/* ============================================================================
 * Compass (Recommendations) — app.css
 * Written from scratch, round 3. Replaces the 299-line v1 sheet entirely.
 *
 * ⚠️ NO GOLD. The v2 plan said "gold medallion" and "gold rail" throughout.
 *    BRAND-VOICE-BIBLE section 9 rules out black-and-gold and turquoise by
 *    name, both previously rejected by Yosef. Every accent here is the
 *    brand orange. Do not
 *    reintroduce gold because a mock looks richer with it.
 *
 * ⚠️ EXACTLY TWO DARK SURFACES: the home stage and the top of the person
 *    screen. Three makes the app feel like a different product; zero puts us
 *    back at the flat v1 that was rejected. Count them before shipping.
 *
 * ⚠️ NO HEBREW IN THIS FILE. Every visible string comes from data.ui.
 *    Same contract as the JS files; build-dist.py fails the build otherwise.
 * ========================================================================== */

:root {
  --paper: #FDFBF7;
  --paper2: #F6EFE4;
  --card: #FFFFFF;
  --ink: #1C1610;
  --ink2: #4A3E30;
  --dim: #8A7A62;
  --line: #EFE8DC;
  --action: #E67E17;
  --action-d: #C2691A;
  --label: #1F72A8;
  --danger: #B3382C;
  --danger-bg: #F9E7E4;
  --warn-bg: #FBEEDD;
  --font: 'Heebo', system-ui, sans-serif;

  /* the dark register — derived from --ink, not a new hue */
  --stage: #16110B;
  --stage2: #241B12;
  --on-stage: #FBF6EE;
  --on-stage-dim: #B9A791;

  --r: 16px;
  --r-s: 10px;
  --pad: 18px;
  --shadow: 0 1px 2px rgba(28,22,16,.05), 0 8px 24px -12px rgba(28,22,16,.18);
  --shadow-lift: 0 2px 4px rgba(28,22,16,.06), 0 18px 40px -18px rgba(28,22,16,.30);
  --tap: 44px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* ⚠️ Every card here is a <button>, and a button may not legally contain a
   <div> — so its innards are spans. An inline span ignores width, height and
   text-overflow, which is why the first render showed rectangular thumbnails
   instead of circles, no graduate names at all, and each card's title and
   micro-copy welded into a single unreadable line. Declaring
   the display explicitly is not tidiness; it is what makes the layout exist. */
.strip-face, .strip-name,
.way-txt, .way-title, .way-micro, .way-coin, .way-go,
.hero-img, .hero-body, .hero-cap, .hero-name, .hero-role, .hero-why,
.face, .res-txt, .res-name, .res-role, .res-why, .res-moment { display: block; }
.res-moment { display: inline-flex; }
.face, .way-coin, .way-go, .strip-face { flex-shrink: 0; }

html, body {
  margin: 0; padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}
body { padding-bottom: env(safe-area-inset-bottom); }

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
img { max-width: 100%; display: block; }

:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ── boot ──────────────────────────────────────────────────────────────── */
#boot {
  position: fixed; inset: 0; z-index: 100;
  background: var(--paper);
  display: grid; place-items: center;
  transition: opacity .3s ease;
}
#boot.hide { opacity: 0; pointer-events: none; }
.boot-spin {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--action);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── app bar ───────────────────────────────────────────────────────────── */
#appbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: 10px var(--pad);
  padding-top: calc(10px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
#appbar.scrolled { border-bottom-color: var(--line); }
#appbar.on-stage {
  background: transparent; backdrop-filter: none; border-bottom-color: transparent;
}
.bar-btn {
  width: var(--tap); height: var(--tap); flex: 0 0 auto;
  display: grid; place-items: center; border-radius: 12px;
  color: var(--ink2);
}
.bar-btn:hover { background: var(--paper2); }
#appbar.on-stage .bar-btn { color: var(--on-stage); }
#appbar.on-stage .bar-btn:hover { background: rgba(255,255,255,.12); }
.bar-btn svg { width: 21px; height: 21px; }
.bar-title {
  flex: 1 1 auto; min-width: 0;
  font-size: 16px; font-weight: 600; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-count {
  font-size: 12px; font-weight: 600; color: var(--action);
  background: color-mix(in srgb, var(--action) 12%, transparent);
  border-radius: 999px; padding: 3px 9px;
}

/* ── screens ───────────────────────────────────────────────────────────────
   Every screen lives in the DOM from boot and is toggled. This is what kills
   the v1 flash: nothing is destroyed and rebuilt, so images never reload and
   scroll position survives a round trip. */
#app { min-height: 100vh; }
.screen { display: none; }
.screen.is-active { display: block; animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

.wrap { max-width: 780px; margin: 0 auto; padding: 0 var(--pad) 96px; }
.wrap-wide { max-width: 1180px; }

/* ══ 1. HOME — dark surface #1 ═══════════════════════════════════════════ */
.stage {
  position: relative;
  margin-top: calc(-1 * (var(--tap) + 20px + env(safe-area-inset-top)));
  padding: calc(var(--tap) + 34px + env(safe-area-inset-top)) var(--pad) 30px;
  background: var(--stage);
  color: var(--on-stage);
  overflow: hidden;
  isolation: isolate;
}
.stage::before {
  content: ''; position: absolute; inset: 0; z-index: -2;
  background: url('../img/brand/bg/bg-04.webp') center 28% / cover no-repeat;
  opacity: .52;
}
.stage::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(120% 78% at 50% 6%, rgba(230,126,23,.20), transparent 62%),
    linear-gradient(180deg, rgba(22,17,11,.30) 0%, rgba(22,17,11,.78) 62%, var(--stage) 100%);
}
.medallion {
  width: 62px; height: 62px; margin: 0 auto 14px;
  border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, #2E2216, #16110B 72%);
  box-shadow: 0 0 0 1px rgba(230,126,23,.42), 0 0 34px -6px rgba(230,126,23,.55);
}
.medallion img { width: 40px; height: 40px; object-fit: contain; }
.stage h1 {
  margin: 0; text-align: center;
  font-size: clamp(26px, 7.6vw, 38px); font-weight: 700; letter-spacing: -.025em;
}
.stage .promise {
  margin: 10px auto 0; max-width: 30ch; text-align: center;
  font-size: 15px; line-height: 1.6; color: var(--on-stage-dim);
}

/* the graduate strip — real people, one row, each one an entry point.
   ⚠️ Deliberately NOT a decorative face collage: BRAND-VOICE-BIBLE §9 rules
   out crowded face-collage banners. Every face here is tappable
   and carries a name, so it is content rather than wallpaper. */
.strip {
  display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none;
  margin: 24px calc(-1 * var(--pad)) 0; padding: 4px var(--pad) 6px;
  scroll-snap-type: x proximity;
}
.strip::-webkit-scrollbar { display: none; }
.strip-item {
  flex: 0 0 auto; width: 74px; text-align: center; scroll-snap-align: center;
}
.strip-face {
  width: 64px; height: 64px; margin: 0 auto 7px;
  border-radius: 50%; overflow: hidden; position: relative;
  background: var(--stage2);
  box-shadow: 0 0 0 1.5px rgba(251,246,238,.22);
  transition: box-shadow .18s, transform .18s;
}
.strip-item:hover .strip-face,
.strip-item:focus-visible .strip-face {
  box-shadow: 0 0 0 2px var(--action); transform: translateY(-2px);
}
.strip-face img { width: 100%; height: 100%; object-fit: cover; }
.strip-name {
  font-size: 11.5px; font-weight: 500; color: var(--on-stage-dim);
  line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── the three ways ─────────────────────────────────────────────────────── */
.ways-head {
  margin: 30px 0 12px; font-size: 13px; font-weight: 600;
  color: var(--dim); letter-spacing: .01em;
}
.ways { display: grid; gap: 11px; }
.way {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: start;
  padding: 15px 16px; border-radius: var(--r);
  background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.way:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: #E4D9C6; }
.way:active { transform: translateY(0); }
.way-coin {
  flex: 0 0 auto; width: 50px; height: 50px; border-radius: 14px;
  display: grid; place-items: center; background: var(--paper2);
}
.way-coin img { width: 34px; height: 34px; object-fit: contain; }
.way-txt { flex: 1 1 auto; min-width: 0; }
.way-title { font-size: 16.5px; font-weight: 600; letter-spacing: -.01em; }
.way-micro { font-size: 13px; color: var(--dim); line-height: 1.5; margin-top: 2px; }
.way-go { flex: 0 0 auto; color: var(--action); opacity: .55; }
.way:hover .way-go { opacity: 1; }
.way-go svg { width: 18px; height: 18px; }

/* ══ 2. INPUTS ═══════════════════════════════════════════════════════════ */
.section-head {
  margin: 26px 0 12px; font-size: 13px; font-weight: 600; color: var(--dim);
}
.field { position: relative; margin-top: 18px; }
.field input, .field textarea {
  width: 100%; padding: 14px 16px; border-radius: var(--r);
  background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow); resize: none;
  transition: border-color .18s, box-shadow .18s;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: color-mix(in srgb, var(--action) 55%, var(--line));
  box-shadow: var(--shadow), 0 0 0 3px color-mix(in srgb, var(--action) 14%, transparent);
}
.field textarea { min-height: 116px; line-height: 1.6; }
/* The native search clear button renders as an oversized glyph pinned to the
   wrong edge in RTL. The app has its own empty state; this one only adds
   noise. */
.field input[type="search"]::-webkit-search-cancel-button,
.field input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.field-hint { font-size: 12.5px; color: var(--dim); margin-top: 8px; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pill {
  padding: 7px 13px; border-radius: 999px; font-size: 13.5px; font-weight: 500;
  background: var(--card); border: 1px solid var(--line); color: var(--ink2);
  transition: all .15s;
}
.pill:hover { border-color: var(--action); color: var(--action-d); }
.pill.on {
  background: var(--action); border-color: var(--action); color: #fff;
  box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--action) 60%, transparent);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 22px; border-radius: 999px;
  font-size: 15.5px; font-weight: 600;
  background: var(--action); color: #fff;
  box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--action) 70%, transparent);
  transition: background .15s, transform .12s;
}
.btn:hover { background: var(--action-d); }
.btn:active { transform: scale(.985); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-ghost {
  background: var(--card); color: var(--ink2); border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.btn-ghost:hover { background: var(--paper2); }
.btn-block { display: flex; width: 100%; }
/* ⚠️ No CTA ever sits on the bottom edge — standing rule. */
.cta-row { margin: 22px 0 30px; }

/* ── the lead accordion — the fix for the "cluttered" verdict ────────────
   25 chips laid flat is the single most cluttered thing in v1. Four labelled
   rows, one open at a time, turns the same 25 into a question being asked. */
.acc { margin-top: 16px; border-radius: var(--r); overflow: hidden;
       border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); }
.acc-row + .acc-row { border-top: 1px solid var(--line); }
.acc-head {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: start;
  padding: 13px 16px; min-height: var(--tap);
}
.acc-label { flex: 1 1 auto; font-size: 14.5px; font-weight: 600; }
.acc-value { font-size: 13px; color: var(--action); font-weight: 500; }
.acc-value.empty { color: var(--dim); font-weight: 400; }
.acc-chev { color: var(--dim); transition: transform .2s; }
.acc-chev svg { width: 16px; height: 16px; }
.acc-row.open .acc-chev { transform: rotate(180deg); }
.acc-body { display: none; padding: 2px 16px 16px; }
.acc-row.open .acc-body { display: block; }

/* ══ 3. RESULTS ══════════════════════════════════════════════════════════ */
.reason {
  display: flex; gap: 9px; align-items: flex-start;
  margin: 16px 0 6px; padding: 12px 14px;
  border-radius: var(--r-s); background: var(--paper2);
  font-size: 13.5px; line-height: 1.55; color: var(--ink2);
}
.reason svg { flex: 0 0 auto; width: 16px; height: 16px; color: var(--action); margin-top: 2px; }
.hint-line { font-size: 12.5px; color: var(--dim); margin: 14px 0 10px; }

.results { display: grid; gap: 12px; }

/* #1 — the hero. Composition carries rank, not a 1-to-5 score beside a
   person's name. See the "strength dots" note in the plan. */
.hero {
  display: block; width: 100%; text-align: start;
  border-radius: var(--r); overflow: hidden; background: var(--card);
  border: 1px solid var(--line); box-shadow: var(--shadow-lift);
  transition: transform .16s;
}
.hero:hover { transform: translateY(-2px); }
.hero-img { position: relative; aspect-ratio: 16/9; background: var(--paper2); }
.hero-img img { width: 100%; height: 100%; object-fit: cover; }
.hero-img::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 44%, rgba(22,17,11,.86) 100%);
}
.hero-cap { position: absolute; inset-inline: 16px; bottom: 13px; z-index: 1; color: #fff; }
.hero-name { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.hero-role { font-size: 13px; color: rgba(255,255,255,.82); margin-top: 1px; }
.hero-body { padding: 14px 16px 16px; }
.hero-why { font-size: 14px; line-height: 1.6; color: var(--ink2); }

.rescard {
  display: flex; gap: 13px; width: 100%; text-align: start; align-items: center;
  padding: 12px; border-radius: var(--r); background: var(--card);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform .14s, box-shadow .14s;
}
.rescard:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.face {
  flex: 0 0 auto; width: 58px; height: 58px; border-radius: 13px;
  overflow: hidden; background: var(--paper2); position: relative;
}
/* ⚠️ position + z-index on the image is load-bearing, not decoration. The
   monogram underneath is absolutely positioned, and a positioned element
   paints ABOVE a static one no matter what the DOM order says — so without
   this the fallback letter covered every thumbnail that had loaded perfectly
   well, and the whole result list read as a column of grey initials. */
.face img {
  width: 100%; height: 100%; object-fit: cover;
  position: relative; z-index: 1;
}
.face .mono {
  position: absolute; inset: 0; z-index: 0; display: grid; place-items: center;
  font-size: 20px; font-weight: 700; color: var(--dim); background: var(--paper2);
}
.res-txt { flex: 1 1 auto; min-width: 0; }
.res-name { font-size: 15.5px; font-weight: 600; letter-spacing: -.01em; }
.res-role {
  font-size: 12.5px; color: var(--dim); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.res-why { font-size: 13px; color: var(--ink2); margin-top: 5px; line-height: 1.5; }
.res-moment {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 6px;
  font-size: 12px; font-weight: 600; color: var(--action);
}
.res-moment svg { width: 13px; height: 13px; }

.resrow {
  display: flex; gap: 12px; align-items: center; width: 100%; text-align: start;
  padding: 10px 12px; border-radius: var(--r-s);
  background: transparent; border: 1px solid transparent;
  transition: background .14s;
}
.resrow:hover { background: var(--card); border-color: var(--line); }
.resrow .face { width: 42px; height: 42px; border-radius: 10px; }
.resrow .res-name { font-size: 14.5px; }

.more-row { margin-top: 18px; display: flex; justify-content: center; }

/* ══ 4. PERSON SCREEN — dark surface #2, and the heart of the app ════════ */
.portrait {
  position: relative;
  margin-top: calc(-1 * (var(--tap) + 20px + env(safe-area-inset-top)));
  height: 56svh; min-height: 300px; max-height: 460px;
  background: var(--stage); overflow: hidden;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center 28%; }
.portrait::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(22,17,11,.62) 0%, rgba(22,17,11,.10) 32%,
    rgba(22,17,11,.72) 78%, var(--stage) 100%);
}
.portrait-cap {
  position: absolute; inset-inline: var(--pad); bottom: 18px; z-index: 1;
  color: var(--on-stage);
}
.portrait-name {
  font-size: clamp(26px, 7.4vw, 34px); font-weight: 700; letter-spacing: -.025em;
  line-height: 1.15;
}
.portrait-role {
  margin-top: 5px; font-size: 13.5px; font-weight: 500; color: var(--action);
}
.play-badge {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 12px;
  padding: 8px 15px 8px 12px; border-radius: 999px;
  background: var(--action); color: #fff; font-size: 13.5px; font-weight: 600;
  box-shadow: 0 0 30px -6px color-mix(in srgb, var(--action) 80%, transparent);
}
.play-badge svg { width: 15px; height: 15px; }

.person-body { background: var(--paper); border-radius: 20px 20px 0 0; margin-top: -16px;
                position: relative; z-index: 2; padding-top: 22px; }

.bigquote {
  margin: 0 0 22px; padding: 18px 18px 18px 20px;
  border-radius: var(--r); background: var(--card);
  border: 1px solid var(--line); border-inline-start: 3px solid var(--action);
  box-shadow: var(--shadow);
}
.bigquote p {
  margin: 0; font-size: 18px; line-height: 1.62; font-weight: 500;
  letter-spacing: -.012em;
}
.bigquote cite {
  display: block; margin-top: 9px; font-style: normal;
  font-size: 12.5px; color: var(--dim);
}

.story { display: grid; gap: 16px; }
.story-block h3 {
  margin: 0 0 5px; font-size: 12px; font-weight: 700; color: var(--action);
  letter-spacing: .04em; text-transform: none;
}
.story-block p { margin: 0; font-size: 14.5px; line-height: 1.65; color: var(--ink2); }

/* ── the moment rail ──────────────────────────────────────────────────────
   The rail's height is proportional to the video's real duration and every
   stop sits at its true time, so the eye reads "three moments, all late in a
   long talk" before reading a single word. */
.rail-head {
  display: flex; align-items: baseline; gap: 9px; margin: 30px 0 4px;
}
.rail-head h2 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.015em; }
.rail-head span { font-size: 12.5px; color: var(--dim); }

