/* ==========================================================================
   Prototype chrome — device frames, prototype bar, toaster, tour.
   Structural, brand-neutral. Copy into <POC>/assets/css/components.css and
   re-skin with the project's tokens. Requires the token contract.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Phone. A fixed 390x844 canvas scaled to always fit the viewport, so the
   whole device is visible without scrolling the browser. On a real handset
   the frame disappears and the app fills the screen.
   -------------------------------------------------------------------------- */
.phone-stage {
  --phone-fit: 1;
  height: 100dvh; overflow: hidden;
  display: grid; grid-template-columns: auto; place-content: center; place-items: center;
  column-gap: var(--s-10);
  padding: var(--s-4) var(--gutter) calc(var(--pocbar-h) + var(--s-4));
  background: var(--surface-2);
}
.phone {
  position: relative; flex: none;
  width: 390px; height: 844px;
  transform: scale(var(--phone-fit)); transform-origin: center;
  display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink);
  border: 10px solid #15130f; border-radius: 46px;
  box-shadow: 0 40px 80px -20px rgb(0 0 0 / 0.35), 0 0 0 1px rgb(0 0 0 / 0.08);
  overflow: hidden;
}
.phone::before {                      /* notch */
  content: ''; position: absolute; left: 50%; top: 10px; transform: translateX(-50%);
  width: 120px; height: 34px; background: #15130f; border-radius: 20px; z-index: 5;
}
.phone-status {
  display: flex; align-items: center; justify-content: space-between;
  height: 54px; padding: 12px 28px 0; font-size: var(--t-14); font-weight: 600; flex: none;
}
.phone-scroll {
  flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  scrollbar-width: none; position: relative; display: flex; flex-direction: column;
}
.phone-scroll::-webkit-scrollbar { display: none; }
.phone-scroll > * { flex-shrink: 0; }   /* or horizontal card rows collapse */
.phone-tabbar {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  height: 84px; padding: 8px 8px 24px; flex: none;
  border-top: 1px solid var(--line); background: var(--surface);
}
.phone-tabbar a {
  position: relative; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  font-size: 10.5px; font-weight: 600; color: var(--muted);
  border-radius: var(--r-ctl); min-height: 44px; text-decoration: none;
}
.phone-tabbar a .ico { width: 24px; height: 24px; }
.phone-tabbar a[aria-current="page"] { color: var(--primary); }
.phone-home {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
  width: 134px; height: 5px; border-radius: 3px; background: var(--ink); opacity: .9; z-index: 4;
}
.phone { --app-gutter: var(--s-4); }

/* The narration column beside the device: what this screen proves. */
.phone-caption {
  display: none; align-self: center; max-width: 34ch; text-align: left;
  font-size: var(--t-14); line-height: 1.55; color: var(--ink-2);
}
.phone-caption strong {
  display: block; color: var(--ink); font-family: var(--font-display);
  font-size: var(--t-18); font-weight: 600; margin-bottom: var(--s-2);
}
@media (min-width: 1100px) {
  .phone-stage { grid-template-columns: auto minmax(260px, 34ch); }
  .phone-caption { display: block; }
}

/* Step the scale down so the device always fits the window height. */
@media (max-height: 940px) { .phone-stage { --phone-fit: .95; } }
@media (max-height: 880px) { .phone-stage { --phone-fit: .90; } }
@media (max-height: 820px) { .phone-stage { --phone-fit: .84; } }
@media (max-height: 770px) { .phone-stage { --phone-fit: .78; } }
@media (max-height: 700px) { .phone-stage { --phone-fit: .72; } }
@media (max-height: 640px) { .phone-stage { --phone-fit: .66; } }

/* On an actual handset the app IS the page. The frame, notch, status bar and
   home indicator disappear; the app fills the screen minus the prototype bar. */
@media (max-width: 600px) {
  .phone-stage { --phone-fit: 1; padding: 0; height: 100dvh; grid-template-columns: 1fr; background: var(--bg); }
  .phone { width: 100%; height: 100dvh; border: 0; border-radius: 0; box-shadow: none; transform: none; }
  .phone::before, .phone-status, .phone-home { display: none; }
  .phone-caption { display: none; }
  /* The bar is fixed over the viewport, so the app must give up its height or
     the tab bar hides behind it. */
  body.has-pocbar .phone-stage,
  body.has-pocbar .phone { height: calc(100dvh - var(--pocbar-h)); }
  .phone-tabbar { padding-bottom: 8px; height: 64px; }
}

