:root {
  --bg: #0b0b0d;
  --panel: #151417;
  --panel-2: #1d1b20;
  --line: #343038;
  --text: #f4eee7;
  --muted: #b9aaa0;
  --faint: #786b64;
  --red: #b61d2a;
  --red-2: #df3947;
  --gold: #d7b56d;
  --ice: #9ed1df;
  --ok: #67c18c;
  --warn: #e2ad54;
  --shadow: rgba(0, 0, 0, 0.35);
  --reader-size: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

body {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  background:
    linear-gradient(135deg, rgba(182, 29, 42, 0.16), transparent 34%),
    radial-gradient(circle at 85% 15%, rgba(215, 181, 109, 0.08), transparent 28%),
    var(--bg);
}

.sidebar {
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: rgba(12, 11, 13, 0.92);
  padding: 22px 18px;
}

.brand {
  display: flex;
  gap: 13px;
  align-items: center;
  margin-bottom: 26px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(215, 181, 109, 0.45);
  background: linear-gradient(145deg, rgba(182, 29, 42, 0.85), rgba(43, 12, 16, 0.95));
  color: #fff5df;
  font-weight: 800;
  border-radius: 8px;
  box-shadow: 0 12px 32px var(--shadow);
}

.brand h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.05;
}

.brand p,
.eyebrow {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.search-box {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.search-box label,
.block-title {
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.search-box input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111013;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.search-box input:focus {
  border-color: var(--red-2);
}

.section-tabs,
.status-list,
.arc-list {
  display: grid;
  gap: 8px;
}

.section-tab,
.status-filter,
.arc-button,
.download-button,
.download-block select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  padding: 8px 10px;
  text-align: left;
}

.download-block {
  display: grid;
  gap: 8px;
}

.contribute-block summary,
.admin-block summary {
  cursor: pointer;
  list-style: none;
}

.contribute-block summary::-webkit-details-marker,
.admin-block summary::-webkit-details-marker {
  display: none;
}

.contribute-form,
.admin-form,
.chapter-edit-form {
  display: grid;
  gap: 9px;
}

.contribute-form {
  margin-top: 10px;
}

.contrib-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.contribute-form input,
.contribute-form select,
.contribute-form textarea,
.admin-form input,
.chapter-edit-form input,
.chapter-edit-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111013;
  color: var(--text);
  padding: 10px 11px;
  outline: none;
}

.contribute-form textarea,
.chapter-edit-form textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.45;
}

.contrib-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px 64px;
  gap: 8px;
}

.contrib-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.contrib-mode label {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.contrib-mode input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.contrib-mode label:has(input:checked) {
  border-color: rgba(223, 57, 71, 0.85);
  background: rgba(182, 29, 42, 0.22);
  color: var(--text);
}

.contribute-form .download-check:has(#contribTranslated) {
  display: none;
}

.admin-users {
  display: grid;
  gap: 7px;
  margin-top: 9px;
}

.admin-user {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 12px;
}

.admin-user span {
  color: var(--muted);
}

.chapter-edit-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.edit-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.download-block select {
  outline: none;
  appearance: none;
}

.download-block select:focus,
.download-button:focus {
  border-color: var(--red-2);
}

.download-check {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.download-check input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--red-2);
}

.compact-setting {
  margin-top: 12px;
}

.download-button {
  border-color: rgba(215, 181, 109, 0.55);
  background: rgba(215, 181, 109, 0.1);
  color: #f7dfaa;
  font-weight: 750;
  text-align: center;
}

.download-button:hover {
  background: rgba(215, 181, 109, 0.16);
}

.download-button:disabled,
.icon-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.download-status {
  min-height: 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.download-status.error {
  color: #ff9a9a;
}

.section-tab.active,
.status-filter.active,
.arc-button.active {
  border-color: rgba(223, 57, 71, 0.85);
  background: rgba(182, 29, 42, 0.22);
}

.filter-block {
  margin-top: 20px;
}

.block-title {
  margin-bottom: 8px;
}

.stats {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  display: grid;
  gap: 7px;
}

.library-panel {
  min-width: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.topbar {
  min-height: 82px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 15, 18, 0.78);
  backdrop-filter: blur(10px);
}

.topbar h2 {
  margin: 4px 0 0;
  font-size: 26px;
}

.reader-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.icon-button {
  min-width: 44px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-weight: 700;
}

.icon-button.active {
  border-color: var(--ice);
  color: var(--ice);
}

.content-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
}

.chapter-list {
  min-height: 0;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: rgba(17, 16, 19, 0.82);
  padding: 14px;
}

.chapter-card {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 13px;
  margin-bottom: 8px;
}

.chapter-card:hover,
.chapter-card.active {
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--line);
}

.chapter-card.active {
  border-color: rgba(223, 57, 71, 0.78);
}

.chapter-title {
  font-size: 15px;
  font-weight: 750;
  line-height: 1.25;
}

.chapter-meta {
  color: var(--muted);
  font-size: 12px;
  grid-column: 1 / -1;
}

.chapter-user-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 18px;
}

.user-status,
.reader-stars {
  border: 1px solid rgba(158, 209, 223, 0.34);
  border-radius: 999px;
  color: var(--ice);
  padding: 2px 7px;
  font-size: 11px;
  line-height: 1.35;
}

.status-pill {
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.status-pill.translated {
  border-color: rgba(103, 193, 140, 0.5);
  color: var(--ok);
}

.status-pill.needs_translation,
.status-pill.source_changed {
  border-color: rgba(226, 173, 84, 0.55);
  color: var(--warn);
}

.reader {
  min-height: 0;
  overflow-y: auto;
  padding: 28px clamp(18px, 5vw, 68px);
}

.reader-inner {
  max-width: 920px;
  margin: 0 auto;
}

.reader-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.reader-header h3 {
  margin: 0;
  font-size: clamp(25px, 3vw, 42px);
  line-height: 1.1;
}

.reader-meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.reader-stars {
  display: inline-block;
  margin-top: 9px;
}

.reading-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.reading-controls label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.reading-controls select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111013;
  color: var(--text);
  padding: 6px 9px;
}

.bookmark {
  min-width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--gold);
  font-size: 20px;
}

.bookmark.active {
  background: rgba(215, 181, 109, 0.15);
  border-color: rgba(215, 181, 109, 0.65);
}

.reader-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chapter-edit-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(158, 209, 223, 0.1);
  color: var(--ice);
  padding: 0 13px;
  font-weight: 750;
}

.guide-season-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  padding: 13px;
  margin-bottom: 8px;
}

.anime-guide {
  max-width: 1120px;
}

.guide-note,
.guide-sources {
  border: 1px solid rgba(226, 173, 84, 0.35);
  border-radius: 8px;
  background: rgba(226, 173, 84, 0.08);
  color: #f6dfb8;
  padding: 14px 16px;
  margin: 0 0 18px;
  line-height: 1.5;
}

.guide-season {
  margin: 22px 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.guide-season-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.guide-season h4 {
  margin: 0 0 6px;
  font-size: 21px;
}

.guide-season p,
.guide-row p {
  margin: 4px 0 0;
  color: var(--muted);
}

.guide-accuracy {
  display: inline-block;
  margin-left: 8px;
  border: 1px solid rgba(226, 173, 84, 0.45);
  border-radius: 999px;
  color: var(--warn);
  padding: 2px 7px;
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
}

.guide-accuracy.verified {
  border-color: rgba(103, 193, 140, 0.5);
  color: var(--ok);
}

.guide-accuracy.season {
  border-color: rgba(158, 209, 223, 0.4);
  color: var(--ice);
}

.guide-table {
  display: grid;
  gap: 8px;
}

.guide-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 11px 12px;
}

.guide-ep {
  color: var(--gold);
  font-weight: 800;
}

