.topnav button { white-space: nowrap; }
.bp-toggle button { font-size: .875rem; }
.bp-toolgroup { gap: 11px; }
.bp-overlay-header strong { font-size: 1rem; }
.bp3-tick { font-size: .875rem; }
.planning-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.planning-grid > label { min-width: 0; }
.planning-grid > label:first-child:last-child { grid-column: 1/-1; }
.planning-grid input, .planning-grid select { min-width: 0; }
.planning-stack, .planning-box { display: grid; gap: 10px; }
.planning-box, .planning-details {
  padding: 10px 12px;
  border: 1px solid #345678;
  border-radius: 9px;
  background: #102238;
}
.planning-stack h3, .planning-box h4, .planning-details h4 { margin: 0; font-size: .875rem; }
.planning-details h4 { margin-top: 10px; }
.planning-details summary {
  font-weight: 700;
  font-size: .875rem;
  cursor: pointer;
  color: #d6f1ff;
}
.planning-details[open] summary { margin-bottom: 10px; }
.planning-details p { margin: 8px 0 0; }
.planning-diagram { margin: 14px 0; }
.planning-diagram h3 { margin: 0; }
.planning-status { color: #b7d5ee; font-size: .875rem; margin: 5px 0 15px; }
.planning-status strong { color: #7fe7f1; }
.planning-routes { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.planning-route {
  --route-color: #66dcef;
  padding: 12px;
  border: 1px solid #2a5978;
  border-left: 3px solid var(--route-color);
  border-radius: 9px;
  background: #0c1d31;
}
.planning-route.reserve { --route-color: #eabce1; }
.route-index { color: var(--route-color); font-weight: 700; font-size: .875rem; }
.route-nodes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(98px, .72fr) minmax(0,1fr);
  align-items: center;
  text-align: left;
  gap: 6px;
  margin: 8px 0;
  overflow-wrap: anywhere;
}
.route-nodes > div:not(.route-medium) { padding: 8px; background: #1a3550; border-radius: 7px; }
.route-nodes b, .route-nodes small { display: block; }
.route-nodes small, .planning-route p { color: #a8c6df; }
.route-nodes b, .route-medium { font-size: .875rem; }
.route-medium { text-align: center; color: var(--route-color); }
.route-medium::before, .route-medium::after {
  content: "";
  display: block;
  margin: 4px 0;
  border-top: 1px dashed var(--route-color);
}
.planning-route p { margin: 6px 0 0; font-size: .8125rem; }
.pane.right .route-nodes { grid-template-columns: minmax(0,1fr); }
.pane.right .planning-grid { grid-template-columns: minmax(0,1fr); }
@media (max-width: 670px) { .route-nodes { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 520px) { .planning-grid { grid-template-columns: minmax(0,1fr); } }

.source-path {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin: .75rem 0;
  color: #d4ebff;
}
.source-path span { padding: .15rem .45rem; border-radius: .3rem; background: #173b58; }

.equipment-dialog {
  width: min(1120px,calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid #365677;
  border-radius: 16px;
  overflow: hidden;
  background: #0b1728;
  color: #edf7ff;
  box-shadow: 0 24px 85px #000b;
}
.equipment-dialog::backdrop { background: #050b14c9; }
.equipment-dialog[open] { display: flex; flex-direction: column; }
.eq-header, .eq-tabs { padding: 15px 22px; }
.eq-header, .eq-heading, .eq-tabs, .eq-filters, .eq-alternatives {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.eq-header, .eq-heading { justify-content: space-between; }
.eq-header { background: #12243a; border-bottom: 1px solid #2d4d69; }
.eq-header h2 { margin: 0; font-size: 1.45rem; }
.eq-header p { margin: 3px 0 0; color: #a8c5de; }
.eq-tabs { padding-block: 10px; border-bottom: 1px solid #253f5a; }
.eq-body { padding: 20px 22px; overflow: auto; overscroll-behavior: contain; }
.eq-split { display: grid; grid-template-columns: minmax(0, .83fr) minmax(0, 1.17fr); align-items: start; gap: 16px; }
.eq-controls, .eq-result, .eq-catalog { display: grid; gap: 12px; min-width: 0; }
.eq-controls, .eq-result { padding: 14px; background: #0f2035; border: 1px solid #284966; border-radius: 10px; }
.eq-heading h3, .eq-result h4, .eq-catalog h3, .eq-rack h4 { margin: 0; font-size: 1rem; }
.eq-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.eq-wide { grid-column: 1/-1; }
.eq-fields label, .eq-filters label { min-width: 0; font-size: .875rem; }
.eq-controls .bp3-tick { margin: 0; align-self: end; }
.eq-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.eq-metrics > div { padding: 8px; border: 1px solid #2b506c; border-radius: 8px; color: #bbd2e5; font-size: .8125rem; overflow-wrap: anywhere; }
.eq-metrics b { display: block; font-size: 1.1rem; color: #c7f4ff; }
.eq-badge { border-radius: 999px; padding: 2px 9px; border: 1px solid #497495; color: #d4eeff; font-size: .8125rem; }
.eq-badge.ok { background: #153a33; color: #98f3cc; border-color: #388463; }
.eq-badge.pending { background: #44351a; color: #ffdc92; border-color: #896839; }
.eq-badge.error { background: #421d2c; color: #ffb9c2; border-color: #9b4f62; }
.eq-issues, .eq-paths { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.eq-issues li { padding: 7px 9px; border-left: 3px solid #69aed5; background: #162d45; font-size: .875rem; }
.eq-issues li.error { border-color: #ff8c99; }
.eq-issues li.pending { border-color: #efc16b; }
.eq-paths li { display: grid; grid-template-columns: 1fr .85fr 1fr; gap: 8px; align-items: center; padding: 8px; border: 1px solid #315775; border-radius: 7px; overflow-wrap: anywhere; }
.eq-paths span { color: #85e3ef; padding: 0 6px; border-inline: 1px dashed #498696; font-size: .8125rem; }
.eq-paths b { font-size: .875rem; }
.eq-table { overflow: auto; max-width: 100%; }
.eq-table table { border-collapse: collapse; width: 100%; background: #0c1b2d; }
.eq-table th, .eq-table td { padding: 8px; border-bottom: 1px solid #27425b; text-align: left; font-size: .875rem; }
.eq-table thead { background: #203b56; }
.eq-table small { display: block; font-weight: 400; color: #adc6de; }
.eq-table input[type=checkbox] { width: 17px; min-height: auto; accent-color: #369afb; }
.eq-list { max-height: 48dvh; }
.eq-list thead { position: sticky; top: 0; }
.eq-filters > label:first-child { flex: 1; }
.eq-rack { display: grid; gap: 7px; padding: 10px; background: #091626; border: 1px solid #304e68; border-radius: 8px; }
.eq-slots { display: flex; flex-wrap: wrap; gap: 5px; }
.eq-slots span { padding: 5px 8px; border-radius: 4px; background: #244f75; border: 1px solid #4279a3; font-size: .8125rem; }
.eq-slots.input span { background: #195659; border-color: #448683; }
.eq-rack p { margin: 2px 0; }
.equipment-dialog :focus-visible { outline: 2px solid #7ae2ff; outline-offset: 2px; }
@media (max-width: 820px) { .eq-split { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 540px) {
  .eq-body, .eq-header, .eq-tabs { padding-inline: 10px; }
  .eq-fields, .eq-paths li { grid-template-columns: 1fr; }
  .eq-paths span { border-inline: 0; border-block: 1px dashed #498696; padding-block: 3px; }
  .eq-metrics b { font-size: .95rem; }
}

.scene-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 16px;
  pointer-events: none;
}
.scene-empty[hidden] { display: none; }
.scene-empty p { margin: 0; color: #c7daed; font-size: 1rem; }
.scene-empty button { pointer-events: auto; }

.panel-size-dialog {
  width: min(470px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 20px;
  background: #12243a;
  color: #edf7ff;
  border: 1px solid #456889;
  border-radius: 14px;
  box-shadow: 0 24px 85px #000b;
}
.panel-size-dialog::backdrop { background: #050b14c9; }
.panel-size-dialog form { display: grid; gap: 14px; }
.panel-size-title h2 { margin: 0; font-size: 1.25rem; }
.panel-size-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.panel-size-fields[hidden], .scene-tools button[hidden], .area-status[hidden] { display: none; }
.panel-size-dialog label { min-width: 0; font-size: .875rem; }
.panel-size-pair .tick { margin: 0; gap: 10px; }
.panel-size-pair .tick input { width: 18px; height: 18px; }
.panel-size-pair p { margin: 4px 0 0 28px; color: #abc1d8; font-size: .8125rem; }
.panel-size-feedback { margin: 0; color: #a7def4; font-size: .875rem; }
.panel-size-feedback.error { color: #ffacb5; }
.panel-size-actions { justify-content: flex-end; }
.area-status { color: #ffda98; background: #243125; }
#panelSelectionStatus { margin-inline-start: .45em; color: #a9e5e0; }
#panelSelectionStatus.has-group { color: #8bffeb; font-weight: 700; }
.segment.group-selected { border-color: #63d9c9; box-shadow: inset 3px 0 #63d9c9; }
.btn.arena-preset { border-color: #4b9fea; background: #153957; color: #d9f2ff; }
.btn.arena-preset:hover { background: #20517b; }
.structure-library .btn.primary { width: 100%; margin-bottom: 8px; }
.structure-picker { margin-bottom: 8px; }
.structure-library .fieldgrid { margin-top: 8px; }
.structure-dialog form h2 { margin: 0; font-size: 1.25rem; }
.structure-dialog .fieldgrid { margin: 0; }
#structureUnits[hidden] { display: none; }

.panel-context-menu {
  position: fixed;
  z-index: 10000;
  width: min(205px, calc(100vw - 8px));
  max-height: calc(100vh - 8px);
  overflow: auto;
  box-sizing: border-box;
  padding: 6px;
  border: 1px solid #426582;
  border-radius: 8px;
  background: #101f30;
  color: #e4f3ff;
  box-shadow: 0 6px 22px #0007;
}
.panel-context-menu strong { display: block; padding: 5px 8px; overflow-wrap: anywhere; color: #8bdfff; }
.panel-context-menu button { display: block; width: 100%; text-align: left; padding: 7px 8px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.panel-context-menu button:hover, .panel-context-menu button:focus-visible { background: #24415d; }
.panel-context-menu button[data-command="delete"] { color: #ffb5b5; }
