/*
 * Bifrost tracker. A Trakt-style app shell (sidebar, rails, dense grids) in Bifrost's own palette:
 * near-black surfaces, warm white ink, artwork doing the colour, and the spectrum kept for progress and what's yours.
 */
:root {
  color-scheme: dark;
  --bg: #09090b;
  --sidebar-bg: #0c0c0f;
  --surface: #121215;
  --surface-2: #19191d;
  --surface-3: #222227;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --line-3: rgba(255, 255, 255, 0.2);
  --fg: #ededed;
  --fg2: #a3a3ab;
  --fg3: #6c6c75;
  --spectrum: linear-gradient(90deg, #ff6b7a, #ffab5e 22%, #ffe08a 42%, #7bd88f 60%, #5cc8ff 80%, #a98bff);
  --good: #7bd88f;
  --warn: #ffc56b;
  --bad: #ff7a85;
  --info: #9db8ff;
  --heat-0: #1a1a1e;
  --heat-1: #3a3a40;
  --heat-2: #6e6e75;
  --heat-3: #a8a8ae;
  --heat-4: #ededed;
  --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;
}
.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; }

/* ---------- 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: 700; letter-spacing: -.04em; 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); }

/* ---------- 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(9, 9, 11, .82); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
body[data-page="title"] .topbar, body[data-page="profile"] .topbar { background: linear-gradient(rgba(9, 9, 11, .7), rgba(9, 9, 11, 0)); border-bottom-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.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: 19px; font-weight: 700; 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: var(--surface); }
.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 { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.card.pad { padding: 20px; display: grid; gap: 14px; align-content: start; }
.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: 17px; font-weight: 600; letter-spacing: -.025em; }
.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; flex: none; height: 22px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--fg2); font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.status-watching, .status-repeating { color: var(--info); border-color: rgba(157, 184, 255, .3); }
.status-completed { color: var(--good); border-color: rgba(123, 216, 143, .3); }
.status-paused { color: var(--warn); border-color: rgba(255, 197, 107, .3); }
.status-dropped { color: var(--bad); border-color: rgba(255, 122, 133, .3); }
.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); }
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; }
.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: var(--surface-3); color: var(--fg); }
.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-3); color: var(--fg2); font: 500 12px var(--mono); transition: background 140ms, color 140ms, border-color 140ms; }
button.square:hover { border-color: var(--line-3); color: var(--fg); }
.square.is-watched { background: rgba(255, 255, 255, .3); color: #fff; }
.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; }

.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: var(--bad); stroke: var(--bad); vertical-align: -1px; }

.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; }
.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 { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.streak:hover { border-color: var(--line-3); }
.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; overflow: hidden; display: grid; gap: 14px; justify-items: start; padding: clamp(28px, 5vw, 64px); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.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 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.stat-row.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stat { display: grid; gap: 2px; padding: 16px 18px; min-width: 0; }
.stat + .stat { border-left: 1px solid var(--line); }
.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: 1px 2px; border-radius: 0 0 5px 5px; background: rgba(0, 0, 0, .75); font-size: 8.5px; font-style: normal; text-align: center; overflow: hidden; white-space: nowrap; }
.cal-more { grid-column: 1 / -1; color: var(--fg3); font-size: 11.5px; }
.cal-agenda { display: grid; gap: 14px; }
.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: 6px; list-style: none; }
.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; }
.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-card { position: relative; isolation: isolate; overflow: hidden; display: grid; gap: 16px; padding: 20px; align-content: start; }
.progress-glow { position: absolute; inset: 0 0 auto; height: 160px; z-index: -1; opacity: .28; }
.progress-glow img { width: 100%; height: 100%; object-fit: cover; filter: blur(30px) saturate(1.3); transform: scale(1.2); }
.progress-glow::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent, var(--surface)); }
.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; padding-top: 14px; border-top: 1px solid var(--line); }
.progress-foot .card-meta { white-space: normal; }

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

.title-hero, .profile-banner { position: relative; isolation: isolate; margin-top: calc(-1 * var(--topbar)); }
.title-hero { min-height: 560px; display: flex; align-items: end; }
.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(9, 9, 11, .95) 0%, rgba(9, 9, 11, .7) 45%, rgba(9, 9, 11, .2) 100%), linear-gradient(0deg, var(--bg) 2%, transparent 50%, rgba(9, 9, 11, .5) 100%); }
.title-hero-inner { display: flex; gap: clamp(20px, 3vw, 44px); align-items: end; width: 100%; max-width: 1680px; margin: 0 auto; padding: calc(var(--topbar) + 60px) var(--gutter) 28px; }
.title-poster-wrap { flex: none; }
.title-poster { width: clamp(150px, 16vw, 240px); 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: 12px; min-width: 0; justify-items: start; }
.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; }
.title-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.status-select { position: relative; display: inline-flex; align-items: center; }
.status-select select { appearance: none; height: 46px; padding: 0 40px 0 18px; border-radius: 999px; border-color: rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .08); backdrop-filter: blur(10px); font-weight: 600; cursor: pointer; }
.status-select .icon { position: absolute; right: 14px; width: 16px; pointer-events: none; color: var(--fg2); }
.scores { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.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; }
.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 { padding: 18px; 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; text-align: center; min-width: 0; }
.person img, .person-initials { width: 92px; height: 92px; margin-bottom: 8px; border-radius: 50%; object-fit: cover; object-position: center 20%; 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(9, 9, 11, .35) 60%, rgba(9, 9, 11, .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(9, 9, 11, .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; overflow: hidden; transition: border-color 160ms; }
.list-card:hover { border-color: var(--line-3); }
.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: 14px 16px 16px; }
.list-card-text .card-meta { white-space: normal; }

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

.connect { display: grid; gap: 16px; padding: 22px; align-content: start; }
.connect-head { display: flex; gap: 14px; align-items: start; }
.connect-head h2, .settings-block h2 { font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.connect-head p, .settings-block 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; }
.key-form input { flex: 1; min-width: 0; height: 40px !important; border-radius: 999px !important; padding: 0 16px !important; }
.key-form .button { height: 40px; }
.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: 16px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface-2); }
.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 { display: grid; justify-items: start; gap: 14px; padding: 28px; border: 1px dashed var(--line-2); border-radius: var(--radius-lg); color: var(--fg2); }

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

.menu { position: fixed; z-index: 60; top: 0; left: 0; min-width: 230px; padding: 6px; border: 1px solid var(--line-2); border-radius: 14px; background: rgba(26, 26, 30, .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-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(--bg); }
.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)); }
  .stat-row.six .stat:nth-child(4) { border-left: 0; }
  .stat-row.six .stat:nth-child(n+4) { border-top: 1px solid var(--line); }
  .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(9, 9, 11, .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(9, 9, 11, .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)); }
  .stat-row .stat:nth-child(3) { border-left: 0; }
  .stat-row .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .toast { bottom: 132px; }
  .dots { opacity: 1; }
  .cal-grid { gap: 3px; }
  .cal-dow { padding: 0 2px; font-size: 10px; text-align: center; }
  .cal-cell { min-height: 64px; padding: 5px 3px; border-radius: 8px; gap: 4px; }
  .cal-num { justify-content: center; font-size: 12px; }
  .cal-num b { display: none; }
  .cal-tiles { grid-template-columns: 1fr; }
  .cal-tile:nth-child(n+2) { display: none; }
  .cal-tile i { display: none; }
  .cal-more { text-align: center; font-size: 10px; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .title-hero-inner { flex-direction: column; align-items: start; padding-top: calc(var(--topbar) + 30px); }
  .title-poster { width: 130px; }
  .title-actions > .button.primary { width: 100%; }
  .title-actions .status-select { flex: 1; min-width: 0; }
  .title-actions .status-select select { width: 100%; }
  .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-row.six .stat { border-left: 0 !important; border-top: 0 !important; }
  .stat-row.six .stat:nth-child(even) { border-left: 1px solid var(--line) !important; }
  .stat-row.six .stat:nth-child(n+3) { border-top: 1px solid var(--line) !important; }
  .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; }
  .progress-card { padding: 16px; }
  .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; }
  .key-form { flex-wrap: wrap; }
  .key-form input { flex-basis: 100%; }
  .streak-bars { display: none; }
  .welcome { padding: 24px; }
}

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