.party-glyph {width:54px;height:54px;fill:none;stroke:currentColor;stroke-width:2.3;stroke-linecap:round;stroke-linejoin:round;flex:none}
.story-insights{margin:10px 0;border:1px solid #8ea8bc66;border-radius:11px;background:#102430;overflow:hidden}
.story-insights>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:48px;padding:8px 14px;box-sizing:border-box;cursor:pointer;color:#efdbb0;font-weight:700}
.story-insights>summary::before{content:'›';font-size:24px}.story-insights[open]>summary::before{transform:rotate(90deg)}
.story-insights>summary>span{flex:1}.story-insights>summary>small{font-size:12px;color:#b5c8d3;font-weight:400}
.story-insight-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,270px),1fr));gap:10px;padding:12px;border-top:1px solid #8ea8bc33}
.story-note{min-width:0;padding:12px;background:#1b3040;border:1px solid #8ea8bc33;border-radius:9px}.story-note>small{color:#9fcfc6}.story-note h4{font-size:17px;color:#f1ddb5;margin:3px 0 8px}.story-note p{font-size:15px;line-height:1.75;margin:6px 0}.story-note aside{border-left:2px solid #bfb68c;padding-left:10px;margin-top:12px}.story-note aside small{color:#b9cbd3}.story-note-next{color:#b9d5ce;font-size:15px;line-height:1.7}.story-note-sources{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}.story-note-sources .tower-btn{font-size:13px!important;min-height:44px;padding:6px 9px;max-width:100%;white-space:normal}
.bestiary-region{font-size:13px;color:#b9d5ce;margin:8px 0}.tower-bestiary-archive{margin-top:12px}.tower-bestiary-archive>summary{min-height:44px;padding:10px 0;color:#d8debd;cursor:pointer}
@media(max-height:540px){.story-insight-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:8px}.story-note{padding:10px}.story-insights>summary{padding:8px 10px}.story-insights>summary>small{font-size:11px}.story-note p{font-size:15px}}
.tower-resource-line{display:flex;align-items:center;flex-wrap:wrap;gap:7px 12px;margin-bottom:12px;color:#d3e7e6}.tower-resource-line .resource-icon,.tower-copy .resource-icon,.tower-guard-summary .resource-icon,.tower-light-card p .resource-icon,.tower-stat .resource-icon{display:inline-block;width:25px;height:25px;vertical-align:middle;margin:0 4px 0 0;flex:none}.tower-stat .resource-icon{width:18px;height:18px}.tower-clue-list{display:flex;flex-wrap:wrap;gap:8px}.tower-clue-list span{display:inline-flex;align-items:center}.tower-atlas-link{display:inline-block;padding:10px 16px;min-height:44px;border:1px solid #a5b995;border-radius:10px;color:#ffe1a2;text-decoration:none}
.party-food {width:70px;height:52px;display:block;margin:0 auto 5px;filter:drop-shadow(0 3px 3px #0005)}
.affix-icon,.gear-affix svg{display:inline-flex;width:26px;height:26px;flex:none;vertical-align:middle}
.gear-affix{display:inline-flex;gap:4px;align-items:center;font-size:12px;margin:4px 0}
.forge-affixes{margin:12px 0;padding-top:10px;border-top:1px solid #aa9be166}
.hero-statuses{display:flex;justify-content:center;flex-wrap:wrap;gap:2px;max-width:100%;pointer-events:none}
.hero-statuses:empty{display:none}
.hero-status{display:flex;align-items:center;gap:1px;border-radius:4px;background:#101725c9;border:1px solid var(--status-color);color:var(--status-color);padding:1px;line-height:1.1}
.hero-status svg{width:15px;height:16px}.hero-status small{font-size:9px;font-variant-numeric:tabular-nums}
.hero-status.is-ward{border-style:dotted;background:#244132c9}
.party-professions .tower-item {background:linear-gradient(140deg,#213748,#122434);border-color:#81b7b63b}
.party-professions .tower-item h3 {color:#f5deb0;font-size:20px}
.party-professions .tower-btn {border-color:#94c8c7aa}
.party-stocks {display:flex;flex-wrap:wrap;gap:10px;margin:14px 0 20px;padding:12px;border:1px solid #9ec4ce33;border-radius:12px;background:#0b1d28}
.party-stocks span {flex:1;min-width:85px;text-align:center;color:#d3e7e6;font-size:14px}
.party-stocks .party-food {width:44px;height:34px}
.party-stock-panel {margin:12px 0 16px;border:1px solid #9ec4ce40;border-radius:12px;background:#0b1d28;overflow:hidden}
.party-stock-panel summary {padding:12px 14px;min-height:44px;box-sizing:border-box;cursor:pointer;color:#f3dfaf;font-size:15px}
.party-stock-panel summary>span {float:right;color:#b6d5d9;font-size:13px}
.party-stock-panel .party-stocks {margin:0;padding:10px;border:0;border-radius:0;max-height:150px;overflow-y:auto;display:grid;grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:8px}
.party-stock-panel .party-stocks>span {display:flex;align-items:center;gap:6px;text-align:left;min-width:0;font-size:13px}
.party-stock-panel .party-stocks>span>span {min-width:0;text-align:left;font-size:13px}
.party-stock-panel .party-stocks svg {width:36px;height:32px;flex:none;margin:0}
.party-stock-panel>small {display:block;padding:8px 12px 12px;color:#a9c4cc;font-size:12px;line-height:1.5}
.party-costs {display:flex;flex-wrap:wrap;gap:6px;margin:8px 0;line-height:1.35}
.party-cost {display:flex;align-items:center;gap:5px;padding:5px 7px;border:1px solid #81b39b55;background:#203c39;border-radius:8px;color:#d9ede3;font-size:13px}
.party-cost svg {width:28px;height:26px;flex:none;margin:0}
.party-cost b {white-space:nowrap;font-variant-numeric:tabular-nums}
.party-cost.missing {border-color:#d3978155;background:#3b2c2b;color:#f4c0ae}
.party-cost small {display:block;font-size:11px;color:#f0a89b}
@media(max-height:540px) {.party-stock-panel summary {padding:10px 12px}.party-stock-panel .party-stocks {max-height:108px}.party-stock-panel {margin:8px 0 12px}.party-cost {font-size:12px;padding:4px 6px}}
.party-recipe .tower-btn {margin-top:4px}
.party-forge-grid {grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr))}
.party-forge-traits {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr));gap:12px;width:100%}
.party-forge-traits section {display:flex;flex-direction:column;gap:8px;padding:12px;border:1px solid #d7b78244;border-radius:10px;background:#192f3e}
.party-forge-traits b {color:#f2d49e;font-size:17px}
.party-forge-traits p {flex:1;margin:0}
.party-forge-traits .tower-btn {white-space:normal;margin-top:auto}
.party-status {font:inherit;font-size:13px;color:#eddbad;border:0;background:transparent;cursor:pointer;padding:3px 0;text-align:left}
.party-status:hover {color:#fff4cf;text-decoration:underline}
#towerWorkProgress[hidden],body:not(.story-active) #towerWorkProgress {display:none!important}
#towerWorkProgress,.tower-site-progress {box-sizing:border-box;padding:7px 10px;border:1px solid #85cbb97a;border-radius:10px;background:#102b36ee;color:#eef4dc}
#towerWorkProgress {width:230px;max-width:100%;pointer-events:none;flex:none}
.tower-work-heading {display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:14px;line-height:1.3;margin-bottom:5px}
.tower-work-heading small {color:#b5d9d0;font-size:11px;white-space:nowrap}
.tower-work-track {display:block;appearance:none;-webkit-appearance:none;width:100%;height:7px;border:0;border-radius:6px;overflow:hidden;background:#324b55;accent-color:#a8e1bd}
.tower-work-track::-webkit-progress-bar {background:#324b55;border-radius:6px}
.tower-work-track::-webkit-progress-value {background:linear-gradient(90deg,#67c7b5,#d6eeb0);border-radius:6px}
.tower-work-track::-moz-progress-bar {background:linear-gradient(90deg,#67c7b5,#d6eeb0);border-radius:6px}
.tower-site-progress {margin:12px 0;max-width:420px}
@media(max-height:540px) {#towerWorkProgress {width:214px;padding:5px 8px}.tower-work-heading {font-size:13px;margin-bottom:4px}.tower-work-track {height:6px}}
.grocery-heading{display:flex;align-items:center;gap:12px;margin-bottom:10px}
.grocery-heading svg{width:52px;height:52px;flex:0 0 52px;margin:0}
.grocery-heading h3{margin:0}
.grocery-heading small{color:#a4bdb8}
.grocery-stock{margin:20px 0}
.grocery-stock:first-child{margin-top:0}
.grocery-stock>h3{color:#e8d7a4;margin:0 0 6px}
.grocery-stock>.tower-copy{margin:0 0 12px}
.grocery-ingredient.is-specialty{border-color:#bba36b;background:linear-gradient(125deg,#263b42,#243040)}
.grocery-supply .supply-guide{margin:10px 0}
.party-invite {display:grid;grid-template-columns:64px minmax(0,1fr);gap:8px 14px;margin:12px 0}
.party-invite>* {grid-column:1/-1;min-width:0;margin:0}
.party-invite>svg {grid-column:1;grid-row:1;width:64px;height:74px;align-self:center}
.party-invite>p:first-of-type {grid-column:2;grid-row:1;align-self:center}
.party-invite>.recruit-costs {grid-template-columns:repeat(auto-fit,minmax(160px,1fr));width:100%}
.party-invite>details>summary {min-height:44px;align-content:center;cursor:pointer}
#towerProfessionBtn {color:#d1f2e0;border-color:#81b8a299;max-width:120px;white-space:normal;font-size:13px;background:#173b3c}
#towerProfessionBtn[hidden] {display:none!important}
@media(max-height:540px) {
  .party-professions {grid-template-columns:repeat(3,minmax(0,1fr))}
  .party-professions .tower-item {gap:6px;padding:10px}
  .party-professions .tower-item p {font-size:14px}
  .party-glyph {width:38px;height:38px}
  #towerProfessionBtn {position:absolute;left:0;bottom:56px;min-width:100px}
}
@media(max-width:600px) and (orientation:portrait) {.party-professions {grid-template-columns:repeat(2,minmax(0,1fr))}}

/* A single small lighting shortcut, separate from the weapon and profession skill. */
#towerLightBtn {display:grid;place-items:center;flex:none;width:40px;height:40px;padding:0;box-sizing:border-box;border:1px solid #d4b78066;border-radius:9px;background:#283642;color:#c9c3af;cursor:pointer;pointer-events:auto;touch-action:manipulation}
#towerLightBtn[hidden],#towerLightStatus[hidden] {display:none!important}
#towerLightBtn svg,.tower-light-card svg {width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#towerLightBtn[data-light="torch"] {color:#ffce80;background:#4c3d2c}
#towerLightBtn[data-light="daylight"] {color:#fff3bf;background:#39525c}
#towerLightBtn[data-light="core"] {background:#263d50}
#towerLightBtn:focus-visible {outline:2px solid #ffe2a2;outline-offset:2px}
#towerLightStatus {font-size:12px;color:#e3c995;padding-top:4px}
.tower-light-card svg {width:42px;height:42px;color:#f0cb87}
.tower-light-grid {grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-height:540px) {#towerLightBtn {width:36px;height:36px}}
@media(max-width:480px) and (orientation:portrait) {.tower-light-grid {grid-template-columns:1fr}}

/* A small survival strip by default; only the explicit controls intercept touches. */
body.story-active #towerHud {width:max-content;max-width:calc(100% - 126px - env(safe-area-inset-left) - env(safe-area-inset-right));padding:4px 6px 4px 10px;border-radius:12px;line-height:1.3}
#towerHud .tower-hud-summary {display:flex;align-items:center;gap:12px}
#towerHud .tower-stat {font-size:14px;gap:5px}
#towerHud .tower-stat small {font-size:12px;color:#b7cedb}
#towerHud .tower-stat b {font-variant-numeric:tabular-nums}
#towerHud .tower-floor-stat b {color:#f4d69f}
#towerHud .tower-hud-health {min-width:92px}
#towerHud #towerHp {height:4px;margin-top:3px}
#towerHudToggle {display:grid;place-items:center;flex:none;width:40px;height:40px;padding:8px;border:1px solid #91b4c344;border-radius:9px;background:#213c50;color:#e9f4f5;cursor:pointer;pointer-events:auto;touch-action:manipulation}
#towerHudToggle svg {width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
#towerHudToggle[aria-expanded="true"] svg {transform:rotate(180deg)}
#towerHudToggle:focus-visible {outline:2px solid #ffe2a2;outline-offset:2px}
#towerHudDetails {padding:8px 4px 5px 0;margin-top:4px;border-top:1px solid #94b2bb44;max-width:320px}
#towerHudDetails[hidden] {display:none!important}
#towerHud .tower-hud-meta {display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:13px}
#towerHud #towerChapter {max-width:190px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:#b7cedb}
#towerHud .tower-guard-status {border:0;padding:0;margin-top:4px}
#towerHud .party-status {pointer-events:auto;min-height:32px;padding:4px 0;font-size:14px}
#towerHud .tower-gear-status {font-size:12px;padding-top:3px}
body.tower-danger #towerHud #towerHealth {color:#ffaaa0}
body.tower-danger #towerHud #towerHp::-webkit-progress-value {background:#ed8576}
body.tower-danger #towerHud #towerHp::-moz-progress-bar {background:#ed8576}
.camp-service-strip {display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:10px 0 6px;padding:8px 10px;background:#203a48;border:1px solid #54716a;border-radius:12px}
.camp-service-strip>div {flex:1;min-width:130px}
.camp-service-strip b,.camp-service-strip small {display:block}
.camp-service-strip small {color:#b8cddd;font-size:.8em;margin-top:2px}
.camp-service-strip .tower-btn {margin:0;padding:8px 12px;min-height:44px}
.camp-rule-notes {margin:4px 0 12px;color:#b8cddd;font-size:.82em}
.camp-rule-notes summary {min-height:32px;cursor:pointer;align-content:center}
.camp-rule-notes p {margin:5px 0;line-height:1.6}
/* Shops and camps share compact item rows; the item heading opens its details. */
.tower-commerce .trade-stock-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.tower-commerce .trade-card-actions{display:flex;align-items:stretch;gap:6px;width:100%;margin-top:auto}
.tower-commerce .trade-card-actions .tower-btn{flex:1 1 0;width:auto;min-width:44px;min-height:44px;padding:7px 10px;font-size:15px;margin:0;box-sizing:border-box;white-space:normal}
.tower-commerce .trade-card-actions [data-tower="sell"]{flex:0 0 auto;background:#1d3543;border-color:#506d78;color:#bcd4dc}
.tower-titles-with-wallet{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:0 12px}
.tower-titles-with-wallet .tower-kicker{grid-column:1/-1}
.tower-trade-wallet{display:flex;align-items:center;gap:4px;white-space:nowrap;font-size:15px;font-weight:700;color:#f3dca0}
.tower-trade-wallet>.resource-icon{width:22px;height:24px;flex:none}
.trade-item-details{width:100%;margin:0}
.tower-commerce .tower-item{min-width:0;box-sizing:border-box}
.trade-item-details>summary{display:flex;align-items:center;gap:8px;min-height:44px;list-style:none;cursor:pointer}
.trade-item-details>summary::-webkit-details-marker{display:none}
.trade-item-details>summary>svg{width:38px;height:40px;flex:none;margin:0;filter:drop-shadow(0 2px 2px #0004)}
.trade-item-details>summary>div{flex:1;min-width:0}
.trade-item-details>summary h3{font-size:17px!important;margin:0;line-height:1.3}
.trade-item-details>summary small{display:block;font-size:13px;color:#aac8d3;line-height:1.4;margin-top:3px}
.trade-detail-indicator{color:#b5c9d3;font-size:21px;flex:none}
.trade-item-details[open] .trade-detail-indicator{transform:rotate(180deg)}
.trade-item-details>p,.tower-trade-note>p{font-size:15px;line-height:1.55;margin:8px 0}
.trade-categories{display:flex;gap:8px;margin:0 0 8px}
.trade-categories .tower-btn{min-height:44px;padding:7px 16px;flex:1}
.trade-categories .tower-btn[aria-pressed="true"]{border-color:#e0c581;background:#385762;color:#fff0be}
.tower-commerce .grocery-stock{margin:0}
.tower-commerce .grocery-stock[hidden]{display:none!important}
.tower-trade-note{margin:10px 0;border:1px solid #7893a344;border-radius:9px;background:#102431;padding:0 10px}
.tower-trade-note>summary,.tower-commerce .supply-guide>summary,.forge-trait-guide>summary{cursor:pointer;min-height:44px;display:flex;align-items:center;gap:7px;color:#b6d3db;font-size:15px}
.tower-trade-note>summary::before,.tower-commerce .supply-guide>summary::before,.forge-trait-guide>summary::before{content:'＋';font-size:16px;color:#e6cea0}
.tower-trade-note[open]>summary::before,.tower-commerce .supply-guide[open]>summary::before,.forge-trait-guide[open]>summary::before{content:'−'}
.tower-trade-note>summary::-webkit-details-marker,.tower-commerce .supply-guide>summary::-webkit-details-marker,.forge-trait-guide>summary::-webkit-details-marker{display:none}
.tower-commerce .grocery-heading{gap:8px;margin:0}
.tower-commerce .grocery-heading svg{width:36px;height:38px;flex-basis:36px}
.tower-commerce .grocery-heading>div{min-width:0}
.tower-commerce .grocery-heading h3{font-size:17px!important;line-height:1.25}
.tower-commerce .grocery-heading small{font-size:13px;line-height:1.4}
.tower-commerce .trade-item-stat{font-size:14px!important;line-height:1.4!important;margin:2px 0!important}
.forge-overview-notes{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;margin:8px 0}
.forge-overview-notes .party-stock-panel,.forge-overview-notes .tower-trade-note{margin:0}
.forge-overview-notes .party-stock-panel summary{font-size:15px;padding:8px 10px}
.forge-overview-notes .party-stock-panel summary>span{display:none}
.forge-overview-notes .party-stocks{max-height:none;overflow:visible}
.forge-resources{margin:0 0 6px;gap:6px;font-size:15px;line-height:1.4}
.forge-resources .resource-icon{width:23px;height:23px}
.forge-traits-title{font-size:17px!important;display:flex;align-items:center;gap:10px;margin:10px 0 7px}
.forge-traits-title small{color:#b4cbd7;font-size:13px;font-weight:normal}
.forge-piece h3{margin:0!important;font-size:18px!important}
.forge-piece p{margin:3px 0;font-size:14px!important;line-height:1.4}
.forge-repair{display:flex;align-items:center;gap:10px;justify-content:space-between;padding:8px 10px;margin:8px 0 12px}
.forge-repair>div{min-width:0;flex:1}.forge-repair h3{font-size:16px!important;margin:0}
.forge-repair p{font-size:14px!important;margin:3px 0;line-height:1.4}.forge-repair>.tower-btn{min-height:44px;flex:none;padding:8px 12px;margin:0}
.forge-detail .party-forge-traits{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
.forge-detail .party-forge-traits section{display:flex;flex-direction:column;align-items:stretch;gap:5px}
.forge-detail .party-forge-traits .tower-btn{max-width:none;width:100%;min-height:44px}
.forge-trait-heading{display:flex;align-items:center;gap:7px}
.forge-trait-heading>svg{width:30px;height:30px;flex:none}
.forge-trait-heading b{font-size:16px;line-height:1.3}.forge-trait-heading small{font-size:12px;color:#b8cddd}
.forge-trait-warning{font-size:13px;color:#edc5a7;line-height:1.4}
.forge-trait-guide p{margin:5px 0;line-height:1.45}
@media(max-width:1000px),(max-height:600px){
  #towerDialog.tower-commerce .tower-dialog-header .tower-kicker{display:none}
  #towerDialog.tower-commerce .tower-dialog-content{padding:7px 10px}
  #towerDialog.tower-commerce[data-commerce="grocery"] .tower-dialog-content,
  #towerDialog.tower-commerce[data-commerce="merchant"] .tower-dialog-content{padding:4px 8px}
  #towerDialog.tower-commerce .tower-titles-with-wallet{gap:0 8px}
  #towerDialog.tower-commerce .tower-dialog-content>.tower-copy{font-size:15px;line-height:1.4;margin:0 0 7px}
  #towerDialog.tower-commerce .tower-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
  #towerDialog.tower-commerce .tower-grid .tower-item{padding:7px 8px;gap:5px;border-radius:10px}
  #towerDialog.tower-commerce .trade-stock-grid{gap:4px}
  #towerDialog.tower-commerce .trade-stock-grid .tower-item{padding:2px 6px;gap:2px}
  #towerDialog.tower-commerce .trade-stock-grid .trade-card-actions{gap:4px}
  #towerDialog.tower-commerce .trade-stock-grid .trade-item-details>summary small{margin-top:1px}
  #towerDialog.tower-commerce .trade-categories{gap:6px;margin-bottom:4px}
  #towerDialog.tower-commerce .tower-grid .tower-item h3{font-size:16px}
  #towerDialog.tower-commerce .trade-item-details>p{font-size:15px;line-height:1.5}
  #towerDialog.tower-commerce .trade-card-actions .tower-btn{padding:6px 7px;font-size:15px}
  #towerDialog.tower-commerce .camp-service-strip{padding:6px 8px;margin:0 0 8px;gap:7px;border-radius:9px}
  #towerDialog.tower-commerce .camp-service-strip>div{min-width:90px}
  #towerDialog.tower-commerce .camp-service-strip b{font-size:15px}
  #towerDialog.tower-commerce .camp-service-strip small{font-size:13px}
  #towerDialog.tower-commerce .camp-rule-notes summary{min-height:44px}
  #towerDialog.tower-commerce .party-stock-panel>small{font-size:13px}
  #towerDialog.tower-commerce .party-stock-panel .party-stocks{max-height:none;overflow:visible}
  .tower-commerce .party-recipe .supply-guide{margin:0}
}
@media(max-width:700px){
  #towerDialog.tower-commerce .tower-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  #towerDialog.tower-commerce .trade-card-actions{flex-wrap:wrap}
  #towerDialog.tower-commerce .trade-card-actions .tower-btn{padding:6px;font-size:15px}
  .trade-item-details>summary{gap:6px}.trade-item-details>summary>svg{width:31px;height:36px}
}
.recruit-costs {list-style:none;padding:0;margin:8px 0;display:grid;gap:6px}
.recruit-costs li {display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:8px 12px;background:#172e3c;border:1px solid #426472;border-radius:10px}
.recruit-costs li span {flex:1;min-width:100px}
.recruit-costs small {color:#bdd4dc}
.recruit-cost-missing,.recruit-cost-missing small {color:#ffd198}
#towerLeftHud {display:contents}
body.story-active #hudTop {z-index:21}
body.story-active #towerLeftHud {display:flex;flex-direction:column;align-items:flex-start;gap:7px;width:max-content;max-width:calc(100% - 126px);pointer-events:none}
body.story-active #towerLeftHud #hudInfo {max-width:100%;box-sizing:border-box}
body.story-active #towerLeftHud #towerHud {position:static;max-width:100%;box-sizing:border-box}
body.story-active #towerLeftHud #effectChips {position:static;align-items:flex-start;max-width:100%}
body:not(.story-active) #heroTeamBar {display:none!important}
@media(max-height:540px) {
  body.story-active #towerHud {top:calc(52px + env(safe-area-inset-top));padding:2px 4px 2px 8px}
  #towerHud .tower-hud-summary {gap:9px}
  #towerHudToggle {width:36px;height:36px}
  body.story-active #towerLeftHud {gap:5px}
}
@media(max-height:360px) {
  #towerHudDetails {padding-top:4px;padding-bottom:3px;margin-top:2px}
  #towerHud .party-status {min-height:26px;padding:2px 0}
  #towerHud .tower-gear-status,#towerLightStatus {padding-top:2px}
  /* Keep expanded survival details and work feedback above the battle dock. */
  #towerLeftHud[data-working="true"] #towerHudDetails {display:grid;grid-template-columns:max-content max-content;gap:0 8px;padding:2px 0;margin-top:2px}
  #towerLeftHud[data-working="true"] #towerChapter {display:none}
  #towerLeftHud[data-working="true"] .tower-hud-meta {justify-content:flex-start}
  #towerLeftHud[data-working="true"] .tower-guard-status {margin-top:0}
  #towerLeftHud[data-working="true"] .tower-gear-status,#towerLeftHud[data-working="true"] #towerLightStatus {padding-top:0;font-size:11px}
  /* Alerts live below each card; compact the expanded details when that extra
     row is needed, keeping the full team above the phone's battle controls. */
  #towerLeftHud:has(.hero-gear-alert) #towerHudDetails {display:grid;grid-template-columns:max-content max-content;gap:0 8px;padding:2px 0;margin-top:2px}
  #towerLeftHud:has(.hero-gear-alert) #towerChapter {display:none}
  #towerLeftHud:has(.hero-gear-alert) .tower-hud-meta {justify-content:flex-start}
  #towerLeftHud:has(.hero-gear-alert) .tower-guard-status {margin-top:0}
  #towerLeftHud:has(.hero-gear-alert) #towerHud .party-status {min-height:18px;padding:0;font-size:12px}
  #towerLeftHud:has(.hero-gear-alert) .tower-gear-status,#towerLeftHud:has(.hero-gear-alert) #towerLightStatus {padding-top:0;font-size:11px}
}
/* Supplemental copy only: prices, shortages and actions stay outside this panel. */
.tower-compact-help{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:flex-start;gap:0;margin:0 0 6px;min-width:0}
.tower-help-toggle,.tower-help-close,.tower-help-read{font:inherit;cursor:pointer;touch-action:manipulation;min-width:44px;min-height:44px;box-sizing:border-box;border:1px solid #78939d;color:#f2e4be;background:#233d4d;border-radius:10px}
.tower-help-toggle{display:grid;place-items:center;width:44px;height:44px;padding:4px;background:transparent;border-color:transparent}
.tower-help-toggle>span{display:grid;place-items:center;width:28px;height:28px;border:1px solid #78939d;border-radius:50%;background:#233d4d;font-size:19px;font-weight:700;line-height:1}
.tower-help-toggle[aria-expanded="true"]>span{color:#142b35;background:#efcf85;border-color:#efcf85}
.tower-help-toggle:focus-visible,.tower-help-close:focus-visible,.tower-help-read:focus-visible{outline:2px solid #efcf85;outline-offset:2px}
.tower-help-panel{flex:0 0 100%;box-sizing:border-box;min-width:0;max-height:min(320px,52vh);overflow:auto;overscroll-behavior:contain;border:1px solid #78939d;border-radius:12px;background:#112533;box-shadow:0 5px 16px #050c1580;padding:8px 12px;color:#d4e2e8;font-size:16px;line-height:1.55}
.tower-help-panel[hidden]{display:none!important}
.tower-help-panel>header{display:flex;align-items:center;justify-content:space-between;gap:12px;color:#f2e4be}
.tower-help-panel .tower-help-copy{min-width:0;overflow-wrap:anywhere}
.tower-help-copy p{margin:6px 0 10px}
.tower-help-copy p:last-child{margin-bottom:8px}
.tower-help-close{font-size:23px;padding:0 6px;flex:0 0 44px}
.tower-help-read{font-size:15px;padding:7px 12px;margin:3px 0 2px}
@media(max-height:540px){.tower-help-panel{font-size:14px;line-height:1.45;padding:6px 9px;max-height:46vh}.tower-compact-help{margin-bottom:3px}}
