* {box-sizing:border-box}
:root {
  color-scheme:dark;
  --paper:#161417; --ink:#fcf2df; --muted:#c6b8ac; --soft:#100e10; --line:#453831;
  --accent:#e6be81; --on-accent:#261608; --bar:56px;
  font:15px/1.6 system-ui,-apple-system,"Hiragino Sans","Yu Gothic",sans-serif;
}
html {-webkit-text-size-adjust:100%; background:var(--soft)}
body,h1,h2,h3,p {margin:0}
body {background:var(--paper); color:var(--ink); min-height:100dvh}
[hidden] {display:none !important}
a {color:inherit}
button {font:inherit; color:inherit; cursor:pointer; border:0; background:none; min-height:44px; padding:8px 12px}
button:disabled {opacity:.38; cursor:default}
:focus-visible {outline:2px solid var(--accent); outline-offset:-2px}
img {display:block; max-width:100%; height:auto}

/* 共通ヘッダー */
.mast {max-width:960px; margin:auto; padding:0 22px; min-height:60px; display:flex; justify-content:space-between; align-items:center; border-bottom:1px solid var(--line)}
.mast b {letter-spacing:.18em; font-size:14px}
.mast a {text-decoration:none; font-size:13px; min-height:44px; display:flex; align-items:center}
.wrap {max-width:960px; margin:auto; padding:0 22px 56px}
.eyebrow {color:var(--accent); font-size:11px; font-weight:750; letter-spacing:.12em}
.meta {font-size:12px; color:var(--muted); margin-top:7px}