.guide-open {
  min-height: 34px;
  border: 1px solid rgba(158, 209, 223, 0.38);
  border-radius: 8px;
  background: rgba(158, 209, 223, 0.1);
  color: var(--ice);
  padding: 0 10px;
  font-weight: 750;
  white-space: nowrap;
}

.guide-open:hover {
  border-color: rgba(158, 209, 223, 0.72);
}

.guide-missing {
  color: var(--muted);
  font-size: 12px;
}

.admin-block {
  display: none !important;
}

.hidden-admin-panel {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.62);
}

.hidden-admin-card {
  width: min(560px, 100%);
  max-height: min(680px, calc(100vh - 40px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}

.hidden-admin-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.notice {
  border: 1px solid rgba(226, 173, 84, 0.35);
  border-radius: 8px;
  background: rgba(226, 173, 84, 0.08);
  padding: 14px 16px;
  color: #f6dfb8;
  margin-bottom: 20px;
}

.chapter-text {
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--reader-size);
  line-height: 1.78;
}

.chapter-text p {
  margin: 0 0 1.05em;
}

.tl-notes {
  margin: 26px 0 8px;
  padding: 14px 16px;
  border: 1px solid rgba(158, 209, 223, 0.28);
  border-radius: 8px;
  background: rgba(158, 209, 223, 0.08);
  color: var(--text);
}

.tl-notes h4 {
  margin: 0 0 8px;
  color: var(--ice);
}

.tl-notes p {
  margin: 0 0 8px;
  color: var(--muted);
}

.original-block {
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.original-block h4 {
  color: var(--ice);
  margin: 0 0 14px;
}

.empty-reader,
.empty-list {
  min-height: 54vh;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--muted);
}

.empty-symbol {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(215, 181, 109, 0.45);
  border-radius: 8px;
  color: var(--gold);
  font-size: 34px;
  font-weight: 800;
}

.empty-reader h3,
.empty-list h3 {
  color: var(--text);
  margin: 0 0 8px;
}

@media (max-width: 1040px) {
  body {
    overflow: auto;
  }

  .app-shell {
    min-height: 100vh;
    display: block;
  }

  .sidebar {
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .library-panel {
    height: auto;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .chapter-list {
    max-height: 42vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .reader {
    padding: 22px 16px;
  }

  .reader-header {
    grid-template-columns: 1fr;
  }

  .guide-season-head,
  .guide-row {
    grid-template-columns: 1fr;
  }

  .guide-season-head {
    display: grid;
  }
}

body.offline-copy {
  background: linear-gradient(135deg, rgba(112, 19, 30, 0.22), transparent 32%), radial-gradient(circle at 78% 12%, rgba(158, 209, 223, 0.1), transparent 24%), #09090b;
}
body.offline-copy .app-shell { grid-template-columns: 280px minmax(0, 1fr); }
body.offline-copy .sidebar { padding: 18px 14px; background: rgba(11, 10, 12, 0.9); }
body.offline-copy .filter-block, body.offline-copy .download-check.compact-setting { margin-top: 14px; }
body.offline-copy .content-grid { grid-template-columns: 360px minmax(0, 1fr); }
body.offline-copy .chapter-list { padding: 14px; }
body.offline-copy .chapter-card { min-height: 96px; }
body.offline-copy .reader { background: rgba(9, 9, 11, 0.58); }
.offline-home { max-width: 1180px; margin: 0 auto; padding: 22px; display: grid; gap: 22px; }
.offline-hero { min-height: 250px; display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 20px; align-items: stretch; border: 1px solid rgba(215, 181, 109, 0.24); border-radius: 8px; padding: 24px; background: linear-gradient(135deg, rgba(182, 29, 42, 0.24), rgba(12, 11, 13, 0.82)), rgba(255, 255, 255, 0.03); }
.offline-hero h3 { margin: 8px 0 10px; font-size: 34px; max-width: 720px; }
.offline-hero p { max-width: 720px; color: var(--muted); line-height: 1.6; }
.offline-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.download-button.subtle { border-color: rgba(158, 209, 223, 0.35); background: rgba(158, 209, 223, 0.08); }
.offline-progress-card { display: grid; align-content: center; justify-items: center; border: 1px solid rgba(158, 209, 223, 0.26); border-radius: 8px; background: rgba(255, 255, 255, 0.045); }
.offline-progress-card span, .offline-progress-card small { color: var(--muted); }
.offline-progress-card strong { font-size: 54px; color: var(--gold); }
.offline-section-head { display: flex; justify-content: space-between; align-items: end; }
.offline-section-head h4 { margin: 5px 0 0; font-size: 20px; }
.offline-arc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.offline-arc-card { min-height: 270px; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: end; gap: 6px; border: 1px solid rgba(215, 181, 109, 0.22); border-radius: 8px; padding: 14px; text-align: left; color: var(--text); background: #111013; }
.offline-arc-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.56; transition: transform 180ms ease, opacity 180ms ease; }
.offline-arc-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 18%, rgba(0, 0, 0, 0.84)); }
.offline-arc-card span, .offline-arc-card strong, .offline-arc-card small { position: relative; z-index: 1; }
.offline-arc-card span { color: var(--gold); font-weight: 800; }
.offline-arc-card strong { line-height: 1.2; }
.offline-arc-card small { color: var(--muted); }
.offline-arc-card:hover img { transform: scale(1.05); opacity: 0.72; }
.anime-bridge-switch { display: inline-flex; gap: 6px; align-self: start; margin-bottom: 16px; padding: 5px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, 0.035); }
.anime-bridge-switch button { min-height: 34px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); padding: 7px 11px; }
.anime-bridge-switch button.active { background: rgba(182, 29, 42, 0.82); color: #fff7ed; }
body.offline-copy.reader-open .app-shell { grid-template-columns: 1fr; }
body.offline-copy.reader-open .sidebar, body.offline-copy.reader-open .topbar, body.offline-copy.reader-open .chapter-list { display: none; }
body.offline-copy.reader-open .content-grid { display: block; }
body.offline-copy.reader-open .reader { height: 100vh; max-height: 100vh; padding: 0; }
body.offline-copy.reader-open .reader-inner { max-width: 900px; min-height: 100vh; margin: 0 auto; padding: 34px 28px 80px; background: rgba(15, 14, 17, 0.88); border-left: 1px solid rgba(255, 255, 255, 0.04); border-right: 1px solid rgba(255, 255, 255, 0.04); }
body.offline-copy.reader-open .chapter-text { max-width: 760px; margin: 0 auto; font-size: var(--reader-size); line-height: 1.86; }
body.offline-copy.reader-open .reader-header { max-width: 760px; margin: 0 auto 28px; position: sticky; top: 0; z-index: 4; background: rgba(15, 14, 17, 0.96); border-bottom: 1px solid var(--line); padding-bottom: 14px; }
@media (max-width: 900px) { body.offline-copy .app-shell, body.offline-copy .content-grid, .offline-hero { grid-template-columns: 1fr; } .offline-progress-card { min-height: 140px; } }

/* Offline copy: book-room redesign */
body.offline-copy {
  --ink: #211c1b;
  --paper: #f5efe2;
  --paper-soft: #ebe0cd;
  --lacquer: #8f1724;
  --lacquer-dark: #4a1019;
  --steel: #31515c;
  --ember: #c58a3a;
  --muted-on-paper: #786f64;
  overflow: auto;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(34, 17, 20, 0.58), rgba(34, 17, 20, 0.2) 280px, rgba(245, 239, 226, 0) 520px),
    linear-gradient(90deg, #171114 0, #2d1119 28%, #e7dac5 28%, #f5efe2 100%);
}

body.offline-copy::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(0,0,0,0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.26;
}

body.offline-copy .app-shell {
  display: block;
  min-height: 100vh;
}

body.offline-copy .sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: auto;
  display: grid;
  grid-template-columns: minmax(210px, 280px) minmax(220px, 360px) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 14px 22px;
  color: #f9efe3;
  background: rgba(28, 16, 19, 0.94);
  border-right: 0;
  border-bottom: 1px solid rgba(224, 186, 118, 0.28);
  box-shadow: 0 12px 40px rgba(30, 12, 16, 0.32);
  backdrop-filter: blur(18px);
}

