/* purplish design system (INTERFACE-V2 §3–§6; the study's CSS is the specification: its tokens, rules, keyframes,
   durations and easings are lifted here as written).
   Greys with a hint of violet for every surface, line and quiet word, so purple is free to be the one accent: the
   primary button, what is selected, the badge, the mark. Blue, rose, mint, amber and red appear only as small state
   dots. Depth is three tones (bar, ground, raised panel) with a faintly lit edge; glass is kept for what floats. */

@font-face { font-family: "Outfit"; font-weight: 300; font-display: swap; src: url("../brand/fonts/Outfit-300.ttf") format("truetype"); }
@font-face { font-family: "Outfit"; font-weight: 400; font-display: swap; src: url("../brand/fonts/Outfit-400.ttf") format("truetype"); }
@font-face { font-family: "Outfit"; font-weight: 500; font-display: swap; src: url("../brand/fonts/Outfit-500.ttf") format("truetype"); }
@font-face { font-family: "Outfit"; font-weight: 600; font-display: swap; src: url("../brand/fonts/Outfit-600.ttf") format("truetype"); }
@font-face { font-family: "Outfit"; font-weight: 700; font-display: swap; src: url("../brand/fonts/Outfit-700.ttf") format("truetype"); }
/* the LIVE tag's face, bundled under its open licence (brand/fonts/OFL-PixelifySans.txt) */
@font-face { font-family: "Pixelify Sans"; font-weight: 400 700; font-display: swap; src: url("../brand/fonts/PixelifySans.ttf") format("truetype"); }

:root, .theme-dark {
  color-scheme: dark;
  /* surfaces: behind the window / the bar and side panels / the place / panels and cards */
  --page: #0b0b0e; --bar: #131217; --ground: #18171d; --raise: #201f27;
  /* a row under the pointer / pressed / fields, segmented tracks, behind pictures / what an avatar's colour mixes into */
  --hover: #2a2933; --press: #353340; --well: #0f0e13; --base: #17161c;
  /* quiet button, its hover, the tab mark */
  --fill-1: rgb(236 232 250 / 0.05); --fill-2: rgb(236 232 250 / 0.09); --fill-3: rgb(236 232 250 / 0.14);
  /* hairlines, stronger edges */
  --line: rgb(236 232 250 / 0.08); --line-2: rgb(236 232 250 / 0.15);
  /* every panel: a faintly lit top edge */
  --edge: inset 0 0 0 1px var(--line), inset 0 1px 0 rgb(255 255 255 / 0.035);
  /* only what floats: menus, sheets, notices, tooltips, the watch pill, tags on pictures */
  --glass: rgb(34 32 42 / 0.82); --glass-blur: blur(28px) saturate(1.5); --scrim: rgb(8 8 11 / 0.56);
  --glass-edge: inset 0 0 0 1px rgb(255 255 255 / 0.09), inset 0 1px 0 rgb(255 255 255 / 0.07);
  --float: 0 20px 56px -16px rgb(0 0 0 / 0.78), 0 3px 10px -2px rgb(0 0 0 / 0.4);
  --tip-float: 0 8px 20px -8px rgb(0 0 0 / 0.7);
  /* words / second line / labels; ink on the accent */
  --text: #f4eee6; --text-2: #b0acb9; --text-3: #86828f; --ink: #1a0f2e;
  /* the one accent */
  --purple: #c08bff; --purple-hi: #cfa5ff; --purple-text: #c9a8ff; --purple-fill: rgb(192 139 255 / 0.18);
  /* state dots and small marks only: Only me · live · online, in use · waiting · failure */
  --blue: #5b82ff; --live: #e8779f; --mint: #5ef2c2; --amber: #ffb45e; --red: #ff7a7a;
  --red-fill: rgb(255 122 122 / 0.12); --red-fill-2: rgb(255 122 122 / 0.16);
  /* behind a watched picture */
  --dark: #050308;
  /* the window's own controls: Windows' close key under the pointer; a Mac's three lights and their glyphs */
  --win-close: #d9434e; --win-close-ink: #fff;
  --light-close: #ff5f57; --light-minimize: #febc2e; --light-fullscreen: #28c840; --light-ink: rgb(0 0 0 / 0.6);
  /* the on-screen pill's own window cannot blur the desktop under it: a denser tint and a shorter shadow than glass */
  --pill-glass: rgb(34 32 42 / 0.94);
  /* a person's initial: their colour mixed towards this */
  --av-ink: #fff;
  --pill-shadow: 0 6px 16px -6px rgb(0 0 0 / 0.7), 0 2px 6px -2px rgb(0 0 0 / 0.4);
  /* the on-screen pad on a picture (player/TOUCH-PAD.md): a tint and a hairline, no blur, no colour but the ink */
  --pad-tint: rgb(34 32 42 / 0.42); --pad-ring: rgb(255 255 255 / 0.22); --pad-ink: rgb(244 238 230 / 0.9);
  --pad-knob: rgb(244 238 230 / 0.55); --pad-knob-ring: rgb(255 255 255 / 0.35); --pad-knob-held: rgb(244 238 230 / 0.8);
  --pad-pressed: rgb(236 232 250 / 0.32); --pad-pressed-ring: rgb(255 255 255 / 0.6);
  --ui: "Outfit", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --pixel: "Pixelify Sans", "Outfit", system-ui, sans-serif;
  /* the brand corner: cut at the top left and bottom right; everything you press takes it */
  --cut: 3px 10px 3px 10px; --cut-s: 2px 8px 2px 8px; --cut-xs: 1px 6px 1px 6px;
  --ease: cubic-bezier(0.2, 0, 0, 1); --out: cubic-bezier(0.2, 0.8, 0.2, 1); --spring: cubic-bezier(0.34, 1.45, 0.64, 1); --nudge: cubic-bezier(0.3, 1.25, 0.5, 1);
  /* what lies in front of the window, back to front: a sheet with its dimmed room; what floats (a menu, a panel),
     from the room or from inside a sheet, so always above the sheet it came from (lib/menu.js); notices; a name */
  --z-sheet: 50; --z-float: 60; --z-notice: 70; --z-tip: 80;
}
@supports (transition-timing-function: linear(0, 1)) {
  :root, .theme-dark { --spring: linear(0, 0.009, 0.035 2.1%, 0.141 4.4%, 0.723 12.9%, 0.938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, 0.991, 0.977 51%, 0.974 53.8%, 0.975 57.1%, 0.997 69.8%, 1.003 76.9%, 1); }
}

