:root {
  --baia: #102033;
  --sombra: #173044;
  --laje: #f3eee4;
  --piloto: #e23b2f;
  --faixa: #f5c400;
  --orvalho: #7eb8c9;
  --mute: #8aa0b0;
  --line: rgba(243, 238, 228, 0.14);
  --glass: rgba(16, 32, 51, 0.82);
  --ok: var(--orvalho);
  --band: var(--faixa);
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  background: #102033;
  color: var(--laje);
  font-family: Overpass, system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  overflow: hidden;
}
.top {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 1.2rem 0.6rem;
  border-bottom: 1px solid var(--line);
  z-index: 2;
}
.top-right {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.follow-btn {
  width: auto;
  white-space: nowrap;
  padding: 0.5rem 0.85rem;
  font-size: 0.82rem;
}
.follow-btn.pending,
.act.pending {
  opacity: 0.72;
}
.follow-btn.following,
.act.primary.following {
  background: var(--orvalho);
  color: var(--baia);
  border-color: var(--orvalho);
  animation: follow-glow 1.6s ease-in-out infinite;
}
@keyframes follow-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(126, 200, 196, 0.5); }
  50% { box-shadow: 0 0 0 7px rgba(126, 200, 196, 0); }
}
.brand em {
  font-family: Newsreader, Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 1.45rem;
  color: var(--laje);
}
.brand strong {
  font-family: "Big Shoulders Display", sans-serif;
  font-weight: 800;
  letter-spacing: 0.02em;
  font-size: 1.7rem;
  margin-left: 0.15rem;
  color: var(--faixa);
}
.tabs {
  display: flex;
  gap: 0.15rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--mute);
  font: 600 0.92rem Overpass, sans-serif;
  padding: 0.55rem 0.8rem;
  min-height: 44px;
  cursor: pointer;
  flex: 0 0 auto;
}
.tabs button.on {
  color: var(--baia);
  background: var(--faixa);
}
.clock-face {
  font-family: "Big Shoulders Display", sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: var(--faixa);
  min-width: 5.2rem;
  text-align: right;
}
.live-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--orvalho);
}
.live-pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--piloto);
  box-shadow: 0 0 10px var(--piloto);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}
