:root { --bg: #14161a; --card: #1d2026; --line: #3a3f47; --txt: #e8e2d0; --dim: #9a937f; --acc: #ff5d3a; --gold: #ffd23a; --ok: #3fae5a; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--txt); }
#map { position: fixed; inset: 0; }
#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px; padding: 10px 14px;
  background: rgba(20,22,26,.94); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; } .dim { color: var(--dim); font-size: 12px; }
.tabs { display: flex; gap: 6px; }
.tab, .skins button {
  background: #262a31; color: var(--txt); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 12px; cursor: pointer; font-size: 13px;
}
.tab.active, .skins button.active { border-color: var(--acc); background: #33231e; }
.skins { margin-left: auto; display: flex; gap: 6px; }
.tabpane { display: none; }
.tabpane.active { display: block; }
#drive-panel {
  position: fixed; left: 12px; top: 64px; z-index: 15; width: 340px; max-height: calc(100vh - 120px);
  overflow-y: auto; background: rgba(20,22,26,.94); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px;
}
.tabpane.full {
  position: fixed; left: 12px; right: 12px; top: 64px; bottom: 44px; z-index: 15;
  overflow-y: auto; background: rgba(20,22,26,.97); border: 1px solid var(--line);
  border-radius: 12px; padding: 18px;
}
h2 { margin: 0 0 6px; font-size: 18px; } h3 { margin: 14px 0 6px; font-size: 14px; } h4 { margin: 10px 0 4px; font-size: 13px; }
.big { width: 100%; padding: 12px; font-size: 15px; border-radius: 10px; border: 1px solid var(--acc); background: #3a241d; color: var(--txt); cursor: pointer; }
#progress { height: 6px; background: #262a31; border-radius: 3px; margin: 10px 0; overflow: hidden; }
#progress-fill { height: 100%; width: 0; background: var(--acc); transition: width .3s; }
#event-feed { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.feed-item { font-size: 12.5px; background: #23262d; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; }
.feed-item .t { color: var(--dim); font-size: 11px; margin-right: 6px; }
.feed-item.scout { border-color: #7a2e1d; } .feed-item.loved { border-color: #6b5a1e; }
.feed-item.ok { border-color: var(--ok); } .feed-item.warn { border-color: #b98a1e; }
#badge {
  position: fixed; left: 12px; bottom: 10px; z-index: 20; font-size: 11.5px; color: var(--dim);
  background: rgba(20,22,26,.94); border: 1px solid var(--line); padding: 6px 10px; border-radius: 6px;
}
.toast {
  position: fixed; bottom: 56px; left: 50%; transform: translateX(-50%); z-index: 99;
  background: #2a2e36; border: 1px solid var(--line); color: var(--txt);
  padding: 10px 16px; border-radius: 10px; font-size: 13px; max-width: 80vw;
}
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.card.danger { border-color: #7a2e1d; }
.panel-head { margin-bottom: 12px; }
.sim-note { font-size: 12.5px; color: var(--dim); }
.tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 20px; background: #2a2e36; border: 1px solid var(--line); margin: 1px 2px; }
.tag.ok { border-color: var(--ok); color: #8fd6a4; } .tag.warn { border-color: #b98a1e; color: #ffd23a; } .tag.sim { border-color: #4a6fa5; color: #9cc3ff; }
.voice-row, .line-row { padding: 8px 0; border-top: 1px solid var(--line); }
.line-ev { font-size: 12px; color: var(--gold); margin-bottom: 4px; }
input, select { width: 100%; margin: 4px 0 8px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: #262a31; color: var(--txt); font-size: 13px; }
button { background: #2a2e36; color: var(--txt); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; cursor: pointer; font-size: 13px; margin: 2px; }
button:hover { border-color: var(--acc); }
button.ghost { opacity: .7; } .row-btns { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.switch-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; }
.switch-row input { width: auto; }
.script li { margin-bottom: 6px; }
.score { font-size: 34px; font-weight: 800; color: var(--gold); }
.score small { font-size: 13px; color: var(--dim); font-weight: 400; }
.events { font-size: 12.5px; padding-left: 18px; } .events li { margin-bottom: 4px; }
.panic-btn { background: #5a1d12; border: 2px solid #ff5d3a; font-weight: 800; padding: 14px 26px; font-size: 16px; border-radius: 12px; }
body[data-uitheme="light"] { --bg: #f4efe4; --card: #fffdf6; --line: #d8d0ba; --txt: #2b2620; --dim: #8a8172; }
body[data-uitheme="light"] #topbar, body[data-uitheme="light"] #drive-panel,
body[data-uitheme="light"] .tabpane.full, body[data-uitheme="light"] #badge,
body[data-uitheme="light"] .toast { background: rgba(244,239,228,.96); }
body[data-uitheme="light"] .tab, body[data-uitheme="light"] .skins button,
body[data-uitheme="light"] button { background: #efe8d6; }
body[data-uitheme="light"] input, body[data-uitheme="light"] select { background: #fffdf6; }
body[data-uitheme="light"] .feed-item, body[data-uitheme="light"] .card { background: #fffdf6; }
