/* v7 keeps the board/cable identity while putting the hand within reach. */
body:has(.dock-study){padding-bottom:110px;scroll-padding-bottom:110px}
.dock-study{margin-bottom:12px}
.dock-study .brandbar{gap:14px;padding:10px 20px;position:relative}
.route-setup{margin-left:auto;position:relative;z-index:10;font:10px ui-monospace,monospace}
.route-setup summary{cursor:pointer;padding:10px 0;color:#d9ed91}
.route-setup .route-effect{color:inherit;font:inherit}
.dock-study .route-setup .routebar{position:absolute;top:100%;right:0;min-width:230px;display:flex;padding:12px;background:#ece8d3;border:1px solid #9dab87;box-shadow:0 6px 14px #183b3340;border-radius:8px}
.dock-study .enemy-committed .enemy-plan,.dock-study.enemy-committed .enemy-plan{display:none}
.dock-study .enemy-summary{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.dock-study .connection-bus{padding-top:20px;padding-bottom:20px}
.dock-study .bus-tail{display:none}
.dock-study .player-slots .slot{padding:7px 9px}
.dock-study .player-slots .slot header{flex-wrap:nowrap}
.dock-study .player-console{display:block;padding:9px 15px;border-bottom-width:4px}
.dock-study .rig{display:flex;gap:12px;padding:0;border:0}
.dock-study .player-core{display:flex;gap:5px;align-items:center;min-width:0;width:auto;padding:3px 6px;box-shadow:none;border:0;background:transparent}
.dock-study .player-core svg{width:25px;height:25px}
.dock-study .player-health{display:flex;flex-wrap:nowrap;gap:10px;flex:1}
.dock-study .player-health .attack-lane{width:auto;flex:none}
.dock-study .hp-loss-readout,.dock-study .damage-readout{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.dock-study .lane-shield+.lane-arrow{display:none}
.dock-study .combat-dock{position:fixed;bottom:12px;left:50%;transform:translateX(-50%);width:calc(100% - 32px);max-width:960px;z-index:100;display:flex;align-items:center;gap:20px;min-height:80px;padding:10px 18px;background:#173c32;border:2px solid #81956b;border-bottom:5px solid #294c39;border-radius:13px;box-shadow:0 5px 25px #142f2955;color:#e5edcd}
.dock-study .combat-dock .hand{display:flex;align-items:center;gap:18px;flex:1;min-width:0;padding:0;border:0;background:none;box-shadow:none}
.dock-study .hand .section-line{margin:0;display:flex;flex-direction:row;flex:none}
.dock-study .tray-mark{display:none}
.dock-study .combat-dock .dice-row{display:flex;flex-wrap:nowrap;gap:16px;justify-content:center;align-items:center;flex:1;padding:0;min-height:48px}
.dock-study .combat-dock .dice-unit{width:44px;min-height:0;height:44px}
.dock-study .die.physical-die{--size:44px}
.dock-study .combat-dock .action{display:block;padding:0;flex:none}
.dock-study .combat-dock .execute{width:140px;min-height:44px;padding:10px;font-size:16px}
.dock-study .combat-dock .reroll{min-height:40px;padding:6px 10px;font-size:11px;max-width:120px}
.dock-study .loadout{margin-top:8px}
.dock-study [data-port],.dock-study .result,.dock-study details{scroll-margin-bottom:115px;scroll-margin-top:12px}
@media(min-width:1100px){
 .dock-study .battle{grid-template-areas:'heading components' 'arena components' 'plan components' 'health health' 'details details'}
 .dock-study .connection-bus{padding:18px 16px}
 .dock-study .player-console .rig{display:flex}
 .dock-study .player-console .player-health .attack-lane{width:auto}
}
@media(max-width:1099px){
 .dock-study .brand{font-size:22px}.dock-study .brandbar{padding:8px 16px}
 .dock-study .enemy-heading h2{font-size:26px;margin:0}
 .dock-study .arena{padding-top:155px;height:auto}
 .dock-study .enemy{width:220px;height:155px;top:0}
 .dock-study .enemy-barrier{width:180px;height:135px;top:0}
 .dock-study .intent-bubble{top:132px;bottom:auto;padding:2px 6px;font-size:9px}
 .dock-study .intent-bubble strong{font-size:18px}
 .dock-study .enemy-slots{position:relative;inset:auto;display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}
 .dock-study .enemy-slots .slot{width:auto}
 .dock-study .enemy-slots .slot:after{width:3px;height:12px;top:-14px;left:50%;right:auto}
 .dock-study .subsystems{margin:14px auto 10px;gap:10px}
 .dock-study .subsystem:before{top:-16px;height:14px}
 .dock-study .subsystem{padding:7px;gap:4px}
 .dock-study .component-stage{min-height:60px}.dock-study .component-art{max-width:95px}
 .dock-study .subsystem:only-child{max-width:300px}
 .dock-study .component-health{margin-top:3px}
 .dock-study .health{gap:7px}
 .dock-study .connection-bus{padding:16px 0}
 .dock-study .player-core .you-label{font-size:9px}
 .dock-study .player-health .attack-lane{font-size:10px;gap:3px}
 .dock-study .player-hp-value{font-size:10px}
}
@media(max-width:580px){
 body:has(.dock-study){padding-bottom:92px}
 .dock-study .brandbar{padding:8px 12px;gap:8px}.dock-study .brand{font-size:19px}
 .route-setup{font-size:8px}.route-setup summary{max-width:130px}
 .dock-study .gameboard{padding:10px 8px}
 .dock-study .battle{padding:9px 8px}
 .dock-study .enemy-heading h2{font-size:23px}
 .dock-study .slot{gap:4px}
 .dock-study .player-slots .slot{padding:5px}
 .dock-study .player-console{padding:7px 8px}
 .dock-study .rig{gap:5px}.dock-study .player-core{padding:0}.dock-study .player-core svg{width:20px;height:20px}.dock-study .player-core .you-label{display:none}
 .dock-study .player-health{gap:5px}.dock-study .player-health .hp-track{min-width:30px}
 .dock-study .player-health .attack-source,.dock-study .player-health .shield-readout{padding:2px 3px}
 .dock-study .combat-dock{bottom:6px;width:calc(100% - 12px);min-height:72px;padding:9px 6px;gap:6px;border-radius:10px}
 .dock-study .combat-dock .hand{gap:5px}
 .dock-study .combat-dock .dice-row{gap:7px;min-height:36px}
 .dock-study .combat-dock .dice-unit{width:34px;height:34px}
 .dock-study .die.physical-die{--size:34px}
 .dock-study .combat-dock .reroll{width:33px;min-height:38px;padding:2px;font-size:0}
 .dock-study .reroll:after{content:'↻';font:22px monospace}
 .dock-study[data-phase=scout] .reroll:after{content:'⏻'}
 .dock-study .combat-dock .execute{width:65px;min-height:38px;font-size:11px;padding:5px 2px}
 .dock-study .loadout{padding-top:6px;margin-bottom:5px}
 .dock-study .footer{padding:3px 12px}
}
.dock-study .combat-dock .execute{color:#173c32}
@media(max-width:360px){.dock-study .combat-dock .dice-row{gap:4px}.dock-study .combat-dock .execute{width:57px}.dock-study .combat-dock .hand{gap:4px}}
.dock-study .combat-dock .hand:before,.dock-study .combat-dock .hand:after{display:none;pointer-events:none}

/* The hand is a physical console plugged into both buses. */
body:has(.dock-study){padding-bottom:0;scroll-padding-bottom:12px}
.dock-study .bus-tail{display:flex;bottom:-4px;z-index:2}
.dock-study .player-console{display:flex;flex-direction:column;gap:9px;padding:10px 15px}
.dock-study .combat-dock{position:relative;inset:auto;transform:none;order:-1;width:100%;max-width:none;min-height:64px;padding:0;border:0;border-radius:0;box-shadow:none;background:transparent;z-index:auto}
.dock-study .player-console .rig{border-top:1px solid #68855c;padding-top:8px}
.dock-study [data-port],.dock-study .result,.dock-study details{scroll-margin-bottom:12px}
@media(max-width:580px){
 .dock-study .player-console{padding:8px;gap:6px}
 .dock-study .combat-dock{min-height:48px;gap:6px}
 .dock-study .player-console .rig{padding-top:6px}
}
@media(max-width:360px){
 .dock-study .combat-dock .dice-unit{width:30px;height:30px}
 .dock-study .die.physical-die{--size:30px}
 .dock-study .combat-dock .dice-row{gap:3px}
 .dock-study .combat-dock .reroll{width:28px}
 .dock-study .combat-dock .execute{width:50px;font-size:10px}
}

/* Supporting machinery hangs from the host through a shared copper junction. */
@media(min-width:1100px){
 .dock-study .battle{grid-template-columns:minmax(0,1fr);grid-template-areas:'heading' 'arena' 'components' 'plan' 'health' 'details';row-gap:4px}
 .dock-study .subsystems{flex-direction:row;gap:18px;justify-content:center;width:min(100%,698px);margin:16px auto 2px;position:relative}
 .dock-study .subsystem{width:340px;grid-template-columns:90px 1fr;padding:6px 10px;gap:2px 10px}
 .dock-study .component-stage{min-height:52px}.dock-study .component-art{max-width:88px}
 .dock-study .subsystems:before{content:'';position:absolute;left:calc(50% - 2px);top:-21px;height:21px;width:4px;background:#b59e70}
 .dock-study .subsystems:has(.subsystem:nth-child(2)):after{content:'';position:absolute;left:24.4%;right:24.4%;top:-10px;height:3px;background:#b59e70}
 .dock-study .subsystem:before{left:calc(50% - 2px);top:-10px;width:4px;height:10px;background:#b59e70}
 .dock-study .subsystem:after{left:calc(50% - 4px);top:-5px}
 .dock-study .subsystem.offline:before{background:repeating-linear-gradient(#b59e70 0 3px,transparent 3px 6px)}
 .dock-study .enemy-heading{min-height:0}.dock-study .enemy-heading .round{padding:6px 9px}
}
@media(min-width:1100px){
 .dock-study .arena{height:144px}
 .dock-study .enemy{height:137px;width:194px}
 .dock-study .enemy-barrier{height:125px;width:170px}
 .dock-study .gameboard{padding-top:10px;padding-bottom:10px}
}

/* One utility bar; compact jacks flank the host above phone widths. */
.dock-study{margin-top:12px}
.dock-study .brandbar{display:flex;align-items:center;gap:16px;padding:7px 18px}
.dock-study .brand{white-space:nowrap}
.dock-study .study-links{display:flex;gap:12px;font:10px ui-monospace,monospace;white-space:nowrap}
.dock-study .study-links a{color:#c6d4ae;text-underline-offset:3px}
.dock-study .utility-controls{display:flex;align-items:center;gap:8px}
.dock-study .utility-controls button{color:#d9ed91;margin:0;min-width:30px;min-height:32px;padding:3px}
.dock-study .route-setup{margin-left:auto}
.dock-study .enemy-slots .slot{padding:6px 7px;gap:4px}
.dock-study .enemy-slots .slot-line{padding:3px 4px;gap:4px}
.dock-study .enemy-slots .slot header{font-size:10px;letter-spacing:1px}
@media(min-width:700px){
 .dock-study .arena{width:100%;max-width:840px;margin:0 auto;position:relative;height:154px;padding:0}
 .dock-study .enemy{width:210px;height:149px;top:-4px}
 .dock-study .enemy-barrier{width:180px;height:132px;top:0}
 .dock-study .intent-bubble{top:auto;bottom:-1px}
 .dock-study .enemy-slots{position:absolute;inset:0;display:flex;justify-content:space-between;align-items:center;margin:0;gap:0}
 .dock-study .enemy-slots .slot{width:174px;flex:none}
 .dock-study .enemy-slots .slot:after{display:none}
 .dock-study .arena:before{content:'';display:block;position:absolute;left:174px;right:174px;top:50%;height:3px;background:#b59e70;pointer-events:none;z-index:0;border:0;transform:none}
}
@media(min-width:700px) and (max-width:1099px){
 .dock-study .brandbar{flex-wrap:wrap;gap:5px 14px}
 .dock-study .study-links{margin-left:auto}
 .dock-study .subsystems{margin-top:18px}
}
@media(max-width:699px){
 .dock-study .brandbar{display:grid;grid-template-columns:1fr auto;gap:3px 10px;padding:7px 12px}
 .dock-study .route-setup{margin:0;grid-column:1;grid-row:2;justify-self:start}
 .dock-study .route-setup summary{padding:3px 0;max-width:none}
 .dock-study .route-setup .routebar{right:auto;left:0}
 .dock-study .study-links{grid-column:1/-1;grid-row:3;gap:14px;font-size:9px;padding:2px 0}
 .dock-study .utility-controls{grid-column:2;grid-row:1/3;gap:6px}
 .dock-study .enemy-slots{max-width:360px;margin-left:auto;margin-right:auto}
 .dock-study .enemy-slots .slot{padding:5px;min-width:0}
}
