@font-face { font-family: "Golos Text"; src: url("/fonts/golos-text.ttf") format("truetype"); font-weight: 400 900; font-style: normal; font-display: swap; }
:root {
  color-scheme: dark;
  --bg: #111111;
  --panel: #191919;
  --cream: #c8c8c6;
  --muted: #999997;
  --line: #3e3e3c;
  --accent: #bdbdb9;
  font-family: "Golos Text", system-ui, sans-serif;
  background: var(--bg);
  color: var(--cream);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button, input, textarea, select { font: inherit; color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: .65rem 1.05rem; border: 1px solid var(--line); border-radius: 0;
  background: var(--panel); color: var(--cream); cursor: pointer; text-align: center;
}
button:hover:not(:disabled), .button:hover { border-color: var(--accent); }
button:disabled { opacity: .55; cursor: default; }
.primary { color: #111; font-weight: 650; background: var(--accent); border-color: var(--accent); }
.primary:hover { background: #d0d0cc; color: #111; }
input, textarea, select { border: 1px solid var(--line); border-radius: 0; padding: .65rem; background: var(--bg); min-height: 44px; }
textarea { resize: vertical; }
header {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  border-bottom: 1px solid var(--line); padding: .9rem clamp(1rem, 5vw, 5rem);
}
header nav, header form { display: flex; align-items: center; gap: clamp(.6rem, 2vw, 1.5rem); margin: 0; }
header nav button { padding: .3rem .7rem; min-height: 38px; }
.brand { display: inline-flex; align-items: center; font: 700 1.85rem Georgia, serif; letter-spacing: -.06em; white-space: nowrap; }
.brand svg { width: .86em; height: 1.1em; }
h1, h2 { font-family: "Golos Text", system-ui, sans-serif; line-height: 1.07; margin: .35em 0; overflow-wrap: anywhere; }
h1 { font-size: clamp(2.25rem, 6vw, 5rem); letter-spacing: -.04em; }
h2 { font-size: clamp(1.35rem, 3vw, 2.1rem); }
p { line-height: 1.65; }
.kicker { color: var(--accent); font-size: .74rem; font-weight: 750; letter-spacing: .14em; margin: 0; }
.shell { width: min(100% - 2rem, 1140px); margin: clamp(2rem, 6vw, 5rem) auto; }
.narrow { max-width: 480px; }
.hero { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.2fr); align-items: center; gap: clamp(1.5rem, 6vw, 6rem); }
.poster { display: block; width: 100%; height: auto; object-fit: contain; }
.hero .poster { max-height: 72vh; }
.lead { font-size: clamp(1rem, 2vw, 1.25rem); color: var(--muted); white-space: pre-wrap; }
.word-poster {
  min-height: 350px; display: grid; place-content: center; grid-auto-flow: column; align-items: center;
  background: var(--panel); border: 1px solid var(--line);
  font: 700 clamp(2rem, 5vw, 4rem) Georgia, serif; letter-spacing: -.07em;
}
.word-poster svg { width: .9em; height: 1.2em; }
.section-line { border-top: 1px solid var(--line); margin-top: 3rem; padding-top: 1rem; }
.section-line p, .muted { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.release { max-width: 680px; }
.release .poster { max-width: 380px; max-height: 68vh; margin: 0 auto 1.75rem; }
.release h1 { font-size: clamp(2.1rem, 6vw, 3.7rem); }
.release .actions button, .release .actions a { flex: 1; }
.description { white-space: pre-wrap; margin-top: 1.5rem; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem 1rem; color: var(--muted); }
.chapter-list li { padding: .45rem 0; }
.archive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 1.5rem; margin-top: 2rem; }
.archive-card .poster { aspect-ratio: 2 / 3; background: var(--panel); }
.archive-card h2 { font-size: 1.3rem; }
.gate { max-width: 610px; padding: 2rem 1.5rem; margin: 12vh auto 0; }
.gate .brand { margin-bottom: 3rem; }
.gate h1 { font-size: clamp(2.3rem, 8vw, 4.5rem); }
.gate .actions { margin-top: 1.75rem; }
.stack, .stack label { display: grid; gap: .55rem; }
.stack { gap: 1.05rem; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.admin-list { list-style: none; padding: 0; }
.admin-list li { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.admin-list a { display: flex; justify-content: space-between; gap: 1rem; }
.admin-list span { color: var(--muted); }
.editor { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 1.65fr); gap: 1rem; margin-top: 1.25rem; }
.editor-box { padding: clamp(.8rem, 2.5vw, 1.45rem); border: 1px solid var(--line); border-radius: 0; min-width: 0; }
.editor-box .section-head { gap: .5rem; }
#cover-preview { min-height: 60px; padding: .5rem; border: 1px solid var(--line); }
#cover-preview img { display: block; height: 190px; max-width: 100%; object-fit: contain; margin: auto; }
.upload { position: relative; width: fit-content; }
.upload input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.upload:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 114px), 1fr)); gap: .65rem; margin-top: 1rem; }
.page-card { min-width: 0; border: 1px solid var(--line); padding: .35rem; border-radius: 0; cursor: grab; }
.page-card img { display: block; width: 100%; height: 150px; object-fit: contain; background: #111; }
.page-caption { display: grid; grid-template-columns: 1fr 35px; align-items: center; padding: .25rem 0 0; text-align: center; }
.page-caption span { font: 700 1.5rem Georgia, serif; }
.page-menu { position: relative; }
.page-menu summary { font-size: 1.3rem; cursor: pointer; list-style: none; padding: .3rem; }
.page-menu[open] { grid-column: 1 / -1; display: grid; gap: .3rem; }
.page-menu input, .page-menu button, .page-menu label { width: 100%; padding: .35rem; }
.editor-bottom { margin-top: 1rem; }
.error { color: var(--cream); }
.reader-body { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: #111; }
.reader-bar { display: grid; flex: none; padding: .5rem clamp(.8rem, 4vw, 2rem); background: var(--bg); gap: .4rem 1rem; grid-template-columns: auto 1fr auto; align-items: center; }

.reader-bar a { padding: .3rem .55rem; font-size: 1.3rem; }
.reader-bar progress { grid-column: 2 / 4; width: 100%; height: 4px; accent-color: var(--accent); }
.reader-bar output { white-space: nowrap; }
.reader-toggle { position: absolute; z-index: 1; bottom: .75rem; right: .75rem; opacity: .65; padding: .4rem .65rem; }
.reader-toggle:hover, .reader-toggle:focus { opacity: 1; }
.reading { min-height: 0; overflow: auto; position: relative; flex: 1; width: 100%; scrollbar-color: #555 #111; }
.reading figure, .reading section, .reading footer { max-width: 860px; margin: 0 auto; }
.reading figure { margin-bottom: 0; background: var(--panel); }
.reading figure img { display: block; width: 100%; height: auto; cursor: pointer; }
.reading .end-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(8rem, 30%); align-items: center; gap: clamp(1rem, 4vw, 2.5rem); width: min(100% - 2rem, 860px); margin: 4rem auto 1rem; padding: clamp(1rem, 5vw, 3.5rem); border: 1px solid var(--cream); }
.signature { display: inline-block; background: #8f2923; padding: .3rem .6rem; font-size: .8rem; text-transform: uppercase; }
.stamp { display: inline-block; border: 2px solid #f34a3d; color: #f34a3d; padding: .3rem .65rem; transform: rotate(-4deg); font: 800 clamp(1rem, 5vw, 2.2rem) Georgia, serif; overflow-wrap: anywhere; }
.uncle { text-align: center; }
.uncle img { display: block; width: 100%; height: auto; margin: auto; }
.uncle p { margin: .35rem 0 0; font-family: Georgia, serif; }
@media(max-width: 510px) {
  .reading .end-card { grid-template-columns: 1fr; }
  .uncle img { max-width: 150px; }
}
.reader-links { padding: 1rem 1rem 5rem; }
@media(max-width: 640px) {
  header { flex-wrap: wrap; }
  .hero, .editor { grid-template-columns: 1fr; }
  .hero .poster { max-height: 55vh; }
  .word-poster { min-height: 220px; }
  .page-card img { height: 125px; }
}

.draft-card { border: 1px solid var(--line); padding: .85rem; border-radius: 0; }
.draft-card .kicker { margin-top: .65rem; }
.draft-card h3 { margin: .4rem 0; }
.draft-card span, .draft-card time { color: var(--muted); }
.schedule-box { margin-top: 1.25rem; }
.schedule-box summary { cursor: pointer; font-weight: 650; }
.schedule-box .actions { margin-top: .85rem; }
.schedule-box p { margin-bottom: 0; }

.cookie-footer { width: min(100% - 2rem, 1140px); margin: 1.5rem auto; padding-top: .75rem; border-top: 1px solid var(--line); }
.cookie-settings { min-height: 44px; padding: .55rem .75rem; font-size: .875rem; color: var(--muted); background: transparent; }
.cookie-banner {
  position: fixed; z-index: 5; inset: auto 1rem max(1rem, env(safe-area-inset-bottom)) auto;
  width: min(100% - 2rem, 32rem); max-height: calc(100dvh - 2rem); overflow: auto;
  padding: clamp(1rem, 3vw, 1.5rem); border: 1px solid var(--line); border-radius: 0;
  background: var(--panel);
}
.cookie-banner h2 { margin: 0; font-size: 1.45rem; }
.cookie-banner p { margin: .7rem 0; color: var(--muted); font-size: .94rem; }
.cookie-banner .actions { margin-top: 1rem; }
.cookie-banner .actions button { flex: 1 1 9rem; }

.upload-progress {
  position: fixed; z-index: 4; inset: auto 1rem max(1rem, env(safe-area-inset-bottom)) auto;
  width: min(100% - 2rem, 29rem); padding: 1rem; border: 1px solid var(--line);
  border-radius: 0; background: var(--panel);
}
.upload-progress-heading { display: flex; justify-content: space-between; gap: .75rem; margin-bottom: .6rem; }
.upload-progress-heading span { font-variant-numeric: tabular-nums; }
.upload-progress progress { display: block; width: 100%; height: .65rem; accent-color: var(--accent); }

.compression-setting { margin-top: 1rem; }
.compression-setting label { display: flex; align-items: center; gap: .65rem; cursor: pointer; }
.compression-setting input { width: 1.15rem; height: 1.15rem; min-height: 0; accent-color: var(--accent); }
.compression-setting p { margin: .35rem 0 0; }

.image-weight { margin: .45rem 0 0; font-size: .8rem; line-height: 1.35; color: var(--muted); overflow-wrap: anywhere; }

.home-feature > .kicker { grid-column: 1 / -1; margin-bottom: -.5rem; }
.home-feature { row-gap: 1.25rem; }
.home-feature h1 { margin-top: 0; }
.home-archive { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 1.25rem; }
.home-archive .poster { max-height: 24rem; }
.chapter-list { padding: 0; list-style: none; }
.chapter-list li { padding: 0; margin: .5rem 0; }
.chapter-list a { display: flex; justify-content: space-between; align-items: center; min-height: 44px;
  gap: 1rem; padding: .65rem .9rem; border: 1px solid var(--line); border-radius: 0; background: var(--panel); }
.update-label { display: inline-block; color: var(--cream); border: 1px solid var(--line); border-radius: 0; padding: .15rem .45rem; font-size: .8rem; }
.release-update { color: var(--muted); }
@media (max-width: 640px) { .home-archive { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.reader-tools { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: end; gap: .55rem; max-height: 50dvh; overflow: auto; padding: .2rem 0 .5rem; }
.reader-tools form { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; margin: 0; }
.reader-tools > label { display: grid; gap: .25rem; font-size: .85rem; }
.reader-tools button, .reader-tools .button { font-size: .9rem; }
.reader-tools a { padding: .65rem .8rem; }
.reader-tools input { width: 5rem; }
.reader-toggle { font-variant-numeric: tabular-nums; }
.reading[data-spacing=seamless] figure { margin-bottom: 0; }
.reading[data-width=wide] figure { max-width: 1200px; }
.reader-picture { position: relative; }
.reader-picture:not(.without-ratio) img { position: absolute; inset: 0; height: 100%; object-fit: contain; }
.reader-picture img { touch-action: manipulation; }
.reader-picture.without-ratio:has(img[loading=lazy]) { min-height: min(35dvh, 240px); }
.image-failed .reader-picture { min-height: 8rem; }
.image-failed .reader-picture img { visibility: hidden; }
.page-load-error { position: absolute; inset: 0; display: grid; align-content: start; justify-items: center;
  padding: 1rem; text-align: center; background: var(--panel); }
.page-load-error[hidden] { display: none; }
.page-load-error p { margin: 0 0 .5rem; }
.reader-note { padding: .65rem 1rem; border-top: 1px solid var(--line); background: var(--panel); color: var(--muted); }
.reader-note summary { cursor: pointer; color: var(--cream); }
.reader-note p { white-space: pre-wrap; overflow-wrap: anywhere; margin: .5rem 0 0; }
.reader-zoom, .publish-dialog { background: var(--panel); color: var(--cream); border: 1px solid var(--line); border-radius: 0; }
.reader-zoom::backdrop, .publish-dialog::backdrop { background: #000b; }
.reader-zoom { width: min(100% - 1rem, 1250px); height: calc(100% - 1rem); padding: 0; }
.reader-zoom[open] { display: flex; flex-direction: column; }
.reader-zoom form { flex: none; text-align: right; padding: .35rem; }
.zoom-viewport { min-height: 0; flex: 1; overflow: auto; background: #111; }
.zoom-viewport img { display: block; max-width: none; touch-action: manipulation; }

.editor-check { display: flex !important; align-items: center; gap: .65rem; }
.editor-check input { width: 1.15rem; height: 1.15rem; min-height: 0; accent-color: var(--accent); }
.chapter-options { margin-top: .85rem; }
.chapter-options button { justify-self: start; }
.danger { color: var(--cream); }
.page-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); gap: .65rem 1rem; }
.page-slot { position: relative; min-width: 0; padding-right: .55rem; }
.insert-pages { position: absolute; top: 56px; right: -.55rem; width: 36px; min-height: 36px; padding: 0; font-size: 1.1rem; }
.page-menu textarea { display: block; width: 100%; margin-top: .25rem; }
.publish-dialog { width: min(100% - 2rem, 560px); padding: clamp(1rem, 4vw, 2rem); }
.publish-dialog li { margin: .5rem 0; }
.log-table { overflow-x: auto; margin: 1.25rem 0; }
.log-table table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.log-table th, .log-table td { padding: .6rem .75rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.log-table code { white-space: nowrap; }

/* Shared navigation and neutral design code. The original final plaque is retained. */
[hidden] { display: none !important; }
:root { --motion: 400ms; }
html.no-motion { --motion: 0ms; }
@media (prefers-reduced-motion: reduce) { :root { --motion: 0ms; } }
button, .button, input, select, textarea { border-radius: 0; }
button, .button { transition: background-color var(--motion), border-color var(--motion); }
button:hover:not(:disabled), .button:hover { color: inherit; }
.primary:hover:not(:disabled) { color: #111; }
h1 { font-size: clamp(1.9rem, 4vw, 3.2rem); line-height: 1.12; letter-spacing: -.025em; font-weight: 700; }
h2 { font-size: clamp(1.3rem, 2.6vw, 1.9rem); line-height: 1.2; letter-spacing: -.02em; }
h3 { font-size: 1rem; }
.kicker { color: var(--muted); letter-spacing: .08em; }
.shell { margin-top: clamp(1.5rem, 4vw, 3rem); }
.site-header { height: 4rem; flex: none; flex-wrap: nowrap; padding: .5rem max(1rem, calc((100vw - 1140px) / 2)); }
.brand { font-size: 1.85rem; }
.menu-toggle { width: 44px; height: 44px; padding: 10px; border: 0; background: transparent; display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.menu-toggle span { display: block; width: 24px; height: 2px; background: currentColor; }
.menu-toggle { transition: transform var(--motion); }
.menu-toggle[aria-expanded=true], #menu-close { transform: rotate(90deg); }
.site-menu { position: fixed; inset: 0 0 0 auto; width: min(100%, 380px); height: 100dvh; max-height: 100dvh; max-width: 100vw; margin: 0; padding: 0 1.25rem 2rem; border: 0; border-left: 1px solid var(--line); background: var(--bg); color: var(--cream); transform: translateX(100%); opacity: 0; transition: transform var(--motion) ease-out, opacity var(--motion); overflow: auto; }
.site-menu.is-open { transform: translateX(0); opacity: 1; }
.site-menu::backdrop { background: #0009; }
.menu-heading { display: flex; align-items: center; justify-content: space-between; min-height: 4rem; }
.menu-heading h2 { font-size: 1.3rem; }
.menu-nav { display: grid; gap: .1rem; padding: 1rem 0; }
.menu-nav a { padding: .8rem 0; font-size: 1.15rem; }
.site-settings, .menu-account { border-top: 1px solid var(--line); padding-top: 1.1rem; margin-top: .6rem; }
.site-settings h3 { margin: 0 0 1rem; }
.site-settings fieldset { border: 0; padding: 0; margin: 0 0 1.5rem; display: flex; flex-wrap: wrap; gap: .6rem; }
.site-settings legend { margin-bottom: .7rem; }
.site-settings fieldset label { display: flex; gap: .35rem; align-items: center; font-size: .88rem; }
input[type=checkbox], input[type=radio] { min-height: 0; width: 1.1rem; height: 1.1rem; accent-color: var(--accent); flex-shrink: 0; }
.setting-check { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.25rem; font-size: .94rem; }
.menu-account a, .menu-account button { width: 100%; }
body.menu-open { overflow: hidden; }
.home-shell { max-width: 850px; }
.home-search { margin-bottom: 1.8rem; }
.home-search > label { display: block; font-size: 1.6rem; font-weight: 700; margin-bottom: .8rem; }
.search-row { display: flex; min-width: 0; gap: .4rem; }
.search-row input { width: 100%; min-width: 0; }
.search-row button { flex-shrink: 0; }
.resume-section { margin-bottom: 1.8rem; }
.resume-section h2 { margin-bottom: .8rem; }
.resume-summary { border: 1px solid var(--line); display: flex; align-items: center; gap: 1rem; padding: .8rem; background: var(--panel); }
.resume-summary img { width: 85px; max-height: 145px; height: auto; object-fit: contain; }
.resume-summary h3 { font-size: 1.25rem; margin: 0 0 .55rem; }
.resume-summary p { color: var(--muted); margin: 0 0 .55rem; font-size: .88rem; }
.resume-summary progress { width: 100%; height: 4px; accent-color: var(--accent); }
.resume-summary > div { flex: 1; min-width: 0; }
.resume-button { display: flex; width: 100%; border-top: 0; }
.spotlight { border: 1px solid var(--line); padding: clamp(.9rem, 3vw, 1.5rem); }
.spotlight > .kicker { margin-bottom: 1rem; }
.spotlight-content { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1fr); gap: 1.5rem; align-items: center; }
.spotlight .poster { max-height: 520px; }
.spotlight .lead { font-size: 1rem; }
.spotlight .actions > * { flex: 1; }
.translations { margin-top: 2rem; }
.translations h2 a { display: inline-block; padding: .5rem 0; }
.archive-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; }
.archive-card { min-width: 0; }
.archive-card .poster { aspect-ratio: auto; height: auto; object-fit: contain; object-position: top; }
.archive-card h2 { font-size: 1rem; margin-top: .55rem; line-height: 1.35; }
.home-archive { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: .7rem; }
.home-archive .poster { max-height: none; }
html[data-catalog-view=compact] .archive-grid:not(.home-archive) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.error { border-left: 3px solid var(--cream); padding: .5rem .8rem; }
.reader-body .site-header { z-index: 2; background: var(--bg); }
.reader-bar { position: absolute; top: 4rem; left: 0; right: 0; z-index: 2; max-height: calc(100dvh - 8rem); overflow: auto; border-bottom: 1px solid var(--line); transform: translateY(-.6rem); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity var(--motion), transform var(--motion), visibility var(--motion); }
.reader-bar.open { transform: translateY(0); opacity: 1; visibility: visible; pointer-events: auto; }
.reader-bar progress { accent-color: var(--accent); }
.reading figure { margin-bottom: 0; }
.paged-nav { display: flex; flex: none; justify-content: space-between; gap: .5rem; align-items: center; padding: .35rem .75rem; border-bottom: 1px solid var(--line); }
.paged-nav output { font-variant-numeric: tabular-nums; white-space: nowrap; }
.reading:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.taxonomy { border: 1px solid var(--line); padding: .75rem; min-width: 0; }
.taxonomy > label { font-size: .85rem; margin-bottom: .4rem; }
.taxonomy .search-row { margin: .5rem 0; flex-wrap: wrap; }
.taxonomy-results { display: grid; grid-template-columns: 1fr; max-height: 165px; overflow: auto; }
.taxonomy-results button { text-align: left; justify-content: flex-start; background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: .5rem; }
.selected-values { display: flex; flex-wrap: wrap; gap: .35rem; }
.selected-values button { font-size: .85rem; padding: .25rem .5rem; min-height: 36px; }
.taxonomy p { margin: .5rem 0 0; font-size: .85rem; }
.admin-card { display: grid; grid-template-columns: 78px 1fr auto; gap: 1rem; align-items: center; }
.admin-list .admin-card > a { display: block; }
.admin-card img { width: 78px; height: auto; max-height: 140px; object-fit: contain; }
.admin-card h2 { font-size: 1.2rem; }
.admin-card p { margin: .4rem 0; font-size: .9rem; color: var(--muted); }
@media (max-width: 640px) {
  .spotlight-content { grid-template-columns: minmax(0, .65fr) minmax(0, 1fr); gap: .9rem; align-items: start; }
  .spotlight h1 { font-size: 1.45rem; }
  .spotlight .lead { font-size: .88rem; line-height: 1.5; }
  .spotlight .actions { gap: .5rem; }
  .spotlight .actions > * { flex-basis: 100%; font-size: .85rem; padding: .6rem; }
  .archive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
  html[data-catalog-view=compact] .archive-grid:not(.home-archive) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-archive { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
  .home-archive h2 { font-size: .85rem; }
  .admin-card { grid-template-columns: 60px 1fr; }
  .admin-card img { width: 60px; }
  .admin-card .actions { grid-column: 2; }
  .editor > .editor-box { padding: .8rem; }
}

.admin-search { display: grid; gap: .5rem; margin: 1.5rem 0 1rem; max-width: 32rem; }
.admin-filters { gap: 0; }
.admin-filters [aria-pressed=true] { color: #111; background: var(--accent); }
.disclosure-content { overflow: hidden; }

.shelf-tabs { margin: 1.5rem 0; }
.shelf-tabs [aria-current=page] { background: var(--accent); color: #111; }
[data-shelf-panel] form { display: grid; gap: .5rem; }
[data-shelf-panel] select { width: 100%; }

.title-card { position: relative; min-width: 0; }
.shelf-menu-compact { position: absolute; right: .25rem; top: .25rem; z-index: 1; }
.shelf-menu summary { cursor: pointer; list-style: none; border: 1px solid var(--line); padding: .6rem 1rem; background: var(--bg); }
.shelf-menu-compact summary { margin-left: auto; width: 44px; text-align: center; }
.shelf-menu form { display: grid; min-width: 190px; padding: .4rem; background: var(--bg); border: 1px solid var(--line); }
.shelf-menu button { text-align: left; }

.reader-body .site-header { transition: margin-top var(--motion), transform var(--motion); }
.reader-chrome-hidden .site-header { margin-top: -4rem; transform: translateY(-100%); }
.reader-body .site-header:focus-within { margin-top: 0; transform: none; }

.chapter-thumbnail { width: 72px; height: 72px; object-fit: cover; flex: none; }
.chapter-list a { display: flex; align-items: center; gap: 1rem; min-height: 90px; }
.chapter-list .current-chapter { background: #2B2B2B; }
#start-reading { display: flex; flex-direction: column; gap: .3rem; }
#start-reading small { font-size: .8rem; font-weight: 400; }
.title-details { width: min(90vw, 650px); max-height: 85dvh; overflow: auto; background: var(--bg); color: var(--cream); border: 1px solid var(--line); padding: 1.5rem; opacity: 0; transform: translateY(12px); transition: opacity var(--motion), transform var(--motion); }
.title-details.is-open { opacity: 1; transform: none; }
.title-details::backdrop { background: #0009; backdrop-filter: blur(6px); }
.title-details .tags { display: block; }
.title-details .tags a { color: #8dbbff; border: 0; padding: 0; background: none; margin-right: .4rem; }
.title-details .tags a:not(:last-child)::after { content: ','; }

/* Document scrolling lets mobile browsers retract their own address bar. */
.reader-body { height: auto; min-height: 100dvh; overflow: visible; display: block; }
.reader-body .site-header { position: sticky; top: 0; margin-top: 0; transition: transform var(--motion); }
.reader-chrome-hidden .site-header { margin-top: 0; transform: translateY(-100%); pointer-events: none; }
.reader-body .site-header:focus-within { transform: none; pointer-events: auto; }
.reader-body .reading { overflow: visible; min-height: 100dvh; }
.reader-body .reader-toggle { position: fixed; }
.reader-body .reader-bar { position: fixed; }
.reader-body .paged-nav { position: sticky; top: 0; z-index: 1; background: var(--bg); }
.shelf-menu { z-index: 4; }
.shelf-menu form button[aria-pressed=true]::before { content: '✓ '; }
.shelf-menu .disclosure-content { overflow: hidden; }
@media (max-width: 600px) { .shelf-menu-compact { max-width: calc(100vw - 2rem); } }

.release { max-width: 1140px; }
.title-hero { display: grid; grid-template-columns: minmax(180px, 300px) minmax(0, 1fr); gap: 2rem; align-items: start; }
.title-hero > .poster { width: 100%; max-height: none; aspect-ratio: 2 / 3; object-fit: contain; margin: 0; }
.title-summary h1 { font-size: clamp(1.8rem, 3vw, 2.7rem); margin-top: 0; }
.title-summary .actions { flex-direction: column-reverse; }
.title-summary .description { line-height: 1.65; }
.title-summary .shelf-menu { position: relative; }
.title-summary .shelf-menu summary { text-align: center; }
@media (max-width: 650px) {
 .title-hero { display: block; }
 .title-hero > .poster { width: min(65%, 250px); margin: 0 auto 1.5rem; }
 .title-summary h1 { text-align: center; }
 .shelf-menu-compact form { min-width: 0; width: min(190px, calc(100vw - 2rem)); }
}

/* Tablet layouts must not compress controls or stretch short editor columns. */
.editor { align-items: start; }
.editor > .stack, .editor .stack { align-content: start; }
.title-summary { min-width: 0; }
.title-summary .actions { align-items: stretch; }
.title-summary .actions > a, .title-summary .actions > details { width: 100%; }
.title-summary h1 { overflow-wrap: anywhere; }
.chapter-list a > span:first-of-type { flex: 1; text-align: left; }
@media (max-width: 900px) {
 .title-hero { display: block; }
 .title-hero > .poster { width: min(55%, 280px); margin: 0 auto 1.5rem; }
 .title-summary { max-width: 620px; margin: 0 auto; }
 .title-summary h1 { text-align: center; }
 .editor { grid-template-columns: minmax(0, 1fr); }
 .editor > .stack { gap: 1.05rem; }
 .editor .upload { min-height: 44px; height: auto; }
}

/* Text and SVG buttons share one line box on tablet and desktop. */
#title-more, #title-share { height: 48px; min-height: 48px; vertical-align: middle; margin: 0; }
#title-share { width: 48px; padding: 0; }
#title-share svg { display: block; flex: none; }

@media (max-width: 900px) {
 .title-chapters { max-width: 620px; margin: 1.5rem auto 0; }
}

/* Page turns remain reachable when document scrolling hides the site header. */
.reader-paged .paged-nav { position: fixed; inset: auto 0 0; z-index: 3; padding-bottom: max(.35rem, env(safe-area-inset-bottom)); }
.reader-paged .reading { padding-bottom: calc(4rem + env(safe-area-inset-bottom)); }
.reader-paged .reader-toggle { bottom: calc(4.5rem + env(safe-area-inset-bottom)); }

.reading[data-mode=paged] { touch-action: pan-y pinch-zoom; overflow-x: clip; }
.reader-paged .paged-nav { justify-content: center; gap: 1rem; pointer-events: none; font-size: .85rem; }

/* SnakeTime 1.0: one reading action and navigation vocabulary. */
[data-reading-slug] { display: flex; flex-direction: column; gap: .3rem; }
[data-reading-slug] small { font-size: .8rem; font-weight: 400; }
.shelf-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem; margin: 1rem 0; }
.shelf-tools label { display: grid; gap: .4rem; flex: 1 1 220px; }
.shelf-tools input, .shelf-tools select { width: 100%; }
.shelf-tools p { flex-basis: 100%; margin: 0; }
.shelf-reading { width: 100%; margin-top: .5rem; }
#shelf-resume { border: 1px solid var(--line); padding: 1rem; margin-block: 1.5rem; }
#shelf-resume h2 { margin-top: 0; }
.reader-chapters { grid-column: 1 / -1; }
.reader-chapters summary { cursor: pointer; padding: .6rem; }
.reader-chapters nav { display: grid; gap: .4rem; max-height: 30dvh; overflow: auto; }
.reader-chapters a { padding: .6rem; border: 1px solid var(--line); }
.reader-chapters [aria-current=page] { background: #2B2B2B; }
.chapter-end-notice { max-width: 860px; padding: 1rem; margin: 0 auto; color: var(--muted); }
.action-confirmation { width: min(92vw, 560px); max-height: 85dvh; overflow: auto; background: var(--bg); color: var(--cream); border: 1px solid var(--line); padding: 1.5rem; }
.action-confirmation::backdrop { background: #0009; backdrop-filter: blur(4px); }
.action-confirmation h2 { font-size: 1.2rem; line-height: 1.5; }
.shelf-menu-compact .disclosure-content { max-width: calc(100vw - 16px); }

.page-transition-stage { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; background: var(--bg); }
.page-transition-incoming { position: absolute; inset: 0; background: var(--bg); }
.page-transition-stage img { display: block; width: 100%; height: auto; }

/* The shelf resume card follows the same two-line reading action as titles. */
.shelf-shell { max-width: 1000px; }
#shelf-resume { padding: clamp(1rem, 3vw, 1.5rem); }
#shelf-resume h2 { margin: 0 0 1rem; font-size: 1.25rem; }
.shelf-resume-body { display: grid; grid-template-columns: clamp(80px, 16vw, 120px) minmax(0, 1fr); gap: 1rem; align-items: center; }
.shelf-resume-body.without-cover { grid-template-columns: minmax(0, 1fr); }
.shelf-resume-cover { display: block; }
.shelf-resume-cover .poster { display: block; width: 100%; height: auto; max-height: 190px; object-fit: contain; margin: 0; }
.shelf-resume-info { min-width: 0; }
.shelf-resume-info h3 { font-size: clamp(1rem, 2.5vw, 1.3rem); line-height: 1.35; margin: 0 0 1rem; overflow-wrap: anywhere; }
.shelf-resume-info > .button { width: 100%; align-items: center; text-align: center; }
.shelf-resume-info small { display: block; line-height: 1.4; }
.shelf-tools { margin: 1.5rem 0 1rem; gap: 1rem; }
.shelf-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: 1rem 0 1.5rem; }
.shelf-tabs .button { gap: .4rem; padding: .65rem .4rem; min-width: 0; flex-wrap: wrap; font-size: clamp(.75rem, 1.8vw, .95rem); }
[data-shelf-panel] > h2 { margin: 0 0 1rem; }
[data-shelf-panel] > .archive-grid { margin-top: 0; }

.shelf-sort-control { display: grid; gap: .4rem; flex: 1 1 220px; min-width: 0; }
.shelf-sort-menu { position: relative; }
.shelf-sort-menu summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: .65rem 1rem; border: 1px solid var(--line); background: var(--panel); cursor: pointer; list-style: none; }
.shelf-sort-menu summary::-webkit-details-marker { display: none; }
.shelf-sort-menu summary::after { content: '⌄'; margin-left: .5rem; transition: transform var(--motion); }
.shelf-sort-menu[open] summary::after { transform: rotate(180deg); }
.shelf-sort-menu .disclosure-content { position: absolute; top: calc(100% + .35rem); right: 0; width: 100%; z-index: 5; background: var(--bg); border: 1px solid var(--line); }
.shelf-sort-menu [role=group] { display: grid; padding: .35rem; gap: .25rem; }
.shelf-sort-menu button { text-align: left; justify-content: flex-start; width: 100%; }
.shelf-sort-menu [aria-pressed=true]::before { content: '✓'; margin-right: .5rem; }

.shelf-menu[data-closing=true], .shelf-sort-menu[data-closing=true] { pointer-events: none; }
.shelf-menu[data-closing=true] > summary, .shelf-sort-menu[data-closing=true] > summary { pointer-events: auto; }
[data-shelf-panel] .title-card > p { padding: .5rem 3rem .5rem .5rem; overflow-wrap: anywhere; min-height: 44px; }
