/* Phone Checker: mobile first, light and dark, no framework. One main action per screen, pinned within thumb reach. */
:root {
    --ink: #0b0b0b; --paper: #ffffff; --mist: #f2f2ef; --line: #e4e4de; --muted: #66665f;
    --good: #15803d; --good-bg: #e7f6ec; --bad: #b91c1c; --bad-bg: #fdecec; --warn: #92400e; --warn-bg: #fff4d6;
    --radius: 1.25rem;
    color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
    :root { --ink: #f2f2ef; --paper: #151515; --mist: #0c0c0c; --line: #2a2a2a; --muted: #a3a39c;
        --good: #4ade80; --good-bg: #0f2618; --bad: #f87171; --bad-bg: #2b1111; --warn: #fbbf24; --warn-bg: #2a220c; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--mist); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
h1:focus { outline: none; }
.wrap { max-width: 40rem; margin: 0 auto; padding: 0 1rem; }
.small { font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.top { position: sticky; top: 0; z-index: 10; background: #0b0b0b; color: #f2f2ef; padding: .75rem 1rem; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 800; letter-spacing: .01em; text-decoration: none; }

/* Where you are: Start · Measure · Try it · Condition · Locks · Report */
.stepper { display: flex; gap: .25rem; list-style: none; margin: 1rem 0 0; padding: 0; }
.stepper li { flex: 1; min-width: 0; }
.stepper li::before { content: ''; display: block; height: .3rem; border-radius: 999px; background: var(--line); }
.stepper li.done::before, .stepper li.now::before { background: var(--ink); }
.stepper span { display: block; margin-top: .3rem; font-size: .68rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stepper li.now span { color: var(--ink); font-weight: 700; }

.hero { padding: 1.4rem 0 .5rem; }
.hero h1 { margin: 0; font-size: clamp(1.55rem, 6.5vw, 2.15rem); line-height: 1.12; letter-spacing: -.015em; }
.lead { color: var(--muted); font-size: 1.05rem; margin: .5rem 0 0; }
.eyebrow { margin: 0 0 .25rem; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.card { background: var(--paper); border-radius: var(--radius); padding: 1.1rem 1.1rem 1.2rem; margin: .8rem 0; box-shadow: 0 0 0 1px var(--line); }
.card h3 { margin: 0 0 .45rem; font-size: 1.05rem; }
.card > p:last-child { margin-bottom: 0; }
.card.warn { background: var(--warn-bg); box-shadow: none; }
.card.ok { background: var(--good-bg); box-shadow: none; }
.card.alt { background: transparent; }
.label { display: block; font-weight: 700; margin: 0 0 .45rem; }
.hint { color: var(--muted); font-size: .9rem; }
.input { width: 100%; font: inherit; font-size: 1rem; padding: .8rem .9rem; border-radius: .9rem; border: 1px solid var(--line); background: var(--mist); color: var(--ink); min-height: 3rem; }
.input[aria-invalid="true"] { border-color: var(--bad); }
.row { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.row .input { max-width: 8rem; }
.suffix { font-weight: 700; font-size: 1.2rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 700; border: 0; border-radius: 999px;
    padding: .7rem 1.2rem; min-height: 2.9rem; background: var(--ink); color: var(--paper); cursor: pointer; text-decoration: none; margin: .2rem 0; }
.btn:disabled { opacity: .4; cursor: default; }
.btn-light { background: var(--mist); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-big { width: 100%; padding: 1rem; font-size: 1.05rem; }
.btn-wa { background: #1fa855; color: #fff; }

/* The main action, pinned to the bottom on phones so a thumb always reaches it. */
.actionbar { position: sticky; bottom: 0; z-index: 5; display: flex; gap: .5rem; margin: 1rem -1rem 0; padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--mist) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
.actionbar .btn { flex: 1; margin: 0; }
.actionbar .btn-light { flex: 0 1 auto; }

.numbered { margin: .25rem 0 0; padding-left: 1.3rem; }
.numbered li { margin: .3rem 0; }
.path { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; padding: 0; margin: 0 0 1rem; }
.path li { background: var(--mist); border-radius: .6rem; padding: .3rem .6rem; font-weight: 600; font-size: .92rem; }
.path li:not(:last-child)::after { content: '›'; margin-left: .45rem; color: var(--muted); }

.options, .choices { display: grid; gap: .5rem; }
.choices { grid-template-columns: 1fr 1fr; }
.option { font: inherit; text-align: left; padding: .9rem 1rem; min-height: 3rem; border-radius: .9rem; border: 1px solid var(--line); background: var(--mist); color: var(--ink); cursor: pointer; }
.option[aria-checked="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); font-weight: 700; }
.option[aria-checked="true"]::after { content: ' ✓'; }

.meter { height: .45rem; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 1rem; }
.meter span { display: block; height: 100%; background: var(--ink); transition: width .3s; }
.steps { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 1rem; font-size: .9rem; }
.steps li { padding: .25rem 0 .25rem 1.4rem; position: relative; color: var(--muted); break-inside: avoid; }
.steps li::before { content: '○'; position: absolute; left: 0; }
.steps li.running { color: var(--ink); font-weight: 700; }
.steps li.running::before { content: '◐'; animation: spin 1s linear infinite; display: inline-block; }
.steps li.done { color: var(--ink); }
.steps li.done::before { content: '✓'; color: var(--good); font-weight: 800; }
@keyframes spin { to { transform: rotate(360deg); } }

.test #area:empty { display: none; }
.result:empty { display: none; }
.pill { display: inline-block; padding: .2rem .65rem; border-radius: 999px; font-weight: 700; font-size: .85rem; }
.pill.is-pass { background: var(--good-bg); color: var(--good); }
.pill.is-fail { background: var(--bad-bg); color: var(--bad); }
.pill.is-unknown { background: var(--mist); color: var(--muted); }
.ask p { font-weight: 600; margin: .75rem 0 .5rem; }
.recording { font-weight: 700; }
audio { width: 100%; margin: .5rem 0; }

.overlay { position: fixed; inset: 0; z-index: 50; background: #000; color: #fff; touch-action: none; user-select: none; -webkit-user-select: none; }
.overlay canvas, .overlay video, .overlay .fill { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.overlay-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: .5rem; align-items: center; justify-content: space-between;
    padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom)); background: rgb(0 0 0 / .7); }
.overlay-bar span { font-size: .9rem; }
.overlay-bar .btn { background: #fff; color: #000; margin: 0; }
.overlay-bar .btn-light { background: rgb(255 255 255 / .15); color: #fff; box-shadow: none; }
.overlay-hint { position: absolute; left: 50%; bottom: calc(1.5rem + env(safe-area-inset-bottom)); transform: translateX(-50%); padding: .45rem .9rem; border-radius: 999px;
    background: rgb(0 0 0 / .55); color: #fff; font-size: .85rem; white-space: nowrap; }

/* The report */
.genuine { margin: 1rem 0 0; padding: .9rem 1rem; border-radius: var(--radius); background: var(--good-bg); color: var(--good); }
.genuine p { margin: 0; }
.genuine p + p { margin-top: .3rem; }
.grade { display: flex; gap: 1rem; align-items: flex-start; border-radius: var(--radius); padding: 1.2rem; margin: 1rem 0 .8rem; }
.grade h2 { margin: 0 0 .2rem; font-size: 1.45rem; line-height: 1.15; }
.grade p { margin: 0; }
.grade .eyebrow { color: inherit; opacity: .75; }
.grade-letter { flex: none; width: 4.2rem; height: 4.2rem; border-radius: 1.1rem; display: grid; place-items: center; font-size: 2.4rem; font-weight: 900; background: currentColor; }
.grade-letter { color: inherit; }
.tone-good { background: var(--good-bg); color: var(--good); }
.tone-warn { background: var(--warn-bg); color: var(--warn); }
.tone-bad { background: var(--bad-bg); color: var(--bad); }
.grade-letter { background: none; box-shadow: inset 0 0 0 3px currentColor; }
.grade-score { margin-top: .6rem !important; font-weight: 600; font-size: .92rem; }
.issues { box-shadow: inset 0 0 0 2px var(--bad); }
.issues ul { margin: 0; padding-left: 1.1rem; }
.issues li { margin: .4rem 0; }
.group { padding: 0; }
.group summary, details.card > summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.1rem; cursor: pointer; font-weight: 700; list-style: none; }
.group summary::-webkit-details-marker, details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: '⌄'; color: var(--muted); }
details.card[open] > summary::after { content: '⌃'; }
details.card > :not(summary) { padding-left: 1.1rem; padding-right: 1.1rem; }
details.card > :last-child { padding-bottom: 1rem; }
.count { margin-left: auto; font-size: .85rem; padding: .15rem .6rem; border-radius: 999px; background: var(--mist); color: var(--muted); }
.count.is-pass { background: var(--good-bg); color: var(--good); }
.count.is-fail { background: var(--bad-bg); color: var(--bad); }
.checks { list-style: none; margin: 0; padding: 0 1.1rem 1rem; }
.check { display: flex; gap: .75rem; padding: .65rem 0; border-top: 1px solid var(--line); }
.check .mark { flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; margin-top: .1rem; }
.check.is-pass .mark { background: var(--good-bg); color: var(--good); }
.check.is-fail .mark { background: var(--bad-bg); color: var(--bad); }
.check.is-unknown .mark { background: var(--mist); color: var(--muted); }
.check p { margin: 0; font-size: .9rem; }
.check .check-title { font-weight: 700; font-size: .97rem; }
.check .check-exp, .check .check-note { color: var(--muted); }
.tag { margin-left: .4rem; font-size: .7rem; font-weight: 600; padding: .1rem .45rem; border-radius: 999px; background: var(--mist); color: var(--muted); vertical-align: .1em; }
.readings { display: grid; grid-template-columns: minmax(6.5rem, auto) 1fr; gap: .35rem 1rem; margin: 0; font-size: .88rem; }
.readings dt { color: var(--muted); }
.readings dd { margin: 0; overflow-wrap: anywhere; }
.raw summary { cursor: pointer; color: var(--muted); font-size: .88rem; margin-top: 1rem; }
pre { max-height: 22rem; overflow: auto; font-size: .7rem; background: var(--mist); padding: .75rem; border-radius: .75rem; }
.share-grid { display: grid; grid-template-columns: 9.5rem 1fr; gap: 1rem; align-items: start; }
.share-grid p { margin-top: 0; }
@media (max-width: 380px) { .share-grid { grid-template-columns: 1fr; } }
.qr { width: 100%; max-width: 11rem; background: #fff; padding: .35rem; border-radius: .7rem; }
.qr svg { display: block; width: 100%; height: auto; }
.next { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.fineprint { color: var(--muted); font-size: .8rem; margin: 1rem 0 1.5rem; }
.foot { color: var(--muted); font-size: .8rem; padding: 1rem 1rem 2rem; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