/* `.theme-dark` keeps the dark tokens on a thing that lies on a picture whatever the window's theme is (the Player's
   overlay, the watch page): a video's field is dark in every theme, so its ink and glass are too. */

/* ---- the light theme (Settings › App, `device.preferences.theme`): the same greys turned over, the same one accent.
   Text keeps ≥ 4.5:1 on its ground; pictures stay on black. */
:root[data-theme="light"] {
  color-scheme: light;
  --page: #e9e7ee; --bar: #f1eff5; --ground: #f7f6fa; --raise: #ffffff;
  --hover: #ebe8f1; --press: #dedae7; --well: #efedf3; --base: #ffffff;
  --fill-1: rgb(40 32 64 / 0.05); --fill-2: rgb(40 32 64 / 0.09); --fill-3: rgb(40 32 64 / 0.14);
  --line: rgb(40 32 64 / 0.10); --line-2: rgb(40 32 64 / 0.18);
  --edge: inset 0 0 0 1px var(--line), inset 0 1px 0 rgb(255 255 255 / 0.8);
  --glass: rgb(255 255 255 / 0.84); --scrim: rgb(40 32 64 / 0.25);
  --glass-edge: inset 0 0 0 1px rgb(40 32 64 / 0.10), inset 0 1px 0 rgb(255 255 255 / 0.8);
  --float: 0 20px 56px -16px rgb(40 32 64 / 0.28), 0 3px 10px -2px rgb(40 32 64 / 0.12);
  --tip-float: 0 8px 20px -8px rgb(40 32 64 / 0.3);
  --text: #1d1a24; --text-2: #55505f; --text-3: #6b6676;
  --purple: #9d5cf0; --purple-hi: #ad73f5; --purple-text: #7a3fd9; --purple-fill: rgb(157 92 240 / 0.16);
  --blue: #2f55d9; --mint: #138a66; --amber: #a86410; --red: #cf3327;
  --pill-glass: rgb(252 251 255 / 0.94);
  --pill-shadow: 0 6px 16px -6px rgb(40 32 64 / 0.3), 0 2px 6px -2px rgb(40 32 64 / 0.15);
  --ink: #fff;
  --av-ink: #1d1a24;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--ground); color: var(--text); font: 400 14px/1.4 var(--ui); -webkit-font-smoothing: antialiased; }
* { scrollbar-width: thin; scrollbar-color: var(--fill-3) transparent; }
::selection { background: rgb(192 139 255 / 0.35); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
.spring { flex: 1; }
.num { font-variant-numeric: tabular-nums; }

/* ---- type: labels above groups, 11/600 capitals, the quietest colour ------------------------------------------ */
.cap, .label { color: var(--text-3); font: 600 11px/1 var(--ui); letter-spacing: 0.09em; text-transform: uppercase; }
.cap .n { margin-left: 6px; opacity: 0.75; letter-spacing: 0; }
.sw { display: inline-block; }

/* ---- icons: the study's 20 grid -------------------------------------------------------------------------------- */
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.i--s { width: 15px; height: 15px; }
.i--l { width: 22px; height: 22px; }
.i .f { fill: currentColor; stroke: none; }

/* ---- state dot ------------------------------------------------------------------------------------------------- */
.dot { display: inline-block; width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--text-3); transition: background 0.2s; }
.dot--live { background: var(--live); } .dot--mine { background: var(--blue); } .dot--all { background: var(--purple); } .dot--on { background: var(--mint); } .dot--wait { background: var(--amber); } .dot--bad { background: var(--red); }
.dot--off { background: none; box-shadow: inset 0 0 0 1.5px var(--text-3); }
.sep { width: 1px; height: 20px; flex: none; margin: 0 4px; background: var(--line-2); }

/* ---- buttons --------------------------------------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: none; height: 32px; padding: 0 13px; border: 0; border-radius: var(--cut-s); background: var(--fill-2); color: var(--text); font: 600 13.5px/1 var(--ui); white-space: nowrap; text-decoration: none; user-select: none; -webkit-tap-highlight-color: transparent; transition: background 0.14s, color 0.14s, transform 0.12s var(--out); }
.btn:hover { background: var(--fill-3); }
.btn:active { transform: scale(0.96); }
.btn:disabled { color: var(--text-3); pointer-events: none; }
.btn--primary { background: var(--purple); color: var(--ink); }
.btn--primary:hover { background: var(--purple-hi); }
.btn--primary:disabled { background: var(--purple-fill); color: var(--purple-text); }
.btn--ghost { background: none; color: var(--text-2); }
.btn--ghost:hover { background: var(--fill-2); color: var(--text); }
.btn--danger { background: none; color: var(--red); padding: 0 10px; }
.btn--danger:hover { background: var(--red-fill); }
.btn--s { height: 28px; padding: 0 11px; font-size: 13px; }
/* an icon-only button (a tooltip names it) */
.ibtn, .btn--icon { display: grid; place-items: center; width: 32px; height: 32px; flex: none; padding: 0; border: 0; border-radius: var(--cut-s); background: none; color: var(--text-2); text-decoration: none; transition: background 0.14s, color 0.14s, transform 0.12s var(--out); }
.ibtn:hover, .btn--icon:hover { background: var(--fill-2); color: var(--text); }
.ibtn:active, .btn--icon:active { transform: scale(0.92); }
.ibtn:disabled, .btn--icon:disabled { color: var(--text-3); pointer-events: none; opacity: 0.5; }
.ibtn[aria-pressed="true"], .btn--icon[aria-pressed="true"], .ibtn[aria-current="page"], .btn--icon[aria-current="page"] { background: var(--purple-fill); color: var(--purple-text); }
.ibtn--s, .btn--icon.btn--s { width: 28px; height: 28px; }
/* a word with a menu under it */
.chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px; border: 0; border-radius: var(--cut-s); background: none; color: var(--text-2); font: 500 13.5px/1 var(--ui); white-space: nowrap; transition: background 0.14s, color 0.14s, transform 0.12s var(--out); }
.chip:hover, .chip[aria-expanded="true"] { background: var(--fill-2); color: var(--text); }
.chip:active { transform: scale(0.96); }
.chip .i:last-child, .pickbtn .i { width: 13px; height: 13px; color: var(--text-3); transition: transform 0.35s var(--nudge); }
.chip[aria-expanded="true"] .i:last-child, .pickbtn[aria-expanded="true"] .i { transform: rotate(180deg); }
.pickbtn { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 8px 0 11px; border: 0; border-radius: var(--cut-s); background: var(--fill-1); box-shadow: inset 0 0 0 1px var(--line); color: var(--text); font: 500 13px/1 var(--ui); white-space: nowrap; transition: background 0.14s; }
.pickbtn:hover, .pickbtn[aria-expanded="true"] { background: var(--fill-2); }
.pickbtn:disabled { color: var(--text-3); pointer-events: none; }

