/*
 * Kage Reader — editorial catalog.
 * System typography, no external dependencies. Dark first, light opt-in.
 * Layout scale: 4/8pt rhythm, fluid gutters, 2/3/4/5-up catalog grids.
 */
:root {
  color-scheme: dark;
  --bg: #0c0e12;
  --bg-deep: #090b0e;
  --surface: #141821;
  --surface-2: #191e28;
  --soft: #1d2430;
  --border: #2a313d;
  --border-strong: #3a4351;
  --accent: #ff8a66;
  --accent-strong: #ff7046;
  --accent-soft: rgba(255, 138, 102, .14);
  --ink: #f4f5f7;
  --muted: #a3abb8;
  --on-accent: #1c0f08;
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 18px;
  --admin-offset: 0px;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .28);
  --shadow: 0 22px 48px -26px rgba(0, 0, 0, .8);
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --ease: cubic-bezier(.2, .7, .3, 1);
  --gutter: clamp(16px, 4vw, 64px);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f4ef;
  --bg-deep: #efece5;
  --surface: #fffefa;
  --surface-2: #faf8f2;
  --soft: #ece9e2;
  --border: #ddd8cf;
  --border-strong: #c7c1b6;
  --accent: #b8451f;
  --accent-strong: #a03a18;
  --accent-soft: rgba(184, 69, 31, .1);
  --ink: #1d1f24;
  --muted: #5f636c;
  --on-accent: #ffffff;
  --shadow-sm: 0 2px 8px rgba(39, 36, 26, .06);
  --shadow: 0 22px 48px -30px rgba(39, 36, 26, .35);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--admin-offset) + 90px); overflow-x: clip; }
body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 50% -12%, var(--accent-soft), transparent 62%),
    var(--bg);
  color: var(--ink);
  font: 15px/1.65 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  overflow-wrap: break-word;
  overflow-x: clip;
}
body.admin-bar { --admin-offset: 32px; }
a { color: inherit; text-decoration: none; text-underline-offset: 4px; transition: color .16s var(--ease); }
a:hover { color: var(--accent); }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button, input, select, textarea { color: var(--ink); }
button { background: none; }
button, input:not([type="checkbox"]):not([type="radio"]), select, textarea { min-height: 44px; }
button:disabled { cursor: not-allowed; opacity: .5; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.18; font-weight: 700; }
.custom-logo { max-height: 56px; width: auto; }

