/* RotaSegura — tokens do docs/design.md (black canvas + electric yellow) */
:root {
  --primary: #faff69;
  --primary-active: #e6eb52;
  --primary-disabled: #3a3a1f;
  --on-primary: #0a0a0a;

  --canvas: #0a0a0a;
  --surface-soft: #121212;
  --surface-card: #1a1a1a;
  --surface-elevated: #242424;
  --hairline: #2a2a2a;
  --hairline-strong: #3a3a3a;

  --on-dark: #ffffff;
  --body: #cccccc;
  --body-strong: #e6e6e6;
  --muted: #888888;
  --muted-soft: #5a5a5a;

  /* semânticos (status das áreas) */
  --safe: #22c55e;
  --warn: #faff69;
  --danger: #ef4444;
  --alert: #ef4444;
  --restrict: #f97316;
  --info: #3b82f6;
  --none: #5a5a5a;

  --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-pill: 9999px;
  --s-xxs: 4px; --s-xs: 8px; --s-sm: 12px; --s-md: 16px; --s-lg: 24px; --s-xl: 32px; --s-xxl: 48px;

  --touch: 48px;            /* luva + moto: alvo maior que os 40px do guia */
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--body);
  font: 400 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: var(--primary); }
h1, h2, h3 { color: var(--on-dark); font-weight: 700; margin: 0; }
h1 { font-size: 32px; line-height: 1.2; letter-spacing: -1px; }
h2 { font-size: 24px; line-height: 1.3; letter-spacing: -0.3px; }
h3 { font-size: 18px; line-height: 1.4; font-weight: 600; }
p { margin: 0; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s-xxs); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 13px; font-weight: 500; }
.stack > * + * { margin-top: var(--s-md); }
.row { display: flex; align-items: center; gap: var(--s-xs); }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------ Views */
#app { position: fixed; inset: 0 0 calc(var(--tabbar-h) + var(--safe-b)) 0; }
.view { position: absolute; inset: 0; display: none; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: calc(var(--s-lg) + var(--safe-t)) var(--s-md) var(--s-xl); }
.view.is-active { display: block; }
.view-map { padding: 0; overflow: hidden; }
.view:not(.view-map) > * { max-width: 720px; margin-left: auto; margin-right: auto; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-md); margin-bottom: var(--s-lg); }

/* ------------------------------------------------------------ Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-xs);
  min-height: var(--touch); padding: 12px 20px; border: 0; border-radius: var(--r-md);
  font-size: 15px; font-weight: 600; line-height: 1; text-decoration: none; white-space: nowrap;
  background: var(--surface-card); color: var(--on-dark);
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:active { background: var(--primary-active); }
.btn-primary:disabled { background: var(--primary-disabled); color: var(--muted); }
.btn-secondary { background: var(--surface-elevated); color: var(--on-dark); }
.btn-outline { background: transparent; box-shadow: inset 0 0 0 1px var(--hairline-strong); }
.btn-danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.btn-link { background: none; color: var(--primary); padding: 8px 0; min-height: 0; text-decoration: underline; }
.btn-block { width: 100%; }
.btn-lg { min-height: 56px; font-size: 16px; }
.btn[aria-busy="true"] { opacity: .6; pointer-events: none; }

.icon-btn {
  width: 40px; height: 40px; flex: none; display: inline-grid; place-items: center;
  border: 0; border-radius: 50%; background: var(--surface-elevated); color: var(--on-dark); font-size: 16px;
}
.icon-btn-ghost { background: transparent; color: var(--muted); }
.icon-btn-lg { width: var(--touch); height: var(--touch); font-size: 18px; background: var(--surface-card); box-shadow: inset 0 0 0 1px var(--hairline); }
.icon-btn[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); box-shadow: none; }
.icon-btn.is-loading i { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ Chips / tabs / badges */
.chip-row { display: flex; gap: var(--s-xs); overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chip-row::-webkit-scrollbar { display: none; }
.chip-row-static { margin-bottom: var(--s-md); }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px;
  border: 0; border-radius: var(--r-pill); background: var(--surface-card); color: var(--body);
  font-size: 13px; font-weight: 500; box-shadow: inset 0 0 0 1px var(--hairline);
}
.chip i { font-size: 12px; }
.chip[aria-pressed="true"] { background: var(--on-dark); color: var(--canvas); box-shadow: none; }
.chip-city { background: var(--primary); color: var(--on-primary); box-shadow: none; font-weight: 600; }

