/* Lumenia Portal — a screening room: warm dark, ivory type, and the amber light of the projector
   on what you're watching, which also marks what you can act on. */

@font-face { font-family: "Bricolage"; src: url("fonts/bricolage-latin.woff2") format("woff2"); font-weight: 400 800; 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: "Bricolage"; src: url("fonts/bricolage-latin-ext.woff2") format("woff2"); font-weight: 400 800; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Instrument"; src: url("fonts/instrument-latin.woff2") format("woff2"); font-weight: 400 700; 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: "Instrument"; src: url("fonts/instrument-latin-ext.woff2") format("woff2"); font-weight: 400 700; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: dark;
  /* Warm home-cinema neutrals (a living room at night), lit in amber: the projector's lamp. */
  --velvet: #131014;
  --velvet-deep: #0d0b0d;
  --surface: #1d1719;
  --surface-2: #272022;
  --line: #322a2c;
  --ivory: #f1e8e0;
  --muted: #a99d96;
  --faint: #7b706a;
  --lamp: #ffcb8e;
  --lamp-glow: rgba(242, 167, 105, 0.18);
  --accent: #f2a769;
  --accent-ink: #2a1709;
  --ok: #8fd9b6;
  --danger: #ff8a8f;

  --display: "Bricolage", "Instrument", ui-sans-serif, system-ui, sans-serif;
  --text: "Instrument", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --page: min(1180px, 100% - 48px);
  --dock-h: 0px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--velvet); color: var(--ivory);
  font: 400 16px/1.55 var(--text); font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--lamp); color: var(--velvet); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3 { font-family: var(--display); font-weight: 700; margin: 0; letter-spacing: -0.025em; line-height: 1.08; }
h1 { font-size: clamp(34px, 5vw, 52px); font-variation-settings: "opsz" 96; }
h2 { font-size: clamp(22px, 2.6vw, 28px); font-variation-settings: "opsz" 48; }
h3 { font-size: 18px; letter-spacing: -0.01em; font-variation-settings: "opsz" 24; }
p { margin: 0; }
.lede { color: var(--muted); max-width: 62ch; margin-top: 12px; font-size: 17px; }
.quiet { color: var(--muted); }
.small { font-size: 14px; }
/* Titles come in any language: right-to-left ones read correctly but stay aligned with the layout. */
bdi, [dir="auto"] { unicode-bidi: plaintext; text-align: left; }

/* Header ----------------------------------------------------------------------------------------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--velvet) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.top-inner { width: var(--page); margin: 0 auto; height: 68px; display: flex; align-items: center; gap: 28px; }
.wordmark { display: flex; align-items: center; gap: 10px; color: var(--ivory); font: 700 22px/1 var(--display); letter-spacing: -0.03em; }
.wordmark:hover { text-decoration: none; }
.wordmark svg { width: 30px; height: 30px; }
/* Sections: a pill of tabs, the open one lit. */
.tabs {
  display: flex; gap: 2px; margin-right: auto; padding: 4px; border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--line);
}
.tabs a {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; color: var(--muted); font-weight: 500; border-radius: 12px;
}
.tabs a svg { width: 18px; height: 18px; }
.tabs a:hover { color: var(--ivory); text-decoration: none; background: var(--surface-2); }
.tabs a[aria-current="page"] {
  color: var(--ivory); background: color-mix(in srgb, var(--accent) 22%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}
.tabs a[aria-current="page"] svg { color: var(--accent); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.btn-link-tv { gap: 8px; color: var(--ivory); background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.btn-link-tv svg { width: 18px; height: 18px; color: var(--accent); }
.menu summary .menu-avatar { width: 100%; height: 100%; border-radius: 50%; font-size: 15px; }
.menu summary:has(.menu-avatar) { overflow: hidden; padding: 0; }

.menu { position: relative; }
.menu summary {
  list-style: none; cursor: pointer; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-2); color: var(--ivory);
  font: 700 15px var(--display); border: 1px solid var(--line);
}
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { border-color: var(--accent); }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 10px); width: 260px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 24px 48px -12px rgba(5, 3, 10, 0.7);
}
.menu-panel .who { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-panel .who strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.menu-panel a, .menu-panel button {
  display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  color: var(--ivory); background: none; border: 0; font: inherit; cursor: pointer; text-align: left;
}
.menu-panel a:hover, .menu-panel button:hover { background: var(--surface-2); text-decoration: none; }
.menu-panel svg { width: 18px; height: 18px; color: var(--muted); }

/* Mobile dock ------------------------------------------------------------------------------------ */
.dock { display: none; }

/* Page ------------------------------------------------------------------------------------------- */
main { width: var(--page); margin: 0 auto; padding: 48px 0 96px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 36px; }
.page-head > * { min-width: 0; max-width: 100%; }
.section { margin-top: 64px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head a { font-weight: 500; }

/* Buttons ---------------------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 0 20px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ivory); font: 600 15px/1 var(--text); cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:hover { text-decoration: none; background: var(--surface-2); border-color: #45393b; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: linear-gradient(180deg, #f6b47c, #ea9958); border-color: #ec9d5d; color: var(--accent-ink); }
.btn-primary:hover { background: linear-gradient(180deg, #f9c08e, #eea466); border-color: #f0a668; }
.btn-quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn-quiet:hover { background: var(--surface); color: var(--ivory); border-color: transparent; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  border: 0; background: transparent; color: var(--faint); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ivory); }
.icon-btn.danger:hover { color: var(--danger); }
.icon-btn svg { width: 18px; height: 18px; }
.inline { display: inline; margin: 0; }

/* Flash messages --------------------------------------------------------------------------------- */
.notices { display: grid; gap: 10px; margin-bottom: 28px; }
.notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); font-size: 15px;
}
.notice::before { content: ""; width: 8px; height: 8px; border-radius: 50%; margin-top: 8px; flex-shrink: 0; background: var(--ok); }
.notice.warning::before { background: var(--lamp); }
.notice.error::before { background: var(--danger); }
.notice.error { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }

/* Home: the projected hero ---------------------------------------------------------------------- */
.marquee {
  position: relative; overflow: hidden; isolation: isolate; border-radius: 28px;
  background: var(--velvet-deep); min-height: 380px; display: grid; grid-template-columns: auto 1fr; gap: 48px;
  align-items: end; padding: 48px;
}
.marquee-bg { position: absolute; inset: -40px; z-index: -2; background-size: cover; background-position: center;
  filter: blur(36px) saturate(1.25); opacity: 0.5; transform: scale(1.1); }
.marquee::before { /* the projector beam */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(90% 120% at 0% 0%, rgba(245, 201, 121, 0.28), transparent 55%),
    linear-gradient(90deg, rgba(16, 13, 23, 0.2), rgba(16, 13, 23, 0.85) 55%),
    linear-gradient(0deg, rgba(16, 13, 23, 0.9), transparent 70%);
}
.marquee-poster {
  position: relative; width: 200px; aspect-ratio: 2 / 3; border-radius: 14px; overflow: hidden; background: var(--surface-2);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.marquee-poster img { width: 100%; height: 100%; object-fit: cover; }
.marquee-copy { max-width: 620px; }
.marquee-copy .kicker { color: var(--lamp); font-weight: 600; font-size: 15px; }
.marquee-copy h1 { margin-top: 10px; font-size: clamp(36px, 5.4vw, 64px); text-wrap: balance; }
.marquee-copy .episode { margin-top: 10px; color: var(--ivory); opacity: 0.85; font-size: 17px; }
.marquee-progress { margin-top: 26px; display: grid; gap: 10px; max-width: 420px; }
.marquee-progress .meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 14px; }

.bar { height: 4px; border-radius: 4px; background: rgba(243, 238, 230, 0.14); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--lamp); box-shadow: 0 0 10px var(--lamp-glow); }
.bar.done > span { background: var(--ok); box-shadow: none; }

