/* Microsoft Atlas — VS Code + Figma + Google Maps. Dark, dense, no motion over 200ms. */
:root {
  --bg: #1b1d21; --panel: #202327; --panel2: #24272c; --line: #33373d;
  --text: #d6d9de; --dim: #8b919a; --accent: #4fc3f7; --mono: "Cascadia Code", "Consolas", ui-monospace, monospace;
  --sans: "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100dvh; overflow: hidden; background: var(--bg); color: var(--text); font: 13px/1.5 var(--sans); }
body { display: flex; flex-direction: column; }
button { font: inherit; color: inherit; background: none; border: none; }

#topbar { display: flex; align-items: center; gap: 12px; height: 50px; padding: 0 12px;
  background: var(--panel); border-bottom: 1px solid var(--line); z-index: 40; flex: none; }
#brand { display: flex; align-items: center; flex: none; }
#globe { display: block; width: 116px; height: 48px; cursor: grab; touch-action: pan-y; }
#globe:active { cursor: grabbing; }
.iconbtn { width: 30px; height: 30px; border-radius: 4px; cursor: pointer; color: var(--dim);
  display: none; align-items: center; justify-content: center; font-size: 15px; flex: none; }
.iconbtn:hover { background: #2c3138; color: var(--text); }
/* Search floats as an elegant centered pill, independent of the brand on the left. */
#searchwrap { position: absolute; left: 50%; transform: translateX(-50%);
  width: min(540px, calc(100vw - 130px)); z-index: 10; }
.search-ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--dim); pointer-events: none; }
#search { width: 100%; height: 32px; padding: 0 14px 0 34px; color: var(--text);
  background: rgba(12, 14, 17, 0.72); border: 1px solid var(--line); border-radius: 18px;
  font: 12.5px var(--sans); outline: none; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  transition: border-color 150ms, box-shadow 150ms; }
#search::placeholder { color: #616872; }
#search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.14), 0 2px 12px rgba(0, 0, 0, 0.4); }
#searchwrap:focus-within .search-ico { color: var(--accent); }
#suggestions { position: absolute; top: 38px; left: 0; right: 0; background: var(--panel2);
  border: 1px solid var(--line); border-radius: 8px; max-height: 50dvh; overflow-y: auto; z-index: 60;
  box-shadow: 0 8px 24px rgba(0,0,0,.5); }
#suggestions div { padding: 6px 10px; cursor: pointer; display: flex; gap: 8px; align-items: baseline; }
#suggestions div:hover, #suggestions div.active { background: #2c3138; }
#suggestions .t { color: var(--dim); font: 10px var(--mono); min-width: 58px; flex: none; }

main { flex: 1; display: flex; min-height: 0; position: relative; }
#left { width: 250px; background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; flex: none; }
#right { width: 384px; background: var(--panel); border-left: 1px solid var(--line); overflow-y: auto; flex: none; }
.panel-head { display: none; align-items: center; justify-content: space-between; padding: 8px 12px;
  font: 700 10px var(--mono); letter-spacing: 2px; color: var(--dim); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--panel); z-index: 2; }
.panel-head .close { display: flex; }
#backdrop { display: none; position: absolute; inset: 0; background: rgba(0,0,0,.45); z-index: 20; }

