/* Lab 2080: "a lab sheet for the mind". Mobile-first, RTL, local Vazirmatn only. */
@font-face {
  font-family: "Vazirmatn";
  src: url("../vendor/fonts/Vazirmatn-Regular.cdc140628f11.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("../vendor/fonts/Vazirmatn-Bold.7958481fe611.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --paper: #f3f6f5;
  --surface: #ffffff;
  --ink: #18302e;
  --muted: #56635f;
  --line: #d9e2e0;
  --control: #7f918c;
  --pine: #1d6b63;
  --pine-dark: #154f49;
  --pine-tint: #e3efec;
  --amber: #d99a2b;
  /* Severity levels: text / background / bar fill. Level 0 is the calm end. */
  --lv0: #23694b; --lv0-bg: #e6f2ec; --lv0-fill: #4e9c78;
  --lv1: #8a5300; --lv1-bg: #fbf0dc; --lv1-fill: #d99a2b;
  --lv2: #a8452c; --lv2-bg: #fbe9e4; --lv2-fill: #c8664a;
  --lv3: #8e2a3b; --lv3-bg: #f6e4e8; --lv3-fill: #8e2a3b;
  --nv: #4f548f; --nv-bg: #e9eaf6;
  --crisis: #7d1f2c; --crisis-bg: #fbeaec; --crisis-line: #e7b3bb;
  /* Bought expert content: analysis and solutions boxes. */
  --lemon-bg: #fcf9e3; --lemon-line: #e4d67e;
  --sky-bg: #eaf5fd; --sky-line: #a9d3f0;
  --radius-lg: 18px;
  --radius: 12px;
  --radius-sm: 8px;
  --tap: 44px;
}

* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.85;
}
img { max-width: 100%; }
a { color: var(--pine); text-underline-offset: 3px; }
a:hover { color: var(--pine-dark); }
h1, h2, h3 { line-height: 1.5; margin: 0 0 .5rem; letter-spacing: 0; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8rem; }
ul, ol { padding-inline-start: 1.3rem; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

.container { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
main.container { padding-top: 20px; padding-bottom: 56px; min-height: 60vh; }
.page-head { margin-bottom: 16px; }
.page-head p { color: var(--muted); max-width: 62ch; }

/* ---------- Top bar ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px; padding-top: 8px; padding-bottom: 4px; }
.brand { display: flex; align-items: center; gap: 8px; min-height: var(--tap); min-width: 0; flex: 1 1 0; font-weight: 700; color: var(--ink); text-decoration: none; font-size: .92rem; line-height: 1.35; }
.brand img { flex: none; }
.brand img { width: 30px; height: 30px; }
.topbar-end { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.wallet-pill {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 14px; border-radius: 999px;
  background: var(--pine-tint); color: var(--pine-dark); font-size: .9rem; text-decoration: none; white-space: nowrap;
}
.wallet-pill:hover { background: #d3e6e1; color: var(--pine-dark); }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; width: 100%; margin-inline: -10px; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 10px; white-space: nowrap;
  color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; font-size: .95rem;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--pine); font-weight: 700; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: .9rem; padding: 20px 0 28px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; padding: 0; list-style: none; }
.footer-links a { display: inline-flex; align-items: center; min-height: var(--tap); }

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; margin-bottom: 16px; }
.card.narrow { max-width: 460px; margin-inline: auto; }
.card > :last-child { margin-bottom: 0; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.section { margin-top: 32px; }
.section > h2 { margin-bottom: 4px; }
.section > p { color: var(--muted); max-width: 62ch; }

/* ---------- Buttons ---------- */
.button, button.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap);
  background: var(--pine); color: #fff; border: 2px solid var(--pine); border-radius: var(--radius);
  padding: 0 20px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
}
.button:hover { background: var(--pine-dark); border-color: var(--pine-dark); color: #fff; }
.button.small { padding: 0 14px; font-size: .925rem; }
.button.secondary { background: var(--surface); color: var(--pine); border-color: var(--pine); }
.button.secondary:hover { background: var(--pine-tint); color: var(--pine-dark); }
.button.quiet { background: transparent; color: var(--pine); border-color: transparent; padding-inline: 8px; }
.button.quiet:hover { background: var(--pine-tint); }
.button.danger { background: var(--lv3); border-color: var(--lv3); }
.button.block { width: 100%; }
.button[disabled] { opacity: .5; cursor: not-allowed; }
.inline { display: inline; margin: 0; }
.link-button { background: none; border: 0; color: var(--pine); cursor: pointer; font: inherit; padding: 0; min-height: var(--tap); text-decoration: underline; text-underline-offset: 3px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* ---------- Forms ---------- */
form p { margin-bottom: 14px; }
label { display: block; font-weight: 700; margin-bottom: 4px; }
input[type=text], input[type=tel], input[type=number], input[type=search], input[type=email], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1.5px solid var(--control); border-radius: var(--radius);
  font: inherit; color: var(--ink); background: #fff;
}
input:focus, select:focus, textarea:focus { border-color: var(--pine); outline: 3px solid var(--pine-tint); outline-offset: 0; }
input[aria-invalid="true"], .has-error input, .has-error select { border-color: var(--lv3); }
textarea { min-height: 140px; }
.errorlist { color: var(--lv3); list-style: none; padding: 0; margin: 4px 0; font-size: .9rem; font-weight: 700; }
.helptext { display: block; color: var(--muted); font-size: .875rem; margin-top: 4px; }
input.ltr-digits { direction: ltr; text-align: right; letter-spacing: .08em; }
.age-hint { display: block; min-height: 1.6em; margin-top: 4px; font-weight: 700; color: var(--pine-dark); }
.age-hint.warn { color: var(--lv2); }
.consent { padding: 12px; border: 1.5px solid var(--lv1-fill); border-radius: var(--radius); background: var(--lv1-bg); }
.consent-why { display: block; font-size: .875rem; font-weight: 700; color: var(--lv1); }
.consent label { display: flex; align-items: flex-start; gap: 10px; margin: 0; font-weight: 400; cursor: pointer; }
.consent input[type=checkbox] { flex: none; width: 22px; height: 22px; margin-top: 4px; accent-color: var(--pine); }
/* One-time code: one box per digit over a single transparent input (static/js/otp.js). */
.otp { display: block; position: relative; }
.otp.js input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; background: transparent; color: transparent; caret-color: transparent; outline: none; }
.otp.js input::selection { background: transparent; }
.otp-boxes { display: flex; justify-content: center; gap: 8px; }
.otp-boxes span { flex: 1; max-width: 56px; height: 58px; display: grid; place-items: center; border: 1.5px solid var(--control); border-radius: var(--radius); background: #fff; font-size: 1.5rem; font-weight: 700; }
.otp-boxes span.filled { border-color: var(--pine-dark); }
.otp-boxes span.active { border-color: var(--pine); outline: 3px solid var(--pine-tint); }
.step-mark { margin: 0 0 4px; font-size: .875rem; font-weight: 700; color: var(--pine); }

/* ---------- Messages and alerts ---------- */
.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.msg { padding: 12px 14px; border-radius: var(--radius); margin-bottom: 8px; background: var(--pine-tint); color: var(--pine-dark); border-inline-start: 4px solid var(--pine); }
.msg.success { background: var(--lv0-bg); color: var(--lv0); border-color: var(--lv0); }
.msg.warning { background: var(--lv1-bg); color: var(--lv1); border-color: var(--lv1-fill); }
.msg.error { background: var(--lv3-bg); color: var(--lv3); border-color: var(--lv3); }

.alert { border-radius: var(--radius-lg); padding: 16px; margin-bottom: 16px; }
.alert > :last-child { margin-bottom: 0; }
.alert.refer { background: var(--lv1-bg); border: 1px solid #efd29b; color: #5e3a00; }
.alert.info { background: var(--pine-tint); border: 1px solid #c4ddd7; color: var(--pine-dark); }
.alert.crisis { background: var(--crisis-bg); border: 2px solid var(--crisis-line); color: var(--crisis); }
.alert.crisis h2 { font-size: 1.2rem; }
.lines { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 12px 0; padding: 0; list-style: none; }
.lines a {
  display: flex; flex-direction: column; justify-content: center; min-height: 56px; padding: 8px 14px;
  background: #fff; border: 1.5px solid var(--crisis-line); border-radius: var(--radius); color: var(--crisis); text-decoration: none;
}
.lines a strong { font-size: 1.35rem; line-height: 1.3; }
.lines a span { font-size: .85rem; }
.lines a:hover { border-color: var(--crisis); }

/* ---------- Level badges ---------- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .85rem; font-weight: 700; background: var(--pine-tint); color: var(--pine-dark); white-space: nowrap; }
.badge.level-0 { background: var(--lv0-bg); color: var(--lv0); }
.badge.level-1 { background: var(--lv1-bg); color: var(--lv1); }
.badge.level-2 { background: var(--lv2-bg); color: var(--lv2); }
.badge.level-3 { background: var(--lv3-bg); color: var(--lv3); }
.badge.neutral { background: var(--nv-bg); color: var(--nv); }
.badge.soon { background: #eef1f0; color: var(--muted); font-weight: 400; }

/* ---------- Home ---------- */
.hero { display: grid; gap: 24px; padding: 12px 0 8px; align-items: center; }
.hero h1 { font-size: clamp(1.7rem, 6.4vw, 2.5rem); line-height: 1.45; margin-bottom: 12px; }
.hero .lead { font-size: 1.05rem; color: var(--muted); max-width: 46ch; }
.hero .actions { margin-top: 20px; }
.trust { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 16px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: .9rem; }
.trust li { display: flex; align-items: center; gap: 6px; }
.trust li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--pine); flex: none; }

/* The sample lab sheet: the one memorable element of the home page. */
.sheet {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 16px 18px 18px; box-shadow: 0 1px 0 var(--line), 0 18px 40px -28px rgba(24, 48, 46, .45);
  border-top: 6px solid var(--pine);
}
.sheet-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; border-bottom: 1px dashed var(--line); padding-bottom: 8px; margin-bottom: 4px; font-size: .85rem; color: var(--muted); }
.sheet-head strong { color: var(--ink); font-size: .95rem; }
.sheet-row { padding: 12px 0 6px; border-bottom: 1px dashed var(--line); }
.sheet-row:last-child { border-bottom: 0; }
.sheet-row .row { gap: 6px 10px; }
.sheet-row .name { font-weight: 700; }
.sheet-row .val { margin-inline-start: auto; font-weight: 700; font-size: 1.15rem; }
.sheet-row .spark { display: block; width: 100%; height: 28px; margin-top: 10px; }