body.offline-copy .brand {
  align-items: center;
  gap: 12px;
  margin: 0;
}

body.offline-copy .brand-mark {
  width: 48px;
  height: 64px;
  border-radius: 3px;
  border: 1px solid rgba(224, 186, 118, 0.55);
  background: linear-gradient(180deg, #f2dfb8, #74212a);
  box-shadow: inset 8px 0 0 rgba(255,255,255,0.08), 0 8px 24px rgba(0,0,0,0.28);
  color: #fff8e9;
  font-size: 16px;
  overflow: hidden;
  padding: 0;
}

body.offline-copy .brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

body.offline-copy .brand h1 {
  color: #fff4df;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  letter-spacing: 0;
}

body.offline-copy .brand p,
body.offline-copy .block-title,
body.offline-copy .search-box label {
  color: rgba(255, 232, 190, 0.72);
}

body.offline-copy .search-box {
  margin: 0;
}

body.offline-copy .search-box input,
body.offline-copy select,
body.offline-copy textarea,
body.offline-copy input[type="text"],
body.offline-copy input[type="number"] {
  border-color: rgba(224, 186, 118, 0.28);
  background: rgba(255, 248, 235, 0.09);
  color: #fff9eb;
}

body.offline-copy .search-box input::placeholder,
body.offline-copy textarea::placeholder,
body.offline-copy input::placeholder {
  color: rgba(255, 244, 223, 0.5);
}

body.offline-copy .section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}

body.offline-copy .section-tab {
  width: auto;
  min-height: 38px;
  border: 1px solid rgba(224, 186, 118, 0.2);
  border-radius: 4px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  color: rgba(255, 244, 226, 0.78);
}

body.offline-copy .section-tab.active {
  background: #f2dfb8;
  color: #33151a;
  border-color: #f2dfb8;
}

body.offline-copy .filter-block,
body.offline-copy .download-check.compact-setting {
  margin: 0;
}

body.offline-copy .filter-block {
  min-width: 0;
}

body.offline-copy #arcFilterBlock,
body.offline-copy .download-block,
body.offline-copy .contribute-block,
body.offline-copy .stats {
  grid-column: 1 / -1;
}

body.offline-copy .arc-list,
body.offline-copy .status-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 6px;
}

body.offline-copy .arc-button,
body.offline-copy .status-filter {
  width: auto;
  white-space: nowrap;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  color: rgba(255, 244, 226, 0.82);
}

body.offline-copy .arc-button.active,
body.offline-copy .status-filter.active {
  background: rgba(197, 138, 58, 0.95);
  color: #21120f;
}

body.offline-copy .download-block {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
  align-items: end;
  border-top: 1px solid rgba(224, 186, 118, 0.16);
  padding-top: 12px;
}

body.offline-copy .settings-panel {
  border-top: 1px solid rgba(224, 186, 118, 0.16);
  padding-top: 8px;
}

body.offline-copy .settings-panel > summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(224, 186, 118, 0.2);
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  color: rgba(255, 244, 226, 0.86);
  cursor: pointer;
  list-style: none;
}

body.offline-copy .settings-panel > summary::-webkit-details-marker {
  display: none;
}

body.offline-copy .settings-panel[open] > summary {
  background: rgba(197, 138, 58, 0.95);
  color: #21120f;
}

body.offline-copy .settings-panel > .filter-block,
body.offline-copy .settings-panel > .download-check,
body.offline-copy .settings-panel > .contribute-block,
body.offline-copy .settings-panel > .stats {
  margin-top: 12px;
}

body.offline-copy .download-block .block-title,
body.offline-copy .download-status {
  grid-column: 1 / -1;
}

body.offline-copy .contribute-block {
  border-top: 1px solid rgba(224, 186, 118, 0.16);
  padding-top: 10px;
}

body.offline-copy .library-panel {
  height: auto;
  min-height: calc(100vh - 92px);
  background: transparent;
}

body.offline-copy .topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  width: min(1320px, calc(100% - 36px));
  margin: 22px auto 0;
  border: 1px solid rgba(99, 67, 49, 0.14);
  border-radius: 8px;
  background: rgba(255, 249, 238, 0.86);
  color: var(--ink);
  box-shadow: 0 18px 44px rgba(72, 46, 32, 0.13);
  backdrop-filter: blur(14px);
}

body.offline-copy .topbar h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(26px, 3vw, 42px);
  color: #251817;
}

body.offline-copy .eyebrow {
  color: var(--lacquer);
}

body.offline-copy .reader-actions {
  background: rgba(49, 81, 92, 0.08);
  border: 1px solid rgba(49, 81, 92, 0.14);
  border-radius: 8px;
  padding: 6px;
}

body.offline-copy .icon-button,
body.offline-copy .download-button,
body.offline-copy .chapter-edit-button {
  border-radius: 4px;
  border-color: rgba(76, 52, 43, 0.18);
  background: #fff8eb;
  color: #2c1c18;
}

body.offline-copy .download-button {
  background: var(--lacquer);
  color: #fff7e7;
  border-color: rgba(120, 21, 31, 0.7);
}

body.offline-copy .download-button.subtle {
  background: #31515c;
  color: #f7f0df;
  border-color: rgba(49, 81, 92, 0.8);
}

body.offline-copy .content-grid {
  width: min(1320px, calc(100% - 36px));
  margin: 18px auto 44px;
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 18px;
}

body.offline-copy .chapter-list {
  height: calc(100vh - 182px);
  max-height: none;
  padding: 10px;
  overflow: auto;
  border: 1px solid rgba(99, 67, 49, 0.14);
  border-radius: 8px;
  background: rgba(45, 24, 22, 0.82);
  box-shadow: 0 18px 44px rgba(72, 46, 32, 0.16);
}

body.offline-copy .chapter-card {
  min-height: 88px;
  margin-bottom: 9px;
  border-radius: 5px;
  border-color: rgba(238, 214, 174, 0.14);
  background: linear-gradient(90deg, rgba(250, 234, 204, 0.12), rgba(255,255,255,0.04));
  color: #fff1de;
}

body.offline-copy .chapter-card.active {
  background: #f2dfb8;
  color: #271514;
  border-color: rgba(116, 59, 36, 0.22);
}

body.offline-copy .chapter-card.active .chapter-meta,
body.offline-copy .chapter-card.active .chapter-state-line,
body.offline-copy .chapter-card.active .chapter-user-meta {
  color: rgba(39, 21, 20, 0.66);
}

body.offline-copy .reader {
  min-height: calc(100vh - 182px);
  padding: 0;
  overflow: visible;
  border: 1px solid rgba(99, 67, 49, 0.14);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 22px 56px rgba(72, 46, 32, 0.16);
}

body.offline-copy .reader-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 38px clamp(22px, 5vw, 72px) 72px;
}

body.offline-copy .reader-header {
  align-items: end;
  border-bottom: 1px solid rgba(63, 43, 34, 0.16);
  padding-bottom: 18px;
  margin-bottom: 28px;
}

body.offline-copy .reader-header h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 3.2vw, 48px);
  color: #241817;
}

body.offline-copy .chapter-text {
  max-width: 760px;
  margin: 0 auto;
  color: #251f1a;
  font-size: var(--reader-size);
  line-height: 1.92;
}

body.offline-copy .chapter-text p {
  margin-bottom: 1.25em;
}

body.offline-copy .notice,
body.offline-copy .tl-notes,
body.offline-copy .original-block {
  color: #2b211d;
  background: rgba(255,255,255,0.44);
  border-color: rgba(99, 67, 49, 0.16);
}

body.offline-copy .offline-home {
  max-width: none;
  padding: 0;
  gap: 24px;
}

