/*
 * Apis CV kiosk · design system "Favo" (DESIGN.md), night mode.
 *
 * Light on ink: the assistant is a luminous drop of amber honey (WebGL, js/orb.js)
 * on the warm dark of the hive; the interface is quiet ink and glass around it.
 * Amber is light, the one forward action, and what has become the visitor's.
 * The hexagon of the honeycomb is the only motif: markers, icon wells and the
 * cells that fill as the CV grows. Actions are pills.
 * Tablets: landscape 1280x800 first, portrait 800x1280 fully supported.
 */

@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@property --p {
  syntax: "<number>";
  inherits: false;
  initial-value: 100;
}

:root {
  /* Brand anchors: Apis amber and Apis ink. Everything else derives from them. */
  --amber: #fdaf17;
  --amber-hot: #ffd36b;
  --on-amber: #1c1204;
  --amber-press: #eea312;
  --amber-tint: rgba(253, 175, 23, 0.1);
  --amber-tint-2: rgba(253, 175, 23, 0.16);
  --amber-line: rgba(253, 175, 23, 0.46);

  /* Ink: the warm dark of the hive. */
  --ink-950: #120e0f;
  --ink-900: #1a1617;

  /* Cream type on ink. */
  --text: #fff8ec;
  --text-2: rgba(255, 244, 228, 0.74);
  --text-3: rgba(255, 244, 228, 0.56);
  --text-4: rgba(255, 244, 228, 0.4);

  /* Glass: every secondary surface. A fill, a hairline and a faint top sheen. */
  --glass: rgba(255, 240, 220, 0.06);
  --glass-2: rgba(255, 240, 220, 0.1);
  --tint: rgba(255, 240, 220, 0.08);
  --tint-2: rgba(255, 240, 220, 0.13);
  --line: rgba(255, 236, 205, 0.11);
  --line-2: rgba(255, 236, 205, 0.2);
  --line-3: rgba(255, 236, 205, 0.34);
  --sheen: inset 0 1px 0 rgba(255, 248, 236, 0.07);
  --sheet: linear-gradient(180deg, rgba(38, 33, 34, 0.74), rgba(26, 22, 23, 0.6));
  --panel: rgba(28, 24, 25, 0.96);
  --drop: 0 40px 80px -48px rgba(0, 0, 0, 0.95);

  --danger: #ff8a73;

  /* The honeycomb cell: a pointy-top hexagon with the soft corners of the Apis mark. */
  --hex-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='7 2 86 96'%3E%3Cpath d='M50 6 88.1 28v44L50 94 11.9 72V28Z' fill='%23000' stroke='%23000' stroke-width='8' stroke-linejoin='round'/%3E%3C/svg%3E");
  --hex-line: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='7 2 86 96'%3E%3Cpath d='M50 6 88.1 28v44L50 94 11.9 72V28Z' fill='rgba(255,240,220,0.05)' stroke='rgba(255,236,205,0.36)' stroke-width='2.6' stroke-linejoin='round'/%3E%3C/svg%3E");
  --hex-amber: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='7 2 86 96'%3E%3Cpath d='M50 6 88.1 28v44L50 94 11.9 72V28Z' fill='%23fdaf17' stroke='%23fdaf17' stroke-width='8' stroke-linejoin='round'/%3E%3C/svg%3E");

  /* Type: Geist alone, tuned by weight and tracking. */
  --font: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --t-display: clamp(2.6rem, 1rem + 5.8vw, 5.4rem);
  --t-h1: clamp(1.8rem, 1.05rem + 2.1vw, 2.7rem);
  --t-h2: 1.32rem;
  --t-caption: clamp(1.3rem, 0.9rem + 1.3vw, 1.9rem);
  --t-lead: 1.1rem;
  --t-label: 1.02rem;
  --t-note: 0.9rem;
  --t-eyebrow: 0.76rem;
  --t-code: clamp(3.4rem, 1.8rem + 5.4vw, 6rem);

  /* Shape and space. */
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --r-xl: 34px;
  --r-pill: 999px;
  --gutter: clamp(1.1rem, 3vw, 2.6rem);
  --rail: clamp(16.5rem, 34vw, 23rem);

  /* Motion: liquid and critically damped, never a bounce. */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  font-size: clamp(17px, 1.2vw + 6px, 21px);
  color-scheme: dark;
}

/* --- Base ------------------------------------------------------------------------------ */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--ink-950);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: -0.006em;
  overscroll-behavior: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  caret-color: var(--amber);
}
::selection { background: var(--amber); color: var(--on-amber); }
input, textarea, select { user-select: text; -webkit-user-select: text; }
img { max-width: 100%; }
[hidden] { display: none !important; }
* { scrollbar-width: thin; scrollbar-color: rgba(255, 236, 205, 0.26) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255, 236, 205, 0.24); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* --- Type ------------------------------------------------------------------------------ */
h1 {
  font-size: var(--t-h1);
  line-height: 1.06;
  font-weight: 540;
  letter-spacing: -0.036em;
  margin: 0 0 0.45em;
  text-wrap: balance;
}
h2 { font-size: var(--t-h2); line-height: 1.2; font-weight: 580; letter-spacing: -0.022em; margin: 0 0 0.55em; text-wrap: balance; }
h1:focus, h2:focus { outline: none; }
p { margin: 0 0 0.8em; }
.eyebrow {
  margin: 0;
  font-size: var(--t-eyebrow);
  font-weight: 640;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-3);
}
.muted { color: var(--text-3); }
.lead { font-size: var(--t-lead); line-height: 1.45; color: var(--text-2); max-width: 44ch; text-wrap: pretty; }
.note { color: var(--text-3); font-size: var(--t-note); max-width: 56ch; text-wrap: pretty; }
.notice {
  max-width: 60ch;
  padding: 0.85rem 1.15rem;
  border-radius: var(--r-md);
  border: 1px solid rgba(253, 175, 23, 0.3);
  background: var(--amber-tint);
  color: var(--text);
  font-size: 0.96rem;
  line-height: 1.4;
  text-wrap: pretty;
}

