/* Pill Identifier for India. Base styles shared with ClearLab AI, CleanBites and Prescription Record
   (copied so each tool stands alone), plus the pill identifier styles at the end. */
:root {
  --bg: #f7f3ec;
  --bg-elev: #fdfbf6;
  --surface: #fff;
  --ink: #1a1714;
  --ink-soft: #3e3933;
  --ink-muted: #655e55;
  --line: #e6ddcf;
  --line-strong: #d6ccbb;
  --accent: #c96442;
  --accent-deep: #a64d2e;
  --accent-ink: #8d3d24;
  --accent-soft: #f4e2d8;
  --mint: #d8e6d5;
  --mint-ink: #2d5c3d;
  --butter: #f4e5b8;
  --butter-ink: #6b4e0f;
  --rose: #f0d4cb;
  --font-sans: "Inter Tight", "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;
  --nav-h: 64px;
  --shadow: 0 1px 2px rgba(26, 23, 20, .04), 0 12px 40px rgba(26, 23, 20, .08);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--font-sans);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -.025em; line-height: 1.1; text-wrap: balance; }
p { margin: 0; color: var(--ink-soft); text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
section[id], #upload { scroll-margin-top: calc(var(--nav-h) + 16px); }

.shell { width: min(100% - 48px, 1200px); margin-inline: auto; }
.skip-link { position: fixed; z-index: 70; top: 8px; left: 8px; padding: 10px 14px; background: var(--ink); color: #fff; border-radius: var(--r-sm); transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.label {
  display: inline-block;
  color: var(--accent-deep);
  font: 500 12px/1.4 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 500;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .1s ease;
}
.button:active { transform: scale(.98); }
.button-primary { background: var(--ink); color: var(--bg); }
.button-primary:hover { background: var(--accent-deep); color: #fff; }
.button-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.button-ghost:hover { border-color: var(--ink); background: var(--bg-elev); }
.small-button {
  min-height: 38px;
  padding: 7px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
}
.small-button:hover { border-color: var(--ink); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { height: var(--nav-h); display: flex; align-items: center; gap: 16px; }
.header-brands, .header-tools { display: flex; align-items: center; gap: 12px; min-width: 0; }
.header-tools { margin-left: auto; }
.nc-wordmark, .tool-wordmark { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; line-height: 1; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.nc-wordmark img { display: block; width: 30px; height: 30px; border-radius: 8px; }
.tool-wordmark img { display: block; width: 26px; height: 26px; }
.nc-wordmark em, .tool-wordmark em { color: var(--accent); font-style: normal; font-weight: 400; }
.brand-divider { width: 1px; height: 24px; background: var(--line-strong); }
.header-nav { display: flex; gap: 2px; margin-left: auto; }
.header-nav a { padding: 8px 12px; border-radius: var(--r-pill); color: var(--ink-soft); font-size: 14px; font-weight: 500; white-space: nowrap; }
.header-nav a:hover { background: color-mix(in oklab, var(--ink) 6%, transparent); color: var(--ink); }
.header-action { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 16px; border-radius: var(--r-pill); background: var(--ink); color: var(--bg); font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.header-action:hover { background: var(--accent-deep); color: #fff; }
.header-tools .header-action { margin-left: 4px; }
.header-menu { display: none; position: relative; }
.header-menu summary { display: grid; place-items: center; width: 44px; height: 44px; list-style: none; border: 1px solid var(--line-strong); border-radius: var(--r-sm); cursor: pointer; }
.header-menu summary::-webkit-details-marker { display: none; }
.header-menu summary svg { width: 20px; height: 20px; }
.header-menu .close-icon, .header-menu[open] .menu-icon { display: none; }
.header-menu[open] .close-icon { display: block; }
.header-menu[open] summary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.header-menu nav { position: absolute; top: calc(100% + 10px); right: 0; display: flex; flex-direction: column; gap: 2px; width: min(300px, calc(100vw - 32px)); padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); }
.header-menu nav a { display: flex; align-items: center; min-height: 44px; padding: 9px 12px; border-radius: var(--r-sm); color: var(--ink-soft); font-size: 15px; }
.header-menu nav a:hover { background: var(--bg-elev); color: var(--ink); }

/* Hero: copy on the left, the upload card on the right */
.hero {
  padding: 56px 0 88px;
  background:
    radial-gradient(800px 380px at 90% -10%, color-mix(in oklab, var(--accent-soft) 75%, transparent), transparent 70%),
    linear-gradient(180deg, var(--bg-elev), var(--bg) 70%);
  border-bottom: 1px solid var(--line);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 64px; align-items: start; }
.hero-copy { padding-top: 28px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px; color: var(--ink-muted); font: 400 12px/1.4 var(--font-mono); letter-spacing: .05em; text-transform: uppercase; }
.crumbs a:hover { color: var(--accent-deep); }
.hero h1 { margin: 16px 0 24px; font-size: clamp(44px, 5.6vw, 74px); line-height: 1.02; letter-spacing: -.035em; max-width: 13ch; }
.hero h1 em { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; color: var(--accent-deep); }
.lede { max-width: 52ch; font-size: clamp(17px, 1.45vw, 19px); line-height: 1.55; }
.lede-small { margin-top: 14px; font-size: 16px; color: var(--ink-muted); }
.facts { display: grid; gap: 10px; margin: 32px 0 0; padding: 24px 0 0; list-style: none; border-top: 1px solid var(--line); }
.facts li { position: relative; padding-left: 28px; color: var(--ink-soft); font-size: 15px; }
.facts li::before { content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--mint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2 7 10.5l4.5-5' fill='none' stroke='%232d5c3d' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; }
.facts strong { color: var(--ink); font-weight: 600; }

.upload-card { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.upload-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.upload-card-head h2 { font-size: 22px; letter-spacing: -.02em; }
.pill { padding: 4px 10px; border-radius: var(--r-pill); background: var(--bg); color: var(--ink-muted); font: 500 11px/1.4 var(--font-mono); letter-spacing: .04em; white-space: nowrap; }
.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 176px;
  padding: 20px;
  text-align: center;
  background: var(--bg-elev);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}
.dropzone:hover, .dropzone.drag-over { background: var(--accent-soft); border-color: var(--accent); }
.dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.drop-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 8px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--accent-deep); }
.dropzone strong { font-size: 16px; font-weight: 600; }
.dropzone > span:last-child { color: var(--ink-muted); font-size: 14px; }
.upload-message { min-height: 22px; margin-top: 12px; color: var(--ink-soft); font-size: 14px; font-weight: 500; }
.upload-message.error { color: #a3341b; }
.privacy-note { display: flex; gap: 8px; margin: 6px 0 16px; color: var(--ink-muted); font-size: 13px; line-height: 1.5; }
.privacy-note svg { flex: 0 0 15px; margin-top: 2px; color: var(--mint-ink); }
.consent { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-elev); color: var(--ink-soft); font-size: 13px; line-height: 1.5; cursor: pointer; }
.consent input { flex: 0 0 18px; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent-deep); }
.analyze-btn { width: 100%; margin-top: 14px; }
.analyze-btn:disabled, .analyze-btn:disabled:hover { background: var(--line); color: var(--ink-muted); cursor: not-allowed; transform: none; }
.divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--ink-muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.button-ghost { width: 100%; }
.fine-print { margin-top: 14px; color: var(--ink-muted); font-size: 12.5px; line-height: 1.5; }

/* Section scaffolding */
.report-section, .markers-section, .how-section, .guides-section, .faq-section { padding: 96px 0; }
.guides-section { background: var(--bg-elev); border-top: 1px solid var(--line); }
.inline-link { color: var(--accent-deep); font-weight: 500; white-space: nowrap; }
.inline-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 48px; margin-bottom: 40px; }
.section-head h2 { margin-top: 12px; font-size: clamp(32px, 4vw, 50px); line-height: 1.05; max-width: 18ch; }
.section-head > p { max-width: 44ch; font-size: 17px; line-height: 1.55; }

/* Readout */
.disclaimer { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; padding: 14px 18px; color: #4a3a12; background: #f8efda; border: 1px solid #e3d19c; border-radius: var(--r-sm); }
.disclaimer svg { flex: 0 0 20px; margin-top: 2px; }
.disclaimer p { color: inherit; font-size: 14px; line-height: 1.55; }
.disclaimer strong { font-weight: 600; }

.report-app { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 1px 2px rgba(26, 23, 20, .04); }
.report-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 24px 32px; border-bottom: 1px solid var(--line); }
.report-toolbar h3 { margin: 6px 0 4px; font-size: 22px; }
.report-toolbar p { font-size: 14px; color: var(--ink-muted); }
.report-toolbar-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.summary-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--bg-elev); border-bottom: 1px solid var(--line); }
.summary-item { padding: 18px 32px; border-right: 1px solid var(--line); }
.summary-item:last-child { border-right: 0; }
.summary-item strong { display: block; font-size: 28px; font-weight: 500; letter-spacing: -.03em; line-height: 1.1; }
.summary-item span { color: var(--ink-muted); font-size: 13px; }
.summary-item.attention strong { color: var(--accent-deep); }
.report-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.report-aside { padding: 24px 16px; background: var(--bg-elev); border-right: 1px solid var(--line); }
.report-aside h4 { margin: 0 0 10px; padding: 0 12px; color: var(--ink-muted); font: 500 11px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.category-button { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 10px 12px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink-soft); font-size: 14px; font-weight: 500; text-align: left; }
.category-button span { color: var(--ink-muted); font: 400 12px var(--font-mono); }
.category-button:hover { background: var(--surface); color: var(--ink); }
.category-button.active { background: var(--surface); color: var(--ink); box-shadow: inset 3px 0 var(--accent); }
.aside-help { margin: 24px 12px 0; padding-top: 20px; border-top: 1px solid var(--line); }
.aside-help strong { font-size: 13px; font-weight: 600; }
.aside-help p { margin-top: 6px; color: var(--ink-muted); font-size: 13px; line-height: 1.5; }
.report-main { min-width: 0; padding: 20px 32px 28px; }
.result-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.filter-group { display: flex; gap: 4px; }
.filter { min-height: 36px; padding: 6px 14px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink-soft); font-size: 13px; font-weight: 500; }
.filter:hover { background: var(--bg-elev); }
.filter.active { background: var(--ink); color: var(--bg); }
.result-bar > span { color: var(--ink-muted); font-size: 13px; }

