/* The room is an environment layer. Reading documents remain solid paper. */
:root{--scene-strength:.8;--glass-bg:rgba(250,249,244,.73);--glass-line:rgba(255,255,255,.72);--glass-shadow:0 16px 46px rgba(34,61,51,.12)}
html[data-scene-theme=night]{--paper:#17242c;--ink:#dcebe3;--text:#e8eee7;--muted:#b3c6bb;--line:rgba(211,232,223,.25);--pale:#2d403f;--glass-bg:rgba(23,39,46,.8);--glass-line:rgba(203,232,225,.25);--glass-shadow:0 20px 50px rgba(3,13,25,.3);color-scheme:dark}
body{min-height:100vh}
.site-scene{position:fixed;inset:0;z-index:0;overflow:hidden;pointer-events:none;background:#e6e8da}
.site-scene-image{position:absolute;inset:0}
.site-scene-image::before,.site-scene-image::after{content:'';position:absolute;inset:0;background-position:center center;background-size:cover;background-repeat:no-repeat;transition:opacity .45s ease}
.site-scene-image::before{background-image:url('/backgrounds/atelier-day.webp');opacity:var(--scene-strength)}
.site-scene-image::after{background-image:url('/backgrounds/atelier-night.webp');opacity:0}
.site-scene::after{content:'';position:absolute;inset:0;background:linear-gradient(180deg,rgba(247,247,241,.05),rgba(247,247,241,.14))}
html[data-scene-theme=night] .site-scene{background:#101b26}
html[data-scene-theme=night] .site-scene-image::before{opacity:0}
html[data-scene-theme=night] .site-scene-image::after{opacity:var(--scene-strength)}
html[data-scene-room=score] .site-scene-image::before,html[data-scene-room=score] .site-scene-image::after{background-image:url('/backgrounds/scoring-desk.webp')}
html[data-scene-room=archive] .site-scene-image::before,html[data-scene-room=archive] .site-scene-image::after{background-image:url('/backgrounds/moon-archive.webp')}
html[data-scene-room=score] .site-scene-image::after{filter:brightness(.5) saturate(.82)}
html[data-scene-room=archive] .site-scene-image::before{filter:brightness(1.3) saturate(.82)}
html[data-scene-theme=night] .site-scene::after{background:linear-gradient(180deg,rgba(10,19,29,.12),rgba(10,19,29,.4))}
.header,main,footer{position:relative;z-index:1}
.header{z-index:10;max-width:1340px;margin:16px auto 0;padding:12px clamp(20px,3vw,38px);height:auto;min-height:72px;border:1px solid var(--glass-line);border-radius:14px;background:var(--glass-bg);box-shadow:var(--glass-shadow);backdrop-filter:blur(20px) saturate(135%);-webkit-backdrop-filter:blur(20px) saturate(135%)}
.header nav{gap:clamp(7px,.9vw,16px);font-size:12px}
.header nav a{color:inherit}
.header nav a:hover,.header nav a.active{color:var(--ink)}
.scene-controls{display:flex;align-items:center;gap:5px;position:relative;flex-shrink:0;margin-left:auto}
.scene-toggle,.scene-settings-toggle{border:1px solid var(--line);background:rgba(255,255,255,.26);color:var(--ink);border-radius:8px;height:36px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 9px;font-size:11px}
.scene-toggle:hover,.scene-settings-toggle:hover{background:var(--pale)}
.scene-toggle-icon{font-size:18px;line-height:1}.scene-settings-toggle{width:36px;font-size:18px}
.scene-settings{position:absolute;right:0;top:calc(100% + 13px);z-index:45;width:min(270px,calc(100vw - 36px));padding:19px;border:1px solid var(--glass-line);border-radius:12px;background:var(--glass-bg);box-shadow:var(--glass-shadow);backdrop-filter:blur(25px) saturate(140%);-webkit-backdrop-filter:blur(25px) saturate(140%)}
.scene-settings{background:rgba(250,249,244,.96)}
html[data-scene-theme=night] .scene-settings{background:rgba(22,37,44,.97)}
.scene-settings[hidden]{display:none}.scene-settings strong{display:block;font:500 17px var(--serif);margin-bottom:14px}.scene-settings label{display:flex;justify-content:space-between;margin:12px 0 7px;font-size:12px}.scene-settings select,.scene-settings input[type=range]{width:100%}.scene-settings select{background:var(--glass-bg);color:var(--text);border:1px solid var(--line);border-radius:6px;padding:8px}.scene-settings input[type=range]{accent-color:#74958b}.scene-settings p{color:var(--muted);font-size:11px;margin:12px 0 0}
main{padding-top:4px}
.hero-copy{padding:clamp(25px,3vw,44px);border:1px solid var(--glass-line);border-radius:12px;background:var(--glass-bg);box-shadow:var(--glass-shadow);backdrop-filter:blur(18px) saturate(130%);-webkit-backdrop-filter:blur(18px) saturate(130%)}
.page-top{padding:clamp(24px,3vw,38px);margin:30px 0 25px;border:1px solid var(--glass-line);border-radius:12px;background:var(--glass-bg);box-shadow:var(--glass-shadow);backdrop-filter:blur(18px) saturate(130%);-webkit-backdrop-filter:blur(18px) saturate(130%)}
.hero{gap:clamp(20px,3vw,44px)}
.hero-art{border-radius:12px;overflow:hidden;box-shadow:var(--glass-shadow);border:1px solid var(--glass-line)}
.feature,.panel,.author,.book-card,.reading-shelf-item,.editor-card,.literary-quotes,.companion-stage,.side-note,.workspace-preview{background:var(--glass-bg);border-color:var(--glass-line);box-shadow:var(--glass-shadow);backdrop-filter:blur(18px) saturate(125%);-webkit-backdrop-filter:blur(18px) saturate(125%)}
.feature,.panel,.author,.book-card,.reading-shelf-item,.editor-card{border-radius:10px}
.companion-stage{background:linear-gradient(90deg,rgba(241,248,241,.6),rgba(255,250,237,.77),rgba(232,244,242,.55));border-radius:12px}
.reading-document{background:#fffdf8;backdrop-filter:none;-webkit-backdrop-filter:none}
html[data-scene-theme=night] .reading-document:not(.reading-night){background:#f7f3e9;color:#303b38}
html[data-scene-theme=night] .reading-document:not(.reading-night) .reading-heading h1,html[data-scene-theme=night] .reading-document:not(.reading-night) .reading-chapter h2{color:#303b38}
html[data-scene-theme=night] .hero-copy>p,html[data-scene-theme=night] .hero-copy>p strong,html[data-scene-theme=night] .feature p,html[data-scene-theme=night] .book-card p,html[data-scene-theme=night] .author p,html[data-scene-theme=night] .prose,html[data-scene-theme=night] .page-top p,html[data-scene-theme=night] .companion-stage p,html[data-scene-theme=night] .reading-shelf-item p{color:#d6e4dc}
html[data-scene-theme=night] .eyebrow,html[data-scene-theme=night] .library-note,html[data-scene-theme=night] .feature .icon,html[data-scene-theme=night] .author small,html[data-scene-theme=night] .hero-foot{color:#b5cec4}
html[data-scene-theme=night] .header nav,html[data-scene-theme=night] .header nav a,html[data-scene-theme=night] footer,html[data-scene-theme=night] .reading-shelf-item span{color:#c9d8d0}
html[data-scene-theme=night] .companion-stage{background:linear-gradient(90deg,rgba(23,43,50,.82),rgba(37,53,53,.88),rgba(24,42,51,.82))}
html[data-scene-theme=night] .epilogue-dialogue span{background:#2e4345;color:#edf4e8;border-color:#688077}
html[data-scene-theme=night] .companion-epilogue{background:linear-gradient(180deg,transparent,rgba(10,24,30,.78))}
html[data-scene-theme=night] .reading-night .reading-chapter p{color:#e0e8dc}
html[data-scene-theme=night] #app label,html[data-scene-theme=night] #app .editor-tabs button,html[data-scene-theme=night] #app .editor-actions small,html[data-scene-theme=night] #app .field-hint{color:#d6e5dc}
html[data-scene-theme=night] #app :is(input,textarea)::placeholder{color:#a9bfb4;opacity:1}
html[data-scene-theme=night] .primary{background:#d7eadf;color:#19352f;border-color:#d7eadf}
html[data-scene-theme=night] .primary:hover{background:#edf7ed}
html[data-scene-theme=night] .literary-quotes,html[data-scene-theme=night] .literary-quotes q{color:#e8eee7}
html[data-scene-theme=night] .hero-art{filter:brightness(.82) saturate(.84)}
html[data-scene-theme=night] :is(input,textarea,select,.search){color:var(--text);background:rgba(19,36,42,.88);border-color:var(--line)}
html[data-scene-theme=night] :is(.mode-card,.evidence,.tag,.curve,.report-banner,.quote-strip,.editor-note,.dropzone){background:rgba(44,66,65,.7);color:var(--text);border-color:var(--line)}
html[data-scene-theme=night] .mode-card small,html[data-scene-theme=night] .dimension p,html[data-scene-theme=night] .author .english{color:#c4d8cc}
html[data-scene-theme=night] :is(.reading-actions button,.reading-actions a,.reading-preferences button,.reading-shelf-buttons button){background:#30483f;color:#edf1e8;border-color:#69826d}
.curtain-puller{padding-top:0;--puller-width:clamp(175px,18vw,225px);transform-origin:67% 0}
.curtain-puller img{display:block;width:100%;height:auto;filter:drop-shadow(0 10px 12px rgba(28,69,83,.26))}
@media(max-width:1100px){.header{margin:12px 16px 0}.header nav{order:4;flex-basis:100%}.scene-controls{order:2}.header-cta{order:3}}
@media(max-width:700px){.header{margin:8px 8px 0;padding:9px 12px;min-height:61px;align-items:center}.header .brand{font-size:18px}.header .brand-avatar{width:39px;height:39px}.scene-controls{order:2;margin-left:auto}.scene-toggle{width:35px;padding:0}.scene-toggle-text{display:none}.nav-toggle{order:3;margin-left:0}.header nav,.header.nav-open nav{top:calc(100% + 5px);left:-1px;right:-1px;border-radius:10px;background:var(--glass-bg);border-color:var(--glass-line);backdrop-filter:blur(22px);-webkit-backdrop-filter:blur(22px)}.hero-copy{padding:24px}.hero{padding-top:22px}.page-top{margin:20px 0;padding:23px}.curtain-puller{--puller-width:145px}}
@media(prefers-reduced-transparency:reduce){.header,.hero-copy,.feature,.panel,.author,.book-card,.reading-shelf-item,.editor-card,.literary-quotes,.companion-stage,.side-note,.workspace-preview{backdrop-filter:none;-webkit-backdrop-filter:none;background:var(--paper)}}
@media print{.site-scene,.scene-controls{display:none}.header,.hero-copy,.panel{background:white;box-shadow:none;backdrop-filter:none}}
@media(prefers-reduced-motion:reduce){.site-scene-image::before,.site-scene-image::after{transition:none}}
.scene-data-link{display:block;margin-top:13px;padding-top:12px;border-top:1px solid var(--line);font-size:12px;color:var(--ink)}
.scene-background-status{font-size:11px;line-height:1.7;color:var(--muted);margin:10px 0 6px}.scene-shuffle{width:100%;padding:8px 12px;border:1px solid var(--line);border-radius:5px;background:var(--glass-bg);color:var(--ink);font-size:12px;cursor:pointer}.scene-shuffle:focus-visible{outline:2px solid var(--ink);outline-offset:3px}
.home-workflow{margin:0 0 35px}.home-workflow-heading{display:flex;align-items:end;justify-content:space-between;gap:15px;margin:5px 0 14px}.home-workflow-heading h2{font:500 clamp(20px,2vw,27px) var(--serif);margin:0}.home-workflow-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.home-workflow-card{display:grid;position:relative;gap:9px;min-height:134px;padding:20px 23px;border:1px solid var(--glass-line);border-radius:9px;background:var(--glass-bg);box-shadow:var(--glass-shadow);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}.home-workflow-card:hover{transform:translateY(-3px)}.home-workflow-card span{font-size:10px;letter-spacing:.1em;color:var(--muted)}.home-workflow-card strong{font:500 21px var(--serif);color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:90%}.home-workflow-card small{font-size:11px;color:var(--muted)}.home-workflow-card b{position:absolute;right:20px;top:47px;font:20px var(--serif);color:var(--ink)}
@media(max-width:700px){.home-workflow-heading{display:block}.home-workflow-heading h2{margin-top:8px}.home-workflow-grid{grid-template-columns:1fr}.home-workflow-card{min-height:108px;padding:15px 19px;gap:5px}}
.data-panel{margin:0 0 24px}.data-panel>p{font:13px/1.9 var(--serif);max-width:65em}.data-counts{display:grid;grid-template-columns:repeat(3,1fr);gap:13px;margin-bottom:22px}.data-counts>div{padding:18px;background:rgba(245,248,241,.4);border:1px solid var(--line);border-radius:8px}.data-counts strong{display:block;font:36px Georgia,var(--serif);color:var(--ink)}.data-counts span{font-size:12px;color:var(--muted)}.data-actions{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin:26px 0 15px}.data-import{position:relative;display:inline-flex;align-items:center;justify-content:center;padding:13px 22px;border:1px solid var(--line);border-radius:5px;background:var(--glass-bg);color:var(--ink);font-size:13px;cursor:pointer}.data-import input{position:absolute;inset:0;opacity:0;width:100%;cursor:pointer}.data-status{min-height:1.7em;color:var(--ink)}.data-help{margin-bottom:65px}.data-help h2{font:500 22px var(--serif)}.data-help a{text-decoration:underline;text-underline-offset:4px}
html[data-scene-theme=night] .data-counts>div{background:rgba(38,60,63,.65)}
@media(max-width:700px){.data-counts{gap:7px}.data-counts>div{padding:12px}.data-counts strong{font-size:26px}.data-counts span{font-size:10px}}
.draft-tools{border-top:1px solid var(--line);margin-top:17px;padding-top:18px}.draft-tools-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.draft-tools-head strong{font:500 17px var(--serif)}.draft-tools-head button,.draft-snapshot-form button,.draft-snapshot button{border:1px solid var(--line);background:var(--glass-bg);color:var(--ink);border-radius:5px;padding:7px 11px;font-size:11px}.draft-preview{margin:14px 0 18px;padding:20px;background:#fffdf8;color:#303c35;border:1px solid #d9ded2;border-radius:5px;max-height:420px;overflow:auto}.draft-preview[hidden]{display:none}.draft-preview h2,.draft-preview h3,.draft-preview h4{font:500 21px/1.6 var(--serif);margin:15px 0 7px}.draft-preview p,.draft-preview blockquote{font:15px/1.9 var(--serif);margin:5px 0;white-space:pre-wrap;overflow-wrap:anywhere}.draft-preview blockquote{border-left:3px solid #a5b9a3;padding:5px 12px;color:#526759}.draft-preview-gap{height:12px}.draft-snapshot-form{display:flex;gap:8px;margin:16px 0 5px}.draft-snapshot-form input{flex:1;min-width:0;padding:8px 11px;background:var(--glass-bg);color:var(--text);border:1px solid var(--line);border-radius:5px;font-size:12px}.draft-snapshot-status{min-height:1.5em;font-size:11px;color:var(--muted)}.draft-snapshot-list{display:grid;gap:6px}.draft-snapshot-list>p{font-size:11px;color:var(--muted)}.draft-snapshot{display:flex;gap:7px;align-items:center;padding:8px 0;border-top:1px solid var(--line)}.draft-snapshot>div{flex:1;min-width:0}.draft-snapshot strong{display:block;font:500 13px var(--serif);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.draft-snapshot small{color:var(--muted);font-size:10px}.draft-snapshot button[data-remove]{font-size:16px;width:29px;height:29px;padding:0}
html[data-scene-theme=night] .draft-preview{background:#f7f3e9;color:#303c35}html[data-scene-theme=night] .draft-tools-head button,html[data-scene-theme=night] .draft-snapshot-form button,html[data-scene-theme=night] .draft-snapshot button{background:#30483f;color:#edf1e8;border-color:#69826d}
@media(max-width:700px){.draft-snapshot-form{flex-wrap:wrap}.draft-snapshot-form input{flex-basis:100%}}
.history-controls{display:flex;align-items:end;flex-wrap:wrap;gap:12px;margin:20px 0 8px}.history-controls label{display:grid;gap:5px;font-size:12px;color:var(--muted)}.history-controls select{min-width:140px;padding:9px 12px;border:1px solid var(--line);border-radius:5px;background:var(--glass-bg);color:var(--text)}.history-view-switch{display:flex;gap:4px;padding:3px;border:1px solid var(--line);border-radius:6px;background:var(--glass-bg)}.history-view-switch button{min-width:70px;min-height:38px;padding:7px 12px;border:0;border-radius:4px;background:transparent;color:var(--ink);cursor:pointer}.history-view-switch button[aria-pressed=true]{background:var(--ink);color:var(--paper)}.history-view-switch button:focus-visible{outline:2px solid var(--ink);outline-offset:2px}.history-timeline{position:relative;display:grid;gap:16px;max-width:850px;margin:20px auto 40px;padding-left:35px}.history-timeline:before{content:"";position:absolute;left:12px;top:14px;bottom:14px;width:2px;background:var(--line)}.history-timeline .book-card{position:relative}.history-timeline .book-card:before{content:"";position:absolute;left:-29px;top:25px;width:12px;height:12px;border:3px solid var(--ink);border-radius:50%;background:var(--paper)}
@media(max-width:700px){.history-controls{align-items:stretch}.history-controls label{flex:1;min-width:130px}.history-controls select{width:100%;min-width:0}.history-view-switch{width:100%}.history-view-switch button{flex:1}.history-timeline{padding-left:25px}.history-timeline:before{left:8px}.history-timeline .book-card:before{left:-23px;width:10px;height:10px}}
html[data-scene-theme=night] .history-view-switch button[aria-pressed=true]{background:#d7eadf;color:#19352f}
@media(max-width:700px){.header.nav-open nav{background:rgba(250,249,244,.98);box-shadow:0 18px 32px rgba(16,33,30,.25)}html[data-scene-theme=night] .header.nav-open nav{background:rgba(19,34,42,.98)}.header.nav-open nav a{font-size:13px;line-height:1.45;padding:13px 8px;border-bottom:1px solid var(--line)}}
