/* ==========================================================================
   Driving Test Hero — swap platform design system
   ========================================================================== */

:root {
  --ink:       #0f172a;
  --ink-2:     #1e293b;
  --ink-3:     #334155;

  --brand:     #4f46e5;
  --brand-600: #4338ca;
  --brand-50:  #eef2ff;
  --brand-100: #e0e7ff;

  --swap:      #f59e0b;   /* the exchange accent */
  --swap-50:   #fffbeb;
  --swap-100:  #fef3c7;
  --swap-700:  #b45309;

  --ok:        #059669;
  --ok-50:     #ecfdf5;
  --ok-100:    #d1fae5;
  --ok-700:    #047857;

  --no:        #dc2626;
  --no-700:    #b91c1c;
  --no-50:     #fef2f2;
  --no-100:    #fee2e2;

  --bg:        #ffffff;
  --bg-soft:   #f8fafc;
  --bg-soft-2: #f1f5f9;
  --line:      #e2e8f0;
  --line-2:    #cbd5e1;
  --text:      #1e293b;
  --muted:     #64748b;
  --muted-2:   #94a3b8;

  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --r-xl: 28px;

  --sh-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.07);
  --sh:    0 4px 10px rgba(15,23,42,.06), 0 12px 30px rgba(15,23,42,.08);
  --sh-lg: 0 20px 50px rgba(15,23,42,.16);

  --wrap: 1160px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.62;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { color: var(--ink); line-height: 1.16; margin: 0 0 .5em; letter-spacing: -.021em; }
h1 { font-size: clamp(2.1rem, 1.35rem + 3vw, 3.4rem); font-weight: 800; letter-spacing: -.035em; }
h2 { font-size: clamp(1.55rem, 1.15rem + 1.6vw, 2.25rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 1.05em; }
ul, ol { margin: 0 0 1.05em; padding-left: 1.25em; }
li { margin: .32em 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.4rem 0; }
code { font-family: var(--mono); font-size: .9em; background: var(--bg-soft-2); padding: .12em .4em; border-radius: 5px; }

:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 200; background: var(--ink); color: #fff; padding: .8rem 1.2rem; }
.skip-link:focus { left: 0; }

/* Layout ------------------------------------------------------------------ */
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 2.5rem, 780px); margin-inline: auto; }
.section { padding: clamp(3rem, 5.5vw, 5rem) 0; }
.section--soft { background: var(--bg-soft); }
.section--tight { padding: clamp(1.8rem, 3.5vw, 2.8rem) 0; }
.center { text-align: center; }

.grid { display: grid; gap: 1.35rem; }
@media (min-width: 720px)  { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 720px)  { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 620px)  { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }

.section-head { max-width: 680px; margin-bottom: 2.2rem; }
.section-head.center { margin-inline: auto; }
.section-head p { color: var(--muted); font-size: 1.05rem; margin-bottom: 0; }
.eyebrow { display: inline-block; font-size: .77rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; color: var(--brand); margin-bottom: .6rem; }
.lede { font-size: 1.13rem; color: var(--muted); }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mt-0{margin-top:0}.mb-0{margin-bottom:0}.mt-1{margin-top:.6rem}.mt-2{margin-top:1.2rem}.mt-3{margin-top:2rem}.mb-1{margin-bottom:.6rem}.mb-2{margin-bottom:1.2rem}.mb-3{margin-bottom:2rem}

/* Header ------------------------------------------------------------------ */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.9); backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--line); }
.site-header .bar { display: flex; align-items: center; gap: 1rem; height: 70px; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; color: var(--ink); font-size: 1.05rem; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 34px; height: 34px; flex: none; }
.brand .tail { color: var(--brand); }
.brand .wordmark { white-space: nowrap; }

.nav { display: none; margin-left: auto; align-items: center; gap: .2rem; }
@media (min-width: 1080px) { .nav { display: flex; } }
.nav a { color: var(--muted); font-weight: 600; font-size: .94rem; padding: .5rem .7rem; border-radius: var(--r-sm); }
.nav a:hover { color: var(--ink); background: var(--bg-soft); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--brand); background: var(--brand-50); }
.nav .btn { margin-left: .45rem; }