/* A page header: the question or the title of the screen, and one line under it. */
.page-head { width: 100%; max-width: 62rem; margin: 0.3rem auto 1.1rem; text-align: center; }
.page-head h1 { margin-bottom: 0.3em; }
.page-head .lead { margin: 0 auto; }
.page-head-start { margin-left: 0; text-align: left; }
.page-head-start .lead { margin-left: 0; }

/* --- Stage: the orb canvas lives behind every screen ------------------------------------ */
.orb-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.orb-fallback {
  --x: 50vw; --y: 50vh; --size: 0px; --alpha: 0; --level: 0;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 0;
  width: var(--size);
  height: var(--size);
  transform: translate(var(--x), var(--y)) scale(calc(1 + var(--level) * 0.08));
  opacity: var(--alpha);
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(circle at 34% 28%, #fff4d6 0%, rgba(255, 219, 128, 0.85) 10%, transparent 34%),
    radial-gradient(circle at 50% 55%, #ffc23d 0%, #fdaf17 45%, #c97800 85%, #8c5000 100%);
  box-shadow: 0 0 calc(var(--size) * 0.4) calc(var(--size) * 0.04) rgba(253, 175, 23, 0.3);
}
.orb-fallback[data-mode="thinking"], .orb-fallback[data-mode="connecting"] { animation: orb-pulse 1.1s ease-in-out infinite; }
@keyframes orb-pulse { 50% { filter: brightness(1.15); } }
.orb-anchor { pointer-events: none; }

/* --- Screens ------------------------------------------------------------------------- */
.app { position: relative; z-index: 1; min-height: 100dvh; }
.screen {
  min-height: 100dvh;
  max-height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.05rem var(--gutter) 1.25rem;
  display: flex;
  flex-direction: column;
  animation: screen-in 560ms var(--ease) both;
}
@keyframes screen-in { from { opacity: 0; filter: blur(5px); transform: translateY(12px); } }
.screen-center { align-items: center; text-align: center; }

/* Question screens: the orb asks, the answers follow it in, one after the other. */
.screen-ask > h1, .screen-ask > .choice-grid, .screen-ask > .note, .screen-ask > .btn-link { animation: rise 640ms var(--ease) both; }
.screen-ask > h1 { animation-delay: 60ms; }
.screen-ask > .choice-grid { animation-delay: 130ms; }
.screen-ask > .note, .screen-ask > .btn-link { animation-delay: 200ms; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* The orb in the middle of a question screen: the assistant asks it. */
.orb-host { flex: 0 0 auto; width: 100%; height: clamp(7rem, 21vmin, 11.5rem); margin: 0.1rem 0 0.5rem; }
.screen-center > :last-child { margin-bottom: auto; }
/* The question and its answers sit as one group, a little above the middle of the screen
   (the trailing spacer shares the free space, whatever the last child is, even hidden). */
.screen-ask { padding-bottom: 3rem; }
.screen-ask > .orb-host { margin-top: auto; height: clamp(8rem, 25vmin, 13.5rem); }
.screen-ask > :last-child { margin-bottom: 0; }
.screen-ask::after { content: ""; margin-top: auto; }

/* --- Top bar ------------------------------------------------------------------------- */
.topbar {
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
  align-items: center;
  gap: 1rem;
  min-height: 3.2rem;
  margin-bottom: 0.5rem;
  width: 100%;
  text-align: left;
}
.topbar-logo { display: block; height: 2.25rem; width: auto; justify-self: start; }
.topbar-center { display: grid; place-items: center; }
.orb-dock { width: 3.3rem; height: 3.3rem; }
.topbar-extra { display: flex; align-items: center; justify-content: flex-end; gap: 0.6rem; }
/* Always there, never the point: smaller tinted pills, the icon in the text colour. */
.btn-exit, .btn-toggle { min-height: 2.65rem; padding: 0 1.05rem 0 0.85rem; gap: 0.45rem; color: var(--text-2); font-size: 0.9rem; font-weight: 540; white-space: nowrap; }
.btn-exit:active:not(:disabled), .btn-toggle:active:not(:disabled) { color: var(--text); }
.btn-exit svg, .btn-toggle svg { width: 1.05rem; height: 1.05rem; }
.btn-audio[aria-pressed="false"] { color: var(--text-3); }

/* --- Buttons ------------------------------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3.3rem;
  padding: 0 1.45rem;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: var(--t-label);
  font-weight: 560;
  line-height: 1.15;
  letter-spacing: -0.012em;
  text-align: center;
  cursor: pointer;
  transition: transform 160ms var(--ease), background-color 220ms ease, border-color 220ms ease, color 220ms ease, box-shadow 260ms ease, opacity 200ms ease;
}
.btn svg { flex: none; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { cursor: default; }
.btn:focus-visible, .chip:focus-visible, .tile:focus-visible, .orb-button:focus-visible, .summary-card:focus-visible, .photo-slot:focus-visible, .tag-remove:focus-visible, .check-card:has(.check-input:focus-visible) {
  outline: 2.5px solid var(--amber);
  outline-offset: 4px;
}

/* The one forward action of a screen: amber, with its arrow in a dark well. */
.btn-primary, .btn-amber {
  background: var(--amber);
  color: var(--on-amber);
  font-weight: 640;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -1px 0 rgba(120, 70, 0, 0.22), 0 16px 30px -18px rgba(0, 0, 0, 0.95);
}
.btn-primary:active:not(:disabled), .btn-amber:active:not(:disabled) { background: var(--amber-press); }
.btn-primary > .i-arrow, .btn-amber > .i-arrow {
  width: 2.15rem;
  height: 2.15rem;
  margin-inline: 0.15rem -0.95rem;
  padding: 0.5rem;
  border-radius: 50%;
  background: var(--on-amber);
  color: var(--amber);
}
.btn-primary:disabled, .btn-amber:disabled {
  background: var(--tint);
  border-color: transparent;
  color: var(--text-3);
  box-shadow: none;
}
.btn-primary:disabled > .i-arrow { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text-3); }
/* Pills that are not the forward action: a tint of cream, no edge. Cards keep their hairlines. */
.btn-secondary { background: var(--tint); }
.btn-secondary:active:not(:disabled) { background: var(--tint-2); }
.btn-secondary:disabled, .btn-ghost:disabled { opacity: 0.4; }
.btn-ghost { color: var(--text-2); }
.btn-ghost:active:not(:disabled) { background: var(--glass); }
.btn-link {
  min-height: 3rem;
  padding: 0 0.2rem;
  font-weight: 520;
  text-decoration: underline;
  text-decoration-color: var(--amber-line);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.38em;
}
.btn-link svg { color: var(--amber); }
.btn-wide { width: min(27rem, 100%); min-height: 3.8rem; font-size: 1.1rem; }
.btn-hero {
  min-height: 4.1rem;
  padding: 0 1.3rem 0 2.3rem;
  font-size: clamp(1.2rem, 1rem + 0.55vw, 1.45rem);
  gap: 1.3rem;
}
.btn-hero > .i-arrow { width: 2.7rem; height: 2.7rem; padding: 0.62rem; margin-inline-end: -0.7rem; }
.btn.is-busy { color: transparent !important; pointer-events: none; }
.btn.is-busy svg { opacity: 0; }
.btn.is-busy::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  border: 2px solid rgba(28, 18, 4, 0.25);
  border-top-color: var(--on-amber);
  animation: spin 800ms linear infinite;
}
.btn-secondary.is-busy::after, .btn-primary:disabled.is-busy::after { border-color: rgba(255, 244, 228, 0.2); border-top-color: var(--text); }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Tiles: the answers of a question screen ------------------------------------------- */
.choice-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; width: 100%; margin: 1rem 0 1.3rem; }
.tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.05rem;
  width: min(23rem, 100%);
  min-height: 5.5rem;
  padding: 0.95rem 1.3rem 0.95rem 1rem;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-2);
  background: var(--glass);
  box-shadow: var(--sheen);
  color: var(--text);
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: transform 180ms var(--ease), background-color 220ms ease, border-color 220ms ease, opacity 200ms ease;
}
.tile:active:not(:disabled) { transform: scale(0.975); background: var(--glass-2); border-color: var(--line-3); }
.tile:disabled { opacity: 0.45; cursor: default; }
.tile-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 3.35rem;
  height: 3.35rem;
  background: var(--hex-line) center / contain no-repeat;
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 640;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}
.tile-body { flex: 1; display: grid; gap: 0.25rem; min-width: 0; }
.tile-title { font-size: 1.32rem; font-weight: 540; line-height: 1.16; letter-spacing: -0.024em; }
.tile-hint { font-size: 0.92rem; line-height: 1.36; color: var(--text-2); text-wrap: pretty; }
.tile-go { flex: none; display: grid; color: var(--text-4); transition: transform 220ms var(--ease), color 220ms ease; }
.tile:active .tile-go { transform: translateX(3px); color: var(--text-2); }
.tile-lead .tile-mark { background-image: var(--hex-amber); color: var(--on-amber); }