/* トップ: 作品棚 */
.shelf-title {font-family:"Hiragino Mincho ProN","Yu Mincho",serif; font-size:28px; margin:26px 0 14px; letter-spacing:.06em}
.cards {display:grid; grid-template-columns:repeat(2,1fr); gap:16px 14px; list-style:none; padding:0; margin:0}
@media(min-width:700px){.cards{grid-template-columns:repeat(4,1fr)}}
.card {display:block; text-decoration:none}
.card .cover {width:100%; aspect-ratio:5/7; object-fit:cover; background:#262126; border:1px solid var(--line); border-radius:3px}
.card h2 {font-size:15px; margin-top:8px; line-height:1.4}
.card p {font-size:12px; color:var(--muted)}
.badge {display:inline-block; font-size:11px; font-weight:700; color:var(--on-accent); background:var(--accent); border-radius:3px; padding:0 6px; margin-right:6px}

/* 作品ページ */
.myth {position:relative; min-height:440px; display:flex; align-items:flex-end; overflow:hidden; isolation:isolate; border-bottom:1px solid var(--line)}
.artwork,.artwork:after {position:absolute; inset:0; z-index:-1}
.artwork img {width:100%; height:100%; object-fit:cover; object-position:50% 32%}
.artwork:after {content:""; z-index:0; background:linear-gradient(180deg,#1a131626 5%,#1a131666 36%,#161417f5 76%,#161417)}
.myth .blurb {width:100%; max-width:960px; margin:auto; padding:60px 22px 22px}
.myth h1 {font-family:"Hiragino Mincho ProN","Yu Mincho",serif; font-size:clamp(32px,7vw,57px); line-height:1.15; letter-spacing:.07em; margin-top:8px}
.subtitle {font-weight:650; margin-top:7px}
.primary {text-decoration:none; display:flex; align-items:center; justify-content:space-between; gap:12px; background:var(--accent); color:var(--on-accent); font-weight:700; width:100%; max-width:340px; margin-top:16px; border-radius:4px}
.volumes {margin:26px 0 0}
.volumes h2 {font-size:19px; margin-bottom:8px}
.volume {display:flex; width:100%; gap:13px; align-items:center; padding:9px 0; border-top:1px solid var(--line); text-decoration:none}
.volume .cover,.placeholder {width:39px; height:54px; object-fit:cover; flex:none; background:#262126}
.placeholder {display:grid; place-items:center; font:22px Georgia,serif}
.volume small,.volume strong {display:block}
.volume small {color:var(--muted)}
.volume .go {margin-left:auto}
.schedule {display:flex; flex-wrap:wrap; gap:8px; align-items:baseline; font-size:13px; border-top:1px solid var(--line); padding-top:12px}
.schedule span {color:var(--muted)}
.schedule time {font-weight:750}
.empty {color:var(--muted); padding:40px 0; text-align:center}

/* リーダー */
body.reading {background:var(--soft)}
.rbar {position:fixed; left:0; right:0; z-index:5; background:var(--paper); transition:transform .2s, visibility 0s}
.rtop {top:0; min-height:var(--bar); padding:env(safe-area-inset-top) 10px 0; display:flex; align-items:center; gap:8px; border-bottom:1px solid var(--line)}
.rtop b {font-size:13px; margin-right:auto; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.rtop button {font-size:13px; flex:none}
.rbot {bottom:0; padding:0 10px max(5px,env(safe-area-inset-bottom)); border-top:1px solid var(--line)}
.chrome-off .rbar {visibility:hidden; transition:transform .2s, visibility 0s linear .2s}
.chrome-off .rtop {transform:translateY(-110%)}
.chrome-off .rbot {transform:translateY(110%)}
.tools {display:flex; justify-content:space-between; max-width:540px; margin:auto}
.tools button {flex:1; padding-inline:3px; font-size:13px}
#count {font-weight:750; font-variant-numeric:tabular-nums; color:var(--accent)}
#mark[aria-pressed=true] {color:var(--accent); font-weight:750}
.progress {height:3px; background:var(--line); margin:0 -10px 2px}
.progress i {display:block; width:0; height:100%; background:var(--accent)}
.stream {padding:var(--bar) 0 70px; min-height:100dvh}
.stream img {width:min(100%,650px); height:auto; margin:auto; background:#262126}
.stream img {scroll-margin-top:var(--bar)}
.stream.spaced img {margin-bottom:14px}
.end {max-width:650px; margin:0 auto; padding:36px 22px; text-align:center}
.end h2 {font-family:"Hiragino Mincho ProN","Yu Mincho",serif; font-size:22px; margin-bottom:6px}
.end .primary {margin-inline:auto; justify-content:center}
.ghost {display:block; margin:10px auto 0; border:1px solid var(--line); border-radius:4px; min-width:200px}

dialog {color:inherit; background:var(--paper); border:1px solid var(--line); border-radius:15px 15px 0 0; width:min(100%,540px); max-width:100%; max-height:72dvh; padding:0; margin:auto auto 0}
dialog::backdrop {background:#0008}
.panel-head {display:flex; align-items:center; justify-content:space-between; position:sticky; top:0; background:var(--paper); padding:0 16px; border-bottom:1px solid var(--line); z-index:1}
.panel-head h2 {font-size:17px}
.panel {padding:10px 16px max(16px,env(safe-area-inset-bottom))}
.panel-row {width:100%; display:flex; align-items:center; justify-content:space-between; gap:8px; text-align:left; border-bottom:1px solid var(--line)}
.panel-row span {color:var(--accent); flex:none}
.panel input[type=number] {font:inherit; background:var(--soft); color:var(--ink); border:1px solid var(--line); border-radius:4px; min-height:44px; width:6em; padding:0 8px}
.panel form {display:flex; gap:8px; align-items:center; flex-wrap:wrap}
.panel label {display:flex; gap:10px; align-items:center; min-height:44px}
.panel input[type=checkbox] {accent-color:var(--accent); width:20px; height:20px}
.secondary {border:1px solid var(--line); border-radius:4px}
#notice {position:fixed; z-index:9; bottom:96px; left:50%; transform:translateX(-50%); max-width:90vw; width:max-content; background:var(--ink); color:var(--paper); border-radius:6px; padding:7px 12px; font-size:13px; pointer-events:none}

/* 横読み(1ページずつ・右綴じ) */
.stream.paged {padding:0; display:flex; align-items:center; justify-content:center; height:100dvh; min-height:0; overflow:hidden}
.stream.paged img {width:auto; height:auto; max-width:100vw; max-height:calc(100dvh - 2 * var(--bar)); margin:0; object-fit:contain}
.chrome-off .stream.paged img {max-height:100dvh}
.stream.paged .end {width:100%}
.rtop button#modebtn {white-space:nowrap}
.panel-row + .meta, .panel .meta {margin:10px 0 0}
.stream.paged .end {max-height:calc(100dvh - 2 * var(--bar)); overflow:auto}
.chrome-off .stream.paged .end {max-height:100dvh}
