:root {
  --bg: #eef5fc;
  --card: #ffffff;
  --ink: #1d2b3a;
  --muted: #6b7c8f;
  --accent: #128afa;
  --good: #1fa463;
  --bad: #e5484d;
  --line: #d6e3f0;
  --tag: #e6f1fd;
  --track: #e3ecf6;
  --shadow: 0 1px 2px rgba(29, 43, 58, 0.06), 0 4px 16px rgba(29, 43, 58, 0.06);
  /* List status colors (checked for colorblind separation in this order:
     completed, watching, on hold, plan to watch, dropped). */
  --st-completed: #1f9d55;
  --st-current: #128afa;
  --st-on_hold: #c48a00;
  --st-planned: #8b5cf6;
  --st-dropped: #e5484d;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1722;
    --card: #172231;
    --ink: #e6eef7;
    --muted: #8fa1b5;
    --line: #2a3a4f;
    --tag: #1d2c40;
    --track: #223247;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
    --st-completed: #2a9f5e;
    --st-current: #2f8fe6;
    --st-on_hold: #b98a12;
    --st-planned: #8f72f0;
    --st-dropped: #e0555a;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
[hidden] { display: none !important; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 24px 16px 40px; }
header { text-align: center; margin-bottom: 18px; }
.back { margin: -8px 0 8px; }
.back a { color: var(--muted); font-size: 0.85rem; text-decoration: none; }
.back a:hover { color: var(--accent); text-decoration: underline; }
h1 { margin: 0; font-size: 2rem; letter-spacing: -0.02em; }
h1 span { color: var(--accent); }
.sub { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }
.sub.warn { color: var(--bad); font-weight: 600; }
.sub.busy::before {
  content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px;
  border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hint { color: var(--muted); font-size: 0.85rem; margin: 4px 0 0; }
.hint.center { text-align: center; margin: -6px 0 14px; }

/* ---------- controls ---------- */
button {
  padding: 9px 16px; font: inherit; font-size: 0.95rem; border-radius: 10px; border: 0;
  background: var(--accent); color: #fff; cursor: pointer; font-weight: 600;
}
button:disabled { opacity: .45; cursor: default; }
button.ghost, .btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); font-weight: 500; }
button.ghost:hover:not(:disabled), .btn.ghost:hover { color: var(--accent); border-color: var(--accent); }
button.link { background: none; color: var(--muted); font-weight: 400; font-size: 0.85rem; padding: 6px 0 0; text-decoration: underline; }
button.link:hover { color: var(--accent); }
.btn {
  display: inline-block; background: var(--accent); color: #fff; text-decoration: none;
  font-weight: 600; font-size: 0.9rem; padding: 7px 16px; border-radius: 999px; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, li:focus-visible, .filebtn:focus-within {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
input[type="text"], input[type="search"], select {
  padding: 8px 12px; font: inherit; font-size: 0.95rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); }

/* ---------- load screen ---------- */
.load { max-width: 520px; margin: 0 auto; transition: border-color .15s ease; }
.load.over { border-color: var(--accent); border-style: dashed; }
.load label[for="user"] { font-weight: 600; display: block; margin-bottom: 6px; }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; min-width: 0; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.85rem; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.upload p { margin: 0; }
.upload .filebtn { margin-top: 12px; border-radius: 10px; padding: 8px 16px; }

/* ---------- app bar ---------- */
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 10px; }
.who { display: flex; flex-direction: column; margin-right: auto; min-width: 0; }
.who strong { font-size: 1.15rem; }
.who small { color: var(--muted); font-size: 0.8rem; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions button { padding: 7px 12px; font-size: 0.85rem; }

.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { background: none; color: var(--muted); font-weight: 600; padding: 6px 14px; border-radius: 999px; font-size: 0.9rem; }
.seg button small { font-weight: 500; opacity: .8; margin-left: 2px; }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.seg.small button { padding: 4px 10px; font-size: 0.8rem; }

.settings { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; font-size: 0.9rem; }
.settings label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.settings button.link { padding: 0; font-size: inherit; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { background: none; color: var(--muted); border-radius: 0; padding: 10px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- status colors ---------- */
.st-completed { --st: var(--st-completed); }
.st-current { --st: var(--st-current); }
.st-on_hold { --st: var(--st-on_hold); }
.st-planned { --st: var(--st-planned); }
.st-dropped { --st: var(--st-dropped); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--st, var(--muted)); margin-right: 6px; vertical-align: 1px; flex: none; }
.pill {
  display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 2px 10px; border-radius: 999px;
  color: var(--ink); background: var(--tag); white-space: nowrap; justify-self: start;
}
.tag { display: inline-block; font-size: 0.7rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--tag); color: var(--accent); }
.tag.warn { color: var(--muted); }

/* ---------- library ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 5px 12px; border-radius: 999px; font-size: 0.85rem; font-weight: 500;
  display: inline-flex; align-items: baseline;
}
.chip .dot { align-self: center; }
.chip small { color: var(--muted); margin-left: 6px; }
.chip[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.filters input[type="search"] { flex: 1 1 200px; min-width: 160px; }
.filters select { max-width: 190px; }
.sortby { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.85rem; }
.count { color: var(--muted); font-size: 0.8rem; margin: 4px 0 10px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.tile {
  display: flex; flex-direction: column; align-items: stretch; text-align: left;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 12px;
  padding: 0; overflow: hidden; font-weight: 400; cursor: pointer;
  transition: transform .15s ease, border-color .15s ease;
}
.tile:hover { transform: translateY(-2px); border-color: var(--accent); }
/* The box keeps a fixed 2:3 shape; covers that are a little taller or wider are cropped to fit,
   so a picture can never stretch its card. */
.cover { position: relative; display: block; aspect-ratio: 2 / 3; overflow: hidden; background: var(--track); border-bottom: 4px solid var(--st); }
.cover .img, .cover .noimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: grid; place-items: center; }
.noimg { color: var(--muted); font-size: 2rem; font-weight: 700; background: var(--track); }
.badge {
  position: absolute; top: 6px; right: 6px; background: rgba(15, 23, 34, .78); color: #fff;
  font-size: 0.75rem; font-weight: 700; padding: 2px 7px; border-radius: 999px;
}
.tile .t { font-size: 0.85rem; font-weight: 600; line-height: 1.3; padding: 8px 10px 2px; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .m { font-size: 0.75rem; color: var(--muted); padding: 0 10px; }
.tile .m.s { padding-bottom: 9px; display: flex; align-items: center; }
img.nsfw { filter: blur(14px); }

.rows { display: grid; gap: 4px; }
.row, .qrow, .pcard {
  display: grid; align-items: center; gap: 12px; text-align: left; width: 100%;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px 12px 6px 6px; font-weight: 400; cursor: pointer;
}
.row { grid-template-columns: 40px minmax(0, 1fr) 120px 110px 50px 44px; }
.row:hover, .qrow:hover, .pcard:hover { border-color: var(--accent); }
.thumb { width: 40px; height: 56px; object-fit: cover; border-radius: 6px; background: var(--track); display: grid; place-items: center; }
.thumb.noimg { font-size: 1rem; }
.thumb.sm { width: 32px; height: 45px; }
.r-title { min-width: 0; display: flex; flex-direction: column; }
.r-title strong { font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-title small { color: var(--muted); font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-prog { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.r-score { font-weight: 700; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.r-mean { color: var(--muted); font-size: 0.8rem; text-align: right; font-variant-numeric: tabular-nums; }
.pbar { display: block; height: 6px; background: var(--track); border-radius: 999px; overflow: hidden; margin-top: 4px; }
.pbar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.more { display: block; margin: 16px auto 0; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }

/* ---------- progress ---------- */
.block { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 14px; }
.block h2 { margin: 0 0 4px; font-size: 1.05rem; }
.block h2 small { color: var(--muted); font-weight: 500; font-size: 0.85rem; margin-left: 4px; }
.block h3 { margin: 16px 0 6px; font-size: 0.85rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.block > .hint:last-child { margin-bottom: 0; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; margin-top: 10px; }
.pcard { grid-template-columns: 40px minmax(0, 1fr); background: var(--bg); }
.p-body { display: flex; flex-direction: column; min-width: 0; }
.p-body strong { font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-line { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.p-body small { color: var(--muted); font-size: 0.75rem; margin-top: 3px; }
.qhead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.qhead .hint { margin: 0; }
.queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; counter-reset: q; }
.queue li { counter-increment: q; display: flex; align-items: center; gap: 8px; }
.queue li::before { content: counter(q); color: var(--muted); font-size: 0.75rem; width: 2.2em; text-align: right; font-variant-numeric: tabular-nums; flex: none; }
.qrow { grid-template-columns: 32px minmax(0, 1fr) 44px; background: var(--bg); padding: 4px 12px 4px 4px; }

/* ---------- next up ---------- */
.basis {
  max-width: 720px; margin: 6px auto 14px; padding: 10px 16px; text-align: center;
  background: var(--tag); color: var(--ink); border: 1px solid var(--line); border-radius: 12px;
  font-size: 0.95rem; font-weight: 600;
}
.multi { position: relative; }
.msel {
  font: inherit; font-size: 0.95rem; font-weight: 400; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 32px 8px 12px; max-width: 240px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; text-align: left;
}
.msel::after {
  content: ""; position: absolute; right: 12px; top: 50%; width: 6px; height: 6px; margin-top: -5px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg);
}
.multi.on .msel { border-color: var(--accent); color: var(--accent); }
.mpanel {
  position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 240px; max-height: 380px; overflow-y: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
}
/* Pinned at the top of the list while the options scroll underneath. */
.mhead {
  position: sticky; top: 0; z-index: 1; display: flex; flex-direction: column; gap: 8px;
  background: var(--card); border-bottom: 1px solid var(--line); padding: 10px;
}
.mhead:empty { display: none; }
.msearch { width: 100%; font-size: 0.88rem; padding: 6px 10px; }
.mbtns { display: flex; gap: 6px; }
.mbtn {
  font-size: 0.8rem; font-weight: 600; padding: 4px 12px; border-radius: 999px;
  background: var(--tag); color: var(--accent); border: 1px solid transparent;
}
.mbtn:hover { border-color: var(--accent); }
.mall { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--muted); cursor: pointer; }
.mlist { display: grid; gap: 0 12px; padding: 8px; }
.mlist .hint { margin: 4px 6px; }
.mlist.twocol { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
.mopt { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; font-size: 0.88rem; cursor: pointer; white-space: nowrap; }
.mopt:hover { background: var(--bg); }

.check { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.85rem; cursor: pointer; }
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; margin-top: 10px; }
.rcard {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: start; text-align: left; width: 100%;
  background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 12px 8px 8px; font-weight: 400; cursor: pointer;
}
.rcard:hover { border-color: var(--accent); }
.rthumb { width: 64px; height: 92px; object-fit: cover; border-radius: 8px; background: var(--track); display: grid; place-items: center; }
.rthumb.noimg { font-size: 1.3rem; }
.rc-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rc-body strong { font-size: 0.9rem; line-height: 1.3; }
.rc-body small { color: var(--muted); font-size: 0.78rem; }
.rc-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag.new { color: var(--st-planned); }
.reasons { list-style: none; margin: 2px 0 0; padding: 0; font-size: 0.78rem; color: var(--muted); }
.reasons li { position: relative; padding-left: 12px; }
.reasons li::before { content: ""; position: absolute; left: 2px; top: 0.55em; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }

/* ---------- stats ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.stat small { display: block; color: var(--muted); font-size: 0.8rem; }
.stat span { display: block; font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.25; }
.stat em { font-style: normal; color: var(--muted); font-size: 0.75rem; }

.stack { display: flex; gap: 2px; height: 18px; margin: 10px 0; }
.stack i { display: block; background: var(--st); min-width: 3px; }
.stack i:first-child { border-radius: 4px 0 0 4px; }
.stack i:last-child { border-radius: 0 4px 4px 0; }
.stack i:only-child { border-radius: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.85rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: baseline; }
.legend .dot { align-self: center; }
.legend strong { color: var(--ink); margin-left: 5px; font-variant-numeric: tabular-nums; }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.two .block { margin-bottom: 14px; }
.bhead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.bhead h2 { margin: 0; }
.gbars { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
.gbars li { display: grid; grid-template-columns: minmax(80px, 34%) 1fr 64px 40px; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 6px; font-size: 0.85rem; }
.gbars li:hover, .gbars li:focus { background: var(--bg); }
.g-name, .g-val, .g-sub { align-self: baseline; }
.g-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-bar { display: block; height: 10px; }
.g-bar i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 2px; }
.g-val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.g-sub { color: var(--muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

.cols { display: flex; gap: 2px; align-items: stretch; height: 160px; border-bottom: 1px solid var(--line); }
.col {
  flex: 1; min-width: 0; display: flex; flex-direction: column; background: none; color: var(--muted);
  padding: 0; border-radius: 6px 6px 0 0; font-weight: 400; cursor: default;
}
.col[data-year] { cursor: pointer; }
.col:hover { background: var(--bg); }
.bar-area { flex: 1; display: flex; align-items: flex-end; justify-content: center; padding: 0 2px; }
.bar-area i { display: block; width: min(100%, 36px); background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; opacity: .55; }
.bar-area i.zero { opacity: .2; }
.col.on .bar-area i, .cols:not(:has(.on)) .bar-area i { opacity: 1; }
.col-l { font-size: 0.7rem; padding: 4px 0 2px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.col.on .col-l { color: var(--accent); font-weight: 700; }
.axis-note { font-size: 0.7rem; color: var(--muted); text-align: right; margin-top: 2px; }

#tip {
  position: fixed; z-index: 50; pointer-events: none; max-width: 280px;
  background: var(--ink); color: var(--bg); font-size: 0.8rem; padding: 6px 10px; border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .2);
}

/* ---------- detail panel ---------- */
dialog {
  border: 1px solid var(--line); border-radius: 18px; padding: 0; background: var(--card); color: var(--ink);
  width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 40px); box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
  overscroll-behavior: contain; /* scrolling inside the panel never spills over to the page */
}
/* "dvh" follows the phone's visible height as the address bar shows or hides, so the panel doesn't shift. */
@supports (height: 100dvh) { dialog { max-height: calc(100dvh - 40px); } }
/* Page pinned in place while the panel is open (set from ui.js). */
body.locked { position: fixed; left: 0; right: 0; overflow: hidden; }
dialog::backdrop { background: rgba(10, 16, 24, .55); }
.d-wrap { position: relative; display: grid; grid-template-columns: 220px 1fr; gap: 20px; padding: 20px; }
.d-close { position: absolute; top: 10px; right: 10px; padding: 4px 10px; }
.d-cover { width: 100%; border-radius: 12px; aspect-ratio: 2 / 3; object-fit: cover; background: var(--track); }
.d-body { min-width: 0; }
.d-body h2 { margin: 0 32px 2px 0; font-size: 1.3rem; line-height: 1.25; }
.d-body h3 { margin: 16px 0 6px; font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.d-body dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; font-size: 0.9rem; }
.d-body dt { color: var(--muted); }
.d-body dd { margin: 0; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; }
.tags li { background: var(--tag); color: var(--accent); font-size: 0.75rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; }

footer { margin-top: 28px; text-align: center; font-size: 0.78rem; color: var(--muted); }
footer a { color: inherit; }
.version { font-size: 0.75rem; opacity: 0.6; }

/* ---------- small screens ---------- */
@media (max-width: 820px) {
  .two { grid-template-columns: 1fr; }
  .row { grid-template-columns: 40px minmax(0, 1fr) 70px 44px; }
  .row .pill, .row .r-mean { display: none; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
  .d-wrap { grid-template-columns: 1fr; }
  .d-cover { max-width: 180px; }
  .bar { gap: 8px; }
  .who { flex-basis: 100%; }
  .filters select { flex: 1 1 40%; max-width: none; }
  .gbars li { grid-template-columns: minmax(70px, 34%) 1fr 54px; }
  .g-sub { display: none; }
  .pgrid, .rgrid { grid-template-columns: 1fr; }
  .mpanel { max-width: calc(100vw - 32px); }
  .mlist.twocol { grid-template-columns: 1fr; }
}
.filters .mhead .msearch { flex: none; min-width: 0; }
.hint.busy::before {
  content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; vertical-align: -1px;
  border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite;
}

/* Warning banner (e.g. MyAnimeList asked to slow down). */
.notice {
  display: flex; align-items: center; gap: 14px; max-width: 720px; margin: 0 auto 14px; padding: 12px 16px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--card);
}
.notice.warn { border-color: var(--st-on_hold); background: #fff7e3; }
.notice strong { display: block; font-size: 0.95rem; }
.notice p { margin: 2px 0 0; font-size: 0.85rem; color: var(--muted); }
.notice > div { flex: 1; min-width: 0; }
.notice button { flex: none; padding: 8px 14px; font-size: 0.85rem; }
.notice-icon {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--st-on_hold); color: #fff; font-weight: 800; font-size: 0.9rem;
}
@media (prefers-color-scheme: dark) { .notice.warn { background: rgba(185, 138, 18, 0.14); } }
@media (max-width: 560px) { .notice { flex-wrap: wrap; } .notice button { width: 100%; } }

/* ---------- signing in and editing ---------- */
.signin { text-align: center; }
.signin .hint { margin-top: 8px; }
.malbtn { background: #2e51a2; } /* MyAnimeList blue */
.malbtn:hover { filter: brightness(1.1); }
.acct { color: var(--muted); }
.acct .link { padding: 0; font-size: inherit; }

/* Quick +1 on covers and progress cards (kept outside the card's own button). */
.tw, .pw, .rw { position: relative; display: flex; min-width: 0; }
.tw > .tile, .pw > .pcard, .rw > .rcard { flex: 1; min-width: 0; }
.plus1 {
  position: absolute; padding: 4px 10px; font-size: 0.8rem; font-weight: 700; border-radius: 999px;
  background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.tw .plus1 { top: 6px; left: 6px; }
.pw .plus1 { right: 10px; top: 50%; transform: translateY(-50%); }
.pw > .pcard { padding-right: 60px; }
.rw .addplan { position: absolute; right: 10px; bottom: 10px; }
.rw > .rcard { padding-bottom: 42px; }
.tag.mine { color: var(--st-completed); }

.editor { display: flex; flex-direction: column; gap: 10px; font-size: 0.9rem; }
.editor label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 0.8rem; }
.editor label.chk { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-size: 0.9rem; min-height: 36px; }
.editor select, .editor input[type="date"], .editor input[type="number"] { font-size: 0.9rem; padding: 6px 10px; }
.editor input.small { width: 80px; }
.erow { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; }
.step { display: flex; align-items: center; gap: 6px; }
.step-l { min-width: 72px; color: var(--muted); font-size: 0.8rem; }
.step input { width: 72px; text-align: center; }
.step button { padding: 4px 12px; font-size: 1rem; line-height: 1.2; }
.step-t { color: var(--muted); font-size: 0.85rem; }
.esave { margin: 0; color: var(--muted); font-size: 0.8rem; min-height: 1.2em; }
.eremove { margin: 0; font-size: 0.85rem; color: var(--muted); }
.link.danger { color: var(--bad); }
.mystat { margin: 0; }

#toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; max-width: calc(100vw - 32px);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
#toast.warn { background: var(--bad); color: #fff; }

/* Privacy page */
.prose .card { max-width: 760px; margin: 0 auto; }
.prose h2 { font-size: 1.1rem; margin: 18px 0 6px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { font-size: 0.95rem; }
.prose ul { padding-left: 20px; margin: 6px 0; }