.nav-toggle { margin-left: auto; background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-sm); width: 44px; height: 42px; display: grid; place-items: center; cursor: pointer; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { content: ""; display: block; width: 19px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .18s ease; }
.nav-toggle span::before { transform: translateY(-6px); }
.nav-toggle span::after { transform: translateY(4px); }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: rotate(-45deg) translateY(-1px); }
@media (min-width: 1080px) { .nav-toggle { display: none; } }

.mobile-nav { display: none; border-top: 1px solid var(--line); background: #fff; padding: .7rem 0 1.3rem; }
.mobile-nav.open { display: block; }
@media (min-width: 1080px) { .mobile-nav { display: none !important; } }
.mobile-nav a { display: block; padding: .72rem .2rem; font-weight: 600; color: var(--ink); border-bottom: 1px solid var(--line); }
.mobile-nav .btn { margin-top: 1rem; width: 100%; border-bottom: 0; }

/* Buttons ----------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 700; font-size: .96rem;
  padding: .78rem 1.3rem; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; text-align: center; transition: transform .12s ease, background .18s ease, box-shadow .18s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(79,70,229,.28); }
.btn-primary:hover { background: var(--brand-600); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line-2); box-shadow: var(--sh-sm); }
.btn-ghost:hover { border-color: var(--ink-3); color: var(--ink); }
.btn-swap { background: var(--swap); color: #3b2400; box-shadow: 0 6px 16px rgba(245,158,11,.3); }
.btn-swap:hover { background: #e08c07; color: #3b2400; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover { background: var(--ok-700); color: #fff; }
.btn-lg { padding: .98rem 1.7rem; font-size: 1.04rem; }
.btn-sm { padding: .48rem .95rem; font-size: .86rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.nav a.btn-primary, .mobile-nav a.btn-primary, .nav a.btn-primary:hover, .mobile-nav a.btn-primary:hover { color: #fff; background: var(--brand); }
.nav a.btn-primary:hover { background: var(--brand-600); }
.nav a.btn-ghost, .mobile-nav a.btn-ghost { color: var(--ink); background: #fff; }

/* Cards ------------------------------------------------------------------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.5rem; box-shadow: var(--sh-sm); }
.card h3 { margin-bottom: .4rem; }
.card p:last-child { margin-bottom: 0; }
.card-meta { color: var(--muted); font-size: .93rem; }
.card--link { display: block; color: inherit; transition: transform .16s ease, box-shadow .2s ease, border-color .2s ease; }
.card--link:hover { transform: translateY(-3px); box-shadow: var(--sh); border-color: var(--line-2); text-decoration: none; }

.icon-badge { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); margin-bottom: .9rem; font-size: 1.25rem; font-weight: 800; }
.icon-badge.amber { background: var(--swap-100); color: var(--swap-700); }
.icon-badge.green { background: var(--ok-100); color: var(--ok-700); }
.icon-badge.red { background: var(--no-100); color: var(--no); }

/* Hero -------------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden; border-bottom: 1px solid var(--line);
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(79,70,229,.15), transparent 60%),
    radial-gradient(800px 420px at 5% 10%, rgba(245,158,11,.15), transparent 58%),
    linear-gradient(180deg, #fcfcff 0%, #ffffff 70%);
}
.hero-grid { display: grid; gap: 2.4rem; padding: clamp(2.6rem, 5vw, 4.5rem) 0; align-items: center; }
@media (min-width: 1000px) { .hero-grid { grid-template-columns: 1.03fr .97fr; gap: 3.2rem; } }
.hero p.lede { font-size: 1.16rem; max-width: 34em; }
.hero-points { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .5rem; }
.hero-points li { display: flex; gap: .55rem; align-items: flex-start; color: var(--muted); font-size: .97rem; }
.tick { color: var(--ok); font-weight: 900; }

/* Stats ------------------------------------------------------------------- */
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1.15rem 1.3rem; box-shadow: var(--sh-sm); }
.stat .num { font-size: 1.95rem; font-weight: 800; color: var(--ink); letter-spacing: -.03em; line-height: 1.1; }
.stat .num.brand { color: var(--brand); }
.stat .num.ok { color: var(--ok); }
.stat .num.amber { color: var(--swap-700); }
.stat .lbl { color: var(--muted); font-size: .88rem; margin-top: .2rem; }

