/* Chapter journal: all artwork and larger type remain inside the quest drawer. */
.quest-drawer:has(.chapter-journal){border-color:#786f5880;border-radius:18px;background:linear-gradient(150deg,#1d2827f5,#141e1df8);box-shadow:0 24px 80px #0008}
.chapter-journal{color:#e9e5d6;padding:2px 0 12px;overflow-wrap:anywhere}
.chapter-kicker{font-size:11px;line-height:1.8;color:#d7ba80;letter-spacing:.8px}
.chapter-menu-heading{padding:4px 28px 20px 2px}
.chapter-journal .chapter-menu-heading h2{font-size:24px;line-height:1.55;margin:5px 0 8px;color:#f4eddc}
.chapter-menu-heading p{font-size:13px;line-height:1.8;color:#a8b8b0}
.chapter-cover-card{position:relative;display:block;width:100%;height:350px;padding:0;text-align:left;overflow:hidden;border:1px solid #baa27380;border-radius:13px;background:#152523;isolation:isolate;box-shadow:0 12px 28px #0005}
.chapter-cover-card>img,.chapter-banner>img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;object-position:60% 45%;image-rendering:pixelated;z-index:-2}
.chapter-cover-shade{position:absolute;inset:0;background:linear-gradient(180deg,#08151235,transparent 25%,#0d1919b3 62%,#0c1919f2);z-index:-1}
.chapter-cover-card>img{object-position:right 45%}
.chapter-cover-top{position:absolute;left:18px;right:18px;top:18px;display:flex;justify-content:space-between;align-items:center;gap:8px}
.chapter-badge{padding:6px 13px;border:1px solid #dcc79d8c;border-radius:100px;background:#152420ac;color:#f4dfb2;font-size:12px;backdrop-filter:blur(6px)}
.chapter-cover-count{font-size:11px;color:#f3e9d3;background:#0c1919b8;border-radius:100px;padding:7px 10px}
.chapter-cover-copy{position:absolute;left:22px;right:22px;bottom:22px;display:grid;gap:8px}
.chapter-cover-copy>strong{font-size:29px;line-height:1.55;color:#fff0d0;letter-spacing:0;text-shadow:0 2px 12px #0009}
.chapter-cover-description{font-size:13px;line-height:1.8;color:#d4ddd5}
.chapter-open-label{display:flex;align-items:center;justify-content:space-between;margin-top:10px;padding-top:12px;border-top:1px solid #dbbf814d;color:#ebca8e;font-size:14px;font-weight:700}
.chapter-open-label>span{font-size:22px;font-weight:400}
.chapter-cover-card:hover{border-color:#dfc18a;box-shadow:0 12px 32px #0007}
.chapter-menu-progress,.chapter-page-progress{padding:18px 2px 0}
.chapter-menu-progress>span,.chapter-page-progress>span{display:flex;justify-content:space-between;gap:8px;font-size:12px;color:#afc0b5}
.chapter-menu-progress b,.chapter-page-progress b{color:#e3c891;font-weight:500}
.chapter-progress{height:4px;background:#364742;margin-top:10px;border-radius:10px;overflow:hidden}
.chapter-progress i{display:block;height:100%;background:linear-gradient(90deg,#88b6a4,#dfbc82)}
.chapter-menu-progress>p{margin-top:10px;font-size:12px;line-height:1.85;color:#c7d3cb}
.chapter-journal .chapter-menu-synopsis{font-size:13px;line-height:1.95;color:#aabcb2;margin:18px 2px}
.chapter-other-button{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:16px;border:1px solid #58706570;border-radius:10px;text-align:left;background:#20322d80;color:#d9dfd4;min-height:64px}
.chapter-other-button>span:first-child{display:grid;gap:6px;min-width:0}
.chapter-other-button strong{font-size:14px;font-weight:500}
.chapter-other-button small{font-size:11px;line-height:1.8;color:#9cb5a7}
.chapter-other-button>span:last-child{font-size:20px;color:#ceb384}
.chapter-back{display:block;min-height:44px;padding:8px 0;margin:0 28px 12px 0;color:#d7c299;font-size:13px}
.chapter-banner{position:relative;isolation:isolate;min-height:205px;display:flex;align-items:flex-end;padding:22px;border:1px solid #b69d6c70;border-radius:12px;overflow:hidden;background:#192827}
.chapter-banner::before{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(180deg,#10201c15,#0d1c1bd9)}
.chapter-journal .chapter-banner h2{font-size:27px;line-height:1.55;margin:5px 0;color:#ffedca;text-shadow:0 2px 12px #0009}
.chapter-banner p{font-size:12px;line-height:1.8;color:#d0d9d0}
.chapter-list-heading{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:10px;margin:24px 0 16px}
.chapter-list-heading h3{font-size:16px;color:#eadac0;font-weight:500}
.chapter-current-button{font-size:12px;min-height:44px;padding:8px 11px;border:1px solid #7f947750;border-radius:6px;color:#cddcc7;background:#263c313f}
.chapter-episodes{gap:10px}
.chapter-episode{border:1px solid #53685d80;border-radius:9px;background:#1a2925e0;overflow:hidden;scroll-margin-top:12px}
.chapter-episode summary{padding:15px 12px;gap:12px;min-height:80px}
.chapter-episode-number{display:grid;place-items:center;flex:0 0 34px;width:34px;height:34px;border:1px solid #b6a37475;border-radius:50%;color:#dac18f;background:#af985314;font-size:12px;font-variant-numeric:tabular-nums}
.chapter-episode .quest-row-copy strong{font-size:14px;line-height:1.7;color:#ece3cd;font-weight:500}
.chapter-episode .quest-row-copy small{font-size:11px;line-height:1.7;color:#a1b3a8}
.chapter-episode .quest-row-meta{display:grid;gap:7px;justify-items:end}
.chapter-episode .quest-status{font-size:10px;white-space:nowrap}
.chapter-episode.locked{background:#15211fe0;border-color:#42584e70}
.chapter-episode.locked .chapter-episode-number{border-color:#5d71666e;color:#94a99c;background:#20302b}
.chapter-episode.locked .quest-row-copy strong{color:#a5b6aa}
.chapter-episode.locked .quest-status{color:#81988b}
.chapter-episode.ready,.chapter-episode.available{border-color:#b8a16d99}
.chapter-episode.active .chapter-episode-number{color:#e7d7ad;border-color:#d3b77c;background:#b6994530}
.chapter-episode.completed .chapter-episode-number{color:#a8ceb8;border-color:#80a79180;background:#46645335}
.chapter-episode[open] summary{border-bottom-color:#53685d80}
.chapter-episode summary:hover{background:#2a3b3250}
.chapter-episode .quest-detail{padding:18px}
.chapter-episode .quest-detail p{font-size:13px;line-height:1.95;color:#bacabf}
.chapter-episode .chapter-episode-hint{padding:10px 12px;background:#10211d65;border-left:2px solid #b99f65;color:#d0bd92!important;margin-top:14px}
.chapter-episode .quest-detail h3{font-size:13px;margin:20px 0 12px;color:#e0cda4}
.chapter-episode .quest-objectives li{font-size:13px;line-height:1.85}
.chapter-episode .quest-objectives small{font-size:11px;line-height:1.8}
.chapter-episode .quest-objectives strong{font-size:12px}
.chapter-episode .quest-rewards li{font-size:11px;line-height:1.8;border:1px solid #8c795d35;border-radius:5px;background:#74614324;padding:7px 9px;color:#dfc793}
.chapter-journal .quest-footnote{font-size:11px;line-height:1.9;margin-top:20px}
.chapter-journal button:focus-visible{outline:2px solid #e8c891;outline-offset:3px}
.dojo-dialogue{margin:12px 0;padding:12px 14px;border-left:3px solid #c2a873;border-radius:0 7px 7px 0;background:#31433565;color:#e6dec6;overflow-wrap:anywhere}
.dojo-dialogue>strong{display:block;color:#d8c092;font-size:13px}
.dojo-dialogue p{margin:7px 0 0;font-size:15px;line-height:1.9}
.dojo-story-received{border-color:#799d70}
@media(min-width:761px){.quest-drawer:has(.chapter-journal){width:560px;max-width:calc(100vw - 40px)}}
@media(max-width:400px){.chapter-cover-card{height:320px}.chapter-cover-copy{left:16px;right:16px;bottom:18px}.chapter-cover-copy>strong{font-size:24px}.chapter-menu-heading h2{font-size:22px!important}.chapter-banner{padding:16px;min-height:190px}.chapter-journal .chapter-banner h2{font-size:23px}.chapter-episode summary{gap:8px;padding:13px 9px}.chapter-episode-number{flex-basis:28px;width:28px;height:28px;font-size:11px}.chapter-episode .quest-row-copy strong{font-size:13px}.chapter-episode .quest-status{font-size:9px}.chapter-episode .quest-detail{padding:14px}.chapter-cover-top{left:14px;right:14px}}

/* Chapter conversations share the original clinic speaking engine. */
.dojo-vn.medic-vn{display:grid;grid-template-columns:minmax(120px,.8fr) minmax(0,1.5fr);gap:0;isolation:isolate;border:1px solid #a98f5266;border-radius:16px;overflow:hidden;background:linear-gradient(135deg,#213b32,#142820);box-shadow:0 18px 50px #0004;margin:14px 0;color:#efe6cb}
.dojo-vn.medic-vn>header{grid-column:1/-1;background:#11251eee;border-bottom:1px solid #a98f5240;padding:15px 18px;color:#d8bf83;font-size:11px;letter-spacing:.06em;line-height:1.8}
.dojo-vn.medic-vn .medic-vn-stage{height:300px;min-height:0;overflow:hidden;position:relative;background:radial-gradient(ellipse at 50% 65%,#8b9c6040,transparent 68%),linear-gradient(180deg,#29493d,#182f26);border:0}
.dojo-vn.medic-vn .medic-vn-stage:after{content:'';position:absolute;bottom:38px;left:20%;right:20%;height:10px;background:#07130b70;border-radius:50%;z-index:-1}
.dojo-vn.medic-vn .medic-vn-stage img{position:absolute;width:560px;height:560px;max-width:none;max-height:none;left:50%;bottom:auto;top:-10px;margin-left:-280px;object-fit:contain;object-position:center top;image-rendering:pixelated;filter:drop-shadow(0 8px 6px #0003)}
.dojo-vn.medic-vn .medic-vn-cross{display:none}
.dojo-vn.medic-vn .medic-vn-location{left:8px;right:8px;bottom:8px;text-align:center;font-size:10px;line-height:1.7;color:#c1d0b8;background:transparent;white-space:normal}
.dojo-vn.medic-vn .medic-vn-box{min-width:0;margin:0;padding:24px 22px 18px;background:linear-gradient(135deg,#243c31,#192d25);border:0;border-left:1px solid #a98f5230;border-radius:0;display:flex;flex-direction:column;box-shadow:none}
.dojo-vn.medic-vn .medic-vn-name{font-size:23px;color:#efdba6;border-bottom:1px solid #a98f5238;padding-bottom:14px;margin-bottom:12px;line-height:1.6}
.dojo-vn.medic-vn .medic-vn-name small{display:block;font-size:11px;color:#a9bda9;margin-top:3px;font-weight:400}
.dojo-vn.medic-vn [data-vn-text]{font-size:16px;line-height:2;min-height:115px;overflow-wrap:anywhere;margin:0 0 18px;color:#e5e6d4}
.dojo-vn.medic-vn .medic-vn-controls{margin-top:auto;display:flex;flex-wrap:wrap;align-items:center;gap:12px;justify-content:space-between}
.dojo-vn.medic-vn [data-vn-page]{font-size:11px;color:#aebd9f}
.dojo-vn.medic-vn [data-vn-next]{min-height:44px;border:1px solid #ceb47590;background:linear-gradient(#dbc38b,#b99b5c);color:#19251b;font-weight:700;border-radius:8px;padding:10px 14px;font-size:12px;max-width:100%}
.dojo-vn.medic-vn .medic-vn-details{grid-column:1/-1;margin:0;border-radius:0;border:0;border-top:1px solid #a98f5235;background:#10241f;color:#bbccba;padding:13px;min-height:44px;font-size:11px;width:100%}
.dojo-vn button:focus-visible,.dojo-talk-again:focus-visible{outline:2px solid #edd399;outline-offset:-4px}
.dojo-talk-again{background:#263e31;border:1px solid #a98f5255;color:#d8c492;padding:10px 14px;border-radius:8px;margin:10px 0;min-height:44px}
.dojo-conversation-loading{padding:32px;text-align:center;border:1px solid #a98f5260;background:#20382e;border-radius:14px;color:#d8c492}
.dojo-story.medic-next,.dojo-story-received.medic-next{padding:20px;border-radius:14px;background:linear-gradient(135deg,#263d31,#182c24);border:1px solid #a98f524f}
.dojo-story h3{font-size:21px!important;color:#ecd6a3!important;line-height:1.6}
.dojo-story .medic-primary{min-height:46px;border-radius:8px}
.dojo-story .quest-objectives li{background:#10231c60;border-radius:8px;padding:12px 10px;margin:7px 0}
.dojo-story .quest-rewards{display:flex;flex-wrap:wrap;gap:7px;padding:0;list-style:none}
.dojo-story .quest-rewards li{background:#a98f521a;border:1px solid #a98f5244;padding:8px 10px;border-radius:7px;font-size:12px;color:#dcc896}
@media(max-width:600px){.dojo-vn.medic-vn{grid-template-columns:1fr}.dojo-vn.medic-vn .medic-vn-stage{height:240px}.dojo-vn.medic-vn .medic-vn-stage img{height:480px;width:480px;margin-left:-240px;bottom:auto;top:-10px}.dojo-vn.medic-vn .medic-vn-box{border-left:0;border-top:1px solid #a98f5230;padding:18px 16px}.dojo-vn.medic-vn .medic-vn-name{font-size:21px}.dojo-vn.medic-vn [data-vn-text]{font-size:15px;min-height:100px}.dojo-vn.medic-vn>header{padding:12px 14px}.dojo-story.medic-next{padding:16px}}

#game-shell .dojo-vn.medic-vn [data-vn-text]{font-size:16px;line-height:2;margin:0 0 18px;color:#e5e6d4}
#game-shell .dojo-vn.medic-vn .medic-vn-name small{font-size:11px}
@media(max-width:600px){#game-shell .dojo-vn.medic-vn [data-vn-text]{font-size:15px}}

.dojo-vn.medic-vn .medic-vn-location{z-index:2;background:#142820e8;padding:5px 8px;border-radius:5px}

/* Keep the existing quest action reachable while reading on a small screen.
   clip preserves the rounded portrait edge without making a second scroller
   that traps the sticky action inside the full-height conversation. */
@media (max-width:760px), (pointer:coarse) and (max-height:650px){
 #game-shell .dojo-vn.medic-vn{overflow:clip}
 #game-shell .dojo-vn.medic-vn .medic-vn-details,
 #game-shell .dojo-story .medic-primary{
  position:sticky;bottom:0;z-index:2;box-shadow:0 -6px 14px #10241f80;
 }
}
/* Keep quest controls in a fixed bottom row; the portrait yields to the viewport. */
#game-shell #drawer.quest-drawer:has(.quest-conversation-host){display:flex;flex-direction:column}
#game-shell #drawer.quest-drawer>#drawer-content:has(.quest-conversation-host){display:flex;flex-direction:column;flex:1;min-height:0;height:auto;overflow:hidden;padding-right:0;scrollbar-gutter:auto}
#drawer-content>[data-medic-back]{flex:none;align-self:flex-start;min-height:44px;margin:0 0 8px}
.quest-conversation-host{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
#game-shell .quest-conversation-host>.medic-vn{display:grid;flex:1;min-height:0;margin:0;grid-template-columns:minmax(120px,.7fr) minmax(0,1.3fr);grid-template-rows:auto minmax(0,1fr) auto;gap:0;border:1px solid #82754c80;border-radius:12px;overflow:hidden}
#game-shell .quest-conversation-host>.medic-vn>header{grid-column:1/-1;padding:8px 12px;font-size:11px;line-height:1.6;background:#14271f;border-bottom:1px solid #82754c50}
#game-shell .quest-conversation-host>.medic-vn>.medic-vn-stage{height:100%;min-height:0;border:0;border-radius:0}
#game-shell .quest-conversation-host>.medic-vn .medic-vn-stage img{width:420px;height:420px;left:50%;margin-left:-210px;top:0}
#game-shell .quest-conversation-host>.medic-vn>.medic-vn-box{display:flex;flex-direction:column;min-height:0;min-width:0;padding:16px;border:0;border-left:1px solid #82754c50;border-radius:0;box-shadow:none}
#game-shell .quest-conversation-host>.medic-vn .medic-vn-name{flex:none;font-size:20px;line-height:1.5;padding:0 0 8px;margin:0}
#game-shell .quest-conversation-host>.medic-vn [data-vn-text]{min-height:0;flex:1;overflow:auto;font-size:16px;line-height:1.75;margin:10px 0}
#game-shell .quest-conversation-host>.medic-vn .medic-vn-controls{flex:none;gap:8px;margin-top:auto}
#game-shell .quest-conversation-host>.medic-vn [data-vn-next]{min-height:44px;font-size:12px;padding:8px 10px}
#game-shell .quest-conversation-host>.medic-vn>.medic-vn-details{grid-column:1/-1;position:static;min-height:48px;margin:0;border-radius:0;box-shadow:none}
#game-shell .quest-conversation-host .quest-detail-page{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
#game-shell .quest-conversation-host .quest-detail-body{min-height:0;flex:1;overflow:auto;overscroll-behavior:contain;padding:0 4px 10px 0}
#game-shell .quest-conversation-host .quest-detail-actions{flex:none;padding:10px 0 0;border-top:1px solid #82754c50;background:#14251e}
#game-shell .quest-conversation-host .quest-detail-actions button{position:static;width:100%;min-height:48px;margin:0;padding:10px 12px;border:1px solid #ffe2a0;border-radius:8px;background:linear-gradient(135deg,#ffe0a0,#d9ad60);color:#17291e;font-family:inherit;font-size:15px;font-weight:700;line-height:1.55}
#game-shell .quest-conversation-host>.dojo-talk-again{flex:none;align-self:flex-start;margin:0 0 8px;min-height:44px}
#game-shell .quest-conversation-host .quest-detail-actions button:disabled{background:#28332b;border-color:#485642;color:#a5af9e;opacity:1}
#game-shell .quest-conversation-host .quest-detail-actions .quest-accept-primary{min-height:54px}
#game-shell .quest-conversation-host .dojo-story{padding:14px;display:grid;gap:8px}
#game-shell .quest-conversation-host .dojo-story h3{margin:0}
#game-shell .quest-conversation-host .dojo-story h4{font-size:14px;line-height:1.5;margin:4px 0}
#game-shell .quest-conversation-host .dojo-story .quest-objectives{gap:6px}
#game-shell .quest-conversation-host .dojo-story .quest-objectives li{margin:0;padding:8px}
#game-shell .quest-conversation-host .dojo-story .quest-rewards{gap:5px}
#game-shell .quest-conversation-host .dojo-story .quest-rewards li{padding:5px 7px}
#game-shell .quest-conversation-host [data-dojo-notice],#game-shell .quest-conversation-host [data-medic-error]{font-size:13px;line-height:1.65;color:#ffe1b1}
#game-shell .quest-conversation-host [data-dojo-notice]:empty,#game-shell .quest-conversation-host [data-medic-error]:empty{display:none}
#drawer-content>.dojo-npc-journal:has(.quest-conversation-host){display:flex;flex-direction:column;flex:1;min-height:0;gap:8px}
#drawer-content>.dojo-npc-journal:has(.quest-conversation-host)>.medic-footer{flex:none;padding-top:4px;gap:4px}
#drawer-content>.dojo-npc-journal:has(.quest-conversation-host)>.medic-footer p{display:none}
@media(max-width:600px){
 #game-shell .quest-conversation-host>.medic-vn{grid-template-columns:minmax(0,1fr);grid-template-rows:auto clamp(65px,18dvh,145px) minmax(0,1fr) auto}
 #game-shell .quest-conversation-host>.medic-vn .medic-vn-stage img{width:300px;height:300px;margin-left:-150px;top:-12px}
 #game-shell .quest-conversation-host>.medic-vn>.medic-vn-box{padding:10px 12px;border-left:0;border-top:1px solid #82754c50}
 #game-shell .quest-conversation-host>.medic-vn .medic-vn-name{font-size:18px;padding-bottom:4px}
 #game-shell .quest-conversation-host>.medic-vn [data-vn-text]{font-size:15px;line-height:1.65;margin:6px 0}
}
@media(max-height:500px){
 #game-shell .quest-conversation-host>.medic-vn>header{padding:4px 10px;font-size:10px}
 #game-shell .quest-conversation-host>.medic-vn>.medic-vn-box{padding:8px 12px}
 #game-shell .quest-conversation-host>.medic-vn .medic-vn-name{font-size:16px;padding-bottom:2px}
 #game-shell .quest-conversation-host>.medic-vn .medic-vn-name small{display:none}
 #game-shell .quest-conversation-host>.medic-vn [data-vn-text]{font-size:14px;line-height:1.55;margin:4px 0}
}

