/* ==========================================================================
   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 var(--primary-strong); 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: var(--primary-strong); 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 var(--primary-strong); 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-scrim {
  position: absolute; inset: 0; z-index: var(--z-layer);
  background: rgb(0 0 0 / 0.4); 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: 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;
}
.sheet-body { overflow-y: auto; padding: var(--s-4) var(--app-gutter) var(--s-6); }
.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. */
.push {
  position: absolute; left: 8px; right: 8px; top: 58px; z-index: var(--z-toast);
  display: flex; gap: var(--s-3); padding: var(--s-3) var(--s-4);
  background: var(--bg); border-radius: var(--r-card); box-shadow: var(--e-3);
  transform: translateY(-140%); transition: transform var(--dur-3) var(--ease-out);
}
.push.in { transform: translateY(0); }

/* --------------------------------------------------------------------------
   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(--accent); color: var(--on-accent); }
.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-full); box-shadow: var(--e-3); padding-inline: var(--s-5);
  font-size: var(--t-14); animation: toast-in var(--dur-3) var(--ease-out);
}
.toast.ok { background: var(--accent); color: var(--on-accent); } .toast.warn { background: var(--warning); color: var(--on-accent); }
.toast.err { background: var(--danger-ink); }
@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: 4px;
  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; }

/* ==========================================================================
   SEILSCHAFT COMPONENTS · Aare / Sheet
   Every radius, rule, shadow and height reads from tokens.css.
   ========================================================================== */

/* ---- Top navigation (shell) ---------------------------------------------
   Sits on the colour of the band below it and settles onto mist when scrolled. */