/* Voice or keyboard: two tall tiles; the recommended one wears a little honey. */
.tile-tall {
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  width: min(21rem, 100%);
  min-height: 0;
  padding: 1.35rem 1.45rem 1.45rem;
  border-radius: var(--r-xl);
}
.tile-tall .tile-mark { width: 4.4rem; height: 4.4rem; }
.tile-tall .tile-title { font-size: 1.55rem; letter-spacing: -0.03em; }
.tile-tall .tile-go { position: absolute; top: 1.45rem; right: 1.45rem; }
.mode-voice { border-color: var(--amber-line); background: linear-gradient(180deg, rgba(253, 175, 23, 0.15), rgba(253, 175, 23, 0.04)); }
.mode-card.is-busy::after {
  content: "";
  position: absolute;
  top: 1.35rem;
  right: 1.35rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 2px solid var(--line-3);
  border-top-color: var(--amber);
  animation: spin 800ms linear infinite;
}
.mode-card.is-busy .tile-go { opacity: 0; }
/* The chosen card stays bright while it starts; the other one steps back. */
.tile.is-busy:disabled { opacity: 1; }

.lang-others { margin-top: 0.2rem; max-width: 50rem; }
.lang-others .note { margin-inline: auto; }
.lang-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.65rem; }
.lang-btn { min-width: 10rem; min-height: 3.5rem; font-size: 1.06rem; }

/* --- Attract ------------------------------------------------------------------------- */
.screen-idle { position: relative; align-items: center; text-align: center; cursor: pointer; padding-bottom: 1.1rem; }
/* The logo and the event float in the corners: the orb takes the whole height above the title. */
.idle-top {
  position: absolute;
  top: 1.15rem;
  left: var(--gutter);
  right: var(--gutter);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  pointer-events: none;
}
.idle-logo { display: block; height: clamp(2.3rem, 5.4vmin, 3.2rem); width: auto; }
.idle-event { text-align: end; }
.orb-hero { flex: 1 1 0; min-height: 11rem; width: 100%; max-width: 86vmin; }
.idle-title {
  font-size: var(--t-display);
  line-height: 0.98;
  font-weight: 450;
  letter-spacing: -0.052em;
  margin: 0.1em 0 0.24em;
}
/* Amber is light and action: the key word is carried by weight. */
.idle-title .accent { font-weight: 660; }
/* The words of the attract voice take the subtitle's place while the orb says them. Both lines
   share one cell (two lines reserved), so nothing moves when they swap. */