.rail { position: relative; margin-top: 16px; padding-inline-start: 26px; }
.rail::before {
  content: ''; position: absolute; inset-block: 6px; inset-inline-start: 5px;
  width: 2px; border-radius: 2px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--action) 70%, transparent),
    color-mix(in srgb, var(--action) 18%, transparent));
}
.stop { position: relative; padding-bottom: 16px; }
.stop::before {
  content: ''; position: absolute; inset-inline-start: -26px; top: 7px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--paper); border: 2.5px solid var(--action);
  box-shadow: 0 0 0 4px var(--paper);
}
.stop-card {
  border-radius: var(--r); background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow); padding: 13px 15px 14px;
}
.stop-top { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.stop-time {
  font-size: 12.5px; font-weight: 700; color: var(--action);
  font-variant-numeric: tabular-nums;
}
.stop-len { font-size: 11.5px; color: var(--dim); }
.stop-title { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.stop-desc { font-size: 13.5px; line-height: 1.55; color: var(--ink2); margin-top: 4px; }
.stop-quote {
  margin-top: 9px; padding: 9px 12px; border-radius: var(--r-s);
  background: var(--paper2); font-size: 13.5px; line-height: 1.55;
}
.stop-actions { display: flex; gap: 8px; margin-top: 11px; flex-wrap: wrap; }
.stop-actions .btn { min-height: 38px; padding: 0 16px; font-size: 13.5px; }

/* ══ 5. LEADS ════════════════════════════════════════════════════════════ */
.lead-card {
  border-radius: var(--r); background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 11px;
}
.lead-top { display: flex; align-items: center; gap: 10px; }
.lead-name { flex: 1 1 auto; font-size: 15.5px; font-weight: 600; }
.lead-date { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.lead-said { font-size: 13.5px; color: var(--ink2); margin-top: 6px; line-height: 1.55; }
.lead-sent { display: flex; gap: 7px; margin-top: 11px; flex-wrap: wrap; }
.lead-sent .face { width: 34px; height: 34px; border-radius: 9px; }
.outcome { display: flex; gap: 7px; margin-top: 12px; }
.outcome .pill { font-size: 12.5px; padding: 6px 12px; }
.bubble {
  margin-top: 11px; padding: 11px 14px; border-radius: 14px 14px 14px 4px;
  background: #E7F5E4; border: 1px solid #CFE8C9;
  font-size: 13.5px; line-height: 1.6; white-space: pre-wrap;
}

/* ══ 6. SHEET + TOAST ════════════════════════════════════════════════════ */
#sheet-root:empty, #toast-root:empty { display: none; }
.scrim {
  position: fixed; inset: 0; z-index: 60; background: rgba(22,17,11,.46);
  backdrop-filter: blur(2px); animation: fade .2s ease;
}
.sheet {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 61;
  max-width: 560px; margin: 0 auto;
  background: var(--paper); border-radius: 22px 22px 0 0;
  padding: 8px var(--pad) calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -18px 50px -20px rgba(22,17,11,.5);
  animation: rise .26s cubic-bezier(.22,1,.36,1);
  max-height: 88svh; overflow-y: auto;
}
@keyframes rise { from { transform: translateY(100%); } }
.sheet-grab {
  width: 38px; height: 4px; border-radius: 4px; background: var(--line);
  margin: 4px auto 14px;
}
.sheet h2 { margin: 0 0 8px; font-size: 18px; font-weight: 700; }
.sheet p { margin: 0 0 16px; font-size: 14.5px; line-height: 1.6; color: var(--ink2); }
.sheet-actions { display: grid; gap: 9px; }

.toast {
  position: fixed; inset-inline: 0; bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 70; display: flex; justify-content: center; pointer-events: none;
}
.toast span {
  background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 500;
  padding: 11px 20px; border-radius: 999px; box-shadow: var(--shadow-lift);
  animation: fade .2s ease;
}

/* ══ 7. STATES ═══════════════════════════════════════════════════════════ */
.empty-state { text-align: center; padding: 44px 10px; }
.empty-state h2 { margin: 0 0 8px; font-size: 18px; font-weight: 700; }
.empty-state p { margin: 0 auto 18px; max-width: 34ch; font-size: 14.5px; color: var(--dim); line-height: 1.6; }
.skeleton {
  border-radius: var(--r); background:
    linear-gradient(90deg, var(--paper2) 25%, #FBF6EC 50%, var(--paper2) 75%);
  background-size: 300% 100%; animation: shimmer 1.3s ease infinite;
}
@keyframes shimmer { to { background-position: -300% 0; } }
.sk-card { height: 84px; }

/* ══ 8. SMART SWITCH ═════════════════════════════════════════════════════ */
.smart {
  display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto;
  padding: 6px 11px 6px 8px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card);
  font-size: 12.5px; font-weight: 600; color: var(--dim);
  transition: all .18s;
}
.smart .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--line);
  transition: background .18s, box-shadow .18s;
}
.smart.on {
  color: var(--action-d); border-color: color-mix(in srgb, var(--action) 45%, var(--line));
  background: color-mix(in srgb, var(--action) 9%, var(--card));
}
.smart.on .dot {
  background: var(--action);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--action) 22%, transparent);
}
.smart.busy .dot { animation: pulse .9s ease infinite; }
@keyframes pulse { 50% { opacity: .3; } }
#appbar.on-stage .smart {
  background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.20);
  color: var(--on-stage-dim);
}
#appbar.on-stage .smart.on { color: #fff; background: rgba(230,126,23,.28);
                             border-color: rgba(230,126,23,.6); }