.topnav {
  position: sticky; top: 0; z-index: var(--z-sticky);
  height: var(--nav-h); display: flex; align-items: center; gap: var(--s-5);
  padding-inline: var(--gutter);
  background: var(--nav-bg, var(--aare)); color: var(--nav-ink, var(--on-aare));
  transition: background var(--dur-3) var(--ease), box-shadow var(--dur-3) var(--ease);
}
.topnav.settled { background: var(--bg); color: var(--ink); box-shadow: 0 1px 0 var(--line); }
.topnav.on-night { --nav-bg: var(--drench); --nav-ink: var(--on-drench); }
.topnav.on-mist { --nav-bg: var(--bg); --nav-ink: var(--ink); }
.brand { display: inline-flex; align-items: center; gap: var(--s-2); text-decoration: none; font-family: var(--font-display); font-size: 1.5rem; letter-spacing: -0.01em; white-space: nowrap; }
.brand svg { width: 28px; height: 28px; }
.brand small { font-family: var(--font-body); font-size: var(--t-12); opacity: .78; margin-left: var(--s-2); letter-spacing: 0; }
.topnav nav { display: flex; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.topnav nav::-webkit-scrollbar { display: none; }
.topnav nav a {
  display: inline-flex; align-items: center; gap: var(--s-2); height: 40px; padding-inline: var(--s-3);
  border-radius: var(--r-ctl); font-size: var(--t-15); font-weight: 500; text-decoration: none; white-space: nowrap;
  opacity: .82; transition: opacity var(--dur-1), background var(--dur-1);
}
.topnav nav a:hover { opacity: 1; background: color-mix(in oklch, currentColor 8%, transparent); }
.topnav nav a[aria-current="page"] { opacity: 1; background: color-mix(in oklch, currentColor 12%, transparent); }
.topnav nav a .count { min-width: 20px; height: 20px; padding-inline: 6px; border-radius: var(--r-full); background: var(--accent); color: var(--on-accent); font-size: var(--t-11); font-weight: 700; display: inline-grid; place-items: center; }
.topnav .tools { display: flex; align-items: center; gap: var(--s-2); margin-left: auto; }
.me { display: inline-flex; align-items: center; gap: var(--s-2); height: 44px; padding: 0 var(--s-3) 0 4px; border-radius: var(--r-ctl); font-size: var(--t-14); font-weight: 600; }
.me:hover { background: color-mix(in oklch, currentColor 8%, transparent); }
.me .av { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-size: var(--t-12); font-weight: 700; }
.lang { display: inline-flex; border: var(--bw) solid currentColor; border-radius: var(--r-ctl); height: 36px; padding: 2px; opacity: .9; }
.lang button { padding: 0 10px; border-radius: var(--r-ctl); font-size: var(--t-12); font-weight: 700; letter-spacing: .04em; min-width: 38px; }
.lang button[aria-pressed="true"] { background: currentColor; }
.lang button[aria-pressed="true"] span { color: var(--nav-bg, var(--aare)); }
.topnav.settled .lang button[aria-pressed="true"] span { color: var(--bg); }
.topnav .menu-btn { display: none; }
@media (max-width: 1100px) {
  .topnav nav { display: none; }
  .topnav .menu-btn { display: inline-grid; }
  body.nav-open .topnav nav {
    display: flex; flex-direction: column; position: fixed; inset: var(--nav-h) 0 auto 0; padding: var(--s-3) var(--gutter) var(--s-5);
    background: var(--bg); color: var(--ink); box-shadow: var(--elev-pop); z-index: var(--z-layer);
  }
  body.nav-open .topnav nav a { height: 48px; }
}

/* ---- Sound toggle: a live mini waveform ---- */
.snd { display: inline-flex; align-items: center; gap: var(--s-2); height: 40px; padding: 0 var(--s-4) 0 var(--s-3); border: var(--bw) solid currentColor; border-radius: var(--r-ctl); font-size: var(--t-14); font-weight: 600; white-space: nowrap; }
.snd canvas { width: 30px; height: 16px; }
.snd[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* ---- Buttons: pills ------------------------------------------------------ */
.btn {
  --bh: var(--h-ctl);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: var(--bh); padding-inline: calc(var(--bh) * .5); border-radius: var(--r-ctl);
  font-size: var(--t-15); font-weight: 600; line-height: 1; white-space: nowrap; text-decoration: none;
  border: var(--bw) solid transparent; cursor: pointer; position: relative;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn .ico { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-strong); }
.btn-sun { background: var(--accent); color: var(--on-accent); }
.btn-sun:hover { background: var(--accent-strong); }
.btn-line { border-color: currentColor; color: inherit; }
.btn-line:hover { background: color-mix(in oklch, currentColor 8%, transparent); }
.btn-ghost { color: inherit; padding-inline: var(--s-3); text-decoration: underline; text-underline-offset: .25em; text-decoration-thickness: 1px; }
.btn-ghost:hover { text-decoration-thickness: 2px; }
.btn-danger { background: var(--danger-soft); color: var(--danger-ink); }
.btn-danger:hover { background: color-mix(in oklch, var(--danger) 18%, var(--danger-soft)); }
.band-night .btn-primary, .on-night .btn-primary { background: var(--on-drench); color: var(--drench); }
.btn-sm { --bh: var(--h-ctl-sm); font-size: var(--t-14); }
.btn-lg { --bh: 52px; font-size: var(--t-16); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--on-primary); border-right-color: transparent; animation: spin .7s linear infinite; }
.btn-sun.is-loading::after, .btn-line.is-loading::after { border-color: var(--ink); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; color: inherit; transition: background var(--dur-1); flex: none; }
.icon-btn:hover { background: color-mix(in oklch, currentColor 9%, transparent); }
.icon-btn.line { border: var(--bw) solid color-mix(in oklch, currentColor 40%, transparent); }

/* ---- Fields: underlined, like a line drawn on the sheet ------------------ */
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field .label { font-size: var(--t-13); font-weight: 600; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; min-height: var(--h-ctl); padding: 10px 2px; background: transparent;
  border: 0; border-bottom: var(--bw) solid var(--line-strong); border-radius: 0;
  font-size: var(--t-16); color: var(--ink); outline: none;
  transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:hover, .select:hover, .textarea:hover { border-bottom-color: var(--ink-2); }
.input:focus, .select:focus, .textarea:focus { border-bottom-color: var(--ink); box-shadow: 0 var(--bw-strong) 0 var(--ink); }
.textarea { min-height: 112px; resize: vertical; line-height: 1.55; }
.select { appearance: none; padding-right: 28px; background: no-repeat right 4px center / 14px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23233a4f' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); cursor: pointer; }
.field-msg { font-size: var(--t-13); color: var(--muted); }
.field.error .input, .field.error .select, .field.error .textarea { border-bottom-color: var(--danger); box-shadow: 0 var(--bw-strong) 0 var(--danger); }
.field.error .field-msg { color: var(--danger-ink); display: flex; gap: 6px; align-items: center; }
.field.ok .field-msg { color: var(--success-ink); }
.input:disabled { color: var(--muted); border-bottom-style: dashed; cursor: not-allowed; }
.search { display: flex; align-items: center; gap: var(--s-2); height: var(--h-ctl); padding-inline: var(--s-4); background: var(--surface); border: var(--bw) solid var(--line); border-radius: var(--r-ctl); min-width: 0; }
.search:focus-within { border-color: var(--ink); }
.search input { border: 0; outline: 0; background: none; flex: 1; min-width: 0; font-size: var(--t-15); }
.search input::placeholder { color: var(--muted); }
.search kbd { font-family: var(--font-mono); font-size: var(--t-11); color: var(--muted); border: var(--bw) solid var(--line); border-radius: 4px; padding: 1px 5px; }

.check, .radio { display: inline-flex; align-items: center; gap: var(--s-3); min-height: 44px; cursor: pointer; font-size: var(--t-15); }
.check input, .radio input { appearance: none; width: 20px; height: 20px; margin: 0; border: var(--bw-strong) solid var(--ink-2); display: grid; place-items: center; cursor: pointer; flex: none; transition: background var(--dur-1); }
.check input { border-radius: 4px; }
.radio input { border-radius: 50%; }
.check input:checked { background: var(--primary); border-color: var(--primary); }
.check input:checked::after { content: ""; width: 10px; height: 6px; border: 2px solid var(--on-primary); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.radio input:checked { border-color: var(--primary); }
.radio input:checked::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.check input:disabled, .radio input:disabled { opacity: .4; cursor: not-allowed; }

.toggle { display: inline-flex; align-items: center; gap: var(--s-3); min-height: 44px; cursor: pointer; font-size: var(--t-15); }
.toggle input { appearance: none; width: 46px; height: 28px; border-radius: var(--r-full); background: var(--line-strong); position: relative; cursor: pointer; transition: background var(--dur-2) var(--ease); flex: none; margin: 0; }
.toggle input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); transition: transform var(--dur-2) var(--ease-out); }
.toggle input:checked { background: var(--primary); }
.toggle input:checked::after { transform: translateX(18px); }

.seg { display: inline-flex; padding: 3px; border-radius: var(--r-ctl); background: var(--surface-2); gap: 2px; }
.seg button { height: calc(var(--h-ctl) - 8px); padding-inline: var(--s-4); border-radius: var(--r-ctl); font-size: var(--t-14); font-weight: 600; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 0 var(--line); }

.drop { display: grid; place-items: center; gap: var(--s-2); text-align: center; padding: var(--s-6); border: var(--bw) dashed var(--line-strong); color: var(--muted); font-size: var(--t-14); cursor: pointer; transition: border-color var(--dur-1), background var(--dur-1); }
.drop:hover, .drop.over { border-color: var(--ink); background: var(--surface); color: var(--ink); }

/* ---- Status pills --------------------------------------------------------- */
.st { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding-inline: 10px; border-radius: var(--r-full); font-size: var(--t-12); font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.st-wait { background: var(--accent); color: var(--on-accent); }
.st-wait::before { animation: breath 1.8s var(--ease) infinite; }
.st-ok   { background: var(--success-soft); color: var(--success-ink); }
.st-warn { background: var(--warning-soft); color: var(--warning-ink); }
.st-err  { background: var(--danger-soft); color: var(--danger-ink); }
.st-info { background: var(--info-soft); color: var(--info-ink); }
.st-draft { background: var(--surface-2); color: var(--ink-2); }
.st-draft::before { background: transparent; border: 1.5px solid currentColor; }
.st-off  { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-strong); }
@keyframes breath { 50% { opacity: .3; } }

/* ---- Tag: agent chip ------------------------------------------------------ */
.agent-chip { display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-13); font-weight: 600; white-space: nowrap; }
.agent-chip i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 9px; font-weight: 800; letter-spacing: .02em; color: var(--surface); background: var(--c, var(--ag-mgt)); }
.human-chip i { background: var(--accent); color: var(--on-accent); }

