*{box-sizing:border-box} [hidden]{display:none!important} :root{color:#242424;background:#f3f3f3;font:16px/1.45 "Helvetica Neue",Helvetica,Arial,sans-serif;--rule:#cbcbcb;--muted:#636363} body{margin:0}button,select{font:inherit;color:inherit}button{cursor:pointer;border:1px solid var(--rule);border-radius:6px;background:transparent;padding:10px 17px;font-weight:600} button:disabled{opacity:.35;cursor:default} button:focus-visible,select:focus-visible{outline:3px solid #727272;outline-offset:3px}button.dark{background:#282828;color:#fff;border-color:#282828}button.dark:hover:enabled{background:#454545}#library{max-width:1112px;margin:auto;padding:0 clamp(20px,5vw,72px) 24px}.mast{height:90px;border-bottom:1px solid var(--rule);display:flex;align-items:center;justify-content:space-between;font-size:14px;color:var(--muted)}.brand{display:flex;gap:12px;align-items:center;font-weight:700;letter-spacing:-2px;color:#272727}.brand img{border-radius:10px}.shelf-heading{display:flex;align-items:center;gap:18px;justify-content:space-between;margin:38px 0 23px}h1,h2,p{margin:0}h1,h2,.volume-title{font-family:inherit;font-weight:400}h1{font-size:clamp(48px,7vw,80px);letter-spacing:-.065em;line-height:1.05}.feature{display:grid;grid-template-columns:1fr 1fr;background:#e7e7e7;border:1px solid #cecece;border-radius:8px;overflow:hidden}.cover-panel{min-height:295px;display:grid;place-items:center;padding:24px;background:repeating-linear-gradient(105deg,transparent 0 8px,#ffffff09 8px 9px),#717171}.cover-panel img{max-height:244px;max-width:85%;box-shadow:6px 9px 14px #2b2b2b50;transform:rotate(-5deg);border-radius:2px}.feature-info{padding:clamp(24px,4vw,52px);align-self:center}.kicker{font-size:12px;letter-spacing:.13em;font-weight:700;text-transform:uppercase;color:#575757}.feature h2{font-size:clamp(30px,5vw,57px);line-height:1.08;letter-spacing:-.055em;overflow-wrap:anywhere;margin:10px 0}.feature p,.shelf p{color:var(--muted)}.feature button{margin-top:25px}.shelf{margin-top:35px}.shelf-heading-row{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;border-bottom:1px solid var(--rule);padding-bottom:12px}.shelf h2{font-size:30px;letter-spacing:-.04em}.shelf p{margin:17px 0}.volume-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:24px;margin-top:20px}.volume{padding:0;border:0;text-align:left;display:grid;align-content:start;gap:5px}.volume img{width:100%;height:178px;object-fit:contain;background:transparent;border-radius:4px}.volume-title{font-size:20px;overflow-wrap:anywhere}.volume small,footer{color:var(--muted)}footer{border-top:1px solid var(--rule);margin-top:40px;padding-top:14px;font-size:13px}#status:not(:empty){margin-bottom:16px}#reader{background:#161616;color:#f1f1f1;height:100vh;height:100dvh;display:grid;grid-template-rows:auto minmax(0,1fr) auto}.toolbar,.pager{display:flex;align-items:center;gap:12px;padding:10px max(16px,env(safe-area-inset-left));background:#252525}.toolbar{flex-wrap:wrap}.toolbar strong{margin-right:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:30vw}.toolbar label{font-size:12px;color:#d1d1d1}.toolbar select{background:#353535;color:#fff;border:1px solid #616161;border-radius:4px;min-height:40px;padding:0 4px}.toolbar button,.pager button{color:#fff;border-color:#636363;min-height:44px}#stage{position:relative;touch-action:pan-y pinch-zoom;user-select:none;-webkit-user-select:none;overflow:hidden}.pager{justify-content:center;padding-bottom:max(10px,env(safe-area-inset-bottom))}.pager button{min-width:50px}.pager output{min-width:120px;text-align:center;font-variant-numeric:tabular-nums}#readerError:not(:empty){position:absolute;inset:40% 10% auto;background:#282828;padding:16px;text-align:center} @media(max-width:600px){.mast{height:64px}.shelf-heading{margin-top:28px}.cover-panel{min-height:208px;padding:12px}.cover-panel img{max-width:80%;max-height:180px}.feature-info{padding:16px}.feature button{padding:8px 10px}.toolbar{gap:6px}.toolbar strong{max-width:44vw}.toolbar label{font-size:0}.toolbar select{font-size:13px}.shelf-heading button{padding:9px 12px}}

.book-meta { display:flex; align-items:center; gap:7px; }
.completed-mark { display:inline-flex; flex:none; width:16px; height:16px; }
.completed-mark svg { width:100%; height:100%; fill:none; stroke:currentColor; stroke-width:1.4; stroke-linecap:round; stroke-linejoin:round; }
#nextVolume { position:absolute; z-index:3; bottom:max(22px, env(safe-area-inset-bottom)); display:flex; align-items:center; gap:8px; min-height:44px; padding:10px 14px; max-width:calc(50% - 44px); background:var(--surface, white); color:var(--text, #242424); border:1px solid var(--rule); border-radius:24px; box-shadow:0 2px 12px #0002; font-size:14px; touch-action:manipulation; }
#nextVolume[data-side="left"] { left:max(16px, env(safe-area-inset-left)); }
#nextVolume[data-side="right"] { right:max(16px, env(safe-area-inset-right)); flex-direction:row-reverse; }
#nextVolume svg { width:18px; height:18px; flex:none; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
#nextVolume[data-side="right"] svg { transform:rotate(180deg); }
@media(max-width:420px) { #nextVolume { font-size:12px; padding:9px 10px; gap:5px; } }

:root { accent-color: #343434; }
.brand { font: 800 clamp(23px, 3vw, 34px)/1 "Helvetica Neue", Helvetica, Arial, sans-serif; letter-spacing: -.065em; color: #202020; }
#volumes h3 { margin: 0; font-size: 20px; font-weight: 600; overflow-wrap: anywhere; }
.series-disclosure { width:100%; min-height:54px; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 2px; border:0; border-bottom:1px solid var(--rule); border-radius:0; font:inherit; text-align:start; }
.series-disclosure span { flex:none; width:40px; text-align:center; font-size:24px; font-weight:400; color:var(--muted); }
#volumes section:has(.series-disclosure[aria-expanded="true"]) { padding-bottom:20px; }
#seriesDialog, #importDialog, #seriesSettingsDialog { width: min(480px, calc(100% - 28px)); max-height: 90vh; max-height: 90dvh; color: #222; background: #fafafa; border: 1px solid #bbb; border-radius: 12px; padding: clamp(18px, 4vw, 30px); }
#seriesDialog::backdrop, #importDialog::backdrop, #seriesSettingsDialog::backdrop { background: rgb(0 0 0 / 55%); }
#seriesDialog h2, #importDialog h2, #seriesSettingsDialog h2 { font-size: 32px; line-height: 1.2; margin-bottom: 20px; }
#seriesDialog fieldset { min-width: 0; margin: 0 0 16px; padding: 0; border: 0; }
#seriesDialog legend, .field { font-size: 14px; font-weight: 600; }
#bookChoices { margin-top: 7px; border: 1px solid #ccc; border-radius: 5px; overflow: auto; max-height: 32vh; }
#bookChoices label { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; padding: 10px; min-height: 44px; overflow-wrap: anywhere; cursor: pointer; }
#bookChoices label + label { border-top: 1px solid #ddd; }
#bookChoices input { width: 18px; height: 18px; }
#bookChoices small { max-width: 95px; color: #555; }
.field { display: grid; gap: 5px; margin: 12px 0; }
.field input, .field select { min-width: 0; width: 100%; padding: 10px; font: inherit; font-weight: 400; border: 1px solid #999; border-radius: 5px; background: white; color: #222; }
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
#library { padding-top: env(safe-area-inset-top, 0px); }
#library::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  background: rgb(0 0 0 / 36%);
  backdrop-filter: blur(6px);
  pointer-events: none;
  z-index: 3;
}
#reader { position: fixed; inset: 0; width: 100%; overflow: hidden; }
.toolbar, .pager { position: relative; z-index: 2; transition: transform 180ms ease; }
.toolbar { padding-top: max(10px, env(safe-area-inset-top)); }
#reader.immersive { grid-template-rows: minmax(0, 1fr); }
.immersive .toolbar, .immersive .pager { position: absolute; left: 0; right: 0; pointer-events: none; }
.immersive .toolbar { top: 0; transform: translateY(-100%); }
.immersive .pager { bottom: 0; transform: translateY(100%); }
#stage { outline: 0; container-type: size; }
/* Pages share a strip with a one-device-pixel seam. Spare width reveals the adjacent scan. */
#reader, #stage { background: white; }
#reader:fullscreen::backdrop { background: white; }
.reading-fullscreen, .reading-fullscreen body { background: white; }
#reader:fullscreen { width: 100%; height: 100%; }
#reader:-webkit-full-screen { width: 100%; height: 100%; }
#stage { touch-action: none; overscroll-behavior: contain; -webkit-touch-callout: none; }
#readingSurface { position: absolute; inset: 0; transform-origin: 0 0; will-change: transform; }
#pages {
  position: absolute; inset: 0; will-change: transform;
  --seam: 1px;
  --slot-width: min(100cqw, calc(100cqh * var(--current-ratio)));
}
.page-frame {
  position: absolute; top: 0; bottom: 0;
  width: min(100cqw, calc(100cqh * var(--ratio)));
  display: grid; place-items: center; background: white;
  /* Keep the bounded resident window paintable independently of the moving strip. */
  transform: translateZ(0); backface-visibility: hidden;
}
.page-frame[data-side="current"] { left: 0; }
.page-frame[data-side="left"] { right: calc(100% + var(--seam)); }
.page-frame[data-side="right"] { left: calc(var(--slot-width) + var(--seam)); }
#pages[data-direction="rtl"] .page-frame[data-side="current"] { left: auto; right: 0; }
#pages[data-direction="rtl"] .page-frame[data-side="left"] { right: calc(var(--slot-width) + var(--seam)); }
#pages[data-direction="rtl"] .page-frame[data-side="right"] { left: calc(100% + var(--seam)); }
#pages {
  --left-width: min(100cqw, calc(100cqh * var(--left-ratio)));
  --right-width: min(100cqw, calc(100cqh * var(--right-ratio)));
}
.page-frame[data-side="far-left"] { right: calc(100% + var(--left-width) + 2 * var(--seam)); }
.page-frame[data-side="far-right"] { left: calc(var(--slot-width) + var(--right-width) + 2 * var(--seam)); }
#pages[data-direction="rtl"] .page-frame[data-side="far-left"] { right: calc(var(--slot-width) + var(--left-width) + 2 * var(--seam)); }
#pages[data-direction="rtl"] .page-frame[data-side="far-right"] { left: calc(100% + var(--right-width) + 2 * var(--seam)); }
.page-frame[data-side$="left"]::after, .page-frame[data-side$="right"]::before {
  content: ""; position: absolute; top: 0; bottom: 0; width: var(--seam); background: #777;
}
.page-frame[data-side$="left"]::after { left: 100%; }
.page-frame[data-side$="right"]::before { right: 100%; }
.sheet { display: flex; width: min(100cqw, calc(100cqh * var(--ratio))); aspect-ratio: var(--ratio); }
.sheet > img { display: block; height: 100%; width: auto; min-width: 0; object-fit: contain; pointer-events: none; }
.sheet { transition: transform 280ms cubic-bezier(.22,.68,.28,1); }
.page-frame[data-side="current"] .sheet { transform: var(--spread-transform, none); }
#pages:not(.spread-rotated) { --spread-transform: none; }
#pages.spread-rotated .page-frame:not([data-side="current"]) { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .sheet { transition: none; } }
@media (orientation: landscape) {
  #pages { --slot-width: 100cqw; --left-width: 100cqw; --right-width: 100cqw; }
  .page-frame { width: 100cqw; }
}@media (prefers-reduced-motion: reduce) { .toolbar, .pager { transition: none; } }

/* The settings controls float over the same full-size page as immersive mode. */
#reader, #reader.immersive { display:block; }
#stage { position:absolute; inset:0; }
#reader .toolbar, #reader .pager {
  position:absolute; left:0; right:0; background:none; border:0; pointer-events:none;
  padding:0; z-index:2;
}
#reader .toolbar {
  top:max(18px, env(safe-area-inset-top)); justify-content:space-between;
  margin-inline:max(18px, env(safe-area-inset-left)) max(18px, env(safe-area-inset-right));
}
#reader .pager { bottom:max(18px, env(safe-area-inset-bottom)); }
#reader .round, #shelfSettings {
  padding:0; width:46px; min-width:46px; height:46px; border-radius:50%; border:1px solid #0000000d;
  display:grid; place-items:center; background:#fff; color:#555; pointer-events:auto;
  box-shadow:0 2px 12px #0002;
}
.round svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
#reader #browsePages { background:#333e; color:white; box-shadow:0 3px 14px #0003; }
#reader #back {
  width:auto; grid-template-columns:auto 44px; border-radius:23px;
  padding-inline-start:16px; touch-action:manipulation;
}
#back span { font-size:15px; }
#back svg { pointer-events:none; }
#reader.immersive .toolbar { transform:translateY(calc(-100% - max(24px, env(safe-area-inset-top)))); }
#reader.immersive .pager { transform:translateY(calc(100% + max(24px, env(safe-area-inset-bottom)))); }
#reader.immersive .round { pointer-events:none; }
#rotateSpread {
  position:absolute; z-index:3; top:calc(max(18px, env(safe-area-inset-top)) - 9px);
  right:calc(max(18px, env(safe-area-inset-right)) - 9px);
  /* Keep the 22px icon in place while extending its invisible touch target. */
  width:64px; min-width:64px; height:64px; padding:0;
  display:grid; place-items:center; border:0;
  border-radius:50%; color:#999; background:transparent;
  appearance:none; -webkit-appearance:none; -webkit-tap-highlight-color:transparent;
  box-shadow:none; opacity:0; touch-action:manipulation; pointer-events:none;
}
#reader #rotateSpread[data-visible="true"] { opacity:1; pointer-events:auto; }
#rotateSpread:active svg { opacity:.65; }
#rotateSpread svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; pointer-events:none; }
#rotateSpread[aria-pressed="true"] svg { transform:rotate(90deg); }
/* Reserve the corner for rotate; settings sits beside it without changing page layout. */
#reader #settings { transition:transform 180ms ease; }
#reader:has(#rotateSpread[data-visible="true"]) #settings { transform:translateX(-58px); }
@media (prefers-reduced-motion:reduce) { #reader #settings { transition:none; } }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
#settingsDialog, #pageDialog { border:0; box-shadow:0 10px 60px #0004; }
#settingsDialog::backdrop, #pageDialog::backdrop { background:#0006; }
#settingsDialog { margin:max(72px, calc(env(safe-area-inset-top) + 68px)) max(18px, env(safe-area-inset-right)) auto auto; padding:20px; width:min(320px,calc(100vw - 36px)); border-radius:16px; background:#fafafa; color:#333; }
.dialog-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.dialog-heading h2 { font-size:20px; font-weight:600; letter-spacing:-.035em; }
.dismiss { display:grid; place-items:center; width:44px; height:44px; padding:0; border:0; color:inherit; font:400 28px/1 Helvetica,Arial,sans-serif; }
#pageDialog { padding:0; width:min(1100px,92vw); height:92dvh; max-height:calc(100dvh - 18px); max-width:100vw; background:#202020; color:#eee; border-radius:20px; overflow:hidden; }
#pageDialog[open] { display:flex; flex-direction:column; }
#pageDialog .dialog-heading { position:relative; flex:none; min-height:46px; justify-content:center; background:#272727; }
#pageDialog h2 { font-size:15px; letter-spacing:0; }
#pageDialog .dismiss { position:absolute; right:5px; top:1px; appearance:none; -webkit-appearance:none; background:transparent; border:0; border-radius:0; box-shadow:none; outline:none; -webkit-tap-highlight-color:transparent; }
#pageDialog .dismiss:focus-visible { text-decoration:none; color:var(--text); font-weight:700; }
#pageScroll { flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; }
#pageGrid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); align-content:start; gap:14px clamp(5px,1.5vw,18px); padding:10px clamp(8px,1.5vw,18px) 20px; }
#pageGrid button { min-width:0; padding:0; border:0; font-size:12px; font-weight:400; color:#c6c6c6; font-variant-numeric:tabular-nums; }
#pageGrid img { display:block; width:100%; aspect-ratio:5/7; border-radius:5px; object-fit:contain; background:#383838; }
#pageGrid span { display:block; margin-top:4px; }
#pageGrid [aria-current] img { outline:3px solid #fff; outline-offset:2px; }
#pageGrid [aria-current] span { color:#fff; font-weight:bold; }
.cover-panel { background:var(--surface-3); overflow:hidden; container-type:inline-size; }
#deck { --deck-height:244px; --cover-ratio:.7; position:relative; width:100%; height:var(--deck-height); }
#heroCover, .fan-card { position:absolute; width:min(56%, calc(var(--deck-height) * var(--cover-ratio))); height:auto; aspect-ratio:var(--cover-ratio); left:50%; top:50%; transform:translate(-50%,-50%) rotate(-5deg); border-radius:2px; box-shadow:2px 4px 9px #0003; }
#deck #heroCover { max-height:none; max-width:none; object-fit:contain; }
#deck.fanned #heroCover { left:39%; }
.fan-card { left:calc(39% + var(--rank) * 6%); transform:translate(-50%,-50%) rotate(calc(-5deg + var(--rank) * 5deg)); background:white; overflow:hidden; }
#fan img { display:block; width:100%; height:100%; max-width:none; max-height:none; object-fit:cover; transform:none; border-radius:0; box-shadow:none; }
.fan-card::after { content:""; position:absolute; inset:0; background:white; opacity:calc(var(--rank) * .13); }
@media(max-width:600px){ #deck {--deck-height:164px;} .cover-panel { padding:9px; } }

/* Colors from MAX Database's main client. */
:root {
  color-scheme: light;
  --bg: #eeede8;
  --surface: #f7f6f2;
  --surface-2: #e6e4de;
  --surface-3: #dad8d2;
  --text: #111;
  --muted: #62615d;
  --rule: #ceccc6;
  --line-strong: #a6a49e;
  --inverse: #f5f4ef;
  --inverse-bg: #0d0d0d;
  color: var(--text);
  background: var(--bg);
  accent-color: var(--inverse-bg);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0a;
  --surface: #101010;
  --surface-2: #171717;
  --surface-3: #202020;
  --text: #f0efeb;
  --muted: #969696;
  --rule: #303030;
  --line-strong: #4c4c4c;
  --inverse: #090909;
  --inverse-bg: #efeee9;
}
body, #reader, #stage, .page-frame, #reader:fullscreen::backdrop,
.reading-fullscreen, .reading-fullscreen body { background:var(--bg); }
#reader, .brand { color:var(--text); }
.feature { background:var(--surface-2); border-color:var(--rule); }
.kicker, #bookChoices small { color:var(--muted); }
button.dark, button.dark:hover:enabled, #reader #browsePages {
  color:var(--inverse); background:var(--inverse-bg); border-color:var(--inverse-bg);
}
#shelfSettings, #reader .round, #settingsDialog, #seriesDialog, #importDialog, #seriesSettingsDialog {
  color:var(--text); background:var(--surface); border-color:var(--rule);
}
#shelfSettings, #reader .round { color:var(--muted); }
.field input, .field select, #bookChoices {
  color:var(--text); background:var(--surface-2); border-color:var(--line-strong);
}
#bookChoices label + label { border-color:var(--rule); }
#pageDialog { background:var(--surface); color:var(--text); }
#pageDialog .dialog-heading, #pageGrid img { background:var(--surface-2); }
#pageGrid button { color:var(--muted); }
#pageGrid [aria-current] span { color:var(--text); }
#pageGrid [aria-current] img { outline-color:var(--text); }
#readerError:not(:empty) { color:var(--inverse); background:var(--inverse-bg); }
.paper-option { display:flex; align-items:center; justify-content:space-between; min-height:44px; font-size:14px; font-weight:600; }
.paper-option input { width:21px; height:21px; margin:0; }
.sheet { position:relative; background:white; isolation:isolate; }
/* Warm paper and an isotropic fibre tile travel with each decoded sheet. */
[data-paper="true"] .sheet::before, [data-paper="true"] .sheet::after {
  content:""; position:absolute; inset:0; pointer-events:none; mix-blend-mode:multiply;
}
[data-paper="true"] .sheet::before { background:#ffebce; opacity:var(--warmth,.10); z-index:1; }
[data-paper="true"] .sheet::after { background:url("./paper-stock.svg") repeat; background-size:88px 88px; opacity:var(--grain,.08); z-index:2; }
[data-paper="true"] .sheet > img { filter:var(--ink-tone,none); }
.paper-fibres { display:none; }
[data-paper="true"] .paper-fibres { display:block; position:absolute; inset:0; z-index:3; pointer-events:none;
  background:url("./paper-stock.svg") repeat; background-size:88px 88px; filter:brightness(.45) sepia(.2);
  mix-blend-mode:screen; opacity:var(--through,0); }
#settingsDialog { max-height:calc(100dvh - max(72px, calc(env(safe-area-inset-top) + 68px)) - max(12px, env(safe-area-inset-bottom))); overflow-y:auto; overscroll-behavior:contain; }
#settingsDialog.clear-preview::backdrop { background:transparent; }
.theme-choice { border:0; margin:12px 0; padding:0; }
.theme-choice legend { font-size:14px; font-weight:600; padding:0 0 5px; }
.theme-choice div { display:flex; border-radius:7px; background:var(--surface-2); padding:3px; }
.theme-choice button { flex:1; min-height:40px; border:0; padding:6px; }
.theme-choice button[aria-pressed="true"] { color:var(--inverse); background:var(--inverse-bg); }
.paper-section { border-top:1px solid var(--rule); margin-top:16px; padding-top:6px; }
.heading-actions { display:flex; align-items:center; }
#previewPaper { width:44px; height:44px; display:grid; place-items:center; padding:0; border:0; background:transparent; color:inherit; }
#previewPaper svg { width:18px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; }
#previewPaper[aria-pressed="true"] .eye-slash { display:none; }
.paper-slider { display:grid; grid-template-columns:1fr auto; align-items:center; margin:8px 0; font-size:14px; }
.paper-slider span { color:var(--muted); font-variant-numeric:tabular-nums; }
.paper-slider input { grid-column:1/-1; width:100%; height:30px; margin:0; }
.shelf-actions, #shelfView { display:flex; align-items:center; gap:8px; }
.shelf-actions { flex-wrap:wrap; }
#shelfView { padding:3px; border-radius:8px; background:var(--surface-2); gap:0; }
#shelfView button { min-height:40px; padding:6px 14px; border:0; }
#shelfView button[aria-pressed="true"] { color:var(--inverse); background:var(--inverse-bg); }
#allSeries { margin-top:14px; }
.series-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(190px,100%),1fr)); gap:28px 24px; margin-top:24px; }
.series-card { position:relative; display:grid; min-width:0; }
.series-open { display:flex; flex-direction:column; align-items:stretch; gap:0; width:100%; height:100%; min-width:0; padding:0; border:0; border-radius:8px; text-align:left; }
.series-artwork { display:grid; place-items:center; width:100%; aspect-ratio:2/3; padding:14px; background:var(--surface-2); border:1px solid var(--rule); border-radius:8px; overflow:hidden; }
.series-card img { display:block; width:100%; height:100%; min-height:0; object-fit:contain; filter:drop-shadow(0 3px 4px #0002); }
.series-open-label { flex:1; min-width:0; min-height:2.7em; margin-top:13px; font-size:20px; line-height:1.35; font-weight:600; overflow-wrap:break-word; }
.series-count { display:flex; align-items:center; min-height:44px; padding-right:88px; color:var(--muted); font-size:14px; font-weight:400; }
.series-open-sign { position:absolute; bottom:0; right:44px; width:44px; height:44px; display:grid; place-items:center; color:var(--muted); font-size:24px; font-weight:400; border-radius:6px; }
.series-open:hover .series-artwork { border-color:var(--line-strong); }
.series-open:hover .series-open-sign, .series-card > .series-settings:hover { color:var(--text); background:var(--surface-2); }
@media(max-width:600px) {
  .series-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px 16px; }
  .series-artwork { padding:10px; }
  .series-open-label { font-size:18px; }
  .series-count { font-size:13px; }
}
@media(max-width:359px) { .series-grid { grid-template-columns:1fr; } }
.series-settings { flex:none; width:44px; height:44px; padding:10px; display:grid; place-items:center; color:var(--muted); }
.series-settings svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.series-card > .series-settings { position:absolute; bottom:0; right:0; border:0; }
.series-heading, .series-title-row { display:flex; align-items:center; gap:10px; min-width:0; }
.series-heading .series-disclosure { flex:1; min-width:0; }
.series-title-row h2 { overflow-wrap:anywhere; }
#seriesSettingsDialog { width:min(480px, calc(100% - 28px)); max-height:90vh; max-height:90dvh; overflow-y:auto; padding:clamp(18px,4vw,30px); color:var(--text); background:var(--surface); border:1px solid var(--rule); border-radius:12px; }
#seriesSettingsDialog::backdrop { background:rgb(0 0 0 / 55%); }
#seriesSettingsDialog h2 { font-size:28px; line-height:1.2; }
#seriesSettingsDialog .dialog-heading { gap:12px; }
.series-delete-option { margin-top:24px; padding-top:20px; border-top:1px solid var(--rule); }
#deleteSeries { width:100%; }
#deleteSeriesSummary { overflow-wrap:anywhere; }
#deleteSeriesConfirmation .actions { flex-wrap:wrap; }
#seriesSettingsError:not(:empty) { margin-top:16px; }
input:focus-visible { outline:3px solid #727272; outline-offset:3px; }
.volume { touch-action:pan-y pinch-zoom; }
.volume img { -webkit-user-drag:none; pointer-events:none; }
#bookDialog { width:min(480px, calc(100% - 28px)); max-height:90dvh; overflow-y:auto; padding:clamp(18px,4vw,30px); color:var(--text); background:var(--surface); border:1px solid var(--rule); border-radius:12px; }
#bookDialog::backdrop { background:rgb(0 0 0 / 55%); }
#bookDialog .dialog-heading { gap:12px; align-items:flex-start; }
#bookDialog h2 { font-size:24px; line-height:1.2; overflow-wrap:anywhere; }
#bookOptions { display:grid; gap:8px; margin-top:20px; }
#bookOptions button { min-height:48px; text-align:left; }
#bookError:not(:empty) { margin-top:16px; }
#librarySettingsActions { margin:16px 0; padding:16px 0; border-block:1px solid var(--rule); }
#editBooks { width:100%; min-height:48px; }
#bookEditBar { flex:none; }

/* Information uses the same shelf selection and page browser, without actions. */
#bookInformation { width:100%; min-height:48px; margin-bottom:8px; }
#bookInfoPanel { padding:0 clamp(14px,3vw,30px) 18px; }
#bookInfoStatus { font-size:14px; color:var(--muted); min-height:1.5em; }
#bookInfoSummary h3 { font-size:22px; overflow-wrap:anywhere; margin:12px 0; }
.book-info-facts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.book-info-facts dt { font-size:14px; color:var(--muted); }
.book-info-facts dd { margin:4px 0 0; font-size:16px; overflow-wrap:anywhere; }
.book-info-note { font-size:14px; line-height:1.5; color:var(--muted); }
details.book-info-note { margin-top:14px; }
details.book-info-note summary { cursor:pointer; padding:8px 0; }
.book-info-distribution { width:100%; border-collapse:collapse; font-size:14px; }
.book-info-distribution caption { text-align:left; font-size:16px; margin:12px 0; }
.book-info-distribution th, .book-info-distribution td { padding:8px 4px; border-bottom:1px solid var(--rule); text-align:right; }
.book-info-distribution th:first-child { text-align:left; font-weight:400; }
.book-information #pageGrid { grid-template-columns:repeat(auto-fill,minmax(145px,1fr)); }
#pageGrid article { min-width:0; font-size:14px; font-variant-numeric:tabular-nums; }
#pageGrid .page-information { display:block; font-size:14px; line-height:1.45; white-space:pre-line; margin-top:6px; overflow-wrap:anywhere; color:var(--muted); }
@media (max-width:480px) {
  .book-info-facts { grid-template-columns:1fr; gap:14px; }
  .book-information #pageGrid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
/* Backup controls remain within the viewport on iPad and narrow Safari windows. */
#backupDialog { max-width: min(36rem, calc(100vw - 2rem)); max-height: 85dvh; overflow: auto; }
#backupDialog p { line-height: 1.5; overflow-wrap: anywhere; }
.backup-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1rem 0; }
.backup-actions button { white-space: normal; }
#librarySettingsActions { display: flex; flex-wrap: wrap; gap: .5rem; }
#librarySettingsActions[hidden] { display: none; }