/* ---- segmented: two or three choices and one thumb that travels between them; always the same purple ------------ */
.seg { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; flex: none; padding: 3px; overflow: hidden; border-radius: var(--cut); background: var(--well); box-shadow: inset 0 0 0 1px var(--line); }
.seg__thumb { position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: var(--cut-s); background: var(--purple-fill); transition: transform 0.42s var(--nudge), width 0.3s var(--out); }
.seg button { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 7px; height: 28px; padding: 0 13px; border: 0; border-radius: var(--cut-s); background: none; color: var(--text-3); font: 500 13px/1 var(--ui); white-space: nowrap; transition: color 0.18s; outline-offset: -2px; }
.seg button:hover { color: var(--text); }
.seg button[aria-checked="true"] { color: var(--purple-text); font-weight: 600; }
.seg button:disabled { opacity: 0.4; pointer-events: none; }
/* before the thumb has measured its stop (and with no script) the chosen stop carries the fill itself */
.seg:not([data-thumb]) button[aria-checked="true"] { background: var(--purple-fill); }
.seg--host button { height: 32px; padding: 0 15px; font-size: 13.5px; }
.seg--lvl button { width: 30px; height: 26px; padding: 0; }
.seg--wide { display: grid; width: 100%; grid-auto-columns: auto; grid-template-columns: 1fr 1fr 1.25fr; grid-auto-flow: row; }
.seg--wide button { height: 34px; padding: 0 4px; gap: 5px; font-size: 12.5px; }
.seg--set button, .seg--s button { height: 26px; padding: 0 11px; }

