/* A quiet archive: dark timber, plum shadows, and continuous shelf boards. */
#scene-reader .scene-library{flex:1;background:radial-gradient(ellipse at top,#51342645,transparent 65%),linear-gradient(120deg,#241822,#17121b);background-attachment:local}
#scene-reader .story-section-title{font-family:"Shippori Mincho", "Yu Mincho","Hiragino Mincho ProN",serif;letter-spacing:.15em;font-size:18px;font-weight:400;margin:0 0 18px}
#scene-reader .story-archive{padding-top:0;margin-bottom:24px;border:6px solid #3c2927;border-top-color:#674835;border-bottom-color:#291b22;border-radius:7px;background:linear-gradient(110deg,#39282b80,#1e151f99),repeating-linear-gradient(90deg,#50372f66 0 1px,#2b1e2544 1px 8px);box-shadow:inset 0 0 20px #08060c80,0 4px 12px #0b071350}
#scene-reader .story-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:180px;align-content:start;min-height:540px;gap:0;padding:0 4px;box-sizing:border-box;background:linear-gradient(180deg,#110d16 0,#271a20 12px,#302025 120px,#171019 144px,#997052 145px,#553b30 148px,#392629 156px,#100c13 161px,#1c141c 180px) 0 0 / 100% 180px repeat-y;box-shadow:inset 0 0 18px #08060c80}
#scene-reader .story-card{min-width:0;padding:12px 8px 0;box-sizing:border-box;background:transparent;box-shadow:none}
#scene-reader .story-open{display:flex;flex-direction:column;width:100%;align-items:center;border:0;padding:0;background:transparent;border-radius:0;gap:14px}
#scene-reader .story-cover{position:relative;isolation:isolate;box-sizing:border-box;display:grid;place-items:center;width:100%;height:132px;min-height:132px;border-radius:8px 9px 9px 8px;overflow:hidden;font-family:"Shippori Mincho", serif;letter-spacing:.08em;color:#dcc09b;background:linear-gradient(110deg,#432638,#291d2d 70%);box-shadow:3px 3px 0 #af977b80,5px 5px 0 #3b2a2b,0 8px 12px #08060cd9;transform-origin:bottom center}
#scene-reader .story-cover::before{content:"";position:absolute;z-index:3;inset:0 auto 0 0;width:16px;border-radius:8px 0 0 8px;background:linear-gradient(90deg,#090711b3,#d6a88b50 28%,#30142250 48%,#0b07117d 76%,transparent);border-right:1px solid #160b173d;pointer-events:none}
#scene-reader .story-cover::after{content:"";position:absolute;z-index:3;inset:0;border-radius:inherit;box-shadow:inset 0 0 0 1px #e5c8a43d,inset -2px 0 3px #0a07116b; background:linear-gradient(110deg,#ffffff0d,transparent 35%,#10081826);pointer-events:none}
#scene-reader .story-cover img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
#scene-reader .story-cover-title{box-sizing:border-box;position:relative;z-index:2;display:block;width:100%;padding:10px 6px 10px 12px;white-space:normal;overflow-wrap:anywhere;font-size:10px;line-height:1.45;letter-spacing:.02em;text-align:center}
#scene-reader .story-cover.has-image .story-cover-title{color:#fff0de;text-shadow:0 1px 4px #000,0 0 8px #000;background:#120b1855}
#scene-reader .story-kind{font-size:11px;color:#c6a083;letter-spacing:.1em}
#scene-reader .story-open:focus-visible{outline-offset:6px}
@media(hover:hover){#scene-reader .story-open:hover .story-cover{transform:translateY(-2px)}}
#scene-reader .story-share{display:flex;align-items:center;justify-content:center;gap:5px;font-size:12px;margin:12px 0;color:#ceb8ab}
#scene-reader .story-share input{width:17px;height:17px;accent-color:#b27891;flex-shrink:0}
#scene-reader .story-card-actions{display:flex;justify-content:center;gap:8px}
#scene-reader .story-card-actions button{flex:1;min-width:0;font-size:11px;padding:9px 3px;white-space:nowrap;background:transparent;border-color:#b7957d60}
#scene-reader .story-empty{grid-column:1/-1;align-self:start;padding:12px;margin:0;color:#ceb8ab;font-size:13px}
#scene-reader .story-novel,#scene-reader .story-reading{padding:22px;flex:1;min-height:0;overflow:auto;background:linear-gradient(130deg,#392734f2,#19131ff5)}
#scene-reader .story-novel label{display:block;margin-bottom:18px}
#scene-reader .story-novel input:not([type=file]),#scene-reader .story-novel textarea{box-sizing:border-box;width:100%;display:block;padding:12px;margin-top:8px;font:inherit;font-size:16px;line-height:1.8;border:1px solid #b7957d80;border-radius:12px;background:#19131f;color:#f1dfcd}
#scene-reader .story-prose{margin-top:26px;white-space:pre-wrap;overflow-wrap:anywhere;line-height:2.15;font-size:14px;font-family:"Shippori Mincho", "Yu Mincho","Hiragino Mincho ProN",serif;max-width:34em;margin-inline:auto;padding-bottom:40px}
@media(min-width:550px){#scene-reader .story-card{padding-inline:18px}#scene-reader .story-cover-title{font-size:12px}}
@media(max-width:360px){#scene-reader .story-card{padding-inline:5px}#scene-reader .story-cover-title{font-size:9.5px;padding-inline:8px}}

#scene-reader .story-filters{display:flex;gap:8px;margin-bottom:18px}
#scene-reader .story-filters button{flex:1;min-width:0;padding:9px 8px;font-size:14px;background:#201624a6;border-color:#b7957d70}
#scene-reader .story-filters button[aria-pressed=true]{background:#684151;border-color:#dab28d;color:#fff0de}
#scene-reader .story-reading-tools{display:flex;justify-content:flex-end;align-items:center;gap:12px}
#scene-reader .story-stash{display:block;width:100%;margin:0 0 20px;padding:12px 18px;font-size:15px;background:linear-gradient(#684151,#392638);border-color:#c6a083}
#scene-reader .story-registration .scene-intro{margin-top:0}
#scene-reader .story-reading-tools .story-gear{width:44px;height:44px;padding:4px;border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center}
.story-gear svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.6}
.story-gear span{font-size:8px;line-height:1.2}
#story-work-settings{box-sizing:border-box;width:min(94vw,520px);max-height:88dvh;padding:0;border:1px solid #b7957d;border-radius:20px;color:#f1dfcd;background:linear-gradient(135deg,#35202e,#17121e);overflow:auto;font:16px/1.7 system-ui,sans-serif}
#story-work-settings::backdrop{background:#0c0811b3;backdrop-filter:blur(4px)}
#story-work-settings [hidden]{display:none!important}
#story-work-settings .story-settings-content{padding:22px}
#story-work-settings label{display:block;margin-bottom:12px}
#story-work-settings input:not([type=checkbox]):not([type=file]){box-sizing:border-box;display:block;width:100%;margin-top:8px;padding:12px;font:inherit;font-size:16px;color:inherit;background:#19131f;border:1px solid #b7957d80;border-radius:12px}
#story-work-settings button,#story-work-settings .scene-import{box-sizing:border-box;font:inherit;color:inherit;padding:10px 16px;background:#362232;border:1px solid #b7957d;border-radius:24px;cursor:pointer}
#story-work-settings .scene-import{position:relative;margin:0;text-align:center;overflow:hidden}
#story-work-settings .scene-import input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
#story-work-settings .story-settings-cover,#story-work-settings .scene-secondary{display:flex;flex-wrap:wrap;gap:10px;margin:20px 0 12px}
#story-work-settings .story-share{display:flex;align-items:center;gap:8px;margin-top:22px}
#story-work-settings input[type=checkbox]{width:18px;height:18px;accent-color:#b27891}
#story-work-settings .scene-help{font-size:13px;line-height:1.8;color:#ceb8ab}
#story-work-settings [data-status]{color:#e5b7c9;overflow-wrap:anywhere}
#story-work-settings button:disabled{opacity:.45}
#story-work-settings :focus-visible{outline:2px solid #f1cfb5;outline-offset:3px}

#scene-reader .story-backups{margin-top:26px;padding-top:18px;border-top:1px solid #b7957d50}
#scene-reader .story-backups h3{font:18px/1.6 "Shippori Mincho", "Yu Mincho","Hiragino Mincho ProN",serif;margin:0}
#scene-reader .story-backups [data-status]{font-size:14px;line-height:1.8;color:#e5b7c9;overflow-wrap:anywhere}

/* The archive illustration stays behind the scrollable shelf and reading panes. */
#scene-reader{background:#130d17 url('assets/images/backgrounds/story-archive.webp') center / cover no-repeat}
#scene-reader .scene-library{background:linear-gradient(#09060c12,#09060c26);background-attachment:scroll}
#scene-reader .story-reading{background:linear-gradient(#08060c4d,#08060c70)}
#scene-reader .scene-stage{background:#08060c33}
#scene-reader .scene-text-panel{background-color:#0c0813a6}
#scene-reader .story-archive{margin-bottom:24px}
#scene-reader .story-library-footer{min-height:clamp(150px,26dvh,240px);box-sizing:border-box;padding:0 4px 24px;text-align:center}
#scene-reader .story-library-footer p{margin:0;color:#dcc09b;font:13px/2 "Shippori Mincho", "Yu Mincho","Hiragino Mincho ProN",serif;letter-spacing:.06em;text-shadow:0 1px 5px #08060c,0 0 12px #08060c}

/* Reading controls follow the last page, leaving the prose undisturbed. */
#scene-reader.story-reading-active .scene-heading [data-close]{display:none}
#scene-reader .story-prose{margin-top:0}
#scene-reader .story-reading-tools{flex-direction:column;align-items:stretch;gap:28px;padding:0 0 24px}
#scene-reader .story-reading-tools .story-edit{align-self:flex-end;display:flex;align-items:center;gap:6px;border:0;border-radius:0;padding:4px 0;background:transparent;color:#d9bdab;font:14px/1.7 "Shippori Mincho", "Yu Mincho","Hiragino Mincho ProN",serif}
#scene-reader .story-edit svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.4}
#scene-reader .story-reading-back{width:100%;background:transparent;font-family:"Shippori Mincho", "Yu Mincho","Hiragino Mincho ProN",serif}

/* A simple on-device gate; the underlying work remains unencrypted. */
#scene-reader .story-cover{position:relative}
#scene-reader .story-lock-badge{position:absolute;right:6px;top:6px;display:grid;place-items:center;width:24px;height:24px;border:1px solid #c5a06d;border-radius:50%;background:#241625e8;color:#f0cf94}
#scene-reader .story-lock-badge svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
#story-work-settings .story-lock-settings{margin-top:22px;padding-top:8px;border-top:1px solid #b7957d50}
#story-pin{box-sizing:border-box;width:min(92vw,420px);max-height:88dvh;overflow:auto;padding:0;border:1px solid #b7957d;border-radius:20px;color:#f1dfcd;background:linear-gradient(135deg,#35202e,#17121e);font:15px/1.7 system-ui,sans-serif}
#story-pin::backdrop{background:#0c0811b3;backdrop-filter:blur(4px)}
#story-pin [hidden]{display:none!important}
#story-pin header{position:static;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 22px;border-bottom:1px solid #b7957d50}
#story-pin h2{position:static;margin:0;font:23px/1.5 "Shippori Mincho", "Yu Mincho","Hiragino Mincho ProN",serif}
#story-pin form{padding:22px}
#story-pin label{display:block;margin:14px 0}
#story-pin input{box-sizing:border-box;display:block;width:100%;margin-top:6px;padding:12px;font:20px/1.5 system-ui,sans-serif;letter-spacing:.2em;color:inherit;background:#19131f;border:1px solid #b7957d80;border-radius:12px}
#story-pin button{padding:10px 18px;border:1px solid #b7957d;border-radius:24px;background:#362232;color:inherit;font:inherit;cursor:pointer}
#story-pin header button{width:40px;height:40px;padding:0;font-size:24px}
#story-pin [data-submit]{background:linear-gradient(#684151,#392638);margin-right:8px}
#story-pin [data-status]{min-height:1.7em;color:#e5b7c9}
#story-pin button:disabled{opacity:.45}
#story-pin :focus-visible{outline:2px solid #f1cfb5;outline-offset:3px}


/* Gilt crescent bindings, with a quiet title panel. */
.story-cover[data-cover-color=plum],.story-color-choice[data-cover-color=plum]{--book-light:#57324e;--book-dark:#281a30}
.story-cover[data-cover-color=indigo],.story-color-choice[data-cover-color=indigo]{--book-light:#334765;--book-dark:#192438}
.story-cover[data-cover-color=crimson],.story-color-choice[data-cover-color=crimson]{--book-light:#693442;--book-dark:#361923}
.story-cover[data-cover-color=green],.story-color-choice[data-cover-color=green]{--book-light:#34564e;--book-dark:#192e2a}
.story-cover[data-cover-color=amber],.story-color-choice[data-cover-color=amber]{--book-light:#705137;--book-dark:#34271e}
.story-cover[data-cover-color=ink],.story-color-choice[data-cover-color=ink]{--book-light:#44414e;--book-dark:#211e29}
#scene-reader .story-cover:not(.has-image){background:radial-gradient(ellipse at 55% 30%,#ffffff09,transparent 65%),linear-gradient(110deg,var(--book-light),var(--book-dark) 85%)}
#scene-reader .story-cover img.story-cover-ornament{object-fit:fill;pointer-events:none;z-index:1}
#scene-reader .story-cover:not(.has-image) .story-cover-title{padding:32px 9px 27px 19px;max-height:100%;overflow:hidden;text-shadow:0 1px 3px #100a16}
#scene-reader .story-lock-badge{z-index:4}
#story-work-settings .story-cover-palette{border:1px solid #b7957d60;border-radius:12px;padding:12px;margin:22px 0 12px;min-width:0}
#story-work-settings .story-cover-palette legend{font-family:"Shippori Mincho", "Yu Mincho","Hiragino Mincho ProN",serif;color:#dbc29c;padding:0 8px}
#story-work-settings [data-cover-colors]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
#story-work-settings .story-color-choice{display:flex;flex-direction:column;align-items:center;gap:6px;padding:8px 4px;border-radius:9px;border-color:#b7957d50;background:#17121e;font-size:12px}
#story-work-settings .story-color-choice[aria-pressed=true]{border-color:#ecd298;background:#62435655;box-shadow:0 0 0 1px #ecd29850}
#story-work-settings .story-color-swatch{width:34px;height:45px;border-radius:3px;box-shadow:2px 2px 0 #b7957d60;background:url('/assets/images/ui/story-cover-ornament.svg') center/100% 100%,linear-gradient(110deg,var(--book-light),var(--book-dark))}
#story-work-settings .story-color-choice:focus-visible{outline:2px solid #ecd298;outline-offset:3px}
#story-work-settings [data-color-save]{margin-top:14px;width:100%}
#story-work-settings [data-color-save]:disabled{opacity:.45;cursor:default}
#story-work-settings [data-color-status]{margin:8px 0 0;min-height:1.7em}
