:root {
  --bg: #f6f8f6;
  --panel: #ffffff;
  --text: #17231c;
  --muted: #5f7367;
  --line: #dfe6e1;
  --accent: #2e7d32;
  --row-hover: #eef4ef;
  --hint: #fff8e1;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121a16;
    --panel: #1b2620;
    --text: #e8f0ea;
    --muted: #9fb3a6;
    --line: #2b3a31;
    --accent: #66bb6a;
    --row-hover: #24332a;
    --hint: #2c2a1c;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }

.topbar {
  display: flex; align-items: center; gap: 16px;
  height: 56px; padding: 0 16px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.tabs { display: flex; gap: 4px; flex: 1; }
.tab { border: 0; background: none; color: var(--muted); padding: 8px 12px; border-radius: 6px; font: inherit; cursor: pointer; }
.tab.active { color: var(--text); background: var(--row-hover); font-weight: 600; }
.signin { border: 1px solid var(--line); background: none; color: var(--muted); border-radius: 6px; padding: 6px 12px; font: inherit; }

.layout { display: flex; height: calc(100% - 56px); }
#map { flex: 1; min-width: 0; }
.panel { width: 360px; max-width: 100%; overflow-y: auto; background: var(--panel); border-left: 1px solid var(--line); padding: 16px; }

.search { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; margin-bottom: 12px; }
.list { display: flex; flex-direction: column; gap: 6px; }
.row { text-align: left; border: 1px solid var(--line); background: none; color: inherit; border-radius: 8px; padding: 10px 12px; cursor: pointer; font: inherit; }
.row:hover { background: var(--row-hover); }
.row-title { font-weight: 600; }
.row-sub, .muted { color: var(--muted); }
.small { font-size: 13px; }
.detail h2 { margin: 8px 0 4px; }
.detail h3 { margin: 16px 0 4px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.hint { background: var(--hint); border-left: 4px solid #ffb300; padding: 8px 12px; border-radius: 4px; }
.back { border: 0; background: none; color: var(--accent); font: inherit; padding: 0; cursor: pointer; }
.path { padding-left: 20px; margin: 4px 0; }
.error { color: #c62828; }

.sample-banner {
  position: fixed; left: 16px; bottom: 16px;
  background: #ffb300; color: #1b1b1b; font-weight: 600;
  padding: 6px 12px; border-radius: 16px; font-size: 13px;
}

@media (max-width: 720px) {
  .layout { flex-direction: column; }
  #map { flex: none; height: 50vh; }
  .panel { width: 100%; border-left: 0; border-top: 1px solid var(--line); flex: 1; }
  .signin { padding: 6px 10px; }
}

/* Account panel */
.stack { display: flex; flex-direction: column; gap: 10px; }
.primary { background: #c8572a; color: #fff; border: 0; border-radius: 2px; padding: 12px 16px; font: 600 15px system-ui, sans-serif; cursor: pointer; }
.primary:disabled { opacity: 0.6; cursor: default; }
.signin:not(:disabled) { cursor: pointer; color: var(--text); }
.link-btn { border: 0; background: none; color: var(--accent); font: inherit; padding: 6px 0; cursor: pointer; text-align: left; }
.pair-code { margin: 12px 0; }
.pair-code-value { font: 700 40px ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: 0.12em; }
.pair-code-value.expired { text-decoration: line-through; opacity: 0.5; }
.device-row { display: grid; grid-template-columns: 1fr auto; cursor: default; }
.device-row .row-sub { grid-column: 1; }
.device-row .link-btn { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.field { display: flex; flex-direction: column; gap: 4px; }
textarea.search, select.search { font: inherit; margin-bottom: 0; }
