/* v9: tuned security layer; phone combat fits one screen with full-size dice. */
/* Comparison links live in the setup panel beneath the route choice. */
.breach-study.dock-study .route-setup .routebar{flex-wrap:wrap;gap:8px}
.breach-study.dock-study .route-setup .study-links{flex-basis:100%;gap:14px;padding-top:8px;border-top:1px solid #c3c4a8}
.breach-study.dock-study .route-setup .study-links a{color:#1e4a3c}
@media(max-width:580px){
 /* Compact host: smaller machine, one-line heading, one-line integrity. */
 .breach-study.dock-study .enemy-heading{min-height:0;align-items:center;margin-bottom:5px}
 .breach-study.dock-study .enemy-heading .location{display:none}
 .breach-study.dock-study .enemy-heading h2{font-size:21px;line-height:1.1}
 .breach-study.dock-study .enemy-heading .round{padding:4px 7px;font-size:9px}
 .breach-study.dock-study .arena{padding-top:94px}
 .breach-study.dock-study .enemy{width:134px;height:94px}
 .breach-study.dock-study .enemy-barrier{width:118px;height:86px}
 .breach-study.dock-study .intent-bubble{top:75px}
 .breach-study.dock-study .intent-bubble strong{font-size:15px}
 .breach-study.dock-study .enemy-plan{top:62px}
 .breach-study.dock-study .enemy-slots{margin-top:6px}
 .breach-study.dock-study .battle .health{flex-wrap:nowrap;gap:6px;margin-top:2px}
 .breach-study.dock-study .battle .health .hp-track{flex:1;min-width:40px}
 .breach-study.dock-study .battle .hit-lane{width:auto;font-size:10px;gap:3px;flex:none}
 .breach-study.dock-study .battle .hit-lane>span{padding:2px 4px}
 .breach-study.dock-study .battle .hp-value,.breach-study.dock-study .repair-tag{font-size:10px;white-space:nowrap}
 .breach-study.dock-study .enemy-loadout{margin-top:0;font-size:10px}

 /* Supporting machines become one-line modules on a shared rail. */
 .breach-study.dock-study .subsystems{display:flex;flex-direction:column;gap:5px;width:auto;max-width:none;margin:10px 0 6px 10px;position:relative}
 .breach-study.dock-study .subsystems:before{content:'';position:absolute;left:-8px;top:-12px;bottom:24px;width:3px;background:#b59e70}
 .breach-study.dock-study .subsystems:after{content:none}
 .breach-study.dock-study .subsystem,.breach-study.dock-study .subsystem:only-child{width:100%;max-width:none;display:grid;grid-template-columns:46px minmax(0,1fr) auto;grid-template-areas:'machine title socket' 'machine health socket';align-items:center;gap:3px 8px;padding:5px 7px;border-bottom-width:3px}
 .breach-study.dock-study .subsystem:before{left:-8px;top:50%;width:8px;height:3px}
 .breach-study.dock-study .subsystem:after{content:none}
 .breach-study.dock-study .subsystem header{font-size:9px;letter-spacing:.5px;min-width:0}
 .breach-study.dock-study .sub-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .breach-study.dock-study .component-stage{min-height:0;width:46px}
 .breach-study.dock-study .component-art,.breach-study.dock-study .subsystem.security .component-art{max-width:46px}
 .breach-study.dock-study .effect-badge{font-size:8px;padding:0 3px;right:-6px;bottom:-6px}
 .breach-study.dock-study .component-socket:before{display:none}
 .breach-study.dock-study .component-socket .slot-line{padding:3px;gap:3px;flex-wrap:nowrap}
 .breach-study.dock-study .component-socket .line-value{display:none}
 .breach-study.dock-study .component-health{margin:0;gap:6px}
 .breach-study.dock-study .sub-track{height:6px}
 .breach-study.dock-study .sub-hp{font-size:9px}
 .breach-study.dock-study .subsystem .port-hole{width:40px;height:40px}
 .breach-study.dock-study .subsystem .port-hole.mod{width:34px;height:34px}
 /* Severed and destroyed machines collapse to a labelled stub. */
 .breach-study.dock-study .subsystem.offline,.breach-study.dock-study .subsystem.destroyed{grid-template-columns:minmax(0,1fr);grid-template-areas:'title';padding:4px 8px;border-bottom-width:2px}
 .breach-study.dock-study .subsystem.offline :is(.component-stage,.component-socket,.component-health),.breach-study.dock-study .subsystem.destroyed :is(.component-stage,.component-socket,.component-health){display:none}

 /* Buses: tighter channels around the same sockets. */
 .breach-study.dock-study .connection-bus{padding-top:10px;padding-bottom:10px}
 .breach-study.dock-study .player-slots .slot{padding:4px 5px;gap:3px}
 .breach-study.dock-study .player-slots .slot-line{padding:2px 4px}

 /* Console: dice and Execute on one row; reroll beside your integrity. */
 .breach-study.dock-study .player-console{display:grid;grid-template-columns:44px minmax(0,1fr) auto;grid-template-areas:'dice dice exec' 'reroll rig rig';gap:7px 8px;padding:8px}
 .breach-study.dock-study .player-console :is(.combat-dock,.hand,.section-line,.action){display:contents}
 .breach-study.dock-study .player-console .dice-row{grid-area:dice;display:flex;gap:6px;justify-content:flex-start;min-height:44px;padding:0}
 .breach-study.dock-study .player-console .dice-unit{width:44px;height:44px;flex-shrink:0}
 .breach-study.dock-study .die.physical-die{--size:44px}
 .breach-study.dock-study .player-console .execute{grid-area:exec;width:auto;min-width:72px;min-height:44px;padding:4px;font-size:11px}
 .breach-study.dock-study .player-console .reroll{grid-area:reroll;width:44px;min-height:36px;padding:0;align-self:center}
 .breach-study.dock-study .player-console .rig{grid-area:rig;border-top:0;padding-top:0;align-self:center}
 .breach-study.dock-study .player-console .forecast,.breach-study.dock-study .player-console .tray-mark{display:none}
}
@media(max-width:389px){
 .breach-study.dock-study .player-console{grid-template-columns:40px minmax(0,1fr) auto;gap:6px}
 .breach-study.dock-study .player-console .dice-row{gap:3px;min-height:38px}
 .breach-study.dock-study .player-console .dice-unit{width:38px;height:38px}
 .breach-study.dock-study .die.physical-die{--size:38px}
 .breach-study.dock-study .player-console .execute{min-width:58px;padding:2px 4px;font-size:10px}
 .breach-study.dock-study .player-console .reroll{width:40px}
 .breach-study.dock-study .subsystem .port-hole{width:36px;height:36px}
 .breach-study.dock-study .subsystem .port-hole.mod{width:30px;height:30px}
}
/* The smallest phones need narrower dice to retain a separate Execute target. */
@media(max-width:349px){
 .breach-study.dock-study .player-console .dice-row{min-height:34px}
 .breach-study.dock-study .player-console .dice-unit{width:34px;height:34px}
 .breach-study.dock-study .die.physical-die{--size:34px}
}
/* The outcome stamps across the enemy board instead of below the console. */
.breach-study.dock-study .battle{position:relative}
.breach-study.dock-study .battle>.result:not([hidden]){position:absolute;left:24px;right:24px;top:58px;z-index:30;display:grid;justify-items:center;gap:4px;margin:0;padding:18px 20px;text-align:center;border:2px solid #263f33;border-bottom-width:5px;border-radius:10px;box-shadow:0 10px 24px #173a3040;transform:rotate(-1.5deg);animation:result-stamp .35s cubic-bezier(.2,1.4,.4,1)}
.breach-study.dock-study .battle>.result .result-label{letter-spacing:2px}
.breach-study.dock-study .battle>.result h3{margin:0;font-size:30px}
.breach-study.dock-study .battle>.result p{margin:0 0 6px;max-width:520px}
.breach-study.dock-study .battle>.result .execute{width:auto;min-width:200px;min-height:44px}
.breach-study.dock-study.slots[data-phase=ended] .arena{filter:saturate(.6)}
@keyframes result-stamp{from{opacity:0;transform:rotate(-1.5deg) scale(1.15)}}
@media(max-width:580px){
 .breach-study.dock-study .battle>.result:not([hidden]){left:6px;right:6px;top:40px;padding:12px}
 .breach-study.dock-study .battle>.result h3{font-size:23px}
 .breach-study.dock-study .battle>.result p{font-size:12px}
}
@media(prefers-reduced-motion:reduce){.breach-study.dock-study .battle>.result:not([hidden]){animation:none}}
.breach-study.dock-study .battle>.result[data-outcome=lost]{background:#f2c4a8;border-color:#7d2a1d}
.breach-study.dock-study .battle>.result[data-outcome=lost] .result-label{color:#7d2a1d}
