/* Theme: follows the OS by default; <html data-theme="light|dark"> (header toggle) overrides it. */
:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #646b78;
  --border: #dde1e7;
  --accent: #d1323c;
  --accent-text: #d1323c;
  --header-bg: #16181d;
  --header-text: #f1f2f4;
  --danger: #d33c3c;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111317;
    --surface: #1a1d23;
    --text: #e7e9ee;
    --muted: #9198a5;
    --border: #2b3039;
    --accent: #d1323c;
  --accent-text: #ff6b73;
  --header-bg: #0b0c0f;
  --header-text: #f1f2f4;
    --danger: #ff6b6b;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111317;
  --surface: #1a1d23;
  --text: #e7e9ee;
  --muted: #9198a5;
  --border: #2b3039;
  --accent: #d1323c;
  --accent-text: #ff6b73;
  --header-bg: #0b0c0f;
  --header-text: #f1f2f4;
  --danger: #ff6b6b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
.muted { color: var(--muted); }
.center { text-align: center; }

header.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface);
}
header.top h1 { font-size: 17px; margin: 0; }
main { max-width: 960px; margin: 0 auto; padding: 16px; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.login { max-width: 340px; margin: 15vh auto 0; }
.login h1 { margin: 0 0 16px; font-size: 20px; }

input, button, select, textarea {
  font: inherit; color: inherit;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); padding: 8px 12px;
}
input { width: 100%; }
button { cursor: pointer; background: var(--surface); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:disabled { opacity: .6; cursor: default; }
.stack > * + * { margin-top: 12px; }
.error { color: var(--danger); min-height: 1.5em; margin: 0; }
.small { font-size: 13px; }
button:disabled { opacity: .5; cursor: default; }
button.danger { color: var(--danger); border-color: var(--danger); }

/* Library */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.tabs button { white-space: nowrap; border-radius: 999px; }
.tabs button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.toolbar input { flex: 1 1 200px; width: auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 12px; }
.grid > * { min-width: 0; }

.card.item { display: flex; gap: 12px; padding: 10px; }
.item .cover {
  flex: 0 0 72px; height: 104px; border-radius: 6px; overflow: hidden; cursor: pointer;
  background: var(--border); display: grid; place-items: center; font-size: 28px; color: var(--muted);
}
.item .cover img { width: 100%; height: 100%; object-fit: cover; }
.item .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.item .title { color: var(--text); text-decoration: none; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .title:hover { text-decoration: underline; }
.item .meta { color: var(--muted); font-size: 13px; }
.badge { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; padding: 1px 6px; border-radius: 4px; background: var(--border); color: var(--text); }
.bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.bar > div { height: 100%; background: var(--accent); }
.item .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.item .progress { font-variant-numeric: tabular-nums; font-size: 14px; }
.item .plus { padding: 4px 14px; font-weight: 600; }
.item .rating { padding: 3px 8px; font-size: 13px; }

/* Editor dialog */
dialog.editor {
  width: min(560px, calc(100vw - 32px)); border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); padding: 20px;
}
dialog.editor::backdrop { background: rgb(0 0 0 / .5); }
dialog.editor h2 { margin: 0; font-size: 18px; }
dialog.editor label { display: block; font-size: 13px; color: var(--muted); }
dialog.editor label > input, dialog.editor label > select, dialog.editor label > textarea { display: block; width: 100%; margin-top: 4px; color: var(--text); }
.cols { display: flex; gap: 10px; }
.cols > * { flex: 1; min-width: 0; }
.actions { display: flex; gap: 8px; align-items: center; }
.spacer { flex: 1; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 8px 16px; border-radius: 8px; z-index: 10;
}

/* Nav */
header.top .nav { display: flex; gap: 4px; margin-right: auto; margin-left: 20px; }
header.top .nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; }
header.top .nav a.active { color: var(--text); background: var(--bg); }

