/* ============ tokens ============ */
:root {
  --bg: #f6f1e8;
  --surface: #fffdf9;
  --surface-2: #efe8db;
  --ink: #1d1a16;
  --ink-2: #4b453d;
  --muted: #6f675c;
  --line: #e2d9c9;
  --accent: #d9442b;
  --accent-ink: #ffffff;
  --accent-soft: #fbe3dc;
  --ok: #2f7d4f;
  --ok-soft: #dcf0e2;
  --sched: #2d5fa8;
  --sched-soft: #dde8f8;
  --danger: #b4232c;
  --shadow: 0 1px 2px rgba(40, 30, 20, .06), 0 8px 24px -12px rgba(40, 30, 20, .18);
  --radius: 14px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Bricolage Grotesque", Inter, system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(.22, .8, .24, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141311;
    --surface: #1d1b18;
    --surface-2: #26231f;
    --ink: #f3eee6;
    --ink-2: #d2cabd;
    --muted: #a39a8c;
    --line: #34302a;
    --accent: #ff6b4f;
    --accent-ink: #1a0d09;
    --accent-soft: #3d1f18;
    --ok: #6fd093;
    --ok-soft: #1c3526;
    --sched: #8cb4ff;
    --sched-soft: #1d2a40;
    --danger: #ff7b7b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -12px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

/* ============ base ============ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased; min-height: 100vh;
  display: flex; flex-direction: column;
}
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
a { color: inherit; }
p { margin: 0 0 1em; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.meta { color: var(--muted); font-size: .85rem; }
.small { font-size: .85rem; }
.hint { color: var(--muted); font-size: .85rem; margin: .5em 0; }
.center { text-align: center; justify-content: center; }
.row { display: flex; align-items: center; }
.row.gap { gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }

main { padding: 0 var(--gutter) 64px; max-width: 1240px; width: 100%; flex: 1 0 auto; margin: 0 auto; outline: none; }
main.page-enter { animation: page-in .35s var(--ease); }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } }

.boot { display: grid; place-items: center; min-height: 50vh; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 24px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ buttons & forms ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  font-weight: 600; text-decoration: none; white-space: nowrap; background: var(--surface-2);
  transition: transform .15s var(--ease), background .2s, box-shadow .2s, opacity .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px -8px var(--accent); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.outline { background: transparent; border-color: var(--ink); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.sm { padding: 6px 12px; font-size: .85rem; }
.btn.lg { padding: 12px 22px; font-size: 1rem; }
.btn.block { width: 100%; }
.link { background: none; border: 0; padding: 0; cursor: pointer; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.link.danger { color: var(--danger); }

.ricon {
  display: inline-grid; place-items: center; position: relative; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: transparent; cursor: pointer; color: inherit; text-decoration: none; flex: none;
  transition: background .2s, transform .15s;
}
.ricon:hover { background: rgba(127, 127, 127, .18); }
.ricon:active { transform: scale(.92); }
.ricon:disabled { opacity: .35; pointer-events: none; }
.ricon.sm { width: 32px; height: 32px; }
.ricon.danger:hover { color: var(--danger); }

.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 500; font-size: .92rem; }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]), select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; }
label.check { display: flex !important; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
.form-error { color: var(--danger); min-height: 1.2em; margin: 0; font-size: .9rem; }

.segmented { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented > * {
  border: 0; background: none; padding: 6px 14px; border-radius: 999px; cursor: pointer; text-decoration: none;
  font-size: .88rem; font-weight: 600; color: var(--muted); transition: background .2s, color .2s;
}
.segmented > .on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.segmented > :disabled { opacity: .45; cursor: default; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow); }
.card-title { font-size: 1.1rem; margin-bottom: 12px; }
.card-title.inline { display: inline; }
details.card > summary { cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: '▾'; float: right; color: var(--muted); transition: transform .2s; }
details.card[open] > summary::after { transform: rotate(180deg); }
details.card[open] > summary { margin-bottom: 16px; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.sched { background: var(--sched-soft); color: var(--sched); }
.pill.draft { background: var(--surface-2); color: var(--muted); }
.pill.warn { background: #ffcf5a; color: #3b2a00; }
.badge { font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }

/* toasts & dialogs */
#toasts { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 1000; display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); animation: toast-in .35s var(--ease); font-weight: 500; }
.toast-success { background: var(--ok); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }
.toast.leaving { animation: toast-out .3s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }
.dialog { border: 0; border-radius: 18px; padding: 24px; background: var(--surface); color: var(--ink); width: min(92vw, 420px); box-shadow: 0 30px 60px -20px rgba(0,0,0,.5); }
.dialog::backdrop, .panel-editor::backdrop { background: rgba(10, 8, 6, .55); backdrop-filter: blur(3px); }
.dialog[open] { animation: pop .25s var(--ease); }
@keyframes pop { from { opacity: 0; transform: scale(.95); } }

/* ============ header ============ */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
@supports not (background: color-mix(in srgb, red, blue)) { .site-header { background: var(--bg); } }
.header-inner { max-width: 1240px; margin: 0 auto; padding: 10px var(--gutter); display: flex; align-items: center; gap: 20px; }
.logo { display: flex; align-items: center; font-family: var(--display); font-weight: 800; font-size: 1.35rem; text-decoration: none; letter-spacing: -.02em; }
.logo-mark { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 7px; background: var(--accent); color: var(--accent-ink); border-radius: 8px; margin-right: 3px; transform: rotate(-6deg); transition: transform .3s var(--ease); }
.logo:hover .logo-mark { transform: rotate(4deg) scale(1.06); }
.main-nav { display: flex; gap: 4px; }
.main-nav a { text-decoration: none; padding: 7px 12px; border-radius: 999px; font-weight: 600; color: var(--muted); transition: color .2s, background .2s; }
.main-nav a:hover { color: var(--ink); }
.main-nav a.active { color: var(--ink); background: var(--surface-2); }
.search { flex: 1; max-width: 320px; margin-left: auto; }
.search input { border-radius: 999px !important; padding: 8px 14px !important; background: var(--surface-2) !important; border-color: transparent !important; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; cursor: pointer; border-radius: 50%; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu .menu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; min-width: 220px; display: grid; animation: pop .2s var(--ease); }
.user-menu .menu a, .user-menu .menu button { text-align: left; padding: 9px 12px; border-radius: 8px; text-decoration: none; background: none; border: 0; cursor: pointer; }
.user-menu .menu a:hover, .user-menu .menu button:hover { background: var(--surface-2); }
.menu-head { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: grid; }

@media (max-width: 760px) {
  .header-inner { flex-wrap: wrap; gap: 8px 12px; }
  .main-nav { order: 3; width: 100%; overflow-x: auto; margin: 0 -6px; }
  .search { display: none; }
  .header-actions { margin-left: auto; }
}
.page-search { max-width: 420px; margin-bottom: 18px; }
.page-search input { border-radius: 999px !important; }

/* avatars & covers */
.avatar { border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center; }
.avatar.sm { width: 32px; height: 32px; font-size: .9rem; }
.avatar.lg { width: 64px; height: 64px; font-size: 1.6rem; }
.avatar.xl { width: 96px; height: 96px; font-size: 2.4rem; }
.avatar.placeholder { background: var(--accent-soft); color: var(--accent); font-family: var(--display); font-weight: 800; }
.cover { width: 100%; aspect-ratio: 5 / 7; object-fit: cover; border-radius: 10px; display: block; background: var(--surface-2); }
.cover.placeholder { display: grid; place-items: center; font-family: var(--display); font-size: 3rem; font-weight: 800; color: var(--accent); background: linear-gradient(135deg, var(--accent-soft), var(--surface-2)); }
.cover.thumb { width: 56px; flex: none; border-radius: 8px; }
.cover.thumb.placeholder { font-size: 1.4rem; }

/* ============ home ============ */
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; padding: clamp(28px, 6vw, 72px) 0 24px; }
.hero h1 { font-size: clamp(2.3rem, 6vw, 4.2rem); line-height: 1.02; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { font-size: 1.1rem; color: var(--ink-2); max-width: 46ch; }
.hero-art { position: relative; height: 360px; }
.hero-cover { position: absolute; width: 46%; box-shadow: 0 30px 50px -24px rgba(0,0,0,.45); border-radius: 12px; animation: float 6s ease-in-out infinite; }
.hero-cover.c0 { left: 26%; top: 0; z-index: 2; transform: rotate(-2deg); }
.hero-cover.c1 { left: 0; top: 50px; transform: rotate(-9deg); animation-delay: -2s; }
.hero-cover.c2 { right: 0; top: 60px; transform: rotate(8deg); animation-delay: -4s; }
@keyframes float { 50% { translate: 0 -10px; } }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; } .hero-art { display: none; } }