/* ---- switch: the thumb springs across ----------------------------------------------------------------------------- */
.switch { position: relative; width: 36px; height: 20px; flex: none; padding: 0; border: 0; border-radius: 10px; background: var(--press); transition: background 0.2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-2); transition: transform 0.55s var(--spring), background 0.2s; }
.switch[aria-checked="true"] { background: var(--purple); }
.switch[aria-checked="true"]::after { transform: translateX(16px); background: var(--ink); }
.switch:disabled { opacity: 0.4; pointer-events: none; }

/* ---- field ------------------------------------------------------------------------------------------------------- */
.field, .sfield { height: 32px; padding: 0 10px; border: 0; outline: 0; border-radius: 8px; background: var(--well); box-shadow: inset 0 0 0 1px var(--line); color: var(--text); font: 400 13.5px/1 var(--ui); transition: box-shadow 0.16s; }
.sfield { width: 190px; height: 30px; }
.field::placeholder, .sfield::placeholder { color: var(--text-3); }
.field:focus, .sfield:focus { box-shadow: inset 0 0 0 1.5px var(--purple); }
.field.bad, .field[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px var(--red); animation: shake 0.4s var(--ease); }
textarea.field { height: auto; padding: 8px 10px; line-height: 1.4; }

/* ---- a circle is a person, a rounded square is a place ----------------------------------------------------------- */
.av { --c: var(--purple); position: relative; display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; background: color-mix(in srgb, var(--c) 28%, var(--base)); color: color-mix(in srgb, var(--c) 78%, var(--av-ink)); font: 600 13.5px/1 var(--ui); }
.av--s { width: 24px; height: 24px; font-size: 11px; }
.av--m { width: 28px; height: 28px; font-size: 12px; }
.av--l { width: 44px; height: 44px; font-size: 16px; }
.av--xl { width: 64px; height: 64px; font-size: 24px; }
.av--sq { border-radius: 9px; }
.av--s.av--sq { border-radius: 6px; }
.av .i { width: 15px; height: 15px; }
.av--l .i { width: 18px; height: 18px; }
.av[data-c="amber"] { --c: var(--amber); } .av[data-c="lilac"] { --c: var(--purple); } .av[data-c="rose"] { --c: var(--live); } .av[data-c="mint"] { --c: var(--mint); } .av[data-c="blue"] { --c: var(--blue); }
/* a person whose input is in use right now: one soft ring that breathes */
.av--busy::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--mint); animation: ring 2.2s ease-out infinite; }
.st { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--text-3); box-shadow: 0 0 0 2.5px var(--ring, var(--raise)); }
.st--on { background: var(--mint); } .st--live { background: var(--live); } .st--wait { background: var(--amber); }
.st--off { background: var(--ring, var(--raise)); box-shadow: 0 0 0 2.5px var(--ring, var(--raise)), inset 0 0 0 2px var(--text-3); }
.faces { display: inline-flex; flex: none; }
.faces .av { margin-left: -6px; box-shadow: 0 0 0 2px var(--ring, var(--raise)); }
.faces .av:first-child { margin-left: 0; }
/* the app's mark for a source's app (the picker), a letter when the system gave no icon */
.appmark { display: grid; place-items: center; width: 24px; height: 24px; flex: none; overflow: hidden; border-radius: 6px; background: color-mix(in srgb, var(--c, var(--purple)) 28%, var(--base)); color: color-mix(in srgb, var(--c, var(--purple)) 76%, var(--av-ink)); font: 700 11.5px/1 var(--ui); }
.appmark img { width: 100%; height: 100%; object-fit: contain; }