#stage { flex: 1; position: relative; min-width: 0;
  background: radial-gradient(circle at 50% 40%, #20242a 0%, var(--bg) 70%); }
#gl, #labels { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
#labels { pointer-events: none; }
#hint { position: absolute; bottom: 8px; left: 10px; font: 10px var(--mono); color: #565c66; pointer-events: none; }

/* explorer */
.exp-group > .exp-head { display: flex; justify-content: space-between; padding: 6px 10px; cursor: pointer;
  font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: 1px; color: var(--dim);
  border-bottom: 1px solid #26292e; user-select: none; }
.exp-group > .exp-head:hover { color: var(--text); }
.exp-items { display: none; }
.exp-group.open .exp-items { display: block; }
.exp-items div { padding: 4px 10px 4px 20px; cursor: pointer; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; font-size: 12px; }
.exp-items div:hover { background: #2c3138; }
.exp-items div.sel { background: #2d3f4d; color: #fff; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; }

/* inspector */
#inspector { padding: 12px 14px 48px; overflow-wrap: break-word; }
#inspector .empty { color: var(--dim); font-size: 12px; padding-top: 30px; text-align: center; }
.insp-name { font-size: 16px; font-weight: 650; line-height: 1.25; }
.insp-meta { margin: 6px 0 10px; display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.chip { font: 10px var(--mono); padding: 1px 7px; border-radius: 8px; background: #2c3138; color: var(--dim); }
.chip.type { color: #0d1117; font-weight: 700; }
.insp-summary { color: #b9bec6; margin-bottom: 10px; }
.sec { margin-top: 14px; }
.sec > h3 { font: 700 10px var(--mono); text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--dim); border-bottom: 1px solid var(--line); padding-bottom: 3px; margin-bottom: 6px; }
.sec ul { padding-left: 16px; }
.sec li { margin: 2px 0; }
.kv { color: var(--dim); font-size: 12px; margin: 2px 0; }
.kv b { color: var(--text); font-weight: 600; }
.rel { display: flex; gap: 6px; align-items: baseline; padding: 2px 0; }
.rel a { color: var(--accent); text-decoration: none; cursor: pointer; }
.rel a:hover { text-decoration: underline; }
.rel .dir { font: 10px var(--mono); color: var(--dim); width: 14px; flex: none; }
.rel .conf { font: 9px var(--mono); color: #565c66; margin-left: auto; flex: none; padding-left: 8px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 12px; }
.crumbs a { color: var(--accent); cursor: pointer; text-decoration: none; }
.crumbs .sep { color: var(--dim); }
.doc { margin: 10px 0; }
.doc h4 { font-size: 12px; color: #e8eaed; margin-bottom: 2px; }
.doc p { color: #b0b6bd; font-size: 12px; }
.doc .ev { font: 10px var(--mono); color: #565c66; word-break: break-all; }
.doc .ev a { color: #6e9fbe; text-decoration: none; }
.can { color: #9ccc9c; } .cannot { color: #e08c8c; }
.prov { margin-top: 18px; padding-top: 8px; border-top: 1px dashed var(--line);
  font: 10px var(--mono); color: #565c66; }
.ask-plan { font: 11px var(--mono); color: var(--dim); }
.ask-prompt { white-space: pre-wrap; font: 11px var(--mono); background: var(--bg);
  border: 1px solid var(--line); border-radius: 4px; padding: 8px; margin-top: 6px; max-height: 46dvh; overflow-y: auto; }

/* statusbar — operator-facing fiscal clock by default; developer metrics behind the "metrics" toggle */
#statusbar { display: flex; gap: 16px; height: 24px; align-items: center; padding: 0 12px;
  background: var(--panel); border-top: 1px solid var(--line); font: 10px var(--mono); color: var(--dim);
  flex: none; overflow: hidden; white-space: nowrap; }
#statusbar b { color: var(--text); font-weight: 600; }
#st-dev { display: inline-flex; gap: 16px; align-items: center; min-width: 0; overflow: hidden; }
#st-dev[hidden] { display: none; }
#st-devtoggle { margin-left: auto; flex: none; cursor: pointer; color: var(--dim); background: none;
  font: 10px var(--mono); letter-spacing: 0.5px; padding: 1px 9px; border: 1px solid var(--line); border-radius: 4px; }
#st-devtoggle:hover { color: var(--text); border-color: var(--dim); }
#st-devtoggle.on { color: var(--accent); border-color: rgba(79, 195, 247, 0.4); }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: #33373d; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- responsive: tablets and phones ---------- */
@media (max-width: 1180px) {
  #right { width: 340px; }
}
@media (max-width: 900px) {
  .iconbtn { display: flex; }
  .panel-head { display: flex; }
  #brand { display: none; }
  #searchwrap { width: calc(100vw - 60px); }
  #left, #right { position: absolute; top: 0; bottom: 0; z-index: 30;
    transition: transform 180ms ease-out; box-shadow: 0 0 32px rgba(0,0,0,.55); }
  #left { left: 0; width: min(280px, 84vw); transform: translateX(-105%); }
  #right { right: 0; width: min(420px, 94vw); transform: translateX(105%); }
  body.explorer-open #left { transform: translateX(0); }
  body.inspector-open #right { transform: translateX(0); }
  body.no-anim #left, body.no-anim #right { transition: none; }
  body.explorer-open #backdrop, body.inspector-open #backdrop { display: block; }
  #statusbar { gap: 12px; }
  #hint { display: none; }
  .exp-items div, #suggestions div { padding-top: 8px; padding-bottom: 8px; } /* touch targets */
}
@media (prefers-reduced-motion: reduce) {
  #left, #right { transition: none; }
}
@supports (padding: env(safe-area-inset-bottom)) {
  #statusbar { padding-bottom: env(safe-area-inset-bottom); height: calc(24px + env(safe-area-inset-bottom)); }
}
/* Mobile: the metrics row can't fit on one narrow line — let it wrap and let the bar grow instead
   of clipping after two items. Placed after the @supports rule so height:auto wins. */
@media (max-width: 900px) {
  #statusbar { height: auto; min-height: 24px; overflow: visible; white-space: normal;
    flex-wrap: wrap; row-gap: 6px; padding-top: 5px;
    padding-bottom: calc(5px + env(safe-area-inset-bottom, 0px)); }
  #st-dev { flex-wrap: wrap; overflow: visible; min-width: 0; row-gap: 4px; column-gap: 12px; }
}
