/* Static output of the page's Panda-style tokens and component recipes. */
:root {
  color-scheme: dark;
  --color-canvas: #080a0d;
  --color-surface: #11151a;
  --color-surface-raised: #181d23;
  --color-surface-pressed: #090c10;
  --color-border: #38414b;
  --color-border-strong: #677382;
  --color-text: #f4f7fa;
  --color-muted: #9ba6b2;
  --color-accent: #65e6ff;
  --color-accent-ink: #061014;
  --color-danger: #ff5b62;
  --shadow-panel: 0 2px 0 #000, 0 18px 46px rgba(0, 0, 0, .38);
  --radius-sm: 3px;
  --radius-md: 5px;
  --control-height: 36px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--color-canvas); }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--color-text);
  background: var(--color-canvas);
}

button, input { font: inherit; }
button { color: inherit; }
h1, h2, h3, p { margin: 0; letter-spacing: 0; }

.app {
  width: min(1680px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px 0 24px;
}

header {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 20px;
  align-items: center;
  min-height: 52px;
  margin-bottom: 12px;
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 2px solid var(--color-text);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font: 900 1.05rem/1 Consolas, monospace;
  box-shadow: 3px 3px 0 #27313a;
}

h1 { font-size: clamp(1.18rem, 2vw, 1.55rem); line-height: 1; text-transform: uppercase; }
h1 span { color: var(--color-muted); font-weight: 550; }

.tabs, .controls { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.tab, .toggle, .command {
  min-height: var(--control-height);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-raised);
  padding: 8px 11px;
  color: #dce3e9;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 2px 0 #050608;
  transition: border-color 120ms ease, background 120ms ease, transform 80ms ease;
}

.tab:hover, .toggle:hover, .command:hover { border-color: var(--color-border-strong); background: #20262d; }
.tab:active, .command:active { transform: translateY(1px); box-shadow: inset 0 2px 2px rgba(0,0,0,.5); }
.tab:focus-visible, .command:focus-visible, .toggle:focus-within { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.tab[aria-selected="true"] {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font-weight: 800;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.2), 0 2px 0 #164a55;
}

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 286px; gap: 12px; align-items: start; }
.viewer-shell, .panel {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-panel);
}
.viewer-shell { overflow: hidden; min-width: 0; }

.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}
.map-heading { display: flex; align-items: center; gap: 9px; min-width: 0; }
.map-heading h2 { font-size: 1rem; text-transform: uppercase; white-space: nowrap; }
.status-light { width: 8px; height: 8px; flex: none; background: #5cff91; box-shadow: 0 0 10px rgba(92,255,145,.65); }
.toggle { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-size: .78rem; }
.toggle input { width: 14px; height: 14px; margin: 0; accent-color: var(--color-accent); }
.command { background: #232b33; font-weight: 750; font-size: .78rem; }

.viewer-wrap { position: relative; height: min(79vh, 880px); min-height: 640px; background: #05070a; }
#viewer, #labelsLayer { position: absolute; inset: 0; }
#viewer canvas { display: block; }
#labelsLayer { overflow: hidden; pointer-events: none; }

.hud { position: absolute; left: 12px; bottom: 12px; z-index: 3; display: flex; flex-wrap: wrap; gap: 5px; max-width: calc(100% - 24px); }
.chip {
  border: 1px solid #46515d;
  border-radius: var(--radius-sm);
  background: rgba(10, 13, 17, .88);
  padding: 6px 8px;
  color: #bdc7d1;
  font: 650 .7rem/1.1 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.chip b { color: var(--color-text); }

.room-label {
  border: 1px solid rgba(255,255,255,.55);
  border-left: 3px solid var(--color-accent);
  border-radius: 2px;
  background: rgba(7, 10, 14, .9);
  padding: 4px 7px;
  color: white;
  font: 850 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 2px 2px 0 rgba(0,0,0,.7);
  transform: translate(-50%, -50%);
}

.side { display: grid; gap: 12px; }
.panel { overflow: hidden; }
.panel-title { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 0 12px; border-bottom: 1px solid var(--color-border); background: var(--color-surface-raised); }
.panel-title h3 { font-size: .78rem; text-transform: uppercase; }
.panel-index { color: var(--color-accent); font: 800 .68rem/1 ui-monospace, monospace; }

.selected-info { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0; padding: 1px; background: var(--color-border); }
.selected-info > div { min-width: 0; padding: 10px 11px; background: var(--color-surface); }
.selected-info dt { color: var(--color-muted); font: 750 .64rem/1 ui-monospace, monospace; text-transform: uppercase; }
.selected-info dd { margin: 5px 0 0; color: var(--color-text); font-size: .85rem; font-weight: 750; overflow-wrap: anywhere; }
.selected-info .wide { grid-column: 1 / -1; }

.legend { display: grid; grid-template-columns: 1fr; max-height: 410px; overflow: auto; scrollbar-color: #4d5965 #11151a; }
.legend-item { display: grid; grid-template-columns: 27px minmax(0,1fr); align-items: center; gap: 9px; min-height: 35px; padding: 5px 10px; border-bottom: 1px solid #252c33; color: #cbd3db; font-size: .72rem; }
.legend-item:last-child { border-bottom: 0; }
.swatch { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid rgba(255,255,255,.35); border-radius: 2px; color: #060a0d; font: 900 10px/1 ui-monospace, monospace; box-shadow: 1px 1px 0 #000; }

.tooltip { position: fixed; z-index: 20; pointer-events: none; opacity: 0; transform: translate(12px, 14px); max-width: 260px; border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); background: #0a0d11; padding: 8px 10px; color: white; box-shadow: 3px 3px 0 rgba(0,0,0,.72); font-size: .76rem; transition: opacity 80ms ease; }
.tooltip.visible { opacity: 1; }
.tooltip strong { display: block; margin-bottom: 3px; }
.tooltip span { color: var(--color-muted); font-family: ui-monospace, monospace; }

.loading { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; background: #080b0f; color: var(--color-text); font: 750 .78rem/1 ui-monospace, monospace; text-transform: uppercase; }

@media (max-width: 1160px) {
  header, .layout { grid-template-columns: 1fr; }
  .tabs, .controls { justify-content: flex-start; }
  .side { grid-template-columns: 1fr 1fr; }
  .legend { max-height: 280px; }
}

@media (max-width: 760px) {
  .app { width: calc(100vw - 16px); padding-top: 8px; }
  header { align-items: start; }
  h1 span { display: block; margin-top: 4px; }
  .bar { align-items: flex-start; flex-direction: column; }
  .viewer-wrap { height: 65vh; min-height: 480px; }
  .side { grid-template-columns: 1fr; }
  .controls { width: 100%; }
}
