/* Inkline studio and data-driven comic renderer. */
:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  --studio-ink: #222631;
  --studio-muted: #6d7482;
  --studio-line: #d8dce4;
  --studio-panel: #ffffff;
  --studio-canvas: #e8ebf0;
  --studio-accent: #3367d6;
  --studio-accent-soft: #e8efff;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--studio-ink); background: #f3f5f8; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
:focus-visible { outline: 3px solid #3779dd; outline-offset: 2px; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.admin-chapter { min-width: 0; }
.admin-chapter__breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem;
  margin: 0 0 .9rem;
}
.admin-chapter__breadcrumb a { font-weight: 700; text-decoration: none; }
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: .2rem .65rem;
  border: 1px solid #c9ced8;
  border-radius: 999px;
  background: #fff;
  color: #5c6472;
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .02em;
  text-decoration: none;
}
.status-pill--published { border-color: #a9cdb4; background: #eef8f1; color: #236a3b; }

.studio {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: clamp(640px, calc(100vh - 160px), 1000px);
  min-height: 0;
  overflow: hidden;
  border: 1px solid #cfd4dd;
  border-radius: 12px;
  background: var(--studio-canvas);
  box-shadow: 0 16px 46px #20283b1a;
  color: var(--studio-ink);
  line-height: 1.35;
}
.studio__topbar {
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
  padding: .6rem .85rem;
  border-bottom: 1px solid var(--studio-line);
  background: var(--studio-panel);
}
.studio__identity,
.studio__top-actions {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
}
.studio__identity { flex: 1 1 auto; }
.studio__mark {
  flex: none;
  padding: .32rem .58rem;
  border-radius: 7px;
  background: #20283b;
  color: #ffc482;
  font-size: .9rem;
  font-weight: 900;
  letter-spacing: -.04em;
}
.studio__title {
  min-width: 0;
  max-width: 36ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .98rem;
  letter-spacing: -.02em;
}
.save-indicator {
  flex: none;
  padding: .18rem .45rem;
  border-radius: 999px;
  color: var(--studio-muted);
  font-size: .7rem;
  font-weight: 700;
  white-space: nowrap;
}
.save-indicator--dirty { background: #fff4dc; color: #8a5a0b; }
.save-indicator--saving { background: #e8efff; color: #2d5bb8; }
.save-indicator--error { background: #fdecec; color: #a02c2c; }
.save-indicator--saved { color: #47785a; }

.tool-group,
.zoom-control {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--studio-line);
  border-radius: 8px;
  background: #f8f9fb;
}
.icon-button,
.text-button,
.primary-button,
.zoom-control__value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #303745;
  font-weight: 700;
}
.icon-button { width: 32px; padding: 0; }
.icon-button svg,
.layer-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-button:hover:not(:disabled),
.text-button:hover:not(:disabled),
.zoom-control__value:hover { background: #e9edf4; }
.text-button { padding: .35rem .72rem; font-size: .82rem; }
.zoom-control__value {
  min-width: 52px;
  padding: 0 .25rem;
  color: var(--studio-muted);
  font-size: .76rem;
  font-variant-numeric: tabular-nums;
}
.zoom-control .text-button { color: #4b5566; }
.primary-button {
  min-height: 34px;
  padding: .4rem 1rem;
  background: #273e68;
  color: #fff;
  box-shadow: 0 2px 6px #273e6833;
}
.primary-button:hover:not(:disabled) { background: #1f3255; }

.studio__body {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 320px;
  min-height: 0;
  min-width: 0;
}
.studio.is-preview .studio__body { grid-template-columns: minmax(0, 1fr); }

.studio__tools {
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  min-height: 0;
  padding: .55rem .45rem;
  overflow-y: auto;
  border-right: 1px solid var(--studio-line);
  background: var(--studio-panel);
  scrollbar-width: thin;
}
.studio__tool {
  display: grid;
  justify-items: center;
  gap: 3px;
  width: 100%;
  min-height: 49px;
  padding: .35rem .2rem .28rem;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #4e5666;
  font-size: .62rem;
  font-weight: 750;
}
.studio__tool svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.studio__tool:hover { background: #f0f3f8; color: #20283b; }
.studio__tool.is-active { border-color: #b9c9e7; background: var(--studio-accent-soft); color: #2454b5; }
.studio__tool-sep { height: 1px; margin: .35rem .3rem; background: var(--studio-line); }

.studio__workspace {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  background-color: var(--studio-canvas);
  background-image:
    radial-gradient(circle at 1px 1px, #4a556715 1px, transparent 0),
    linear-gradient(135deg, #ffffff24, #cfd6e224);
  background-size: 18px 18px, 100% 100%;
}
.studio__stage {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  background: #fff;
  box-shadow: 0 8px 30px #20283b24, 0 0 0 1px #aeb5c133;
  will-change: transform;
}
.studio__svg {
  display: block;
  overflow: visible;
  touch-action: none;
}
.studio__overlay-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  gap: .25rem;
  width: min(300px, 70%);
  padding: 1rem 1.2rem;
  transform: translate(-50%, -50%);
  border: 1px dashed #9da7b8;
  border-radius: 10px;
  background: #ffffffcf;
  color: #596273;
  text-align: center;
  pointer-events: none;
  backdrop-filter: blur(3px);
}
.studio__overlay-hint strong { color: #303846; font-size: 1rem; }
.studio__overlay-hint span { font-size: .8rem; }

.studio[data-tool="select"] .studio__workspace { cursor: default; }
.studio[data-tool="hand"] .studio__workspace { cursor: grab; }
.studio[data-tool="hand"] .studio__workspace:active { cursor: grabbing; }
.studio[data-tool="pencil"] .studio__workspace,
.studio[data-tool="brush"] .studio__workspace { cursor: crosshair; }
.studio[data-tool="eraser"] .studio__workspace { cursor: cell; }
.studio[data-tool="text"] .studio__workspace { cursor: text; }
.studio[data-tool="image"] .studio__workspace { cursor: copy; }
.studio[data-tool="rect"] .studio__workspace,
.studio[data-tool="roundrect"] .studio__workspace,
.studio[data-tool="ellipse"] .studio__workspace,
.studio[data-tool="line"] .studio__workspace,
.studio[data-tool="arrow"] .studio__workspace,
.studio[data-tool="panel"] .studio__workspace,
.studio[data-tool="bubble"] .studio__workspace { cursor: crosshair; }
.studio.is-panning .studio__workspace { cursor: grabbing !important; }
.studio.is-preview .studio__workspace { cursor: default; }
.studio.is-preview .studio__stage { box-shadow: 0 12px 38px #20283b24; }

.inline-text {
  position: absolute;
  z-index: 12;
  margin: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
}
.inline-text textarea {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: inherit;
  overflow: hidden;
  border: 2px dashed #2f6fed;
  border-radius: 2px;
  background: #ffffffd9;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-align: inherit;
  resize: none;
  outline: none;
  pointer-events: auto;
}
.inline-text__hint {
  position: absolute;
  right: 0;
  bottom: -1.55rem;
  padding: .1rem .35rem;
  border-radius: 3px;
  background: #2f6fed;
  color: #fff;
  font: 600 .62rem system-ui, sans-serif;
  white-space: nowrap;
  pointer-events: none;
}

.studio__side {
  z-index: 3;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  border-left: 1px solid var(--studio-line);
  background: var(--studio-panel);
  scrollbar-width: thin;
}
.side-section { padding: .7rem .8rem .9rem; border-bottom: 1px solid #e7e9ee; }
.side-section--layers { flex: 0 1 34%; min-height: 150px; overflow-y: auto; }
.side-section--properties { flex: 1 1 auto; }
.side-section__head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .15rem 0 .55rem;
  background: var(--studio-panel);
}
.side-section__head h2 {
  margin: 0;
  font-size: .74rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #5c6472;
}
.side-section__head span { color: #9aa2b0; font-size: .7rem; font-variant-numeric: tabular-nums; }

.layer-list { display: grid; gap: 2px; }
.layer-row {
  display: grid;
  grid-template-columns: 24px 24px minmax(0, 1fr) 20px 20px 20px;
  align-items: center;
  gap: 2px;
  min-height: 34px;
  padding: 2px 3px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #3b4250;
  cursor: default;
}
.layer-row:hover { background: #f4f6fa; }
.layer-row.is-selected { border-color: #b7c8e8; background: var(--studio-accent-soft); color: #20468f; }
.layer-row.is-hidden .layer-name { opacity: .45; text-decoration: line-through; }
.layer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #657083;
  font-size: .72rem;
}
.layer-icon:hover { background: #e5e9f1; color: #20283b; }
.layer-name {
  min-width: 0;
  overflow: hidden;
  padding: 0 .2rem;
  font-size: .76rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.layer-kind { display: none; }
.layer-order { color: #8b93a2; }
.layer-empty { margin: .4rem 0; color: #8a92a0; font-size: .76rem; }

.properties { display: grid; gap: .65rem; min-width: 0; }
.prop-group {
  display: grid;
  gap: .45rem;
  min-width: 0;
  padding-bottom: .65rem;
  border-bottom: 1px solid #eceef2;
}
.prop-group:last-child { padding-bottom: 0; border-bottom: 0; }
.prop-group h3 {
  margin: .1rem 0 0;
  color: #5a6271;
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.prop-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .55rem;
  min-width: 0;
  color: #4e5665;
  font-size: .75rem;
  font-weight: 650;
}
.prop-row > span { flex: 1 1 auto; min-width: 0; }
.prop-row input[type="color"] {
  flex: none;
  width: 42px;
  height: 27px;
  padding: 2px;
  border: 1px solid #c8ced8;
  border-radius: 5px;
  background: #fff;
}
.prop-row input[type="number"],
.prop-row input[type="text"],
.prop-row select,
.prop-row textarea,
.prop-grid input,
.prop-grid select {
  min-width: 0;
  width: 100%;
  min-height: 30px;
  padding: .32rem .42rem;
  border: 1px solid #c8ced8;
  border-radius: 5px;
  background: #fff;
  color: #303745;
  font-size: .76rem;
}
.prop-row input[type="number"] { width: 78px; }
.prop-row input[type="range"] { width: 116px; accent-color: var(--studio-accent); }
.prop-row textarea { min-height: 74px; resize: vertical; }
.prop-row select { width: 128px; }
.prop-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
.prop-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.prop-grid label {
  display: grid;
  gap: .2rem;
  min-width: 0;
  color: #6a7282;
  font-size: .68rem;
  font-weight: 700;
}
.check-row {
  display: flex;
  align-items: center;
  gap: .4rem;
  color: #4e5665;
  font-size: .75rem;
  font-weight: 600;
}
.check-row input { width: 15px; height: 15px; accent-color: var(--studio-accent); }
.check-row-group { display: flex; flex-wrap: wrap; gap: .8rem; }
.prop-note { margin: 0; color: #848c9a; font-size: .7rem; line-height: 1.45; }
.button-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
.button-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.small-button,
.wide-button {
  min-height: 31px;
  padding: .35rem .5rem;
  border: 1px solid #c5ccd8;
  border-radius: 5px;
  background: #fff;
  color: #394253;
  font-size: .72rem;
  font-weight: 700;
}
.small-button:hover, .wide-button:hover { border-color: #9fb3d5; background: #f1f5fc; }
.wide-button { width: 100%; }

.studio__status {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1rem;
  min-height: 27px;
  padding: .32rem .85rem;
  border-top: 1px solid var(--studio-line);
  background: #fbfcfd;
  color: #667083;
  font-size: .7rem;
}
.status-error { color: #b02f2f; font-weight: 700; }

.selection-box {
  fill: none;
  stroke: #2f6fed;
  stroke-dasharray: 4 3;
  pointer-events: none;
}
.transform-handle,
.rotate-handle,
.tail-handle {
  fill: #fff;
  stroke: #2f6fed;
  vector-effect: non-scaling-stroke;
}
.rotate-stem { stroke: #2f6fed; pointer-events: none; }
.rotate-handle { fill: #e8efff; }
.tail-handle { fill: #f0a33b; stroke: #fff; }
.marquee { fill: #3367d615; stroke: #2f6fed; stroke-dasharray: 4 3; pointer-events: none; }
.snap-guide { stroke: #d84c9b; stroke-dasharray: 3 3; pointer-events: none; }
.comic-grid-line { stroke: #61708b22; stroke-width: .65; pointer-events: none; }
.comic-object { overflow: visible; }
.comic-text { font-kerning: normal; }

.comic-reader { max-width: 100%; padding: .5rem 0 1rem; }
.comic-reader__viewport { width: 100%; min-width: 0; }
.comic-reader__stage { display: grid; justify-items: center; width: 100%; }
.comic-page {
  display: block;
  width: min(100%, 980px);
  height: auto;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 18px 52px #20283b20, 0 0 0 1px #20283b12;
}

.chapter-settings {
  margin-top: 1.1rem;
  border: 1px solid #d8dce3;
  border-radius: 9px;
  background: #fff;
}
.chapter-settings > summary {
  padding: .8rem 1rem;
  color: #3b4351;
  font-weight: 750;
  cursor: pointer;
}
.chapter-settings__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1rem;
  padding: 0 1rem 1rem;
}
.chapter-settings__grid .form-card { margin: 0; box-shadow: none; }
.comic-editor__error { color: #a5232a; }

@media (max-width: 1120px) {
  .studio__body { grid-template-columns: 72px minmax(0, 1fr) 284px; }
  .studio__title { max-width: 22ch; }
  .studio__tool { min-height: 46px; font-size: .58rem; }
  .studio__tool svg { width: 19px; height: 19px; }
}
@media (max-width: 900px) {
  .studio { height: auto; min-height: 760px; }
  .studio__topbar { flex-wrap: wrap; }
  .studio__top-actions { flex-wrap: wrap; }
  .studio__body {
    grid-template-columns: 66px minmax(0, 1fr);
    grid-template-rows: minmax(540px, 1fr) auto;
  }
  .studio__tools { grid-column: 1; grid-row: 1; }
  .studio__workspace { grid-column: 2; grid-row: 1; }
  .studio__side {
    grid-column: 1 / -1;
    grid-row: 2;
    max-height: 400px;
    border-top: 1px solid var(--studio-line);
    border-left: 0;
  }
  .studio.is-preview .studio__body { grid-template-columns: minmax(0, 1fr); }
  .studio.is-preview .studio__workspace { grid-column: 1; }
}
@media (max-width: 640px) {
  .studio { min-height: 680px; border-radius: 8px; }
  .studio__topbar { padding: .5rem; }
  .studio__mark { padding: .28rem .4rem; font-size: .78rem; }
  .studio__title { max-width: 15ch; font-size: .88rem; }
  .save-indicator { display: none; }
  .studio__top-actions { gap: .35rem; }
  .studio__body { grid-template-columns: 56px minmax(0, 1fr); grid-template-rows: minmax(460px, 1fr) auto; }
  .studio__tools { padding: .4rem .25rem; }
  .studio__tool { min-height: 42px; }
  .studio__tool span { display: none; }
  .layer-row { grid-template-columns: 24px 24px minmax(0, 1fr) 20px; }
  .layer-order:last-child { display: none; }
  .button-grid--three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Server-rendered pages: warm paper, strong ink, and a chapter-reading rhythm. */
body {
  background-color: #f5f3ef;
  background-image: radial-gradient(#28334b0b 1px, transparent 1px);
  background-size: 20px 20px;
  color: #252a37;
}
.site-header, .site-main { line-height: 1.6; }
.studio, .comic-reader { line-height: normal; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem max(1rem, calc((100% - 1200px) / 2));
  background: #20283b;
  border-bottom: 4px solid #e4a263;
  color: #f8f7f4;
}
.site-header > a {
  color: #fff;
  font-size: 1.45rem;
  font-weight: 850;
  line-height: 1.2;
  letter-spacing: -.04em;
  text-decoration: none;
}
.site-header > a::first-letter { color: #ffbf81; }
.site-header nav { display: flex; align-items: center; gap: .7rem; white-space: nowrap; color: #bfc8d8; }
.site-header nav a { color: #f8f7f4; font-weight: 650; text-decoration: none; }
.site-header a:hover, .site-header a:focus-visible { color: #ffca94; }

.site-main {
  width: min(100% - 2rem, 1200px);
  min-height: calc(100vh - 80px);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3.25rem) 0 5rem;
}
.site-main > h1, .site-main > h2, .form-card h1, .form-card h2, .empty h1 {
  color: #20283b;
  line-height: 1.2;
  letter-spacing: -.035em;
}
.site-main > h1, .form-card h1, .empty h1 { font-size: clamp(2rem, 5vw, 3.1rem); margin: .3rem 0 1.25rem; }
.site-main > h2 { font-size: 1.45rem; margin: 2.5rem 0 1rem; }
.site-main > p { max-width: 72ch; color: #535c6a; }
.site-main > a { display: inline-block; margin-bottom: .85rem; }
.site-main a:not(.card) { color: #2e4f82; text-underline-offset: .18em; }
.site-main a:not(.card):hover { color: #9c3a37; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 1.1rem; margin: 1.4rem 0 2.5rem; }
.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 170px;
  padding: 1.4rem;
  border: 1px solid #d9dce1;
  border-top: 4px solid #cb685a;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 5px 18px #20283b0c;
  color: #252a37;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover, .card:focus-visible { transform: translateY(-3px); border-color: #bd7467; box-shadow: 0 10px 28px #20283b1c; }
.card h2, .card h3 { margin: 0 0 .5rem; font-size: 1.35rem; line-height: 1.3; color: #20283b; }
.card p { margin: 0; color: #596273; }

.chapter-list { list-style: none; counter-reset: chapter; padding: 0; margin: 1rem 0 2.5rem; border-top: 1px solid #dce0e4; }
.chapter-list li { counter-increment: chapter; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; min-width: 0; padding: .85rem .8rem; border-bottom: 1px solid #dce0e4; background: #fff; overflow-wrap: anywhere; }
.chapter-list li:nth-child(even) { background: #faf9f6; }
.chapter-list li::before { content: counter(chapter, decimal-leading-zero); flex: none; min-width: 2.6rem; margin-right: .5rem; color: #a74d40; font-weight: 800; font-variant-numeric: tabular-nums; }
.chapter-list a { font-weight: 700; }

.form-card {
  max-width: 760px;
  margin: 1.5rem 0 2rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid #d9dce1;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 9px 32px #20283b10;
}
.site-main > .form-card:first-child { max-width: 480px; margin: clamp(2rem, 7vh, 5rem) auto; }
.form-card h1 { font-size: 2rem; }
.form-card h2 { margin: 0 0 1rem; font-size: 1.4rem; }
.form-card form { display: grid; justify-items: start; gap: 1rem; min-width: 0; }
.form-card form + form { margin-top: 1.4rem; padding-top: 1.4rem; border-top: 1px solid #e4e5e8; }
.form-card label { display: grid; gap: .4rem; width: 100%; min-width: 0; color: #363e50; font-weight: 700; }
.form-card input:not([type="hidden"]), .form-card textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: .65rem .8rem;
  border: 1px solid #a9b1c0;
  border-radius: 6px;
  background: #fff;
  color: #20283b;
  font-weight: 400;
}
.form-card textarea { min-height: 130px; resize: vertical; }
.form-card input:not([type="hidden"]):focus, .form-card textarea:focus { border-color: #3d6196; outline: 2px solid #a5c2f0; outline-offset: 1px; }
.form-card button, .site-main > form button {
  min-height: 44px;
  padding: .55rem 1.1rem;
  border: 1px solid #273f65;
  border-radius: 6px;
  background: #304f7f;
  color: #fff;
  font-weight: 700;
}
.form-card button:hover, .site-main > form button:hover { background: #233c63; }
.form-card button.danger { border-color: #a6403a; background: #b4443e; }
.form-card button.danger:hover { background: #93352f; }
.site-main > form { margin-bottom: 1.5rem; }
.site-main > form button { border-color: #b6bdca; background: #fff; color: #304f7f; }
.site-main > form button:hover { background: #e9eef6; }

.empty { max-width: 760px; margin: 1.5rem 0; padding: 2rem; border: 1px dashed #b9c1cc; border-radius: 8px; background: #ffffffd9; color: #545f70; }
.empty h1 { margin-top: 0; }
.empty a { font-weight: 700; }

.reader-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; margin: .3rem 0 1.5rem; }
.reader-nav:last-child { margin: 1.5rem 0 0; }
.reader-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .5rem .9rem;
  border: 1px solid #c9ced7;
  border-radius: 6px;
  background: #fff;
  color: #304f7f;
  font-weight: 700;
  text-decoration: none;
}
.reader-nav a:hover { border-color: #ba7766; background: #fff7ef; }
.comic-reader { max-width: 100%; }
.comic-reader__viewport { width: 100%; }

@media (max-width: 600px) {
  .site-header { padding: .8rem .75rem; }
  .site-header > a { font-size: 1.3rem; }
  .site-main { width: calc(100% - 1.5rem); padding-top: 1.5rem; }
  .card { min-height: 0; }
  .chapter-list li { padding: .75rem .5rem; }
  .reader-nav { gap: .5rem; }
  .reader-nav a { flex: 1 1 auto; justify-content: center; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
}