.tabs { display: flex; gap: var(--s-xxs); padding: 4px; background: var(--surface-soft); border-radius: var(--r-md); margin-bottom: var(--s-lg); }
.tab { flex: 1; height: 40px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; }
.tab[aria-pressed="true"] { background: var(--surface-card); color: var(--on-dark); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; letter-spacing: .3px; background: var(--surface-elevated); color: var(--on-dark); white-space: nowrap; }
.badge-yellow { background: var(--primary); color: var(--on-primary); text-transform: uppercase; letter-spacing: 1.2px; }

.status {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: var(--r-md);
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
}
.status-lg { height: 44px; padding: 0 16px; font-size: 15px; }
.tone-safe    { background: var(--safe);    color: #04150a; }
.tone-warn    { background: var(--warn);    color: var(--on-primary); }
.tone-danger  { background: var(--danger);  color: #fff; }
.tone-alert   { background: var(--alert);   color: #fff; animation: pulse 1.4s ease-in-out infinite; }
.tone-restrict{ background: var(--restrict);color: #1a0b00; }
.tone-none    { background: var(--surface-elevated); color: var(--muted); }
@keyframes pulse { 50% { opacity: .55; } }

.tag {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600; background: rgba(249,115,22,.14); color: var(--restrict);
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ------------------------------------------------------------ Cards */
.card { background: var(--surface-card); border-radius: var(--r-lg); padding: var(--s-lg); }
.card-soft { background: var(--surface-soft); box-shadow: inset 0 0 0 1px var(--hairline); }
.card-yellow { background: var(--primary); color: var(--on-primary); border-radius: var(--r-lg); padding: var(--s-lg); }
.card-yellow h2, .card-yellow h3 { color: var(--on-primary); }

/* ------------------------------------------------------------ Mapa */
#map { position: absolute; inset: 0; background: #111; }
/* OSM claro → escuro no padrão do guia (preto + texto claro) */
#map.tiles-dark .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.82) contrast(1.15) saturate(.35); }
.leaflet-container { background: #111; font-family: var(--font); }
.leaflet-control-attribution { background: rgba(10,10,10,.7) !important; color: var(--muted-soft) !important; font-size: 10px; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-control-zoom { display: none; }
.leaflet-tooltip.area-label {
  background: rgba(10,10,10,.85); color: var(--on-dark); border: 0; border-radius: var(--r-sm);
  box-shadow: none; font: 600 11px/1.2 var(--font); padding: 3px 6px;
}
.leaflet-tooltip.area-label::before { display: none; }
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--info); box-shadow: 0 0 0 4px rgba(59,130,246,.35), 0 0 0 2px #fff inset; }
.pin-drop { color: var(--primary); font-size: 34px; transform: translate(-6px, -30px); text-shadow: 0 2px 0 #000; }

.map-top { position: absolute; top: 0; left: 0; right: 0; z-index: 500; padding: calc(var(--s-sm) + var(--safe-t)) var(--s-sm) 0; pointer-events: none; }
.map-top > * { pointer-events: auto; max-width: 720px; margin: 0 auto; }
.searchbar {
  display: flex; align-items: center; gap: 6px; height: 56px; padding: 0 8px 0 16px;
  background: var(--surface-card); border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--hairline);
}
.searchbar:focus-within { box-shadow: inset 0 0 0 2px var(--primary); }
.searchbar-icon { color: var(--muted); }
.searchbar input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: 0; font-size: 16px; color: var(--on-dark); }
.searchbar input::placeholder { color: var(--muted); }
.searchbar input::-webkit-search-cancel-button { display: none; }
.search-results { margin-top: 6px !important; background: var(--surface-card); border-radius: var(--r-lg); overflow: hidden; box-shadow: inset 0 0 0 1px var(--hairline); max-height: 55vh; overflow-y: auto; }
.search-item { display: flex; align-items: center; gap: var(--s-sm); width: 100%; min-height: 60px; padding: 10px 16px; border: 0; background: transparent; text-align: left; border-bottom: 1px solid var(--hairline); }
.search-item:last-child { border-bottom: 0; }
.search-item:active { background: var(--surface-elevated); }
.search-item .ico { width: 36px; height: 36px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--surface-elevated); color: var(--muted); flex: none; }
.search-item strong { display: block; color: var(--on-dark); font-weight: 600; font-size: 15px; }
.search-item small { display: block; color: var(--muted); font-size: 13px; }
.search-empty { padding: 16px; color: var(--muted); font-size: 14px; }
#map-chips { margin-top: var(--s-xs); }
#map-chips .chip { background: rgba(26,26,26,.95); }
#map-chips .chip[aria-pressed="true"] { background: var(--on-dark); }
#map-chips .chip-city { background: var(--primary); }

.map-side { position: absolute; right: var(--s-sm); bottom: calc(var(--s-md) + 0px); z-index: 500; display: flex; flex-direction: column; gap: var(--s-xs); }
.here-card {
  position: absolute; left: var(--s-sm); right: calc(var(--s-sm) + var(--touch) + var(--s-xs)); bottom: var(--s-md); z-index: 500;
  background: var(--surface-card); border-radius: var(--r-lg); padding: var(--s-sm) var(--s-md); box-shadow: inset 0 0 0 1px var(--hairline);
  display: flex; align-items: center; gap: var(--s-sm); max-width: 560px;
}
.here-card .grow strong { display: block; color: var(--on-dark); font-size: 15px; font-weight: 600; }
.here-card .grow small { color: var(--muted); font-size: 12px; }
.guard-banner {
  position: absolute; left: var(--s-sm); right: var(--s-sm); top: calc(150px + var(--safe-t)); z-index: 600;
  border-radius: var(--r-lg); padding: var(--s-md); display: flex; gap: var(--s-sm); align-items: center; max-width: 720px; margin: 0 auto;
}
.guard-banner i { font-size: 28px; }
.guard-banner.tone-alert { animation: none; }
.guard-banner.tone-alert > i:first-child { animation: pulse 1s ease-in-out infinite; }
.guard-banner strong { display: block; font-size: 17px; }

/* ------------------------------------------------------------ Tabbar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b); display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); align-items: center;
  background: var(--canvas); border-top: 1px solid var(--hairline);
}
.tabbar-item { position: relative; height: 100%; border: 0; background: none; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 500; }
.tabbar-item i { font-size: 20px; }
.tabbar-item[aria-current="page"] { color: var(--on-dark); }
.tabbar-item[aria-current="page"] i { color: var(--primary); }
.tabbar-item .dot { position: absolute; top: 10px; left: calc(50% + 8px); width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: pulse 1.4s infinite; }
.tabbar-fab {
  justify-self: center; width: 64px; height: 56px; margin-top: -18px; border: 0; border-radius: var(--r-lg);
  background: var(--primary); color: var(--on-primary); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; font-weight: 700; box-shadow: 0 0 0 6px var(--canvas);
}
.tabbar-fab i { font-size: 22px; }
.tabbar-fab:active { background: var(--primary-active); }

/* ------------------------------------------------------------ Bottom sheet */
.sheet-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.6); }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1001; max-height: 92vh; max-height: 92dvh;
  display: flex; flex-direction: column; background: var(--surface-soft); border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: inset 0 1px 0 var(--hairline); transform: translateY(0); transition: transform .22s ease;
  max-width: 720px; margin: 0 auto;
}
.sheet.is-entering { transform: translateY(100%); }
.sheet-grip { padding: 10px 0 4px; display: grid; place-items: center; cursor: grab; touch-action: none; }
.sheet-grip span { width: 44px; height: 5px; border-radius: 3px; background: var(--hairline-strong); }
.sheet-body { overflow-y: auto; padding: var(--s-xs) var(--s-md) calc(var(--s-lg) + var(--safe-b)); -webkit-overflow-scrolling: touch; }
.sheet-head { display: flex; align-items: flex-start; gap: var(--s-sm); margin-bottom: var(--s-md); }
.sheet-head h2 { font-size: 24px; letter-spacing: -0.5px; }
.sheet-close { margin-left: auto; }
.sheet-actions { display: grid; grid-template-columns: 1fr auto auto; gap: var(--s-xs); margin: var(--s-md) 0; }
.sheet-footer { position: sticky; bottom: calc(-1 * (var(--s-lg) + var(--safe-b))); margin: var(--s-md) calc(-1 * var(--s-md)) calc(-1 * (var(--s-lg) + var(--safe-b))); padding: var(--s-sm) var(--s-md) calc(var(--s-md) + var(--safe-b)); background: var(--surface-soft); border-top: 1px solid var(--hairline); }

/* ------------------------------------------------------------ Área (detalhe) */
.area-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: 13px; margin-top: 6px; }
.area-meta i { margin-right: 4px; }
.live-band { display: flex; gap: var(--s-sm); align-items: center; background: rgba(239,68,68,.12); color: #fecaca; border-radius: var(--r-md); padding: var(--s-sm); margin: var(--s-md) 0; box-shadow: inset 0 0 0 1px rgba(239,68,68,.4); }
.live-band i { color: var(--danger); font-size: 22px; }
.base-note { display: flex; gap: var(--s-xs); font-size: 13px; color: var(--muted); background: var(--surface-card); padding: var(--s-sm); border-radius: var(--r-md); margin: var(--s-md) 0; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-xs); margin: var(--s-md) 0; }
.summary-cell { background: var(--surface-card); border-radius: var(--r-md); padding: var(--s-sm); text-align: center; }
.summary-cell b { display: block; font-size: 24px; color: var(--on-dark); letter-spacing: -0.5px; line-height: 1.1; }
.summary-cell span { font-size: 12px; color: var(--muted); }
.confidence { height: 6px; background: var(--surface-elevated); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.confidence span { display: block; height: 100%; background: var(--on-dark); }

/* ------------------------------------------------------------ Lista de relatos */
.list { display: flex; flex-direction: column; gap: var(--s-xs); }
.report { background: var(--surface-card); border-radius: var(--r-lg); padding: var(--s-md); }
.report-top { display: flex; gap: var(--s-sm); align-items: flex-start; }
.report-ico { width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; font-size: 18px; flex: none; }
.report-title { color: var(--on-dark); font-weight: 600; font-size: 15px; line-height: 1.3; }
.report-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.report-sub i { font-size: 11px; }
.report-note { margin-top: var(--s-xs); color: var(--body-strong); font-size: 14px; background: var(--surface-soft); padding: 8px 12px; border-radius: var(--r-md); }
.report-actions { display: flex; gap: 6px; margin-top: var(--s-sm); align-items: center; }
.vote { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 0; border-radius: var(--r-md); background: var(--surface-elevated); color: var(--body); font-size: 13px; font-weight: 600; }
.vote[aria-pressed="true"].vote-up { background: var(--safe); color: #04150a; }
.vote[aria-pressed="true"].vote-down { background: var(--danger); color: #fff; }
.report-more { margin-left: auto; }
.pill-onsite { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--safe); }
.expired { opacity: .55; }
.area-link { color: var(--on-dark); background: none; border: 0; padding: 0; font-weight: 600; text-align: left; }

/* ------------------------------------------------------------ Relatar */
.where { display: flex; align-items: center; gap: var(--s-sm); background: var(--surface-card); border-radius: var(--r-lg); padding: var(--s-sm) var(--s-sm) var(--s-sm) var(--s-md); box-shadow: inset 0 0 0 1px var(--hairline); }
.where.is-set { box-shadow: inset 0 0 0 2px var(--primary); }
.where-ico { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--surface-elevated); display: grid; place-items: center; color: var(--primary); flex: none; }
.where strong { display: block; color: var(--on-dark); font-weight: 600; font-size: 15px; }
.where small { color: var(--muted); font-size: 12px; }
.where-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--s-xs); margin-top: var(--s-xs); }
.where-actions .btn { font-size: 13px; padding: 10px 8px; }
.group-title { margin: var(--s-lg) 0 var(--s-xs); }
.type-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-xs); }
.type-grid-3 { grid-template-columns: repeat(3, 1fr); }
.type-card {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 88px; padding: var(--s-sm);
  border: 0; border-radius: var(--r-lg); background: var(--surface-card); color: var(--on-dark); text-align: left; box-shadow: inset 0 0 0 1px var(--hairline);
}
.type-card i { font-size: 22px; }
.type-card strong { font-size: 14px; font-weight: 600; line-height: 1.2; }
.type-card small { font-size: 11px; color: var(--muted); line-height: 1.3; }
.type-grid-3 .type-card { align-items: center; text-align: center; min-height: 92px; justify-content: center; }
.type-card .check { position: absolute; top: 8px; right: 8px; font-size: 16px; opacity: 0; }
.type-card[aria-pressed="true"] .check { opacity: 1; }
.type-card[aria-pressed="true"] small { color: inherit; opacity: .8; }
.type-card.tone-safe i, .type-card.tone-safe-i i { color: var(--safe); }
.type-card[data-tone="safe"] i { color: var(--safe); }
.type-card[data-tone="warn"] i { color: var(--warn); }
.type-card[data-tone="danger"] i, .type-card[data-tone="alert"] i { color: var(--danger); }
.type-card[data-tone="restrict"] i { color: var(--restrict); }
.type-card[aria-pressed="true"][data-tone="safe"] { background: var(--safe); color: #04150a; box-shadow: none; }
.type-card[aria-pressed="true"][data-tone="warn"] { background: var(--warn); color: var(--on-primary); box-shadow: none; }
.type-card[aria-pressed="true"][data-tone="danger"],
.type-card[aria-pressed="true"][data-tone="alert"] { background: var(--danger); color: #fff; box-shadow: none; }
.type-card[aria-pressed="true"][data-tone="restrict"] { background: var(--restrict); color: #1a0b00; box-shadow: none; }
.type-card[aria-pressed="true"] i { color: inherit !important; }

/* ------------------------------------------------------------ Forms */
.field { display: block; margin-bottom: var(--s-md); }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--body-strong); margin-bottom: 6px; }
.field > span em { font-style: normal; font-weight: 400; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: var(--touch); padding: 12px 14px; border: 0; border-radius: var(--r-md);
  background: var(--surface-card); color: var(--on-dark); font-size: 16px; outline: 0; box-shadow: inset 0 0 0 1px var(--hairline);
}
.input:focus, .select:focus, .textarea:focus { box-shadow: inset 0 0 0 2px var(--primary); }
.textarea { min-height: 84px; resize: vertical; line-height: 1.4; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
.input-wrap { position: relative; }
.input-wrap > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-wrap .input { padding-left: 42px; }
.input-wrap .toggle-pass { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.field-error { display: block; color: var(--danger); font-size: 13px; margin-top: 6px; }
.field.has-error .input, .field.has-error .select { box-shadow: inset 0 0 0 2px var(--danger); }
.field-hint { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; }
.counter { float: right; font-weight: 400; color: var(--muted); }
.check-row { display: flex; gap: var(--s-sm); align-items: flex-start; font-size: 14px; margin-bottom: var(--s-md); cursor: pointer; }
.check-row input { width: 22px; height: 22px; accent-color: var(--primary); flex: none; margin-top: 1px; }
.prof-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-xs); }
.prof { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 76px; padding: 8px; border: 0; border-radius: var(--r-md); background: var(--surface-card); color: var(--body); font-size: 12px; font-weight: 600; text-align: center; box-shadow: inset 0 0 0 1px var(--hairline); line-height: 1.2; }
.prof i { font-size: 20px; color: var(--muted); }
.prof[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); box-shadow: none; }
.prof[aria-pressed="true"] i { color: var(--on-primary); }

