/* ===== Tokens ===== */
:root {
  --accent: #ff4f7b;
  --accent-2: color-mix(in oklab, var(--accent) 70%, #8b5cf6);
  --bg: #0b0b12;
  --bg-2: #11111a;
  --surface: #161622;
  --surface-2: #1d1d2b;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #ededf3;
  --muted: #9b9bb0;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  --radius: 14px;
  --radius-sm: 10px;
  --header-h: 64px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', var(--font);
  color-scheme: dark;
}
:root[data-theme='light'] {
  --bg: #f6f6fa;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #f0f0f6;
  --line: rgba(10, 10, 30, 0.08);
  --line-2: rgba(10, 10, 30, 0.16);
  --text: #15151f;
  --muted: #62627a;
  --shadow: 0 20px 40px -24px rgba(20, 20, 50, 0.35);
  color-scheme: light;
}
/* "Reader" theme: warm paper tones, easier on the eyes for long sessions */
:root[data-theme='sepia'] {
  --bg: #f3ead6;
  --bg-2: #efe4cc;
  --surface: #faf4e6;
  --surface-2: #ebdfc4;
  --line: rgba(70, 45, 10, 0.12);
  --line-2: rgba(70, 45, 10, 0.22);
  --text: #3a2e1f;
  --muted: #7d6a50;
  --shadow: 0 20px 40px -24px rgba(70, 45, 10, 0.35);
  color-scheme: light;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
p { margin: 0 0 0.8em; }
code { background: var(--surface-2); padding: 0.1em 0.4em; border-radius: 6px; font-size: 0.9em; }
svg { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in oklab, var(--accent) 40%, transparent); }
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 20px; }
/* Big monitors (1920px+, ultrawide): use more of the screen instead of a narrow centre column. */
@media (min-width: 1800px) { .container { max-width: 1600px; } }
@media (min-width: 2400px) { .container { max-width: 1920px; } }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

/* ===== Buttons & inputs ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface);
  font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: transform 0.15s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.btn:hover { border-color: var(--text); }
.btn:active { transform: scale(0.97); }
.btn.primary {
  border: 0; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 30px -10px var(--accent);
}
.btn.primary:hover { box-shadow: 0 14px 34px -10px var(--accent); transform: translateY(-1px); }
.btn.ghost { background: color-mix(in oklab, var(--surface) 60%, transparent); backdrop-filter: blur(10px); }
.btn.small { height: 34px; padding: 0 14px; font-size: 13px; }
.btn.big { height: 52px; padding: 0 26px; font-size: 16px; }
.btn.icon-only { width: 42px; padding: 0; justify-content: center; }
.btn[aria-pressed='true'] { background: color-mix(in oklab, var(--accent) 18%, var(--surface)); border-color: var(--accent); color: var(--accent); }
.btn[aria-pressed='true'] svg { fill: currentColor; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border-radius: 999px; border: 0; background: transparent; transition: background 0.2s;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.is-disabled { opacity: 0.3; pointer-events: none; }
.link-btn { background: none; border: 0; color: var(--muted); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.link-btn:hover { color: var(--text); }
.input {
  height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px; outline: none;
}
.input:focus { border-color: var(--accent); }
select.input { padding-right: 32px; }
kbd {
  font: 600 11px/1 var(--font); padding: 3px 6px; border-radius: 6px;
  border: 1px solid var(--line-2); border-bottom-width: 2px; color: var(--muted); background: var(--surface-2);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 999px;
  background: color-mix(in oklab, var(--surface-2) 80%, transparent); border: 1px solid var(--line); color: var(--muted);
}
button.chip:hover { color: var(--text); }
button.chip.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }
.badge-new {
  font: 700 10px/1 var(--font); letter-spacing: 0.06em; padding: 3px 6px; border-radius: 6px; margin-left: 8px;
  background: var(--accent); color: #fff; vertical-align: middle;
}
.eyebrow { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 25%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px transparent; } }
.count { font: 600 13px var(--font); color: var(--muted); background: var(--surface-2); padding: 2px 9px; border-radius: 999px; vertical-align: middle; margin-left: 4px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 100%; }
.logo { display: inline-flex; align-items: center; gap: 10px; font: 700 18px var(--font-display); }
.logo-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff; font-size: 14px; letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 20px -6px var(--accent);
}
.logo-mark svg { width: 24px; height: 24px; display: block; }
.logo-text { font-weight: 800; letter-spacing: -0.01em; }
.logo-accent { background: linear-gradient(90deg, var(--accent), #c25cf0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 8px 12px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.nav a:hover, .nav a[aria-current='page'] { color: var(--text); background: var(--surface-2); }
.nav .nav-support { color: var(--accent); }
.nav .nav-support svg { fill: currentColor; stroke: none; }
.header-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search { position: relative; }
.search input {
  width: 260px; height: 40px; padding: 0 38px 0 38px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px; outline: none; transition: border-color 0.2s, width 0.25s;
}
.search input:focus { border-color: var(--accent); width: 320px; }
.search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; }
.search-kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }
.search input:focus + .search-kbd { display: none; }
.search-results {
  position: absolute; right: 0; top: calc(100% + 8px); width: min(420px, 92vw); max-height: 70vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px;
}
.search-results a { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: var(--radius-sm); }
.search-results a:hover, .search-results a.is-active { background: var(--surface-2); }
.search-results img { width: 40px; height: 56px; object-fit: cover; border-radius: 6px; }
.search-results strong { display: block; font-size: 14px; }
.search-results span { font-size: 12px; color: var(--muted); }
.search-results .empty-msg { padding: 14px; color: var(--muted); font-size: 14px; }
.supporter-badge { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--accent); background: color-mix(in oklab, var(--accent) 14%, transparent); }
.supporter-badge svg { fill: currentColor; stroke: none; }
[data-theme-toggle] > span { display: none; }
[data-theme-toggle] .i-dark { display: inline-flex; }
:root[data-theme='light'] [data-theme-toggle] .i-dark, :root[data-theme='sepia'] [data-theme-toggle] .i-dark { display: none; }
:root[data-theme='light'] [data-theme-toggle] .i-light { display: inline-flex; }
:root[data-theme='sepia'] [data-theme-toggle] .i-sepia { display: inline-flex; }

/* ===== Hero carousel ===== */
.hero { position: relative; min-height: 480px; overflow: hidden; isolation: isolate; }
/* Slide change: the old slide's text drifts left and fades while the new one's comes in from the right,
   line by line; the cover settles in and the background cross-fades with a slow zoom. */
