/* The scenes and characters are image assets; CSS arranges them and keeps dialogue readable. */
#floor.screen .grand-floor-topbar{grid-template-columns:auto minmax(55px,1fr) auto auto auto!important}
#floor .grand-floor-topbar .gf-header-tag{display:none!important}
#nightChronicleOpen,#characterStoryOpen{white-space:nowrap;min-height:36px;border:1px solid #d7b36b;border-radius:7px;background:#294633;color:#fff0c7;padding:6px 10px;font:700 12px/1.2 system-ui}
#character .char-topbar__meta{min-width:0;overflow:hidden;flex:1 1 auto}#characterStoryOpen{flex:0 0 auto}
#nightChronicleModal .ns-panel{background:linear-gradient(180deg,#020c09c9,#020907ed),url('./assets/ui/night-chronicle-v05443/cover.png') center/cover no-repeat!important}
#nightChronicleModal .story-library{display:flex!important;flex-direction:column;gap:7px;flex:1 1 auto;min-height:0;overflow:hidden}
#nightChronicleModal .story-library[hidden],#storyReaderModal[hidden]{display:none!important;pointer-events:none}
.story-characters{display:flex;gap:6px;min-height:58px;flex:0 0 58px;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;padding:1px 2px 3px}
#nightChronicleModal .story-character-button{display:flex!important;align-items:center;gap:5px;min-width:97px!important;width:auto!important;flex:0 0 auto;height:51px!important;min-height:51px!important;padding:4px 7px 4px 4px!important;border:1px solid #89764d!important;border-radius:7px!important;background:#142b20!important;color:#f7e9ca!important;font:700 11px/1.2 system-ui!important}
#nightChronicleModal .story-character-button[aria-pressed="true"]{border-color:#f1cf86!important;background:#634d2c!important}
.story-character-button img{width:38px;height:40px;object-fit:cover;object-position:center 10%;border-radius:4px;background:#253c2c}.story-character-button span{white-space:nowrap}
.story-library-body{display:grid;grid-template-columns:minmax(0,1fr) minmax(265px,1.1fr);gap:9px;flex:1 1 auto;min-height:0;overflow:hidden}
.story-character-hero{position:relative;display:flex;align-items:flex-end;min-width:0;overflow:hidden;isolation:isolate;background-color:#123224;background-position:center;background-size:cover;border:1px solid #ac9155;border-radius:9px}
.story-character-hero:before{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(90deg,#061710e8,#06171070 65%,#06171020)}
.story-character-hero>img{position:absolute;z-index:-1;right:0;bottom:-8%;height:112%;width:60%;object-fit:contain;object-position:right bottom;filter:drop-shadow(0 5px 6px #0008)}
.story-character-hero>div{padding:12px;max-width:68%;min-width:0;text-shadow:0 2px 4px #000}.story-character-hero small{font-size:10px;letter-spacing:.1em;color:#e3c68b}.story-character-hero h3{font:700 clamp(20px,2.6vw,34px)/1.15 Georgia,serif;margin:4px 0;color:#fff0cb}.story-character-hero p{margin:4px 0;font-size:12px;color:#d6e2d1}.story-character-hero span{display:inline-block;border-radius:5px;background:#0b251ddc;padding:5px 7px;font-size:11px;color:#f2d99e}
.story-episodes{display:flex;flex-direction:column;min-height:0;min-width:0;overflow:hidden;background:#0d281ce8;border:1px solid #7b754b;border-radius:9px;padding:9px;gap:6px}.story-episodes>header{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:0 0 auto}.story-episodes h3{margin:0;font-size:14px;color:#f3d69b}.story-episodes header span{font-size:11px;white-space:nowrap;color:#d1c598}.story-episode-list{display:grid;grid-template-columns:1fr;gap:6px;align-content:start;overflow-y:auto;min-height:0;flex:1 1 auto;padding:1px 3px 5px}
#nightChronicleModal .story-episode{display:flex!important;align-items:center;gap:8px;min-height:64px!important;height:auto!important;padding:8px!important;width:100%!important;text-align:left;white-space:normal!important;border:1px solid #9d8954!important;border-radius:7px!important;background:#1d3b29!important;color:#f7e8c5!important}
#nightChronicleModal .story-episode:disabled{opacity:.67;cursor:default;background:#17271e!important}.story-episode-label{flex:0 0 auto;font-size:10px;color:#dbc18a}.story-episode-copy{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1}.story-episode-copy strong{font-size:13px;line-height:1.3}.story-episode-copy small{font-size:10px;color:#c4d0b7;line-height:1.3}.story-episode>b{font-size:10px;white-space:nowrap;color:#ead09b}#storyLibraryStatus{margin:0;color:#bbcbb4;font-size:10px;line-height:1.3;max-height:30px;overflow:auto;flex:0 0 auto}
#storyReaderModal{position:fixed;inset:0;z-index:27000;display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding:max(8px,env(safe-area-inset-top)) max(10px,var(--safe-inline,0px),env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(10px,var(--safe-inline,0px),env(safe-area-inset-left));background:#020906f5;color:#fff2d7;opacity:1;visibility:visible;pointer-events:auto}
#storyReaderModal *{box-sizing:border-box}.story-reader-stage{position:relative;isolation:isolate;width:min(1200px,100%);height:100%;overflow:hidden;border:1px solid #c8a968;border-radius:10px;background:#10251c}
.story-reader-background{position:absolute;inset:0;z-index:-2;background-position:center;background-size:cover}.story-reader-portrait{position:absolute;z-index:-1;right:1%;bottom:-8%;height:103%;width:46%;object-fit:contain;object-position:center bottom;filter:drop-shadow(0 6px 12px #0009)}
@keyframes storyCharacterArrive{from{opacity:0;transform:translateX(8px)}to{opacity:1;transform:translateX(0)}}.story-reader-portrait{animation:storyCharacterArrive .35s ease-out both}
.story-reader-stage>header{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;padding:12px 14px;text-shadow:0 2px 5px #000}.story-reader-stage header small{font-size:11px;color:#e3ca92}.story-reader-stage h2{font:700 clamp(19px,2.4vw,30px)/1.15 Georgia,serif;margin:4px 0;color:#fff0ce}#storyReaderClose{width:44px;height:44px;min-width:44px;flex:0 0 44px;border:1px solid #d2b373;border-radius:50%;background:#0b211bcf;color:#fff1d0;font-size:24px;touch-action:manipulation}
.story-reader-dialogue{position:absolute;left:2%;bottom:3%;width:68%;max-height:60%;display:flex;flex-direction:column;gap:6px;padding:12px 14px;border:1px solid #d5b777;border-radius:10px;background:#071a15f2;box-shadow:0 5px 30px #0008}.story-reader-dialogue>div{display:flex;justify-content:space-between;align-items:center;color:#e6c786;font-size:12px}.story-reader-dialogue>p{margin:0;overflow-y:auto;min-height:0;font-size:15px;line-height:1.6;color:#fff3da;overflow-wrap:anywhere}#storyReaderStatus{font-size:11px;color:#ffd493}.story-reader-dialogue nav{display:flex;justify-content:flex-end;gap:8px;flex:0 0 auto}.story-reader-dialogue button{min-width:100px;min-height:38px;border:1px solid #c7a965;border-radius:7px;background:#385c3b;color:#fff1d0;padding:7px 13px;font:700 12px system-ui;touch-action:manipulation}.story-reader-dialogue button:disabled{opacity:.45}#storyReaderNext{background:#7d632e}#nightChronicleModal button:focus-visible,#storyReaderModal button:focus-visible{outline:2px solid #ffe5a4;outline-offset:2px}
@media(max-height:480px){#nightChronicleOpen,#characterStoryOpen{font-size:10px;padding:5px 7px;min-height:31px}.story-characters{min-height:46px;flex-basis:46px;gap:4px}#nightChronicleModal .story-character-button{height:41px!important;min-height:41px!important;min-width:81px!important;font-size:10px!important;padding:3px!important}.story-character-button img{width:31px;height:33px}.story-library-body{grid-template-columns:minmax(0,1fr) minmax(240px,1fr);gap:6px}.story-character-hero>div{padding:8px}.story-character-hero h3{font-size:20px}.story-character-hero p,.story-character-hero span{font-size:10px}.story-episodes{padding:6px;gap:4px}.story-episodes h3{font-size:12px}.story-episodes header span{font-size:10px}#nightChronicleModal .story-episode{min-height:56px!important;padding:6px!important;gap:6px}.story-episode-copy strong{font-size:12px}.story-episode-copy small{font-size:9px}#storyLibraryStatus{font-size:9px;max-height:24px}.story-reader-stage>header{padding:7px 10px}.story-reader-stage h2{font-size:19px;margin:2px 0}#storyReaderClose{width:38px;height:38px;min-width:38px}.story-reader-dialogue{padding:8px 10px;gap:4px;max-height:67%}.story-reader-dialogue>p{font-size:13px;line-height:1.45}.story-reader-dialogue>div{font-size:11px}.story-reader-dialogue button{min-height:32px;min-width:75px;padding:5px 9px}}
@media(max-width:700px) and (orientation:landscape){#floor .grand-floor-heading h2{font-size:12px!important}#floor .grand-floor-topbar{gap:4px!important}#nightChronicleOpen{padding:4px 6px!important;font-size:10px!important}#characterStoryOpen{font-size:10px;padding:4px 6px}.story-library-body{grid-template-columns:minmax(0,1fr) minmax(210px,1fr)}.story-character-hero>div{max-width:72%}.story-character-hero h3{font-size:17px}.story-reader-dialogue{width:74%}.story-reader-portrait{width:42%}}
@media(prefers-reduced-motion:reduce){.story-library *,#storyReaderModal *{animation:none!important;transition:none!important}}

/* Small status marks never cover game controls or interrupt settlement. */
#nightChronicleOpen[data-story-new="true"],#characterStoryOpen[data-story-new="true"]{box-shadow:inset 0 0 0 2px #ffe393,0 0 9px #d8b454;}
#nightChronicleModal .story-episode[data-story-new="true"]{border-color:#ffe393!important;background:#54441f!important}