.panel { display: none; flex: 1; min-height: 0; flex-direction: column; }
.panel.on { display: flex; }
.stage {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  min-height: 0;
}
.console {
  padding: 1rem 1.1rem 0.6rem;
  border-right: 1px solid var(--line);
  overflow: auto;
}
.eyebrow, .route-kicker {
  font-size: 0.78rem;
  color: var(--orvalho);
  margin: 0 0 0.35rem;
}
.where h1 {
  font-family: Newsreader, Georgia, serif;
  font-weight: 500;
  font-size: 1.2rem;
  line-height: 1.25;
  margin: 0;
  overflow-wrap: anywhere;
}
.where p { margin: 0.2rem 0 0; color: var(--mute); font-size: 0.85rem; }
.place-class {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--faixa);
}
.place-class[data-band="high"] { color: var(--piloto); }
.place-class[data-band="medium"] { color: var(--faixa); }
.place-class[data-band="low"] { color: var(--orvalho); }
.shield-wrap {
  position: relative;
  width: 100%;
  margin: 0.15rem 0 0;
}
.gauge { width: 100%; height: auto; display: block; }
.gauge-track {
  fill: none;
  stroke: rgba(243, 238, 228, 0.12);
  stroke-width: 11;
  stroke-linecap: round;
}
.shield-arc {
  fill: none;
  stroke: var(--band);
  stroke-width: 11;
  stroke-linecap: round;
  stroke-dasharray: 276;
  stroke-dashoffset: 276;
  transition: stroke-dashoffset 1.1s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.4s;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--band) 55%, transparent));
}
.shield-readout {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 0.1rem;
}
.digits {
  font-family: "Big Shoulders Display", sans-serif;
  font-weight: 800;
  font-size: 4.4rem;
  line-height: 0.78;
  letter-spacing: -0.04em;
  color: var(--laje);
}
.band {
  font-family: "Big Shoulders Display", sans-serif;
  letter-spacing: 0.18em;
  font-size: 1.05rem;
  margin-top: 0.1rem;
  color: var(--band);
}
.low { --band: var(--orvalho); }
.medium { --band: var(--faixa); }
.high { --band: var(--piloto); }
.rel {
  text-align: left;
  color: var(--mute);
  font-size: 0.8rem;
  margin: 0.15rem 0 0.55rem;
}
.ticker {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.ticker li {
  font-size: 0.72rem;
  padding: 0.28rem 0.45rem;
  border: 1px solid var(--line);
  color: var(--mute);
  opacity: 0.4;
  transition: opacity 0.35s ease, background 0.35s ease, color 0.35s ease;
}
.ticker li.on {
  opacity: 1;
  color: var(--baia);
  background: var(--faixa);
  border-color: var(--faixa);
  transform: none;
}
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}
.vehicle-drill {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.4rem;
  margin-top: 0.55rem;
}
.vehicle-drill .hint { grid-column: 1 / -1; margin: 0; }
.route-box {
  position: absolute;
  z-index: 1150;
  left: 52px;
  top: 52px;
  width: min(340px, calc(100% - 72px));
  max-height: calc(100% - 52px - 148px);
  overflow: auto;
  margin: 0;
  padding: 0.75rem 0.8rem 0.85rem;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.15);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.38);
  pointer-events: auto;
}
.hud .map-frame .route-box,
.stage-main > .map-slot .route-box,
.stage-main > .map-slot .locate-fab { display: none; }
.ops[data-stage="cameras"] .hud { display: none; }
@media (min-width: 901px) {
  .top-right .stage-btn { display: none; }
  .sheet-handle { display: none; }
  .hud.compact .ticker { display: flex; }
  .hud.compact .rail { display: grid; }
  .hud.compact #spark,
  .hud.compact .vehicle-drill,
  .hud.compact .status,
  .hud.compact .rel { display: block; }
  .hud.compact .digits { font-size: 4.1rem; }
  .route-box.compact {
    left: 52px;
    top: 52px;
    width: min(340px, calc(100% - 72px));
    max-height: calc(100% - 52px - 148px);
    padding: 0.75rem 0.8rem 0.85rem;
  }
  .route-box.compact .route-kicker { display: block; }
  .route-box.compact .route-fields { display: grid; }
  .route-box.compact #route-go,
  .route-box.compact #replay,
  .route-box.compact .hint,
  .route-box.compact .route-summary,
  .route-box.compact .trip-box { display: block; }
  .route-box.compact #route-list { display: block; }
}
.route-box .eyebrow { margin-bottom: 0.35rem; }
.route-fields {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem;
  margin: 0.3rem 0;
}
.route-fields.three { grid-template-columns: 1fr auto auto; }
.route-summary {
  margin: 0.45rem 0 0;
  font-size: 0.75rem;
  color: var(--mute);
  line-height: 1.4;
  min-height: 0;
}
.route-card {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  padding: 0.55rem 0.6rem;
  margin: 0.45rem 0 0;
  cursor: pointer;
  font-size: 0.8rem;
  background: rgba(16, 32, 51, 0.45);
}
.route-card.on { border-left-color: var(--faixa); background: rgba(245, 196, 0, 0.08); }
.route-card.suggested { border-left-color: var(--orvalho); }
.route-card > b { color: var(--laje); }
.route-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.25rem;
  margin-top: 0.4rem;
}
.route-metrics span {
  display: block;
  color: var(--mute);
  font-size: 0.68rem;
}
.route-metrics b {
  display: block;
  margin-top: 0.08rem;
  font-size: 0.95rem;
  color: var(--laje);
}
.route-card .hot-label {
  margin: 0.4rem 0 0;
  font-size: 0.68rem;
  color: var(--mute);
}
.route-card ul.hotspots {
  list-style: none;
  margin: 0.2rem 0 0;
  padding: 0;
}
.route-card ul.hotspots li {
  color: var(--piloto);
  font-size: 0.72rem;
  margin-top: 0.18rem;
  line-height: 1.3;
}
.route-card .safer { color: var(--orvalho); margin: 0.3rem 0 0; font-size: 0.72rem; }
.route-card .route-choose {
  margin-top: 0.45rem;
  width: 100%;
  font-size: 0.78rem;
}
.route-card.on .route-choose {
  background: var(--faixa);
  color: #1a1400;
  border-color: var(--faixa);
}
.sheet-handle {
  appearance: none;
  display: none;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--faixa);
  font: 700 0.78rem Overpass, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.45rem 0 0.55rem;
  min-height: 44px;
  cursor: pointer;
}
.sheet-handle::before {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  border-radius: 99px;
  background: rgba(243, 238, 228, 0.28);
  margin: 0 auto 0.35rem;
}
.act, select, input[type=search], input[type=text] {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--sombra);
  color: var(--laje);
  font: 500 0.86rem Overpass, sans-serif;
  padding: 0.68rem 0.6rem;
  border-radius: 0;
  width: 100%;
  min-height: 44px;
  cursor: pointer;
}
.act.primary { background: var(--faixa); color: #1a1400; border-color: var(--faixa); font-weight: 700; }
.top-right .follow-btn,
.top-right .stage-btn { width: auto; white-space: nowrap; }
.act:focus-visible, select:focus-visible, .tabs button:focus-visible {
  outline: 2px solid var(--faixa);
  outline-offset: 2px;
}
.status { color: var(--mute); font-size: 0.75rem; margin: 0.6rem 0 0; }
.trip-box {
  margin-top: 0.7rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.4rem;
}
.trip-box[hidden] { display: none; }
.trip-check, .trip-rating label {
  font-size: 0.82rem;
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.trip-rating { display: flex; gap: 0.9rem; }
.trip-box textarea {
  width: 100%;
  background: rgba(7, 16, 24, 0.6);
  color: var(--laje);
  border: 1px solid var(--line);
  padding: 0.4rem 0.5rem;
  font: inherit;
}
.gps-secure {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.55rem 1rem;
  background: rgba(245, 196, 0, 0.16);
  border-bottom: 1px solid var(--faixa);
  color: var(--laje);
  font-size: 0.82rem;
  flex-shrink: 0;
}
.gps-secure[hidden] { display: none; }
.gps-secure .act { width: auto; margin: 0; }
.map-frame { position: relative; min-height: 0; height: 100%; }
#map, #cam-map { position: absolute; inset: 0; }
#cam-map { position: relative; height: 180px; margin: 0.5rem 0; border: 1px solid var(--line); }
.locate-fab {
  position: absolute;
  z-index: 1100;
  top: 78px;
  left: 12px;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(16, 26, 36, 0.92);
  color: var(--laje);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.locate-fab .locate-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--orvalho);
  box-shadow: 0 0 0 3px rgba(126, 200, 196, 0.22);
}
.locate-fab.pending .locate-dot {
  animation: pulse 1.1s ease-in-out infinite;
}
.locate-fab.following {
  border-color: var(--orvalho);
}
.locate-fab.following .locate-dot {
  background: var(--piloto);
  border-color: var(--piloto);
  animation: pulse 1.6s ease-in-out infinite;
}
.leaflet-tooltip.you-tip {
  background: var(--baia);
  color: var(--faixa);
  border: 1px solid var(--faixa);
  font: 600 0.72rem Overpass, sans-serif;
  box-shadow: none;
  padding: 0.2rem 0.4rem;
}
.leaflet-tooltip.you-tip::before { border-top-color: var(--orvalho); }
.map-legend {
  position: absolute;
  z-index: 500;
  left: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.68rem;
  color: var(--laje);
  background: rgba(7, 16, 24, 0.72);
  padding: 0.35rem 0.55rem;
  backdrop-filter: blur(6px);
  pointer-events: none;
}
.map-legend i {
  width: 42px;
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--orvalho), var(--faixa));
}
.map-legend i.hot { background: linear-gradient(90deg, var(--faixa), var(--piloto)); }
.leaflet-container { background: #0e1c2c; font-family: Overpass, sans-serif; touch-action: manipulation; cursor: crosshair; }
.filmstrip {
  border-top: 1px solid var(--line);
  padding: 0.55rem 1rem 0.8rem;
}
.filmstrip p {
  margin: 0 0 0.4rem;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}
.strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: #000;
  border: 1px solid var(--line);
  cursor: pointer;
}
.thumb iframe {
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
}
.thumb span {
  position: absolute;
  left: 6px;
  bottom: 4px;
  font-size: 0.65rem;
  background: rgba(7,16,24,.75);
  padding: 0.1rem 0.3rem;
}
.scroll { overflow: auto; padding: 1.1rem 1.4rem 2rem; flex: 1; }
.editorial { max-width: 920px; }
.conta-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.conta-cadastro {
  display: grid;
  grid-template-columns: auto 1.3fr 1fr 1fr 0.8fr;
  gap: 0.65rem 0.8rem;
  align-items: end;
  padding: 0.85rem 1.4rem 0.95rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--sombra) 72%, transparent);
  flex-shrink: 0;
}
.conta-kicker {
  grid-column: 1;
  margin: 0;
  font-size: 0.78rem;
  color: var(--mute);
  align-self: center;
  max-width: 9rem;
}
.conta-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.72rem;
  color: var(--mute);
}
.conta-field input,
.conta-field select {
  width: 100%;
  min-height: 2.4rem;
}
.conta-cadastro .hint {
  grid-column: 1 / -1;
  margin: 0;
}
.conta-grid {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  grid-template-rows: auto 1fr;
  gap: 1rem 1.2rem;
  padding: 1rem 1.4rem 1.8rem;
  width: 100%;
  max-width: none;
}
.conta-formula { grid-column: 1 / -1; }
.conta-formula .lede { margin: 0 0 0.85rem; max-width: 52rem; }
.conta-formula .lede em { font-style: italic; color: var(--faixa); }
.formula-eq {
  margin: 0.35rem 0 0;
  color: var(--mute);
  font-size: 0.82rem;
}
.formula-eq code {
  font-family: Overpass, ui-monospace, monospace;
  color: var(--orvalho);
  font-size: 0.9rem;
}
.conta-side { display: grid; gap: 1rem; align-content: start; }
.source-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}
.source-list li {
  padding: 0.45rem 0 0.55rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
  line-height: 1.35;
}
.source-list strong { color: var(--faixa); margin-right: 0.35rem; }
.pipe-out { background: color-mix(in srgb, var(--faixa) 14%, transparent); }
.conta-mix h3 {
  margin: 1rem 0 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mute);
}
.lede { font-family: Newsreader, Georgia, serif; font-size: 1.4rem; line-height: 1.35; }
.pipeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.45rem;
  margin: 0.2rem 0 0.7rem;
}
.pipe {
  border: 1px solid var(--line);
  padding: 0.7rem 0.65rem;
  min-height: 92px;
  opacity: 0.35;
  transform: translateY(10px);
  animation: rise 0.7s ease forwards;
}
.pipe.on { opacity: 1; border-color: var(--faixa); }
.pipe b {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 0.35rem;
}
.pipe strong {
  font-family: "Big Shoulders Display", sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
}
@keyframes rise {
  to { opacity: 1; transform: none; }
}
.mixbars { display: grid; gap: 0.45rem; margin: 1rem 0 1.4rem; }
.mixrow { display: grid; grid-template-columns: 9.5rem 1fr auto auto; gap: 0.5rem; align-items: center; font-size: 0.8rem; }
.mixrow b { font-family: "Big Shoulders Display", sans-serif; font-size: 1.05rem; }
.mixrow em { font-style: normal; color: var(--mute); }
.mixrow i {
  display: block;
  height: 10px;
  width: 0;
  background: var(--faixa);
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.gap {
  border: 1px dashed color-mix(in srgb, var(--piloto) 50%, var(--line));
  padding: 0.7rem 0.8rem;
  margin: 0.4rem 0;
}
.gap strong { color: var(--piloto); display: block; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 0.2rem; }
.stats-head { padding: 0.8rem 1.2rem 0; max-width: 280px; }
.chart-card {
  background: color-mix(in srgb, var(--sombra) 70%, transparent);
  border: 1px solid var(--line);
  padding: 0.9rem 1rem 1rem;
  margin: 0 0 1rem;
}
.chart-card h2 {
  margin: 0 0 0.7rem;
  font-family: Newsreader, Georgia, serif;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--laje);
}
.race { display: grid; gap: 0.38rem; }
.race-row { display: grid; grid-template-columns: 1.6rem 1fr auto; gap: 0.45rem; align-items: center; font-size: 0.78rem; cursor: pointer; }
.race-row small { display: block; color: var(--mute); font-size: 0.68rem; margin-top: 0.15rem; }
.race-row em { font-style: normal; color: var(--mute); font-family: "Big Shoulders Display", sans-serif; font-weight: 700; }
.race-track { height: 11px; background: #15202b; overflow: hidden; }
.race-track b {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--orvalho), var(--faixa) 55%, var(--piloto));
  transition: width 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}