.idle-subtitle {
  display: grid;
  place-items: center;
  max-width: 46rem;
  min-height: 2.7em;
  margin: 0 0 1.35rem;
  font-size: clamp(1.05rem, 0.85rem + 0.55vw, 1.32rem);
  line-height: 1.35;
  color: var(--text-2);
}
.idle-subtitle > span { grid-area: 1 / 1; text-wrap: balance; transition: opacity 420ms ease; }
.idle-sub-voice { opacity: 0; color: var(--text); font-weight: 450; }
.screen-idle.is-speaking .idle-sub-text { opacity: 0; }
.screen-idle.is-speaking .idle-sub-voice { opacity: 1; }
.idle-langs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0;
  margin: 1.1rem 0 0;
  color: var(--text-3);
  font-size: 0.84rem;
}
.idle-langs svg { color: var(--amber); margin-inline-end: 0.55rem; }
.idle-langs span + span::before { content: "·"; margin: 0 0.55rem; color: var(--text-4); }

/* --- Privacy --------------------------------------------------------------------------- */
.screen-privacy { align-items: center; }
.screen-privacy > h1 { align-self: stretch; text-align: center; margin: 0.2rem 0 0.9rem; }
.privacy-points {
  list-style: none;
  counter-reset: point;
  width: 100%;
  max-width: 64rem;
  margin: 0 0 0.3rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
  column-gap: 2.4rem;
}
.privacy-points li {
  counter-increment: point;
  display: grid;
  grid-template-columns: 2.1rem 1fr;
  gap: 0.4rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.93rem;
  line-height: 1.42;
  color: var(--text-2);
  text-wrap: pretty;
}
.privacy-points li::before {
  content: counter(point, decimal-leading-zero);
  padding-top: 0.1rem;
  font-size: 0.8rem;
  font-weight: 640;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: var(--amber);
}

/* --- Check cards --------------------------------------------------------------------------- */
.check-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  width: min(50rem, 100%);
  margin: 0.4rem 0 0.8rem;
  padding: 0.95rem 1.2rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: var(--glass);
  box-shadow: var(--sheen);
  font-size: 1.02rem;
  font-weight: 520;
  line-height: 1.35;
  text-align: start;
  cursor: pointer;
  transition: border-color 220ms ease, background-color 220ms ease;
}
.check-card:has(.check-input:checked) { border-color: var(--amber-line); background: var(--amber-tint); }
.check-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-box {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 10px;
  border: 1.5px solid var(--line-3);
  background: rgba(255, 244, 228, 0.03);
  color: var(--on-amber);
  transition: background-color 180ms ease, border-color 180ms ease;
}
.check-box svg { opacity: 0; transform: scale(0.5); transition: opacity 180ms ease, transform 260ms var(--ease); }
.check-input:checked + .check-box { background: var(--amber); border-color: var(--amber); }
.check-input:checked + .check-box svg { opacity: 1; transform: none; }
.check-hint { display: block; margin-top: 0.2rem; font-size: 0.88rem; font-weight: 400; color: var(--text-3); }

/* --- Pinned actions: content scrolls under a fade into the ground ---------------------- */
.action-bar {
  position: sticky;
  bottom: -1.25rem;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  margin-top: auto;
  padding: 1.4rem 0 1.25rem;
}
.action-bar::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -0.9rem;
  bottom: 0;
  left: calc(50% - 50vw);
  right: calc(50% - 50vw);
  background: linear-gradient(rgba(14, 11, 12, 0), rgba(14, 11, 12, 0.94) 42%);
  pointer-events: none;
}
.consent-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: min(50rem, 100%);
  padding: 0.4rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  background: rgba(34, 29, 30, 0.92);
  box-shadow: var(--sheen), 0 24px 48px -28px rgba(0, 0, 0, 0.95);
  transition: border-color 260ms ease, background-color 260ms ease;
}
.consent-bar:has(.check-input:checked) { border-color: var(--amber-line); background: rgba(52, 40, 22, 0.94); }
.consent-bar .check-card { flex: 1; width: auto; margin: 0; padding: 0.55rem 0.8rem; border: 0; border-radius: var(--r-pill); background: none; box-shadow: none; }
.consent-bar .check-card:has(.check-input:checked) { background: none; }
.consent-bar .btn { flex: none; width: auto; min-width: 12.5rem; min-height: 3.5rem; }
.form-nav .btn { min-width: 11rem; min-height: 3.8rem; }

/* --- Conversation ---------------------------------------------------------------------- */
.screen-conversation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail);
  grid-template-rows: auto minmax(0, 1fr) auto;
  column-gap: clamp(1.25rem, 3vw, 2.6rem);
  overflow: hidden;
}
.screen-conversation > .topbar { grid-column: 1 / -1; }
.conv-stage { grid-column: 1; grid-row: 2; min-height: 0; display: flex; flex-direction: column; align-items: center; }
/* The CV runs down the side as a sheet; "I'm done" belongs to the stage column. */
.cv-rail { grid-column: 2; grid-row: 2 / 4; }
.conv-footer { grid-column: 1; grid-row: 3; display: flex; justify-content: center; align-items: center; gap: 1rem; padding-top: 0.5rem; }
/* Until "I'm done" is offered the footer takes no room: the stage keeps it. */
.conv-footer:has(> .btn-finish[hidden]) { display: none; }