body.offline-copy .offline-hero {
  min-height: 430px;
  grid-template-columns: minmax(0, 1.25fr) minmax(220px, 0.75fr);
  align-items: end;
  overflow: hidden;
  border: 0;
  border-radius: 8px 8px 0 0;
  padding: clamp(28px, 5vw, 64px);
  color: #fff7e9;
  background:
    linear-gradient(115deg, rgba(35, 13, 17, 0.93), rgba(77, 17, 27, 0.76) 46%, rgba(245, 239, 226, 0.1)),
    url("covers/rezero-web-novel-volume-1.jpg") right center / contain no-repeat,
    #211116;
}

body.offline-copy .offline-hero h3 {
  max-width: 760px;
  margin: 12px 0 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 7vw, 84px);
  line-height: 0.98;
  color: #fff4df;
}

body.offline-copy .offline-hero p {
  max-width: 620px;
  color: rgba(255, 240, 218, 0.78);
  font-size: 17px;
}

body.offline-copy .offline-progress-card {
  min-height: 250px;
  border: 1px solid rgba(255, 240, 210, 0.22);
  border-radius: 8px;
  background: rgba(20, 14, 16, 0.62);
  color: #fff4df;
  backdrop-filter: blur(10px);
}

body.offline-copy .offline-progress-card strong {
  color: #f1d390;
  font-family: Georgia, "Times New Roman", serif;
}

body.offline-copy .offline-section-head {
  padding: 0 22px;
  color: var(--ink);
}

body.offline-copy .offline-section-head h4 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
}

body.offline-copy .offline-arc-grid {
  padding: 0 22px 34px;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}

body.offline-copy .offline-arc-card {
  min-height: 320px;
  border: 0;
  border-radius: 6px;
  box-shadow: 0 18px 38px rgba(72, 46, 32, 0.24);
  transform: translateY(0);
}

body.offline-copy .offline-arc-card::after {
  background:
    linear-gradient(180deg, rgba(0,0,0,0.03) 0, rgba(0,0,0,0.18) 38%, rgba(0,0,0,0.88) 100%),
    linear-gradient(90deg, rgba(255,255,255,0.14), transparent 18%);
}

body.offline-copy .offline-arc-card span {
  color: #f6d487;
}

body.offline-copy .offline-arc-card strong {
  color: #fff7e7;
  font-size: 18px;
}

body.offline-copy .anime-bridge-switch {
  border-color: rgba(65, 43, 33, 0.16);
  background: rgba(49, 81, 92, 0.1);
}

body.offline-copy .anime-bridge-switch button.active {
  background: var(--steel);
  color: #fff8ea;
}

body.offline-copy.reader-open {
  background: #eadfce;
}

body.offline-copy.reader-open .app-shell {
  display: block;
}

body.offline-copy.reader-open .reader {
  min-height: 100vh;
  height: auto;
  max-height: none;
  width: min(980px, calc(100% - 28px));
  margin: 0 auto;
  border-radius: 0;
  border-top: 0;
  border-bottom: 0;
}

body.offline-copy.reader-open .reader-inner {
  max-width: 900px;
  padding: 44px clamp(22px, 7vw, 88px) 92px;
  background: transparent;
  border: 0;
}

body.offline-copy.reader-open .reader-header {
  max-width: 760px;
  background: rgba(245, 239, 226, 0.94);
}

body.offline-copy.reader-open .chapter-text {
  color: #211c1b;
}

@media (max-width: 980px) {
  body.offline-copy {
    background: #f5efe2;
  }

  body.offline-copy .sidebar {
    position: static;
    grid-template-columns: 1fr;
  }

  body.offline-copy .download-block {
    grid-template-columns: 1fr;
  }

  body.offline-copy .topbar,
  body.offline-copy .content-grid {
    width: calc(100% - 20px);
  }

  body.offline-copy .content-grid {
    display: flex;
    flex-direction: column;
  }

  body.offline-copy .reader {
    order: 1;
  }

  body.offline-copy .chapter-list {
    order: 2;
  }

  body.offline-copy .chapter-list {
    height: auto;
    max-height: 44vh;
  }

  body.offline-copy .offline-hero {
    grid-template-columns: 1fr;
    background:
      linear-gradient(115deg, rgba(35, 13, 17, 0.94), rgba(77, 17, 27, 0.82)),
      #211116;
  }
}

/* Offline copy: top-page navigation */
body.offline-copy .app-shell {
  display: block;
}

body.offline-copy .sidebar {
  position: sticky;
  top: 0;
  z-index: 35;
  width: 100%;
  height: auto;
  max-height: none;
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  grid-template-areas:
    "brand nav settings";
  gap: 10px 18px;
  align-items: center;
  overflow: visible;
  padding: 12px clamp(14px, 3vw, 34px);
  border-right: 0;
  border-bottom: 1px solid rgba(224, 186, 118, 0.18);
  box-shadow: 0 14px 40px rgba(15, 8, 10, 0.28);
}

body.offline-copy .brand {
  grid-area: brand;
  order: initial;
  min-width: 220px;
  padding: 0;
  border-bottom: 0;
}

body.offline-copy .brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  background: #f4f0de;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}

body.offline-copy .brand h1 {
  font-size: 23px;
}

body.offline-copy .settings-content .search-box {
  order: initial;
  max-width: none;
  margin: 0;
}

body.offline-copy .settings-content .search-box label {
  display: block;
}

body.offline-copy .settings-content .search-box input {
  min-height: 40px;
}

body.offline-copy .section-tabs {
  grid-area: nav;
  order: initial;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0;
  padding: 0;
}

body.offline-copy .section-tab {
  width: auto;
  min-width: 0;
  min-height: 38px;
  padding: 8px 14px;
}

body.offline-copy .settings-panel {
  grid-area: settings;
  order: initial;
  min-width: 118px;
  align-self: stretch;
  display: flex;
  align-items: center;
  padding-top: 0;
  border-top: 0;
  position: relative;
}

body.offline-copy .settings-panel > summary {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
}

body.offline-copy .settings-panel[open] {
  align-items: start;
}

body.offline-copy .settings-panel[open] > .settings-content {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(420px, calc(100vw - 24px));
  z-index: 50;
  padding: 14px;
  border: 1px solid rgba(224, 186, 118, 0.22);
  border-radius: 8px;
  background: rgba(27, 15, 18, 0.98);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.36);
}

body.offline-copy .library-panel {
  min-height: auto;
}

body.offline-copy .topbar,
body.offline-copy .content-grid {
  width: min(1320px, calc(100% - 32px));
}

body.offline-copy.home-open .reader {
  min-height: calc(100vh - 110px);
}

body.offline-copy .offline-hero {
  min-height: clamp(300px, 38vh, 450px);
}

@media (max-width: 760px) {
  body.offline-copy .sidebar {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand settings"
      "nav nav";
    gap: 10px;
    padding: 10px 12px;
  }

  body.offline-copy .brand {
    min-width: 0;
  }

  body.offline-copy .brand h1 {
    font-size: 20px;
  }

  body.offline-copy .brand p {
    display: none;
  }

  body.offline-copy .brand-mark {
    width: 46px;
    height: 46px;
  }

  body.offline-copy .section-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.offline-copy .section-tab {
    padding: 7px 6px;
    font-size: 13px;
  }

  body.offline-copy .settings-panel {
    min-width: 92px;
  }
}

/* Offline copy: stable full-width page tabs */
body.offline-copy .sidebar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  max-height: none;
  overflow: visible;
}

body.offline-copy .brand {
  flex: 1 1 240px;
}

body.offline-copy .settings-panel {
  flex: 0 0 140px;
}

body.offline-copy .settings-panel {
  justify-self: end;
  width: min(140px, 100%);
}

body.offline-copy .section-tabs {
  flex: 1 0 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
}

body.offline-copy .section-tab {
  width: 100%;
}