/* ══ 9. LAB — Yosef's instrument, not part of Arye's daily flow ══════════ */
.lab-cols { display: grid; gap: 14px; margin-top: 18px; }
.lab-col {
  border-radius: var(--r); border: 1px solid var(--line); background: var(--card);
  box-shadow: var(--shadow); overflow: hidden;
}
.lab-head {
  display: flex; align-items: baseline; gap: 8px;
  padding: 12px 15px; border-bottom: 1px solid var(--line); background: var(--paper2);
}
.lab-head h3 { margin: 0; font-size: 14.5px; font-weight: 700; }
.lab-ms { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; margin-inline-start: auto; }
.lab-list { padding: 8px; display: grid; gap: 2px; }
.lab-item { display: flex; gap: 9px; align-items: center; padding: 7px 8px; border-radius: 8px; font-size: 13px; }
.lab-item.only { background: var(--warn-bg); }
.lab-rank {
  flex: 0 0 auto; width: 19px; height: 19px; border-radius: 6px;
  display: grid; place-items: center; background: var(--paper2);
  font-size: 11px; font-weight: 700; color: var(--dim);
}
.lab-nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lab-note { font-size: 12.5px; color: var(--dim); padding: 0 15px 12px; }

/* ══ 10. WIDER SCREENS ═══════════════════════════════════════════════════ */
@media (min-width: 720px) {
  :root { --pad: 26px; }
  .stage { padding-bottom: 38px; border-radius: 0 0 26px 26px; }
  .ways { grid-template-columns: repeat(3, 1fr); }
  .way { flex-direction: column; align-items: flex-start; gap: 11px; padding: 18px; }
  .way-go { display: none; }
  .results { grid-template-columns: 1fr 1fr; }
  .hero { grid-column: 1 / -1; display: grid; grid-template-columns: 300px 1fr; }
  .hero-img { aspect-ratio: auto; height: 100%; }
  .hero-body { display: flex; flex-direction: column; justify-content: center; padding: 22px 24px; }
  /* Shorter on a wide screen: the source is a 16:9 video frame, so extra
     height buys wall rather than face, and pushes the story below the fold. */
  .portrait { height: 44svh; max-height: 420px; }
  .lab-cols { grid-template-columns: 1fr 1fr; }
  .person-body { border-radius: 26px 26px 0 0; }
}
@media (min-width: 1000px) {
  .results { grid-template-columns: repeat(3, 1fr); }
  .hero { grid-column: 1 / -1; grid-template-columns: 380px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