/* ---- tags: a small fact on a picture; LIVE is the one place the pixel face is used -------------------------------- */
.tag { display: inline-flex; align-items: center; gap: 5px; flex: none; height: 20px; padding: 0 7px; border-radius: var(--cut-xs); background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-edge); color: var(--text); font: 600 11px/1 var(--pixel); letter-spacing: 0.08em; white-space: nowrap; }
.tag--plain { font: 600 11.5px/1 var(--ui); letter-spacing: 0; }
.kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; flex: none; border-radius: 4px; background: var(--fill-1); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text-2); font: 500 11px/1 var(--ui); }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--purple); color: var(--ink); font: 700 11px/18px var(--ui); text-align: center; animation: badge 0.7s var(--spring) 0.5s both; }

/* ---- panels of rows ----------------------------------------------------------------------------------------------- */
.panel { overflow: hidden; border-radius: 12px; background: var(--raise); box-shadow: var(--edge); }
.sect { display: grid; gap: 8px; align-content: start; }
.sect__head { display: flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 4px; }
.sect > .cap { padding: 0 4px; }
.level-note { margin: 0; padding: 0 4px; color: var(--text-2); font: 400 12px/1.5 var(--ui); }
.row { --ring: var(--raise); position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 9px 12px 9px 14px; border: 0; background: none; color: var(--text); text-align: left; text-decoration: none; transition: background 0.14s; }
.row + .row { border-top: 1px solid var(--line); }
button.row:hover, .row[role="button"]:hover, .row[aria-pressed="true"] { --ring: var(--hover); background: var(--hover); }
.row::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--purple); transform: scaleY(0); transition: transform 0.4s var(--nudge); }
.row[aria-pressed="true"]::before { transform: scaleY(1); }
.row__who { flex: 1; min-width: 0; display: grid; gap: 1px; }
.row__who b, .row__name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 600 14.5px/1.3 var(--ui); }
.row__who span, .row__meta { overflow: hidden; color: var(--text-2); font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.row__name { flex: 1; min-width: 0; }
.row__meta { flex: none; }
.row--dim b, .row--dim .row__who span, .row--dim .row__name { color: var(--text-3); }
.row--dim .av { filter: saturate(0.4); opacity: 0.7; }
.row--none .row__who span { color: var(--text-3); }
.row__go { color: var(--text-3); transition: transform 0.35s var(--nudge), color 0.14s; }
.row:hover .row__go { color: var(--text); transform: translateX(4px); }
.row__acts { display: flex; align-items: center; gap: 4px; }
/* Remove: the first press arms it (it turns red and says so), the second removes. Nothing in the row moves. */
.row__out { opacity: 0; }
.row:hover .row__out, .row__out:focus-visible, .row__out[data-armed] { opacity: 1; }
.row__out[data-armed] { background: var(--red-fill-2); color: var(--red); animation: pop-in 0.4s var(--spring) both; }
.row__pic { position: relative; width: 112px; flex: none; overflow: hidden; aspect-ratio: 16 / 9; border-radius: 6px; background: var(--well); box-shadow: 0 0 0 1px var(--line-2); }
.row__pic img, .row__pic canvas { display: block; width: 100%; height: 100%; object-fit: cover; }
.row__pic .tag { position: absolute; top: 5px; left: 5px; height: 17px; padding: 0 5px; font-size: 10px; }
/* a row that goes: closes up to nothing (lib/motion.js `collapse`) */
.row.going { min-height: 0; overflow: hidden; }

/* a name on the left, one control on the right (Settings and the sheets) */
.srow { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 8px 12px 8px 14px; }
.srow + .srow { border-top: 1px solid var(--line); }
.srow > b, .srow__name { flex: 1; min-width: 0; font-weight: 500; }
.srow__name > b { font-weight: inherit; }
.srow__name small { display: block; color: var(--text-2); font-size: 13px; font-weight: 400; }
.val { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 13.5px; white-space: nowrap; }
.card { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--raise); box-shadow: var(--edge); }
.card__who { flex: 1; min-width: 0; display: grid; gap: 1px; }
.card__who b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }
.card__who span { color: var(--text-2); font-size: 13px; }
.card--stack { display: grid; gap: 12px; }
.opt { display: flex; align-items: center; gap: 12px; }
.opt b { flex: 1; font-weight: 500; }
.empty { color: var(--text-3); }