.welcome { padding: 56px 48px; align-items: center; grid-template-columns: 1fr; }
.welcome h1 { font-size: clamp(36px, 5vw, 56px); max-width: 16ch; }
.steps { margin: 28px 0 0; padding: 0; list-style: none; display: grid; gap: 14px; counter-reset: step; max-width: 560px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 32px 1fr; gap: 14px; align-items: baseline; color: var(--muted); }
.steps li::before {
  content: counter(step); font: 700 18px/1 var(--display); color: var(--lamp);
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--lamp) 45%, transparent);
  display: grid; place-items: center;
}
.steps li.done { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--faint); }
.steps li.done::before { content: "✓"; color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.steps a { font-weight: 600; }

/* Poster shelf ------------------------------------------------------------------------------------ */
.shelf {
  display: grid; grid-auto-flow: column; grid-auto-columns: 152px; gap: 18px; overflow-x: auto;
  scroll-snap-type: x mandatory; padding-bottom: 10px; margin-inline: -4px; padding-inline: 4px;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.tile { scroll-snap-align: start; min-width: 0; }
.tile .art { aspect-ratio: 2 / 3; border-radius: 12px; overflow: hidden; background: var(--surface); position: relative; }
.tile .art img { width: 100%; height: 100%; object-fit: cover; }
.tile .bar { margin-top: 10px; }
.tile .name { margin-top: 10px; font-weight: 600; font-size: 15px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.art img, .marquee-poster img { position: relative; }
.art-fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; text-align: center;
  font: 700 15px/1.2 var(--display); color: var(--muted);
  background: radial-gradient(120% 80% at 0% 0%, var(--lamp-glow), transparent 60%), var(--surface); }

/* Home: your setup ------------------------------------------------------------------------------ */
.setup { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.ledger { margin: 0; border-top: 1px solid var(--line); }
.ledger > div { display: grid; grid-template-columns: 140px 1fr auto; gap: 20px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line); }
.ledger dt { color: var(--muted); font-size: 15px; }
.ledger dd { margin: 0; min-width: 0; }
.ledger dd .names { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger dd .quiet { font-size: 14px; }
.ledger .go { color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px; }
.panel + .panel { margin-top: 20px; }
.panel h3 + p { margin-top: 6px; }

.switch { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: start; cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; margin: 4px 0 0; width: 46px; height: 28px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); position: relative; cursor: pointer; transition: background-color 0.2s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--muted); transition: transform 0.2s, background-color 0.2s; }
.switch input:checked { background: var(--accent); border-color: var(--accent); }
.switch input:checked::after { transform: translateX(18px); background: var(--accent-ink); }
.switch strong { display: block; font-weight: 600; }
.switch span span { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; }

/* History ----------------------------------------------------------------------------------------- */
.filters { display: flex; gap: 8px; overflow-x: auto; margin: -4px -4px 36px; padding: 4px; scrollbar-width: none; }
.filters a {
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
  font-weight: 500; font-size: 15px; white-space: nowrap;
}
.filters a:hover { color: var(--ivory); text-decoration: none; border-color: #4a3f5e; }
.filters a[aria-current="true"] { background: var(--ivory); color: var(--velvet); border-color: var(--ivory); }

.day { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 32px; padding: 28px 0; border-top: 1px solid var(--line); }
.day h2 { font-size: 22px; position: sticky; top: 96px; align-self: start; }
.day h2 small { display: block; margin-top: 6px; font: 400 14px var(--text); color: var(--faint); letter-spacing: 0; }
.plays { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.play {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto; gap: 18px; align-items: center;
  padding: 10px 10px 10px 10px; margin-inline: -10px; border-radius: 14px;
}
.play:hover { background: var(--surface); }
.play .art { width: 56px; aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; background: var(--surface-2); position: relative; }
.play .art img { width: 100%; height: 100%; object-fit: cover; }
.play .art .art-fallback { font-size: 12px; padding: 4px; }
.play .title { font-weight: 600; font-size: 17px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.play .title .year { color: var(--faint); font-weight: 400; margin-left: 6px; }
.play .detail { color: var(--muted); font-size: 14px; margin-top: 2px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.play .detail .bar { width: 120px; }
.play .state-done { color: var(--ok); }
.play time { color: var(--faint); font-size: 14px; font-variant-numeric: tabular-nums; }
.play .icon-btn { opacity: 0; }
.play:hover .icon-btn, .play .icon-btn:focus-visible { opacity: 1; }
.kind-live .art { display: grid; place-items: center; color: var(--lamp); }

.blank { text-align: center; padding: 72px 24px; border: 1px dashed var(--line); border-radius: 24px; }
.blank h2 { font-size: 24px; }
.blank p { color: var(--muted); margin: 10px auto 22px; max-width: 46ch; }

/* Lists: playlists, addons, TVs ------------------------------------------------------------------ */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rows > li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); }
.rows > li.off .name, .rows > li.off .desc { opacity: 0.55; }
.rows .badge {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; overflow: hidden;
  background: var(--surface-2); color: var(--muted); font: 700 17px var(--display);
}
.rows .badge img { width: 100%; height: 100%; object-fit: contain; }
.rows .badge svg { width: 24px; height: 24px; }
.rows .order { width: 52px; text-align: center; font: 700 28px/1 var(--display); color: var(--faint); }
.rows .name { font-weight: 600; font-size: 17px; }
.rows .name .version { color: var(--faint); font-weight: 400; font-size: 14px; margin-left: 8px; }
.rows .facts { display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--muted); font-size: 14px; margin-top: 4px; }
.rows .facts > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.rows .desc { color: var(--muted); font-size: 14px; margin-top: 4px; max-width: 70ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rows .actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.live-dot { display: inline-flex; align-items: center; gap: 8px; }
.live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.live-dot.on::before { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 18%, transparent); }

/* Profiles ------------------------------------------------------------------------------------------ */
.avatar {
  --avatar: var(--accent); flex: none; display: inline-grid; place-items: center; overflow: hidden;
  width: 40px; height: 40px; border-radius: 12px; background: var(--avatar); color: #fff;
  font: 700 18px/1 var(--display); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.big { width: 112px; height: 112px; border-radius: 26px; font-size: 48px; }
.avatar.mini { width: 22px; height: 22px; border-radius: 7px; font-size: 12px; }
.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.people > li {
  display: grid; justify-items: center; gap: 10px; padding: 28px 18px 18px; text-align: center;
  border: 1px solid var(--line); border-radius: 22px; background: var(--surface);
}
.people > li[aria-current="true"] { border-color: var(--accent); }
.people .who { display: flex; align-items: center; gap: 8px; }
.people .name { font: 700 20px var(--display); letter-spacing: -0.01em; }
.people .pin { display: inline-flex; align-items: center; gap: 4px; color: var(--lamp); font-size: 12px; font-weight: 600; }
.people .pin svg { width: 14px; height: 14px; }
.people .facts { display: grid; gap: 2px; color: var(--muted); font-size: 13px; }
.people .actions { display: flex; gap: 6px; }
.people .person { display: grid; justify-items: center; gap: 10px; color: inherit; border-radius: 16px; padding: 4px 8px; }
.people .person:hover { text-decoration: none; }
.people .person:hover .avatar { outline: 3px solid var(--ivory); outline-offset: 3px; }
.tag.kids { background: color-mix(in srgb, var(--lamp) 22%, transparent); color: var(--lamp); font-weight: 600; }
.back-link { display: inline-block; margin-bottom: 18px; color: var(--muted); font-weight: 500; }
.person-head { justify-content: flex-start; align-items: center; }
.person-head .lede { margin-top: 8px; }
form.form > .panel + .panel, form + .panel, .panel + form { margin-top: 20px; }
.sticky-save { position: sticky; bottom: calc(var(--dock-h) + 12px); z-index: 5; margin-top: 20px; }
.links { margin: 16px 0 0; display: grid; }
.links > div { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 0; border-top: 1px solid var(--line); }
.links dt { font-weight: 600; }
.links dd { margin: 0; color: var(--ivory); font-size: 15px; }
@media (max-width: 760px) {
  .links > div { grid-template-columns: minmax(0, 1fr) auto; }
  .links dd { grid-column: 1 / -1; grid-row: 2; }
}
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset > legend { padding: 0; font-weight: 600; font-size: 15px; margin-bottom: 10px; }
.swatches { display: flex; flex-wrap: wrap; gap: 12px; }
.swatches > legend { width: 100%; }
.swatch input {
  appearance: none; -webkit-appearance: none; margin: 0; width: 40px; height: 40px; border-radius: 12px; cursor: pointer;
  background: var(--avatar); border: 3px solid transparent; outline: 0;
}
.swatch input:checked { border-color: var(--ivory); box-shadow: 0 0 0 3px var(--velvet) inset; }
.swatch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.checklist { display: grid; gap: 4px; }
.tick { display: flex !important; align-items: center; gap: 10px; font-weight: 400 !important; font-size: 15px !important; margin: 6px 0 0 !important; cursor: pointer; }
.tick input, .chip input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.tick .tag { margin-left: auto; }
.mode-row { cursor: default; }
.mode-row select { width: auto; min-width: 170px; padding: 6px 10px; }
input.file { width: 100%; color: var(--muted); font: 400 14px var(--text); }
input, select, textarea { min-width: 0; max-width: 100%; }
input.file::file-selector-button {
  margin-right: 12px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ivory); font: 600 14px var(--text); cursor: pointer;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 6px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 600;
}
.chip:has(input:checked) { color: var(--ivory); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.chip:has(input:not(:checked)) .avatar { filter: grayscale(1); opacity: 0.5; }
.chip input { width: 15px; height: 15px; }
/* A playlist per profile: a select in the chip, coloured by what the profile gets. */
.chip.mode { cursor: default; padding-right: 6px; }
.chip.mode select { background: transparent; color: inherit; border: 0; font: inherit; padding: 2px 4px; cursor: pointer; }
.chip.mode select option { color: initial; }
.chip.mode-browse { color: var(--ivory); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.chip.mode-watch { color: var(--ivory); border-style: dashed; border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.chip.mode-off .avatar { filter: grayscale(1); opacity: 0.5; }
.access { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.access .chips { margin-top: 10px; }
.people-filter { margin-bottom: 14px; }
.people-filter a { display: inline-flex; align-items: center; gap: 8px; }
.select-inline { display: flex; align-items: center; gap: 10px; }
.select-inline select { min-height: 38px; width: auto; font-size: 14px; border-radius: 999px; padding-left: 14px; }

.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 13px; }

/* Forms -------------------------------------------------------------------------------------------- */
.form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
/* minmax(0, …): fields shrink with the screen; an input's natural width never widens the page. */
.form-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.form-grid .wide { grid-column: 1 / -1; }
.field label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.field > legend { margin-bottom: 8px; }
.field .hint { color: var(--faint); font-size: 13px; margin-top: 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input:not([type]), select, textarea {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--velvet-deep); color: var(--ivory); font: 400 16px var(--text); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
select { appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23a79fb5' stroke-width='1.8'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline-form { display: flex; gap: 10px; }
.inline-form input { flex: 1; min-width: 0; }

.code-entry {
  font: 700 clamp(28px, 7vw, 40px)/1 var(--display) !important; letter-spacing: 0.18em; text-align: center; text-transform: uppercase;
  min-height: 84px !important; border-radius: 18px !important;
}
.code-show {
  display: block; padding: 24px; margin: 8px 0 18px; text-align: center; border-radius: 18px;
  border: 1px dashed color-mix(in srgb, var(--lamp) 50%, transparent); color: var(--lamp);
  font: 700 clamp(30px, 7vw, 44px)/1 var(--display); letter-spacing: 0.2em;
}
.narrow { max-width: 560px; }
.waiting { display: flex; gap: 12px; align-items: center; color: var(--muted); }
.waiting::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--lamp); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; transform: scale(0.7); } }

/* Sign-in: a wall of what's showing ---------------------------------------------------------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(380px, 1fr); }
.wall { position: relative; overflow: hidden; background: var(--velvet-deep); isolation: isolate; }
.wall-grid { position: absolute; inset: -10% -6%; display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px;
  transform: rotate(-8deg); z-index: -2; }
.wall-col { display: grid; gap: 14px; align-content: start; animation: drift 90s linear infinite alternate; }
.wall-col:nth-child(even) { animation-direction: alternate-reverse; margin-top: -120px; }
.wall-col img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 10px; opacity: 0.85; }
@keyframes drift { to { transform: translateY(-22%); } }
.wall::after { content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(70% 60% at 15% 85%, rgba(245, 201, 121, 0.22), transparent 60%),
    linear-gradient(180deg, rgba(16, 13, 23, 0.35), rgba(16, 13, 23, 0.92) 78%); }
.wall-copy { position: absolute; left: 56px; right: 56px; bottom: 56px; max-width: 520px; }
.wall-copy h1 { font-size: clamp(40px, 5vw, 64px); text-wrap: balance; }
.wall-copy p { margin-top: 16px; color: var(--ivory); opacity: 0.8; font-size: 18px; max-width: 40ch; }
.auth-side { display: flex; flex-direction: column; padding: 40px 56px; background: var(--velvet); }
.auth-side .wordmark { margin-bottom: auto; }
.auth-form { width: 100%; max-width: 380px; margin: 48px 0 auto; }
.auth-form h2 { font-size: 32px; }
.auth-form .lede { font-size: 16px; margin-top: 8px; margin-bottom: 32px; }
.auth-form .btn { width: 100%; margin-top: 6px; }
.auth-switch { margin-top: 24px; color: var(--muted); font-size: 15px; }

/* Confirm dialog ------------------------------------------------------------------------------------- */
dialog { padding: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--ivory);
  width: min(420px, calc(100% - 32px)); box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.8); }
dialog::backdrop { background: rgba(10, 8, 15, 0.7); backdrop-filter: blur(4px); }
dialog[open] { animation: rise 0.18s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.dialog-body { padding: 26px 26px 22px; }
.dialog-body p { color: var(--muted); margin-top: 8px; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 0 26px 24px; }

/* Errors ---------------------------------------------------------------------------------------------- */
.error-page { min-height: 70vh; display: grid; place-content: center; text-align: center; gap: 14px; }
.error-page .code { font: 800 clamp(80px, 18vw, 160px)/0.9 var(--display); color: var(--lamp); letter-spacing: -0.05em;
  text-shadow: 0 0 60px var(--lamp-glow); }
.error-page p { color: var(--muted); max-width: 44ch; margin: 0 auto 10px; }

/* Small screens ------------------------------------------------------------------------------------- */
@media (max-width: 1000px) {
  .setup { grid-template-columns: 1fr; gap: 32px; }
  .auth { grid-template-columns: 1fr; }
  .wall { min-height: 300px; }
  .wall-copy { left: 24px; right: 24px; bottom: 28px; }
  .wall-copy h1 { font-size: 36px; }
  .wall-copy p { font-size: 16px; }
  .auth-side { padding: 28px 24px 48px; }
  .auth-side .wordmark { display: none; }
  .auth-form { margin: 8px auto 0; }
}

@media (max-width: 760px) {
  :root { --page: calc(100% - 32px); --dock-h: 68px; }
  .top-inner { height: 60px; }
  .tabs, .top-actions .btn-primary { display: none; }
  .top-actions { margin-left: auto; }
  main { padding: 28px 0 calc(var(--dock-h) + 48px + env(safe-area-inset-bottom)); }
  .dock {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--velvet-deep) 92%, transparent);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line);
  }
  .dock a { display: grid; justify-items: center; gap: 3px; padding: 8px 0 6px; color: var(--faint); font-size: 11px; font-weight: 600; border-radius: 12px; }
  .dock a:hover { text-decoration: none; }
  .dock svg { width: 22px; height: 22px; }
  .dock a[aria-current="page"] { color: var(--ivory); }
  .dock a[aria-current="page"] svg { color: var(--lamp); filter: drop-shadow(0 0 6px var(--lamp-glow)); }

  .page-head { margin-bottom: 24px; }
  .section { margin-top: 44px; }
  .marquee { grid-template-columns: 1fr; padding: 24px; gap: 22px; min-height: 0; border-radius: 22px; }
  .marquee-poster { width: 112px; }
  .marquee-copy h1 { font-size: 34px; }
  .welcome { padding: 32px 24px; }
  .shelf { grid-auto-columns: 128px; gap: 14px; }
  .ledger > div { grid-template-columns: 1fr auto; gap: 4px 16px; }
  .ledger dt { grid-column: 1 / -1; font-size: 14px; }
  .panel { padding: 22px; border-radius: 18px; }

  .day { grid-template-columns: 1fr; gap: 14px; padding: 22px 0; }
  .day h2 { position: static; font-size: 20px; }
  .play { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; }
  .play .art { width: 48px; }
  .play time { display: none; }
  .play .icon-btn, .play .row-actions .play-menu summary.icon-btn { opacity: 1; }
  .play .title { font-size: 16px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .play .detail .bar { width: 72px; }

  .rows > li { grid-template-columns: auto minmax(0, 1fr); gap: 14px; }
  .rows .actions { grid-column: 1 / -1; justify-content: flex-start; }
  .rows .badge, .rows .order { width: 44px; height: 44px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .inline-form { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* AI picks */
textarea { min-height: 112px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
.ai-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ai-picks { margin-top: 10px; }
.ai-kind { margin: 22px 0 0; font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.ai-picks .reason { color: var(--muted); margin: 6px 0 0; font-size: 14px; }
.ai-profile summary { cursor: pointer; font-weight: 600; }
.ai-profile pre { white-space: pre-wrap; font: 13px/1.6 ui-monospace, monospace; color: var(--muted);
  background: var(--velvet-deep); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-top: 12px; max-height: 420px; overflow: auto; }
.seen-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; }
.seen-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 6px 0;
  border-top: 1px solid var(--line); }
.seen-list li:first-child { border-top: 0; }
.seen-list .year { color: var(--faint); margin-left: 4px; }
.seen-list .quiet { font-size: 13px; margin: 0; }

/* Sources: the add forms fold away under their list ------------------------------------------- */
.source-block { scroll-margin-top: 110px; }
.source-block .section-head p { margin-top: 6px; max-width: 70ch; }
.adder { margin-top: 24px; max-width: 760px; }
.adder > summary { cursor: pointer; font: 600 18px var(--display, inherit); list-style: none; display: flex; align-items: center; gap: 10px; }
.adder > summary::-webkit-details-marker { display: none; }
.adder > summary::before { content: "+"; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink, #1a1530); font-weight: 700; }
.adder[open] > summary::before { content: "−"; }

/* Home ------------------------------------------------------------------------------------------- */
.home-hello { position: relative; margin-bottom: 28px; min-height: 120px; }
/* A living room at night, behind the greeting. */
.home-room { position: absolute; z-index: -1; right: 0; bottom: -18px; width: 400px; height: auto; pointer-events: none; overflow: visible; }
.home-hello::before { /* the lamp, as in the living room at night */
  content: ""; position: absolute; z-index: -1; right: -40px; top: -90px; width: 520px; height: 300px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(245, 201, 121, 0.14), transparent);
}
.home-hello h1 { font-size: clamp(32px, 4vw, 48px); }
.home-status { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; color: var(--muted); font-size: 17px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 10px color-mix(in srgb, var(--ok) 60%, transparent); }

.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.home-main, .home-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; min-width: 0; }
/* Rows that scroll inside a card must never widen the card, nor the page. */
.home-card { min-width: 0; }
main:has(.home-grid) { overflow-x: clip; }
.home-card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, #fff 2%), var(--surface));
  border: 1px solid var(--line); border-radius: 22px; padding: 22px 24px;
}
.home-card h2 { font-size: 22px; }
.home-card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.more {
  display: inline-flex; align-items: center; gap: 4px; flex: none; color: var(--accent); font: 500 15px var(--text);
  background: none; border: 0; padding: 4px 0; cursor: pointer;
}
.more svg { width: 16px; height: 16px; }
.more:disabled { color: var(--faint); cursor: default; }
.home-start { margin-bottom: 24px; }
.home-start h2 { margin-bottom: 14px; }

.who-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 18px; }
.who-list a { display: grid; gap: 4px; color: var(--ivory); }
.who-list a:hover { text-decoration: none; }
.who-list a:hover .who-avatar { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--accent), 0 18px 30px -14px rgba(0, 0, 0, 0.8); }
.who-art { position: relative; display: block; margin-bottom: 8px; line-height: 0; }
.who-avatar { display: grid; width: 100%; height: auto; aspect-ratio: 1; line-height: 1; border-radius: 22px; font-size: 52px; transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 18px 30px -14px rgba(0, 0, 0, 0.8); }
.who-tag { position: absolute; right: 8px; bottom: 8px; line-height: 1.4; padding: 3px 10px; border-radius: 99px; background: var(--lamp); color: #2a1e08; font-size: 13px; font-weight: 700; }
.who-lock { position: absolute; right: 8px; top: 8px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: rgba(16, 13, 23, 0.72); color: var(--ivory); }
.who-lock svg { width: 16px; height: 16px; }
.who-name { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 17px; }
.who-what { color: var(--muted); font-size: 14px; line-height: 1.4; }

/* Rows that scroll sideways, edge to edge of their card. */
.rail { list-style: none; margin: 0 -24px; padding: 0 24px 6px; display: grid; grid-auto-flow: column; gap: 14px; overflow-x: auto;
  scroll-snap-type: x proximity; scroll-padding: 0 24px; scrollbar-width: thin; }
.rail > li { scroll-snap-align: start; min-width: 0; }
.continue { grid-auto-columns: minmax(250px, 300px); }
.continue-art { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.continue-art img { width: 100%; height: 100%; object-fit: cover; }
.continue-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 10px; padding: 26px 12px 10px;
  background: linear-gradient(transparent, rgba(10, 8, 14, 0.85)); }
.continue-bar .bar { flex: 1; }
.continue-play { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; }
.continue-play button { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer;
  color: var(--accent-ink); background: var(--accent); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45); transition: transform 0.15s; }