/* ---- Pane: the only "container". Tinted fill, square, no border, no shadow. */
.pane { background: var(--surface); padding: var(--pad-card); min-width: 0; }
.pane.tint { background: var(--surface-2); }
.pane-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-4); flex-wrap: wrap; }
.pane-head h2, .pane-head h3 { font-family: var(--font-body); font-weight: 600; font-size: var(--t-18); letter-spacing: 0; }
.pane-head a, .pane-head button.link { font-size: var(--t-14); font-weight: 600; }

/* ---- Tables: hairline rows, no boxes -------------------------------------- */
.tbl-wrap { overflow-x: auto; }
.tbl { font-size: var(--t-15); }
.tbl th { text-align: left; font-size: var(--t-12); font-weight: 600; color: var(--muted); padding: 0 var(--s-3) var(--s-2); border-bottom: var(--rule-strong); white-space: nowrap; }
.tbl th button { font-weight: 600; color: inherit; display: inline-flex; gap: 4px; align-items: center; min-height: 32px; }
.tbl th button[aria-sort] { color: var(--ink); }
.tbl td { height: var(--h-row); padding: 8px var(--s-3); border-bottom: var(--row-rule); border-right: var(--cell-rule); vertical-align: middle; }
.tbl tbody tr { transition: background var(--dur-1); }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr.sel { background: var(--primary-soft); }
.tbl tbody tr[data-href] { cursor: pointer; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .strong { font-weight: 600; }
.tbl .sub { display: block; font-size: var(--t-13); color: var(--muted); }
.bulkbar { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-2) var(--s-2) var(--s-4); background: var(--primary); color: var(--on-primary); border-radius: var(--r-ctl); margin-bottom: var(--s-3); animation: toast-in var(--dur-2) var(--ease-out); }
.bulkbar .btn-line { color: var(--on-primary); }