/* --------------------------------------------------------------------------
   Tablet — staff-facing landscape surfaces (kitchen display, POS, field app).
   -------------------------------------------------------------------------- */
.tablet-stage {
  display: flex; flex-direction: column; align-items: center; gap: var(--s-4);
  padding: var(--s-8) var(--gutter) calc(var(--pocbar-h) + var(--s-10));
  min-height: 100dvh; background: var(--surface-3);
}
.tablet {
  --tablet-fit: 1;
  position: relative; width: 1024px; height: 768px;
  transform: scale(var(--tablet-fit)); transform-origin: top center;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg); border: 12px solid #15130f; border-radius: 28px;
  box-shadow: 0 40px 80px -24px rgb(0 0 0 / 0.35);
}
.tablet-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 1140px) { .tablet-stage { --tablet-fit: .82; } }
@media (max-width: 940px)  { .tablet-stage { --tablet-fit: .66; } }
@media (max-width: 760px)  { .tablet-stage { --tablet-fit: .50; } }

/* --------------------------------------------------------------------------
   Bottom sheet — the mobile-native alternative to a modal.
   -------------------------------------------------------------------------- */
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: calc(var(--z-layer) + 1);
  max-height: 82%; display: flex; flex-direction: column;
  background: var(--bg); border-radius: var(--r-lg) var(--r-lg) 0 0;
  transform: translateY(100%); transition: transform var(--dur-3) var(--ease-out);
}
.sheet::before {
  content: ''; width: 36px; height: 4px; border-radius: 2px; background: var(--line-strong);
  margin: 10px auto 2px; flex: none;
}
.layer-open .sheet-scrim { opacity: 1; pointer-events: auto; }
.layer-open .sheet { transform: translateY(0); }

/* In-frame push notification — lands every time in a demo. */

/* --------------------------------------------------------------------------
   Prototype bar — the client's remote control, on every page.
   -------------------------------------------------------------------------- */
.pocbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-pocbar);
  height: var(--pocbar-h); display: flex; align-items: center; gap: var(--s-3);
  padding: 0 var(--s-4); font-size: var(--t-12);
  background: var(--drench); color: var(--on-drench);
  box-shadow: 0 -4px 20px rgb(0 0 0 / 0.2);
}
.pocbar .tagword {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em;
  color: var(--accent); font-weight: 500;
}
.pocbar .roles { display: flex; gap: 2px; }
.pocbar .roles a {
  padding: 4px 10px; border-radius: var(--r-full); color: var(--on-drench-muted);
  text-decoration: none; white-space: nowrap;
}
.pocbar .roles a:hover { color: var(--on-drench); background: var(--drench-2); }
.pocbar .roles a[aria-current="true"] { background: var(--primary); color: var(--on-primary); }
.pocbar .mods { display: flex; gap: 4px; }
.pocbar .tag-module {
  font-family: var(--font-mono); font-size: 10px; padding: 2px 6px;
  border: 1px solid var(--drench-line); border-radius: var(--r-full);
  color: var(--on-drench-muted); text-decoration: none;
}
.pocbar .spacer { flex: 1; }
.pocbar button.link {
  background: none; border: 0; color: var(--on-drench-muted);
  font: inherit; cursor: pointer; padding: 4px 6px; white-space: nowrap;
}
.pocbar button.link:hover { color: var(--on-drench); }
body.has-pocbar { padding-bottom: 0; }
@media (max-width: 720px) {
  .pocbar .hide-sm { display: none; }
  /* Never let the bar clip its own controls: let it scroll instead. */
  .pocbar { overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
  .pocbar::-webkit-scrollbar { display: none; }
  .pocbar > * { flex: none; }
  .pocbar .spacer { flex: 1 0 var(--s-4); }
}
@media (max-width: 420px) { .pocbar .tagword { display: none; } }

/* Module map overlay: outlines the elements proving each module. */
body.show-sow [data-module] { outline: 1px dashed var(--accent-strong); outline-offset: 2px; position: relative; }
body.show-sow [data-module]::after {
  content: attr(data-module); position: absolute; top: -8px; right: -6px; z-index: 2;
  font-family: var(--font-mono); font-size: 9px; line-height: 1;
  padding: 3px 5px; border-radius: var(--r-full);
  background: var(--accent); color: var(--on-accent);
}

/* --------------------------------------------------------------------------
   Toaster
   -------------------------------------------------------------------------- */
.toaster {
  position: fixed; right: var(--s-4); bottom: calc(var(--pocbar-h) + var(--s-4));
  z-index: var(--z-toast); display: flex; flex-direction: column-reverse;
  gap: var(--s-2); pointer-events: none;
}
body:not(.has-pocbar) .toaster { bottom: var(--s-4); }
.toast {
  max-width: 42ch; padding: var(--s-3) var(--s-4);
  background: var(--drench); color: var(--on-drench);
  border-radius: var(--r-ctl); box-shadow: var(--e-3);
  font-size: var(--t-14); animation: toast-in var(--dur-3) var(--ease-out);
}
.toast.ok { background: var(--success); } .toast.warn { background: var(--warning); color: var(--on-accent); }
.toast.err { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   Guided tour
   -------------------------------------------------------------------------- */
.tour-scrim { position: fixed; inset: 0; z-index: var(--z-tour); background: rgb(0 0 0 / 0.55); }
.tour-hole { position: fixed; z-index: calc(var(--z-tour) + 1); border-radius: var(--r-card);
  box-shadow: 0 0 0 9999px rgb(0 0 0 / 0.55), 0 0 0 3px var(--accent); pointer-events: none; }
.tour-pop {
  position: fixed; z-index: calc(var(--z-tour) + 2); max-width: 34ch;
  padding: var(--s-4); background: var(--bg); color: var(--ink);
  border-radius: var(--r-card); box-shadow: var(--e-3);
}
.tour-pop .step { font-family: var(--font-mono); font-size: var(--t-11); color: var(--muted); }
.tour-pop h3 { font-size: var(--t-16); margin: var(--s-1) 0 var(--s-2); }
.tour-pop p { font-size: var(--t-14); line-height: 1.5; color: var(--ink-2); }
.tour-pop .row { display: flex; gap: var(--s-2); justify-content: flex-end; margin-top: var(--s-4); }

/* Section reveal — set by prototype.js, off under reduced motion. */
.rv.pre { opacity: 0; transform: translateY(14px); }
.rv.in  { opacity: 1; transform: none; transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out); }

/* Accessibility floor */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  padding: var(--s-3) var(--s-4); background: var(--primary); color: var(--on-primary);
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ==========================================================================
   PLAY CORE — product components. Form: SOFT, from the client's mockups.
   Rounded white cards on a tinted ground, one hairline, selection = 2px
   orange + peach, no shadow at rest, 56px targets. Every form value is a
   token in tokens.css; nothing below hardcodes a radius, weight or height.
   ========================================================================== */

/* ---------- Buttons: full width on the phone, the mockups' three kinds ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  width: 100%; min-height: var(--h-ctl); padding: 0 var(--s-5); border-radius: var(--r-ctl);
  border: var(--bw-strong) solid transparent; font-size: var(--t-14); font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease); }
.btn:active { transform: scale(0.985); }
.btn[disabled], .btn.is-disabled { pointer-events: none; }
.btn .ico { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-strong); }
.btn-primary[disabled] { background: var(--surface-3); color: var(--muted-2); }
.btn-outline { background: var(--card); border-color: var(--accent); color: var(--accent-ink); }
.btn-outline:hover { background: var(--accent-soft); }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover { background: var(--accent-strong); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink-2); text-transform: none; letter-spacing: 0; font-weight: 700; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { width: auto; min-height: var(--h-ctl-sm); padding: 0 var(--s-4); font-size: var(--t-12); }
.btn-auto { width: auto; }
.btn-icon { width: 44px; min-height: 44px; padding: 0; border-radius: var(--r-ctl); background: var(--surface-2); color: var(--ink); }
.btn-icon:hover { background: var(--surface-3); }
.btn.is-loading { position: relative; color: transparent; }
.btn.is-loading::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--on-primary); border-top-color: transparent; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- The option card: sports, domains, observations, dials, ratings, archive rows ---------- */
.opt { display: flex; align-items: center; gap: var(--s-4); width: 100%; text-align: left;
  min-height: var(--h-row); padding: 14px 16px; background: var(--card); color: var(--ink);
  border: var(--rule-ctl); border-radius: var(--r-card); position: relative;
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease); }
.opt + .opt { margin-top: 10px; }
.opt:hover { border-color: var(--muted-2); }
.opt .t { display: block; font-weight: 800; font-size: var(--t-15); line-height: 1.25; }
.opt .s { display: block; font-size: var(--t-13); color: var(--muted); font-weight: 500; margin-top: 3px; line-height: 1.4; }
.opt .s.sel { text-transform: uppercase; letter-spacing: 0.06em; font-size: var(--t-11); font-weight: 700; }
.opt .in { flex: 1; min-width: 0; }
.opt .end { flex: none; color: var(--muted-2); }
.opt.is-sel, .opt[aria-pressed="true"] { border: var(--rule-strong); background: var(--primary-soft); }
.opt.is-sel .t, .opt[aria-pressed="true"] .t { color: var(--primary-ink); }
.opt.tall { min-height: 84px; align-items: flex-start; padding-top: 18px; }
.opt.tall .t { text-transform: uppercase; letter-spacing: 0.04em; }
.opt.dim { opacity: 0.55; }

