/* Root Story commitments use native public status and quotes only. */
body[data-story="true"] .story-starters17{max-width:1100px;margin:30px auto;text-align:center}.story-starters17 h1{font-size:30px;margin:0;color:#ead9a9}
.story-town-commitments17{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:12px;max-width:1040px;margin:10px auto;padding:9px 14px;background:#203128;color:#f1dfb4;border:1px solid #a38b59;border-radius:9px 4px 8px 5px}.story-town-commitments17>span{flex:1;text-align:center}.story-town-commitments17 .icon{width:22px;height:22px;vertical-align:middle}.story-town-commitments17 button{min-height:40px;padding:6px 12px;font-size:18px}
.composed-tavern>.story-forest-window17{position:absolute;left:93.2%;top:7%;width:5.5%;height:12%;border:0;background:transparent;color:#e6efbc;box-shadow:none;padding:0;z-index:7}.story-forest-window17>.icon{width:24px;height:24px;filter:drop-shadow(0 0 4px #11251d)}.story-forest-window17:is(:hover,:focus-visible){outline:2px solid #c0df8f;outline-offset:2px}
body[data-story="true"][data-cycle-phase="night"] .journey-bar #enemyStatus{top:48px!important;max-width:430px!important;width:43vw!important;left:50%!important;transform:translateX(-50%)!important;right:auto!important}
.story-goal17{position:relative;display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:34px;padding:3px 9px 6px;color:#f3df9b;background:#343328;border:1px solid #b99d59;font-size:16px;border-radius:5px;overflow:hidden}.story-goal17 strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.story-goal17>span{white-space:nowrap}.story-goal17 .icon{width:20px;height:20px;vertical-align:middle}.story-goal17>i{position:absolute;left:0;bottom:0;height:3px;background:#d0b96e}
body[data-story="true"] #storyFuel17{position:fixed;right:15px;top:42%;z-index:40}body[data-story="true"] #storySettlement17{position:relative;z-index:12}.story-rest-service17{display:flex;flex-direction:column;align-items:center;gap:5px;padding:8px;color:#eddbb0;background:#25382d;border:1px solid #ab935f;border-radius:7px}.story-rest-service17 .icon{width:20px;height:20px;vertical-align:middle}
@media(max-width:700px){.story-town-commitments17{gap:7px;padding:7px}.story-town-commitments17>span{order:-1;flex-basis:100%}.story-town-commitments17 button{font-size:16px}body[data-story="true"][data-cycle-phase="night"] .journey-bar #enemyStatus{top:46px!important;width:60vw!important}.story-goal17{font-size:13px}body[data-story="true"] #storyFuel17{right:7px;top:44%}}

/* The goal lives outside transformed legacy header containers. */
body[data-story="true"] #storyGoalHost17{position:fixed;top:42px;left:50%;transform:translateX(-50%);width:min(430px,calc(100vw - 170px));z-index:76}
body[data-story="true"] #storyGoalHost17 .story-goal17{height:23px;min-height:23px;padding:1px 7px 3px;font-size:13px;line-height:17px}
body[data-story="true"][data-style="hybrid"][data-progression="xp"][data-view="expedition"][data-phase="battle"][data-cycle-phase] #game>#handSection #hand{height:174px!important;min-height:174px!important}
@media(max-width:700px){body[data-story="true"] #storyGoalHost17{width:calc(100vw - 80px);top:43px}}

/* One real seasonal source occupies four existing enemy-card spaces; native cap stays three. */
@media(min-width:900px){
body[data-story="true"][data-style="hybrid"][data-progression="xp"][data-view="expedition"][data-phase="battle"][data-cycle-phase] #game>.encounter #enemies:has(>.enemy[data-story-tree="true"])>.enemy[data-story-tree="true"]{grid-area:1/1/3/3!important;width:100%!important;height:min(100%,calc(100dvh - 260px))!important;min-height:0!important;max-height:calc(100dvh - 260px)!important}
body[data-story="true"][data-style="hybrid"][data-progression="xp"][data-view="expedition"][data-phase="battle"][data-cycle-phase] #game>.encounter #enemies:has(>.enemy[data-story-tree="true"])>.enemy:not([data-story-tree="true"]){grid-area:auto/3/auto/4!important}
body[data-story="true"][data-style="hybrid"][data-progression="xp"][data-view="expedition"][data-phase="battle"][data-cycle-phase] #game>.encounter #enemies>.enemy[data-story-tree="true"]>.unit-card-face{width:100%!important;height:100%!important;max-height:none!important}
body[data-story="true"][data-style="hybrid"][data-progression="xp"][data-view="expedition"][data-phase="battle"][data-cycle-phase] #game>.encounter #enemies>.enemy[data-story-tree="true"]:is(:hover,:focus-within)>.unit-card-face{transform:scale(1.04)!important;transform-origin:50% 50%!important}
}
body[data-knowledge="true"] #game .enemy .enemy-no-retreat17{position:absolute;top:24px;left:5px;right:5px;z-index:3;text-align:center;font:12px/14px var(--fantasy-copy);color:#f2ce91;background:#442323}

/* Story uses the native controls without the legacy bridge's contextual reparenting. */
body[data-story="true"][data-cycle-phase="night"] #game :is(#extractButton,#retreatButton){position:fixed!important;left:auto!important;top:auto!important;right:15px!important;bottom:60px!important;transform:none!important;min-height:36px!important;min-width:125px!important;z-index:70!important;font-size:18px!important}
body[data-story="true"][data-cycle-phase="night"] #game #cancelButton{position:fixed!important;left:auto!important;top:auto!important;right:15px!important;bottom:105px!important;transform:none!important;min-height:34px!important;min-width:76px!important;z-index:70!important;font-size:17px!important}
body[data-story="true"][data-cycle-phase="night"] #game #inspectButton{position:fixed!important;left:auto!important;top:auto!important;right:15px!important;bottom:148px!important;transform:none!important;width:40px!important;min-width:40px!important;min-height:34px!important;z-index:70!important}
body[data-story="true"] #game #guardSelected{display:none!important}

body[data-story="true"]:has(.overlay:not([hidden])) #storyTimeline17{visibility:hidden}
.loot-resource-amount .icon{display:inline-block;width:22px;height:22px;vertical-align:middle;object-fit:contain}
.loot-resource-amount>span{display:inline-flex;align-items:center;justify-content:center;gap:3px}

/* Only the scenery dims. Opaque actor/card/HUD surfaces keep their own colours. */
body[data-story="true"][data-phase="battle"] #game::before{filter:brightness(var(--story-world-brightness,1));transition:filter .4s ease}
@media(prefers-reduced-motion:reduce){body[data-story="true"] #game::before{transition:none!important}}

body[data-story="true"] .composed-tavern>.story-forest-window17{background:transparent!important;border:0!important;box-shadow:none!important;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;color:#f2e2a3;font:12px/14px var(--fantasy-copy)}
.story-forest-window17>span{display:flex;align-items:center;gap:2px;white-space:nowrap;text-shadow:0 1px 3px #092019}.story-forest-window17>span>.icon{width:16px;height:16px}
body[data-story="true"] .patron-stock[data-patron="Mara"]>header{display:flex;align-items:center;gap:4px;min-height:30px}
.story-rest-inline17{margin-left:auto!important;padding:3px 5px!important;min-height:30px!important;font:14px/18px var(--fantasy-copy)!important;white-space:nowrap}.story-rest-inline17>.icon{width:15px;height:16px;vertical-align:middle}
.story-quest-selected17{outline:2px solid #b1d184!important;box-shadow:0 0 8px #8ecd6599!important}

/* Modal card inspection must cover its own complete title and artwork. */
body[data-story="true"]:has(.overlay:not([hidden])) :is(#storyGoalHost17,#storyFuel17){visibility:hidden}
body[data-story="true"] #enemies .enemy-rank:empty{display:none!important}

@media(min-width:900px){
body[data-story="true"] .resolved-events15{--resolved-width15:134px;--resolved-right15:15px;--resolved-bottom15:104px;max-height:96px;overflow:auto;padding:4px;font:12px/15px var(--fantasy-copy)}
body[data-story="true"] .resolved-entry15{grid-template-columns:minmax(0,1fr);gap:2px}
body[data-story="true"] .resolved-order15{display:none}
body[data-story="true"] .resolved-names15{font-size:12px;white-space:normal;overflow-wrap:normal}
body[data-story="true"] .resolved-result15{justify-content:start;font-size:12px}
body[data-story="true"] .resolved-history15>ol{max-height:65px}
}

/* The boss has a deliberate art window, with intact canopy and roots centred in it. */
@media(min-width:900px){
body[data-story="true"][data-style="hybrid"][data-progression="xp"][data-view="expedition"][data-phase="battle"][data-cycle-phase] #game>.encounter #enemies:has(>.enemy[data-story-tree="true"]){height:min(calc(100dvh - 260px),380px)!important;grid-template-rows:repeat(2,minmax(0,1fr))!important}
body[data-story="true"][data-style="hybrid"][data-progression="xp"][data-view="expedition"][data-phase="battle"][data-cycle-phase] #game>.encounter #enemies>.enemy[data-story-tree="true"]>.unit-card-face>img:not(.icon){position:static!important;inset:auto!important;width:100%!important;height:100%!important;min-height:0!important;max-height:none!important;object-fit:contain!important;object-position:center!important;margin:0!important;padding:0!important}
}
body[data-story="true"] #cardInspectionContent:is([data-card-kind="enemy"],[data-card-kind="hero"]),body[data-story="true"] #cardInspectionContent:is([data-card-kind="enemy"],[data-card-kind="hero"]) :is(#inspectionArt,#inspectionCopy){background:var(--inspection-unit,#442323)!important;color:#f2dfb4!important}
body[data-story="true"] #cardInspectionContent:is([data-card-kind="enemy"],[data-card-kind="hero"]) :is(h2,p,.inspection-card-name,.inspection-subtitle,.inspection-rules,.inspection-stats){color:#f2dfb4!important}

.market-recruit-name18{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:3px;color:#ecdab3;font:13px/15px var(--fantasy-copy)}.market-recruit-name18 small{font-size:10px}.market-recruit-name18 input{width:100%;min-width:0;font:13px Georgia,serif;padding:4px;background:#203128;color:#f0dfb5;border:1px solid #a08a5d}.market-recruit-kit18{color:#efdfb8;font:13px/17px var(--fantasy-copy);background:#25382d;border:1px solid #a08a5d}.market-recruit-kit18>summary{cursor:pointer;padding:3px}.market-recruit-kit18>ul{position:fixed;right:15px;bottom:130px;z-index:120;width:min(340px,calc(100vw - 30px));max-height:65dvh;overflow:auto;padding:8px 12px;background:#203128;border:2px solid #b69a60;box-shadow:0 5px 18px #000a;margin:0;list-style:none}.market-recruit-kit18 li{display:flex;flex-direction:column;gap:2px;padding:6px 0;border-bottom:1px solid #796d4a}.market-recruit-kit18 li:last-child{border:0}.market-recruit-kit18 .market-icon{width:17px;height:17px;vertical-align:middle}
body[data-story="true"] #tavern .market-hero-card{--market-hero18:#20383f}body[data-story="true"] #tavern .market-hero-card[data-role="DPS"]{--market-hero18:#442b25}body[data-story="true"] #tavern .market-hero-card[data-role="Tank"]{--market-hero18:#263a32}body[data-story="true"] #tavern .market-hero-card[data-role="Lead"]{--market-hero18:#34303f}
body[data-story="true"][data-style="hybrid"] #tavern .market-hero-card>.unit-card-face,body[data-story="true"][data-style="hybrid"] #tavern .market-hero-card .hero-body,body[data-story="true"][data-style="hybrid"] #tavern .market-hero-card .stats{background:var(--market-hero18)!important;color:#f0dfb7!important}
body[data-story="true"][data-style="hybrid"] #tavern .market-hero-card :is(h3,.hero-class-name,.hp,.stats span,.stats b){color:#f0dfb7!important}

#storyTutorialHint18{position:fixed;right:15px;top:42%;width:145px;padding:7px;background:#203128;border:1px solid #b19a63;color:#f0dfb6;font:14px/18px var(--fantasy-copy);z-index:45}#storyTutorialHint18 strong,#storyTutorialHint18 span{display:block}.hero-harmful18{position:absolute;top:24px;left:4px;right:4px;z-index:5;background:#322f24;color:#f1dda4;font:12px/15px var(--fantasy-copy)}.hero-harmful18>span{display:block}.hero-harmful18 .icon{width:15px!important;height:15px!important;vertical-align:middle}
.cleanse-panel18{z-index:180}.cleanse-choice18{width:min(540px,calc(100vw - 24px));max-height:90dvh;overflow:auto;margin:auto;padding:18px;background:#e5d3aa;color:#30291f;border:3px solid #927347;font:17px/1.3 var(--fantasy-copy)}.cleanse-choice18 h2{margin-top:0}.cleanse-choice18 .icon{width:22px;height:22px;vertical-align:middle}.cleanse-choice18 [data-cleanse-target18]{display:flex;flex-wrap:wrap;align-items:center;gap:6px;width:100%;margin:7px 0;padding:8px;text-align:left;background:#203128;color:#efdfb6}.cleanse-choice18 [data-cleanse-target18]>span{flex-basis:100%;font-size:15px}
@media(max-width:700px){#storyTutorialHint18{top:auto;bottom:210px;right:8px;width:125px;font-size:12px;line-height:15px}}