/* ------------------------------------------------------------ Stats / ranking */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-xs); margin-bottom: var(--s-lg); }
.stat { background: var(--surface-card); border-radius: var(--r-lg); padding: var(--s-md) var(--s-sm); }
.stat b { display: block; color: var(--primary); font-size: 32px; font-weight: 700; letter-spacing: -1.5px; line-height: 1; }
.stat span { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); font-weight: 500; }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: var(--s-xs); align-items: end; margin-bottom: var(--s-md); }
.podium-item { background: var(--surface-card); border-radius: var(--r-lg); padding: var(--s-md) var(--s-xs); text-align: center; min-width: 0; }
.podium-item.first { background: var(--primary); color: var(--on-primary); padding-top: var(--s-lg); }
.podium-item .pos { font-size: 12px; font-weight: 700; letter-spacing: 1.5px; }
.podium-item .name { font-weight: 700; font-size: 14px; margin-top: 6px; color: var(--on-dark); }
.podium-item.first .name { color: var(--on-primary); }
.podium-item .pts { font-size: 28px; font-weight: 700; letter-spacing: -1px; color: var(--primary); line-height: 1.1; margin-top: 4px; }
.podium-item.first .pts { color: var(--on-primary); font-size: 36px; }
.podium-item .lvl { font-size: 11px; color: var(--muted); margin-top: 2px; }
.podium-item.first .lvl { color: #3a3a1f; }
.rank-row { display: flex; align-items: center; gap: var(--s-sm); background: var(--surface-card); border-radius: var(--r-md); padding: var(--s-sm) var(--s-md); }
.rank-row.is-me { box-shadow: inset 0 0 0 2px var(--primary); }
.rank-pos { width: 28px; font-weight: 700; color: var(--muted); font-size: 15px; }
.rank-name { color: var(--on-dark); font-weight: 600; }
.rank-pts { font-weight: 700; color: var(--on-dark); font-size: 17px; }
.rank-pts small { font-size: 11px; color: var(--muted); font-weight: 500; }
.rules { margin-top: var(--s-lg); }
.rules-list { list-style: none; padding: 0; margin: var(--s-xs) 0 0; display: grid; gap: 8px; font-size: 14px; }
.rules-list li { display: flex; justify-content: space-between; gap: var(--s-sm); }
.rules-list b { color: var(--primary); }

/* ------------------------------------------------------------ Perfil */
.profile-hero { display: flex; align-items: center; gap: var(--s-md); margin-bottom: var(--s-lg); }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-size: 26px; flex: none; }
.level-bar { height: 8px; background: var(--surface-elevated); border-radius: 4px; overflow: hidden; margin: var(--s-xs) 0 6px; }
.level-bar span { display: block; height: 100%; background: var(--primary); }
.menu { display: flex; flex-direction: column; background: var(--surface-card); border-radius: var(--r-lg); overflow: hidden; }
.menu-item { display: flex; align-items: center; gap: var(--s-sm); min-height: 56px; padding: 0 var(--s-md); border: 0; background: none; text-align: left; color: var(--on-dark); font-weight: 500; border-bottom: 1px solid var(--hairline); text-decoration: none; }
.menu-item:last-child { border-bottom: 0; }
.menu-item > i:first-child { width: 22px; color: var(--muted); }
.menu-item .fa-chevron-right { margin-left: auto; color: var(--muted-soft); font-size: 12px; }
.code-box { font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace; font-size: 22px; letter-spacing: 2px; text-align: center; color: var(--on-dark); background: var(--canvas); border-radius: var(--r-md); padding: var(--s-md); margin: var(--s-md) 0; box-shadow: inset 0 0 0 1px var(--hairline-strong); user-select: all; }
.info-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-sm); }
.info-list li { display: flex; gap: var(--s-sm); font-size: 14px; }
.info-list li i { color: var(--primary); width: 20px; margin-top: 3px; flex: none; }
.info-list strong { color: var(--on-dark); }