/* list rows */
.rows { border-top: var(--rule); }
.row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s-4); align-items: center; padding: var(--s-4) 0; border-bottom: var(--rule); }
.row h4 { font-size: var(--t-16); }
.row p { font-size: var(--t-14); color: var(--muted); }
a.row, button.row { width: 100%; text-align: left; text-decoration: none; transition: background var(--dur-1); }
a.row:hover, button.row:hover { background: var(--surface-2); }

/* ---- Tabs / accordion ------------------------------------------------------ */
.tabs { display: flex; gap: var(--s-5); border-bottom: var(--rule); overflow-x: auto; scrollbar-width: none; }
.tabs button, .tabs a { position: relative; height: 48px; font-size: var(--t-15); font-weight: 600; color: var(--muted); white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.tabs [aria-selected="true"], .tabs [aria-current="page"] { color: var(--ink); }
.tabs [aria-selected="true"]::after, .tabs [aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); }
.acc { border-top: var(--rule); }
.acc details { border-bottom: var(--rule); }
.acc summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); min-height: 56px; cursor: pointer; font-weight: 600; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "+"; font-family: var(--font-display); font-size: 1.6rem; line-height: 1; transition: transform var(--dur-2) var(--ease); }
.acc details[open] summary::after { transform: rotate(45deg); }
.acc .acc-body { padding-bottom: var(--s-5); color: var(--ink-2); }

/* ---- Layers: modal, drawer, popover, tooltip ------------------------------- */
.scrim { position: fixed; inset: 0; z-index: var(--z-layer); background: oklch(0.21 0.045 238 / .45); opacity: 0; pointer-events: none; transition: opacity var(--dur-2) var(--ease); }
.scrim.on { opacity: 1; pointer-events: auto; }
.modal { position: fixed; left: 50%; top: 50%; z-index: calc(var(--z-layer) + 1); width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 64px); overflow: auto; background: var(--surface); box-shadow: var(--elev-modal); padding: var(--s-6); transform: translate(-50%, -46%); opacity: 0; pointer-events: none; transition: transform var(--dur-3) var(--ease-out), opacity var(--dur-2); }
.modal.on { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; }
.modal h2 { font-size: var(--t-28); margin-bottom: var(--s-3); }
.modal .acts { display: flex; gap: var(--s-2); justify-content: flex-end; margin-top: var(--s-6); flex-wrap: wrap; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: calc(var(--z-layer) + 1); width: min(520px, 100vw); background: var(--surface); box-shadow: var(--elev-modal); transform: translateX(100%); transition: transform var(--dur-3) var(--ease-out); display: flex; flex-direction: column; }
.drawer.on { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: var(--s-5) var(--s-6); border-bottom: var(--rule); }
.drawer-head h2 { font-size: var(--t-22); }
.drawer-body { padding: var(--s-6); overflow: auto; flex: 1; }
.drawer-foot { padding: var(--s-4) var(--s-6); border-top: var(--rule); display: flex; gap: var(--s-2); justify-content: flex-end; }
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); background: var(--primary-strong); color: var(--on-primary); font-size: var(--t-12); font-weight: 500; line-height: 1.35; padding: 6px 10px; border-radius: 6px; white-space: nowrap; z-index: var(--z-toast); pointer-events: none; }
.popover { position: fixed; z-index: var(--z-layer); min-width: 240px; background: var(--surface); box-shadow: var(--elev-pop); padding: var(--s-2); }
.popover button, .popover a { display: flex; width: 100%; align-items: center; gap: var(--s-3); min-height: 44px; padding-inline: var(--s-3); font-size: var(--t-15); text-decoration: none; }
.popover button:hover, .popover a:hover { background: var(--surface-2); }

