/* NOCTE 2026-11-09. Additive visual repair; original art, routes and reading state stay intact. */
@font-face{font-family:'Nocte Academy';src:url('/assets/fonts/PretendardVariable.woff2') format('woff2');font-style:normal;font-weight:400 600;font-display:swap}
@font-face{font-family:'Pretendard Variable';src:url('/assets/fonts/PretendardVariable.woff2') format('woff2');font-style:normal;font-weight:100 900;font-display:swap}
:root{--serif:'Nocte Academy','AppleMyungjo','Batang',serif}
/* Home previously opted out of quality.css, leaving the old ivory theme behind. */
:root[data-theme=light]{--outside:#e9eff2;--bg:#fff;--panel:#f4f8fa;--panel2:#e6eef0;--text:#1b3735;--muted:#587075;--line:#c3d3d8;--soft:#2b635a;--accent:#214f44;--foil:#77969c;--paper:#fff;--paper-ink:#1b3735}
:root[data-theme=dark]{--outside:#080f11;--bg:#0c1b1a;--panel:#122724;--panel2:#1c3731;--text:#edf5f3;--muted:#adbfbd;--line:#365850;--soft:#b7cfca;--accent:#d1e4df;--foil:#7eaaa2;--paper:#102622;--paper-ink:#edf5f3}
body[data-quality=off] .category-bar button.active:after{height:2px;background:var(--accent)}
body[data-quality=off] .bottom-nav{border-top:1px solid var(--line);box-shadow:0 -4px 20px #193b3705}
body[data-quality=off] .section-title h2,body[data-quality=off] .how-section h2{font-family:var(--serif);font-weight:500;color:var(--text)}

/* Silver-edged emerald panels, with readable body type and reserved display type. */
body[data-quality=on]{--text:#1b3735;--muted:#526c70;--soft:#2b635a;--accent:#214f44;--metal-mid:#a5bec3;--metal-edge:#6b9294;--button:#214f44;--button-rim:#10372f;--surface-radius:6px}
:root[data-theme=dark] body[data-quality=on]{--bg:#0c1b1a;--panel:#122724;--panel2:#1b3932;--text:#edf5f3;--muted:#adbfbd;--soft:#b7cfca;--accent:#d1e4df;--line:#365850;--metal-hi:#d6e7e1;--metal-mid:#769c92;--metal-edge:#a6c7bb;--button:#d8e7e1;--button-ink:#183b31;--button-rim:#87a89c}
body[data-quality=on] :is(.quality-kicker,.frame-kicker,.result-position,.daily-english){color:var(--soft);letter-spacing:.13em}
body[data-quality=on] :is(.utility-page h1,.detail-intro h2,.chapter-section>h2,.detail-guide h2,.faq-section h2,.result-heading h1,.result-card-copy h2,.closing-card h2,.daily-heading h1){font-family:var(--serif);font-weight:500;letter-spacing:-.025em;text-wrap:balance}
body[data-quality=on] :is(.detail-intro>p,.chapter-section p,.dialogue-line,.result-card-copy>p,.closing-card p,.daily-message,.prose p){font-family:'Pretendard Variable',sans-serif;line-height:1.95;letter-spacing:-.015em;word-break:keep-all;overflow-wrap:anywhere}
body[data-quality=on] :is(.chapter-section,.detail-guide,.faq-section){background:var(--bg)}
body[data-quality=on] .chapter-section article{margin:14px 0;padding:23px 24px;background:linear-gradient(115deg,var(--panel),var(--bg));border:1px solid var(--line);border-left:3px solid var(--metal-edge);box-shadow:inset 0 1px 0 var(--metal-hi);border-radius:6px}
body[data-quality=on] .chapter-section h3{font-family:var(--serif);font-size:21px;font-weight:500;color:var(--text);line-height:1.55}
body[data-quality=on] .quote-frame{background:linear-gradient(115deg,var(--panel),var(--bg));font-family:var(--serif)}
body[data-quality=on] .quote-frame p{font-size:21px;line-height:1.85;color:var(--text)}
body[data-quality=on] .result-card-copy{margin:4px 0 14px;padding:28px 30px;background:linear-gradient(115deg,var(--panel),var(--bg));border-radius:7px}
body[data-quality=on] .result-card-copy h2{font-size:29px}
body[data-quality=on] .result-card-copy>p{font-size:16px;color:var(--muted)}
body[data-quality=on] .result-card-copy strong{color:var(--text);font-weight:650}
body[data-quality=on] .quality-frame{border-radius:7px}
body[data-quality=on] .quality-frame .quality-frame-art svg{display:block}
body[data-quality=on] .chapter-section article{position:relative;padding-left:57px}
body[data-quality=on] .chapter-section article>span{position:absolute;top:27px;left:22px}
body[data-quality=on] .chapter-section article:last-child{border:1px solid var(--line);border-left:3px solid var(--metal-edge)}
body[data-quality=on] .quality-crest{background:var(--panel)}
body[data-quality=on] .topbar>span{min-width:0;overflow-wrap:anywhere}

/* The desktop flex row inherited width:100% from finish.css on its button,
   while quality.css gave the input width:0. Explicit grid tracks fix both. */
body[data-quality=on] .dialogue-frame .name-line{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:stretch;gap:12px;width:100%}
body[data-quality=on] .dialogue-frame .name-line input{width:100%;min-width:0;min-height:54px;flex:none;padding:12px 15px;border:1px solid var(--metal-mid);border-bottom-width:2px;border-radius:5px;background:var(--panel);color:var(--text);font-family:'Pretendard Variable',sans-serif;font-size:16px;line-height:1.7;box-sizing:border-box}
body[data-quality=on] .dialogue-frame .name-line input::placeholder{color:var(--muted);opacity:1}
body[data-quality=on] .dialogue-frame .name-line .pill-button{width:auto;min-width:144px;max-width:100%;justify-self:stretch;align-self:stretch;padding:12px 20px;white-space:nowrap;min-height:54px}
body[data-quality=on] .question-bottom{display:flex;align-items:center;justify-content:space-between;gap:16px}
body[data-quality=on] .question-bottom .pill-button{width:auto;min-width:160px;flex:0 0 auto}
body[data-quality=on] .frame-inner textarea{width:100%;box-sizing:border-box;min-height:136px;line-height:1.85;border-radius:5px}
body[data-quality=on] .dialogue-responses button,body[data-quality=on] .choice-list button{border-radius:5px;border:1px solid var(--metal-mid);background:linear-gradient(120deg,var(--panel),var(--bg));color:var(--text);min-height:48px}
body[data-quality=on] .dialogue-reply{border-left:2px solid var(--metal-edge);color:var(--muted);background:var(--panel);font-size:12px;padding:10px 13px}

/* A portrait is not a landscape cover image. Preserve its aspect ratio at
   every width; only the separate room backdrop fills the wide composition. */
body[data-quality=on] .flow-page:not(.draw-page){--shell:min(100vw,960px)}
body[data-quality=on] .app-shell:has(.flow-page:not(.draw-page)){max-width:960px}
body[data-quality=on] .flow-page:not(.draw-page) .dialogue-scene-layer{width:min(100vw,960px);max-width:960px;top:80px;height:calc(100dvh - 80px);background:#10221d}
body[data-quality=on] .flow-page:not(.draw-page) img.dialogue-scene-image{object-fit:contain;object-position:center top}
body[data-quality=on] .flow-page:not(.draw-page) .dialogue-scene-image.scene-composition>.scene-portrait{width:100%;height:100%;left:0;object-fit:contain;object-position:center top}
body[data-quality=on] .flow-page:not(.draw-page) .scene-setting{object-fit:cover;object-position:center;filter:brightness(.65) saturate(.72)}
body[data-quality=on] .flow-page:not(.draw-page) .flow-content{width:100%;max-width:720px;box-sizing:border-box;min-height:calc(100dvh - 80px);padding:0 26px 22px}
body[data-quality=on] .flow-page:not(.draw-page) .flow-progress{top:0;left:26px;right:26px;padding:22px 0;font-size:11px}
body[data-quality=on] .flow-page:not(.draw-page) .conversation-frame{margin:clamp(210px,36dvh,390px) 0 18px;min-height:0;background:linear-gradient(115deg,var(--panel),var(--bg));box-shadow:0 16px 38px #051b1940}
body[data-quality=on] .flow-page:not(.draw-page) .frame-inner{margin:0;padding:30px 30px 27px;min-height:0;text-align:left}
body[data-quality=on] .conversation-frame h1{font-size:clamp(23px,2.5vw,29px);line-height:1.6;margin-bottom:16px}
body[data-quality=on] .flow-page:not(.draw-page) .dialogue-line{font-size:15px;margin-bottom:22px}
body[data-quality=on] .frame-hint{font-size:11px;margin-top:17px}
body[data-quality=on] .flow-privacy{text-shadow:0 1px 4px #0009}
body[data-quality=on] .draw-page .flow-privacy{text-shadow:none}

/* A dark study inset conveys the magical-school mood while preserving the
   user's cool-white light theme and the existing silver corner ornaments. */
body[data-quality=on] .conversation-frame{--bg:#102b24;--panel:#16382f;--text:#f0f6f3;--muted:#b4cbc4;--soft:#bbd3c9;--metal-mid:#93b4aa;--metal-edge:#b5d0c6;--metal-hi:#e6f1eb;--line:#52796b;--button:#dce9e2;--button-ink:#153c2e;--button-rim:#93b4a4;color:var(--text)}
body[data-quality=on] .conversation-frame .quality-crest{background:#15362d}
body[data-quality=on] .conversation-frame .quality-frame-art{opacity:.96}
body[data-quality=on] .conversation-frame .frame-inner{color:var(--text)}
body.quality-room[data-quality=on] .dialogue-box{background:linear-gradient(115deg,#17392f,#102a24);color:#edf5f1;--text:#edf5f1;--muted:#b7cdc4;--soft:#b7d0c4;--line:#4c7363;--metal-mid:#91afa3;--metal-edge:#c0d5ca;--panel:#17392f}
body.quality-room[data-quality=on] .dialogue-copy{font-family:'Pretendard Variable',sans-serif;font-size:16px;line-height:1.95}
body.quality-room[data-quality=on] .speaker-name{font-family:var(--serif);font-size:22px;letter-spacing:.02em}
body.quality-room[data-quality=on] .comic-balloon,body.quality-room[data-quality=on] .chat-bubble{line-height:1.9;border-radius:5px}
@media(max-width:767px){
 body[data-quality=on] .flow-page:not(.draw-page) .dialogue-scene-layer{top:73px;height:calc(100dvh - 73px)}
 body[data-quality=on] .flow-page:not(.draw-page) .flow-content{min-height:calc(100dvh - 73px);padding:0 20px 18px}
 body[data-quality=on] .flow-page:not(.draw-page) .flow-progress{left:20px;right:20px;padding:17px 0;font-size:10px}
 body[data-quality=on] .flow-page:not(.draw-page) .conversation-frame{margin-top:clamp(205px,33dvh,300px)}
 body[data-quality=on] .flow-page:not(.draw-page) .frame-inner{padding:28px 22px 25px}
 body[data-quality=on] .dialogue-frame .name-line{grid-template-columns:minmax(0,1fr);gap:14px}
 body[data-quality=on] .dialogue-frame .name-line .pill-button{width:100%;min-width:0;justify-self:stretch}
 body[data-quality=on] .conversation-frame h1{font-size:23px}
 body[data-quality=on] .flow-page:not(.draw-page) .dialogue-line{font-size:14px;line-height:1.85}
 body[data-quality=on] .question-bottom{flex-direction:column;align-items:stretch;gap:13px}
 body[data-quality=on] .question-bottom .pill-button{width:100%;min-width:0}
 body[data-quality=on] .result-card-copy{padding:28px 23px;margin-top:28px}
 body[data-quality=on] .result-card-copy h2{font-size:25px}
 body[data-quality=on] .result-card-copy>p{font-size:15px}
 body[data-quality=on] .quote-frame p{font-size:19px}
 body[data-quality=on] .chapter-section article{padding:20px 21px 20px 51px}
 body[data-quality=on] .chapter-section article>span{top:24px;left:18px}
}
@media(max-width:359px){
 body[data-quality=on] .flow-page:not(.draw-page) .flow-content{padding-inline:16px}
 body[data-quality=on] .flow-page:not(.draw-page) .frame-inner{padding:27px 19px 23px}
 body[data-quality=on] .conversation-frame h1{font-size:21px}
 body[data-quality=on] .flow-page:not(.draw-page) .flow-progress{left:16px;right:16px;font-size:9px}
}
@media(max-height:600px) and (min-width:768px){
 body[data-quality=on] .flow-page:not(.draw-page) .conversation-frame{margin-top:170px}
}
@media(prefers-reduced-motion:reduce){body[data-quality=on] *{scroll-behavior:auto!important}}

/* User reference: one centered portrait canvas, with a compact lower dialogue
   panel. Never split the character and text into desktop side-by-side columns. */
body[data-quality=on] .app-shell:has(.flow-page:not(.draw-page)){width:min(100%,calc(100dvh * 9 / 16));max-width:calc(100dvh * 9 / 16);margin-inline:auto}
body[data-quality=on] .flow-page:not(.draw-page){--shell:min(100vw,calc(100dvh * 9 / 16));display:block;height:100dvh;min-height:0;background:#10221d;overflow:hidden}
body[data-quality=on] .flow-page:not(.draw-page)>.topbar{position:relative;z-index:2;height:52px;min-height:52px;padding:7px 14px;gap:10px}
body[data-quality=on] .flow-page:not(.draw-page)>.topbar .icon-button{width:36px;height:36px;min-width:36px;min-height:36px}
body[data-quality=on] .flow-page:not(.draw-page)>.topbar>span{font-size:11px}
body[data-quality=on] .flow-page:not(.draw-page)>.topbar>span:before{display:none}
body[data-quality=on] .flow-page:not(.draw-page) .dialogue-scene-slot{display:contents}
body[data-quality=on] .flow-page:not(.draw-page) .dialogue-scene-layer{position:absolute;top:52px;bottom:0;left:0;right:0;transform:none;width:100%;max-width:none;height:calc(100% - 52px);z-index:-3}
body[data-quality=on] .flow-page:not(.draw-page) .dialogue-scene-image.scene-composition>.scene-portrait{inset:15% 0 auto;width:100%;height:85%;max-width:none;object-fit:contain;object-position:center top}
body[data-quality=on] .flow-page:not(.draw-page) img.dialogue-scene-image{object-fit:contain;object-position:center top;top:15%;height:85%}
body[data-quality=on] .flow-page:not(.draw-page)>.flow-vignette{display:block;background:linear-gradient(0deg,#07120e80,transparent 45%);pointer-events:none}
body[data-quality=on] .flow-page:not(.draw-page) .flow-content{width:100%;max-width:none;height:calc(100dvh - 52px);min-height:0;margin:0;padding:0 20px 25px;display:flex;flex-direction:column;justify-content:flex-end;background:none;border:0}
body[data-quality=on] .flow-page:not(.draw-page) .flow-progress{position:absolute;top:0;left:20px;right:20px;padding:15px 0;font-size:8px}
body[data-quality=on] .flow-page:not(.draw-page) .conversation-frame{margin:0 0 13px;max-height:min(34dvh,290px);min-height:0;background:linear-gradient(115deg,#17392ff2,#102a24f2)}
body[data-quality=on] .flow-page:not(.draw-page) .frame-inner{padding:16px 16px 14px;max-height:min(34dvh,290px);min-height:0;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#769c92 transparent;overscroll-behavior:contain}
body[data-quality=on] .flow-page:not(.draw-page) .conversation-frame h1{font-size:18px;line-height:1.35;margin:0 0 7px}
body[data-quality=on] .flow-page:not(.draw-page) .dialogue-line{font-size:11px;line-height:1.6;margin:0 0 10px}
body[data-quality=on] .flow-page:not(.draw-page) .dialogue-reply{font-size:10px;line-height:1.5;padding:6px 9px;margin-bottom:10px}
body[data-quality=on] .flow-page:not(.draw-page) .name-line{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}
body[data-quality=on] .flow-page:not(.draw-page) .name-line input{min-height:44px;height:44px;padding:9px 11px;font-size:16px}
body[data-quality=on] .flow-page:not(.draw-page) .name-line .pill-button{width:auto;min-width:88px;min-height:44px;height:44px;padding:8px 10px;font-size:11px}
body[data-quality=on] .flow-page:not(.draw-page) .name-line .pill-button svg{width:13px;height:13px}
body[data-quality=on] .flow-page:not(.draw-page) .frame-hint{font-size:8px;line-height:1.4;margin-top:7px}
body[data-quality=on] .flow-page:not(.draw-page) .flow-privacy{margin:0;font-size:8px;line-height:1.5;text-align:center}
body[data-quality=on] .flow-page:not(.draw-page) .dialogue-responses,body[data-quality=on] .flow-page:not(.draw-page) .choice-list{gap:6px}
body[data-quality=on] .flow-page:not(.draw-page) .dialogue-responses button,body[data-quality=on] .flow-page:not(.draw-page) .choice-list button{min-height:44px;padding:8px 10px;font-size:11px;line-height:1.5}
body[data-quality=on] .flow-page:not(.draw-page) .frame-inner textarea{min-height:75px;height:75px;font-size:16px;line-height:1.65;padding:10px}
body[data-quality=on] .flow-page:not(.draw-page) .question-bottom{display:flex;flex-direction:row;align-items:center;gap:10px;margin-top:8px;font-size:9px}
body[data-quality=on] .flow-page:not(.draw-page) .question-bottom .pill-button{width:auto;min-width:120px;min-height:44px;font-size:11px;padding:8px 12px}
body[data-quality=on] .flow-page:not(.draw-page) .quality-corner{width:34px;height:34px}
body[data-quality=on] .flow-page:not(.draw-page) .quality-crest{width:76px;height:18px;top:-8px}
@media(max-width:359px){
 body[data-quality=on] .flow-page:not(.draw-page) .flow-content{padding-inline:16px;padding-bottom:20px}
 body[data-quality=on] .flow-page:not(.draw-page) .frame-inner{padding:16px 15px 14px}
 body[data-quality=on] .flow-page:not(.draw-page) .conversation-frame h1{font-size:17px}
 body[data-quality=on] .flow-page:not(.draw-page) .flow-progress{left:16px;right:16px;font-size:7px}
}

/* User-approved restoration of the 11/4 floating translucent capsule.
   Keep the current cool-white light palette instead of restoring old ivory. */
body[data-quality] .bottom-nav{position:fixed;z-index:30;top:auto;bottom:calc(16px + env(safe-area-inset-bottom));left:50%;right:auto;transform:translateX(-50%);width:calc(100% - 32px);max-width:408px;height:74px;min-height:74px;border:1px solid #acacb2b5;border-radius:39px;background:linear-gradient(180deg,#333333d9,#101010e8);backdrop-filter:blur(22px);-webkit-backdrop-filter:blur(22px);box-shadow:0 6px 25px #0004;padding:7px;display:flex;flex-direction:row;align-items:center;justify-content:space-around;gap:0}
body[data-quality] .bottom-nav::before{content:none;display:none}
body[data-quality] .bottom-nav button{flex:1 1 0;width:auto;min-width:44px;min-height:58px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:4px;padding:0;color:#d4d4d7;font-size:9px;font-weight:400;line-height:1.35;border:0;border-radius:28px;background:transparent;box-shadow:none}
body[data-quality] .bottom-nav svg{width:23px;height:23px;stroke-width:1.55}
body[data-quality] .bottom-nav button.active{background:#ffffff24;color:#fff;font-weight:400;box-shadow:none}
body[data-quality] .bottom-nav button.active svg{stroke-width:2}
body[data-quality] .bottom-nav button.active:first-child svg{fill:currentColor}
:root[data-theme=light] body[data-quality] .bottom-nav{background:linear-gradient(180deg,#fffffff0,#e8eff2ed);border-color:#7c989d88}
:root[data-theme=light] body[data-quality] .bottom-nav button{color:#526c70}
:root[data-theme=light] body[data-quality] .bottom-nav button.active{background:#214f4418;color:#173f35}
body[data-quality] .app-shell:has(.bottom-nav){padding-left:0}
body[data-quality] .home-main{padding-bottom:calc(120px + env(safe-area-inset-bottom))}
body[data-quality] :is(.utility-page,.daily-page){padding-bottom:calc(130px + env(safe-area-inset-bottom))}
@media(max-width:359px){
 body[data-quality] .bottom-nav{width:calc(100% - 24px);height:70px;min-height:70px;padding:5px;bottom:calc(12px + env(safe-area-inset-bottom))}
 body[data-quality] .bottom-nav button{font-size:8px;min-height:56px}
 body[data-quality] .bottom-nav svg{width:21px;height:21px}
}
