/*
 * GeoKL Explorer on the Planetra design system.
 *
 * Every value comes from the semantic --pl-* tier in planetra-tokens.css (copied
 * verbatim from @planetra/ui). Recipes follow @planetra/ui components: Button,
 * Panel, Tabs, Badge, Input, Select, Checkbox, ToggleChip, SegmentedControl,
 * Legend, StatCard, DataTable, Callout. Mint is the only accent; data colours on
 * the map (legends, choropleths) are data, not chrome.
 */

@font-face { font-family: "Geologica Variable"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("../fonts/geologica-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geologica Variable"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("../fonts/geologica-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DM Mono"; font-style: normal; font-display: swap; font-weight: 400; src: url("../fonts/dm-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "DM Mono"; font-style: normal; font-display: swap; font-weight: 500; src: url("../fonts/dm-mono-latin-500-normal.woff2") format("woff2"); }

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
html {
  color-scheme: dark;
  background: var(--pl-surface-canvas);
  color: var(--pl-text);
  font-family: var(--pl-font-sans);
  -webkit-font-smoothing: antialiased;
}
body { font-size: 13px; line-height: 1.45; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select { font: inherit; color: inherit; }
a { color: var(--pl-accent); text-decoration: none; }
a:hover { color: var(--pl-accent-hover); }
code { font-family: var(--pl-font-mono); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; } }
:focus-visible { outline: var(--pl-focus-ring-width) solid var(--pl-focus-ring); outline-offset: var(--pl-focus-ring-offset); }
:where(table, output, time, [data-numeric], .mono) { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--pl-font-mono); }
::selection { background: var(--pl-accent-soft); color: var(--pl-text); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--pl-border); border-radius: var(--pl-radius-full); border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
.ic { flex: none; }

/* ---------------------------------------------------------------- shell */
#app {
  --left-w: 340px;
  --right-w: var(--pl-panel-width);
  display: grid; height: 100%;
  grid-template-rows: var(--pl-header-height) 1fr;
  grid-template-columns: var(--left-w) 1fr var(--right-w);
}
#app.wide-right { --right-w: 480px; }
#app.left-closed { --left-w: 0px; }
#app.right-closed { --right-w: 0px; }
header {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 16px;
  padding: 0 var(--pl-space-panel);
  background: var(--pl-surface-canvas); border-bottom: 1px solid var(--pl-border);
  z-index: var(--pl-z-panel);
}
aside {
  display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden;
  background: var(--pl-surface); z-index: var(--pl-z-panel);
}
#left { border-right: 1px solid var(--pl-border); }
#right { border-left: 1px solid var(--pl-border); }
#mapwrap { position: relative; min-width: 0; }
#map { position: absolute; inset: 0; }

/* brand */
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pl-logo { height: 24px; width: auto; flex: none; color: var(--pl-text); }  /* @planetra/ui Logo: h-6 w-auto shrink-0 */
.brand-sep { width: 1px; height: 28px; background: var(--pl-border); flex: none; }
.brand-name { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: var(--pl-tracking-wordmark); text-transform: uppercase; line-height: 1.1; white-space: nowrap; }
.brand-name b { color: var(--pl-accent); font-weight: 600; }
.brand-sub { display: block; margin-top: 3px; font-size: 12px; color: var(--pl-text-subtle); white-space: nowrap; letter-spacing: 0; text-transform: none; font-weight: 400; }
.head-spacer { flex: 1; }
.head-stats { display: flex; gap: 8px; }
.head-sep { width: 1px; height: 24px; background: var(--pl-border); }

/* ---------------------------------------------------------------- Badge */
.badge {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  padding: 2px 8px; border-radius: var(--pl-radius-full); border: 1px solid var(--pl-border);
  background: var(--pl-surface-raised); color: var(--pl-text-muted);
  font-size: 12px; font-weight: 500; line-height: 18px;
}
.badge b { color: var(--pl-text); font-weight: 500; font-family: var(--pl-font-mono); }
.badge.sm { padding: 0 6px; font-size: 11px; line-height: 16px; }
.badge.accent { background: var(--pl-accent-soft); color: var(--pl-accent); border-color: color-mix(in srgb, var(--pl-accent) 30%, transparent); }
.badge.warning { background: var(--pl-status-warning-soft); color: var(--pl-status-warning); border-color: color-mix(in srgb, var(--pl-status-warning) 30%, transparent); }
.badge.danger { background: var(--pl-status-danger-soft); color: var(--pl-status-danger); border-color: color-mix(in srgb, var(--pl-status-danger) 30%, transparent); }
.badge.info { background: var(--pl-status-info-soft); color: var(--pl-status-info); border-color: color-mix(in srgb, var(--pl-status-info) 30%, transparent); }
.badge.demo { background: var(--pl-severity-low-soft); color: var(--pl-severity-low); border-color: color-mix(in srgb, var(--pl-severity-low) 30%, transparent); }

/* ---------------------------------------------------------------- Button / icon button / link */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  height: 32px; padding: 0 12px; border-radius: var(--pl-radius-md);
  font-size: 13px; font-weight: 500; user-select: none;
  border: 1px solid var(--pl-border); background: var(--pl-surface-raised); color: var(--pl-text);
  transition: background var(--pl-duration-fast) var(--pl-ease), border-color var(--pl-duration-fast) var(--pl-ease);
}
.btn:hover { border-color: var(--pl-border-strong); background: var(--pl-surface); }
.btn.primary { border-color: transparent; background: var(--pl-accent); color: var(--pl-text-on-accent); }
.btn.primary:hover { background: var(--pl-accent-hover); }
.btn.primary:active { background: var(--pl-accent-active); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.icon-btn {
  width: 32px; height: 32px; display: grid; place-items: center; flex: none;
  border-radius: var(--pl-radius-md); color: var(--pl-text-muted);
  transition: background var(--pl-duration-fast) var(--pl-ease), color var(--pl-duration-fast) var(--pl-ease);
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: var(--pl-surface-raised); color: var(--pl-text); }
.icon-btn[aria-pressed="true"] { background: var(--pl-accent-soft); color: var(--pl-accent); }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn.sm svg { width: 14px; height: 14px; }
.link-btn { font-size: 12px; font-weight: 500; color: var(--pl-text-muted); text-decoration: none; }
.link-btn:hover { color: var(--pl-accent); }
.link-btn:disabled, .link-btn[disabled] { opacity: 0.4; pointer-events: none; }
.copied { color: var(--pl-accent) !important; }

/* ---------------------------------------------------------------- SegmentedControl */
.seg { display: inline-flex; padding: 2px; border-radius: var(--pl-radius-md); border: 1px solid var(--pl-border); background: var(--pl-surface-sunken); }
.seg > button {
  padding: 5px 12px; border-radius: var(--pl-radius-sm); font-size: 12px; font-weight: 500; color: var(--pl-text-muted);
  transition: background var(--pl-duration-fast) var(--pl-ease), color var(--pl-duration-fast) var(--pl-ease);
}
.seg > button:hover { color: var(--pl-text); }
.seg > button[aria-checked="true"] { background: var(--pl-accent); color: var(--pl-text-on-accent); }

/* ---------------------------------------------------------------- Tabs */
.tabs { display: flex; gap: 4px; padding: 4px 12px 0; border-bottom: 1px solid var(--pl-border); flex: none; align-items: stretch; }
.tabs button {
  position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; margin-bottom: -1px;
  font-size: 14px; line-height: 20px; font-weight: 500; color: var(--pl-text-muted);
  transition: color var(--pl-duration-fast) var(--pl-ease);
}
.tabs button svg { width: 16px; height: 16px; }
.tabs button:hover { color: var(--pl-text); }
.tabs button.on { color: var(--pl-text); }
.tabs button.on svg { color: var(--pl-accent); }
.tabs button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: var(--pl-accent); }
.tab-pane { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.tab-pane[hidden] { display: none; }

/* ---------------------------------------------------------------- Panel */
.panel-head { padding: 12px var(--pl-space-panel); border-bottom: 1px solid var(--pl-border); display: grid; gap: 12px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel-title h2 { margin: 0; font-size: 14px; font-weight: 500; color: var(--pl-text); }
.panel-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
.micro, .section-label { font: 500 11px/1.2 var(--pl-font-mono); letter-spacing: var(--pl-tracking-micro); text-transform: uppercase; color: var(--pl-text-subtle); }
.section-label { margin: 20px 0 8px; }
.empty-list { padding: 32px 20px; color: var(--pl-text-subtle); text-align: center; font-size: 13px; }

/* ---------------------------------------------------------------- Input / Select */
.search {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px;
  border-radius: var(--pl-radius-md); border: 1px solid var(--pl-border); background: var(--pl-surface-sunken);
  color: var(--pl-text-subtle);
  transition: border-color var(--pl-duration-fast) var(--pl-ease);
}
.search svg { width: 16px; height: 16px; }
.search:focus-within { border-color: var(--pl-accent); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--pl-text); font-size: 13px; }
.search input::placeholder { color: var(--pl-text-subtle); }
.search.sm { height: 34px; }
.select, .field {
  width: 100%; height: 34px; padding: 0 10px; border-radius: var(--pl-radius-md);
  border: 1px solid var(--pl-border); background: var(--pl-surface-sunken); color: var(--pl-text); font-size: 13px; outline: none;
  transition: border-color var(--pl-duration-fast) var(--pl-ease);
}
.select:hover, .field:hover { border-color: var(--pl-border-strong); }
.select:focus, .field:focus { border-color: var(--pl-accent); }

/* ---------------------------------------------------------------- ToggleChip */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border-radius: var(--pl-radius-full); border: 1px solid var(--pl-border); background: var(--pl-surface);
  color: var(--pl-text-muted); font-size: 13px; font-weight: 400;
  transition: border-color var(--pl-duration-fast) var(--pl-ease), background var(--pl-duration-fast) var(--pl-ease), color var(--pl-duration-fast) var(--pl-ease);
}
.chip:hover { border-color: var(--pl-border-strong); color: var(--pl-text); }
.chip.on { border-color: var(--pl-accent); background: var(--pl-accent-soft); color: var(--pl-text); }
.chip .chip-check { display: none; width: 14px; height: 14px; color: var(--pl-accent); }
.chip.on .chip-check { display: block; }
.chip.on .geo { display: none; }
.geo { display: inline-flex; align-items: center; gap: 4px; }
.geo i { display: inline-block; width: 9px; height: 9px; border: 1.5px solid currentColor; }
.geo.point i { border-radius: 50%; }
.geo.line i { height: 0; width: 10px; border-width: 1.5px 0 0; transform: rotate(-35deg); }
.geo.polygon i { border-radius: 2px; }
.geo.model i { border-radius: 1px; transform: skewY(-12deg); box-shadow: 2px -2px 0 -0.5px currentColor; }

/* ---------------------------------------------------------------- layer tree (sections + rows) */
.group { border-bottom: 1px solid var(--pl-border); }
.group-head {
  width: 100%; display: grid; grid-template-columns: 32px 1fr auto 16px; align-items: center; gap: 12px;
  padding: 10px var(--pl-space-panel); text-align: left; position: sticky; top: 0; z-index: 1; background: var(--pl-surface);
  transition: background var(--pl-duration-fast) var(--pl-ease);
}
.group-head:hover { background: var(--pl-surface-raised); }
.sicon {
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--pl-radius-md);
  border: 1px solid var(--pl-border); background: var(--pl-surface-raised); color: var(--pl-text-muted);
  transition: background var(--pl-duration-fast) var(--pl-ease), color var(--pl-duration-fast) var(--pl-ease), border-color var(--pl-duration-fast) var(--pl-ease);
}
.sicon svg { width: 16px; height: 16px; }
.group.has-active .sicon { background: var(--pl-accent-soft); border-color: color-mix(in srgb, var(--pl-accent) 30%, transparent); color: var(--pl-accent); }
.gname { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gname small { display: block; font-size: 12px; font-weight: 400; color: var(--pl-text-subtle); }
.gcount { display: flex; align-items: center; gap: 6px; font: 400 11px var(--pl-font-mono); color: var(--pl-text-subtle); }
.gactive { font: 500 11px/16px var(--pl-font-mono); color: var(--pl-accent); background: var(--pl-accent-soft); border: 1px solid color-mix(in srgb, var(--pl-accent) 30%, transparent); border-radius: var(--pl-radius-full); padding: 0 6px; }
.chev { width: 16px; height: 16px; color: var(--pl-text-subtle); transition: transform var(--pl-duration) var(--pl-ease); }
.group.open .group-head .chev { transform: rotate(90deg); }
.group-body { display: none; padding: 0 8px 10px; }
.group.open .group-body { display: grid; gap: 4px; }

.row { padding: 7px 8px; border-radius: var(--pl-radius-md); transition: background var(--pl-duration-fast) var(--pl-ease); }
.row:hover { background: var(--pl-surface-raised); }
.row.active { background: color-mix(in srgb, var(--pl-accent-soft) 55%, transparent); }
.row-main { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; cursor: pointer; user-select: none; }
.check {
  width: 16px; height: 16px; margin-top: 1px; display: grid; place-items: center;
  border-radius: var(--pl-radius-xs); border: 1px solid var(--pl-border-strong); background: transparent;
  color: var(--pl-text-on-accent);
  transition: background var(--pl-duration-fast) var(--pl-ease), border-color var(--pl-duration-fast) var(--pl-ease);
}
.check svg { width: 12px; height: 12px; opacity: 0; }
.row.active .check { background: var(--pl-accent); border-color: var(--pl-accent); }
.row.active .check svg { opacity: 1; }
.row.loading .check { border-color: var(--pl-accent); border-top-color: transparent; border-radius: 50%; background: none; animation: spin 0.8s linear infinite; }
.row.error .check { border-color: var(--pl-status-danger); }
@keyframes spin { to { transform: rotate(360deg); } }
.rtext { min-width: 0; }
.rname-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ldot { width: 8px; height: 8px; border-radius: 2px; background: var(--c); flex: none; }
.rname { flex: 1; min-width: 0; font-size: 13px; line-height: 1.3; color: var(--pl-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src { flex: none; font: 500 10px/16px var(--pl-font-mono); letter-spacing: var(--pl-tracking-micro); text-transform: uppercase; color: var(--pl-text-subtle); border: 1px solid var(--pl-border); border-radius: var(--pl-radius-xs); padding: 0 4px; }
.rmeta { display: flex; gap: 8px; margin-top: 3px; color: var(--pl-text-subtle); font: 400 11px var(--pl-font-mono); align-items: center; flex-wrap: wrap; }
.rmeta .badge { font-family: var(--pl-font-mono); }
.rerr { color: var(--pl-status-danger); font-size: 12px; margin-top: 2px; }
.rprog { height: 2px; background: var(--pl-border); border-radius: 2px; margin-top: 6px; overflow: hidden; display: none; }
.rprog i { display: block; height: 100%; width: 0; background: var(--pl-accent); transition: width var(--pl-duration-fast) linear; }
.row.loading .rprog { display: block; }
.row-ctrl { display: none; align-items: center; gap: 4px; margin: 8px 0 2px 28px; }
.row.active .row-ctrl { display: flex; }
.row-ctrl input[type=range] { flex: 1; accent-color: var(--pl-accent); height: 4px; }

/* ---------------------------------------------------------------- Legend (in-row) */
.legend-host { display: none; }
.row.active .legend-host { display: block; }
.legend { margin: 8px 0 2px 28px; padding: 10px 0 2px; border-top: 1px solid var(--pl-border-hairline); }
.legend-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.legend-head > span:first-child { font: 500 11px var(--pl-font-mono); letter-spacing: var(--pl-tracking-micro); text-transform: uppercase; color: var(--pl-text-subtle); }
.legend-actions { display: flex; gap: 12px; }
.legend-items { display: grid; gap: 1px; }
.lg-item {
  display: grid; grid-template-columns: 16px 1fr auto; align-items: center; gap: 8px;
  padding: 4px 6px; border-radius: var(--pl-radius-sm); text-align: left; width: 100%;
  transition: background var(--pl-duration-fast) var(--pl-ease), opacity var(--pl-duration-fast) var(--pl-ease);
}
.lg-item:hover { background: var(--pl-surface-raised); }
.lg-item.off { opacity: 0.4; }
.lg-item.off .lg-label { text-decoration: line-through; }
.lg-sw { width: 12px; height: 12px; border: 1px solid var(--pl-border-strong); border-radius: var(--pl-radius-xs); justify-self: center; }
.lg-sw.line { height: 0; border-width: 3px 0 0; border-radius: 0; }
.lg-sw.line.dashed { border-top-style: dashed; }
.lg-sw.dot { width: 14px; height: 14px; border-radius: 50%; display: grid; place-items: center; font: 700 9px/1 var(--pl-font-sans); color: var(--pl-c-ink-on-light); }
.lg-label { min-width: 0; font-size: 12px; color: var(--pl-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-n { font: 400 11px var(--pl-font-mono); color: var(--pl-text-subtle); }
.metric-select { margin: 2px 0 8px; height: 32px; font-size: 12px; }
.legend-note { font-size: 11px; color: var(--pl-text-subtle); margin: 6px 0 0 6px; }

/* ---------------------------------------------------------------- map chrome (.pl-on-map) */
.map-card {
  position: absolute; z-index: var(--pl-z-panel);
  border: 1px solid var(--pl-border); border-radius: var(--pl-radius-md);
  background: color-mix(in srgb, var(--pl-surface) 90%, transparent); color: var(--pl-text);
  box-shadow: var(--pl-shadow-panel); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.toggle-left { left: 12px; top: 12px; }
.toggle-right { right: 12px; top: 12px; }
.statusbar { left: 12px; bottom: 12px; display: flex; padding: 6px 4px; font: 400 11px var(--pl-font-mono); color: var(--pl-text-muted); }
.statusbar span { padding: 0 8px; }
.statusbar span + span { border-left: 1px solid var(--pl-border); }
.toast { left: 50%; top: 12px; transform: translateX(-50%); display: none; align-items: center; gap: 8px; padding: 8px 12px; font-size: 13px; color: var(--pl-text-muted); white-space: nowrap; }
.toast.show { display: flex; animation: drop var(--pl-duration) var(--pl-ease); }
.toast svg { width: 16px; height: 16px; color: var(--pl-accent); }
.toast b { color: var(--pl-text); font-weight: 500; }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -6px); } }
.maplibregl-ctrl-top-right { top: 56px; }
.maplibregl-ctrl-group { background: color-mix(in srgb, var(--pl-surface) 90%, transparent) !important; border: 1px solid var(--pl-border); border-radius: var(--pl-radius-md) !important; box-shadow: var(--pl-shadow-panel) !important; backdrop-filter: blur(4px); }
.maplibregl-ctrl-group button { width: 32px; height: 32px; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--pl-border) !important; }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(0.9); }
.ctrl-3d button { position: relative; overflow: hidden; font: 600 11px var(--pl-font-mono); letter-spacing: 0.02em; color: var(--pl-text-muted); }
.ctrl-3d button:hover { color: var(--pl-text); }
.ctrl-3d button.on, .ctrl-3d button.on:not(:disabled):hover { background: var(--pl-accent); color: var(--pl-accent-fg); }
.ctrl-3d button.loading { color: var(--pl-text); }
.ctrl-3d .ctrl-prog { position: absolute; left: 0; bottom: 0; height: 2px; width: calc(var(--p, 0) * 100%); background: var(--pl-accent); transition: width 0.2s; }
.maplibregl-ctrl-scale { background: transparent; color: var(--pl-text-muted); border-color: var(--pl-text-muted); font: 10px var(--pl-font-mono); }
.maplibregl-ctrl-attrib { background: color-mix(in srgb, var(--pl-surface-sunken) 80%, transparent) !important; color: var(--pl-text-subtle); font-size: 11px; }
.maplibregl-ctrl-attrib a { color: var(--pl-text-muted); }
.maplibregl-ctrl-attrib-button { filter: invert(0.85); }

/* ---------------------------------------------------------------- attributes panel */
.hits-label { padding: 12px var(--pl-space-panel) 4px; }
.hits { display: grid; gap: 2px; padding: 4px 8px 8px; max-height: 232px; overflow-y: auto; border-bottom: 1px solid var(--pl-border); }
.hit {
  display: grid; grid-template-columns: 10px 1fr; align-items: center; gap: 10px;
  padding: 7px 8px; border-radius: var(--pl-radius-md); text-align: left; width: 100%;
  transition: background var(--pl-duration-fast) var(--pl-ease);
}
.hit:hover { background: var(--pl-surface-raised); }
.hit.on { background: var(--pl-accent-soft); }
.hit .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.hit .htext { min-width: 0; }
.hit .hlabel { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hit .hlayer { color: var(--pl-text-subtle); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail { padding: var(--pl-space-panel); }
.detail-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.detail-head .dtitle { flex: 1; min-width: 0; }
.detail-head h3 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: var(--pl-tracking-tight); line-height: 1.2; word-break: break-word; }
.detail-head .dsub { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--pl-text-muted); }
.detail-head .dsub .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.detail-actions { display: flex; gap: 2px; }
.zone-chip {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 3px 10px 3px 6px;
  border-radius: var(--pl-radius-full); border: 1px solid var(--pl-border); background: var(--pl-surface-raised); font-size: 12px; color: var(--pl-text);
}
.zone-chip b { font: 500 12px var(--pl-font-mono); }
.attr-filter { margin-bottom: 8px; }
table.attrs { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.attrs td { padding: 8px 0; vertical-align: top; word-break: break-word; border-bottom: 1px solid var(--pl-border-hairline); }
table.attrs tr:last-child td { border-bottom: 0; }
table.attrs td.k { width: 42%; padding-right: 12px; color: var(--pl-text-subtle); font: 400 12px var(--pl-font-mono); }
table.attrs td.v { color: var(--pl-text); font-size: 13px; }
table.attrs td.v.num { font-family: var(--pl-font-mono); font-size: 12px; }
table.attrs td.v.nil { color: var(--pl-text-subtle); font-style: italic; }
table.attrs td.v .raw { display: block; color: var(--pl-text-subtle); font: 400 11px var(--pl-font-mono); }
.note-small { margin-top: 12px; font-size: 12px; color: var(--pl-text-subtle); }

/* StatCard grid (layer info + insight KPIs) */
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.kv { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 16px; border-radius: var(--pl-radius-md); border: 1px solid var(--pl-border); background: var(--pl-surface); }
.kv span { font-size: 12px; line-height: 16px; color: var(--pl-text-subtle); }
.kv b { font-size: 24px; line-height: 32px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kv b.long { font-size: 14px; line-height: 20px; font-weight: 500; }
.kv em { font-style: normal; font-size: 12px; color: var(--pl-text-muted); }
.fields { display: flex; flex-wrap: wrap; gap: 6px; }
.fields code { font: 400 11px var(--pl-font-mono); padding: 2px 6px; border-radius: var(--pl-radius-xs); background: var(--pl-surface-sunken); border: 1px solid var(--pl-border); color: var(--pl-text-muted); }
.prose { margin: 0; color: var(--pl-text-muted); font-size: 13px; }

/* EmptyState */
.placeholder { display: grid; justify-items: center; gap: 8px; padding: 48px 24px; text-align: center; }
.placeholder .ph-icon { color: var(--pl-text-subtle); margin-bottom: 4px; }
.placeholder .ph-icon svg { width: 32px; height: 32px; }
.placeholder p { margin: 0; font-size: 14px; font-weight: 500; }
.placeholder .tip { font-size: 13px; color: var(--pl-text-subtle); max-width: 260px; }

/* ---------------------------------------------------------------- Insights (right panel) */
.ins-intro { padding: 14px var(--pl-space-panel) 6px; color: var(--pl-text-muted); font-size: 13px; }
.ins-group { padding: 4px 8px; border-bottom: 1px solid var(--pl-border); }
.ins-group.open { padding-bottom: 12px; }
.ins-group-head {
  width: 100%; display: grid; grid-template-columns: 32px 1fr auto 16px; gap: 12px; align-items: center; padding: 10px 8px; text-align: left;
  border-radius: var(--pl-radius-md); transition: background var(--pl-duration-fast) var(--pl-ease);
}
.ins-group-head:hover { background: var(--pl-surface-raised); }
.ins-group.open .ins-group-head .chev { transform: rotate(90deg); }
.ins-group-body { display: none; }
.ins-group.open .ins-group-body { display: block; }
.ins-group-head h3 { margin: 0; font-size: 13px; font-weight: 600; }
.ins-group-head p { margin: 2px 0 0; color: var(--pl-text-subtle); font-size: 12px; }
.ins-card {
  display: grid; grid-template-columns: auto 1fr 16px; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 8px; border-radius: var(--pl-radius-md); transition: background var(--pl-duration-fast) var(--pl-ease);
}
.ins-card:hover { background: var(--pl-surface-raised); }
.ins-id { font: 500 11px/16px var(--pl-font-mono); color: var(--pl-accent); background: var(--pl-accent-soft); border: 1px solid color-mix(in srgb, var(--pl-accent) 30%, transparent); border-radius: var(--pl-radius-xs); padding: 1px 6px; }
.ins-main { min-width: 0; display: grid; gap: 2px; }
.ins-title { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ins-kpi { color: var(--pl-text-subtle); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ins-kpi b { color: var(--pl-text-muted); font: 500 12px var(--pl-font-mono); }
.ins-detail { padding: 12px var(--pl-space-panel) 28px; }
.ins-back { display: inline-flex; align-items: center; gap: 6px; }
.ins-back svg { width: 14px; height: 14px; }
.ins-head { display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; }
.ins-head h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: var(--pl-tracking-tight); line-height: 1.2; }
.ins-sub { display: flex; align-items: center; gap: 8px; margin-top: 4px; color: var(--pl-text-subtle); font-size: 12px; }
.ins-q { color: var(--pl-text-muted); margin: 12px 0 16px; font-size: 13px; }
.ins-layers { display: grid; gap: 2px; }
.ins-layer, .tl-check {
  display: grid; grid-template-columns: 16px 10px 1fr; align-items: center; gap: 10px; cursor: pointer;
  padding: 6px 8px; margin: 0 -8px; border-radius: var(--pl-radius-md); font-size: 13px;
  transition: background var(--pl-duration-fast) var(--pl-ease);
}
.tl-check { grid-template-columns: 16px 1fr; }
.ins-layer:hover, .tl-check:hover { background: var(--pl-surface-raised); }
.ins-layer input, .tl-check input {
  appearance: none; width: 16px; height: 16px; margin: 0; display: grid; place-items: center;
  border-radius: var(--pl-radius-xs); border: 1px solid var(--pl-border-strong); background: var(--pl-surface-sunken);
}
.ins-layer input:checked, .tl-check input:checked { background: var(--pl-accent); border-color: var(--pl-accent); }
.ins-layer input:checked::after, .tl-check input:checked::after { content: ""; width: 8px; height: 4px; border: 2px solid var(--pl-text-on-accent); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.swatch-mini { width: 10px; height: 10px; border-radius: 2px; background: var(--c); }
.ins-hint { color: var(--pl-text-subtle); font-size: 12px; margin-top: 6px; }
.ins-chart { display: grid; gap: 4px; }
.bar-row { display: grid; grid-template-columns: minmax(96px, 38%) 1fr auto; align-items: center; gap: 10px; font-size: 12px; }
.bar-label { color: var(--pl-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; background: var(--pl-surface-sunken); border-radius: 0 var(--pl-radius-xs) var(--pl-radius-xs) 0; }
.bar-track i { display: block; height: 100%; min-width: 2px; background: var(--pl-support); border-radius: 0 var(--pl-radius-xs) var(--pl-radius-xs) 0; }
.bar-row:hover .bar-track i { background: var(--pl-accent); }
.bar-val { font: 400 11px var(--pl-font-mono); color: var(--pl-text); min-width: 44px; text-align: right; }
.ins-table-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ins-table-head .link-btn { display: inline-flex; align-items: center; gap: 4px; font-family: var(--pl-font-sans); text-transform: none; letter-spacing: 0; }
.ins-table-head .link-btn svg { width: 14px; height: 14px; }
/* DataTable */
.ins-table-wrap { max-height: 380px; overflow: auto; border: 1px solid var(--pl-border); border-radius: var(--pl-radius-md); background: var(--pl-surface-sunken); }
.ins-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ins-table th { position: sticky; top: 0; background: var(--pl-surface-raised); color: var(--pl-text-subtle); font-weight: 500; text-align: left; padding: 8px 10px; cursor: pointer; white-space: nowrap; border-bottom: 1px solid var(--pl-border); }
.ins-table th:hover { color: var(--pl-text); }
.ins-table td { padding: 7px 10px; border-top: 1px solid var(--pl-border-hairline); color: var(--pl-text-muted); max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ins-table .num { text-align: right; font-family: var(--pl-font-mono); }
.ins-table tbody tr { cursor: pointer; transition: background var(--pl-duration-fast) var(--pl-ease); }
.ins-table tbody tr:hover td { background: var(--pl-surface-raised); color: var(--pl-text); }
.ins-table tbody tr.on td { background: var(--pl-accent-soft); color: var(--pl-text); }
.ins-notes { margin: 0; padding-left: 18px; color: var(--pl-text-muted); font-size: 12px; }
.ins-notes li + li { margin-top: 6px; }
.ins-foot { margin-top: 16px; color: var(--pl-text-subtle); font-size: 12px; }

/* ---------------------------------------------------------------- Filter tab */
.tl-intro { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; padding: 14px var(--pl-space-panel) 4px; color: var(--pl-text-muted); font-size: 13px; }
.tl-card { margin: 10px 12px; padding: 14px; border: 1px solid var(--pl-border); border-radius: var(--pl-radius-lg); background: var(--pl-surface-raised); display: grid; gap: 10px; }
.tl-card h3 { margin: 0; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.tl-n { width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--pl-radius-md); border: 1px solid var(--pl-border); background: var(--pl-surface); color: var(--pl-text-muted); }
.tl-n svg { width: 14px; height: 14px; }
.tl-card > * { min-width: 0; }
.tl-card { grid-template-columns: minmax(0, 1fr); }
.tl-row { display: flex; gap: 8px; align-items: center; min-width: 0; }
.tl-row > .field, .tl-row > .select { flex: 1 1 0; min-width: 0; width: auto; }
.tl-grid > .select, .tl-grid > .field, .tl-grid > .tl-row { min-width: 0; }
.tl-row > span { color: var(--pl-text-subtle); font-size: 12px; }
.tl-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 10px; align-items: center; }
.tl-grid > label { color: var(--pl-text-subtle); font-size: 12px; }
.tl-card .field[type=date] { color-scheme: dark; }
.tl-note { color: var(--pl-text-subtle); font-size: 12px; }
.tl-note code { font-size: 11px; color: var(--pl-text-muted); }
.tl-res { font-size: 13px; color: var(--pl-text-muted); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.tl-res b { color: var(--pl-text); font-family: var(--pl-font-mono); font-weight: 500; }
.tl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tl-chips:empty { display: none; }
.tl-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 4px 0 10px; border-radius: var(--pl-radius-full); border: 1px solid var(--pl-accent); background: var(--pl-accent-soft); font-size: 12px; color: var(--pl-text-muted); }
.tl-chip b { color: var(--pl-text); font-weight: 500; }
.tl-chip button { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; color: var(--pl-text-muted); }
.tl-chip button:hover { background: var(--pl-surface-raised); color: var(--pl-text); }
.tl-chip button svg { width: 12px; height: 12px; }
.tl-sum-title { display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.tl-sum { border-top: 1px solid var(--pl-border-hairline); padding: 8px 0 2px; }
.tl-sum-h { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.tl-sum-h b { font-family: var(--pl-font-mono); font-weight: 500; }
.tl-sum-r { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--pl-text-subtle); padding-left: 12px; }
.tl-sum-r span:last-child { font-family: var(--pl-font-mono); }
.tl-preset {
  display: grid; grid-template-columns: 16px 1fr; gap: 2px 10px; text-align: left; padding: 10px 12px;
  border-radius: var(--pl-radius-md); border: 1px solid var(--pl-border); background: var(--pl-surface);
  transition: border-color var(--pl-duration-fast) var(--pl-ease), background var(--pl-duration-fast) var(--pl-ease);
}
.tl-preset svg { width: 16px; height: 16px; color: var(--pl-accent); grid-row: span 2; margin-top: 2px; }
.tl-preset:hover { border-color: var(--pl-border-strong); background: var(--pl-surface-raised); }
.tl-preset b { font-weight: 500; font-size: 13px; }
.tl-preset span { color: var(--pl-text-subtle); font-size: 12px; }

/* ---------------------------------------------------------------- site screening + lot facts + nearby */
.screen-card .micro { margin-top: 2px; }
.scr-checks { display: grid; gap: 0; }
.scr-list { display: grid; gap: 2px; max-height: 360px; overflow-y: auto; margin: 0 -6px; }
.scr-row {
  display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; text-align: left;
  padding: 8px 8px; border-radius: var(--pl-radius-md); transition: background var(--pl-duration-fast) var(--pl-ease);
}
.scr-row:hover { background: var(--pl-surface); }
.scr-main, .scr-num { display: grid; gap: 2px; min-width: 0; }
.scr-main b { font-weight: 500; font-size: 13px; }
.scr-main span { font-size: 12px; color: var(--pl-text-subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scr-num { text-align: right; }
.scr-num b { font: 500 12px var(--pl-font-mono); }
.scr-num span { font: 400 11px var(--pl-font-mono); color: var(--pl-text-subtle); }
.spin-sm { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid currentColor; border-top-color: transparent; animation: spin 0.8s linear infinite; vertical-align: -2px; margin-right: 6px; }
.enrich { margin-bottom: 16px; }
.lot-facts { margin-bottom: 8px; }
.lot-facts .kv b { font-size: 20px; line-height: 28px; }
.lot-facts .kv b.long { font-size: 14px; line-height: 20px; }
.lot-facts table.attrs { margin-bottom: 8px; }
.fact-no { color: var(--pl-text-subtle); }
.note-small .ic { display: inline-block; vertical-align: -2px; margin-right: 2px; }
.nearby-head { display: flex; justify-content: space-between; align-items: center; }
.nearby-head .link-btn { display: inline-flex; align-items: center; gap: 4px; font-family: var(--pl-font-sans); letter-spacing: 0; text-transform: none; }
.near-list { display: grid; gap: 2px; margin: 0 -8px; }
.near-row {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; text-align: left; width: 100%;
  padding: 6px 8px; border-radius: var(--pl-radius-md); transition: background var(--pl-duration-fast) var(--pl-ease);
}
.near-row:hover { background: var(--pl-surface-raised); }
.near-row.far { opacity: 0.55; }
.near-ic { width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--pl-radius-sm);
  border: 1px solid color-mix(in srgb, var(--fc) 35%, transparent); background: color-mix(in srgb, var(--fc) 14%, transparent); color: var(--fc); }
.near-main { display: grid; min-width: 0; }
.near-cat { font-size: 12px; color: var(--pl-text-subtle); }
.near-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.near-d { display: grid; justify-items: end; gap: 1px; }
.near-d b { font: 500 12px var(--pl-font-mono); }
.near-d span { display: inline-flex; align-items: center; gap: 3px; font: 400 11px var(--pl-font-mono); color: var(--pl-text-subtle); white-space: nowrap; }
.near-btn { margin-bottom: 4px; }
.report-btn { width: 100%; height: 40px; margin-top: 16px; }
.report-btn + .note-small { margin-top: 8px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  #app { --left-w: 300px; --right-w: 320px; }
  #app.wide-right { --right-w: 420px; }
  .head-stats .badge:nth-child(n+2), .brand-sub { display: none; }
}
@media (max-width: 760px) {
  #app { grid-template-columns: 0 1fr 0; }
  #app aside { position: fixed; top: var(--pl-header-height); bottom: 0; width: 100vw; display: none; }
  #app #left { left: 0; } #app #right { right: 0; }
  #app:not(.left-closed) #left, #app:not(.right-closed) #right { display: flex; }
  .head-stats, .head-sep, .brand-sep, .brand-name { display: none; }
  header { gap: 10px; padding: 0 12px; }
  .seg > button { padding: 5px 8px; }
}

/* ---------------------------------------------------------------- nearest-facility pins + tooltip */
.fac-pin { width: 28px; height: 34px; cursor: pointer; filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.45)); }
.fac-pin-head {
  position: absolute; left: 2px; top: 0; width: 24px; height: 24px; display: grid; place-items: center;
  background: var(--fc); color: #111d26; border: 1.5px solid #111d26; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  transition: transform var(--pl-duration-fast) var(--pl-ease);
}
.fac-pin-head svg { transform: rotate(45deg); }
.fac-pin:hover { z-index: 2; }
.fac-pin:hover .fac-pin-head { transform: rotate(-45deg) scale(1.18); }
.fac-tip .maplibregl-popup-content {
  background: var(--pl-surface-raised); color: var(--pl-text); border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius-md); box-shadow: var(--pl-shadow-panel); padding: 10px 12px; font: 12px/1.4 var(--pl-font-sans);
}
.fac-tip .maplibregl-popup-tip { border-top-color: var(--pl-border); }
.fac-tip-cat { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--pl-text-muted); }
.fac-tip-cat i { width: 8px; height: 8px; border-radius: 50%; background: var(--fc); }
.fac-tip-name { font-size: 13px; font-weight: 600; margin: 2px 0 6px; }
.fac-tip-meta { display: flex; align-items: baseline; gap: 10px; }
.fac-tip-meta b { font: 500 13px var(--pl-font-mono); }
.fac-tip-meta span { display: inline-flex; align-items: center; gap: 4px; color: var(--pl-text-muted); }
.fac-tip-row { margin-top: 4px; color: var(--pl-text-muted); }
.fac-tip-src { margin-top: 6px; font-size: 11px; color: var(--pl-text-subtle); }

/* ---------------------------------------------------------------- site screening option icons + hover explanations */
.chip .chip-ic { width: 14px; height: 14px; color: var(--pl-text-subtle); flex: none; }
.chip:hover .chip-ic { color: var(--pl-text-muted); }
.chip.on .chip-ic { display: none; }
.scr-checks .tl-check { grid-template-columns: 16px 16px 1fr; }
.scr-ic { display: grid; place-items: center; color: var(--pl-text-subtle); }
.tl-check:hover .scr-ic, .tl-check:has(input:checked) .scr-ic { color: var(--pl-accent); }
.has-info { cursor: help; text-decoration: underline dotted color-mix(in srgb, currentColor 50%, transparent); text-underline-offset: 3px; }
.info-tip {
  position: fixed; z-index: 1000; max-width: 280px; padding: 10px 12px; pointer-events: none;
  background: var(--pl-surface-raised); color: var(--pl-text); border: 1px solid var(--pl-border-strong);
  border-radius: var(--pl-radius-md); box-shadow: var(--pl-shadow-panel); font: 12px/1.5 var(--pl-font-sans); text-transform: none; letter-spacing: normal;
}

/* ---------------------------------------------------------------- Assistant tab (chat) */
.chat-log { flex: 1; min-height: 0; overflow-y: auto; padding: 12px var(--pl-space-panel); display: flex; flex-direction: column; gap: 12px; }
.chat-empty { margin: auto 0; text-align: center; display: grid; justify-items: center; gap: 8px; padding: 24px 4px; }
.chat-empty h3 { margin: 4px 0 0; font-size: 15px; font-weight: 600; }
.chat-empty p { margin: 0; color: var(--pl-text-muted); font-size: 13px; max-width: 290px; }
.chat-empty .sicon { color: var(--pl-accent); }
.chat-sugg { display: grid; gap: 8px; margin-top: 8px; width: 100%; }
.chat-sugg .chip { justify-content: flex-start; text-align: left; white-space: normal; height: auto; padding: 8px 12px; line-height: 1.35; }
.msg { display: grid; gap: 6px; max-width: 100%; }
.msg.user { justify-items: end; }
.msg .bubble { font-size: 13px; line-height: 1.5; border-radius: var(--pl-radius-lg); padding: 8px 12px; max-width: 92%; overflow-wrap: anywhere; }
.msg.user .bubble { background: var(--pl-accent-soft); border: 1px solid color-mix(in srgb, var(--pl-accent) 30%, transparent); white-space: pre-wrap; }
.msg.bot .bubble { background: var(--pl-surface-raised); border: 1px solid var(--pl-border); }
.msg.bot .bubble p { margin: 0 0 6px; }
.msg.bot .bubble p:last-child { margin-bottom: 0; }
.msg.bot .bubble ul, .msg.bot .bubble ol { margin: 4px 0 6px; padding-left: 18px; }
.msg.bot .bubble li { margin: 2px 0; }
.msg.bot .bubble code { font: 12px var(--pl-font-mono); background: var(--pl-surface-sunken); padding: 0 4px; border-radius: var(--pl-radius-xs); }
.msg.error .bubble { display: flex; gap: 8px; align-items: flex-start; border-color: color-mix(in srgb, var(--pl-status-danger) 50%, transparent); color: var(--pl-text); }
.msg.error .bubble svg { color: var(--pl-status-danger); flex: none; margin-top: 2px; }
.msg-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.msg-actions .chip svg { width: 14px; height: 14px; color: var(--pl-accent); }
.msg-meta { font: 11px var(--pl-font-mono); color: var(--pl-text-subtle); }
.typing { display: inline-flex; gap: 4px; padding: 12px 14px !important; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--pl-text-muted); animation: typing 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .typing i { animation: none; opacity: 0.6; } }
.chat-compose { flex: none; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; padding: 10px var(--pl-space-panel) 6px; border-top: 1px solid var(--pl-border); }
.chat-compose textarea {
  resize: none; min-height: 40px; max-height: 140px; padding: 9px 12px; font: 13px/1.4 var(--pl-font-sans); color: var(--pl-text);
  background: var(--pl-surface-sunken); border: 1px solid var(--pl-border); border-radius: var(--pl-radius-md);
}
.chat-compose textarea:focus { outline: none; border-color: var(--pl-accent); }
.chat-send { height: 40px; width: 40px; padding: 0; justify-content: center; }
.chat-foot { flex: none; padding: 0 var(--pl-space-panel) 10px; font-size: 11px; line-height: 1.4; color: var(--pl-text-subtle); }

/* ---------------------------------------------------------------- 3D: style toggle + floating building label */
.ctrl-3d .ctrl-style { color: var(--pl-text-muted); }
.ctrl-3d .ctrl-style[hidden] { display: none; }
.ctrl-3d .ctrl-style svg { width: 16px; height: 16px; }
/* positioned by JS at the roof point: the pin sits just above it, the text block above the pin */
.bldg-label { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 2; pointer-events: none; will-change: transform; }
.bldg-label .bl-card { position: absolute; left: 0; bottom: 44px; translate: -50% 0; width: max-content; max-width: 260px; text-align: left;
  color: #fff; text-shadow: 0 1px 3px rgb(0 0 0 / 0.85), 0 0 12px rgb(0 0 0 / 0.6); }
.bl-k { display: block; font: 500 10px/1.2 var(--pl-font-mono); letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.8; }
.bl-name { font: 700 18px/1.15 var(--pl-font-sans); letter-spacing: 0.01em; text-transform: uppercase; margin: 2px 0 6px; }
.bl-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.bl-facts div { display: grid; }
.bl-facts span { font: 500 10px/1.2 var(--pl-font-mono); letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.75; }
.bl-facts b { font: 600 15px/1.25 var(--pl-font-sans); }
.bl-pin { position: absolute; left: 0; bottom: 8px; translate: -50% 0; width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 50%; background: #0c151c; color: #fff; border: 2px solid #fff; box-shadow: 0 0 0 3px rgb(255 255 255 / 0.18), 0 2px 6px rgb(0 0 0 / 0.5); }
.bl-pin::after { content: ""; position: absolute; top: 100%; left: 50%; width: 2px; height: 6px; translate: -50% 0; background: #fff; }
.bl-pin svg { width: 14px; height: 14px; }

/* Facility pins in the holographic 3D style: a glowing badge raised on a stem, name above (body.holo-3d) */
.fac-pin-label { display: none; }
.holo-3d .fac-pin { width: 28px; height: 78px; filter: none; }
.holo-3d .fac-pin-head {
  left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; transform: none;
  background: color-mix(in srgb, var(--fc) 28%, #0c151c); color: var(--fc); border: 2px solid var(--fc);
  box-shadow: 0 0 10px color-mix(in srgb, var(--fc) 70%, transparent), inset 0 0 6px color-mix(in srgb, var(--fc) 40%, transparent);
}
.holo-3d .fac-pin-head svg { transform: none; }
.holo-3d .fac-pin:hover .fac-pin-head { transform: scale(1.15); }
.holo-3d .fac-pin::before {  /* stem */
  content: ""; position: absolute; left: 13px; top: 28px; bottom: 2px; width: 2px;
  background: linear-gradient(var(--fc), color-mix(in srgb, var(--fc) 35%, transparent)); box-shadow: 0 0 6px var(--fc);
}
.holo-3d .fac-pin::after {  /* ground contact */
  content: ""; position: absolute; left: 9px; bottom: 0; width: 10px; height: 4px; border-radius: 50%;
  background: var(--fc); opacity: 0.8; box-shadow: 0 0 8px var(--fc);
}
.holo-3d .fac-pin-label {
  display: block; position: absolute; left: 14px; bottom: calc(100% + 4px); translate: -50% 0; max-width: 200px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fc);
  font: 700 11px/1.2 var(--pl-font-sans); letter-spacing: 0.04em; text-transform: uppercase;
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.9), 0 0 8px rgb(0 0 0 / 0.7);
}
.holo-3d .fac-pin:hover { z-index: 3; }