/* ---- Banners & states ------------------------------------------------------ */
.banner { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-4) var(--s-5); background: var(--info-soft); color: var(--info-ink); font-size: var(--t-15); }
.banner .ico { flex: none; margin-top: 2px; }
.banner b { font-weight: 700; }
.banner .acts { margin-left: auto; display: flex; gap: var(--s-2); flex: none; }
.banner.warn { background: var(--warning-soft); color: var(--warning-ink); }
.banner.err  { background: var(--danger-soft); color: var(--danger-ink); }
.banner.ok   { background: var(--success-soft); color: var(--success-ink); }
.banner.sun  { background: var(--accent); color: var(--on-accent); }
.empty { display: grid; justify-items: start; gap: var(--s-3); padding: var(--s-7) 0; max-width: 34rem; }
.empty svg.flow { width: 160px; height: 40px; color: var(--aare-deep); }
.empty h3 { font-family: var(--font-display); font-weight: 400; font-size: var(--t-28); line-height: 1.1; }
.empty p { color: var(--muted); }
.skel { display: block; height: 14px; border-radius: 4px; background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 40%, var(--surface-2) 80%) 0 0 / 300% 100%; animation: shimmer 1.6s linear infinite; }
.skel + .skel { margin-top: 10px; }
.skel.w60 { width: 60%; } .skel.w40 { width: 40%; } .skel.w80 { width: 80%; } .skel.tall { height: 40px; }
@keyframes shimmer { to { background-position: -300% 0; } }

/* ==========================================================================
   DOMAIN COMPONENTS
   ========================================================================== */

