/* Keep the original palette available for the reader's explicit dark setting. */
:root,#reader[data-theme=dark],#reader[data-theme=oled] {
  color-scheme:dark;
  --bg:#151515; --paper:#f0f0f0; --muted:#b4b4b4; --gold:#edaf71;
  --line:#383838; --control:#242424;
}
:root {
  --header:#101010; --surface:#1c1c1c; --accent-bg:#edaf71; --accent-ink:#21150b;
}
:root[data-site-theme=light] {
  color-scheme:light;
  --bg:#fbf7ef; --paper:#282019; --muted:#625247; --gold:#814617;
  --line:#c9b9a7; --control:#f2e8da; --header:#f5ebdb; --surface:#fffaf3;
  --accent-bg:#814617; --accent-ink:#fff9f0;
}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--paper);font:1rem/1.55 system-ui,sans-serif}a{color:inherit;text-decoration:none}button,input{font:inherit}button,a,input{outline-offset:4px}button{cursor:pointer}[hidden]{display:none!important}.wrap{width:min(1160px,90%);margin-inline:auto}
header{background:var(--header);border-bottom:1px solid var(--line)}.bar{min-height:74px;display:flex;justify-content:space-between;align-items:center;gap:1rem}.brand{font:700 clamp(1rem,3vw,1.45rem) Georgia,serif;white-space:nowrap}.brand img{display:block;width:clamp(144px,30vw,220px);max-width:100%;height:auto}nav{display:flex;gap:clamp(.8rem,4vw,2.4rem);color:var(--muted);font-size:.92rem}nav a:hover,.back:hover{color:var(--gold)}
.hero{display:grid;align-items:center;min-height:clamp(475px,49vw,625px);background:linear-gradient(90deg,#141414f5 3%,#141414cf 30%,#14141422 74%),linear-gradient(0deg,var(--bg) 0%,transparent 31%),url(hero.webp) center 51%/cover,#2a2a2a}.hero-copy{padding-block:4rem}.eyebrow{color:var(--gold);text-transform:uppercase;letter-spacing:.17em;font-size:.85rem;font-weight:650}h1,h2,h3{font-family:Georgia,serif;line-height:1.02;margin:0}h1{font-size:clamp(3rem,7vw,6.4rem);margin:.22em 0}h2{font-size:clamp(2.25rem,4vw,3.45rem);margin:.23em 0 .5em}h3{font-size:1.6rem;line-height:1.12}.hero p{max-width:445px;color:#dcdcdc;margin:0 0 1.65rem}.button,button{display:inline-block;border:1px solid var(--line);border-radius:5px;padding:.55rem .9rem;background:var(--control);color:var(--paper)}.button{padding:.7rem 1rem;background:var(--accent-bg);color:var(--accent-ink);font-weight:700;margin:.2rem .4rem .2rem 0}.outline{background:#101010bc;color:var(--paper);border-color:#6a6a6a}.collection{padding-block:1.3rem 4.8rem}.tools{display:flex;justify-content:space-between;flex-wrap:wrap;gap:1rem;margin-bottom:1.4rem}#filters,.reader-tools{display:flex;flex-wrap:wrap;gap:.5rem}button[aria-pressed=true]{color:var(--gold);border-color:var(--gold)}input{border:1px solid var(--line);background:var(--control);color:var(--paper);border-radius:5px;padding:.55rem .8rem;width:min(100%,235px)}.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1.15rem}.card{border:1px solid var(--line);border-radius:8px;overflow:hidden;background:var(--surface);display:flex;flex-direction:column}.cover{height:145px;background:linear-gradient(0deg,var(--surface),transparent 67%),var(--cover);background-size:cover;background-position:center;display:grid;place-items:center}.cover mark{background:none;color:#f8d19f;font:3rem Georgia;text-shadow:0 0 22px #f9b57677}.body{padding:0 1.2rem 1.2rem;display:flex;flex-direction:column;flex:1}.tags{font-size:.85rem;color:var(--gold);margin:.75rem 0}.body p,.empty{color:var(--muted);margin:.8rem 0 1.2rem}.actions{margin-top:auto;display:flex;flex-wrap:wrap;align-items:center;gap:.65rem}.actions a{font-weight:650;color:var(--gold)}.actions button{font-size:.88rem}footer{border-top:1px solid var(--line);padding:1.5rem 0}.reading{max-width:760px;padding:3rem 0 5rem;min-height:78vh}.reading h1{font-size:clamp(2.7rem,7vw,4.8rem)}.back{display:inline-block;color:var(--muted);margin-bottom:2.5rem}#chapter{font:var(--reading-size,1.25rem)/1.8 Georgia,serif;margin-top:2rem;max-width:68ch}#chapter p{margin:0 0 1em}
@media(max-width:750px){.grid{grid-template-columns:repeat(2,minmax(0,1fr))}.hero{background-position:center,center,64% center}}@media(max-width:500px){.grid{grid-template-columns:1fr}.hero{min-height:460px}.hero-copy{padding-block:3rem}input{width:100%}.collection{padding-bottom:3rem}}

.bar nav { flex-wrap:wrap; gap:.5rem 1.35rem; justify-content:flex-end; }
select,textarea { font:inherit; color:inherit; background:var(--control,#242424); border:1px solid var(--line); border-radius:5px; padding:.55rem .7rem; }
select { appearance:none; padding-right:2rem; background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%); background-position:calc(100% - 14px) 50%,calc(100% - 9px) 50%; background-size:5px 5px; background-repeat:no-repeat; }
textarea { width:100%; min-height:6rem; resize:vertical; }
.tools { justify-content:flex-start; }
.cover img { width:100%; height:145px; object-fit:cover; }
#reader { width:min(100%,820px); padding:clamp(1.5rem,6vw,4rem); margin-block:1.5rem; color:var(--paper); background:var(--bg); }
#reader[data-theme=Sepia] { color-scheme:light; --bg:#f4ead5; --paper:#382c20; --muted:#695548; --line:#c7b498; --gold:#784015; --control:#f9f0df; }
#reader[data-theme=Light] { color-scheme:light; --bg:#fff; --paper:#24201d; --muted:#5b534c; --line:#cdc5bc; --gold:#824516; --control:#f6f3ef; }
#reader button { background:var(--control,#242424); }
#chapter { margin:2.1rem auto; line-height:var(--reading-spacing,1.8); overflow-wrap:anywhere; min-height:9rem; }
#chapter blockquote { margin-inline:0; padding-inline-start:1em; border-inline-start:2px solid var(--line); }
.chapter-nav { display:flex; justify-content:space-between; gap:1rem; padding:.65rem 0; border-block:1px solid var(--line); }
.chapter-nav a,.back,#discussion a,.workspace a { color:var(--gold); }
.chapter-nav span { color:var(--muted); opacity:.8; }
.reader-tools { align-items:flex-start; margin:1.1rem 0; }
summary { color:var(--gold); cursor:pointer; padding:.55rem 0; }
.settings { display:flex; flex-wrap:wrap; gap:.7rem; align-items:center; padding:.5rem 0; }
.settings input { width:6rem; padding:0; vertical-align:middle; accent-color:var(--gold); }
.settings output { display:inline-block; min-width:3rem; padding-inline-start:.4rem; }
#contents { margin-bottom:.7rem; }
#contents [aria-current] { color:var(--gold); font-weight:650; }
#discussion { margin-top:3rem; }
#discussion h2,.workspace h2 { font-size:clamp(1.5rem,4vw,2.1rem); }
.message { border-bottom:1px solid var(--line); padding:.55rem 0; overflow-wrap:anywhere; }
.message p { white-space:pre-wrap; margin:.35rem 0; }
#reviews { margin-bottom:2rem; }
.stack { display:grid; gap:.75rem; margin:1rem 0; }
.stack label { display:grid; gap:.25rem; }
.stack input:not([type=range]),.stack select { width:100%; }
.stack button { justify-self:start; }
.workspace { padding:3rem 0; min-height:75vh; }
.workspace h1 { font-size:clamp(2.5rem,6vw,4.5rem); }
#profile-form { max-width:25rem; }
.studio-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,2fr); gap:1rem; }
.panel { border:1px solid var(--line); padding:1.2rem; border-radius:8px; margin-top:1rem; min-width:0; }
#stats { margin:.7rem 0; color:var(--muted); }
#editor { min-height:18rem; border:1px solid var(--line); border-radius:5px; padding:1rem; font:1.1em/1.75 Georgia,serif; overflow-wrap:anywhere; }
#queue button { margin:.35rem .45rem .35rem 0; }
@media(max-width:700px) { .studio-grid{grid-template-columns:1fr} footer .bar{align-items:flex-start;flex-direction:column;padding-block:.7rem} footer .bar nav{justify-content:flex-start} .tools > *{flex:1 1 9rem} }

body:not([data-page=home]) #home { display:none; }
body[data-page=bookshelf] #home:not([hidden]),body[data-page=history] #home:not([hidden]) { display:block; }
body:is([data-page=bookshelf],[data-page=history]) .hero { display:none; }
body:is([data-page=bookshelf],[data-page=history]) .collection { min-height:70vh;padding-top:3rem; }
.pill-row { display:flex;flex-wrap:wrap;gap:.45rem;margin:.6rem 0; }
.pill-row button { border-radius:99px;padding:.3rem .8rem;font-size:.9rem; }
#browse-pills { margin:0 0 1.2rem; }
#reader[data-theme=oled] { --bg:#000;--paper:#f0eeed;--line:#343434;--control:#121212; }
#reader[data-theme=sepia] { color-scheme:light;--bg:#f4ead5;--paper:#382c20;--muted:#695548;--line:#c7b498;--gold:#784015;--control:#f9f0df; }
#reader[data-theme=light] { color-scheme:light;--bg:#fbfaf7;--paper:#24201d;--muted:#5b534c;--line:#cdc5bc;--gold:#824516;--control:#f6f3ef; }
#reader input { background:var(--control,#242424);color:var(--paper); }
#chapter { font-family:var(--reading-font,Georgia,serif); }
#chapter h2,#chapter h3,.chapter-copy h2,.chapter-copy h3 { font-family:inherit;margin:1em 0 .6em;font-size:1.35em;line-height:1.3; }
#chapter pre,.chapter-copy pre { overflow:auto;padding:1rem;background:var(--control,#242424); }
#chapter :is(ol,ul,pre,blockquote),.chapter-copy :is(ol,ul,pre,blockquote) { margin-block:1em; }
.chapter-copy { font:1.25rem/1.8 Georgia,serif;overflow-wrap:anywhere; }
.reader-tools { padding:.8rem 0;border-top:1px solid var(--line); }
.settings { gap:.7rem 1rem; }
.settings label,.toc-tools form { display:flex;gap:.4rem;align-items:center;flex-wrap:wrap; }
.toc-tools { display:flex;flex-wrap:wrap;gap:.75rem;padding:.6rem 0; }
.toc-tools input { width:6.5rem; }
#volume-list details { border-bottom:1px solid var(--line);padding:.2rem .75rem; }
#volume-list ol { margin:.35rem 0 .7rem; padding-inline-start:1.3rem; }
#volume-list li { padding:.25rem 0; }
#volume-list button { margin-bottom:.65rem; }
.chapter-nav { align-items:center; }
.chapter-nav button { font-size:.9rem; }
.synopsis { font:1.15rem/1.65 Georgia,serif;max-width:65ch; }
#reader .back { margin-bottom:1.4rem; }
#reader #chapter[hidden] { display:none; }
#auth-forms { grid-template-columns:repeat(2,minmax(0,1fr));max-width:55rem; }
.legal { max-width:760px; }
.legal p { max-width:70ch; }
label select { max-width:100%; }
#rich-fields>*+* { margin-top:.75rem; }
#account .actions { margin-block:1rem; }
@media(max-width:630px) { #auth-forms{grid-template-columns:1fr} .chapter-nav{flex-wrap:wrap} #reader{margin-block:0} }

.site-bar { position:relative; }
#browse-pills > summary { display:none; }
.hero h1 { max-width:10ch; text-wrap:balance; }
.menu-toggle { display:inline-flex; align-items:center; gap:.6rem; min-height:44px; }
.menu-icon { display:inline-block; width:1rem; height:.75rem; border-block:2px solid currentColor; position:relative; }
.menu-icon::after { content:""; position:absolute; inset:calc(50% - 1px) 0 auto; border-top:2px solid currentColor; }

body[data-page=home] .site-bar { justify-content:flex-start; gap:clamp(.4rem,2vw,1rem); }
.site-bar .profile-link {display:grid;place-items:center;flex:0 0 44px;height:44px;color:var(--gold);border-radius:50%}
.profile-link:focus-visible {outline:2px solid currentColor}
.profile-avatar {display:block;position:relative;width:30px;height:30px;border:2px solid currentColor;border-radius:50%;overflow:hidden}
.profile-avatar::before,.profile-avatar::after {content:"";position:absolute;left:50%;transform:translateX(-50%);background:currentColor;border-radius:50%}
.profile-avatar::before {width:9px;height:9px;top:4px}
.profile-avatar::after {width:20px;height:17px;top:16px}
.site-bar .header-search {margin-inline-start:auto}
body[data-page=home] .menu-toggle {
  margin-inline-start:auto; display:grid; place-items:center; min-width:44px; padding:0; color:var(--gold);
}
body[data-page=home] .menu-label { display:none; }
body[data-page=home] .menu-icon { width:1.35rem; height:1.05rem; }
body[data-page=home] .site-bar #site-nav {
  position:absolute; z-index:5; inset:calc(100% - .25rem) 0 auto auto;
  display:grid; justify-content:stretch; gap:0; width:min(14rem,100%);
  background:var(--surface); border:1px solid var(--line); border-radius:8px; box-shadow:0 12px 28px #0007;
}
body[data-page=home] #site-nav a {
  display:flex; align-items:center; min-height:44px; padding:.65rem 1rem; border-radius:6px;
}
body[data-page=home] #site-nav a + a { border-top:1px solid var(--line); }
body[data-page=home] #site-nav a:focus-visible { outline:2px solid var(--gold); outline-offset:-3px; }

