:root {
  color-scheme: dark;
  --bg: #07080d;
  --bg-2: #0d1018;
  --surface: #131722;
  --surface-2: #1a1f2c;
  --line: #262c3b;
  --line-2: #323a4d;
  --text: #eef0f4;
  --text-2: #b6bccb;
  --text-3: #7d8598;
  --accent: #ff8a1f;
  --accent-2: #ffd23a;
  --hot: #ff5a36;
  --cold: #4f8bff;
  --dry: #e0a458;
  --wet: #4fb3bf;
  --good: #3fbf7f;
  --s1: #3987e5; /* categorical slots (dark) */
  --s2: #d95926;
  --s3: #199e70;
  --s4: #c98500;
  --s5: #d55181;
  --radius: 14px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: radial-gradient(1200px 700px at 75% -10%, #1b1430 0%, transparent 60%), radial-gradient(900px 600px at 0% 20%, #0d1a2e 0%, transparent 55%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent-2); }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
.hidden { display: none !important; }

/* ---------- topo ---------- */
.topbar {
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; gap: 24px;
  padding: 12px 28px;
  background: rgba(7, 8, 13, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 17px; white-space: nowrap; }
.brand em { font-style: normal; color: var(--accent); font-weight: 700; }
.nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav a { color: var(--text-2); text-decoration: none; padding: 7px 12px; border-radius: 8px; font-weight: 500; font-size: 14px; white-space: nowrap; }
.nav a:hover { color: var(--text); background: var(--surface); }
.live {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text-2);
  padding: 7px 12px; border-radius: 999px; font: 500 13px var(--font); cursor: pointer; white-space: nowrap;
}
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.live.ok .dot { background: var(--good); box-shadow: 0 0 0 0 rgba(63, 191, 127, 0.6); animation: pulse 2s infinite; }
.live.busy .dot { background: var(--accent-2); animation: pulse 1s infinite; }
.live.err .dot { background: var(--hot); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(63, 191, 127, 0.55); } 70% { box-shadow: 0 0 0 8px rgba(63, 191, 127, 0); } 100% { box-shadow: 0 0 0 0 rgba(63, 191, 127, 0); } }

main { max-width: 1320px; margin: 0 auto; padding: 0 28px; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1.6fr 1fr; gap: 36px; padding: 48px 0 24px; align-items: start; }
.eyebrow {
  /* inline-block: no celular o texto quebra a linha normalmente em vez de virar duas colunas */
  display: inline-block; margin: 0 0 14px; line-height: 1.45;
  padding: 6px 12px; border-radius: 16px; font-size: 13px; font-weight: 600;
  background: rgba(255, 90, 54, 0.12); color: #ffb39e; border: 1px solid rgba(255, 90, 54, 0.35);
}
.hero h1 { font-size: clamp(32px, 4.4vw, 54px); font-weight: 800; line-height: 1.05; }
.hl { background: linear-gradient(90deg, var(--hot), var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--text-2); font-size: 17px; max-width: 720px; margin: 14px 0 26px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.kpi {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-height: 104px;
}
.kpi .label { color: var(--text-3); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.kpi .value { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 15px; color: var(--text-2); font-weight: 600; margin-left: 2px; }
.kpi .hint { color: var(--text-2); font-size: 12.5px; margin-top: 2px; }
.kpi .delta-up { color: #ff9b7a; font-weight: 700; }
.kpi .delta-down { color: #8fb5ff; font-weight: 700; }
.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.intensity { margin-top: 22px; position: relative; padding-bottom: 6px; }
.intensity-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.intensity-scale span {
  text-align: center; padding: 8px 4px; font-size: 12.5px; font-weight: 600; color: rgba(255, 255, 255, 0.85);
}
.intensity-scale span:nth-child(1) { background: #2a3040; border-radius: 8px 0 0 8px; }
.intensity-scale span:nth-child(2) { background: #6b3a1c; }
.intensity-scale span:nth-child(3) { background: #a9471f; }
.intensity-scale span:nth-child(4) { background: #d9592a; }
.intensity-scale span:nth-child(5) { background: #f08a2c; color: #1a0d00; border-radius: 0 8px 8px 0; }
.intensity-scale span.on { outline: 2px solid #fff; outline-offset: -2px; }
.intensity-marker { position: relative; height: 16px; margin-top: 4px; }
.intensity-marker b {
  position: absolute; top: 0; transform: translateX(-50%); transition: left 0.8s cubic-bezier(.2, .8, .2, 1);
  width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 11px solid #fff;
}

.hero-explain { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.hero-explain h3 { font-size: 15px; margin-bottom: 8px; }
.hero-explain ol { margin: 0; padding-left: 20px; color: var(--text-2); }
.hero-explain li { margin: 8px 0; }
.t-dry { color: var(--dry); } .t-wet { color: var(--wet); } .t-hot { color: #ff8a6a; }

/* ---------- blocos ---------- */
.block { padding: 44px 0 12px; }
.block-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 18px; flex-wrap: wrap; }
.block-head h2 { font-size: 28px; font-weight: 800; }
.sub { color: var(--text-2); margin: 6px 0 0; max-width: 760px; }
.controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 18px; min-width: 0; }
.card header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.card h3 { font-size: 16px; }
.src { color: var(--text-3); font-size: 12px; }
.note { color: var(--text-3); font-size: 13px; margin: 8px 0 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-2 > .card { margin-bottom: 18px; }
.chart { width: 100%; height: 340px; }
.chart.tall { height: 380px; }

/* ---------- botões ---------- */
.btn { background: var(--surface-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 14px; font: 600 14px var(--font); cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn.icon { width: 44px; height: 44px; padding: 0; border-radius: 50%; font-size: 15px; background: var(--accent); color: #1a0d00; border: 0; flex: none; }
.btn.ghost { background: transparent; }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { background: transparent; border: 0; color: var(--text-2); padding: 7px 12px; border-radius: 8px; font: 600 13px var(--font); cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.seg button .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.seg button:not(.on) .sw { opacity: 0.35; }
select { background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: 500 13px var(--font); }
.toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--accent); width: 16px; height: 16px; }

/* ---------- globo ---------- */
.globe-wrap {
  position: relative; display: grid; grid-template-columns: 1fr; gap: 10px;
  background: radial-gradient(closest-side, #0e1424 0%, #07080d 100%);
  border: 1px solid var(--line); border-radius: 20px; overflow: hidden; height: min(72vh, 680px); min-height: 420px;
}
/* minmax(0, …) + min-height 0: o canvas do globo não pode empurrar o tamanho da linha/coluna da grade */
.globe-wrap.split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.globe-cell { position: relative; min-width: 0; min-height: 0; height: 100%; overflow: hidden; }
.globe { width: 100%; height: 100%; cursor: grab; }
.globe:active { cursor: grabbing; }
.globe-tag {
  position: absolute; z-index: 2; top: 14px; left: 14px; padding: 6px 12px; border-radius: 999px;
  background: rgba(217, 89, 38, 0.18); border: 1px solid rgba(217, 89, 38, 0.6); font-weight: 700; font-size: 13px;
}
.globe-tag.alt { background: rgba(57, 135, 229, 0.18); border-color: rgba(57, 135, 229, 0.6); }
.globe-tip {
  position: absolute; z-index: 5; pointer-events: none; display: none;
  background: rgba(10, 12, 18, 0.92); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; font-size: 13px; box-shadow: var(--shadow);
  white-space: nowrap;
}
.globe-tip b { font-size: 16px; font-variant-numeric: tabular-nums; }
.globe-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-2); font-weight: 600; background: rgba(7, 8, 13, 0.6); z-index: 4; }

.timeline { display: flex; align-items: center; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.timeline-track { flex: 1; min-width: 220px; }
.timeline-date { font: 500 15px var(--mono); min-width: 128px; text-align: center; background: var(--surface); border: 1px solid var(--line); padding: 8px 12px; border-radius: 10px; }
.timeline-labels { position: relative; height: 18px; font-size: 11px; color: var(--text-3); }
.timeline-labels span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
/* as pontas ficam dentro da trilha: centralizadas, passavam da borda e alargavam a página no celular */
.timeline-labels span:first-child { transform: none; }
.timeline-labels span:last-child { transform: translateX(-100%); }
input[type='range'] { width: 100%; accent-color: var(--accent); height: 26px; }

.colorbar { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; margin-top: 10px; font-size: 12px; color: var(--text-2); }
.colorbar .bar { height: 12px; border-radius: 6px; border: 1px solid var(--line); }
.colorbar .ticks { grid-column: 2; display: flex; justify-content: space-between; color: var(--text-3); font-family: var(--mono); font-size: 11px; }
.colorbar .ticks i { font-style: normal; }

/* ---------- tabela ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table th { text-align: left; color: var(--text-3); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); }
.table tr.current td { background: rgba(217, 89, 38, 0.08); }
.table .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }

/* ---------- Brasil ---------- */
.br-layout { display: grid; grid-template-columns: 1.55fr 1fr; gap: 18px; }
.br-map-wrap { position: relative; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; min-height: 620px; }
.br-map { position: absolute; inset: 0; background: #0b0d14; }
.btn.back { position: absolute; z-index: 600; top: 12px; left: 56px; box-shadow: var(--shadow); }
.br-legend { position: absolute; z-index: 600; left: 14px; bottom: 14px; background: rgba(10, 12, 18, 0.9); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 12px; color: var(--text-2); }
.br-legend .row { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.br-legend .sw { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.br-legend .title { color: var(--text); font-weight: 700; margin-bottom: 4px; }
.alerts-toggle {
  position: absolute; z-index: 600; right: 14px; bottom: 30px; display: flex; align-items: center; gap: 8px;
  background: rgba(10, 12, 18, 0.9); border: 1px solid var(--line-2); color: var(--text); border-radius: 10px;
  padding: 9px 12px; font: 700 13px var(--font); cursor: pointer; box-shadow: var(--shadow); min-height: 40px;
}
.alerts-toggle .dot { width: 12px; height: 12px; border-radius: 3px; background: #fffe00; flex: none; }
.alerts-toggle[aria-pressed='true'] { border-color: #f2d600; background: rgba(60, 54, 0, 0.92); }
.alerts-toggle:disabled { cursor: default; color: var(--text-3); }
.alerts-toggle:disabled .dot { background: #3a4256; }
.alerts-toggle.hidden { display: none; }
.alerts-box { margin: 10px 0; }
.alerts-box h4 { margin: 0 0 6px; font-size: 13px; }
.alert-item { border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 8px; padding: 8px 10px; margin: 6px 0; font-size: 13px; color: var(--text-2); background: var(--bg-2); }
.alert-item b { color: var(--text); }
.alert-item details { margin-top: 4px; }
.alert-item summary { cursor: pointer; color: var(--text-3); font-size: 12.5px; }
.alert-item p { margin: 4px 0 0; font-size: 12.5px; }
.alerts-none { color: var(--text-3); font-size: 13px; margin: 0; }
.regions { position: absolute; z-index: 600; top: 14px; right: 14px; display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; max-width: 70%; }
.regions button { background: rgba(10, 12, 18, 0.88); border: 1px solid var(--line); color: var(--text-2); border-radius: 8px; padding: 6px 10px; font: 600 12px var(--font); cursor: pointer; }
.regions button.on, .regions button:hover { color: var(--text); border-color: var(--accent); }
.br-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px; max-height: 620px; overflow-y: auto; }
.br-panel h3 { font-size: 18px; }
.ranking { list-style: none; padding: 0; margin: 14px 0 0; }
.ranking li { display: grid; grid-template-columns: 44px 1fr 64px; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; cursor: pointer; }
.ranking li:hover { background: var(--surface-2); }
.ranking .uf { font-weight: 800; font-size: 13px; text-align: center; white-space: nowrap; }
.ranking .nm { font-size: 13.5px; }
.ranking .barbg { height: 6px; background: var(--bg-2); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.ranking .barbg i { display: block; height: 100%; border-radius: 3px; }
.ranking .sc { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.state-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.state-head .region { color: var(--text-3); font-size: 13px; font-weight: 600; }
.badge { display: inline-block; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700; margin-top: 10px; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.metric { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.metric .label { font-size: 11px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.metric .value { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; }
.metric .hint { font-size: 11.5px; color: var(--text-2); }
.expect { background: var(--bg-2); border-left: 3px solid var(--accent); border-radius: 8px; padding: 10px 12px; margin: 10px 0; font-size: 13.5px; color: var(--text-2); }
.expect b { color: var(--text); }
.state-chart { height: 230px; width: 100%; }
.uf-label { background: none; border: 0; }
.uf-label div { transform: translate(-50%, -50%); text-align: center; font: 800 11px/1.1 var(--font); color: #fff; text-shadow: 0 1px 3px #000, 0 0 2px #000; white-space: nowrap; pointer-events: none; }
.uf-label small { display: block; font-weight: 600; font-size: 10px; opacity: 0.9; }
.leaflet-container { font-family: var(--font); background: #0b0d14; }
.leaflet-tooltip.br-tip { background: rgba(10, 12, 18, 0.95); color: var(--text); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow); padding: 8px 10px; font-size: 13px; }
.leaflet-tooltip.br-tip::before { display: none; }
.leaflet-control-attribution { background: rgba(7, 8, 13, 0.75) !important; color: var(--text-3) !important; font-size: 10px; }
.leaflet-control-attribution a { color: var(--text-2) !important; }
.leaflet-bar a { background: var(--surface-2) !important; color: var(--text) !important; border-color: var(--line) !important; }

/* ---------- satélite ---------- */
.sat-wrap { position: relative; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; height: min(78vh, 720px); min-height: 460px; }
.sat-map { position: absolute; inset: 0; background: #050608; }
.sat-player {
  position: absolute; z-index: 600; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(720px, calc(100% - 32px));
  display: flex; align-items: center; gap: 14px; padding: 10px 16px; border-radius: 16px;
  background: rgba(30, 36, 50, 0.78); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.12); box-shadow: var(--shadow);
}
.sat-player .btn.icon { background: #fff; color: #111; }
.sat-mid { flex: 1; min-width: 0; }
.sat-time { text-align: center; font-weight: 700; font-size: 15px; }
.toggle.small { font-size: 12px; white-space: nowrap; }
.sat-hint { position: absolute; z-index: 600; top: 14px; left: 14px; max-width: 360px; background: rgba(10, 12, 18, 0.85); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 12.5px; color: var(--text-2); display: none; }
.sat-hint.show { display: block; }

/* ---------- fontes ---------- */
.sources { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.source { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.source h4 { margin: 0 0 4px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.source .st { width: 9px; height: 9px; border-radius: 50%; background: var(--text-3); flex: none; }
.source .st.ok { background: var(--good); } .source .st.err { background: var(--hot); } .source .st.busy { background: var(--accent-2); }
.source p { margin: 2px 0; font-size: 12.5px; color: var(--text-2); }
.source code { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); word-break: break-all; }
.method { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 18px; }
.method summary { cursor: pointer; font-weight: 700; }
.method li { color: var(--text-2); margin: 8px 0; font-size: 14px; }

.footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; max-width: 1320px; margin: 40px auto 0; padding: 22px 28px 40px; color: var(--text-3); font-size: 13px; border-top: 1px solid var(--line); }

.pending { display: grid; place-items: center; height: 100%; color: var(--text-3); font-size: 14px; text-align: center; padding: 20px; }

/* ---------- responsivo ---------- */
@media (max-width: 1080px) {
  .hero, .br-layout { grid-template-columns: 1fr; }
  .br-panel { max-height: none; }
}
@media (max-width: 820px) {
  main { padding: 0 16px; }
  .topbar { padding: 10px 16px; gap: 12px; }
  .nav { display: none; }
  .live { margin-left: auto; }
  .grid-2 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .globe-wrap.split { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); height: 900px; }
  .br-map-wrap { min-height: 480px; }
  /* no celular a legenda e o botão de avisos saem de cima do mapa: ficam numa faixa logo abaixo dele */
  .br-map-wrap { min-height: 0; display: flex; flex-direction: column; }
  .br-map { position: relative; inset: auto; height: 440px; flex: none; }
  .alerts-toggle { position: static; order: 2; align-self: flex-start; margin: 10px 12px 0; padding: 7px 12px; font-size: 12.5px; box-shadow: none; min-height: 36px; }
  .alerts-toggle .long { display: none; }
  .br-legend { position: static; order: 3; display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; background: none; border: 0; border-radius: 0; padding: 8px 12px 12px; font-size: 11.5px; }
  .br-legend .title, .br-legend .days, .br-legend .sev, .br-legend .src { grid-column: 1 / -1; }
  .br-legend .row { margin: 2px 0; }
  .br-legend .sw { width: 12px; height: 12px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .intensity-scale span { font-size: 10.5px; padding: 7px 2px; }
  .sat-player { flex-wrap: wrap; }
}

/* ---------- apoie (Pix) ---------- */
.apoie-btn {
  display: flex; align-items: center; gap: 6px; flex: none;
  background: linear-gradient(90deg, rgba(255, 138, 31, 0.18), rgba(255, 210, 58, 0.14));
  border: 1px solid rgba(255, 170, 40, 0.55); color: #ffd9a0;
  padding: 7px 14px; border-radius: 999px; font: 700 13px var(--font); cursor: pointer; white-space: nowrap;
}
.apoie-btn:hover { border-color: var(--accent-2); color: #fff; }
.pix-open, .pix-open body { overflow: hidden; }
.pix-modal { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.pix-modal.hidden { display: none; }
.pix-backdrop { position: absolute; inset: 0; background: rgba(3, 4, 8, 0.72); backdrop-filter: blur(4px); animation: pixFade 0.2s ease; }
.pix-card {
  position: relative; width: min(400px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto;
  background: linear-gradient(180deg, #1a1f2c, #11151f); border: 1px solid var(--line-2); border-radius: 22px;
  padding: 26px 24px 18px; text-align: center; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6); animation: pixUp 0.25s ease;
}
.pix-x { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--text-2); font-size: 16px; cursor: pointer; }
.pix-heart { font-size: 34px; line-height: 1; }
.pix-card h3 { font-size: 22px; margin-top: 8px; }
.pix-text { color: var(--text-2); font-size: 14.5px; line-height: 1.5; margin: 8px 0 14px; }
.pix-text b { color: var(--text); }
.pix-qr { background: #fff; border-radius: 16px; padding: 10px; width: 216px; height: 216px; margin: 0 auto; }
.pix-qr svg { display: block; width: 100%; height: 100%; }
.pix-key { margin: 12px 0 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.pix-key span { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.pix-key code { display: block; font: 500 13px var(--mono); color: var(--text); word-break: break-all; margin-top: 3px; }
.pix-btn {
  width: 100%; min-height: 48px; border: 0; border-radius: 12px; cursor: pointer;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #1a0d00; font: 800 16px var(--font);
}
.pix-btn.done { background: var(--good); color: #04150c; }
.pix-link { display: block; margin: 8px auto 0; background: none; border: 0; color: var(--text-3); font: 500 13px var(--font); text-decoration: underline; cursor: pointer; padding: 6px; min-height: 32px; }
.pix-link.done { color: var(--good); text-decoration: none; }
.pix-to { color: var(--text-3); font-size: 12.5px; margin: 6px 0 0; }
.pix-to b { color: var(--text-2); }
.pix-actions { display: flex; gap: 8px; justify-content: center; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.pix-later { background: transparent; border: 1px solid var(--line); color: var(--text-2); border-radius: 10px; padding: 9px 14px; min-height: 40px; font: 600 13.5px var(--font); cursor: pointer; }
.pix-later:hover { color: var(--text); border-color: var(--line-2); }
@keyframes pixFade { from { opacity: 0; } }
@keyframes pixUp { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.apoie-box {
  display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: center;
  background: linear-gradient(120deg, rgba(255, 138, 31, 0.1), rgba(255, 210, 58, 0.04) 60%), var(--surface);
  border: 1px solid rgba(255, 170, 40, 0.35); border-radius: 22px; padding: 28px;
}
.apoie-box h2 { font-size: 26px; }
.apoie-box .sub { max-width: 560px; }
.apoie-pix { text-align: center; }
@media (max-width: 820px) {
  .apoie-btn { padding: 7px 10px; }
  .apoie-btn .apoie-txt { display: none; }
  .apoie-box { grid-template-columns: 1fr; padding: 20px; gap: 16px; }
  /* o selo "Ao vivo" encolhe para caber o botão de apoio no topo */
  .live { min-width: 0; flex-shrink: 1; }
  #liveText { overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 480px) {
  .topbar { gap: 8px; }
  #liveText { display: none; }
  .live { padding: 9px 11px; }
}

/* ---------- telespectadores agora ---------- */
.viewers {
  position: fixed; left: 14px; bottom: 14px; z-index: 900; display: flex; align-items: center; gap: 7px;
  background: rgba(10, 12, 18, 0.82); backdrop-filter: blur(8px); border: 1px solid var(--line);
  color: var(--text-2); border-radius: 999px; padding: 5px 11px; font: 600 12px var(--font);
  pointer-events: none; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.viewers .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); animation: pulse 2s infinite; }
@media (max-width: 820px) { .viewers { left: 10px; bottom: 10px; font-size: 11.5px; padding: 4px 10px; } }

/* ---------- celular: menu, toque e alvos maiores ---------- */
.nav-toggle { display: none; }
.touch-hint {
  position: absolute; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center;
  background: rgba(4, 6, 10, 0.5); opacity: 0; transition: opacity 0.25s; pointer-events: none;
}
.touch-hint span { background: rgba(10, 12, 18, 0.92); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 14px; font: 600 14px var(--font); color: var(--text); max-width: 80%; text-align: center; }
.touch-hint.show { opacity: 1; }
@media (max-width: 820px) {
  .nav-toggle {
    display: flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--text); font-size: 18px; cursor: pointer;
  }
  .topbar { position: sticky; }
  .topbar.menu-open .nav {
    display: flex; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 2px; margin: 0;
    padding: 8px 16px 14px; background: rgba(7, 8, 13, 0.97); border-bottom: 1px solid var(--line); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  }
  .topbar.menu-open .nav a { padding: 12px 12px; font-size: 16px; border-radius: 10px; min-height: 44px; }
  .live { min-height: 40px; min-width: 40px; justify-content: center; }
  .pix-link { min-height: 40px; }
  .apoie-btn { min-height: 40px; min-width: 40px; justify-content: center; }
  /* alvos de toque com pelo menos ~40 px */
  .seg button { padding: 10px 13px; min-height: 40px; }
  .regions button { padding: 9px 11px; min-height: 38px; }
  .toggle { min-height: 40px; }
  .toggle input { width: 20px; height: 20px; }
  input[type='range'] { height: 36px; }
  .leaflet-touch .leaflet-bar a { width: 38px; height: 38px; line-height: 38px; }
  .sat-player { gap: 10px; padding: 10px 12px; }
  .sat-mid { flex: 1 1 200px; }
  .sat-player .btn { min-height: 40px; }
}
@media (max-width: 480px) {
  .brand { font-size: 15.5px; gap: 8px; }
  .brand img { width: 30px; height: 30px; }
}

/* botão de janela indisponível para o indicador atual (ex.: 7 dias no índice) */
.seg button:disabled { opacity: 0.38; cursor: not-allowed; }

/* ---------- aviso de dados novos ---------- */
.update-notice {
  position: fixed; z-index: 2500; left: 50%; top: 78px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  background: rgba(19, 23, 34, 0.97); border: 1px solid rgba(255, 170, 40, 0.55); border-radius: 999px; padding: 6px 6px 6px 16px;
  font: 600 14px var(--font); color: var(--text); box-shadow: var(--shadow); animation: pixUp 0.25s ease; max-width: calc(100% - 24px);
}
.update-notice .go { background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #1a0d00; border: 0; border-radius: 999px; padding: 8px 14px; min-height: 36px; font: 800 13px var(--font); cursor: pointer; }
.update-notice .x { background: transparent; border: 0; color: var(--text-3); width: 34px; height: 34px; border-radius: 999px; cursor: pointer; }
@media (max-width: 820px) { .update-notice { top: 70px; font-size: 13px; } }

/* ---------- "Por que essa nota" no painel do estado ---------- */
.why { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0; font-size: 13px; color: var(--text-2); }
.why-h { font-weight: 700; color: var(--text); margin-bottom: 6px; display: flex; justify-content: space-between; }
.why-h span { color: var(--text-3); font-weight: 600; }
.why-row { display: grid; grid-template-columns: 92px 78px 1fr; gap: 8px; padding: 5px 0; border-top: 1px solid var(--line); align-items: baseline; }
.why-l { color: var(--text-3); font-weight: 600; }
.why-v b { color: var(--text); }
.why-v b.pos { color: #ff9b6a; }
.why-v b.neg { color: #8fb5ff; }
.why-f { margin-top: 6px; font-size: 12px; color: var(--text-3); }
@media (max-width: 480px) { .why-row { grid-template-columns: 82px 70px 1fr; } }

/* ---------- rios ---------- */
.rio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.rio-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.rio-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.rio-head h3 { font-size: 16px; }
.rio-head span { color: var(--text-3); font-size: 12px; font-weight: 600; white-space: nowrap; }
.rio-now { margin-top: 8px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rio-now b { font-size: 30px; font-weight: 800; }
.rio-now span { color: var(--text-3); font-size: 13px; }
.rio-vs { margin-top: 4px; font-size: 13px; font-weight: 600; }
.rio-vs.low { color: #ff8a6a; }
.rio-vs.high { color: #4fb3bf; }
.rio-vs2 { margin-top: 2px; font-size: 12.5px; color: var(--text-3); }
.rio-chart { height: 170px; margin-top: 8px; }

/* ---------- o que esperar ---------- */
.exp-summary { list-style: none; margin: 0 0 16px; padding: 14px 18px; display: grid; gap: 8px; background: linear-gradient(120deg, rgba(255, 138, 31, 0.1), rgba(255, 210, 58, 0.03) 60%), var(--surface); border: 1px solid rgba(255, 170, 40, 0.35); border-radius: var(--radius); color: var(--text-2); font-size: 15px; }
.exp-summary li::before { content: '→ '; color: var(--accent); font-weight: 800; }
.exp-summary b { color: var(--text); }
.exp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.exp-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.exp-card h4 { margin: 0 0 6px; font-size: 15px; color: var(--accent-2); }
.exp-card p { margin: 6px 0 0; font-size: 13.5px; color: var(--text-2); line-height: 1.45; }
.exp-card b { color: var(--text); }

/* ---------- mar ---------- */
.mar-lead { margin: 10px 0 0; font-size: 16px; color: var(--text-2); }
.mar-lead b { color: var(--text); }
.mar-layout { display: grid; grid-template-columns: 1.55fr 1fr; gap: 18px; }
.mar-map-wrap { border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: var(--surface); }
.mar-map { height: 560px; background: #0b0d14; }
.mar-colorbar { margin: 0; padding: 10px 14px 12px; }
.mar-overlay { image-rendering: auto; }
.mar-label div { width: max-content; transform: translate(-50%, -50%); font: 800 12px/1 var(--font); color: #fff; background: rgba(11, 13, 20, 0.82); border: 1px solid var(--line); padding: 4px 7px; border-radius: 8px; white-space: nowrap; cursor: pointer; }
.mar-label div.warm { color: #ffb08a; }
.mar-label div.cold { color: #9cc0ff; }
.leaflet-tooltip.mar-box-tip { background: rgba(11, 13, 20, 0.75); color: #e8ecf4; border: 0; box-shadow: none; font-weight: 700; font-size: 11px; }
.leaflet-tooltip.mar-box-tip::before { display: none; }
.mar-side { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px; }
.mar-side h3 { font-size: 18px; }
.mar-side .sub { margin: 6px 0 12px; }
.mar-atl-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--text-2); }
.mar-atl-row b { font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mar-atl-row.big b { font-size: 22px; }
.mar-atl-row small { color: var(--text-3); font-weight: 400; }
.mar-read { margin: 12px 0 8px; font-size: 14.5px; line-height: 1.5; }
.warm { color: #ff8a6a; }
.cold { color: #8fb5ff; }
.mar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-top: 18px; }
.mar-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; scroll-margin-top: 90px; }
.mar-head h3 { font-size: 16px; }
.mar-now { margin-top: 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mar-now b { font-size: 30px; font-weight: 800; }
.mar-now .chip { font-size: 12.5px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.mar-now .chip.warm { color: #ffb08a; background: rgba(255, 122, 58, 0.14); }
.mar-now .chip.cold { color: #9cc0ff; background: rgba(90, 141, 255, 0.14); }
.mar-cmp { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.mar-cmp caption { text-align: left; color: var(--text-3); font-size: 12px; padding-bottom: 4px; }
.mar-cmp td { padding: 3px 0; }
.mar-cmp td:first-child { color: var(--text-2); white-space: nowrap; padding-right: 8px; }
.mar-cmp td:nth-child(2) { width: 100%; }
.mar-cmp td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; padding-left: 8px; }
.mar-cmp i { display: block; height: 6px; border-radius: 3px; width: var(--w); background: var(--c); }
.mar-cmp tr.now td { color: var(--text); font-weight: 800; }
.mar-chart { height: 180px; margin-top: 10px; }
@media (max-width: 1080px) {
  .mar-layout { grid-template-columns: 1fr; }
  .mar-map { height: 440px; }
}
@media (max-width: 560px) {
  .mar-map { height: 380px; }
  .mar-grid { grid-template-columns: 1fr; }
}
.mar-ocean div { width: max-content; transform: translate(-50%, -50%); font: italic 600 14px/1 var(--font); letter-spacing: 0.04em; color: rgba(232, 236, 244, 0.82); text-shadow: 0 1px 3px #000, 0 0 6px #000; pointer-events: none; }
.leaflet-tooltip.mar-hover { background: rgba(11, 13, 20, 0.92); color: #e8ecf4; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4); font-size: 13px; padding: 6px 10px; }
.leaflet-tooltip.mar-hover b { font-size: 15px; }
.leaflet-tooltip.mar-hover span { color: var(--text-3); font-size: 11.5px; }
.leaflet-tooltip.mar-hover::before { border-top-color: rgba(11, 13, 20, 0.92); }
@media (max-width: 700px) { .mar-ocean div { font-size: 11px; } }

/* ---------- opiniões ---------- */
.fb-layout { display: grid; grid-template-columns: 1fr 1.3fr; gap: 18px; align-items: start; }
.fb-form { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px; display: grid; gap: 12px; }
.fb-form label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.fb-form label small { color: var(--text-3); font-weight: 400; }
.fb-form input, .fb-form textarea { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; font-weight: 400; resize: vertical; }
.fb-form input:focus, .fb-form textarea:focus { outline: none; border-color: var(--accent, #ff8a1f); }
.fb-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.fb-row { display: flex; justify-content: space-between; align-items: center; color: var(--text-3); font-size: 12.5px; }
.fb-msg { margin: 0; font-size: 14px; min-height: 1em; color: var(--text-2); }
.fb-msg.ok { color: #6fd39a; }
.fb-msg.err { color: #ff8a8a; }
.fb-list { display: grid; gap: 12px; max-height: 640px; overflow: auto; padding-right: 4px; }
.fb-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.fb-item p { margin: 6px 0 0; white-space: normal; overflow-wrap: anywhere; }
.fb-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--text-3); }
.fb-meta b { color: var(--text); font-size: 14px; }
.fb-reply { margin-top: 10px; border-left: 3px solid var(--accent, #ff8a1f); padding: 4px 0 4px 12px; color: var(--text-2); font-size: 14px; }
.fb-reply b { color: var(--accent, #ff8a1f); font-size: 13px; }
.fb-empty { color: var(--text-3); margin: 0; padding: 14px 4px; }
@media (max-width: 900px) { .fb-layout { grid-template-columns: 1fr; } .fb-list { max-height: none; } }
.fb-row .btn { background: var(--accent); border-color: var(--accent); color: #1a0d00; }
.fb-row .btn:disabled { opacity: 0.6; cursor: default; }

/* ---------- detalhes do selo "Ao vivo" ---------- */
.live-pop { position: fixed; z-index: 1200; width: max-content; max-width: min(320px, calc(100vw - 16px)); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px; font-size: 13.5px; color: var(--text-2); }
.live-pop p { margin: 0 0 6px; }
.live-pop p:last-child { margin: 8px 0 0; }
.live-pop b { color: var(--text); }

/* ---------- barra do topo em telas médias: links mais compactos; abaixo de 1240 px vira menu ☰ ---------- */
@media (min-width: 1241px) and (max-width: 1560px) {
  .nav a { padding: 7px 8px; font-size: 13.5px; }
  .topbar { gap: 14px; }
}
@media (max-width: 1240px) {
  .nav { display: none; }
  .live { margin-left: auto; }
  .nav-toggle {
    display: flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--text); font-size: 18px; cursor: pointer;
  }
  .topbar { position: sticky; }
  .topbar.menu-open .nav {
    display: flex; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 2px; margin: 0;
    padding: 8px 16px 14px; background: rgba(7, 8, 13, 0.97); border-bottom: 1px solid var(--line); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  }
  .topbar.menu-open .nav a { padding: 12px 12px; font-size: 16px; border-radius: 10px; min-height: 44px; }
}

/* ---------- mapa de avisos do INMET (botões de dia na legenda) ---------- */
.br-legend .days { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 8px; }
.br-legend .days button { background: var(--surface-2, #1a1f2c); color: var(--text-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font: 600 12px/1.3 var(--font); cursor: pointer; }
.br-legend .days button.on { background: #f2d600; border-color: #f2d600; color: #1a1600; }
.br-legend .src { margin-top: 6px; font-size: 11px; color: var(--text-3); }
@media (max-width: 700px) {
  .br-legend .sev { display: flex; flex-wrap: wrap; gap: 0 10px; }
  .br-legend .src { display: none; }
  .br-legend .days { margin: 4px 0 4px; }
  .br-legend .days button { padding: 2px 8px; font-size: 11px; }
}