@media (max-width: 820px) {
  body.offline-copy .section-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  body.offline-copy .section-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Offline copy: final reading-room layout */
body.offline-copy .app-shell {
  display: grid;
  grid-template-columns: 318px minmax(0, 1fr);
  min-height: 100vh;
}

body.offline-copy .sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 13px;
  overflow: auto;
  padding: 18px 16px;
  border-right: 1px solid rgba(224, 186, 118, 0.22);
  border-bottom: 0;
}

body.offline-copy .brand { order: 1; }
body.offline-copy .search-box { order: 2; }
body.offline-copy .settings-panel { order: 3; }
body.offline-copy .section-tabs { order: 4; }
body.offline-copy #arcFilterBlock { order: 5; }

body.offline-copy .brand {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(224, 186, 118, 0.16);
}

body.offline-copy .section-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

body.offline-copy .section-tab {
  justify-content: center;
  text-align: center;
}

body.offline-copy #arcFilterBlock,
body.offline-copy .settings-panel {
  grid-column: auto;
}

body.offline-copy #arcFilterBlock {
  display: none !important;
}

body.offline-copy .arc-list,
body.offline-copy .status-list {
  max-height: 132px;
  display: grid;
  grid-template-columns: 1fr;
  overflow: auto;
}

body.offline-copy .arc-button,
body.offline-copy .status-filter {
  justify-content: flex-start;
  text-align: left;
}

body.offline-copy .download-block {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

body.offline-copy .settings-panel .status-list {
  display: flex;
  flex-wrap: wrap;
  max-height: none;
}

body.offline-copy .settings-panel .status-filter {
  flex: 1 1 92px;
  justify-content: center;
  text-align: center;
}

body.offline-copy .settings-panel .stats {
  font-size: 12px;
  color: rgba(255, 244, 226, 0.68);
}

body.offline-copy .library-panel {
  min-width: 0;
  height: auto;
}

body.offline-copy .topbar,
body.offline-copy .content-grid {
  width: min(1280px, calc(100% - 34px));
}

body.offline-copy .topbar {
  top: 14px;
  margin-top: 14px;
}

body.offline-copy .content-grid {
  margin-top: 14px;
}

body.offline-copy .chapter-list {
  height: calc(100vh - 156px);
}

body.offline-copy .reader {
  min-height: calc(100vh - 156px);
}

body.offline-copy .offline-hero {
  min-height: clamp(330px, 42vh, 480px);
}

body.offline-copy.home-open .topbar,
body.offline-copy.home-open .chapter-list {
  display: none;
}

body.offline-copy.home-open .content-grid {
  display: block;
}

body.offline-copy.home-open .reader {
  min-height: calc(100vh - 34px);
}

@media (max-width: 980px) {
  body.offline-copy .app-shell {
    display: block;
  }

  body.offline-copy .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    max-height: 236px;
    overflow: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(224, 186, 118, 0.22);
  }

  body.offline-copy .brand {
    padding-bottom: 4px;
  }

  body.offline-copy .brand-mark {
    width: 38px;
    height: 50px;
  }

  body.offline-copy .brand h1 {
    font-size: 21px;
  }

  body.offline-copy .section-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    padding-bottom: 4px;
    scrollbar-width: none;
    min-height: 44px;
    align-items: stretch;
  }

  body.offline-copy .section-tabs::-webkit-scrollbar,
  body.offline-copy .arc-list::-webkit-scrollbar,
  body.offline-copy .status-list::-webkit-scrollbar {
    display: none;
  }

  body.offline-copy .section-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 40px;
    overflow: visible;
    color: rgba(255, 244, 226, 0.86);
  }

  body.offline-copy .section-tab.active {
    color: #33151a;
  }

  body.offline-copy .library-panel,
  body.offline-copy .topbar,
  body.offline-copy .content-grid,
  body.offline-copy .reader,
  body.offline-copy .chapter-list {
    max-width: 100%;
    overflow-x: hidden;
  }

  body.offline-copy .arc-list,
  body.offline-copy .status-list {
    display: flex;
    max-height: none;
  }

  body.offline-copy .arc-button,
  body.offline-copy .status-filter {
    min-width: max-content;
  }

  body.offline-copy .download-block,
  body.offline-copy .settings-panel .download-block {
    display: grid;
  }

  body.offline-copy .contribute-block,
  body.offline-copy .settings-panel .contribute-block {
    display: block;
  }

  body.offline-copy .stats,
  body.offline-copy .settings-panel .stats,
  body.offline-copy .download-check.compact-setting {
    display: block;
  }
}

/* Offline copy: airy WCT-style redesign */
body.offline-copy {
  --paper: #fbfaf7;
  --paper-soft: #f2eee6;
  --ink: #181512;
  --muted-ink: #6f675d;
  --rule: #ded6c9;
  --accent-red: #8f1d2c;
  --accent-gold: #b98b35;
  --accent-green: #596f52;
  --reader-size: clamp(17px, 1.05vw, 19px);
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.92), rgba(251,250,247,0.98)),
    repeating-linear-gradient(90deg, rgba(24,21,18,0.025) 0 1px, transparent 1px 72px);
  font-family: Georgia, "Times New Roman", serif;
}

body.offline-copy::before {
  display: none;
}

body.offline-copy .app-shell {
  display: block;
  min-height: 100vh;
}

body.offline-copy .sidebar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: auto;
  max-height: none;
  overflow: visible;
  display: grid;
  grid-template-columns: minmax(210px, 310px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 12px clamp(18px, 4vw, 58px);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  border: 0;
  border-bottom: 1px solid #d9d2c8;
  box-shadow: 0 2px 9px rgba(24, 21, 18, 0.16);
  backdrop-filter: blur(10px);
}

body.offline-copy .brand {
  order: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 0;
  border: 0;
}

body.offline-copy .brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid #1e1a16;
  border-radius: 0;
  background: #f7efe2;
  box-shadow: none;
}

body.offline-copy .brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.offline-copy .brand h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(18px, 1.7vw, 26px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
}