/* Numbered badge: one size, everywhere. Orange when its card is selected. */
.badge { width: var(--badge); height: var(--badge); flex: none; display: grid; place-items: center;
  border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink);
  font-size: var(--t-13); font-weight: 800; font-variant-numeric: tabular-nums; }
.is-sel .badge, [aria-pressed="true"] .badge { background: var(--primary); color: var(--on-primary); }
.badge.sym { font-family: var(--font-mono); font-size: var(--t-15); letter-spacing: -0.04em; }
/* Checkbox square, the sport cards */
.chk { width: var(--badge); height: var(--badge); flex: none; border-radius: 10px; background: var(--accent-soft);
  display: grid; place-items: center; color: transparent; }
.chk .ico { width: 18px; height: 18px; }
.is-sel .chk, [aria-pressed="true"] .chk { background: var(--primary); color: var(--on-primary); }
/* A colour tab at the card's right edge (mockup 7, dial 1) */
.opt .tab { position: absolute; right: 0; top: 14px; bottom: 14px; width: 5px; border-radius: 3px 0 0 3px; background: var(--primary); }

/* ---------- Information cards: learning problem, skills, trainings, protocol blocks ---------- */
.info { padding: 16px 18px; border-radius: var(--r-card); background: var(--card); border: var(--rule-ctl); }
.info + .info { margin-top: 10px; }
.info.blue { background: var(--accent-soft); border-color: transparent; }
.info.peach { background: var(--primary-soft); border-color: transparent; }
.info.navy { background: var(--drench); color: var(--on-drench); border-color: transparent; }
.info .k { font-size: var(--t-12); font-weight: 800; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--ink); }
.info.blue .k { color: var(--ink); } .info.peach .k { color: var(--ink); } .info.navy .k { color: var(--on-drench); }
.info .t { font-weight: 800; font-size: var(--t-15); line-height: 1.3; }
.info .b { font-size: var(--t-14); color: var(--ink-2); margin-top: 6px; line-height: 1.5; font-weight: 500; }
.info.navy .b { color: var(--on-drench-muted); }
.info .k + .t, .info .k + .b { margin-top: 6px; }
.info.lg { padding: 20px 18px; min-height: 120px; }

/* ---------- App screen skeleton inside .phone-scroll ---------- */
.a-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: 6px var(--app-gutter) 6px; flex: none; }
.a-head .step { font-size: var(--t-12); font-weight: 700; color: var(--muted); letter-spacing: 0.04em; white-space: nowrap; }
.a-body { padding: 6px var(--app-gutter) var(--s-4); flex: 1; }
.a-title { margin-bottom: var(--s-4); }
.a-title .brandline { margin-bottom: 8px; }
.a-foot { position: sticky; bottom: 0; flex: none; padding: 12px var(--app-gutter) 18px;
  background: linear-gradient(to top, var(--bg) 72%, oklch(0.966 0.011 250 / 0)); }