/* Voice: the orb is the stage and the button. */
.orb-button {
  flex: 1 1 0;
  min-height: 9rem;
  width: 100%;
  max-width: 34rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.captions {
  width: 100%;
  max-width: 42rem;
  min-height: 6.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  text-align: center;
}
.caption { margin: 0; transition: opacity 360ms ease; }
.caption:empty { display: none; }
/* The visitor's own words, in the colour of what is theirs. */
.caption-user {
  max-width: 44ch;
  font-size: 1.02rem;
  font-weight: 460;
  line-height: 1.4;
  color: var(--amber-hot);
  text-wrap: balance;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
/* The assistant's sentence: the question bright, what leads to it a step back. */
.caption-assistant {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  max-width: 29ch;
  max-height: calc(4 * 1.24em);
  overflow: hidden;
  font-size: var(--t-caption);
  font-weight: 420;
  line-height: 1.24;
  letter-spacing: -0.024em;
  color: var(--text);
}
.caption-text { text-wrap: balance; }
.caption-lead { color: var(--text-3); }
/* Too long for four lines: keep the last ones and fade the first, like live subtitles. */
.caption-assistant.is-long {
  -webkit-mask-image: linear-gradient(transparent, #000 1.4em);
  mask-image: linear-gradient(transparent, #000 1.4em);
}
.screen-conversation[data-state="recording"] .caption-assistant { opacity: 0.35; }
.stage-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 1.5em;
  margin: 0.55rem 0 0;
  font-size: 0.88rem;
  color: var(--text-3);
}
.stage-hint:empty { visibility: hidden; }
/* A small status light next to the hint; the orb carries the rest. */
.stage-hint::before { content: ""; flex: none; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--text-4); }
[data-state="idle"] .stage-hint::before { background: var(--amber); animation: breathe 2.6s ease-in-out infinite; }
[data-state="recording"] .stage-hint::before { background: var(--amber-hot); animation: breathe 0.9s ease-in-out infinite; }
[data-state="processing"] .stage-hint::before, [data-state="connecting"] .stage-hint::before { background: var(--text-2); animation: breathe 0.7s ease-in-out infinite; }
[data-state="speaking"] .stage-hint::before { background: var(--amber); }
@keyframes breathe { 50% { opacity: 0.25; } }
/* The last question of the conversation, a photo for the CV, is answered with a tap. */
.photo-ask { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8rem; margin: 1rem 0 0.4rem; }
.photo-ask .btn { min-height: 3.6rem; padding: 0 1.8rem; font-size: 1.15rem; }

/* Text: the same stage with a smaller orb; the keyboard sits under the question. */
.screen-conversation[data-mode="text"] .conv-stage { justify-content: center; }
.screen-conversation[data-mode="text"] .orb-button { flex: 1 1 0; min-height: 5rem; max-height: 12.5rem; max-width: 12.5rem; cursor: default; }
.screen-conversation[data-mode="text"] .captions { min-height: 5.2rem; }
.screen-conversation[data-mode="text"] .stage-hint { margin: 0.25rem 0 0.7rem; }
.quick-replies { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.55rem; width: 100%; max-width: 44rem; margin: 0 0 0.75rem; }
.quick-replies:empty { display: none; }
/* The composer: one glass capsule holding the answer and its send key. */
.text-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  width: 100%;
  max-width: 44rem;
  padding: 0.4rem;
  border-radius: 1.75rem;
  border: 1px solid var(--line-2);
  background: var(--glass);
  box-shadow: var(--sheen);
  transition: border-color 220ms ease;
}
.text-row:focus-within { border-color: var(--amber-line); }
.text-input {
  flex: 1;
  field-sizing: content;
  min-height: 3.3rem;
  max-height: 7.2rem;
  padding: 0.78rem 0.95rem;
  border: 0;
  border-radius: 1.4rem;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1.12rem;
  line-height: 1.35;
  resize: none;
}
.text-input:focus { outline: none; }
.text-input::placeholder { color: var(--text-3); }
.btn-send { flex: none; min-height: 3.3rem; padding: 0 1.2rem 0 1.05rem; }

/* --- Chips and tags ------------------------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.8rem;
  padding: 0 1.1rem;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: var(--tint);
  color: var(--text);
  font: inherit;
  font-size: 0.98rem;
  font-weight: 520;
  cursor: pointer;
  transition: background-color 200ms ease, border-color 200ms ease, transform 180ms var(--ease);
}
.chip:active { transform: scale(0.97); background: var(--tint-2); }
.chip-toggle.is-on { background: var(--amber); border-color: var(--amber); color: var(--on-amber); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4); }
/* A suggestion is a slot not taken yet: dashed. */
.chip-suggest { border-style: dashed; border-color: var(--line-3); background: transparent; color: var(--text-2); }
.chip-suggest svg { color: var(--amber); }
.form-fields > .chip { justify-self: start; }
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tags:empty { display: none; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  min-height: 2.6rem;
  padding: 0 0.25rem 0 1rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--amber-line);
  background: var(--amber-tint-2);
  font-weight: 520;
}
.tag-remove { display: grid; place-items: center; width: 2.15rem; height: 2.15rem; border: 0; border-radius: 50%; background: transparent; color: var(--text-2); cursor: pointer; }
.tag-remove:active { background: var(--glass-2); }
.tag-row { display: flex; gap: 0.6rem; }
.btn-add { flex: none; }
.suggestions, .chip-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.suggestions:empty { display: none; }