body.offline-copy .brand p {
  margin: 5px 0 0;
  color: var(--muted-ink);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.offline-copy .section-tabs {
  order: 2;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
  min-height: 46px;
  overflow: visible;
  padding: 0;
}

body.offline-copy .section-tab {
  position: relative;
  width: auto;
  min-width: 0;
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(13px, 1.15vw, 18px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

body.offline-copy .section-tab::after {
  content: "/";
  position: absolute;
  right: -4px;
  top: 50%;
  transform: translateY(-50%);
  color: #2f2a25;
  font-size: 19px;
}

body.offline-copy .section-tab:last-child::after {
  display: none;
}

body.offline-copy .section-tab:hover,
body.offline-copy .section-tab.active {
  color: var(--accent-red);
  background: transparent;
  border: 0;
}

body.offline-copy .section-tab.active {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}

body.offline-copy #arcFilterBlock,
body.offline-copy .download-block,
body.offline-copy .contribute-block,
body.offline-copy .stats {
  display: none !important;
}

body.offline-copy .settings-panel {
  order: 3;
  position: relative;
  justify-self: end;
  width: auto;
  margin: 0;
}

body.offline-copy .settings-panel > summary {
  min-height: 42px;
  padding: 0 0 0 18px;
  border: 0;
  border-left: 1px solid #2f2a25;
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  letter-spacing: 0;
  text-transform: uppercase;
}

body.offline-copy .settings-panel[open] > summary,
body.offline-copy .settings-panel > summary:hover {
  color: var(--accent-red);
  background: transparent;
}

body.offline-copy .settings-panel > .settings-content {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  display: grid;
  gap: 14px;
  width: min(420px, calc(100vw - 28px));
  max-height: calc(100vh - 92px);
  overflow: auto;
  padding: 18px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 0;
  box-shadow: 0 18px 40px rgba(24, 21, 18, 0.2);
}

body.offline-copy .settings-content .filter-block,
body.offline-copy .settings-content .download-block,
body.offline-copy .settings-content .contribute-block,
body.offline-copy .settings-content .stats,
body.offline-copy .settings-content .download-check.compact-setting {
  display: grid !important;
}

body.offline-copy .settings-content .search-box {
  display: grid;
  gap: 7px;
}

body.offline-copy .block-title,
body.offline-copy .search-box label {
  color: var(--muted-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.offline-copy .search-box input,
body.offline-copy select,
body.offline-copy textarea,
body.offline-copy input[type="text"],
body.offline-copy input[type="number"] {
  color: var(--ink);
  background: #fff;
  border: 1px solid #cfc4b4;
  border-radius: 3px;
  box-shadow: none;
}

body.offline-copy .search-box input::placeholder,
body.offline-copy textarea::placeholder,
body.offline-copy input::placeholder {
  color: #9a9084;
}

body.offline-copy .status-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: none;
}

body.offline-copy .status-filter,
body.offline-copy .arc-button {
  color: var(--ink);
  background: #f8f5ef;
  border: 1px solid #d7cbbb;
  border-radius: 3px;
}

body.offline-copy .status-filter.active,
body.offline-copy .arc-button.active {
  color: #fff;
  background: var(--accent-red);
  border-color: var(--accent-red);
}

body.offline-copy .download-check {
  color: var(--ink);
}

body.offline-copy .library-panel {
  min-height: calc(100vh - 73px);
  background: transparent;
}

body.offline-copy .topbar,
body.offline-copy .content-grid {
  width: min(1220px, calc(100% - 44px));
  margin-left: auto;
  margin-right: auto;
}

body.offline-copy .topbar {
  position: sticky;
  top: 75px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 22px;
  padding: 14px 0;
  color: var(--ink);
  background: rgba(251, 250, 247, 0.92);
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: blur(8px);
}

body.offline-copy .topbar h2 {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(24px, 2vw, 34px);
  letter-spacing: 0;
}

body.offline-copy .eyebrow {
  color: var(--accent-red);
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

body.offline-copy .reader-actions {
  gap: 8px;
}

body.offline-copy .icon-button,
body.offline-copy .download-button,
body.offline-copy .chapter-edit-button {
  color: var(--ink);
  background: #fff;
  border: 1px solid #cbbbaa;
  border-radius: 3px;
  box-shadow: none;
}

body.offline-copy .download-button {
  min-height: 44px;
  padding: 0 18px;
  color: #fff;
  background: var(--accent-red);
  border-color: var(--accent-red);
}

body.offline-copy .download-button.subtle,
body.offline-copy .icon-button:hover {
  color: var(--ink);
  background: #f6efe3;
  border-color: #cbbbaa;
}

body.offline-copy .content-grid {
  grid-template-columns: minmax(290px, 390px) minmax(0, 1fr);
  gap: 22px;
  margin-top: 22px;
  padding-bottom: 36px;
}

body.offline-copy .chapter-list {
  height: calc(100vh - 166px);
  padding: 0 14px 0 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

body.offline-copy .chapter-card {
  min-height: 124px;
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
  overflow: hidden;
  padding: 0;
  color: var(--ink);
  background: rgba(255,255,255,0.88);
  border: 1px solid #e1d7ca;
  border-radius: 4px;
  box-shadow: none;
}

body.offline-copy .chapter-thumb {
  width: 82px;
  height: 100%;
  min-height: 124px;
  object-fit: cover;
  background: var(--surface-soft);
  border-right: 1px solid var(--rule);
}

body.offline-copy .chapter-card-body {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 13px 14px 13px 0;
}

body.offline-copy .chapter-title {
  overflow-wrap: anywhere;
}

body.offline-copy .chapter-card.active {
  color: var(--ink);
  background: #fff7ea;
  border-color: var(--accent-gold);
}

body.offline-copy .chapter-card.active .chapter-meta,
body.offline-copy .chapter-card.active .chapter-state-line,
body.offline-copy .chapter-card.active .chapter-user-meta {
  color: var(--muted-ink);
}

body.offline-copy .reader {
  min-height: calc(100vh - 166px);
  color: var(--ink);
  background: transparent;
  border: 0;
  box-shadow: none;
}

body.offline-copy .reader-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 56px);
  color: var(--ink);
  background: rgba(255,255,255,0.92);
  border: 1px solid #e2d8cb;
  border-radius: 4px;
  box-shadow: 0 16px 34px rgba(24,21,18,0.09);
}

body.offline-copy .reader-header {
  position: static !important;
  top: auto !important;
  z-index: auto;
  padding-bottom: 20px;
  margin-bottom: 28px;
  background: transparent;
  border-bottom: 1px solid var(--rule);
}

body.offline-copy .reader-header h3 {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(25px, 2.7vw, 40px);
  letter-spacing: 0;
  line-height: 1.1;
}

body.offline-copy .reader-meta,
body.offline-copy .reader-stars {
  color: var(--muted-ink);
  font-size: 13px;
  line-height: 1.35;
}

body.offline-copy .reading-controls {
  margin-top: 8px;
}

body.offline-copy .reading-controls label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-ink);
  font-size: 13px;
}

body.offline-copy .reading-controls select {
  min-height: 32px;
  padding: 4px 28px 4px 8px;
}

body.offline-copy .chapter-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  max-width: 760px;
  margin: -10px auto 26px;
}

body.offline-copy .chapter-nav .chapter-edit-button {
  min-height: 36px;
  padding: 0 14px;
}

body.offline-copy .chapter-nav .chapter-edit-button:disabled {
  opacity: 0.45;
  cursor: default;
}

body.offline-copy.reader-open .reader-header,
body.offline-copy.reader-open .chapter-nav {
  transition: opacity 180ms ease, max-height 180ms ease, margin 180ms ease, padding 180ms ease, border-color 180ms ease;
}

body.offline-copy.reader-open.reader-ui-hidden .reader-header,
body.offline-copy.reader-open.reader-ui-hidden .chapter-nav {
  max-height: 0;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  border-color: transparent;
}

body.offline-copy .chapter-text {
  color: #231f1b;
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--reader-size);
  line-height: 1.9;
}

body.offline-copy .chapter-text p {
  margin: 0 0 1.25em;
}

body.offline-copy .notice,
body.offline-copy .tl-notes,
body.offline-copy .original-block {
  color: var(--ink);
  background: #fffaf1;
  border: 1px solid #e0d0bc;
  border-radius: 4px;
}

body.offline-copy.home-open .topbar,
body.offline-copy.home-open .chapter-list {
  display: none;
}

body.offline-copy.home-open .content-grid {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
}

body.offline-copy.home-open .reader {
  min-height: calc(100vh - 73px);
}

body.offline-copy .offline-home {
  display: grid;
  gap: clamp(26px, 4vw, 48px);
  max-width: 1220px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 68px) 22px 72px;
}

body.offline-copy .offline-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 280px);
  align-items: end;
  gap: 28px;
  min-height: 0;
  padding: 0 0 clamp(28px, 5vw, 56px);
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  box-shadow: none;
}

body.offline-copy .offline-hero::before {
  display: none;
}

body.offline-copy .offline-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

body.offline-copy .offline-hero h3 {
  max-width: 780px;
  margin: 8px 0 14px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(40px, 7vw, 86px);
  line-height: 0.98;
  letter-spacing: 0;
  text-wrap: balance;
}

body.offline-copy .offline-hero p {
  max-width: 520px;
  color: var(--muted-ink);
  font-size: clamp(16px, 1.4vw, 20px);
  line-height: 1.55;
}

body.offline-copy .offline-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

body.offline-copy .offline-progress-card {
  min-height: 168px;
  padding: 22px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #ded3c4;
  border-radius: 4px;
  box-shadow: 0 14px 28px rgba(24,21,18,0.08);
}

body.offline-copy .offline-progress-card strong {
  color: var(--accent-red);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 54px;
}

