/* Original dark parchment quest book, inspired by the supplied two-pane layout. */
#rpg #dialog .quest-book{width:min(880px,100%);max-width:880px;padding:0;border:3px ridge #ab8e55;border-radius:9px;background:#221f19;color:#e9dfc9;box-shadow:0 0 0 3px #151510,0 18px 65px #000b;overflow:hidden}
.quest-book>.close{top:9px;right:12px;z-index:2;padding:4px 9px;font-size:12px;background:#24251c;color:#e5c67d;border:1px solid #aa8846}
.quest-book-heading{display:flex;gap:10px;align-items:center;padding:11px 90px 11px 20px;border-bottom:3px ridge #957947;background:linear-gradient(90deg,#171b1c,#34454d 45%,#212820);min-height:45px}
.quest-book-heading h2{font-size:23px;font-weight:500;color:#e6e4cd;margin:0}.quest-book-heading>span{color:#d5b679;font-size:24px}.quest-book-heading small{margin-left:auto;color:#cfbea0;font-size:12px}
.quest-book-pages{display:grid;grid-template-columns:43% 57%;min-height:450px;height:min(570px,65vh)}
.quest-book-list{overflow:auto;padding:16px 13px;background:linear-gradient(90deg,#1c1e19,#343329,#23251e);border-right:5px ridge #9e8757;scrollbar-color:#b49453 #211f18;scrollbar-width:thin}
.quest-chapter{display:flex;align-items:center;gap:9px;width:100%;text-align:left;margin:0 0 8px;padding:13px 11px!important;background:linear-gradient(100deg,#4e4b39,#2d3028)!important;color:#f1d867!important;border:1px solid #716a4b!important;font-size:14px!important;font-weight:500!important}.quest-chapter>span{font-size:17px;color:#e6d8a6}
.quest-step{display:flex;gap:10px;align-items:center;text-align:left;width:100%;min-height:49px;padding:9px 12px!important;margin:0 0 6px!important;background:#1f231e!important;border:1px solid #555840!important;color:#c7c5ad!important;font-size:13px!important;font-weight:400!important}.quest-step small{display:block;margin-top:4px;font-size:10px;color:#a4a78b}.quest-step.selected{background:linear-gradient(90deg,#584d2e,#353a28)!important;border-color:#dcc36e!important;color:#fff1af!important;box-shadow:inset 3px 0 #e6c35f}.quest-step.finished>span:first-child{color:#a6b98b}.quest-book-list section{margin-bottom:14px}
.quest-book-detail{overflow:auto;position:relative;padding:26px 25px;background:radial-gradient(ellipse at 50% 35%,#4d4838,#39382e 70%,#2c2d25);box-shadow:inset 0 0 22px #131710;color:#f0e6cd;text-align:center;scrollbar-color:#b49453 #211f18;scrollbar-width:thin}
.quest-state{display:block;color:#d0ba79;font-size:11px;margin-bottom:9px}.quest-book-detail h3{padding:11px 8px;margin:0;background:#292b22;border-block:1px solid #80734e;font-size:18px;color:#f6db79;font-weight:500}.quest-book-description{font-size:14px;line-height:1.9;min-height:80px;margin:16px 0 24px;text-align:left;word-break:keep-all}.quest-book-rewards{border:1px dotted #c1a365;border-radius:8px;padding:0 14px 20px;box-shadow:inset 0 0 10px #1118}.quest-book-rewards h4{display:table;margin:-11px auto 10px;padding:0 14px;background:#464234;color:#ffe8a6;font-size:17px;font-weight:500}.quest-book-rewards>div{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.quest-book-rewards article{display:flex;align-items:center;flex-direction:column;min-width:0}.quest-book-rewards svg{width:64px;height:64px;max-width:100%;filter:drop-shadow(0 4px 2px #0006)}.quest-book-rewards b{font-size:15px;font-weight:400;color:#fff3c2;margin:4px}.quest-book-rewards small{font-size:12px;line-height:1.5;color:#ddd8be}.quest-book-note{font-size:11px!important;line-height:1.8!important;color:#aca98e!important;margin:18px 3px!important}.quest-book-action{margin-top:22px;padding:11px 22px!important;background:linear-gradient(#70603b,#423d2b)!important;border:1px solid #c4a969!important;color:#ffe7a2!important;font-size:14px!important}.quest-book-completed{color:#bdc49b;font-size:13px;margin-top:24px}
#status-messages{flex:0 0 142px;min-height:0;display:flex;flex-direction:column;margin:5px 7px;border:1px solid #8c6636;background:#2d271e;color:#e4d9b8;box-shadow:inset 0 1px 8px #0006}#status-messages header{display:flex;justify-content:space-between;align-items:center;padding:4px 7px;border-bottom:1px solid #76613a;background:#433721;font-size:11px;color:#ead49c}#status-messages header button{padding:1px 5px;font-size:10px;color:#d7c59a;background:transparent;border:1px solid #806b40}#status-message-history{min-height:0;overflow:auto;padding:4px 7px;scrollbar-width:thin;scrollbar-color:#a08448 #2d271e;font-size:12px;line-height:1.6;overflow-wrap:anywhere}#status-message-history>div{padding:2px 0;border-bottom:1px solid #c7aa6520}#status-message-history .status-empty{color:#a79f87}#status-message-history .status-earned{color:#efd077}
@media(max-width:650px){#rpg #dialog .quest-book{max-height:100%;overflow:auto}.quest-book-heading{padding:10px 70px 10px 10px;gap:5px}.quest-book-heading h2{font-size:17px}.quest-book-heading small{display:none}.quest-book-pages{grid-template-columns:1fr;height:auto;min-height:0}.quest-book-list{max-height:160px;border-right:0;border-bottom:3px ridge #9e8757;padding:8px}.quest-book-list .quest-book-note{display:none}.quest-book-detail{padding:20px 13px}.quest-book-description{min-height:0;font-size:13px}.quest-book-rewards svg{width:47px;height:47px}.quest-step{min-height:42px}.quest-chapter{padding:8px!important}#status-messages{flex-basis:115px;margin:4px 2px}#status-messages header{padding:3px;font-size:10px}#status-message-history{font-size:11px;padding:3px 4px}}

#character-details[hidden]{display:none}#character-details{position:absolute;right:8px;bottom:160px;z-index:8;width:220px;padding:13px;background:linear-gradient(110deg,#4c3d25,#302819);border:4px ridge #ad8f54;box-shadow:0 6px 20px #0009;color:#e9d9b3}#character-details header{display:flex;justify-content:space-between;border-bottom:1px solid #a08757;padding-bottom:9px;font-size:15px}#character-details header small{font-size:10px;color:#b9aa88}#rpg #character-details .derived-stats{display:grid;gap:9px;margin:12px 0;color:#e7d7af;font-size:13px}#rpg #character-details .derived-stats>span{display:flex;justify-content:space-between;align-items:center;background:none;padding:2px}#rpg #character-details .derived-stats b{background:#1c170f;border:1px inset #9e7f41;color:#f3d17c;text-align:right;min-width:75px;padding:2px 6px;font-weight:400}#character-details p{font-size:10px;color:#b4a98b;margin:7px 0 0}
#right-panel[data-status-mode=messages][data-tab=character] #side-content{flex:0 0 auto;max-height:38%;overflow:auto}#right-panel[data-status-mode=messages][data-tab=character] .equipped-grid,#right-panel[data-status-mode=messages][data-tab=character] .equipped-heading,#right-panel[data-status-mode=messages][data-tab=character] .growth-note{display:none}#right-panel[data-status-mode=messages][data-tab=character] #status-messages{flex:1 1 0;min-height:110px}#right-panel[data-status-mode=equipment] #status-messages,#right-panel[data-status-mode=compact] #status-messages{flex-basis:80px}
@media(max-width:650px){#character-details{width:160px;right:4px;bottom:165px;padding:8px}#character-details header{font-size:12px}#character-details header small{display:none}#rpg #character-details .derived-stats{font-size:11px;gap:6px}#right-panel[data-status-mode=equipment] #status-messages{flex-basis:75px}}

/* Isolate headers from the legacy global page-header sizing and flex order. */
#rpg .quest-book-heading{order:0;height:auto;min-height:52px;gap:10px;border:0;border-bottom:3px ridge #957947;box-shadow:none;flex-shrink:0}
#rpg #status-messages>header{order:0;height:27px;min-height:27px;gap:5px;padding:3px 7px;border:0;border-bottom:1px solid #76613a;box-shadow:none;flex:0 0 27px;white-space:nowrap}
#rpg #status-message-history{order:1;flex:1 1 auto}
#rpg #character-details>header{order:0;height:auto;min-height:30px;padding:0 0 8px;gap:6px;border:0;border-bottom:1px solid #a08757;box-shadow:none;background:none;white-space:nowrap}
@media(max-width:650px){#rpg .quest-book-heading{gap:5px;min-height:45px}#rpg #status-messages>header{padding:3px;gap:2px}}

/* Keep messages readable beneath compact character equipment. */
#rpg #right-panel .side-top-tools{flex:0 0 auto;justify-content:end;padding:3px 5px;grid-template-columns:auto auto}
#rpg #right-panel .side-top-tools button{padding:3px 8px;font-size:11px}
#rpg #right-panel[data-tab=character] #side-content{flex:0 1 auto}
#rpg #right-panel #status-messages{flex:1 0 150px;min-height:150px}
#rpg #right-panel[data-status-mode=messages][data-tab=character] #status-messages{flex:1 0 150px}
@media(max-width:650px){#rpg #right-panel #status-messages{flex:1 0 95px;min-height:95px}#rpg #right-panel .side-top-tools button{padding:3px 2px;font-size:10px}}

@media(min-width:651px){#rpg .equipped-grid button{min-height:52px}.equipped-grid .gear-image{width:32px;height:32px}#rpg .side-brand{padding:5px 4px;font-size:18px}}

.story-ending{padding:12px 0}.story-ending-scene{display:grid;grid-template-columns:140px minmax(0,1fr);gap:20px;align-items:center;padding:18px;border:1px solid #a48a5555;background:radial-gradient(ellipse at 10% 50%,#5b4a7144,transparent 65%)}.story-ending-art{display:flex;flex-direction:column;align-items:center;gap:8px;color:#d7c49f}.story-ending-art>svg{width:124px!important;height:150px!important;max-width:100%;flex:none}.story-ending-scene h3{color:#f0d294;font-size:20px;font-weight:400;line-height:1.5;margin:8px 0}.story-ending-reward{display:grid;gap:7px;padding:14px 18px;margin:12px 0;border:1px solid #aa8b4b55;background:#1d261f}.story-ending-reward small{color:#bfa878}.story-ending-reward strong{color:#eddbab;font-size:16px;font-weight:400}.story-ending-reward span{font-size:12px;color:#adab98}.story-ending-actions{display:flex;flex-wrap:wrap;gap:8px}@media(max-width:550px){.story-ending-scene{grid-template-columns:85px minmax(0,1fr);gap:10px;padding:10px}.story-ending-art>svg{width:80px!important;height:110px!important}.story-ending-scene h3{font-size:16px}.story-ending-scene p{font-size:12px}.story-ending-reward{padding:12px}.story-ending-actions button{flex:1;font-size:12px}}

.supply-heading{border-bottom:1px solid #a48a5555;padding-bottom:10px;margin-bottom:14px}.supply-heading>small{color:#d4b57a;font-size:12px}.supply-heading h2{margin:6px 0;font-weight:400}.supply-heading p{font-size:12px!important;margin:6px 0!important;color:#c4b79e}.supply-active{display:flex;gap:12px;align-items:center;justify-content:space-between;background:#d7b97812;padding:10px;margin-bottom:14px;border-left:2px solid #b69d65;font-size:12px}.supply-active small{display:block;color:#b6a88d;margin-top:4px}.supply-active button{font-size:11px!important;padding:7px}.supply-cards{display:grid;gap:12px}.supply-card{display:grid;grid-template-columns:80px minmax(0,1fr) 108px;gap:12px;align-items:center;padding:16px;border:1px solid #8b79534d;background:linear-gradient(110deg,#39352a,#252b23)}.supply-material-art{width:80px;height:90px;display:grid;place-items:center;background:radial-gradient(ellipse,#c6ab6833,transparent 70%)}.supply-material-art .gear-image{width:72px;height:72px;margin:0}.supply-card-copy>small{font-size:11px;color:#bdb095}.supply-card-copy h3{font-size:16px;font-weight:400;margin:5px 0;color:#ead4a5}.supply-card-copy p{font-size:12px!important;margin:8px 0!important}.supply-card-copy b{font-weight:400;color:#e9c981;white-space:nowrap}.supply-progress{height:5px;background:#141812;border:1px solid #806f454d}.supply-progress>i{display:block;height:100%;background:#ad9760}.supply-card.ready{border-color:#8da375}.supply-card.ready .supply-progress>i{background:#9bb87c}.supply-reward{display:grid;gap:7px;padding-left:12px;border-left:1px solid #8b795355;font-size:12px}.supply-reward small{font-size:11px;color:#bdb095}.supply-reward strong{font-size:18px;color:#e3c982;font-weight:400}.supply-card>button{grid-column:2/4;justify-self:end;min-width:130px}.supply-card.ready>button{background:#4c5939;border-color:#b5c490}@media(max-width:550px){.supply-active{align-items:stretch;flex-direction:column;gap:8px}.supply-card{grid-template-columns:55px minmax(0,1fr);padding:10px;gap:10px}.supply-material-art{width:55px;height:70px}.supply-material-art .gear-image{width:55px;height:55px}.supply-card-copy h3{font-size:14px}.supply-reward{grid-column:1/3;display:flex;flex-wrap:wrap;align-items:center;gap:8px;border-left:0;border-top:1px solid #8b795355;padding:10px 0 0}.supply-reward strong{font-size:16px}.supply-card>button{grid-column:1/3;justify-self:stretch;width:100%}}

.supply-heading{padding-right:54px}.supply-heading h2{font-size:22px}@media(max-width:550px){.supply-heading h2{font-size:18px}}
