/* Compact UX pass (Opus, Oct 18) */
.command-bar button small{display:block;font-size:11px;line-height:1.2}
#commandTarget{display:block;font-size:11px}
.boss-warning{font-size:13px;line-height:1.25;max-width:92%;white-space:normal}
.cart-cta{border-color:#e9cc7e;background:#e9cc7e22;font-weight:700;animation:none}
.kart-arrival{text-align:center;animation:cartArrive .5s ease-out 1}.kart-arrival h2{font-size:22px;margin:4px 0 8px}.kart-arrival-actions{display:grid;gap:8px;margin-top:12px}.kart-arrival-actions button{min-height:44px}
.cart-next{color:var(--muted)}
.formation-board{gap:6px;margin-top:8px}
.formation-board .formation-place{min-height:64px;padding:6px}
.camp-decision-actions .cart-cta{min-height:44px}
.intermission-team button,.intermission-tools button{min-height:44px}
.team-profile-compact{display:flex;align-items:center;gap:10px;margin:6px 0}.team-profile-compact h3{margin:0;font-size:16px}.team-profile-compact small{color:var(--muted);font-size:12px}
.team-orders{margin:8px 0}.team-orders h3{font-size:14px;margin:0 0 6px}.team-orders .pack-orders button{min-height:44px}

/* Short portrait preparation: one decision, roster and thumb-reachable actions. */
@media(max-width:700px){
 #camp:is([data-phase=prepare],[data-phase=retry]){padding:8px 12px}
 #camp:is([data-phase=prepare],[data-phase=retry]) .mast{min-height:46px;padding:0 0 4px;gap:8px}
 #camp:is([data-phase=prepare],[data-phase=retry]) .brand{gap:6px;font-size:10px;line-height:1.1}
 #camp:is([data-phase=prepare],[data-phase=retry]) .brand>span{font-size:34px;line-height:1}
 #camp:is([data-phase=prepare],[data-phase=retry]) .camp-menu>summary{min-height:44px;padding:10px 13px}
 #camp:is([data-phase=prepare],[data-phase=retry]) .camp-heading{padding:3px 0;min-height:32px;gap:16px}
 #camp:is([data-phase=prepare],[data-phase=retry]) .berry-wallet strong,#camp:is([data-phase=prepare],[data-phase=retry]) .supplies strong{font-size:18px}
 #camp:is([data-phase=prepare],[data-phase=retry]) .decision{padding:12px;border-radius:16px}
 #camp:is([data-phase=prepare],[data-phase=retry]) .decision-top{display:grid;gap:8px;margin:0;min-width:0}
 #camp:is([data-phase=prepare],[data-phase=retry]) .decision-top h2{font-size:23px;line-height:1.15;margin:3px 0}
 #camp:is([data-phase=prepare],[data-phase=retry]) .decision-top .eyebrow{font-size:11px;letter-spacing:1px}
 #camp:is([data-phase=prepare],[data-phase=retry]) .decision-top p{font-size:13px;line-height:1.35;margin:4px 0 0}
 #camp:is([data-phase=prepare],[data-phase=retry]) .camp-decision-actions{min-width:0;width:100%;gap:6px}
 #camp:is([data-phase=prepare],[data-phase=retry]) .camp-decision-actions>button{min-height:44px;padding:9px 8px;font-size:14px;width:100%;max-width:100%;white-space:normal}
 #camp:is([data-phase=prepare],[data-phase=retry]) .camp-decision-actions>small{font-size:12px;line-height:1.25}
 #camp:is([data-phase=prepare],[data-phase=retry]) .ready-difficulty{padding:0;border:0;background:none;gap:0}
 #camp:is([data-phase=prepare],[data-phase=retry]) .ready-difficulty .difficulty-pick{min-height:44px;padding:3px 6px}
 #camp:is([data-phase=prepare],[data-phase=retry]) .difficulty-pick small{font-size:12px}
 #camp:is([data-phase=prepare],[data-phase=retry]) .intermission-team{gap:5px;margin:10px 0 8px}
 #camp:is([data-phase=prepare],[data-phase=retry]) .intermission-team>button{grid-template-columns:auto auto;align-content:center;align-items:center;justify-content:center;gap:2px;padding:4px 2px;min-height:54px}
 #camp:is([data-phase=prepare],[data-phase=retry]) .intermission-team .mini-portrait{grid-column:1/-1;width:28px;height:28px}
 #camp:is([data-phase=prepare],[data-phase=retry]) .intermission-team strong,#camp:is([data-phase=prepare],[data-phase=retry]) .intermission-team>button>span:last-child{font-size:12px}
 #camp:is([data-phase=prepare],[data-phase=retry]) .intermission-tools{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:6px}
 #camp:is([data-phase=prepare],[data-phase=retry]) .intermission-tools button{min-width:0;padding:8px 5px;font-size:13px;min-height:44px}
 #camp:is([data-phase=prepare],[data-phase=retry]) .trail-details{margin-top:8px}
 #camp:is([data-phase=prepare],[data-phase=retry]) .trail-details>summary{padding:10px 0;min-height:44px;font-size:13px}
 #camp:is([data-phase=prepare],[data-phase=retry])>footer{margin-top:10px;padding-top:7px;font-size:10px}
}
.camp-decision-actions .primary.cart-cta{background:var(--gold);color:var(--ink)}
@keyframes cartArrive{0%,100%{box-shadow:0 0 0 0 #f3cc6800}50%{box-shadow:0 0 0 4px #f3cc6855}}

@media(max-width:700px){
 #camp:is([data-phase=prepare],[data-phase=retry]) .camp-menu{margin:0 0 0 auto}
 #camp:is([data-phase=prepare],[data-phase=retry]) .decision{margin-bottom:0}
 #modal.team-compact-view{padding:12px;max-height:calc(100dvh - 12px);width:calc(100% - 12px);margin:6px auto}
 #modal.team-compact-view .dialog-close{top:8px;right:8px;width:44px;min-width:44px;height:44px}
 #modal.team-compact-view .team-title{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-right:46px;min-height:44px}
 #modal.team-compact-view .team-title h2{font-size:19px;line-height:1.15;white-space:nowrap;margin:0}
 #modal.team-compact-view .team-title small{font-size:11px;line-height:1.2;text-align:right;color:var(--muted)}
 #modal.team-compact-view .camp-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;margin:6px 0}
 #modal.team-compact-view .camp-tabs button{min-width:0;min-height:44px;padding:5px 2px;font-size:12px;line-height:1.2}
 #modal.team-compact-view .camp-tab-content{padding-top:0}
 .team-family-select,.team-order-select{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:700;margin:6px 0}
 .team-family-select select,.team-order-select select{min-width:0;flex:1;min-height:44px;font:inherit;font-size:14px;padding:6px;border-radius:8px;border:1px solid var(--line);background:#173437;color:var(--cream)}
 .team-role{display:flex;align-items:center;gap:8px;margin:4px 0}
 .team-role small{flex:1;font-size:12px;line-height:1.3;color:var(--muted)}
 .team-role button{font-size:13px;min-height:44px;padding:6px 9px}
 #modal.team-compact-view .formation-heading{font-size:14px;line-height:1.3;margin:4px 0}
 #modal.team-compact-view .formation-heading small{font-size:12px}
 #modal.team-compact-view .formation-board{grid-template-columns:34px minmax(0,1fr) minmax(0,1fr);gap:4px;margin:0}
 #modal.team-compact-view .formation-board>b,#modal.team-compact-view .formation-lane{font-size:11px;line-height:1.2}
 #modal.team-compact-view .formation-board .formation-place{display:grid;grid-template-columns:24px minmax(0,1fr);grid-template-rows:1fr 1fr;align-items:center;justify-content:stretch;column-gap:3px;row-gap:0;min-height:44px;height:44px;padding:4px;min-width:0}
 #modal.team-compact-view .formation-place .mini-portrait{grid-column:1;grid-row:1/3;width:24px;height:24px}
 #modal.team-compact-view .formation-place strong,#modal.team-compact-view .formation-place small{grid-column:2;white-space:nowrap;font-size:12px;line-height:1.1;overflow:hidden;text-overflow:ellipsis}
 #modal.team-compact-view .formation-place strong{grid-row:1}
 #modal.team-compact-view .formation-place small{grid-row:2}
 #modal.team-compact-view .formation-place.empty>span{grid-row:1/3;font-size:22px;line-height:1}
 #modal.team-compact-view .formation-place.empty small{white-space:normal;grid-row:1/3;font-size:11px}
 #modal.team-compact-view #closeModal{min-height:44px;margin-top:8px;padding:8px;font-size:14px}
}

.command-label{display:grid;grid-template-columns:minmax(0,1fr);gap:2px;text-align:left}
.command-label #treatCount,.command-label #commandTarget{font-size:12px;line-height:1.25;text-align:left;max-width:100%}
.command-bar button small{font-size:12px;line-height:1.25}
.boss-warning[data-tone=quiet]{background:#193e3be8;border-color:#94afa0;color:#e3ecda}
.boss-warning[data-tone=good]{background:#285f4f;border-color:#b0d797}
@media(prefers-reduced-motion:reduce){.cart-cta,.kart-arrival{animation:none!important}}
.motion-calm .cart-cta,.motion-calm .kart-arrival{animation:none!important}

/* Bounded shop choices, with deliberate inspection outside the purchase view. */
.cart-artifact-detail{margin:18px 0}.cart-artifact-detail h3{margin-bottom:6px}.cart-artifact-detail p{font-size:14px;line-height:1.45;margin:6px 0}
@media(max-width:700px){
 #modal.cart-compact-view{padding:10px 12px;max-height:calc(100dvh - 12px);width:calc(100% - 12px);margin:6px auto}
 #modal.cart-compact-view .dialog-close{top:6px;right:6px;min-width:44px;width:44px;height:44px}
 #modal.cart-compact-view .cart-heading{padding-right:44px;gap:8px;min-height:40px}
 #modal.cart-compact-view .cart-heading h2{font-size:22px;line-height:1.15}
 #modal.cart-compact-view .cart-heading strong{font-size:16px}
 #modal.cart-compact-view .camp-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;margin:5px 0}
 #modal.cart-compact-view .camp-tabs button{font-size:12px;line-height:1.2;min-height:44px;padding:4px;min-width:0}
 #modal.cart-compact-view .camp-tab-content{padding-top:8px}
 #modal.cart-compact-view .shop-offers{display:grid;grid-template-columns:minmax(0,1fr);gap:6px}
 #modal.cart-compact-view .shop-card{display:grid;grid-template-columns:22px minmax(0,1fr) auto;gap:3px 6px;padding:8px;min-height:72px;min-width:0;text-align:left;align-items:start}
 #modal.cart-compact-view .shop-icon{grid-column:1;grid-row:1/3;font-size:22px;line-height:1.1;align-self:center}
 #modal.cart-compact-view .shop-card strong{grid-column:2;grid-row:1;font-size:14px;line-height:1.25;min-width:0}
 #modal.cart-compact-view .shop-card small{grid-column:2/4;grid-row:2;font-size:13px;line-height:1.3;margin:0;min-height:0}
 #modal.cart-compact-view .shop-card b{grid-column:3;grid-row:1;font-size:12px;line-height:1.3;margin:0;text-align:right;max-width:88px}
 #modal.cart-compact-view .shop-card .beneficiary-note,#modal.cart-compact-view .shop-card .artifact-threat{grid-column:2/4;grid-row:auto;font-size:12px!important;line-height:1.25;margin:0}
 #modal.cart-compact-view .cart-stock{display:flex;flex-wrap:nowrap;gap:4px;margin:7px 0 0;align-items:stretch}
 #modal.cart-compact-view .cart-stock button{flex:1;min-width:0;min-height:44px;padding:4px;font-size:12px;line-height:1.2}
 #modal.cart-compact-view .cart-departure{margin:6px 0 0;font-size:12px;line-height:1.25}
 #modal.cart-compact-view #closeModal{min-height:44px;padding:8px;font-size:14px;margin-top:6px}
}

.reward-tools{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-top:10px}
.reward-tools button{min-height:44px;font-size:14px;padding:8px}.reward-next{font-size:13px;color:var(--muted);margin-top:8px;line-height:1.3}
.reward-detail-list{display:grid;gap:12px;margin:12px 0}.reward-detail-card{display:grid;gap:6px;border:1px solid var(--line);border-radius:12px;padding:14px}.reward-detail-card small{font-size:14px}.reward-detail-card .portrait{width:54px;height:54px}.reward-detail-card .small-note{display:block;margin-top:6px}
@media(max-width:700px){
 #camp[data-phase=reward]{padding:8px 12px}
 #camp[data-phase=reward] .mast{min-height:46px;padding:0 0 4px;gap:8px}
 #camp[data-phase=reward] .camp-menu{margin:0 0 0 auto}
 #camp[data-phase=reward] .brand{gap:6px;font-size:10px;line-height:1.1}
 #camp[data-phase=reward] .brand>span{font-size:34px;line-height:1}
 #camp[data-phase=reward] .camp-menu>summary{min-height:44px;padding:10px 13px}
 #camp[data-phase=reward] .decision{padding:12px;margin:6px 0 0;border-radius:16px}
 #camp[data-phase=reward] .decision>.eyebrow{font-size:11px;letter-spacing:.7px}
 #camp[data-phase=reward] .decision>h2{font-size:23px;line-height:1.15;margin:4px 0}
 #camp[data-phase=reward] .intermission-income{font-size:14px;margin:3px 0}
 #camp[data-phase=reward] .choices{display:grid;grid-template-columns:minmax(0,1fr);gap:7px;margin:10px 0 0}
 #camp[data-phase=reward] .choice{display:grid;grid-template-columns:36px minmax(0,1fr);grid-template-rows:auto auto;gap:3px 8px;padding:9px;min-height:64px;text-align:left;align-items:center}
 #camp[data-phase=reward] .choice>.portrait,#camp[data-phase=reward] .choice>.choice-icon,#camp[data-phase=reward] .choice>.keepsake-art{grid-column:1;grid-row:1/3;width:36px;height:36px;font-size:28px}
 #camp[data-phase=reward] .choice>strong{grid-column:2;grid-row:1;font-size:16px;line-height:1.2}
 #camp[data-phase=reward] .choice>small{grid-column:2;grid-row:2;font-size:13px;line-height:1.3;min-width:0}
 #camp[data-phase=reward] .saved-win-note{font-size:12px;line-height:1.3;margin:5px 0}
 #camp[data-phase=reward]>footer{font-size:10px;margin-top:10px;padding-top:7px}
}

@media(max-width:700px){
 #camp:is([data-phase=prepare],[data-phase=retry],[data-phase=reward])>footer{display:block;font-size:12px;line-height:1.2;margin-top:6px;padding-top:0;border-top:0}
 #camp:is([data-phase=prepare],[data-phase=retry],[data-phase=reward])>footer>span:first-child{display:none}
}

@media(max-width:700px){
 #camp[data-phase=reward]{padding:6px 12px}
 #camp[data-phase=reward] .decision{padding:10px}
 #camp[data-phase=reward] .reward-next{margin-top:4px}
 #camp[data-phase=reward]>footer{margin-top:2px}
}
@media(max-width:700px){
 #camp:is([data-phase=prepare],[data-phase=retry]){padding-top:6px;padding-bottom:6px}
 #camp:is([data-phase=prepare],[data-phase=retry]) .garden-harvest,#camp:is([data-phase=prepare],[data-phase=retry]) .camp-reward-receipt{font-size:13px;line-height:1.25;padding:4px 6px;margin:0 0 5px}
 #camp:is([data-phase=prepare],[data-phase=retry]) .difficulty-pick strong{line-height:1.1}
 #camp:is([data-phase=prepare],[data-phase=retry]) .difficulty-pick small{line-height:1.2}
}

/* A sentence needs a sentence-sized box. Reserve its band in battleInsets. */
#battleScreen .boss-warning{top:calc(var(--battle-meter-bottom,150px) + 4px);left:50%;right:auto;transform:translateX(-50%);width:min(520px,calc(100% - 24px));max-width:none;min-height:0;padding:4px 8px;font-size:13px;line-height:1.25;text-align:left}

@media(max-width:700px){
 #battleScreen.is-paused .pause-overlay{inset:var(--pause-help-top,36px) auto auto var(--pause-help-left,86px);transform:none;width:var(--pause-help-width,112px);max-width:calc(100% - 24px);padding:0;gap:0;display:block;background:none;border:0;backdrop-filter:none;pointer-events:auto;text-align:left}
 #battleScreen.is-paused .pause-options{margin:0}
 #battleScreen.is-paused .pause-options>summary{display:flex;align-items:center;justify-content:center;min-height:44px;padding:4px 6px;font-size:12px;line-height:1.2;border:1px solid var(--line);border-radius:8px;background:#163a33f2}
 #battleScreen.is-paused .pause-overlay:has(.pause-options[open]){top:calc(var(--battle-meter-bottom,150px) + 46px);left:12px;width:min(350px,calc(100% - 24px));padding:8px;background:#163a33fa;border:1px solid #91b9a7}
}

/* Finished expeditions keep their next action beside the result. */
.finish-note{margin:10px 0;color:var(--muted);font-size:15px}
@media(max-width:700px){
 .result-overlay{padding:12px;align-items:center}
 .result-card{padding:20px 16px;max-height:calc(100dvh - 24px);overflow:auto}
 .result-card h2{font-size:27px;line-height:1.15;margin:8px 0}
 .result-card>p{font-size:14px;line-height:1.4}
 .result-card #resultContinue{margin-top:14px;width:100%;white-space:normal;min-height:44px;padding:10px}
 #camp:is([data-phase=victory],[data-phase=defeat]){padding:8px 12px}
 #camp:is([data-phase=victory],[data-phase=defeat]) .mast{min-height:46px;padding-bottom:6px;gap:8px}
 #camp:is([data-phase=victory],[data-phase=defeat]) .brand>span{font-size:34px}
 #camp:is([data-phase=victory],[data-phase=defeat]) .edition{display:none}
 #camp:is([data-phase=victory],[data-phase=defeat]) .decision{padding:12px;margin:8px 0}
 #camp:is([data-phase=victory],[data-phase=defeat]) .decision h2{font-size:24px;line-height:1.15}
 #camp:is([data-phase=victory],[data-phase=defeat]) .decision p{font-size:14px;line-height:1.35}
 #camp:is([data-phase=victory],[data-phase=defeat]) .route-options{grid-template-columns:1fr;gap:6px;margin-top:12px}
 #camp:is([data-phase=victory],[data-phase=defeat]) .route-options button{min-height:44px;padding:8px;font-size:14px;white-space:normal}
 #camp:is([data-phase=victory],[data-phase=defeat])>footer{font-size:12px;margin-top:6px;padding:0;display:block}
 #camp:is([data-phase=victory],[data-phase=defeat])>footer>span:first-child{display:none}
}

@media(max-width:700px){
 #battleScreen.is-paused .pause-overlay>h2{display:none}
}

/* One in-flow Kart entrance; the decision stays in place with no timed gate. */
.kart-card{display:grid;grid-template-columns:50px minmax(0,1fr);gap:6px 8px;width:100%;padding:8px;border:1px solid #e7ca79;border-radius:12px;background:linear-gradient(110deg,#4d5131,#263f36);color:var(--cream);overflow:hidden}
.kart-svg{width:50px;height:32px;align-self:center;color:#f3d98f}
.kart-card-text{display:grid;align-content:center;gap:2px;min-width:0}
.kart-card-text strong{font-size:16px;line-height:1.2;color:#ffe2a0}
.kart-card-text span{font-size:12px;line-height:1.25;color:#dce4c8}
.kart-card-actions{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:8px}
.kart-card-actions>button{min-width:0;min-height:44px;padding:8px;font-size:14px;line-height:1.2;white-space:normal}
.kart-card[data-arrive] .kart-svg{animation:kartRoll .55s ease-out 1 both}
@keyframes kartRoll{from{transform:translateX(-28px);opacity:.25}to{transform:translateX(0);opacity:1}}
@media(prefers-reduced-motion:reduce){.kart-card[data-arrive] .kart-svg{animation:none!important}}
.motion-calm .kart-card[data-arrive] .kart-svg{animation:none!important}