/* ------------------------------------------------------------ Legenda / onboarding */
.legend { display: grid; gap: var(--s-xs); }
.legend-row { display: flex; align-items: center; gap: var(--s-sm); font-size: 14px; }
.legend-swatch { width: 18px; height: 18px; border-radius: 50%; flex: none; }
.onboard-hero { background: var(--primary); color: var(--on-primary); border-radius: var(--r-lg); padding: var(--s-lg); margin-bottom: var(--s-md); }
.onboard-hero h2 { color: var(--on-primary); font-size: 28px; letter-spacing: -1px; line-height: 1.15; }
.onboard-hero p { margin-top: var(--s-xs); font-size: 15px; }

/* ------------------------------------------------------------ Empty / toast / misc */
.empty { text-align: center; padding: var(--s-xxl) var(--s-md); color: var(--muted); }
.empty i { font-size: 36px; color: var(--muted-soft); margin-bottom: var(--s-sm); display: block; }
.empty strong { display: block; color: var(--on-dark); margin-bottom: 4px; }
.skeleton { height: 88px; border-radius: var(--r-lg); background: linear-gradient(90deg, var(--surface-card), var(--surface-elevated), var(--surface-card)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); z-index: 2000; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 32px); padding: 14px 18px; border-radius: var(--r-md);
  background: var(--on-dark); color: var(--canvas); font-size: 14px; font-weight: 600; display: flex; gap: 10px; align-items: center;
}
.toast.toast-error { background: var(--danger); color: #fff; }
.toast.toast-ok { background: var(--primary); color: var(--on-primary); }
.emergency { display: flex; gap: var(--s-sm); align-items: center; margin-top: var(--s-lg) !important; padding: var(--s-md); border-radius: var(--r-lg); background: var(--surface-card); text-decoration: none; color: var(--on-dark); box-shadow: inset 0 0 0 1px rgba(239,68,68,.35); }
.emergency i { color: var(--danger); font-size: 20px; }
.emergency strong { display: block; }
.emergency small { color: var(--muted); font-size: 12px; }
.divider { height: 1px; background: var(--hairline); margin: var(--s-lg) 0; border: 0; }
.center { text-align: center; }
.mt-sm { margin-top: var(--s-sm); } .mt-md { margin-top: var(--s-md); } .mt-lg { margin-top: var(--s-lg); }

/* ------------------------------------------------------------ Tablet / desktop */
@media (min-width: 768px) {
  h1 { font-size: 40px; letter-spacing: -1.5px; }
  .type-grid { grid-template-columns: repeat(3, 1fr); }
  .sheet { bottom: var(--s-md); border-radius: var(--r-lg); max-height: 86vh; left: var(--s-md); right: var(--s-md); }
  .sheet-footer { border-radius: 0 0 var(--r-lg) var(--r-lg); }
  .here-card { left: 50%; transform: translateX(-50%); right: auto; width: 520px; }
  .stat b { font-size: 48px; }
}
@media (min-width: 1024px) {
  .tabbar { top: 0; bottom: 0; right: auto; width: 88px; height: 100%; grid-template-columns: 1fr; grid-template-rows: repeat(5, 72px); align-content: center; border-top: 0; border-right: 1px solid var(--hairline); padding: 0; }
  .tabbar-fab { margin: 0; box-shadow: none; }
  #app { inset: 0 0 0 88px; }
  .toast { bottom: var(--s-lg); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* rótulos só em zoom próximo; área em alerta pulsa */
#map.hide-labels .area-label { display: none; }
.leaflet-interactive.area-alert { animation: pulse 1.4s ease-in-out infinite; }
.guard-banner span { display: block; font-size: 14px; font-weight: 500; }
.guard-banner .icon-btn { background: rgba(0,0,0,.2); color: inherit; }

/* ------------------------------------------------------------ Tabbar sem ranking */
/* ------------------------------------------------------------ Botão flutuante "Relatar" */
:root { --fab: 64px; }
.report-fab {
  position: fixed; z-index: 800; right: var(--s-sm); bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--s-md));
  width: var(--fab); height: var(--fab); border: 0; border-radius: var(--r-lg);
  background: var(--primary); color: var(--on-primary);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 700; letter-spacing: .2px;
  box-shadow: 0 0 0 4px rgba(10,10,10,.55);
}
.report-fab i { font-size: 24px; }
.report-fab:active { background: var(--primary-active); transform: scale(.96); }
body[data-view="perfil"] .report-fab, body[data-view="ranking"] .report-fab { display: none; }
/* no mapa, os botões secundários sobem e o cartão "onde estou" libera o espaço do FAB */
.map-side { bottom: calc(var(--s-md) + var(--fab) + var(--s-sm)); }
.here-card { right: calc(var(--s-sm) + var(--fab) + var(--s-xs)); min-height: var(--fab); }
.view[data-view="alertas"] { padding-bottom: calc(var(--fab) + var(--s-xl)); }
.toast { bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--fab) + 28px); }
@media (min-width: 1024px) {
  .report-fab { bottom: var(--s-lg); right: var(--s-lg); }
  .toast { bottom: var(--s-lg); }
}
.opt { margin-left: 6px; font-size: 11px; font-weight: 500; letter-spacing: .3px; text-transform: none; color: var(--muted-soft); }
.install-card { margin-bottom: var(--s-xs); }
.howto { margin: var(--s-sm) 0 0; padding-left: 20px; display: grid; gap: 10px; font-size: 15px; }
.howto i { color: var(--primary); }