/* facts in a sheet: the same row, on glass */
.facts { display: grid; }
.fact { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 0; }
.fact + .fact { border-top: 1px solid var(--line); }
.fact__k { flex: 1; min-width: 0; font-weight: 500; }
.fact__k small { display: block; color: var(--text-2); font-size: 13px; font-weight: 400; }
.fact__v { flex: none; color: var(--text-2); }

/* ---- what floats: the only glass ---------------------------------------------------------------------------------- */
.pop, .menu { position: fixed; z-index: var(--z-float); border-radius: 14px; background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-edge), var(--float); animation: pop 0.28s var(--out) both; }
.pop--out, .menu.pop--out { animation: pop-out 0.14s var(--ease) both; pointer-events: none; }
/* a panel takes the focus itself (lib/menu.js), as a sheet does: no ring round the whole of it */
.pop:focus-visible, .menu:focus-visible { outline: none; }
.menu { min-width: 200px; max-width: 340px; padding: 6px; overflow-y: auto; }
.menu .cap, .menu__head { display: block; padding: 8px 10px 7px; color: var(--text-3); font: 600 11px/1 var(--ui); letter-spacing: 0.09em; text-transform: uppercase; }
.menu__item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: 500 13.5px/1 var(--ui); text-align: left; transition: background 0.1s; }
.menu__item:hover, .menu__item:focus-visible { background: var(--fill-2); outline: none; }
.menu__item > .i:first-child { color: var(--text-2); }
.menu__label { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.menu__note { flex: none; color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.menu__check { margin-left: auto; color: var(--purple-text); }
.menu__sep { height: 1px; margin: 4px 6px; background: var(--line); }
/* a name for a control that is only a picture: it waits before the first, then follows from one to the next */
.tip { position: fixed; z-index: var(--z-tip); padding: 5px 9px; border-radius: 7px; background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-edge), var(--tip-float); color: var(--text); font: 500 12.5px/1.3 var(--ui); white-space: nowrap; pointer-events: none; animation: tip 0.16s var(--out) both; }

/* notices: rise in with the spring, leave in 0.2 s */
.toasts { position: fixed; z-index: var(--z-notice); left: 12px; right: 12px; bottom: 20px; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 9px; max-width: min(560px, 100%); padding: 9px 14px; border-radius: 10px; background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-edge), var(--float); color: var(--text); font-size: 13.5px; pointer-events: auto; animation: toast 0.45s var(--spring) both; }
.toast .btn { margin: -3px -8px -3px 4px; }
.toast--out { animation: toast-out 0.2s var(--ease) both; }

