/* The operations map and its workspace detail views share the same controls. */
.operations-map { --map-dark: #101c2c; --map-text: #e8f1ff; --map-subtle: #a8bdd7; }
.operations-header { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.operations-header h1 { letter-spacing: -.045em; font-size: clamp(34px, 5.2vw, 65px); }
.operations-header .lead { margin-top: 9px; }
.operations-map-grid, .spatial-workspace-grid {
  display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(248px, 1fr); gap: 15px; align-items: stretch;
}
.operations-stage {
  display: grid; gap: 0; align-content: start; min-width: 0; padding: 1px;
  background: #121d2c; border: 1px solid #2d405b; color: #e9f1ff; border-radius: 19px; overflow: clip;
  box-shadow: 0 12px 36px #0e20402b;
}
.operations-canvas.spatial-canvas {
  display: block; height: clamp(340px, 58vh, 590px); border: 0; border-radius: 18px 18px 0 0;
  background: radial-gradient(ellipse at 48% 43%, #182c45 0%, #101b2c 63%, #101827 100%);
}
.operations-toolbar, .operations-legend { padding: 9px 12px; }
.operations-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border-top: 1px solid #293d56; }
.operations-toolbar button, .operations-toolbar select {
  --card: #16263a; --ink: #e8f1ff; --fill: #263c57; --line: #344b65; min-height: 36px;
  border-radius: 9px; color-scheme: dark;
}
.operations-toolbar select { width: auto; min-width: 110px; padding: 3px 9px; font-size: 13px; }
.operations-toolbar button { min-width: 36px; padding: 0 9px; font-size: 13px; }
.operations-toolbar .operations-mode[aria-pressed=true] { background: #28496f; color: #f3f8ff; border-color: #5584be; }
.operations-legend { color: #b0c4db; font-size: 12px; line-height: 1.45; }
.operations-inspector, .spatial-inspector {
  border: 1px solid var(--line); border-radius: 18px; background: var(--card);
  padding: 15px; min-width: 0; align-content: start; gap: 13px;
}
.operations-inspector h2 { font-size: clamp(20px, 2.5vw, 26px); }
.operations-inspector h3, .spatial-inspector h3 { font-size: 19px; }
.operations-inspector button, .spatial-inspector button { justify-self: start; white-space: normal; text-align: start; }
.operations-flows, .operations-flows ul {
  padding: 0; margin: 0; list-style: none; display: grid; gap: 7px;
}
.operations-flows li { border-top: 1px solid var(--line); padding: 8px 0 0; overflow-wrap: anywhere; }
.operations-directory {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 215px), 1fr)); gap: 8px;
}
.operations-area {
  display: flex; align-items: center; justify-content: start; gap: 10px;
  height: auto; min-height: 46px; border-radius: 10px; text-align: start; white-space: normal;
}
.operations-area[aria-pressed=true] { background: var(--accent-bg); border-color: var(--accent); }
.operations-accent {
  display: inline-block; flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--area-color, #4a83c3);
  outline: 1px solid color-mix(in srgb, var(--area-color, #4a83c3), #142032 32%);
}
.operations-map input[type=search] { max-width: 400px; }
.operations-inspector a, .spatial-inspector a { overflow-wrap: anywhere; }

main:has(> .operations-campus) { max-width:1440px; }
.operations-campus .operations-header { display:grid; justify-content:stretch; gap:5px; margin-block:0 6px; }
.operations-campus .operations-header h1 { font-size:clamp(34px, 4.8vw, 58px); }
.operations-campus .operations-header .lead { margin:0; font-size:16px; }
.operations-campus .operations-map-grid { grid-template-columns:minmax(0, 3.1fr) minmax(232px, 1fr); }
.operations-campus .operations-stage { border-color:#263b54; border-radius:18px; background:#111e2c; padding:0; }
.operations-viewport { position:relative; min-width:0; isolation:isolate; }
.operations-campus .operations-canvas.spatial-canvas { height:clamp(410px, 59vh, 675px); touch-action:none; outline-offset:-4px; }
.operations-viewport:fullscreen .operations-canvas.spatial-canvas { height:100%; }
.operations-markers { position:absolute; inset:0; pointer-events:none; overflow:hidden; }
.operations-marker {
  position:absolute; pointer-events:auto; top:0; left:0; white-space:nowrap; display:flex; gap:6px; align-items:center;
  padding:3px 8px; min-height:23px; border:1px solid #86a8d972; border-radius:6px; background:#101d2fea;
  color:#f3f7ff; font-size:clamp(10px, 1vw, 13px); line-height:1.25; font-weight:600;
  box-shadow:0 4px 12px #090d1780; will-change:transform;
}
.operations-marker[hidden], .operations-toolbar [hidden] { display:none; }
.operations-marker:hover, .operations-marker[data-selected=true] { border-color:var(--area-color); background:#223951; }
.operations-marker:focus-visible { outline:2px solid #edf6ff; outline-offset:2px; }
.operations-marker .operations-accent { width:6px; height:6px; flex-basis:6px; outline:0; }
.operations-renderer-badge {
  position:absolute; inset-inline-start:12px; inset-block-start:12px; pointer-events:none; color:#d4e4fb;
  padding:4px 8px; background:#13253cdd; border:1px solid #6686af66; border-radius:6px; font-size:11px;
}
.operations-campus .operations-inspector { padding:20px; gap:15px; }
.operations-campus .operations-primary { background:var(--primary-bg); border-color:var(--primary-bg); color:#fff; }
.operations-mobile-views, .operations-detail-toggle { display:none; }
.operations-campus .operations-toolbar { padding-block:8px; }
.operations-campus .operations-legend { gap:6px; border-top:1px solid #293d56; }
.operations-campus .operations-legend button { --card:#192b41; --ink:#e7f0ff; --fill:#2a405e; --line:#405e7c; display:inline-flex; align-items:center; gap:7px; }
.operations-campus .operations-legend button[aria-pressed=true] { background:#304a6a; border-color:#7794b8; }
.operations-campus .operations-hint { padding-inline:12px; }
@media(max-width:980px){ .operations-campus .operations-map-grid { grid-template-columns:minmax(0,1fr); } }
@media(max-width:530px){
  .operations-campus .operations-canvas.spatial-canvas { height:clamp(335px, 63svh, 490px); }
  .operations-marker { font-size:11px; min-height:26px; }
  .operations-campus .operations-legend button { font-size:11px; min-height:32px; padding-inline:7px; }
  .operations-campus .operations-inspector { padding:15px; }
}
@media(max-width:760px){
  .operations-campus { padding-block-end:64px; }
  .operations-campus .operations-header h1 { font-size:clamp(30px,8vw,40px); }
  .operations-campus .operations-header .lead { font-size:14px; }
  .operations-mobile-views { display:flex; gap:5px; width:max-content; padding:3px; border-radius:12px; background:var(--fill); }
  .operations-mobile-views button { border:0; border-radius:9px; min-width:72px; }
  .operations-mobile-views button[aria-pressed=true] { background:var(--primary-bg); color:white; }
  .operations-campus[data-mobile-view=map] .operations-directory-panel,
  .operations-campus[data-mobile-view=list] .operations-stage { display:none; }
  .operations-campus[data-mobile-view=list] .operations-map-grid { display:contents; }
  .operations-campus .operations-inspector {
    position:fixed; inset-inline:0; inset-block-end:0; z-index:18; gap:0; max-height:56svh;
    padding:6px 12px max(8px, env(safe-area-inset-bottom)); border-radius:16px 16px 0 0;
    box-shadow:0 -6px 22px #16233d29;
  }
  .operations-campus:not(:has(.operations-viewport:fullscreen)) .operations-detail-toggle {
    display:flex; justify-self:stretch; min-height:42px; justify-content:space-between;
    border:0; border-radius:8px; padding-inline:8px; text-align:start;
  }
  .operations-detail-toggle::after { content:'+'; font-size:18px; }
  .operations-detail-toggle[aria-expanded=true]::after { content:'−'; }
  .operations-inspector-body { max-height:46svh; overflow:auto; padding:6px 8px; }
  .operations-inspector:not([data-mobile-expanded=true]) .operations-inspector-body { display:none; }
}

.spatial-workspace { gap: 10px; }
.spatial-workspace-grid { align-items: start; margin-top: 3px; }
.spatial-map-column { gap: 9px; align-content: start; }
.spatial-workspace-canvas.spatial-canvas {
  height: clamp(295px, 48vh, 520px); background: radial-gradient(ellipse at 48% 50%, #192f48, #101b2b 74%);
  display: block; border: 1px solid #2e4663; box-shadow: 0 8px 23px #10203e1a;
}
.spatial-canvas:fullscreen { height: 100%; width: 100%; border: 0; border-radius: 0; outline: 0; }
.spatial-workspace-controls { gap: 6px; }
.spatial-workspace-controls .sm { border-radius: 9px; min-height: 34px; padding-inline: 9px; }
.spatial-activity { color: var(--ink2); }
.spatial-timeline {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end;
  gap: 10px; padding: 10px; background: var(--fill); border-radius: 12px;
}
.spatial-timeline .row { column-gap: 5px; align-items: stretch; }
.spatial-timeline .row button { min-height: 44px; min-width: 36px; border-radius: 9px; }
.simulation-replay {
  gap: 8px; padding: 10px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--fill);
}
.simulation-replay input[type=range] { width: 100%; margin: 0; accent-color: var(--accent); }
.simulation-replay p { margin: 0; }
.spatial-state, .spatial-state-alert { display: inline-flex; gap: 4px; width: fit-content; margin-bottom: 7px; padding: 2px 7px; border-radius: 6px; font-size: 12px; font-weight: 600; text-transform: capitalize; }
.spatial-state { color: var(--accent); background: var(--accent-bg); }
.spatial-state-alert { color: var(--alert); background: var(--alert-bg); }
.spatial-readouts { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.spatial-readouts > div { flex: 1 1 78px; border-radius: 7px; background: var(--fill); padding: 6px 8px; }
.spatial-readouts dt { color: var(--ink2); font-size: 11px; }
.spatial-readouts dd { font-weight: 650; margin: 0; font-variant-numeric: tabular-nums; }
.spatial-details h4 { font-size: 13px; margin: 0 0 3px; }
.spatial-details ul { list-style: none; padding: 0; margin: 0; }
.spatial-details li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.spatial-details li strong, .spatial-details li small { display: block; font-size: 12px; overflow-wrap: anywhere; }
.spatial-details li small { color: var(--ink2); }
@media (max-width: 815px) {
  .operations-map-grid, .spatial-workspace-grid { grid-template-columns: minmax(0, 1fr); }
  .operations-canvas.spatial-canvas { height: clamp(350px, 57vh, 490px); }
}
@media (max-width: 515px) {
  .spatial-timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spatial-timeline .row { grid-column: 1 / -1; }
  .operations-toolbar { padding-inline: 7px; }
  .operations-canvas.spatial-canvas { height: clamp(300px, 52vh, 400px); }
}
.operations-stage .operations-legend { display: flex; border-top: 1px solid #293d56; }
.operations-stage .operations-legend button { color-scheme: dark; color: #c0d2e8; background: #16263a; border-color: #344b65; border-radius: 9px; }
.operations-stage .operations-legend button[aria-pressed=true] { color: #f3f8ff; background: #28496f; border-color: #5584be; }
.operations-stage .operations-hint { color: #afc3da; padding: 8px 12px; }
.operations-directory-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px; align-items: stretch; }
.operations-open { display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; padding: 0 9px; font-size: 13px; }
.operations-primary { background: var(--accent); border-color: var(--accent); color: white; }
.operations-flows li span { display: block; }

/* Plan status on the campus: one colour per state, shared by the building ring, the label dot and the directory. */
.operations-status { flex:none; width:9px; height:9px; border-radius:50%; background:var(--health,#6f8098); box-shadow:0 0 0 3px color-mix(in srgb,var(--health,#6f8098) 26%,transparent); }
[data-health=ok] { --health:#4f8ff7; } [data-health=running] { --health:#5fb7f2; } [data-health=stale] { --health:#9aa6bd; }
[data-health=attention] { --health:#f5b544; } [data-health=problem] { --health:#ff5a5f; } [data-health=none] { --health:#6f8098; }
.operations-status[data-health=none] { background:transparent; box-shadow:inset 0 0 0 1.5px var(--health); }
.operations-marker .operations-status { width:8px; height:8px; margin-inline-start:2px; }
.operations-marker[data-health=attention], .operations-marker[data-health=problem] { border-color:color-mix(in srgb,var(--health) 70%,transparent); }
.operations-health-legend { gap:6px 14px; padding:9px 12px; border-top:1px solid #293d56; color:#b0c4db; font-size:12px; line-height:1.45; flex-wrap:wrap; }
.operations-health-legend b { color:#e7f0ff; font-weight:600; }
.operations-health-chip { display:inline-flex; align-items:center; gap:7px; white-space:nowrap; }
.operations-area .operations-health-chip { color:var(--ink2); }
/* 3.4.6: name and count on the first line, the plan status on its own line below. */
.operations-area { flex-wrap:wrap; row-gap:4px; }
.operations-area > .grow { flex:1 1 6em; min-width:0; overflow-wrap:anywhere; }
.operations-area > .operations-health-chip { order:3; flex:1 0 100%; padding-inline-start:20px; white-space:normal; }
.operations-health-line { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.operations-workspace-line { display:flex; align-items:center; gap:8px; }