.continue-play button:hover { transform: scale(1.08); }
.continue-play svg { width: 22px; height: 22px; margin-left: 3px; fill: currentColor; }
.pick-play { inset: auto 8px 8px auto; }
.pick-play button { width: 38px; height: 38px; }
.pick-play svg { width: 16px; height: 16px; margin-left: 2px; }
.play-menu { margin-top: 0; }
.play-menu summary.btn { display: inline-flex; width: auto; height: auto; min-height: 34px; gap: 6px; padding: 0 14px; color: var(--accent-ink); background: var(--accent); border-color: transparent; }
.play-menu summary.btn:hover, .play-menu[open] summary.btn { color: var(--accent-ink); background: var(--accent); filter: brightness(1.06); }
.play-menu summary.btn svg { width: 15px; height: 15px; fill: currentColor; }
.play-menu.compact summary { width: 36px; height: 36px; }
.play-menu.compact summary:hover, .play-menu.compact[open] summary { color: var(--accent); }
.play-menu .card-menu-panel { min-width: 220px; }
.row-actions { display: flex; align-items: center; gap: 2px; }
.play .play-menu summary.icon-btn { opacity: 0; }
.play:hover .play-menu summary.icon-btn, .play .play-menu[open] summary.icon-btn, .play .play-menu summary:focus-visible { opacity: 1; }
.continue-bar .left { color: var(--ivory); font-size: 13px; white-space: nowrap; }
.continue-title { margin-top: 10px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.continue-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--muted); font-size: 14px; margin-top: 2px; }
.continue-meta .by { display: inline-flex; align-items: center; gap: 6px; }
.picks { grid-auto-columns: minmax(118px, 132px); }
.pick-art { position: relative; aspect-ratio: 2 / 3; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.pick-art img { width: 100%; height: 100%; object-fit: cover; }
.pick-title { margin-top: 8px; font-weight: 600; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pick-why { color: var(--muted); font-size: 13px; line-height: 1.4; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.home-side h2 { margin-bottom: 8px; }
.setup-list { list-style: none; margin: 0; padding: 0; }
.setup-list li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; }
.setup-list li + li { border-top: 1px solid var(--line); }
.setup-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; color: #fff; }
.setup-icon svg { width: 22px; height: 22px; }
.setup-icon.amber { background: linear-gradient(150deg, #f7b57c, #d9804a); }
.setup-icon.green { background: linear-gradient(150deg, #5fd39b, #2e9c6a); }
.setup-icon.blue { background: linear-gradient(150deg, #6cb6ff, #3a79d8); }
.setup-icon.red { background: linear-gradient(150deg, #ff7a8a, #d6455c); }
.setup-icon.gold { background: linear-gradient(150deg, #f7d58e, #d79b35); color: #2a1e08; }
.setup-icon.pink { background: linear-gradient(150deg, #f29ad6, #b955a6); }
.setup-icon.neutral { background: var(--surface-2); color: var(--ivory); }

/* More: what the phone's dock has no room for. */
.more-groups { display: grid; gap: 20px; max-width: 760px; }
.more-groups h2 { font-size: 18px; margin-bottom: 6px; }
.more-signout { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.more-signout .btn svg { width: 18px; height: 18px; }
.setup-text { display: grid; min-width: 0; }
.setup-text strong { font-weight: 600; }
.setup-text > span { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }

@media (max-width: 1000px) {
  .home-grid { grid-template-columns: 1fr; }
  .home-room { width: 320px; }
}
@media (max-width: 760px) {
  .home-hello h1 { font-size: 30px; }
  .home-room { width: 190px; right: -24px; bottom: 34px; opacity: .55; }
  .home-hello::before { right: -120px; width: 360px; }
  .home-card { padding: 18px 16px; border-radius: 20px; }
  .rail { margin: 0 -16px; padding: 0 16px 6px; scroll-padding: 0 16px; }
  /* Four across, as on a TV's "Who's watching?". */
  .who-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .who-avatar { font-size: 32px; border-radius: 18px; }
  .who-tag { right: 4px; bottom: 4px; padding: 2px 7px; font-size: 11px; }
  .who-lock { right: 4px; top: 4px; width: 24px; height: 24px; border-radius: 7px; }
  .who-lock svg { width: 13px; height: 13px; }
  .who-name { font-size: 15px; gap: 6px; }
  .who-what { font-size: 13px; }
  .continue { grid-auto-columns: 82%; }
  .picks { grid-auto-columns: 40%; }
}

/* A card's own menu ("⋮" under a Continue watching card). */
.continue-foot { display: flex; align-items: flex-start; gap: 6px; }
.continue-text { flex: 1; min-width: 0; }
.card-menu { position: relative; margin-top: 8px; }
.card-menu summary { list-style: none; cursor: pointer; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: var(--muted); }
.card-menu summary::-webkit-details-marker { display: none; }
.card-menu summary:hover, .card-menu[open] summary { background: var(--surface-2); color: var(--ivory); }
.card-menu summary svg { width: 20px; height: 20px; }
.card-menu-panel {
  position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 5; width: max-content; max-width: 280px; padding: 6px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.75);
}
.card-menu-panel a, .card-menu-panel button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 9px; border: 0; background: none;
  color: var(--ivory); font: 500 14px var(--text); text-align: left; cursor: pointer;
}
.card-menu-panel a:hover, .card-menu-panel button:hover { background: var(--surface); text-decoration: none; }
.card-menu-panel svg { width: 17px; height: 17px; color: var(--muted); }
.card-menu-panel form { margin: 0; }
.card-menu-panel .note { color: var(--muted); font-weight: 400; }
.setup-text .warn { color: var(--danger); }

/* Polish: every page in the same quiet, warm cards as Home ------------------------------------ */
:root { --card: linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, #fff 2%), var(--surface)); }
.page-head h1, .person-head h1 { font-size: clamp(32px, 4vw, 44px); }
.page-head { margin-bottom: 28px; }
.section-head h2, .section > h2, .source-block h2 { font-size: 24px; }

/* Panels and lists of rows become cards. */
.panel { background: var(--card); border-radius: 22px; padding: 24px; }
.rows { border: 1px solid var(--line); border-radius: 22px; background: var(--card); padding: 2px 24px; }
.rows > li { padding: 18px 0; }
.rows > li:last-child { border-bottom: 0; }
.rows .badge { width: 46px; height: 46px; border-radius: 13px; color: var(--lamp);
  background: linear-gradient(150deg, #3b2f2a, #29201f); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05); }
.rows .badge svg { width: 22px; height: 22px; }
.rows .badge.tv { color: #9fd0ff; background: linear-gradient(150deg, #24364a, #1b2533); }
.rows .badge.assistant { color: #f6b8e4; background: linear-gradient(150deg, #43293d, #2c1d29); }
.rows .order { width: 40px; font-size: 24px; }
.rows .actions .btn-sm { min-height: 36px; }

/* Filters: one row of soft pills, the chosen one lit like the tabs. */
.filters { gap: 6px; margin-bottom: 18px; }
.filters a { padding: 8px 15px; border-color: transparent; background: color-mix(in srgb, var(--surface) 80%, transparent); }
.filters a:hover { border-color: var(--line); }
.filters a[aria-current="true"] {
  background: color-mix(in srgb, var(--accent) 22%, var(--surface)); color: var(--ivory);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
.filters + .filters { margin-top: -6px; }
.filters:last-of-type { margin-bottom: 28px; }

/* History: a card per day, posters a touch larger. */
.day { border: 1px solid var(--line); border-radius: 22px; background: var(--card); padding: 20px 24px; margin-bottom: 16px; gap: 24px;
  grid-template-columns: 150px minmax(0, 1fr); }
.day h2 { top: 88px; }
.play { grid-template-columns: 52px minmax(0, 1fr) auto auto; padding: 8px 10px; }
.play:hover { background: var(--surface-2); }
.play .art { width: 52px; border-radius: 9px; }

/* Profiles: tiles like Home's "Who's watching?". */
.people { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
.people > li { background: var(--card); padding: 24px 16px 14px; gap: 8px; }
.people .person:hover .avatar { outline: 2px solid var(--accent); outline-offset: 3px; }
.people .actions { gap: 2px; opacity: 0.6; }
.people > li:hover .actions { opacity: 1; }

/* Small pages (Link a TV, Age ratings): the form in a card. */
.narrow > form.form { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 24px; }

/* The person page's "More" list and the AI page's lists breathe a little more. */
.links > div { padding: 14px 0; }

.copy-field { min-width: 0; display: flex; align-items: center; gap: 10px; max-width: 640px; margin-top: 14px; padding: 8px 8px 8px 16px;
  background: var(--velvet-deep); border: 1px solid var(--line); border-radius: 14px; }
.copy-field code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; color: var(--lamp); font-size: 14px; scrollbar-width: none; }
.sticky-save .btn { box-shadow: 0 14px 30px -10px rgba(0, 0, 0, 0.85), 0 0 0 6px color-mix(in srgb, var(--velvet) 70%, transparent); }

@media (max-width: 760px) {
  .rows { padding: 2px 16px; border-radius: 20px; }
  .rows > li { gap: 14px; padding: 16px 0; }
  .panel, .narrow > form.form { padding: 18px 16px; border-radius: 20px; }
  .day { grid-template-columns: 1fr; gap: 10px; padding: 16px; border-radius: 20px; }
  .day h2 { position: static; }
  .people { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

/* TVs page: what went wrong on a TV. */
.reports { margin-top: 10px; font-size: 14px; }
.reports > summary { cursor: pointer; color: var(--muted); width: max-content; max-width: 100%; }
.reports > summary:hover { color: var(--ivory); }
.reports ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.reports li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 10px 12px; border-radius: 10px; background: var(--surface); }
.reports .when { color: var(--faint); white-space: nowrap; }
.reports .what { font-weight: 600; }
.reports .what.crash { color: var(--danger); }
.reports .msg { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.reports li details { flex-basis: 100%; }
.reports li details summary { cursor: pointer; color: var(--muted); }
.reports pre { margin: 8px 0 0; padding: 10px; max-height: 260px; overflow: auto; border-radius: 8px; background: var(--surface-2); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