.clock { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0.25rem; }
.hour-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  background: color-mix(in srgb, var(--piloto) calc(var(--w, 0.3) * 55%), #15202b);
  font-family: "Big Shoulders Display", sans-serif;
  font-weight: 700;
}
.hour-cell.on {
  outline: 2px solid var(--faixa);
  color: var(--faixa);
}
.cam-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  min-height: 0;
}
.cinema-col { display: flex; flex-direction: column; min-height: 0; padding: 0.7rem; }
.cinema {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
  min-height: 280px;
}
.cinema-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--mute);
  padding: 1rem;
  text-align: center;
}
.cinema-crop { position: absolute; inset: 0; overflow: hidden; }
.cinema-crop iframe,
.cinema-crop img {
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
  background: #000;
}
.obs-bar {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 0.45rem;
  align-items: center;
  padding: 0.55rem 0 0;
}
.obs-bar p { margin: 0; font-size: 0.75rem; color: var(--mute); }
.cam-side {
  border-left: 1px solid var(--line);
  padding: 0.7rem;
  overflow: auto;
}
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 0.4rem; }
.cam-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  font-size: 0.82rem;
}
.cam-item:hover, .cam-item.on { color: var(--faixa); }
.hint { color: var(--mute); font-size: 0.8rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
th, td { text-align: left; padding: 0.35rem 0.3rem; border-bottom: 1px solid var(--line); }
th { color: var(--mute); font-weight: 500; }
@media (max-width: 900px) {
  .top { grid-template-columns: 1fr; }
  .stage, .cam-layout { grid-template-columns: 1fr; }
  .strip { grid-template-columns: 1fr 1fr; }
  .pipeline { grid-template-columns: 1fr 1fr; }
  .conta-cadastro {
    grid-template-columns: 1fr 1fr;
    padding: 0.75rem 0.9rem;
  }
  .conta-kicker,
  .conta-cadastro .hint { grid-column: 1 / -1; }
  .conta-grid {
    grid-template-columns: 1fr;
    padding: 0.85rem 0.9rem 1.4rem;
  }
  .conta-formula { grid-column: 1; }
  .live-pill { display: none; }
  .top-right .follow-btn,
  .top-right .stage-btn { width: 100%; }
  .obs-bar { grid-template-columns: 1fr 1fr; }
  .obs-bar p { grid-column: 1 / -1; }
  .locate-fab { width: 52px; height: 52px; top: auto; bottom: 16px; left: 12px; }
}
.ops {
  flex: 1;
  min-height: 0;
  display: flex;
}
.stage-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}
.stage-switch {
  position: absolute;
  z-index: 1200;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.stage-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--laje);
  font: 600 0.86rem Overpass, sans-serif;
  padding: 0.5rem 1rem;
  cursor: pointer;
  white-space: nowrap;
  width: auto;
}
.stage-switch button.on {
  background: var(--faixa);
  color: #1a1400;
}
.stage-main > .map-frame,
.ops[data-stage="map"] .stage-main .map-frame {
  flex: 1;
  min-height: 0;
  height: auto;
  margin: 0;
}
.ops[data-stage="cameras"] .stage-main > .wall {
  flex: 1;
  min-height: 0;
  padding: 8px 8px 140px;
}
.map-slot:empty { display: none; }
.stage-main > .map-slot {
  position: absolute;
  z-index: 1140;
  left: 0;
  right: 0;
  bottom: 0;
  height: 132px;
  padding: 0;
  background: rgba(8, 16, 28, 0.92);
  border-top: 1px solid var(--line);
}
.stage-main > .map-slot .wall {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: 1fr;
  height: 132px;
  min-height: 0;
  margin: 0;
  padding: 0;
  gap: 1px;
  overflow: hidden;
}
.stage-main > .map-slot .wall .cell footer { font-size: 0.55rem; padding: 0.2rem 0.3rem; }
.cell[data-signal="live"] .cell-meta { color: var(--orvalho); }
.cell[data-signal="dead"] .cell-meta { color: var(--mute); }
.cell[data-signal="opening"] .cell-meta { color: var(--faixa); }
.stage-main > .map-slot .wall .cell::before,
.stage-main > .map-slot .wall .cell::after,
.stage-main > .map-slot .wall .cell-feed::after { display: none; }
.ops[data-stage="map"] .map-legend { bottom: 144px; }
.stage-fab { display: none; }
.wall {
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
  background: #05090e;
}
.stage-main > .wall {
  flex: 1;
  padding: 6px;
}
.cell {
  position: relative;
  overflow: hidden;
  background: #000;
  cursor: pointer;
  isolation: isolate;
}
.cell::before, .cell::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--faixa);
  z-index: 2;
  pointer-events: none;
  opacity: 0.7;
}
.cell::before { top: 6px; left: 6px; border-right: 0; border-bottom: 0; }
.cell::after { right: 6px; bottom: 6px; border-left: 0; border-top: 0; }
.cell.on { outline: 1px solid var(--piloto); }
.cell-feed { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(circle at 30% 20%, #1a2834, #05090e); }
.cell-feed::after {
  content: "";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: "Big Shoulders Display", sans-serif;
  font-size: 3.4rem;
  letter-spacing: 0.2em;
  color: rgba(207, 198, 180, 0.08);
  pointer-events: none;
}
.cell-feed iframe,
.cell-feed img.cell-still,
.cell-feed img.cell-live {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
  object-fit: cover;
  background: #000;
}
.cell footer {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.25rem 0.4rem;
  font-size: 0.68rem;
  background: linear-gradient(transparent, rgba(8,16,28,.9));
}
.cell footer b { color: var(--orvalho); font-weight: 500; }
.hud {
  position: absolute;
  z-index: 1160;
  top: 52px;
  right: 12px;
  width: min(292px, 32vw);
  max-height: calc(100% - 52px - 144px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
  padding: 0.85rem 0.9rem 1rem;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.15);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}
.hud select,
.hud button,
.hud a,
.hud input {
  pointer-events: auto;
}
.stage-main > .map-slot .map-frame {
  height: 132px;
  min-height: 132px;
  margin: 0;
}
@media (max-width: 900px) {
  .ops { display: flex; }
  .hud {
    width: auto;
    left: 8px;
    right: 8px;
    top: auto;
    bottom: 140px;
    max-height: 28vh;
  }
  .route-box {
    left: 8px;
    right: auto;
    top: 52px;
    bottom: auto;
    width: min(260px, calc(100% - 72px));
    max-height: 22vh;
  }
}
.hud .digits { font-size: 4.1rem; }
.rail {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.3rem;
  margin: 0.35rem 0 0.4rem;
}
.rail div {
  border: 1px solid var(--line);
  padding: 0.3rem 0.35rem;
}
.rail b {
  display: block;
  font-size: 0.68rem;
  color: var(--mute);
}
.rail span {
  font-family: "Big Shoulders Display", sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
}
#spark { width: 100%; height: 56px; display: block; }
.tape {
  overflow: hidden;
  white-space: nowrap;
  border-top: 1px solid var(--line);
  padding: 0.3rem 0;
  font-size: 0.78rem;
  color: var(--mute);
  background: #0c1826;
}
.tape span {
  display: inline-block;
  padding-left: 100%;
  animation: tape 42s linear infinite;
}
@keyframes tape {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}
@media (max-width: 900px) {
  .ops { display: flex; }
  .stage-main > .wall { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(3, 16vh); }
  .stage-main > .map-slot,
  .stage-main > .map-slot .wall,
  .stage-main > .map-slot .map-frame { height: 96px; }
  .ops[data-stage="map"] .map-legend { bottom: 108px; left: 8px; }
  .top {
    gap: 0.45rem;
    padding: 0.45rem 0.7rem 0.4rem;
  }
  .brand em { font-size: 1.15rem; }
  .brand strong { font-size: 1.35rem; }
  .clock-face { display: none; }
  .top-right .stage-btn { display: none; }
  .top-right { justify-content: stretch; }
  .top-right .follow-btn {
    width: 100%;
    min-height: 48px;
    font-size: 1rem;
  }
  .sheet-handle { display: block; }
  .hud {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: calc(96px + 8px + env(safe-area-inset-bottom));
    width: auto;
    max-height: 42vh;
    padding: 0 0.75rem 0.7rem;
    pointer-events: auto;
  }
  .hud.compact {
    max-height: none;
    pointer-events: none;
  }
  .hud.compact .sheet-handle { pointer-events: auto; }
  .hud.compact .ticker,
  .hud.compact .rail,
  .hud.compact #spark,
  .hud.compact .vehicle-drill,
  .hud.compact .status,
  .hud.compact .rel {
    display: none;
  }
  .hud.compact .digits { font-size: 2.6rem; }
  .hud.compact .shield-wrap { margin: 0; }
  .hud:not(.compact) {
    max-height: min(70vh, 520px);
  }
  .route-box {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: auto;
    width: auto;
    max-height: min(52vh, 420px);
  }
  .route-box.compact {
    left: 8px;
    right: auto;
    top: 52px;
    width: auto;
    max-height: none;
    padding: 0 0.55rem 0.15rem;
  }
  .route-box.compact .route-kicker,
  .route-box.compact .route-fields,
  .route-box.compact #route-go,
  .route-box.compact #replay,
  .route-box.compact .hint,
  .route-box.compact .route-summary,
  .route-box.compact #route-list,
  .route-box.compact .trip-box {
    display: none;
  }
  .locate-fab {
    z-index: 1180;
    width: 56px;
    height: 56px;
    top: auto;
    left: auto;
    right: 12px;
    bottom: calc(96px + 8px + 88px + env(safe-area-inset-bottom));
  }
  .stage-switch {
    top: 8px;
  }
  .stage-switch button { min-height: 44px; padding: 0.55rem 1.1rem; }
  .placa-stage { padding: 0.7rem 0.7rem 1.4rem; }
  .cyd { width: 100%; }
  .cyd-pcb { width: 100%; }
  .conta-cadastro { grid-template-columns: 1fr; }
  #tab-origem, #tab-stats, #tab-cams, #tab-placa { overflow: auto; -webkit-overflow-scrolling: touch; }
  #tab-agora { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .live-pill i { animation: none; }
  .tape span { padding-left: 0.8rem; }
}

.placa-page { background: #1a1408; }
.placa-stage {
  flex: 1;
  overflow: auto;
  padding: 1.2rem 1.4rem 2.4rem;
}
.placa-lead { color: var(--mute); max-width: 40rem; }
.placa-lead a { color: var(--faixa); }
.cyd {
  display: flex;
  justify-content: center;
  margin: 1.2rem 0 1.4rem;
}
.cyd-pcb {
  position: relative;
  width: min(720px, 100%);
  border-radius: 10px;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 236, 160, 0.45), transparent 42%),
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(160, 110, 10, 0.07) 18px 19px),
    linear-gradient(180deg, #f3d45e 0%, #d4a017 58%, #b8860b 100%);
  border: 1px solid #8a6a08;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 220, 0.5);
  padding: 1.1rem 1.4rem 0.9rem 1.1rem;
}
.cyd-silk {
  margin: 0 0 0.45rem;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: #5c4304;
  font-weight: 700;
}
.cyd-hole {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #3a3a3a, #111);
  box-shadow: inset 0 0 0 2px #b8860b;
}
.cyd-hole.tl { top: 10px; left: 10px; }
.cyd-hole.tr { top: 10px; right: 10px; }
.cyd-hole.bl { bottom: 10px; left: 10px; }
.cyd-hole.br { bottom: 10px; right: 10px; }
.cyd-side {
  position: absolute;
  left: 6px;
  top: 52px;
  bottom: 64px;
  width: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}
.cyd-sd {
  width: 14px;
  height: 28px;
  background: #1a1a1a;
  border: 1px solid #111;
  box-shadow: inset 0 0 0 1px #444;
}
.cyd-spk {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #666, #111);
  box-shadow: 0 0 0 2px #c9a227;
}
.cyd-tft { background: #111; padding: 10px; box-shadow: inset 0 0 0 2px #2a2a2a, 0 8px 18px rgba(0, 0, 0, 0.35); }
.tft-bezel { background: #0a0a0a; padding: 8px; }
.tft-glass {
  position: relative;
  display: flex;
  flex-direction: column;
  aspect-ratio: 320 / 240;
  background: #071018;
  color: #d7e6c8;
  font-family: Overpass, sans-serif;
  overflow: hidden;
}
.tft-glass::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, 0.08) 2px 3px);
}
.tft-bar {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 0.4rem;
  align-items: center;
  padding: 0.35rem 0.5rem 0.2rem;
  font-size: 0.78rem;
  color: #9cff6a;
}
.tft-bar strong {
  font-family: "Big Shoulders Display", sans-serif;
  font-size: 1.6rem;
  line-height: 1;
  color: #f5c400;
}
.tft-glass[data-band="high"] .tft-bar strong,
.tft-glass[data-band="high"] #board-band { color: #ff6b5b; }
.tft-glass[data-band="medium"] .tft-bar strong { color: #f5c400; }
.tft-glass[data-band="low"] .tft-bar strong { color: #7eb8c9; }
.tft-cols {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  flex: 1;
  min-height: 0;
}
.tft-now {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid rgba(245, 196, 0, 0.22);
}
.tft-place, .tft-deleg {
  margin: 0;
  padding: 0 0.4rem;
  font-size: 0.72rem;
  line-height: 1.2;
}
.tft-deleg { color: #8aa0b0; font-size: 0.64rem; }
.tft-meters {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  margin: 0.1rem 0.4rem 0.15rem;
  font-size: 0.58rem;
  color: #8aa0b0;
}
.tft-meters b {
  font-family: "Big Shoulders Display", sans-serif;
  font-size: 1.05rem;
  color: #f5c400;
  margin-left: 0.15rem;
}
.tft-map-wrap {
  position: relative;
  flex: 1;
  min-height: 80px;
  margin: 0.12rem 0.35rem 0;
}
#board-map { background: #0b1822; min-height: 80px; height: 100%; }
#board-map .leaflet-container { background: #0b1822; }
.tft-route-pane {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding: 0.2rem 0.4rem 0.3rem;
  overflow: hidden;
  font-size: 0.64rem;
  line-height: 1.2;
  min-width: 0;
}
.tft-route-pane small { color: #8aa0b0; letter-spacing: 0.06em; }
.tft-route-pane > b {
  color: #f5c400;
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tft-route-pane #board-route-meta { margin: 0; color: #c5d4b8; }
.tft-route-pane[data-empty="1"] { opacity: 0.72; }
.tft-route-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.2rem;
  margin: 0.15rem 0 0;
}
.tft-route-stats dt { color: #8aa0b0; font-size: 0.56rem; }
.tft-route-stats dd {
  margin: 0;
  color: #f5c400;
  font-family: "Big Shoulders Display", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
}
.tft-route-fromto {
  margin: 0;
  color: #f5c400;
  font-size: 0.58rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tft-via {
  list-style: none;
  margin: 0.1rem 0 0;
  padding: 0;
  overflow: auto;
  flex: 1;
  min-height: 0;
  font-size: 0.56rem;
  line-height: 1.2;
}
.tft-via li {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 0.2rem;
  padding: 0.12rem 0;
  border-bottom: 1px solid rgba(245, 196, 0, 0.12);
}
.tft-via li.on { background: rgba(245, 196, 0, 0.08); }
.tft-via b {
  color: #f5c400;
  font-family: "Big Shoulders Display", sans-serif;
  font-size: 0.82rem;
}
.tft-via .via-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #eaf6d8;
}
.tft-via em {
  display: block;
  font-style: normal;
  color: #9aae9a;
  font-size: 0.52rem;
  line-height: 1.25;
}
.tft-route-hot {
  margin: 0.15rem 0 0;
  color: #c5d4b8;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.tft-route-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.2rem;
  margin-top: auto;
  padding-top: 0.2rem;
}
.tft-route-pick button {
  appearance: none;
  border: 1px solid rgba(245, 196, 0, 0.45);
  background: #0b1822;
  color: #f5c400;
  font: 600 0.58rem Overpass, sans-serif;
  padding: 0.22rem 0.2rem;
  cursor: pointer;
}
.tft-route-pick button.on {
  background: #f5c400;
  color: #1a1400;
}
#board-map {
  pointer-events: auto;
  cursor: crosshair;
  z-index: 1;
}
#board-map .leaflet-control-zoom {
  margin: 4px;
  transform: scale(0.78);
  transform-origin: top left;
}
.tft-card {
  position: relative;
  margin: 0.2rem 0.3rem 0.3rem;
  padding: 0.28rem 0.35rem;
  background: rgba(8, 22, 16, 0.92);
  border-left: 3px solid #7eb8c9;
  font-size: 0.64rem;
  line-height: 1.2;
  max-height: 38%;
  overflow: hidden;
  flex-shrink: 0;
}
.tft-card[data-kind="act"] { border-left-color: #ff6b5b; }
.tft-card[data-kind="watch"] { border-left-color: #f5c400; }
.tft-card small { display: block; color: #8aa0b0; }
.tft-card b { display: block; color: #eaf6d8; }
.tft-card p { margin: 0.15rem 0 0; color: #c5d4b8; }
.cyd-deck {
  display: grid;
  grid-template-columns: 90px 18px auto auto 1fr;
  gap: 0.55rem;
  align-items: center;
  margin-top: 0.7rem;
  min-height: 52px;
}
.cyd-can {
  height: 42px;
  background:
    linear-gradient(90deg, #c9a227 0 10px, transparent 10px),
    repeating-linear-gradient(90deg, #9a9a9a 0 3px, #6a6a6a 3px 6px),
    linear-gradient(180deg, #d0d0d0, #7a7a7a);
  box-shadow: inset 0 0 0 1px #555;
}
.cyd-rgb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #3d3;
  box-shadow: 0 0 8px #3d3;
}
.cyd-rgb[data-band="high"] { background: #e23b2f; box-shadow: 0 0 10px #e23b2f; }
.cyd-rgb[data-band="medium"] { background: #f5c400; box-shadow: 0 0 10px #f5c400; }
.cyd-btn {
  font: 700 0.62rem Overpass, sans-serif;
  padding: 0.35rem 0.45rem;
  background: #2a2a2a;
  color: #ddd;
  border: 1px solid #111;
}
.cyd-usb {
  justify-self: end;
  width: 42px;
  height: 14px;
  background: #222;
  border: 1px solid #111;
}
.cyd-pins {
  position: absolute;
  right: 6px;
  top: 48px;
  bottom: 48px;
  width: 8px;
  background: repeating-linear-gradient(#d4af37 0 3px, #7a5b12 3px 6px);
}
.placa-feed {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 720px;
  display: grid;
  gap: 0.55rem;
}
.placa-feed li {
  border-left: 3px solid var(--orvalho);
  padding: 0.45rem 0.7rem;
  background: rgba(16, 32, 51, 0.65);
}
.placa-feed li[data-kind="act"] { border-left-color: var(--piloto); }
.placa-feed li[data-kind="watch"] { border-left-color: var(--faixa); }
.placa-feed strong { display: block; }
.placa-feed span { color: var(--laje); font-size: 0.9rem; }
.placa-feed em { display: block; color: var(--mute); font-style: normal; font-size: 0.75rem; margin-top: 0.2rem; }
.placa-controls { display: flex; gap: 0.5rem; max-width: 720px; margin: 1rem auto 0; }
.placa-controls .act { width: auto; }
