/*
 * Bifrost tracker. A Trakt-style app shell (sidebar, rails, dense grids) in the launch page's palette:
 * black, Yggdrasil's warm white ink, neutral graphite surfaces, artwork doing the colour, the spectrum kept for progress
 * and what's yours, and runes set in the same Noto Sans Runic.
 */
@font-face {
  font-family: "Noto Sans Runic";
  src: url("../assets/noto-sans-runic.ttf") format("truetype");
  font-display: swap;
  unicode-range: U+16A0-16FF;
}
:root {
  color-scheme: dark;
  --bg: #000;
  --sidebar-bg: #000;
  /* Neutral graphite, so controls sit on the black like glass rather than reading brown next to it. */
  --surface: #0c0c0d;
  --surface-2: #151516;
  --surface-3: #212123;
  --line: rgba(244, 241, 238, 0.08);
  --line-2: rgba(244, 241, 238, 0.13);
  --line-3: rgba(244, 241, 238, 0.2);
  --fg: #f4f1ee;
  --fg2: #a8a49f;
  --fg3: #8b8781;
  --spectrum: linear-gradient(90deg, #ff6b7a, #ffab5e 22%, #ffe08a 42%, #7bd88f 60%, #5cc8ff 80%, #a98bff);
  --good: #7bd88f;
  --warn: #ffc56b;
  --bad: #ff7a85;
  --info: #9db8ff;
  --heat-0: #151516;
  --heat-1: #38383b;
  --heat-2: #6c6c70;
  --heat-3: #a7a7ab;
  --heat-4: #f4f1ee;
  --radius-lg: 18px;
  --radius: 12px;
  --radius-sm: 9px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(16px, 2.6vw, 36px);
  --sidebar: 236px;
  --topbar: 60px;
  --sans: Geist, -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --runic: "Noto Sans Runic", "Apple Symbols", "Segoe UI Symbol", sans-serif;
}
.sidebar-collapsed { --sidebar: 68px; }

* { box-sizing: border-box; }
html { background: var(--bg); scrollbar-color: #333 transparent; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--fg); font: 400 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
img { display: block; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; border-radius: 8px; }
main:focus, main:focus-visible { outline: none; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }
.muted { color: var(--fg2); }

.icon-definitions, .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon.tiny { width: 12px; height: 12px; vertical-align: -1px; margin-right: 3px; }
.skip-link { position: fixed; z-index: 90; top: 10px; left: 10px; padding: 10px 16px; border-radius: 999px; color: #000; background: var(--fg); transform: translateY(-200%); }
.skip-link:focus { transform: none; }
/* Clipped away until it has focus: Safari's rubber-band bounce pulls fixed elements down into view (as on the launch page). */
.skip-link:not(:focus) { clip-path: inset(50%); opacity: 0; pointer-events: none; }

/* ---------- Sidebar ---------- */

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar);
  display: flex; flex-direction: column; gap: 14px; padding: 12px 10px 12px;
  background: var(--sidebar-bg); border-right: 1px solid var(--line); overflow-y: auto; overflow-x: hidden; scrollbar-width: none;
  transition: width 220ms var(--ease);
}
.sidebar::-webkit-scrollbar { display: none; }
.sidebar-top { display: flex; align-items: center; gap: 6px; height: 36px; padding-left: 2px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; }
.brand-mark { width: 30px; height: 21px; flex: none; }
.side-nav { display: grid; gap: 14px; }
.side-search {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--surface); color: var(--fg3); text-align: left; white-space: nowrap;
}
.side-search span { flex: 1; }
.side-search:hover { color: var(--fg2); border-color: var(--line-3); }
kbd { padding: 1px 6px; border: 1px solid var(--line-2); border-radius: 6px; font: 11px/17px var(--mono); color: var(--fg3); }
.side-group { display: grid; gap: 1px; }
.side-main, .side-sub, .side-profile {
  position: relative; display: flex; align-items: center; gap: 11px; min-height: 34px; padding: 0 10px;
  border-radius: 8px; color: var(--fg2); font-weight: 500; white-space: nowrap;
}
.side-main .icon { width: 18px; height: 18px; }
.side-main:hover, .side-sub:hover, .side-profile:hover { color: var(--fg); background: var(--surface-2); }
.side-main[aria-current="page"] { color: var(--fg); }
.side-sub { min-height: 30px; padding-left: 39px; font-size: 13px; font-weight: 400; color: var(--fg3); }
.side-sub[aria-current="page"] { color: var(--fg); background: var(--surface-2); }
.side-sub[aria-current="page"]::before { content: ""; position: absolute; left: 22px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--spectrum); }
.nav-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: auto; padding: 0 5px; border-radius: 999px; background: var(--fg); color: #000; font-size: 11px; font-weight: 700; }
.side-bottom { display: grid; gap: 1px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.side-profile { min-height: 46px; margin-top: 4px; padding-left: 6px; }
.side-profile-name { overflow: hidden; text-overflow: ellipsis; }

.sidebar-collapsed .sidebar { padding-inline: 10px; }
.sidebar-collapsed .brand span, .sidebar-collapsed .side-sub, .sidebar-collapsed .side-main span, .sidebar-collapsed .side-search span,
.sidebar-collapsed .side-search kbd, .sidebar-collapsed .side-profile-name { display: none; }
.sidebar-collapsed .brand { display: none; }
.sidebar-collapsed .side-search, .sidebar-collapsed .side-main { justify-content: center; padding: 0; }
.sidebar-collapsed .side-profile { justify-content: center; padding: 0; }

.avatar {
  display: inline-grid; place-items: center; flex: none; border-radius: 50%; border: 2px solid transparent;
  background: linear-gradient(var(--surface-3), var(--surface-3)) padding-box, conic-gradient(from 200deg, #ff6b7a, #ffab5e, #ffe08a, #7bd88f, #5cc8ff, #a98bff, #ff6b7a) border-box;
  color: var(--fg); font-weight: 600; letter-spacing: -.02em;
}
.avatar.small { width: 32px; height: 32px; font-size: 12px; }
.avatar.large { width: 116px; height: 116px; border-width: 3px; font-size: 40px; box-shadow: 0 0 0 6px var(--bg); }
.avatar.medium { width: 56px; height: 56px; font-size: 20px; }
.avatar > img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }

/* ---------- Shell & topbar ---------- */

.shell { margin-left: var(--sidebar); min-width: 0; transition: margin-left 220ms var(--ease); }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar);
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 14px; padding: 0 var(--gutter);
  background: rgba(0, 0, 0, .82); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
body:is([data-page="title"], [data-page="profile"], [data-page="u"]) .topbar {
  background: none;
  border-bottom: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body:is([data-page="title"], [data-page="profile"], [data-page="u"]) .topbar::before {
  content: "";
  position: absolute;
  inset: 0 0 -12px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(rgba(0, 0, 0, .7), rgba(0, 0, 0, 0));
}
.topbar .mobile-menu, .topbar .mobile-search { display: none; }
.topbar-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; grid-column: 2; }
.topbar-title h1 { font-size: 20px; font-weight: 600; letter-spacing: -.035em; white-space: nowrap; }
.topbar-title > span { color: var(--fg3); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-toggle { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(255, 255, 255, .03); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.media-toggle button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--fg2); font-size: 13px; font-weight: 500; }
.media-toggle .icon { width: 15px; height: 15px; }
.media-toggle button:hover { color: var(--fg); }
.media-toggle button[aria-pressed="true"] { background: var(--fg); color: #000; }
.topbar-tools { display: flex; align-items: center; gap: 8px; }
.today-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 6px 0 12px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--fg2); font-size: 13px; font-weight: 500; }
.today-chip b { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--surface-3); color: var(--fg); font-size: 12px; }
.today-chip:hover { color: var(--fg); border-color: var(--line-3); }

