:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #ffffff;
  color: #171717;
  font-size: 18px;
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #ffffff;
}

button,
input {
  font: inherit;
}

button,
label,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
.brand:focus-visible {
  outline: 4px solid #f2b84b;
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  width: 1px;
  height: 1px;
  position: absolute;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.shell {
  width: min(100% - 32px, 820px);
  margin: 0 auto;
  padding: 22px 0 56px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 48px;
}

.brand {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #171717;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-logo {
  width: 36px;
  height: 36px;
  display: block;
  flex: 0 0 36px;
}

.listen-toggle {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border: 2px solid #171717;
  border-radius: 999px;
  background: #ffffff;
  color: #171717;
  font-weight: 800;
  cursor: pointer;
}

.listen-toggle[aria-pressed="true"] {
  border-color: #2357b8;
  background: #2357b8;
  color: #ffffff;
}

.start {
  scroll-margin-top: 20px;
}

.eyebrow,
.step-label {
  margin: 0;
  color: #2357b8;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
h5,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 720px;
  margin: 10px 0 0;
  font-size: clamp(2.45rem, 12vw, 4.2rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

h2 {
  margin: 9px 0 0;
  font-size: clamp(1.7rem, 8vw, 2.35rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

h3 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.3;
}

h4 {
  margin: 28px 0 12px;
  font-size: 1.05rem;
}

h5 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.intro,
.section-intro {
  color: #444440;
  line-height: 1.55;
}

.intro {
  max-width: 680px;
  margin: 16px 0 0;
  font-size: 1.08rem;
}

.section-intro {
  margin: 14px 0 0;
}

.choice-grid {
  display: grid;
  gap: 12px;
  margin-top: 30px;
}

.choice-button {
  width: 100%;
  min-height: 82px;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  gap: 15px;
  align-items: center;
  padding: 15px 16px;
  border: 2px solid #222220;
  border-radius: 18px;
  background: #ffffff;
  color: #171717;
  text-align: left;
  cursor: pointer;
}

.choice-button:hover,
.choice-button[aria-pressed="true"] {
  border-color: #2357b8;
  background: #edf3ff;
  box-shadow: inset 5px 0 0 #2357b8;
}

.choice-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #171717;
  color: #ffffff;
  font-size: 1.25rem;
}

.choice-copy strong,
.choice-copy small {
  display: block;
}

.choice-copy strong {
  font-size: 1rem;
  line-height: 1.25;
}

.choice-copy small {
  margin-top: 4px;
  color: #555550;
  font-size: 0.83rem;
  line-height: 1.35;
}

.choice-arrow {
  font-size: 1.7rem;
  line-height: 1;
}

.selection {
  margin-top: 38px;
  padding-top: 32px;
  border-top: 1px solid #d9d9d4;
  scroll-margin-top: 20px;
}

.same-item-note {
  margin: 18px 0 0;
  padding: 15px 16px;
  border-left: 5px solid #f2b84b;
  border-radius: 0 14px 14px 0;
  background: #faf7ef;
  line-height: 1.5;
}

.upload-action,
.primary-action,
.secondary-action,
.text-action {
  min-height: 56px;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  font-weight: 800;
  cursor: pointer;
}

.upload-action,
.primary-action,
.secondary-action {
  display: inline-flex;
  gap: 9px;
  padding: 13px 18px;
}

.upload-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.camera-action {
  display: none;
}

.upload-icon,
.upload-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.upload-icon svg {
  fill: currentColor;
}

.upload-action,
.primary-action {
  border: 2px solid #2357b8;
  background: #2357b8;
  color: #ffffff;
}

.secondary-action {
  border: 2px solid #222220;
  background: #ffffff;
  color: #171717;
}

.text-action {
  min-height: 48px;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: #8b2424;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.upload-action:hover,
.primary-action:hover {
  background: #174798;
}

.secondary-action:hover {
  background: #f4f4f1;
}

.primary-action:disabled,
.secondary-action:disabled,
.text-action:disabled {
  cursor: wait;
  opacity: 0.6;
}

.drop-zone {
  margin-top: 22px;
  padding: 28px 18px;
  border: 2px dashed #7b7b75;
  border-radius: 20px;
  background: #fafaf8;
  text-align: center;
}

.drop-zone[data-dragging="true"] {
  border-color: #2357b8;
  background: #edf3ff;
}

.drop-zone p {
  margin: 0;
}

.desktop-hint {
  padding: 8px 0 16px;
  color: #555550;
  font-size: 0.86rem;
}

.upload-hint {
  padding-top: 14px;
  color: #555550;
  font-size: 0.78rem;
  line-height: 1.45;
}

.image-preview,
.audio-preview {
  margin-top: 26px;
}

.audio-preview {
  padding: 16px;
  border: 1.5px solid #bcbcb6;
  border-radius: 16px;
}

.audio-preview audio {
  width: 100%;
  min-height: 54px;
}

.preview-list {
  display: grid;
  gap: 14px;
  margin: 16px 0 20px;
}

.preview-card {
  min-width: 0;
  padding: 14px;
  border: 1.5px solid #bcbcb6;
  border-radius: 16px;
  background: #ffffff;
}

.preview-card img {
  width: 100%;
  height: 220px;
  display: block;
  object-fit: contain;
  margin-top: 10px;
  border-radius: 10px;
  background: #f4f4f1;
}

.page-label {
  color: #2357b8;
  font-size: 0.95rem;
}

.preview-name {
  overflow-wrap: anywhere;
  font-size: 0.84rem;
  font-weight: 750;
}

.preview-controls,
.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.preview-controls button {
  min-height: 46px;
  padding: 8px 11px;
  border: 1.5px solid #777772;
  border-radius: 12px;
  background: #ffffff;
  color: #171717;
  cursor: pointer;
}

.preview-controls button:disabled {
  cursor: default;
  opacity: 0.45;
}

.file-details {
  overflow-wrap: anywhere;
  font-weight: 750;
}

.upload-status {
  margin-top: 22px;
  padding: 16px;
  border: 2px solid #2357b8;
  border-radius: 14px;
  background: #edf3ff;
  font-weight: 700;
  line-height: 1.5;
}

.upload-status[data-state="error"] {
  border-color: #a52a2a;
  background: #fff1f1;
}

.analysis-result {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid #d9d9d4;
  outline: none;
  scroll-margin-top: 20px;
}

.result-overview {
  padding: 24px;
  border-radius: 22px;
  background: #171717;
  color: #ffffff;
}

.result-overview h2 {
  margin-top: 18px;
  color: #ffffff;
}

.risk-badge {
  width: fit-content;
  margin: 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f2b84b;
  color: #251800;
  font-size: 0.82rem;
  font-weight: 850;
}

[data-risk="low"] .risk-badge {
  background: #3fa66b;
  color: #071a0f;
}

[data-risk="careful"] .risk-badge {
  background: #f2b84b;
  color: #251800;
}

[data-risk="high"] .risk-badge {
  background: #c93434;
  color: #ffffff;
}

.result-summary {
  margin: 14px 0 0;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.55;
}

.next-steps {
  margin-top: 24px;
}

.next-steps ol {
  margin: 12px 0 0;
  padding-left: 24px;
}

.follow-up-question,
.follow-up-result {
  margin-top: 28px;
  padding: 22px;
  border: 2px solid #222220;
  border-radius: 20px;
  background: #ffffff;
  scroll-margin-top: 20px;
}

.follow-up-question h3,
.follow-up-result h3 {
  margin-top: 8px;
}

.follow-up-question > p:not(.step-label),
.follow-up-reassurance {
  margin: 10px 0 0;
  color: #444440;
  line-height: 1.5;
}

.follow-up-options {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.follow-up-button {
  width: 100%;
  min-height: 58px;
  padding: 13px 16px;
  border: 2px solid #2357b8;
  border-radius: 15px;
  background: #ffffff;
  color: #171717;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.follow-up-button:hover,
.follow-up-button:focus-visible {
  background: #edf3ff;
}

.follow-up-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.follow-up-status {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  background: #edf3ff;
  font-weight: 700;
  line-height: 1.45;
}

.follow-up-status[data-state="error"] {
  background: #fff1f1;
  color: #8b2424;
}

.follow-up-result {
  border-color: #2357b8;
  background: #edf3ff;
  outline: none;
}

.follow-up-result ol {
  margin: 16px 0 20px;
  padding-left: 24px;
}

.urgent-note {
  margin: 0 0 18px;
  padding: 14px;
  border-left: 5px solid #c93434;
  border-radius: 0 12px 12px 0;
  background: #fff1f1;
  font-weight: 750;
  line-height: 1.5;
}

.analysis-result li {
  margin-bottom: 11px;
  line-height: 1.5;
}

.full-report-toggle {
  width: 100%;
  margin-top: 18px;
}

.full-report {
  margin-top: 34px;
  padding-top: 30px;
  border-top: 1px solid #d9d9d4;
  outline: none;
  scroll-margin-top: 20px;
}

.full-report > h3 {
  margin-top: 8px;
  font-size: 1.35rem;
}

.warning-list,
.low-concern-reasons-list {
  display: grid;
  gap: 12px;
}

.warning-item,
.low-concern-reason-item {
  padding: 16px;
  border-radius: 0 14px 14px 0;
}

.warning-item {
  border-left: 5px solid #f2b84b;
  background: #faf7ef;
}

.low-concern-reason-item {
  border-left: 5px solid #3fa66b;
  background: #f1faf5;
}

.warning-item p,
.low-concern-reason-item p {
  margin: 6px 0 0;
  line-height: 1.5;
}

.warning-evidence,
.low-concern-reason-evidence {
  font-weight: 750;
}

.result-reminder {
  margin: 24px 0 18px;
  font-weight: 750;
  line-height: 1.5;
}

.privacy-note {
  display: flex;
  gap: 13px;
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid #d9d9d4;
  color: #444440;
  font-size: 0.84rem;
  line-height: 1.5;
}

.privacy-note strong {
  display: block;
  color: #171717;
}

.privacy-icon {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #171717;
  color: #ffffff;
  font-weight: 800;
}

@media (max-width: 479px) {
  .shell {
    width: min(100% - 28px, 820px);
    padding-top: 16px;
  }

  .app-header {
    margin-bottom: 40px;
  }

  .brand {
    font-size: 0.9rem;
  }

  .listen-toggle {
    padding: 0 13px;
    font-size: 0.88rem;
  }

  .choice-button {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 14px;
  }

  .choice-icon {
    width: 46px;
    height: 46px;
  }

  .preview-actions > *,
  .full-report .secondary-action {
    width: 100%;
  }

  .result-overview {
    padding: 21px 19px;
  }
}

@media (min-width: 620px) {
  .shell {
    padding-top: 30px;
  }

  .preview-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (hover: none) and (pointer: coarse) {
  .upload-options {
    flex-direction: column;
    align-items: stretch;
  }

  .upload-options .upload-action {
    width: 100%;
  }

  .camera-action {
    display: inline-flex;
  }

  .device-action {
    border-color: #222220;
    background: #ffffff;
    color: #171717;
  }

  .device-action:hover {
    background: #f4f4f1;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