.steps { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); padding: 0; margin: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.steps li::before { content: counter(step, persian); display: inline-grid; place-items: center; width: 28px; height: 28px; margin-inline-end: 8px; border-radius: 50%; background: var(--pine); color: #fff; font-weight: 700; font-size: .9rem; }
.steps strong { display: inline; }
.steps p { margin: 6px 0 0; color: var(--muted); font-size: .925rem; }

/* ---------- Test list ---------- */
.test-card { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; position: relative; }
.test-card:hover { border-color: var(--pine); }
.test-card h3 { margin-bottom: 2px; }
.test-card h3 a { color: var(--ink); text-decoration: none; }
.test-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.test-card p { margin: 0 0 6px; color: var(--muted); font-size: .925rem; }
.test-card .meta { font-size: .85rem; color: var(--muted); }
.tile { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; background: var(--pine-tint); }
.tile img { width: 40px; height: 40px; }
.tile.standard { background: var(--nv-bg); }
.tile.large { width: 72px; height: 72px; border-radius: 18px; }
.tile.large img { width: 52px; height: 52px; }

/* ---------- Test detail (start) ---------- */
.start-head { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.start-head h1 { margin: 0; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.facts li { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 2px 12px; font-size: .9rem; }

/* ---------- Taking a test ---------- */
.progress-note { color: var(--muted); font-size: .9rem; }
.question { padding: 18px 0; border-bottom: 1px solid var(--line); margin: 0; border-inline: 0; border-top: 0; min-width: 0; }
.question:last-of-type { border-bottom: 0; }
.question legend { font-weight: 700; padding: 0; margin-bottom: 10px; display: flex; gap: 8px; }
.question legend .qn { color: var(--pine); flex: none; }
.options { display: grid; gap: 8px; }
.options label {
  display: flex; align-items: center; gap: 10px; min-height: 48px; margin: 0; padding: 8px 14px;
  font-weight: 400; border: 1.5px solid var(--line); border-radius: var(--radius); cursor: pointer; background: #fff;
}
.options label:hover { border-color: var(--control); }
.options input { width: 20px; height: 20px; margin: 0; accent-color: var(--pine); flex: none; }
.options label:has(input:checked) { border-color: var(--pine); background: var(--pine-tint); font-weight: 700; }
.options label:has(input:focus-visible) { outline: 3px solid var(--amber); outline-offset: 2px; }
.dots { display: inline-flex; gap: 4px; margin-inline-start: auto; }
.dots i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--control); }
.dots i.on { background: var(--pine); border-color: var(--pine); }
.submit-bar { padding: 18px 0 4px; margin-top: 8px; }

/* ---------- Result: the lab report ---------- */
.report-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.report-head h1 { margin: 0; font-size: 1.35rem; }
.report-head .when { color: var(--muted); font-size: .875rem; margin: 0; }
.report-head .avatar { width: 76px; height: 76px; flex: none; margin-inline-start: auto; }
.reading { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; margin-bottom: 16px; border-top: 5px solid var(--pine); }
.reading.lv-0 { border-top-color: var(--lv0-fill); }
.reading.lv-1 { border-top-color: var(--lv1-fill); }
.reading.lv-2 { border-top-color: var(--lv2-fill); }
.reading.lv-3 { border-top-color: var(--lv3-fill); }
.reading.lv-n { border-top-color: var(--nv); }
.reading-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.reading-top h2 { margin: 0; font-size: 1.1rem; }
.reading-top .badge { margin-inline-start: auto; }
.score { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 2px; }
.score .value { font-size: 2.6rem; line-height: 1.2; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Reference-range ruler: bands as segments, a marker at the score. */
.ruler { margin: 10px 0 6px; }
.ruler-track { position: relative; display: flex; height: 12px; border-radius: 999px; overflow: visible; }
.ruler-track .seg { height: 100%; opacity: .5; }
.ruler-track .seg:first-child { border-start-start-radius: 999px; border-end-start-radius: 999px; }
.ruler-track .seg:last-of-type { border-start-end-radius: 999px; border-end-end-radius: 999px; }
.ruler-track .seg.on { opacity: 1; }
.seg.lv-0 { background: var(--lv0-fill); }
.seg.lv-1 { background: var(--lv1-fill); }
.seg.lv-2 { background: var(--lv2-fill); }
.seg.lv-3 { background: var(--lv3-fill); }
.seg.nv { background: var(--nv); }
.seg.nv:nth-of-type(2) { opacity: .35; }
.seg.nv.on { opacity: 1; }
.ruler-mark {
  position: absolute; top: 50%; width: 22px; height: 22px; margin-inline-start: -11px; transform: translateY(-50%);
  border-radius: 50%; background: var(--surface); border: 4px solid var(--ink); box-shadow: 0 0 0 3px var(--surface);
}
.ruler-labels { display: flex; margin-top: 6px; font-size: .78rem; color: var(--muted); line-height: 1.4; }
.ruler-labels span { padding-inline: 2px; text-align: center; }
.ruler-labels span.on { color: var(--ink); font-weight: 700; }
.direction { font-size: .875rem; color: var(--muted); margin: 6px 0 0; }

.layer { border-top: 1px dashed var(--line); margin-top: 14px; padding-top: 12px; }
.layer h3 { margin: 12px 0 4px; font-size: 1rem; }
.layer h3:first-child { margin-top: 0; }
.layer ul { margin: 0; }
.layer .compare { background: var(--pine-tint); border-radius: var(--radius-sm); padding: 8px 12px; }
/* Bought content in its own tinted box: analysis lemon, solutions sky blue. A purchase lands here (#analysis / #solutions). */
.layer.analysis, .layer.solutions { border: 1.5px solid; border-radius: var(--radius); padding: 14px 16px; margin-top: 16px; scroll-margin-top: 16px; }
.layer.analysis { background: var(--lemon-bg); border-color: var(--lemon-line); }
.layer.solutions { background: var(--sky-bg); border-color: var(--sky-line); }
.layer-title { margin: 0 0 6px; font-size: .875rem; font-weight: 700; color: var(--muted); }
.layer .voice { color: var(--ink); }
.layer:target { animation: land 1.6s ease-out 1; outline: none; }
@keyframes land { from { box-shadow: 0 0 0 6px var(--pine-tint); } to { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .layer:target { animation: none; box-shadow: 0 0 0 3px var(--pine-tint); } }
/* Progress through the 6-step plan (not the home page's .steps list). */
.plan-progress { display: flex; gap: 6px; margin: 6px 0 10px; }
.plan-progress span { flex: 1; height: 6px; border-radius: 999px; background: var(--line); }
.plan-progress span.on { background: var(--pine); }
.plan-steps li { margin-bottom: 8px; }
.ai-text { white-space: pre-line; }

/* Services: a compact price list, not a wall of equal cards. */
.services { list-style: none; margin: 0; padding: 0; }
.svc { display: grid; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.svc:last-child { border-bottom: 0; padding-bottom: 0; }
.svc:first-child { padding-top: 4px; }
.svc h3 { margin: 0; font-size: 1rem; }
.svc p { margin: 0; color: var(--muted); font-size: .9rem; }
.svc-act { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.svc-act form { display: flex; align-items: center; gap: 12px; margin: 0; }
.price { font-weight: 700; font-variant-numeric: tabular-nums; }
.price.free { color: var(--lv0); }
.svc .note { font-size: .9rem; color: var(--muted); }

/* ---------- Tables / lists ---------- */
table.data { width: 100%; border-collapse: collapse; background: var(--surface); }
table.data th, table.data td { padding: 10px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: top; }
table.data th { background: var(--paper); font-weight: 700; font-size: .9rem; }
.table-wrap { overflow-x: auto; }
.amount-in { color: var(--lv0); }
.ledger { list-style: none; margin: 0; padding: 0; }
.ledger li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ledger li:last-child { border-bottom: 0; }
.ledger .what { font-weight: 700; }
a.what, .more-link { display: inline-flex; align-items: center; min-height: var(--tap); }
.ledger .amt { text-align: left; font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; }
.ledger .sub { color: var(--muted); font-size: .85rem; }
.balance { font-size: 2.2rem; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; margin: 4px 0 16px; }
.quick-amounts { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 14px; }
.quick-amounts button { min-height: var(--tap); padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font: inherit; font-size: .9rem; cursor: pointer; color: var(--ink); }
.quick-amounts button:hover { border-color: var(--pine); }
.wallet-split { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: -8px 0 16px; font-size: .95rem; }
.wallet-split .gift-part { color: var(--lv1); font-weight: 700; }
.gift-lots { list-style: none; margin: 0 0 16px; padding: 0; font-size: .9rem; }
.gift-lots li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.gift-lots li > :last-child { white-space: nowrap; }
.invite-link { display: flex; gap: 8px; align-items: stretch; }
.invite-link input { flex: 1; min-width: 0; direction: ltr; text-align: left; }

/* One-time gift announcement (native <dialog>: Esc and the buttons close it). */
.gift-dialog {
  width: min(400px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--radius-lg);
  background: var(--surface); color: var(--ink); box-shadow: 0 24px 60px rgba(24, 48, 46, .28);
}
.gift-dialog::backdrop { background: rgba(24, 48, 46, .55); }
.gift-dialog[open] { animation: gift-in .28s ease-out; }
.gift-dialog form { position: relative; padding: 28px 22px 22px; text-align: center; background: linear-gradient(180deg, var(--lv1-bg), var(--surface) 140px); }
.gift-dialog h2 { margin: 8px 0 0; font-size: 1.25rem; }
.gift-art { display: block; margin: 0 auto; }
.gift-total { margin: 4px 0 12px; font-size: 2rem; font-weight: 700; color: var(--lv0); font-variant-numeric: tabular-nums; }
.gift-list { list-style: none; margin: 0 0 12px; padding: 0; text-align: right; }
.gift-list li { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.gift-list .why { font-weight: 700; }
.gift-list .amt { font-weight: 700; }
.gift-list .sub { grid-column: 1 / -1; color: var(--muted); font-size: .85rem; }
.gift-close {
  position: absolute; inset-inline-end: 8px; top: 8px; width: var(--tap); height: var(--tap);
  border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.gift-close:hover { background: var(--pine-tint); color: var(--ink); }
@keyframes gift-in { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .gift-dialog[open] { animation: none; } }

.empty { text-align: center; padding: 28px 16px; }
.empty img { width: 72px; height: 72px; }
.empty p { color: var(--muted); max-width: 40ch; margin-inline: auto; }

/* ---------- Trend ---------- */
.chart-box { position: relative; height: 280px; }
.chart-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 8px; }
.chart-summary .now { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.history-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

@media (min-width: 720px) {
  h1 { font-size: 1.95rem; }
  main.container { padding-top: 28px; }
  .card, .reading { padding: 24px; }
  .topbar-inner { flex-wrap: nowrap; padding-top: 6px; padding-bottom: 6px; }
  .nav { width: auto; margin-inline: 0 -10px; order: 2; }
  .topbar-end { order: 3; margin-inline-start: 8px; }
  .brand { flex: 0 1 auto; margin-inline-end: auto; font-size: 1.05rem; }
  .hero { grid-template-columns: 1.15fr 1fr; gap: 48px; padding-top: 36px; }
  .options { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .svc { grid-template-columns: 1fr auto; align-items: center; column-gap: 24px; }
  .report-head h1 { font-size: 1.6rem; }
  .report-head .avatar { width: 88px; height: 88px; }
  .chart-box { height: 320px; }
}
@media (min-width: 900px) {
  /* Every option of a question on one row (4 or 5 of them). */
  .options { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  /* Narrow boxes: the intensity dots move under the label so the words stay on one line. */
  .options label:has(.dots) { flex-wrap: wrap; row-gap: 2px; }
  .options .dots { flex-basis: 100%; margin-inline-start: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* ---------- The user's path (1 to 100) and what to take next ---------- */
.button.big { min-height: 60px; font-size: 1.15rem; }
.first-run { padding: 24px 18px; border-top: 5px solid var(--pine); }
.first-run h2 { font-size: 1.35rem; margin-bottom: 4px; }
.first-run .button { margin-top: 8px; }
.path-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.path-head h2 { margin: 0; font-size: 1.1rem; }
.path-score { margin: 0; color: var(--muted); }
.path-score strong { font-size: 2rem; line-height: 1; color: var(--ink); }
/* One segment per step, as wide as its points: the gauge is the path itself. */
.path-track { display: flex; gap: 3px; height: 14px; margin: 12px 0 14px; }
.path-seg { position: relative; background: var(--pine-tint); overflow: hidden; }
.path-seg:first-child { border-start-start-radius: 999px; border-end-start-radius: 999px; }
.path-seg:last-child { border-start-end-radius: 999px; border-end-end-radius: 999px; }
.path-seg .fill { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--pine); }
.path-steps { list-style: none; padding: 0; margin: 0 0 8px; }
.path-steps li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.path-steps li:last-child { border-bottom: 0; }
.path-steps .mark { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--control); }
.path-steps li.done .mark { border-color: var(--pine); background: var(--pine) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }
.path-steps .what { flex: 1; }
.path-steps li.done .what { color: var(--muted); }
.path-steps .pts { font-size: .875rem; color: var(--muted); white-space: nowrap; }
.path-steps li.done .pts { color: var(--pine-dark); font-weight: 700; }
.next-title { margin: 16px 0 8px; font-size: 1rem; }
.next-up h2 { font-size: 1.1rem; }
.next-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.next-card { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.next-card:first-child { border-color: var(--pine); border-width: 1.5px; }
.next-body { flex: 1; min-width: 0; }
.next-body h3 { margin: 0; font-size: 1rem; }
.next-body p { margin: 0; font-size: .875rem; color: var(--muted); }
.next-card form { margin: 0; }
@media (max-width: 420px) {
  .next-card { flex-wrap: wrap; }
  .next-card form { flex-basis: 100%; }
  .next-card .button { width: 100%; }
}
