/* Koma — demo manga reader. Aperture (the Jellyfin theme: true black canvas, billboard, pills, glass, shelves that
   snap) + Graphite (the admin console: one indigo accent, graphite surfaces for dense lists, status grammar).
   Rules carried over from Aperture: no borders for separation (space, blur, shadow), SF-first type with tight
   tracking, muted grey for everything secondary, touch devices get none of the hover machinery. */
:root {
  --bg: #000; --bg-1: #0d0d0f; --bg-2: #17171a; --bg-3: #212126;
  --fg: #f5f5f7; --fg-dim: #aeaeb2; --fg-mute: #8e8e93; --fg-faint: #5c5c62;
  --fill: rgba(255,255,255,.12); --fill-hi: rgba(255,255,255,.2); --hair: rgba(255,255,255,.09);
  --accent: #6a61ef; --accent-ink: color-mix(in srgb, var(--accent) 55%, white); --accent-soft: color-mix(in srgb, var(--accent) 20%, transparent);
  --ok: #30d158; --warn: #e5a23c; --bad: #ff453a;
  --r-card: 12px; --r-panel: 18px; --r-pill: 980px;
  --ease: cubic-bezier(.2,.8,.25,1); --fast: .22s var(--ease); --slow: .42s var(--ease);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --jp: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", "Hiragino Sans", serif;
  --gut: clamp(16px, 4.2vw, 64px);
  --top: env(safe-area-inset-top, 0px); --bot: env(safe-area-inset-bottom, 0px);
  --tint: #0e0e10;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 15px/1.45 var(--font); letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; overflow-x: hidden; min-height: 100dvh; }
body.locked { overflow: hidden; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; letter-spacing: -.025em; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; border-radius: 8px; }
.ic { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ic.fill { fill: currentColor; stroke: none; }
.mute { color: var(--fg-mute); } .dim { color: var(--fg-dim); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* boot */
#boot { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: #000; transition: opacity .5s var(--ease); }
#boot svg { animation: breathe 1.4s var(--ease) infinite alternate; }
body.ready #boot { opacity: 0; pointer-events: none; }
@keyframes breathe { from { transform: scale(.94); opacity: .7; } to { transform: scale(1); opacity: 1; } }

/* ── top bar ─────────────────────────────────────────────────────────────── */
#topbar { position: fixed; z-index: 20; top: 0; left: 0; right: 0; height: calc(64px + var(--top)); padding: var(--top) var(--gut) 0;
  display: flex; align-items: center; gap: 22px; transition: background var(--slow), backdrop-filter var(--slow); }
#topbar.solid { background: rgba(10,10,12,.72); -webkit-backdrop-filter: saturate(180%) blur(28px); backdrop-filter: saturate(180%) blur(28px); }
body.reading #topbar, body.reading #tabbar { display: none; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 1.22rem; letter-spacing: -.03em; }
.brand svg { width: 28px; height: 28px; }
.navlinks { display: flex; gap: 4px; }
.navlinks a { padding: 7px 14px; border-radius: var(--r-pill); color: var(--fg-dim); font-weight: 600; font-size: .95rem; transition: color var(--fast), background var(--fast); }
.navlinks a:hover { color: var(--fg); }
.navlinks a.on { color: #000; background: #fff; }
.topright { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.iconbtn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--fg); transition: background var(--fast); }
.iconbtn:hover { background: var(--fill); }
.iconbtn .ic { width: 21px; height: 21px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 700; font-size: .95rem;
  box-shadow: 0 0 0 2px rgba(0,0,0,.4); }
.avatar.lg { width: 76px; height: 76px; font-size: 1.9rem; }

/* ── phone tab bar (Aperture's floating glass capsule) ─────────────────────── */
#tabbar { display: none; }
@media (max-width: 760px) {
  .navlinks, .topright .search-btn { display: none; }
  #topbar { height: calc(56px + var(--top)); }
  #tabbar { display: flex; position: fixed; z-index: 20; left: 14px; right: 14px; bottom: calc(var(--bot) + 6px); padding: 4px;
    border-radius: var(--r-pill); justify-content: space-around; background: rgba(30,30,34,.55);
    -webkit-backdrop-filter: saturate(190%) blur(34px); backdrop-filter: saturate(190%) blur(34px);
    border: 1px solid rgba(255,255,255,.13); box-shadow: 0 12px 34px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.1); }
  #tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 6px; border-radius: var(--r-pill);
    color: rgba(255,255,255,.6); font-size: .66rem; font-weight: 600; letter-spacing: 0; transition: color var(--fast), background var(--fast); position: relative; }
  #tabbar a .ic { width: 22px; height: 22px; }
  #tabbar a.on { color: #fff; background: rgba(255,255,255,.14); }
  #tabbar a .badge { position: absolute; top: 4px; left: calc(50% + 6px); }
  #view { padding-bottom: calc(96px + var(--bot)); }
}
.badge { min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: .66rem; font-weight: 700;
  display: inline-grid; place-items: center; line-height: 1; }

/* ── home billboard ──────────────────────────────────────────────────────── */
.hero { position: relative; height: min(78vh, 820px); min-height: 520px; overflow: hidden; isolation: isolate; background: var(--tint);
  transition: background-color 1s var(--ease); touch-action: pan-y; }
.hero-layers { position: absolute; inset: 0; -webkit-mask-image: linear-gradient(#000 0%, #000 36%, rgba(0,0,0,.45) 66%, transparent 90%);
  mask-image: linear-gradient(#000 0%, #000 36%, rgba(0,0,0,.45) 66%, transparent 90%); }
.hero-layer { position: absolute; inset: 0; background: center/cover no-repeat; opacity: 0; transform: scale(1.07); transition: opacity 1.1s var(--ease), transform 9s linear; }
.hero-layer.cover { filter: blur(26px) saturate(1.25); transform: scale(1.25); }
.hero-layer.on { opacity: 1; transform: scale(1); }
.hero-layer.cover.on { transform: scale(1.18); }
.hero-scrim { position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.42) 0%, rgba(0,0,0,0) 24%, rgba(0,0,0,.26) 60%, rgba(0,0,0,.34) 78%, rgba(0,0,0,0) 90%); }
.hero-native { position: absolute; z-index: 1; right: calc(var(--gut) - 4px); top: calc(92px + var(--top)); writing-mode: vertical-rl; font-family: var(--jp);
  font-size: clamp(1.4rem, 3.3vw, 3rem); font-weight: 600; letter-spacing: .12em; line-height: 1.1; color: rgba(255,255,255,.22); max-height: 56%; overflow: hidden;
  text-shadow: 0 2px 24px rgba(0,0,0,.4); transition: opacity .8s var(--ease); pointer-events: none; }
.hero-body { position: absolute; z-index: 2; inset: auto 0 0 0; padding: 0 var(--gut) clamp(26px, 3vw, 46px); display: flex; flex-direction: column; align-items: center; text-align: center;
  transition: transform .28s var(--ease); }
.hero-body.drag { transition: none; }
.hero-poster { width: clamp(118px, 13vw, 170px); aspect-ratio: 2/3; border-radius: 10px; background: center/cover var(--bg-2); margin-bottom: 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.08); transform: rotate(-2deg); transition: transform var(--slow); }
.hero-poster:hover { transform: rotate(0) scale(1.03); }
.hero-kicker { display: inline-flex; align-items: center; gap: 7px; font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.78); margin-bottom: 10px; }
.hero-kicker .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-ink); box-shadow: 0 0 0 3px var(--accent-soft); }
.hero-title { font-size: clamp(2.1rem, 4.6vw, 4.1rem); font-weight: 750; letter-spacing: -.035em; line-height: 1.02; max-width: 18ch; text-wrap: balance; margin-bottom: 12px;
  text-shadow: 0 3px 22px rgba(0,0,0,.65); }