body.offline-copy .offline-progress-card span,
body.offline-copy .offline-progress-card small {
  color: var(--muted-ink);
}

body.offline-copy .offline-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}

body.offline-copy .offline-section-head h4 {
  margin: 5px 0 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(24px, 2.8vw, 38px);
  letter-spacing: 0;
}

body.offline-copy .offline-arc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 22px;
}

body.offline-copy .offline-arc-card {
  position: relative;
  min-height: clamp(300px, 38vw, 430px);
  overflow: hidden;
  padding: 0;
  color: #fff;
  background: #15120f;
  border: 1px solid #d7cbbb;
  border-radius: 4px;
  box-shadow: 0 18px 35px rgba(24,21,18,0.16);
  text-align: left;
}

body.offline-copy .offline-arc-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.82;
  transform: scale(1.015);
  transition: transform 220ms ease, opacity 220ms ease;
}

body.offline-copy .offline-arc-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 54%;
  background: linear-gradient(180deg, transparent, rgba(10,8,7,0.76) 38%, rgba(10,8,7,0.95));
}

body.offline-copy .offline-arc-card:hover img {
  opacity: 0.95;
  transform: scale(1.04);
}

body.offline-copy .offline-arc-card span,
body.offline-copy .offline-arc-card strong,
body.offline-copy .offline-arc-card small {
  position: relative;
  z-index: 1;
  display: block;
  margin-left: 18px;
  margin-right: 18px;
}

body.offline-copy .offline-arc-card span {
  margin-top: calc(clamp(300px, 38vw, 430px) - 132px);
  color: #f2d37c;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.offline-copy .offline-arc-card strong {
  margin-top: 7px;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(21px, 2vw, 29px);
  line-height: 1.12;
  letter-spacing: 0;
}

body.offline-copy .offline-arc-card small {
  margin-top: 10px;
  color: rgba(255,255,255,0.82);
  font-size: 14px;
}

body.offline-copy .anime-bridge-switch {
  border: 1px solid #d7cbbb;
  background: #fff;
  border-radius: 4px;
}

body.offline-copy .anime-bridge-switch button.active {
  color: #fff;
  background: var(--accent-red);
}

body.offline-copy .shelf-landing {
  display: grid;
  gap: 26px;
}

body.offline-copy .shelf-landing-grid {
  display: grid;
  grid-template-columns: minmax(190px, 260px) minmax(0, 1fr);
  gap: 18px;
}

body.offline-copy .shelf-start-card,
body.offline-copy .shelf-note-card {
  min-height: 180px;
  padding: 22px;
  color: var(--ink);
  background: #fffaf1;
  border: 1px solid #e0d0bc;
  border-radius: 4px;
  box-shadow: none;
  text-align: left;
}

body.offline-copy .shelf-start-card {
  cursor: pointer;
}

body.offline-copy .shelf-start-card:disabled {
  cursor: default;
  opacity: 0.65;
}

body.offline-copy .shelf-start-card span {
  display: block;
  color: var(--accent-red);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 58px;
  line-height: 1;
}

body.offline-copy .shelf-start-card strong,
body.offline-copy .shelf-note-card strong {
  display: block;
  margin-top: 12px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  line-height: 1.2;
}

body.offline-copy .shelf-start-card small,
body.offline-copy .shelf-note-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted-ink);
  font-size: 14px;
}

body.offline-copy.reader-open {
  background: var(--paper-soft);
}

body.offline-copy.reader-open .app-shell {
  display: block;
}

body.offline-copy.reader-open .sidebar,
body.offline-copy.reader-open .topbar,
body.offline-copy.reader-open .chapter-list {
  display: none;
}

body.offline-copy.reader-open .content-grid {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
}

body.offline-copy.reader-open .reader {
  min-height: 100vh;
  max-height: none;
  padding: clamp(18px, 4vw, 54px);
}

body.offline-copy.reader-open .reader-inner {
  min-height: calc(100vh - clamp(36px, 8vw, 108px));
  max-width: 900px;
  padding: clamp(30px, 6vw, 78px);
  background: #fffdf8;
}

body.offline-copy.reader-open .reader-header {
  position: static !important;
  top: auto !important;
  max-width: 760px;
  margin: 0 auto 24px;
}

@media (max-width: 1120px) {
  body.offline-copy .sidebar {
    grid-template-columns: minmax(0, 1fr) auto;
    justify-items: stretch;
    gap: 10px;
  }

  body.offline-copy .brand {
    justify-content: flex-start;
    text-align: left;
  }

  body.offline-copy .section-tabs {
    grid-column: 1 / -1;
    justify-content: flex-start;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  body.offline-copy .settings-panel {
    justify-self: end;
  }

  body.offline-copy .settings-panel > summary {
    border-left: 0;
    padding: 0;
  }
}

@media (max-width: 760px) {
  body.offline-copy .sidebar {
    position: sticky;
    padding: 10px 12px;
  }

  body.offline-copy .brand-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  body.offline-copy .brand h1 {
    font-size: 18px;
  }

  body.offline-copy .brand p {
    display: none;
  }

  body.offline-copy .section-tabs {
    min-height: 40px;
    padding: 0 2px 4px;
  }

  body.offline-copy .section-tab {
    min-height: 38px;
    padding: 0 15px;
    font-size: 13px;
  }

  body.offline-copy .settings-panel > .settings-content {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  body.offline-copy .topbar {
    top: 118px;
    display: grid;
    gap: 10px;
  }

  body.offline-copy .reader-actions {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  body.offline-copy .content-grid {
    display: block;
    width: min(100% - 22px, 1220px);
  }

  body.offline-copy .chapter-list {
    height: auto;
    max-height: 40vh;
    margin-bottom: 18px;
    padding: 0;
  }

  body.offline-copy .reader {
    min-height: 58vh;
  }

  body.offline-copy .offline-home {
    padding: 24px 14px 48px;
  }

  body.offline-copy .offline-hero {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  body.offline-copy .offline-progress-card {
    min-height: 118px;
  }

  body.offline-copy .offline-arc-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  body.offline-copy .offline-arc-card {
    min-height: 300px;
  }

  body.offline-copy .shelf-landing-grid {
    grid-template-columns: 1fr;
  }

  body.offline-copy.reader-open .reader {
    padding: 0;
  }

  body.offline-copy.reader-open .reader-inner {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    padding: 26px 18px 56px;
  }
}

/* Offline copy: Re:Zero archive theme controls */
body.offline-copy.theme-light,
body.offline-copy:not(.theme-dark) {
  --paper: #ffffff;
  --paper-soft: #f6f3ed;
  --surface: #ffffff;
  --surface-soft: #fbf8f2;
  --ink: #191613;
  --muted-ink: #706960;
  --rule: #ded6c9;
  --accent-red: #9b1f32;
  --accent-gold: #b58a34;
  --shadow-soft: rgba(24, 21, 18, 0.12);
}

body.offline-copy.theme-dark {
  --paper: #2b2725;
  --paper-soft: #24211f;
  --surface: #332f2c;
  --surface-soft: #3c3733;
  --ink: #f5efe6;
  --muted-ink: #c9bdae;
  --rule: #5a5149;
  --accent-red: #e26b78;
  --accent-gold: #d8aa52;
  --shadow-soft: rgba(0, 0, 0, 0.28);
}

body.offline-copy.theme-light,
body.offline-copy:not(.theme-dark) {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,246,241,0.98)),
    radial-gradient(circle at 18% 0%, rgba(155,31,50,0.06), transparent 34%),
    radial-gradient(circle at 88% 18%, rgba(181,138,52,0.08), transparent 28%);
}

body.offline-copy.theme-dark {
  background:
    linear-gradient(180deg, rgba(43,39,37,0.98), rgba(36,33,31,0.99)),
    radial-gradient(circle at 18% 0%, rgba(226,107,120,0.13), transparent 34%),
    radial-gradient(circle at 88% 18%, rgba(216,170,82,0.12), transparent 28%);
}

body.offline-copy .sidebar {
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 2px 12px var(--shadow-soft);
}

body.offline-copy .brand h1,
body.offline-copy .topbar h2,
body.offline-copy .offline-hero h3,
body.offline-copy .offline-section-head h4,
body.offline-copy .reader-header h3 {
  color: var(--ink);
}

body.offline-copy .brand p,
body.offline-copy .offline-hero p,
body.offline-copy .offline-progress-card span,
body.offline-copy .offline-progress-card small,
body.offline-copy .shelf-start-card small,
body.offline-copy .shelf-note-card small {
  color: var(--muted-ink);
}

body.offline-copy .section-tabs {
  gap: 8px;
}

body.offline-copy .section-tab {
  min-height: 40px;
  padding: 0 15px;
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  font-size: clamp(13px, 1vw, 16px);
  text-transform: none;
}

body.offline-copy .section-tab::after {
  display: none;
}

body.offline-copy .section-tab:hover {
  color: var(--accent-red);
  background: var(--surface-soft);
  border-color: var(--rule);
}

body.offline-copy .section-tab.active {
  color: #fff;
  background: var(--accent-red);
  border-color: var(--accent-red);
  text-decoration: none;
}

body.offline-copy .settings-panel > summary {
  color: var(--ink);
  border-left-color: var(--rule);
  text-transform: none;
}

body.offline-copy .settings-panel > .settings-content,
body.offline-copy .topbar,
body.offline-copy .reader-inner,
body.offline-copy .offline-progress-card,
body.offline-copy .shelf-start-card,
body.offline-copy .shelf-note-card,
body.offline-copy .chapter-card,
body.offline-copy .anime-bridge-switch {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--rule);
}

body.offline-copy .topbar {
  background: color-mix(in srgb, var(--paper) 90%, transparent);
}

body.offline-copy .offline-hero,
body.offline-copy .offline-section-head,
body.offline-copy .reader-header {
  border-color: var(--rule);
}

body.offline-copy .search-box input,
body.offline-copy select,
body.offline-copy textarea,
body.offline-copy input[type="text"],
body.offline-copy input[type="number"] {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--rule);
}