/* --- The live CV: a sheet beside the orb that fills as the visitor talks ------------------ */
.cv-rail {
  min-height: 0;
  align-self: start;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  margin: 0.2rem 0 0;
  padding: 0.95rem 1.25rem 0.55rem;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--sheet);
  box-shadow: var(--sheen), var(--drop);
  overflow-y: auto;
  overflow-x: hidden;
}
.rail-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.4rem; }
.rail-head { margin: 0; font-size: var(--t-eyebrow); font-weight: 640; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-3); }
.rail-list { list-style: none; margin: 0; padding: 0; display: grid; }
.rail-card { position: relative; display: grid; gap: 0.22rem; margin: 0 -0.7rem; padding: 0.6rem 0.7rem 0.64rem; border-radius: var(--r-sm); }
.rail-card + .rail-card::before { content: ""; position: absolute; top: 0; left: 0.7rem; right: 0.7rem; height: 1px; background: var(--line); }
.card-label { font-size: 0.7rem; font-weight: 640; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-4); transition: color 600ms ease; }
.card-value { font-size: 0.93rem; line-height: 1.3; color: var(--text); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
/* An empty slot is a dashed line waiting for its words. */
.rail-card:not(.is-filled)::after { content: ""; display: block; width: 58%; height: 0.55rem; margin-top: 0.28rem; border-radius: var(--r-pill); border: 1px dashed var(--line-2); }
.rail-card.is-filled .card-label { color: var(--amber-hot); }
.rail-name .card-value { font-size: 1.32rem; font-weight: 580; letter-spacing: -0.026em; -webkit-line-clamp: 1; }
.rail-name:not(.is-filled)::after { width: 74%; height: 0.95rem; }
/* A piece that just arrived flies out of the orb into its slot, warm, then settles. */
.rail-card.is-landing { animation: card-land 1100ms var(--ease) both; }
@keyframes card-land {
  0% { opacity: 0; transform: translate(var(--from-x, -3rem), var(--from-y, 0)) scale(0.4); background-color: rgba(253, 175, 23, 0.5); }
  30% { opacity: 1; }
  70% { transform: none; background-color: rgba(253, 175, 23, 0.14); }
  100% { transform: none; background-color: rgba(253, 175, 23, 0); }
}

/* Honeycomb cells: one per topic, filled with amber as each is covered. */
.comb { display: inline-flex; align-items: center; gap: 0.2rem; }
.comb-cell {
  width: 0.74rem;
  aspect-ratio: 86 / 96;
  background: var(--line-2);
  -webkit-mask: var(--hex-mask) center / 100% 100% no-repeat;
  mask: var(--hex-mask) center / 100% 100% no-repeat;
  transform: scale(0.86);
  transition: background-color 600ms ease, transform 700ms var(--ease);
}
.comb-cell.is-on { background: var(--amber); transform: none; }

/* --- Forms ------------------------------------------------------------------------------ */
.screen-form .form-body { flex: 1; width: calc(100% + 1.2rem); max-width: 57.2rem; margin: 0 -0.6rem; align-self: center; overflow-y: auto; padding: 0.4rem 0.6rem 1rem; }
.form-fields { display: grid; gap: 1.05rem; width: 100%; max-width: 56rem; }
.form-fields.narrow { max-width: 40rem; margin: 0 auto; gap: 0.95rem; }
.form-fields .check-card { width: 100%; margin: 0; }
/* A choice that depends on the one above it (the training offers under the database). */
.consent-sub { padding-left: clamp(1.4rem, 4vw, 2.6rem); }
.consent-sub[hidden] { display: none; }
.field { display: grid; gap: 0.42rem; min-width: 0; }
.field-label { font-size: 0.92rem; font-weight: 520; color: var(--text-2); }
.field-hint { margin: 0; color: var(--text-3); font-size: 0.86rem; }
.field-input {
  width: 100%;
  min-height: 3.5rem;
  padding: 0.6rem 1.05rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: rgba(255, 244, 228, 0.045);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
  color: var(--text);
  font: inherit;
  font-size: 1.1rem;
  transition: border-color 200ms ease, background-color 200ms ease;
}
.field-input::placeholder { color: var(--text-3); }
/* The profile: a few sentences, fully visible while the visitor corrects them. */
textarea.field-area { min-height: 9.5rem; padding-top: 0.75rem; padding-bottom: 0.75rem; line-height: 1.45; resize: none; }
.field-input:focus { outline: none; border-color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber); background: rgba(255, 244, 228, 0.07); }
select.field-input {
  appearance: none;
  padding-inline-end: 2.8rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 1.45rem) 55%, calc(100% - 1.08rem) 55%;
  background-size: 0.38rem 0.38rem;
  background-repeat: no-repeat;
}
select.field-input option { background: var(--ink-900); color: var(--text); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; align-items: end; }
.field-row-tight .check-card { margin: 0; }
.list-editor { display: grid; gap: 0.9rem; }
.list-item { position: relative; display: grid; gap: 0.85rem; padding: 1.1rem 1.2rem 0.9rem; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--glass); box-shadow: var(--sheen); }
.btn-remove { justify-self: end; min-height: 2.6rem; padding: 0 0.9rem; font-size: 0.9rem; }
.btn-add-item { justify-self: start; }
.form-error { display: flex; align-items: center; gap: 0.5rem; margin: 0; color: var(--danger); font-weight: 560; }
.email-check { margin: -0.35rem 0 0; color: var(--amber-hot); font-weight: 560; word-break: break-all; }
.parent-box { display: grid; gap: 0.9rem; }
.parent-box .notice { margin: 0; max-width: none; }
.screen-contacts .form-fields, .screen-consents .form-fields { padding-bottom: 0.4rem; }

/* Form progress: "Question 2 of 6" and the honeycomb. */
.screen-form .progress { display: flex; flex-direction: column; align-items: flex-end; gap: 0.35rem; }
.progress-label { font-size: 0.86rem; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.progress-track .comb-cell { width: 0.82rem; }

/* --- Summary: the CV as a document, every section a tap away from being fixed ------------ */
.screen-summary, .screen-contacts, .screen-consents { align-items: center; }
.cv-doc {
  width: 100%;
  max-width: 62rem;
  padding: 1.35rem 1.55rem 0.6rem;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background: var(--sheet);
  box-shadow: var(--sheen), var(--drop);
  animation: rise 700ms var(--ease) 80ms both;
}
.cv-doc-head { display: flex; align-items: stretch; gap: 1.4rem; padding-bottom: 1.05rem; border-bottom: 1px solid var(--line-2); }
.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.7rem; }
.summary-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  margin: 0 -0.7rem;
  padding: 0.9rem 0.7rem 0.95rem;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: background-color 200ms ease, transform 180ms var(--ease);
}
.summary-grid .summary-card::after { content: ""; position: absolute; left: 0.7rem; right: 0.7rem; bottom: 0; height: 1px; background: var(--line); }
.summary-grid .summary-card:last-child::after, .summary-grid .summary-card:nth-last-child(2):nth-child(odd)::after { display: none; }
.summary-card:active { background: var(--glass); transform: scale(0.99); }
.summary-card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.summary-card-head strong { font-size: 0.72rem; font-weight: 640; letter-spacing: 0.14em; text-transform: uppercase; color: var(--amber-hot); }
.summary-card.is-empty .summary-card-head strong { color: var(--text-3); }
/* The pencil sits in a honeycomb cell. */
.summary-edit {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.05rem;
  height: 2.05rem;
  margin: -0.35rem 0 -0.35rem;
  background: var(--hex-line) center / contain no-repeat;
  color: var(--amber);
}
.summary-line { font-size: 1rem; line-height: 1.38; color: var(--text); text-wrap: pretty; }
.summary-line + .summary-line { color: var(--text-2); }
.summary-card.is-empty .summary-line { color: var(--text-4); }
.summary-name { flex: 1; min-width: 0; justify-content: center; margin: -0.3rem -0.7rem; }
.summary-name .summary-line { font-size: clamp(1.7rem, 1.2rem + 1.4vw, 2.3rem); font-weight: 560; line-height: 1.1; letter-spacing: -0.034em; color: var(--text); }