.hero-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; color: var(--fg-dim); font-weight: 500; font-size: .93rem; margin-bottom: 12px; }
.hero-meta i { font-style: normal; opacity: .45; }
.hero-desc { max-width: 46rem; color: var(--fg-dim); font-size: 1.01rem; line-height: 1.5; margin: 0 0 20px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.dots { display: flex; gap: 7px; justify-content: center; margin-top: 18px; }
.dots button { width: 7px; height: 7px; border-radius: 4px; background: rgba(255,255,255,.35); transition: width var(--slow), background var(--fast); }
.dots button.on { width: 22px; background: #fff; }
.dots button.on.run { background: linear-gradient(90deg, #fff var(--p, 0%), rgba(255,255,255,.35) var(--p, 0%)); }
@media (max-width: 760px) {
  .hero { height: min(86vh, 760px); min-height: 560px; }
  .hero-native { top: calc(70px + var(--top)); font-size: 1.6rem; }
  .hero-desc { -webkit-line-clamp: 2; font-size: .93rem; }
  .hero-poster { width: 132px; margin-bottom: 18px; }
}

/* ── buttons ─────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 24px; border-radius: var(--r-pill); font-weight: 650; font-size: .98rem;
  letter-spacing: -.01em; white-space: nowrap; transition: transform var(--fast), background var(--fast), color var(--fast); }
.btn .ic { width: 19px; height: 19px; }
.btn:active { transform: scale(.97); }
.btn-primary { background: #fff; color: #000; }
.btn-glass { background: rgba(255,255,255,.17); color: var(--fg); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); }
.btn-glass:hover { background: rgba(255,255,255,.26); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-ghost { background: var(--fill); color: var(--fg); }
.btn-sm { height: 34px; padding: 0 15px; font-size: .86rem; }
.btn-round { width: 46px; padding: 0; }
.btn-round.on { background: var(--accent); color: #fff; }
@media (hover: hover) and (pointer: fine) { .btn:hover { transform: scale(1.04); } .btn:active { transform: scale(.98); } }
.jf { gap: 7px; } .jf small { font-weight: 500; color: rgba(255,255,255,.7); }

/* ── shelves ─────────────────────────────────────────────────────────────── */
.page { padding: calc(64px + var(--top)) 0 40px; }
.page.flush { padding-top: 0; }
.section { margin: 30px 0 6px; }
.section-head { display: flex; align-items: baseline; gap: 12px; padding: 0 var(--gut); margin-bottom: 12px; }
.section-head h2 { font-size: clamp(1.25rem, 1.8vw, 1.7rem); font-weight: 700; }
.section-head .sub { color: var(--fg-mute); font-size: .9rem; }
.section-head .more { margin-left: auto; color: var(--fg-dim); display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: .9rem; }
.shelf { display: flex; gap: clamp(12px, 1.2vw, 20px); overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gut);
  padding: 10px var(--gut) 18px; scrollbar-width: none; }
.shelf::-webkit-scrollbar { display: none; }
.shelf > * { scroll-snap-align: start; flex: none; }
.card { width: clamp(118px, 12.2vw, 176px); display: flex; flex-direction: column; gap: 9px; position: relative; }
.cover { position: relative; aspect-ratio: 2/3; border-radius: var(--r-card); overflow: hidden; background: var(--bg-2); box-shadow: 0 10px 26px rgba(0,0,0,.45);
  transition: transform var(--slow), box-shadow var(--slow); }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover .pin { position: absolute; left: 7px; top: 7px; }
.cover .prog { position: absolute; left: 8px; right: 8px; bottom: 8px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.28); overflow: hidden; }
.cover .prog i { display: block; height: 100%; background: #fff; border-radius: 2px; }
.card-t { font-weight: 600; font-size: .9rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-s { color: var(--fg-mute); font-size: .78rem; margin-top: -5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (hover: hover) and (pointer: fine) {
  .shelf:hover .card .cover { opacity: .58; transition: opacity var(--slow), transform var(--slow); }
  .shelf .card:hover .cover { opacity: 1; transform: scale(1.06) translateY(-4px); box-shadow: 0 26px 50px rgba(0,0,0,.7), 0 0 0 2px rgba(255,255,255,.75); }
}
.pill { display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px; border-radius: 6px; font-size: .66rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase;
  background: rgba(0,0,0,.6); color: #fff; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.pill.new { background: var(--accent); }
.pill.warn { background: var(--warn); color: #1b1200; }
.pill.ok { background: rgba(48,209,88,.9); color: #00230c; }
/* ranked: Netflix-style numerals behind the cover */
.card.ranked { width: clamp(168px, 16vw, 232px); flex-direction: row; align-items: flex-end; gap: 0; }
.card.ranked .num { font-size: clamp(5.6rem, 9vw, 8.6rem); font-weight: 850; letter-spacing: -.08em; line-height: .78; color: #000; -webkit-text-stroke: 2px rgba(255,255,255,.55);
  margin-right: -14px; z-index: 0; font-variant-numeric: tabular-nums; }
.card.ranked .stack { width: 62%; display: flex; flex-direction: column; gap: 9px; z-index: 1; }
/* wide (season) */
.wide { width: clamp(290px, 31vw, 440px); position: relative; border-radius: var(--r-panel); overflow: hidden; aspect-ratio: 16/9; background: var(--bg-2);
  box-shadow: 0 14px 30px rgba(0,0,0,.45); transition: transform var(--slow); }
.wide .art { position: absolute; inset: 0; background: center/cover; }
.wide .art.blur { filter: blur(18px) saturate(1.3); transform: scale(1.3); }
.wide .shade { position: absolute; inset: 0; background: linear-gradient(transparent 30%, rgba(0,0,0,.82)); }
.wide .poster { position: absolute; right: 14px; top: 14px; bottom: 14px; aspect-ratio: 2/3; border-radius: 8px; background: center/cover; box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.wide .txt { position: absolute; left: 16px; right: 38%; bottom: 14px; }
.wide .txt b { display: block; font-size: 1.05rem; line-height: 1.2; letter-spacing: -.02em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wide .txt span { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: rgba(255,255,255,.75); margin-top: 6px; }
.wide .onair { position: absolute; left: 14px; top: 14px; }
@media (hover: hover) and (pointer: fine) { .wide:hover { transform: scale(1.03); } }

/* ── updates feed (Graphite list on Aperture canvas) ─────────────────────── */
.feed { margin: 0 var(--gut); background: var(--bg-1); border-radius: var(--r-panel); overflow: hidden; }
.feed-day { padding: 14px 18px 6px; font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-mute); }
.feed-item { display: grid; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: center; padding: 10px 18px; transition: background var(--fast); }
.feed-item + .feed-item { box-shadow: inset 0 1px 0 var(--hair); }
.feed-item:hover { background: var(--bg-2); }
.feed-item .thumb { width: 52px; aspect-ratio: 3/4; border-radius: 8px; background: center/cover var(--bg-2); }
.feed-item b { display: block; font-size: .95rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-item .ch { display: flex; align-items: center; gap: 7px; color: var(--fg-dim); font-size: .86rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-item .meta { display: flex; align-items: center; gap: 6px; color: var(--fg-mute); font-size: .78rem; margin-top: 3px; }
.feed-item .when { text-align: right; color: var(--fg-mute); font-size: .78rem; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.udot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-ink); flex: none; }
.dl { color: var(--ok); }

/* ── title page ──────────────────────────────────────────────────────────── */
.dh { position: relative; isolation: isolate; background: var(--tint); transition: background-color .8s var(--ease); padding: calc(92px + var(--top)) var(--gut) 34px; overflow: hidden; }
.dh-art { position: absolute; inset: 0; z-index: -1; background: center 30%/cover; -webkit-mask-image: linear-gradient(#000 0%, rgba(0,0,0,.65) 45%, transparent 92%);
  mask-image: linear-gradient(#000 0%, rgba(0,0,0,.65) 45%, transparent 92%); opacity: .9; }
.dh-art.blur { filter: blur(30px) saturate(1.3); transform: scale(1.3); opacity: .75; }
.dh::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(rgba(0,0,0,.35), rgba(0,0,0,0) 30%, rgba(0,0,0,.25) 70%, transparent); }
.dh-grid { display: grid; grid-template-columns: clamp(150px, 18vw, 236px) 1fr; gap: clamp(20px, 3vw, 44px); align-items: end; max-width: 1240px; }
.dh-poster { aspect-ratio: 2/3; border-radius: 14px; overflow: hidden; background: var(--bg-2); box-shadow: 0 30px 70px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.08); }
.dh-poster img { width: 100%; height: 100%; object-fit: cover; }
.dh-native { font-family: var(--jp); color: rgba(255,255,255,.55); font-size: 1rem; letter-spacing: .06em; margin-bottom: 6px; }
.dh h1 { font-size: clamp(2rem, 4.2vw, 3.6rem); font-weight: 750; letter-spacing: -.035em; line-height: 1.02; text-wrap: balance; }
.dh-alt { font-size: clamp(1rem, 1.5vw, 1.25rem); color: var(--fg-dim); margin-top: 6px; font-weight: 500; }
.dh-by { color: var(--fg-dim); margin-top: 8px; font-size: .92rem; }
.stats { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; color: var(--fg-dim); font-weight: 600; font-size: .92rem; }
.stats span { display: inline-flex; align-items: center; gap: 6px; }
.stats .star { color: var(--accent-ink); }
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.tag { height: 26px; padding: 0 10px; border-radius: 7px; display: inline-flex; align-items: center; background: rgba(255,255,255,.1); font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--fg); }
.tag.warn { background: var(--warn); color: #1b1200; }
.statusline { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: .82rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-dim); }
.sdot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); } .sdot.completed { background: var(--accent-ink); } .sdot.hiatus { background: var(--warn); } .sdot.cancelled { background: var(--bad); }
.dh-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.desc { max-width: 76ch; color: var(--fg-dim); line-height: 1.6; margin: 22px 0 0; white-space: pre-line; position: relative; }
.desc.clamp { max-height: 4.8em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.linkbtn { color: var(--accent-ink); font-weight: 650; font-size: .9rem; margin-top: 6px; display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 760px) {
  .dh { padding-top: calc(64px + var(--top)); text-align: center; }
  .dh-grid { grid-template-columns: 1fr; justify-items: center; }
  .dh-poster { width: 168px; }
  .stats, .tags, .dh-actions, .statusline { justify-content: center; }
  .dh-actions .btn-primary { flex: 1 1 100%; }
  .desc { text-align: left; }
}
.tabs { position: sticky; top: calc(64px + var(--top)); z-index: 5; display: flex; gap: 6px; padding: 12px var(--gut); background: rgba(0,0,0,.8);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { height: 36px; padding: 0 16px; border-radius: var(--r-pill); color: var(--fg-mute); font-weight: 650; font-size: .92rem; white-space: nowrap; transition: color var(--fast), background var(--fast); }
.tabs button.on { background: #fff; color: #000; }
.tabs button .count { opacity: .55; margin-left: 4px; font-weight: 600; }
@media (max-width: 760px) { .tabs { top: calc(56px + var(--top)); } }
.panel { padding: 18px var(--gut) 0; }

/* chapter list */
.chtools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chtools .grow { flex: 1; }
.seg { display: inline-flex; padding: 3px; border-radius: var(--r-pill); background: var(--bg-2); }
.seg button { height: 30px; padding: 0 13px; border-radius: var(--r-pill); font-size: .82rem; font-weight: 650; color: var(--fg-mute); }
.seg button.on { background: var(--bg-3); color: var(--fg); box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.chgroup { background: var(--bg-1); border-radius: var(--r-panel); overflow: hidden; margin-bottom: 12px; }
.chgroup > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; font-weight: 650; }
.chgroup > summary::-webkit-details-marker { display: none; }
.chgroup > summary .r { margin-left: auto; color: var(--fg-mute); font-weight: 500; font-size: .86rem; display: flex; align-items: center; gap: 8px; }
.chgroup > summary .ic { transition: transform var(--fast); }
.chgroup[open] > summary .chev { transform: rotate(180deg); }
.chrow { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: center; padding: 11px 18px; box-shadow: inset 0 1px 0 var(--hair); transition: background var(--fast); }
.chrow:hover { background: var(--bg-2); }
.chrow .state { color: var(--fg-faint); display: grid; place-items: center; }
.chrow.unread .state { color: var(--accent-ink); }
.chrow.read { color: var(--fg-mute); }
.chrow b { font-weight: 650; font-size: .94rem; } .chrow.read b { font-weight: 500; }
.chrow .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chrow .sub { display: flex; gap: 10px; color: var(--fg-mute); font-size: .78rem; margin-top: 2px; white-space: nowrap; overflow: hidden; }
.chrow .end { display: flex; align-items: center; gap: 10px; color: var(--fg-mute); font-size: .8rem; }
.chrow .mini { width: 46px; height: 3px; border-radius: 2px; background: var(--bg-3); overflow: hidden; }
.chrow .mini i { display: block; height: 100%; background: var(--accent-ink); }
.notice { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 18px; border-radius: var(--r-panel); background: var(--bg-1); }
.notice .big { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.notice b { display: block; font-size: 1rem; } .notice p { margin: 2px 0 0; color: var(--fg-mute); font-size: .88rem; }
@media (max-width: 760px) { .notice { grid-template-columns: auto 1fr; } .notice .btn { grid-column: 1 / -1; } }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 26px; background: var(--bg-1); border-radius: var(--r-panel); padding: 18px; max-width: 720px; }
.kv dt { color: var(--fg-mute); font-size: .88rem; } .kv dd { margin: 0; font-size: .92rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(112px, 12vw, 168px), 1fr)); gap: 26px clamp(12px, 1.4vw, 22px); padding: 0 var(--gut); }
.grid .card { width: auto; }

/* ── library ─────────────────────────────────────────────────────────────── */
.pagehead { padding: 8px var(--gut) 0; display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.pagehead h1 { font-size: clamp(2rem, 3.6vw, 3rem); font-weight: 750; }
.pagehead .sub { color: var(--fg-mute); margin-bottom: 6px; }
.pagehead .r { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.filters { display: flex; gap: 8px; padding: 16px var(--gut) 20px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip { height: 34px; padding: 0 14px; border-radius: var(--r-pill); background: var(--bg-2); color: var(--fg-dim); font-weight: 600; font-size: .86rem; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; transition: background var(--fast), color var(--fast); }
.chip.on { background: #fff; color: #000; }
.chip.inc { background: var(--accent); color: #fff; }
.chip.exc { background: rgba(255,69,58,.18); color: #ff8a80; text-decoration: line-through; }
.chip .n { opacity: .55; }
/* the spine shelf: every series as a book spine, its own colour, its title set vertically */
.spines { display: flex; align-items: flex-end; gap: 6px; padding: 0 var(--gut) 0; flex-wrap: wrap; row-gap: 0; }
.shelfrow { display: flex; align-items: flex-end; gap: 6px; padding: 26px var(--gut) 0; border-bottom: 10px solid #1a1a1e; box-shadow: 0 14px 22px -12px rgba(0,0,0,.9); margin-bottom: 18px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.spine { --c: #444; flex: none; width: 46px; height: var(--h, 250px); border-radius: 4px 4px 2px 2px; background: var(--c); position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center;
  box-shadow: inset 2px 0 0 rgba(255,255,255,.18), inset -3px 0 0 rgba(0,0,0,.25), 0 -2px 12px rgba(0,0,0,.4); transition: transform var(--slow); color: var(--ink, #fff); }
.spine:hover { transform: translateY(-14px); }
.spine .cap { width: 100%; aspect-ratio: 1; background: center/cover; flex: none; }
.spine .v { writing-mode: vertical-rl; font-family: var(--jp); font-weight: 700; font-size: .92rem; letter-spacing: .08em; padding: 10px 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spine .band { width: 100%; height: 3px; background: rgba(255,255,255,.45); margin: 4px 0; flex: none; }
.spine .u { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); }

/* ── search / browse ─────────────────────────────────────────────────────── */
.searchbar { margin: 4px var(--gut) 0; height: 54px; border-radius: 16px; background: var(--bg-2); display: flex; align-items: center; gap: 10px; padding: 0 16px; }
.searchbar input { flex: 1; height: 100%; background: none; border: 0; outline: 0; color: var(--fg); font: 500 1.08rem var(--font); letter-spacing: -.01em; }
.searchbar input::placeholder { color: var(--fg-faint); }
.genres { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(150px, 15vw, 200px), 1fr)); gap: 12px; padding: 0 var(--gut); }
.genre { position: relative; height: 104px; border-radius: 14px; overflow: hidden; background: var(--c, #333); padding: 12px 14px; font-weight: 750; font-size: 1.05rem; letter-spacing: -.02em; text-align: left;
  transition: transform var(--fast); }
.genre img { position: absolute; right: -14px; bottom: -12px; width: 64px; border-radius: 6px; transform: rotate(22deg); box-shadow: 0 6px 18px rgba(0,0,0,.45); }
.genre:active { transform: scale(.97); }
.genre span { position: relative; z-index: 1; text-shadow: 0 1px 8px rgba(0,0,0,.35); }
.empty { text-align: center; padding: 60px var(--gut); color: var(--fg-mute); }
.empty .ic { width: 42px; height: 42px; margin: 0 auto 12px; color: var(--fg-faint); }
.empty b { display: block; color: var(--fg); font-size: 1.1rem; margin-bottom: 6px; }

/* ── sheets ──────────────────────────────────────────────────────────────── */
#layer { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.scrim { position: absolute; inset: 0; background: rgba(0,0,0,.55); opacity: 0; transition: opacity .3s var(--ease); pointer-events: auto; }
.sheet { position: absolute; left: 50%; bottom: 0; width: min(560px, 100%); max-height: min(88dvh, 860px); overflow-y: auto; overscroll-behavior: contain;
  background: rgba(23,23,26,.92); -webkit-backdrop-filter: saturate(170%) blur(40px); backdrop-filter: saturate(170%) blur(40px); border-radius: 24px 24px 0 0;
  padding: 10px 22px calc(26px + var(--bot)); transform: translate(-50%, 100%); transition: transform .42s var(--ease); pointer-events: auto; box-shadow: 0 -20px 60px rgba(0,0,0,.6); }
.sheet .grab { width: 38px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.25); margin: 0 auto 14px; }
#layer.open .scrim { opacity: 1; } #layer.open .sheet { transform: translate(-50%, 0); }
@media (min-width: 761px) { .sheet { bottom: auto; top: 50%; border-radius: 24px; transform: translate(-50%, -46%) scale(.96); opacity: 0; transition: transform .35s var(--ease), opacity .25s var(--ease); }
  #layer.open .sheet { transform: translate(-50%, -50%); opacity: 1; } .sheet .grab { display: none; } .sheet { padding-top: 22px; } }
.sheet h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 4px; }
.sheet .lead { color: var(--fg-mute); margin: 0 0 16px; font-size: .92rem; }
.menu { display: flex; flex-direction: column; margin: 8px -6px; }
.menu a, .menu button { display: flex; align-items: center; gap: 14px; padding: 12px 10px; border-radius: 12px; font-weight: 550; font-size: 1rem; text-align: left; transition: background var(--fast); }
.menu a:hover, .menu button:hover { background: var(--fill); }
.menu .ic { width: 22px; height: 22px; color: var(--fg-dim); }
.menu .r { margin-left: auto; color: var(--fg-mute); font-size: .88rem; display: flex; align-items: center; gap: 6px; }
.menu hr { border: 0; height: 1px; background: var(--hair); margin: 8px 10px; }
.me { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 0 12px; }
.me b { font-size: 1.4rem; letter-spacing: -.02em; }
.role { padding: 3px 10px; border-radius: 7px; background: #fff; color: #000; font-weight: 700; font-size: .78rem; }
.opt { display: flex; align-items: center; gap: 12px; padding: 12px 0; box-shadow: inset 0 -1px 0 var(--hair); }
.opt:last-child { box-shadow: none; }
.opt .l { flex: 1; } .opt .l b { display: block; font-weight: 600; } .opt .l small { color: var(--fg-mute); }
.swatches { display: flex; gap: 8px; }
.swatches button { width: 26px; height: 26px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px transparent; transition: box-shadow var(--fast); }
.swatches button.on { box-shadow: 0 0 0 2px #000, 0 0 0 4px #fff; }
.toggle { width: 50px; height: 30px; border-radius: 15px; background: var(--bg-3); position: relative; transition: background var(--fast); flex: none; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform var(--fast); box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.toggle.on { background: var(--ok); } .toggle.on::after { transform: translateX(20px); }
.foot { color: var(--fg-faint); font-size: .76rem; text-align: center; margin-top: 16px; line-height: 1.5; }

/* toast */
#toast { position: fixed; z-index: 60; left: 50%; bottom: calc(var(--bot) + 96px); transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: rgba(40,40,46,.92); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); padding: 11px 18px; border-radius: var(--r-pill); font-weight: 600; font-size: .9rem;
  box-shadow: 0 12px 30px rgba(0,0,0,.5); transition: opacity .25s var(--ease), transform .3s var(--ease); max-width: calc(100% - 32px); text-align: center; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 761px) { #toast { bottom: 32px; } }

/* ── reader ──────────────────────────────────────────────────────────────── */
.reader { position: fixed; inset: 0; z-index: 30; background: var(--rbg, #000); overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: none; }
.reader.strip { touch-action: pan-y; overflow-y: auto; overscroll-behavior: contain; }
.track { position: absolute; inset: 0; display: flex; will-change: transform; }
.track.anim { transition: transform .38s cubic-bezier(.22,.8,.2,1); }
.slide { flex: 0 0 100%; height: 100%; display: flex; align-items: center; justify-content: center; gap: 0; padding: var(--top) 0 var(--bot); }
.pg { flex: none; display: flex; flex-direction: column; }
.pg img { width: 100%; height: auto; display: block; }
.reader.fit-width .slide { overflow-y: auto; align-items: flex-start; touch-action: pan-y; }
.stripcol { width: min(100%, 860px); margin: 0 auto; padding: calc(var(--top) + 0px) 0 var(--bot); }
.stripcol img { width: 100%; height: auto; }
.stripcol .ph { width: 100%; background: #0c0c0e; }
.endcard { flex: 0 0 100%; height: 100%; display: grid; place-items: center; padding: 30px; position: relative; overflow: hidden; }
.endcard .bgart { position: absolute; inset: 0; background: center/cover; filter: blur(40px) saturate(1.4) brightness(.45); transform: scale(1.3); }
.endcard .box { position: relative; text-align: center; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.endcard .box .done { display: inline-flex; align-items: center; gap: 8px; color: var(--ok); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .78rem; }
.endcard h2 { font-size: 1.8rem; font-weight: 750; letter-spacing: -.03em; }
.endcard p { color: var(--fg-dim); margin: 0 0 10px; }
.endcard .nextp { width: 120px; aspect-ratio: 2/3; border-radius: 10px; background: center/cover; box-shadow: 0 20px 50px rgba(0,0,0,.6); margin: 8px 0; }
.rchrome { position: fixed; z-index: 31; left: 0; right: 0; transition: opacity .28s var(--ease), transform .32s var(--ease); pointer-events: auto; }
.rtop { top: 0; padding: calc(var(--top) + 10px) 14px 26px; display: flex; align-items: center; gap: 10px; background: linear-gradient(rgba(0,0,0,.78), rgba(0,0,0,0)); }
.rtop .tt { flex: 1; min-width: 0; text-align: center; }
.rtop .tt b { display: block; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rtop .tt span { font-size: .78rem; color: var(--fg-dim); }
.rbot { bottom: 0; padding: 26px 16px calc(var(--bot) + 14px); background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.82)); }
.rbar { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.rbar .pc { font-variant-numeric: tabular-nums; font-weight: 650; font-size: .86rem; min-width: 64px; text-align: center; color: var(--fg-dim); }
.rglass { background: rgba(30,30,34,.6); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px); border-radius: var(--r-pill); padding: 6px; display: flex; align-items: center; gap: 4px; }
.scrub { position: relative; flex: 1; height: 34px; display: flex; align-items: center; touch-action: none; cursor: pointer; }
.scrub .rail { position: absolute; left: 0; right: 0; height: 5px; border-radius: 3px; background: rgba(255,255,255,.22); overflow: hidden; }
.scrub .fillr { position: absolute; top: 0; bottom: 0; background: #fff; border-radius: 3px; }
#reader.rtl .fillr { right: 0; } #reader:not(.rtl) .fillr { left: 0; }
.scrub .knob { position: absolute; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.5); }
.scrub .tip { position: absolute; bottom: 30px; width: 96px; margin-left: -48px; border-radius: 10px; overflow: hidden; background: #111; box-shadow: 0 14px 40px rgba(0,0,0,.7); opacity: 0;
  transform: translateY(6px); transition: opacity .15s, transform .15s; pointer-events: none; }
.scrub .tip img { width: 100%; aspect-ratio: 2/3; object-fit: cover; }
.scrub .tip span { display: block; text-align: center; font-size: .74rem; font-weight: 700; padding: 4px 0; }
.scrub.active .tip { opacity: 1; transform: none; }
.rleft { font-size: .76rem; color: var(--fg-mute); text-align: center; margin-top: 8px; }
#reader.hide-ui .rtop { opacity: 0; transform: translateY(-14px); pointer-events: none; }
#reader.hide-ui .rbot { opacity: 0; transform: translateY(14px); pointer-events: none; }
.zone-hint { position: fixed; inset: 0; z-index: 32; display: grid; grid-template-columns: 1fr 1fr 1fr; pointer-events: none; opacity: 0; transition: opacity .5s; }
.zone-hint.on { opacity: 1; }
.zone-hint div { display: grid; place-items: center; color: rgba(255,255,255,.85); font-weight: 700; font-size: .9rem; letter-spacing: .04em; }
.zone-hint div:nth-child(1), .zone-hint div:nth-child(3) { background: rgba(106,97,239,.22); } .zone-hint div:nth-child(2) { background: rgba(255,255,255,.05); }
.pageno { position: fixed; z-index: 31; bottom: calc(var(--bot) + 8px); left: 50%; transform: translateX(-50%); font-size: .72rem; font-weight: 700; color: rgba(255,255,255,.45); font-variant-numeric: tabular-nums; pointer-events: none; transition: opacity .3s; }
#reader:not(.hide-ui) .pageno { opacity: 0; }
.slide img, .stripcol img { -webkit-touch-callout: none; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } .hero-layer { transform: none !important; } }
/* View transitions: the cover you tapped becomes the poster on the title page */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .32s; }
::view-transition-group(poster) { animation-duration: .45s; animation-timing-function: cubic-bezier(.2,.8,.25,1); }

/* ── review pass 1 (2026-10-12) ──────────────────────────────────────────── */
/* top bar over bright artwork: a soft top shade instead of a panel, and brighter links */
#topbar::before { content: ""; position: absolute; inset: 0 0 -40px 0; z-index: -1; pointer-events: none; background: linear-gradient(rgba(0,0,0,.55), rgba(0,0,0,0)); transition: opacity var(--slow); }
#topbar.solid::before { opacity: 0; }
.navlinks a { color: rgba(255,255,255,.82); text-shadow: 0 1px 10px rgba(0,0,0,.5); }
.navlinks a.on { text-shadow: none; }
/* billboard: a smaller poster on big screens so the block never reaches the bar; long titles a size down */
@media (min-width: 761px) { .hero-poster { width: clamp(96px, 8.4vw, 128px); margin-bottom: 16px; } .hero { min-height: 560px; } }
.hero-title.long { font-size: clamp(1.9rem, 3.6vw, 3.3rem); max-width: 22ch; }
@media (max-width: 760px) { .jf .jf-l { display: none; } .hero-actions .jf { width: 46px; padding: 0; } }
/* title page: legibility for the text column over bright banners */
@media (min-width: 761px) { .dh::after { background: linear-gradient(90deg, rgba(0,0,0,.62) 0%, rgba(0,0,0,.35) 45%, rgba(0,0,0,0) 75%), linear-gradient(rgba(0,0,0,.35), rgba(0,0,0,0) 30%); } }
.dh-alt, .dh-by, .stats, .statusline, .dh-native { text-shadow: 0 1px 12px rgba(0,0,0,.55); }
.dh-by .mute { color: rgba(255,255,255,.55); }
/* up next: the page you stopped on, framed like a resume tile */
.upnext { position: relative; width: clamp(300px, 34vw, 460px); height: 172px; border-radius: var(--r-panel); overflow: hidden; display: grid; grid-template-columns: 104px 1fr auto; gap: 16px; align-items: center;
  padding: 14px 18px 14px 14px; background: var(--tint); isolation: isolate; box-shadow: 0 14px 30px rgba(0,0,0,.45); transition: transform var(--slow); }
.upnext .un-art { position: absolute; inset: 0; z-index: -1; background: center/cover; opacity: .38; filter: saturate(1.2); -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 60%); mask-image: linear-gradient(90deg, transparent 0%, #000 60%); }
.upnext .un-page { height: 144px; border-radius: 8px; overflow: hidden; background: #111; box-shadow: 0 10px 24px rgba(0,0,0,.5); display: grid; place-items: center; }
.upnext .un-page img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.upnext .un-txt { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.upnext .un-k { font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); }
.upnext b { font-size: 1.05rem; line-height: 1.2; letter-spacing: -.02em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.upnext .un-txt > span { color: var(--fg-dim); font-size: .84rem; }
.upnext .un-bar { height: 4px; border-radius: 2px; background: rgba(255,255,255,.2); overflow: hidden; margin-top: 6px; }
.upnext .un-bar i { display: block; height: 100%; background: #fff; }
.upnext small { color: var(--fg-mute); font-size: .74rem; }
.upnext .un-play { width: 44px; height: 44px; border-radius: 50%; background: #fff; color: #000; display: grid; place-items: center; box-shadow: 0 8px 20px rgba(0,0,0,.4); }
.upnext .un-play .ic { width: 18px; height: 18px; margin-left: 2px; }
@media (hover: hover) and (pointer: fine) { .upnext:hover { transform: scale(1.025); } }
@media (max-width: 760px) { .upnext { width: calc(100vw - 2 * var(--gut)); } }
/* the bookcase */
.bookcase { padding: 6px 0 10px; }
.shelfrow { overflow: visible; }
.bookend { flex: none; width: 34px; height: 200px; border-radius: 6px 6px 2px 2px; background: #2a2a30; display: flex; align-items: flex-start; justify-content: center; padding-top: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 -2px 12px rgba(0,0,0,.4); margin-right: 6px; }
.bookend span { writing-mode: vertical-rl; font-size: .74rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-mute); white-space: nowrap; }
/* review pass 2: no hairline where a page meets the strip cut from its bottom; phone density */
.pg img + img { margin-top: -1px; }
@media (max-width: 760px) {
  .dh-poster { width: 146px; }
  .tags .tag:nth-child(n+7) { display: none; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 10px; }
  .grid .card-t { font-size: .82rem; }
  .section-head { flex-wrap: wrap; row-gap: 2px; }
  .section-head .sub { order: 3; flex-basis: 100%; font-size: .84rem; }
}
.endcard .box { width: min(420px, 100%); }
.endcard .btn { white-space: normal; text-align: center; height: auto; min-height: 46px; padding: 10px 22px; max-width: 100%; }
.endcard h2, .endcard p { text-wrap: balance; }
.endcard { direction: ltr; }
/* ── live edition (2026-10-12): skeletons, download progress, reader loading ── */
.sk { display: inline-block; border-radius: 8px; background: linear-gradient(90deg, #121215 0%, #1c1c20 40%, #121215 80%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
.cover.sk { display: block; box-shadow: none; }
.hero.sk { height: min(78vh, 820px); min-height: 520px; border-radius: 0; display: block; }
.dh-poster.sk { display: block; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }
.dlnote { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding: 10px 14px; border-radius: 12px; background: rgba(0,0,0,.35); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  font-size: .86rem; font-weight: 600; color: var(--fg-dim); max-width: 520px; }
.dlnote .ic { color: var(--accent-ink); }
.dlnote .bar { flex: 1 1 120px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.18); overflow: hidden; display: block; }
.dlnote .bar b { display: block; height: 100%; background: var(--accent-ink); transition: width .5s var(--ease); }
.dlnote.ok { color: var(--ok); } .dlnote.ok .ic { color: var(--ok); }
.dlnote.warn { color: var(--warn); } .dlnote.warn .ic { color: var(--warn); }
@media (max-width: 760px) { .dlnote { margin-left: auto; margin-right: auto; } }
.btn:disabled { cursor: default; }
.btn.dl-run { opacity: .85; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.2); border-top-color: var(--accent-ink); animation: spin .8s linear infinite; display: inline-block; flex: none; }
.spin.big { width: 34px; height: 34px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.ic.big { width: 40px; height: 40px; color: var(--accent-ink); }
.rload { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 30px; text-align: center; color: var(--fg-dim); }
.rload p { margin: 4px 0 0; font-size: 1.1rem; font-weight: 650; color: var(--fg); }
.rload small { color: var(--fg-mute); }
.rload .bar { width: min(280px, 70vw); height: 5px; border-radius: 3px; background: rgba(255,255,255,.16); overflow: hidden; display: block; margin-top: 8px; }
.rload .bar b { display: block; height: 100%; background: #fff; transition: width .6s var(--ease); }
.rload .pct { font-variant-numeric: tabular-nums; font-size: .82rem; color: var(--fg-mute); }
#reader.loading .rtop .tt b { display: block; font-size: .95rem; } #reader.loading .rtop .tt span { font-size: .78rem; color: var(--fg-dim); }
.chrow .end .spin { margin-left: 4px; }

/* ── the real thing (2026-10-12): device saves, offline, zoom ───────────────── */
.devbtn { width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; color: var(--fg-faint); background: transparent; flex: none; font-size: .7rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.devbtn .ic { width: 17px; height: 17px; }
.devbtn:hover { background: var(--fill); color: var(--fg); }
.devbtn.on { color: var(--accent-ink); background: var(--accent-soft); }
.devbtn.busy { color: var(--accent-ink); width: auto; padding: 0 6px; }
.offline-pill { display: none; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 980px; background: rgba(229,162,60,.16); color: var(--warn); font-size: .78rem; font-weight: 700; }
.offline-pill .ic { width: 15px; height: 15px; }
body.offline .offline-pill { display: inline-flex; }
.slide.zoomed { transition: none; will-change: transform; }
.reader.strip { touch-action: pan-x pan-y pinch-zoom; }
.feed-item a.thumb { display: block; }

/* ── downloads that need help (2026-10-12 night): koma-api's watchdog retries, then moves to another source ── */
.btn-xs { height: 26px; padding: 0 10px; font-size: .76rem; border-radius: 980px; }
.chrow .end .btn-xs { margin-left: 2px; }
.spin.warn { border-color: rgba(229,162,60,.25); border-top-color: var(--warn); }
.dlbusy { color: var(--warn); font-size: .78rem; font-weight: 600; white-space: nowrap; }
.dlfail { display: inline-flex; align-items: center; gap: 4px; color: var(--bad); font-size: .78rem; font-weight: 600; white-space: nowrap; }
.dlfail .ic { width: 14px; height: 14px; }
.chrow .end .dl small { margin-left: 4px; font-size: .72rem; color: var(--fg-dim); font-weight: 600; }
.rbtns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
details.srcdesc { margin-top: 10px; color: var(--fg-dim); }
details.srcdesc summary { cursor: pointer; font-size: .86rem; }
@media (max-width: 640px) { .chrow .end .btn-xs { padding: 0 8px; } .dlfail { font-size: 0; } .dlfail .ic { width: 16px; height: 16px; } }

/* ── Download to device (2026-10-13): the choice sheet's two-line options and the progress pill (devjob.js) ── */
.menu button .ml { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; min-width: 0; }
.menu button .ml small { color: var(--fg-dim); font-size: .8rem; font-weight: 500; }
.menu button:disabled { opacity: .45; cursor: default; }
.devjob { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 60;
  display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-radius: 16px; width: min(560px, calc(100vw - 32px));
  background: rgba(28,28,32,.92); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: 0 10px 40px rgba(0,0,0,.5); color: var(--fg); }
.devjob .dj-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.devjob .dj-t b { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.devjob .dj-t span { font-size: .78rem; color: var(--fg-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.devjob .dj-bar { position: absolute; left: 16px; right: 16px; bottom: 5px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
.devjob .dj-bar b { display: block; height: 100%; background: var(--accent); transition: width .3s; }
@media (max-width: 760px) { .devjob { bottom: calc(86px + env(safe-area-inset-bottom)); } }
body.reading .devjob { display: none; }

/* ── one card per series, advanced search (2026-10-13) ───────────────────── */
.card.virtual .cover img { filter: saturate(.85); }
.card.none { opacity: .5; }
.pill.dim { background: rgba(20,20,24,.82); color: var(--fg-dim); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.pill.checking { background: rgba(20,20,24,.82); color: var(--fg); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.pill.checking i { width: 9px; height: 9px; border-radius: 50%; border: 1.6px solid rgba(255,255,255,.25); border-top-color: #fff; animation: spin .8s linear infinite; }
.searchbar .filt { position: relative; margin-right: -8px; color: var(--fg-dim); }
.searchbar .filt.on { color: var(--accent-ink); }
.searchbar .filt .badge { position: absolute; top: 2px; right: 0; }
.filters.adv { padding-top: 14px; padding-bottom: 6px; }
.filters.adv .chip .ic { width: 14px; height: 14px; }
.chip.on.x { background: rgba(255,69,58,.2); color: #ff9d94; }
.chip.edit { background: var(--accent-soft); color: var(--accent-ink); }
.chip.clear { background: none; color: var(--fg-mute); }
.resbar { display: flex; align-items: center; gap: 12px; padding: 14px var(--gut) 18px; color: var(--fg-mute); font-size: .9rem; }
.resbar .chip { margin-left: auto; }
.resbar .chip .ic { width: 15px; height: 15px; }
.page > .notice { margin: 0 var(--gut) 18px; grid-template-columns: auto 1fr; }
.notice span { display: block; color: var(--fg-mute); font-size: .88rem; }
.morebar { display: flex; justify-content: center; padding: 26px var(--gut) 6px; }
details.extras { margin: 30px var(--gut) 0; }
details.extras > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; color: var(--fg-dim); font-weight: 650; padding: 10px 0 16px; }
details.extras > summary::-webkit-details-marker { display: none; }
details.extras > summary .n { color: var(--fg-mute); font-weight: 500; }
details.extras > summary .chev { transition: transform var(--fast); }
details.extras[open] > summary .chev { transform: rotate(180deg); }
details.extras .grid { padding: 0; }
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(150px, 15vw, 210px), 1fr)); gap: 10px; padding: 0 var(--gut); }
.preset { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 16px; border-radius: 14px; background: var(--bg-1); color: var(--fg); font-weight: 650; font-size: .95rem; text-align: left; transition: background var(--fast); }
.preset .ic { width: 20px; height: 20px; color: var(--accent-ink); }
.preset.more { background: var(--accent-soft); }
@media (hover: hover) and (pointer: fine) { .preset:hover { background: var(--bg-2); } }
/* the advanced search panel (a sheet on phones, a dialog on wide screens) */
.sheet .af { display: flex; flex-direction: column; gap: 18px; padding-bottom: 8px; }
.af-row { display: flex; flex-direction: column; gap: 8px; }
.af-row > span { font-weight: 650; font-size: .92rem; color: var(--fg); }
.af-row > span small { display: block; font-weight: 500; font-size: .78rem; color: var(--fg-mute); margin-top: 1px; }
.af-row.tog { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; }
.inp { width: 100%; height: 42px; border-radius: 12px; background: var(--bg-2); border: 0; outline: 0; color: var(--fg); padding: 0 14px; font: 500 .95rem var(--font); }
.inp::placeholder { color: var(--fg-faint); }
.inp:focus { box-shadow: 0 0 0 2px var(--accent-soft); }
.af .chips { display: flex; flex-wrap: wrap; gap: 7px; }
.af .chip { height: 32px; padding: 0 12px; font-size: .84rem; }
.seg.wrap { flex-wrap: wrap; border-radius: 16px; gap: 2px; }
.seg.wrap button { height: 30px; }
.pair { display: flex; align-items: center; gap: 10px; }
.pair i { color: var(--fg-mute); font-style: normal; }
.tagall > summary, .tagcat > summary { cursor: pointer; color: var(--fg-dim); font-size: .86rem; font-weight: 600; padding: 6px 0; }
.tagall { margin-top: 2px; }
.tagcat { margin-left: 8px; }
.tagcat .chips { padding: 4px 0 10px; }
.tagcat summary .n { color: var(--fg-mute); font-weight: 500; }
.af-actions { position: sticky; bottom: calc(-26px - var(--bot)); display: flex; gap: 10px; justify-content: flex-end; padding: 16px 0 calc(16px + var(--bot)); margin: 6px 0 0;
  background: linear-gradient(rgba(23,23,26,0), rgba(23,23,26,.98) 28%); }
.af-actions .btn-primary { flex: 1; justify-content: center; max-width: 260px; }
/* inside the panel (its glass is the same grey as the page's controls): lift the controls */
.sheet .inp { background: rgba(255,255,255,.075); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.sheet .inp:focus { box-shadow: inset 0 0 0 1px var(--accent-ink); }
.sheet .seg { background: rgba(255,255,255,.06); }
.sheet .seg button.on { background: rgba(255,255,255,.16); }
.sheet .chip { background: rgba(255,255,255,.08); color: var(--fg-dim); }
.sheet .chip.inc { background: var(--accent); color: #fff; }
.sheet .chip.exc { background: rgba(255,69,58,.22); color: #ff9d94; }

/* ── the home billboard laid out like a series page's top (2026-10-13, owner: "home screen hero cards should look kinda
   like the details hero section … than centered with the small manga, make the blur on background stronger") ───── */
.hero-layer { filter: blur(24px) saturate(1.3) brightness(.82); transform: scale(1.2); }
.hero-layer.on { transform: scale(1.12); }
.hero-layer.cover { filter: blur(40px) saturate(1.35) brightness(.78); transform: scale(1.4); }
.hero-layer.cover.on { transform: scale(1.3); }
.hero-body { align-items: stretch; text-align: left; }
.hb-grid { display: grid; grid-template-columns: clamp(150px, 16vw, 224px) minmax(0, 1fr); gap: clamp(20px, 3vw, 44px); align-items: end; max-width: 1240px; }
.hb-poster { display: block; }
.hb-grid .hero-poster { width: 100%; height: auto; aspect-ratio: 2/3; object-fit: cover; margin: 0; transform: none; border-radius: 14px;
  box-shadow: 0 30px 70px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.08); }
.hb-grid .hero-poster:hover { transform: scale(1.02); }
.hb-info { min-width: 0; }
.hb-info .hero-kicker { margin-bottom: 8px; }
.hb-info .hero-title { max-width: 20ch; margin-bottom: 0; }
.hb-info .hero-title.long { max-width: 24ch; }
.hb-info .stats { margin-top: 12px; }
.hb-info .stats .sdot { display: inline-block; }
.hb-info .stats .ic { width: 1em; height: 1em; }
.hb-info .tags { margin-top: 12px; }
.hb-info .hero-desc { max-width: 62ch; margin: 14px 0 0; -webkit-line-clamp: 3; }
.hb-info .hero-actions { justify-content: flex-start; margin-top: 20px; }
.hero .hb-info .dots { justify-content: flex-start; margin-top: 20px; }
.hb-info .stats, .hb-info .dh-native, .hb-info .hero-kicker { text-shadow: 0 1px 12px rgba(0,0,0,.55); }
@media (min-width: 761px) {
  .hero-scrim { background: linear-gradient(90deg, rgba(0,0,0,.6) 0%, rgba(0,0,0,.32) 48%, rgba(0,0,0,0) 78%), linear-gradient(rgba(0,0,0,.42) 0%, rgba(0,0,0,0) 26%); }
}
@media (max-width: 760px) {
  .hb-grid { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 16px; }
  .hb-grid .hero-poster { width: 138px; }
  .hb-info .stats, .hb-info .tags, .hb-info .hero-actions, .hero .hb-info .dots { justify-content: center; }
  .hb-info .stats { gap: 12px; font-size: .86rem; }
  .hb-info .tags .tag:nth-child(n+5) { display: none; }
  .hb-info .hero-desc { -webkit-line-clamp: 2; margin-left: auto; margin-right: auto; }
  .hb-info .hero-title { margin-left: auto; margin-right: auto; }
}
/* billboard, round 2 (owner, 2026-10-13: "make it go up a little so there isnt as much space and make the image and texts
   better … make the background a little less blurred"): as tall as its content (no empty band under the bar), a bigger
   cover centred beside the words, calmer type, pills on one line, less blur */
.hero { height: auto; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.hero-body { position: relative; inset: auto; padding: calc(64px + var(--top) + 26px) var(--gut) clamp(26px, 3vw, 38px); }
.hero-layer { filter: blur(14px) saturate(1.25) brightness(.8); transform: scale(1.12); }
.hero-layer.on { transform: scale(1.06); }
.hero-layer.cover { filter: blur(28px) saturate(1.3) brightness(.76); transform: scale(1.3); }
.hero-layer.cover.on { transform: scale(1.22); }
.hb-grid { grid-template-columns: clamp(170px, 17vw, 250px) minmax(0, 1fr); gap: clamp(24px, 3.2vw, 52px); align-items: center; }
.hb-grid .hero-poster { border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,.12); }
.hb-info .hero-kicker { font-size: .72rem; margin-bottom: 12px; color: rgba(255,255,255,.85); }
.hb-info .dh-native { font-size: .95rem; margin-bottom: 4px; color: rgba(255,255,255,.62); }
.hb-info .hero-title { font-size: clamp(2rem, 3.4vw, 3.2rem); line-height: 1.05; letter-spacing: -.03em; max-width: 22ch; text-shadow: 0 2px 18px rgba(0,0,0,.45);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hb-info .hero-title.long { font-size: clamp(1.8rem, 2.9vw, 2.7rem); max-width: 26ch; }
.hb-info .stats { margin-top: 14px; gap: 14px; font-size: .9rem; color: rgba(255,255,255,.85); }
.hb-info .tags { margin-top: 14px; flex-wrap: nowrap; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.hb-info .tags .tag { flex: none; height: 24px; font-size: .68rem; background: rgba(255,255,255,.13); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.hb-info .hero-desc { margin-top: 16px; max-width: 58ch; color: rgba(255,255,255,.8); font-size: .98rem; line-height: 1.55; text-shadow: 0 1px 10px rgba(0,0,0,.5); }
.hb-info .hero-actions { margin-top: 22px; }
.hero .hb-info .dots { margin-top: 18px; }
@media (min-width: 761px) { .hero { min-height: 540px; } }
@media (max-width: 760px) {
  .hero-body { padding-top: calc(56px + var(--top) + 18px); }
  .hb-grid { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 18px; }
  .hb-info .hero-title { margin-left: auto; margin-right: auto; }
  .hb-grid .hero-poster { width: 150px; }
  .hb-info .hero-title { max-width: none; }
  .hb-info .tags { justify-content: center; -webkit-mask-image: none; mask-image: none; flex-wrap: wrap; max-height: 24px; }
}
.hero.sk { height: 540px; min-height: 0; }
@media (max-width: 760px) { .hero.sk { height: 620px; } }
/* phones: one line of stats (the anime's name becomes "Anime"), buttons on one row */
.an .an-l { display: none; }
@media (max-width: 760px) {
  .an .an-t { display: none; } .an .an-l { display: inline; }
  .hb-info .stats { flex-wrap: nowrap; white-space: nowrap; }
  .hb-info .hero-actions { flex-wrap: nowrap; }
  .hb-info .hero-actions .btn { padding: 0 18px; }
  .hb-info .hero-actions .jf { flex: none; width: 46px; padding: 0; }
}
@media (max-width: 760px) { .hero { min-height: 700px; } }   /* the tallest slide measured on phones (390 and 360 wide): the rows below don't jump as slides change */
/* the anime → where to read (2026-10-13) */
.dlnote.anime { background: rgba(255,255,255,.08); }
.dlnote.anime .linkbtn { margin: 0 0 0 4px; display: inline-flex; vertical-align: baseline; }
.dlnote.anime .linkbtn .ic { width: 14px; height: 14px; }