@media (max-width:760px) {
  .site-bar { min-height:60px; }
  body[data-page=home] .site-bar:has(.menu-toggle:not([hidden])) { flex-wrap:nowrap; }
  body[data-page=home] .site-bar .brand { min-width:0; }
  .site-bar:has(.menu-toggle[hidden]) { flex-wrap:wrap; padding-block:.6rem; }
  body:not([data-page=home]) .site-bar .menu-toggle:not([hidden]) + nav { position:absolute; z-index:5; inset:100% 0 auto; display:grid; gap:0; background:var(--surface); border:1px solid var(--line); border-radius:0 0 8px 8px; box-shadow:0 12px 28px #0007; }
  body:not([data-page=home]) .site-bar .menu-toggle:not([hidden]) + nav a { padding:.75rem 1rem; min-height:44px; }
  body:not([data-page=home]) .site-bar .menu-toggle:not([hidden]) + nav a + a { border-top:1px solid var(--line); }
  .hero { min-height:0; background-position:center,center,62% center; }
  .hero-copy { padding-block:1.05rem .9rem; }
  .hero h1 { font-size:clamp(1.8rem,6.4vw,2.65rem); max-width:19ch; margin-block:.25em .3em; }
  .hero p { font-size:.95rem; line-height:1.4; margin-bottom:.55rem; max-width:37ch; }
  .hero .button { padding:.6rem .7rem; font-size:.9rem; margin:.15rem .25rem .15rem 0; }
  .collection { padding-top:.8rem; }
  #library-title { font-size:clamp(1.55rem,5.6vw,2rem); margin-bottom:.55rem; }
  #browse-tools { gap:.45rem; margin-bottom:.35rem; }
  #browse-tools > * { min-width:0; }
  #browse-pills { margin-bottom:.6rem; }
  #browse-pills > summary { display:block; width:fit-content; min-height:44px; padding:.55rem 0; }
  #library-status:empty { display:none; }
  body[data-page=home] #books { grid-template-columns:repeat(2,minmax(0,1fr)); gap:.55rem; }
  body[data-page=home] #books .cover,
  body[data-page=home] #books .cover img { height:clamp(66px,20vw,116px); }
  body[data-page=home] #books .body { padding:0 .65rem .7rem; }
  body[data-page=home] #books .tags { margin:.4rem 0; line-height:1.35; }
  body[data-page=home] #books h3 { font-size:clamp(1.06rem,4.25vw,1.35rem); overflow-wrap:anywhere; }
  body[data-page=home] #books .body p { font-size:.9rem; line-height:1.4; margin:.42rem 0 .55rem; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
  body[data-page=home] #books .actions { gap:.25rem .5rem; font-size:.875rem; }
  body[data-page=home] #books .actions a { display:inline-flex; align-items:center; min-height:36px; }
  body[data-page=home] #books .actions button { min-height:40px; padding:.3rem .55rem; }
}
@media (max-width:320px) {
  #browse-tools > * { flex:1 1 100%; }
}

/* The featured artwork retains its dark overlay in either site theme. */
.hero {
  --paper:#f0f0f0; --gold:#edaf71; --accent-bg:#edaf71; --accent-ink:#21150b;
  color:var(--paper);
}
:root[data-site-theme=light] .hero {
  background-image:linear-gradient(90deg,#141414f5 3%,#141414e8 48%,#14141440 100%),url(hero.webp);
  background-position:center,center 51%;
  background-size:cover;
}
:root[data-site-theme=light] .brand {
  background:#101010; border-radius:5px;
}
:root[data-site-theme=light] .site-bar .brand { padding:.15rem .6rem; }
#reader[data-theme=dark],#reader[data-theme=oled] {
  --accent-bg:#edaf71; --accent-ink:#21150b;
}
#reader:is([data-theme=sepia],[data-theme=light]) {
  --accent-bg:var(--gold); --accent-ink:#fff9f0;
}
.appearance { max-width:25rem; }
.appearance label { display:flex; flex-wrap:wrap; align-items:center; gap:.55rem; }