/* The optional photo: where it will sit on the printed CV, top right. */
.summary-photo { flex: none; display: flex; align-items: center; gap: 1rem; max-width: min(22rem, 50%); }
.photo-slot {
  flex: none;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.35rem;
  width: 5.6rem;
  aspect-ratio: 4 / 5;
  padding: 0.4rem;
  border-radius: var(--r-md);
  border: 1.5px dashed var(--line-3);
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 560;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: border-color 220ms ease, background-color 220ms ease, transform 180ms var(--ease);
}
.photo-slot svg { color: var(--amber); }
.photo-slot:active { transform: scale(0.97); background: var(--glass); }
.photo-side { display: grid; gap: 0.35rem; align-content: center; min-width: 0; }
.photo-label { font-size: 0.72rem; font-weight: 640; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }
.photo-offer { margin: 0; font-size: 0.9rem; line-height: 1.38; color: var(--text-2); text-wrap: pretty; }
.photo-thumb { flex: none; width: 5.6rem; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r-md); border: 1px solid var(--line-3); }
.photo-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.photo-actions .btn { min-height: 2.8rem; padding: 0 1rem; font-size: 0.92rem; }

/* --- Photo booth ---------------------------------------------------------------------------- */
.dialog.booth { width: min(42rem, 100%); max-height: 96dvh; display: flex; flex-direction: column; align-items: center; gap: 0.9rem; padding: 1.3rem 1.4rem 1.2rem; }
.booth h2 { margin: 0; text-align: center; }
.booth-stage {
  position: relative;
  height: min(62dvh, 36rem);
  aspect-ratio: 4 / 5;
  max-width: 100%;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #070505;
  border: 1px solid var(--line-2);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6);
}
.booth-video, .booth-shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Like a mirror while framing; the photo itself is saved the right way round. */
.booth-video { transform: scaleX(-1); }
.booth-guide {
  position: absolute;
  left: 50%;
  top: 44%;
  width: 56%;
  aspect-ratio: 3 / 4;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px dashed rgba(255, 244, 228, 0.6);
  pointer-events: none;
}
.booth[data-phase="review"] .booth-guide, .booth[data-phase="error"] .booth-guide { display: none; }
.booth-count {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  font-size: clamp(6rem, 18vmin, 11rem);
  font-weight: 520;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
.booth-count.is-tick { animation: count-tick 850ms var(--ease) both; }
@keyframes count-tick { from { opacity: 0; transform: scale(1.35); } 30% { opacity: 1; transform: none; } to { opacity: 0.25; } }
.booth-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.booth-flash.is-on { animation: booth-flash 650ms ease-out; }
@keyframes booth-flash { from { opacity: 0.9; } to { opacity: 0; } }
.booth-note { margin: 0; color: var(--text-3); font-size: 0.9rem; text-align: center; }
.booth-actions { align-self: stretch; margin-top: 0.1rem; }
.dialog-actions .btn-link { flex: 0 0 auto; }

/* --- Outcome ------------------------------------------------------------------------------ */
.screen-outcome { position: relative; align-items: center; text-align: center; }
.orb-celebrate { flex: 1 1 0; min-height: 6.5rem; max-height: 40vh; width: 100%; }
.screen-outcome > h1 { margin-bottom: 0.25em; }
.screen-outcome > .lead { margin: 0 0 0.9rem; }
/* The pickup code is a ticket: punched on both sides, the code in honey. */
.ticket {
  margin: 0 0 1rem;
  padding: 0.95rem 2.6rem 1.05rem;
  border-radius: var(--r-lg);
  border: 1px solid var(--amber-line);
  background: linear-gradient(180deg, rgba(253, 175, 23, 0.13), rgba(253, 175, 23, 0.05));
  -webkit-mask: radial-gradient(circle at 0 50%, transparent 0.8rem, #000 calc(0.8rem + 0.5px)) left / 51% 100% no-repeat, radial-gradient(circle at 100% 50%, transparent 0.8rem, #000 calc(0.8rem + 0.5px)) right / 51% 100% no-repeat;
  mask: radial-gradient(circle at 0 50%, transparent 0.8rem, #000 calc(0.8rem + 0.5px)) left / 51% 100% no-repeat, radial-gradient(circle at 100% 50%, transparent 0.8rem, #000 calc(0.8rem + 0.5px)) right / 51% 100% no-repeat;
  animation: rise 800ms var(--ease) 120ms both;
}
.outcome-code {
  margin: 0;
  font-size: var(--t-code);
  font-weight: 560;
  line-height: 1;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: var(--amber);
}
.outcome-line { max-width: 44rem; font-size: 1.04rem; color: var(--text-2); text-wrap: pretty; }
.outcome-thanks { margin: 0.2rem 0 1rem; font-size: 1.2rem; font-weight: 580; letter-spacing: -0.015em; }
.countdown { display: grid; justify-items: center; gap: 0.55rem; margin-top: 0.9rem; }
.countdown .note { margin: 0; }
.countdown-bar { position: relative; width: min(14rem, 60vw); height: 3px; border-radius: var(--r-pill); background: var(--line); overflow: hidden; }
.countdown-bar::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--amber); transform-origin: left; animation: drain var(--dur, 30s) linear forwards; }
[dir="rtl"] .countdown-bar::after { transform-origin: right; }
@keyframes drain { to { transform: scaleX(0); } }

/* --- Overlays, toasts, banner --------------------------------------------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background: rgba(10, 7, 8, 0.7);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  backdrop-filter: blur(12px) saturate(120%);
  animation: fade 240ms ease-out;
}
@keyframes fade { from { opacity: 0; } }
.dialog {
  width: min(36rem, 100%);
  max-height: 92dvh;
  overflow-y: auto;
  padding: 1.8rem 1.9rem 1.6rem;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--sheen), 0 50px 100px -40px rgba(0, 0, 0, 0.9);
  text-align: center;
  animation: dialog-in 460ms var(--ease) both;
}
@keyframes dialog-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.dialog h2 { font-size: 1.45rem; letter-spacing: -0.028em; }
.dialog p { color: var(--text-2); text-wrap: pretty; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-top: 1.4rem; }
.dialog-actions .btn { flex: 1 1 10rem; min-height: 3.6rem; white-space: nowrap; }
.dialog-large { width: min(60rem, 100%); display: flex; flex-direction: column; text-align: start; }
.dialog-large .dialog-actions { justify-content: flex-end; padding-top: 1rem; border-top: 1px solid var(--line); }
.dialog-large .dialog-actions .btn { flex: 0 1 auto; min-width: 10.5rem; }
.dialog-editor h2 { margin-bottom: 1rem; }
.dialog-editor .editor-body { overflow-y: auto; display: grid; gap: 1rem; margin: 0 -0.6rem; padding: 0.4rem 0.6rem; }

/* Inactivity: the seconds left inside a ring that drains. */
.idle-clock { position: relative; display: grid; place-items: center; width: 7.4rem; height: 7.4rem; margin: 1rem auto 0.3rem; }
.idle-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--amber) calc(var(--p) * 1%), var(--line-2) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4.5px));
  animation: ring-drain var(--dur, 10s) linear forwards;
}
@keyframes ring-drain { to { --p: 0; } }
.idle-count { position: relative; font-size: 2.9rem; font-weight: 560; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; color: var(--text); }
.idle-text { color: var(--text-2); }

