/* Property Maven — instrument-panel interface. Dark, quiet chrome; the map carries the colour. */
:root {
  --bg: #070a0e; --panel: #0d1218; --panel-2: #121922; --raise: #18212c; --line: #1f2a36; --line-2: #2c3a4a;
  --ink: #e6edf3; --ink-2: #a8b4c1; --ink-3: #6c7a89; --accent: #ffb020; --accent-ink: #1a1203; --cyan: #39d0ff;
  --ok: #3ddc97; --warn: #ffcc4d; --bad: #ff6b6b;
  --ui: "Archivo", "Helvetica Neue", Arial, sans-serif; --mono: "Azeret Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--ink); font: 400 13px/1.4 var(--ui); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

#app { height: 100%; display: grid; grid-template-columns: 52px 300px minmax(0, 1fr) 330px; grid-template-rows: 52px minmax(0, 1fr) 28px;
  grid-template-areas: "top top top top" "rail left stage right" "status status status status"; }

/* ---------- top bar ---------- */
.top { grid-area: top; display: flex; align-items: center; gap: 14px; padding: 0 14px 0 10px; background: var(--panel); border-bottom: 1px solid var(--line); min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mark { width: 28px; height: 28px; color: var(--accent); flex: none; }
.wordmark { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.wordmark b { font-weight: 800; font-stretch: 125%; letter-spacing: .16em; text-transform: uppercase; font-size: 12.5px; }
.wordmark span { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-mode { font: 600 9.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); padding: 4px 6px; border-radius: 2px; white-space: nowrap; }
.search { flex: 1 1 260px; max-width: 420px; display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 3px; margin-left: 8px; }
.search svg { width: 15px; height: 15px; color: var(--ink-3); flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-family: var(--mono); font-size: 12px; letter-spacing: .02em; }
.search:focus-within { border-color: var(--cyan); }
.views { display: flex; border: 1px solid var(--line-2); border-radius: 3px; overflow: hidden; flex: none; }
.views button { height: 30px; padding: 0 11px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; font-weight: 600; font-size: 12px; }
.views button + button { border-left: 1px solid var(--line-2); }
.views button:hover { background: var(--raise); color: var(--ink); }
.file-menu { position: relative; flex: none; }
.file-menu summary { list-style: none; cursor: pointer; height: 30px; display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 3px; color: var(--ink-2); font-weight: 600; font-size: 12px; }
.file-menu summary::-webkit-details-marker { display: none; }
.file-menu summary:hover, .file-menu details[open] summary { color: var(--ink); background: var(--raise); }
.menu { position: absolute; right: 0; top: 36px; z-index: 30; min-width: 280px; padding: 6px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 4px; box-shadow: 0 16px 40px rgb(0 0 0 / .5); }
.menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: transparent; cursor: pointer; border-radius: 3px; font-size: 12.5px; }
.menu button:hover { background: var(--raise); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu .danger { color: var(--bad); }
.cloud { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.save { font: 500 10.5px/1 var(--mono); color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.save.ok { color: var(--ok); } .save.warn { color: var(--warn); } .save.bad { color: var(--bad); }
#cloud-user { font: 500 11px/1 var(--mono); color: var(--ink-2); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* page switch (Editor / Operations) */
.pages { display: flex; border: 1px solid var(--line-2); border-radius: 3px; overflow: hidden; flex: none; }
.pages a { height: 30px; display: flex; align-items: center; padding: 0 12px; color: var(--ink-3); text-decoration: none; font-weight: 700; font-size: 10.5px; font-stretch: 112%; letter-spacing: .14em; text-transform: uppercase; }
.pages a + a { border-left: 1px solid var(--line-2); }
.pages a:hover { color: var(--ink); background: var(--raise); }
.pages a[aria-current="page"] { color: var(--ink); background: var(--raise); box-shadow: inset 0 -2px 0 var(--accent); }

/* ---------- rail ---------- */
.rail { grid-area: rail; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; }
.rail hr { width: 26px; border: 0; border-top: 1px solid var(--line-2); margin: 4px 0; }
.rail .grow { flex: 1; }
.tool { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--ink-2); cursor: pointer; }
.tool svg { width: 20px; height: 20px; }
.tool kbd { position: absolute; right: 2px; bottom: 1px; font: 600 8px/1 var(--mono); color: var(--ink-3); }
.tool:hover { background: var(--raise); color: var(--ink); }
.tool.on { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: color-mix(in srgb, var(--accent) 60%, transparent); color: var(--accent); }
.tool.on kbd { color: var(--accent); }
.tool.sm { width: 34px; height: 30px; } .tool.sm svg { width: 17px; height: 17px; }
.tool:disabled { opacity: .3; cursor: default; background: transparent; }

/* ---------- side panels ---------- */
.left, .right { background: var(--panel); overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.left { grid-area: left; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.right { grid-area: right; border-left: 1px solid var(--line); padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 2; }
.tabs button { height: 38px; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; font-weight: 700; font-size: 10.5px; font-stretch: 112%; letter-spacing: .14em; text-transform: uppercase; border-bottom: 2px solid transparent; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.panel-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.eyebrow { font-weight: 700; font-size: 10px; font-stretch: 112%; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); }
.mt { margin-top: 10px; }
.muted { color: var(--ink-3); margin: 0; font-size: 12px; } .small { font-size: 11px; }
.warn { color: var(--warn); margin: 0; font-size: 12px; }
.row { display: flex; align-items: center; } .gap { gap: 6px; } .wrap { flex-wrap: wrap; }
.row.toggle { gap: 9px; padding: 4px 2px; cursor: pointer; color: var(--ink-2); }
.row.toggle span:first-of-type { flex: 1; }
.row.toggle:hover { color: var(--ink); }
.num { font: 500 11px/1 var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.row.slider { gap: 10px; color: var(--ink-2); font-size: 12px; } .row.slider span { width: 92px; flex: none; } .row.slider input { flex: 1; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); margin: 0; width: 14px; height: 14px; }
input[type=range] { accent-color: var(--accent); }
input[type=text], input[type=search], input[type=number], input[type=password], select, textarea {
  width: 100%; min-width: 0; height: 30px; padding: 0 8px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 3px; outline: none; font-size: 12.5px; }
textarea { height: auto; padding: 6px 8px; resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { border-color: var(--cyan); }
input[type=number] { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.btn { height: 28px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 3px; background: var(--raise); color: var(--ink); cursor: pointer; font-weight: 600; font-size: 12px; white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); }
.btn.on { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.btn.wide { width: 100%; height: 34px; }
.btn:disabled { opacity: .4; cursor: default; filter: none; }
.top .btn.primary:disabled { background: transparent; color: var(--ink-3); border-color: var(--line-2); }
.seg { display: flex; border: 1px solid var(--line-2); border-radius: 3px; overflow: hidden; }
.seg button { flex: 1; height: 28px; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; font-weight: 600; font-size: 11.5px; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--raise); color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }

.legend { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 5px; color: var(--ink-2); font-size: 12px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend i { width: 14px; height: 10px; border-radius: 2px; flex: none; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .3); }
.legend.mono b { font: 700 10.5px/1 var(--mono); width: 22px; }

/* sites */
.progress { display: flex; flex-direction: column; gap: 6px; }
.progress .bar { height: 6px; background: var(--raise); border-radius: 3px; overflow: hidden; }
.progress .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #ffd27a); }
.progress span { font: 500 11px/1 var(--mono); color: var(--ink-2); }
.armed { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--cyan) 50%, transparent); background: color-mix(in srgb, var(--cyan) 8%, transparent); border-radius: 4px; }
.armed > div { display: flex; flex-direction: column; gap: 3px; }
.armed strong { font: 800 22px/1 var(--ui); font-stretch: 120%; color: var(--cyan); letter-spacing: .02em; }
.armed small { color: var(--ink-3); font-size: 11px; }
.site-list { display: flex; flex-direction: column; gap: 6px; }
.group { display: flex; justify-content: space-between; margin-top: 6px; font-weight: 700; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { min-width: 40px; height: 24px; padding: 0 6px; border: 1px solid var(--line-2); border-radius: 2px; background: var(--bg); cursor: pointer; font: 600 11px/1 var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--cyan); color: var(--cyan); }
.chip.placed { color: var(--ink-3); border-style: dashed; }
.chip.placed:hover { color: var(--accent); border-color: var(--accent); }
.chip.armed { background: var(--cyan); color: #00151d; border-color: var(--cyan); }

/* overlays */
.ov { border: 1px solid var(--line); border-radius: 4px; padding: 9px 10px; display: flex; flex-direction: column; gap: 8px; background: var(--panel-2); }
.ov.on { border-color: var(--line-2); box-shadow: inset 2px 0 0 var(--accent); }
.ov-head { display: flex; align-items: center; gap: 8px; }
.ov-name { flex: 1; font-weight: 600; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--ink-3); cursor: pointer; }
.align { border-top: 1px dashed var(--line-2); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.align p { margin: 0; color: var(--cyan); font-size: 12px; }
.align ol { margin: 0; padding-left: 18px; color: var(--ink-3); font: 500 11px/1.6 var(--mono); }

/* inspector */
.card { border: 1px solid var(--line); border-radius: 4px; background: var(--panel-2); padding: 11px 12px; display: flex; flex-direction: column; gap: 8px; }
.big { margin: 0; font-weight: 800; font-size: 26px; line-height: 1; font-stretch: 118%; letter-spacing: .01em; overflow-wrap: anywhere; }
.big.bad { color: var(--bad); }
.field { display: grid; gap: 4px; position: relative; }
.field > span { font-weight: 700; font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.field em { position: absolute; right: 8px; bottom: 8px; font: 500 10.5px/1 var(--mono); color: var(--ink-3); font-style: normal; pointer-events: none; }
.field:has(em) input { padding-right: 26px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kv { margin: 0; display: grid; gap: 5px; }
.kv > div { display: grid; grid-template-columns: 112px 1fr; gap: 8px; align-items: baseline; }
.kv dt { font-weight: 700; font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.kv dd { margin: 0; font: 500 12px/1.35 var(--mono); color: var(--ink-2); overflow-wrap: anywhere; }
.kv.keys dd { color: var(--ink); }
.rot { display: inline-flex; } .rot .btn { border-radius: 0; padding: 0 7px; font-family: var(--mono); font-size: 11px; } .rot .btn + .btn { border-left: 0; }
.rot .btn:first-child { border-radius: 3px 0 0 3px; } .rot .btn:last-child { border-radius: 0 3px 3px 0; }
.steps { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--ink-2); font-size: 12px; }
.ptypes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.ptypes button { display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 3px; background: var(--bg); cursor: pointer; font-size: 11.5px; text-align: left; color: var(--ink-2); }
.ptypes button b { font: 700 10.5px/1 var(--mono); width: 20px; }
.ptypes button.on { border-color: var(--accent); color: var(--ink); background: var(--raise); }

/* ---------- stage ---------- */
.stage { grid-area: stage; position: relative; min-width: 0; min-height: 0; background: #05080b; }
#map { position: absolute; inset: 0; }
.cesium-viewer, .cesium-viewer-cesiumWidgetContainer, .cesium-widget { position: relative; width: 100%; height: 100%; overflow: hidden; }
.cesium-widget canvas { width: 100%; height: 100%; touch-action: none; display: block; outline: none; }
.cesium-viewer-bottom, .cesium-widget-credits, .cesium-viewer-toolbar, .cesium-viewer-animationContainer, .cesium-viewer-timelineContainer, .cesium-viewer-fullscreenContainer, .cesium-viewer-vrContainer { display: none !important; }
.cesium-widget-errorPanel { position: absolute; inset: 0; display: grid; place-items: center; background: rgb(0 0 0 / .7); }
.cesium-credit-lightbox-overlay { display: none !important; }
.compass { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; padding: 2px; border-radius: 50%; border: 1px solid var(--line-2); background: rgb(13 18 24 / .85); color: var(--ink); cursor: pointer; backdrop-filter: blur(8px); }
.compass svg { width: 100%; height: 100%; }
.compass text { font-family: var(--ui); }
.reticle { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; pointer-events: none; opacity: .35;
  background: linear-gradient(var(--ink), var(--ink)) center/1px 100% no-repeat, linear-gradient(var(--ink), var(--ink)) center/100% 1px no-repeat; }
.marquee { position: absolute; border: 1px dashed var(--cyan); background: color-mix(in srgb, var(--cyan) 10%, transparent); pointer-events: none; z-index: 5; }
.toast { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); max-width: min(560px, 90%); padding: 8px 14px; background: rgb(13 18 24 / .94); border: 1px solid var(--line-2); border-radius: 4px; font-size: 12.5px; color: var(--ink); box-shadow: 0 10px 30px rgb(0 0 0 / .45); z-index: 6; text-align: center; }

/* ---------- status ---------- */
.status { grid-area: status; display: flex; align-items: center; gap: 16px; padding: 0 12px; background: var(--panel); border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink-3); min-width: 0; }
.status .hint { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.status .mono { font: 500 10.5px/1 var(--mono); letter-spacing: .03em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.credits { max-width: 34%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10px; }
.credits * { display: inline !important; color: var(--ink-3) !important; font-size: 10px !important; }
.credits img { height: 12px; vertical-align: middle; }
.credits a { color: var(--ink-3) !important; }

/* ---------- boot ---------- */
.boot { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--bg); text-align: center; }
.boot b { display: block; font-weight: 800; font-stretch: 125%; letter-spacing: .2em; text-transform: uppercase; margin-top: 14px; }
.boot p { color: var(--ink-3); margin: 6px 0 0; max-width: 420px; }
.spin { width: 28px; height: 28px; margin: 0 auto; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1280px) { #app { grid-template-columns: 52px 270px minmax(0, 1fr) 300px; } .chip-mode { display: none; } }
@media (max-width: 1050px) { .views button:nth-child(n+4) { display: none; } #cloud-user { display: none; } }
