/* Party/deck selection foregrounds the hero and chosen party. Eligibility and
   purchase/start handlers remain owned by the existing expedition state. */
.exp-page.exp-party-screen.party-system{display:flex;flex-direction:column;padding:16px;gap:12px;min-height:0}
.party-system .exp-screen-heading{min-height:48px;gap:12px}
.party-system .exp-screen-heading h2{font-size:28px;line-height:1.15}
.party-system .exp-screen-heading small{font-size:13px;line-height:1.4;letter-spacing:0}
.party-system .exp-screen-heading>.exp-icon-button{width:44px;min-height:44px;flex-basis:44px}
.party-system .exp-screen-heading .ship-heading-bank .exp-money{font-size:17px}
.party-system.ship-party .exp-screen-heading>.ship-heading-bank{display:none}
.party-system .exp-selected-party{flex:0 0 56px;gap:12px}
.party-system .exp-selected-hero{background:none;border:0;border-radius:8px;padding:4px 0;gap:8px;min-height:48px;font-size:14px}
.party-system .exp-selected-hero img{height:44px;width:34px;border-radius:6px}
.party-system .exp-selected-hero span{font-size:14px;line-height:1.3}
.party-system .exp-empty-party{min-height:48px;border:1px dashed var(--pm-ui-accent,#b5dac3);border-radius:10px;background:color-mix(in srgb,var(--pm-ui-accent) 8%,transparent);padding:6px;gap:4px;box-shadow:none}
.party-system .exp-empty-party small{font-size:13px;line-height:1.3}
.party-system .ship-party-readiness{padding:0;border:0;border-radius:0;background:none;font-size:14px!important;line-height:1.45!important;color:var(--pm-ui-text,#f1eee3)!important}
.party-system .ship-party-readiness>span{font-size:13px;line-height:1.4;color:var(--pm-ui-muted,#b7c8c8);margin-top:4px}
.party-system .ship-party-readiness.needs-hero{color:var(--pm-ui-brass,#e0c48c)!important}
.party-readiness-row{display:flex;align-items:center;gap:12px;flex:none}
.party-readiness-row>.ship-party-readiness{flex:1;min-width:0}
.party-system .party-deck-link{min-height:44px;padding:8px 0 8px 8px;font-size:14px;font-weight:500;background:none;border:0;color:var(--pm-ui-accent,#b5dac3);flex:none}
.party-system .journey-choice-note{padding:0;border:0;border-radius:0;background:none;font-size:14px;line-height:1.5}
.party-system .exp-hero-stage{flex:1;min-height:0;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px;background:none;border:0;border-radius:0;box-shadow:none;overflow:hidden}
.party-system .exp-hero-large{height:100%;min-height:0;border-radius:16px;position:relative;inset:auto;width:100%;opacity:1}
.party-system .exp-hero-large :is(.art,.foil-art){object-position:center 24%;height:100%;width:100%;object-fit:cover}
.party-system .exp-hero-large:after{background:linear-gradient(180deg,transparent 60%,color-mix(in srgb,var(--pm-ui-ink) 20%,transparent))}
.party-system .exp-hero-details{height:100%;max-height:100%;min-height:0;padding:8px 4px 8px 0;gap:12px;justify-content:center;align-items:flex-start;overflow-y:auto}
.party-system .exp-hero-details>.exp-eyebrow{font-size:12px;line-height:1.4;letter-spacing:.06em}
.party-system .exp-hero-details>h1{font-size:clamp(28px,4vw,40px);line-height:1.1;letter-spacing:-.04em;margin:0}
.party-system .exp-hero-vital{font-size:17px;line-height:1.4;gap:6px;flex-wrap:wrap}
.party-system .exp-hero-vital small{font-size:13px;line-height:1.4;color:var(--pm-ui-muted,#b7c8c8)}
.party-system .exp-hero-details>.exp-button{min-height:48px;font-size:15px;line-height:1.3;padding:12px 16px;max-width:100%;white-space:normal}
.party-system .exp-hero-details>.party-hero-toggle{background:none;border-color:var(--pm-ui-accent,#b5dac3);color:var(--pm-ui-accent,#b5dac3);font-weight:500}
.party-system .exp-hero-details>small{font-size:13px;line-height:1.5;color:var(--pm-ui-muted,#b7c8c8)}
.party-hero-notes{width:100%;padding:0;border:0;background:none;flex:none}
.party-hero-notes>summary,.party-system .ship-party-rules>summary{box-sizing:border-box;min-height:44px;display:flex;align-items:center;gap:8px;font-size:14px;line-height:1.4;font-weight:500;cursor:pointer;list-style:none;color:var(--pm-ui-accent,#b5dac3)}
.party-hero-notes>summary::-webkit-details-marker,.party-system .ship-party-rules>summary::-webkit-details-marker{display:none}
.party-hero-notes>summary:after,.party-system .ship-party-rules>summary:after{content:'›';font-size:20px;margin-left:auto;transform:rotate(90deg)}
.party-hero-notes[open]>summary:after,.party-system .ship-party-rules[open]>summary:after{transform:rotate(-90deg)}
.party-hero-notes>summary:focus-visible,.party-system .ship-party-rules>summary:focus-visible{outline:2px solid var(--pm-ui-focus,#f3d795);outline-offset:2px;border-radius:4px}
.party-system .party-hero-notes>p,.party-system .hero-perk-desc,.party-system .ship-party-rules p{display:block;font-size:15px;line-height:1.5;max-width:none;color:var(--pm-ui-muted,#b7c8c8)}
.party-system .hero-perk{padding:12px 0;background:none;border:0;border-radius:0;gap:6px}
.party-system .hero-perk-label{font-size:12px;letter-spacing:.05em}
.party-system .hero-perk-name{font-size:17px;line-height:1.4}
.party-system .ship-party-rules{width:100%;padding:0;border:0;background:none;margin:0}
.party-system .exp-roster{height:84px;gap:12px;flex:none}
.party-system .exp-hero-option{background:none;border:0;border-bottom:2px solid transparent;border-radius:0;padding:4px;color:var(--pm-ui-muted,#b7c8c8);gap:6px;min-height:48px}
.party-system .exp-hero-option.selected{border-color:var(--pm-ui-accent,#b5dac3);color:var(--pm-ui-text,#f1eee3);background:color-mix(in srgb,var(--pm-ui-accent) 8%,transparent)}
.party-system .exp-hero-option img{height:48px;width:48px;border-radius:8px}
.party-system .exp-hero-option span{font-size:14px;line-height:1.3}
.party-system .exp-hero-option i{right:4px;top:4px;font-size:13px}
.party-system .exp-screen-footer{gap:12px;min-height:48px;flex:none}
.party-system .exp-screen-footer>.exp-button{min-height:48px;font-size:15px;line-height:1.3;padding:12px 16px;max-width:none}
.party-system .exp-screen-footer>.exp-button.secondary{background:none;border:0;font-weight:500;color:var(--pm-ui-muted,#b7c8c8)}
.party-system .exp-pager button{min-width:44px;min-height:44px}
.party-system .exp-pager>span{font-size:13px}
.party-system .ship-purchase-preview{padding:0;border:0;border-radius:0;background:none;font-size:13px!important;line-height:1.5!important;text-align:left}
@media(max-width:600px){
 .exp-page.exp-party-screen.party-system{padding:12px;gap:10px}
 .party-system .exp-screen-heading h2{font-size:25px}
 .party-system.ship-party .exp-screen-heading h2{font-size:24px;text-wrap:balance}
 .party-system .exp-selected-party{gap:8px;flex-basis:52px}
 .party-system .exp-selected-hero{gap:5px}
 .party-system .exp-selected-hero img{height:38px;width:28px}
 .party-system .exp-selected-hero span{font-size:13px}
 .party-system .exp-hero-stage{grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);gap:16px}
 .party-system .exp-hero-details{gap:8px;padding:4px 2px 4px 0;justify-content:flex-start}
 .party-system .exp-hero-details>h1{font-size:28px}
 .party-system .exp-hero-details>.exp-button{font-size:14px;padding:10px 12px}
 .party-system .exp-hero-vital{font-size:16px}
 .party-system .exp-roster{height:72px;gap:8px}
 .party-system .exp-hero-option img{height:36px;width:36px}
 .party-system .exp-hero-option span{font-size:13px}
 .party-system .ship-party-footer{display:flex;justify-content:space-between;gap:8px}
 .party-system .ship-party-footer>.exp-pager{justify-content:center;gap:4px}
 .party-system .ship-party-footer>.exp-pager>span{font-size:12px;min-width:30px}
 .party-system .ship-party-footer>.exp-button.primary{padding:10px 12px;font-size:14px;flex:1}
 .party-system .exp-screen-footer>.exp-button{font-size:14px;padding:10px 12px}
}
@media(max-height:550px) and (orientation:landscape){
 .exp-page.exp-party-screen.party-system{display:grid;grid-template-columns:minmax(0,1fr) 176px;grid-template-rows:auto auto minmax(0,1fr) auto;padding:8px 16px;gap:8px 20px}
 .party-system>.exp-screen-heading{grid-column:1/-1;grid-row:1;min-height:44px}
 .party-system .exp-screen-heading h2{font-size:24px}
 .party-system>.exp-selected-party{grid-column:1;grid-row:2;min-height:48px;height:48px}
 .party-system>.party-readiness-row{grid-column:2;grid-row:2;display:grid;gap:4px;align-self:start}
 .party-system .party-readiness-row>.ship-party-readiness{font-size:13px!important;padding:0}
 .party-system .party-deck-link{justify-content:flex-start;padding:4px 0}
 .party-system>.exp-hero-stage{grid-column:1;grid-row:3;grid-template-columns:minmax(0,.7fr) minmax(0,1.3fr);gap:16px;height:100%}
 .party-system .exp-hero-details{padding:0 4px 0 0;gap:6px;justify-content:flex-start}
 .party-system .exp-hero-details>h1{font-size:26px}
 .party-system>.exp-roster{grid-column:2;grid-row:3;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(44px,1fr));height:100%;gap:4px}
 .party-system .exp-hero-option img{height:30px;width:30px}
 .party-system .exp-hero-option span{font-size:12px}
 .party-system>.exp-screen-footer{grid-column:1/-1;grid-row:4;display:flex;justify-content:space-between;gap:12px;min-height:48px}
 .party-system .exp-screen-footer>.exp-button{font-size:14px;padding:10px 16px}
 .party-system.ship-hero-shop{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto}
 .party-system.ship-hero-shop>.exp-hero-stage{grid-column:1;grid-row:2;grid-template-columns:minmax(0,.6fr) minmax(0,1.4fr)}
 .party-system.ship-hero-shop>.exp-screen-footer{grid-row:3}
}

.party-system{background:var(--pm-ui-ink);color:var(--pm-ui-text)}
.party-system :is(.exp-screen-heading h2,.exp-selected-hero,.exp-hero-details h1,.hero-perk-name){color:var(--pm-ui-text)}
.party-system :is(.exp-screen-heading small,.exp-hero-details>.exp-eyebrow,.hero-perk-label,.ship-purchase-preview){color:var(--pm-ui-muted)!important}
.party-system .exp-hero-vital{color:var(--pm-ui-danger)}
.party-system .exp-button.primary{background:var(--pm-ui-accent);color:var(--pm-ui-on-accent)}
.party-system .exp-screen-heading>.exp-icon-button{background:var(--pm-ui-surface);color:var(--pm-ui-text);border-color:var(--pm-ui-line)}

.party-system .exp-money b{color:var(--pm-ui-text)}
.party-system .exp-pager>span{color:var(--pm-ui-muted)}

.party-system .exp-button.primary .exp-money{color:var(--pm-ui-on-accent)}
.party-system .exp-button.primary .exp-money b{color:var(--pm-ui-on-accent)}

.party-system .exp-button.secondary{background:var(--pm-ui-surface);color:var(--pm-ui-text);border-color:var(--pm-ui-line)}

/* Selected heroes and the next action share the compact pill language. */
.party-system.ship-party .party-members{flex:none;width:100%;background:none;border:0;padding:0}
.party-system.ship-party .party-members>summary{display:flex;align-items:center;min-height:44px;gap:12px;list-style:none;cursor:pointer;font-size:14px;line-height:1.4;color:var(--pm-ui-text)}
.party-system.ship-party .party-members>summary::-webkit-details-marker{display:none}
.party-system.ship-party .party-members>summary>span{margin-left:auto;font-size:13px;color:var(--pm-ui-muted)}
.party-system.ship-party .party-members>summary:focus-visible{outline:2px solid var(--pm-ui-focus);outline-offset:2px;border-radius:8px}
.party-system.ship-party .party-members>.exp-selected-party{margin:8px 0}
.party-system.ship-party .party-readiness-row:has(.ship-party-readiness:not(.needs-hero)){position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.party-system.ship-party .party-readiness-row:has(.needs-hero){display:block}
.party-system.ship-party .party-hero-notes h3{font-size:17px;line-height:1.4;color:var(--pm-ui-text)}
.party-system.ship-party .party-hero-notes .exp-eyebrow{font-size:12px;color:var(--pm-ui-muted)}
.party-system.ship-party .ship-party-footer>.exp-button.primary{flex:1}
@media(max-width:849px) and (orientation:portrait){
 .party-system.ship-party>.exp-hero-stage{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;overflow-y:auto;min-height:0;padding:4px}
 .party-system.ship-party .exp-hero-large{width:166px;height:222px;min-height:222px;max-width:70%;aspect-ratio:3/4;flex:none;border-radius:24px}
 .party-system.ship-party .exp-hero-details{width:100%;height:auto;max-height:none;flex:none;overflow:visible;padding:0;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 12px;align-items:center;text-align:left}
 .party-system.ship-party .exp-hero-details>h1{grid-column:1;grid-row:1;font-size:25px}
 .party-system.ship-party .exp-hero-details>.exp-hero-vital{grid-column:2;grid-row:1;font-size:15px;gap:4px;justify-content:flex-end}
 .party-system.ship-party .exp-hero-vital>small{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 .party-system.ship-party .exp-hero-details>.party-hero-toggle{grid-column:1/-1;grid-row:2;width:100%;min-height:44px;padding:10px 14px;font-size:14px}
 .party-system.ship-party .party-hero-notes{grid-column:1/-1;grid-row:3}
 .party-system.ship-party .party-hero-notes>summary{min-height:44px;font-size:13px}
 .party-system.ship-party>.exp-roster{height:64px;gap:8px}
 .party-system.ship-party .exp-hero-option img{width:32px;height:32px}
 .party-system.ship-party .exp-hero-option span{font-size:12px}
}
@media(max-width:849px) and (max-height:700px) and (orientation:portrait){
 .party-system.ship-party .exp-hero-large{width:102px;height:136px;min-height:136px}
 .party-system.ship-party>.exp-hero-stage{gap:8px;justify-content:flex-start}
}
@media(max-height:550px) and (orientation:landscape){
 .party-system.ship-party>.party-members{grid-column:1/-1;grid-row:2}
 .party-system.ship-party>.party-members[open]{max-height:112px;overflow-y:auto}
 .party-system.ship-party>.exp-hero-stage{grid-column:1;grid-row:3}
 .party-system.ship-party>.exp-roster{grid-column:2;grid-row:3}
}
.party-system .exp-selected-hero{padding:4px 8px;border-radius:24px;background:var(--pm-ui-surface-soft)}
.party-system .exp-empty-party{border-radius:24px;border-color:var(--pm-ui-line);background:none}
.party-system .exp-hero-large{border-radius:24px}
.party-system .exp-hero-details>.exp-button,.party-system .exp-screen-footer>.exp-button{border-radius:28px}
.party-system .exp-hero-option.selected{border-radius:16px;border-bottom-color:transparent;background:var(--pm-ui-surface-soft)}
/* Hero catalogue uses a centered collectible, never a full-height art strip. */
.party-system .party-hero-notes>summary,.party-system .ship-party-rules>summary{color:var(--pm-ui-text)}
@media(max-width:849px) and (orientation:portrait){
 .party-system.ship-hero-shop>.exp-hero-stage{display:flex;flex-direction:column;align-items:center;gap:16px;overflow-y:auto;overscroll-behavior:contain;padding:8px 4px 12px}
 .party-system.ship-hero-shop .exp-hero-large{width:180px;height:240px;max-width:70%;min-height:240px;flex:none;aspect-ratio:3/4;border-radius:22px;box-shadow:0 10px 24px var(--pm-ui-shadow)}
 .party-system.ship-hero-shop .exp-hero-large :is(.art,.foil-art){object-fit:cover;object-position:center 24%}
 .party-system.ship-hero-shop .exp-hero-details{height:auto;max-height:none;min-height:0;overflow:visible;flex:none;width:100%;max-width:440px;padding:0;align-items:center;justify-content:flex-start;text-align:center;gap:10px}
 .party-system.ship-hero-shop .exp-hero-details>.exp-eyebrow{order:0}
 .party-system.ship-hero-shop .exp-hero-details>h1{order:1;font-size:28px}
 .party-system.ship-hero-shop .exp-hero-details>small{order:2}
 .party-system.ship-hero-shop .exp-hero-details>.exp-button{order:3;min-width:200px;max-width:100%;border-radius:28px}
 .party-system.ship-hero-shop .exp-hero-details>#hero-deck-status{order:4}
 .party-system.ship-hero-shop .exp-hero-details>.ship-purchase-preview{order:5;text-align:center}
 .party-system.ship-hero-shop .exp-hero-details>.party-hero-notes{order:6;text-align:left;max-width:440px}
}
@media(max-width:849px) and (max-height:700px) and (orientation:portrait){
 .party-system.ship-hero-shop .exp-hero-large{width:132px;height:176px;min-height:176px}
 .party-system.ship-hero-shop>.exp-hero-stage{gap:12px}
 .party-system.ship-hero-shop .exp-hero-details{gap:8px}
}
@media(max-width:600px) and (orientation:portrait){.party-system:not(.ship-hero-shop) .exp-hero-large{width:min(100%,210px);height:auto;aspect-ratio:3/4;max-height:280px}}
/* Short phones reserve the complete name/action/details stack before roster. */
@media(max-height:550px) and (orientation:landscape){
 .shell .party-system.ship-party{display:grid;grid-template-columns:minmax(0,1fr) 148px;grid-template-rows:44px 36px minmax(0,1fr) 48px;padding:8px 16px;gap:6px 20px}
 .shell .party-system.ship-party>.exp-screen-heading{grid-column:1/-1;grid-row:1;min-height:44px;gap:8px}
 .shell .party-system.ship-party .exp-screen-heading h2{font-size:22px;line-height:1.15}
 .shell .party-system.ship-party .exp-screen-heading small{font-size:12px;line-height:1.3;margin-top:2px}
 .shell .party-system.ship-party>.party-members{grid-column:1/-1;grid-row:2;min-height:0}
 .shell .party-system.ship-party .party-members>summary{min-height:36px;font-size:13px}
 .shell .party-system.ship-party>.party-members[open]{position:absolute;top:56px;left:16px;right:16px;z-index:12;padding:8px 12px;border-radius:20px;background:var(--pm-ui-surface);max-height:160px;overflow-y:auto;box-shadow:0 8px 24px var(--pm-ui-shadow)}
 .shell .party-system.ship-party>.exp-hero-stage{grid-column:1;grid-row:3;display:grid;grid-template-columns:100px minmax(0,1fr);gap:16px;align-items:center;min-height:0;height:100%;padding:0;overflow-y:auto}
 .shell .party-system.ship-party>.exp-hero-stage>.exp-hero-large{width:96px;height:128px;min-height:128px;max-height:128px;aspect-ratio:3/4;justify-self:center;align-self:center}
 .shell .party-system.ship-party .exp-hero-large :is(.art,.foil-art){object-fit:cover;object-position:center 24%}
 .shell .party-system.ship-party .exp-hero-details{width:100%;height:auto;max-height:none;min-height:0;overflow:visible;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 12px;align-content:center;padding:0;flex:none}
 .shell .party-system.ship-party .exp-hero-details>h1{grid-column:1;grid-row:1;font-size:24px;line-height:1.15}
 .shell .party-system.ship-party .exp-hero-vital{grid-column:2;grid-row:1;font-size:15px;gap:4px}
 .shell .party-system.ship-party .exp-hero-vital>small{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 .shell .party-system.ship-party .exp-hero-details>.party-hero-toggle{grid-column:1/-1;grid-row:2;min-height:44px;padding:10px 12px;font-size:14px;width:100%;white-space:nowrap}
 .shell .party-system.ship-party .party-hero-notes{grid-column:1/-1;grid-row:3}
 .shell .party-system.ship-party .party-hero-notes>summary{min-height:44px;font-size:13px}
 .shell .party-system.ship-party>.exp-roster{grid-column:2;grid-row:3;height:100%;min-height:0;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(44px,1fr));gap:4px}
 .shell .party-system.ship-party>.ship-party-footer{grid-column:1/-1;grid-row:4;min-height:48px}
}
@media(max-width:600px) and (max-height:700px) and (orientation:portrait){
 .shell .party-system.ship-party .exp-screen-heading h2{font-size:22px;line-height:1.15}
 .shell .party-system.ship-party>.exp-hero-stage{display:flex;flex-direction:column;justify-content:flex-start;align-items:center;gap:8px;padding:4px;overflow-y:auto;min-height:0}
 .shell .party-system.ship-party>.exp-hero-stage>.exp-hero-large{width:96px;height:128px;min-height:128px;max-height:128px;max-width:100%;flex:0 0 128px;aspect-ratio:3/4}
 .shell .party-system.ship-party .exp-hero-details{height:auto;max-height:none;min-height:0;overflow:visible;flex:none;gap:8px 12px;padding:0}
 .shell .party-system.ship-party .exp-hero-details>h1{font-size:24px;line-height:1.15}
 .shell .party-system.ship-party .exp-hero-details>.party-hero-toggle{min-height:44px;padding:10px 12px}
 .shell .party-system.ship-party .party-hero-notes>summary{min-height:44px}
}
.shell .party-system.ship-party .exp-hero-vital{display:flex}

/* Keep campaign choice in the existing readiness slot on every viewport. */
.shell .party-system.ship-party .party-readiness-row:has(.campaign-picker-inline){position:static;width:auto;height:auto;margin:0;overflow:visible;clip-path:none;white-space:normal;flex-shrink:0;display:flex}
.campaign-picker-inline{display:flex;gap:8px;align-items:center;min-width:0;width:100%;font-size:12px;font-weight:650}
.campaign-picker-inline select{min-width:0;width:100%;height:44px;padding:8px;border:1px solid var(--pm-ui-line,#b5c4c0);border-radius:8px;color:var(--pm-ui-text,#172e34);background:var(--pm-ui-surface,#fff);font:inherit}
.party-readiness-row:has(.campaign-picker-inline)>.ship-party-readiness:not(.needs-hero){position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.party-readiness-row:has(.needs-hero){flex-wrap:wrap}
@media(orientation:landscape) and (max-height:600px){.campaign-picker-label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.shell .party-system.ship-party>.party-readiness-row{grid-column:2;grid-row:2;z-index:2;align-self:start}.shell .party-system.ship-party{grid-template-rows:44px 44px minmax(0,1fr) 48px}}