.page { max-width: 1680px; margin: 0 auto; padding: 22px var(--gutter) 80px; }
.page.narrow { max-width: 820px; }
.stack { display: grid; gap: 34px; align-content: start; min-width: 0; }
.stack-sm { display: grid; gap: 14px; align-content: start; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.center { display: flex; justify-content: center; }
.card.pad { display: grid; gap: 14px; align-content: start; }
/* — The light ribbon. No boxes: a group of things hangs off a thin beam of the bridge's spectrum, its colours slowly
     flowing down it, brightening when you reach for the group. Every .card is one; list tiles keep their artwork instead. — */
@property --flow { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
@keyframes ribbon-flow { to { --flow: 300%; } }
.card, .ribbon { position: relative; padding: 4px 0 4px 24px; }
.card::before, .ribbon::before {
  content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 2px; border-radius: 2px; pointer-events: none;
  background: linear-gradient(#ff6b7a, #ffab5e, #ffe08a, #7bd88f, #5cc8ff, #a98bff, #ff6b7a, #ffab5e, #ffe08a, #7bd88f, #5cc8ff, #a98bff, #ff6b7a) 0 var(--flow) / 100% 300%;
  box-shadow: 0 0 12px rgba(92, 200, 255, .28); opacity: .72;
  animation: ribbon-flow 9s linear infinite; transition: opacity 320ms var(--ease), box-shadow 320ms var(--ease);
}
.card:hover::before, .ribbon:hover::before, .card:focus-within::before, .ribbon:focus-within::before { opacity: 1; box-shadow: 0 0 16px rgba(92, 200, 255, .45), 0 0 4px rgba(255, 224, 138, .5); }
.card.list-card { padding: 0; }
.card.list-card::before { display: none; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 700; letter-spacing: -.045em; line-height: 1.05; }
.lede { margin-top: 8px; max-width: 62ch; color: var(--fg2); font-size: 15px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: -18px; color: var(--fg2); font-size: 13px; justify-self: start; }
.back:hover { color: var(--fg); }
.back .icon { width: 15px; }
.kicker { color: var(--fg2); font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar > .muted { margin-right: auto; }

.shelf { display: grid; gap: 12px; min-width: 0; }
.shelf-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.shelf-head h2 { font-size: 20px; font-weight: 600; letter-spacing: -.03em; }
.shelf-head h2 a { display: inline-flex; align-items: center; gap: 4px; }
.shelf-head h2 a .icon { width: 16px; height: 16px; color: var(--fg3); transition: transform 160ms var(--ease); }
.shelf-head h2 a:hover .icon { color: var(--fg); transform: translateX(2px); }
.shelf-head p { color: var(--fg3); font-size: 13px; }
.more { display: inline-flex; align-items: center; gap: 2px; color: var(--fg2); font-size: 13px; font-weight: 500; }
.more:hover { color: var(--fg); }
.more .icon { width: 14px; height: 14px; }

/* ---------- Buttons ---------- */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border: 1px solid transparent; border-radius: 999px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap;
  transition: background 160ms, border-color 160ms, transform 160ms var(--ease);
}
.button:not(:disabled):active { transform: scale(.97); }
.button .icon { width: 16px; height: 16px; stroke-width: 2; }
.button.large { height: 46px; padding: 0 22px; font-size: 15px; }
.button.small { height: 32px; padding: 0 12px; font-size: 13px; }
.primary { background: var(--fg); color: #0a0a0a; }
.primary:not(:disabled):hover { background: #fff; }
.secondary { border-color: var(--line-2); background: var(--surface-2); }
.secondary:hover { background: var(--surface-3); border-color: var(--line-3); }
.glass { border-color: rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .08); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.glass:hover { background: rgba(255, 255, 255, .14); }
.danger { color: var(--bad); }

.icon-button { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border: 1px solid var(--line-2); border-radius: 50%; background: var(--surface-2); color: var(--fg2); }
.icon-button:hover { color: var(--fg); background: var(--surface-3); }
.icon-button.glass { width: 46px; height: 46px; color: var(--fg); }
.icon-button.subtle { border-color: transparent; background: none; color: var(--fg3); }
.icon-button.subtle:not(:disabled):hover { color: var(--fg); background: var(--surface-2); }
.icon-button[aria-pressed="true"] { color: var(--bad); }
.icon-button[aria-pressed="true"] .icon { fill: currentColor; }
.icon-button .icon { width: 17px; height: 17px; }

.check { display: grid; place-items: center; width: 34px; height: 34px; flex: none; padding: 0; border: 1.5px solid var(--line-3); border-radius: 50%; background: none; color: var(--fg3); transition: all 160ms var(--ease); }
.check:hover { border-color: var(--fg); color: var(--fg); }
.check[aria-pressed="true"], .check.is-done { background: var(--fg); border-color: var(--fg); color: #000; }
.check .icon { width: 16px; height: 16px; stroke-width: 2.4; }
.check.small { width: 28px; height: 28px; }
.check.small .icon { width: 14px; height: 14px; }
.link-button { padding: 2px 0; border: 0; background: none; color: var(--fg); font-size: 13px; font-weight: 500; text-decoration: underline; text-decoration-color: var(--fg3); text-underline-offset: 3px; }
.link-button:hover { text-decoration-color: var(--fg); }

/* ---------- Chips & tabs ---------- */

.chip { display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: none; height: 24px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); color: var(--fg2); font-size: 11.5px; font-weight: 500; white-space: nowrap; }
/* Status chips: one neutral pill, the status told by a small light from the bridge's spectrum. */
.chip[class*="status-"]::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--dot, var(--fg3)); box-shadow: 0 0 6px var(--dot, transparent); }
.status-watching { --dot: #5cc8ff; }
.status-repeating { --dot: #a98bff; }
.status-planning { --dot: var(--fg3); }
.status-paused { --dot: #ffe08a; }
.status-completed { --dot: #7bd88f; }
.status-dropped { --dot: #ff6b7a; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-button { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; background: none; color: var(--fg2); font-weight: 500; }
.chip-button span { color: var(--fg3); font-family: var(--mono); font-size: 12px; }
.chip-button:hover { color: var(--fg); border-color: var(--line-3); }
.chip-button[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); color: #000; }
.chip-button[aria-pressed="true"] span { color: rgba(0, 0, 0, .5); }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { position: relative; display: inline-flex; align-items: center; gap: 7px; flex: none; padding: 12px 12px 14px; color: var(--fg2); font-weight: 500; }
.tabs a span { color: var(--fg3); font-family: var(--mono); font-size: 12px; }
.tabs a:hover { color: var(--fg); }
.tabs a[aria-current="page"] { color: var(--fg); }
.tabs a[aria-current="page"]::after { content: ""; position: absolute; inset: auto 12px -1px; height: 2px; border-radius: 2px; background: var(--spectrum); }
.select-label { display: inline-flex; align-items: center; gap: 8px; color: var(--fg3); font-size: 13px; }
select, input:not([type="file"]):not([type="search"]), textarea { height: 38px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--fg); }
/* The few native selects left (inside dialogs): Windows draws their list in the select's colours. */
select option, select optgroup { background: var(--surface-2); color: var(--fg); }
/* — Dropdown: a button over a hidden select (app.js dropdown()); its list is the shared menu. — */
.dropdown { position: relative; display: inline-flex; }
.dropdown-button { display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; height: 36px; padding: 0 12px 0 14px; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(255, 255, 255, .03); color: var(--fg); font-size: 13px; font-weight: 500; white-space: nowrap; transition: background 160ms, border-color 160ms; }
.dropdown-button:hover, .dropdown-button[aria-expanded="true"] { background: rgba(255, 255, 255, .07); border-color: var(--line-3); }
.dropdown-button .icon { width: 14px; height: 14px; color: var(--fg3); transition: transform 200ms var(--ease); }
.dropdown-button[aria-expanded="true"] .icon { transform: rotate(180deg); }
.menu.is-dropdown { min-width: 180px; }
.menu.is-dropdown button .icon { visibility: hidden; width: 14px; height: 14px; color: var(--fg); }
.menu.is-dropdown button[aria-checked="true"] .icon { visibility: visible; }
.menu.is-dropdown button[aria-checked="true"] { font-weight: 600; }
textarea { height: auto; padding: 10px 12px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--fg2); }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(255, 255, 255, .03); }
.segmented button { display: grid; place-items: center; width: 34px; height: 28px; border: 0; border-radius: 999px; background: none; color: var(--fg3); }
.segmented button[aria-pressed="true"] { background: rgba(255, 255, 255, .1); color: var(--fg); }
.segmented.text button { width: auto; padding: 0 12px; font-size: 12.5px; font-weight: 500; }
.segmented .icon { width: 16px; height: 16px; }

/* ---------- Bars & squares ---------- */

.bar { display: block; height: 4px; overflow: hidden; border-radius: 4px; background: rgba(255, 255, 255, .14); }
.bar > span { display: block; height: 100%; border-radius: 4px; background: var(--spectrum); }
.squares { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; }
.square { display: grid; place-items: center; aspect-ratio: 1; min-height: 38px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: var(--surface-2); color: var(--fg2); font: 500 12px var(--mono); transition: background 240ms var(--ease), color 240ms, border-color 140ms, box-shadow 240ms; }
button.square:hover { border-color: color-mix(in srgb, var(--c, #fff) 60%, transparent); color: var(--fg); }
button.square.is-watched:hover { color: #000; }
.square.is-watched { background: color-mix(in srgb, var(--c, #fff) 82%, transparent); color: #0a0a0a; box-shadow: 0 0 14px -4px var(--c); }
.square.is-next { position: relative; background: var(--bg); color: var(--fg); }
.square.is-next::before { content: ""; position: absolute; inset: -1px; border-radius: 8px; padding: 1.5px; background: var(--spectrum); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.square.is-upcoming { background: none; border: 1px dashed var(--line-2); color: var(--fg3); }

/* ---------- Posters & cards ---------- */

.poster, .thumb, .thumb-lg, .still, .title-poster, .cal-poster { display: block; object-fit: cover; background: var(--surface-2); }
.poster { width: 100%; height: auto; aspect-ratio: 2 / 3; border-radius: var(--radius); }
.thumb { width: 40px; height: 60px; border-radius: 7px; flex: none; }
.thumb-lg { width: 60px; height: 90px; border-radius: 10px; }
.still { width: 100%; height: 100%; }
.skeleton { background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }
.poster-generated { display: grid; place-items: end start; padding: 10%; background: radial-gradient(circle at 30% 20%, hsl(var(--h) 30% 26%), hsl(var(--h) 20% 10%)); color: rgba(255, 255, 255, .88); font-weight: 600; line-height: 1.15; letter-spacing: -.02em; overflow: hidden; }
.thumb.poster-generated, .cal-poster.poster-generated { padding: 3px; font-size: 7px; }
.thumb-lg.poster-generated { font-size: 9px; padding: 6px; }
.poster.poster-generated { font-size: 15px; }
.still.poster-generated { font-size: 18px; }
.artwork { position: relative; overflow: hidden; }
.artwork > .poster-generated, .artwork > img {
  position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit;
}
.artwork > img { display: block; object-fit: cover; opacity: 0; }
.artwork > img[data-art-loaded] { opacity: 1; }


.poster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px 14px; }
.poster-grid.dense { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 20px 12px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 22px 16px; }
.poster-card, .episode-card { position: relative; display: grid; gap: 9px; min-width: 0; align-content: start; }
.poster-link { display: block; border-radius: var(--radius); }
.poster-wrap { position: relative; display: block; overflow: hidden; border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); background: var(--surface-2); }
.poster-wrap .poster { transition: transform 400ms var(--ease), filter 300ms; }
.poster-card:hover .poster-wrap .poster { transform: scale(1.04); filter: brightness(.82); }
.poster-wrap .bar { position: absolute; inset: auto 8px 8px; height: 3px; }
.seen-tag { position: absolute; left: 8px; bottom: 8px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(0, 0, 0, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.seen-tag .icon { width: 13px; height: 13px; stroke-width: 2.6; }
.seen-tag.list-tag .icon { fill: currentColor; stroke-width: 1.5; }
.poster-wrap:has(.bar) .seen-tag { bottom: 18px; }

.dots { position: absolute; top: 6px; right: 6px; z-index: 2; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: #fff; opacity: 0; transition: opacity 160ms, background 160ms; }
.dots .icon { width: 17px; height: 17px; stroke-width: 2.2; }
.dots:hover, .dots[aria-expanded="true"] { background: #fff; color: #000; }
.poster-card:hover .dots, .episode-card:hover .dots, .dots:focus-visible, .dots[aria-expanded="true"] { opacity: 1; }
.dots[data-inline] { position: static; opacity: 1; background: none; color: var(--fg3); }
.dots[data-inline]:hover { background: var(--surface-3); color: var(--fg); }
.card-foot { display: flex; align-items: start; justify-content: space-between; gap: 8px; min-width: 0; }
.card-text { display: grid; min-width: 0; }
.card-name { display: block; font-weight: 600; letter-spacing: -.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-name.big { font-size: 16px; }
.card-meta { display: block; color: var(--fg2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poster-card .card-meta, .episode-card .card-meta { color: var(--fg3); }
.mine { color: var(--warn); }
.mine .icon { fill: currentColor; }
.inline-fav { width: 12px; height: 12px; fill: url(#heart-spectrum); stroke: url(#heart-spectrum); vertical-align: -1px; }
/* A favorite wears the whole spectrum, not one colour. */
[data-action="toggle-favorite"][aria-pressed="true"] .icon { fill: url(#heart-spectrum); stroke: url(#heart-spectrum); }
/* The burst when something becomes a favorite (ui/burst.js): a ring and sparks in the spectrum, over everything. */
.fav-burst { position: fixed; z-index: 90; width: 0; height: 0; pointer-events: none; }
.fav-burst > i { position: absolute; left: 0; top: 0; width: 7px; height: 7px; margin: -3.5px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.fav-burst > b { position: absolute; left: -22px; top: -22px; width: 44px; height: 44px; border-radius: 50%; padding: 2px; background: conic-gradient(#ff6b7a, #ffab5e, #ffe08a, #7bd88f, #5cc8ff, #a98bff, #ff6b7a); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px)); mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px)); }

.rail { display: grid; grid-auto-flow: column; grid-auto-columns: 150px; gap: 14px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 4px; scroll-padding: 0 var(--gutter); }
.rail::-webkit-scrollbar { display: none; }
/* Rows are dragged (tracker/ui/rows.js). Off Apple devices with a pointer they take no scrolling of their own, which a
   touchpad scrolling the page up and down would catch; a finger drags them, the page still panning. */
.rows-held :is(.rail, .cast-rail, .tabs, .month-strip) { overflow-x: hidden; touch-action: pan-y; }
.row-dragging { cursor: grabbing; user-select: none; scroll-snap-type: none !important; }
.row-dragging * { cursor: grabbing; }
.rail > * { scroll-snap-align: start; }
.rail.wide { grid-auto-columns: minmax(270px, 300px); }

.episode-art { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); background: var(--surface-2); }
.episode-art::after { content: ""; position: absolute; inset: 50% 0 0; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); pointer-events: none; }
.episode-art .still { transition: transform 400ms var(--ease); }
.episode-card:hover .still { transform: scale(1.04); }
.episode-card.is-upcoming .still { filter: grayscale(.6) brightness(.75); }
.pill { position: absolute; z-index: 1; left: 8px; bottom: 12px; display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: rgba(0, 0, 0, .72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font-size: 11.5px; font-weight: 600; }
.pill.right { left: auto; right: 8px; color: var(--fg2); font-weight: 500; }
.pill .icon.tiny { color: var(--warn); fill: currentColor; }
.episode-art .bar { position: absolute; z-index: 1; inset: auto 8px 5px; height: 3px; }
.history-card .dots { color: #fff; }
.history-card .dots:hover { background: var(--bad); color: #000; }

.streak { position: relative; display: flex; align-items: center; gap: 14px; padding: 6px 0 6px 24px; }
.streak::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: linear-gradient(#ffe08a, #ffab5e, #ff6b7a); box-shadow: 0 0 12px rgba(255, 171, 94, .4); }
.streak > .icon { color: var(--fg3); }
.streak-flame { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-3); color: var(--fg3); }
.streak-flame.lit { background: rgba(255, 171, 94, .14); color: #ffab5e; }
.streak-flame.lit .icon { fill: rgba(255, 171, 94, .35); }
.streak-text { display: grid; flex: 1; }
.streak-text strong { font-size: 15px; letter-spacing: -.02em; }
.streak-text small { color: var(--fg3); font-size: 12.5px; }
.streak-bars { display: flex; align-items: end; gap: 4px; height: 30px; }
.streak-bars i { width: 6px; border-radius: 3px; background: var(--surface-3); }
.streak-bars i.on { background: var(--fg2); }
.streak-bars i.on.today { background: var(--fg); }

/* ---------- Welcome ---------- */

.welcome { position: relative; isolation: isolate; display: grid; gap: 14px; justify-items: start; padding: clamp(28px, 5vw, 64px) 0 clamp(20px, 3vw, 36px); }
.welcome-glow { inset: -40px -10% -20px -10%; filter: blur(20px); animation: welcome-drift 16s ease-in-out infinite alternate; }
@keyframes welcome-drift { to { transform: translate(-3%, 4%) scale(1.05); } }
.welcome-glow, .spectrum-glow { position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 80% at 80% 0%, rgba(169, 139, 255, .22), transparent 60%), radial-gradient(50% 70% at 100% 70%, rgba(92, 200, 255, .14), transparent 60%), radial-gradient(40% 60% at 55% 0%, rgba(255, 107, 122, .14), transparent 60%); }
.welcome h2 { font-size: clamp(34px, 5vw, 64px); font-weight: 700; letter-spacing: -.055em; line-height: .98; }
.welcome > p:not(.kicker) { max-width: 56ch; color: var(--fg2); font-size: 16px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

/* ---------- Stats ---------- */

.stat-row { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding-left: 10px; }
.stat-row.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stat { position: relative; display: grid; gap: 2px; padding: 10px 18px; min-width: 0; }
.stat::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; border-radius: 2px; background: var(--sc, var(--fg3)); box-shadow: 0 0 10px var(--sc, transparent); opacity: .85; }
.stat:nth-child(6n+1) { --sc: #ff6b7a; } .stat:nth-child(6n+2) { --sc: #ffab5e; } .stat:nth-child(6n+3) { --sc: #ffe08a; }
.stat:nth-child(6n+4) { --sc: #7bd88f; } .stat:nth-child(6n+5) { --sc: #5cc8ff; } .stat:nth-child(6n+6) { --sc: #a98bff; }
.stat strong { font-size: 24px; font-weight: 600; letter-spacing: -.04em; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat span { color: var(--fg3); font-size: 12.5px; }

/* ---------- Calendar ---------- */

.month-strip { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.month-strip::-webkit-scrollbar { display: none; }
.month-strip button { flex: none; height: 30px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 999px; background: none; color: var(--fg3); font-size: 12.5px; font-weight: 500; }
.month-strip button:hover { color: var(--fg); }
.month-strip button[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); color: #000; }
.cal-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cal-head h2 { font-size: clamp(26px, 3vw, 36px); font-weight: 700; letter-spacing: -.045em; }
.cal-head h2 span { color: var(--fg3); }
.cal-head p { color: var(--fg3); font-size: 13px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow { padding: 0 8px 2px; color: var(--fg3); font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.cal-cell { display: grid; grid-template-rows: auto 1fr; gap: 6px; min-height: 128px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-align: left; }
.cal-cell:hover { border-color: var(--line-3); }
.cal-cell.is-out { background: transparent; opacity: .45; }
.cal-cell.is-selected { border-color: var(--fg2); background: var(--surface-2); }
.cal-num { display: flex; align-items: center; justify-content: space-between; color: var(--fg2); font: 500 13px var(--mono); }
.cal-num b { padding: 1px 7px; border-radius: 999px; background: var(--fg); color: #000; font: 600 11px var(--sans); }
.cal-cell.is-today .cal-num > span { color: var(--fg); }
.cal-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; align-content: start; }
.cal-tile { position: relative; display: block; min-width: 0; }
.cal-poster { width: 100%; aspect-ratio: 2 / 3; border-radius: 5px; }
.cal-tile i { position: absolute; inset: auto 0 0; padding: 10px 2px 3px; border-radius: 0 0 5px 5px; background: linear-gradient(transparent, rgba(0, 0, 0, .88) 55%); color: var(--fg); font-size: 10px; font-style: normal; font-weight: 500; letter-spacing: .02em; text-align: center; overflow: hidden; white-space: nowrap; }
.cal-more { grid-column: 1 / -1; color: var(--fg2); font-size: 12px; }
/* One release: poster on the left, its name and episode beside it in readable type. */
.cal-tiles.single { grid-template-columns: 44px minmax(0, 1fr); gap: 9px; align-items: end; }
.cal-label { display: grid; gap: 3px; min-width: 0; padding-bottom: 2px; }
.cal-label b { overflow: hidden; color: var(--fg); font-size: 12.5px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.cal-label i { color: var(--c); font-size: 11px; font-style: normal; font-weight: 500; }
.cal-quiet { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--fg2); font-size: 14px; }
.cal-agenda { display: grid; gap: 14px; }
/* — The calendar as the bridge: each day carries its colour (--c, red on the 1st through violet on the last); a
     release lights a thread across the top of its day, today wears the turning spectrum ring of the seal, and the
     month's rune stands faintly behind its name. Motion lives in motion.js. — */
@property --spin { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes cal-spin { to { --spin: 360deg; } }
.cal-title { position: relative; isolation: isolate; }
.cal-rune {
  font-family: var(--runic);
  position: absolute; z-index: -1; left: -.12em; top: 50%; transform: translateY(-56%);
  font-size: clamp(96px, 11vw, 150px); line-height: 1; color: var(--fg); opacity: .055; pointer-events: none; user-select: none;
}
.cal-grid { position: relative; }
.cal-cell { position: relative; overflow: hidden; transition: border-color 220ms var(--ease), background-color 220ms, box-shadow 320ms var(--ease); }
.cal-cell.has-releases::before {
  content: ''; position: absolute; top: 0; left: 14%; right: 14%; height: 2px; border-radius: 0 0 2px 2px;
  background: var(--c); box-shadow: 0 0 10px 1px var(--c); opacity: .7; transition: opacity 220ms, left 320ms var(--ease), right 320ms var(--ease);
}
.cal-cell.is-out.has-releases::before { opacity: .35; }
.cal-cell.has-releases:hover::before, .cal-cell.is-selected::before { opacity: 1; left: 6%; right: 6%; }
.cal-cell.has-releases:hover {
  border-color: color-mix(in srgb, var(--c) 32%, var(--line-2));
  background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--c) 11%, transparent), transparent 72%) var(--surface);
}
.cal-tile { transition: transform 320ms var(--ease); }
.cal-cell:hover .cal-tile { transform: translateY(-2px); }
.cal-cell:hover .cal-tile:nth-child(2) { transition-delay: 30ms; }
.cal-cell:hover .cal-tile:nth-child(3) { transition-delay: 60ms; }
.cal-cell.is-selected {
  border-color: color-mix(in srgb, var(--c) 65%, transparent);
  background: radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--c) 15%, transparent), transparent 72%) var(--surface-2);
  box-shadow: 0 14px 40px -18px color-mix(in srgb, var(--c) 70%, transparent);
}
.cal-cell.is-today {
  border-color: transparent;
  background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box,
    conic-gradient(from var(--spin), #ff6b7a, #ffab5e, #ffe08a, #7bd88f, #5cc8ff, #a98bff, #ff6b7a) border-box;
  animation: cal-spin 10s linear infinite;
}
.cal-cell.is-today.is-selected {
  background: radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--c) 15%, transparent), transparent 72%) padding-box,
    linear-gradient(var(--surface-2), var(--surface-2)) padding-box,
    conic-gradient(from var(--spin), #ff6b7a, #ffab5e, #ffe08a, #7bd88f, #5cc8ff, #a98bff, #ff6b7a) border-box;
}
.cal-agenda .date-stack:not(.is-today) { border-color: color-mix(in srgb, var(--c) 55%, transparent); box-shadow: 0 0 22px -6px color-mix(in srgb, var(--c) 70%, transparent); }
.cal-agenda .date-stack:not(.is-today) small { color: var(--c); }
/* Overlays motion.js lays over the page (outside #view, so a re-render never cuts them short). */
.cal-light { position: absolute; z-index: 40; pointer-events: none; }
.cal-sweep { overflow: hidden; border-radius: var(--radius); }
.cal-sweep > i {
  position: absolute; inset: -10% auto -10% 0; width: 45%; mix-blend-mode: screen;
  background: linear-gradient(100deg, transparent, rgba(244, 241, 238, .07) 42%, rgba(255, 224, 138, .1) 48%, rgba(92, 200, 255, .08) 53%, rgba(169, 139, 255, .05) 58%, transparent);
}
.cal-beam { width: 2px; border-radius: 2px; transform-origin: top;
  background: linear-gradient(#ff6b7a, #ffab5e 22%, #ffe08a 42%, #7bd88f 60%, #5cc8ff 80%, #a98bff);
  box-shadow: 0 0 12px 2px rgba(244, 241, 238, .25), 0 0 30px 6px rgba(92, 200, 255, .15); }
.cal-ripple { width: 0; height: 0; }
.cal-ripple::before { content: ''; position: absolute; left: -60px; top: -60px; width: 120px; height: 120px; border-radius: 50%; border: 1.5px solid var(--c); box-shadow: 0 0 18px var(--c), inset 0 0 18px var(--c); animation: cal-ripple 700ms var(--ease) both; }
@keyframes cal-ripple { from { transform: scale(.1); opacity: .9; } to { transform: scale(1); opacity: 0; } }
.cal-agenda-head { display: flex; align-items: center; gap: 14px; }
.cal-agenda-head h3 { font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.cal-agenda-head p { color: var(--fg3); font-size: 13px; }
.date-stack { display: grid; justify-items: center; width: 46px; flex: none; padding: 5px 0; border: 1px solid var(--line-2); border-radius: 10px; line-height: 1.1; }
.date-stack small { color: var(--fg3); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }
.date-stack strong { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.date-stack.is-today { background: var(--fg); border-color: var(--fg); color: #000; }
.date-stack.is-today small { color: rgba(0, 0, 0, .6); }

/* ---------- Rows ---------- */

.rows { display: grid; margin: 0; padding: 0; list-style: none; }
.card.rows { padding: 4px 0 4px 16px; }
.rows > .row + .row { box-shadow: 0 -1px 0 var(--line); }
.rows.flush { padding: 0; margin: 0 -8px; }
.row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 6px 8px; border-radius: var(--radius-sm); }
.row:hover { background: var(--surface-2); }
.row-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.row-text { display: grid; min-width: 0; flex: 1; }
.row-tools { display: flex; gap: 2px; }
.row-bar { width: 120px; flex: none; }
.rating-pill { display: inline-flex; align-items: center; gap: 3px; color: var(--fg2); font-size: 12.5px; font-weight: 600; }
/* Library rows keep every column, empty or not, so bars, scores and statuses line up down the list. */
.row .rating-pill { width: 38px; flex: none; justify-content: flex-end; }
.row-status { display: flex; justify-content: center; width: 116px; flex: none; }
.row-status .chip, .row > .chip { width: 116px; }
.rating-pill .icon { width: 12px; height: 12px; fill: var(--warn); stroke: var(--warn); }
.rank { width: 22px; flex: none; color: var(--fg3); font-family: var(--mono); font-size: 13px; text-align: center; }
.history-day { display: grid; gap: 12px; }
.history-day h3 { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 600; letter-spacing: -.02em; }
.history-day h3 small { display: block; color: var(--fg3); font-size: 12px; font-weight: 400; letter-spacing: 0; }

/* ---------- Progress ---------- */

.progress-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 16px; }
.progress-grid { gap: 34px 40px; }
.progress-card { position: relative; isolation: isolate; display: grid; gap: 16px; padding: 4px 0 4px 24px; align-content: start; }
.progress-glow { position: absolute; inset: -20px -20px auto 2px; height: 180px; z-index: -1; opacity: .22; overflow: hidden; -webkit-mask: radial-gradient(55% 50% at 22% 50%, #000 30%, transparent); mask: radial-gradient(55% 50% at 22% 50%, #000 30%, transparent); }
.progress-glow img { width: 100%; height: 100%; object-fit: cover; filter: blur(30px) saturate(1.3); transform: scale(1.2); }
.progress-head { display: flex; align-items: center; gap: 14px; }
.progress-poster { flex: none; border-radius: 10px; }
.progress-title { display: grid; gap: 4px; justify-items: start; min-width: 0; flex: 1; }
.progress-title .card-name { max-width: 100%; }
.progress-pct { display: grid; justify-items: end; flex: none; }
.progress-pct strong { font-size: 30px; font-weight: 600; letter-spacing: -.05em; line-height: 1; }
.progress-pct small { color: var(--fg3); font-size: 15px; }
.progress-pct span { color: var(--fg3); font-family: var(--mono); font-size: 12px; }
.season-strip { display: grid; gap: 10px; }
.season-strip-head { display: flex; justify-content: space-between; color: var(--fg3); font-size: 12.5px; }
.season-strip-head span:first-child { color: var(--fg2); font-weight: 500; }
.progress-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.progress-foot .card-meta { white-space: normal; }

/* ---------- Title page ---------- */

.title-hero, .profile-banner { position: relative; isolation: isolate; margin-top: calc(-1 * var(--topbar)); }
/* A title: the backdrop as a band across the top, the poster and its actions in a column that drops below it, and
   the words beside them. */
.title-hero { display: block; }
.title-hero > .hero-backdrop { bottom: auto; height: min(62vh, 560px); }
.title-hero > .hero-backdrop::after { background: linear-gradient(90deg, rgba(0, 0, 0, .9) 0%, rgba(0, 0, 0, .55) 45%, rgba(0, 0, 0, .15) 100%), linear-gradient(0deg, var(--bg) 0%, rgba(0, 0, 0, .55) 35%, transparent 70%, rgba(0, 0, 0, .55) 100%); }
.hero-backdrop { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.hero-backdrop img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; animation: settle 1.2s var(--ease) both; }
@keyframes settle { from { opacity: 0; transform: scale(1.04); } }
.hero-backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .95) 0%, rgba(0, 0, 0, .7) 45%, rgba(0, 0, 0, .2) 100%), linear-gradient(0deg, var(--bg) 2%, transparent 50%, rgba(0, 0, 0, .5) 100%); }
.title-hero-inner { display: grid; grid-template-columns: clamp(190px, 18vw, 260px) minmax(0, 1fr); gap: clamp(22px, 3.2vw, 48px); align-items: start; width: 100%; max-width: 1680px; margin: 0 auto; padding: calc(var(--topbar) + min(30vh, 260px)) var(--gutter) 8px; }
.title-side { display: grid; gap: 14px; }
.action-panel { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line-2); border-radius: var(--radius-lg); background: rgba(12, 12, 13, .82); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.action-panel > .button.primary { width: 100%; justify-content: center; }
.action-panel .status-select, .action-panel .status-select .dropdown-button { width: 100%; min-width: 0; }
.action-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.action-tile { display: grid; justify-items: center; gap: 5px; padding: 10px 4px 9px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(255, 255, 255, .03); color: var(--fg2); font-size: 11.5px; font-weight: 500; transition: background 160ms, color 160ms, border-color 160ms; }
.action-tile:hover { background: rgba(255, 255, 255, .07); color: var(--fg); border-color: var(--line-3); }
.action-tile .icon { width: 19px; height: 19px; }
.action-tile[aria-pressed="true"] { color: var(--fg); }
.panel-rating { display: grid; gap: 8px; padding: 10px 2px 2px; border-top: 1px solid var(--line); }
.panel-rating-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.panel-rating .rating-steps { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; }
.panel-rating .rating-steps button { width: auto; height: 28px; font-size: 11px; }
.activity-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; max-width: 760px; margin-top: 4px; padding-left: 10px; }
.activity-strip .stat strong { font-size: 20px; }
.title-poster-wrap { flex: none; }
.title-poster { width: 100%; height: auto; aspect-ratio: 2 / 3; border-radius: var(--radius); box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px var(--line-2); }
.title-poster.poster-generated { font-size: 20px; }
.title-info { display: grid; gap: 14px; min-width: 0; justify-items: start; padding-top: clamp(20px, 6vh, 90px); }
.title-head, .title-body { display: grid; gap: 12px; justify-items: start; min-width: 0; }
.title-body { gap: 14px; width: 100%; }
.title-info h1 { font-size: clamp(34px, 5vw, 68px); font-weight: 700; letter-spacing: -.055em; line-height: .98; }
.title-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--fg2); font-size: 15px; }
.title-meta i { color: var(--fg3); font-style: normal; }
.cert { padding: 0 6px; border: 1px solid var(--line-3); border-radius: 4px; font-size: 12px; font-weight: 600; }
.tagline { font-size: 16px; font-style: italic; opacity: .8; }
.title-overview { max-width: 66ch; color: rgba(237, 237, 237, .78); font-size: 15.5px; line-height: 1.6; }
.status-select .dropdown-button { height: 46px; min-width: 168px; padding: 0 16px 0 20px; border-color: rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .08); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 14px; font-weight: 600; }
.status-select .dropdown-button:hover, .status-select .dropdown-button[aria-expanded="true"] { background: rgba(255, 255, 255, .14); }
.status-select .dropdown-button .icon { width: 16px; height: 16px; color: var(--fg2); }
.scores { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 6px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.scores:empty { display: none; }
.score-block { display: grid; gap: 4px; align-content: start; }
.score-label { color: var(--fg3); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.score-block strong { font-size: 30px; font-weight: 600; letter-spacing: -.04em; line-height: 1; }
.score-block strong small { color: var(--fg3); font-size: 15px; }
.score-sub { color: var(--fg3); font-size: 12px; }
/* Recommended: the lead pick over its backdrop, and each pick's reason under its poster. */
.pick-hero { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: clamp(20px, 4vw, 56px); min-height: 420px; padding: clamp(22px, 4vw, 48px); border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 0 0 1px var(--line-2); }
.pick-hero .hero-backdrop img { object-position: center 20%; filter: saturate(1.1); }
.pick-hero .hero-backdrop::after { background: linear-gradient(90deg, rgba(0, 0, 0, .94) 0%, rgba(0, 0, 0, .78) 38%, rgba(0, 0, 0, .25) 75%, rgba(0, 0, 0, .45) 100%), linear-gradient(0deg, rgba(0, 0, 0, .85) 0%, transparent 55%); }
.pick-hero-body { display: grid; gap: 14px; justify-items: start; max-width: 60ch; }
.pick-hero-top { display: flex; align-items: center; gap: 14px; }
.pick-hero-top .kicker { color: var(--fg); }
.pick-hero-meta { color: var(--fg2); font-size: 13.5px; }
.pick-hero h2 { font-size: clamp(32px, 4.6vw, 60px); font-weight: 700; letter-spacing: -.05em; line-height: .98; text-wrap: balance; }
.pick-hero h2 a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; text-decoration-color: var(--line-3); }
.pick-hero-why { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 9px; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(0, 0, 0, .4); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: var(--fg); font-size: 13.5px; font-weight: 500; }
.pick-hero-why .icon { width: 15px; height: 15px; color: #ffe08a; }
.pick-hero-overview { color: rgba(244, 241, 238, .8); font-size: 15px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pick-hero .hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.button.ghost { background: none; border-color: transparent; color: var(--fg2); }
.button.ghost:hover { color: var(--fg); background: rgba(255, 255, 255, .06); }
.pick-hero-poster { width: clamp(150px, 16vw, 220px); border-radius: var(--radius); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .9), 0 0 0 1px var(--line-2); transform: rotate(2deg); transition: transform 500ms var(--ease); }
.pick-hero-poster:hover { transform: rotate(0deg) translateY(-4px); }
.pick-hero-poster .poster { border-radius: var(--radius); }
/* The match: a ring in the spectrum, filled to the percent. */
.match-ring { position: relative; display: grid; place-items: center; width: 52px; height: 52px; flex: none; }
.match-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.match-ring circle { fill: none; stroke: rgba(255, 255, 255, .12); stroke-width: 3.5; }
.match-ring circle.fill { stroke: url(#spectrum-ring); stroke-linecap: round; animation: ring-fill 1.1s var(--ease) both; }
@keyframes ring-fill { from { stroke-dasharray: 0 100; } }
.match-ring b { font-size: 15px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.match-ring small { font-size: 10px; font-weight: 600; color: var(--fg2); }
@media (max-width: 760px) {
  .pick-hero { grid-template-columns: 1fr; min-height: 0; padding: 20px; }
  .pick-hero-poster { order: -1; width: 112px; transform: none; }
  .pick-hero .hero-backdrop::after { background: linear-gradient(0deg, rgba(0, 0, 0, .95) 30%, rgba(0, 0, 0, .55) 100%); }
}
.pick-why b { color: var(--fg); font-weight: 600; }
/* A pick's reason wraps to two lines instead of being cut off mid-word. */
.poster-card .card-meta:has(.pick-why) { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; white-space: normal; line-height: 1.35; }
.rating-steps { display: inline-flex; gap: 3px; flex-wrap: wrap; }
.rating-steps button { width: 30px; height: 30px; padding: 0; border: 1px solid var(--line-2); border-radius: 8px; background: rgba(0, 0, 0, .35); color: var(--fg3); font: 500 12px var(--mono); }
.rating-steps button:hover, .rating-steps:hover button:has(~ button:hover) { border-color: var(--fg2); color: var(--fg); }
.rating-steps button.on { background: rgba(255, 255, 255, .14); border-color: transparent; color: var(--fg); }
.rating-steps button[aria-pressed="true"] { background: var(--fg); color: #000; font-weight: 700; }
.notice { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface-2); }
.notice .icon { fill: currentColor; }
.notice span { margin-right: auto; }
.seasons { display: grid; gap: 18px; }
.seasons-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.season-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.season-tabs button { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 999px; background: none; color: var(--fg2); font: 500 13px var(--mono); }
.season-tabs button .icon { width: 13px; height: 13px; stroke-width: 2.4; color: var(--good); }
.season-tabs button:hover { color: var(--fg); border-color: var(--line-3); }
.season-tabs button[aria-selected="true"] { background: var(--fg); border-color: var(--fg); color: #000; }
.season-tabs button[aria-selected="true"] .icon { color: #000; }
.season-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.episode-list { list-style: none; margin: 0 -6px; padding: 0; display: grid; }
.episode-row { display: flex; align-items: center; gap: 16px; padding: 10px 6px; border-radius: var(--radius-sm); }
.episode-row + .episode-row { border-top: 1px solid var(--line); }
.episode-row:hover { background: var(--surface-2); }
.ep-still { position: relative; flex: none; width: 140px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 9px; background: var(--surface-3); }
.ep-still img { width: 100%; height: 100%; object-fit: cover; }
.ep-still .mono { position: absolute; left: 6px; bottom: 6px; padding: 1px 6px; border-radius: 5px; background: rgba(0, 0, 0, .7); font-size: 11px; }
.ep-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.ep-title { font-weight: 600; letter-spacing: -.01em; }
.ep-overview { color: var(--fg3); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.episode-row.is-watched .ep-still img { filter: grayscale(.5) brightness(.6); }
.episode-row.is-upcoming { opacity: .55; }
.cast-rail { display: grid; grid-auto-flow: column; grid-auto-columns: 112px; gap: 14px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
.cast-rail::-webkit-scrollbar { display: none; }
.person { display: grid; gap: 2px; justify-items: center; align-content: start; text-align: center; min-width: 0; border-radius: var(--radius); }
a.person img, a.person .person-initials { transition: transform 260ms var(--ease), box-shadow 260ms var(--ease); }
a.person:hover img, a.person:hover .person-initials { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--line-3), 0 12px 30px -12px rgba(92, 200, 255, .45); }
a.person:hover .card-name { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--fg3); }
.person img, .person-initials { width: 92px; height: 92px; margin-bottom: 8px; border-radius: 50%; object-fit: cover; object-position: center 12%; background: var(--surface-2); box-shadow: 0 0 0 1px var(--line); }
.person-initials { display: grid; place-items: center; color: var(--fg3); font-weight: 600; font-size: 22px; }
.person .card-name { max-width: 100%; font-size: 13px; }
.person .card-meta { max-width: 100%; font-size: 12px; color: var(--fg3); }

/* ---------- Profile ---------- */

.profile-banner { height: 320px; }
.profile-banner .hero-backdrop img { object-position: center 30%; filter: saturate(1.15); }
.profile-banner .hero-backdrop::after { background: linear-gradient(0deg, var(--bg) 0%, rgba(0, 0, 0, .35) 60%, rgba(0, 0, 0, .55) 100%); }
.profile-page { margin-top: -110px; position: relative; padding-top: 0; }
.profile-head { display: flex; align-items: end; gap: 22px; flex-wrap: wrap; }
.profile-id { display: grid; gap: 6px; flex: 1; min-width: 220px; }
.profile-id h1 { font-size: clamp(30px, 4vw, 44px); font-weight: 700; letter-spacing: -.045em; line-height: 1.05; }
.watch-time { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.watch-time-label { color: var(--fg3); font-size: 12px; }
.watch-time-boxes { display: flex; gap: 4px; }
.watch-time-boxes span { display: grid; justify-items: center; min-width: 50px; padding: 5px 8px; border: 1px solid var(--line-2); border-radius: 8px; background: rgba(0, 0, 0, .6); line-height: 1.1; }
.watch-time-boxes strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.watch-time-boxes small { color: var(--fg3); font-size: 10.5px; }
.profile-head .head-actions { margin-bottom: 6px; }
.profile-columns { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start; }
.profile-columns > aside { position: sticky; top: calc(var(--topbar) + 16px); }
.profile-columns .rail { margin: 0; padding: 0 0 4px; }
.side-title { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--fg3); }
.ws-block { display: grid; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.ws-label { color: var(--fg2); font-size: 12.5px; font-weight: 600; }
.ws-row { display: flex; align-items: baseline; gap: 6px; }
.ws-row .icon.tiny { color: var(--fg3); }
.ws-row strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.ws-row small { color: var(--fg3); font-size: 12px; }

/* ---------- Charts ---------- */

.heatmap-wrap { display: grid; gap: 4px; overflow-x: auto; padding-bottom: 2px; }
.heatmap-months, .heatmap { display: grid; grid-template-columns: repeat(var(--weeks), minmax(10px, 1fr)); gap: 3px; min-width: calc(var(--weeks) * 13px); }
.heatmap-months { color: var(--fg3); font-size: 11px; }
.heatmap { grid-template-rows: repeat(7, auto); }
.cell { display: block; aspect-ratio: 1; border-radius: 3px; background: var(--heat-0); }
.cell.l1 { background: var(--heat-1); }
.cell.l2 { background: var(--heat-2); }
.cell.l3 { background: var(--heat-3); }
.cell.l4 { background: var(--heat-4); }
.heatmap .cell:hover { outline: 1.5px solid var(--fg); outline-offset: 1px; }
.legend-scale { display: flex; align-items: center; justify-content: end; gap: 3px; margin-top: 6px; color: var(--fg3); font-size: 11px; }
.legend-scale .cell { width: 10px; height: 10px; }
.columns { position: relative; display: flex; align-items: end; gap: 3px; height: 190px; padding-left: 34px; }
.columns.short { height: 150px; padding-left: 0; }
.axis-lines { position: absolute; inset: 0 0 22px 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.axis-lines span { display: block; height: 0; border-top: 1px dashed var(--line-2); color: var(--fg3); font: 10.5px/0 var(--mono); }
.column { position: relative; display: flex; flex-direction: column; justify-content: end; align-items: center; flex: 1; height: 100%; padding-bottom: 22px; border-radius: 6px; }
.column:hover { background: rgba(255, 255, 255, .03); }
.col-bar { display: block; width: min(64%, 26px); border-radius: 5px 5px 0 0; background: var(--fg); transition: opacity 160ms; }
.col-bar[style*="height:0%"] { height: 2px !important; background: var(--line-2); }
.columns:hover .col-bar { opacity: .5; }
.columns .column:hover .col-bar { opacity: 1; }
.col-label { position: absolute; bottom: 2px; color: var(--fg3); font: 11px var(--mono); }
.hbars { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.hbars li { display: grid; grid-template-columns: 110px 1fr 48px; align-items: center; gap: 12px; }
.hbar-label { color: var(--fg2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar { display: block; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .06); }
.hbar > span { display: block; height: 100%; border-radius: 4px; background: var(--fg); }
.hbar-value { color: var(--fg); font: 12.5px var(--mono); text-align: right; }
.table-view summary { color: var(--fg3); font-size: 12.5px; cursor: pointer; }
.table-view table { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.table-view th, .table-view td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.table-view th { color: var(--fg3); font-weight: 500; }

/* ---------- Lists ---------- */

.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.list-card { display: grid; gap: 0; }
.list-card .collage { border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); transition: box-shadow 320ms var(--ease); }
.list-card:hover .collage { box-shadow: 0 0 0 1px var(--line-2), 0 18px 50px -24px rgba(92, 200, 255, .45); }
.collage { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); aspect-ratio: 16 / 7; overflow: hidden; background: var(--surface-2); }
.collage .poster { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; }
.collage-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--fg3); }
.collage-empty .icon { width: 28px; height: 28px; }
.list-card-text { display: grid; gap: 2px; padding: 12px 2px 0; }
.list-card-text .card-meta { white-space: normal; }

/* ---------- Connect / settings ---------- */

/* Settings: a short rune-marked index, one section at a time beside it, each section ribbon groups of label/control rows. */
.settings { display: grid; grid-template-columns: 280px minmax(0, 780px); gap: clamp(24px, 4vw, 56px); align-items: start; }
.settings-index { position: sticky; top: calc(var(--topbar) + 22px); display: grid; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.settings-index a { position: relative; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 12px; border-radius: 12px; color: var(--fg2); transition: color 200ms, background 320ms var(--ease); }
.settings-index a > .icon { width: 14px; height: 14px; margin-left: auto; color: var(--fg3); opacity: 0; transition: opacity 200ms; }
.settings-index a:hover { color: var(--fg); background: rgba(255, 255, 255, .03); }
.settings-index a[aria-current="page"] { color: var(--fg); background: linear-gradient(90deg, rgba(92, 200, 255, .13), rgba(169, 139, 255, .05) 70%, transparent); }
.settings-index a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 2px; border-radius: 2px; background: linear-gradient(#5cc8ff, #a98bff); box-shadow: 0 0 10px #5cc8ff; }
.set-index-text { display: grid; gap: 1px; min-width: 0; }
.set-index-text b { font-size: 14px; font-weight: 600; }
.set-index-text small { color: var(--fg3); font-size: 12px; line-height: 1.35; }
.set-rune { width: 22px; flex: none; font-family: var(--runic); font-size: 18px; text-align: center; color: var(--fg3); }
.settings-index a[aria-current="page"] .set-rune { color: var(--fg); text-shadow: 0 0 10px rgba(92, 200, 255, .7); }
.settings-pane { gap: 30px; }
.settings-back { display: none; }
.settings-pane-head { display: flex; align-items: center; gap: 16px; padding-bottom: 6px; }
.settings-pane-head .set-rune { display: grid; place-items: center; width: 52px; height: 52px; border: 1px solid var(--line-2); border-radius: 16px; background: radial-gradient(circle at 30% 20%, rgba(92, 200, 255, .16), transparent 70%), var(--surface-2); color: var(--fg); font-size: 26px; text-shadow: 0 0 14px rgba(92, 200, 255, .55); }
.settings-pane-head h2 { font-size: 26px; font-weight: 700; letter-spacing: -.035em; }
.settings-pane-head p { color: var(--fg3); font-size: 14px; }
.set-group { display: grid; gap: 10px; }
.set-head { display: flex; align-items: center; gap: 10px; color: var(--fg3); font-size: 11.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.set-head .set-rune { width: auto; font-size: 14px; letter-spacing: 0; color: var(--fg2); }
.set-card { display: grid; padding: 4px 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.set-card > .nifl-preview { margin: 14px 0 6px; }
.set-kbd { padding: 3px 9px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 7px; background: var(--surface-2); color: var(--fg); font: 500 12.5px var(--mono); white-space: nowrap; }
.set-row { display: flex; align-items: center; gap: 16px; min-height: 58px; padding: 10px 0; }
.set-row + .set-row, .set-card > .form-error + .set-row, .set-card > form + .set-row, .set-card > .set-row + form { border-top: 1px solid var(--line); }
.set-key { display: grid; gap: 1px; flex: 1; min-width: 0; color: var(--fg); font-weight: 500; }
.set-key > span { color: var(--fg3); font-size: 12.5px; font-weight: 400; }
.set-key a { color: var(--fg2); text-decoration: underline; text-decoration-color: var(--fg3); text-underline-offset: 3px; }
.set-key .status-line { display: inline; }
.set-linked { color: var(--fg3); font-size: 13px; }
.set-control { display: flex; align-items: center; justify-content: end; gap: 8px; flex-wrap: wrap; }
.set-row.key-form .set-control { flex: 1.3; flex-wrap: nowrap; }
.set-row.key-form input { flex: 1; min-width: 0; height: 32px !important; padding: 0 14px !important; }
.set-row.key-form .button { height: 32px; }
.set-card > .fine { padding: 12px 0; border-top: 1px solid var(--line); }
.set-card > .import-card { margin: 10px 0; }
.avatar-row { flex-wrap: nowrap; margin: 0; }
.connect-head { display: flex; gap: 14px; align-items: start; }
.connect-head h2 { font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.connect-head p { margin-top: 4px; color: var(--fg2); }
.connect-head a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--fg3); text-underline-offset: 3px; }
.connect-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--surface-3); }
.key-form { display: flex; gap: 8px; }
.form-error { color: var(--bad); font-size: 13px; }
.file-button { position: relative; overflow: hidden; justify-self: start; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-button:focus-within { outline: 2px solid var(--fg); outline-offset: 2px; }
.import-card { display: grid; gap: 12px; padding: 14px 0 4px; border-top: 1px solid var(--line); }
.import-counts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; color: var(--fg2); font-size: 13px; }
.import-counts strong { color: var(--fg); }
.import-counts small { color: var(--fg3); }
.status-line { display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg3); box-shadow: 0 0 0 4px rgba(255, 255, 255, .05); }
.dot.ok { background: var(--good); box-shadow: 0 0 0 4px rgba(123, 216, 143, .12); }
.fine { color: var(--fg3) !important; font-size: 12px; }
.empty { position: relative; display: grid; justify-items: start; gap: 14px; padding: 8px 0 8px 24px; color: var(--fg2); }
.empty::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: repeating-linear-gradient(var(--fg3) 0 4px, transparent 4px 9px); opacity: .6; }

/* ---------- Menu ---------- */

.menu { position: fixed; z-index: 60; top: 0; left: 0; min-width: 230px; max-height: calc(100vh - 16px); overflow-y: auto; padding: 6px; border: 1px solid var(--line-2); border-radius: 14px; background: rgba(22, 22, 24, .97); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.menu-title { padding: 6px 10px 8px; color: var(--fg3); font-size: 12px; font-weight: 600; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--fg); text-align: left; font-size: 13.5px; }
.menu button .icon { width: 16px; height: 16px; color: var(--fg2); }
.menu button:hover, .menu button:focus-visible { background: var(--surface-3); outline: none; }

/* ---------- Palette & dialogs ---------- */

.palette { width: min(640px, calc(100% - 24px)); max-height: min(560px, calc(100% - 80px)); margin: 12vh auto auto; padding: 0; border: 1px solid var(--line-2); border-radius: var(--radius-lg); background: rgba(22, 22, 26, .97); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); color: var(--fg); box-shadow: 0 40px 120px rgba(0, 0, 0, .7); overflow: hidden; }
.palette[open] { display: flex; flex-direction: column; }
.palette::backdrop { background: rgba(0, 0, 0, .55); backdrop-filter: blur(3px); }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); color: var(--fg3); }
.palette-input input { flex: 1; min-width: 0; height: 60px; border: 0; outline: 0; background: none; color: var(--fg); font-size: 17px; }
.palette-input input::-webkit-search-cancel-button { display: none; }
.palette-results { flex: 1; margin: 0; padding: 8px; list-style: none; overflow-y: auto; }
.palette-results li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.palette-results li[aria-selected="true"] { background: var(--surface-3); }
.pal-enter { color: var(--fg3); font-size: 12px; opacity: 0; }
.palette-results li[aria-selected="true"] .pal-enter { opacity: 1; }
.palette-recent { padding: 12px 18px 4px; }
.pal-recent-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: var(--fg3); font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.pal-recent-head .link-button { font-size: 12px; letter-spacing: 0; text-transform: none; }
.pal-recent-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pal-query { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface-2); color: var(--fg2); font-size: 13px; transition: border-color 200ms, color 200ms; }
.pal-query:hover { border-color: var(--line-3); color: var(--fg); }
.pal-query button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 4px 0 12px; border: 0; background: none; color: inherit; font: inherit; }
.pal-query .pal-forget { padding: 0 10px 0 4px; color: var(--fg3); }
.pal-query .pal-forget:hover { color: var(--fg); }
.palette-foot { padding: 10px 18px; border-top: 1px solid var(--line); color: var(--fg3); font-size: 12px; }
.palette-foot:empty { display: none; }
dialog:not(.palette) { width: min(460px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 26px; border: 1px solid var(--line-2); border-radius: var(--radius-lg); color: var(--fg); background: #16161a; box-shadow: 0 40px 120px rgba(0, 0, 0, .7); }
dialog::backdrop { background: rgba(0, 0, 0, .65); backdrop-filter: blur(4px); }
dialog h2 { padding-right: 36px; font-size: 22px; font-weight: 700; letter-spacing: -.035em; }
dialog .eyebrow { color: var(--fg3); font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 4px; }
.dialog-close { position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line-2); border-radius: 50%; background: none; color: var(--fg2); }
.dialog-close:hover { color: var(--fg); background: var(--surface-3); }
.form { display: grid; gap: 14px; margin-top: 20px; }
.form label { display: grid; gap: 6px; color: var(--fg2); font-size: 13px; font-weight: 500; }
.form input, .form select, .form textarea { width: 100%; min-width: 0; background: var(--surface-2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-note { color: var(--warn); font-size: 12.5px; }
.form-note:empty { display: none; }
.form-actions { display: flex; justify-content: end; gap: 8px; margin-top: 18px; }
.form .form-actions { margin-top: 4px; }
.add-lists { display: grid; gap: 6px; margin-top: 18px; max-height: 50vh; overflow: auto; }
.add-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg); text-align: left; }
.add-row:hover { border-color: var(--line-3); }
.add-row small { display: block; color: var(--fg3); font-size: 12px; }
.add-row[aria-pressed="true"] { border-color: var(--fg2); background: var(--surface-2); }
.rate-body { display: grid; gap: 14px; justify-items: start; margin-top: 18px; }
.rate-body .rating-steps button { width: 34px; height: 38px; }

/* ---------- Toast & tooltip ---------- */

.toast { position: fixed; z-index: 70; left: 50%; bottom: 24px; display: flex; align-items: center; gap: 14px; max-width: calc(100% - 32px); min-height: 44px; padding: 8px 8px 8px 18px; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(30, 30, 34, .95); backdrop-filter: blur(12px); box-shadow: 0 16px 50px rgba(0, 0, 0, .6); opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity 220ms var(--ease), transform 220ms var(--ease); }
.toast.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.toast:empty { display: none; }
.toast button { height: 30px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--fg); color: #000; font-weight: 600; }
.tooltip { position: fixed; z-index: 80; top: 0; left: 0; max-width: 280px; padding: 6px 10px; border-radius: 8px; background: var(--fg); color: #000; font-size: 12px; font-weight: 500; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tabbar, .drawer-scrim { display: none; }

/* ---------- Responsive ---------- */

@media (max-width: 1280px) {
  .stat-row.six { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 6px; }
  .profile-columns { grid-template-columns: minmax(0, 1fr); }
  .profile-columns > aside { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1080px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .media-toggle span { display: none; }
  .media-toggle button { padding: 0 10px; }
  .cal-cell { min-height: 96px; }
}

@media (max-width: 860px) {
  :root { --sidebar: 0px; --topbar: 56px; }
  .sidebar { --sidebar: 280px; width: 280px; transform: translateX(-100%); transition: transform 260ms var(--ease); box-shadow: 0 0 60px rgba(0, 0, 0, .6); }
  .sidebar-collapsed .sidebar { width: 280px; }
  .sidebar-collapsed .brand, .sidebar-collapsed .brand span, .sidebar-collapsed .side-sub, .sidebar-collapsed .side-main span, .sidebar-collapsed .side-search span, .sidebar-collapsed .side-search kbd, .sidebar-collapsed .side-profile-name { display: revert; }
  .sidebar-collapsed .side-search, .sidebar-collapsed .side-main, .sidebar-collapsed .side-profile { justify-content: start; padding: 0 10px; }
  .sidebar-toggle { display: none; }
  body.drawer-open .sidebar { transform: none; }
  .drawer-scrim { position: fixed; inset: 0; z-index: 25; display: block; background: rgba(0, 0, 0, .6); }
  .drawer-scrim[hidden] { display: none; }
  .shell { margin-left: 0; }
  .topbar .mobile-menu, .topbar .mobile-search { display: grid; }
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(0, 0, 0, .96); }
  .topbar-title { grid-column: 2; }
  .topbar-title > span { display: none; }
  .media-toggle { position: fixed; z-index: 21; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); transform: translateX(-50%); box-shadow: 0 10px 30px rgba(0, 0, 0, .6); background: rgba(18, 18, 21, .95); backdrop-filter: blur(12px); }
  .media-toggle span { display: inline; }
  .topbar-tools .button span, .today-chip { display: none; }
  .topbar-tools .button { width: 34px; padding: 0; }
  .tabbar { position: fixed; z-index: 22; inset: auto 0 0; display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(0, 0, 0, .94); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
  .tabbar a { display: grid; justify-items: center; gap: 3px; flex: 1; padding: 6px 2px; color: var(--fg3); font-size: 10.5px; font-weight: 500; }
  .tabbar a[aria-current="page"] { color: var(--fg); }
  .tabbar .icon { width: 20px; height: 20px; }
  .page { padding-bottom: 150px; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 6px; padding-left: 0; }
  .toast { bottom: 132px; }
  .dots { opacity: 1; }
  /* Phones: the month folds into a compact date picker (a number and a dot per release, like a week strip) and the
     chosen day's releases below it carry the artwork. */
  .cal-grid { gap: 4px; }
  .cal-dow { padding: 0 0 4px; font-size: 10.5px; text-align: center; }
  .cal-cell { grid-template-rows: auto 6px; justify-items: center; align-content: center; gap: 5px; min-height: 0; aspect-ratio: 1; padding: 0; border-radius: 12px; }
  .cal-cell:not(.has-releases):not(.is-today):not(.is-selected) { border-color: transparent; background: transparent; }
  .cal-num { justify-content: center; font-size: 14px; }
  .cal-num b { display: none; }
  .cal-tiles { display: flex; justify-content: center; gap: 3px; }
  .cal-tile { width: 5px; height: 5px; border-radius: 50%; background: var(--c); box-shadow: 0 0 6px var(--c); }
  .cal-tile > *, .cal-more, .cal-label { display: none; }
  .cal-tiles.single { display: flex; }
  .cal-cell:hover .cal-tile { transform: none; }
  .cal-cell.has-releases::before { display: none; }
  .cal-agenda { padding-top: 6px; border-top: 1px solid var(--line); }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  /* Phones: poster and words side by side under the backdrop, the action panel full width below. */
  .title-hero > .hero-backdrop { height: 300px; }
  .title-hero-inner { grid-template-columns: 112px minmax(0, 1fr); gap: 16px; padding-top: calc(var(--topbar) + 120px); }
  .title-side { display: contents; }
  .title-poster-wrap { grid-column: 1; grid-row: 1; align-self: end; }
  .title-info { display: contents; }
  .title-head { grid-column: 2; grid-row: 1; align-self: end; gap: 8px; }
  .title-info h1 { font-size: clamp(26px, 8vw, 36px); }
  .action-panel { grid-column: 1 / -1; grid-row: 2; }
  .title-body { grid-column: 1 / -1; grid-row: 3; }
  .activity-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 6px; padding-left: 0; }
  .row-status, .row-status .chip, .row > .chip { width: auto; }
  .row .rating-pill { width: auto; }
  .row .rating-pill:empty { display: none; }
  .icon-button.glass { width: 44px; height: 44px; }
  .scores { gap: 18px; }
  .rating-steps { gap: 2px; }
  .rating-steps button { width: 27px; height: 32px; }
  .stat-row.six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 14px 16px; }
  .stat strong { font-size: 21px; }
  .poster-grid, .poster-grid.dense { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 18px 10px; }
  .card-grid { grid-template-columns: minmax(0, 1fr); }
  .rail { grid-auto-columns: 112px; gap: 10px; }
  .rail.wide { grid-auto-columns: 78%; }
  .card-foot .check.small { width: 26px; height: 26px; }
  .ep-still { width: 96px; }
  .ep-overview { display: none; }
  .row-bar { display: none; }
  .squares { grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); }
  .square { min-height: 34px; }
  .profile-banner { height: 220px; }
  .profile-page { margin-top: -70px; }
  .avatar.large { width: 88px; height: 88px; font-size: 30px; }
  .profile-columns > aside { grid-template-columns: minmax(0, 1fr); }
  .watch-time-boxes span { min-width: 44px; }
  .hbars li { grid-template-columns: 80px 1fr 40px; }
  /* Phones: the sections as a list; each opens on its own page with a way back. */
  .settings { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .settings.at-index .settings-pane, .settings:not(.at-index) .settings-index { display: none; }
  .settings-index { position: static; }
  .settings-index a > .icon { opacity: 1; }
  .settings-index a[aria-current="page"] { background: none; }
  .settings-index a[aria-current="page"]::before { display: none; }
  .settings-back { display: inline-flex; align-items: center; gap: 6px; color: var(--fg2); font-size: 14px; font-weight: 500; }
  .settings-back .icon { width: 16px; height: 16px; }
  .settings-pane-head .set-rune { width: 44px; height: 44px; font-size: 22px; }
  .settings-pane-head h2 { font-size: 22px; }
  .set-card { padding: 2px 14px; }
  .set-row { flex-wrap: wrap; }
  .set-row.key-form .set-control { flex-basis: 100%; }
  .set-row > .set-control { margin-left: auto; }
  .streak-bars { display: none; }
  .welcome { padding: 24px 0; }
}

/* ---------- Motion (motion.js), in the launch page's manner ---------- */

/* Pages rise in, a beat apart. Only on arrival: background refreshes never replay it. */
.view.is-entering > * { animation: rise 760ms var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); filter: blur(3px); } }

/* Marking something watched: the light lands, a halo in the bridge's colours with sparks thrown off it. */
:has(> .rune-veil) { position: relative; }
.rune-veil { position: absolute; inset: 0; pointer-events: none; }
.rune-veil > span { position: absolute; transform: translateX(-50%); color: var(--fg2); font-family: var(--runic); font-weight: 400; }
.land-flare { position: fixed; z-index: 60; width: 0; height: 0; pointer-events: none; }
.land-flare::before {
  position: absolute; left: -60px; top: -60px; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 224, 138, .5), rgba(92, 200, 255, .22) 45%, rgba(169, 139, 255, .1) 65%, transparent 80%);
  animation: land 1100ms var(--ease) both; content: "";
}
@keyframes land { 0% { opacity: 0; scale: .4; } 18% { opacity: 1; scale: 1; } 100% { opacity: 0; scale: 1.35; } }
.land-flare i {
  position: absolute; left: -2px; top: -2px; width: 4px; height: 4px; border-radius: 50%;
  background: var(--c); box-shadow: 0 0 8px var(--c);
  animation: spark 900ms var(--ease) both;
}
@keyframes spark { from { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(1); } to { opacity: 0; transform: rotate(var(--a)) translateY(-38px) scale(.3); } }

/* A soft light follows the pointer, as on the launch page. */
.cursor-light {
  position: fixed; z-index: 40; left: 0; top: 0; width: 60vmax; height: 60vmax; margin: -30vmax 0 0 -30vmax;
  border-radius: 50%; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(closest-side, rgba(244, 241, 238, .045), transparent 70%);
  opacity: 0; transition: opacity 1s var(--ease); will-change: transform;
}
.has-pointer .cursor-light { opacity: 1; }

/* The mark glows when you reach for it, and breathes while Bifrost opens. */
.brand-mark { transition: filter 400ms var(--ease); }
.brand:hover .brand-mark { filter: drop-shadow(0 0 6px rgba(255, 224, 138, .55)) drop-shadow(0 0 14px rgba(92, 200, 255, .35)); }
.gate-card:has(> .gate-mark + .gate-wait) > .gate-mark { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe {
  0%, 100% { filter: drop-shadow(0 0 0 transparent); }
  50% { filter: drop-shadow(0 0 8px rgba(255, 224, 138, .5)) drop-shadow(0 0 18px rgba(92, 200, 255, .3)); }
}

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

/* ---------- Account gate (sync/gate.js): in front of the tracker until this browser is signed in ---------- */
body.gated > :not(.gate):not(.gate-runes):not(.icon-definitions):not(.skip-link):not(script):not(.nifl-sky):not(.nifl-lights) { display: none !important; }
/* Sign-in stands in the launch page's rune field, the bridge's arch framing the card. Drawn by runes.js. */
.gate-runes { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
body:not(.gated) > .gate-runes { display: none; }
.gate { position: relative; }
.gate { min-height: 100vh; min-height: 100dvh; display: grid; }
.gate-screen {
  display: grid; place-items: center; padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}
.gate-card { width: 100%; max-width: 400px; display: grid; gap: 14px; }
.gate-mark { width: 56px; height: 40px; margin-bottom: 6px; }
/* The bare "Opening Bifrost…" card: the mark sits right above the centered status, so center it too. */
.gate-card:has(> .gate-mark + .gate-wait) > .gate-mark { justify-self: center; }
/* "Loading your library": a status screen, not a form, so everything is centered under the mark. */
.gate-loading { justify-items: center; text-align: center; }
.gate-loading > .gate-mark { animation: breathe 2.4s ease-in-out infinite; }
.gate-card h1 { font-size: 30px; line-height: 1.1; font-weight: 600; letter-spacing: -.035em; }
.gate-lede { color: var(--fg2); font-size: 15px; margin-bottom: 4px; }
.gate-detail { color: var(--fg3, var(--fg2)); font-size: 12px; overflow-wrap: anywhere; margin-bottom: 8px; }
.gate-field { display: grid; gap: 6px; }
.gate-field > span { font-size: 13px; font-weight: 500; color: var(--fg2); }
.gate-field input {
  width: 100%; height: 50px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--surface); font-size: 16px; transition: border-color 160ms;
}
.gate-field input:focus { outline: none; border-color: var(--fg2); }
.gate-field input.mono { font-family: var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.gate-hint { margin-top: -8px; color: var(--fg3); font-size: 12px; }
.gate-alert { padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(255, 122, 133, .1); color: var(--bad); font-size: 14px; }
.gate-submit { width: 100%; height: 50px; font-size: 15px; }
.gate-providers { display: contents; }
.gate-providers .gate-hint { margin-top: 0; text-align: center; }
.gate-or { display: flex; align-items: center; gap: 12px; color: var(--fg3); font-size: 12px; margin-top: 4px; }
.gate-or::before, .gate-or::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }
.gate-foot { justify-self: center; margin-top: 6px; color: var(--fg2); font-size: 14px; }
a.gate-foot, .gate-foot a { color: inherit; text-decoration: underline; text-decoration-color: var(--fg3); text-underline-offset: 3px; }
.gate-foot { margin-bottom: 0; }
.gate-wait { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--fg2); font-size: 14px; }
.gate-spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-3); border-top-color: var(--fg); animation: gate-spin 900ms linear infinite; }
@keyframes gate-spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { .gate-spinner { animation-duration: 3s; } }

/* ---------- Account and sync status (sidebar foot, Settings) ---------- */
.sync-chip { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--fg2); }
.sync-chip:hover { background: var(--surface-2); color: var(--fg); }
.sync-text { display: grid; min-width: 0; line-height: 1.25; }
.sync-user { color: var(--fg); font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sync-label { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sync-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--fg3); }
.sync-dot.good { background: var(--good); }
.sync-dot.warn { background: var(--warn); }
.sync-dot.bad { background: var(--bad); }
.sync-dot.info { background: var(--info); }
.status-line .sync-dot { display: inline-block; margin-right: 8px; vertical-align: 1px; }
.sidebar-collapsed .sync-chip { justify-content: center; padding: 6px 0; }
.sidebar-collapsed .sync-text { display: none; }
@media (max-width: 860px) { .sidebar-collapsed .sync-chip { justify-content: flex-start; padding: 6px 10px; } .sidebar-collapsed .sync-text { display: grid; } }
/* On a phone the sidebar is a drawer: a small pill in the top bar says when changes are waiting or sync is failing. */
.sync-pill { display: none; }
@media (max-width: 860px) {
  .sync-pill:not([hidden]) { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface-2); color: var(--fg2); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
}

/* ---------- Person ---------- */

.person-head { display: flex; gap: clamp(18px, 3vw, 36px); align-items: flex-start; }
.person-photo { width: clamp(120px, 16vw, 200px); aspect-ratio: 2 / 3; flex: none; border-radius: var(--radius-lg); object-fit: cover; background: var(--surface-2); box-shadow: 0 0 0 1px var(--line), 0 30px 60px -30px rgba(0, 0, 0, .9); }
.person-photo.person-initials { display: grid; place-items: center; font-size: 40px; }
.person-text { display: grid; gap: 10px; align-content: start; min-width: 0; }
.person-text h1 { font-size: clamp(30px, 4vw, 52px); font-weight: 700; letter-spacing: -.045em; line-height: 1.02; }
.person-bio { max-width: 72ch; color: var(--fg2); font-size: 15px; line-height: 1.6; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.person-bio.is-open { display: block; }
.person-text .link-button { justify-self: start; }
.skeleton.line { display: block; width: 240px; height: 32px; border-radius: 8px; }
@media (max-width: 640px) { .person-head { flex-direction: column; } }

/* ---------- Community ---------- */

.community { gap: 18px; }
.community-head { justify-content: space-between; align-items: center; }
.community-head .count { color: var(--fg3); font: 500 14px var(--mono); }
.comment-form { display: flex; gap: 12px; align-items: flex-start; }
.comment-compose { display: grid; gap: 8px; flex: 1; min-width: 0; }
.comment-compose textarea { width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--radius); background: rgba(255, 255, 255, .03); line-height: 1.5; transition: border-color 160ms, background 160ms; }
.comment-compose textarea:focus { background: rgba(255, 255, 255, .05); min-height: 96px; }
.comment-compose-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.comments { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.comment { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.comment-main { display: grid; gap: 6px; flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--fg3); }
.comment-head strong { color: var(--fg); font-weight: 600; }
.comment-head time { margin-left: auto; font-size: 12px; }
.karma { display: inline-flex; align-items: center; color: var(--fg2); font: 500 11.5px var(--mono); }
.karma .icon, .karma-badge .icon { color: #ffe08a; }
.comment-text { color: rgba(244, 241, 238, .88); font-size: 14.5px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-tools { display: flex; align-items: center; gap: 14px; }
.vote { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--line-2); border-radius: 999px; }
.vote button { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--fg3); transition: color 160ms, background 160ms; }
.vote button .icon { width: 14px; height: 14px; stroke-width: 2.2; }
.vote button:not(:disabled):hover { color: var(--fg); background: rgba(255, 255, 255, .08); }
.vote button[data-value="1"][aria-pressed="true"] { color: #7bd88f; background: rgba(123, 216, 143, .12); }
.vote button[data-value="-1"][aria-pressed="true"] { color: #ff6b7a; background: rgba(255, 107, 122, .12); }
.vote button:disabled { opacity: .35; }
.vote-score { min-width: 26px; text-align: center; color: var(--fg2); font: 600 12px var(--mono); }
.link-button.subtle { color: var(--fg3); font-size: 12.5px; }
.karma-line { display: flex; align-items: center; gap: 10px; min-height: 24px; margin-top: 6px; }
.karma-line:empty { display: none; }
.karma-badge { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(255, 255, 255, .03); color: var(--fg2); font-size: 12.5px; }
.karma-badge strong { color: var(--fg); font-family: var(--mono); }
.karma-sub { color: var(--fg3); font-size: 12.5px; }

/* ---------- World Tree (profile; Yggdrasil's WorldTree.module.css). --hi/--deep: the current realm; --own: each row's ---------- */

.world-tree { min-width: 0; --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; }
.wt-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.wt-total { font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; color: color-mix(in oklab, var(--hi) 55%, var(--fg2)); }
.wt-panel {
  margin: 0; padding: 8px 6px; list-style: none; border-radius: var(--radius);
  background: radial-gradient(120% 50% at 0% 100%, color-mix(in oklab, var(--deep) 30%, transparent), transparent 75%), color-mix(in oklab, var(--deep) 8%, rgba(255, 255, 255, .035));
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--hi) 9%, transparent);
}
.wt-realm { --node: 15px; position: relative; display: grid; grid-template-columns: 30px 1fr auto; align-items: baseline; column-gap: 6px; padding: 6px 8px 6px 28px; border-radius: var(--radius-sm); font-size: 13px; }
/* The trunk's segment through this row, and its lit part rising from the row's foot. */
.wt-realm::before, .wt-realm::after { content: ""; position: absolute; left: 11px; bottom: 0; width: 2px; border-radius: 1px; }
.wt-realm::before { top: 0; background: rgba(255, 255, 255, .07); }
.wt-realm::after {
  height: calc(100% * var(--lit)); transform-origin: bottom;
  background: linear-gradient(to top, color-mix(in oklab, var(--hi) 55%, transparent), var(--hi));
  box-shadow: 0 0 8px color-mix(in oklab, var(--hi) 50%, transparent);
  animation: wt-rise 380ms var(--ease) both; animation-delay: calc(var(--k) * 70ms + 120ms);
}
.wt-realm:first-child::before { top: var(--node); }
.wt-realm:first-child::after { max-height: calc(100% - var(--node)); }
@keyframes wt-rise { from { transform: scaleY(0); } }
.wt-numeral::before {
  content: ""; position: absolute; z-index: 1; top: var(--node); left: 12px; width: 7px; height: 7px; border-radius: 50%; translate: -50% -50%;
  background: #151515; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .16);
}
.wt-realm[data-state="passed"] .wt-numeral::before { background: color-mix(in oklab, var(--hi) 60%, #151515); box-shadow: 0 0 0 1.5px color-mix(in oklab, var(--hi) 80%, transparent); }
.wt-numeral { font-family: var(--serif); font-size: 13px; font-style: italic; font-weight: 600; color: var(--fg3); }
.wt-name { min-width: 0; font-weight: 500; color: var(--fg2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wt-from { font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--fg3); }
.wt-realm[data-state="ahead"] > * { opacity: .55; }
.wt-realm[data-state="ahead"]::after { height: calc((100% - var(--node)) * var(--lit)); }
.wt-realm[data-state="passed"] .wt-name { color: color-mix(in oklab, var(--own) 40%, var(--fg2)); }
.wt-realm[data-state="here"] {
  --node: 19px; margin: 2px 0; padding-block: 9px 10px;
  background: linear-gradient(90deg, color-mix(in oklab, var(--deep) 46%, transparent), color-mix(in oklab, var(--deep) 10%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--hi) 18%, transparent);
}
.wt-realm[data-state="here"] .wt-numeral { color: var(--hi); }
.wt-realm[data-state="here"] .wt-numeral::before { width: 11px; height: 11px; background: var(--hi); box-shadow: 0 0 0 3px color-mix(in oklab, var(--hi) 25%, transparent), 0 0 14px var(--hi); }
.wt-realm[data-state="here"] .wt-name { font-size: 16px; font-weight: 400; letter-spacing: .16em; text-transform: uppercase; color: var(--hi); text-shadow: 0 0 18px color-mix(in oklab, var(--hi) 40%, transparent); }
.wt-realm[data-state="here"] .wt-from { color: color-mix(in oklab, var(--hi) 55%, var(--fg3)); }
.wt-detail { grid-column: 2 / -1; display: flex; flex-direction: column; gap: 3px; margin-top: 3px; }
.wt-epithet { font-family: var(--serif); font-size: 16px; font-style: italic; font-weight: 500; color: color-mix(in oklab, var(--hi) 62%, var(--fg2)); }
.wt-next { font-size: 12px; color: var(--fg2); }
.realm-tag { letter-spacing: .18em; text-transform: uppercase; font-size: .86em; }
@media (prefers-reduced-motion: reduce) { .wt-realm::after { animation: none; } }

/* ---------- Stats tab (Yggdrasil's StatsScreen) ---------- */

.st-hero { display: grid; gap: 6px; }
.st-total { font-size: clamp(34px, 5vw, 52px); font-weight: 600; letter-spacing: -.045em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.st-controls { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 8px; }
.st-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.st-tile { display: grid; gap: 3px; align-content: start; min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface, rgba(255, 255, 255, .03)); }
.st-label { color: var(--fg3); font-size: 12px; }
.st-value { font-size: 24px; font-weight: 600; letter-spacing: -.035em; line-height: 1.2; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-note { color: var(--fg2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-block { display: grid; gap: 14px; min-width: 0; }
.st-legend { display: flex; gap: 14px; color: var(--fg3); font-size: 12px; }
.st-key::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 2px; background: var(--fg); }
.st-key.movies::before { background: var(--info); }
.st-timeline .column { border: 0; background: none; color: inherit; padding-top: 0; padding-inline: 0; }
.st-timeline button.column:hover { background: rgba(255, 255, 255, .05); }
.st-stack { display: flex; flex-direction: column-reverse; width: min(64%, 34px); min-height: 2px; border-radius: 5px 5px 0 0; overflow: hidden; background: var(--line-2); }
.st-stack .shows { background: var(--fg); }
.st-stack .movies { background: var(--info); }
.st-clock { display: grid; grid-template-columns: 34px repeat(24, minmax(9px, 1fr)); gap: 3px; overflow-x: auto; min-width: 0; }
.st-clock .cell { aspect-ratio: auto; height: clamp(10px, 1.4vw, 16px); border-radius: 3px; }
.st-day { color: var(--fg3); font-size: 11px; line-height: 1; align-self: center; }
.st-hour { color: var(--fg3); font-size: 10.5px; white-space: nowrap; }
.st-share-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px 32px; }
.st-shares h3 { margin-bottom: 12px; color: var(--fg2); font-size: 13px; font-weight: 600; }
.vs-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.vs-verdict { display: grid; gap: 2px; }
.vs-verdict strong { font-size: 26px; font-weight: 600; letter-spacing: -.035em; }
.vs-scores { display: flex; gap: 10px; }
.vs-score { display: grid; justify-items: center; gap: 2px; min-width: 76px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.vs-score strong { font-size: 26px; font-weight: 600; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.vs-score span { color: var(--fg3); font-size: 12px; }
.vs-score.mine { border-color: var(--line-3); }
.vs-split { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden; }
.vs-split .below, .st-key.below::before { background: var(--bad); }
.vs-split .same, .st-key.same::before { background: var(--line-3); }
.vs-split .above, .st-key.above::before { background: var(--good); }
.vs-sub { color: var(--fg2); font-size: 13px; font-weight: 600; }
.vs-gap { flex: none; min-width: 48px; text-align: right; font: 600 14px var(--mono); }
.vs-gap.above { color: var(--good); }
.vs-gap.below { color: var(--bad); }
.st-footnote { color: var(--fg3); font-size: 12.5px; }
@media (max-width: 640px) { .st-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Preferences from Settings (tracker/prefs.js) ---------- */
/* Compact posters: more to a row. */
.compact-posters .poster-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 16px 10px; }
.compact-posters .poster-grid.dense { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.compact-posters .rail { grid-auto-columns: 116px; gap: 10px; }
.compact-posters .poster-card .card-name { font-size: 12.5px; }
/* Hide spoilers: what you haven't watched yet stays blurred until you hover or focus it. */
.hide-spoilers .episode-row:not(.is-watched) .ep-still img,
.hide-spoilers .episode-card .episode-art img { filter: blur(16px) saturate(.6); transform: scale(1.1); }
.hide-spoilers .episode-row:not(.is-watched) .ep-overview,
.hide-spoilers .episode-row:not(.is-watched) .ep-title { filter: blur(5px); transition: filter 200ms; }
.hide-spoilers .episode-row:not(.is-watched):hover .ep-overview, .hide-spoilers .episode-row:not(.is-watched):hover .ep-title,
.hide-spoilers .episode-row:not(.is-watched):focus-within .ep-overview, .hide-spoilers .episode-row:not(.is-watched):focus-within .ep-title { filter: none; }
/* Reduced motion, chosen in Bifrost rather than the system. */
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }

/* ---------- Import from another tracker (importers/ui.js) ---------- */
.set-intro { padding: 14px 0 4px; color: var(--fg2); font-size: 13.5px; line-height: 1.5; }
.source-grid { display: grid; gap: 10px; padding: 10px 0 14px; }
.source-card { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 4px 14px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.source-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, rgba(92, 200, 255, .2), rgba(169, 139, 255, .14)); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--fg); font-size: 19px; font-weight: 700; letter-spacing: -.04em; }
.source-mark.has-logo { overflow: hidden; background: none; box-shadow: none; outline: 1px solid var(--line-2); outline-offset: -1px; }
.source-mark.has-logo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.source-text h3 { font-size: 15px; font-weight: 600; }
.source-text p { color: var(--fg2); font-size: 13px; }
.source-text .source-how { margin-top: 4px; color: var(--fg3); font-size: 12.5px; }
.source-card > .import-card { grid-column: 1 / -1; margin-top: 8px; }
.export-card { align-items: center; }
.export-card .source-mark .icon { width: 20px; height: 20px; color: var(--fg); }
.set-card > .import-card { margin: 0 0 12px; }
.import-progress { display: flex; align-items: center; gap: 10px; color: var(--fg2); font-size: 13.5px; }
.import-unmatched summary { cursor: pointer; color: var(--warn); font-size: 13px; }
.import-unmatched ul { max-height: 180px; margin: 8px 0 0; padding: 0 0 0 18px; overflow: auto; color: var(--fg2); font-size: 13px; }
@media (max-width: 640px) {
  .source-card { grid-template-columns: 40px minmax(0, 1fr); }
  .source-card > .file-button, .source-card > .button { grid-column: 1 / -1; justify-self: start; }
}

/* ---------- The intro (onboarding.js): full screen over the tracker, in the launch page's black and runes ---------- */
.intro-open { overflow: hidden; }
.intro { position: fixed; inset: 0; z-index: 80; display: grid; grid-template-rows: auto 1fr auto; padding: max(18px, env(safe-area-inset-top)) clamp(16px, 4vw, 48px) max(18px, env(safe-area-inset-bottom)); background: radial-gradient(120% 80% at 50% 110%, rgba(92, 200, 255, .1), transparent 60%), #000; overflow-y: auto; }
.intro-runes { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .75; }
.intro-top, .intro-stage, .intro-nav { position: relative; z-index: 1; }
.intro-top { display: flex; align-items: center; gap: 16px; }
.intro-progress { display: flex; flex: 1; gap: 6px; max-width: 520px; }
.intro-progress i { flex: 1; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .1); transition: background 400ms var(--ease); }
.intro-progress i.on { background: var(--spectrum); background-size: 600% 100%; }
.intro-progress i.on:nth-child(1) { background-position: 0 0; } .intro-progress i.on:nth-child(2) { background-position: 20% 0; }
.intro-progress i.on:nth-child(3) { background-position: 40% 0; } .intro-progress i.on:nth-child(4) { background-position: 60% 0; }
.intro-progress i.on:nth-child(5) { background-position: 80% 0; } .intro-progress i.on:nth-child(n+6) { background-position: 100% 0; }
.intro-skip { margin-left: auto; color: var(--fg3); font-size: 14px; }
.intro-stage { display: grid; place-items: center; padding: 28px 0; }
.intro-step { display: grid; justify-items: center; gap: 18px; width: min(720px, 100%); text-align: center; }
.intro-title { font-size: clamp(30px, 5vw, 52px); font-weight: 700; letter-spacing: -.05em; line-height: 1.02; text-wrap: balance; }
.intro-lede { max-width: 54ch; color: var(--fg2); font-size: clamp(15px, 1.6vw, 17.5px); line-height: 1.55; text-wrap: pretty; }
.intro-hint { min-height: 1.4em; color: var(--fg3); font-size: 13.5px; }
.intro-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: min(720px, 100%); margin: 0 auto; }
.intro-count { color: var(--fg3); font: 500 13px var(--mono); }
.intro-nav .button .icon { width: 16px; height: 16px; }
.button.large { height: 50px; padding: 0 24px; font-size: 15.5px; }
/* Welcome: the seal, turning slowly. */
.intro-seal { position: relative; display: grid; place-items: center; width: 168px; height: 168px; margin-bottom: 6px; }
.intro-seal-ring { position: absolute; inset: 0; display: grid; place-items: center; border: 1px solid rgba(244, 241, 238, .14); border-radius: 50%; color: var(--fg3); font: 13px var(--runic); letter-spacing: .5em; animation: intro-turn 40s linear infinite; mask: radial-gradient(circle, transparent 58%, #000 60%); }
.intro-seal-ring { background: conic-gradient(from 0deg, rgba(255, 107, 122, .14), rgba(255, 224, 138, .14), rgba(123, 216, 143, .14), rgba(92, 200, 255, .14), rgba(169, 139, 255, .14), rgba(255, 107, 122, .14)); }
@keyframes intro-turn { to { transform: rotate(360deg); } }
.intro-mark { width: 96px; height: 68px; filter: drop-shadow(0 0 18px rgba(92, 200, 255, .45)); }
/* Choice tiles and chips. */
.intro-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: 100%; }
.intro-tile { position: relative; display: grid; justify-items: start; align-content: start; gap: 6px; padding: 20px 18px; border: 1px solid var(--line-2); border-radius: var(--radius-lg); background: rgba(21, 21, 22, .8); color: var(--fg2); text-align: left; transition: border-color 200ms, background 200ms, color 200ms; }
.intro-tile > .icon { width: 26px; height: 26px; margin-bottom: 6px; color: var(--fg); }
.intro-tile b { color: var(--fg); font-size: 17px; font-weight: 600; }
.intro-tile small { font-size: 13px; }
.intro-tile:hover { border-color: var(--line-3); }
.intro-tile[aria-pressed="true"] { border-color: transparent; background: linear-gradient(rgba(21, 21, 22, .92), rgba(21, 21, 22, .92)) padding-box, var(--spectrum) border-box; border: 1.5px solid transparent; color: var(--fg); }
.intro-tick { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-3); }
.intro-tick .icon { width: 13px; height: 13px; opacity: 0; }
.intro-tile[aria-pressed="true"] .intro-tick { border-color: transparent; background: var(--fg); color: #000; }
.intro-tile[aria-pressed="true"] .intro-tick .icon { opacity: 1; }
.intro-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 640px; }
.intro-chip { height: 40px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(21, 21, 22, .8); color: var(--fg2); font-size: 14px; font-weight: 500; transition: background 180ms, color 180ms, border-color 180ms; }
.intro-chip:hover { color: var(--fg); border-color: var(--line-3); }
.intro-chip[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); color: #000; }
/* Lists: import sources, points, steps, shortcuts. */
.intro-list { display: grid; gap: 8px; width: 100%; max-width: 560px; margin: 0; padding: 0; list-style: none; text-align: left; }
.intro-source { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--radius); background: rgba(21, 21, 22, .8); color: var(--fg); text-align: left; transition: border-color 180ms, background 180ms; }
.intro-source:hover { border-color: var(--line-3); background: rgba(33, 33, 35, .9); }
.intro-source > span:nth-child(2) { display: grid; flex: 1; min-width: 0; }
.intro-source small { color: var(--fg3); font-size: 12.5px; }
.intro-source > .icon { width: 16px; height: 16px; color: var(--fg3); }
.intro-source .source-mark { width: 38px; height: 38px; font-size: 16px; }
.intro-fresh { color: var(--fg2); font-size: 14px; }
.intro-points li, .intro-numbered li, .intro-keys li { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(21, 21, 22, .8); color: var(--fg2); line-height: 1.45; }
.intro-points .icon { width: 22px; height: 22px; flex: none; color: #ffe08a; }
.intro-points b, .intro-numbered b { color: var(--fg); }
.intro-num { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--fg); color: #000; font-weight: 700; font-size: 14px; }
.intro-keys li { justify-content: space-between; }
.intro-keys .set-kbd { order: 2; }
.intro-app-icon { display: grid; place-items: center; width: 92px; height: 92px; border-radius: 24px; background: #000; box-shadow: 0 0 0 1px var(--line-3), 0 20px 50px -10px rgba(92, 200, 255, .4); }
.intro-app-icon .intro-mark { width: 64px; height: 46px; }
.intro-check { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: conic-gradient(#ff6b7a, #ffab5e, #ffe08a, #7bd88f, #5cc8ff, #a98bff, #ff6b7a); box-shadow: 0 0 60px -6px rgba(92, 200, 255, .55); }
.intro-check .icon { width: 36px; height: 36px; padding: 18px; box-sizing: content-box; border-radius: 50%; background: #000; color: var(--fg); stroke-width: 2.5; }
.intro-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
@media (max-width: 640px) {
  .intro-tiles { grid-template-columns: minmax(0, 1fr); }
  .intro-tile { grid-template-columns: auto 1fr; align-items: center; column-gap: 14px; padding: 16px; }
  .intro-tile > .icon { grid-row: span 2; margin: 0; }
  .intro-seal { width: 132px; height: 132px; }
  .intro-stage { place-items: start center; }
}

/* ---------- Friends ---------- */
/* The sidebar's Friends entry: a dot when friends watched something since your last look (requests get a count). */
.nav-dot { width: 7px; height: 7px; flex: none; margin-left: auto; border-radius: 50%; background: var(--info); box-shadow: 0 0 8px var(--info); }
.friend-add { display: grid; gap: 10px; max-width: 640px; }
.friend-search { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); color: var(--fg3); }
.friend-search:focus-within { border-color: var(--line-3); color: var(--fg); }
.friend-search input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: none; color: var(--fg); font-size: 15px; }
.friend-search input::placeholder { color: var(--fg3); }
.friend-search input::-webkit-search-cancel-button { filter: invert(1); opacity: .5; }
.friend-results:empty { display: none; }
.friend-results-note { padding: 2px 16px; white-space: normal; }
.friend-rows { padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.friend-rows .row { min-height: 56px; }
.friend-tools { display: flex; align-items: center; justify-content: end; gap: 6px; flex: none; flex-wrap: wrap; }
.friend-tools .button .icon { width: 15px; height: 15px; }
.offline-note { padding: 10px 14px; color: var(--fg2); font-size: 13px; }

.activity { gap: 26px; max-width: 760px; }
.activity-day { display: grid; gap: 6px; }
.activity-rows { padding: 0; }
.activity-row { align-items: center; padding: 8px 0; border-radius: 0; }
.activity-face { flex: none; border-radius: 50%; }
.activity-text { flex: 1; min-width: 0; color: var(--fg2); line-height: 1.45; overflow-wrap: anywhere; }
.activity-text strong { color: var(--fg); font-weight: 600; }
.activity-text a:hover strong { text-decoration: underline; text-decoration-color: var(--fg3); text-underline-offset: 3px; }
.activity-text time { display: inline; margin-left: 6px; color: var(--fg3); white-space: nowrap; }
.activity-poster { flex: none; border-radius: 7px; }

.friend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.friend-card { display: flex; align-items: center; gap: 6px; padding: 12px 8px 12px 14px; }
.friend-card-main { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.friend-card-main:hover .card-name { text-decoration: underline; text-decoration-color: var(--fg3); text-underline-offset: 3px; }

/* Someone else's profile: the page their app shared, in the profile's own layout. */
.profile-banner.banner-short { height: 250px; }
.profile-banner.banner-tall { height: 400px; }
.profile-bio { max-width: 62ch; color: var(--fg2); white-space: pre-line; overflow-wrap: anywhere; }
.user-page .head-actions .button .icon { width: 16px; height: 16px; }
.taste-list { display: grid; gap: 12px; max-width: 620px; margin: 0; padding: 0; list-style: none; }
.taste-list li { display: grid; grid-template-columns: minmax(90px, 170px) minmax(0, 1fr) 42px; align-items: center; gap: 14px; }
.taste-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.taste-list .bar { height: 6px; }
.taste-share { color: var(--fg2); text-align: right; }

/* On a title's page. */
.friends-watched { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; width: 100%; padding-top: 14px; border-top: 1px solid var(--line-2); }
.friends-watched-faces { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.friends-watched-faces a { border-radius: 50%; transition: transform 160ms var(--ease); }
.friends-watched-faces a:hover { transform: translateY(-2px); }
.comment-author { display: inline-flex; align-items: baseline; gap: 8px; min-width: 0; }
.comment-author:hover strong { text-decoration: underline; text-decoration-color: var(--fg3); text-underline-offset: 3px; }

.ask-body { margin-top: 10px; color: var(--fg2); line-height: 1.55; }

@media (max-width: 640px) {
  /* 16px, or iOS zooms the page when the box is tapped. */
  .friend-search input { font-size: 16px; }
  .friend-grid { grid-template-columns: minmax(0, 1fr); }
  .friend-rows .row { flex-wrap: wrap; row-gap: 6px; }
  .friend-rows .row-main { flex: 1 1 150px; }
  .profile-banner.banner-short { height: 190px; }
  .profile-banner.banner-tall { height: 260px; }
  .user-page .profile-head .head-actions { width: 100%; }
  .taste-list li { grid-template-columns: minmax(70px, 110px) minmax(0, 1fr) 40px; gap: 10px; }
  #ask-dialog .form-actions { flex-direction: column-reverse; }
  #ask-dialog .form-actions .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .friends-watched-faces a { transition: none; } }

/* ---------- Filter and sort (tracker/ui/refine.js) ---------- */

.refine-button { position: relative; }
.refine-button[aria-expanded="true"] { border-color: var(--line-3); background: var(--surface-3); color: var(--fg); }
.refine-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 2px; padding: 0 5px; border-radius: 999px; background: var(--fg); color: #000; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.refine-panel { display: grid; gap: 16px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: radial-gradient(120% 140% at 0% 0%, rgba(92, 200, 255, .06), transparent 55%), radial-gradient(120% 140% at 100% 100%, rgba(169, 139, 255, .05), transparent 55%), var(--surface);
  animation: refine-in 320ms var(--ease) both; }
.refine-group { display: grid; gap: 8px; align-content: start; }
.refine-row { display: flex; flex-wrap: wrap; gap: 18px 28px; }
.refine-label { color: var(--fg3); font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.refine-panel .chip-button { height: 30px; padding: 0 12px; font-size: 13px; }
.refine-panel .chip-button .icon.tiny { width: 13px; height: 13px; }
.refine-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
@keyframes refine-in { from { opacity: 0; transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .refine-panel { animation: none; } }
body.reduce-motion .refine-panel { animation: none; }

/* ---------- Recommended's hero: it turns through its picks ---------- */

.pick-hero { animation: hero-in 700ms var(--ease) both; }
.pick-hero .hero-backdrop img { animation: hero-art 1600ms var(--ease) both; }
.hero-dots { display: flex; gap: 6px; margin-top: 6px; }
.hero-dots button { position: relative; width: 22px; height: 16px; padding: 0; border: 0; background: none; transition: width 320ms var(--ease); }
.hero-dots button::before { content: ""; position: absolute; inset: 6px 0; border-radius: 4px; background: rgba(244, 241, 238, .22); transition: background 200ms; }
.hero-dots button:hover::before { background: rgba(244, 241, 238, .45); }
.hero-dots button[aria-pressed="true"] { width: 40px; }
.hero-dots button[aria-pressed="true"]::before { background: var(--spectrum); }
@keyframes hero-in { from { opacity: .35; } }
@keyframes hero-art { from { opacity: 0; transform: scale(1.04); } }
@media (prefers-reduced-motion: reduce) { .pick-hero, .pick-hero .hero-backdrop img { animation: none; } }
body.reduce-motion .pick-hero, body.reduce-motion .pick-hero .hero-backdrop img { animation: none; }

/* ---------- Images (tracker/ui/gallery.js) ---------- */

.gallery .chips { margin-bottom: 12px; }
.gallery-rail { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(240px, 26vw, 340px); gap: 12px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter) 6px; }
.gallery-rail::-webkit-scrollbar { display: none; }
.gallery-rail.is-posters { grid-auto-columns: clamp(120px, 12vw, 160px); }
.gallery-rail.is-logos { grid-auto-columns: clamp(180px, 18vw, 240px); }
.gallery-shot { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); transition: transform 320ms var(--ease), border-color 200ms; }
.gallery-shot.is-posters { aspect-ratio: 2 / 3; }
.gallery-shot.is-logos { aspect-ratio: 16 / 9; display: grid; place-items: center; padding: 18px; background: radial-gradient(circle at 50% 40%, #2a2a2e, #121214); }
.gallery-shot img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease); }
.gallery-shot.is-logos img { object-fit: contain; }
.gallery-shot:hover { border-color: var(--line-3); }
.gallery-shot:hover img { transform: scale(1.04); }
.gallery-shot.skeleton { cursor: default; }
.gallery-badge { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; background: rgba(0, 0, 0, .7); color: var(--fg); font-size: 11.5px; font-weight: 600; backdrop-filter: blur(6px); }

dialog.gallery-viewer { width: min(1200px, calc(100% - 24px)); max-width: none; padding: 0; overflow: hidden; background: rgba(10, 10, 11, .96); }
.gallery-viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.gv-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--line); }
.gv-count { color: var(--fg2); font-size: 13px; font-variant-numeric: tabular-nums; }
.gv-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 14px; }
.gv-stage img { max-width: 100%; max-height: calc(100dvh - 190px); border-radius: var(--radius-sm); object-fit: contain; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); animation: gv-in 360ms var(--ease) both; }
.gallery-viewer[data-kind="logos"] .gv-stage img { max-height: 40vh; padding: 24px; background: radial-gradient(circle, #2a2a2e, transparent 70%); box-shadow: none; }
.gv-step { position: absolute; top: 50%; display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line-2); border-radius: 50%; background: rgba(0, 0, 0, .55); color: var(--fg); transform: translateY(-50%); backdrop-filter: blur(6px); }
.gv-step:hover { background: rgba(30, 30, 32, .85); }
.gv-step:first-child { left: 22px; }
.gv-step:last-child { right: 22px; }
.gv-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.gv-note { display: inline-flex; align-items: center; gap: 6px; color: var(--fg2); font-size: 13px; }
@keyframes gv-in { from { opacity: 0; transform: scale(.985); } }

/* ---------- Your profile banner ---------- */

.banner-tools { position: absolute; right: var(--gutter); top: calc(var(--topbar) + 14px); z-index: 1; display: flex; align-items: center; gap: 10px; }
.banner-credit { color: rgba(244, 241, 238, .7); font-size: 12.5px; text-shadow: 0 1px 8px rgba(0, 0, 0, .8); }
.banner-credit:hover { color: var(--fg); }
.banner-change { background: rgba(0, 0, 0, .45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

dialog.banner-picker { width: min(760px, calc(100% - 24px)); }
.bp-lede { margin: 4px 0 16px; color: var(--fg2); font-size: 14px; }
.bp-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.bp-back .icon { width: 15px; height: 15px; }
.bp-auto { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--fg2); font-size: 13.5px; }
.bp-auto .icon { color: #ffe08a; }
.bp-current { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; align-items: center; gap: 14px; margin-bottom: 14px; padding: 10px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface-2); }
.bp-current img { width: 150px; aspect-ratio: 16 / 9; border-radius: 8px; object-fit: cover; }
.bp-current-text { display: grid; gap: 8px; justify-items: start; min-width: 0; }
.bp-current-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.bp-search { display: flex; align-items: center; gap: 10px; height: 40px; margin-bottom: 14px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); color: var(--fg3); }
.bp-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--fg); font: inherit; }
.bp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; max-height: min(52vh, 460px); overflow-y: auto; padding: 2px; }
.bp-title, .bp-art { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.bp-title img, .bp-art img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms var(--ease); }
.bp-title:hover img, .bp-art:hover img { transform: scale(1.05); }
.bp-title span { position: absolute; inset: auto 0 0; padding: 18px 10px 8px; background: linear-gradient(transparent, rgba(0, 0, 0, .85)); color: var(--fg); font-size: 12.5px; font-weight: 600; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-art[aria-pressed="true"] { border-color: transparent; box-shadow: 0 0 0 2px #5cc8ff, 0 0 18px rgba(92, 200, 255, .4); }
@media (max-width: 640px) {
  .banner-tools { top: calc(var(--topbar) + 10px); }
  .banner-credit { display: none; }
  .bp-current { grid-template-columns: 96px minmax(0, 1fr); }
  .bp-current img { width: 96px; }
  .bp-current > .button { grid-column: 1 / -1; justify-self: start; }
  .bp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gv-step { width: 36px; height: 36px; }
  .gv-step:first-child { left: 8px; }
  .gv-step:last-child { right: 8px; }
}
@media (prefers-reduced-motion: reduce) { .gv-stage img { animation: none; } }
body.reduce-motion .gv-stage img { animation: none; }

/* ---------- When you finished: the Completed dialog, and the log's "don't remember" ---------- */

.when-choice { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; }
.when-choice legend { margin-bottom: 8px; color: var(--fg2); font-size: 13px; font-weight: 500; }
.when-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.when-options label { position: relative; cursor: pointer; }
.when-options input { position: absolute; opacity: 0; pointer-events: none; }
.when-options span { display: grid; place-items: center; min-height: 40px; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); color: var(--fg2); font-size: 13px; font-weight: 500; text-align: center; transition: border-color 200ms, background 200ms, color 200ms; }
.when-options label:hover span { border-color: var(--line-3); color: var(--fg); }
.when-options input:checked + span { border-color: transparent; background: linear-gradient(#16161a, #16161a) padding-box, var(--spectrum) border-box; border: 1px solid transparent; color: var(--fg); }
.when-options input:focus-visible + span { outline: 2px solid var(--fg); outline-offset: 2px; }
.form .check-row { display: flex; align-items: center; gap: 10px; color: var(--fg2); font-size: 14px; cursor: pointer; }
.form .check-row input { flex: none; width: 16px; height: 16px; padding: 0; accent-color: #5cc8ff; }
.form .when-options label { display: block; }
.form .when-options input { width: auto; }
#log-when[aria-disabled="true"] { opacity: .4; }
@media (max-width: 420px) { .when-options { grid-template-columns: minmax(0, 1fr); } }