.header-search {
  display:grid; place-items:center; flex:0 0 44px; min-height:44px;
  color:var(--gold); border:1px solid var(--line); border-radius:5px;
}
.header-search span {
  position:relative; width:15px; height:15px; border:2px solid currentColor;
  border-radius:50%; transform:translate(-2px,-2px);
}
.header-search span::after {
  content:""; position:absolute; height:2px; width:7px; background:currentColor;
  top:9px; left:9px; transform:rotate(45deg); transform-origin:left;
}
body[data-page=home] .header-search { margin-inline-start:auto; }
body[data-page=home] .site-bar .menu-toggle { margin-inline-start:0; }
.site-bar .brand { min-width:0; }
#search { scroll-margin-top:1rem; }
.novel-intro:has(.novel-cover:not([hidden])) {
  display:grid; grid-template-columns:clamp(100px,28vw,210px) minmax(0,1fr);
  gap:clamp(.75rem,3vw,1.7rem); align-items:start;
}
.novel-cover {
  display:grid; place-items:center; position:relative; isolation:isolate;
  overflow:hidden; aspect-ratio:2/3; border-radius:8px;
  border:1px solid #5a5a5a; background:radial-gradient(ellipse at top,#3b3b3b,#181818 76%);
  color:#ececec; text-align:center; font:700 clamp(.85rem,2.6vw,1.35rem)/1.15 Georgia,serif;
  padding:.55rem; overflow-wrap:anywhere;
}
.novel-cover img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.novel-info { min-width:0; overflow-wrap:anywhere; }
body[data-page=novel] .novel-info h1 { font-size:clamp(1.55rem,5vw,3.1rem); }
#discussion .discussion-content { padding-bottom:.75rem; }

#toc-status { color:var(--muted); }
#toc-status:empty { display:none; }

#site-settings input[type=checkbox] { width:auto; accent-color:var(--gold); }
#site-settings .appearance label { min-height:44px; }
.stream-chapter { margin-top:3rem; border-top:1px solid var(--line); }
#chapter .stream-chapter > h2 {
  color:var(--gold); font-size:1.5em; margin:1.25rem 0;
}
#chapter-stream { margin-block:1.5rem; color:var(--muted); font:1rem/1.5 system-ui,sans-serif; }
#chapter-stream-status:empty { display:none; }
.chapter-end {
  margin-top:1.5rem; padding-block:.35rem; border-bottom:1px solid var(--line);
  color:var(--muted); font: .9rem/1.5 system-ui,sans-serif;
}

body:is([data-page=library],[data-page=novels]) #home {display:block}
body:is([data-page=library],[data-page=novels]) .hero {display:none}
body .site-bar #site-nav:not([hidden]) {position:absolute;z-index:8;inset:100% 0 auto auto;display:grid;width:min(18rem,95vw);max-height:75dvh;overflow-y:auto;gap:0;background:var(--surface);border:1px solid var(--line);border-radius:8px}
.site-bar #site-nav a {display:flex;align-items:center;min-height:44px;padding:.55rem 1rem}
.site-bar .menu-toggle:not([hidden]) {display:flex;align-items:center}