.section { margin-top: 36px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.section-head h1, .section-head h2 { margin: 0; }
.section-head > a { color: var(--accent); font-weight: 600; text-decoration: none; }
.section-head.tight { margin-bottom: 12px; }
.empty { padding: 24px 0; }

.series-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 22px 18px; }
@media (max-width: 480px) { .series-grid { grid-template-columns: repeat(2, 1fr); gap: 18px 12px; } }
.series-card { text-decoration: none; display: grid; gap: 10px; }
.series-card .cover { transition: transform .35s var(--ease), box-shadow .35s; box-shadow: var(--shadow); }
.series-card:hover .cover { transform: translateY(-4px) rotate(-.6deg); box-shadow: 0 18px 30px -16px rgba(0,0,0,.4); }
.series-card-body { display: grid; gap: 2px; }
.series-card h3 { margin: 0; font-size: 1rem; }

.update-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.update { display: flex; gap: 12px; align-items: center; text-decoration: none; padding: 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); transition: transform .2s var(--ease), border-color .2s; }
.update:hover { transform: translateY(-2px); border-color: var(--accent); }
.update > div { display: grid; min-width: 0; }
.update strong, .update span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* series page */
.series-hero { display: grid; grid-template-columns: 240px 1fr; gap: 36px; padding-top: 32px; align-items: start; }
.series-cover .cover { box-shadow: 0 30px 50px -24px rgba(0,0,0,.45); }
.series-info .description { white-space: pre-line; color: var(--ink-2); max-width: 70ch; margin-top: 14px; }
.author-chip { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--surface-2); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag { font-size: .8rem; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--muted); }
.tag:hover { border-color: var(--accent); color: var(--accent); }
.stats { display: flex; gap: 22px; flex-wrap: wrap; margin: 4px 0 18px; color: var(--muted); }
.stats strong { color: var(--ink); font-size: 1.15rem; font-family: var(--display); }
.next-release { margin-top: 14px; color: var(--sched); font-weight: 500; display: flex; gap: 6px; align-items: center; }
@media (max-width: 680px) {
  .series-hero { grid-template-columns: 1fr; gap: 20px; }
  .series-cover { max-width: 200px; }
}
.chapter-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.chapter-list a { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; transition: transform .2s var(--ease), border-color .2s; }
.chapter-list a:hover { transform: translateX(4px); border-color: var(--accent); }
.chapter-list a.read { opacity: .7; }
.ch-num { font-family: var(--display); font-weight: 800; font-size: 1.3rem; color: var(--accent); min-width: 2.2ch; }
.ch-title { flex: 1; font-weight: 600; }