.container, .page-shell { width: min(1240px, calc(100% - var(--gutter))); margin-inline: auto; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 10000; padding: 12px 18px; background: var(--accent); color: var(--on-accent); border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.skip-link:focus { top: calc(var(--admin-offset) + 12px); width: auto; height: auto; margin: 0; clip-path: none; overflow: visible; white-space: normal; }

/* ---------- Header ---------- */
.utility-bar { border-bottom: 1px solid var(--border); color: var(--muted); font-size: 11px; letter-spacing: .035em; }
.utility-bar .container { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.utility-bar a { display: inline-flex; align-items: center; min-height: 44px; }
.site-header { background: var(--bg); background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); position: relative; z-index: 50; }
.header-main { min-height: 96px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; min-width: 0; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; color: var(--on-accent); background: linear-gradient(150deg, var(--accent), var(--accent-strong)); font-size: 27px; font-weight: 900; border-radius: var(--radius-sm); line-height: 1; box-shadow: var(--shadow-sm); flex-shrink: 0; }
.brand-text { font-size: 23px; font-weight: 800; letter-spacing: -.8px; line-height: 1.1; min-width: 0; overflow-wrap: anywhere; }
.brand-text span, .brand-subtitle { display: block; }
.brand-subtitle { color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: 1.8px; text-transform: uppercase; margin-top: 5px; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex: 1; min-width: 0; }
.search-form { display: flex; align-items: center; width: min(100%, 360px); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px 4px 3px 16px; transition: border-color .16s var(--ease), box-shadow .16s var(--ease); }
.search-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search-field { width: 100%; min-width: 0; min-height: 38px; padding: 0; background: transparent; border: 0; border-radius: 999px; font-size: 13px; }
.search-field::placeholder { color: var(--muted); }
.search-submit { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 38px; min-height: 38px; padding: 0; border: 0; border-radius: 999px; color: var(--muted); font-size: 17px; }
.search-submit:hover { background: var(--soft); color: var(--ink); }
.theme-toggle, .menu-toggle { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; white-space: nowrap; font-size: 12px; font-weight: 600; transition: border-color .16s var(--ease), background .16s var(--ease); }
.theme-toggle:hover, .menu-toggle:hover { border-color: var(--border-strong); background: var(--soft); color: var(--ink); }
.menu-toggle { display: none; }
.site-nav { border-block: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav-links { display: flex; align-items: center; flex-wrap: wrap; gap: 30px; list-style: none; margin: 0; padding: 0; }
.nav-link { display: inline-flex; align-items: center; position: relative; min-height: 54px; font-size: 13px; font-weight: 600; color: var(--muted); }
.nav-link:hover { color: var(--ink); }
.nav-link.active, .nav-link[aria-current="page"] { color: var(--ink); }
.nav-link.active::after, .nav-link[aria-current="page"]::after { content: ""; height: 2px; background: var(--accent); position: absolute; bottom: -1px; inset-inline: 0; border-radius: 2px; }
.nav-note { font-size: 11px; color: var(--muted); }

/* ---------- Page scaffolding ---------- */
.site-main { padding-block: 34px 72px; min-height: 55vh; }
.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 34px; align-items: start; }
.page-shell > .content-layout { margin-top: 30px; }
.spotlight + .content-layout { margin-top: 36px; }
.main-column, .sidebar { min-width: 0; }
.sidebar { display: grid; gap: 20px; align-content: start; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-block: 32px 18px; }
.section-head:first-child { margin-top: 0; }
.panel .section-head { margin-block: 0 16px; align-items: center; }
.section-head .panel-title { margin-bottom: 0; }
.eyebrow, .spotlight-kicker { color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: 1.9px; text-transform: uppercase; margin-bottom: 8px; }
.section-title { font-family: var(--font-display); font-size: clamp(22px, 2.2vw, 28px); font-weight: 700; letter-spacing: -.4px; margin: 0; }
.text-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 12px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.text-link:hover { color: var(--accent-strong); }

/* ---------- Buttons & badges ---------- */
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; background: linear-gradient(150deg, var(--accent), var(--accent-strong)); color: var(--on-accent); border: 1px solid transparent; border-radius: 999px; font-weight: 700; font-size: 13px; text-align: center; transition: transform .16s var(--ease), filter .16s var(--ease), box-shadow .16s var(--ease); }
.button:hover { color: var(--on-accent); filter: brightness(1.06); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.button:active { transform: translateY(0); }
.button-secondary { color: var(--ink); background: var(--surface); border-color: var(--border); }
.button-secondary:hover { color: var(--ink); background: var(--soft); border-color: var(--border-strong); }
.button-small { min-height: 40px; padding-inline: 15px; font-size: 12px; }
.badge, .format-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 9px; font-size: 10px; font-weight: 700; letter-spacing: .02em; line-height: 1.5; color: var(--on-accent); background: var(--accent); }
.badge-muted { background: var(--soft); color: var(--muted); }

/* ---------- Spotlight ---------- */
.spotlight { position: relative; display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 30px; align-items: center; padding: 28px; background: linear-gradient(140deg, var(--surface) 0%, var(--surface-2) 55%, var(--surface) 100%); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.spotlight::before { content: ""; position: absolute; inset: -40% -10% auto auto; width: 420px; height: 420px; background: radial-gradient(circle, var(--accent-soft), transparent 68%); pointer-events: none; }
.spotlight > * { position: relative; }
.spotlight-kicker { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.spotlight-kicker .eyebrow { margin-bottom: 0; }
.spotlight-cover { display: block; width: 176px; aspect-ratio: 2 / 3; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--soft); }
.spotlight-cover img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s var(--ease); }
.spotlight-cover:hover img { transform: scale(1.04); }
.spotlight-body { min-width: 0; }
.spotlight-title { font-family: var(--font-display); font-size: clamp(26px, 3vw, 38px); letter-spacing: -.5px; margin-bottom: 12px; overflow-wrap: anywhere; }
.spotlight-copy { font-size: 13.5px; color: var(--muted); line-height: 1.75; max-width: 52ch; margin-bottom: 16px; }
.spotlight-meta, .spotlight-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.spotlight-meta { color: var(--muted); font-size: 11px; letter-spacing: .02em; margin-bottom: 18px; }
.spotlight-meta span + span::before { content: "·"; margin-right: 10px; opacity: .7; }

