/* BYD Monitor — tema escuro, mobile-first (estilo app de carro elétrico) */

:root {
  color-scheme: dark;
  --bg: #070b14;
  --line: rgba(148, 163, 184, .14);
  --line-strong: rgba(148, 163, 184, .26);
  --ink: #eef2f8;
  --muted: #8fa0b8;
  --accent: #2dd4bf;
  --accent-2: #38bdf8;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --radius: 18px;
  --shadow: 0 12px 32px rgba(2, 6, 23, .5);
}

* { box-sizing: border-box; }

[x-cloak] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(640px 320px at 12% -6%, rgba(45, 212, 191, .13), transparent 70%),
    radial-gradient(720px 360px at 92% -4%, rgba(56, 189, 248, .10), transparent 70%);
}

::selection { background: rgba(45, 212, 191, .35); }

main { max-width: 1060px; margin: 0 auto; padding: 14px 14px 34px; }

:focus-visible { outline: 2px solid rgba(45, 212, 191, .65); outline-offset: 2px; }

/* --- topo ---------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top));
  background: rgba(7, 11, 20, .78);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; letter-spacing: .2px; }
.brand svg { color: var(--accent); filter: drop-shadow(0 0 9px rgba(45, 212, 191, .55)); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .7px;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.badge-mock { background: rgba(251, 191, 36, .13); color: #fcd34d; border: 1px solid rgba(251, 191, 36, .25); }
.badge-real { background: rgba(52, 211, 153, .12); color: #6ee7b7; border: 1px solid rgba(52, 211, 153, .25); }

/* --- chave de acesso ------------------------------------------------ */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 7, 14, .66);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.keycard {
  width: 100%;
  max-width: 390px;
  background: linear-gradient(180deg, #101a2f, #0c1322);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 24px 60px rgba(2, 6, 23, .7);
}
.keycard h2 { margin: 0 0 8px; font-size: 18px; }
.keycard p { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; }
.keycard code { background: rgba(148, 163, 184, .12); padding: 2px 6px; border-radius: 6px; font-size: 12.5px; color: #cbd5e1; }
.keycard input {
  width: 100%;
  padding: 12px 13px;
  margin-bottom: 12px;
  background: rgba(7, 11, 20, .7);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--ink);
  font: inherit;
}
.keycard input::placeholder { color: #5b6b85; }
.keycard input:focus {
  outline: none;
  border-color: rgba(45, 212, 191, .55);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, .15);
}

/* --- erros, botões e chips ------------------------------------------ */

.error {
  margin: 12px 0;
  padding: 11px 15px;
  border-radius: 12px;
  background: rgba(248, 113, 113, .1);
  border: 1px solid rgba(248, 113, 113, .25);
  color: #fca5a5;
  font-size: 13.5px;
}

.btn {
  font: inherit;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: rgba(148, 163, 184, .08);
  color: var(--ink);
  cursor: pointer;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: border-color .15s ease, color .15s ease, background .15s ease,
              box-shadow .15s ease, filter .15s ease, transform .08s ease;
}
.btn:hover:not(:disabled) { border-color: rgba(45, 212, 191, .55); color: #5eead4; background: rgba(45, 212, 191, .08); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, #14b8a6, #0ea5e9);
  border: none;
  color: #fff;
  box-shadow: 0 8px 22px rgba(20, 184, 166, .35);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #14b8a6, #0ea5e9);
  color: #fff;
  filter: brightness(1.08);
}
.btn-danger { background: rgba(248, 113, 113, .07); border-color: rgba(248, 113, 113, .3); color: #fca5a5; }
.btn-danger:hover:not(:disabled) {
  background: rgba(248, 113, 113, .13);
  border-color: rgba(248, 113, 113, .5);
  color: #fecaca;
}
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover:not(:disabled) { color: #5eead4; background: rgba(45, 212, 191, .08); }
.btn-seg { padding: 6px 13px; min-height: 34px; font-size: 13px; border-radius: 999px; background: rgba(148, 163, 184, .08); white-space: nowrap; }
.btn-seg.active {
  background: linear-gradient(135deg, #14b8a6, #0ea5e9);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(20, 184, 166, .35);
}
.btn-seg.active:hover:not(:disabled) {
  background: linear-gradient(135deg, #14b8a6, #0ea5e9);
  color: #fff;
}
.btn-row { display: flex; gap: 10px; margin-top: 12px; }
.btn-row .btn { flex: 1; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 650;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}
.chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.chip svg { margin-left: -2px; }
.chip svg + span { margin-left: -1px; }
.chip-charge { background: rgba(56, 189, 248, .13); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, .22); }
.chip-drive { background: rgba(251, 191, 36, .13); color: #fcd34d; border: 1px solid rgba(251, 191, 36, .22); }
.chip-idle { background: rgba(148, 163, 184, .1); color: #b6c2d6; border: 1px solid rgba(148, 163, 184, .18); }
.chip-idle::before { box-shadow: none; }
.chip-ok { background: rgba(52, 211, 153, .13); color: #6ee7b7; border: 1px solid rgba(52, 211, 153, .22); }
.chip-alert { background: rgba(248, 113, 113, .14); color: #fca5a5; border: 1px solid rgba(248, 113, 113, .26); }
.chip-locked, .chip-unlocked {
  background: rgba(9, 14, 26, .72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line-strong);
  color: #cbd5e1;
}
.chip-locked::before, .chip-unlocked::before { content: none; }
.chip-unlocked { color: #fcd34d; border-color: rgba(251, 191, 36, .3); }

/* --- cards / painéis ------------------------------------------------- */

.card {
  background: linear-gradient(180deg, #0e1627, #0b1220);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card h2 { margin: 0; font-size: 19px; letter-spacing: .2px; }
.plate { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 1.2px; font-variant-numeric: tabular-nums; }

.vehicle { margin-top: 14px; }
.vehicle-body { display: grid; gap: 14px; margin-top: 14px; }

/* --- velocímetro (por cima da foto; só entra no DOM em movimento) ---- */

.hero-speed {
  position: absolute;
  inset: 0;
  padding-top: 10px;
  z-index: 1; /* sob os chips (z-index 2), sobre a foto e o glow */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(70% 90% at 50% 50%, rgba(7, 11, 20, .88) 30%, rgba(7, 11, 20, .6) 62%, rgba(7, 11, 20, .1) 100%);
  animation: heroSpeedIn .35s ease;
}
@keyframes heroSpeedIn { from { opacity: 0; } to { opacity: 1; } }
.hero-speed svg { width: min(240px, 62%); height: auto; display: block; }
.speedo-arc-bg { fill: none; stroke: #1c2940; stroke-width: 10; stroke-linecap: round; }
.speedo-arc-val {
  fill: none; stroke: #2dd4bf; stroke-width: 10; stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(45, 212, 191, .4));
  transition: stroke-dasharray .9s cubic-bezier(.2, .7, .3, 1);
}
.speedo-needle {
  stroke: #2dd4bf; stroke-width: 4; stroke-linecap: round;
  transform-origin: 100px 100px;
  transition: transform .9s cubic-bezier(.2, .7, .3, 1);
}
.speedo-hub { fill: #2dd4bf; }
.speedo-num { text-align: center; margin-top: -4px; }
.speedo-num strong { font-size: 50px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.speedo-num span { color: var(--muted); font-size: 15px; font-weight: 600; margin-left: 5px; }

.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-title h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 15.5px;
  letter-spacing: .2px;
}
.card-title h3::before {
  content: "";
  width: 4px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #2dd4bf, #0ea5e9);
  box-shadow: 0 0 10px rgba(45, 212, 191, .5);
}

.divider { border-top: 1px solid var(--line); margin: 14px 0; }

.muted { color: var(--muted); font-size: 13px; }
.warn { color: var(--amber); font-weight: 650; }

/* --- hero (foto + pneus) -------------------------------------------- */

.hero { padding: 16px 16px 10px; overflow: hidden; }
.hero-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.hero-media { position: relative; margin-top: 4px; }
.hero-media img {
  position: relative;
  display: block;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  filter: drop-shadow(0 20px 30px rgba(2, 6, 23, .6));
}
.hero-glow {
  position: absolute;
  inset: 14% 10% 6%;
  background: radial-gradient(58% 52% at 50% 60%, rgba(56, 189, 248, .17), transparent 72%);
  pointer-events: none;
}
.overlay-chip { position: absolute; z-index: 2; }
.overlay-chip.tl { top: 4px; left: 0; }
.overlay-chip.tr { top: 4px; right: 0; }
.overlay-chip::before { box-shadow: 0 0 8px currentColor; }
.chip-locked::before, .chip-unlocked::before { content: none; box-shadow: none; }

.tire-strip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(9, 14, 26, .74);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
}
.tire-strip .t { padding: 7px 4px 8px; text-align: center; border-left: 1px solid var(--line); }
.tire-strip .t:first-child { border-left: none; }
.tire-strip .k {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .7px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1px;
}
.tire-strip .v { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* --- bateria / combustível (anéis) ---------------------------------- */

.statgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat { text-align: center; padding: 16px 12px 14px; }

.ring { position: relative; width: 112px; height: 112px; margin: 0 auto; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.ring circle { fill: none; stroke-width: 9; }
.ring .ring-bg { stroke: rgba(148, 163, 184, .14); }
.ring .ring-val {
  stroke: var(--ring, #34d399);
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px var(--ring, #34d399));
  transition: stroke-dasharray .7s cubic-bezier(.22, .61, .36, 1);
}
.ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  padding-top: 40px;
  gap: 2px;
}
.ring-label strong { font-size: 27px; font-weight: 750; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.ring-label span { font-size: 13px; color: var(--muted); }

.stat .cap { margin-top: 10px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.stat .cap strong { color: var(--ink); font-size: 14px; }
.stat-note {
  margin-top: 8px;
  font-size: 12px;
  color: #7dd3fc;
  background: rgba(56, 189, 248, .1);
  border: 1px solid rgba(56, 189, 248, .2);
  border-radius: 9px;
  padding: 5px 8px;
  display: inline-block;
}

/* --- consumo --------------------------------------------------------- */

.energy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.eg .k {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .9px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.eg .big { font-size: 21px; font-weight: 750; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.eg .sub { margin-top: 2px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.bars { position: relative; display: flex; align-items: flex-end; gap: 6px; height: 74px; padding-top: 8px; }
.bar-col { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.bar-v {
  width: 100%;
  min-height: 3px;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #2dd4bf, #0ea5e9);
  box-shadow: 0 0 10px rgba(45, 212, 191, .25);
  transition: height .5s ease;
}
.bar-ref { position: absolute; left: 0; right: 0; border-top: 1.5px dashed rgba(251, 191, 36, .55); }
.bars-cap { margin: 8px 0 0; font-size: 12px; }

/* --- climatização ----------------------------------------------------- */

.climate-info { margin-bottom: 12px; }

.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(148, 163, 184, .06);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 8px;
}
.st-btn {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(148, 163, 184, .08);
  color: var(--ink);
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .08s ease;
}
.st-btn:hover:not(:disabled) { border-color: rgba(45, 212, 191, .55); background: rgba(45, 212, 191, .09); }
.st-btn:active:not(:disabled) { transform: scale(.96); }
.st-btn:disabled { opacity: .35; cursor: not-allowed; }
.st-temp { display: flex; align-items: baseline; gap: 3px; }
.st-temp strong { font-size: 32px; font-weight: 760; letter-spacing: -.8px; font-variant-numeric: tabular-nums; }
.st-temp span { font-size: 14px; color: var(--muted); }
.st-range { margin: 7px 0 0; font-size: 11.5px; text-align: center; }

.dur-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.dur-row > .muted { min-width: 56px; }
.segctl {
  display: flex;
  gap: 4px;
  background: rgba(148, 163, 184, .08);
  border-radius: 11px;
  padding: 3px;
  flex: 1;
}
.segctl button {
  flex: 1;
  padding: 7px 4px;
  min-height: 36px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
}
.segctl button:hover:not(:disabled):not(.active) { color: #5eead4; }
.segctl button.active {
  background: linear-gradient(135deg, #14b8a6, #0ea5e9);
  color: #fff;
  box-shadow: 0 3px 10px rgba(20, 184, 166, .3);
}
.segctl button:disabled { opacity: .4; cursor: not-allowed; }
.segctl.dur { max-width: 300px; }

.seat-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.seat-label { font-size: 12.5px; color: var(--muted); min-width: 148px; }

/* --- comandos --------------------------------------------------------- */

.cmdgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cmdbtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 13px 8px;
  min-height: 84px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(148, 163, 184, .07);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .08s ease;
}
.cmdbtn svg { width: 24px; height: 24px; color: var(--accent); }
.cmdbtn:hover:not(:disabled) { border-color: rgba(45, 212, 191, .55); background: rgba(45, 212, 191, .08); }
.cmdbtn:active:not(:disabled) { transform: translateY(1px); }
.cmdbtn:disabled { opacity: .4; cursor: not-allowed; }
.cmdbtn.wide { grid-column: 1 / -1; flex-direction: row; min-height: 58px; gap: 10px; }
.cmdbtn.primary {
  background: linear-gradient(135deg, #14b8a6, #0ea5e9);
  border: none;
  color: #fff;
  box-shadow: 0 8px 22px rgba(20, 184, 166, .3);
}
.cmdbtn.primary svg { color: #fff; }
.cmdbtn.primary:hover:not(:disabled) { filter: brightness(1.08); background: linear-gradient(135deg, #14b8a6, #0ea5e9); }

/* --- estado ----------------------------------------------------------- */

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; font-size: 13.5px; }
.facts .k {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .9px;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.facts span:not(.k) { font-variant-numeric: tabular-nums; }

/* --- painel do mapa ---------------------------------------------------- */

.panel {
  background: linear-gradient(180deg, #0e1627, #0b1220);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 14px;
  box-shadow: var(--shadow);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 15.5px;
  letter-spacing: .2px;
}
.panel-head h3::before {
  content: "";
  width: 4px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #2dd4bf, #0ea5e9);
  box-shadow: 0 0 10px rgba(45, 212, 191, .5);
}
.segments { display: flex; gap: 6px; }
.trail-km { font-size: 12.5px; }

#map { height: 340px; border-radius: 13px; z-index: 1; border: 1px solid var(--line); }

/* Leaflet no escuro */
.leaflet-container { background: #0a101d; }
.leaflet-tile { filter: brightness(.78) saturate(.85); }
.leaflet-bar { border: 1px solid var(--line-strong) !important; box-shadow: 0 8px 20px rgba(2, 6, 23, .5) !important; }
.leaflet-bar a { background: #101a2f !important; color: #cbd5e1 !important; border-bottom: 1px solid var(--line) !important; }
.leaflet-bar a:hover { background: #16223b !important; color: #5eead4 !important; }
.leaflet-control-attribution { background: rgba(7, 11, 20, .75) !important; color: #64748b !important; }
.leaflet-control-attribution a { color: #94a3b8 !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: #101a2f;
  color: var(--ink);
  box-shadow: 0 12px 30px rgba(2, 6, 23, .6);
}
.leaflet-popup-content { margin: 12px 14px; font: inherit; }
.leaflet-container a.leaflet-popup-close-button { color: #94a3b8; }

.car-pin-wrap { background: none; border: none; }
.car-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  border: 2px solid rgba(255, 255, 255, .9);
  box-shadow: 0 2px 10px rgba(2, 6, 23, .6);
}

.stop-badge { background: none; border: none; }
.stop-badge span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #334155;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  border: 2px solid #0b1220;
  box-shadow: 0 0 6px rgba(0, 0, 0, .5);
}

/* filtro de dia (trajeto + paradas): calendário fixo + chips roláveis */
.daybar { display: flex; gap: 6px; margin-bottom: 10px; }
.daybar-chips {
  display: flex;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.daybar-chips::-webkit-scrollbar { display: none; }
.daybar-chips .btn-seg { flex: 0 0 auto; }
.day-input {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(148, 163, 184, .08);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  color-scheme: dark;
}
.day-input:focus { outline: none; border-color: #14b8a6; }

/* tabela de paradas abaixo do mapa */
.stops { margin-top: 14px; }
.stops-empty { margin: 0; font-size: 13px; }
.stops-group + .stops-group { margin-top: 16px; }
.stops h4 {
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--muted);
}
.stop-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #0e1627;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.stop-row:last-child { margin-bottom: 0; }
.stop-row:active { border-color: var(--line-strong); }
.stop-pin {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  background: #334155;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 700;
}
.stop-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stop-addr { font-weight: 600; overflow-wrap: anywhere; }
.stop-addr.pend { color: var(--muted); font-weight: 500; }
.stop-meta { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* --- rodapé + toasts ---------------------------------------------------- */

.foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.credit { font-size: 12px; }

.toasts {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(92vw, 420px);
  pointer-events: none;
}
.toast {
  padding: 12px 14px;
  border-radius: 13px;
  font-size: 13.5px;
  background: #101a2f;
  border: 1px solid var(--line-strong);
  box-shadow: 0 14px 34px rgba(2, 6, 23, .65);
  animation: toast-in .2s ease;
}
.toast.ok { border-color: rgba(52, 211, 153, .45); color: #a7f3d0; }
.toast.err { border-color: rgba(248, 113, 113, .45); color: #fca5a5; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* --- aba histórico ------------------------------------------------------ */

.tabs-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 2px; }
.tabs { flex: 1 1 168px; max-width: 340px; min-width: 0; margin: 0; }
.tabs-row .btn-swap { flex: 0 0 auto; }

.bars.dense { gap: 2px; height: 84px; }
.bar-v.gap { background: rgba(148, 163, 184, .16); box-shadow: none; }
.bar-v.fuel { background: linear-gradient(180deg, #fbbf24, #d97706); box-shadow: 0 0 10px rgba(251, 191, 36, .25); }
.bar-v.speed { background: linear-gradient(180deg, #a78bfa, #7c3aed); box-shadow: 0 0 10px rgba(167, 139, 250, .25); }
.bar-v.amber { background: linear-gradient(180deg, #fbbf24, #d97706); box-shadow: 0 0 10px rgba(251, 191, 36, .22); }
.bar-v.red { background: linear-gradient(180deg, #f87171, #dc2626); box-shadow: 0 0 10px rgba(248, 113, 113, .25); }

.hist-facts { margin-bottom: 2px; }
.price-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--muted);
}
.price-row label { display: flex; align-items: center; gap: 6px; }
.price-row input {
  width: 76px;
  padding: 7px 9px;
  background: rgba(7, 11, 20, .7);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.price-row input:focus {
  outline: none;
  border-color: rgba(45, 212, 191, .55);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, .15);
}
.zero-note { margin: 10px 0 0; }

.hist-body { display: grid; gap: 14px; margin-top: 14px; }

.lv-legend { margin: 10px 0 6px; font-size: 11.5px; }
.lv-bars { display: flex; gap: 2px; height: 46px; }
.lv-col { flex: 1; position: relative; }
.lv-track { position: absolute; inset: 0; background: rgba(148, 163, 184, .1); border-radius: 4px; }
.lv-range {
  position: absolute;
  left: 15%;
  right: 15%;
  min-height: 3px;
  border-radius: 4px;
  background: linear-gradient(180deg, #2dd4bf, #0ea5e9);
  box-shadow: 0 0 8px rgba(45, 212, 191, .25);
}
.lv-range.fuel { background: linear-gradient(180deg, #fbbf24, #d97706); box-shadow: 0 0 8px rgba(251, 191, 36, .22); }

.tire-row { display: grid; grid-template-columns: 106px 1fr; align-items: center; gap: 10px; margin-top: 10px; }
.tire-lab { font-size: 12.5px; color: var(--muted); }
.tire-bars { height: 44px; }

.hrow { display: flex; flex-direction: column; gap: 1px; padding: 9px 2px; border-top: 1px solid var(--line); }
.hrow-k { font-size: 11px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: var(--muted); }
.hrow-v { font-size: 13.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.hrow-sub { font-size: 12px; color: var(--muted); }
.hsub { font-size: 11px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase; margin: 10px 0 2px; }
.hsub-gap { margin-top: 16px; }

/* --- escolha do carro (tela inicial) ------------------------------------- */

.picker { margin-top: 14px; }
.pick-title { margin: 6px 0 4px; font-size: 20px; letter-spacing: .2px; }
.picker > .muted { display: block; margin: 0 0 14px; }
.pick-grid { display: grid; gap: 14px; }
.pick {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 14px 13px;
  background: linear-gradient(180deg, #0e1627, #0b1220);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .08s ease;
}
.pick:hover { border-color: rgba(45, 212, 191, .5); }
.pick:active { transform: translateY(1px); }
.pick-media {
  display: block;
  padding: 4px 6px 10px;
  border-radius: 13px;
  background: radial-gradient(64% 74% at 50% 62%, rgba(56, 189, 248, .14), transparent 72%);
}
.pick-media img {
  display: block;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  filter: drop-shadow(0 16px 24px rgba(2, 6, 23, .55));
}
.pick-body { display: block; padding: 2px 4px 0; }
.pick-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pick-name { font-size: 17px; letter-spacing: .2px; }
.pick-sub { display: block; margin-top: 3px; font-size: 12.5px; }
.pick-empty { margin-top: 14px; }

/* hora da última coleta no topo do hero */
.hero-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
/* botão "trocar carro" — fica junto às abas, visível nas duas */
.btn-swap { min-height: 36px; padding: 4px 12px; font-size: 13px; border-radius: 10px; }
.btn-swap svg { width: 15px; height: 15px; }

/* --- telas maiores ------------------------------------------------------ */

@media (min-width: 720px) {
  main { padding: 22px 20px 44px; }
  #map { height: 400px; }
  /* card do carro escolhido em largura cheia: seções em 2 colunas, como no
     painel pessoal */
  .vehicle-body { grid-template-columns: 1fr 1fr; align-items: start; }
  .vehicle-body > .statgrid { grid-column: 1 / -1; }
  .cmdgrid { grid-template-columns: repeat(4, 1fr); }
  .statgrid { grid-template-columns: 1fr 1fr; }
  .hist-body { grid-template-columns: 1fr 1fr; align-items: start; }
  .hist-body .span2 { grid-column: 1 / -1; }
  .pick-grid { grid-template-columns: 1fr 1fr; }
  .pick-name { font-size: 18px; }
}

/* ===================== app dos clientes (web-app) ===================== */

/* --- telas de entrada (auth / lgpd / onboarding) --------------------- */
.center-wrap {
  display: flex;
  justify-content: center;
  padding: 8vh 16px 40px;
}

.keycard { max-width: 420px; width: 100%; }
.keycard h2 { margin: 0 0 4px; font-size: 20px; }
.keycard p { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.keycard label { display: block; margin: 10px 0 2px; font-size: 13px; color: var(--muted); }
.keycard input,
.keycard select {
  width: 100%;
  margin-top: 4px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, .08);
  color: var(--ink);
  font: inherit;
}
.keycard input:focus { outline: none; border-color: var(--accent); }
.keycard .btn { width: 100%; margin-top: 16px; }

.auth-tabs { display: flex; gap: 6px; margin: 10px 0 6px; }
.auth-tabs button {
  flex: 1; padding: 9px 10px; border-radius: 12px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); font: inherit; cursor: pointer;
}
.auth-tabs button.active { background: rgba(45, 212, 191, .14); color: var(--ink); border-color: rgba(45, 212, 191, .5); }

.form-err { color: var(--red); font-size: 13px; min-height: 18px; margin: 10px 0 0; }
.form-ok { color: var(--green); font-size: 13px; min-height: 18px; margin: 10px 0 0; }

.notice {
  margin-top: 16px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid rgba(251, 191, 36, .35); background: rgba(251, 191, 36, .08);
  color: #fde68a; font-size: 13px; line-height: 1.45;
}

/* --- LGPD ------------------------------------------------------------- */
.lgpd { max-width: 760px; margin: 0 auto; padding: 24px 16px 120px; }
.lgpd h2 { margin: 0 0 6px; }
.lgpd-text {
  max-height: 52vh; overflow-y: auto; padding: 14px 16px; margin-top: 12px;
  border: 1px solid var(--line); border-radius: 14px;
  background: rgba(2, 6, 17, .5);
  font-size: 14px; line-height: 1.6; color: #cbd5e1;
}
.lgpd-text h1, .lgpd-text h2, .lgpd-text h3 { color: var(--ink); margin: 18px 0 6px; }
.lgpd-text h1 { font-size: 18px; } .lgpd-text h2 { font-size: 16px; } .lgpd-text h3 { font-size: 15px; }
.lgpd-text p { margin: 8px 0; }
.lgpd-text ul { margin: 8px 0; padding-left: 20px; }
.lgpd-text li { margin: 4px 0; }
.lgpd-text code { background: rgba(148,163,184,.15); border-radius: 6px; padding: 1px 5px; font-size: 12px; }
.lgpd-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 14px; flex-wrap: wrap;
}
.lgpd-actions .btn { width: auto; }

/* --- onboarding ------------------------------------------------------- */
.onb { max-width: 520px; margin: 0 auto; padding: 24px 16px 60px; }
.onb .card label { display: block; margin: 12px 0 2px; font-size: 13px; color: var(--muted); }
.onb .card input {
  width: 100%; margin-top: 4px; padding: 11px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(148, 163, 184, .08);
  color: var(--ink); font: inherit;
}
.onb .card input:focus { outline: none; border-color: var(--accent); }
.onb .btn { width: 100%; margin-top: 18px; }
.small { font-size: 12px; }

/* --- banner do trial -------------------------------------------------- */
.trial-bar {
  position: sticky; top: 0; z-index: 30;
  padding: 9px 16px; text-align: center; font-size: 13.5px; font-weight: 600;
  border-bottom: 1px solid var(--line); backdrop-filter: blur(8px);
}
.trial-bar.neutral { background: rgba(56, 189, 248, .13); color: #bae6fd; }
.trial-bar.amber   { background: rgba(251, 191, 36, .16); color: #fde68a; }
.trial-bar.red     { background: rgba(248, 113, 113, .18); color: #fecaca; }

/* --- dashboard -------------------------------------------------------- */
.dash { max-width: 960px; margin: 0 auto; padding: 18px 16px 90px; }
.dash-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
}
.dash-head h2 { margin: 0; font-size: 20px; }
.dash-head .muted { font-size: 13px; }
.veh-list { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 14px; }
.veh-list.blocked-blur > *, .hist.blocked-blur > * { filter: blur(7px) saturate(.7); pointer-events: none; user-select: none; }

.blocked-overlay {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(7, 11, 20, .55);
}
.blocked-card {
  max-width: 420px; width: 100%; text-align: center;
  padding: 28px 24px; border-radius: var(--radius);
  border: 1px solid var(--line); background: #0d1526;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.blocked-card h3 { margin: 0 0 8px; font-size: 20px; }
.blocked-card p { color: var(--muted); font-size: 14px; line-height: 1.5; }
.blocked-card .btn { margin-top: 14px; }

/* --- botão de suporte (fixo) ------------------------------------------ */
.support-fab {
  position: fixed; right: 16px; bottom: 16px; z-index: 50;
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04121a; font-weight: 700; font-size: 14px; text-decoration: none;
  box-shadow: 0 12px 30px rgba(45, 212, 191, .35);
}
.support-fab:hover { filter: brightness(1.06); }

/* --- modal ------------------------------------------------------------ */
.modal-card { max-width: 460px; width: 100%; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; margin-top: 0; }

/* --- diversos --------------------------------------------------------- */
.center { text-align: center; padding: 18vh 16px; }
.foot .btn { margin-left: auto; }
.topbar { flex-wrap: wrap; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-right .btn { padding: 6px 12px; }
/* banner do trial vive dentro do topbar (que já é sticky): sangra até as bordas */
.trial-bar { position: static; flex-basis: 100%; margin: 2px -16px -12px; border-bottom: none; }