/* Pills ------------------------------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: .35rem; background: var(--brand-50); color: var(--brand-600); font-size: .77rem; font-weight: 700; padding: .28rem .68rem; border-radius: 999px; }
.pill.green { background: var(--ok-50); color: var(--ok-700); }
.pill.amber { background: var(--swap-50); color: var(--swap-700); }
.pill.red   { background: var(--no-50); color: var(--no-700); }
.pill.grey  { background: var(--bg-soft-2); color: var(--muted); }

/* Callouts ---------------------------------------------------------------- */
.callout { border-left: 4px solid var(--brand); background: var(--bg-soft); border-radius: 0 var(--r) var(--r) 0; padding: 1rem 1.25rem; margin: 1.5rem 0; }
.callout.green { border-color: var(--ok); background: var(--ok-50); }
.callout.amber { border-color: var(--swap); background: var(--swap-50); }
.callout.red   { border-color: var(--no); background: var(--no-50); }
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--ink); }

/* Tables ------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-sm); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; background: #fff; }
th, td { text-align: left; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
th { background: var(--bg-soft); font-weight: 700; color: var(--ink); font-size: .87rem; }
tbody tr:last-child td { border-bottom: 0; }

/* Steps ------------------------------------------------------------------- */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; gap: 1rem; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 40px 1fr; gap: 0 1rem; align-items: start; margin: 0; }
.steps li::before { grid-column: 1; grid-row: 1 / span 2; }
.steps li > h4 { grid-column: 2; }
.steps li > p { grid-column: 2; }
.steps li::before { content: counter(step); width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: .92rem; }
.steps li h4 { margin-bottom: .18rem; }
.steps li p { margin-bottom: 0; color: var(--muted); font-size: .95rem; }
.steps.amber li::before { background: var(--swap); color: #3b2400; }

/* FAQ --------------------------------------------------------------------- */
details.faq { border: 1px solid var(--line); border-radius: var(--r); background: #fff; margin-bottom: .75rem; box-shadow: var(--sh-sm); }
details.faq summary { cursor: pointer; list-style: none; padding: 1rem 1.2rem; font-weight: 700; color: var(--ink); display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; font-size: 1.3rem; color: var(--muted); line-height: 1; }
details.faq[open] summary::after { content: "\2212"; }
details.faq .faq-body { padding: 0 1.2rem 1.1rem; color: var(--muted); }
details.faq .faq-body p:last-child { margin-bottom: 0; }

/* CTA band ---------------------------------------------------------------- */
.cta-band { background: linear-gradient(135deg, var(--ink) 0%, #1e2a55 55%, #312e81 100%); color: #fff; border-radius: var(--r-xl); padding: clamp(2rem, 4vw, 3rem); text-align: center; box-shadow: var(--sh-lg); }
.cta-band h2 { color: #fff; }
.cta-band p { color: #c7d2fe; max-width: 48ch; margin-inline: auto; }
.cta-band .btn-row { justify-content: center; margin-top: 1.5rem; }

/* Footer ------------------------------------------------------------------ */
.site-footer { background: var(--ink); color: #a9b6cc; padding: 3.2rem 0 2rem; }
.site-footer h4 { color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .11em; margin-bottom: .9rem; }
.site-footer a { color: #a9b6cc; font-size: .94rem; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: .42rem 0; }
.footer-grid { display: grid; gap: 2rem; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }
.site-footer .brand { color: #fff; margin-bottom: .8rem; }
.footer-note { border-top: 1px solid rgba(255,255,255,.12); margin-top: 2.3rem; padding-top: 1.3rem; font-size: .85rem; color: #7f8fab; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }

/* ==========================================================================
   Swap-specific components
   ========================================================================== */

/* Slot card — a test booking rendered as an object */
.slot {
  border: 1px solid var(--line); border-radius: var(--r); background: #fff;
  padding: .85rem 1rem; display: grid; gap: .1rem; min-width: 0;
}
.slot .slot-date { font-weight: 800; color: var(--ink); font-size: 1.02rem; letter-spacing: -.01em; }
.slot .slot-time { font-variant-numeric: tabular-nums; }
.slot .slot-centre { color: var(--muted); font-size: .9rem; }
.slot.mine { border-color: var(--brand); background: var(--brand-50); }
.slot.theirs { border-color: var(--swap); background: var(--swap-50); }

/* The exchange row: my slot ⇄ their slot */
.exchange { display: grid; gap: .6rem; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 620px) { .exchange { grid-template-columns: 1fr 44px 1fr; } }
.exchange .arrows {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--ink); color: #fff; font-size: 1.05rem; font-weight: 800; margin-inline: auto;
}

/* Match card */
.match {
  border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff;
  box-shadow: var(--sh-sm); padding: 1.15rem 1.25rem; margin-bottom: 1rem;
  transition: box-shadow .2s ease, border-color .2s ease;
}
.match:hover { box-shadow: var(--sh); border-color: var(--line-2); }
.match.top { border-color: var(--ok); box-shadow: 0 0 0 3px var(--ok-50), var(--sh-sm); }
.match-head { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-bottom: .9rem; }
.match-head .who { font-weight: 700; color: var(--ink); }
.match-head .spacer { margin-left: auto; }
.score {
  display: inline-flex; align-items: baseline; gap: .15rem; font-weight: 800; font-size: .95rem;
  background: var(--ok-50); color: var(--ok-700); padding: .25rem .65rem; border-radius: 999px;
}
.score.mid { background: var(--swap-50); color: var(--swap-700); }
.score.low { background: var(--bg-soft-2); color: var(--muted); }
.match-gain { font-size: .92rem; color: var(--ok-700); font-weight: 700; }
.match-foot { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1rem; }
.match-foot .spacer { margin-left: auto; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--brand-100); color: var(--brand-600); font-weight: 800; font-size: .85rem;
}

/* Eligibility checklist inside a match */
.elig { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-size: .84rem; color: var(--muted); margin-top: .75rem; }
.elig span { display: inline-flex; align-items: center; gap: .3rem; }
.elig .yes { color: var(--ok-700); font-weight: 700; }
.elig .no  { color: var(--no); font-weight: 700; }

/* Chain diagram */
.chain { display: grid; gap: .5rem; margin: .9rem 0; }
.chain-row { display: grid; grid-template-columns: 34px 1fr; gap: .75rem; align-items: center; }
.chain-row .node { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .82rem; background: var(--brand-100); color: var(--brand-600); }
.chain-row .node.you { background: var(--brand); color: #fff; }
.chain-row .desc { font-size: .93rem; color: var(--muted); }
.chain-row .desc strong { color: var(--ink); }

/* Forms ------------------------------------------------------------------- */
.field { display: block; margin-bottom: 1rem; }
.field > .label { display: block; font-weight: 700; font-size: .88rem; color: var(--ink); margin-bottom: .35rem; }
.field .hint { display: block; font-size: .82rem; color: var(--muted); margin-top: .3rem; }
input[type="text"], input[type="date"], input[type="time"], input[type="number"], input[type="search"], select, textarea {
  width: 100%; padding: .62rem .8rem; border: 1px solid var(--line-2); border-radius: 10px;
  font: inherit; font-size: .95rem; color: var(--text); background: #fff;
}
select[multiple] { padding: .4rem; }
textarea { min-height: 84px; resize: vertical; }
.field-row { display: grid; gap: .8rem; }
@media (min-width: 560px) { .field-row.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (min-width: 560px) { .field-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.checks { display: grid; gap: .4rem; }
.check { display: flex; gap: .55rem; align-items: flex-start; font-size: .93rem; padding: .4rem .55rem; border-radius: 8px; }
.check:hover { background: var(--bg-soft); }
.check input { margin-top: .22rem; flex: none; width: 18px; height: 18px; accent-color: var(--brand); }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh); padding: 1.4rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel-head h3 { margin: 0; font-size: 1.02rem; }

/* Tabs -------------------------------------------------------------------- */
.tabs { display: flex; flex-wrap: wrap; gap: .4rem; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; }
.tab {
  background: none; border: 0; border-bottom: 3px solid transparent; font: inherit; font-weight: 700;
  font-size: .95rem; color: var(--muted); padding: .7rem .9rem; cursor: pointer; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.tab .count { display: inline-block; background: var(--bg-soft-2); color: var(--muted); border-radius: 999px; font-size: .76rem; padding: .05rem .45rem; margin-left: .35rem; }
.tab[aria-selected="true"] .count { background: var(--brand-100); color: var(--brand-600); }

/* Search layout ----------------------------------------------------------- */
.finder { display: grid; gap: 1.6rem; align-items: start; }
/* Below the two-column breakpoint the form would otherwise span the whole
   container, stretching a select to 800px on a tablet. Cap it. */
@media (max-width: 999px) { .finder .side { max-width: 540px; } }
/* The alert card sits in the wide results column; keep its inputs sensible too. */
#alert-card .field-row.two { max-width: 560px; }
@media (min-width: 1000px) { .finder { grid-template-columns: 340px 1fr; gap: 2rem; } }
@media (min-width: 1000px) { .finder .side { position: sticky; top: 88px; } }

.empty { border: 1px dashed var(--line-2); border-radius: var(--r-lg); padding: 2.4rem 1.5rem; text-align: center; color: var(--muted); background: var(--bg-soft); }
.empty h3 { color: var(--ink); }

/* Call runbook ------------------------------------------------------------ */
.runbook { counter-reset: rb; display: grid; gap: .8rem; }
.rb-step {
  display: grid; grid-template-columns: 34px 1fr; gap: .9rem; align-items: start;
  border: 1px solid var(--line); border-radius: var(--r); background: #fff; padding: .95rem 1.1rem;
}
.rb-step.done { background: var(--ok-50); border-color: var(--ok-100); }
.rb-step .n { counter-increment: rb; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .82rem; }
.rb-step.done .n { background: var(--ok); }
.rb-step h4 { margin-bottom: .15rem; }
.rb-step p { margin: 0; font-size: .93rem; color: var(--muted); }
.rb-step .say { display: block; margin-top: .5rem; padding: .6rem .8rem; background: var(--bg-soft); border-left: 3px solid var(--line-2); border-radius: 0 8px 8px 0; font-size: .9rem; color: var(--ink); }

.phone-card { background: var(--ink); color: #fff; border-radius: var(--r-lg); padding: 1.3rem 1.4rem; }
.phone-card .num { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.phone-card .meta { color: #a9b6cc; font-size: .9rem; }

/* Reference reveal -------------------------------------------------------- */
.ref-box { border: 1px dashed var(--line-2); border-radius: var(--r); padding: 1rem 1.15rem; background: var(--bg-soft); }
.ref-value { font-family: var(--mono); font-size: 1.25rem; font-weight: 700; letter-spacing: .06em; color: var(--ink); }
.ref-masked { color: var(--muted-2); letter-spacing: .3em; }

/* Message thread ---------------------------------------------------------- */
.thread { display: grid; gap: .6rem; margin-bottom: 1rem; max-height: 300px; overflow-y: auto; padding-right: .3rem; }
.msg { max-width: 82%; padding: .6rem .85rem; border-radius: 14px; font-size: .93rem; }
.msg.them { background: var(--bg-soft-2); border-bottom-left-radius: 4px; }
.msg.me { background: var(--brand); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.msg .when { display: block; font-size: .74rem; opacity: .7; margin-top: .2rem; }

/* Timeline --------------------------------------------------------------- */
.timeline { border-left: 2px solid var(--line); padding-left: 1.2rem; display: grid; gap: 1.1rem; margin-left: .4rem; }
.tl { position: relative; }
.tl::before { content: ""; position: absolute; left: -1.63rem; top: .35rem; width: 12px; height: 12px; border-radius: 50%; background: var(--line-2); border: 2px solid #fff; }
.tl.done::before { background: var(--ok); }
.tl.now::before { background: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.tl h4 { margin-bottom: .1rem; }
.tl p { margin: 0; font-size: .92rem; color: var(--muted); }

/* Deadline banner --------------------------------------------------------- */
.deadline { display: flex; flex-wrap: wrap; gap: .8rem 1.4rem; align-items: center; border-radius: var(--r); padding: .9rem 1.15rem; font-size: .94rem; }
.deadline.ok { background: var(--ok-50); border: 1px solid var(--ok-100); color: var(--ok-700); }
.deadline.warn { background: var(--swap-50); border: 1px solid var(--swap-100); color: var(--swap-700); }
.deadline.bad { background: var(--no-50); border: 1px solid var(--no-100); color: var(--no-700); }
.deadline strong { font-weight: 800; }

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

/* ==========================================================================
   v2 — soft matching, demand, alerts, outcome loop, safety
   ========================================================================== */

/* Day-of-week picker */
.daypick { display: flex; flex-wrap: wrap; gap: .3rem; }
.daypick label { position: relative; }
.daypick input { position: absolute; opacity: 0; width: 0; height: 0; }
.daypick span {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 9px;
  border: 1px solid var(--line-2); background: #fff; font-size: .83rem; font-weight: 700;
  color: var(--muted); cursor: pointer; user-select: none;
}
.daypick span:hover { border-color: var(--ink-3); color: var(--ink); }
.daypick input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.daypick input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }

/* Near-miss notes on a match */
.notes { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .7rem; }
.note {
  display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 600;
  background: var(--swap-50); color: var(--swap-700); border: 1px solid var(--swap-100);
  padding: .2rem .55rem; border-radius: 999px;
}
.note.exact { background: var(--ok-50); color: var(--ok-700); border-color: var(--ok-100); }

/* Demand board */
.demand-row {
  display: grid; grid-template-columns: 1fr auto; gap: .5rem 1rem; align-items: center;
  padding: .55rem 0; border-bottom: 1px solid var(--line);
}
.demand-row:last-child { border-bottom: 0; }
.demand-row .cname { font-weight: 700; font-size: .92rem; color: var(--ink); }
.demand-row .csub { font-size: .8rem; color: var(--muted); }
.demand-row .cnum { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--brand); font-size: 1.05rem; text-align: right; }
.demand-bar { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--bg-soft-2); overflow: hidden; display: flex; }
.demand-bar i { display: block; height: 100%; }
.demand-bar i.early { background: var(--ok); }
.demand-bar i.late { background: var(--swap); }
.demand-key { display: flex; gap: .9rem; font-size: .78rem; color: var(--muted); margin-top: .6rem; }
.demand-key b { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: .3rem; }
.demand-key b.early { background: var(--ok); }
.demand-key b.late { background: var(--swap); }

/* Outcome loop */
.outcome { border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; padding: 1.3rem; }
.outcome h3 { margin-bottom: .3rem; }
.outcome .btn-row { margin-top: 1rem; }
.outcome-result { border-radius: var(--r); padding: 1rem 1.15rem; margin-top: 1rem; font-size: .95rem; }
.outcome-result.win { background: var(--ok-50); border: 1px solid var(--ok-100); }
.outcome-result.lose { background: var(--swap-50); border: 1px solid var(--swap-100); }

/* Call-slot picker */
.slotgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: .5rem; margin-top: .8rem; }
.slotgrid label { position: relative; }
.slotgrid input { position: absolute; opacity: 0; width: 0; height: 0; }
.slotgrid span {
  display: block; text-align: center; padding: .6rem .4rem; border-radius: 10px;
  border: 1px solid var(--line-2); background: #fff; font-size: .87rem; font-weight: 600;
  color: var(--ink); cursor: pointer;
}
.slotgrid span small { display: block; color: var(--muted); font-weight: 500; font-size: .76rem; }
.slotgrid input:checked + span { background: var(--brand-50); border-color: var(--brand); color: var(--brand-600); }
.slotgrid input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }

/* Reveal budget + safety */
.budget { display: flex; align-items: center; gap: .5rem; font-size: .84rem; color: var(--muted); }
.budget .dots { display: flex; gap: .22rem; }
.budget .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); display: block; }
.budget .dots i.spent { background: var(--line-2); }

.report-btn {
  background: none; border: 0; font: inherit; font-size: .8rem; color: var(--muted);
  cursor: pointer; padding: .2rem .3rem; text-decoration: underline;
}
.report-btn:hover { color: var(--no); }

.trust { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 700; color: var(--ok-700); }

/* Mobile: the form is long, so give people a way straight to the matches. */
.jump-to-results {
  display: inline-flex; align-items: center; gap: .4rem; margin-bottom: 1rem;
  font-weight: 700; font-size: .95rem; color: var(--brand); text-decoration: none;
  min-height: 44px;
}
.jump-to-results:hover { text-decoration: underline; }
@media (min-width: 1000px) { .jump-to-results { display: none; } }

/* Collapsible preferences panel */
details.panel > summary.panel-toggle { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
details.panel > summary.panel-toggle::-webkit-details-marker { display: none; }
details.panel > summary.panel-toggle h3 { margin: 0; }
details.panel > summary.panel-toggle .toggle-mark { width: 12px; height: 12px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s ease; flex: none; margin-right: .2rem; }
details.panel[open] > summary.panel-toggle .toggle-mark { transform: rotate(225deg); }

/* Footer links: give thumbs a real target on mobile. */
.site-footer ul a, .footer-note a { display: inline-block; padding: .3rem 0; }

/* A form control never escapes its container, whatever its intrinsic width. */
.field input, .field select, .field textarea { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
