/* Labologics: editorial clinical style.
   Navy, paper and teal, with serif italic accents. The hero's microscope view is the one
   bold element; everything else stays calm. Use logical properties so Urdu mirrors. */

:root {
  color-scheme: light;
  --paper: #F6F5F1;
  --card: #FFFFFF;
  --ink: #12161C;
  --muted: #545D69;
  --line: #E2E0D8;
  --teal: #0D9488;
  --teal-ink: #0B6F66;
  --teal-soft: #E3F3F1;
  --navy: #0F1B2A;
  --navy-2: #172638;
  --on-navy: #E9EEF2;
  --on-navy-muted: #A9B8C6;
  --mint: #7FE0D4;
  --warn: #9A3412;
  --warn-soft: #FDF0E7;
  --danger: #B91C1C;
  --danger-soft: #FDECEC;
  --btn-bg: #0B6F66;
  --btn-ink: #FFFFFF;
  --status-low: #F6C177;
  --status-ok: #7FE0D4;
  --status-high: #F58CA6;
  --radius: 14px;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --body-font: var(--sans);
  --body-leading: 1.6;
}

/* Dark mode. The second block has the same values and lets us test dark on any computer. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0E1218;
    --card: #151B23;
    --ink: #E8ECEF;
    --muted: #9AA5B1;
    --line: #26303B;
    --teal: #2DBFAF;
    --teal-ink: #5FD3C5;
    --teal-soft: #12302D;
    --navy: #0A121C;
    --navy-2: #111C29;
    --warn: #F4A26B;
    --warn-soft: #2B1C12;
    --danger: #F28B8B;
    --danger-soft: #2E1515;
    --btn-bg: #7FE0D4;
    --btn-ink: #0F1B2A;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0E1218;
  --card: #151B23;
  --ink: #E8ECEF;
  --muted: #9AA5B1;
  --line: #26303B;
  --teal: #2DBFAF;
  --teal-ink: #5FD3C5;
  --teal-soft: #12302D;
  --navy: #0A121C;
  --navy-2: #111C29;
  --warn: #F4A26B;
  --warn-soft: #2B1C12;
  --danger: #F28B8B;
  --danger-soft: #2E1515;
  --btn-bg: #7FE0D4;
  --btn-ink: #0F1B2A;
}

/* Urdu: Nastaliq needs generous line height. */
html[lang="ur"] {
  --body-font: "Noto Nastaliq Urdu", var(--sans);
  --body-leading: 2.15;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body-font);
  font-size: 17px;
  line-height: var(--body-leading);
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--teal-ink); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.12; margin: 0 0 .5em; font-weight: 600; letter-spacing: -0.015em; }
html[lang="ur"] h1, html[lang="ur"] h2, html[lang="ur"] h3 { line-height: 1.9; letter-spacing: 0; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.005em; }
html[lang="ur"] em { font-family: inherit; font-style: normal; color: var(--teal-ink); }
p { margin: 0 0 1em; }

.wrap { width: min(1200px, 100%); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 720px) { .wrap { padding-inline: 32px; } }

.label { font-size: 14px; color: var(--muted); font-weight: 600; margin: 0 0 .75em; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; inset-inline-start: -999px; top: 0; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 10; }
.skip:focus { inset-inline-start: 8px; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }
.hero :focus-visible, .site-header :focus-visible, .topnote :focus-visible, .page-head :focus-visible, .band :focus-visible, .waitlist :focus-visible { outline-color: var(--mint); }

