:root {
  --app-scale: 1;
  color-scheme: dark;
  --page: #0a0a0c;
  --card: #131316;
  --surface: #1b1b20;
  --button: #27272e;
  --text: #e0e0e6;
  --secondary: #a1a1aa;
  --muted: #82828d;
  --line: rgba(255,255,255,.08);
  --strong-line: rgba(255,255,255,.16);
  --main-ink: #0a0a0c;
  --accent: #d6303c;
  --sync-pending: #fab219;
  --danger: #f95358;
  --scrim: rgba(0,0,0,.62);
  --artwork-scrim: rgba(10,10,12,.85);
  --poster-track: rgba(10,10,12,.90);
  --poster-edge: rgba(255,255,255,.07);
  font: 400 15px/1.5 "Segoe UI Variable Text","Segoe UI",system-ui,-apple-system,sans-serif;
  background: var(--page);
  color: var(--text);
}
/* Desktop uses the owner's preferred Chrome 125% size. CSS zoom scales
   viewport units too, so divide those lengths by the same factor. */
@media screen and (min-width: 900px) {
  :root { --app-scale: 1.25; zoom: var(--app-scale); }
}
:root[data-theme="light"] {
  color-scheme: light;
  --page: #f6f6f7;
  --card: #ffffff;
  --surface: #ececef;
  --button: #dfdfe4;
  --text: #0a0a0c;
  --secondary: #55555f;
  --muted: #6a6a74;
  --line: rgba(0,0,0,.08);
  --strong-line: rgba(0,0,0,.18);
  --main-ink: #f4f4f6;
  --danger: #c2142c;
  --sync-pending: #916300;
  --scrim: rgba(10,10,12,.45);
  --artwork-scrim: rgba(246,246,247,.85);
  --poster-track: rgba(246,246,247,.90);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, a { font: inherit; }
a { color: inherit; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 8px 16px; border: 0; border-radius: 10px; background: var(--button);
  color: var(--text); font-weight: 600; text-decoration: none; cursor: pointer;
}
@media (hover: hover) {
  button:hover:not(:disabled), .button:hover { text-decoration: underline; }
}
button:disabled { background: var(--surface); color: var(--muted); cursor: default; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
:root[data-mouse-input] :is(select,option,[aria-haspopup=menu],[role=menuitem]):focus { outline: none; }
:root[data-touch-input] :focus { outline: none; }
:root[data-touch-input] .segments input:focus-visible + span { outline: none; }
:root[data-touch-input] :is(input:not([type=range]),textarea,select):focus { border-color: var(--secondary); }
@media (any-pointer: coarse) {
  :where(a[href],button,summary,label) { -webkit-tap-highlight-color: transparent; }
  :where(a[href],button:enabled,summary):active { text-decoration: underline; }
}
.primary { background: var(--text); color: var(--main-ink); }
.destructive { color: var(--danger); }
[hidden] { display: none !important; }
.shell { min-height: calc(100vh / var(--app-scale)); display: grid; grid-template-columns: clamp(188px,calc(20vw / var(--app-scale)),260px) 1fr; }
.rail { padding: 34px 24px; border-right: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 24px; letter-spacing: -.06em; }
:is(.app-name, .rail .brand)::before { content: ""; width: 24px; height: 24px; flex: none; background: url("./favicon.svg") center / contain no-repeat; }
.rail nav { display: grid; gap: 2px; margin-top: 48px; }
.rail nav a { display: flex; align-items: center; min-height: 44px; padding: 8px; font-weight: 500; color: var(--secondary); text-decoration: none; }
.rail nav a:hover { color: var(--text); background: var(--surface); border-radius: 6px; }
main { width: min(100%, 764px); padding: 50px clamp(24px,calc(5vw / var(--app-scale)),72px) 64px; min-width: 0; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(32px,calc(4vw / var(--app-scale)),44px); line-height: 1.12; font-weight: 680; letter-spacing: -.045em; }
.group { scroll-margin-top: 18px; margin-top: 36px; }
.group > h2 { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-weight: 600; margin-bottom: 12px; }
.segments { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0,1fr); max-width: 28rem; padding: 3px; border-radius: 10px; background: var(--surface); }
.segments > label, .sheet .segments > label { position: relative; min-width: 0; margin: 0; }
.segments label > span { display: grid; place-items: center; min-height: 32px; padding: 4px; text-align: center; font-size: 13px; font-weight: 600; color: var(--secondary); border-radius: 8px; }
.segments label > input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; opacity: 0; cursor: pointer; }
.segments input:checked + span { color: var(--main-ink); background: var(--text); }
.segments input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }
.segments input:disabled { cursor: default; }
.appearance-error:empty { display: none; }
@media (forced-colors: active) {
  .segments input:checked + span { border: 2px solid Highlight; }
}
.key-row, .about { background: var(--card); border-radius: 10px; }
.key-row { display: flex; gap: 10px; align-items: center; padding: 16px; }
.key-row + .key-row { margin-top: 8px; }
.key-storage-note { margin: 8px 0 18px; font-size: 14px; color: var(--secondary); }
[data-page="dropbox-setup"] .key-storage-note { max-width: 70ch; }
.dropbox-settings.key-row { display: block; }
.dropbox-key-heading { display: flex; align-items: center; gap: 10px; }
.dropbox-required { display: inline-block; margin-inline-start: 8px; font-size: 12px; color: var(--secondary); }
.dropbox-key-heading [data-cloud-reason] { margin-inline-start: 8px; color: var(--danger); font-size: 13px; }
.dropbox-key-heading [data-synced="true"] { color: #74d99a; }
:root[data-theme="light"] .dropbox-key-heading [data-synced="true"] { color: #18683b; }
.dropbox-settings form { margin-top: 14px; }
.dropbox-settings label, .dropbox-settings input { display: block; }
.dropbox-settings input { margin-block: 6px; max-width: 30rem; min-height: 44px; padding: 8px 12px; font-size: 16px; color: var(--text); background: var(--page); border: 1px solid var(--strong-line); border-radius: 8px; }
.dropbox-settings code { overflow-wrap: anywhere; }
.dropbox-settings .actions > * { flex: 0 1 auto; }
.dropbox-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.dropbox-actions > .actions { display: contents; }
.dropbox-actions :is(button, .button) { padding-inline: 12px; }
.dropbox-settings [data-dropbox-feedback]:not(:empty), .dropbox-settings [data-sync-notices]:not(:empty), .dropbox-settings ul { margin-block: 10px 0; }
.dropbox-settings [data-sync-notices] { overflow-wrap: anywhere; }
.dropbox-settings ul { padding-inline-start: 20px; }
.imdb-settings-link, .mal-settings-link { color: var(--text); text-decoration: none; }
.imdb-settings-link > span, .mal-settings-link > span { font-size: 22px; color: var(--secondary); }
.rating-source-settings { max-width: 42rem; }
.rating-sources { border: 0; margin: 24px 0 0; padding: 0; min-width: 0; }
.rating-sources legend { font-weight: 600; margin-bottom: 10px; }
.rating-sources label { flex: 1; display: grid; grid-template-columns: 20px 1fr; column-gap: 10px; align-items: center; min-height: 44px; font-weight: 600; }
.rating-sources input { grid-column: 1; grid-row: 1 / span 2; accent-color: var(--text); width: 18px; height: 18px; }
.rating-sources small { grid-column: 2; font-weight: 400; color: var(--secondary); }
.rating-source-settings .group > p { margin-top: 12px; }
.job-file-copy { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.job-file-copy code { font-size: 12px; overflow-wrap: anywhere; }
.job-manual-copy { box-sizing: border-box; width: 100%; font: 1rem monospace; }
.key-symbol { width: 20px; height: 12px; position: relative; transform: rotate(-38deg); flex: none; }
.key-symbol::before { content: ""; position: absolute; left: 0; top: 0; width: 8px; height: 8px; border: 2px solid var(--text); border-radius: 50%; }
.key-symbol::after { content: ""; position: absolute; left: 11px; top: 5px; width: 9px; height: 4px; border-top: 2px solid var(--text); border-right: 2px solid var(--text); }
.key-copy { min-width: 0; flex: 1; }
.key-copy strong { font-weight: 600; }
.key-copy p, .about p, .secondary, .hint { color: var(--secondary); }
.key-copy p { font-size: 13px; overflow-wrap: anywhere; }
.settings-imports .actions { margin-top: 0; }
.settings-phone-export { margin-top: 8px; }
@media (min-width:900px) {
  .settings-phone-export { display: none; }
}
.offline-settings [data-offline-status] { margin-bottom: 10px; }
.offline-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.offline-actions a { padding: 8px; }
.offline-settings [data-device-result]:empty { display:none; }
.notification-log { max-width: 42rem; }
.notification-log summary { min-height: 44px; align-content: center; }
.notification-log ul { margin: 0; padding: 0; list-style: none; }
.notification-log li { display: grid; gap: .2rem; padding-block: .65rem; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.notification-log time, .notification-log p { color: var(--secondary); font-size: .85rem; }
.sheet .dropbox-reset-options { margin: 14px 0; padding: 0; border: 0; }
.sheet .dropbox-reset-options legend { color: var(--secondary); }
.sheet .dropbox-reset-options label { display:flex; align-items:center; gap:10px; margin:0; min-height:44px; font-size:1rem; }
.sheet .dropbox-reset-options input { width:18px; height:18px; min-height:0; margin:0; accent-color:var(--text); }
.help { background: transparent; padding: 0; min-width: 44px; }
.help span { display: grid; place-items: center; border: 1.5px solid var(--secondary); border-radius: 50%; width: 21px; height: 21px; font-size: 13px; color: var(--secondary); }
.notice { color: var(--secondary); margin-top: 16px; }
.notice:empty { display: none; }
.about { padding: 22px; }
.source-credits { margin-top: 24px; color: var(--secondary); font-size: .9rem; }
.notification-log summary, .source-credits summary { width: fit-content; padding-block: 12px; cursor: pointer; color: var(--secondary); font-size: .9rem; }
.source-credits img { display: block; width: 108px; height: auto; margin-block: 4px 12px; }
.source-credits p { margin-top: 12px; color: var(--secondary); }
dialog { color: var(--text); background: var(--card); width: min(390px,100%); max-width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 16px; max-height: calc(90vh / var(--app-scale)); max-height: calc(90dvh / var(--app-scale)); overflow: auto; }
dialog::backdrop { background: var(--scrim); }
.sheet { padding: 24px; }
.sheet h2 { font-size: 23px; letter-spacing: -.025em; line-height: 1.2; margin-bottom: 8px; }
.sheet label { display: block; margin: 20px 0 6px; font-size: 13px; font-weight: 600; }
.sheet :is(input,textarea) { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; background: var(--page); padding: 9px 12px; color: var(--text); font-size: 16px; }
.hint { font-size: 13px; margin-top: 8px; }
.feedback { margin-top: 10px; overflow-wrap: anywhere; }
.feedback:empty { display: none; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 22px; }
.actions > * { flex: 1; }
.steps { padding-left: 24px; margin: 18px 0 0; }
.steps li { padding: 7px 0 7px 4px; }
.steps li::marker { color: var(--secondary); font-variant-numeric: tabular-nums; }
.steps .help-instruction { display: block; text-wrap: balance; }
:is(.sheet, .dropbox-dialog, .recovery-screen) .actions { gap: 12px; margin: 24px 0 0; }
:is(.sheet, .dropbox-dialog, .recovery-screen) .actions > * { flex: 1 1 auto; }
.dropbox-dialog .actions:empty { display: none; }
.clear-device-review p + p { margin-top: 12px; }
.steps a { display: block; padding: 4px 0; color: var(--secondary); font-size: 13px; overflow-wrap: anywhere; }
.tmdb-state { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.skeleton { display: grid; width: min(320px,100%); grid-template-columns: 46px 1fr; grid-template-rows: 12px 12px; align-content: center; gap: 8px 12px; }
.skeleton i { display: block; background: var(--surface); border-radius: 4px; }
.skeleton i:first-child { grid-row: span 2; }
.skeleton i:last-child { width: 60%; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width:899px) {
  .shell { display: block; }
  .rail { padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { font-size: 20px; }
  .rail nav { display: none; }
  main { padding: 24px 16px 48px; margin: 0 auto; }
  .group { margin-top: 26px; }
  .key-row { padding: 12px; gap: 6px; }
  .dropbox-key-heading { gap: 6px; }
  .about { padding: 16px; }
  dialog { margin: auto auto 0; width: 100%; border-radius: 16px 16px 0 0; }
  .sheet { padding: 20px 16px max(24px, env(safe-area-inset-bottom)); }
}

.recovery-screen { max-width: 44rem; }
.recovery-screen p { margin: .65rem 0; }
.recovery-screen h2, .recovery-screen h3 { margin: 1.5rem 0 .5rem; }
.recovery-screen input[type=file] { display: block; max-width: 100%; margin: .5rem 0; }
.recovery-screen [data-folders] button { display: block; max-width: 100%; text-align: start; margin-block: .4rem; overflow-wrap: anywhere; }
.recovery-screen fieldset { min-width: 0; padding: .8rem 1rem; margin: 1.25rem 0 .75rem; border: 1px solid var(--line); border-radius: 8px; }
.recovery-screen legend { max-width: 100%; overflow-wrap: anywhere; }
.recovery-screen fieldset label { display: flex; align-items: center; min-height: 44px; gap: .5rem; }
.recovery-screen [data-result] { white-space: pre-line; }
.recovery-screen [data-erase] { margin-top: 1.75rem; }
.recovery-downloads { display: flex; flex-wrap: wrap; gap: .5rem; margin-block: .8rem; }

.import-screen { max-width: 44rem; overflow-wrap: anywhere; }
.import-screen [data-select] > p, .import-screen [data-status] { margin-block: .75rem; color: var(--secondary); }
.import-screen [data-select] label { display: block; margin-block: 1.5rem; font-weight: 600; }
.import-screen input[type=file] { display: block; width: 100%; margin-top: .5rem; font-weight: 400; }
.import-screen input::file-selector-button {
  margin-inline-end: .6rem; padding: .65rem 1rem; min-height: 44px; border: 0; border-radius: 8px;
  font: inherit; background: var(--button); color: var(--text); cursor: pointer;
}
.import-totals { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .55rem; margin: 1.25rem 0 1.75rem; }
@media (min-width:900px) {
  .import-totals { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
.import-totals div { border-radius: 10px; padding: .85rem 1rem; background: var(--card); }
.import-totals dt, .import-count p { color: var(--secondary); font-size: .9rem; }
.import-totals dd { margin: .35rem 0 0; font-size: 1.65rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.import-screen section h2 { font-size: 1.25rem; margin: 1.5rem 0 .5rem; }
.import-screen details { border-bottom: 1px solid var(--line); padding-block: .15rem; }
.import-screen summary { cursor: pointer; padding: .7rem .1rem; font-weight: 600; }
.import-screen details ul, .dropbox-dialog details ul { padding-inline-start: 1.4rem; overflow-wrap: anywhere; }
.import-screen details li, .dropbox-dialog details li { margin-block: .35rem; }
.anilist-import details li a { display: inline-block; padding-block: .5rem; }
.import-screen .import-count { margin-block: .5rem; padding: 0 .85rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
@supports (contain-intrinsic-block-size: auto 5.75rem) {
  .import-screen .import-count:nth-of-type(n+51) { content-visibility: auto; contain-intrinsic-block-size: auto 5.75rem; }
}
.count-notices { margin: 0; padding: .5rem 0 .75rem 1.15rem; color: var(--secondary); font-size: .9rem; overflow-wrap: anywhere; }
.count-header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding-block: .55rem; }
.count-header [data-count-summary] { display: grid; grid-template-columns: auto minmax(0,1fr); gap: .2rem .35rem; align-content: center; flex: 1; min-width: 0; min-height: 44px; padding: .25rem 0; background: transparent; text-align: left; overflow-wrap: anywhere; }
.count-header [data-count-summary]::before { content: '▸'; grid-row: 1 / 3; }
.count-header [data-count-summary][aria-expanded=true]::before { content: '▾'; }
.count-whole { align-self: flex-start; text-align: center; }
.count-whole small { display: block; color: var(--secondary); margin-bottom: .15rem; }
.import-count .count-gap, .count-season small { display: block; color: var(--secondary); font-size: .85rem; font-weight: 400; }
.count-season { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem .75rem; padding-block: .65rem; border-top: 1px solid var(--line); }
.count-stepper { display: flex; gap: .4rem; align-items: center; font-variant-numeric: tabular-nums; }
.count-stepper button { width: 44px; padding-inline: 0; font-size: 1.25rem; }
.count-stepper > span { min-width: 2.25rem; max-width: 7rem; overflow-wrap: anywhere; text-align: center; }

#app:has(> p[role="status"]) {
  padding: 16px max(16px, env(safe-area-inset-right)) 16px max(16px, env(safe-area-inset-left));
}
.startup-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.app-frame { --sidebar-width: 196px; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: calc(100vh / var(--app-scale)); }
[data-page="dropbox-setup"] .app-frame { display: block; }
[data-page="dropbox-setup"] :is(.app-sidebar,.phone-header,.phone-nav) { display: none; }
[data-page="dropbox-setup"] .app-column main { max-width: 46rem; }
.app-sidebar { position: sticky; top: 0; height: calc(100vh / var(--app-scale)); height: calc(100dvh / var(--app-scale)); overflow-y: auto; display: flex; flex-direction: column; padding: 26px 12px 18px; border-right: 1px solid var(--line); background: var(--card); }
.app-name { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 18px; letter-spacing: -.025em; text-decoration: none; }
.app-sidebar .app-name { padding: 0 12px; margin-bottom: 26px; }
.app-sidebar nav { display: grid; gap: 4px; }
.app-sidebar nav a, .phone-nav a { text-decoration: none; display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 8px 12px; border-radius: 10px; color: var(--secondary); font-size: 14px; font-weight: 500; }
.app-sidebar nav a:hover, .app-sidebar nav a[aria-current] { background: var(--button); color: var(--text); }
.sync-state { display: inline-flex; gap: 6px; align-items: center; color: var(--secondary); font-size: 12px; }
.sync-state::before { content: ""; display: inline-block; width: 6px; height: 6px; background:var(--sync-pending); border-radius: 50%; }
.cloud-status { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.app-sidebar .cloud-status { margin:auto 12px 0; }
.cloud-status button { padding:3px 6px; min-height:32px; font-size:12px; }
.sync-state { text-decoration:none; white-space:nowrap; }
.sync-state[data-synced=true]::before { background:#0ca30c; }
.dropbox-message { white-space:pre-wrap; overflow-wrap:anywhere; }
.dropbox-dialog { width:min(32rem,calc(100% - 24px)); max-height:calc(85vh / var(--app-scale)); overflow:auto; overflow-wrap:anywhere; padding:20px; }
.dropbox-dialog fieldset { border:1px solid var(--line); margin:8px 0; min-width:0; }
.delivery-season { padding-block:.6rem; border-block-start:1px solid var(--line); }
.delivery-season > select { margin-top:.4rem; }
.dropbox-dialog label, .dropbox-settings label { display:block; }
.dropbox-dialog input:not([type=radio]), .dropbox-settings input { width:100%; }
.dropbox-settings > form .actions { margin-block:12px; }
.dropbox-dialog > h2 { margin-bottom:8px; }
.dropbox-settings p { overflow-wrap:anywhere; }
.group [data-copy]:has(a[download]) { display:flex; flex-wrap:wrap; gap:8px; margin-block:12px; }
.group [data-copy] p { width:100%; }
.phone-header, .phone-nav { display: none; }
.app-column { min-width: 0; }
.app-column main { width: min(100%, 1120px); margin: 0 auto; padding: 28px 28px 84px; }
.desktop-back { gap: 2px; margin-bottom: 8px; padding-inline: 0 10px; background: transparent; }
.desktop-back + .group { margin-top: 0; }
:where(.app-column main) h1 { font-size: 28px; }
/* Navigation focuses the screen so Tab continues in the new page. */
#screen:focus { outline: none; }
.app-sidebar { overflow-y: auto; }
.tab-state, .reports { max-width: 1120px; margin: 0 auto; }
.tab-status-area { position: sticky; top: 0; z-index: 2; pointer-events: none; }
.tab-state:not(:empty) { pointer-events: auto; }
html:has(.tab-state:not(:empty)) { scroll-padding-top: 3rem; }
.tab-state:empty, .reports:empty { display: none; }
.tab-state:not(:empty), .report { background: var(--surface); padding: 10px 20px; font-size: 13px; }
.report { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.report > span, .report > details { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.report details[open] { flex-basis: 100%; }
.report details ul, [data-sync-notices] ul { max-height: 18rem; overflow: auto; padding-inline-start: 1.5rem; }
.report summary, [data-sync-notices] summary { cursor: pointer; }
.report button, .undo-bar button { font-size: 13px; min-height: 34px; padding: 5px 10px; }
.skip-link { position: fixed; top: -100px; left: 10px; padding: 10px; background: var(--button); z-index: 5; }
.skip-link:focus { top: 8px; }
.undo-bar { position: fixed; z-index: 4; left: calc(50% + var(--sidebar-width) / 2); transform: translateX(-50%); bottom: 12px; width: min(366px, calc(100% - 24px)); min-height: 48px; padding: 6px 10px 6px 14px; display: flex; align-items: center; gap: 6px; border-radius: 10px; background: var(--button); }
.undo-bar span { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14px; line-height: 1.3; max-height: 4em; overflow: auto; }
.undo-bar button { padding-inline: 8px; background: transparent; }
.undo-bar [data-undo] { font-weight: 700; }
.remove-question .sheet { overflow-wrap: anywhere; }
@media (max-width: 899px) {
  html { scroll-padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  html:has(.undo-bar:not([hidden])) { scroll-padding-bottom: calc(140px + env(safe-area-inset-bottom)); }
  .phone-nav a:focus-visible { outline-offset: -2px; }
  .app-frame { display: block; }
  .app-sidebar { display: none; }
  .desktop-back { display: none; }
  .app-column main { padding: 20px 16px calc(142px + env(safe-area-inset-bottom)); }
  .phone-header { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px; border-bottom: 1px solid var(--line); }
  .phone-title { font-size: 28px; font-weight: 700; letter-spacing: -.04em; }
  .app-column .statistics-screen h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .phone-header .cloud-status { margin-left:auto; justify-content:flex-end; gap:4px; }
  .settings-shortcut, .phone-back { display: inline-flex; min-width: 44px; min-height: 44px; padding: 0; align-items: center; justify-content: center; background: transparent; gap: 2px; }
  .phone-back:not([hidden]) + .app-name { display: none; }
  .phone-nav { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); position: fixed; z-index: 3; bottom: 0; left: 0; width: 100%; padding-bottom: env(safe-area-inset-bottom); background: var(--card); border-top: 1px solid var(--line); }
  .phone-nav a { min-width: 0; flex-direction: column; justify-content: center; gap: 3px; min-height: 64px; padding: 4px 2px; font-size: 11px; }
  .phone-nav a[aria-current] { color: var(--text); }
  .app-frame .undo-bar { left: 12px; right: 12px; width: auto; transform: none; bottom: calc(76px + env(safe-area-inset-bottom)); }
}

.home-screen, .search-screen { min-width: 0; }
.screen-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-width: 0; }
.screen-heading h1 { margin: 0; }
.screen-heading > h1, .screen-heading > .library-heading { margin-inline-end: auto; }
.screen-heading > form, .screen-heading > .tv-search-field { flex: 1 1 10rem; min-width: 0; max-width: 28rem; }
.tv-search-field { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--secondary); }
.home-search { padding-inline-start: 0; gap: 0; }
.home-search-submit { order: -1; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; background: transparent; color: inherit; }
.tv-search-field:focus-within { outline: 2px solid var(--text); outline-offset: 2px; }
:root[data-touch-input] .tv-search-field:focus-within { outline: none; border-color: var(--secondary); }
.tv-search-field input { flex: 1; min-width: 0; padding: 10px 0; height: 44px; color: var(--text); background: transparent; border: 0; outline: 0; font-size: 16px; }
.tv-search-field input::placeholder { color: var(--secondary); opacity: 1; }
.search-glass { flex: none; position: relative; width: 15px; height: 15px; margin-right: 4px; border: 1.7px solid currentColor; border-radius: 50%; }
.search-glass::after { content: ''; position: absolute; width: 8px; height: 1.7px; background: currentColor; transform: rotate(48deg); bottom: -3px; right: -6px; }
.tv-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin: 28px 0 12px; }
.tv-section-head h2, .home-screen .setup-card h2 { margin: 0; font-size: 20px; line-height: 1.25; font-weight: 650; letter-spacing: -.025em; }
.tv-section-head > span, .rail-count, .result-counts, .tv-note, .tv-empty { color: var(--secondary); }
.tv-section-head > span, .rail-count { font-size: 13px; }
.tv-section-head h2 a { display: inline-flex; gap: 6px; align-items: center; min-height: 44px; text-decoration: none; }
.tv-section-head h2 a:hover { text-decoration: underline; }
.tv-section-head h2 a span { color: var(--secondary); }
.home-screen .setup-card { margin-top: 18px; }
.home-screen .setup-card .actions { justify-content: flex-start; margin-top: 12px; }
.home-screen .setup-card .actions > * { flex: 0 1 auto; }
.tv-note { margin-top: 8px; font-size: 13px; }
.tv-note:empty { display: none; }
.tv-empty { padding: 12px 0; }
.poster-rail, .tv-results { margin: 0; padding: 0; list-style: none; }
.poster-rail { display: flex; gap: 12px; padding: 4px 4px 8px; margin: -4px -4px 0; overflow-x: auto; }
.poster-rail li { flex: 0 0 104px; width: 104px; }
.poster-rail [data-dismiss-recent] { display: none; }
@media (hover: hover) and (pointer: fine) {
  [data-recent] .poster-rail li { position: relative; }
  .poster-rail [data-dismiss-recent] {
    position: absolute; top: 4px; right: 4px; display: grid; place-items: center;
    width: 32px; height: 32px; min-height: 0; padding: 0; border-radius: 50%;
    background: rgba(10,10,12,.72); color: #fff; font: 400 22px/1 system-ui,sans-serif;
    opacity: 0; pointer-events: none;
  }
  .poster-rail li:hover [data-dismiss-recent], .poster-rail [data-dismiss-recent]:focus-visible {
    opacity: 1; pointer-events: auto; text-decoration: none;
  }
}
.rail-heading { display: flex; align-items: center; gap: 10px; }
.rail-heading > .rail-controls { flex: none; }
.tv-section-head.rail-heading > span { margin-left: auto; }
.rail-controls { display: flex; align-items: center; gap: 5px; }
.rail-controls button { display: grid; place-content: center; min-height: 36px; min-width: 36px; padding: 0; font-size: 22px; line-height: 1; }
.rail-controls button[aria-disabled=true] { opacity: .45; cursor: default; }
.poster-rail a, .result-link { display: block; text-decoration: none; color: var(--text); border-radius: 7px; }
.poster-rail strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin-top: 6px; font-size: 14px; font-weight: 600; }
.tv-poster { position: relative; display: block; width: 100%; aspect-ratio: 2 / 3; background: var(--surface); border-radius: 7px; overflow: hidden; }
.tv-poster img { width: 100%; height: 100%; display: block; object-fit: cover; }
.tv-poster::after { content: ""; position: absolute; inset: 0; border: 1px solid var(--poster-edge); border-radius: inherit; pointer-events: none; }
.tv-poster progress { position: absolute; bottom: 0; display: block; width: 100%; height: 3px; border: 0; appearance: none; color: var(--accent); background: var(--poster-track); }
.tv-poster progress::-webkit-progress-bar { background: transparent; }
.tv-poster progress::-webkit-progress-value { background: var(--accent); }
.tv-poster progress::-moz-progress-bar { background: var(--accent); }
.record-totals { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin: 0; }
.record-totals div { border-radius: 10px; padding: 14px; background: var(--card); min-width: 0; }
.record-totals dt { display: flex; gap: 6px; align-items: center; color: var(--secondary); font-size: 13px; }
.record-totals svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.record-totals dd { margin: 5px 0 0; font-size: clamp(21px,calc(3vw / var(--app-scale)),30px); line-height: 1.18; overflow-wrap: anywhere; letter-spacing: -.03em; font-weight: 650; font-variant-numeric: tabular-nums; }
.tv-results li { position: relative; padding: 13px 0 13px 72px; border-bottom: 1px solid var(--line); min-height: 116px; }
.result-link { display: block; }
.result-link .tv-poster { position: absolute; left: 0; top: 13px; width: 60px; }
.result-link > span:last-child { overflow-wrap: anywhere; }
.result-link strong { display: block; font-size: 16px; font-weight: 620; line-height: 1.35; }
.result-link:hover strong, .poster-rail a:hover strong { text-decoration: underline; }
.result-counts { display: block; min-height: 1lh; margin-top: 3px; font-size: 13px; }
.critic-marks {
  --score-red: #f5452a;
  --score-green: #0ca30c;
  --score-yellow: #fab219;
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text);
}
.outside-scores { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.result-scores { display: flex; align-items: flex-start; min-height: 22px; margin-top: 5px; }
.imdb-score { display: inline-flex; align-items: center; gap: 3px; color: var(--text); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.imdb-score svg { width: 14px; height: 14px; fill: #fab219; }
.myanimelist-score { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 5px; border-radius: 6px; background: #4169c8; color: #fff; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tomatoes-score { display: inline-flex; align-items: center; gap: 4px; }
.tomatoes-score svg { width: 16px; height: 16px; }
.tomatoes-score .score-red { fill: var(--score-red); }
.tomatoes-score .score-green { fill: var(--score-green); }
.metacritic-score { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 4px; border-radius: 6px; color: #0a0a0c; }
.metacritic-score[data-band="green"] { background: var(--score-green); }
.metacritic-score[data-band="yellow"] { background: var(--score-yellow); }
.metacritic-score[data-band="red"] { background: var(--score-red); }
.complete-tick { color: var(--text); margin-right: 4px; }
.result-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.result-actions button { padding: 5px 12px; min-height: 34px; font-size: 13px; }
.result-actions button[aria-disabled="true"]:not(:disabled) { cursor: wait; opacity: .65; }
.search-screen [data-state]:not(:empty), .search-screen .next-results { margin-top: 16px; }
.next-results[hidden] { display: none; }
@media (min-width:900px) {
  .poster-rail li { flex-basis: 122px; width: 122px; }
}
@media (max-width:899px) {
}
@media (max-width:550px) {
  .record-totals { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

.show-page {
  display: grid;
  gap: 26px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.show-page h2 { margin: 0 0 12px; font-size: 20px; line-height: 1.2; letter-spacing: -.025em; }
.show-page > :empty, .show-columns > :empty { display: none; }
.show-page .show-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: end;
  grid-template: "poster title" auto "actions actions" auto "stats stats" auto / minmax(72px, 100px) minmax(0, 1fr);
  gap: 14px;
  padding-top: 68px;
}
.show-page .show-hero:empty { display: none; }
.show-page .show-hero.no-detail { display: block; padding: 0; }
.show-page .show-art {
  display: block;
  overflow: hidden;
  background: var(--surface);
  border-radius: 8px;
}
.show-art img { display: block; height: 100%; width: 100%; object-fit: cover; }
.show-art-poster { width: 100%; aspect-ratio: 2 / 3; }
.show-hero > .show-art-poster { grid-area: poster; align-self: end; }
.show-page .show-hero > .show-art-backdrop {
  position: absolute;
  z-index: -1;
  inset: 0 -16px;
  border-radius: 0;
  background: linear-gradient(to bottom, var(--surface), var(--page) 90%);
}
.show-art-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent, var(--artwork-scrim) 66px, var(--page) 88%);
}
.show-title-block { grid-area: title; min-width: 0; }
.show-title-block h1 { font-size: 28px; }
.show-facts { color: var(--secondary); font-size: 14px; margin-top: 6px; }
.show-labels { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
@media (max-width:899px) {
  .show-labels .outside-scores { flex-basis: 100%; }
}
.show-list-tag { border-radius: 20px; background: var(--button); color: var(--text); padding: 2px 9px; font-size: 12px; }
.show-rating { border: 0; background: transparent; min-height: 36px; padding: 4px 0; font-weight: 600; font-size: 15px; }
.show-rating:not(:has(small)) { color: var(--secondary); }
.show-rating small { color: var(--secondary); font-weight: 500; }
.show-actions button[aria-disabled="true"] { opacity: .55; cursor: default; }
.show-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; grid-area: actions; }
.show-actions:empty { display: none; }
.show-actions > .primary { flex: 1; }
.show-actions .show-more {
  position: absolute; inset: 8px 0 auto auto; padding: 0; min-height: 32px; min-width: 40px;
  border-radius: 999px; background: var(--artwork-scrim); letter-spacing: .07em;
}
.show-actions .show-more:focus-visible { outline-offset: -3px; }
.show-stats { display: grid; grid-area: stats; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.show-stat { display: grid; align-content: start; gap: 3px; background: var(--card); border-radius: 10px; padding: 11px 13px; }
.show-stat > span { color: var(--secondary); font-size: 12px; }
.show-stat > strong { font-size: 20px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.show-stat small { color: var(--secondary); font-size: 13px; font-weight: 500; }
.show-overview p { color: var(--secondary); max-width: 80ch; }
.show-columns, .show-extras {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  gap: 26px;
  min-width: 0;
}
.show-columns > * { min-width: 0; }
.show-seasons { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,17rem),1fr)); gap: 8px 12px; }
.show-seasons > :is(h2,p) { grid-column: 1 / -1; margin: 0; }
.season-order-form label { display: grid; gap: 5px; }
.season-order-form select { min-height:44px; font:inherit; color:var(--text); border:1px solid var(--line); background:var(--card); border-radius:8px; padding:4px 8px; }
.season-order-breaks label + label { margin-top:10px; }
.show-season-tile {
  position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center;
  gap: 4px; padding: 2px 8px; background: var(--card); border-radius: 10px; min-width: 0;
}
.show-seasons .show-season-row {
  display: flex; min-width: 0; align-self: stretch; align-items: center; text-align: left;
  gap: 8px; padding: 10px 4px; border-radius: 4px; min-height: 56px; text-decoration: none;
}
.show-season-row::after { content: ''; position: absolute; inset: 0; border-radius: 10px; }
.show-season-row:hover { background: var(--card); }
.show-season-row:is(:hover,:focus-visible) .show-season-title strong { text-decoration: underline; }
.show-season-controls { display: flex; align-items: center; }
.show-season-count, .show-season-add { position: relative; min-width: 44px; min-height: 44px; padding: 0; background: transparent; }
.show-season-add { display: grid; place-items: center; }
.show-season-controls .show-season-add:disabled { background: transparent; }
.season-step-icon {
  display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--line);
  border-radius: 50%; pointer-events: none;
}
.season-step-icon::before, .watch-step-plus .season-step-icon::after {
  content: ''; grid-area: 1 / 1; width: 10px; height: 2px; border-radius: 1px; background: currentColor;
}
.watch-step-plus .season-step-icon::after { width: 2px; height: 10px; }
.show-season-controls button:enabled:not([aria-disabled=true]):hover .season-step-icon { background: var(--button); }
.show-season-controls button[aria-disabled=true] { opacity: .55; cursor: default; }
@media (forced-colors:active) {
  .season-step-icon::before, .watch-step-plus .season-step-icon::after { forced-color-adjust: none; background-color: ButtonText; }
  :is(.show-season-controls,.episode-controls) button:is(:disabled,[aria-disabled=true]) { opacity: 1; }
  :is(.show-season-controls,.episode-controls) button:is(:disabled,[aria-disabled=true]) .season-step-icon::before,
  :is(.show-season-controls,.episode-controls) button:is(:disabled,[aria-disabled=true]) .season-step-icon::after { background-color: GrayText; }
}
.show-season-count:hover .show-view-count { background: var(--button); }
.show-season-copy { min-width: 0; flex: 1; display: grid; grid-template-columns: minmax(0,1fr); gap: 2px; }
.show-season-title { display: flex; align-items: center; }
.show-season-title strong { flex: none; width: max-content; max-width: 100%; overflow-wrap: anywhere; }
.show-season-title .season-scores { display: inline-flex; flex: none; align-items: center; }
.season-score-item { display: inline-block; padding-inline-start: 4px; vertical-align: middle; }
.season-number-label { white-space: nowrap; }
.show-season-copy strong { font-size: 15px; line-height: 1.25; font-weight: 600; }
.show-season-copy small { font-size: 13px; font-weight: 400; color: var(--secondary); }
.show-view-count {
  min-width: 40px; min-height: 24px; border-radius: 14px; display: inline-grid; place-items: center;
  max-width: 7rem; overflow-wrap: anywhere; padding: 1px 7px; color: var(--text); background: var(--surface); font-size: 13px; font-variant-numeric: tabular-nums;
}
.show-view-count.rewatching { background: var(--accent); color: white; }
.show-season-count:hover .rewatching { background: var(--accent); }
.show-chevron { grid-column: 3; pointer-events: none; color: var(--secondary); font-size: 20px; font-weight: 400; }
.season-count-stepper { display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; gap: 8px; }
.season-count-stepper input { text-align: center; font-variant-numeric: tabular-nums; }
.season-count-stepper button { font-size: 20px; padding: 0; }
@media (hover: hover) {
  .season-count-stepper button:enabled:hover { background: color-mix(in srgb,var(--button),var(--text) 14%); text-decoration: none; }
}
.season-count-stepper button:enabled:active { background: color-mix(in srgb,var(--button),var(--text) 22%); text-decoration: none; }
.show-strip { display: flex; gap: 14px; overflow-x: auto; list-style: none; margin: 0; padding: 4px 3px 8px; }
.show-strip > li { flex: none; }
.show-extras .rail-heading { justify-content: space-between; margin-bottom: 12px; }
.show-extras .rail-heading h2 { margin-bottom: 0; }
.show-cast-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,8rem),1fr)); align-items: start; gap: 16px 12px; list-style: none; padding: 0; margin: 0; }
.show-cast-card { min-width: 0; text-align: center; overflow-wrap: anywhere; }
.show-cast-member, .show-recommendation { display: flex; flex-direction: column; gap: 6px; }
.show-cast-member { align-items: center; font-size: 14px; color: inherit; text-decoration: none; }
.show-cast-member > span { max-width: 100%; }
.show-cast-member:hover > span:not(.show-art), .show-cast-member:focus-visible > span:not(.show-art) { text-decoration: underline; }
.show-cast-member .show-art-profile { width: 56px; height: 56px; border-radius: 50%; }
.show-cast-roles { display: block; width: 100%; min-height: 28px; padding: 4px 2px; background: transparent; color: var(--secondary); font-size: 12px; font-weight: 400; line-height: 1.4; overflow-wrap: anywhere; }
.show-cast-roles span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.show-cast-roles:hover span, .show-cast-roles:focus-visible span { text-decoration: underline; }
.show-more-cast { margin-top: 12px; }
.show-role-context { color: var(--secondary); margin-bottom: 12px; }
.show-role-list { margin: 0; padding: 0 0 0 1.4rem; overflow-wrap: anywhere; }
.show-role-list li + li { margin-top: 4px; }
.show-recommendation { flex: none; width: 104px; font-size: 14px; font-weight: 600; line-height: 1.35; text-decoration: none; }
:root[data-theme="light"] .show-recommendation > strong { font-weight: 400; }
.show-recommendation:hover { text-decoration: underline; }
@media (min-width:900px) {
  .show-page { gap: 28px; }
  .show-title-block h1 { font-size: 38px; }
  .show-page .show-hero {
    grid-template: "poster title" auto "poster actions" auto "stats stats" auto / 120px minmax(0,1fr);
    gap: 12px 22px; padding-top: 74px;
  }
  .show-actions { align-self: start; }
  .show-actions .show-more { position: static; background: var(--button); border-radius: 10px; min-width: 44px; min-height: 44px; }
  .show-actions > .primary { flex: 0 1 auto; }
  .show-stats { margin-top: 4px; }
  .show-page .show-hero > .show-art-backdrop { inset-inline: -24px; }
  .show-seasons .show-season-row { padding: 10px; }
}
@media (min-width:1100px) {
  .show-seasons { grid-template-columns: repeat(auto-fill,minmax(min(100%,20rem),1fr)); }
}
/* 1250 layout pixels at the desktop scale. */
@media (min-width:1562.5px) {
  .show-page .show-hero { grid-template: "poster title stats" auto "poster actions stats" auto / 132px minmax(0,1fr) minmax(230px,30%); }
  .show-stats { margin: 0 0 4px; }
}

.season-screen { min-width: 0; }
.repair-notice { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;
  margin-block:16px; padding:12px 16px; background:var(--card); border:1px solid var(--line); border-radius:10px; }
.repair-moves { margin:12px 0; padding-inline-start:22px; }
.repair-moves li { padding-block:6px; overflow-wrap:anywhere; }
.repair-moves li p { color:var(--secondary); }
.season-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; }
.season-heading h1 { overflow-wrap:anywhere; flex:1; min-width:min(120px,100%); }
.season-list-title { font-size:20px; line-height:1.25; letter-spacing:-.025em; }
.season-actions { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.season-actions:empty { display:none; }
.season-mark { gap:7px; }
.season-summary,.episode-copy small,.episode-number,.season-rewatch-label span { color:var(--secondary); }
.season-summary,.season-status { margin-top:8px; }
.season-status { padding:8px 0; }
.season-summary,.season-rewatch-label,.episode-number,.episode-count { font-variant-numeric:tabular-nums; }
.season-rewatch { background:var(--card); border-radius:10px; padding:13px 16px; margin-top:16px; }
.season-rewatch-label { display:flex; align-items:baseline; justify-content:space-between; gap:10px; }
.season-rewatch-label strong,.watch-sheet-context { font-size:12px; text-transform:uppercase; letter-spacing:.07em; }
.season-rewatch progress { display:block; margin-top:10px; width:100%; height:5px; border:0; border-radius:4px; overflow:hidden; appearance:none; background:var(--button); accent-color:var(--accent); }
.season-rewatch progress::-webkit-progress-bar { background:var(--button); }
.season-rewatch progress::-webkit-progress-value { background:var(--accent); }
.season-rewatch progress::-moz-progress-bar { background:var(--accent); }
.season-list-title { margin:24px 0 2px; }
.season-episodes { list-style:none; padding:0; margin:8px 0 0; }
.season-episodes li + li { border-top:1px solid var(--line); }
.episode-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:8px; }
.season-episode { display:grid; align-items:center; grid-template-columns:fit-content(4ch) minmax(0,1fr); gap:8px; width:100%; min-height:50px;
  padding:8px 3px; }
.episode-number { min-width:20px; overflow-wrap:anywhere; font-size:13px; font-weight:400; }
.season-episode .imdb-score { color:var(--secondary); font-weight:500; }
.episode-copy { min-width:0; display:flex; align-items:baseline; flex-wrap:wrap; gap:2px 8px; overflow-wrap:anywhere; }
.episode-name { font-weight:500; }
.episode-copy small { flex-basis:100%; font-weight:400; font-size:12px; }
.episode-controls { display:flex; align-items:center; }
.episode-controls button { display:grid; place-items:center; min-width:44px; min-height:44px; padding:0; background:transparent; }
.episode-controls button:disabled { background:transparent; }
.episode-step:enabled:hover .season-step-icon, .episode-count-button:enabled:hover .episode-count { background:var(--button); }
.episode-count-button { max-width:7ch; }
.episode-count { justify-self:center; display:inline-grid; place-items:center; font-size:13px; font-weight:600; line-height:1;
  border-radius:999px; min-width:36px; max-width:100%; min-height:24px; overflow-wrap:anywhere; padding:2px 9px; background:var(--surface); }
.episode-count.empty { border:1px solid var(--secondary); background:transparent; }
.episode-count.rewatched { background:var(--accent); color:white; }
.watch-sheet { overflow-wrap:anywhere; }
.watch-sheet-context,.watch-sheet-description,.watch-sheet-action small { color:var(--secondary); }
.watch-sheet-context { margin-bottom:5px; }
.watch-sheet-description { margin-bottom:12px; }
.watch-sheet-action { display:flex; flex-direction:column; align-items:flex-start; gap:2px; text-align:left; width:100%; min-height:52px;
  background:transparent; border-top:1px solid var(--line); border-radius:0; padding:10px 2px; }
.watch-sheet-action small { font-weight:400; font-size:13px; }
.watch-sheet-cancel { margin-top:24px; width:100%; }
@media(max-width:899px) {
  .season-heading { align-items:start; }
  .season-heading h1 { flex-basis:100%; }
}

.personal-sheet { overflow-wrap: anywhere; }
.personal-sheet h2 { margin: 0 0 14px; font-size: 22px; }
.personal-sheet label > :is(input[type=text], input[type=search], textarea) { display: block; margin-top: 6px; }
.personal-show-name { color: var(--secondary); margin: 0 0 4px; font-size: 12px; font-weight: 600; }
.personal-check-row { cursor: pointer; }
.personal-sheet label.personal-check-row {
  display: flex; align-items: center; gap: 12px; margin: 0; padding: 10px 2px; min-height: 48px;
  font-size: 15px; font-weight: 500; border-bottom: 1px solid var(--line);
}
.personal-check-row span { min-width: 0; overflow-wrap: anywhere; }
.personal-sheet input.personal-check, .recovery-screen input[type=checkbox] {
  appearance: none; flex: 0 0 20px; width: 20px; height: 20px; min-height: 20px;
  padding: 0; margin: 0; background: transparent; border: 2px solid var(--muted); border-radius: 6px;
  display: inline-grid; place-items: center; cursor: pointer;
}
.personal-sheet input.personal-check:checked, .recovery-screen input[type=checkbox]:checked { background: var(--text); border-color: var(--text); }
.personal-sheet input.personal-check:checked::after, .recovery-screen input[type=checkbox]:checked::after {
  content: ""; width: 8px; height: 4px; border-left: 2px solid var(--main-ink); border-bottom: 2px solid var(--main-ink);
  transform: translateY(-1px) rotate(-45deg);
}
.export-screen input[type=radio] {
  appearance: none; box-sizing: border-box; flex: none; width: 20px; height: 20px; min-height: 0;
  margin: 0; padding: 0; border: 2px solid var(--muted); border-radius: 50%; background: transparent; cursor: pointer;
}
.export-screen input[type=radio]:checked {
  border: 6px solid var(--text);
}
@media (forced-colors: active) {
  .personal-sheet input.personal-check, .recovery-screen input[type=checkbox],
  .export-screen input[type=radio] { appearance: auto; }
  .personal-sheet input.personal-check::after, .recovery-screen input[type=checkbox]::after { display: none; }
}
.rating-figure { margin: 0; font-size: 26px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.rating-figure small { font-size: 15px; color: var(--secondary); }
.rating-slider { position: relative; height: 44px; margin-top: 12px; display: flex; align-items: center; }
.rating-slider progress {
  position: absolute; inset-inline: 12px; width: calc(100% - 24px); height: 4px; border: 0; border-radius: 2px;
  overflow: hidden; appearance: none; background: var(--muted); color: var(--text);
}
.rating-slider progress::-webkit-progress-bar { background: var(--muted); }
.rating-slider progress::-webkit-progress-value { background: var(--text); }
.rating-slider progress::-moz-progress-bar { background: var(--text); }
.personal-sheet .rating-slider input[type=range] {
  appearance: none; z-index: 1; width: 100%; height: 44px; min-height: 44px;
  border: 0; padding: 0; margin: 0; border-radius: 3px; background: transparent; cursor: pointer;
}
.rating-slider input::-webkit-slider-runnable-track { background: transparent; height: 24px; }
.rating-slider input::-moz-range-track { background: transparent; }
.rating-slider input::-webkit-slider-thumb {
  appearance: none; box-sizing: border-box; height: 24px; width: 24px;
  border: 2px solid var(--card); border-radius: 100%; background: var(--text);
}
.rating-slider input::-moz-range-thumb {
  box-sizing: border-box; height: 24px; width: 24px;
  border: 2px solid var(--card); border-radius: 100%; background: var(--text);
}
.rating-scale { display: flex; justify-content: space-between; margin: 0; color: var(--secondary); font-size: 12px; }
.rating-commands .destructive { background: transparent; }

.lists-screen > .screen-heading { margin-bottom: 16px; }
.list-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.list-chips button { min-height: 32px; max-width: 100%; gap: 7px; padding: 5px 12px; border-radius: 18px; background: var(--surface); font-size: 13px; overflow-wrap: anywhere; }
.list-chips button span { color: var(--secondary); font-size: 12px; font-variant-numeric: tabular-nums; }
.list-chips button[aria-pressed=true] { background: var(--text); color: var(--main-ink); }
.list-chips button[aria-pressed=true] span { color: var(--main-ink); }
.list-new::before { content: '+'; font-size: 16px; font-weight: 500; line-height: 1; }
.lists-screen section { margin-top: 24px; }
.lists-screen section > header { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 10px; }
.lists-screen section > header h2 { margin: 0; font-size: 18px; font-weight: 650; overflow-wrap: anywhere; }
.list-tools { display: flex; align-items: center; margin-left: auto; gap: 4px; max-width: 100%; }
.list-more, .list-remove { width: 44px; height: 44px; padding: 0; flex: none; color: var(--secondary); background: transparent; }
.list-more { letter-spacing: 2px; }
.list-remove { font-size: 23px; font-weight: 400; }
.list-shows, .list-picker { list-style: none; padding: 0; margin: 0; }
.list-shows > li { display: flex; gap: 10px; align-items: center; min-height: 72px; }
.list-shows a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 52px; text-decoration: none; }
.list-shows a:is(:hover,:focus-visible) strong { text-decoration: underline; }
.list-shows .tv-poster { width: 40px; flex: none; }
.watch-compact .list-shows .tv-poster { display: none; }
.watch-compact .list-shows > li, .watch-compact .list-shows a { min-height: 44px; }
.list-shows a > span:last-child { min-width: 0; display: grid; gap: 3px; overflow-wrap: anywhere; }
.list-shows strong { font-weight: 600; }
.list-shows small, .list-empty, .list-picker-empty, .list-selection { color: var(--secondary); }
.list-rating { white-space: nowrap; font-weight: 600; font-size: 13px; }
.list-rating small { font-weight: 400; }
.list-empty { margin: 12px 0; }
.list-form .list-picker { margin: 12px 0; }
.list-form .list-picker label { margin: 0; }
.list-picker-empty, .list-selection { margin: 8px 0 0; font-size: 13px; }

.library-screen { min-width: 0; }
.library-screen > header { margin-bottom: 18px; }
.library-screen h1 { margin: 0; }
.library-count { margin: 0; font-size: 13px; color: var(--secondary); }
.library-count:empty, .library-screen .tv-empty:empty { display: none; }
.library-recovery summary, .library-recovery a { cursor: pointer; width: fit-content; padding-block: 12px; }
.library-recovery a { display: inline-block; }
.library-recovery p { margin: 0; color: var(--secondary); }
.library-selects .tv-search-field { flex: 1 1 9rem; min-width: 0; max-width: 18rem; }
.library-controls { display: grid; gap: 10px; margin-bottom: 18px; }
.library-selects { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.library-controls .library-chips { gap: 6px; }
.library-chips button { min-height: 40px; }
.library-controls .library-chips, .library-selects { min-width: 0; max-width: 100%; }
.library-grid { padding: 0; margin: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 18px 12px; }
.library-grid > li { min-width: 0; }
.library-grid a { display: block; min-width: 0; border-radius: 7px; color: var(--text); text-decoration: none; }
.library-grid a > strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin: 6px 0 2px; font-size: 14px; font-weight: 600; }
.library-grid a:hover > strong { text-decoration: underline; }
.library-details { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 5px; color: var(--secondary); font-size: 12px; font-variant-numeric: tabular-nums; }
.library-status { position: relative; max-width: 100%; }
.library-status-trigger { display: flex; align-items: flex-start; justify-content: flex-start; min-height: 24px; max-width: 100%; padding: 0; margin: 0;
  font: inherit; color: inherit; background: transparent; border: 0; border-radius: 3px; text-align: start; }
.library-status-caption::after { content: ''; display: inline-block; width: 5px; height: 5px;
  margin-inline: 4px 2px; border: solid currentColor; border-width: 0 1px 1px 0; vertical-align: 3px; transform: rotate(45deg); }
.library-status-trigger:is(:hover,:focus-visible,[aria-expanded=true]):enabled { color: var(--text); text-decoration: underline; }
.library-status-trigger:disabled .library-status-caption::after { display: none; }
.library-status-trigger:disabled { color: inherit; background: transparent; }
.library-status-menu { display: grid; position: absolute; z-index: 4; top: calc(100% + 2px); width: max-content; min-width: 8rem;
  overflow-y: auto; padding: 4px; background: var(--card); color: var(--text);
  border: 1px solid var(--strong-line); border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.library-status-menu[data-above] { top: auto; bottom: calc(100% + 2px); }
.library-status-menu:focus { outline: none; }
.library-status-menu button { text-align: start; justify-content: flex-start; min-height: 32px; border: 0; border-radius: 4px; padding: 5px 10px;
  font-size: 13px; font-weight: 500; color: var(--text); background: transparent; white-space: nowrap; }
.library-status-menu button:focus { background: var(--button); }
.library-status-menu button:hover:not(:disabled) { text-decoration: none; }
.library-status-menu button:focus-visible { outline-offset: -2px; }
@media (pointer: coarse) {
  .library-status-trigger { min-height: 44px; min-width: min(44px,100%); }
}
.library-episode-count { flex-basis: 100%; order: 1; }
.library-details .library-rating { margin-inline-start: auto; }
.library-rating { color: var(--text); font-weight: 600; }
.library-grid small { color: var(--secondary); font-size: 12px; font-weight: 400; }
.library-screen .tv-note { margin: 0 0 14px; }
@media (min-width: 900px) {
  .library-count { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
/* 1100 layout pixels at the desktop scale. */
@media (min-width: 1375px) {
  .library-grid { grid-template-columns: repeat(7,minmax(0,1fr)); gap: 22px 16px; }
}
@media (max-width: 899px) {
  .library-screen > header { margin-bottom: 14px; }
  .library-controls { gap: 8px; margin-bottom: 14px; }
}
@media (max-width: 540px) {
  .library-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px 10px; }
  .library-controls .library-chips button { padding-inline: 8px; gap: 4px; }
  .library-selects { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px 10px; }
  .library-selects .view-choice { display: grid; gap: 2px; font-size: 12px; }
  .library-selects select { width: 100%; max-width: none; font-size: 14px; }
  .library-selects .tv-search-field { grid-column: 1 / -1; max-width: none; }
}
.ratings-screen { min-width: 0; container: ratings / inline-size; }
.ratings-header { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 12px; margin-bottom: 16px; }
.ratings-heading h1 { margin: 0; }
.ratings-total { display: block; color: var(--secondary); font-size: 13px; font-variant-numeric: tabular-nums; }
.ratings-header .tv-search-field { justify-self: end; max-width: 20rem; }
.ratings-tools { grid-column: 1/-1; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.ratings-tools .view-choice { flex: 0 1 auto; }
.ratings-tools select { max-width: min(13rem,100%); }
.ratings-rows { display: grid; gap: 6px; padding: 0; margin: 0; list-style: none; }
.ratings-rows li { min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; column-gap: 10px;
  padding: 6px 12px; background: var(--card); border-radius: 10px;
  content-visibility: auto; contain-intrinsic-block-size: auto 48px; }
.ratings-rows a { min-width: 0; min-height: 48px; display: flex; align-items: center; gap: 10px;
  border-radius: 4px; color: var(--text); text-decoration: none; }
.ratings-rows a:is(:hover,:focus-visible) strong { text-decoration: underline; }
.ratings-rows .tv-poster { width: 32px; flex: none; border-radius: 4px; }
.ratings-rows:not(:has(.tv-poster img)) .tv-poster { display: none; }
.rating-show-copy { display: grid; min-width: 0; gap: 3px; overflow-wrap: anywhere; }
.rating-show-copy strong { font-size: 15px; line-height: 1.3; font-weight: 600; }
.ratings-rows small { color: var(--secondary); font-size: 12px; }
.rating-editor { position: relative; }
.rating-editor::after { content: ''; position: absolute; right: 11px; top: 50%; pointer-events: none; width: 5px; height: 5px;
  border: solid var(--secondary); border-width: 0 1.5px 1.5px 0; transform: translateY(-70%) rotate(45deg); }
.rating-edit { display: block; appearance: none; width: 5.75rem; min-height: 44px; padding: 0 22px 0 10px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 600;
  font-variant-numeric: tabular-nums; cursor: pointer; }
.rating-edit:hover:enabled { border-color: var(--secondary); }
.rating-edit:disabled { color: var(--secondary); cursor: default; }
@media (hover: hover) and (pointer: fine) {
  @supports (appearance: base-select) and selector(::picker(select)) {
    .rating-edit, .rating-edit::picker(select) { appearance: base-select; }
    .rating-edit { display: flex; align-items: center; }
    .rating-edit::picker-icon { display: none; }
    .rating-edit::picker(select) {
      width: max-content; min-width: 9rem; max-height: min(18rem,50dvh); overflow-y: auto; overscroll-behavior: contain;
      padding: 4px; color: var(--text); background: var(--card); border: 1px solid var(--strong-line);
      border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.2);
      font: inherit; font-weight: 500; font-variant-numeric: tabular-nums;
    }
    .rating-edit option {
      min-height: 32px; padding: 5px 10px; gap: 8px; border-radius: 4px;
      color: var(--text); background: transparent; cursor: pointer;
    }
    .rating-edit option:is(:hover,:focus-visible) { background: var(--button); }
    .rating-edit option:checked { font-weight: 700; }
    .rating-edit option[value="remove"] { margin-top: 4px; border-top: 1px solid var(--strong-line); color: var(--danger); }
  }
}
@container ratings (max-width: 21rem) {
  .rating-edit { width: 4.9rem; padding-inline: 8px 19px; }
  .rating-editor::after { right: 9px; }
}
@container ratings (min-width: 44rem) {
  .ratings-header { grid-template-columns: minmax(7rem,1fr) minmax(10rem,18rem) auto; margin-bottom: 20px; }
  .ratings-tools { grid-column: auto; }
  .ratings-rows { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 12px; }
  .ratings-rows li { padding: 8px 14px; }
  .ratings-rows .tv-poster { width: 36px; }
}

.watch-view { min-width: 0; }
.watchlist-screen, .lists-screen { container: collection / inline-size; }
.watch-lead { margin: 6px 0 12px; color: var(--secondary); }
.watch-rows { list-style: none; margin: 0; padding: 0; }
.watch-rows, .list-shows { display: grid; gap: 6px; }
.watch-rows li, .list-shows > li { min-width: 0; padding-inline: 10px; border-radius: 10px; background: var(--card); }
.more-watch-rows > li { content-visibility: auto; contain-intrinsic-block-size: auto 92px; }
.watch-rows a { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-radius: 4px; text-decoration: none; }
.watch-rows a:is(:hover,:focus-visible) strong { text-decoration: underline; }
.watch-rows .tv-poster { width: 48px; flex: none; }
.watch-row-text { flex: 1; min-width: 0; display: grid; gap: 3px; overflow-wrap: anywhere; }
.watch-row-text strong { font-weight: 600; line-height: 1.3; }
.watch-row-text > span, .watch-row-end { color: var(--secondary); font-size: 13px; font-variant-numeric: tabular-nums; }
.watch-row-end { flex: none; }
.watch-row-text progress { appearance: none; display: block; margin-top: 3px; border: 0; border-radius: 2px; overflow: hidden; height: 3px; width: 100%; max-width: 24rem; color: var(--accent); background: var(--surface); }
.watch-row-text progress::-webkit-progress-bar { background: var(--surface); }
.watch-row-text progress::-webkit-progress-value { background: var(--accent); }
.watch-row-text progress::-moz-progress-bar { background: var(--accent); }
.watch-view .tv-section-head { margin-bottom: 4px; }
.watchlist-screen section { margin-top: 20px; }
.watchlist-screen section h2 { margin: 0 0 4px; font-size: 18px; }
.watchlist-screen .screen-heading h2 { margin: 0 auto 0 0; scroll-margin-block-start: 12px; }
.watchlist-screen .watch-rows li { display: flex; align-items: center; gap: 8px; }
.watchlist-screen .watch-rows a { flex: 1; min-width: 0; }
.watch-density { min-height: 44px; padding: 4px 10px; font-size: 14px; }
.watch-density[aria-pressed="true"] { background: var(--text); color: var(--page); }
.watch-compact .watch-rows a { min-height: 44px; padding-block: 4px; }
.watch-compact .watch-rows .tv-poster, .watch-compact .watch-rows progress { display: none; }
.watch-compact .watch-row-text { gap: 0; }
.watch-compact .more-watch-rows > li { contain-intrinsic-block-size: auto 44px; }
@container collection (min-width: 44rem) {
  .watch-rows, .list-shows { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 12px; }
  .watch-rows li, .list-shows > li { padding-inline: 14px; }
  .watch-rows .tv-poster, .list-shows .tv-poster { width: 36px; }
  .watch-rows a { padding-block: 6px; }
  .more-watch-rows > li { contain-intrinsic-block-size: auto 66px; }
  .list-shows > li { min-height: 66px; }
}

.view-choice { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; color: var(--secondary); font-size: 14px; }
.view-choice select { font: inherit; min-height: 44px; min-width: 0; max-width: 13rem; color: var(--text); background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; cursor: pointer; text-overflow: ellipsis; }
@media (max-width: 899px) {
  .watchlist-screen .watch-lead { margin-top: 0; }
}

.cast-page { max-width: 760px; container: cast / inline-size; }
.cast-page > header { display: grid; grid-template-columns: auto minmax(0,1fr) minmax(0,32%); gap: 12px; align-items: center; padding: 4px 0 8px; }
.cast-page > header:not(:has(.tv-search-field:not([hidden]))) { grid-template-columns: auto minmax(0,1fr); }
.cast-portrait { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; background: var(--surface); }
.cast-portrait img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cast-page h1 { font-size: 22px; overflow-wrap: anywhere; }
.cast-page header p { margin-top: 6px; }
.cast-page p, .cast-title small { color: var(--secondary); }
.cast-page h2 { margin: 24px 0 8px; font-size: 18px; }
.cast-page ul { list-style: none; margin: 0; padding: 0; }
.cast-page li:not([hidden]) ~ li:not([hidden]) { border-top: 1px solid var(--line); }
.cast-row { display: grid; grid-template-columns: 44px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 10px 2px; color: inherit; text-decoration: none; }
.cast-row:hover strong, .cast-row:focus-visible strong { text-decoration: underline; }
.cast-title { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.cast-title small, .cast-watch { font-size: 13px; }
.cast-watch { white-space: nowrap; color: var(--secondary); }
.cast-watch:has(span) { color: var(--text); }
.cast-watch span { margin-right: 4px; }
.cast-page > div > p { margin: 20px 0 0; }
@container cast (max-width: 28rem) {
  .cast-page > header { gap: 8px; grid-template-columns: auto minmax(0,1fr) minmax(5.5rem,36%); }
  .cast-portrait { width: 40px; height: 40px; }
  .cast-page h1 { font-size: 19px; }
  .cast-page header p { font-size: 13px; }
  .cast-page .tv-search-field { padding-inline: 8px; }
}

.statistics-screen { --stats-tile-gap: 8px; min-width: 0; container-type: inline-size; font-variant-numeric: tabular-nums; }
.statistics-screen > header { margin: 0 0 16px; }
.statistics-screen .stats-scope { max-width: none; margin-top: 12px; }
.stats-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--stats-tile-gap); margin: 0 0 var(--stats-tile-gap); }
.stats-totals { display: contents; }
.stats-totals > div, .statistics-card { min-width: 0; border-radius: 10px; background: var(--card); padding: 14px; }
.stats-totals dt { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--secondary); }
.stat-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.stats-totals dd { margin: 8px 0 0; font-weight: 700; font-size: 26px; letter-spacing: -.025em; line-height: 1.12; overflow-wrap: anywhere; }
.stats-omissions, .stats-empty { font-size: 13px; color: var(--secondary); margin: 12px 0; }
.stats-omissions:empty, .stats-empty:empty { display: none; }
.stats-charts, .stats-charts > div, .stats-rewatch-stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--stats-tile-gap); }
.stats-charts > div:not(:has(.statistics-card)), .stats-rewatch-stack:empty { display: none; }
.stats-totals > div { padding: 12px; }
.stats-rewatch-stack:has([data-chart=rewatched-shows]) { grid-template-rows: auto 1fr; }
.stats-comparisons { grid-auto-rows: 1fr; }
.stats-comparisons .statistics-card:has(.stats-dots) { display: flex; flex-direction: column; }
.stats-comparisons .statistics-card > div:has(.stats-dots) { flex: 1; display: grid; }
.stats-rewatch-stack > [data-chart=rewatches] header { margin-bottom: 4px; }
.stats-rewatch-stack .stats-rewatch progress { height: 5px; margin: 5px 0; }
.statistics-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.statistics-card h2 { font-size: 15px; line-height: 1.3; font-weight: 650; letter-spacing: -.012em; }
.statistics-card header p, .stats-rewatch small { font-size: 12px; color: var(--secondary); }
.statistics-card header p { margin-top: 2px; }
.statistics-card header button { width: 44px; min-width: 44px; height: 44px; padding: 0; margin: -8px -8px 0 0; background: transparent; color: var(--secondary); }
@media (hover: hover) {
  .statistics-card header button:hover { color: var(--text); background: var(--surface); }
}
.stats-rewatch > p { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.stats-rewatch strong { font-size: 26px; line-height: 1.15; letter-spacing: -.025em; }
.stats-rewatch span { color: var(--secondary); font-size: 13px; overflow-wrap: anywhere; }
.stats-rewatch progress { appearance: none; display: block; border: 0; width: 100%; height: 8px; margin: 10px 0 8px; border-radius: 4px; background: var(--button); overflow: hidden; }
.stats-rewatch progress::-webkit-progress-bar { background: var(--button); }
.stats-rewatch progress::-webkit-progress-value { background: var(--accent); border-radius: 4px; }
.stats-rewatch progress::-moz-progress-bar { background: var(--accent); border-radius: 4px; }
.stats-bars > div { display: grid; grid-template-columns: minmax(3em, 41%) minmax(10px, 1fr) minmax(2.2em, auto); gap: 8px; align-items: center; margin-top: 7px; font-size: 12.5px; }
.stats-bars span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--secondary); }
.stats-bars b { text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.stats-bars svg { display: block; width: 100%; height: 6px; }
.stats-bars rect, .stats-columns rect { fill: var(--accent); }
.stats-dots path { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.stats-dots line { stroke: var(--secondary); stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.stats-column-scroll { overflow-x: auto; }
.stats-columns { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; min-width: 100%; width: max-content; }
.stats-columns > div { text-align: center; font-size: 11px; }
.stats-column-mark { display: flex; height: 112px; flex-direction: column; align-items: center; justify-content: flex-end; border-bottom: 1px solid var(--strong-line); padding: 0 1px; }
.stats-column-mark svg { display: block; width: 100%; max-width: 22px; }
.stats-rating-histogram { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px; padding-top: 12px; container-type: inline-size; }
.stats-count-scale { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; height: 81px; font-size: 11px; line-height: 1; color: var(--secondary); }
.stats-rating-histogram .stats-columns { width: auto; min-width: 0; grid-template-columns: repeat(21,minmax(0,1fr)); }
.stats-rating-histogram .stats-column-mark { height: 81px; }
@container (max-width: 16rem) {
  .stats-rating-histogram .stats-columns > div:nth-child(4n + 3) > span { visibility: hidden; }
}
@container (max-width: 22rem) {
  .stats-rating-histogram .stats-columns > div:last-child > span { display: flex; justify-content: flex-end; }
}
.stats-column-mark b { font-weight: 600; margin-bottom: 2px; }
.stats-columns > div > span { display: block; padding-top: 5px; color: var(--secondary); }
.stats-dots { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto minmax(124px, 1fr) auto auto; gap: 3px 7px; padding-right: 4px; font-size: 11px; color: var(--secondary); }
.stats-dots > span:first-child { grid-column: 1 / -1; margin-bottom: 3px; }
.stats-y-ticks { display: flex; flex-direction: column; justify-content: space-between; text-align: right; }
.stats-dots svg { width: 100%; height: 100%; min-height: 124px; border-left: 1px solid var(--strong-line); border-bottom: 1px solid var(--strong-line); overflow: visible; }
.stats-x-ticks, .stats-x-label { grid-column: 2; }
.stats-x-ticks { display: flex; justify-content: space-between; }
.stats-x-label { text-align: center; }
.stats-table-dialog[open] {
  display:flex; flex-direction:column; gap:12px; inset:0; margin:auto; padding:16px;
  width:min(48rem,calc(100% - 24px)); max-height:calc(88dvh / var(--app-scale)); overflow:hidden; border-radius:16px;
}
.stats-table-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; flex:none; }
.stats-table-heading h2 { font-size:20px; }
.stats-table-heading button { flex:none; }
.stats-table-scroll { min-height:0; overflow:auto; overscroll-behavior:contain; }
.stats-data { border-collapse:separate; border-spacing:0; width:100%; font-size:14px; line-height:1.4; }
.stats-data th, .stats-data td { border-bottom:1px solid var(--line); padding:8px 6px; text-align:right; overflow-wrap:anywhere; }
.stats-data th:first-child { text-align:left; }
.stats-data th { font-weight: 500; }
.stats-data thead th { position:sticky; top:0; background:var(--card); padding:0 6px; z-index:1; }
.stats-data thead button {
  color:var(--secondary); background:transparent; border:0; border-radius:4px; padding:0; min-height:44px;
  font-size:13px; font-weight:600; white-space:nowrap; text-align:inherit;
}
.stats-data thead button::after { content:'↕'; display:inline-block; width:0.8em; margin-left:2px; }
.stats-data [aria-sort=ascending] button::after { content:'▴'; }
.stats-data [aria-sort=descending] button::after { content:'▾'; }
.stats-data tbody tr:last-child > * { border-bottom: 0; }
@container (min-width: 32rem) {
  .stats-summary { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@container (min-width: 52rem) {
  .stats-summary { grid-template-columns: repeat(4,minmax(0,1fr)) minmax(0,1.35fr); }
}
@media (min-width: 900px) {
  .statistics-screen > header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
  .statistics-screen .stats-scope { width: 300px; margin-top: 0; }
  .statistics-screen { --stats-tile-gap: 12px; }
  @container (min-width: 30rem) {
    .stats-charts > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats-rankings:has([data-chart=hours-by-show]) > [data-chart=plays-by-show] { grid-column: 1 / -1; }
    .stats-rewatch-stack:not(:has([data-chart=rewatched-shows])) { align-self: start; }
  }
  @container (min-width: 47rem) {
    .stats-charts > div { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .stats-rankings:has([data-chart=hours-by-show]) > [data-chart=plays-by-show] { grid-column: auto; }
  }
}

.export-screen { max-width: 720px; min-width: 0; }
.export-screen header p { margin: 5px 0 18px; color: var(--secondary); }
.export-screen fieldset { min-width: 0; margin: 0; padding: 4px 16px; border: 0; border-radius: 10px; background: var(--card); }
.export-screen label { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 6px 0; cursor: pointer; }
.export-screen label + label { border-top: 1px solid var(--line); }
.export-screen label strong, .export-screen label small { display: block; }
.export-screen label strong { font-size: 15px; font-weight: 600; }
.export-screen label small { color: var(--secondary); font-size: 12px; }
.export-omission, .export-screen [data-export-status] { color: var(--secondary); font-size: 13px; margin: 8px 0; }
.export-omission:empty, .export-screen [data-export-status]:empty { display: none; }
.export-actions { display: flex; flex-wrap: wrap; align-items: start; gap: 8px; margin-top: 16px; }
.export-actions button, .export-actions .button, .export-screen [data-copy] { gap: 8px; }
.export-actions svg, .export-screen [data-copy] svg { width: 16px; height: 16px; flex: none; stroke: currentColor; stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.export-downloads { display: flex; flex-wrap: wrap; gap: 8px; }
.export-downloads a[aria-disabled] { opacity: .55; cursor: default; }
.export-record-downloads { flex-basis: 100%; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
.export-prompt { margin-top: 24px; }
.export-prompt h2 { font-size: 18px; line-height: 1.25; letter-spacing: -.02em; }
.export-prompt blockquote { margin: 12px 0 14px; padding-left: 12px; border-left: 2px solid var(--strong-line); color: var(--secondary); }
.export-screen [data-copy] { width: 100%; }
@media (max-width: 899px) {
  .export-actions > [data-share], .export-actions > .export-downloads:not(.export-record-downloads) { flex: 1; }
  .export-actions .export-downloads:not(.export-record-downloads) a { width: 100%; }
}