/* ---- Page head: every workspace page opens on an Aare band ---- */
.page-head { background: var(--aare); color: var(--on-aare); padding: var(--s-7) 0 0; position: relative; overflow: hidden; }
.page-head .wrap { position: relative; z-index: 1; }
.page-head .crumbs { font-size: var(--t-13); font-weight: 600; opacity: .8; display: flex; gap: var(--s-2); align-items: center; }
.page-head .crumbs a { text-decoration: none; }
.page-head h1 { margin-top: var(--s-3); max-width: 20ch; }
.page-head .lead { color: var(--on-aare-muted); margin-top: var(--s-3); max-width: 44rem; }
.page-head .head-row { display: flex; gap: var(--s-6); align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.page-head .head-acts { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.page-head canvas.strands { display: block; width: 100%; height: 76px; margin-top: var(--s-6); }
.page-head.night { background: var(--drench); color: var(--on-drench); }
.page-head.night .lead { color: var(--on-drench-muted); }

/* ---- Voice row: an agent speaks, its waveform is its signature ---- */
.voices { border-top: var(--bw) solid var(--drench-line); }
.voice { display: grid; grid-template-columns: 200px minmax(0, 1fr) minmax(120px, 220px) 48px; gap: var(--s-5); align-items: center; padding: var(--s-5) 0; border-bottom: var(--bw) solid var(--drench-line); width: 100%; text-align: left; color: inherit; text-decoration: none; transition: background var(--dur-2); }
.voice:hover { background: var(--drench-2); }
.voice .nm { font-family: var(--font-display); font-size: var(--t-28); line-height: 1; }
.voice .nm small { display: block; font-family: var(--font-body); font-size: var(--t-12); color: var(--on-drench-muted); margin-top: 6px; }
.voice .said { font-size: var(--t-16); line-height: 1.55; min-height: 2.6em; }
.voice .said.idle { color: var(--on-drench-muted); }
.voice canvas { width: 100%; height: 44px; }
.voice .play { width: 46px; height: 46px; border-radius: 50%; border: var(--bw) solid var(--drench-line); display: grid; place-items: center; }
.voice[aria-pressed="true"] .play { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.mist .voices, .voices.light { border-top-color: var(--line); }
.voices.light .voice { border-bottom-color: var(--line); }
.voices.light .voice:hover { background: var(--surface-2); }
.voices.light .voice .nm small, .voices.light .voice .said.idle { color: var(--muted); }
.voices.light .voice .play { border-color: var(--line-strong); }
@media (max-width: 900px) {
  .voice { grid-template-columns: minmax(0, 1fr) 48px; }
  .voice .said { grid-column: 1 / -1; }
  .voice canvas { grid-column: 1 / -1; }
}

/* ---- Decision sheet: the approval, in the owner's language ---- */
.decision { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(var(--s-6), 5vw, var(--s-9)); align-items: start; }
.decision .who { display: flex; align-items: center; gap: var(--s-3); font-size: var(--t-14); font-weight: 600; margin-bottom: var(--s-4); flex-wrap: wrap; }
.decision h2, .decision h3.title { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.6rem); line-height: 1.08; max-width: 22ch; }
.figure { font-family: var(--font-display); font-size: clamp(3rem, 2rem + 4vw, 5.25rem); line-height: .92; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin-top: var(--s-5); }
.figure small { display: block; font-family: var(--font-body); font-size: var(--t-14); letter-spacing: 0; color: var(--muted); margin-top: var(--s-3); }
.facts { margin-top: var(--s-6); border-top: var(--rule-strong); }
.facts > div { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: var(--s-4); padding: var(--s-3) 0; border-bottom: var(--rule); font-size: var(--t-15); }
.facts dt { color: var(--muted); }
.decision .acts { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-6); }
.decision .done { display: none; font-family: var(--font-display); font-size: var(--t-28); line-height: 1.15; margin-top: var(--s-6); max-width: 24ch; }
.decision.is-done .acts { display: none; }
.decision.is-done .done { display: block; }
.trail { list-style: none; padding: 0 0 0 var(--s-5); border-left: var(--bw) solid var(--line-strong); font-size: var(--t-14); line-height: 1.65; color: var(--muted); }
.trail li { position: relative; padding-bottom: var(--s-4); }
.trail li::before { content: ""; position: absolute; left: calc(-1 * var(--s-5) - 5px); top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: var(--bw-strong) solid var(--c, var(--ink-2)); }
.trail li b { color: var(--ink); font-weight: 600; display: block; }
.trail li.human::before { background: var(--accent); border-color: var(--accent-strong); }
@media (max-width: 900px) { .decision { grid-template-columns: 1fr; } }

/* ---- Tool-call trace: what Claude actually did ---- */
.trace { font-family: var(--font-mono); font-size: var(--t-13); line-height: 1.85; color: var(--ink-2); }
.trace .ln { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: var(--s-3); align-items: baseline; }
.trace .t { color: var(--muted); }
.trace .call { color: var(--ink); overflow-wrap: anywhere; }
.trace .call b { color: var(--ag-sal); font-weight: 600; }
.trace .res { grid-column: 2 / -1; color: var(--muted); overflow-wrap: anywhere; }
.trace .ok { color: var(--success-ink); }
.trace .hold { color: var(--on-accent); background: var(--accent); padding: 0 6px; border-radius: 4px; }
.trace .say { grid-column: 1 / -1; font-family: var(--font-body); font-size: var(--t-16); line-height: 1.55; color: var(--ink); margin: var(--s-2) 0; }
.caret { display: inline-block; width: 8px; height: 1.1em; background: var(--ink); vertical-align: -3px; animation: breath 1s steps(2) infinite; }

/* ---- Autonomy dial ---- */
.dial { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
.dial button { position: relative; padding: var(--s-3) var(--s-3) var(--s-2); text-align: left; font-size: var(--t-13); font-weight: 600; color: var(--muted); border-top: 3px solid var(--line); min-height: 58px; transition: color var(--dur-2), border-color var(--dur-2); }
.dial button small { display: block; font-weight: 400; font-size: var(--t-12); line-height: 1.35; margin-top: 2px; }
.dial button.on { color: var(--ink); border-top-color: var(--ink); }
.dial button.lvl { color: var(--ink); border-top-color: var(--c, var(--ink)); }
.dial button:hover { color: var(--ink); }
.dial.compact button { min-height: 0; padding: var(--s-2) 0 0; }
.dial.compact button small { display: none; }

/* ---- Rope: the hand-off between agents ---- */
.rope { position: relative; display: grid; grid-template-columns: repeat(var(--knots, 4), minmax(0, 1fr)); align-items: start; padding-top: var(--s-5); }
.rope::before { content: ""; position: absolute; left: 11px; right: 11px; top: calc(var(--s-5) + 10px); height: 2px; background: repeating-linear-gradient(90deg, var(--ink-2) 0 6px, transparent 6px 9px); opacity: .55; }
.rope .knot { position: relative; display: grid; justify-items: start; gap: 6px; font-size: var(--t-13); padding-right: var(--s-3); }
.rope .knot i { width: 22px; height: 22px; border-radius: 50%; background: var(--bg); border: 2px solid var(--c, var(--ink)); display: grid; place-items: center; z-index: 1; }
.rope .knot.done i { background: var(--c, var(--ink)); }
.rope .knot.now i { background: var(--accent); border-color: var(--accent-strong); box-shadow: 0 0 0 6px oklch(0.87 0.15 92 / .35); animation: halo 2s var(--ease) infinite; }
.rope .knot b { font-weight: 600; color: var(--ink); }
.rope .knot span { color: var(--muted); line-height: 1.4; }
@keyframes halo { 50% { box-shadow: 0 0 0 11px oklch(0.87 0.15 92 / 0); } }
@media (max-width: 700px) { .rope { grid-template-columns: 1fr; gap: var(--s-4); padding-top: 0; } .rope::before { left: 10px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; background: repeating-linear-gradient(180deg, var(--ink-2) 0 6px, transparent 6px 9px); } .rope .knot { grid-template-columns: 22px 1fr; column-gap: var(--s-3); } .rope .knot > :not(i) { grid-column: 2; } }

/* ---- Connector row ---- */
.sys { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: var(--t-12); letter-spacing: .02em; color: var(--surface); background: var(--c, var(--ink-2)); flex: none; }
.conn { display: grid; grid-template-columns: 40px minmax(0, 1.2fr) minmax(0, 1fr) auto auto; gap: var(--s-4); align-items: center; padding: var(--s-4) 0; border-bottom: var(--rule); }
.conn h4 { font-size: var(--t-16); }
.conn .scopes { display: flex; flex-wrap: wrap; gap: 4px; }
.scope { font-family: var(--font-mono); font-size: var(--t-11); padding: 2px 7px; border-radius: var(--r-full); background: var(--surface-2); color: var(--ink-2); }
.scope.w { background: var(--warning-soft); color: var(--warning-ink); }
@media (max-width: 900px) { .conn { grid-template-columns: 40px minmax(0, 1fr) auto; } .conn .scopes, .conn .meta { grid-column: 2 / -1; } }

/* ---- Spend meter ---- */
.meter { position: relative; height: 10px; background: var(--surface-3); border-radius: var(--r-full); overflow: visible; }
.meter > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: var(--r-full); background: var(--primary); width: var(--v, 0%); transition: width var(--dur-4) var(--ease-out); }
.meter.warn > span { background: var(--warning); }
.meter.full > span { background: var(--danger); }
.meter .cap { position: absolute; top: -6px; bottom: -6px; width: 2px; background: var(--ink); left: var(--cap, 100%); }
.meter-legend { display: flex; justify-content: space-between; font-size: var(--t-13); color: var(--muted); margin-top: var(--s-2); font-variant-numeric: tabular-nums; }

/* ---- Briefing prose: numbers set inside sentences, not hero metrics ---- */
.brief { font-family: var(--font-display); font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.3rem); line-height: 1.22; letter-spacing: -0.015em; max-width: 30ch; text-wrap: pretty; }
.brief .n { font-family: var(--font-body); font-weight: 600; font-size: .78em; letter-spacing: -0.01em; padding: 0 .2em; border-bottom: 2px solid var(--c, var(--aare-deep)); font-variant-numeric: tabular-nums; }
.brief a { text-decoration-color: var(--aare-deep); }

