:root {
  --bg: #e3ecd6; --hud-bg: rgba(255, 255, 255, 0.94); --fg: #26323d; --muted: #6b7885;
  --ring: #fff; --shadow: rgba(30, 50, 40, 0.18); --btn-bg: rgba(38, 50, 61, 0.08); --line: rgba(38, 50, 61, 0.12);
}
:root[data-theme="dark"] {
  --bg: #1c2430; --hud-bg: rgba(28, 36, 48, 0.96); --fg: #e4ebf2; --muted: #8fa0b2;
  --ring: #1c2430; --shadow: rgba(0, 0, 0, 0.5); --btn-bg: rgba(255, 255, 255, 0.1); --line: rgba(255, 255, 255, 0.12);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--fg); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif; }

#app { display: grid; grid-template-columns: 360px 1fr; height: 100%; }
#map { min-width: 0; min-height: 0; }
#panel { background: var(--hud-bg); display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); z-index: 2; box-shadow: 4px 0 24px var(--shadow); }
.p-head, .p-filters, #list-meta, #foot { padding-left: 16px; padding-right: 16px; }

.p-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; }
.p-head b { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
#theme-toggle { border: 0; border-radius: 8px; background: var(--btn-bg); color: var(--fg); cursor: pointer; font: inherit; font-size: 12px; padding: 4px 10px; }

#auth-area { margin: 8px 16px 0; padding: 8px 0 0; }

.p-filters { padding-top: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
#q { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font: inherit; background: var(--btn-bg); color: var(--fg); }
#q:focus, select:focus { outline: 2px solid #30a46c; outline-offset: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--fg);
        font: inherit; font-size: 12px; padding: 3px 10px 3px 8px; cursor: pointer; }
.chip[aria-pressed="false"] { opacity: 0.45; }
.chip .dot, .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; box-shadow: 0 0 0 2px var(--ring); }
.chip .n { color: var(--muted); }
.selects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
select { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 6px 4px; font: inherit; font-size: 12px; background: var(--btn-bg); color: var(--fg); }

#list-meta { padding-top: 8px; padding-bottom: 6px; font-size: 12px; color: var(--muted); }
#list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; }
#list li { display: flex; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
#list li:hover, #list li:focus { background: var(--btn-bg); outline: none; }
#list li .dot { margin-top: 5px; }
#list .t { font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#list .s { font-size: 11px; color: var(--muted); margin-top: 2px; }
#list .empty { cursor: default; color: var(--muted); font-size: 13px; }

#foot { border-top: 1px solid var(--line); padding-top: 10px; padding-bottom: 12px; font-size: 12px; color: var(--muted); line-height: 1.5; }
#foot details summary { cursor: pointer; color: var(--fg); }
#foot details p { margin: 6px 0 0; }
#demo-note { display: none; color: #b4442f; margin-bottom: 6px; font-weight: 600; }
:root[data-theme="dark"] #demo-note { color: #f08a74; }
#err { display: none; margin: 10px 16px 0; color: #e5484d; font-size: 13px; }

@media (max-width: 760px) {
  #app { grid-template-columns: 1fr; grid-template-rows: 46% 54%; }
  #panel { grid-row: 2; border-right: 0; border-top: 1px solid var(--line); box-shadow: 0 -4px 24px var(--shadow); }
  #map { grid-row: 1; }
}
