/* ===== 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; }
.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);
}
.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-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.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); }
.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; }
.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; }
.lead { font-size: 17px; color: color-mix(in oklab, var(--text) 85%, var(--muted)); max-width: 60ch; }
.donate-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 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; padding: 64px 20px 120px; }
.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; }

.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; }
}