.result-row { padding: 28px 0; border-bottom: 1px solid var(--line); }
.result-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.result-identity { min-width: 0; }
.result-title { font-size: 20px; font-weight: 500; }
.result-plain { margin-top: 4px; color: var(--ink-muted); font-size: 14px; }
.badge { flex: 0 0 auto; padding: 5px 11px; border-radius: var(--r-pill); font: 500 11px/1.4 var(--font-mono); letter-spacing: .02em; white-space: nowrap; }
.badge.in-range { background: var(--mint); color: var(--mint-ink); }
.badge.out-of-range { background: var(--butter); color: var(--butter-ink); }
.badge.unverified { background: var(--bg); color: var(--ink-soft); border: 1px solid var(--line); }
.result-measure { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); margin-top: 16px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.result-measure > div { min-width: 0; padding: 12px 16px; }
.result-measure > div + div { border-left: 1px solid var(--line); }
.result-kicker { display: block; margin-bottom: 4px; color: var(--ink-muted); font: 500 10.5px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.result-value { display: block; font-size: 30px; font-weight: 500; letter-spacing: -.03em; line-height: 1.15; }
.result-value small { color: var(--ink-muted); font-size: 14px; font-weight: 400; letter-spacing: 0; white-space: nowrap; }
.result-range { display: block; font-size: 15px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }

/* Where the value sits against the lab's range */
.range-meter { position: relative; height: 8px; margin: 18px 0 6px; border-radius: var(--r-pill); background: var(--rose); }
.range-meter .band { position: absolute; top: 0; bottom: 0; background: var(--mint); }
.range-meter .marker { position: absolute; top: 50%; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--ink); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--ink); transform: translateY(-50%); }
.range-meter.out .marker { background: var(--accent-deep); box-shadow: 0 0 0 1px var(--accent-deep); }
.range-scale { position: relative; height: 16px; color: var(--mint-ink); font: 500 11px/16px var(--font-mono); }
.range-scale span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }

.result-explanation { margin-top: 12px; color: var(--ink-soft); font-size: 14px; }
.result-questions { margin-top: 14px; padding: 12px 16px; background: var(--bg-elev); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r-sm); }
.result-questions strong { display: block; color: var(--accent-deep); font: 500 11px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.result-questions p { margin-top: 4px; color: var(--ink); font-size: 15px; line-height: 1.5; }
.result-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 12px; color: var(--ink-muted); font-size: 12.5px; }
.result-foot a { color: var(--accent-deep); font-weight: 500; white-space: nowrap; }
.result-foot a:hover { text-decoration: underline; text-underline-offset: 3px; }

.report-empty { padding: 28px 0; }
.report-empty p { margin-top: 4px; font-size: 14px; }
.add-result { width: 100%; min-height: 44px; margin-top: 18px; padding: 10px; border: 1px dashed var(--line-strong); border-radius: var(--r-sm); background: transparent; color: var(--accent-deep); font-size: 14px; font-weight: 500; }
.add-result:hover { border-color: var(--accent); background: var(--accent-soft); }
.manual-entry { margin-top: 20px; padding: 20px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-md); }
.manual-entry h4 { font-size: 17px; }
.manual-entry > p { margin: 4px 0 16px; font-size: 14px; color: var(--ink-muted); }
.manual-entry form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.manual-entry label { display: grid; gap: 4px; color: var(--ink-soft); font-size: 12px; font-weight: 500; }
.manual-entry input, .manual-entry select { width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); font-size: 15px; }
.manual-entry .button { align-self: end; min-height: 42px; }