.hero { --ease: cubic-bezier(.2, .8, .2, 1); }
.hero-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .7s ease, visibility 0s linear .7s; }
.hero-slide.is-active { position: relative; opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .7s ease; }
.hero-slide .hero-text > * { opacity: 0; transform: translateX(32px); transition: opacity .6s var(--ease), transform .7s var(--ease); }
.hero-slide.is-active .hero-text > * { opacity: 1; transform: none; }
.hero-slide.is-active .hero-text > :nth-child(1) { transition-delay: .08s; }
.hero-slide.is-active .hero-text > :nth-child(2) { transition-delay: .14s; }
.hero-slide.is-active .hero-text > :nth-child(3) { transition-delay: .2s; }
.hero-slide.is-active .hero-text > :nth-child(4) { transition-delay: .26s; }
.hero-slide.is-active .hero-text > :nth-child(5) { transition-delay: .32s; }
.hero-slide.is-leaving .hero-text > * { opacity: 0; transform: translateX(-32px); transition-duration: .45s; transition-delay: 0s; }
.hero-slide .hero-cover { opacity: 0; transform: perspective(900px) rotateY(8deg) translateX(24px) scale(.94); transition: opacity .6s var(--ease), transform .8s var(--ease); }
.hero-slide.is-active .hero-cover { opacity: 1; transform: perspective(900px) rotateY(8deg); }
.hero-slide.is-active .hero-cover:hover { transform: perspective(900px) rotateY(0) translateY(-4px); transition-duration: .4s; }
.hero-slide.is-leaving .hero-cover { opacity: 0; transform: perspective(900px) rotateY(8deg) translateX(-24px) scale(.96); }
.hero-controls { position: absolute; top: 18px; left: 0; right: 0; z-index: 3; display: flex; justify-content: flex-end; pointer-events: none; }
.hero-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; pointer-events: auto; background: color-mix(in oklab, var(--bg) 55%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line); }
.hero-tabs button { border: 0; background: none; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); transition: background .25s, color .25s; }
.hero-tabs button:hover { color: var(--text); }
.hero-tabs button.is-active { background: var(--text); color: var(--bg); }
.hero-bg {
  position: absolute; inset: -40px; z-index: -1; background-size: cover; background-position: center 25%;
  filter: blur(36px) saturate(1.4); opacity: 0.55; transform: scale(1.05);
}
.hero-slide.is-active .hero-bg { animation: drift 20s ease-in-out infinite alternate; }
@keyframes drift { to { transform: scale(1.15) translate(-2%, 1%); } }
.hero::after { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(180deg, transparent 30%, var(--bg)), linear-gradient(90deg, var(--bg) 0%, transparent 60%); }
.hero-inner { display: flex; align-items: center; gap: 48px; padding-top: 56px; padding-bottom: 72px; }
.hero-cover { flex: none; width: 240px; aspect-ratio: 2/3; border-radius: var(--radius); overflow: hidden; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--line-2); }
.hero-cover img { width: 100%; height: 100%; object-fit: cover; }
.hero-text { max-width: 640px; display: grid; gap: 16px; }
.hero-title { font-size: clamp(32px, 5vw, 56px); font-weight: 800; }
.hero-desc { color: color-mix(in oklab, var(--text) 80%, var(--muted)); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-dots { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.hero-dots { z-index: 3; }
.hero-dots button { position: relative; overflow: hidden; width: 8px; height: 8px; border-radius: 999px; border: 0; padding: 0; background: var(--line-2); transition: width .4s var(--ease), background .3s; }
.hero-dots button:hover { background: var(--muted); }
.hero-dots button.is-active { width: 40px; background: var(--line-2); }
/* The fill is the slide timer: when it reaches the end, the next slide comes (see app.js). */
.hero-dots button.is-active::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: var(--accent); transform-origin: left; animation: hero-fill 7s linear forwards; }
.hero:hover .hero-dots button.is-active::after, .hero:has(:focus-visible) .hero-dots button.is-active::after { animation-play-state: paused; }
@keyframes hero-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ===== Sections ===== */
.section { padding-top: 40px; }
/* Section controls (Clear, RSS, View all…) sit right next to their heading, not stranded at the far edge. */
.section-head { display: flex; align-items: center; justify-content: flex-start; gap: 6px 18px; flex-wrap: wrap; margin-bottom: 18px; }
.rank-panel .section-head { justify-content: space-between; }
.section-head h2 { font-size: 24px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chips { margin-bottom: 18px; }

/* Continue reading rail */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 340px); gap: 14px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.continue-card { scroll-snap-align: start; display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: border-color 0.2s, transform 0.2s; }
.continue-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.continue-card img { width: 56px; height: 80px; object-fit: cover; border-radius: 8px; }
.continue-card .cc-body { min-width: 0; flex: 1; }
.continue-card strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.continue-card .cc-meta { font-size: 13px; color: var(--muted); }
.continue-card .cc-cover { flex: none; }
.cc-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cc-actions .btn { padding: 6px 12px; font-size: 12.5px; }
.continue-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.library-sub { font-size: 20px; margin: 8px 0 14px; }
.library-recent { margin-bottom: 32px; }
.mini-progress { height: 4px; background: var(--surface-2); border-radius: 999px; margin-top: 8px; overflow: hidden; }
.mini-progress > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: inherit; }