body.offline-copy .status-filter,
body.offline-copy .arc-button,
body.offline-copy .download-button.subtle,
body.offline-copy .icon-button,
body.offline-copy .chapter-edit-button {
  color: var(--ink);
  background: var(--surface-soft);
  border-color: var(--rule);
}

body.offline-copy .chapter-text {
  color: var(--ink);
}

body.offline-copy .notice,
body.offline-copy .tl-notes,
body.offline-copy .original-block {
  color: var(--ink);
  background: var(--surface-soft);
  border-color: var(--rule);
}

body.offline-copy.reader-open {
  background: var(--paper-soft);
}

body.offline-copy.reader-open .reader-inner {
  background: var(--surface);
}

body.offline-copy.home-open .reader,
body.offline-copy.anime-guide-open .reader {
  display: block;
}

body.offline-copy.home-open .reader-inner {
  display: none;
}

body.offline-copy.shelf-list-open .content-grid {
  display: block;
  width: min(980px, calc(100% - 44px));
  margin-top: 28px;
}

body.offline-copy.shelf-list-open .topbar {
  display: none;
}

body.offline-copy.shelf-list-open .reader,
body.offline-copy.shelf-list-open .reader-inner {
  display: none;
}

body.offline-copy.shelf-list-open .chapter-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 12px;
  width: 100%;
  height: auto;
  max-height: none;
  padding: 0 0 36px;
  overflow: visible;
}

body.offline-copy.shelf-list-open .chapter-card {
  margin: 0;
}

body.offline-copy.shelf-list-open .chapter-thumb {
  min-height: 132px;
}

body.offline-copy.anime-guide-open .topbar,
body.offline-copy.anime-guide-open .chapter-list {
  display: none;
}

body.offline-copy.anime-guide-open .content-grid {
  display: block;
  width: min(1120px, calc(100% - 44px));
}

body.offline-copy.anime-guide-open .reader {
  min-height: auto;
}

body.offline-copy.anime-guide-open .reader-inner {
  max-width: 1120px;
  padding: clamp(22px, 4vw, 46px);
  background: var(--surface);
}

body.offline-copy.anime-guide-open .reader-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

body.offline-copy.anime-guide-open .reader-header h3 {
  font-size: clamp(30px, 4vw, 54px);
}

body.offline-copy.anime-guide-open .anime-bridge-switch {
  margin: 0 0 22px;
  background: var(--surface-soft);
}

body.offline-copy.anime-guide-open .guide-season {
  margin: 0 0 18px;
  padding: 0;
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid var(--rule);
  border-radius: 8px;
}

body.offline-copy.anime-guide-open .guide-season-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  background: color-mix(in srgb, var(--surface) 78%, var(--accent-red) 8%);
  border-bottom: 1px solid var(--rule);
}

body.offline-copy.anime-guide-open .guide-season h4 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
}

body.offline-copy.anime-guide-open .guide-table {
  display: grid;
}

body.offline-copy.anime-guide-open .guide-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 68px;
  padding: 12px 18px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 74%, transparent);
}

body.offline-copy.anime-guide-open .guide-row:last-child {
  border-bottom: 0;
}

body.offline-copy.anime-guide-open .guide-ep {
  width: auto;
  min-height: 38px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent-red);
  border-radius: 999px;
  font-weight: 700;
}

body.offline-copy.anime-guide-open .guide-row strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.35;
}

body.offline-copy.anime-guide-open .guide-accuracy {
  display: inline-flex;
  margin-top: 6px;
  color: var(--muted-ink);
  background: color-mix(in srgb, var(--surface) 74%, var(--accent-gold) 14%);
  border-color: var(--rule);
}

body.offline-copy.theme-dark .reader-inner,
body.offline-copy.theme-dark .chapter-card,
body.offline-copy.theme-dark .offline-progress-card,
body.offline-copy.theme-dark .shelf-start-card,
body.offline-copy.theme-dark .shelf-note-card,
body.offline-copy.theme-dark .settings-panel > .settings-content {
  background: var(--surface);
}

body.offline-copy.theme-dark .guide-open,
body.offline-copy.theme-dark .download-button.subtle,
body.offline-copy.theme-dark .icon-button,
body.offline-copy.theme-dark .chapter-edit-button,
body.offline-copy.theme-dark .status-filter,
body.offline-copy.theme-dark .arc-button {
  color: var(--ink);
  background: var(--surface-soft);
  border-color: var(--rule);
}

body.offline-copy.theme-dark .offline-arc-card {
  border-color: #514943;
}

body.offline-copy.theme-dark .offline-arc-card::after {
  background: linear-gradient(180deg, transparent, rgba(29,27,26,0.58) 36%, rgba(29,27,26,0.9));
}

body.offline-copy.theme-dark .settings-panel > .settings-content {
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.36);
}

@media (max-width: 760px) {
  body.offline-copy .section-tabs {
    gap: 7px;
  }

  body.offline-copy .section-tab {
    padding: 0 13px;
    font-size: 13px;
  }

  body.offline-copy .settings-panel[open] > .settings-content,
  body.offline-copy .settings-panel > .settings-content {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    top: 112px !important;
    width: auto !important;
    max-height: calc(100vh - 128px);
    transform: none !important;
  }

  body.offline-copy.shelf-list-open .content-grid,
  body.offline-copy.anime-guide-open .content-grid {
    width: min(100% - 22px, 1120px);
  }

  body.offline-copy.shelf-list-open .chapter-list {
    grid-template-columns: 1fr;
  }

  body.offline-copy.anime-guide-open .reader-header,
  body.offline-copy.anime-guide-open .guide-season-head,
  body.offline-copy.anime-guide-open .guide-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  body.offline-copy.anime-guide-open .guide-row {
    gap: 9px;
  }
}