.doctor-questions { padding: 32px; background: var(--bg-elev); border-top: 1px solid var(--line); }
.doctor-questions-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.doctor-questions h3 { margin-top: 6px; font-size: 24px; }
.doctor-questions-heading p { max-width: 36ch; font-size: 14px; color: var(--ink-muted); }
.doctor-questions ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 20px 0 0; padding: 0; list-style: none; counter-reset: q; }
.doctor-questions li { min-width: 0; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); counter-increment: q; }
.doctor-questions li::before { content: counter(q, decimal-leading-zero); display: block; margin-bottom: 12px; color: var(--accent-deep); font: 500 11px var(--font-mono); }
.doctor-questions li strong { display: block; margin-bottom: 4px; font-size: 14px; font-weight: 600; }
.doctor-questions li span { display: block; color: var(--ink-soft); font-size: 14px; line-height: 1.5; }
.report-caption { margin-top: 14px; color: var(--ink-muted); font-size: 13px; }

/* What it reads */
.markers-section { background: var(--bg-elev); border-block: 1px solid var(--line); }
.markers-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.marker-card { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.marker-card h3 { margin-bottom: 14px; font-size: 19px; }
.marker-card ul { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.marker-card li a { display: inline-block; color: var(--ink); font-weight: 600; font-size: 15px; border-bottom: 1px solid var(--line-strong); }
.marker-card li a::after { content: " ↗"; color: var(--ink-muted); font-weight: 400; font-size: 12px; }
.marker-card li a:hover { color: var(--accent-deep); border-color: var(--accent); }
.marker-card li span { display: block; margin-top: 2px; color: var(--ink-muted); font-size: 13.5px; line-height: 1.45; }
.marker-card-limits { background: transparent; border-style: dashed; border-color: var(--line-strong); }
.plain-list li { position: relative; padding-left: 20px; color: var(--ink-soft); font-size: 14.5px; line-height: 1.45; }
.plain-list li::before { content: "×"; position: absolute; left: 0; top: -1px; color: var(--accent-deep); font-weight: 600; }

/* How it works */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin: 0; padding: 0; list-style: none; }
.steps li { padding-top: 20px; border-top: 1px solid var(--ink); }
.step-num { color: var(--accent-deep); font: 500 13px var(--font-mono); }
.steps h3 { margin: 28px 0 10px; font-size: 21px; }
.steps p { font-size: 15.5px; max-width: 34ch; }

/* FAQ */
.faq-section { border-top: 1px solid var(--line); }
.faq-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 64px; align-items: start; }
.faq-grid h2 { margin-top: 12px; font-size: clamp(32px, 4vw, 50px); line-height: 1.05; }
.faq-intro { margin-top: 18px; font-size: 16px; }
.faq-intro a { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; }
.faq-list { border-top: 1px solid var(--line-strong); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { position: relative; display: block; padding: 22px 44px 22px 0; font-size: 18px; font-weight: 500; letter-spacing: -.01em; cursor: pointer; list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: ""; position: absolute; right: 4px; top: 50%; width: 22px; height: 22px; margin-top: -11px; border: 1px solid var(--line-strong); border-radius: 50%; background: linear-gradient(var(--ink), var(--ink)) center/10px 1.5px no-repeat, linear-gradient(var(--ink), var(--ink)) center/1.5px 10px no-repeat; transition: transform .2s ease; }
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list summary:hover { color: var(--accent-deep); }
.faq-list details p { max-width: 62ch; padding: 0 44px 22px 0; font-size: 16px; line-height: 1.6; }

/* Footer */
.footer { padding-top: 64px; background: var(--bg-elev); border-top: 1px solid var(--line); }
.footer-top { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 1.8fr); gap: 64px; padding-bottom: 48px; }
.footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.footer-brand > strong { margin-top: 10px; font-size: 20px; font-weight: 500; letter-spacing: -.02em; }
.footer-brand p { max-width: 38ch; font-size: 14px; }
.footer-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.footer-links > div { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.footer-links h2 { margin-bottom: 4px; color: var(--ink-muted); font: 500 11px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.footer-links a { color: var(--ink-soft); font-size: 14px; }
.footer-links a:hover { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; }
.footer-note { padding: 16px 0; border-block: 1px solid var(--line); font-size: 13px; line-height: 1.55; }
.footer-note strong { color: var(--ink); font-weight: 600; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; padding: 20px 0 32px; color: var(--ink-muted); font-size: 12.5px; }

/* Tablet */
@media (max-width: 1100px) {
  .header-nav { display: none; }
  .header-menu { display: block; }
}
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hero-copy { padding-top: 0; }
  .crumbs { margin-bottom: 28px; }
  .hero h1 { max-width: 15ch; }
  .upload-card { max-width: 620px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 16px; }
  .report-layout { grid-template-columns: minmax(0, 1fr); }
  .report-aside { padding: 16px 0 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .report-aside h4 { padding: 0 24px; }
  #category-list { display: flex; gap: 6px; overflow-x: auto; padding: 0 24px 8px; scrollbar-width: none; }
  #category-list::-webkit-scrollbar { display: none; }
  .category-button { flex: 0 0 auto; width: auto; gap: 10px; min-height: 40px; border: 1px solid var(--line); white-space: nowrap; }
  .category-button.active { background: var(--ink); border-color: var(--ink); color: var(--bg); box-shadow: none; }
  .category-button.active span { color: inherit; }
  .aside-help { display: none; }
  .markers-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { gap: 24px; }
  .faq-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .footer-top { grid-template-columns: minmax(0, 1fr); gap: 40px; }
}

/* Phone */
@media (max-width: 640px) {
  :root { --nav-h: 60px; }
  .shell { width: calc(100% - 32px); }
  .header-action { display: none; }
  .nc-wordmark { font-size: 15px; }
  .tool-wordmark { font-size: 16px; }
  .tool-wordmark img { display: none; }
  .header-brands { gap: 10px; }
  .hero { padding: 32px 0 48px; }
  .crumbs { margin-bottom: 20px; }
  .hero h1 { margin: 12px 0 16px; font-size: clamp(38px, 11vw, 50px); }
  .lede { font-size: 16.5px; }
  .lede-small { display: none; }
  .facts { margin-top: 22px; padding-top: 18px; }
  .upload-card { padding: 16px; border-radius: var(--r-md); }
  .upload-card-head h2 { font-size: 19px; }
  .dropzone { min-height: 150px; }
  .report-section, .markers-section, .how-section, .guides-section, .faq-section { padding: 56px 0; }
  .section-head { margin-bottom: 28px; }
  .section-head > p { font-size: 16px; }
  .disclaimer { padding: 12px 14px; }
  .disclaimer p { font-size: 13px; }
  .report-toolbar { flex-direction: column; align-items: stretch; gap: 14px; padding: 18px 16px; }
  .report-toolbar h3 { font-size: 19px; }
  .report-toolbar-actions .small-button { flex: 1; min-height: 44px; }
  .summary-item { padding: 14px 12px; }
  .summary-item strong { font-size: 23px; }
  .summary-item span { display: block; font-size: 11.5px; line-height: 1.3; }
  .report-aside h4 { padding: 0 16px; }
  #category-list { padding: 0 16px 8px; }
  .category-button { min-height: 44px; }
  .report-main { padding: 14px 16px 20px; }
  .result-bar { flex-wrap: wrap; }
  .filter { min-height: 44px; }
  .result-row { padding: 22px 0; }
  .result-head { flex-direction: column; gap: 8px; }
  .result-title { font-size: 18px; }
  .result-measure { grid-template-columns: minmax(0, 1fr); }
  .result-measure > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .result-value { font-size: 26px; }
  .result-foot { flex-direction: column; gap: 6px; }
  .manual-entry { padding: 16px; }
  .manual-entry form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manual-entry label:first-child, .manual-entry .button { grid-column: 1 / -1; }
  .manual-entry input, .manual-entry select { min-height: 44px; font-size: 16px; }
  .doctor-questions { padding: 22px 16px; }
  .doctor-questions-heading { flex-direction: column; align-items: flex-start; gap: 8px; }
  .doctor-questions h3 { font-size: 21px; }
  .doctor-questions ol { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .markers-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .marker-card { padding: 20px; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .steps h3 { margin: 14px 0 8px; }
  .faq-list summary { font-size: 16.5px; padding: 18px 40px 18px 0; }
  .faq-list details p { padding-right: 0; font-size: 15px; }
  .footer { padding-top: 48px; }
  .footer-links { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 32px; }
}
@media (max-width: 400px) {
  .nc-wordmark span { display: none; }
}

@media print {
  .site-header, .hero, .markers-section, .how-section, .faq-section, .footer,
  .filter-group, .small-button, .add-result, .manual-entry, .report-aside, .skip-link { display: none !important; }
  body { background: #fff; }
  .report-section { padding: 0; }
  .report-app { border: 0; box-shadow: none; }
  .report-layout { display: block; }
  .result-row { break-inside: avoid; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Pill identifier: upload, editor and card (editor styles shared with Prescription Record) ---------- */
.input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 10px; }
.progress { height: 4px; margin-top: 10px; border-radius: var(--r-pill); background: var(--line); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s ease; }
.preview-img { display: block; max-width: 100%; max-height: 180px; margin: 12px auto 0; border-radius: var(--r-sm); border: 1px solid var(--line); }

.editor { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 24px; align-items: start; }
.panel { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel h3 { font-size: 20px; margin-bottom: 4px; }
.panel > p { color: var(--ink-muted); font-size: 14px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.field-grid .wide { grid-column: 1 / -1; }
.field-grid label, .med-row label { display: grid; gap: 4px; color: var(--ink-soft); font-size: 12px; font-weight: 500; }
.field-grid input, .field-grid textarea, .med-row input, .med-row select { width: 100%; min-height: 40px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); font-size: 15px; }
.field-grid textarea { min-height: 64px; resize: vertical; }
.field-grid input:focus, .field-grid textarea:focus, .med-row input:focus, .med-row select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.panel h4 { margin: 24px 0 8px; color: var(--ink-muted); font: 500 11px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.med-list { display: grid; gap: 12px; }
.med-row { position: relative; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-elev); }
.med-row .span2 { grid-column: span 2; }
.med-row .full { grid-column: 1 / -1; }
.med-plain { grid-column: 1 / -1; color: var(--ink); font-size: 14px; }
.med-plain b { color: var(--accent-deep); font: 500 10.5px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; margin-right: 6px; }
.med-remove { position: absolute; top: 6px; right: 8px; border: 0; background: transparent; color: var(--ink-muted); font-size: 18px; line-height: 1; padding: 4px; }
.med-remove:hover { color: var(--accent-deep); }
.add-med { width: 100%; min-height: 44px; margin-top: 12px; border: 1px dashed var(--line-strong); border-radius: var(--r-sm); background: transparent; color: var(--accent-deep); font-size: 14px; font-weight: 500; }
.add-med:hover { border-color: var(--accent); background: var(--accent-soft); }
.raw-text { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-elev); }
.raw-text summary { padding: 10px 14px; font-size: 13.5px; font-weight: 500; cursor: pointer; }
.raw-text textarea { display: block; width: 100%; min-height: 140px; padding: 12px 14px; border: 0; border-top: 1px solid var(--line); background: var(--surface); font: 13px/1.55 var(--font-mono); resize: vertical; }
.raw-actions { display: flex; justify-content: flex-end; padding: 8px 14px; border-top: 1px solid var(--line); }

.sheet-wrap { position: sticky; top: calc(var(--nav-h) + 16px); display: grid; gap: 14px; }
.sheet { position: relative; overflow: hidden; padding: 28px 26px; background: #fff; color: #1a1714; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); font-size: 14px; }
.sheet-band { margin: -28px -26px 20px; padding: 10px 26px; background: #f8efda; color: #4a3a12; font: 600 11.5px/1.45 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; border-bottom: 1px solid #e3d19c; }
.sheet h3 { font-size: 19px; margin-bottom: 2px; }
.sheet .sub { color: #655e55; font-size: 13px; }
.sheet dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 16px 0; font-size: 13.5px; }
.sheet dt { color: #655e55; }
.sheet dd { margin: 0; }
.sheet table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.sheet th, .sheet td { padding: 8px 6px; border-bottom: 1px solid #e6ddcf; text-align: left; vertical-align: top; }
.sheet th { color: #655e55; font: 500 10px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.sheet td small { display: block; color: #3e3933; }
.sheet .sheet-note { margin-top: 14px; color: #3e3933; font-size: 13px; }
.sheet .sheet-foot { margin-top: 18px; padding-top: 10px; border-top: 1px solid #e6ddcf; color: #655e55; font-size: 11.5px; }
.sheet img { display: block; max-width: 100%; margin-top: 16px; border: 1px solid #e6ddcf; border-radius: 6px; }
.sheet-empty { color: #655e55; font-size: 13.5px; }
.export-card { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.export-card .consent { margin-bottom: 12px; }
.export-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.export-actions .button { min-height: 44px; width: 100%; font-size: 14px; }
.export-actions .button:disabled { background: var(--line); color: var(--ink-muted); border-color: var(--line); cursor: not-allowed; }
.export-card .fine-print { margin-top: 10px; }
.check-row { display: flex; gap: 8px; align-items: center; margin: 0 0 10px; color: var(--ink-soft); font-size: 13px; }
.check-row input { width: 16px; height: 16px; accent-color: var(--accent-deep); }

.abbr-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.abbr-table th, .abbr-table td { padding: 11px 16px; border-bottom: 1px solid var(--line); text-align: left; font-size: 15px; }
.abbr-table th { color: var(--ink-muted); font: 500 11px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; background: var(--bg-elev); }
.abbr-table td:first-child { font: 500 14px var(--font-mono); color: var(--accent-deep); white-space: nowrap; }
.abbr-wrap { overflow-x: auto; }

@media (max-width: 960px) {
  .editor { grid-template-columns: minmax(0, 1fr); }
  .sheet-wrap { position: static; }
}
@media (max-width: 640px) {
  .panel { padding: 16px; }
  .field-grid { grid-template-columns: minmax(0, 1fr); }
  .med-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .med-row .span2, .med-row > label:first-of-type { grid-column: 1 / -1; }
  .field-grid input, .field-grid textarea, .med-row input, .med-row select { min-height: 44px; font-size: 16px; }
  .sheet { padding: 22px 16px; }
  .sheet-band { margin: -22px -16px 16px; padding: 10px 16px; }
  .export-actions { grid-template-columns: minmax(0, 1fr); }
}

/* Mode switcher in the upload card */
.mode-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin-bottom: 16px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); }
.mode-tabs button { min-height: 44px; padding: 6px 8px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-soft); font: 500 13.5px/1.2 var(--font-sans); cursor: pointer; }
.mode-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(26, 23, 20, .08); }
.mode-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mode-panel[hidden] { display: none; }
.mode-intro { margin-bottom: 12px; color: var(--ink-soft); font-size: 14px; }
.paste-box { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-elev); }
.paste-box summary { padding: 10px 14px; font-size: 13.5px; font-weight: 500; cursor: pointer; }
.paste-box textarea { display: block; width: 100%; min-height: 96px; padding: 10px 14px; border: 0; border-top: 1px solid var(--line); background: var(--surface); font: 13px/1.5 var(--font-mono); resize: vertical; }
.paste-box .small-button:disabled { opacity: .5; cursor: not-allowed; }
.loose-teaser { padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-elev); font-size: 14.5px; color: var(--ink-soft); }
.loose-teaser strong { display: block; margin-bottom: 6px; color: var(--ink); font-size: 16px; }
.loose-teaser .button { margin-top: 14px; width: 100%; }
.card-actions { display: grid; gap: 8px; margin-top: 14px; }

/* Medicine card */
.flag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.flag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--r-pill); font: 600 11.5px/1.3 var(--font-mono); letter-spacing: .03em; text-transform: uppercase; background: #efe9df; color: #3e3933; }
.flag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.flag.ok { background: #d8e6d5; color: #2d5c3d; }
.flag.warn { background: #f4e5b8; color: #6b4e0f; }
.flag.bad { background: #f0d4cb; color: #8d2a14; }
.flag.rx { background: #fbe0dc; color: #a3241b; }
.sheet .generic { margin: 0 0 2px; font-size: 21px; font-weight: 600; letter-spacing: -.015em; }
.sheet .brand { color: #3e3933; font-size: 14px; }
.sheet .next { margin: 16px 0 0; padding: 14px 16px; border-radius: 10px; background: #f7f3ec; font-size: 13px; }
.sheet .next h4 { margin: 0 0 6px; font: 600 10.5px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: #655e55; }
.sheet .next ul { margin: 0; padding-left: 18px; }
.sheet .next li + li { margin-top: 4px; }
.link-box { margin-top: 14px; padding: 12px 14px; border: 1px dashed #d6ccbb; border-radius: 10px; font-size: 13px; overflow-wrap: anywhere; }
.link-box code { display: block; margin: 4px 0 8px; font: 12.5px/1.45 var(--font-mono); color: #1a1714; }
.link-box a { color: #a64d2e; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.field-grid select { width: 100%; min-height: 40px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); font-size: 15px; }

/* Loose pill note */
.loose-section { padding: 96px 0; background: var(--bg-elev); border-top: 1px solid var(--line); }
.emergency { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; margin-bottom: 20px; padding: 16px 18px; background: #fbe6e0; border: 1px solid #ecc3b6; border-radius: var(--r-md); color: #4d1f12; }
.emergency svg { margin-top: 2px; color: #a3341b; }
.emergency p { color: inherit; font-size: 15px; }
.emergency strong { color: #2a0f07; }
.emergency a { font-weight: 700; color: #8d2a14; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.emergency.loud { outline: 3px solid #c0391f; outline-offset: 2px; }
.fieldset { margin: 18px 0 0; padding: 0; border: 0; min-width: 0; }
.fieldset legend { margin-bottom: 8px; padding: 0; color: var(--ink-soft); font-size: 12px; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface); font-size: 14px; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip:has(input:checked) { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.swatch { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(26, 23, 20, .25); }
.chip svg { width: 22px; height: 16px; flex: 0 0 22px; }
.photo-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }
.sheet .stop-band { background: #fbe6e0; color: #6b1e0d; border-bottom-color: #ecc3b6; }

/* Where to look on a strip */
.strip-section { padding: 96px 0; border-top: 1px solid var(--line); }
.strip-figure { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 32px; align-items: start; margin: 0; }
.strip-figure svg { display: block; width: 100%; height: auto; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
.strip-legend { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: leg; }
.strip-legend li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; font-size: 15px; color: var(--ink-soft); }
.strip-legend li::before { counter-increment: leg; content: counter(leg); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-deep); color: #fff; font: 600 12px var(--font-mono); }
.strip-legend strong { color: var(--ink); font-weight: 600; }
.strip-figure figcaption { grid-column: 1 / -1; color: var(--ink-muted); font: 400 12px/1.5 var(--font-mono); }

/* Why there is no colour-and-shape search */
.why-section { padding: 96px 0; background: var(--bg-elev); border-top: 1px solid var(--line); }
.why-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.why-card { padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.why-card h3 { margin-bottom: 8px; font-size: 18px; letter-spacing: -.015em; }
.why-card p { font-size: 15px; }
.why-card a, .sources a, .abbr-note a { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; }
.abbr-note { margin-top: 14px; color: var(--ink-muted); font-size: 14px; }
.sources { margin-top: 32px; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.sources h3 { margin-bottom: 10px; color: var(--ink-muted); font: 500 11px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.sources ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; color: var(--ink-soft); }

@media (max-width: 960px) {
  .strip-figure { grid-template-columns: minmax(0, 1fr); }
  .why-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .loose-section, .strip-section, .why-section { padding: 56px 0; }
  .mode-tabs button { font-size: 12.5px; padding: 6px 4px; }
  .field-grid select { min-height: 44px; font-size: 16px; }
  .chip { min-height: 44px; }
  .emergency { grid-template-columns: minmax(0, 1fr); }
  .emergency svg { display: none; }
}
@media print {
  @page { margin: 14mm; }
  body * { visibility: hidden !important; }
  body.print-card #med-sheet, body.print-card #med-sheet *,
  body.print-note #note-sheet, body.print-note #note-sheet * { visibility: visible !important; }
  body.print-card #med-sheet, body.print-note #note-sheet { position: absolute; inset: 0 auto auto 0; width: 100%; border: 0; box-shadow: none; }
  .sheet-band, .flag, .sheet .next { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