/* ---------- Catalog ---------- */
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px 16px; }
.manga-card { display: flex; flex-direction: column; min-width: 0; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: transform .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease); }
.manga-card:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.card-cover { display: block; position: relative; aspect-ratio: 2 / 3; overflow: hidden; background: var(--soft); border-radius: calc(var(--radius) - 4px); }
.cover-image { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s var(--ease); }
.manga-card:hover .cover-image { transform: scale(1.04); }
.card-badge { position: absolute; top: 9px; left: 9px; background: #101114e8; color: #f1f2f4; border: 1px solid #ffffff26; backdrop-filter: blur(4px); }
.card-body { display: flex; flex-direction: column; flex: 1; padding-top: 11px; }
.card-title { font-size: 13px; line-height: 1.42; margin: 0 0 6px; font-weight: 700; overflow-wrap: anywhere; }
.card-title a:hover { color: var(--accent); }
.card-meta { color: var(--muted); font-size: 10.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-update { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 9px; border-top: 1px solid var(--border); color: var(--muted); font-size: 10px; }
.card-update time { font-variant-numeric: tabular-nums; }

/* ---------- Panels, sidebar ---------- */
.panel { padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.panel-title { font-size: 15px; font-weight: 700; letter-spacing: -.2px; margin-bottom: 16px; }
.genre-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.genre-chip { display: inline-flex; align-items: center; min-height: 38px; padding: 7px 12px; background: var(--soft); border: 1px solid transparent; border-radius: 999px; color: var(--muted); font-size: 11.5px; font-weight: 500; transition: border-color .16s var(--ease), color .16s var(--ease), background .16s var(--ease); }
.genre-chip:hover, .genre-chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.chapter-feed { list-style: none; padding: 0; margin: 0; }
.feed-item { display: flex; gap: 12px; padding-block: 12px; border-bottom: 1px solid var(--border); }
.feed-item:first-child { padding-top: 0; }
.feed-item:last-child { border-bottom: 0; padding-bottom: 0; }
.feed-title { display: inline-flex; align-items: center; min-height: 34px; font-size: 12.5px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.feed-meta { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 10.5px; }
.number-index { flex: 0 0 26px; color: var(--border-strong); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; padding-top: 6px; }
.sidebar .panel > p { color: var(--muted); font-size: 12.5px; line-height: 1.7; margin-bottom: 10px; }

/* ---------- States ---------- */
.notice, .empty-state { padding: 24px; border: 1px dashed var(--border-strong); background: var(--surface); border-radius: var(--radius); color: var(--muted); font-size: 13.5px; }
.empty-state { display: grid; justify-items: start; gap: 10px; padding: clamp(26px, 5vw, 56px); }
.empty-state > :last-child { margin-bottom: 0; }
.empty-state .button { justify-self: start; }
.empty-state h1, .empty-state h2 { margin: 0; color: var(--ink); font-family: var(--font-display); letter-spacing: -.4px; }
.empty-state .eyebrow { margin-bottom: 0; }
.notice a, .empty-state a:not(.button) { color: var(--accent); text-decoration: underline; }
.welcome-state .button:not(.button-secondary), .empty-state .button:not(.button-secondary) { color: var(--on-accent); text-decoration: none; }

/* ---------- Breadcrumbs, archive ---------- */
.breadcrumb { margin-bottom: 22px; color: var(--muted); font-size: 11px; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.breadcrumb li { min-width: 0; display: inline-flex; align-items: center; }
.breadcrumb li + li::before { content: "/"; color: var(--border-strong); margin-right: 8px; }
.breadcrumb a { display: inline-flex; align-items: center; min-height: 40px; }
.breadcrumb a:hover { color: var(--accent); }
.archive-head { margin-bottom: 6px; }
.archive-head h1 { font-family: var(--font-display); font-size: clamp(30px, 4vw, 44px); letter-spacing: -.6px; margin-bottom: 10px; }
.archive-head .eyebrow { display: block; }
.archive-description { color: var(--muted); max-width: 65ch; font-size: 14px; }
.archive-description.prose p:last-child { margin-bottom: 0; }

/* ---------- Filters ---------- */
.filter-bar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 18px; }
.filter-field { display: grid; gap: 6px; flex: 1 1 160px; min-width: 0; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.filter-field select, .filter-field input, .chapter-search, .chapter-select, .reader-settings select { width: 100%; max-width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; letter-spacing: normal; text-transform: none; }
.filter-field select:focus, .chapter-search:focus { border-color: var(--accent); }
.filter-actions { display: flex; align-items: center; gap: 10px; }
.results-count { color: var(--muted); font-size: 12px; margin-bottom: 18px; }

/* ---------- Pagination ---------- */
.pagination { margin-top: 38px; display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; }
.pagination .nav-links { display: flex; gap: 7px; flex-wrap: wrap; justify-content: center; }
.page-numbers { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface); transition: border-color .16s var(--ease), color .16s var(--ease); }
.page-numbers:hover { border-color: var(--accent); color: var(--accent); }
.page-numbers.current { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.page-numbers.dots { border-color: transparent; background: transparent; }

/* ---------- Series ---------- */
.series-hero { display: grid; grid-template-columns: 224px minmax(0, 1fr); gap: 34px; align-items: start; padding-bottom: 34px; border-bottom: 1px solid var(--border); }
.series-cover { display: block; width: 224px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--radius); background: var(--soft); box-shadow: var(--shadow); overflow: hidden; }
.series-cover img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.series-info { min-width: 0; }
.series-title { font-family: var(--font-display); font-size: clamp(28px, 4vw, 44px); letter-spacing: -.6px; margin-bottom: 9px; overflow-wrap: anywhere; }
.series-alias { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.series-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 20px; }
.series-tags .genre-chip { min-height: 32px; padding: 5px 11px; font-size: 11px; }
.series-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 20px; margin: 0 0 22px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-size: 12.5px; }
.series-facts > div { display: grid; gap: 2px; min-width: 0; }
.series-facts dt { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.series-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.series-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.series-body { margin-top: 30px; }
.prose { line-height: 1.85; color: var(--muted); font-size: 15px; max-width: 75ch; }
.prose h2, .prose h3, .prose strong { color: var(--ink); }
.prose a { color: var(--accent); text-decoration: underline; }
.prose figure { max-width: 100%; }
.prose .alignwide { max-width: 100%; }
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.prose th, .prose td { padding: 10px; border: 1px solid var(--border); }
.prose pre { overflow-x: auto; padding: 16px; background: var(--surface); border-radius: var(--radius-sm); }
.editor-credit { color: var(--muted); font-size: 11px; margin-block: 20px 0; }
.editor-credit a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--border-strong); }
.editor-credit a:hover { color: var(--accent); }

/* ---------- Chapter list ---------- */
.chapter-panel { margin-top: 30px; }
.chapter-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.chapter-search { max-width: 320px; min-width: 0; }
.chapter-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--border); }
.chapter-item { border-bottom: 1px solid var(--border); transition: background .14s var(--ease); }
.chapter-item > a { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 58px; padding: 12px 16px; position: relative; }
.chapter-item:nth-child(odd) { background: color-mix(in srgb, var(--surface) 60%, transparent); }
.chapter-item:hover { background: var(--soft); }
.chapter-item:hover > a { color: var(--accent); }
.chapter-number { font-size: 13px; font-weight: 600; }
.chapter-date { font-size: 11px; color: var(--muted); flex-shrink: 0; font-variant-numeric: tabular-nums; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 44px 0 max(22px, env(safe-area-inset-bottom)); background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.footer-brand { max-width: 44ch; }
.footer-brand p { font-size: 12.5px; color: var(--muted); margin-block: 16px 0; line-height: 1.7; }
.footer-grid .panel-title { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.footer-links, .policy-links { display: flex; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; gap: 4px 22px; font-size: 12.5px; color: var(--muted); }
.footer-links a, .policy-links a { min-height: 40px; display: inline-flex; align-items: center; }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 26px; padding-top: 14px; color: var(--muted); font-size: 11px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; text-align: center; gap: 0 8px; line-height: 1.5; }
.footer-bottom .policy-links { justify-content: center; gap: 0; font-size: 11.5px; }
.footer-bottom .policy-links a { min-height: 0; padding: 4px 8px; }
.footer-bottom .policy-links li + li::before { content: "·"; color: var(--border-strong); }
.footer-copy { margin: 0; font-size: 11px; }
.footer-legal + .footer-copy::before { content: "·"; margin-right: 8px; color: var(--border-strong); }

/* ---------- Posts, author, comments ---------- */
.article-header { margin-bottom: 28px; max-width: 800px; }
.article-header h1 { font-family: var(--font-display); font-size: clamp(30px, 4vw, 48px); letter-spacing: -.6px; }
.article-content > .prose { max-width: 72ch; }
.article-meta { color: var(--muted); font-size: 12px; }
.author-card { display: flex; flex-direction: column; gap: 10px; margin-top: 32px; padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.avatar { border-radius: 50%; width: 48px; height: 48px; flex-shrink: 0; }
.comments-area { margin-top: 30px; }
.comment-list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 14px; }
.comment-list .comment-body { padding: 16px 18px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.comment-list .children { list-style: none; margin: 14px 0 0; padding-left: 18px; }
.comment-form { display: grid; gap: 12px; }
.comment-form p { margin: 0; }
.comment-form label { display: block; margin-bottom: 5px; font-size: 12px; color: var(--muted); }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.comment-form textarea { min-height: 140px; resize: vertical; }
.comment-form .submit { background: linear-gradient(150deg, var(--accent), var(--accent-strong)); color: var(--on-accent); border: 0; border-radius: 999px; padding: 11px 22px; font-weight: 700; }

/* ---------- Reader ---------- */
.is-reader .site-main { padding-top: 22px; }
.is-reader .page-shell { width: 100%; }
.reader-shell { width: min(100%, 1100px); margin-inline: auto; --page-width: 840px; }
.reader-shell[data-width="fit"] { --page-width: 840px; }
.reader-shell[data-width="wide"] { --page-width: 1100px; }
.reader-shell[data-width="full"] { --page-width: 100%; width: 100%; max-width: none; }
.reader-heading { text-align: center; padding: 10px 20px 24px; }
.reader-heading h1 { font-size: clamp(21px, 3vw, 30px); margin-bottom: 8px; letter-spacing: -.4px; }
.reader-series { color: var(--accent); font-size: 13px; display: inline-flex; min-height: 44px; align-items: center; font-weight: 600; }
.reader-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; background: var(--surface); border: 1px solid var(--border); padding: 10px 14px; margin-bottom: 20px; border-radius: 999px; box-shadow: var(--shadow-sm); }
.reader-nav { display: flex; flex: 1; gap: 8px; align-items: center; min-width: 0; }
.reader-nav .button { border-radius: 999px; }
.chapter-select { min-width: 0; width: auto; flex: 1; max-width: 280px; font-size: 12px; border-radius: 999px; }
.reader-settings { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.reader-settings label { display: flex; gap: 7px; align-items: center; }
.reader-settings select { width: auto; min-height: 38px; padding: 6px 10px; font-size: 12px; border-radius: 999px; }
.reader-settings button { min-height: 38px; padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 11px; background: var(--bg); }
.reader-settings button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.reader-pages { width: min(100%, var(--page-width)); margin-inline: auto; background: #0a0b0d; border-radius: var(--radius-sm); overflow: hidden; }
.reader-page { position: relative; margin: 0; padding: 0; line-height: 0; }
.reader-page.has-error { line-height: 1.6; padding: 18px; background: var(--surface); }
.reader-page.has-error .page-image { display: none; }
.page-image { display: block; width: 100%; height: auto; margin: 0; }
.page-caption { position: absolute; bottom: 8px; right: 8px; font: 10px/1.5 var(--font-sans); padding: 3px 7px; color: #f1f2f4; background: #101114d9; border-radius: 3px; pointer-events: none; }
.image-failure { display: grid; gap: 6px; padding: 48px 20px; background: var(--surface); color: var(--muted); text-align: center; font-size: 14px; line-height: 1.7; border: 1px dashed var(--border); border-radius: var(--radius-sm); }
.image-failure strong { color: var(--ink); }
.image-failure p { margin: 0; }
.reader-page .image-failure { padding: 28px 16px; border: 0; background: transparent; }
.reader-end { max-width: 680px; margin: 32px auto; padding: 26px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.reader-end h2 { font-family: var(--font-display); font-size: 26px; letter-spacing: -.4px; }
.reader-end p { color: var(--muted); font-size: 13px; }
.reader-bottom { margin-top: 28px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.reader-back { flex: 0 0 auto; }
.reader-nav .chapter-select { flex: 1 1 200px; }
.reader-help { color: var(--muted); font-size: 11px; text-align: center; margin: 16px 0 0; }
.reading-progress { position: fixed; top: var(--admin-offset); left: 0; right: 0; height: 3px; z-index: 100; pointer-events: none; background: transparent; }
.reading-progress [data-progress-bar] { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-strong)); }
.progress-label { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.reader-immersive .site-header, .reader-immersive .site-footer { display: none; }
.reader-immersive .site-main { padding-top: 0; }
.reader-immersive .reader-heading, .reader-immersive .breadcrumb { display: none; }
.reader-immersive .reader-toolbar { border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- Responsive ---------- */
@media (min-width: 1025px) {
  .is-reader .header-main { min-height: 76px; }
  .is-reader .utility-bar, .is-reader .nav-note { display: none; }
}
@media (max-width: 1100px) {
  .content-layout { grid-template-columns: minmax(0, 1fr) 270px; gap: 26px; }
  .spotlight { gap: 22px; padding: 22px; }
  .nav-note { display: none; }
}
@media (max-width: 960px) {
  .content-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 4px; }
  .catalog-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .reader-toolbar { align-items: stretch; }
  .reader-settings { flex-wrap: wrap; }
  .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 782px) { body.admin-bar { --admin-offset: 46px; } }
@media (max-width: 680px) {
  .container, .page-shell { width: calc(100% - 32px); }
  .utility-bar .container { min-height: 30px; }
  .utility-bar .container > :nth-child(2) { display: none; }
  .header-main { flex-wrap: wrap; min-height: 0; gap: 14px; padding-block: 18px 14px; }
  .brand-text { font-size: 21px; }
  .header-actions { display: contents; }
  .search-form { order: 5; width: 100%; }
  .theme-toggle { margin-left: auto; min-width: 44px; min-height: 44px; font-size: 18px; padding-inline: 12px; }
  .theme-toggle [data-theme-label] { display: none; }
  .menu-toggle { min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .site-nav .nav-inner { display: none; }
  .site-nav.is-open .nav-inner { display: block; padding-block: 8px; }
  .nav-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
  .nav-link { min-height: 48px; }
  .nav-link.active::after { bottom: 4px; }
  .site-main { padding-block: 24px 44px; }
  .spotlight { grid-template-columns: 112px minmax(0, 1fr); padding: 16px; gap: 16px; align-items: start; }
  .spotlight-cover { width: 112px; }
  .spotlight-kicker { font-size: 9px; letter-spacing: 1.1px; margin-bottom: 7px; }
  .spotlight-title { font-size: 23px; letter-spacing: -.4px; margin-bottom: 9px; }
  .spotlight-copy { font-size: 12px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 10px; }
  .spotlight-meta { font-size: 10px; gap: 6px; margin-bottom: 12px; }
  .spotlight-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .spotlight-actions .button { width: 100%; padding-inline: 12px; font-size: 12px; white-space: nowrap; }
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .manga-card { padding: 8px; }
  .card-body { padding-top: 8px; }
  .section-title { font-size: 21px; }
  .section-head { margin-block: 26px 14px; gap: 8px; }
  .sidebar { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .card-title { font-size: 12.5px; }
  .filter-bar { padding: 14px; gap: 12px; }
  .filter-field { flex-basis: calc(50% - 12px); }
  .filter-actions { flex-basis: 100%; }
  .series-hero { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .series-cover { width: 140px; }
  .series-title { font-size: 25px; }
  .series-alias { font-size: 11px; margin-bottom: 12px; }
  .series-facts { grid-template-columns: minmax(0, 1fr); padding: 12px 14px; gap: 8px; }
  .series-tags { gap: 5px; margin-bottom: 14px; }
  .series-actions { gap: 8px; }
  .series-actions .button { flex: 1 1 130px; padding-inline: 12px; }
  .chapter-tools { flex-wrap: wrap; }
  .chapter-search { max-width: none; flex: 1 1 170px; }
  .chapter-item > a { padding-inline: 10px; }
  .chapter-date { font-size: 10px; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .footer-links { gap: 2px 20px; }
  .is-reader .utility-bar, .is-reader .header-main > .search-form { display: none; }
  .is-reader .header-main { padding-block: 12px; gap: 12px; }
  .is-reader .page-shell { width: 100%; }
  .reader-heading .breadcrumb { margin-bottom: 8px; }
  .reader-heading .editor-credit { margin-block: 12px; }
  .is-reader .breadcrumb { padding-inline: 16px; }
  .reader-toolbar { padding: 8px; gap: 8px; border-radius: var(--radius); margin-bottom: 12px; }
  .reader-nav { flex-basis: 100%; }
  .reader-nav .button { padding-inline: 10px; font-size: 11px; }
  .reader-settings { justify-content: space-between; flex: 1; gap: 6px; }
  .reader-settings select { padding-inline: 8px; }
  .reader-settings button { padding-inline: 9px; font-size: 11px; }
  .reader-heading { padding-bottom: 16px; }
  .reader-end { margin-block: 20px; padding: 18px; }
  .reader-bottom { padding-inline: 12px; }
}
@media (max-width: 380px) {
  .header-main { gap: 8px; }
  .brand { gap: 8px; }
  .brand-mark { width: 38px; height: 44px; }
  .brand-text { font-size: 19px; }
  .brand-subtitle { letter-spacing: 1px; font-size: 9px; }
  .theme-toggle, .menu-toggle { padding-inline: 8px; font-size: 10px; }
  .spotlight { padding: 13px; gap: 12px; }
  .spotlight-title { font-size: 20px; }
  .spotlight-actions .button { width: 100%; }
}
@media (max-width: 600px) { body.admin-bar { --admin-offset: 46px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .reader-toolbar, .reader-bottom, .reading-progress { display: none; }
  body { background: white; color: black; }
  .reader-pages { width: 100%; }
  .reader-page { break-inside: avoid; }
}

/* ---------- Welcome (empty catalog) ---------- */
.welcome-state {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr);
  align-items: center;
  gap: 32px;
  padding: clamp(24px, 4vw, 48px);
  border-style: solid;
  background: linear-gradient(140deg, var(--surface) 0%, var(--surface-2) 60%, var(--surface) 100%);
  overflow: hidden;
  position: relative;
}
.welcome-state::before { content: ""; position: absolute; inset: -30% -15% auto auto; width: 460px; height: 460px; background: radial-gradient(circle, var(--accent-soft), transparent 68%); pointer-events: none; }
.welcome-copy { position: relative; min-width: 0; }
.welcome-copy h1 { font-family: var(--font-display); font-size: clamp(32px, 5vw, 56px); letter-spacing: -.8px; margin-bottom: 12px; overflow-wrap: anywhere; }
.welcome-lead { color: var(--muted); font-size: 14.5px; line-height: 1.75; max-width: 46ch; margin-bottom: 22px; }
.welcome-state .series-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 10px; margin-top: 0; }
.welcome-state .series-actions .button { width: 100%; padding-inline: 16px; white-space: nowrap; }
.welcome-art { position: relative; display: grid; justify-items: end; gap: 12px; }
.welcome-art span { display: block; height: 14px; border-radius: 999px; background: linear-gradient(90deg, var(--accent), transparent); opacity: .55; }
.welcome-art span:nth-child(1) { width: 88%; }
.welcome-art span:nth-child(2) { width: 66%; opacity: .38; }
.welcome-art span:nth-child(3) { width: 44%; opacity: .22; }
@media (max-width: 680px) {
  .welcome-state { grid-template-columns: minmax(0, 1fr); padding: 22px; gap: 20px; }
  .welcome-art { justify-items: stretch; }
  .welcome-lead { font-size: 13.5px; margin-bottom: 18px; }
}