.privacy-head { display: flex; gap: 1.2rem; align-items: flex-start; justify-content: space-between; padding-bottom: 0.6rem; border-bottom: 1px solid var(--line); }
.privacy-qr { margin: 0; max-width: 9.5rem; font-size: 0.78rem; line-height: 1.3; color: var(--text-3); text-align: center; }
.privacy-qr img { display: block; margin: 0 auto 0.4rem; padding: 0.35rem; border-radius: var(--r-sm); background: #fff; }
.privacy-full { overflow-y: auto; padding-top: 0.4rem; font-size: 0.96rem; line-height: 1.5; color: var(--text-2); }
.privacy-full h3 { margin: 1.1rem 0 0.3rem; font-size: 1.02rem; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.privacy-full ul { padding-inline-start: 1.2rem; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.4rem;
  z-index: 60;
  max-width: min(40rem, 92vw);
  padding: 0.85rem 1.35rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: var(--panel);
  box-shadow: var(--sheen), 0 24px 50px -24px rgba(0, 0, 0, 0.85);
  color: var(--text);
  font-weight: 520;
  line-height: 1.38;
  text-align: center;
  transform: translateX(-50%);
  animation: toast-in 320ms var(--ease);
  transition: opacity 300ms ease;
}
.toast-warn { border-color: var(--amber-line); }
.toast-error { border-color: rgba(255, 138, 115, 0.65); }
.toast-out { opacity: 0; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } }
.net-banner {
  position: fixed;
  top: 0.55rem;
  left: 50%;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 1rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--amber-line);
  background: var(--panel);
  color: var(--amber-hot);
  font-size: 0.84rem;
  font-weight: 520;
  width: max-content;
  max-width: calc(100vw - 2rem);
  transform: translateX(-50%);
}
.net-queue { color: var(--text-2); }
/* While the banner shows, every screen steps down to make room for it. */
.has-banner .screen { padding-top: 3.2rem; }
.has-banner .idle-top { top: 3.3rem; }
.net-banner > span:not(:empty) + .net-queue::before { content: "·"; margin-inline-end: 0.6rem; color: var(--text-4); }

/* Test phase only: the conversation is being kept (TEST_TRANSCRIPTS). A ribbon along the bottom
   edge, and every screen stops above it. */
.test-badge {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  height: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-top: 1px solid rgba(255, 138, 115, 0.45);
  background: rgba(96, 22, 14, 0.94);
  color: #ffd6cc;
  font-size: 0.76rem;
  font-weight: 560;
  letter-spacing: 0.01em;
  pointer-events: none;
}
.test-badge[hidden] { display: none; }
.test-dot { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: #ff5a47; animation: breathe 1.6s ease-in-out infinite; }
.has-test-badge .screen { min-height: calc(100dvh - 1.6rem); max-height: calc(100dvh - 1.6rem); }

/* --- Staff screens: activation and boot errors ---------------------------------------------- */
.screen-setup .idle-logo { margin-top: auto; margin-bottom: 0.4rem; }
.screen-setup .lead { max-width: 36rem; }

/* --- Portrait tablets ------------------------------------------------------------------------ */
@media (max-aspect-ratio: 1/1) {
  :root { font-size: clamp(17px, 2vw + 5px, 22px); }
  .screen-conversation { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto; }
  .cv-rail { grid-column: 1; grid-row: 3; align-self: stretch; margin: 1rem 0 0.2rem; overflow: visible; }
  .rail-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.6rem; }
  .rail-name { grid-column: 1 / -1; }
  .rail-card + .rail-card::before { left: 0.7rem; right: 0.7rem; }
  .conv-footer { grid-row: 4; }
  .summary-grid { grid-template-columns: minmax(0, 1fr); }
  .summary-grid .summary-card:nth-last-child(2):nth-child(odd)::after { display: block; }
  .orb-button { max-width: 30rem; }
  .privacy-points { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .btn-toggle .toggle-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .btn-toggle { padding: 0 0.95rem; }
  .topbar-extra { gap: 0.5rem; }
  .cv-doc-head { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  /* Countdowns are clocks, not motion: they keep their pace. */
  .idle-ring, .countdown-bar::after { animation-duration: var(--dur, 10s) !important; }
}