/* ---------- header ---------- */
.topnote { background: var(--navy); color: var(--on-navy-muted); font-size: 13px; text-align: center; padding: 6px 16px; }
.site-header { background: var(--navy); color: var(--on-navy); border-bottom: 1px solid #ffffff14; }
.header-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; padding-block: 8px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; --paper: var(--navy); }
.brand-mark { color: var(--on-navy); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--sans); font-size: 18px; letter-spacing: -0.01em; }
.brand-text small { font-size: 12px; color: var(--on-navy-muted); }
html[lang="ur"] .brand-text small { line-height: 1.8; }
/* Phones: four links in two equal columns. From 480px they fit in one row. */
.main-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; order: 3; width: 100%; }
@media (min-width: 480px) { .main-nav { display: flex; justify-content: space-between; } }
.main-nav a { color: var(--on-navy); text-decoration: none; font-size: 14px; padding: 6px 8px; border-radius: 8px; white-space: nowrap; text-align: center; }
.main-nav a:hover, .main-nav a[aria-current="page"] { background: #ffffff14; }
.lang-switch { order: 2; margin-inline-start: auto; color: var(--on-navy); text-decoration: none; font-size: 14px; padding: 6px 12px; border-radius: 8px; border: 1px solid #ffffff33; }
.lang-switch:hover { background: #ffffff14; }
.lang-switch[lang="ur"] { font-family: "Noto Nastaliq Urdu", var(--sans); line-height: 1.6; }
.lang-switch[lang="en"] { font-family: var(--sans); }
/* Phones: the header scrolls away so it never covers the page. Bigger screens: it sticks. */
@media (min-width: 720px) {
  .site-header { position: sticky; top: 0; z-index: 5; }
}
/* Logo, nav and language button only fit on one row from this width. */
@media (min-width: 820px) {
  .header-row { min-height: 64px; gap: 16px; }
  .main-nav { order: 0; width: auto; margin-inline-start: auto; gap: 4px; }
  .main-nav a { padding: 6px 10px; }
  .lang-switch { order: 0; margin-inline-start: 0; }
}

/* ---------- mobile menu ----------
   Everything that collapses the links needs the "menu-js" class, which only assets/menu.js adds.
   Without JavaScript the button stays hidden and the links stay visible (rules above). */
.menu-toggle { display: none; }
@media (max-width: 719.98px) { .site-header { position: relative; z-index: 5; } }
@media (max-width: 819.98px) {
  html.menu-js .header-row { flex-wrap: nowrap; min-height: 60px; }
  html.menu-js .brand { min-width: 0; }
  html.menu-js .menu-toggle { display: inline-flex; flex: none; order: 3; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; color: var(--on-navy); background: transparent; border: 1px solid #ffffff33; border-radius: 8px; cursor: pointer; }
  html.menu-js .menu-toggle:hover { background: #ffffff14; }
  html.menu-js .menu-icon-close { display: none; }
  html.menu-js .menu-toggle[aria-expanded="true"] .menu-icon-open { display: none; }
  html.menu-js .menu-toggle[aria-expanded="true"] .menu-icon-close { display: block; }
  html.menu-js .lang-switch { flex: none; }
  html.menu-js .main-nav { position: absolute; inset-block-start: 100%; inset-inline: 0; display: flex; flex-direction: column; justify-content: flex-start; gap: 4px; width: auto; padding: 8px 16px 16px; background: var(--navy); border-block-end: 1px solid #ffffff14; box-shadow: 0 12px 24px #0000004d; visibility: hidden; opacity: 0; transform: translateY(-8px); transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s; }
  html.menu-js .menu-toggle[aria-expanded="true"] ~ .main-nav { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
  html.menu-js .main-nav a { display: flex; align-items: center; min-height: 48px; padding: 8px 12px; font-size: 16px; white-space: normal; text-align: start; }
}
@media (min-width: 720px) and (max-width: 819.98px) {
  html.menu-js .main-nav { padding-inline: 32px; }
}
/* end mobile menu */

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; background: radial-gradient(1100px 620px at 78% 18%, var(--navy-2), var(--navy)); color: var(--on-navy); }
html[dir="rtl"] .hero { background: radial-gradient(1100px 620px at 22% 18%, var(--navy-2), var(--navy)); }
.hero-inner { display: grid; gap: 40px; padding-block: 48px 40px; }
@media (min-width: 960px) {
  .hero-inner { grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: 32px 56px; align-items: center; padding-block: 88px 56px; }
  .stats { grid-column: 1 / -1; }
}
.kicker { font-size: 14px; color: var(--on-navy-muted); margin-bottom: 18px; }
.hero h1 { font-size: clamp(40px, 6vw, 78px); }
html[lang="ur"] .hero h1 { font-size: clamp(30px, 4.4vw, 54px); }
.hero h1 em { color: var(--mint); display: block; }
.lead { font-size: clamp(17px, 1.7vw, 20px); max-width: 56ch; color: inherit; opacity: .9; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* The microscope field: a bright round slide, as it looks down the eyepiece. */
.hero-visual { position: relative; width: min(100%, 460px); margin-inline: auto; }
.scope {
  position: relative; width: 84%; aspect-ratio: 1; margin-inline-start: auto; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 50% 46%, #F6F1F6, #E6DCE9 72%);
  box-shadow: 0 0 0 1px #ffffff29, 0 0 0 12px #ffffff0a, 0 0 70px 6px #7FE0D41a;
}
.scope::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 44px 14px #0f1b2a8c; pointer-events: none; }
.scope-field { width: 100%; height: 100%; }

/* Sample result card */
.rcard {
  position: relative; margin: -46% 0 0; width: min(100%, 372px); padding: 18px 20px;
  background: #13202F; color: var(--on-navy); border: 1px solid #ffffff24; border-radius: var(--radius);
  box-shadow: 0 18px 44px #050b1466;
}
.rcard-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.rcard-title { margin: 0; font-weight: 600; font-size: 15px; line-height: 1.35; }
.rcard-badge { flex: none; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; border: 1px solid #ffffff3d; color: var(--on-navy); }
.rrows { list-style: none; margin: 0; padding: 0; }
.rrow { padding-block: 12px; border-top: 1px solid #ffffff1a; }
.rrow-top, .rrow-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rrow-name { font-size: 14px; line-height: 1.4; }
.rrow-val { flex: none; direction: ltr; unicode-bidi: isolate; }
.rrow-val .num { font-size: 18px; font-weight: 500; }
.rrow-unit { font-size: 11px; color: var(--on-navy-muted); }
.rrow-foot { font-size: 12px; color: var(--on-navy-muted); flex-wrap: wrap; gap: 2px 12px; line-height: 1.5; }
.rrange .num { font-size: 11px; }
.rstatus { display: inline-flex; align-items: center; gap: 6px; color: var(--on-navy); font-weight: 600; }
.rstatus i { width: 8px; height: 8px; border-radius: 50%; background: var(--dot); }
.rrow[data-status="low"] { --dot: var(--status-low); }
.rrow[data-status="ok"] { --dot: var(--status-ok); }
.rrow[data-status="high"] { --dot: var(--status-high); }
.rbar { position: relative; height: 6px; margin-block: 9px; border-radius: 999px; background: #ffffff1c; }
.rbar-ok { position: absolute; inset-block: 0; inset-inline-start: 25%; width: 50%; border-radius: 999px; background: #7FE0D466; }
.rbar-dot { position: absolute; top: 50%; inset-inline-start: var(--x); width: 14px; height: 14px; margin-block-start: -7px; margin-inline-start: -7px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 0 2px #13202F; }
.rcard-note { font-size: 12px; line-height: 1.5; color: var(--on-navy-muted); padding-top: 12px; border-top: 1px solid #ffffff1a; }
html[lang="ur"] .rcard-title, html[lang="ur"] .rrow-name { line-height: 2; }
html[lang="ur"] .rrow-foot, html[lang="ur"] .rcard-note { line-height: 2.1; }

/* Your four real numbers, as one slim line */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 24px; margin: 8px 0 0; padding-top: 24px; border-top: 1px solid #ffffff24; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stats div { display: flex; flex-direction: column-reverse; justify-content: flex-end; }
.stats dt { font-size: 14px; color: var(--on-navy-muted); }
.stats dd { margin: 0; font-size: 28px; color: #fff; line-height: 1.3; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; font: 600 16px/1 var(--sans); text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: background-color .18s, border-color .18s, filter .18s; }
html[lang="ur"] .btn { font-family: var(--body-font); line-height: 2; font-weight: 600; }
.btn-primary { background: var(--btn-bg); color: var(--btn-ink); }
.hero .btn-primary, .waitlist .btn-primary { background: var(--mint); color: #0F1B2A; }
.btn-primary:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: not-allowed; filter: none; }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn-ghost:hover { background: #8881; }
.btn-small { min-height: 40px; padding: 0 16px; font-size: 14px; }
.text-link { font-weight: 600; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* ---------- sections ---------- */
.tool-section { border-top: 1px solid var(--line); padding-block: 56px; }
.tool-section:first-of-type { border-top: 0; }
@media (min-width: 720px) { .tool-section { padding-block: 104px; } }
.tool-section h2, .band h2 { font-size: clamp(32px, 4.8vw, 60px); }
html[lang="ur"] .tool-section h2, html[lang="ur"] .band h2 { font-size: clamp(26px, 3.4vw, 42px); }
.tool-grid { display: grid; gap: 4px; }
@media (min-width: 720px) { .tool-grid { grid-template-columns: 150px 1fr; gap: 32px; } }
.section-num { font-family: var(--serif); font-style: italic; font-size: clamp(44px, 6vw, 76px); line-height: 1; color: var(--teal-ink); margin: 0; }
html[lang="ur"] .section-num { font-style: normal; line-height: 1.2; }
.section-lead { font-size: 18px; color: var(--muted); max-width: 62ch; }

/* How it works: a real sequence, so these are numbered. */
.steps { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 28px; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 48px; } }
.steps li { border-top: 2px solid var(--teal-ink); padding-top: 16px; }
.step-num { display: block; font-size: 15px; color: var(--teal-ink); margin-bottom: 10px; }
.steps h3 { font-size: 21px; }
.steps p { margin: 0; color: var(--muted); }

/* Browse by category */
.cat-grid { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 900px) { .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 44px; } }
.cat-grid a { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; height: 100%; min-height: 118px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; transition: border-color .18s, background-color .18s; }
.cat-grid a:hover { border-color: var(--teal-ink); }
.cat-grid strong { font-size: 17px; font-weight: 600; line-height: 1.3; }
html[lang="ur"] .cat-grid strong { line-height: 1.9; }
.cat-grid span { font-size: 14px; color: var(--muted); }
.cat-grid .cat-all { background: var(--navy); border-color: #ffffff2e; color: var(--on-navy); }
.cat-grid .cat-all span { color: var(--on-navy-muted); }
.cat-grid .cat-all:hover { border-color: var(--mint); }
.popular-label { margin-top: 36px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); text-decoration: none; font-size: 15px; }
.chip:hover { border-color: var(--teal-ink); color: var(--teal-ink); }

/* Why Labologics: the one navy band, for rhythm down the page. */
.band { background: var(--navy); color: var(--on-navy); padding-block: 56px; border-block: 1px solid #ffffff14; }
@media (min-width: 720px) { .band { padding-block: 104px; } }
.band h2 em { color: var(--mint); }
.why-grid { display: grid; gap: 28px; margin-top: 32px; }
@media (min-width: 720px) { .why-grid { grid-template-columns: repeat(2, 1fr); gap: 44px 64px; margin-top: 48px; } }
.why { border-top: 1px solid #ffffff2e; padding-top: 16px; }
.why h3 { font-size: 21px; }
.why p:last-child { margin: 0; color: var(--on-navy-muted); }

/* FAQ */
.faq-grid { display: grid; gap: 20px; }
@media (min-width: 960px) { .faq-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 56px; } }
.faq { border-bottom: 1px solid var(--line); }
.faq-item { border-top: 1px solid var(--line); }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; padding-block: 16px; font-size: 18px; font-weight: 600; line-height: 1.35; cursor: pointer; list-style: none; }
html[lang="ur"] .faq-item summary { line-height: 2; font-size: 17px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; flex: none; font-family: var(--mono); font-weight: 400; font-size: 22px; line-height: 1; color: var(--teal-ink); transition: transform .2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:hover { color: var(--teal-ink); }
.faq-item p { margin: 0; padding-block-end: 20px; color: var(--muted); max-width: 62ch; }

.waitlist { background: var(--navy); color: var(--on-navy); padding-block: 56px; }
.waitlist-inner { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.waitlist h2 { font-size: clamp(24px, 3.5vw, 36px); }
.waitlist p { color: var(--on-navy-muted); max-width: 56ch; margin: 0; }

/* ---------- page head ---------- */
.page-head { background: var(--navy); color: var(--on-navy); padding-block: 44px 40px; }
@media (min-width: 720px) { .page-head { padding-block: 80px 64px; } }
.page-head h1 { font-size: clamp(34px, 5.5vw, 64px); }
html[lang="ur"] .page-head h1 { font-size: clamp(28px, 4vw, 48px); }
.page-head h1 em { color: var(--mint); }
.page-head .kicker { font-family: var(--serif); font-style: italic; font-size: 26px; line-height: 1; color: var(--mint); margin-bottom: 14px; }
html[lang="ur"] .page-head .kicker { font-style: normal; line-height: 1.4; }
.page-head a.text-link { color: var(--mint); }
.page-head .aka { font-size: 14px; color: var(--on-navy-muted); margin: 0 0 14px; max-width: 62ch; }
html[lang="ur"] .page-head .aka { line-height: 2; }
.crumbs { font-size: 14px; color: var(--on-navy-muted); margin-bottom: 16px; }
.crumbs a { color: var(--on-navy); }

/* ---------- tools ---------- */
.tool-body { padding-block: 32px 72px; }
@media (min-width: 720px) { .tool-body { padding-block: 48px 96px; } }
.tool-layout { display: grid; gap: 24px; align-items: start; }
@media (min-width: 960px) { .tool-layout { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.form { padding: 20px; display: grid; gap: 20px; }
@media (min-width: 720px) { .form { padding: 28px; } }
@media (min-width: 960px) { .form { position: sticky; top: 88px; } }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.field > span, .field > legend { display: block; font-weight: 600; margin-bottom: 8px; font-size: 15px; }
.field-row { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 480px) { .field-row { grid-template-columns: 120px minmax(0, 1fr); } }
input[type="number"], input[type="search"] {
  width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); color: var(--ink); font: 500 17px var(--sans);
}
html[lang="ur"] input[type="search"] { font-family: var(--body-font); line-height: 2; min-height: 56px; }
input:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 48px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--paper); }
.seg input:checked + span { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-ink); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }
.checks { display: grid; gap: 8px; }
@media (min-width: 560px) { .checks { grid-template-columns: 1fr 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 15px; line-height: 1.4; background: var(--paper); }
html[lang="ur"] .check { line-height: 1.9; }
.check input { margin-top: 3px; accent-color: var(--teal); width: 18px; height: 18px; flex: none; }
.check:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.flags { padding: 14px; border-radius: 12px; background: var(--danger-soft); }
.flags legend { color: var(--danger); float: left; width: 100%; }
html[dir="rtl"] .flags legend { float: right; }
.flags .checks { clear: both; }
.check-warn { background: var(--card); }
.check-warn:has(input:checked) { border-color: var(--danger); background: var(--card); }
.check-warn input { accent-color: var(--danger); }
.hint { font-size: 13px; color: var(--muted); margin: 8px 0 0; }

/* ---------- results ---------- */
.result:empty { display: none; }
.result { display: grid; gap: 16px; }
.result-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.result-head h2 { margin: 0; font-size: 26px; }
.bucket { padding: 0; overflow: hidden; }
.bucket-title { display: flex; align-items: center; gap: 10px; margin: 0; padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 600; }
.bucket-title::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--teal); flex: none; }
.bucket[data-b="q3m"] .bucket-title::before { background: #DC2626; }
.bucket[data-b="q6m"] .bucket-title::before { background: #EA580C; }
.bucket[data-b="yearly"] .bucket-title::before { background: var(--teal); }
.bucket[data-b="multi"] .bucket-title::before { background: #2563EB; }
.bucket[data-b="once"] .bucket-title::before { background: #7C3AED; }
.bucket[data-b="discuss"] .bucket-title::before { background: var(--muted); }
.item { padding: 16px 20px; border-top: 1px solid var(--line); }
.item:first-of-type { border-top: 0; }
.item h3 { font-size: 17px; margin: 0 0 4px; }
.item h3 a { color: var(--ink); text-decoration-color: var(--teal); }
.item p { margin: 0 0 6px; color: var(--muted); font-size: 15px; }
.item .src { font-size: 13px; color: var(--muted); margin: 0; }
html[lang="ur"] .item .src { font-family: var(--sans); direction: ltr; text-align: end; }
.item .from { font-size: 13px; color: var(--muted); }
.notice { padding: 16px 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); margin: 0; }
.notice-warn { background: var(--warn-soft); border-color: transparent; color: var(--ink); }
.notice-danger { background: var(--danger-soft); border: 1px solid var(--danger); }
.notice-danger h2 { color: var(--danger); font-size: 22px; margin-bottom: 6px; }
.notice-danger .big { font-family: var(--mono); font-size: 32px; color: var(--danger); margin: 8px 0 0; }
.not-routine { background: transparent; }
.not-routine .bucket-title::before { background: transparent; border: 2px solid var(--muted); }

/* ---------- library ---------- */
.search { display: block; max-width: 520px; margin-bottom: 32px; }
.lib-group { margin-bottom: 40px; scroll-margin-top: 88px; }
.lib-group > .label { font-size: 16px; color: var(--ink); }
.lib-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
@media (min-width: 720px) { .lib-list { grid-template-columns: 1fr 1fr; } }
.lib-list a { display: grid; gap: 4px; height: 100%; padding: 18px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; transition: border-color .18s; }
.lib-list a:hover { border-color: var(--teal-ink); }
.lib-list strong { font-size: 17px; }
.lib-list span { color: var(--muted); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tag { font-style: normal; font-family: var(--sans); font-size: 13px; color: var(--teal-ink); }
html[lang="ur"] .tag { font-family: var(--body-font); }
.lib-list li[hidden] { display: none; }

/* ---------- test page ---------- */
.article { display: grid; gap: 32px; }
@media (min-width: 960px) { .article { grid-template-columns: minmax(0, 1fr) 280px; gap: 56px; } }
.article-main { max-width: 72ch; }
.info-block { padding-block: 24px; border-bottom: 1px solid var(--line); }
.info-block:first-child { padding-block-start: 0; }
.info-block > .label { font-size: 16px; color: var(--ink); }
.info-block p { margin: 0; }
.info-block p + p { margin-block-start: 12px; }
.page-updated { font-size: 14px; color: var(--on-navy-muted); margin: 12px 0 0; }
.info-block.note { background: var(--teal-soft); border: 0; border-radius: var(--radius); padding: 20px; margin-top: 20px; }
.ranges { width: 100%; border-collapse: collapse; font-size: 16px; }
.ranges th, .ranges td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ranges th { font-weight: 500; width: 45%; }
.ranges td { font-family: var(--mono); font-size: 14px; }
html[lang="ur"] .ranges td { font-family: var(--sans); direction: ltr; text-align: end; }
.sources { margin-top: 28px; font-size: 14px; }
.sources ul { margin: 0; padding-inline-start: 18px; }
html[lang="ur"] .sources ul { direction: ltr; text-align: start; }
.article-side { display: grid; gap: 12px; align-content: start; }
@media (min-width: 960px) { .article-side { position: sticky; top: 88px; align-self: start; } }
.side-card { padding: 20px; }
.side-card p { margin-bottom: 6px; font-weight: 600; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 48px 32px; background: var(--card); }
.footer-grid { display: grid; gap: 24px; margin-bottom: 24px; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-brand { font-weight: 700; font-size: 18px; margin-bottom: 4px; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { margin-bottom: 6px; }
.disclaimer { font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 20px; }

/* ---------- motion: only for visitors who have not asked for less ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  /* One moment on load: the microscope comes into focus, the words rise, the markers settle. */
  .scope-field { animation: focus-in 1.5s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-copy > * { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-copy > :nth-child(2) { animation-delay: .06s; }
  .hero-copy > :nth-child(3) { animation-delay: .12s; }
  .hero-copy > :nth-child(4) { animation-delay: .18s; }
  .rcard { animation: rise .8s .25s cubic-bezier(.2, .7, .2, 1) both; }
  .rbar-dot { animation: settle 1s .55s cubic-bezier(.2, .7, .2, 1) both; }
  /* Scroll reveal. "motion" is only added by assets/motion.js once it is running. */
  .motion .reveal { transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1); }
  .motion .reveal:not(.in) { opacity: 0; transform: translateY(22px); }
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes focus-in { from { filter: blur(12px); opacity: .5; transform: scale(1.05); } }
@keyframes settle { from { inset-inline-start: 50%; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- print (planner results) ---------- */
@media print {
  .topnote, .site-header, .site-footer .footer-grid, .form, .page-head .lead, .scope, .no-print { display: none !important; }
  body { background: #fff; color: #000; font-size: 13px; }
  .page-head { background: none; color: #000; padding: 0 0 12px; }
  .page-head h1 em, .page-head .kicker { color: #000; }
  .tool-layout { display: block; }
  .card { break-inside: avoid; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
