/* The map is shared by the center stage and the translucent desktop side panels. */
#yk-command {
  --yk-bg: #090d14;
  --yk-panel: #161e2a;
  --yk-border: #35475c;
  --yk-text: #f1f6fe;
  --yk-muted: #c0cddd;
  --yk-mint: #84dfff;
  --yk-red: #ffa5a6;
  --yk-amber: #ffd39a;
  --yk-edge: clamp(12px, 2vw, 30px);
  --yk-scene: clamp(550px, calc(100svh - 260px), 850px);
  --yk-glass: linear-gradient(150deg, #252e3be8, #111923eb 78%);
  min-height: 100vh;
  min-height: 100svh;
  background: var(--yk-bg);
  border: 0;
  border-radius: 0;
  font: 14px/1.45 "Segoe UI", system-ui, sans-serif;
}

#yk-command::before {
  position: absolute;
  z-index: 3;
  inset: 16px 8px 8px;
  border: 1px solid #617a9880;
  clip-path: polygon(0 12px, 12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px));
  background: linear-gradient(135deg, #9ad9ff 1px, transparent 2px) top left / 22px 22px no-repeat;
  content: "";
  pointer-events: none;
}

#yk-command > header {
  z-index: 2;
  padding: 22px var(--yk-edge) 25px;
  background: linear-gradient(180deg, #0c1018 10%, #0c1018eb 68%, #111926b0);
}

#yk-command header::after {
  height: 14px;
  background: linear-gradient(90deg, #3c526b, #a9d9f8 48%, #3c526b);
  filter: drop-shadow(0 0 5px #81bcff78);
}

#yk-command h2 {
  font-size: clamp(22px, 2.8vw, 39px);
  font-weight: 680;
  letter-spacing: -.02em;
}

#yk-command h3 { font-size: 15px; }

#yk-command .yk-eyebrow {
  font-size: 11px;
  letter-spacing: .12em;
}

#yk-command .yk-clock {
  color: var(--yk-text);
  font-size: 13px;
  font-weight: 650;
}

#yk-command .yk-status {
  color: var(--yk-amber);
  border-color: #a16e43;
  border-radius: 2px;
  background: #362619;
  font-weight: 700;
  letter-spacing: .055em;
}

#yk-command .yk-grid {
  z-index: 1;
  grid-template-columns: minmax(180px, 23fr) minmax(0, 54fr) minmax(225px, 23fr);
  padding: 14px var(--yk-edge) 16px;
  gap: clamp(10px, 1.2vw, 18px);
}

#yk-command .yk-map {
  z-index: 0;
  inset: 0;
  height: auto;
  background: radial-gradient(ellipse at 52% 38%, #2b354a, #090d15 82%);
}

#yk-command .yk-map::after {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 38%, transparent 25%, #090d1470 85%);
  content: "";
  pointer-events: none;
}

#yk-command .yk-markers { z-index: 1; }

#yk-command :is(.yk-pane, .yk-stage-tools, .yk-stage-summary) {
  background: var(--yk-glass);
  border: 1px solid #7e92ad58;
  border-radius: 3px;
  box-shadow: 0 12px 28px #03060966;
}

#yk-command .yk-pane {
  max-height: var(--yk-scene);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #47617a transparent;
  padding: 12px;
}

#yk-command .yk-panel-heading {
  padding: 4px 0 8px;
  border-bottom-color: #8297b366;
  color: var(--yk-text);
  letter-spacing: .02em;
}

#yk-command .yk-panel-heading::before {
  content: "▸";
  color: var(--yk-mint);
  text-shadow: 0 0 10px #52beff;
}

#yk-command .yk-stage { min-height: var(--yk-scene); }
#yk-command .yk-map-space { min-height: 290px; }

#yk-command .yk-stage-tools { padding: 9px 11px; }

#yk-command .yk-stage-summary {
  padding: 9px 11px;
  text-align: center;
}

#yk-command .yk-stage-summary p { overflow-wrap: anywhere; }

#yk-command .yk-metrics {
  padding: 1px 0 9px;
  column-gap: 7px;
  row-gap: 10px;
}

#yk-command .yk-metrics span {
  gap: 3px;
  overflow-wrap: anywhere;
}

#yk-command .yk-metrics strong {
  font-size: clamp(18px, 2.2vw, 29px);
  font-weight: 680;
  letter-spacing: -.025em;
}

#yk-command .yk-metrics span::after {
  width: clamp(20px, 4.2vw, 62px);
  height: 10px;
  border-color: #599fcb;
  background: radial-gradient(ellipse, #44c7f55c, #142945 65%);
  box-shadow: 0 3px 0 #1e435e, 0 5px 10px #44c7f529;
}

#yk-command :is(button, select, input) {
  border-color: #52677f;
  border-radius: 4px;
  background: #1b2837;
}

#yk-command button:not(:disabled) { cursor: pointer; }
#yk-command button:hover { background: #293e53; }

#yk-command :is(button[aria-pressed="true"], .yk-primary) {
  background: #20405d;
  border-color: #84c9ef;
}

#yk-command :is([data-queue], .yk-alarm-bars, [data-panel]) > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

#yk-command .yk-pin {
  border-radius: 7px;
  box-shadow: 0 0 0 2px #0b121c, 0 0 12px currentColor;
}

#yk-command footer {
  z-index: 2;
  padding: 13px var(--yk-edge) 18px;
  border-color: #526e88;
  background: linear-gradient(145deg, #182332fa, #0b1019fc 70%);
  box-shadow: 0 -12px 36px #080c1566;
}

#yk-command .yk-drill-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

#yk-command .yk-drill-controls button {
  flex: 0 1 auto;
  text-align: center;
}

#yk-command .yk-drill-mode,
#yk-command .yk-drill-kpi {
  color: var(--yk-mint);
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

#yk-command .yk-drill-events {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 1fr);
  gap: 8px;
  margin-block: 8px;
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #526e88 transparent;
}

#yk-command .yk-drill-event {
  min-width: 0;
  padding: 8px 10px;
  border-top: 2px solid #6a89a2;
  overflow-wrap: anywhere;
}

#yk-command .yk-drill-event[data-state="complete"] { border-top-color: #6bd3b7; }

#yk-command .yk-drill-event[aria-current="step"] {
  background: #20405d;
  border-color: #84c9ef;
  box-shadow: inset 0 2px 0 #84c9ef;
}

#yk-command .yk-drill-detail {
  min-width: 0;
  padding: 8px 10px;
  border-left: 2px solid #76b1d9;
  background: #1b2837;
  overflow-wrap: anywhere;
}

@media (max-width: 1000px) {
  #yk-command { --yk-scene: 570px; }

  #yk-command .yk-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #yk-command .yk-stage {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  #yk-command .yk-queue {
    grid-column: auto;
    order: 0;
  }

  #yk-command .yk-pane { max-height: none; }

  #yk-command .yk-map {
    bottom: auto;
    height: 760px;
  }
}

@media (max-width: 540px) {
  #yk-command { --yk-scene: 580px; }

  #yk-command::before { inset-inline: 5px; }
  #yk-command > header { padding-block: 16px 24px; }
  #yk-command .yk-grid { grid-template-columns: minmax(0, 1fr); }
  #yk-command .yk-map { height: 780px; }
  #yk-command .yk-map-space { min-height: 260px; }
  #yk-command .yk-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #yk-command .yk-drill-events { grid-auto-columns: minmax(135px, 65%); }
}

@media (pointer: coarse) {
  #yk-command button:not(.yk-pin) { min-height: 44px; }
}