/* ------------------------------------------------------------ Splash + apresentação (primeiro acesso) */
body.intro-open { overflow: hidden; }
.intro {
  --intro-bg: var(--primary); --intro-ink: var(--on-primary); --intro-sub: #3a3a1f;
  position: fixed; inset: 0; z-index: 3000; display: flex; flex-direction: column;
  background: var(--intro-bg); color: var(--intro-ink);
  transition: background-color .35s ease, opacity .3s ease, transform .3s ease;
}
.intro[data-tone="dark"] { --intro-bg: var(--canvas); --intro-ink: var(--on-dark); --intro-sub: var(--body); }
.intro.is-leaving { opacity: 0; transform: scale(1.02); pointer-events: none; }

.splash {
  position: absolute; inset: 0; z-index: 10; background: var(--canvas);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  animation: splash-out .45s ease 1.5s forwards;
}
.splash-logo { width: 104px; height: 104px; animation: splash-pop .7s cubic-bezier(.2,1.4,.4,1) both; }
.splash-name { margin-top: var(--s-lg); color: var(--on-dark); font-size: 34px; font-weight: 700; letter-spacing: -1.2px; animation: splash-up .5s ease .25s both; }
.splash-tag { margin-top: 6px; color: var(--primary); font-size: 12px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; animation: splash-up .5s ease .4s both; }
@keyframes splash-pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes splash-up { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes splash-out { to { opacity: 0; visibility: hidden; } }

/* barra do topo: voltar · saudação · pular */
.intro-top {
  position: absolute; z-index: 5; top: 0; left: 0; right: 0; height: calc(64px + var(--safe-t));
  padding: var(--safe-t) 16px 0; display: flex; align-items: center; justify-content: space-between;
}
.intro-back {
  width: 44px; height: 44px; border: 0; border-radius: var(--r-lg); display: grid; place-items: center; font-size: 16px;
  background: rgba(10,10,10,.1); color: var(--intro-ink);
}
.intro[data-tone="dark"] .intro-back { background: var(--surface-elevated); }
.intro-hello { font-size: 16px; font-weight: 600; }
.intro-skip { min-height: 44px; padding: 0 4px 0 16px; border: 0; background: none; color: var(--intro-ink); font-size: 15px; font-weight: 600; margin-left: auto; }

/* trilho deslizante */
.intro-track {
  flex: 1; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
  scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
}
.intro-track::-webkit-scrollbar { display: none; }
.intro-slide {
  position: relative; flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; align-items: center;
  padding: calc(64px + var(--safe-t)) max(24px, calc((100% - 420px) / 2)) calc(170px + var(--safe-b));
}
/* manchas orgânicas + pontilhado de fundo (como nas referências) */
.intro-slide::before, .intro-slide::after { content: ''; position: absolute; pointer-events: none; border-radius: 50%; z-index: 0; }
.intro-slide::before { width: 70vw; height: 70vw; max-width: 380px; max-height: 380px; right: -22%; bottom: 6%; border-radius: 42% 58% 60% 40% / 45% 40% 60% 55%; }
.intro-slide::after { width: 46vw; height: 46vw; max-width: 240px; max-height: 240px; left: -16%; top: 18%; border-radius: 60% 40% 45% 55% / 55% 60% 40% 45%; }
.intro-slide.tone-yellow { background: var(--primary); color: var(--on-primary); }
.intro-slide.tone-yellow::before { background: #eef25a; }
.intro-slide.tone-yellow::after { background: radial-gradient(rgba(10,10,10,.16) 1.4px, transparent 1.6px) 0 0 / 10px 10px; border-radius: 30%; }
.intro-slide.tone-dark { background: var(--canvas); color: var(--on-dark); }
.intro-slide.tone-dark::before { background: #141414; }
.intro-slide.tone-dark::after { background: radial-gradient(rgba(250,255,105,.18) 1.4px, transparent 1.6px) 0 0 / 10px 10px; border-radius: 30%; }

.intro-illus { position: relative; z-index: 1; flex: 1; width: 100%; min-height: 200px; max-height: 400px; display: grid; place-items: center; }
.intro-illus svg { width: 108%; height: 100%; max-height: 400px; overflow: visible; }
.intro-slide.is-compact .intro-illus { flex: 0 0 auto; min-height: 0; height: 110px; margin-bottom: var(--s-xs); }
.intro-illus .bob { animation: bob-y 2.4s ease-in-out infinite; }
@keyframes bob-y { 50% { transform: translateY(-6px); } }

.intro-copy { position: relative; z-index: 1; width: 100%; text-align: center; margin-top: var(--s-md); }
.intro-copy h1 { color: inherit; font-size: 30px; line-height: 1.1; letter-spacing: -1.2px; }
.intro-copy p { margin: 10px auto 0; max-width: 320px; font-size: 16px; line-height: 1.5; color: inherit; opacity: .78; }
.intro-copy .intro-small { font-size: 13px; font-weight: 600; opacity: .6; margin-top: var(--s-sm); }
.intro-copy .prof-grid { margin-top: var(--s-lg); text-align: center; }
.intro-copy .prof { min-height: 68px; }
.intro-city { margin: var(--s-md) 0 0; text-align: left; }
.intro-city > span { color: var(--body-strong); }
.intro-howto { margin-top: var(--s-md); text-align: left; background: rgba(10,10,10,.08); border-radius: var(--r-lg); padding: 4px var(--s-md) var(--s-md); }
.intro-howto .howto { font-size: 14px; }
.intro-howto .howto i { color: var(--on-primary); }

/* botão redondo com anel de progresso */
.intro-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; display: flex; flex-direction: column; align-items: center;
  padding: var(--s-sm) 24px calc(var(--s-lg) + var(--safe-b));
}
.intro-next { position: relative; width: 84px; height: 84px; border: 0; padding: 0; background: none; display: grid; place-items: center; }
.intro-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.intro-ring circle { fill: none; stroke-width: 3; }
.ring-track { stroke: rgba(10,10,10,.14); }
.ring-fill { stroke: var(--on-primary); stroke-linecap: round; transition: stroke-dashoffset .45s ease, stroke .3s; }
.intro-next-btn {
  width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; font-size: 20px;
  background: var(--on-primary); color: var(--primary); transition: transform .15s, background-color .3s, color .3s;
}
.intro-next:active .intro-next-btn { transform: scale(.92); }
.intro-next:disabled .intro-next-btn { opacity: .45; }
.intro[data-tone="dark"] .ring-track { stroke: rgba(255,255,255,.14); }
.intro[data-tone="dark"] .ring-fill { stroke: var(--primary); }
.intro[data-tone="dark"] .intro-next-btn { background: var(--primary); color: var(--on-primary); }
.intro-next-label { min-height: 20px; margin-top: 6px; font-size: 13px; font-weight: 600; }
.intro-later { margin-top: 2px; border: 0; background: none; color: inherit; opacity: .7; font-size: 14px; text-decoration: underline; padding: 6px; }
@media (max-height: 720px) {
  .intro-copy h1 { font-size: 26px; }
  .intro-illus { min-height: 140px; }
  .intro-slide { padding-bottom: calc(150px + var(--safe-b)); }
  .intro-next { width: 72px; height: 72px; }
  .intro-next-btn { width: 54px; height: 54px; }
}

@media (min-width: 768px) { .here-card { right: auto; } }
.empty .btn i { display: inline; font-size: inherit; color: inherit; margin: 0; }