/* ---- Figures in a row: a hairline ledger of numbers, not cards ---- */
.ledger { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); border-top: var(--rule-strong); }
.ledger > div { padding: var(--s-4) var(--s-4) var(--s-4) 0; border-bottom: var(--rule); }
.ledger dt { font-size: var(--t-13); color: var(--muted); }
.ledger dd { font-family: var(--font-display); font-size: var(--t-32); line-height: 1.1; font-variant-numeric: tabular-nums; margin-top: 4px; }
.ledger dd small { font-family: var(--font-body); font-size: var(--t-13); color: var(--muted); margin-left: 4px; }
.ledger .delta { font-size: var(--t-13); font-weight: 600; }
.delta.up { color: var(--success-ink); } .delta.down { color: var(--danger-ink); }

/* ---- Chat / console composer ---- */
.composer { display: flex; align-items: flex-end; gap: var(--s-2); padding: var(--s-2) var(--s-2) var(--s-2) var(--s-5); background: var(--surface); border: var(--bw) solid var(--line-strong); border-radius: 28px; }
.composer:focus-within { border-color: var(--ink); }
.composer textarea { flex: 1; border: 0; outline: 0; background: none; resize: none; font-size: var(--t-16); line-height: 1.5; padding: 10px 0; max-height: 160px; min-height: 44px; }
.composer textarea::placeholder { color: var(--muted); }
.msg { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: var(--s-3); padding: var(--s-4) 0; }
.msg .av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 800; color: var(--surface); background: var(--c, var(--ink-2)); }
.msg.me .av { background: var(--accent); color: var(--on-accent); }
.msg .body { font-size: var(--t-16); line-height: 1.6; min-width: 0; }
.msg .body .who { font-size: var(--t-13); font-weight: 600; color: var(--muted); margin-bottom: 2px; }