/* v18: latest updates, cover field, settings, profile, community */
.muted,.hint { color:var(--muted); }
.hint { font-size:.88rem; margin:0; }
.lead { color:var(--muted); max-width:62ch; }
.sr-file { position:absolute; width:1px; height:1px; opacity:0; overflow:hidden; pointer-events:none; }
.avatar { display:inline-grid; place-items:center; flex:0 0 auto; width:36px; height:36px; border-radius:50%; overflow:hidden; background:var(--control); border:1px solid var(--line); color:var(--gold); font:700 .95rem Georgia,serif; }
.avatar img { display:block; width:100%; height:100%; object-fit:cover; }
.avatar-lg { width:84px; height:84px; font-size:2rem; }

body:not([data-page=home]) #latest { display:none; }
.latest { padding-block:1.6rem .2rem; }
.latest h2 { font-size:clamp(1.7rem,4vw,2.4rem); margin:.1em 0 .5em; }
.latest-list { list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.6rem; }
.latest-item { display:grid; grid-template-columns:48px minmax(0,1fr) auto; align-items:center; gap:.8rem; min-height:72px; padding:.5rem .85rem .5rem .5rem; border:1px solid var(--line); border-radius:8px; background:var(--surface); }
.latest-item:hover,.latest-item:focus-visible { border-color:var(--gold); }
.latest-cover { display:grid; place-items:center; width:48px; height:72px; border-radius:5px; overflow:hidden; background:radial-gradient(ellipse at top,#3b3b3b,#181818 76%); color:#ececec; font:700 1.2rem Georgia,serif; }
.latest-cover img { width:100%; height:100%; object-fit:cover; }
.latest-text { display:grid; gap:.1rem; min-width:0; }
.latest-text strong { font-family:Georgia,serif; font-size:1.05rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.latest-text span { color:var(--muted); font-size:.9rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.latest-item time { color:var(--gold); font-size:.82rem; white-space:nowrap; }

.cover-field { display:grid; gap:.4rem; }
.cover-row { display:grid; grid-template-columns:104px minmax(0,1fr); gap:.9rem; align-items:start; }
.cover-preview { position:relative; display:grid; place-items:center; aspect-ratio:2/3; padding:.3rem; overflow:hidden; border:1px dashed var(--line); border-radius:6px; background:var(--control); color:var(--muted); font-size:.8rem; text-align:center; }
.cover-preview img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.cover-controls { display:grid; gap:.55rem; justify-items:start; min-width:0; }
.cover-controls input[type=file] { max-width:100%; padding:.4rem; }

.settings-grid,.profile-grid { column-count:2; column-gap:1rem; margin-top:1rem; }
.settings-grid .panel,.profile-grid .panel { break-inside:avoid; margin:0 0 1rem; }
.settings-grid .panel { display:grid; gap:.7rem; }
.settings-grid h2,.profile-grid h2 { margin:0 0 .4rem; }
.settings-grid label { display:flex; flex-wrap:wrap; align-items:center; gap:.55rem; min-height:44px; }
.settings-grid input[type=range] { width:min(100%,12rem); padding:0; accent-color:var(--gold); }
.settings-grid p { margin:0; }
.reading-preview { padding:1rem 1.15rem; border:1px solid var(--line); border-radius:8px; background:var(--bg); color:var(--paper); font:var(--reading-size,1.25rem)/var(--reading-spacing,1.8) var(--reading-font,Georgia,serif); }
.reading-preview p { margin:0; }
.reading-preview[data-theme=dark] { --bg:#151515; --paper:#f0f0f0; --line:#383838; }
.reading-preview[data-theme=oled] { --bg:#000; --paper:#f0eeed; --line:#343434; }
.reading-preview[data-theme=sepia] { --bg:#f4ead5; --paper:#382c20; --line:#c7b498; }
.reading-preview[data-theme=light] { --bg:#fbfaf7; --paper:#24201d; --line:#cdc5bc; }
.clear-list { display:grid; gap:.6rem; }
.clear-row { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:.5rem .8rem; }
.confirm { display:inline-flex; flex-wrap:wrap; align-items:center; gap:.5rem; }
.danger { border-color:#b5483a; color:#f0b3a8; }
:root[data-site-theme=light] .danger { color:#8a2d20; }
#clear-status:empty,#settings-account:empty { display:none; }

.profile-head { display:flex; align-items:center; gap:1rem; margin-bottom:.9rem; }
.profile-who { min-width:0; overflow-wrap:anywhere; }
.profile-who h2 { margin:0 0 .15rem; }
.profile-who p { margin:.15rem 0; }
.avatar-tools { margin-block:.2rem 1rem; }
.file-button { position:relative; cursor:pointer; margin:0; }
.file-button:focus-within { outline:2px solid var(--gold); outline-offset:3px; }
#level-line { margin:.2rem 0 .5rem; }
progress { width:100%; height:.7rem; accent-color:var(--gold); }
.stat-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.6rem; margin:1rem 0 0; }
.stat-grid div { display:flex; flex-direction:column-reverse; border:1px solid var(--line); border-radius:8px; padding:.6rem .7rem; background:var(--surface); }
.stat-grid dt { color:var(--muted); font-size:.82rem; }
.stat-grid dd { margin:0; color:var(--gold); font:700 1.6rem Georgia,serif; }
.link-list { list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.5rem; }
.link-list a { display:flex; align-items:center; min-height:44px; padding:.5rem .8rem; border:1px solid var(--line); border-radius:8px; background:var(--surface); }
.link-list a:hover { border-color:var(--gold); }
.provider-list { display:grid; gap:.6rem; }
.provider { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:.5rem .8rem; padding:.6rem .8rem; border:1px solid var(--line); border-radius:8px; background:var(--surface); }
.provider strong,.provider small { display:block; }
.provider small { color:var(--muted); overflow-wrap:anywhere; }
.badge { display:inline-block; padding:.05rem .55rem; border:1px solid var(--gold); border-radius:99px; color:var(--gold); font-size:.78rem; }
#account-tools form { max-width:26rem; }
#account-tools h3,#settings-account h3 { margin:1.2rem 0 .3rem; font-size:1.2rem; }
#account-tools h3:first-child,#settings-account h3:first-child { margin-top:0; }
#oauth-buttons { margin-block:1rem; }

.community h2 { font-size:clamp(1.5rem,3.4vw,2rem); margin:1.2rem 0 .5rem; }
.community-grid { display:grid; grid-template-columns:minmax(0,2fr) minmax(0,1fr); gap:1.4rem; align-items:start; }
.feed { list-style:none; margin:0; padding:0; display:grid; gap:.6rem; }
.feed > li.panel { margin:0; padding:.8rem 1rem; overflow-wrap:anywhere; }
.feed > li p { margin:.35rem 0; white-space:pre-wrap; }
.feed small { color:var(--muted); }
.feed .person { display:flex; align-items:center; gap:.6rem; }
.comment { display:grid; gap:.3rem; }
.comment-head { display:flex; flex-wrap:wrap; align-items:center; gap:.3rem .6rem; }
.comment-head time,.comment-head .where { color:var(--muted); font-size:.88rem; }
.comment-actions { display:flex; flex-wrap:wrap; gap:.4rem; }
.comment-actions button { min-height:36px; padding:.25rem .7rem; font-size:.85rem; }
.replies { display:grid; gap:.5rem; margin:.3rem 0 0 .6rem; padding-inline-start:.8rem; border-inline-start:2px solid var(--line); }
.reply-form { display:grid; gap:.5rem; }
.reply-form textarea { min-height:4rem; }
.reply-form button { justify-self:start; }
.comment.reply { border-bottom:0; padding:.2rem 0; }

@media(max-width:800px) {
  .settings-grid,.profile-grid { column-count:1; }
  .community-grid { grid-template-columns:1fr; }
}
@media(max-width:760px) {
  .latest { padding-top:.8rem; }
  .latest-list { grid-template-columns:1fr; }
  .latest-item { grid-template-columns:40px minmax(0,1fr) auto; gap:.65rem; min-height:64px; }
  .latest-cover { width:40px; height:60px; }
}
@media(max-width:460px) {
  .latest-item { grid-template-columns:40px minmax(0,1fr); }
  .latest-item time { grid-column:2; }
  .stat-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .link-list { grid-template-columns:1fr; }
  .cover-row { grid-template-columns:84px minmax(0,1fr); }
}
.feed .message { border-bottom:0; padding:0; }
#settings-account > p:first-child { margin-bottom:1rem; }

/* v18: button links inside workspace pages keep their dark label (".workspace a" would turn it gold on gold) */
.workspace a.button { color:var(--accent-ink); display:inline-block; }

/* v19: novel page and chapter reader */
body:is([data-page=novel],[data-page=chapter]) #reader { padding:1.25rem clamp(1rem,4vw,2.5rem) 2rem; margin-block:0; }
body[data-page=chapter] #reader { padding-bottom:calc(5.5rem + env(safe-area-inset-bottom,0px)); }

.np-title { display:flex; align-items:flex-start; justify-content:space-between; gap:.75rem; margin-bottom:1rem; }
.np-title h1 { margin:0; font:700 clamp(1.35rem,5.2vw,2rem)/1.2 system-ui,sans-serif; letter-spacing:.02em; text-transform:uppercase; overflow-wrap:anywhere; }
.icon-button { display:grid; place-items:center; flex:0 0 46px; height:46px; color:var(--gold); background:var(--control); border:1px solid var(--line); border-radius:12px; }
.np-card { display:grid; grid-template-columns:minmax(118px,36%) minmax(0,1fr); gap:.7rem; background:var(--surface); border:1px solid var(--line); border-radius:16px; overflow:hidden; }
.np-card .novel-cover { aspect-ratio:auto; min-height:100%; padding:0; border:0; border-radius:0; background:#181818; }
.np-card .novel-cover > span { padding:.6rem; }
.novel-cover .cover-back { object-fit:cover; filter:blur(14px) brightness(.55); transform:scale(1.25); }
.novel-cover .cover-front { object-fit:contain; }
.np-side { display:grid; gap:.55rem; align-content:start; min-width:0; padding:.7rem .7rem .7rem 0; }
.np-stats { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.5rem; margin:0; }
.stat { min-width:0; padding:.55rem .3rem .6rem; text-align:center; background:var(--control); border:1px solid var(--line); border-radius:12px; }
.stat dt { font-size:.66rem; letter-spacing:.09em; text-transform:uppercase; color:var(--muted); }
.stat dd { margin:.1rem 0 0; font-size:1.02rem; overflow-wrap:anywhere; }
.dot { display:inline-block; width:.6rem; height:.6rem; margin-right:.4rem; border-radius:50%; background:#8a8a8a; }
.dot-ongoing { background:#4caf6a; }
.dot-completed { background:#e0443a; }
.dot-hiatus { background:#e0a53a; }
#reader .np-library,#reader .np-start { display:flex; align-items:center; justify-content:center; gap:.4rem; min-height:48px; padding:.5rem .8rem; border-radius:12px; font-weight:650; text-align:center; }
#reader .np-library { color:var(--paper); background:var(--control); border:1px solid var(--line); }
#reader .np-library[aria-pressed=true] { color:var(--gold); border-color:var(--gold); }
#reader .np-library:not([aria-pressed=true])::before { content:"+"; font-size:1.3rem; line-height:1; }
#reader .np-start { color:var(--accent-ink); background:var(--accent-bg); border:1px solid var(--accent-bg); }
.library-status:empty { display:none; }
.chips { display:flex; gap:.45rem; margin:.9rem 0 0; padding:0 0 .55rem; list-style:none; overflow-x:auto; scrollbar-width:thin; }
.chips li { flex:0 0 auto; padding:.4rem .85rem; background:var(--control); border:1px solid var(--line); border-radius:10px; }
.np-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.4rem; margin-top:.9rem; padding:.4rem; background:var(--control); border:1px solid var(--line); border-radius:16px; }
#reader .np-tabs [role=tab] { min-height:50px; padding:.5rem; color:var(--muted); font-size:1.02rem; background:transparent; border:1px solid transparent; border-radius:12px; }
#reader .np-tabs [role=tab][aria-selected=true] { color:var(--paper); background:var(--bg); border-color:var(--line); }
.np-panel { margin-top:1rem; }
.np-panel .toc-tools { padding-top:0; }
.np-latest { margin-top:2rem; }
.np-latest h2 { margin:0 0 .8rem; padding-inline-start:.9rem; border-inline-start:3px solid var(--gold); font:650 1.5rem/1.2 system-ui,sans-serif; }
.np-latest ol { display:grid; gap:.5rem; margin:0; padding:0; list-style:none; }
.np-latest li { display:flex; justify-content:space-between; gap:1rem; padding:.75rem .9rem; background:var(--control); border:1px solid var(--line); border-radius:12px; }
.np-latest li a { min-width:0; overflow-wrap:anywhere; }
.np-latest time { flex:none; color:var(--muted); font-size:.9rem; white-space:nowrap; }
@media(min-width:640px) { .np-tabs { grid-template-columns:repeat(4,minmax(0,1fr)); } .stat dd { font-size:1.15rem; } }

.novel-bar { display:block; margin:0 0 1rem; padding:.9rem 1rem; color:var(--muted); font-size:1.02rem; line-height:1.4; background:var(--control); border:1px solid var(--line); border-radius:12px; overflow-wrap:anywhere; }
.chapter-progress { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); align-items:center; gap:.6rem; margin:0 0 1rem; }
.chapter-progress .cp-btn { display:grid; place-items:center; min-height:46px; padding:.4rem .6rem; color:var(--paper); background:var(--control); border:1px solid var(--line); border-radius:12px; }
.chapter-progress .cp-btn[aria-disabled=true] { color:var(--muted); opacity:.55; }
.cp-center { display:grid; text-align:center; line-height:1.25; }
.cp-center span { color:var(--muted); font-size:.95rem; }
#chapter-title { margin:.4rem 0 1.2rem; font:650 clamp(1.55rem,6vw,2.2rem)/1.25 system-ui,sans-serif; overflow-wrap:anywhere; }
.ch-no { margin-right:.2rem; color:var(--muted); }
#chapter-bottom { margin:1.4rem 0 0; }

.dock { position:fixed; z-index:6; left:50%; bottom:0; transform:translateX(-50%); width:min(100%,820px); padding-bottom:env(safe-area-inset-bottom,0px); background:var(--control); border-top:1px solid var(--line); box-shadow:0 -6px 24px #0006; }
.dock-sheet { display:flex; flex-direction:column; max-height:min(62dvh,34rem); background:var(--bg); }
#reader .dock-handle { display:grid; place-items:center; flex:none; width:100%; min-height:30px; padding:0; color:var(--muted); background:var(--control); border:0; border-bottom:1px solid var(--line); border-radius:0; }
.dock-panel { flex:1 1 auto; min-height:0; padding:.9rem 1rem 1.1rem; overflow:auto; overscroll-behavior:contain; }
.dock-tabs { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); background:var(--control); }
#reader .dock-tab { display:grid; justify-items:center; gap:.15rem; min-height:58px; padding:.5rem .25rem; color:var(--muted); font-size:.95rem; background:transparent; border:0; border-radius:0; }
#reader .dock-tab[aria-selected=true] { color:var(--paper); background:var(--bg); box-shadow:inset 0 3px 0 var(--gold); }
.icon { display:inline-grid; place-items:center; line-height:0; }
.dock-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.65rem; }
#reader .dock-action,.novel-card { display:flex; align-items:center; justify-content:center; gap:.6rem; min-height:56px; padding:.6rem .9rem; color:var(--paper); font-size:1.02rem; background:var(--control); border:1px solid var(--line); border-radius:12px; }
#reader .dock-actions .dock-action { justify-content:flex-start; }
.dock-actions { display:grid; gap:.55rem; }
#reader .dock-action[aria-pressed=true] { color:var(--gold); border-color:var(--gold); }
.novel-card { justify-content:flex-start; gap:.65rem; padding:.35rem .6rem .35rem .35rem; }
.novel-thumb { flex:0 0 38px; height:48px; overflow:hidden; background:#2a2a2a; border-radius:6px; }
.novel-thumb img { display:block; width:100%; height:100%; object-fit:cover; }
.novel-card-text { display:grid; flex:1; min-width:0; text-align:left; }
.novel-card-text small { color:var(--muted); font-size:.7rem; letter-spacing:.08em; }
.novel-card-text strong { overflow:hidden; font-weight:500; text-overflow:ellipsis; white-space:nowrap; }
.dock-nav { margin-bottom:.85rem; }
.dock-field + .dock-field { margin-top:1.2rem; }
.dock-field h3 { margin:0 0 .5rem; color:var(--muted); font:650 .8rem/1.2 system-ui,sans-serif; letter-spacing:.08em; text-transform:uppercase; }
.dock-heading { display:flex; align-items:center; gap:.8rem; margin-bottom:.8rem; }
.dock-heading .dock-action { min-height:44px; padding:.3rem .8rem; }
.dock-panel .hint { margin-top:.7rem; }
.segmented { display:flex; overflow:hidden; background:var(--control); border:1px solid var(--line); border-radius:14px; }
#reader .segmented button { flex:1 1 0; min-height:50px; padding:.4rem .5rem; color:var(--muted); font-size:1.02rem; background:transparent; border:0; border-radius:0; }
#reader .segmented > * + * { border-left:1px solid var(--line); }
#reader .segmented button[aria-pressed=true] { color:var(--paper); font-weight:650; background:var(--bg); }
#reader .segmented button:disabled { opacity:.4; }
.segmented output { display:grid; flex:1 1 0; place-items:center; min-height:50px; color:var(--paper); background:var(--bg); }
.swatches { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:.4rem; padding:.35rem; background:var(--control); border:1px solid var(--line); border-radius:14px; }
#reader .swatch { min-height:50px; font:600 1.15rem Georgia,serif; border:2px solid transparent; border-radius:10px; }
#reader .swatch[aria-pressed=true] { border-color:var(--gold); }
#reader .swatch-site { color:#a8a8a8; background:linear-gradient(135deg,#151515 50%,#fbf7ef 50%); }
#reader .swatch-dark { color:#f0f0f0; background:#151515; }
#reader .swatch-oled { color:#f0eeed; background:#000; }
#reader .swatch-sepia { color:#382c20; background:#f4ead5; }
#reader .swatch-light { color:#24201d; background:#fbfaf7; }
@media(max-width:360px) { .stat dd { font-size:.92rem; } #reader .dock-tab { font-size:.85rem; } }

/* v20: header search overlay, home shelves (New Novels row, Random Novels grid) */
.sr-only { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
html.searching { overflow:hidden; }
.search-overlay { position:fixed; inset:0; z-index:30; overflow:hidden; background:#000a; }
.search-top { background:var(--header); border-bottom:1px solid var(--line); }
.search-bar { min-height:74px; gap:.7rem; justify-content:flex-start; }
.search-back { flex:0 0 48px; display:grid; place-items:center; height:48px; padding:0; color:var(--gold); background:var(--control); border:1px solid var(--line); border-radius:10px; }
.search-form { position:relative; flex:1 1 auto; min-width:0; margin:0; }
.search-form input { width:100%; height:48px; padding:0 3rem; color:var(--paper); background:var(--control); border:1px solid var(--gold); border:1px solid color-mix(in srgb,var(--gold) 55%,var(--line)); border-radius:10px; font-size:1.15rem; }
.search-form input:focus { border-color:var(--gold); outline:none; box-shadow:0 0 0 2px #edaf7133; }
.search-form input::-webkit-search-cancel-button,.search-form input::-webkit-search-decoration { display:none; -webkit-appearance:none; }
.search-glass { position:absolute; inset:13px auto auto 13px; color:var(--gold); pointer-events:none; }
.search-clear { position:absolute; inset:0 0 0 auto; width:48px; display:grid; place-items:center; padding:0; color:var(--muted); background:none; border:0; border-radius:0 10px 10px 0; }
.search-clear:hover { color:var(--paper); }
.search-drop { display:flex; flex-direction:column; max-width:44rem; margin-top:.55rem; background:var(--surface); border:1px solid var(--line); border-radius:12px; box-shadow:0 18px 40px #0009; overflow:hidden; }
.search-results { list-style:none; margin:0; padding:0; overflow-y:auto; overscroll-behavior:contain; max-height:min(26rem,calc(100dvh - 19rem)); min-height:0; }
.search-results:empty { display:none; }
.search-results li + li { border-top:1px solid var(--line); }
.search-link { display:grid; grid-template-columns:54px minmax(0,1fr); align-items:center; gap:.9rem; min-height:84px; padding:.6rem .9rem; }
.search-link:hover,.search-link:focus-visible { background:var(--control); outline:none; box-shadow:inset 3px 0 0 var(--gold); }
.search-thumb { display:grid; place-items:center; width:54px; height:72px; overflow:hidden; border-radius:5px; background:radial-gradient(ellipse at top,#3b3b3b,#181818 76%); color:#ececec; font:700 1.3rem Georgia,serif; }
.search-thumb img { width:100%; height:100%; object-fit:cover; }
.search-text { display:grid; gap:.15rem; min-width:0; }
.search-text strong { font-size:1.12rem; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.search-text span { color:var(--muted); font-size:.92rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.search-status { margin:0; padding:1rem; color:var(--muted); text-align:center; overflow-wrap:anywhere; }
.search-more { display:block; flex:none; padding:.85rem 1rem; text-align:center; font-size:1.1rem; color:var(--paper); border-top:1px solid var(--line); background:var(--surface); }
.search-more:hover,.search-more:focus-visible { background:var(--control); color:var(--gold); outline:none; }
@media(max-width:700px) { .search-bar { min-height:64px; gap:.5rem; } .search-drop { max-width:none; } .search-back { flex-basis:44px; height:44px; } .search-form input { height:44px; font-size:1.05rem; } .search-glass { top:11px; } }

/* The home page lists shelves now; the full catalog with filters lives on /novels. */
body[data-page=home] #library { display:none; }
.shelf { padding-block:1.2rem .4rem; }
.shelf-head { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:.9rem; }
.shelf-head h2 { margin:0; font-size:clamp(1.55rem,4.4vw,2.1rem); }
.see-more { display:inline-flex; align-items:center; min-height:44px; padding:.35rem 1rem; color:var(--paper); background:var(--control); border:1px solid var(--line); border-radius:10px; white-space:nowrap; }
.see-more:hover,.see-more:focus-visible { border-color:var(--gold); color:var(--gold); }
.shelf-status:empty { display:none; }
.shelf-link { position:relative; display:flex; flex-direction:column; height:100%; overflow:hidden; background:var(--surface); border:1px solid var(--line); border-radius:12px; }
.shelf-link:hover,.shelf-link:focus-visible { border-color:var(--gold); }
.shelf-cover { position:relative; display:block; aspect-ratio:3/4; overflow:hidden; background:radial-gradient(ellipse at top,#3b3b3b,#181818 76%); }
.shelf-cover img { display:block; width:100%; height:100%; object-fit:cover; }
.shelf-cover > b { position:absolute; inset:0; display:grid; place-items:center; color:#ececec; font:700 clamp(2rem,10vw,3.4rem) Georgia,serif; }
.ribbon { position:absolute; inset:0 auto auto 0; width:38px; height:38px; clip-path:polygon(0 0,100% 0,0 100%); }
.ribbon-ongoing { background:#2f9d55; }
.ribbon-completed { background:#c4372c; }
.rating-badge { position:absolute; inset:.5rem .5rem auto auto; display:inline-flex; align-items:center; gap:.2rem; padding:.12rem .55rem; color:#f0f0f0; background:#121212d9; border:1px solid #5a5a5a; border-radius:7px; font-size:.95rem; line-height:1.4; }
.rating-badge b { color:#edaf71; font-weight:400; }
.shelf-body { display:flex; flex-direction:column; gap:.4rem; padding:.7rem .75rem .8rem; min-width:0; }
.shelf-title { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; font-size:1.12rem; line-height:1.3; overflow-wrap:anywhere; }
.chip { display:inline-block; max-width:100%; padding:.12rem .7rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--paper); background:var(--control); border:1px solid var(--line); border-radius:8px; font-size:1rem; }
.shelf-meta { display:flex; align-items:center; justify-content:space-between; gap:.5rem; min-width:0; }
.chap-count,.shelf-added { color:var(--muted); font-size:.95rem; white-space:nowrap; }
.shelf-added { font-size:.95rem; white-space:normal; }

.new-row { display:flex; gap:.8rem; margin:0; padding:0 0 .3rem; list-style:none; overflow-x:auto; overscroll-behavior-x:contain; scrollbar-width:none; }
.new-row::-webkit-scrollbar { display:none; }
.new-card { flex:0 0 clamp(165px,51%,236px); min-width:0; }
.scroll-track { position:relative; height:12px; margin-top:.5rem; background:var(--control); border-radius:6px; touch-action:none; cursor:pointer; }
.scroll-track.inactive { display:none; }
.scroll-track span { position:absolute; inset:0 auto 0 0; width:20%; background:#6a6a6a; border-radius:6px; }
.scroll-track:hover span { background:var(--gold); }

.random-grid { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:.7rem; margin:0; padding:0; list-style:none; }
.random-card .shelf-cover { aspect-ratio:5/7; }
.random-card .shelf-body { align-items:center; text-align:center; padding:.5rem .45rem .7rem; }
.random-card .shelf-title { font-size:1.02rem; }
.random-card .chip { font-size:.9rem; }
.chap-badge { position:absolute; inset:auto .4rem .4rem auto; padding:.05rem .5rem; color:#f0f0f0; background:#121212d9; border-radius:6px; font-size:.9rem; line-height:1.45; }
@media(max-width:900px) { .random-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } .random-card:nth-child(n+10) { display:none; } }
@media(max-width:420px) { .random-grid { gap:.5rem; } .random-card .shelf-title { font-size:.95rem; } .chip { font-size:.85rem; padding-inline:.5rem; } .rating-badge { font-size:.85rem; padding-inline:.4rem; } }

.site-bar .brand { display:inline-flex; align-items:center; gap:.6rem; min-height:44px; }
.site-bar .brand img.brand-mark { width:auto; height:clamp(30px,7vw,40px); }
.brand-short { color:#c9a44c; font:700 clamp(1.15rem,4.2vw,1.45rem) Georgia,serif; letter-spacing:.02em; white-space:nowrap; }
.site-bar .menu-toggle:not([hidden]) { min-width:44px; justify-content:center; padding:0; }
.menu-dots { font-size:1.65rem; line-height:1; }
#remove-novel:not(:empty) { margin-block:1rem; }

/* The modal drawer uses the browser's focus handling and Escape support. */
.drawer-open {overflow:hidden}
body .site-bar dialog#site-nav:not([open]) {display:none}
body .site-bar dialog#site-nav[open] {position:fixed;inset:0 0 0 auto;margin:0;display:flex;flex-direction:column;box-sizing:border-box;width:min(76vw,19rem);height:100dvh;max-height:100dvh;max-width:none;padding:1rem 1rem max(2rem,env(safe-area-inset-bottom));overflow-y:auto;overscroll-behavior:contain;background:#15110f;color:#ebd7b9;border:0;border-left:1px solid #49382b;border-radius:0;box-shadow:-12px 0 45px #0005}
#site-nav::backdrop {background:#080605ae}
#drawer-close {display:grid;place-items:center;background:none;border:0;color:#d4b693;font:2.3rem/1 system-ui;width:44px;height:44px;padding:0}
body .site-bar #site-nav a.drawer-profile {display:flex;gap:1rem;align-items:center;padding:1rem .6rem 1.5rem;color:#f0d8b7}
.drawer-profile strong {overflow-wrap:anywhere}
.drawer-profile .avatar {width:54px;height:54px;background:#392d23;color:#e9c798;font-size:1.4rem}
.drawer-stats,.drawer-links {background:#211b17;border:1px solid #342a23;border-radius:16px}
.drawer-stats {padding:1rem;margin-bottom:.75rem}
.drawer-stats div {display:flex;align-items:center;gap:.75rem;color:#c1ac94;font-size:.9rem}.drawer-stats strong {display:block;color:#f3dbb9;font-size:1.25rem}
.drawer-links {margin-block:auto;flex:none;display:grid;gap:0;padding:.25rem .85rem}
body .site-bar #site-nav .drawer-links a {display:flex;justify-content:space-between;gap:.75rem;text-align:start;align-items:center;min-height:48px;padding:.65rem .2rem;color:#e2cbae;border:0;border-radius:0}
body .site-bar #site-nav .drawer-links a+a {border-top:1px solid #332922}
.drawer-links span {flex:none;font-size:1.25rem;color:#c6aa87}
body[data-page=home] .hero.showcase {display:block;position:relative;min-height:0;background:#151311;color:white}
#feature-track {display:flex;overflow-x:auto;scroll-snap-type:x mandatory;overscroll-behavior-x:contain;scrollbar-width:none}
#feature-track::-webkit-scrollbar {display:none}
.feature-slide {position:relative;isolation:isolate;flex:none;width:100%;height:clamp(21rem,40vw,34rem);scroll-snap-align:start;display:flex;align-items:flex-end;justify-content:center;color:#fff}
.feature-slide img,.feature-slide::after {position:absolute;inset:0;width:100%;height:100%;z-index:-1}
.feature-slide img {object-fit:cover;object-position:center 38%}
.feature-slide::after {content:"";background:linear-gradient(180deg,#090a0b12 8%,#090a0b48 34%,#090a0be6 85%,#090a0b)}
.feature-text {width:min(58rem,94%);text-align:center;padding:2rem .4rem 4rem;text-shadow:0 2px 12px #000}
.feature-text strong {display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font:750 clamp(1.65rem,5vw,3.5rem)/1.12 system-ui,sans-serif;color:#f4dec2;text-wrap:balance}
.feature-genres {display:flex;justify-content:center;flex-wrap:wrap;gap:.45rem;margin-top:1rem}
.feature-genres span {border:1px solid #ab6951;background:#361e18e8;color:#ffbe9b;padding:.19rem .8rem;border-radius:2rem;font:600 .86rem/1.5 system-ui}
.feature-genres span:nth-child(2) {border-color:#557851;background:#162b1bed;color:#bce1af}
.feature-genres span:nth-child(3) {border-color:#735985;background:#291f33eb;color:#dfbfee}
.feature-genres span:nth-child(4) {border-color:#90703f;background:#302519ed;color:#ebcb90}
#feature-dots {position:absolute;bottom:.3rem;left:50%;transform:translateX(-50%);display:flex;max-width:96%}
#feature-dots button {display:grid;place-items:center;width:clamp(25px,7vw,40px);min-height:44px;border:0;background:none;padding:0}
#feature-dots button::before {content:"";width:8px;height:8px;border-radius:20px;background:#b09d8699}
#feature-dots button[aria-pressed=true]::before {width:19px;background:#8bd8d1}

#site-nav > * {flex-shrink:0}
.photo-picker {display:grid;gap:.45rem;max-width:100%;min-width:0}
.photo-picker p {margin:0}
#avatar-file,#cover-file {display:block;width:100%;min-width:0;min-height:44px;padding:.25rem;color:var(--paper);font:inherit;cursor:pointer}
#avatar-file::file-selector-button,#cover-file::file-selector-button {min-height:40px;margin-right:.5rem;padding:.45rem .7rem;border:0;border-radius:.4rem;background:var(--gold);color:#201a13;font:inherit;cursor:pointer}
@media(max-width:540px){.cover-row {grid-template-columns:1fr}.cover-preview {width:90px}}

/* Writer Zone, moderation and novel labels */
:root { --warn:#f08a7d; --good:#7fd19b; }
:root[data-site-theme=light] { --warn:#9c2f22; --good:#1d6b3a; }
.byline { margin:-.5rem 0 1rem; color:var(--muted); }
.chips .chip-special { border-color:var(--gold); color:var(--gold); font-weight:600; }
.my-novels { display:grid; gap:.9rem; margin:1rem 0; }
.writer-card { display:grid; grid-template-columns:84px minmax(0,1fr); gap:.9rem; padding:.8rem; border:1px solid var(--line); border-radius:8px; background:var(--surface); }
.writer-cover { width:84px; aspect-ratio:2/3; border-radius:6px; overflow:hidden; background:var(--control); display:grid; place-items:center; }
.writer-cover img { width:100%; height:100%; object-fit:cover; display:block; }
.writer-cover b { font-size:1.8rem; color:var(--gold); }
.writer-info { min-width:0; }
.writer-info h3 { margin:0 0 .35rem; overflow-wrap:anywhere; }
.writer-info p { margin:.35rem 0; }
.badges { display:flex; flex-wrap:wrap; gap:.35rem; margin:.25rem 0; }
.badge { display:inline-block; padding:.1rem .6rem; font-size:.85rem; border:1px solid var(--line); border-radius:999px; background:var(--control); overflow-wrap:anywhere; }
.badge-warn { color:var(--warn); border-color:var(--warn); }
.badge-good { color:var(--good); border-color:var(--good); }
.alert { padding:.5rem .7rem; border:1px solid var(--warn); border-radius:6px; color:var(--warn); overflow-wrap:anywhere; }
.kind-field { display:grid; gap:.4rem; margin:0; padding:.6rem .8rem; border:1px solid var(--line); border-radius:6px; }
.kind-field legend { padding-inline:.35rem; }
.stack label.choice, label.choice { display:flex; align-items:flex-start; gap:.6rem; }
.stack label.choice input, label.choice input { width:auto; flex:0 0 auto; margin:.3rem 0 0; }
.guidelines { margin-top:1rem; }
.guidelines li { margin:.3rem 0; }
.guidelines a { text-decoration:underline; }
#close-editor { margin:.5rem 0; }
#monetization-state { margin:.3rem 0; overflow-wrap:anywhere; }
.community-row input[type=text] { width:100%; margin:.4rem 0; }
.community-row .actions { flex-wrap:wrap; }
#community-filters button[aria-pressed=true] { background:var(--accent-bg); color:var(--accent-ink); }
#community-search { align-items:center; margin:.6rem 0; }
#community-search input { flex:1 1 14rem; min-width:0; }
@media(max-width:540px){ .writer-card { grid-template-columns:64px minmax(0,1fr); } .writer-cover { width:64px; } }
#writer-home > .hint { margin-bottom:.8rem; }
