:root {
  color-scheme: dark;
  --bg: #0a0c0f;
  --card: #14181d;
  --card-2: #1b2027;
  --line: #232a33;
  --text: #f2f5f8;
  --muted: #8b97a5;
  --red: #e82127;
  --green: #33d17a;
  --amber: #e6a532;
}
* { box-sizing: border-box; }
/* any author display rule below would otherwise override the hidden attribute */
[hidden] { display: none !important; }

body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, system-ui, "SF Pro Text", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.pane {
  max-width: 480px; margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(104px + env(safe-area-inset-bottom));
}
#login-view { padding-bottom: 24px; }

.brand { text-align: center; font-weight: 700; font-size: 1.05rem; margin: 4px 0 18px; }
.brand span { color: var(--red); }

.muted { color: var(--muted); }
.small { font-size: .8rem; }
.center { text-align: center; }
.big { font-size: 1.6rem; }
.screen-title { font-size: 1.35rem; margin: 6px 0 4px; }
.screen-title::after { content: ''; display: block; width: 34px; height: 3px;
  background: var(--red); border-radius: 2px; margin-top: 8px; }
.screen-sub { margin: 10px 0 16px; }
.card-title { color: var(--muted); font-size: .78rem; text-transform: uppercase;
  letter-spacing: .08em; margin: 22px 0 8px; }
.card-title.flush { margin: 0 0 10px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; margin-bottom: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; }

.vehicle { display: flex; align-items: center; gap: 14px; }
.car { width: 104px; height: 42px; flex: none; }
.vehicle-meta h2 { margin: 0; font-size: 1.35rem; line-height: 1.15; }
.vehicle-meta p { margin: 2px 0 8px; font-size: .85rem; }
.badge { display: inline-block; background: var(--card-2); color: var(--muted);
  border-radius: 999px; padding: 3px 10px; font-size: .72rem; letter-spacing: .06em; }

.hero { text-align: center; padding: 22px 0 10px; }
.ring {
  width: 150px; height: 150px; margin: 0 auto 18px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 50%, transparent 34%,
    var(--ring-color, #3a4450) 35% 63%, transparent 64%);
  -webkit-mask-image: repeating-conic-gradient(#000 0 3deg, transparent 3deg 6deg);
  mask-image: repeating-conic-gradient(#000 0 3deg, transparent 3deg 6deg);
}
.ring-core { width: 46px; height: 46px; border-radius: 50%; background: var(--bg); display: block; }
.hero h1 { margin: 0; font-size: 2rem; letter-spacing: -.5px; color: var(--state-color, var(--text)); }
.state-sub { margin: 4px 0 2px; color: var(--state-color, var(--muted)); font-size: .95rem; }

.event-row { display: flex; align-items: center; gap: 10px; }
.dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(230,165,50,.16); color: var(--amber); font-weight: 700; font-size: .85rem; flex: none; }
.event-row span:nth-child(2) { flex: 1; font-weight: 600; }

.banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 12px;
  border-radius: 16px; background: rgba(51,209,122,.10); border: 1px solid rgba(51,209,122,.35); }
.banner.warn { background: rgba(232,33,39,.10); border-color: rgba(232,33,39,.4); }
.banner-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: var(--green); color: #05210f; font-weight: 800; flex: none; }
.banner.warn .banner-icon { background: var(--red); color: #fff; }
.banner b { display: block; font-size: 1rem; }
.banner p { margin: 2px 0 0; }

.battery-card { display: flex; align-items: center; gap: 18px; }
.gauge { width: 96px; height: 96px; flex: none; }
.battery-card p { margin: 4px 0 0; }

.pill { background: rgba(51,209,122,.16); color: var(--green); border-radius: 999px;
  padding: 4px 12px; font-size: .78rem; font-weight: 600; }
.pill.warn { background: rgba(232,33,39,.16); color: var(--red); }
.check { margin: 8px 0 0; font-size: .9rem; }
.check.ok { color: var(--text); }
.check::before { content: '○ '; color: var(--muted); }
.check.ok::before { content: '✓ '; color: var(--green); }

.temps { display: flex; align-items: center; text-align: center; }
.temps > div { flex: 1; }
.temps p { margin: 2px 0 0; }
.divider { width: 1px; align-self: stretch; background: var(--line); flex: none; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { background: var(--card-2); border-radius: 14px; padding: 14px; display: grid; gap: 4px; }
.stat b { font-size: 1.25rem; }

.chips { display: flex; gap: 8px; margin-bottom: 14px; }
.chip { flex: 1; padding: 10px 8px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--muted); font-size: .85rem; font-weight: 600;
  width: auto; margin: 0; }
.chip.is-active { background: var(--card-2); color: var(--text); }

.day { color: var(--muted); font-size: .82rem; margin: 18px 0 8px; }
.day:first-child { margin-top: 0; }
.log { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 6px 14px; }
.log-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.log-row + .log-row { border-top: 1px solid var(--line); }
.log-icon { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center;
  font-size: .9rem; flex: none; }
.log-icon.aware { background: rgba(230,165,50,.16); color: var(--amber); }
.log-icon.panic { background: rgba(232,33,39,.16); color: var(--red); }
.log-icon.armed { background: rgba(51,209,122,.16); color: var(--green); }
.log-main { flex: 1; }
.log-main b { display: block; font-size: .95rem; font-weight: 600; }
.log-main span { color: var(--muted); font-size: .78rem; }

button { font-family: inherit; font-size: 1rem; border: 0; border-radius: 14px;
  width: 100%; padding: 15px; margin: 10px 0 0; cursor: pointer; }
button.primary { background: var(--red); color: #fff; font-weight: 600; }
button.ghost { background: var(--card-2); color: var(--text); border: 1px solid var(--line); }

input { width: 100%; padding: 15px; margin: 10px 0; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card); color: inherit; font-size: 1rem; }

.tabs {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex; gap: 2px; padding: 6px;
  background: rgba(27,32,39,.94); backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: 999px;
}
.tabs .tab { width: auto; margin: 0; padding: 10px 14px; border-radius: 999px;
  background: transparent; color: var(--muted); font-size: .82rem; font-weight: 600; }
.tabs .tab.is-active { background: var(--card); color: var(--text); }