.a-foot .btn + .btn { margin-top: 10px; }
.a-sec { margin-top: var(--s-5); }
.a-sec > .a-label { display: block; margin-bottom: 10px; }
.a-q { padding: 16px 18px; border-radius: var(--r-card); font-weight: 800; font-size: var(--t-15); line-height: 1.3; }
.a-q.blue { background: var(--accent-soft); } .a-q.peach { background: var(--primary-soft); }
.a-q + .btn { margin-top: 10px; }

/* ---------- Status ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-full);
  font-size: var(--t-12); font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-ok { background: var(--success-soft); color: var(--success-ink); }
.pill-warn { background: var(--warning-soft); color: var(--warning-ink); }
.pill-danger { background: var(--danger-soft); color: var(--danger-ink); }
.pill-info { background: var(--accent-soft); color: var(--accent-ink); }
.pill-brand { background: var(--primary-soft-2); color: var(--primary-ink); }
.rate-pp { color: var(--rate-pp); } .rate-p { color: var(--rate-p); } .rate-0 { color: var(--rate-0); }
.rate-m { color: var(--rate-m); } .rate-q { color: var(--rate-q); }

/* Filter chips */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: var(--h-ctl-sm); padding: 0 14px; border-radius: var(--r-full); border: var(--rule-ctl);
  background: var(--card); font-size: var(--t-13); font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--on-drench); }

/* Segmented control (site language switch, tablet views) */
.seg { display: inline-flex; padding: 4px; gap: 2px; background: var(--surface-2); border-radius: var(--r-ctl); }
.seg button { min-height: 36px; padding: 0 14px; border-radius: 9px; font-size: var(--t-13); font-weight: 700; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--e-1); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: var(--t-13); font-weight: 700; color: var(--ink-2); }
.input, .select, .textarea { width: 100%; min-height: var(--h-ctl); padding: 12px 16px; background: var(--card);
  border: var(--rule-ctl); border-radius: var(--r-ctl); font-size: var(--t-15); font-weight: 500; color: var(--ink);
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease); }
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft-2); }
.textarea { min-height: 112px; resize: vertical; line-height: 1.5; }
.hint { font-size: var(--t-12); color: var(--muted); }
.field.is-error .input, .field.is-error .textarea { border-color: var(--danger); }
.err { display: flex; gap: 6px; align-items: center; font-size: var(--t-12); color: var(--danger-ink); font-weight: 600; }
.count { font-size: var(--t-12); color: var(--muted-2); text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Feedback ---------- */
.empty { text-align: center; padding: var(--s-8) var(--s-5); }
.empty .ico { width: 44px; height: 44px; margin: 0 auto var(--s-4); color: var(--accent); padding: 10px; background: var(--accent-soft); border-radius: 14px; box-sizing: content-box; }
.empty .t { font-weight: 800; font-size: var(--t-16); }
.empty .b { color: var(--muted); font-size: var(--t-14); margin-top: 6px; line-height: 1.5; }
.empty .btn { margin-top: var(--s-5); }
.note { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-card); font-size: var(--t-14); line-height: 1.5; font-weight: 500; }
.note .ico { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.note.blue { background: var(--accent-soft); color: var(--ink-2); } .note.blue .ico { color: var(--accent); }
.note.peach { background: var(--primary-soft); color: var(--ink-2); } .note.peach .ico { color: var(--primary-ink); }
.note.warn { background: var(--warning-soft); color: var(--warning-ink); }
.skel { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 50%, var(--surface-2) 75%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--r-ctl); }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.skel-card { height: var(--h-row); border-radius: var(--r-card); } .skel-card + .skel-card { margin-top: 10px; }

/* Offline / status strip at the top of the phone */
.strip { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 6px var(--app-gutter);
  font-size: var(--t-12); font-weight: 700; background: var(--drench); color: var(--on-drench); }
.strip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }

/* ---------- Layers inside the phone ---------- */
.scrim { position: absolute; inset: 0; z-index: var(--z-layer); background: oklch(0.245 0.060 262 / 0.45);
  opacity: 0; pointer-events: none; transition: opacity var(--dur-2) var(--ease); }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: calc(var(--z-layer) + 1); max-height: 88%;
  display: flex; flex-direction: column; background: var(--card); border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--elev-modal); transform: translateY(100%); transition: transform var(--dur-3) var(--ease-out); }