/* ---- Explain-this-agent inline chip ---- */
.why { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding-inline: 12px; border-radius: var(--r-full); font-size: var(--t-13); font-weight: 600; background: var(--primary-soft); color: var(--ink); }
.why:hover { background: var(--primary-soft-2); }

/* ---- Phone app specifics ---- */
.phone .app-head { padding: var(--s-2) var(--app-gutter) var(--s-4); background: var(--aare); color: var(--on-aare); }
.phone .app-head h1 { font-size: var(--t-32); line-height: 1.05; }
.phone .app-body { padding: var(--s-4) var(--app-gutter) var(--s-6); }
.phone-tabbar a[aria-current="page"] { color: var(--ink); }
.phone-tabbar a .badge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; border-radius: var(--r-full); background: var(--accent); color: var(--on-accent); font-size: 10px; font-weight: 800; display: grid; place-items: center; padding-inline: 4px; }

/* ---- Footer ---- */
.site-foot { background: var(--drench); color: var(--on-drench-muted); padding: var(--s-8) 0 calc(var(--s-8) + var(--pocbar-h)); font-size: var(--t-14); }
.site-foot a { color: var(--on-drench); }
.site-foot .cols { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: var(--s-6); }
.site-foot h4 { color: var(--on-drench); font-size: var(--t-14); margin-bottom: var(--s-3); }
.site-foot ul { list-style: none; padding: 0; display: grid; gap: var(--s-2); }
.site-foot .fine { margin-top: var(--s-7); padding-top: var(--s-5); border-top: var(--bw) solid var(--drench-line); display: flex; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }
@media (max-width: 800px) { .site-foot .cols { grid-template-columns: 1fr 1fr; } }

/* ---- Narrow screens: the nav keeps brand, sound (icon only), language, menu ---- */
@media (max-width: 600px) {
  .topnav { gap: var(--s-2); }
  .brand { font-size: 1.3rem; }
  .brand small { display: none; }
  .snd { padding: 0 10px; }
  .snd .snd-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .lang button { min-width: 32px; padding: 0 6px; }
  .topnav .tools { gap: 4px; }
}
.topnav.on-clear { --nav-bg: transparent; }
.topnav.on-clear .lang button[aria-pressed="true"] span { color: var(--aare); }
body.has-pocbar .drawer { bottom: var(--pocbar-h); }
body.has-pocbar .modal { max-height: calc(100dvh - var(--pocbar-h) - 64px); }