/* authors */
.author-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.author-card { display: flex; gap: 16px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; transition: transform .2s var(--ease), border-color .2s; }
.author-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.author-card h3 { margin: 0; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 6px 0 0; }
.profile-hero { display: flex; gap: 24px; align-items: center; padding-top: 36px; flex-wrap: wrap; }
.profile-hero .description { margin-top: 10px; white-space: pre-line; max-width: 65ch; }

/* auth / settings */
.auth-card { max-width: 420px; margin: 48px auto; background: var(--surface); padding: 32px; border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.narrow { max-width: 620px; margin: 32px auto; }
.narrow .card .row { margin-bottom: 18px; }
.empty-state { text-align: center; padding: 72px 16px; display: grid; justify-items: center; gap: 8px; }
.empty-state.small { padding: 36px 16px; }
.empty-state .big { font-family: var(--display); font-size: 4rem; font-weight: 800; color: var(--accent); }

/* creator links */
.profile-links { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.profile-links a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; font-weight: 600; font-size: .9rem; transition: border-color .2s, color .2s, transform .2s var(--ease); }
.profile-links a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.links-editor { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px 16px; margin: 0; display: grid; gap: 8px; min-width: 0; }
.links-editor legend { font-weight: 600; padding: 0 6px; }
.links-editor .hint { margin: 0; }
.link-rows { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.link-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.links-editor > .btn { justify-self: start; }
@media (max-width: 520px) {
  .link-row { grid-template-columns: minmax(0, 1fr) auto; }
  .link-row [name="linkLabel"] { grid-row: 2; }
}

/* site colours (settings) */
.card-title .icon { color: var(--accent); }
.small-title { font-size: .95rem; margin: 20px 0 10px; }
.theme-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.theme-preset { display: grid; gap: 6px; justify-items: center; padding: 8px; border-radius: 12px; border: 2px solid transparent; background: none; cursor: pointer; font-size: .82rem; font-weight: 600; color: inherit; }
.theme-preset:hover { background: var(--surface-2); }
.theme-preset.on { border-color: var(--accent); }
.theme-sample { position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: 8px; display: grid; place-items: center; border: 1px solid var(--line); overflow: hidden; }
.theme-sample span { padding: 4px 10px; border-radius: 6px; border: 1px solid; font-family: var(--display); font-weight: 800; }
.theme-sample i { position: absolute; right: 8px; bottom: 8px; width: 14px; height: 14px; border-radius: 50%; }
.theme-sample.system { background: linear-gradient(135deg, #f6f1e8 50%, #141311 50%); color: #888; }
.theme-sample.system span { background: #fffdf9; color: #1d1a16; border-color: #e2d9c9; }
.theme-sample.system i { background: linear-gradient(135deg, #d9442b 50%, #ff6b4f 50%); }
.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; margin-bottom: 16px; }
.color-field { display: grid !important; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px !important; padding: 6px 8px; border-radius: 10px; cursor: pointer; }
.color-field:hover { background: var(--surface-2); }
.color-field input[type="color"] { width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: none; cursor: pointer; overflow: hidden; }
.color-field input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-field input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.color-field input[type="color"]::-moz-color-swatch { border: 0; border-radius: 50%; }
.color-field code { font-size: .78rem; color: var(--muted); }

/* languages */
.lang-tags { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.lang-tag { display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .04em; padding: 1px 6px; border-radius: 5px; background: var(--surface-2); color: var(--muted); text-decoration: none; vertical-align: middle; }
.series-lang { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; color: var(--ink-2); margin: 0 0 12px; }
.filters .page-search { margin-bottom: 0; flex: 1; min-width: 200px; }
.version-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; }
.version-list li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.version-list a { font-weight: 600; }
.inline-form select, select.lang-select { width: auto; }
.anno-count { display: block; margin: 0 0 2px; }

/* reports */
.admin-quote { margin: 8px 0 0; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 8px 8px 0; white-space: pre-line; overflow-wrap: anywhere; }
.admin-quote.deleted { border-left-color: var(--muted); color: var(--muted); }

/* annotation editor (shares the panel editor layout) */
.anno-editor .pe-side label { display: grid; gap: 6px; font-size: .85rem; font-weight: 500; }
.anno-editor textarea, .anno-editor select { background: #26231f; border-color: #3a3631; color: #f3eee6; }
.anno-editor .ae-list { flex: 0 1 auto; max-height: 30vh; overflow: auto; }
.anno-editor .pe-pick { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; color: inherit; }
.ae-form { display: grid; gap: 10px; }
.ae-form .segmented { flex-wrap: nowrap; justify-self: start; }
.ae-form .segmented > * { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.ae-form .btn.ghost { color: #f2ede4; border-color: #3a3631; justify-self: start; }
.ae-row { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.ae-row select { grid-column: 1; }
.ae-row textarea { grid-column: 1; }
.ae-row .ricon { grid-column: 2; grid-row: 1; }
.pe-box.ae-translation { border-color: #ff6b4f; }
.pe-box.ae-note { border-color: #ffd34f; background: rgba(255, 211, 79, .12); }
.pe-box .pe-num .icon { width: 14px; height: 14px; }

/* contact & legal */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.legal { line-height: 1.65; }
.legal h2 { font-size: 1.15rem; margin-top: 1.8em; }
.legal ul { padding-left: 1.2em; }
.legal li { margin-bottom: .5em; }
.legal a { color: var(--accent); }
mark.todo { background: #ffcf5a; color: #3b2a00; padding: 0 4px; border-radius: 4px; }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.footer-inner { max-width: 1240px; margin: 0 auto; padding: 20px var(--gutter); display: flex; gap: 12px 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: .9rem; }
.footer-inner nav { display: flex; gap: 6px 20px; flex-wrap: wrap; }
.footer-inner a { color: var(--muted); text-decoration: none; }
.footer-inner a:hover { color: var(--accent); }
body.reading .site-footer { display: none; }

/* ============ admin ============ */
.admin .kpi { text-decoration: none; transition: border-color .2s, transform .2s var(--ease); }
.admin .kpi:hover { border-color: var(--accent); transform: translateY(-2px); }
.admin .kpi.attention { border-color: var(--sched); }
.admin .kpi.attention strong { color: var(--sched); }
.admin-search { margin: 0; flex: 1; min-width: 200px; }
.segmented.sub { margin-bottom: 14px; }
.count-dot { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--sched); color: #fff; font-size: .7rem; }
.admin-list { list-style: none; padding: 0; margin: 0; display: grid; }
.admin-item { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.admin-item:last-child { border-bottom: 0; }
.admin-item > .grow { display: grid; gap: 2px; min-width: 200px; }
.admin-item a { text-decoration: none; }
.admin-item a:hover { color: var(--accent); }
.admin-item.banned > .avatar, .admin-item.banned > .grow { opacity: .6; }
.admin-item .cover.thumb { width: 44px; }
.admin-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.admin-body { margin: 6px 0 0; white-space: pre-line; overflow-wrap: anywhere; color: var(--ink-2); }
.admin-chapters { flex-basis: 100%; padding-left: 56px; }
.admin-sublist { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.admin-sublist li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); }
.pill.banned { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
@media (max-width: 600px) {
  .admin-actions { width: 100%; justify-content: flex-start; }
  .admin-chapters { padding-left: 0; }
}

/* ============ studio ============ */
.studio { padding-top: 28px; }
.crumbs { display: flex; gap: 8px; color: var(--muted); font-size: .9rem; margin-bottom: 10px; flex-wrap: wrap; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.filters select { width: auto; min-width: 180px; border-radius: 999px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 2px; box-shadow: var(--shadow); }
.kpi-label { color: var(--muted); font-size: .85rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi strong { font-family: var(--display); font-size: 2rem; font-weight: 800; line-height: 1.1; }
.kpi-sub { font-size: .78rem; color: var(--muted); }
.kpi-sub.up { color: var(--ok); }
.kpi-sub.down { color: var(--danger); }
.studio-cols { display: grid; grid-template-columns: 1.7fr 1fr; gap: 20px; }
.studio-cols > .card { min-width: 0; }
@media (max-width: 960px) { .studio-cols { grid-template-columns: 1fr; } }

.chart { position: relative; }
.chart svg { display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .bar { fill: var(--accent); transition: opacity .15s; }
.chart svg:hover .bar:not(.on) { opacity: .55; }
.chart .hit { fill: transparent; cursor: crosshair; }
.tooltip { position: absolute; transform: translate(-50%, -100%); background: var(--ink); color: var(--bg); padding: 8px 10px; border-radius: 8px; font-size: .8rem; pointer-events: none; display: grid; white-space: nowrap; box-shadow: var(--shadow); }

.table-wrap { overflow-x: auto; margin: 0 -4px; }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.data th { text-align: left; color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data td a { text-decoration: none; font-weight: 600; }
table.data td:first-child { min-width: 190px; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
.recent-comments { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.recent-comments p { margin: 0 0 2px; }

.studio-series { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.studio-series-card { display: flex; gap: 14px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; transition: transform .2s var(--ease), border-color .2s; }
.studio-series-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.studio-series-card .cover.thumb { width: 72px; }
.studio-series-card > div { display: grid; align-content: center; gap: 2px; }
.studio-series-card h3 { margin: 0; }

.series-form { grid-template-columns: 180px 1fr; gap: 24px; align-items: start; }
.series-form .form-fields { display: grid; gap: 14px; }
.cover-picker { display: grid !important; justify-items: center; gap: 10px; cursor: pointer; }
.cover-preview { width: 100%; display: block; }
@media (max-width: 600px) { .series-form { grid-template-columns: 1fr; } .cover-picker { max-width: 180px; } }

.inline-form input { width: auto; }
.inline-form .num-input { width: 80px !important; }
.studio-chapters { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.studio-chapter { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 12px; text-decoration: none; transition: background .2s; }
.studio-chapter:hover { background: var(--surface-2); }
.studio-chapter img, .thumb-empty { width: 44px; height: 60px; object-fit: cover; border-radius: 6px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); flex: none; }
.studio-chapter > div { display: grid; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }

.editor-top { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 820px) { .editor-top { grid-template-columns: 1fr; } }
.meta-card .row { margin-bottom: 12px; align-items: end; }
.meta-card label { display: grid; gap: 6px; font-weight: 500; font-size: .9rem; }
.num-label { width: 90px; }
.publish-card p { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.schedule { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); }
.schedule label { display: grid; gap: 6px; font-size: .9rem; font-weight: 500; flex: 1; min-width: 200px; }

.dropzone { display: grid; justify-items: center; gap: 6px; padding: 28px 16px; border: 2px dashed var(--line); border-radius: var(--radius); text-align: center; cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.dropzone .icon { width: 32px; height: 32px; color: var(--accent); }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.over { transform: scale(1.01); }
.upload-queue { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 6px; }
.upload-queue li { display: grid; grid-template-columns: minmax(0, 1fr) 120px minmax(110px, auto); gap: 12px; align-items: center; font-size: .85rem; animation: page-in .3s var(--ease); }
.upload-queue .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-queue .bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.upload-queue .bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.upload-queue .done .bar span { background: var(--ok); width: 100%; }
.upload-queue .failed .state { color: var(--danger); }
.upload-queue .state { color: var(--muted); }

.page-grid { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.page-card { display: grid; gap: 6px; cursor: grab; transition: opacity .2s, transform .2s; animation: page-in .3s var(--ease); }
.page-card.dragging { opacity: .4; transform: scale(.96); }
.page-thumb { position: relative; border-radius: 10px; overflow: hidden; background: var(--surface-2); aspect-ratio: 5 / 7; border: 1px solid var(--line); }
.page-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.page-no { position: absolute; top: 6px; left: 6px; background: var(--ink); color: var(--bg); font-weight: 700; font-size: .8rem; min-width: 24px; height: 24px; border-radius: 12px; display: grid; place-items: center; padding: 0 6px; }
.panel-badge { position: absolute; left: 6px; right: 6px; bottom: 6px; background: rgba(20, 16, 12, .78); color: #fff; font-size: .72rem; padding: 4px 8px; border-radius: 8px; display: flex; gap: 5px; align-items: center; backdrop-filter: blur(4px); }
.panel-badge.off { background: rgba(90, 90, 90, .7); }
.page-actions { display: flex; align-items: center; gap: 2px; }
.page-actions .btn { flex: 1; padding-inline: 8px; }

/* ============ panel editor ============ */
.panel-editor { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #121110; color: #f2ede4; display: grid; grid-template-rows: auto 1fr; }
.panel-editor:not([open]) { display: none; }
.panel-editor[open] { animation: pop .25s var(--ease); }
.pe-head { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 60px 10px 16px; border-bottom: 1px solid #2c2925; flex-wrap: wrap; }
.pe-head > .ricon { position: absolute; right: 10px; top: 8px; }
.pe-head h3 { margin: 0; display: flex; gap: 8px; align-items: center; }
.pe-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.pe-tools .btn { color: #f2ede4; border-color: #3a3631; }
.pe-tools .btn:hover { background: #2a2723; }
.pe-body { display: grid; grid-template-columns: 1fr 300px; min-height: 0; }
.pe-wrap { display: grid; place-items: center; min-height: 0; overflow: hidden; padding: 8px; }
.pe-canvas { position: relative; user-select: none; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.pe-canvas img { width: 100%; height: 100%; display: block; }
.pe-overlay { position: absolute; inset: 0; cursor: crosshair; touch-action: none; }
.pe-overlay.disabled .pe-box { opacity: .35; }
.pe-box { position: absolute; border: 2px solid #ff6b4f; background: rgba(255, 107, 79, .12); cursor: move; border-radius: 3px; }
.pe-box.sel { border-color: #ffd34f; background: rgba(255, 211, 79, .18); box-shadow: 0 0 0 9999px rgba(0, 0, 0, .25); z-index: 2; }
.pe-num { position: absolute; top: -1px; left: -1px; background: #ff6b4f; color: #1a0d09; font-weight: 800; font-size: 12px; min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 3px 0 6px 0; pointer-events: none; }
.pe-box.sel .pe-num { background: #ffd34f; }
.pe-h { position: absolute; width: 16px; height: 16px; background: #fff; border: 2px solid #ff6b4f; border-radius: 50%; }
.pe-box.sel .pe-h { border-color: #ffd34f; }
.pe-h.nw { left: -9px; top: -9px; cursor: nwse-resize; }
.pe-h.ne { right: -9px; top: -9px; cursor: nesw-resize; }
.pe-h.sw { left: -9px; bottom: -9px; cursor: nesw-resize; }
.pe-h.se { right: -9px; bottom: -9px; cursor: nwse-resize; }
.pe-side { border-left: 1px solid #2c2925; padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.pe-side .hint { color: #a39a8c; }
.pe-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; flex: 1; align-content: start; }
.pe-list li { display: flex; align-items: center; gap: 2px; border-radius: 8px; padding: 2px 4px; }
.pe-list li.sel { background: #2e2a24; }
.pe-pick { flex: 1; text-align: left; background: none; border: 0; cursor: pointer; padding: 6px; font-weight: 600; }
.pe-actions .btn.ghost { color: #f2ede4; border-color: #3a3631; }
/* Panel outlines made of dots (panel editor) */
.pe-canvas img.pe-mask { position: absolute; inset: 0; pointer-events: none; }
.pe-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pe-poly { fill: rgba(255, 107, 79, .12); stroke: #ff6b4f; stroke-width: 2; stroke-linejoin: round; cursor: move; }
.pe-poly.sel { fill: rgba(255, 211, 79, .16); stroke: #ffd34f; }
.pe-overlay.disabled .pe-poly, .pe-overlay.disabled .pe-label { opacity: .35; }
.pe-dim { fill: rgba(0, 0, 0, .3); pointer-events: none; }
.pe-ghost { fill: rgba(56, 189, 248, .06); stroke: #38bdf8; stroke-width: 2; stroke-dasharray: 7 5; cursor: copy; }
.pe-cut { stroke: #38bdf8; stroke-width: 4; stroke-linecap: round; opacity: .85; pointer-events: none; }
.pe-draft { fill: rgba(255, 211, 79, .1); stroke: #ffd34f; stroke-width: 2; stroke-dasharray: 5 4; pointer-events: none; }
.pe-overlay.dots-tool, .pe-overlay.dots-tool .pe-poly, .pe-overlay.dots-tool .pe-ghost { cursor: crosshair; }
.pe-dots { position: absolute; inset: 0; pointer-events: none; }
.pe-dots > span { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; }
.pe-pt { width: 7px; height: 7px; background: #ff6b4f; box-shadow: 0 0 0 1.5px #1a0d09; }
.pe-gpt { width: 6px; height: 6px; background: #38bdf8; box-shadow: 0 0 0 1.5px #06202c; }
.pe-dots > .pe-label { min-width: 26px; height: 26px; padding: 0 6px; display: grid; place-items: center; background: #ff6b4f; color: #1a0d09; font-weight: 800; font-size: 13px; border-radius: 13px; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.pe-label.sel { background: #ffd34f; }
.pe-dot { width: 16px; height: 16px; background: #fff; border: 3px solid #ffd34f; pointer-events: auto; cursor: grab; box-shadow: 0 1px 4px rgba(0,0,0,.5); touch-action: none; }
.pe-dot::after, .pe-mid::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; }
.pe-dot:hover { transform: translate(-50%, -50%) scale(1.2); }
.pe-dot.on { background: #ffd34f; border-color: #fff; }
.pe-dot.draft { pointer-events: none; width: 12px; height: 12px; border-width: 2px; }
.pe-dot.draft.first { width: 18px; height: 18px; background: #ffd34f; }
.pe-mid { width: 14px; height: 14px; background: rgba(18, 17, 16, .75); border: 1.5px dashed #ffd34f; pointer-events: auto; cursor: copy; }
.pe-mid::before { content: "+"; position: absolute; inset: 0; display: grid; place-items: center; color: #ffd34f; font: 700 12px/1 sans-serif; }
.pe-mid:hover { background: #ffd34f; }
.pe-mid:hover::before { color: #1a0d09; }
.pe-seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #3a3631; border-radius: 10px; padding: 3px; gap: 3px; }
.pe-seg button { background: none; border: 0; color: #c9c0b2; border-radius: 7px; padding: 7px 6px; font: inherit; font-weight: 600; font-size: .85rem; cursor: pointer; }
.pe-seg button.on { background: #ffd34f; color: #1a0d09; }
.pe-side kbd { font: 600 .78em/1 inherit; padding: 2px 5px; border: 1px solid #4a453e; border-radius: 4px; background: #24211d; }
.pe-selbox:empty { display: none; }
.pe-selbox { display: grid; gap: 8px; padding: 10px; border-radius: 10px; background: #1e1c19; border: 1px solid #3a3631; }
.pe-selbox .btn, .pe-detect .btn { color: #f2ede4; border-color: #3a3631; }
.pe-side .muted { color: #a39a8c; font-weight: 400; }
.pe-detect { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid #2c2925; }
.pe-detect h4 { margin: 0; font-size: .9rem; }
.pe-detect .hint { margin: 0; }
.pe-detect .btn { justify-self: start; }
@media (max-width: 760px) {
  .pe-body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .pe-side { border-left: 0; border-top: 1px solid #2c2925; max-height: 38dvh; }
  .pe-head h3 { font-size: .95rem; width: 100%; }
  .pe-tools { margin-left: 0; }
}

/* ============ reader ============ */
body.reading { overflow: hidden; overscroll-behavior: none; }
body.reading .site-header { display: none; }
body.reading main { padding: 0; max-width: none; animation: none; }

.reader {
  --reader-bg: #1c1c21;
  --bar-bg: rgba(18, 17, 16, .82);
  position: fixed; inset: 0; height: 100vh; height: 100dvh; background: var(--reader-bg); color: #f3eee6;
  overflow: hidden; transition: background-color .4s ease; user-select: none; -webkit-user-select: none;
}
.stage { position: absolute; inset: 0; overflow: hidden; outline: none; touch-action: pan-y pinch-zoom; }
.stage * { touch-action: pan-y pinch-zoom; }
.layer { position: absolute; inset: 0; will-change: transform, opacity; }
.layer.loading::after { content: ''; position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px; border-radius: 50%; border: 3px solid rgba(255,255,255,.2); border-top-color: #fff; animation: spin .8s linear infinite; }
.bg-light .layer.loading::after { border-color: rgba(0,0,0,.15); border-top-color: #333; }

.scroller { position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
/* The frame is sized from JS for each fit mode; the image and its overlays fill it. */
.scroller .frame { position: relative; margin: auto; }
.scroller .frame img { display: block; width: 100%; height: 100%; max-width: none; -webkit-user-drag: none; }
.scroller.fit-width .frame img { height: auto; }
.scroller.fit-contain { display: grid; place-items: center; overflow: hidden; }
.scroller.animate { transition: top .35s var(--ease), bottom .35s var(--ease); }
.scroller.animate .frame { transition: width .35s var(--ease), height .35s var(--ease); }
.scroller.fit-height { display: flex; }
.scroller.fit-height .frame { flex: none; }

.panel-layer { overflow: hidden; }
.camera { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; --inv: 1; }
.camera img { display: block; width: 100%; height: 100%; max-width: none; -webkit-user-drag: none; }
.spotlight { position: absolute; left: 0; top: 0; border-radius: 3px; box-shadow: 0 0 0 200vmax var(--reader-bg); pointer-events: none; transform-origin: 0 0; }
.spotlight svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.spotlight path { fill: var(--reader-bg); }
.panel-layer.glide .camera { transition: transform .62s cubic-bezier(.65, 0, .35, 1); }

/* overlays: hover translations, creator's notes, comment areas */
.anno-layer { position: absolute; inset: 0; pointer-events: none; }
.anno { position: absolute; pointer-events: auto; border-radius: calc(6px * var(--inv, 1)); transition: background-color .2s, box-shadow .2s; }
.anno.tr { cursor: help; outline: calc(1.5px * var(--inv, 1)) dashed rgba(255, 107, 79, .45); outline-offset: calc(-1px * var(--inv, 1)); }
.anno.tr:hover, .anno.tr.active { background: rgba(255, 107, 79, .14); outline-color: #ff6b4f; outline-style: solid; }
.anno.note, .anno.cgroup { cursor: pointer; }
.anno.note:hover, .anno.note.active { background: rgba(255, 211, 79, .16); box-shadow: inset 0 0 0 calc(2px * var(--inv, 1)) #ffd34f; }
.anno.cgroup:hover, .anno.cgroup.active { background: rgba(140, 180, 255, .16); box-shadow: inset 0 0 0 calc(2px * var(--inv, 1)) #8cb4ff; }
.anno-mark {
  position: absolute; top: 0; right: 0; transform: translate(40%, -40%) scale(var(--inv, 1)); transform-origin: 60% 40%;
  display: inline-flex; align-items: center; gap: 3px; min-width: 28px; height: 28px; padding: 0 7px; border-radius: 14px;
  font: 700 12px/1 var(--font); box-shadow: 0 3px 10px rgba(0, 0, 0, .35); justify-content: center;
}
.anno.note .anno-mark { background: #ffd34f; color: #2b2100; }
.anno.cgroup .anno-mark { background: #8cb4ff; color: #0b1020; }
.anno.pending { border: calc(2px * var(--inv, 1)) dashed #8cb4ff; background: rgba(140, 180, 255, .18); pointer-events: none; }
.picking .anno-layer { pointer-events: auto; cursor: crosshair; }
.picking .anno { pointer-events: none; }
.anno-pop {
  position: absolute; z-index: 8; width: min(320px, calc(100% - 16px)); max-height: 50vh; overflow: auto;
  background: #fffdf9; color: #1d1a16; border-radius: 12px; padding: 12px 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
  font-size: .95rem; line-height: 1.45; animation: pop .18s var(--ease); user-select: text; -webkit-user-select: text;
}
.anno-pop p { margin: 4px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.pop-head { display: flex; gap: 6px; align-items: center; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #6f675c; }
.pop-orig { color: #6f675c; font-style: italic; font-size: .85rem; }
.pop-more { display: block; margin-top: 6px; font-size: .75rem; color: #6f675c; }
.pop-comments { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 10px; }
.pop-comments span { color: #6f675c; font-size: .8rem; }
.anno-pop .link { color: #b4381f; }
.pick-banner {
  position: absolute; z-index: 9; left: 50%; top: max(12px, env(safe-area-inset-top)); transform: translateX(-50%);
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: center; width: max-content; max-width: calc(100% - 24px);
  background: #2d5fa8; color: #fff; padding: 8px 10px 8px 16px; border-radius: 999px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); font-weight: 600;
}
.picking .rbar { opacity: 0; pointer-events: none; }
.rlang { display: inline-flex; align-items: center; gap: 4px; padding: 0 4px 0 8px; border-radius: 999px; background: rgba(127, 127, 127, .2); }
.rlang select { background: transparent !important; border: 0 !important; color: inherit; padding: 6px 4px !important; width: auto !important; font-size: .8rem; font-weight: 600; box-shadow: none !important; }
.rlang select option { color: #1d1a16; }
.toggles { display: grid; gap: 8px; }
.sub-setting { display: flex; gap: 8px; align-items: center; margin-left: 26px; font-size: .85rem; color: #a39a8c; }
.sub-setting select { width: auto; background: #26231f; border-color: #3a3631; color: #f3eee6; padding: 4px 8px; }
.area-chip { display: flex; gap: 8px; align-items: center; margin: 0; font-size: .85rem; color: #8cb4ff; }
.comment-actions { display: flex; gap: 12px; margin-top: 2px; }
.comment-actions .link .icon { width: 1em; height: 1em; }
.panel-layer.glide .spotlight { transition: transform .62s cubic-bezier(.65, 0, .35, 1), width .62s cubic-bezier(.65, 0, .35, 1), height .62s cubic-bezier(.65, 0, .35, 1); }

.rbar { position: absolute; left: 0; right: 0; display: flex; align-items: center; gap: 4px; z-index: 5; padding: 6px max(10px, env(safe-area-inset-left)); background: var(--bar-bg); backdrop-filter: blur(14px) saturate(1.3); transition: transform .35s var(--ease), opacity .35s; color: #f3eee6; }
.rtop { top: 0; padding-top: max(6px, env(safe-area-inset-top)); }
.rbottom { bottom: 0; padding-bottom: max(6px, env(safe-area-inset-bottom)); }
.ui-hidden .rtop { transform: translateY(-100%); opacity: 0; pointer-events: none; }
.ui-hidden .rbottom { transform: translateY(100%); opacity: 0; pointer-events: none; }
.rtitle { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.rtitle a { font-weight: 700; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--display); }
.rtitle span { font-size: .8rem; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ricon .count { position: absolute; top: 2px; right: 0; font-size: .65rem; font-weight: 700; background: var(--accent); color: #fff; border-radius: 8px; padding: 0 5px; line-height: 15px; }
.ricon .count:empty { display: none; }
.progress { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; }
.progress input[type="range"] { flex: 1; accent-color: #ff6b4f; min-width: 60px; }
#page-label { font-size: .8rem; font-variant-numeric: tabular-nums; white-space: nowrap; opacity: .85; min-width: 64px; text-align: center; }
.mode-toggle.on { background: #ff6b4f; color: #1a0d09; }
@media (max-width: 600px) { .hide-sm { display: none; } }

/* end card */
.end-layer { display: grid; place-items: center; padding: 24px; }
.end-card { display: grid; justify-items: center; gap: 14px; text-align: center; max-width: 420px; color: #f3eee6; animation: page-in .5s var(--ease) both; animation-delay: .15s; }
.bg-light .end-card { color: #1d1a16; }
.end-card .eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; opacity: .7; }
.end-card h2 { font-size: 2rem; margin: 0; }
.end-card .muted { color: inherit; opacity: .7; }
.end-card .link { color: inherit; opacity: .8; }
.caught-up { font-family: var(--display); font-weight: 700; font-size: 1.1rem; }
.btn.like { background: rgba(127,127,127,.2); color: inherit; }
.btn.like.on { background: #ff4d6d; color: #fff; }
.btn.like.on .icon { fill: currentColor; }
.btn.outline-light { background: transparent; border-color: currentColor; color: inherit; }

/* sheets */
.sheet { position: absolute; z-index: 10; top: 0; right: 0; bottom: 0; width: min(380px, 100%); background: #1b1a18; color: #f3eee6; box-shadow: -20px 0 40px rgba(0,0,0,.4); transform: translateX(105%); visibility: hidden; transition: transform .4s var(--ease), visibility 0s .4s; display: flex; flex-direction: column; user-select: text; -webkit-user-select: text; }
.sheet.open { transform: none; visibility: visible; transition: transform .4s var(--ease), visibility 0s; }
@media (max-width: 600px) {
  .sheet { top: auto; left: 0; width: 100%; max-height: 78dvh; border-radius: 20px 20px 0 0; transform: translateY(105%); padding-bottom: env(safe-area-inset-bottom); }
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; padding-top: max(14px, env(safe-area-inset-top)); }
.sheet-head h3 { margin: 0; }
.sheet-head .muted { color: #a39a8c; font-weight: 500; }
.sheet-body { padding: 4px 16px 20px; overflow-y: auto; }
.sheet h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: #a39a8c; margin: 18px 0 8px; font-family: var(--font); }
.sheet .hint { color: #a39a8c; }
.segmented.dark { background: #2a2723; }
.segmented.dark > * { color: #b8afa2; }
.segmented.dark > .on { background: #f3eee6; color: #1d1a16; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 38px; height: 38px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); cursor: pointer; position: relative; transition: transform .2s var(--ease); padding: 0; }
.swatch:hover { transform: scale(1.1); }
.swatch.on { outline: 3px solid #ff6b4f; outline-offset: 2px; }
.swatch.custom { background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); overflow: hidden; }
.swatch.custom input { opacity: 0; position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.sheet textarea { background: #26231f; border-color: #3a3631; color: #f3eee6; }
.comment-form { display: grid; gap: 8px; margin-bottom: 16px; }
.check.small { font-size: .85rem; }
.login-hint a { color: #ff6b4f; }
.comments { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.comments li { display: flex; gap: 10px; animation: page-in .3s var(--ease); }
.comments li > div { min-width: 0; }
.comments p { margin: 2px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.comment-meta { display: flex; gap: 8px; align-items: center; font-size: .85rem; flex-wrap: wrap; }
.comment-meta span { color: #a39a8c; }
.page-ref { background: #2e2a24; border: 0; color: #ffb29f; border-radius: 6px; font-size: .75rem; padding: 1px 6px; cursor: pointer; }
.comments .link { color: #a39a8c; }
.no-comments { color: #a39a8c; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