.sheet::before { content: ''; width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 10px auto 4px; flex: none; }
.sheet-h { padding: 8px var(--app-gutter) 12px; flex: none; }
.sheet-b { overflow-y: auto; padding: 0 var(--app-gutter) 24px; }
.phone.layer-open .scrim { opacity: 1; pointer-events: auto; }
/* Centered confirm dialog */
.dialog { position: absolute; left: 20px; right: 20px; top: 50%; z-index: calc(var(--z-layer) + 1); transform: translateY(-50%) scale(0.96);
  background: var(--card); border-radius: var(--r-lg); padding: 22px 20px 18px; box-shadow: var(--elev-modal);
  opacity: 0; pointer-events: none; transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease); }
.phone.dialog-open .scrim { opacity: 1; pointer-events: auto; }
.phone.dialog-open .dialog { opacity: 1; pointer-events: auto; transform: translateY(-50%) scale(1); }
.dialog .t { font-weight: 800; font-size: var(--t-18); line-height: 1.25; }
.dialog .b { color: var(--muted); font-size: var(--t-14); margin-top: 8px; line-height: 1.5; }
.dialog .acts { display: grid; gap: 8px; margin-top: 18px; }
/* Share sheet */
.share-preview { border: var(--rule-ctl); border-radius: var(--r-card); overflow: hidden; background: var(--bg); }
.share-preview canvas, .share-preview img { width: 100%; height: auto; }
.share-apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; }
.share-apps button { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 4px; border-radius: var(--r-card); font-size: var(--t-11); font-weight: 700; color: var(--ink-2); }
.share-apps button:hover { background: var(--surface); }
.share-apps .app-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: #fff; }
.share-apps .app-ico .ico { width: 24px; height: 24px; }
/* Toast inside the phone */
.push { position: absolute; left: 12px; right: 12px; top: 58px; z-index: var(--z-toast); display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; background: var(--drench); color: var(--on-drench); border-radius: var(--r-card); box-shadow: var(--elev-pop);
  transform: translateY(-160%); transition: transform var(--dur-3) var(--ease-out); }
.push.in { transform: translateY(0); }
.push .ico { width: 20px; height: 20px; flex: none; color: var(--primary); margin-top: 1px; }
.push .t { font-size: var(--t-13); font-weight: 800; } .push .b { font-size: var(--t-13); color: var(--on-drench-muted); }

/* ---------- Lists & data (archive, content check, tablet) ---------- */
.kv { display: flex; justify-content: space-between; gap: var(--s-4); padding: 10px 0; font-size: var(--t-14); }
.kv + .kv { border-top: var(--rule); }
.kv dt { color: var(--muted); font-weight: 600; } .kv dd { font-weight: 700; text-align: right; }
.stat { padding: 16px 18px; border-radius: var(--r-card); background: var(--card); border: var(--rule-ctl); }
.stat .n { font-family: var(--font-display); font-size: var(--t-28); font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.stat .l { font-size: var(--t-12); color: var(--muted); font-weight: 700; margin-top: 6px; }
.check-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; font-size: var(--t-14); font-weight: 600; }
.check-row + .check-row { border-top: var(--rule); }
.check-row .ico { width: 22px; height: 22px; flex: none; }
.check-row.ok .ico { color: var(--success); } .check-row.warn .ico { color: var(--warning-ink); } .check-row.bad .ico { color: var(--danger); }
.check-row .n { margin-left: auto; font-family: var(--font-mono); font-size: var(--t-13); color: var(--muted); }
.group-h { font-size: var(--t-12); font-weight: 800; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--muted); margin: var(--s-5) 0 10px; }
.group-h:first-child { margin-top: 0; }

/* Tablet landscape: list + detail */
.split { display: grid; grid-template-columns: 380px 1fr; height: 100%; min-height: 0; }
.split > * { min-height: 0; overflow-y: auto; }
.split .list { border-right: var(--rule); padding: var(--s-4) var(--app-gutter); }
.split .detail { padding: var(--s-5) var(--s-6); }
.split .detail .info { max-width: 640px; }