/* Settings */
.settings { max-width: 640px; }
.settings h2 { margin: 0; font-size: 17px; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline input { flex: 1 1 180px; width: auto; }

/* AniList search in add dialog */
.search { border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
.search p { margin: 6px 0 0; }
.results { list-style: none; margin: 6px 0 0; padding: 0; max-height: 300px; overflow-y: auto; }
.results li + li { margin-top: 4px; }
.result { display: flex; gap: 10px; width: 100%; text-align: left; padding: 6px; background: transparent; border-color: transparent; }
.result:hover, .result:focus-visible { background: var(--bg); border-color: var(--border); }
.result img, .result .noimg { width: 40px; height: 58px; object-fit: cover; border-radius: 4px; background: var(--border); flex: none; }
.r-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.r-title { font-weight: 600; }
.r-body .badge { align-self: flex-start; }

/* About */
.about .tmdb-logo { height: 18px; width: auto; display: block; }
.about a { color: var(--accent-text); }

/* Synopsis + episode checklist in the editor */
.synopsis summary { cursor: pointer; }
.synopsis p { margin: 6px 0 0; white-space: pre-line; }
.episodes { border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
#ep-list { max-height: 340px; overflow-y: auto; margin-top: 8px; }
button.small { padding: 3px 10px; font-size: 13px; }
.season { border-top: 1px solid var(--border); }
.season summary { display: flex; align-items: center; gap: 8px; padding: 6px 2px; cursor: pointer; list-style: none; }
.season summary::-webkit-details-marker { display: none; }
.season summary::before { content: "▸"; color: var(--muted); width: 1em; }
.season[open] summary::before { content: "▾"; }
.season ul { list-style: none; margin: 0 0 8px; padding: 0; }
dialog.editor .season li label { display: flex; align-items: center; gap: 8px; padding: 3px 4px; color: var(--text); font-size: 14px; border-radius: 6px; cursor: pointer; }
.season li label:hover { background: var(--bg); }
dialog.editor .season li label > input { display: inline-block; width: auto; margin: 0; flex: none; }
.season li.future label { opacity: .55; }
.ep-num { width: 2.2em; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.ep-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Import */
progress { width: 100%; }
.log { max-height: 220px; overflow-y: auto; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px; margin: 0; white-space: pre-wrap; }

/* Links */
.actions-inline { display: inline-flex; gap: 6px; align-items: center; }
a.open {
  font-size: 13px; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--accent);
  color: var(--accent-text); text-decoration: none; white-space: nowrap;
}
a.open:hover { background: var(--accent); color: #fff; }
.links { border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
.links a.ref { color: var(--accent-text); text-decoration: none; }
#link-list { list-style: none; margin: 8px 0; padding: 0; }
#link-list li { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-top: 1px solid var(--border); min-width: 0; }
#link-list li:first-child { border-top: 0; }
#link-list li a { color: var(--accent-text); white-space: nowrap; }
#link-list .url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 auto; }
.link-add input { flex: 1 1 160px; }
#link-label { flex: 0 1 140px; }

/* Chart tokens (validated categorical slots 1-3; dark steps chosen for the dark surface) */
:root {
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a;
  --grid: #e1e0d9; --axis-line: #c3c2b7; --tick: #646b78;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70;
    --grid: #2b3039; --axis-line: #3a404b; --tick: #9198a5;
  }
}
:root[data-theme="dark"] {
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70;
  --grid: #2b3039; --axis-line: #3a404b; --tick: #9198a5;
}

/* Dashboard */
#view > .card + .card, #view > .card + .tiles, #view > .tiles + .card, #view > .card + .two-col, #view > .two-col + .card { margin-top: 12px; }
.hero .hero-value { font-size: 48px; font-weight: 600; line-height: 1.1; margin: 4px 0; }
.runtime-note { margin-top: 8px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { padding: 14px 16px; }
.tile-value { font-size: 26px; font-weight: 600; }
.card h3 { margin: 0 0 4px; font-size: 16px; }
.card h3 + p { margin: 0 0 8px; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 12px; }
.two-col > *, .tiles > * { min-width: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); margin: 4px 0 6px; }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.plot-wrap { position: relative; }
.plot svg { display: block; max-width: 100%; }
.plot .grid { stroke: var(--grid); stroke-width: 1; }
.plot .axis { stroke: var(--axis-line); stroke-width: 1; }
.plot .tick { fill: var(--tick); font-size: 11px; font-variant-numeric: tabular-nums; }
.plot .hit { fill: transparent; cursor: default; }
.plot .hit.on { fill: var(--text); fill-opacity: .05; }
.tip {
  position: absolute; top: 0; pointer-events: none; z-index: 2; min-width: 140px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-size: 13px; box-shadow: 0 4px 16px rgb(0 0 0 / .15);
}
.tip-title { font-weight: 600; margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 6px; }
.tip-row b { margin-left: auto; padding-left: 12px; font-variant-numeric: tabular-nums; }
.tip-row.total { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }
.table-view { margin-top: 6px; }
.table-view summary { cursor: pointer; }
.table-wrap { overflow-x: auto; max-height: 320px; }
.card table { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
.card th, .card td { text-align: right; padding: 4px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.card th:first-child, .card td:first-child { text-align: left; }
.card thead th { color: var(--muted); font-weight: 500; }
.current { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.cur { display: flex; gap: 10px; width: 100%; text-align: left; padding: 6px; background: transparent; border-color: transparent; }
.cur:hover { background: var(--bg); border-color: var(--border); }
.cur img, .cur .noimg { width: 36px; height: 52px; object-fit: cover; border-radius: 4px; background: var(--border); flex: none; }
.cur-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.cur-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cur .bar { display: block; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.cur .bar > span { display: block; height: 100%; background: var(--accent); }

/* Recommendations */
.recs-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.recs-head h2 { margin: 0 0 4px; font-size: 20px; }
.recs-head p { margin: 0; max-width: 680px; }
.recs-head a { color: var(--accent-text); }
.grid.recs { margin-top: 12px; }
.card.rec { display: flex; gap: 12px; padding: 10px; }
.rec .cover { flex: 0 0 80px; height: 116px; border-radius: 6px; overflow: hidden; background: var(--border); display: grid; place-items: center; font-size: 28px; color: var(--muted); }
.rec .cover img { width: 100%; height: 100%; object-fit: cover; }
.rec .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rec .title { font-weight: 600; }
.rec .meta { color: var(--muted); font-size: 13px; }
.rec .because { color: var(--text); }
.rec .because b { font-weight: 600; }
.synopsis-clamp { margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rec .row { display: flex; justify-content: flex-end; gap: 6px; margin-top: auto; }
.rec .because { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Header actions */
.header-actions { display: flex; gap: 6px; align-items: center; }
.header-actions button { white-space: nowrap; }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  header.top { flex-wrap: wrap; padding: 10px 16px 0; padding-top: max(10px, env(safe-area-inset-top)); gap: 6px; }
  header.top h1 { flex: 1; }
  header.top .nav {
    order: 3; flex: 1 0 100%; margin: 0 -16px; padding: 4px 12px 6px; overflow-x: auto;
    scrollbar-width: none; gap: 2px;
  }
  header.top .nav::-webkit-scrollbar { display: none; }
  header.top .nav a { padding: 8px 12px; white-space: nowrap; }
  main { padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); }
  .card { padding: 14px; }
  .toolbar input { flex: 1 1 100%; }
  .toolbar select { flex: 1 1 0; min-width: 0; }
  .grid, .grid.recs { grid-template-columns: minmax(0, 1fr); }
  .cols { flex-wrap: wrap; }
  .cols > * { flex: 1 1 calc(50% - 10px); }
  dialog.editor { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; border: 0; padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  dialog.editor .actions { position: sticky; bottom: -16px; background: var(--surface); padding: 10px 0; margin-bottom: -10px; }
  .hero .hero-value { font-size: 40px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .recs-head { flex-wrap: wrap; }
  #link-list .url { display: none; }
  input, select, textarea { font-size: 16px; } /* stops iOS zooming into focused fields */
}

/* Bigger tap targets on touch screens */
@media (pointer: coarse) {
  .item .plus { min-height: 40px; min-width: 52px; }
  a.open { padding: 10px 12px; }
  button.small { min-height: 36px; }
  dialog.editor .season li label { padding: 9px 6px; }
  dialog.editor .season li label > input { width: 20px; height: 20px; }
  .season summary { padding: 10px 2px; }
  .tabs button { padding: 8px 14px; }
}

/* ================= Trakt-style redesign ================= */

/* Dark header bar in both themes */
header.top { background: var(--header-bg); color: var(--header-text); border-bottom: 0; position: sticky; top: 0; z-index: 5; }
header.top h1 { letter-spacing: .02em; }
header.top .nav a { color: rgb(241 242 244 / .65); font-weight: 500; }
@media (hover: hover) { header.top .nav a:hover { color: var(--header-text); } } /* not on touch screens: a tapped tab kept looking selected after going back */
header.top .nav a.active { color: var(--header-text); background: rgb(255 255 255 / .08); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 6px 6px 0 0; }
header.top .header-actions button { background: rgb(255 255 255 / .08); border-color: rgb(255 255 255 / .14); color: var(--header-text); }
main { max-width: 1200px; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.page-head h2 { margin: 0; font-size: 22px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: var(--surface); padding: 6px 12px; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.active { background: var(--accent); color: #fff; }
.chip { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 600; }

/* ---------- Poster grid ---------- */
.posters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 14px; }
.posters > * { min-width: 0; }
.poster { position: relative; display: flex; flex-direction: column; gap: 4px; }
.poster-img, .read-img {
  position: relative; display: block; aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden;
  background: var(--border); box-shadow: 0 2px 8px rgb(0 0 0 / .18); transition: transform .15s, box-shadow .15s;
}
.poster-img:hover, .read-img:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgb(0 0 0 / .28); }
.poster-img img, .read-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph { display: grid; place-items: center; width: 100%; height: 100%; font-size: 32px; color: var(--muted); background: var(--border); }
.poster .type-badge { position: absolute; top: 6px; left: 6px; background: rgb(0 0 0 / .65); color: #fff; }
.poster .rating-badge { position: absolute; top: 6px; right: 6px; background: var(--accent); color: #fff; }
.poster-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgb(0 0 0 / .45); }
.poster-bar > span { display: block; height: 100%; background: var(--accent); }
.poster-title { color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.poster-title:hover { color: var(--accent-text); }
.poster-meta { color: var(--muted); font-size: 12px; }
.poster-frame { position: relative; }
.poster-frame .poster-actions {
  position: absolute; right: 6px; bottom: 12px; display: flex; gap: 6px;
  opacity: 0; transition: opacity .15s; pointer-events: none;
}
.poster:hover .poster-actions, .poster:focus-within .poster-actions { opacity: 1; pointer-events: auto; }
.poster-actions .plus, .poster-actions .open { background: rgb(0 0 0 / .72); color: #fff; border: 1px solid rgb(255 255 255 / .25); backdrop-filter: blur(4px); }
.poster-actions .plus { padding: 4px 12px; font-weight: 700; }
.poster-actions.always { display: flex; gap: 6px; }
.poster-actions.always .plus, .poster-actions.always .open { background: var(--surface); color: var(--text); border-color: var(--border); backdrop-filter: none; }

/* ---------- Title page ---------- */
.title-page { margin: -16px -16px 0; }
.hero-band { position: relative; overflow: hidden; color: #fff; min-height: 340px; display: flex; align-items: flex-end; background: #111; }
.hero-band::before {
  content: ""; position: absolute; inset: 0; background: var(--hero-img) center 25% / cover no-repeat;
}
.hero-band.blurred::before { filter: blur(28px) saturate(1.2); transform: scale(1.2); opacity: .7; }
.hero-band::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgb(10 11 14 / .97) 0%, rgb(10 11 14 / .75) 45%, rgb(10 11 14 / .25) 100%),
              linear-gradient(to right, rgb(10 11 14 / .7), transparent 60%);
}
.hero-inner { position: relative; z-index: 1; display: flex; gap: 24px; align-items: flex-end; padding: 80px 24px 24px; width: 100%; max-width: 1200px; margin: 0 auto; }
.hero-poster { flex: 0 0 200px; aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden; box-shadow: 0 10px 30px rgb(0 0 0 / .5); background: #222; }
.hero-poster img, .hero-poster .ph { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.hero-info .crumbs { font-size: 13px; opacity: .8; }
.hero-info .crumbs a { color: #fff; }
.hero-info h1 { margin: 0; font-size: 34px; line-height: 1.15; text-shadow: 0 2px 10px rgb(0 0 0 / .4); }
.hero-info h1 .year { font-weight: 400; opacity: .7; font-size: .7em; }
.hero-info .alt { opacity: .75; font-size: 14px; }
.facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; opacity: .95; }
.facts .dot { opacity: .5; }
.genres { display: flex; flex-wrap: wrap; gap: 6px; }
.genre { font-size: 12px; padding: 2px 10px; border-radius: 999px; border: 1px solid rgb(255 255 255 / .35); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.hero-actions select, .hero-actions button:not(.primary) { background: rgb(255 255 255 / .1); color: #fff; border-color: rgb(255 255 255 / .25); }
.hero-actions select option { color: #000; }
.hero-actions a.open.big { padding: 8px 14px; font-size: 15px; color: #fff; border-color: rgb(255 255 255 / .5); }
.hero-progress { display: flex; align-items: center; gap: 10px; max-width: 420px; }
.hero-progress .bar { flex: 1; height: 6px; border-radius: 3px; background: rgb(255 255 255 / .2); overflow: hidden; display: block; }
.hero-progress .bar > span { display: block; height: 100%; background: var(--accent); }

.title-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; max-width: 1200px; margin: 16px auto 0; padding: 0 16px 16px; }
.main-col, .side-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.title-body h3 { margin: 0 0 8px; font-size: 16px; }
.synopsis { margin: 0; white-space: pre-line; line-height: 1.6; }
.side-col textarea { width: 100%; resize: vertical; }
.details label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.details label input { display: block; width: 100%; margin-top: 4px; color: var(--text); }
.episodes-page #ep-list { max-height: none; }
.season-bar { width: 80px; height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; display: inline-block; }
.season-bar > span { display: block; height: 100%; background: var(--accent); }
.episodes-page .season li label { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; cursor: pointer; }
.episodes-page .season li label:hover { background: var(--bg); }
.episodes-page .season li input { width: auto; margin: 0; }
.upnext-card { border-left: 4px solid var(--accent); }
.upnext-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.upnext-ep { font-size: 17px; margin: 2px 0; }
.cast { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 14px; }
.person img, .person .ph { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 8px; display: block; background: var(--border); }
.person .ph { font-size: 24px; }
.person-name { font-size: 13px; font-weight: 600; margin-top: 4px; line-height: 1.25; }

/* ---------- Up next strips ---------- */
#upnext:not(:empty) { margin-bottom: 16px; }
.strip + .strip { margin-top: 16px; }
.strip-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.strip-head h3 { margin: 0; font-size: 18px; }
.strip-row { display: grid; grid-auto-flow: column; grid-auto-columns: 260px; gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.strip-row > * { scroll-snap-align: start; }
.next-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.next-img { display: block; aspect-ratio: 16 / 9; background: var(--img) center / cover no-repeat, var(--border); position: relative; }
.next-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgb(0 0 0 / .55), transparent 55%); }
.next-left { position: absolute; left: 8px; bottom: 6px; z-index: 1; color: #fff; font-size: 12px; font-weight: 600; }
.next-card.upcoming .next-img { filter: grayscale(.6); opacity: .8; }
.next-body { padding: 8px 10px 10px; padding-right: 54px; min-width: 0; }
.next-title { color: var(--text); text-decoration: none; font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-body .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.next-card .check {
  position: absolute; right: 10px; bottom: 10px; width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent); color: #fff; border: 0; font-size: 18px; font-weight: 700; padding: 0;
}
.strip-row:has(.read-card) { grid-auto-columns: 140px; }
.read-card { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

/* ---------- History ---------- */
.day-head { position: sticky; top: 52px; z-index: 1; margin: 18px 0 6px; padding: 6px 0; font-size: 14px; background: var(--bg); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.h-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; background: var(--surface); border: 1px solid var(--border); margin-bottom: 6px; }
.h-row:hover { border-color: var(--accent); }
.h-thumb { flex: 0 0 36px; height: 54px; border-radius: 4px; overflow: hidden; background: var(--border); }
.h-thumb img, .h-thumb .ph { width: 100%; height: 100%; object-fit: cover; font-size: 16px; }
.h-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.h-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-body .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-meta { white-space: nowrap; display: flex; gap: 8px; align-items: center; }
#more { margin: 12px auto; }

/* ---------- Calendar ---------- */
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.cal-day { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px; min-height: 160px; display: flex; flex-direction: column; gap: 8px; }
.cal-day.today { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
.cal-day h3 { margin: 0; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.cal-ep { display: flex; flex-direction: column; border-radius: 8px; overflow: hidden; background: var(--bg); color: var(--text); text-decoration: none; border: 1px solid var(--border); }
.cal-ep:hover { border-color: var(--accent); }
.cal-img { display: block; aspect-ratio: 16 / 9; background: var(--img) center / cover no-repeat, var(--border); }
.cal-body { padding: 6px 8px; display: flex; flex-direction: column; min-width: 0; }
.cal-title { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-body .small { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ep.watched { opacity: .6; }

@media (max-width: 1000px) {
  .calendar { grid-template-columns: minmax(0, 1fr); }
  .cal-day { min-height: 0; }
  .cal-day.empty { display: none; }
  .cal-ep { flex-direction: row; }
  .cal-img { flex: 0 0 120px; aspect-ratio: 16 / 9; }
  .title-body { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .posters { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; }
  .poster-title { font-size: 13px; }
  .poster .poster-actions { opacity: 1; pointer-events: auto; }
  .title-page { margin: -12px -16px 0; }
  .hero-band { min-height: 0; }
  .hero-inner { flex-direction: column; align-items: flex-start; gap: 14px; padding: 60px 16px 18px; }
  .hero-poster { flex: none; width: 120px; }
  .hero-info h1 { font-size: 24px; }
  .title-body { padding: 0 16px 16px; }
  .strip-row { grid-auto-columns: 78%; }
  .strip-row:has(.read-card) { grid-auto-columns: 34%; }
  .day-head { top: 96px; }
  .h-meta .badge { display: none; }
}

/* Header: one row on wide screens, title + actions above a scrollable nav below 1200px (8 tabs + the buttons need ~1180px) */
header.top h1, header.top .nav a { white-space: nowrap; }
@media (max-width: 1200px) {
  header.top { flex-wrap: wrap; padding: 10px 16px 0; padding-top: max(10px, env(safe-area-inset-top)); gap: 6px; }
  header.top h1 { flex: 1; }
  header.top .nav {
    order: 3; flex: 1 0 100%; margin: 0 -16px; padding: 4px 12px 0; overflow-x: auto; scrollbar-width: none; gap: 2px;
  }
  header.top .nav::-webkit-scrollbar { display: none; }
  header.top .nav a { padding: 8px 12px; }
  .day-head { top: 96px; }
}

.upnext-row button { white-space: nowrap; flex: none; }

/* Chapter list (WeebCentral) */
#ch-actions { gap: 6px; }
/* Title page: room between the header row (⋯, ✓ Mark all read) and the chapter list's top border */
.chapters-card > .inline:first-child { margin-bottom: 10px; }
.ch-list { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; border-top: 1px solid var(--border); }
.ch-list li { display: flex; align-items: center; border-bottom: 1px solid var(--border); }
.ch-row { flex: 1; display: flex; align-items: center; gap: 10px; text-align: left; border: 0; border-radius: 0; background: transparent; padding: 8px 6px; min-width: 0; }
.ch-row:hover { background: var(--bg); }
.ch-check { width: 18px; color: var(--accent-text); font-weight: 700; flex: none; }
.ch-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-list li.read .ch-name { color: var(--muted); }
.ch-list li.next { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.ch-open { padding: 8px 12px; color: var(--accent-text); text-decoration: none; flex: none; }
.new-badge { position: absolute; top: 6px; left: 6px; background: var(--accent); color: #fff; }
.done-badge { position: absolute; top: 6px; left: 6px; background: rgb(0 0 0 / .65); color: #fff; }
@media (pointer: coarse) { .ch-row { padding: 12px 6px; } }

/* Chapter "Read" button: a real button instead of a bare arrow */
.ch-open {
  margin: 4px 8px 4px 4px; padding: 6px 14px; min-height: 34px; display: inline-flex; align-items: center;
  border: 1px solid var(--accent); border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap;
}
.ch-open:hover { background: var(--accent); color: #fff; }
.ch-list li.next .ch-open { background: var(--accent); color: #fff; }
@media (pointer: coarse) { .ch-open { min-height: 40px; padding: 8px 16px; } }
.ch-mark { margin: 4px 0 4px 4px; padding: 6px 12px; min-height: 34px; border-radius: 999px; font-size: 13px; white-space: nowrap; }
.ch-list li.next .ch-mark { border-color: var(--accent); color: var(--accent-text); }
@media (pointer: coarse) { .ch-mark { min-height: 40px; } }
@media (max-width: 640px) { .ch-mark { padding: 6px 10px; } .ch-list li .muted.small { display: none; } }

/* Hide from Up next */
.next-card, .read-card { position: relative; }
.hide-btn {
  position: absolute; top: 6px; right: 6px; z-index: 2; width: 28px; height: 28px; padding: 0; border-radius: 50%;
  background: rgb(0 0 0 / .6); color: #fff; border: 1px solid rgb(255 255 255 / .3); font-size: 13px; line-height: 1;
  opacity: 0; transition: opacity .15s;
}
.next-card:hover .hide-btn, .read-card:hover .hide-btn, .hide-btn:focus-visible { opacity: 1; }
@media (pointer: coarse) { .hide-btn { opacity: .85; width: 32px; height: 32px; } }
.read-card .new-badge, .read-card .done-badge { left: 6px; right: auto; }
.toast { display: flex; align-items: center; gap: 10px; }
.toast-action { background: transparent; color: inherit; border: 1px solid currentColor; padding: 2px 10px; font-weight: 600; }
.details button { display: block; width: 100%; margin-top: 8px; }

/* Continue reading cards use the Up next card style */
.next-img.from-cover { background-position: center 22%; }
.read-next .next-body { display: flex; flex-direction: column; gap: 4px; }
.read-btn {
  align-self: flex-start; margin-top: 2px; padding: 4px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--accent); color: var(--accent-text); text-decoration: none;
}
.read-btn:hover { background: var(--accent); color: #fff; }
.strip-row:has(.read-next) { grid-auto-columns: 260px; }
@media (max-width: 640px) { .strip-row:has(.read-next) { grid-auto-columns: 78%; } }

/* Continue reading: text-only cards */
.strip-row:has(.read-next) { grid-auto-columns: 230px; }
.read-next .next-body { padding: 12px 54px 12px 12px; }
.read-next .next-title { padding-right: 18px; }
.read-badge { align-self: flex-start; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--border); color: var(--text); }
.read-badge.is-new { background: var(--accent); color: #fff; }
.read-next .hide-btn { top: 8px; right: 8px; width: 24px; height: 24px; background: transparent; color: var(--muted); border-color: var(--border); }
.read-next .check { bottom: 12px; }
@media (max-width: 640px) { .strip-row:has(.read-next) { grid-auto-columns: 70%; } }

/* Continue reading: Up next-style card, whole cover art centred over a blurred fill */
.strip-row:has(.read-next) { grid-auto-columns: 260px; }
.read-next .next-body { padding: 8px 54px 10px 10px; }
.read-next .hide-btn { top: 6px; right: 6px; width: 28px; height: 28px; background: rgb(0 0 0 / .6); color: #fff; border-color: rgb(255 255 255 / .3); }
.read-next .check { bottom: 10px; }
.next-img.cover-art { overflow: hidden; background: #111; }
.next-img.cover-art::before {
  content: ""; position: absolute; inset: -20px; background: var(--img) center / cover no-repeat;
  filter: blur(18px) brightness(.6); transform: scale(1.1);
}
.next-img.cover-art img { position: relative; z-index: 0; display: block; height: 100%; width: auto; margin: 0 auto; object-fit: contain; }
.next-img.cover-art::after { z-index: 0; }
.next-left { z-index: 1; }
.next-left.is-new { background: var(--accent); padding: 1px 8px; border-radius: 999px; }
@media (max-width: 640px) { .strip-row:has(.read-next) { grid-auto-columns: 78%; } }

/* ===== Dashboard strips: one poster-card style for Up next and Continue reading ===== */
.strip-row:has(.poster-next), .strip-row:has(.read-next) { grid-auto-columns: 168px; }
.poster-next { display: flex; flex-direction: column; }
.next-cover {
  position: relative; display: block; aspect-ratio: 2 / 3; overflow: hidden; background: var(--border);
}
.next-cover img, .next-cover .ph { width: 100%; height: 100%; object-fit: cover; display: block; }
.next-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgb(0 0 0 / .55), transparent 35%); pointer-events: none; }
.next-cover .next-left { position: absolute; left: 8px; bottom: 8px; z-index: 1; color: #fff; font-size: 12px; font-weight: 700; }
.poster-next .next-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.poster-next .next-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
.poster-next .next-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-actions { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; padding-top: 6px; }
.next-actions .read-btn { margin: 0; }
.poster-next .check { position: static; margin-left: auto; width: 36px; height: 36px; flex: none; }
.poster-next .hide-btn { top: 6px; right: 6px; background: rgb(0 0 0 / .6); color: #fff; border-color: rgb(255 255 255 / .3); }
@media (max-width: 640px) { .strip-row:has(.poster-next) { grid-auto-columns: 42%; } }

/* Library posters: small Open button (no +1) */
.poster-actions .open { padding: 3px 10px; font-size: 12px; min-height: 0; line-height: 1.5; }
@media (pointer: coarse) { .poster-actions .open { padding: 4px 10px; font-size: 12px; } }
@media (max-width: 640px) { .poster-frame .poster-actions { right: 4px; bottom: 9px; } }

/* Sync back */
.sync-block { border-top: 1px solid var(--border); padding-top: 12px; }
.sync-block h3 { margin: 0 0 6px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.steps { margin: 4px 0 10px; padding-left: 20px; }
.steps li + li { margin-top: 4px; }
.steps code, .settings code { background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-size: 12px; word-break: break-all; }
.steps a, .sync-block a { color: var(--accent-text); }
.device-code { font-size: 20px; letter-spacing: .12em; padding: 0 6px; }

/* Watch on Crunchyroll */
.hero-actions a.open.watch { background: #c75000; border-color: #c75000; color: #fff; font-weight: 600; } /* 4.6:1 with white text */
.hero-actions a.open.watch:hover { filter: brightness(1.08); }

/* New releases strip */
#newrel:not(:empty) { margin-bottom: 18px; }
.small-seg button { padding: 4px 10px; font-size: 13px; }
.poster-next.seen { opacity: .6; }
.poster-next.seen .next-left { background: rgb(0 0 0 / .55); padding: 1px 8px; border-radius: 999px; }

/* More like this */
.similar-row { display: grid; grid-auto-flow: column; grid-auto-columns: 130px; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.similar-card { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.similar-cover { aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; background: var(--border); }
.similar-cover img, .similar-cover .ph { width: 100%; height: 100%; object-fit: cover; display: block; }
.similar-title { font-weight: 600; font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.similar-actions { display: flex; gap: 6px; margin-top: 2px; }
.similar-actions .primary { flex: 1; }
@media (max-width: 640px) { .similar-row { grid-auto-columns: 30%; } }
.cloud-list { list-style: none; margin: 6px 0; padding: 0; }
.cloud-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--border); font-size: 14px; }

/* Episode lists use the chapter-list row layout */
.ch-list.ep-list { max-height: none; overflow: visible; margin: 0 0 8px; }
.ch-list li.future { opacity: .55; }
.ch-list .ep-num { width: 2em; flex: none; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.season summary { border-bottom: 0; }

/* Season posters (title page) */
.season-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; margin-top: 8px; }
.season-card { display: flex; flex-direction: column; gap: 3px; padding: 0; text-align: left; background: transparent; border: 0; min-width: 0; }
.season-poster { position: relative; display: block; aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; background: var(--border); box-shadow: 0 2px 8px rgb(0 0 0 / .18); transition: transform .15s; }
.season-card:hover .season-poster { transform: translateY(-2px); }
.season-poster img, .season-poster .ph { width: 100%; height: 100%; object-fit: cover; display: block; }
.season-poster .chip { position: absolute; top: 6px; left: 6px; }
.season-done { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.season-card.has-next .season-poster { outline: 3px solid var(--accent); outline-offset: 2px; }
.season-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.season-view-head { display: flex; align-items: center; gap: 10px; margin: 6px 0 8px; flex-wrap: wrap; }
@media (max-width: 640px) { .season-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; } }

/* Cast links + actor pages */
a.person.linked { color: var(--text); text-decoration: none; }
a.person.linked:hover .person-name { color: var(--accent-text); }
a.person.linked img { transition: transform .15s; }
a.person.linked:hover img { transform: translateY(-2px); }
.person-page { display: flex; flex-direction: column; gap: 16px; }
.person-head { display: flex; gap: 18px; align-items: flex-start; }
.person-photo { flex: 0 0 140px; aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden; background: var(--border); }
.person-photo img, .person-photo .ph { width: 100%; height: 100%; object-fit: cover; display: block; }
.person-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.person-info h2 { margin: 0; font-size: 24px; }
.bio { margin: 4px 0 0; line-height: 1.55; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.bio.open { -webkit-line-clamp: unset; display: block; }
.credit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 16px 12px; margin-top: 8px; }
.credit-card { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.credit-cover { position: relative; display: block; aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; background: var(--border); }
.credit-cover img, .credit-cover .ph { width: 100%; height: 100%; object-fit: cover; display: block; }
a.credit-cover { text-decoration: none; color: var(--muted); }
.credit-cover .ph { display: grid; place-items: center; font-size: 28px; }
.credit-card.mine .credit-cover { outline: 3px solid var(--accent); outline-offset: 2px; }
.credit-status { position: absolute; left: 6px; bottom: 6px; background: var(--accent); color: #fff; }
.credit-title { font-weight: 600; font-size: 13px; line-height: 1.3; color: var(--text); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
a.credit-title:hover { color: var(--accent-text); }
.credit-role { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.credit-card button { align-self: flex-start; margin-top: 2px; }
/* Filmography: red round + bottom-left of the poster, like the Watchlist's */
.credit-cover-wrap { position: relative; }
.credit-card .credit-add { position: absolute; left: 6px; bottom: 6px; margin: 0; font-size: 18px; }
.credit-card .credit-add.done { opacity: 1; font-size: 14px; }
.filmo-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.filmo-head h3 { margin: 0; }
.filmo-head .seg button { padding: 4px 10px; }
@media (max-width: 640px) {
  .person-head { flex-direction: column; }
  .person-photo { flex: none; width: 120px; }
  .credit-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; }
}

/* New: separate Episodes / Chapters rows */
.new-group + .new-group { margin-top: 10px; }
.new-group h4 { margin: 4px 0 6px; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); display: flex; gap: 8px; align-items: baseline; }
.new-group h4 .muted { text-transform: none; letter-spacing: 0; }
.new-group > p { margin: 0 0 4px; }

/* Manga/manhwa categories */
/* Stays under the header while scrolling, so posters far down can still be dragged onto a tab. */
.cat-tabs { margin-top: 8px; padding: 6px 0 4px; position: sticky; top: var(--header-h, 52px); z-index: 4; background: var(--bg); }
#lib-cat-opts #cat-select.active { background: var(--accent); border-color: var(--accent); color: #fff; }
#grid.selecting .item { cursor: pointer; -webkit-touch-callout: none; user-select: none; }
#grid.selecting .item:not(.selected) { opacity: .55; }
.item.selected { opacity: 1; outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.item.selected .poster-frame::after { content: "✓"; position: absolute; top: 6px; left: 6px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; z-index: 2; }
.item.selected .type-badge { visibility: hidden; }
.select-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(12px, env(safe-area-inset-bottom)); z-index: 9; width: min(720px, calc(100% - 24px)); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 30px rgb(0 0 0 / .3); padding: 10px 12px; display: grid; gap: 8px; }
.select-head { display: flex; gap: 8px; align-items: center; }
.select-cats { display: flex; gap: 6px; align-items: center; overflow-x: auto; padding-bottom: 2px; }
.select-cats .cat-chip { white-space: nowrap; }
.select-cats .cat-chip:disabled { opacity: .4; }
.select-cats > span { white-space: nowrap; }
#view:has(.select-bar) { padding-bottom: 120px; }
body:has(.select-bar) .toast { bottom: 140px; }
.cat-tabs button { font-size: 14px; }
.cat-tabs .cat-count { display: inline-block; min-width: 1.6em; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--border); color: var(--text); font-size: 12px; }
.cat-tabs button.active .cat-count { background: rgb(255 255 255 / .25); color: #fff; }
.cat-tabs .cat-edit { margin-left: auto; background: transparent; }
.cat-tabs.drag-active button[data-cat]:not([data-cat=""]):not([data-cat="none"]) { border-style: dashed; border-color: var(--accent); }
.cat-tabs button.drop-target { background: var(--accent) !important; color: #fff; transform: scale(1.05); }
.item.dragging { opacity: .4; }
.poster[draggable="true"] .poster-img, .card.item[draggable="true"] { cursor: grab; }
.cat-edit-list { list-style: none; margin: 0; padding: 0; }
.cat-edit-list li { display: flex; gap: 6px; align-items: center; padding: 4px 0; }
.cat-edit-list li input { flex: 1; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-chip { border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.cat-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Cover picker */
.hero-poster { position: relative; }
.hero-poster .cover-img { width: 100%; height: 100%; }
.cover-change { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); white-space: nowrap; font-size: 12px; padding: 4px 10px; border-radius: 999px; background: rgb(0 0 0 / .65); color: #fff; border: 1px solid rgb(255 255 255 / .25); opacity: 0; transition: opacity .15s; }
.hero-poster:hover .cover-change, .cover-change:focus-visible { opacity: 1; }
@media (pointer: coarse) { .cover-change { opacity: 1; font-size: 11px; padding: 3px 8px; } }
dialog.cover-picker { width: min(760px, calc(100vw - 24px)); }
.cover-current { display: flex; gap: 12px; align-items: center; }
.cover-current .stack { flex: 1; min-width: 0; }
.cover-current form input { flex: 1; min-width: 0; }
.cover-thumb { flex: 0 0 70px; aspect-ratio: 2 / 3; border-radius: 6px; overflow: hidden; background: var(--border); }
.cover-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-group-title { margin: 14px 0 8px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cover-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.cover-option { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: var(--border); display: flex; flex-direction: column; text-align: left; }
.cover-option:hover, .cover-option:focus-visible { border-color: var(--accent); }
.cover-option img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; display: block; }
.cover-note { font-size: 11px; padding: 4px 6px; color: var(--muted); background: var(--surface); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .cover-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; } .cover-current { align-items: flex-start; } }

/* ===== Compact dashboard: smaller poster cards, actions on the cover ===== */
.strip + .strip { margin-top: 12px; }
#newrel:not(:empty) { margin-bottom: 12px; }
.strip-head { margin-bottom: 6px; }
.strip-head h3 { font-size: 16px; }
.new-group + .new-group { margin-top: 6px; }
.new-group h4 { margin: 2px 0 4px; font-size: 12px; }
.strip-row:has(.poster-next), .strip-row:has(.read-next) { grid-auto-columns: 128px; gap: 10px; padding-bottom: 6px; }
.next-media { position: relative; }
.next-cover::after { background: linear-gradient(to top, rgb(0 0 0 / .7), transparent 45%); }
.next-cover .next-left { left: 6px; bottom: 6px; font-size: 11px; }
/* ✓ and Read/Watch float over the bottom-right of the cover. */
.poster-next .next-actions { position: absolute; right: 6px; bottom: 6px; margin: 0; padding: 0; gap: 4px; justify-content: flex-end; z-index: 2; }
.poster-next .next-actions .read-btn { padding: 2px 7px; font-size: 11px; line-height: 1.5; min-height: 0; background: rgb(0 0 0 / .65); color: #fff; border: 1px solid rgb(255 255 255 / .3); border-radius: 999px; text-decoration: none; }
.poster-next .check { width: 30px; height: 30px; font-size: 14px; padding: 0; border-radius: 50%; }
.poster-next .next-body { padding: 6px 8px 8px; gap: 1px; }
.poster-next .next-title { -webkit-line-clamp: 1; font-size: 13px; }
.poster-next .next-line { font-size: 12px; }
@media (max-width: 640px) {
  .strip-row:has(.poster-next), .strip-row:has(.read-next) { grid-auto-columns: 31%; gap: 8px; }
  .poster-next .next-actions .read-btn { font-size: 10px; padding: 2px 6px; }
  .poster-next .check { width: 30px; height: 30px; }
}

/* ===== Compact library: smaller posters, one-line titles ===== */
.posters { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px 10px; }
.poster { gap: 2px; }
.poster-title { font-size: 13px; -webkit-line-clamp: 1; margin-top: 2px; }
.poster-meta { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poster .type-badge, .poster .rating-badge { top: 5px; font-size: 10px; padding: 1px 6px; }
.poster .type-badge { left: 5px; }
.poster .rating-badge { right: 5px; }
.poster-bar { height: 4px; }
.poster-actions .open { padding: 2px 8px; font-size: 11px; }
@media (max-width: 640px) {
  .posters { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 6px; }
  .poster-title { font-size: 12px; }
  .poster-meta { font-size: 10px; }
  .poster .type-badge, .poster .rating-badge { font-size: 9px; padding: 0 5px; }
  /* Too narrow for both badges: one type tab -> type is redundant; All -> keep the type. */
  .posters.typed .poster .type-badge, .posters:not(.typed) .poster .rating-badge { display: none; }
  .poster-actions .open { padding: 1px 6px; font-size: 10px; }
  .poster-frame .poster-actions { right: 3px; bottom: 7px; }
}

/* Type label only on the All tab; Airing filter button */
.posters.typed .poster .type-badge { display: none; }
.airing-toggle { white-space: nowrap; border-radius: 999px; }
.airing-toggle.active { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (max-width: 640px) { .toolbar select { flex: 1 1 0; min-width: 0; } .toolbar .airing-toggle { flex: none; padding: 6px 10px; } }

/* Watchlist */
.wl-hint { margin: 6px 0 10px; }
.poster-frame .wl-actions { opacity: 1; pointer-events: auto; left: 6px; right: 6px; justify-content: space-between; }
.wl-actions button { padding: 2px 8px; font-size: 11px; min-height: 0; line-height: 1.5; border-radius: 999px; background: rgb(0 0 0 / .72); color: #fff; border: 1px solid rgb(255 255 255 / .25); }
.wl-actions .wl-start { background: var(--accent); border-color: var(--accent); font-weight: 600; }
@media (max-width: 640px) { .poster-frame .wl-actions { left: 3px; right: 3px; } .wl-actions button { padding: 1px 6px; font-size: 10px; } }

/* Discover */
.dc-strip .similar-row { grid-auto-columns: 128px; gap: 10px; }
.dc-cover { position: relative; display: block; padding: 0; border: 0; width: 100%; cursor: pointer; }
.dc-cover .badge { position: absolute; font-size: 10px; padding: 1px 6px; }
.dc-badge { left: 5px; bottom: 5px; background: var(--accent); color: #fff; }
.dc-score { right: 5px; top: 5px; background: rgb(0 0 0 / .65); color: #fff; }
.dc-card .similar-title { -webkit-line-clamp: 1; }
.dc-card .muted.small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.dc-card .similar-actions button { padding: 3px 8px; font-size: 12px; }
dialog.dc-preview { width: min(640px, calc(100vw - 24px)); }
.dc-preview-body { display: flex; gap: 16px; }
.dc-preview-cover { flex: 0 0 150px; }
.dc-preview-cover img { width: 100%; border-radius: 8px; display: block; }
.dc-preview h2 { margin: 0; font-size: 20px; }
.dc-synopsis { max-height: 260px; overflow: auto; white-space: pre-line; margin: 4px 0 0; }
.dc-preview .actions { margin-top: 14px; }
@media (max-width: 640px) {
  .dc-strip .similar-row { grid-auto-columns: 31%; gap: 8px; }
  .dc-preview-body { flex-direction: column; }
  .dc-preview-cover { flex: none; width: 120px; }
}
.dc-hide { display: flex; align-items: center; gap: 6px; color: var(--muted); cursor: pointer; }
.dc-hide input { width: auto; margin: 0; }
.dc-hide[hidden] { display: none; }
.dc-known { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Preview page (Discover details) */
.pv-card { text-decoration: none; color: inherit; }
.pv-card .similar-cover { position: relative; }
.pv-card .dc-badge { position: absolute; font-size: 10px; padding: 1px 6px; }
.pv-note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.pv-details { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: 13px; }
.pv-details dt { color: var(--muted); }
.pv-details dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.pv-eps { display: flex; flex-direction: column; gap: 2px; padding: 0 0 8px; max-height: 480px; overflow: auto; }
.pv-ep { padding: 6px 4px; border-radius: 6px; }
.pv-ep:hover { background: var(--bg); }
.pv-ep.upcoming { opacity: .6; }
.pv-ep-head { display: flex; gap: 6px; align-items: baseline; font-size: 13px; }
.pv-ep-head .muted { white-space: nowrap; }
.pv-ep-overview { margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pv-ep:hover .pv-ep-overview { -webkit-line-clamp: unset; }
.pv-video { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000; }
.pv-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.preview-page .hero-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
a.credit-card { text-decoration: none; color: inherit; }
a.credit-card .credit-title { color: var(--text); font-weight: 600; }

/* Discover: seasonal anime */
.dc-seasonal { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border); }
.dc-season-head { flex-wrap: wrap; justify-content: space-between; }
.dc-season-nav { display: flex; align-items: center; gap: 8px; }
.dc-season-nav b { min-width: 96px; text-align: center; }
.dc-season-group { margin-top: 10px; }
.dc-season-group h4 { margin: 4px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.dc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 14px 10px; }
@media (max-width: 640px) { .dc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; } }
.dc-season-toggle { display: flex; align-items: baseline; gap: 8px; background: none; border: 0; padding: 0; color: inherit; cursor: pointer; text-align: left; }
.dc-season-toggle h3 { margin: 0; }
.dc-caret { display: inline-block; width: 1em; color: var(--muted); }

/* Library: "N new" chapters tag (manga/manhwa), like Continue reading */
.poster .new-badge { position: absolute; left: 5px; top: 24px; bottom: auto; right: auto; height: auto; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; z-index: 1; text-transform: none; }
.posters.typed .poster .new-badge { top: 5px; } /* type label hidden on a type tab */
.new-text { color: var(--accent-text); }
@media (max-width: 640px) { .poster .new-badge { font-size: 10px; padding: 0 6px; left: 3px; } }

/* Notifications (top right) */
header.top .header-actions { position: relative; display: flex; align-items: center; gap: 6px; }
.nf-btn { position: relative; padding: 4px 8px; line-height: 1.2; }
.nf-btn.open { background: rgb(255 255 255 / .2) !important; }
.nf-count { position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px var(--header-bg); }
.nf-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 20; width: min(380px, calc(100vw - 24px)); max-height: min(70vh, 560px); overflow: auto; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 40px rgb(0 0 0 / .35); }
.nf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 12px 14px 8px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.nf-list { display: flex; flex-direction: column; padding: 4px; }
.nf-row { display: flex; align-items: center; gap: 6px; border-radius: 8px; padding-right: 8px; }
.nf-row:hover { background: var(--bg); }
.nf-row.is-new { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.nf-main { display: flex; gap: 10px; align-items: center; flex: 1; min-width: 0; padding: 7px 8px; color: inherit; text-decoration: none; }
.nf-thumb { flex: 0 0 34px; height: 50px; border-radius: 5px; overflow: hidden; background: var(--border); }
.nf-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nf-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.nf-text > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nf-title { font-weight: 600; font-size: 13px; }
.nf-read { white-space: nowrap; color: var(--accent-text); text-decoration: none; }
.nf-empty { padding: 14px; margin: 0; }
@media (max-width: 640px) { .nf-panel { position: fixed; top: calc(var(--header-h, 95px) + 4px); right: 12px; left: 12px; width: auto; } }

/* Library check */
.checkup-card h2 { margin: 0; }
.checkup-group h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; }
.checkup-list { list-style: none; margin: 8px 0 0; padding: 0; }
.checkup-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.checkup-list li:first-child { border-top: 0; }
.ck-main { flex: 1; min-width: 0; }
.ck-main a { color: var(--text); text-decoration: none; }
.ck-main a:hover { color: var(--accent-text); }
.ck-actions { display: flex; gap: 6px; flex: none; }
@media (max-width: 640px) { .checkup-list li { flex-direction: column; align-items: stretch; } .ck-actions { justify-content: flex-end; } }

/* Discover search */
.dc-search { display: flex; gap: 8px; margin: 10px 0 4px; }
.dc-search input { flex: 1; min-width: 0; }
.dc-results { margin-top: 8px; }
.pv-ch-candidates { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
#pv-chapters .pv-ep-head .ch-open { margin-left: 8px; text-decoration: none; }

/* In-app reader (long strip) */
body.reader-mode { background: #000; }
body.reader-mode header.top { display: none; }
body.reader-mode #view { padding: 0; max-width: none; margin: 0; }
.reader { min-height: 100vh; background: #000; color: #eee; }
.reader-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top));
  background: rgb(15 15 18 / .92); backdrop-filter: blur(6px); transition: transform .2s; }
.reader-bar.hidden { transform: translateY(-110%); }
.reader-back { color: #fff; text-decoration: none; font-size: 22px; line-height: 1; padding: 2px 6px; }
.reader-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.reader-info b, .reader-info span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-info span { color: #aaa; }
.reader-page { color: #aaa; white-space: nowrap; font-variant-numeric: tabular-nums; }
.reader-ext { color: #aaa; text-decoration: none; }
.reader-strip { max-width: 820px; margin: 0 auto; padding-top: 0; }
.reader-chapter img { display: block; width: 100%; height: auto; min-height: 200px; background: #111; }
.reader-chapter img[src] { min-height: 0; }
.reader-chapter img.broken { min-height: 160px; display: grid; place-items: center; color: #aaa; font-size: 13px; cursor: pointer; }
.reader-divider { padding: 70px 16px 14px; text-align: center; color: #bbb; font-size: 14px; letter-spacing: .04em; }
.reader-chapter-end { height: 2px; }
.reader-end { max-width: 820px; margin: 0 auto; padding: 40px 16px 80px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.reader-error { padding: 90px 16px; text-align: center; }
.ch-ext { padding: 4px 8px; color: var(--muted); text-decoration: none; font-size: 13px; }
.ch-ext:hover { color: var(--accent-text); }

/* Reader: chapter list, settings, prev/next, zoom, fallback source */
.reader-info { background: none; border: 0; color: inherit; text-align: left; padding: 0; cursor: pointer; }
.reader-btn { background: none; border: 0; color: #ddd; font-size: 20px; line-height: 1; padding: 4px 8px; min-height: 0; }
.reader-btn:disabled { opacity: .3; }
.reader-pop { position: fixed; top: calc(52px + env(safe-area-inset-top)); right: 10px; left: auto; z-index: 31; width: min(380px, calc(100vw - 20px)); max-height: 70vh; overflow: auto;
  background: #18181c; color: #eee; border: 1px solid #333; border-radius: 12px; box-shadow: 0 12px 40px rgb(0 0 0 / .6); }
.reader-pop-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid #2a2a30; position: sticky; top: 0; background: #18181c; }
.reader-pop-head button { background: none; border: 0; color: #aaa; }
.reader-ch-list { display: flex; flex-direction: column; padding: 4px; }
.reader-ch-list a { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 6px; color: #eee; text-decoration: none; font-size: 14px; }
.reader-ch-list a:hover { background: #24242a; }
.reader-ch-list a.read { color: #888; }
.reader-ch-list a.current { background: var(--accent); color: #fff; }
.reader-ch-list a .muted { color: inherit; opacity: .7; }
.reader-settings { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.reader-settings .seg button { background: #24242a; color: #ddd; border-color: #333; }
.reader-settings .seg button.active { background: var(--accent); color: #fff; }
.reader-check { display: flex; gap: 8px; align-items: center; }
.reader-check input { width: auto; margin: 0; }
.reader.full-width .reader-strip { max-width: none; }
.reader-strip { touch-action: manipulation; } /* our double-tap zoom instead of the browser's */
.reader.zoomed .reader-strip { margin: 0; }
.reader-alt { color: #8fb3ff; margin-top: 4px; }
.reader-link { display: block; margin: 6px auto 0; background: none; border: 0; color: #777; text-decoration: underline; font-size: 12px; min-height: 0; }
.reader-link:hover { color: #bbb; }

/* Library check reminder */
#nav a.has-dot { position: relative; }
#nav a.has-dot::after { content: ""; position: absolute; top: 4px; right: 2px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--header-bg); }
.new-dot { background: var(--accent); color: #fff; font-size: 10px; padding: 1px 6px; }

/* ================= Appearance: themes + options (Settings → Appearance) =================
   Themes only redefine the shared tokens; set on <html> as data-skin, data-density, data-poster, data-corners. */
body { font-family: var(--font-body, system-ui, -apple-system, "Segoe UI", sans-serif); }
h1, h2, h3, .page-head h2, header.top h1 { font-family: var(--font-display, inherit); }
header.top { background: var(--header-bg-image, var(--header-bg)); }
header.top .nav a { color: var(--header-nav, rgb(241 242 244 / .65)); }
header.top .nav a.active { background: var(--header-active, rgb(255 255 255 / .08)); }
header.top .header-actions button { background: var(--header-chip, rgb(255 255 255 / .08)); border-color: var(--header-chip-line, rgb(255 255 255 / .14)); }

html:root[data-skin="midnight"] { color-scheme: dark; --bg: #000; --surface: #0b0d10; --text: #e9edf1; --muted: #8b939e; --border: #1d2127;
  --accent: #2fb8a3; --accent-text: #4fd8c2; --header-bg: #000; --header-text: #e9edf1; --danger: #ff6b6b;
  --font-body: "Manrope", system-ui, sans-serif; --font-display: "Manrope", system-ui, sans-serif;
  --grid: #1d2127; --axis-line: #2a3038; --tick: #8b939e; }
html:root[data-skin="velvet"] { color-scheme: dark; --bg: #17121f; --surface: #211a2c; --text: #efe9f7; --muted: #a596b8; --border: #33283f;
  --accent: #b44ff0; --accent-text: #d595ff; --header-bg: #2a1340; --header-bg-image: linear-gradient(100deg, #2a1340, #4b1f5c 55%, #6a2350);
  --header-text: #fff; --header-nav: rgb(255 255 255 / .72); --header-active: rgb(255 255 255 / .14); --danger: #ff7a8a;
  --font-body: "Outfit", system-ui, sans-serif; --font-display: "Outfit", system-ui, sans-serif;
  --grid: #33283f; --axis-line: #45384f; --tick: #a596b8; }
html:root[data-skin="paper"] { color-scheme: light; --bg: #f2f3ef; --surface: #fbfbf8; --text: #1d2330; --muted: #5d6676; --border: #c9cdd3;
  --accent: #1f4fa3; --accent-text: #1f4fa3; --header-bg: #f2f3ef; --header-text: #1d2330; --header-nav: rgb(29 35 48 / .65);
  --header-active: transparent; --header-chip: #e3e5e1; --header-chip-line: #c9cdd3; --danger: #c0392b;
  --font-body: "IBM Plex Sans", system-ui, sans-serif; --font-display: "Fraunces", Georgia, serif; }
html:root[data-skin="sakura"] { color-scheme: light; --bg: #fff7f9; --surface: #ffffff; --text: #35232c; --muted: #8a6f7c; --border: #f1d9e2;
  --accent: #d9467c; --accent-text: #c43a6d; --header-bg: #ffe9f0; --header-text: #4a2a38; --header-nav: rgb(74 42 56 / .65);
  --header-active: #ffffff; --header-chip: #ffffff; --header-chip-line: #f1d9e2; --danger: #c62e5a;
  --font-body: "Nunito", system-ui, sans-serif; --font-display: "Nunito", system-ui, sans-serif; }
html:root[data-skin="slate"] { color-scheme: dark; --bg: #1a1d23; --surface: #22262d; --text: #e6e8ec; --muted: #9298a4; --border: #2f343d;
  --accent: #e9952b; --accent-text: #f2b259; --header-bg: #22262d; --header-text: #e6e8ec; --danger: #ff7b6b;
  --font-body: "Sora", system-ui, sans-serif; --font-display: "Sora", system-ui, sans-serif;
  --grid: #2f343d; --axis-line: #3d434d; --tick: #9298a4; }
html:root[data-skin="crimson"] { color-scheme: dark; --bg: #0b0b0c; --surface: #151517; --text: #f2f2f3; --muted: #a3a3aa; --border: #2a2a2f;
  --accent: #e11d2e; --accent-text: #ff4655; --header-bg: #120607; --header-bg-image: linear-gradient(90deg, #0b0b0c 0%, #24070b 55%, #5c0d16 100%);
  --header-text: #fff; --header-nav: rgb(255 255 255 / .7); --header-active: rgb(225 29 46 / .22); --danger: #ff5c6c;
  --font-body: "Archivo", system-ui, sans-serif; --font-display: "Archivo", system-ui, sans-serif;
  --grid: #2a2a2f; --axis-line: #3a3a40; --tick: #a3a3aa; }

/* Theme details beyond colours */
html[data-skin="paper"] header.top { border-bottom: 1px solid var(--border); }
html[data-skin="paper"] header.top .nav a.active, html[data-skin="sakura"] header.top .nav a.active { color: var(--header-text); }
html[data-skin="midnight"] :is(.poster-img, .next-card, .similar-cover, .season-poster, .card),
html[data-skin="paper"] :is(.poster-img, .next-card, .similar-cover, .season-poster) { box-shadow: none; border: 1px solid var(--border); }
html[data-skin="velvet"] :is(.poster-img, .next-card, .similar-cover) { box-shadow: 0 8px 22px rgb(160 70 255 / .22); border-radius: 16px; }
html[data-skin="sakura"] :is(.poster-img, .next-card, .similar-cover, .card) { box-shadow: 0 6px 16px rgb(217 70 124 / .14); border-radius: 18px; }
html[data-skin="crimson"] :is(.poster-img, .next-card, .similar-cover) { box-shadow: 0 6px 18px rgb(0 0 0 / .6); }
html[data-skin="crimson"] .poster:hover .poster-img, html[data-skin="crimson"] .next-card:hover { box-shadow: 0 0 0 2px var(--accent), 0 8px 24px rgb(225 29 46 / .35); }
html[data-skin="crimson"] :is(h2, h3) { letter-spacing: .01em; font-weight: 800; }
html[data-skin="crimson"] .tabs button.active { box-shadow: 0 0 14px rgb(225 29 46 / .45); }

/* Corners: sharp everywhere a card or button is rounded (round dots stay round) */
html[data-corners="sharp"] :is(.card, .poster-img, .next-card, .next-cover, .similar-cover, .season-poster, .hero-poster, .credit-cover, .dc-cover,
  button:not(.check):not(.nf-btn), input, select, textarea, dialog, .tabs button, .badge, .chip, .cat-chip, .read-btn, .open, .nf-panel, .select-bar,
  .person img, .toast, .cover-option, .reader-pop) { border-radius: 3px !important; }

/* Density: poster sizes (Library, Watchlist, Discover, Dashboard rows) */
html[data-density="compact"] .posters { grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 10px 8px; }
html[data-density="compact"] :is(.strip-row:has(.poster-next), .dc-strip .similar-row) { grid-auto-columns: 108px; }
html[data-density="compact"] .dc-grid { grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); }
html[data-density="roomy"] .posters { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px 14px; }
html[data-density="roomy"] :is(.strip-row:has(.poster-next), .dc-strip .similar-row) { grid-auto-columns: 168px; }
html[data-density="roomy"] .dc-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
@media (max-width: 640px) {
  html[data-density="compact"] :is(.posters, .dc-grid) { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px 5px; }
  html[data-density="compact"] :is(.strip-row:has(.poster-next), .dc-strip .similar-row) { grid-auto-columns: 26%; }
  html[data-density="roomy"] :is(.posters, .dc-grid) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; }
  html[data-density="roomy"] :is(.strip-row:has(.poster-next), .dc-strip .similar-row) { grid-auto-columns: 42%; }
}

/* Poster style (Library & Watchlist posters, Discover cards): title on the cover, or cover only */
html[data-poster="overlay"] .poster { position: relative; }
html[data-poster="overlay"] .poster .poster-frame::after { content: ""; position: absolute; inset: 40% 0 0; border-radius: 0 0 8px 8px; pointer-events: none;
  background: linear-gradient(transparent, rgb(0 0 0 / .85)); }
html[data-poster="overlay"] .poster :is(.poster-title, .poster-meta) { position: absolute; left: 7px; right: 7px; z-index: 2; color: #fff; pointer-events: none; text-shadow: 0 1px 3px rgb(0 0 0 / .6); }
html[data-poster="overlay"] .poster .poster-title { bottom: 22px; }
html[data-poster="overlay"] .poster .poster-title:last-child { bottom: 7px; }
html[data-poster="overlay"] .poster .poster-meta { bottom: 7px; color: rgb(255 255 255 / .82); }
html[data-poster="overlay"] .poster .poster-actions { bottom: auto; top: 28px; }
html[data-poster="overlay"] .poster-bar { z-index: 3; }
html[data-poster="cover"] :is(.poster .poster-title, .poster .poster-meta, .dc-card .similar-title, .dc-card .muted.small) { display: none; }

/* Appearance picker (Settings) */
.skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.skin-opt { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 2px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; }
.skin-opt[aria-pressed="true"] { border-color: var(--accent); }
.skin-swatch { display: flex; height: 38px; border-radius: 6px; overflow: hidden; }
.skin-swatch i { flex: 1; }
.skin-opt b { font-size: 14px; }
.skin-opt span { font-size: 12px; color: var(--muted); }
.appearance-opts { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.appearance-opts > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.appearance-opts > .mode-opt[hidden] { display: none; }

/* Header search */
.hs-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 21; width: min(420px, calc(100vw - 24px)); background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 40px rgb(0 0 0 / .35); overflow: hidden; }
.hs-panel input { width: 100%; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 12px 14px; font-size: 15px; background: var(--surface); color: var(--text); }
.hs-panel input:focus { outline: none; }
.hs-results { max-height: min(60vh, 480px); overflow: auto; padding: 4px; display: flex; flex-direction: column; }
.hs-row { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; color: var(--text); text-decoration: none; }
.hs-row.active, .hs-row:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.hs-discover { color: var(--accent-text); font-size: 13px; padding: 10px 8px; border-top: 1px solid var(--border); border-radius: 0; margin-top: 4px; }
.hs-empty { padding: 12px; margin: 0; }
.hs-head { margin: 8px 8px 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 640px) { .hs-panel { position: fixed; top: calc(var(--header-h, 95px) + 4px); left: 12px; right: 12px; width: auto; } }

/* Year in review */
.yr-tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.yr-highlights { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.yr-hl { display: flex; flex-direction: column; gap: 4px; }
.yr-big { font-size: 26px; font-weight: 700; color: var(--accent-text); font-family: var(--font-display, inherit); }
.yr-first a { color: var(--text); text-decoration: none; font-size: 18px; }
.yr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 14px 10px; margin-top: 8px; }
.yr-item { display: flex; flex-direction: column; gap: 3px; color: var(--text); text-decoration: none; min-width: 0; }
.yr-item b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yr-cover { aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; background: var(--border); display: block; }
.yr-cover img, .yr-cover .ph { width: 100%; height: 100%; object-fit: cover; display: grid; place-items: center; }
.yr-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.yr-types > div { display: flex; flex-direction: column; }
#view > .card + .card, .yr-highlights + .card, .yr-tiles + .yr-highlights { margin-top: 12px; }
@media (max-width: 640px) { .yr-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .yr-big { font-size: 22px; } }

/* ---------- Phone polish ---------- */
@media (max-width: 640px) {
  /* Header: title + icon buttons on one row, nav scrolls below */
  header.top .header-actions { gap: 4px; }
  header.top .header-actions button { padding: 6px 7px; min-width: 32px; }
  header.top .lbl { display: none; }
  header.top h1 { font-size: 16px; flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

  /* Chapter / episode rows: icon buttons so the chapter name stays readable */
  .ch-list .lbl { display: none; }
  .ch-mark { margin: 4px 0 4px 2px; padding: 0; width: 36px; min-height: 36px; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; }
  .ch-open { margin: 4px 2px 4px 4px; padding: 0 12px; min-height: 36px; font-size: 13px; }
  .ch-ext { padding: 4px 6px 4px 2px; }
  .ch-row { gap: 6px; padding-left: 2px; padding-right: 4px; }
  .ch-check { width: 14px; }
  .ch-row .chip { display: none; }

  /* Title page: less empty space above, small poster beside the title, buttons full width below.
     The last (1fr) row soaks up the poster's extra height so the text lines don't spread apart. */
  .hero-inner { display: grid; grid-template-columns: 96px minmax(0, 1fr); grid-template-rows: repeat(5, auto) 1fr; column-gap: 14px; row-gap: 4px; align-items: start; padding: 20px 16px 16px; }
  .hero-poster { grid-column: 1; grid-row: 1 / 7; width: 96px; }
  .hero-info { display: contents; }
  .hero-info > * { grid-column: 2; }
  .hero-info > .hero-actions, .hero-info > .hero-progress { grid-column: 1 / -1; }
  .hero-actions { margin-top: 10px; }
  .hero-info h1 { font-size: 21px; line-height: 1.2; }
  .cover-change { font-size: 0; padding: 3px 7px; }
  .cover-change::before { content: "🖼"; font-size: 13px; }
}

header.top .ico { vertical-align: -2px; }

/* Header ↻: check manhwa for new chapters */
#ch-check-all .spin-ico { display: inline-block; font-size: 15px; line-height: 1; }
#ch-check-all.spinning .spin-ico { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Dashboard cards: "N new" / day badge top-left (like the Library), link icon bottom-left, ✓ bottom-right */
.poster-next .next-cover .next-left { top: 6px; left: 6px; bottom: auto; padding: 1px 7px; border-radius: 999px; background: rgb(0 0 0 / .65); font-size: 11px; font-weight: 700; line-height: 1.5; }
.poster-next .next-cover .next-left.is-new { background: var(--accent); }
.poster-next .next-actions { left: 6px; right: 6px; justify-content: space-between; align-items: center; }
.poster-next .next-actions .read-btn.icon-btn { width: 30px; height: 30px; padding: 0; display: inline-grid; place-items: center; border-radius: 50%; }
.poster-next .next-actions .read-btn.cr { background: none; border: 0; }
.poster-next .next-actions .read-btn.cr svg { width: 28px; height: 28px; filter: drop-shadow(0 1px 2px rgb(0 0 0 / .5)); }
@media (max-width: 640px) { .poster-next .next-actions .read-btn.icon-btn { padding: 0; } }

/* Calendar: expected chapters (from the usual release day) are dashed; late ones get the accent */
.cal-ep.cal-ch.expected, .cal-ep.cal-ch.late { border-style: dashed; background: transparent; }
.cal-ep.cal-ch.expected .cal-img { opacity: .6; }
.cal-ep.cal-ch.late { border-color: var(--accent); }
.cal-ep.cal-ch.late .muted { color: var(--accent-text); }

.results li.results-head { margin-top: 10px; font-weight: 600; }

/* Private library */
.private-add { margin-bottom: 12px; }
.private-add .inline input { flex: 1; min-width: 0; }
#pv-filter { margin-bottom: 12px; }

/* Settings: folding sections (Appearance, Tools) */
details.fold > summary { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; cursor: pointer; list-style: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h2 { margin: 0; }
details.fold > summary::after { content: "▸"; margin-left: auto; color: var(--muted); font-size: 14px; transition: transform .15s; }
details.fold[open] > summary::after { transform: rotate(90deg); }
details.fold .fold-body { margin-top: 12px; }
details.fold > summary .open { margin-left: auto; }
details.fold > summary:has(.open)::after { margin-left: 0; }
details.fold > summary { align-items: center; }
details.fold > summary { flex-wrap: nowrap; }
details.fold > summary h2 { flex: none; }
details.fold > summary > span.muted { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-hint { margin: 4px 0 8px; }
/* Private → Discover */
#pv-tabs { margin-bottom: 12px; }
.pd-controls { flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pd-controls .seg { overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.pd-controls .seg button { white-space: nowrap; }
#pd-grid.hide-mine .dc-card.mine { display: none; }
.pd-controls .dc-hide { flex: none; width: auto; white-space: nowrap; margin: 0; }
.pd-more { display: flex; justify-content: center; margin: 14px 0 6px; }

/* Stats: time left, streaks, habits */
#stats-left, #stats-more { display: contents; }
#view > .tiles + #stats-left > .tiles, #stats-left > .tiles + .card, #stats-left > .card { margin-top: 12px; }
#stats-more > .two-col { margin-top: 12px; }
.left-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 10px; }
.left-block { background: var(--bg); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.almost-head { margin: 16px 0 6px; font-size: 14px; }
.almost { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.almost a { display: flex; gap: 10px; align-items: center; color: var(--text); text-decoration: none; padding: 6px; border-radius: 8px; border: 1px solid var(--border); min-width: 0; }
.almost a:hover { border-color: var(--accent); }
.almost img, .almost .ph { width: 38px; height: 54px; object-fit: cover; border-radius: 4px; flex: none; display: grid; place-items: center; background: var(--border); }
.almost .cur-body { display: flex; flex-direction: column; min-width: 0; }
.almost .cur-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: 14px; }
@media (max-width: 640px) { .streak-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .streak-tiles .tile-value { font-size: 20px; } .left-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .streak-tiles .tile { padding: 12px; } }
.series-all { margin-bottom: 10px; flex-wrap: wrap; }
.rec a.title { color: var(--text); text-decoration: none; }
.rec a.title:hover, .rec .plus-wrap:has(a.cover:hover) + .body a.title { color: var(--accent-text); }

/* Dashboard New: chapter cards have only the book link, bottom right */
.poster-next.link-right .next-actions { justify-content: flex-end; }

/* Small choice dialog (e.g. "you're not caught up yet") */
dialog.choice-dialog { max-width: min(420px, calc(100vw - 32px)); width: 100%; border: 1px solid var(--border); border-radius: 12px; padding: 18px; background: var(--surface); color: var(--text); }
dialog.choice-dialog::backdrop { background: rgb(0 0 0 / .5); }
dialog.choice-dialog h3 { margin: 0 0 8px; font-size: 17px; }
dialog.choice-dialog p { margin: 0 0 16px; color: var(--muted); line-height: 1.45; }
.choice-actions { display: flex; flex-direction: column; gap: 8px; }
.choice-actions button { width: 100%; min-height: 42px; }
/* IMDb button on title pages (IMDb's own yellow) */
.hero-actions a.open.imdb, .person-links a.open.imdb { background: #f5c518; border-color: #f5c518; color: #000; font-weight: 700; }
/* Library search on phones: a slim bar instead of a tall field (font stays 16px so iOS doesn't zoom) */
@media (max-width: 640px) {
  .toolbar input[type="search"] { padding: 5px 10px 5px 32px; min-height: 0; height: 36px; line-height: 1.2;
    background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 11px center; }
  .toolbar { gap: 6px; margin-top: 8px; }
  .toolbar select, .toolbar .airing-toggle { height: 36px; padding-top: 4px; padding-bottom: 4px; }
}
.wl-section { margin: 18px 0 10px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.wl-section:first-child { margin-top: 4px; }
.wl-count { font-weight: 400; opacity: .75; }
.person-links { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
button.danger-fill { background: var(--danger); border-color: var(--danger); color: #fff; }
.al-auto { gap: 8px; font-size: 14px; }
.al-auto input { width: auto; flex: none; } /* a checkbox: not stretched like text inputs in .inline */

/* Settings → Timeline */
.tl-day { border-top: 1px solid var(--border); padding: 8px 0; }
.tl-day > summary { cursor: pointer; list-style: none; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tl-day > summary::-webkit-details-marker { display: none; }
.tl-day > summary::before { content: "▸"; color: var(--muted); }
.tl-day[open] > summary::before { content: "▾"; }
.tl-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tl-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: start; font-size: 14px; line-height: 1.35; }
.tl-kind { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 6px; border-radius: 999px; margin-top: 1px; }
.tl-new { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-text); }
.tl-fix { background: color-mix(in srgb, #e9952b 22%, transparent); color: #c27712; }
.tl-speed { background: color-mix(in srgb, #2fb8a3 22%, transparent); color: #1f8c7c; }
.tl-time { white-space: nowrap; }
.dc-strip .dc-grid { margin-top: 4px; }
.dc-count { margin-bottom: 6px; }
#dc-body > .pd-controls { margin-top: 16px; }
.dc-seasonal:first-child, .pd-controls + .dc-seasonal { margin-top: 0; padding-top: 0; border-top: 0; }
.dc-more { display: flex; justify-content: center; margin: 12px 0 4px; }
.dc-more button { min-width: 160px; }
/* Tab rows still scroll sideways by swiping, without a visible scroll bar */
.tabs { scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.more-fields > summary { cursor: pointer; padding: 4px 0; }
.more-fields[open] > summary { margin-bottom: 10px; }
a.similar-title { color: var(--text); text-decoration: none; display: -webkit-box; }
a.similar-cover { display: block; }
header.top h1 a.home-link { color: inherit; text-decoration: none; }
details.fold > summary h3 { margin: 0; }
details.fold > summary .ref { white-space: nowrap; }
/* Logo in the top bar: the monitor + book, drawn in the header's text colour (works in every theme) */
header.top h1 a.home-link { display: inline-flex; align-items: center; gap: 8px; }
.logo-mark { width: 24px; height: 24px; flex: none; background: currentColor;
  -webkit-mask: url("/logo-mark.png") center / contain no-repeat; mask: url("/logo-mark.png") center / contain no-repeat; }
@media (max-width: 640px) { .logo-mark { width: 22px; height: 22px; } header.top h1 a.home-link { gap: 6px; } }
/* Log out: bottom of Settings; on phones the top-bar button goes, so the name fits */
.settings-logout { display: flex; justify-content: center; margin: 18px 0 8px; }
.settings-logout button { min-width: 160px; }
@media (max-width: 640px) { header.top #logout { display: none; } }

/* Chapter list: tap reads, hold opens the menu; release dates also on phones; 📖 instead of "Read" */
.ch-list .ch-row { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.ch-list .ch-date { white-space: nowrap; flex: none; }
.ch-list a.ch-open.icon-btn { width: 36px; height: 36px; min-height: 0; padding: 0; margin: 4px 6px 4px 4px; display: inline-grid; place-items: center; border-radius: 50%; flex: none; }
.ch-list a.ch-open.icon-btn svg { width: 17px; height: 17px; }
@media (max-width: 640px) {
  .ch-list li .muted.small.ch-date { display: inline; font-size: 11px; }
  .ch-list .ch-row { gap: 8px; }
}
#ch-actions .ch-more { min-width: 34px; font-weight: 700; letter-spacing: .05em; }

/* Library ⋯: layout / status / airing / sort folded into a panel */
.lib-more { min-width: 40px; font-weight: 700; letter-spacing: .05em; position: relative; }
.lib-more.active { background: var(--bg); border-color: var(--accent); }
.lib-more.has-dot::after { content: ""; position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.lib-opts { display: flex; flex-wrap: wrap; gap: 12px 18px; padding: 12px 14px; margin: 8px 0 4px; }
.lib-opt { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lib-opt select { width: auto; }
@media (max-width: 640px) { .lib-opts { flex-direction: column; gap: 10px; } .lib-opt > .small { min-width: 52px; } }
.lib-opts[hidden] { display: none; }

/* Settings → Usage */
.usage-row { display: grid; gap: 4px; }
.usage-label { display: flex; justify-content: space-between; gap: 8px; }
.usage-sub { font-size: .95rem; margin: 10px 0 0; }
.usage-sub:first-child { margin-top: 0; }
.usage-bar { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.usage-bar span { display: block; height: 100%; border-radius: inherit; background: var(--ok, #2e9d5b); }
.usage-bar.warn span, .usage-col.warn { background: #d99a1e; }
.usage-bar.bad span, .usage-col.bad { background: #d14b4b; }
.usage-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: #2e9d5b; vertical-align: middle; }
.usage-dot.warn { background: #d99a1e; } .usage-dot.bad { background: #d14b4b; }
.usage-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 120px; }
.usage-day { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; height: 100%; text-align: center; }
.usage-col { width: 70%; max-width: 28px; border-radius: 4px 4px 0 0; background: #2e9d5b; }
.usage-day .small { font-size: 10px; }

/* Title page → Where to watch */
.watch-row { display: grid; gap: 4px; margin-bottom: 8px; }
.watch-logos { display: flex; flex-wrap: wrap; gap: 6px; }
.watch-logos img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }
.watch-foot { justify-content: space-between; align-items: center; gap: 8px; }
.watch-card .watch-summary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* Stats → yearly goal */
.goal-card { display: grid; gap: 12px; }
.goal-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.goal-head h3 { margin: 0; }
.goal-row { display: grid; gap: 4px; }
.goal-bar { position: relative; height: 10px; border-radius: 5px; background: var(--border); }
.goal-bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.goal-bar i { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--text, currentColor); opacity: .55; }
.goal-ok { color: #2e9d5b; } .goal-behind { color: #d99a1e; }

/* Stats → Genres */
.genre-card { display: grid; gap: 8px; }
.genre-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.genre-cols h4 { margin: 0 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.genre-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.genre-list li { display: grid; grid-template-columns: minmax(80px, 9em) 1fr auto; align-items: center; gap: 8px; }
.genre-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.genre-bar { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.genre-bar span { display: block; height: 100%; border-radius: inherit; background: var(--series-1, var(--accent)); }

/* Favourites, filler guide */
.fav-btn { font-size: 18px; line-height: 1; padding: 6px 10px; color: var(--muted); }
.fav-btn.on { color: #e0245e; border-color: #e0245e; }
.poster-fav { position: absolute; top: 6px; left: 6px; z-index: 3; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: rgb(0 0 0 / .55); color: #ff4d7d; font-size: 12px; pointer-events: none; }
.filler-line { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: 4px 0 8px; }
.badge.filler-badge { background: #d99a1e22; color: #b77a06; border-color: #d99a1e66; }
.badge.mixed-badge { background: #8a63d222; color: #7a52c7; border-color: #8a63d266; }
.filler-line label { display: inline-flex; flex-direction: row; align-items: center; gap: 4px; margin: 0; }
.filler-line input[type="checkbox"] { width: auto; margin: 0; flex: none; }

/* Stats → Activity heatmap */
.heatmap-scroll { overflow-x: auto; padding-bottom: 4px; }
.heatmap { display: block; }
.heatmap text { font-size: 9px; fill: var(--muted); }
.hm0 { fill: var(--border); }
.hm1 { fill: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.hm2 { fill: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.hm3 { fill: color-mix(in srgb, var(--accent) 80%, var(--border)); }
.hm4 { fill: var(--accent); }
.heatmap-legend { display: flex; align-items: center; gap: 3px; justify-content: flex-end; margin-top: 4px; }

/* For you → theme rows */
.theme-row { margin: 12px 0 18px; }
.theme-row h3 { margin: 0 0 8px; font-size: 15px; font-weight: 500; }
.theme-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 112px; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.theme-item { display: grid; gap: 3px; align-content: start; text-decoration: none; color: inherit; scroll-snap-align: start; }
.theme-cover { aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; background: var(--border); display: grid; place-items: center; }
.theme-cover img { width: 100%; height: 100%; object-fit: cover; }
a.theme-cover { text-decoration: none; color: var(--muted); }
a.theme-title { color: inherit; text-decoration: none; }
a.theme-title:hover { color: var(--accent-text); }
.theme-item .plus-corner { left: 5px; bottom: 5px; width: 28px; height: 28px; }
.theme-title { font-size: 12px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 640px) { .theme-strip { grid-auto-columns: 96px; } }

/* Source fallback */
.source-alt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 10px; margin: 6px 0 10px; border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); font-size: 13px; }
.source-alt[hidden] { display: none; }
.ck-alt { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
/* Monthly recap: month switcher under the Stats tabs */
.recap-nav { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; }
.recap-nav h3 { margin: 0; min-width: 9em; text-align: center; }
.recap-nav .recap-nav-gap { width: 34px; }

/* Settings → Chapter sources */
.source-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.source-list .switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 2px; border-bottom: 1px solid var(--border); cursor: pointer; margin: 0; }
.source-list li:last-child .switch-row { border-bottom: 0; }
.source-list input[type="checkbox"] { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--accent); }
.src-status { display: block; font-size: 12px; margin-top: 2px; }
.src-status.ok { color: #2e9d5b; } .src-status.warn { color: #b77a06; } .src-status.bad { color: #d14b4b; }
.src-add { display: grid; gap: 4px; padding-top: 10px; border-top: 1px solid var(--border); }
.src-add p { margin: 0; }
.src-remove { margin-top: 4px; }
/* Settings → Browse sites */
.browse-sites { width: min(560px, 94vw); }
.bs-list { list-style: none; margin: 0; padding: 0; max-height: 55vh; overflow-y: auto; display: grid; }
.bs-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--border); }
.bs-name { display: grid; gap: 1px; min-width: 0; }
.bs-name .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge.badge-adult { background: #d14b4b22; color: #d14b4b; border-color: #d14b4b66; }
.browse-sites .inline label { display: inline-flex; align-items: center; gap: 4px; margin: 0; }
.browse-sites .inline input[type="checkbox"] { flex: none; width: auto; margin: 0; }
/* Settings tabs */
.settings-tabs { flex-wrap: wrap; }
.settings-tabs button.has-dot { position: relative; }
.settings-tabs button.has-dot::after { content: ""; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.settings-tabs button.active.has-dot::after { background: #fff; }
.settings-logout[hidden] { display: none; }
@media (max-width: 640px) { .settings-tabs { width: 100%; } .settings-tabs button { flex: 1 1 auto; } }
details.settings[hidden] { display: none; }

/* Reader: paged modes (one page at a time, swipe or tap the sides; right-to-left for manga) */
.reader.paged .reader-strip { display: flex; flex-direction: row; max-width: none; height: 100vh; height: 100dvh; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; overflow-anchor: none; /* pages are inserted before the end marker: don't follow it */ }
.reader.paged .reader-strip::-webkit-scrollbar { display: none; }
.reader.paged.rtl .reader-strip { direction: rtl; }
.reader.paged .reader-chapter { display: contents; }
.reader.paged .reader-chapter img { flex: 0 0 100vw; width: 100vw; height: 100vh; height: 100dvh; min-height: 0; object-fit: contain; scroll-snap-align: start; background: #000; }
.reader.paged .reader-divider { flex: 0 0 100vw; height: 100dvh; display: grid; place-content: center; padding: 16px; scroll-snap-align: start; direction: ltr; }
.reader.paged .reader-chapter-end { flex: 0 0 1px; height: 1px; }
.reader.paged .reader-end { flex: 0 0 100vw; height: 100dvh; justify-content: center; scroll-snap-align: start; direction: ltr; max-width: none; margin: 0; }
.reader.paged .reader-error { flex: 0 0 100vw; }
/* Watchlist list layout */
.wl-row .wl-actions { gap: 8px; justify-content: flex-start; }
.wl-row .wl-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-row .wl-actions button { background: transparent; color: inherit; border: 1px solid var(--border); font-size: 12px; padding: 4px 12px; }
.wl-row .wl-actions .wl-start { background: var(--accent); border-color: var(--accent); color: #fff; }
/* For you tabs */
.recs-tabs { margin: 4px 0 8px; }
.rt-similar-only[hidden] { display: none; }

/* Sideways rows (Continue watching/reading, For you themes, More like this, cast): no scrollbar on touch
   screens (you swipe); on a computer a thin bar that only shows while the mouse is over the row. */
.strip-row, .theme-strip, .similar-row, .rel-row, .cast { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.strip-row:hover, .theme-strip:hover, .similar-row:hover, .rel-row:hover, .cast:hover { scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent; }
.strip-row::-webkit-scrollbar, .theme-strip::-webkit-scrollbar, .similar-row::-webkit-scrollbar, .rel-row::-webkit-scrollbar, .cast::-webkit-scrollbar { height: 6px; }
.strip-row::-webkit-scrollbar-thumb, .theme-strip::-webkit-scrollbar-thumb, .similar-row::-webkit-scrollbar-thumb, .rel-row::-webkit-scrollbar-thumb, .cast::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; }
.strip-row:hover::-webkit-scrollbar-thumb, .theme-strip:hover::-webkit-scrollbar-thumb, .similar-row:hover::-webkit-scrollbar-thumb, .rel-row:hover::-webkit-scrollbar-thumb, .cast:hover::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 45%, transparent); }
@media (pointer: coarse) {
  .strip-row, .theme-strip, .similar-row, .rel-row, .cast { scrollbar-width: none; }
  .strip-row::-webkit-scrollbar, .theme-strip::-webkit-scrollbar, .similar-row::-webkit-scrollbar, .rel-row::-webkit-scrollbar, .cast::-webkit-scrollbar { display: none; }
}
/* About card: awards (Wikidata) */
.awards-head { margin: 14px 0 6px; font-size: 14px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.awards { margin: 0; padding-left: 18px; font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
.awards-more { margin-top: 6px; }
.awards-more summary { cursor: pointer; color: var(--accent-text); }
.awards-more .awards { margin-top: 4px; }
.awards-src { margin: 8px 0 0; }
.watch-links { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.watch-links a { text-decoration: none; }
/* Settings: a header button (gear; "Settings" next to it on wide screens) */
header.top .hdr-link { position: relative; display: inline-flex; align-items: center; gap: 2px; padding: 3px 10px; line-height: 1.5; white-space: nowrap; text-decoration: none;
  border-radius: 8px; border: 1px solid var(--header-chip-line, rgb(255 255 255 / .14)); background: var(--header-chip, rgb(255 255 255 / .08)); color: var(--header-text); }
header.top .hdr-link .ico { display: block; }
header.top .hdr-link.active { box-shadow: inset 0 -2px 0 var(--accent); }
#settings-link.has-dot::after { content: ""; position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--header-bg); }
@media (max-width: 640px) { header.top .hdr-link { padding: 6px 8px; min-width: 32px; min-height: 36px; justify-content: center; } }
/* Settings → Compare sources */
.cmp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cmp-list li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); }
.cmp-list li:first-child { border-top: 0; }
.cmp-main { flex: 1; min-width: 0; }
.cmp-main a { color: var(--text); text-decoration: none; }
.cmp-main .chip { margin-left: 4px; }
.cmp-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
/* New version bar (bottom, above everything) */
.update-bar { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  background: var(--accent); color: #fff; border: 0; border-radius: 999px; padding: 10px 18px; font-size: 14px; box-shadow: 0 4px 16px rgb(0 0 0 / .25); }
/* Title page buttons: placeholders still empty (Open / Watch / Trailer arrive later) take no space */
.hero-actions > span:empty { display: none; }
/* Phones: cast as one sideways row of small cards (a 2-column grid of 15 big photos was ~3 screens long) */
@media (max-width: 640px) {
  .cast { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 92px; overflow-x: auto; gap: 10px; padding-bottom: 2px; }
}
/* Phones: Compare sources buttons on their own row under the details */
@media (max-width: 640px) {
  .cmp-list li { flex-direction: column; align-items: stretch; gap: 6px; }
  .cmp-actions { justify-content: flex-start; }
}
/* Cover without an image (titles and actors in Discover / More like this): the letter centred, no link underline */
.similar-cover .ph { display: grid; place-items: center; }
a.similar-cover { text-decoration: none; }
/* ---------- Light novels: title page card ---------- */
.book-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 14px; }
.book { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.book-cover { position: relative; display: block; aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; background: var(--border); text-decoration: none; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-cover .ph { display: grid; place-items: center; width: 100%; height: 100%; font-size: 26px; color: var(--muted); }
.book-cover .poster-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgb(0 0 0 / .35); }
.book-cover .poster-bar span { display: block; height: 100%; background: var(--accent); }
.book-done { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; }
.book.done .book-cover img { opacity: .55; }
.book.current .book-cover { box-shadow: 0 0 0 2px var(--accent); }
.book-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.book-title { color: var(--text); text-decoration: none; font-weight: 600; font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-actions { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.book-actions .open { padding: 3px 10px; }
@media (max-width: 640px) { .book-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; } }

/* ---------- Light novels: reader (#book/<id>) ---------- */
body.book-mode { background: var(--book-bg, #fff); }
.book-reader { position: fixed; inset: 0; overflow-y: auto; background: var(--book-bg, #fff); color: var(--book-fg, #1d1d1f); -webkit-overflow-scrolling: touch; }
.book-pages { padding: calc(56px + env(safe-area-inset-top)) 0 calc(40vh + env(safe-area-inset-bottom)); }
.book-frame { display: block; width: 100%; border: 0; background: transparent; }
/* PDFs: one box per page (its shape set inline), drawn on a canvas; the page colour is a filter */
.pdf-page { margin: 0 auto 8px; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); max-width: none; }
.pdf-page canvas { display: block; width: 100%; height: 100%; }
.book-reader.pdf[data-theme="sepia"] .pdf-page { background: #f4ecd8; }
.book-reader.pdf[data-theme="sepia"] .pdf-page canvas { filter: sepia(.45) brightness(.97); }
.book-reader.pdf[data-theme="dark"] .pdf-page { background: #1e1e1e; box-shadow: none; }
.book-reader.pdf[data-theme="dark"] .pdf-page canvas { filter: invert(.88) hue-rotate(180deg); }
.book-loading { text-align: center; padding: 40px 16px; color: var(--book-fg, #555); }
.book-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 5; transition: transform .2s; }
.book-bar.hidden { transform: translateY(-110%); }
.book-pop { position: fixed; z-index: 6; top: calc(52px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(420px, calc(100vw - 24px)); max-height: 70vh; overflow: auto; }
.book-aa-row { display: flex; align-items: center; gap: 8px; padding: 6px 4px; }
.book-aa-row > span { width: 44px; }
.book-aa-row button { min-width: 56px; }
.book-aa-row button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.book-toc { list-style: none; margin: 0; padding: 0; }
.book-toc button { display: block; width: 100%; text-align: left; border: 0; border-radius: 6px; padding: 8px 10px; background: none; color: inherit; }
.book-toc button:hover, .book-toc button.current { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.book-toc button.current { font-weight: 600; }
.book-bar { color: #eee; }
.book-actions { flex-wrap: wrap; }
.book-actions button { padding: 3px 9px; }
/* Light novel uploads: floating progress panel (stays while you move around the app) */
.upload-panel { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 50; width: min(360px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; box-shadow: 0 8px 28px rgb(0 0 0 / .25); }
.upload-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.upload-bar { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; margin: 10px 0 6px; }
.upload-bar span { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.upload-panel p { margin: 0 0 6px; }
.upload-list { list-style: none; margin: 0; padding: 0; max-height: 180px; overflow: auto; font-size: 13px; }
.upload-list li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
.upload-list li > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.upload-list li.done > span:last-child { color: var(--accent-text); }
.upload-list li.failed > span:last-child { color: var(--danger); }
@media (max-width: 640px) { .upload-panel { left: 12px; right: 12px; width: auto; } }
.books-card summary .open { white-space: nowrap; }
.books-tools { margin-bottom: 6px; }
/* Light novels: groups (main series first, then side stories) */
.book-group + .book-group { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.book-group h4 { margin: 0 0 4px; font-size: 14px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }

/* ---------- Related titles (title page) ---------- */
.related-card { display: grid; gap: 12px; }
.related-card h3 { margin: 0; }
#related-body { display: grid; gap: 14px; }
.rel-group { display: grid; gap: 8px; min-width: 0; }
.rel-head { display: flex; align-items: center; gap: 8px; }
.rel-head h4 { margin: 0; font-size: 14px; }
.rel-head button { margin-left: auto; padding: 2px 10px; }
.rel-row { display: grid; grid-auto-flow: column; grid-auto-columns: 104px; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.rel-item { display: flex; flex-direction: column; gap: 3px; min-width: 0; color: inherit; text-decoration: none; }
.rel-cover { aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; background: var(--border); display: grid; place-items: center; }
.rel-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rel-cover .ph { font-size: 28px; color: var(--muted); }
.rel-title { font-size: 13px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rel-item .small { line-height: 1.3; }
.rel-item.out .rel-cover { opacity: .6; }
.rel-item:hover .rel-title, .rel-item:focus-visible .rel-title { color: var(--accent-text); }
/* Link a title dialog */
dialog.link-dialog { display: grid; gap: 10px; }
dialog.link-dialog p { margin: 0; }
dialog.link-dialog input[type="search"] { width: 100%; }
.link-results { list-style: none; margin: 0; padding: 0; max-height: min(50vh, 360px); overflow-y: auto; display: grid; gap: 2px; }
.link-results button { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; padding: 6px 8px; border: 0; background: transparent; border-radius: 8px; color: inherit; }
.link-results button:hover, .link-results button:focus-visible { background: var(--bg); }
.link-results img, .link-results .link-ico { width: 32px; height: 46px; border-radius: 4px; object-fit: cover; flex: none; background: var(--border); display: grid; place-items: center; }
.link-results button > span:last-child { display: grid; min-width: 0; }
.link-results b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Related: hide (✕) / show again (↺) on automatic suggestions */
.rel-wrap { position: relative; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rel-wrap > .rel-item { flex: none; }
.rel-hide { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 0;
  background: rgb(0 0 0 / .62); color: #fff; font-size: 13px; line-height: 1; display: grid; place-items: center; cursor: pointer; }
@media (hover: hover) { .rel-wrap:not(.is-hidden) .rel-hide { opacity: 0; transition: opacity .15s; } .rel-wrap:hover .rel-hide, .rel-hide:focus-visible { opacity: 1; } }
.rel-wrap.is-hidden .rel-item { opacity: .45; }
/* ✓ on unwatched movies: always shown, bottom-right of the poster (104 px wide, 2:3, so 156 px tall) */
/* ✓ and + on the bottom-right of a Related poster (104 px wide, 2:3, so 156 px tall) */
.rel-acts { position: absolute; top: calc(104px * 1.5 - 36px); left: 6px; right: 6px; display: flex; justify-content: flex-end; pointer-events: none; }
.rel-acts button { pointer-events: auto; }
.rel-acts [data-wl] { margin-right: auto; } /* + bottom-left, ✓ bottom-right */
#related-hidden { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 2px 6px; }

/* ---------- Library → Movies → Collections ---------- */
#grid.collections { display: grid; gap: 18px; }
.coll { display: grid; gap: 8px; min-width: 0; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.coll:last-child { border-bottom: 0; }
.coll-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.coll-head h3 { margin: 0; font-size: 16px; }
.coll-head button { margin-left: auto; }
.coll-note { margin: 0; }
/* Collections tab: poster cards with a "3/4 watched" badge */
.coll-card .coll-count { background: rgb(0 0 0 / .7); color: #fff; }
/* Collection page */
.coll-page { display: grid; gap: 16px; }
.coll-back { color: var(--muted); text-decoration: none; font-size: 14px; }
.coll-back:hover { color: var(--accent-text); }
.coll-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.coll-top button { padding: 2px 12px; }
.coll-hero { display: flex; gap: 18px; align-items: flex-end; flex-wrap: wrap; }
.coll-poster { width: 140px; aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden; background: var(--border); display: grid; place-items: center; flex: none; }
.coll-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.coll-poster .ph { font-size: 40px; color: var(--muted); }
.coll-info { display: grid; gap: 8px; min-width: 0; }
.coll-info h1 { margin: 0; font-size: 26px; line-height: 1.2; text-wrap: balance; }
.coll-info p { margin: 0; }
.coll-page h3 { margin: 6px 0 0; }
.poster.out .poster-img { opacity: .55; }
/* Change poster dialog */
dialog.poster-dialog { max-width: min(560px, calc(100vw - 32px)); display: grid; gap: 12px; }
.poster-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; max-height: min(50vh, 420px); overflow-y: auto; }
.poster-choices button { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: var(--border); aspect-ratio: 2 / 3; }
.poster-choices button:hover, .poster-choices button:focus-visible { border-color: var(--accent); }
.poster-choices img { width: 100%; height: 100%; object-fit: cover; display: block; }
dialog.poster-dialog .inline input { flex: 1; min-width: 0; }
.rel-head h4 a { color: inherit; text-decoration: none; }
.rel-head h4 a:hover, .rel-head h4 a:focus-visible { color: var(--accent-text); text-decoration: underline; }
/* Add to a group: ticked titles */
.link-tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); flex: none; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; }
.link-results button.picked { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.link-results button.picked .link-tick { background: var(--accent); border-color: var(--accent); }
/* Collection pages: the badge sits top-left, round buttons bottom-right (like the Dashboard's ✓) */
.poster .unwatched-badge { position: absolute; top: 6px; left: 6px; background: var(--accent); color: #fff; }
.poster-frame .coll-actions { opacity: 1; pointer-events: auto; gap: 4px; align-items: center; bottom: 6px; }
/* Round ✓ (and +) on posters, the Dashboard's ✓ button */
/* Films you don't have: + bottom-left, ✓ bottom-right */
.poster-frame .coll-actions.spread { left: 6px; justify-content: space-between; pointer-events: none; }
.coll-actions.spread button { pointer-events: auto; }
.poster-check { width: 30px; height: 30px; min-height: 0; padding: 0; border-radius: 50%; border: 0; background: var(--accent); color: #fff;
  font-size: 14px; font-weight: 700; line-height: 1; display: grid; place-items: center; flex: none; cursor: pointer; }
.poster-check.plus-check, .rel-acts [data-wl] { font-size: 18px; }
/* Watchlist posters: round ✕ (dark) bottom-left, ✓ / ▶ (red) bottom-right */
.poster-frame .wl-actions .poster-check { width: 30px; height: 30px; padding: 0; font-size: 14px; border-radius: 50%; border: 0; display: grid; place-items: center; }
.poster-frame .wl-actions .poster-check.dark { background: rgb(0 0 0 / .65); border: 1px solid rgb(255 255 255 / .3); font-size: 13px; }
.poster-frame .wl-actions .wl-start { font-size: 13px; }
.poster-check:disabled { opacity: .5; cursor: progress; }
@media (max-width: 640px) { .poster .unwatched-badge { top: 5px; left: 5px; font-size: 10px; padding: 1px 6px; } }
/* Private page: its own 🔔 for new chapters of private titles */
.pv-head-actions { gap: 8px; }
.pv-bell { position: relative; padding: 4px 10px; }
.pv-bell .nf-count { box-shadow: 0 0 0 2px var(--bg); }
.pv-bell.open { background: var(--border); }
.pv-news { padding: 0; overflow: hidden; max-height: min(60vh, 480px); overflow-y: auto; }
/* Preview: + Watchlist and ✓ Watched get the hero row's gap like its other buttons */
#pv-action { display: contents; }

/* Red round + (Watchlist) bottom-left of a cover: Similar row, Discover, For you; ✕ (not interested) top-right */
.plus-wrap { position: relative; min-width: 0; }
.plus-wrap > .plus-corner { position: absolute; left: 6px; bottom: 6px; font-size: 18px; z-index: 1; }
.poster-check.dark { background: rgb(0 0 0 / .65); border: 1px solid rgb(255 255 255 / .3); }
.plus-wrap > .x-corner { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; font-size: 12px; z-index: 1; }
.rec > .plus-wrap { flex: 0 0 80px; align-self: flex-start; }
.rec > .plus-wrap > .cover { width: 100%; }
.rec .plus-corner { left: 4px; bottom: 4px; width: 28px; height: 28px; }
/* Dashboard: the Read button (📖 in-app reader, or Read ↗ on a site) is red like the ✓ next to it */
.poster-next .next-actions .read-btn:not(.cr) { background: var(--accent); border-color: var(--accent); color: #fff; }
/* Collection pages: Up next line; Change watch order dialog */
.coll-next { margin: 0; font-weight: 600; }
.coll-next a { color: var(--accent-text); }
dialog.order-dialog { width: min(480px, calc(100vw - 32px)); }
.order-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; max-height: 60vh; overflow-y: auto; }
.order-list li { display: flex; align-items: center; gap: 8px; padding: 4px; border: 1px solid var(--border); border-radius: 8px; }
.order-list img, .order-ph { width: 32px; height: 48px; object-fit: cover; border-radius: 4px; background: var(--border); flex: none; }
.order-n { width: 20px; text-align: right; color: var(--muted); font-size: 12px; flex: none; }
.order-title { flex: 1; min-width: 0; display: grid; font-size: 13px; font-weight: 600; overflow: hidden; }
.order-title .small { font-weight: 400; }
.order-list button { width: 34px; height: 34px; padding: 0; flex: none; }
/* Library posters: Open ↗ is a round red button like the others */
.poster-actions .open-round { text-decoration: none; font-size: 15px; }
/* Group pages: ✕ (take a film you don't have out of the group) top-right of its poster */
.poster-frame > .x-corner { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; font-size: 12px; z-index: 2; }
/* + Add on group pages: "In your library" / "Films you don't have" headings in the results */
.link-results .link-head { padding: 8px 8px 2px; text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
/* Library ⋯ → Filter: genre, decade, rating share the row (wrap on narrow screens) */
.lib-filters select { flex: 1 1 110px; min-width: 0; max-width: 220px; }

/* Tab bar: More ▾ holds the tabs switched off in Settings → Tabs and those that don't fit (phones) */
header.top .nav-more { flex: none; background: none; border: 0; color: var(--header-nav, rgb(241 242 244 / .65)); font: inherit; font-weight: 500; padding: 8px 12px; border-radius: 6px 6px 0 0; cursor: pointer; white-space: nowrap; }
header.top .nav-more[aria-expanded="true"], header.top:has(#nav-menu a.active) .nav-more { color: var(--header-text); background: var(--header-active, rgb(255 255 255 / .08)); }
header.top:has(#nav-menu a.active) .nav-more { box-shadow: inset 0 -2px 0 var(--accent); }
.nav-menu { position: absolute; top: 100%; right: 12px; z-index: 20; min-width: 160px; display: flex; flex-direction: column; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 40px rgb(0 0 0 / .35); }
.nav-menu[hidden] { display: none; }
.nav-menu a { color: var(--text); text-decoration: none; padding: 10px 12px; border-radius: 8px; font-weight: 500; }
.nav-menu a.active { color: var(--accent); background: var(--bg); }
@media (hover: hover) { .nav-menu a:hover { background: var(--bg); } }
.tab-opts { display: flex; flex-wrap: wrap; gap: 8px 18px; }

/* ⋯ → Change background: wide images */
.backdrop-picker .cover-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.backdrop-picker .cover-option img { aspect-ratio: 16 / 9; }
@media (max-width: 640px) { .backdrop-picker .cover-grid { grid-template-columns: repeat(2, 1fr); } }

/* Settings → System → Problems */
.problem-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.problem-list li { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.problem-msg { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }

/* Settings → Jellyfin */
.jf-url input { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.jf-guide ol { margin: 8px 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }

/* Settings → System → How it works (the reference page in a frame, as tall as its content) */
.rules-frame { display: block; width: 100%; min-height: 70vh; border: 0; border-radius: 12px; background: transparent; }

/* Settings → General → Devices */
.device-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.device-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.device-main { min-width: 0; }
.device-tag { margin-left: 6px; padding: 2px 8px; }
.device-tag-form input { flex: 1 1 160px; }

/* Settings → Phone notifications → What to send / When */
.push-prefs h3 { margin: 6px 0 0; font-size: 14px; }
.push-prefs label { flex-wrap: wrap; gap: 6px; }
.push-prefs input[type="time"], .push-prefs select { width: auto; flex: none; }

/* Dashboard: sections in the order from Settings → General → Dashboard (CSS order; containers flatten) */
.dash { display: flex; flex-direction: column; }
.dash > #newrel, .dash > #upnext { display: contents; }
.dash-opts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dash-opts li { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 10px; }

/* Token fields: hidden characters without being a password field (password managers leave them alone) */
.masked { -webkit-text-security: disc; }

/* ================= More appearance options (Settings → General → Appearance) ================= */
/* Accent colour: your own, over any theme (--accent-custom is set by the app). Lighter for text on dark themes. */
html[data-accent]:root { --accent: var(--accent-custom) !important; --accent-text: var(--accent-custom) !important; }
@media (prefers-color-scheme: dark) { html[data-accent]:root:not([data-theme="light"]) { --accent-text: color-mix(in srgb, var(--accent-custom) 70%, #fff) !important; } }
html[data-accent]:root:is([data-theme="dark"], [data-skin="crimson"], [data-skin="midnight"], [data-skin="velvet"], [data-skin="slate"],
  [data-skin="ocean"], [data-skin="forest"], [data-skin="nord"], [data-skin="dracula"]) { --accent-text: color-mix(in srgb, var(--accent-custom) 70%, #fff) !important; }

/* Text size: the whole page scales, so buttons and posters grow with the text (handy on a TV). */
html[data-text="small"] body { zoom: .92; }
html[data-text="large"] body { zoom: 1.12; }
html[data-text="xl"] body { zoom: 1.25; }

/* Font: the theme's, your system's, or Atkinson Hyperlegible (made for readability). */
html[data-font="system"]:root { --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif !important; --font-display: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif !important; }
html[data-font="readable"]:root { --font-body: "Atkinson Hyperlegible", system-ui, sans-serif !important; --font-display: "Atkinson Hyperlegible", system-ui, sans-serif !important; }

/* Poster size: Extra large (Small / Medium / Large are the density steps above). */
html[data-density="xl"] .posters { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px 16px; }
html[data-density="xl"] :is(.strip-row:has(.poster-next), .dc-strip .similar-row) { grid-auto-columns: 210px; }
html[data-density="xl"] .dc-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
@media (max-width: 640px) {
  html[data-density="xl"] :is(.posters, .dc-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  html[data-density="xl"] :is(.strip-row:has(.poster-next), .dc-strip .similar-row) { grid-auto-columns: 55%; }
}

/* Poster badges off: no type, rating or "new" labels and no progress bars on covers. */
html[data-badges="hide"] :is(.new-badge, .type-badge, .rating-badge, .poster-bar, .next-left) { display: none !important; }

/* Title page background: softened, or off (plain dark band). */
html[data-hero="soft"] .hero-band::before { filter: blur(10px) saturate(.8); transform: scale(1.05); opacity: .45; }
html[data-hero="off"] .hero-band::before { display: none; }
html[data-hero="off"] .hero-band { background: var(--header-bg, #111); }

/* Animations off: on request, or (Follow device) when the phone or computer asks for reduced motion. */
html[data-motion="reduce"] *:not(.spin-ico), html[data-motion="reduce"] *::before, html[data-motion="reduce"] *::after {
  animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) {
  html:not([data-motion]) *:not(.spin-ico), html:not([data-motion]) *::before, html:not([data-motion]) *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* More themes */
html:root[data-skin="ocean"] { color-scheme: dark; --bg: #0b1622; --surface: #11202f; --text: #e6eef6; --muted: #8ea3b8; --border: #1d3245;
  --accent: #2b8be6; --accent-text: #6cb8ff; --header-bg: #0a1a2b; --header-bg-image: linear-gradient(90deg, #0a1a2b, #0f2c48);
  --header-text: #fff; --header-nav: rgb(255 255 255 / .7); --header-active: rgb(255 255 255 / .12); --danger: #ff7a7a;
  --grid: #1d3245; --axis-line: #2a4560; --tick: #8ea3b8; }
html:root[data-skin="forest"] { color-scheme: dark; --bg: #0f1712; --surface: #16211a; --text: #e5efe7; --muted: #8fa596; --border: #24352a;
  --accent: #2f9e5c; --accent-text: #66cf8e; --header-bg: #122019; --header-text: #e5efe7; --danger: #ff7b6b;
  --grid: #24352a; --axis-line: #33473a; --tick: #8fa596; }
html:root[data-skin="nord"] { color-scheme: dark; --bg: #2e3440; --surface: #3b4252; --text: #eceff4; --muted: #b0b8c6; --border: #4c566a;
  --accent: #5e81ac; --accent-text: #88c0d0; --header-bg: #2b303b; --header-text: #eceff4; --header-active: rgb(136 192 208 / .16); --danger: #bf616a;
  --grid: #4c566a; --axis-line: #5b6579; --tick: #b0b8c6; }
html:root[data-skin="dracula"] { color-scheme: dark; --bg: #1e1f29; --surface: #282a36; --text: #f8f8f2; --muted: #a4a7b8; --border: #3a3d4e;
  --accent: #c24f9b; --accent-text: #ff79c6; --header-bg: #191a21; --header-text: #f8f8f2; --header-active: rgb(189 147 249 / .18); --danger: #ff5555;
  --grid: #3a3d4e; --axis-line: #4a4d60; --tick: #a4a7b8; }
html:root[data-skin="snow"] { color-scheme: light; --bg: #ffffff; --surface: #ffffff; --text: #111318; --muted: #5f6670; --border: #e3e6ea;
  --accent: #2563eb; --accent-text: #1d4ed8; --header-bg: #ffffff; --header-text: #111318; --header-nav: rgb(17 19 24 / .6);
  --header-active: #f1f3f5; --header-chip: #f1f3f5; --header-chip-line: #e3e6ea; --danger: #c0392b; }
html[data-skin="snow"] header.top { border-bottom: 1px solid var(--border); }
html[data-skin="snow"] header.top .nav a.active { color: var(--header-text); }
html[data-skin="snow"] :is(.poster-img, .next-card, .similar-cover, .season-poster, .card) { box-shadow: none; border: 1px solid var(--border); }
html[data-skin="nord"] :is(.poster-img, .next-card, .similar-cover) { border-radius: 12px; }

/* Accent colour picker */
.accent-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.accent-row button { width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 2px solid var(--border); background: var(--sw); }
.accent-row button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.accent-row button.accent-theme { width: auto; border-radius: 999px; padding: 0 10px; background: var(--surface); color: var(--text); font-size: 12px; }
.accent-row input[type="color"] { width: 36px; height: 30px; padding: 0; border: 0; background: none; flex: none; }

/* Settings tabs: an icon with each label; on a phone two rows of three separate tiles (icon above the label) */
.settings-tabs .st-icon { margin-right: 5px; }
@media (max-width: 640px) {
  .settings-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border: 0; background: none; overflow: visible; }
  .settings-tabs button, .settings-tabs button + button { display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 10px 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font-weight: 600; }
  .settings-tabs .st-icon { margin: 0; font-size: 20px; line-height: 1; }
  .settings-tabs button.active { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 40%, transparent); }
}
/* A fold inside a card (Login & devices → Change password) */
.sub-fold { border-top: 1px solid var(--border); padding-top: 10px; }
.sub-fold > summary { cursor: pointer; }
.sub-fold[open] > summary { margin-bottom: 10px; }


/* On my disk (folder scan): 💾 on episode rows and the title page */
.disk-ep { font-size: 12px; flex: none; }
.disk-line { margin-top: 4px; }
.disk-line[hidden] { display: none; }
.f-disk { display: inline-flex; align-items: center; gap: 4px; margin: 0; white-space: nowrap; }
.f-disk input { width: auto; margin: 0; }
.disk-kind { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--border); }
.disk-unmatched { margin: 6px 0; padding-left: 18px; max-height: 240px; overflow: auto; }

/* Music: square album covers, artists with round photos, tracklists */
.mu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; margin: 6px 0 14px; }
@media (max-width: 640px) { .mu-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; } }
.mu-album { display: flex; flex-direction: column; gap: 2px; min-width: 0; color: inherit; text-decoration: none; }
.mu-cover { position: relative; display: block; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--surface-2, var(--border)); }
.mu-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.mu-cover .ph, .mu-hero-cover .ph, .mu-face-big .ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 32px; font-weight: 700; color: var(--muted); }
.mu-title { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; }
.mu-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-album button { margin-top: 4px; align-self: flex-start; }
.fmt-btn[aria-pressed="true"], .title-page .hero-actions .fmt-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
button.mu-album.mb-pick { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; color: inherit; }
.mb-link .mu-grid { max-height: 60vh; overflow: auto; }
.mb-link .mu-cover img { opacity: 1 !important; } /* not dimmed like the albums you don't own */
#ar-disco .mu-album:not(.owned) .mu-cover img { opacity: .55; } /* artist page: the ones you don't own, faded */
.mu-own { position: absolute; left: 6px; top: 6px; z-index: 2; background: var(--accent); color: #fff; }
.mu-hero-cover, .mu-face-big { position: relative; aspect-ratio: 1; overflow: hidden; }
.mu-hero-cover img, .mu-face-big img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.mu-face-big { border-radius: 50%; }
/* Artists: a grid of round photos, like the album covers */
.mu-artists { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px 14px; margin: 6px 0 14px; }
@media (max-width: 640px) { .mu-artists { grid-template-columns: repeat(3, 1fr); gap: 12px 10px; } }
.mu-artist { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; color: inherit; text-decoration: none; text-align: center; }
.mu-artist .mu-title { max-width: 100%; }
.mu-face { position: relative; width: 100%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--border); }
.mu-face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.mu-face .ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; font-weight: 700; color: var(--muted); }
.mu-tracks { margin: 0; padding-left: 24px; }
.mu-tracks li { padding: 5px 0; border-bottom: 1px solid var(--border); }
.mu-tracks li > span:first-child { display: inline-block; max-width: calc(100% - 60px); }
.mu-tracks li > span:last-child { float: right; }
.artist-page .synopsis { white-space: pre-line; }
/* Library → Music: the title grid, its search, categories and ⋯ make way for the music area */
#view.lib-music-on :is(#cats, .toolbar, #lib-opts, #count, #grid, #lib-more, #add) { display: none !important; }
.mu-head { flex-wrap: wrap; gap: 8px; margin-top: 14px; } /* the same gap under the type tabs as the category tabs */
.mu-head .tabs { margin: 0; }
.album-page .alt a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
