.scene.ix-scene {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  background: #122f2a;
  color: #e6f4ec;
}
.ix-map { min-width: 0; min-height: 0; overflow: hidden; }
.ix-map svg { display: block; width: 100%; height: auto; max-width: 100%; margin: 0; overflow: hidden; }
.ix-label rect { fill: #1e3e32; stroke: #97b7a2; stroke-width: .55; }
.ix-label text { fill: #f3f8ef; font: 600 7.8px system-ui, sans-serif; pointer-events: none; }
.ix-label.ix-current rect { fill: #245441; stroke: #abf3cd; stroke-width: 1.5; }
.ix-console { min-width: 0; padding: 8px 10px; background: #122f2a; border-top: 1px solid #466c5a; }
.ix-tools { display: grid; gap: 5px; }
.ix-lane-row, .ix-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 9px; }
.ix-choice { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: #d0e5d8; font-size: 14px; }
#ix-waiting { color: #bbd2c4; font-size: 13px; white-space: nowrap; }
.ix-console button, .ix-lane-picker {
  min-height: 40px; margin: 0; padding: 5px 11px; font: 650 14px/1.2 var(--font-ui), system-ui, sans-serif;
  border: 1px solid #658978; border-radius: 8px; background: #275044; color: #edf8f0;
}
.ix-console .ix-quiet { background: #163a30; box-shadow: none; }
.ix-console :is(button,input):focus-visible, .ix-lane-menu button:focus-visible {
  outline: 2px solid #ffdc91; outline-offset: 2px;
}
.ix-auto {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px;
  margin: 0; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.ix-auto input[type=checkbox] {
  appearance: none; -webkit-appearance: none; display: grid; place-content: center; flex: none;
  margin: 0; padding: 0; width: 19px; height: 19px; min-width: 0; min-height: 0;
  border: 1.5px solid #94b7a4; border-radius: 4px; background: #0d2822; cursor: pointer;
}
.ix-auto input:checked { background: #89e4ba; border-color: #a2f0cb; }
.ix-auto input:checked::after {
  content: ''; width: 9px; height: 5px; margin-top: -2px; transform: rotate(-45deg);
  border-left: 2px solid #0c3023; border-bottom: 2px solid #0c3023;
}
.ix-console .ix-lane-picker {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 9px; min-width: 112px;
  background: #173c31; color: #edf8ef;
}
.ix-lane-picker::after {
  content: ''; width: 6px; height: 6px; transform: translateY(-2px) rotate(45deg);
  border-right: 1.6px solid #a6cdb7; border-bottom: 1.6px solid #a6cdb7;
}
.ix-lane-menu:not([hidden]) {
  position: fixed; inset: auto; z-index: 10100; box-sizing: border-box;
  display: grid; gap: 2px; width: max-content; overflow: auto; margin: 0; padding: 5px; border-radius: 10px;
  border: 1px solid #6b9983; background: #12362b; color: #ecf8ef; box-shadow: 0 6px 22px #00140fb3;
}
.ix-lane-menu[hidden] { display: none; }
.ix-lane-menu button {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 7px 10px; text-align: left;
  font: 600 14px/1.2 system-ui, sans-serif; border: 0; border-radius: 5px; background: transparent; color: #e3f0e8;
}
.ix-lane-menu button[aria-selected="true"] { background: #295642; color: #a8f0c9; }
.ix-lane-menu button[aria-selected="true"]::after { content: '✓'; margin-left: auto; }
.ix-lane-menu button:hover { background: #234d3e; }
#ix-inspect:not(:empty) {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 8px;
  margin-top: 6px; padding: 6px 0 0; border-top: 1px solid #3c6251;
}
#ix-inspect span { min-width: 0; }
#ix-inspect strong, #ix-inspect small { display: block; font-size: 12px; line-height: 1.3; overflow-wrap: anywhere; }
#ix-inspect strong { color: #d0ebda; }
#ix-inspect small { color: #b5d0c1; }
#ix-recover:empty { display: none; }
#ix-recover:not(:empty) { margin-bottom: 7px; font-size: 14px; }
#ix-recover[data-phase="collision"] {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 10px;
  padding: 6px 8px; border-left: 3px solid #f6cd78; background: #2d3b2e; color: #ffe4ab;
}
#ix-recover strong, #ix-recover small { display: block; line-height: 1.3; }
#ix-recover small { font-size: 12px; color: #ebdfc4; }
#ix-recover [data-act="clear-intersection"] {
  border: 2px solid #ffe2a0; background: #ffda8a; color: #25291e; box-shadow: 0 0 0 2px #876f41;
}
#ix-recover[data-phase="awaiting-run"] { color: #c4e8d5; }
.ix-expanded .graphic-stage { grid-template: minmax(0, 1fr) / minmax(0, 1fr); padding: 0; }
.ix-expanded .ix-scene {
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0; border-radius: 0;
  grid-template-rows: minmax(0, 1fr) auto; background: transparent;
}
.ix-expanded .ix-map svg { width: 100%; height: 100%; min-height: 0; max-height: 100%; }
.ix-expanded .ix-console { justify-self: center; width: min(100%, 640px); background: transparent; }
.ix-expanded .ix-lane-row, .ix-expanded .ix-actions { justify-content: center; }
.ix-expanded #ix-inspect { text-align: center; }
@media (max-width: 699px) and (orientation: portrait) {
  .live-graphic.ix-expanded.has-live-controls { grid-template-rows: 44px minmax(0, 1fr) var(--ix-dock-height, 210px); }
}
@media (orientation: landscape) and (max-height: 520px) {
  .live-graphic.ix-expanded.has-live-controls { grid-template: 40px minmax(0, 1fr) / minmax(0, 1fr) clamp(180px, 27vw, 260px); gap: 4px 8px; }
  .ix-expanded.live-graphic .graphic-control-dock { top: 52px; bottom: auto; right: 8px; width: clamp(180px, 27vw, 260px); max-height: calc(100% - 56px); }
  .ix-expanded .ix-console { padding: 3px; }
  .ix-expanded #ix-inspect:not(:empty) { padding-top: 3px; margin-top: 3px; }
}
@media (orientation: landscape) and (max-height: 520px) and (min-width: 550px) {
  .ix-expanded .ix-scene {
    grid-template: minmax(0, 1fr) / minmax(0, 1fr) minmax(235px, 45%); gap: 8px;
  }
  .ix-expanded .ix-console { align-self: center; border-top: 0; border-left: 1px solid #466c5a; }
  .ix-expanded .ix-lane-row, .ix-expanded .ix-actions { display: grid; gap: 3px 5px; }
  .ix-expanded .ix-lane-row { grid-template-columns: 1fr 1.05fr; }
  .ix-expanded .ix-actions { grid-template-columns: minmax(62px, .6fr) minmax(0, 1.4fr); }
  .ix-expanded .ix-choice { display: grid; align-content: center; justify-items: start; gap: 0; }
  .ix-expanded .ix-auto { min-width: 0; white-space: normal; line-height: 1.15; }
  .ix-expanded .ix-tools button { width: 100%; min-width: 0; white-space: normal; padding-inline: 4px; }
  .ix-expanded #ix-waiting { grid-column: 1 / -1; }
  .ix-expanded #ix-recover[data-phase="collision"] { display: grid; grid-template-columns: minmax(0, 1fr) 102px; gap: 5px; }
  .ix-expanded #ix-recover button { white-space: normal; padding-inline: 5px; }
}
@media (max-width: 440px) {
  .ix-console { padding: 5px 7px; }
  .ix-tools { gap: 4px; }
  .ix-tools button { min-height: 44px; padding-inline: 8px; }
  .ix-lane-row, .ix-actions { gap: 3px 6px; }
  .ix-auto, .ix-choice { font-size: 13px; }
  .ix-label text { font-size: 8.5px; }
}
@media (forced-colors: active) {
  .ix-auto input[type=checkbox] { appearance: auto; }
  .ix-auto input:checked::after { content: none; }
}
.ix-expanded .ix-dock-toggle { margin-left: auto; }
.ix-expanded [hidden].ix-dock-toggle, .ix-expanded .graphic-control-dock[hidden] { display: none; }
.ix-expanded.live-graphic.ix-dock-folded { grid-template-rows: 44px minmax(0, 1fr); }
@media (max-width: 699px) and (max-height: 700px) and (orientation: portrait) {
  .ix-expanded.live-graphic > header { flex-wrap: nowrap; gap: 4px; font-size: 14px; white-space: nowrap; }
  .ix-expanded.live-graphic > header .btn { flex: none; padding: 4px 7px; font-size: 12px; white-space: nowrap; }
}
@media (max-width: 699px) and (max-height: 700px) and (orientation: portrait),
       (max-width: 800px) and (max-height: 520px) and (orientation: landscape) {
  .ix-expanded:not(.ix-dock-folded) .ix-tools, .ix-expanded:not(.ix-dock-folded) #ix-inspect { display: none; }
  .ix-expanded:not(.ix-dock-folded) .ix-console:has(#ix-recover:empty) { padding: 0; border: 0; }
}
@media (max-width: 800px) and (max-height: 520px) and (orientation: landscape) {
  .live-graphic.ix-expanded.has-live-controls.ix-dock-folded { grid-template: 40px minmax(0, 1fr) / minmax(0, 1fr); }
  .ix-expanded:not(.ix-dock-folded) .ix-scene { grid-template: minmax(0, 1fr) auto / minmax(0, 1fr); gap: 3px; }
  .ix-expanded:not(.ix-dock-folded) #ix-recover[data-phase="collision"] { display: flex; justify-content: space-between; }
}
@media (max-width: 365px) {
  .ix-choice { display: grid; justify-items: start; gap: 1px; }
  #ix-recover[data-phase="collision"] { display: grid; grid-template-columns: minmax(0, 1fr) 110px; }
  #ix-recover button { white-space: normal; padding-inline: 5px; }
}

#controls-panel .control-choice-button {
  display:flex; align-items:center; justify-content:space-between; gap:7px;
  width:100%; min-width:0; min-height:40px; margin:0; padding:6px 9px;
  border:1px solid #658978; border-radius:8px; background:#173c31; color:#edf8ef;
  font:600 13px/1.25 system-ui,sans-serif; text-align:left; white-space:normal;
}
.control-choice-button::after { flex:none; }
#controls-panel .compact-equipment:not([hidden]) {
  display:grid; grid-template-columns:minmax(0,1fr); align-content:start; gap:4px;
}
#controls-panel .compact-equipment>span { color:#bad1c5; }
#controls-panel .control-choice-menu button { width:100%; white-space:normal; min-width:0; }
#controls-panel .control-choice-button:focus-visible { outline:2px solid #ffdc91; outline-offset:1px; }
#controls-panel .heading-actions .tool-choice { min-width:min(108px,100%); }