/* Latest updates */
.updates { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.update { display: flex; gap: 14px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color 0.2s; }
.update:hover { border-color: var(--line-2); }
.update-cover { flex: none; width: 76px; aspect-ratio: 2/3; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.update-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.update:hover .update-cover img { transform: scale(1.06); }
.update-body { min-width: 0; flex: 1; }
.update h3 { font-size: 16px; margin: 2px 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.update h3 a:hover { color: var(--accent); }
.update ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.update li a { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 4px 8px; margin: 0 -8px; border-radius: 8px; }
.update li a:hover { background: var(--surface-2); }
.update li time { color: var(--muted); white-space: nowrap; }
.update li a.is-read .update-ch { color: var(--muted); }

/* Cards grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 22px 16px; }
.card { display: block; }
.card-cover { position: relative; aspect-ratio: 2/3; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); box-shadow: 0 0 0 1px var(--line); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s cubic-bezier(.2,.8,.2,1); }
.card:hover .card-cover img { transform: scale(1.07); }
.card-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 60%, rgba(0,0,0,.5)); opacity: 0; transition: opacity 0.3s; }
.card:hover .card-cover::after { opacity: 1; }
.card-status { position: absolute; left: 8px; top: 8px; z-index: 1; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; backdrop-filter: blur(6px); text-transform: capitalize; }
.card-dot { position: absolute; right: 8px; top: 8px; z-index: 1; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(0,0,0,.4); }
.card-body { padding: 10px 2px 0; }
.card-title { font-size: 15px; font-weight: 600; font-family: var(--font); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card:hover .card-title { color: var(--accent); }
.card-meta { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ===== Ads ===== */
.ad { margin: 36px 0 0; }
.ad-label { display: flex; justify-content: space-between; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 6px; }
.ad-label a { text-transform: none; letter-spacing: 0; color: var(--accent); }
.house-ad { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: var(--radius); border: 1px dashed var(--line-2); background: linear-gradient(120deg, color-mix(in oklab, var(--accent) 10%, var(--surface)), var(--surface)); }
.house-ad > span:nth-child(2) { flex: 1; font-size: 14px; }
.house-ad-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--accent); background: color-mix(in oklab, var(--accent) 16%, transparent); }
.house-ad-icon svg { fill: currentColor; stroke: none; width: 22px; height: 22px; }
.series-side .ad { margin-top: 16px; }
.series-side .house-ad { flex-direction: column; align-items: flex-start; gap: 12px; }
.series-side { align-self: start; position: sticky; top: calc(var(--header-h) + 16px); }

/* ===== Series page ===== */
/* No overflow:hidden here so the "Add to library" menu can drop below; the blurred background clips itself. */
.series-hero { position: relative; z-index: 5; isolation: isolate; overflow-x: clip; } /* keep the blurred cover from widening the page */
.series-bg { position: absolute; inset: -40px; z-index: -1; background-size: cover; background-position: center 25%; filter: blur(40px) saturate(1.3); opacity: 0.5; clip-path: inset(40px); }
.series-hero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent, var(--bg) 92%); }
.series-head { display: flex; gap: 36px; align-items: flex-end; padding-top: 48px; padding-bottom: 28px; }
.series-cover { width: 220px; aspect-ratio: 2/3; object-fit: cover; border-radius: var(--radius); box-shadow: 0 30px 60px -20px rgba(0,0,0,.7), 0 0 0 1px var(--line-2); flex: none; }
.series-info { display: grid; gap: 12px; min-width: 0; }
.series-info h1 { font-size: clamp(30px, 4.5vw, 52px); font-weight: 800; }
.alt-titles { color: var(--muted); font-size: 14px; }
.people { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; }
.people .muted { margin-right: 4px; }
.series-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; padding-top: 8px; padding-bottom: 40px; }
.description { color: color-mix(in oklab, var(--text) 85%, var(--muted)); max-width: 75ch; position: relative; }
.description.is-collapsed { max-height: 7.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.description-toggle { margin-top: 4px; }
.chapters-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 28px 0 12px; }
.chapters-head h2 { font-size: 22px; }
.chapter-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.chapter-list li + li { border-top: 1px solid var(--line); }
.chapter-list a { display: flex; align-items: center; gap: 14px; padding: 14px 18px; transition: background 0.15s; }
.chapter-list a:hover { background: var(--surface-2); }
.ch-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.ch-main { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ch-label { font-weight: 600; }
.ch-title { color: var(--muted); font-size: 14px; }
.ch-pages { font-size: 12px; }
.chapter-list time { font-size: 13px; color: var(--muted); white-space: nowrap; min-width: 84px; text-align: right; }
.chapter-list li.is-read .ch-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.chapter-list li.is-read .ch-label { color: var(--muted); font-weight: 500; }
.chapter-list li.is-current a { background: color-mix(in oklab, var(--accent) 8%, transparent); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.stats strong { display: block; font: 700 18px var(--font-display); }
.stats strong time { font: inherit; font-size: 14px; white-space: nowrap; }
.stats span { font-size: 12px; color: var(--muted); }

/* ===== Support ===== */
.support { max-width: 920px; padding-top: 48px; padding-bottom: 48px; }
.support-hero { text-align: center; display: grid; justify-items: center; gap: 14px; margin-bottom: 32px; }
.support-heart { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 20px 40px -14px var(--accent); animation: beat 2.4s infinite; }
.support-heart svg { width: 34px; height: 34px; fill: currentColor; stroke: none; }
@keyframes beat { 0%, 100% { transform: scale(1); } 10% { transform: scale(1.08); } 20% { transform: scale(1); } 30% { transform: scale(1.05); } }
.support-hero h1 { font-size: clamp(30px, 5vw, 46px); font-weight: 800; }
.goal { width: 100%; max-width: 620px; display: grid; gap: 8px; padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--surface); text-align: left; }
.goal-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 15px; }
.goal-head span { font-weight: 700; color: var(--accent); }
.goal-bar { height: 12px; border-radius: 999px; background: color-mix(in oklab, var(--accent) 14%, transparent); overflow: hidden; }
.goal-bar span { display: block; height: 100%; min-width: 6px; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.6s ease; }
.goal-costs { list-style: none; margin: 6px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.goal-costs li { display: flex; justify-content: space-between; gap: 12px; }
.lead { font-size: 17px; color: color-mix(in oklab, var(--text) 85%, var(--muted)); max-width: 60ch; }
.support-hero { grid-template-columns: minmax(0, 1fr); }
.donate-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 12px; width: 100%; max-width: 820px; margin-top: 8px; }
.donate-link { display: grid; gap: 2px; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--surface); text-align: left; transition: transform 0.15s, border-color 0.2s, box-shadow 0.2s; }
.donate-link:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 14px 30px -18px var(--accent); }
.donate-link strong { font: 700 17px var(--font-display); }
.donate-link span { font-size: 13px; color: var(--muted); }
.donate-link.is-primary { border: 0; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.donate-link.is-primary span { color: rgba(255,255,255,.85); }
.support-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.support-grid h2 { font-size: 20px; margin-bottom: 12px; }
.perks { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.unlock { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.unlock .input { flex: 1; min-width: 220px; height: 42px; }
.notice { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 16px; font-weight: 500; }
.notice-ok { background: color-mix(in oklab, #22c55e 15%, var(--surface)); border: 1px solid color-mix(in oklab, #22c55e 40%, transparent); }
.notice-err { background: color-mix(in oklab, #ef4444 13%, var(--surface)); border: 1px solid color-mix(in oklab, #ef4444 40%, transparent); }

/* ===== Status / empty ===== */
.status { padding-top: 40px; padding-bottom: 40px; display: grid; gap: 16px; }
.status .stats { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pill { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); }
.pill-error { background: #ef444433; color: #f87171; }
.pill-waiting, .pill-queued, .pill-extracting { background: #f59e0b33; color: #fbbf24; }
.empty { text-align: center; padding-top: 100px; padding-bottom: 100px; display: grid; justify-items: center; gap: 14px; }
.empty-art { font: 800 64px var(--font-display); color: var(--accent); }
.empty-art svg { width: 64px; height: 64px; }

/* ===== Footer ===== */
.site-footer { margin-top: 64px; border-top: 1px solid var(--line); padding: 32px 0; background: var(--bg-2); }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-inner p { margin: 8px 0 0; font-size: 14px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; font-size: 14px; color: var(--muted); }
.footer-links a { display: inline-flex; gap: 6px; align-items: center; }
.footer-links a:hover { color: var(--text); }
.footer-note { font-size: 12px; margin-top: 20px; }

/* ===== Toasts ===== */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: toast-in 0.4s cubic-bezier(.2,.9,.3,1.2); }
.toast img { width: 44px; height: 62px; object-fit: cover; border-radius: 8px; }
.toast-body { flex: 1; min-width: 0; font-size: 14px; }
.toast-body small { display: block; color: var(--accent); font-weight: 700; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.toast-body strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast-close { background: none; border: 0; color: var(--muted); font-size: 20px; line-height: 1; padding: 4px; }
.toast.is-leaving { animation: toast-out 0.3s forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }

/* ===== Reader ===== */
.reader-page { --r-bg: var(--bg); background: var(--r-bg); }
.reader-page[data-bg='black'] { --r-bg: #000; }
.reader-page[data-bg='white'] { --r-bg: #fff; }
.reader-page[data-bg='black'] .r-end-card { color: #ededf3; }
.reader-page[data-bg='black'] .r-end-card .muted { color: #9b9bb0; }
.reader-page[data-bg='white'] .r-end-card { color: #15151f; }
.reader-page[data-bg='white'] .r-end-card .muted { color: #62627a; }
.r-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: 60px; display: flex; align-items: center; gap: 8px;
  padding: 0 10px; padding-top: env(safe-area-inset-top);
  background: color-mix(in oklab, var(--bg) 80%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line); transition: transform 0.3s;
}
.r-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.r-series { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-series:hover { color: var(--text); }
.r-select { field-sizing: content; max-width: 100%; background: transparent; border: 0; color: var(--text); font: 600 15px var(--font); padding: 0; outline: none; cursor: pointer; text-overflow: ellipsis; }
.r-select option { background: var(--surface); }
.r-actions { display: flex; gap: 2px; }
.ui-hidden .r-top { transform: translateY(-100%); }
.ui-hidden .r-pill { opacity: 0; transform: translate(-50%, 10px); }

.reader { padding-top: 60px; min-height: 100vh; }
/* Long strip: pages butt together with no gap, like one continuous scroll. */
.strip { display: flex; flex-direction: column; align-items: center; margin: 0 auto; gap: 0; line-height: 0; }
.strip img { display: block; width: 100%; height: auto; margin: 0; border: 0; vertical-align: top; background: color-mix(in oklab, var(--r-bg) 88%, #888); }
/* Scaled images can land on fractional pixels and leave a hairline seam; overlap by 1px to hide it. */
.strip img + img { margin-top: -1px; }
.strip img.is-loaded { background: none; }
.fit-width .strip { max-width: var(--strip-w, 900px); }
.fit-height .strip img { width: auto; max-height: calc(100vh - 60px); max-width: 100%; }
.fit-original .strip img { width: auto; max-width: none; }
.fit-original .strip { overflow-x: auto; align-items: center; }

.mode-paged .strip { display: none; }
.paged { position: relative; height: calc(100vh - 60px); height: calc(100dvh - 60px); display: grid; place-items: center; overflow: auto; }
.spread { display: flex; justify-content: center; align-items: center; width: 100%; height: 100%; }
.dir-rtl .spread { flex-direction: row-reverse; }
.paged img { max-width: 100%; max-height: 100%; object-fit: contain; min-width: 0; user-select: none; -webkit-user-drag: none; }
.spread.is-pair img { max-width: 50%; }
.dir-ltr .spread.is-pair img:first-child, .dir-rtl .spread.is-pair img:last-child { object-position: right center; }
.dir-ltr .spread.is-pair img:last-child, .dir-rtl .spread.is-pair img:first-child { object-position: left center; }
.fit-width .spread { height: auto; align-items: flex-start; }
.fit-width .paged img { width: min(100%, var(--strip-w, 900px)); max-height: none; }
.fit-width .spread.is-pair img { width: 50%; }
.fit-original .spread { height: auto; width: max-content; min-width: 100%; }
.fit-original .paged img, .fit-original .spread.is-pair img { max-width: none; max-height: none; width: auto; }
.fit-width .paged, .fit-original .paged { place-items: start center; }
.tap { position: absolute; top: 0; bottom: 0; border: 0; background: transparent; padding: 0; -webkit-tap-highlight-color: transparent; }
.tap-left { left: 0; width: 33%; cursor: w-resize; }
.tap-mid { left: 33%; width: 34%; cursor: pointer; }
.tap-right { right: 0; width: 33%; cursor: e-resize; }
.mode-paged.at-end .paged { display: none; }
.mode-paged .r-end { display: none; }
.mode-paged.at-end .r-end { display: grid; min-height: calc(100vh - 60px); }

.r-end { display: grid; place-items: center; grid-template-columns: minmax(0, 1fr); padding: 64px 20px 120px; }
.r-end > * { max-width: 100%; }

/* Chapter banners: above page 1 and below the last page, same width as the pages, height reserved. */
.r-ad { width: 100%; max-width: min(var(--strip-w, 900px), 100%); margin: 0 auto; padding: 14px 12px; box-sizing: border-box; }
.r-ad-top { padding-top: 18px; }
.r-ad-box { min-height: 90px; display: grid; place-items: center; overflow: hidden; }
.r-ad-box > * { max-width: 100%; }
@media (max-width: 700px) { .r-ad-box { min-height: 100px; } }
/* Single-page mode: no top banner; the bottom one shows on the end screen only. */
.mode-paged .r-ad-top, .mode-paged .r-ad-bottom { display: none; }
.mode-paged.at-end .r-ad-bottom { display: block; }
.r-end-card { width: min(520px, 100%); display: grid; justify-items: center; gap: 16px; text-align: center; color: var(--text); }
.r-end-card .ad { width: 100%; margin-top: 8px; text-align: left; }
.r-end-links { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.r-caught-up { font: 700 24px var(--font-display); margin: 0; }
.r-support { display: inline-flex; gap: 6px; align-items: center; color: var(--accent); font-size: 14px; font-weight: 600; }
.r-support svg { fill: currentColor; stroke: none; }
/* "Translated by" credits (series sidebar + end of chapter) */
.credits, .r-credits { display: grid; gap: 8px; justify-items: start; }
.r-credits { justify-items: center; text-align: center; margin: 4px 0; }
.credits-who { font-weight: 700; font-size: 16px; }
.credits-who a { color: var(--accent); }
.credits .btn svg, .r-credits .btn svg { fill: currentColor; stroke: none; }

.r-progress { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: 3px; background: transparent; }
.r-progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.15s; }
.r-pill {
  position: fixed; bottom: calc(14px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 60;
  font: 600 13px var(--font); padding: 6px 14px; border-radius: 999px; color: #fff; background: rgba(0,0,0,.65); backdrop-filter: blur(8px);
  transition: opacity 0.3s, transform 0.3s; pointer-events: none; font-variant-numeric: tabular-nums;
}
.r-panel, .r-help {
  position: fixed; z-index: 70; right: 12px; top: 72px; width: min(380px, calc(100vw - 24px)); max-height: calc(100vh - 90px); overflow: auto;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px;
  animation: pop 0.2s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.r-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.r-panel-head h2 { font-size: 18px; }
.r-panel-head .icon-btn { font-size: 24px; }
.r-field { margin-bottom: 16px; }
.r-field > label:not(.toggle) { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.seg { display: flex; background: var(--surface-2); padding: 3px; border-radius: 999px; gap: 2px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 7px 8px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--muted); }
.seg button.is-active { background: var(--bg); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.2); }
input[type='range'] { width: 100%; accent-color: var(--accent); }
.r-note { font-size: 12px; margin: 8px 0 0; }
.r-toggles { display: grid; gap: 10px; }
.toggle { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle span { width: 38px; height: 22px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); position: relative; flex: none; transition: background 0.2s; }
.toggle span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform 0.2s, background 0.2s; }
.toggle input:checked + span { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + span::after { transform: translateX(16px); background: #fff; }
.toggle input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.r-help dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 12px; font-size: 14px; align-items: center; }
.r-help dt { white-space: nowrap; }
.r-help dd { margin: 0; color: var(--muted); }

/* ===== Cover cards (Recently Added style) ===== */
.card > .card-meta { margin-top: 8px; font-size: 12.5px; }
.card > .card-meta time { white-space: nowrap; }
.card > .card-title { margin-top: 3px; font-size: 14.5px; line-height: 1.3; }
.card-type { position: absolute; left: 8px; bottom: 8px; z-index: 1; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; background: rgba(0,0,0,.62); color: #fff; backdrop-filter: blur(6px); }
.page-title { font-size: clamp(26px, 4vw, 34px); }
.head-links { display: flex; align-items: center; gap: 12px; }
.load-more { margin-top: 28px; }

/* ===== Popular / Top rated ===== */
.ranks { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; }
.rank-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.rank-panel .section-head { margin-bottom: 10px; }
.rank-panel h2 { font-size: 20px; }
.small-tabs { margin: 0; padding: 0; }
.small-tabs .tab { padding: 5px 11px; font-size: 12.5px; }
.rank-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rank-list > li.muted { padding: 12px 4px; font-size: 14px; }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; transition: background .15s; }
.rank-row:hover { background: var(--surface-2); }
.rank-n { width: 22px; text-align: center; font: 800 18px var(--font-display); color: var(--muted); flex: none; }
.rank-list li:nth-child(-n+3) .rank-n { color: var(--accent); }
.rank-row img { width: 44px; height: 62px; object-fit: cover; border-radius: 8px; flex: none; background: var(--surface-2); }
.rank-body { flex: 1; min-width: 0; display: grid; }
.rank-body strong { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-body .muted { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-right { font-size: 12.5px; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.star { width: 15px; height: 15px; fill: #fbbf24; stroke: none; }
.browse-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 22px 24px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(120deg, color-mix(in oklab, var(--accent) 12%, var(--surface)), var(--surface)); }
.browse-cta > span:first-child { display: grid; gap: 2px; }
.browse-cta strong { font: 700 19px var(--font-display); }

/* ===== Browse ===== */
.browse { display: grid; gap: 16px; align-content: start; }
/* Full-height pages built as grids: keep rows at their natural height instead of stretching them. */
.account, .admin, .status { align-content: start; }
.browse-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.field { display: grid; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); min-width: 150px; }
.field.grow { flex: 1; min-width: 220px; }
.field .input { height: 40px; border-radius: 12px; width: 100%; }
.browse-filters .btn { height: 40px; }
a.chip:hover { color: var(--text); border-color: var(--line-2); }
a.chip.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip-clear { color: var(--accent) !important; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 24px; }

/* ===== Rating ===== */
.rating { margin-top: 16px; display: grid; gap: 8px; text-align: center; justify-items: center; }
.rating-score { display: flex; align-items: baseline; gap: 8px; }
.rating-score .star { width: 20px; height: 20px; align-self: center; }
.rating-score strong { font: 800 26px var(--font-display); }
.rating-score span { font-size: 13px; }
.stars { display: flex; gap: 2px; }
.stars button { border: 0; background: none; padding: 4px; border-radius: 8px; line-height: 0; }
.stars .star { width: 26px; height: 26px; fill: var(--surface-2); stroke: var(--line-2); stroke-width: 1; transition: fill .1s, transform .1s; }
.stars button.is-on .star { fill: #fbbf24; stroke: #f59e0b; }
.stars button:hover .star { transform: scale(1.12); }
.rating p { margin: 0; }
.similar { padding-bottom: 8px; }

/* ===== Comments ===== */
.comments { width: min(760px, 100%); margin-top: 56px; display: grid; gap: 18px; text-align: left; color: var(--text); }
.reader-page[data-bg='black'] .comments { --text: #ededf3; --muted: #9b9bb0; --surface: #161622; --surface-2: #1d1d2b; --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.14); }
.reader-page[data-bg='white'] .comments { --text: #15151f; --muted: #62627a; --surface: #fff; --surface-2: #f0f0f6; --line: rgba(10,10,30,.08); --line-2: rgba(10,10,30,.16); }
.comments-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.comments-head h2 { font-size: 22px; display: flex; align-items: center; gap: 8px; }
.comment-sort { width: 180px; }
.comment-form { display: flex; gap: 12px; align-items: flex-start; }
.comment-form-main { flex: 1; display: grid; gap: 8px; min-width: 0; }
.comment-form textarea { width: 100%; height: auto; min-height: 84px; padding: 12px 14px; border-radius: 14px; resize: vertical; line-height: 1.5; font: inherit; }
.comment-form.is-compact textarea { min-height: 60px; }
.comment-form.is-compact { margin-top: 10px; }
.comment-form-bar { display: flex; align-items: center; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.spoiler-check { margin-right: auto; display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); cursor: pointer; }
.comment-login { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.comment-login span { margin-right: auto; font-weight: 600; }
.comment-list { display: grid; gap: 4px; }
.comment { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.replies .comment { border-top: 0; padding: 10px 0 0; }
.replies { margin-top: 6px; padding-left: 4px; border-left: 2px solid var(--line); padding-left: 12px; }
.replies .avatar { width: 28px; height: 28px; font-size: 13px; }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.comment-head time { font-size: 12.5px; color: var(--muted); }
.team-badge { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 6px; border-radius: 6px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.comment-body { margin-top: 4px; font-size: 14.5px; line-height: 1.55; overflow-wrap: anywhere; }
.comment-body a { color: var(--accent); }
.comment.is-hidden > .comment-main { opacity: .6; }
.comment.is-removed { display: block; }
.spoiler { position: relative; border-radius: 10px; cursor: pointer; }
.spoiler .spoiler-body { filter: blur(6px); user-select: none; transition: filter .2s; }
.spoiler-label { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; font-size: 12.5px; font-weight: 600; color: var(--text); background: color-mix(in oklab, var(--surface-2) 60%, transparent); border-radius: 10px; }
.spoiler.is-open { cursor: auto; }
.spoiler.is-open .spoiler-body { filter: none; user-select: auto; }
.spoiler.is-open .spoiler-label { display: none; }
.comment-actions { display: flex; gap: 4px; margin-top: 6px; margin-left: -8px; flex-wrap: wrap; }
.c-act { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; color: var(--muted); font-size: 12.5px; font-weight: 600; padding: 4px 8px; border-radius: 8px; }
.c-act:hover { background: var(--surface-2); color: var(--text); }
.c-act svg { width: 15px; height: 15px; }
.c-act.is-liked { color: var(--accent); }
.c-act.is-liked svg { fill: currentColor; }
.c-report { margin-left: auto; }
.comment-empty { padding: 20px 0; text-align: center; }
.comment-rules { margin-top: 8px; }
.comments-btn { position: relative; }
.comments-badge { position: absolute; top: 3px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: #fff; font: 700 10px/16px var(--font); text-align: center; }
.ch-comments { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.ch-comments svg { width: 14px; height: 14px; }
.mode-paged.at-end .r-end { align-content: start; padding-top: 48px; }

/* ===== Notifications ===== */
.bell { position: relative; }
.bell-btn { position: relative; }
.bell-badge { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: #fff; font: 700 10px/17px var(--font); text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.bell-menu { width: min(380px, calc(100vw - 24px)); padding: 0; overflow: hidden; }
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.bell-items { max-height: min(60vh, 440px); overflow-y: auto; }
.bell-empty { padding: 16px 14px; margin: 0; }
.bell-all { display: block !important; text-align: center !important; padding: 11px !important; border-top: 1px solid var(--line); border-radius: 0 !important; color: var(--accent) !important; font-weight: 600; }
.notif { display: flex !important; gap: 12px; align-items: flex-start !important; padding: 12px 14px !important; border-radius: 0 !important; border-bottom: 1px solid var(--line); position: relative; }
.notif:hover { background: var(--surface-2); }
.notif.is-unread { background: color-mix(in oklab, var(--accent) 7%, transparent); }
.notif-img { width: 40px; height: 56px; border-radius: 8px; object-fit: cover; flex: none; background: var(--surface-2); }
.notif-img.is-round { width: 40px; height: 40px; border-radius: 50%; }
.notif-icon { display: grid; place-items: center; font-size: 20px; height: 40px; border-radius: 50%; }
.notif-body { display: grid; gap: 3px; min-width: 0; font-size: 13.5px; line-height: 1.4; }
.notif-text { font-weight: 500; }
.notif-excerpt { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notif-body time { font-size: 12px; color: var(--muted); }
.notif-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; margin-top: 6px; margin-left: auto; }
.notif-list { padding: 0; }
.notif-list .notif:last-of-type { border-bottom: 0; }
.notif-settings .toggle { color: var(--text); font-weight: 500; font-size: 14px; }
.notif-settings .btn { justify-self: start; }
.comment.is-highlighted > .comment-main { animation: flash 2.4s ease-out; border-radius: 10px; }
@keyframes flash { 0%, 40% { background: color-mix(in oklab, var(--accent) 22%, transparent); box-shadow: 0 0 0 6px color-mix(in oklab, var(--accent) 22%, transparent); } }

/* ===== Menus, avatar ===== */
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; flex: none; }
.avatar-letter { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font: 700 15px var(--font-display); }
.avatar-lg { width: 72px; height: 72px; font-size: 30px; }
.user-menu, .shelf { position: relative; }
.user-btn { border: 0; padding: 0; background: none; border-radius: 50%; display: grid; }
.user-btn:hover .avatar { box-shadow: 0 0 0 3px var(--line-2); }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 80; min-width: 230px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); animation: pop 0.15s ease-out;
}
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: none; border-radius: var(--radius-sm); font-size: 14px; text-align: left; color: var(--text); }
.menu a:hover, .menu button:hover { background: var(--surface-2); }
.menu form { margin: 0; }
.menu-head { display: flex; gap: 10px; align-items: center; padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-head strong { display: block; font-size: 14px; }
.menu-sub { font-size: 12px; display: inline-flex; gap: 4px; align-items: center; }
.supporter-text { color: var(--accent); }
.supporter-text svg { fill: currentColor; stroke: none; width: 12px; height: 12px; }
.shelf-menu { left: 0; right: auto; }
.shelf-menu button.is-active { color: var(--accent); font-weight: 600; }
.shelf-menu button.is-active::after { content: '✓'; margin-left: auto; }
.menu-danger { color: #ef4444 !important; border-top: 1px solid var(--line) !important; border-radius: 0 0 var(--radius-sm) var(--radius-sm) !important; }
.login-btn { height: 36px; }

/* ===== Auth pages ===== */
.auth { display: grid; place-items: center; padding-top: 48px; padding-bottom: 48px; }
.auth-card { width: min(440px, 100%); padding: 28px; display: grid; gap: 14px; }
.auth-card h1 { font-size: 26px; }
.auth-card .notice { margin: 0; }
.auth-alt { font-size: 14px; color: var(--muted); text-align: center; margin: 4px 0 0; }
.auth-alt a, .notice a, .panel p a, .steps a { color: var(--accent); }
.social { display: grid; gap: 10px; }
.social-btn { justify-content: center; height: 46px; background: var(--surface-2); }
.brand { width: 20px; height: 20px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.stack { display: grid; gap: 12px; }
.stack label, .claim-form label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.stack .input, .claim-form .input { height: 44px; border-radius: 12px; width: 100%; }
.stack .btn { justify-content: center; }
.small-heart { width: 56px; height: 56px; justify-self: center; }

/* ===== My Library ===== */
.my-library h1 { font-size: 30px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 18px; scrollbar-width: none; }
.tab { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--muted); padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; }
.tab.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }
.tab-count { font-size: 12px; opacity: .7; margin-left: 2px; }
.small-empty { padding-top: 40px; padding-bottom: 40px; }

/* ===== Account ===== */
.account { padding-top: 36px; padding-bottom: 40px; display: grid; gap: 18px; }
.account-head { display: flex; gap: 16px; align-items: center; }
.account-head h1 { font-size: 30px; }
.account-head p { margin: 4px 0 0; }
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.account-grid .panel, .admin .panel { display: grid; gap: 12px; align-content: start; }
.account-grid h2, .admin h2, .how h2 { font-size: 19px; }
.span-2 { grid-column: 1 / -1; }
.status-line { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); margin: 0; }
.status-line.is-on { background: color-mix(in oklab, var(--accent) 14%, var(--surface)); color: var(--text); }
.status-line svg { fill: var(--accent); stroke: none; vertical-align: -2px; }
.code-chip { font: 700 14px/1 ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: .06em; padding: 6px 10px; border-radius: 8px; border: 1px dashed var(--accent); background: color-mix(in oklab, var(--accent) 10%, transparent); color: var(--text); cursor: copy; }
.code-chip:hover { background: color-mix(in oklab, var(--accent) 20%, transparent); }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0; }
.inline-form .input { flex: 1; min-width: 160px; }
.inline-form .input.days { flex: 0 0 90px; min-width: 0; }
.email-list, .login-list, .claim-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.email-list li, .login-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.email-list li > span:first-child, .login-list li > span:first-of-type { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.email-list form, .login-list form { margin: 0; }
.claim-list li { font-size: 14px; }
.pill-pending { background: #f59e0b33; color: #d97706; }
.pill-approved { background: #22c55e33; color: #16a34a; }
.pill-rejected { background: #ef444433; color: #ef4444; }
details summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 4px 0; }
details[open] summary { margin-bottom: 10px; }
.danger-zone { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.danger-text { color: #ef4444; }
.btn.danger { background: #ef4444; color: #fff; border: 0; }
.claim-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.claim-form .btn { justify-self: start; }
.table tr.is-revoked td { opacity: .5; text-decoration: line-through; }

/* ===== Support: how-to ===== */
.how { display: grid; gap: 14px; align-content: start; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 12px; }
.steps ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 10px; }
.steps .inline-form { margin-top: 8px; }
.guest-unlock { border-top: 1px solid var(--line); padding-top: 12px; }
.faq-title { font-size: 16px; margin: 18px 0 6px; }
.support-grid details { border-top: 1px solid var(--line); padding: 8px 0; }
.support-grid details p { font-size: 14px; color: var(--muted); }

/* ===== Admin ===== */
.admin { padding-top: 36px; padding-bottom: 40px; display: grid; gap: 18px; }
.admin-stats { grid-template-columns: repeat(4, 1fr); }
.admin-item { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.admin-item > div { flex: 1; min-width: 260px; }
.admin-item form { margin: 0; }
.admin .table { font-size: 13px; }
.admin .table form { margin: 0; }
.admin .table .inline-form .input { min-width: 140px; height: 32px; }
.admin select.input { max-width: 340px; }
.panel { overflow-x: auto; }
.mod-item { display: grid; gap: 6px; padding: 14px 0; border-top: 1px solid var(--line); }
.mod-item.is-hidden { opacity: .75; }
.mod-meta a { color: var(--accent); }
.mod-body { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14px; overflow-wrap: anywhere; }
.report-line { color: #f59e0b; font-weight: 600; }
.mod-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mod-actions form { margin: 0; }
.mute-form select { min-width: 0; flex: 0 0 auto; height: 32px; }
.mute-form label { display: inline-flex; gap: 4px; align-items: center; color: var(--muted); }

/* ===== Responsive ===== */
.nav a, .logo-text { white-space: nowrap; }
@media (max-width: 1240px) {
  .logo-text { display: none; }
  .search input { width: 210px; }
  .search input:focus { width: 260px; }
}
@media (max-width: 1000px) {
  .nav { display: none; }
  .search input, .search input:focus { width: 200px; }
  .series-body { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  :root { --header-h: 58px; }
  body { font-size: 14px; }
  .container { padding: 0 14px; }
  .header-inner { gap: 10px; }
  .logo-text { display: none; }
  .header-tools { flex: 1; }
  .search { flex: 1; }
  .search input, .search input:focus { width: 100%; }
  .search-kbd { display: none; }
  .supporter-badge span { display: none; }
  .hero { min-height: 0; }
  .hero-inner { flex-direction: column; align-items: flex-start; gap: 20px; padding-top: 28px; padding-bottom: 60px; }
  .hero-cover { width: 130px; }
  .hero-slide.is-active .hero-cover, .hero-slide.is-active .hero-cover:hover { transform: none; }
  .hero-controls { top: 12px; justify-content: center; }
  .hero-tabs button { padding: 6px 11px; font-size: 12px; }
  .hero-inner { padding-top: 64px; }
  .hero::after { background: linear-gradient(180deg, transparent 20%, var(--bg)); }
  .updates { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 18px 12px; }
  .series-head { flex-direction: column; align-items: center; text-align: center; gap: 18px; padding-top: 28px; }
  .series-cover { width: 160px; }
  .series-info { justify-items: center; }
  .series-info .chips, .series-info .actions, .people { justify-content: center; }
  .eyebrow { justify-content: center; }
  .hero .eyebrow { justify-content: flex-start; }
  .chapter-list a { padding: 12px 14px; gap: 10px; }
  .ch-pages { display: none; }
  .support-grid, .account-grid, .claim-form, .ranks { grid-template-columns: 1fr; }
  .field, .field.grow { min-width: 0; flex: 1 1 140px; }
  .browse-filters .btn { flex: 1 1 100%; justify-content: center; }
  .comment-form > .avatar { display: none; }
  .comment-sort { width: 100%; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .login-btn { padding: 0 12px; }
  .menu { position: fixed; left: 12px; right: 12px; top: 64px; min-width: 0; }
  .hide-sm { display: none; }
  .house-ad { flex-wrap: wrap; }
  .r-top { height: 56px; }
  .r-panel, .r-help {
    left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-height: 80vh;
    border-radius: 20px 20px 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom));
    animation: sheet 0.25s ease-out;
  }
  .seg button { padding: 8px 4px; font-size: 12.5px; }
}
@keyframes sheet { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  /* The banner still changes slides (slower), but with a plain cross-fade and no movement. */
  .hero-dots button.is-active::after { animation: hero-fill 10s linear forwards !important; }
  .hero .hero-slide { transition: opacity .6s ease, visibility 0s linear .6s !important; }
  .hero .hero-slide.is-active { transition: opacity .6s ease !important; }
  .hero .hero-slide .hero-text > *, .hero .hero-slide .hero-cover { opacity: 1 !important; transform: none !important; }
}

/* ---------- Profiles, favorites, epic moments ---------- */
.profile-head { display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-bottom: 36px; }
.profile-avatar { width: 96px; height: 96px; border-radius: 28px; font-size: 40px; flex: none; }
.profile-id { flex: 1; min-width: 220px; display: grid; gap: 6px; }
.profile-id h1 { font-size: clamp(26px, 4vw, 36px); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.profile-id p { margin: 0; }
.profile-bio { max-width: 60ch; color: color-mix(in oklab, var(--text) 85%, var(--muted)); }
.supporter-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; font: 600 12px var(--font); color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.supporter-chip svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.profile-edit { margin-left: auto; }
.profile-section { margin-bottom: 40px; }
.fav-grid { grid-template-columns: repeat(auto-fill, minmax(min(150px, 44%), 1fr)); }
.moments { columns: 3 260px; column-gap: 16px; }
.moment { break-inside: avoid; margin: 0 0 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.moment-img { display: block; width: 100%; background-repeat: no-repeat; background-color: var(--surface-2); max-height: 560px; }
.moment-missing { aspect-ratio: 4/3; display: grid; place-items: center; color: var(--muted); font-size: 13px; padding: 20px; text-align: center; }
.moment figcaption { display: grid; gap: 4px; padding: 10px 14px 12px; font-size: 13px; }
.moment-cap { font-weight: 600; color: var(--text); }
.moment-src { color: var(--muted); }
.moment-src a:hover { color: var(--accent); }
.moment-del { padding: 0 14px 12px; }
.profile-edit-page .panel { margin-bottom: 20px; }
.profile-edit-page .panel h2 { font-size: 20px; margin-bottom: 12px; }
.profile-edit-page textarea.input { height: auto; min-height: 84px; padding: 12px 14px; resize: vertical; font: inherit; }
.stack .toggle { display: flex; font-weight: 500; color: var(--text); }
.fav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fav-list li { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; background: var(--surface-2); }
.fav-list img { width: 36px; height: 50px; object-fit: cover; border-radius: 6px; }
.fav-list a { flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-fav].is-on { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 50%, transparent); }
[data-fav].is-on svg { fill: currentColor; }

/* Clip tool (reader) */
body.clip-open { overflow: hidden; }
.clip-overlay { position: fixed; inset: 0; z-index: 200; display: grid; grid-template-rows: auto auto 1fr auto; gap: 8px; padding: max(12px, env(safe-area-inset-top)) 14px max(12px, env(safe-area-inset-bottom)); background: color-mix(in oklab, #000 88%, var(--bg)); color: var(--text); }
.clip-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.clip-pagenav { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.clip-pagenav .icon-btn { font-size: 22px; line-height: 1; }
.clip-hint { margin: 0; }
.clip-stage { min-height: 0; display: grid; place-items: center; overflow: hidden; }
.clip-frame { position: relative; max-height: 100%; touch-action: none; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.clip-frame img { display: block; max-width: 100%; max-height: calc(100dvh - 210px); width: auto; height: auto; pointer-events: none; border-radius: 6px; }
.clip-box { position: absolute; border: 2px solid var(--accent); border-radius: 4px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55); pointer-events: none; }
.clip-bottom { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; max-width: 720px; width: 100%; margin: 0 auto; }
.clip-bottom .input { flex: 1; min-width: 200px; height: 42px; border-radius: 12px; }
.clip-btns { display: flex; gap: 8px; }
@media (max-width: 700px) { .profile-head { gap: 14px; } .profile-avatar { width: 72px; height: 72px; border-radius: 22px; font-size: 30px; } .profile-edit { margin-left: 0; } .moments { columns: 2 150px; column-gap: 10px; } .clip-btns { width: 100%; } .clip-btns .btn { flex: 1; justify-content: center; } }

/* ---------- Live chapter chat (Discord-style channel) ---------- */
.chat { gap: 0; grid-template-columns: minmax(0, 1fr); width: min(820px, 100%); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); background: var(--surface); overflow: hidden; position: relative; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); background: color-mix(in oklab, var(--surface-2) 60%, var(--surface)); }
.chat-head h2 { font-size: 18px; display: flex; align-items: center; gap: 6px; }
.chat-hash { color: var(--muted); font-weight: 500; font-size: 22px; margin-right: 2px; }
.chat-head .count { font: 600 12px var(--font); color: var(--muted); background: var(--surface-2); padding: 2px 8px; border-radius: 999px; }
.chat-presence { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: color-mix(in oklab, #22c55e 85%, var(--text)); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: live-pulse 2s infinite; }
@keyframes live-pulse { 70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.chat-scroll { max-height: min(62vh, 620px); min-height: 220px; overflow-y: auto; overscroll-behavior: contain; padding: 10px 0 6px; scrollbar-width: thin; }
.chat-older { display: block; margin: 4px auto 10px; }
.chat-list { display: flex; flex-direction: column; }
.chat-loading { padding: 20px; text-align: center; }
.chat-empty { display: grid; justify-items: center; gap: 4px; padding: 40px 20px; text-align: center; }
.chat-empty-icon { font-size: 34px; }
.chat-day { display: flex; align-items: center; gap: 12px; margin: 14px 18px 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.chat-day::before, .chat-day::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.msg { position: relative; display: grid; grid-template-columns: 40px 1fr; gap: 0 12px; padding: 6px 18px 4px; margin-top: 10px; transition: background-color .15s; }
.msg.is-grouped { margin-top: 0; padding-top: 1px; }
.msg:hover, .msg:focus-within { background: color-mix(in oklab, var(--surface-2) 55%, transparent); }
.msg .avatar { width: 40px; height: 40px; font-size: 16px; }
.msg-side { display: flex; justify-content: center; }
.msg-hover-time { visibility: hidden; font-size: 10.5px; color: var(--muted); padding-top: 4px; white-space: nowrap; }
.msg.is-grouped:hover .msg-hover-time { visibility: visible; }
.msg-main { min-width: 0; }
.msg-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.msg-name { font-weight: 700; font-size: 14.5px; color: var(--text); }
a.msg-name:hover { text-decoration: underline; }
.msg.is-mine .msg-name { color: var(--accent); }
.msg-head time { font-size: 11.5px; color: var(--muted); }
.msg-supporter { font-size: 12px; }
.msg-body { font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.msg-body a { color: var(--accent); }
.msg-edited { font-size: 11px; color: var(--muted); }
.msg.is-hidden .msg-body { opacity: .6; }
.msg.mentions-me { background: color-mix(in oklab, #f5b301 10%, transparent); box-shadow: inset 3px 0 0 #f5b301; }
.msg.is-new { animation: msg-in .35s ease-out; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } }
.msg.is-highlighted { background: color-mix(in oklab, var(--accent) 16%, transparent); transition: background-color 1s; }
.page-ref { display: inline-block; padding: 0 6px; border-radius: 6px; font-weight: 600; text-decoration: none; background: color-mix(in oklab, var(--accent) 16%, transparent); }
.page-ref::before { content: '📄 '; font-size: 11px; }
.mention { font-weight: 600; color: color-mix(in oklab, var(--accent) 70%, #fff); background: color-mix(in oklab, var(--accent) 14%, transparent); padding: 0 4px; border-radius: 5px; }
.msg-replyref { display: flex; align-items: center; gap: 6px; max-width: 100%; border: 0; background: none; padding: 0 0 2px; color: var(--muted); font-size: 12.5px; text-align: left; cursor: pointer; }
.msg-replyref span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.msg-replyref strong { color: var(--text); font-weight: 600; flex: none; }
.msg-replyref:hover span:last-child { color: var(--text); }
.msg-replyref-arrow { color: var(--accent); }
.msg .spoiler { display: inline; border-radius: 6px; background: var(--surface-2); padding: 1px 4px; }
.msg .spoiler .spoiler-body { filter: blur(5px); }
.msg .spoiler.is-open { background: none; padding: 0; }
.msg .spoiler.is-open .spoiler-body { filter: none; }

.msg-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.react-chip { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 13px; color: var(--text); cursor: pointer; }
.react-chip span { font-size: 12px; font-weight: 700; color: var(--muted); }
.react-chip.is-mine { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 16%, var(--surface-2)); }
.react-chip.is-mine span { color: var(--accent); }
.react-chip:hover { border-color: var(--accent); }

.msg-tools { position: absolute; top: -14px; right: 14px; display: none; gap: 2px; padding: 3px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); box-shadow: var(--shadow); z-index: 3; }
.msg:hover .msg-tools, .msg:focus-within .msg-tools { display: flex; }
.msg-tools button { width: 30px; height: 28px; border: 0; border-radius: 7px; background: none; color: var(--text); font-size: 15px; line-height: 1; cursor: pointer; }
.msg-tools button:hover { background: var(--surface-2); }
.react-picker { position: absolute; top: 34px; right: 0; display: flex; gap: 2px; padding: 4px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); box-shadow: var(--shadow); animation: pop .15s ease-out; }
.react-picker button { width: 34px; height: 34px; font-size: 19px; }
.react-picker button:hover { transform: scale(1.15); }
.msg:has(.react-picker) .msg-tools { display: flex; }

.chat-jump { position: absolute; left: 50%; transform: translateX(-50%); bottom: 132px; z-index: 4; border: 0; padding: 7px 14px; border-radius: 999px; font: 700 12.5px var(--font); color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 8px 24px -8px var(--accent); cursor: pointer; }
.chat-typing { min-height: 20px; padding: 0 18px 2px; display: flex; align-items: center; gap: 6px; }
.typing-dots { display: inline-flex; gap: 3px; }
.typing-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: tdot 1.2s infinite; }
.typing-dots i:nth-child(2) { animation-delay: .15s; }
.typing-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes tdot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

.chat-compose { padding: 8px 14px 4px; border-top: 1px solid var(--line); }
.chat-replybar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px 6px 52px; font-size: 12.5px; color: var(--muted); }
.chat-replybar strong { color: var(--text); }
.chat-form { display: flex; gap: 10px; align-items: flex-end; }
.chat-form > .avatar { width: 38px; height: 38px; flex: none; margin-bottom: 4px; }
.chat-input-wrap { position: relative; flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 6px; padding: 6px 6px 6px 14px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--surface-2); }
.chat-input-wrap:focus-within { border-color: var(--accent); }
.chat-input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font: 14.5px/1.5 var(--font); resize: none; padding: 6px 0; max-height: 160px; outline: none; }
.chat-tools { display: flex; align-items: center; gap: 2px; }
.chat-tool { width: 34px; height: 34px; border: 0; border-radius: 10px; background: none; font-size: 17px; cursor: pointer; opacity: .75; }
.chat-tool:hover, .chat-tool.is-on { opacity: 1; background: color-mix(in oklab, var(--accent) 16%, transparent); }
.chat-send { height: 34px; }
.emoji-pop { position: absolute; bottom: calc(100% + 6px); right: 0; display: grid; grid-template-columns: repeat(8, 34px); gap: 2px; padding: 6px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); box-shadow: var(--shadow); z-index: 5; }
.emoji-pop button { width: 34px; height: 34px; border: 0; border-radius: 8px; background: none; font-size: 19px; cursor: pointer; }
.emoji-pop button:hover { background: var(--surface-2); }
.chat-hint { padding: 4px 4px 0 48px; min-height: 18px; }
.chat-hint kbd { font: 600 10.5px var(--font); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line-2); }
.chat-login { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 6px; }
.chat-login span { margin-right: auto; }
.chat .comment-rules { padding: 0 18px 12px; margin: 0; }
.msg-editform { display: grid; gap: 6px; margin-top: 4px; }
.msg-editform .chat-input { border: 1px solid var(--accent); border-radius: 10px; padding: 8px 10px; background: var(--surface-2); }
.msg-editbar { display: flex; align-items: center; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.msg-editbar span { margin-right: auto; }
.comments-btn.has-new .comments-badge { background: #22c55e; animation: pop .3s ease-out; }

@media (max-width: 700px) {
  .chat { border-radius: 14px; }
  .chat-head { padding: 12px 14px; }
  .msg { grid-template-columns: 34px 1fr; gap: 0 10px; padding: 6px 12px 4px; }
  .msg .avatar { width: 34px; height: 34px; font-size: 14px; }
  .msg-tools { top: -16px; right: 8px; }
  .chat-scroll { max-height: 60vh; }
  .chat-form > .avatar { display: none; }
  .chat-replybar { padding-left: 6px; }
  .chat-hint { padding-left: 4px; }
  .emoji-pop { grid-template-columns: repeat(6, 34px); }
  .chat-jump { bottom: 120px; }
}
@media (hover: none) {
  .msg-tools { position: static; display: flex; justify-content: flex-start; grid-column: 2; margin-top: 2px; box-shadow: none; border: 0; background: none; padding: 0; opacity: .7; }
  .msg-tools button { width: 32px; height: 26px; font-size: 14px; }
  .react-picker { top: auto; bottom: 30px; left: 0; right: auto; }
  .msg.is-grouped .msg-tools { display: none; }
  .msg.is-grouped:focus-within .msg-tools { display: flex; }
}

/* "Add to library": the bookmark fills in once the series is on a shelf. */
[data-shelf-btn][aria-pressed="true"] { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 50%, transparent); }
[data-shelf-btn][aria-pressed="true"] svg { fill: currentColor; }

/* ---------- Credits, groups, legal pages ---------- */
.series-credits { display: grid; gap: 14px; }
.series-credits .eyebrow { margin: 0; }
.credit-rows { margin: 0; display: grid; }
.credit-rows > div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.credit-rows > div:last-child { border-bottom: 1px solid var(--line); }
.credit-rows dt { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.credit-rows dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; text-align: right; }
.credit-raw { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; color: var(--muted); }
.credit-raw a { color: var(--accent); font-weight: 600; }
.credit-raw a:hover { text-decoration: underline; }
.credit-raw svg { width: 12px; height: 12px; vertical-align: -1px; }
.credit-actions { display: grid; gap: 8px; }
.credit-actions .btn { width: 100%; justify-content: center; }
.credit-note { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--muted); text-align: center; }
.series-side { display: flex; flex-direction: column; gap: 16px; }
.container.series-head { padding-bottom: 28px; }
.series-side > .panel, .series-side .ad { margin: 0; }
.series-side .stats > div + div { border-left: 1px solid var(--line); }
.series-side .stats span { display: block; margin-top: 2px; }
.series-side .stats strong { line-height: 1.6; }
.rating-score strong:empty { display: none; }
.rating-score { align-items: center; }
.credit-rows a, .people a { color: var(--accent); }
.credit-rows a:hover, .people a:hover { text-decoration: underline; }
.credit-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.series-credits p { margin: 0; }
.r-official { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13.5px; font-weight: 600; color: var(--accent); }
.r-official svg { width: 16px; height: 16px; }
.container.narrow { max-width: 760px; }
.legal { max-width: 860px; }
.legal h1 { margin-bottom: 12px; }
.legal .panel { margin-top: 20px; }
.legal .panel h2 { font-size: 20px; margin-bottom: 10px; }
.legal ul, .legal ol { padding-left: 20px; display: grid; gap: 8px; line-height: 1.55; }
.terms li strong { color: var(--text); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 12px; }
/* Checkbox + sentence (which may contain links): the text flows as one paragraph next to the box. */
.stack label.check, label.check { display: block; position: relative; padding-left: 28px; font-weight: 500; color: var(--text); font-size: 13.5px; line-height: 1.5; }
label.check input { position: absolute; left: 0; top: 2px; margin: 0; width: 16px; height: 16px; }
label.check a { color: var(--accent); text-decoration: underline; }
.stack textarea.input { height: auto; min-height: 80px; padding: 10px 12px; font: inherit; resize: vertical; }
.group-head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 32px; }
.group-logo { width: 96px; height: 96px; border-radius: 28px; display: grid; place-items: center; font: 800 42px var(--font-display); color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); flex: none; }
.group-id { flex: 1; min-width: 240px; display: grid; gap: 8px; }
.group-id h1 { font-size: clamp(26px, 4vw, 38px); }
.team-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.team-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.team-list li a { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.team-list .avatar { width: 32px; height: 32px; }
.group-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.admin .table td.actions { display: flex; gap: 10px; }
@media (max-width: 700px) { .group-logo { width: 72px; height: 72px; font-size: 32px; border-radius: 22px; } }

/* ---------- Group uploader ---------- */
.uploader .panel h2 { font-size: 18px; }
.credit-fields { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 14px; display: grid; gap: 12px; margin: 4px 0 0; }
.credit-fields legend { font-weight: 700; font-size: 13px; padding: 0 6px; color: var(--accent); }
.new-series { display: grid; gap: 12px; }
.dropzone { display: grid; justify-items: center; gap: 8px; padding: 34px 18px; border: 2px dashed var(--line-2); border-radius: 16px; text-align: center; cursor: pointer; transition: border-color .2s, background-color .2s; }
.dropzone.is-over, .dropzone:hover { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 7%, transparent); }
.dropzone strong { font: 700 17px var(--font-display); }
.up-toolbar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.up-toolbar span { margin-right: auto; font-weight: 600; }
.up-pages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.up-page { position: relative; border-radius: 10px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); cursor: grab; }
.up-page img { display: block; width: 100%; aspect-ratio: 3/4; object-fit: cover; pointer-events: none; }
.up-n { position: absolute; top: 6px; left: 6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: rgba(0,0,0,.72); color: #fff; font: 700 11.5px/22px var(--font); text-align: center; }
.up-cover { position: absolute; top: 6px; right: 6px; padding: 2px 7px; border-radius: 999px; background: var(--accent); color: #fff; font: 700 10.5px var(--font); }
.up-actions { position: absolute; left: 0; right: 0; bottom: 22px; display: flex; justify-content: center; gap: 4px; padding: 4px; opacity: 0; transition: opacity .15s; }
.up-page:hover .up-actions, .up-page:focus-within .up-actions { opacity: 1; }
@media (hover: none) { .up-actions { opacity: 1; } }
.up-actions button { width: 28px; height: 28px; border: 0; border-radius: 8px; background: rgba(0,0,0,.75); color: #fff; font-size: 14px; cursor: pointer; }
.up-name { display: block; padding: 4px 6px; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-submit { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.up-progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.up-progress div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s; }
.up-preview { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.up-preview img { width: 70px; height: 96px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.upload-item { gap: 8px; }

/* Content levels */
.blur-nsfw [data-nsfw], .blur-nsfw .reader[data-nsfw] img { filter: blur(28px) saturate(.7); }
.blur-nsfw .card-cover, .blur-nsfw .rank-row, .blur-nsfw .series-head { overflow: hidden; }
.card-cover { position: relative; }
.card-18 { position: absolute; right: 8px; bottom: 8px; padding: 2px 7px; border-radius: 999px; background: rgba(225, 29, 72, .92); color: #fff; font: 700 11px/1.5 var(--font); letter-spacing: .02em; }
.nsfw-gate { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px 16px; padding: 10px 16px; background: color-mix(in oklab, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); font-size: 14px; text-align: center; }
.content-chips { margin-top: -4px; }
.rating-chip { font-weight: 700; }
.rating-chip.r-suggestive { color: #f59e0b; border-color: color-mix(in oklab, #f59e0b 45%, transparent); }
.rating-chip.r-mature { color: #fb923c; border-color: color-mix(in oklab, #fb923c 45%, transparent); }
.rating-chip.r-explicit { color: #f43f5e; border-color: color-mix(in oklab, #f43f5e 45%, transparent); }
.tag-chip { opacity: .85; }
.gate-actions { justify-content: center; }
.content-settings { max-width: 720px; padding-top: 32px; padding-bottom: 48px; }
.content-settings h1 { margin-bottom: 6px; }
.content-settings .panel { display: grid; gap: 14px; }
.levels { display: grid; gap: 8px; }
.level-opt { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.level-opt:hover { border-color: var(--line-2); }
.level-opt:has(input:checked) { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 8%, transparent); }
.level-opt.is-locked { opacity: .5; cursor: not-allowed; }
.level-opt input { margin: 0; accent-color: var(--accent); }
.level-n { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-2); font: 700 14px var(--font-display); }
.level-body { display: grid; gap: 2px; font-size: 14px; }
.level-body .muted { font-size: 13px; }
.level-body .pill { font-size: 10.5px; vertical-align: 1px; }
.level-why { font-size: 12px; color: var(--accent); font-weight: 600; }
.adult-confirm { display: grid; gap: 10px; padding: 14px; border-radius: 12px; background: var(--surface-2); }
.adult-confirm[hidden] { display: none; }
.adult-confirm p { margin: 0; }
.adult-confirm .field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; max-width: 240px; }
.tag-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pick { position: relative; }
.tag-pick input { position: absolute; opacity: 0; pointer-events: none; }
.tag-pick span { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; cursor: pointer; transition: all .15s; }
.tag-pick input:checked + span { border-color: #f43f5e; color: #f43f5e; background: color-mix(in oklab, #f43f5e 10%, transparent); text-decoration: line-through; }
.tag-pick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.admin-rating-row { display: flex; gap: 8px; }
.admin-rating-row .input { flex: 1; min-width: 0; }
.admin-rating { display: grid; gap: 10px; }

/* Quick content-level switch (header, right of the profile icon) */
.lvl-switch { position: relative; }
.lvl-btn { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 10px 0 9px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); color: var(--text); font: 700 13px var(--font-display); line-height: 1; transition: border-color .15s, background .15s; }
.lvl-btn:hover { background: var(--surface-2); }
.lvl-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.lvl-btn.lvl-1 { color: #34d399; border-color: color-mix(in oklab, #34d399 40%, transparent); }
.lvl-btn.lvl-2 { color: #fbbf24; border-color: color-mix(in oklab, #fbbf24 40%, transparent); }
.lvl-btn.lvl-3 { color: #fb923c; border-color: color-mix(in oklab, #fb923c 45%, transparent); }
.lvl-btn.lvl-4, .lvl-btn.lvl-5 { color: #f43f5e; border-color: color-mix(in oklab, #f43f5e 45%, transparent); }
.lvl-menu { right: 0; left: auto; width: 250px; }
.lvl-head { display: grid; gap: 1px; padding: 8px 12px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
.lvl-head .muted { font-size: 12px; }
.menu .lvl-opt { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; }
.lvl-n { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; background: var(--surface-2); font: 700 12px var(--font-display); }
.lvl-opt.is-current .lvl-n { background: var(--accent); color: #fff; }
.lvl-opt.is-current { font-weight: 600; }
.lvl-18 { font-size: 10px; font-weight: 700; color: #f43f5e; }
.lvl-check { color: var(--accent); font-weight: 700; }
.menu .lvl-opt.is-locked { opacity: .45; }
.menu span.lvl-opt.is-locked { padding: 9px 12px; cursor: not-allowed; font-size: 14px; }
.menu .lvl-more { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius-sm) var(--radius-sm); font-size: 13px; color: var(--muted); }
.lvl-more svg { width: 15px; height: 15px; }
@media (max-width: 560px) { .lvl-btn { padding: 0 8px; } .lvl-btn span { display: none; } .lvl-menu { position: fixed; top: calc(var(--header-h) + 4px); right: 12px; } }