/* sheets: in front of the window, which dims and blurs 6 px; scale 0.92 → 1 with the spring */
.scrim { position: fixed; inset: 0; z-index: var(--z-sheet); display: grid; place-items: center; padding: 16px; background: var(--scrim); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade 0.2s both; }
.scrim.out { animation: fade-out 0.16s both; pointer-events: none; }
.sheet { --ring: var(--raise); width: min(380px, 100%); max-height: 100%; overflow: auto; padding: 20px; border-radius: 14px; background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-edge), var(--float); animation: sheet 0.5s var(--spring) both; }
.scrim.out .sheet { animation: sheet-out 0.16s var(--ease) both; }
.sheet:focus-visible { outline: none; }
.sheet--m { width: min(452px, 100%); }
.sheet--l { width: min(640px, 100%); }
.sheet h2 { font: 600 19px/1.25 var(--ui); letter-spacing: -0.01em; }
.sheet__head p { margin-top: 6px; color: var(--text-2); }
.sheet__body { display: grid; gap: 16px; margin-top: 16px; }
.sheet__body[hidden] + .sheet__foot { margin-top: 20px; }
.sheet__foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
/* the answers: the one that goes on is purple; the others are quiet (the study's Cancel) */
.sheet__foot .btn:not(.btn--primary):not(.btn--danger) { background: none; color: var(--text-2); }
.sheet__foot .btn:not(.btn--primary):not(.btn--danger):hover { background: var(--fill-2); color: var(--text); }
.sheet .rows { display: grid; margin: 0 -10px; }
.sheet .rows .row { min-height: 48px; padding: 6px 10px; border-radius: 8px; }
.sheet .rows .row + .row { border-top: 0; }

/* ---- motion ------------------------------------------------------------------------------------------------------ */
@keyframes page-in { from { opacity: 0; transform: translateX(36px); filter: blur(5px); } }
@keyframes page-out { to { opacity: 0; transform: translateX(-36px); filter: blur(5px); } }
@keyframes page-in-back { from { opacity: 0; transform: translateX(-36px); filter: blur(5px); } }
@keyframes page-out-back { to { opacity: 0; transform: translateX(36px); filter: blur(5px); } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); filter: blur(3px); } }
@keyframes rise-x { from { opacity: 0; transform: translateX(16px); filter: blur(3px); } }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(0.95); filter: blur(5px); } }
@keyframes pop-out { to { opacity: 0; transform: translateY(-6px) scale(0.97); filter: blur(3px); } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.3); } }
@keyframes tip { from { opacity: 0; transform: translateY(3px) scale(0.96); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes toast { from { opacity: 0; transform: translateY(16px) scale(0.94); filter: blur(4px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(0.97); filter: blur(3px); } }
@keyframes sheet { from { opacity: 0; transform: translateY(12px) scale(0.92); filter: blur(5px); } }
@keyframes sheet-out { to { opacity: 0; transform: scale(0.96); filter: blur(3px); } }
@keyframes watch-out { to { opacity: 0; transform: scale(0.98); filter: blur(6px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes badge { from { opacity: 0; transform: translate(-7px, 7px) scale(0.3); } }
@keyframes shake { 15% { transform: translateX(-7px); } 35% { transform: translateX(6px); } 55% { transform: translateX(-4px); } 75% { transform: translateX(2px); } }
@keyframes shimmer { to { background-position: -220% 0; } }
@keyframes shimmer-text { to { background-position: -240% 0; } }
@keyframes ring { from { transform: scale(0.9); opacity: 0.75; } to { transform: scale(1.14); opacity: 0; } }
@keyframes bob { 50% { translate: 0 -3px; } }

/* Everything stops for reduced motion. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
