/* GeoFuego Harmonization — app styles. Written with SI assistance (Claude, Anthropic); reviewed by the team. */
:root { --bg:#0f1115; --panel:#171a21; --card:#1e2230; --text:#e8eaf0; --muted:#9aa3b5; --line:#2a3040; --accent:#f5a623; --warn:#ffb347; --ok:#4fc3f7; --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
* { box-sizing: border-box; }
html, body { margin:0; background:var(--bg); color:var(--text); font-family:var(--font); font-size:15px; line-height:1.4; height:100%; }
body { display:flex; flex-direction:column; height:100vh; overflow:hidden; }
a { color:var(--accent); }
header.top { flex:0 0 auto; display:flex; justify-content:space-between; align-items:flex-start; gap:16px; padding:12px 20px 10px; border-bottom:1px solid var(--line); background:var(--panel); }
.brand { display:flex; align-items:center; gap:18px; min-width:0; }
.globo { height:54px; width:auto; display:block; margin-right:14px; }
.wordmark { display:block; } .wordmark img { height:20px; width:auto; display:block; margin-bottom:6px; }
header h1 { margin:0; font-size:24px; letter-spacing:.2px; } header h1 span { color:var(--accent); font-weight:500; font-size:14px; margin-left:10px; }
header p { margin:3px 0 0; color:var(--muted); max-width:820px; font-size:13px; }
.topright { align-items:center; }
.topright { display:flex; gap:8px; flex-shrink:0; }
.chip { background:var(--card); color:var(--text); border:1px solid var(--line); border-radius:999px; padding:5px 12px; text-decoration:none; font-size:13px; cursor:pointer; }
.chip:hover { border-color:var(--accent); }
main { flex:1 1 auto; min-height:0; overflow:auto; display:grid; grid-template-columns: clamp(420px, calc(100vw - 900px), 50vw) minmax(0, 1fr); gap:14px; padding:14px 20px; align-content:start; }
.panel { background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:12px; }
.map-panel { display:flex; flex-direction:column; gap:8px; position:sticky; top:0; align-self:start; height: calc(100vh - var(--chrome, 200px)); min-height:520px; overflow:hidden; }
#map { flex:1 1 auto; min-height:300px; height:auto; border-radius:8px; background:#222; }
.msg { margin:4px 0 0; font-size:13px; color:var(--warn); width:100%; }
/* narrow screens (after the base rules so these win): one column, page scrolls as a whole, map not sticky, compact header and footer */
@media (max-width: 1000px) {
  body { height:auto; min-height:100vh; overflow:auto; }
  main { grid-template-columns: minmax(0, 1fr); overflow:visible; padding:10px; gap:10px; }
  .map-panel { position:static; max-height:none; height:auto; min-height:0; overflow:visible; }
  #map { height:360px; min-height:260px; }
  header.top { flex-direction:column; align-items:stretch; gap:8px; padding:10px 12px; }
  header h1 { font-size:20px; } header h1 span { display:block; margin:2px 0 0; }
  header p { display:none; }
  .wordmark img { height:16px; }
  .topright { flex-wrap:wrap; align-items:center; }
  .globo { height:36px; margin-right:auto; }
  footer { position:static; padding:8px 12px; }
  .kpi .v { font-size:20px; }
  .rank { columns:1; }
  .btn, .chip { min-height:36px; }
}
.controls { display:flex; flex-wrap:wrap; gap:8px; align-items:flex-end; }
.ctl { display:flex; flex-direction:column; gap:3px; }
.ctl label, .range label { font-size:12px; color:var(--muted); }
select, input[type=number], input[type=month] { background:var(--card); color:var(--text); border:1px solid var(--line); border-radius:6px; padding:6px 8px; font-size:14px; }
select { max-width:200px; }
.latlon input { width:92px; }
.latlon { flex-direction:row; align-items:flex-end; gap:4px; flex-wrap:wrap; }
.latlon label { width:100%; }
.btn { background:var(--card); color:var(--text); border:1px solid var(--line); border-radius:6px; padding:7px 12px; font-size:14px; cursor:pointer; }
.btn:hover { border-color:var(--accent); } .btn.small { padding:4px 10px; font-size:13px; }
.hint { font-size:12px; color:var(--muted); width:100%; }
.attrib { font-size:11px; color:var(--muted); margin:0; }
.results { display:flex; flex-direction:column; gap:12px; }
.empty { color:var(--muted); padding:40px 20px; text-align:center; font-size:16px; }
.summary h2 { margin:0 0 2px; font-size:20px; } .sub { margin:0 0 8px; color:var(--muted); }
.range { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin:6px 0; font-size:13px; }
.range .ym { display:inline-flex; gap:4px; }
input[type=month] { max-width:100%; }
.card { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:12px 14px; }
.card h3 { margin:0 0 8px; font-size:15px; font-weight:600; }
.cardhead { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:8px; }
.tools { display:flex; gap:10px; align-items:center; flex-wrap:wrap; font-size:13px; }
.tog { display:flex; gap:4px; align-items:center; color:var(--muted); cursor:pointer; }
.banner { background:#2b2410; border:1px solid #6b5a1e; color:#ffe2a8; border-radius:8px; padding:8px 10px; margin:6px 0; font-size:13px; }
.banner.info { background:#13232b; border-color:#1f4a5c; color:#bfe6f5; }
.calwrap { position:relative; overflow-x:auto; }
#cal { width:100%; max-width:900px; height:auto; display:block; }
.tip { position:absolute; background:#0b0d12; border:1px solid var(--line); border-radius:6px; padding:6px 8px; font-size:12px; pointer-events:none; max-width:280px; z-index:5; box-shadow:0 4px 14px rgba(0,0,0,.5); }
.legend { display:flex; gap:12px; align-items:center; flex-wrap:wrap; font-size:12px; color:var(--muted); margin:6px 0; }
.legend canvas { height:10px; width:160px; border-radius:3px; }
.note { font-size:12px; color:var(--muted); margin:6px 0 0; }
.note.warn { color:var(--warn); }
.now-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap:10px; }
.kpi { background:var(--panel); border:1px solid var(--line); border-radius:8px; padding:10px; }
.kpi .v { font-size:24px; font-weight:600; } .kpi .l { font-size:12px; color:var(--muted); } .kpi .d { font-size:13px; margin-top:4px; }
.kpi.up .v { color:#ff8a65; } .kpi.down .v { color:var(--ok); }
.grid2 { display:grid; grid-template-columns: 1fr 1fr; gap:12px; } @media (max-width: 1300px) { .grid2 { grid-template-columns: 1fr; } }
canvas#years, canvas#season, canvas#static, canvas#where { width:100%; height:auto; display:block; }
.rank { margin:8px 0 0; padding-left:20px; font-size:13px; columns:2; } .rank li { margin:2px 0; } .rank .tag { color:var(--muted); font-size:11px; }
.how { margin:6px 0 0; padding-left:18px; font-size:13px; color:var(--muted); } .how li { margin:4px 0; }
details summary { cursor:pointer; font-weight:600; }
footer { flex:0 0 auto; padding:8px 20px; border-top:1px solid var(--line); color:var(--muted); font-size:11px; line-height:1.35; background:var(--panel); }
footer p { margin:0; }
.leaflet-container { background:#1b1d22; font-family:var(--font); }
.leaflet-control-home a { display:flex; align-items:center; justify-content:center; width:30px; height:30px; color:#000; }
.u-legend { font-size:12px; }
.map-globo { position:absolute; right:12px; top:12px; z-index:790; height:46px; width:auto; pointer-events:none; filter:drop-shadow(0 1px 3px rgba(0,0,0,.6)); }
.leaflet-container .leaflet-control-attribution, .leaflet-control-attribution { background:transparent; color:rgba(190,196,208,.45); font-size:9px; text-shadow:none; padding:0 4px 1px; }
/* before / after harmonization panel */
.card.step { border-color:#4a3a1a; }
.seg { display:flex; flex-wrap:wrap; align-items:center; gap:6px; background:#151821; border:1px solid var(--line); border-radius:12px; padding:5px 8px; }
.seg-l { font-size:11px; letter-spacing:.8px; text-transform:uppercase; color:var(--muted); margin-right:4px; }
.pill { background:transparent; color:#c9cfdb; border:1px solid transparent; border-radius:8px; padding:5px 12px; font-size:13px; cursor:pointer; font-family:var(--font); }
.pill:hover { color:var(--text); }
.pill.on { border-color:#c2410c; background:#3a1d0e; color:#ffd2b3; box-shadow:0 0 0 1px rgba(194,65,12,.25) inset; }
.pill[data-s="4"].on { border-color:#8b93a5; background:#262a35; color:#e3e6ee; box-shadow:none; }
.pill[data-s="6"].on { border-color:#e5484d; background:#3a1214; color:#ffc9c9; box-shadow:none; }
.pill[data-s="5"].on { border-color:#3b82c4; background:#11263a; color:#bfe0ff; box-shadow:none; }
.step-kpis { display:grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap:10px; margin:4px 0 10px; }
.step-kpis .kpi .v { font-size:26px; }
.step-kpis .kpi.bad .v { color:#ff8a65; } .step-kpis .kpi.good .v { color:var(--accent); } .step-kpis .kpi.ref .v { color:#c9cfdb; }
#step-chart { min-height:260px; }
.step-table { margin:8px 0 6px; font-size:13px; } .step-table summary { color:#c9cfdb; }
.step-table .tblscroll { overflow-x:auto; max-width:100%; margin:8px 0; border:1px solid var(--line); border-radius:8px; }
.step-table table { border-collapse:collapse; width:100%; min-width:560px; font-size:12px; font-variant-numeric:tabular-nums; }
.step-table th, .step-table td { padding:3px 6px; text-align:right; border-bottom:1px solid var(--line); white-space:nowrap; }
.step-table thead th { position:sticky; top:0; background:#151821; color:var(--muted); font-weight:600; font-size:11px; white-space:normal; vertical-align:bottom; }
.step-table tbody th { text-align:left; font-weight:600; color:#c9cfdb; position:sticky; left:0; background:var(--card); } .step-table thead th:first-child { position:sticky; left:0; z-index:1; } .step-table thead th:first-child { text-align:left; }
.step-table tbody tr:last-child th, .step-table tbody tr:last-child td { border-bottom:0; }
.step-table tr.prelim th, .step-table tr.prelim td { color:var(--muted); font-style:italic; }
.step-table .pt { display:block; color:var(--muted); font-size:10px; line-height:1.1; }
.step-table tr.prelim th { white-space:normal; min-width:92px; }
.step-key { display:inline-block; width:14px; height:0; border-top:2px solid; vertical-align:middle; margin-right:6px; }
.case-btns { display:flex; flex-wrap:wrap; gap:8px; }
.case-btns .pill { border-color:var(--line); background:#151821; }
.case-btns .pill.on { border-color:#c2410c; background:#3a1d0e; color:#ffd2b3; }
.case-img { margin:8px 0 0; font-size:13px; } .case-img summary { color:#c9cfdb; }
.case-pair { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:8px 0 6px; max-width:620px; }
.range .end { display:inline-flex; align-items:center; gap:8px; white-space:nowrap; }
.case-pair figure { margin:0; } .case-pair img { display:block; width:100%; height:auto; border-radius:8px; border:1px solid var(--line); }
.case-zoom { display:block; width:100%; padding:0; border:0; background:none; cursor:zoom-in; border-radius:8px; } .case-zoom:hover img, .case-zoom:focus-visible img { border-color:var(--accent); }
/* image viewer: one image over the whole window, zoom and pan */
html.vw-open, html.vw-open body { overflow:hidden; }
.viewer { position:fixed; inset:0; z-index:5000; background:#08090c; display:flex; flex-direction:column; }
.vw-bar { flex:0 0 auto; display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; padding:8px 12px; border-bottom:1px solid var(--line); }
.vw-title { font-size:15px; } .vw-seg { display:flex; gap:6px; } .vw-seg .pill { border-color:var(--line); background:#151821; } .vw-seg .pill.on { border-color:#c2410c; background:#3a1d0e; color:#ffd2b3; }
.vw-tools { margin-left:auto; display:flex; gap:6px; } .vw-tools .btn { min-width:34px; } .vw-tools .btn:disabled { opacity:.4; cursor:default; }
.vw-stage { flex:1 1 auto; position:relative; overflow:hidden; touch-action:none; cursor:zoom-in; user-select:none; } .vw-stage.zoomed { cursor:grab; } .vw-stage.drag { cursor:grabbing; }
.vw-stage img { position:absolute; left:0; top:0; max-width:none; transform-origin:0 0; will-change:transform; -webkit-user-drag:none; }
.vw-foot { flex:0 0 auto; margin:0; padding:6px 12px; font-size:12px; color:var(--muted); border-top:1px solid var(--line); } .vw-foot a { color:#ffd2b3; }
.case-pair figcaption { font-size:12px; color:var(--muted); margin-top:3px; } .case-pair figcaption b { color:#e8eaf0; }
.case-line { margin:10px 0 0; font-size:15px; } .case-line b { color:#ff8a65; font-size:18px; }
.card.valid .kpi .v { color:#ffb347; font-size:22px; white-space:nowrap; }
#ramp { padding:3px 6px; font-size:12px; max-width:96px; }
.cardhead .tools { gap:8px; } .cardhead .tools .tog { font-size:12px; }
.sum-kpis { display:grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap:8px; margin-top:8px; }
.sum-kpis .kpi { padding:8px 10px; border-bottom:2px solid #c2410c; }
.sum-kpis .kpi .l { text-transform:uppercase; letter-spacing:.6px; font-size:10.5px; }
.sum-kpis .kpi .v { font-size:19px; }
.sum-kpis .kpi.where { grid-column:1 / -1; display:flex; align-items:baseline; gap:6px 14px; flex-wrap:wrap; }
.sum-kpis .kpi.where .l { flex-basis:100%; }
.sum-kpis .kpi.where .d { margin-top:0; }
.sum-kpis .kpi .d { font-size:12px; color:var(--muted); }
.seg.mini { padding:2px 4px; border-radius:8px; } .seg.mini .pill { padding:3px 10px; font-size:12px; }
.leaflet-control-pulse a { display:flex !important; align-items:center; justify-content:center; width:30px; height:30px; color:#000; font-size:14px; text-decoration:none; }
.pulse-label { position:absolute; left:50%; bottom:14px; transform:translateX(-50%); z-index:800; background:rgba(15,17,21,.85); color:#ffd2b3; border:1px solid #c2410c; border-radius:10px; padding:4px 14px; font:700 22px system-ui, sans-serif; pointer-events:none; }
.cases-row { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-top:10px; }
.cases-row .case-btns .pill { padding:4px 10px; font-size:12.5px; }
.summary .case-line { margin:8px 0 0; }
.map-chip { display:flex; align-items:center; gap:7px; background:rgba(15,17,21,.82); color:#c9cfdb; border:1px solid #3a3f4e; border-radius:999px; padding:5px 12px 5px 9px; font:500 12px var(--font); cursor:pointer; backdrop-filter:blur(3px); box-shadow:0 1px 4px rgba(0,0,0,.4); }
.map-chip i { width:10px; height:10px; border-radius:50%; background:#4a4f5e; display:inline-block; }
.map-chip.on { color:#ffd2b3; border-color:#c2410c; } .map-chip.on i { background:linear-gradient(135deg,#ffe066,#f5731f 55%,#b4231a); box-shadow:0 0 6px #f5731f; }
.map-chip:hover { border-color:#f5a623; }
.map-chip:disabled { opacity:.45; cursor:default; } .map-chip:disabled:hover { border-color:#3a3f4e; }
.kpi .v .u { font-size:13px; font-weight:500; color:var(--muted); }
.mv-bar { position:absolute; left:10px; right:10px; bottom:10px; z-index:850; display:flex; gap:12px; align-items:center; background:rgba(12,13,18,.9); border:1px solid #3a3f4e; border-radius:14px; padding:8px 12px; backdrop-filter:blur(4px); box-shadow:0 4px 16px rgba(0,0,0,.5); }
.mv-play { flex:0 0 auto; width:44px; height:44px; border-radius:50%; border:0; background:radial-gradient(circle at 35% 30%, #ffb15c, #f5731f 55%, #b4231a); color:#14161c; font-size:16px; font-weight:700; cursor:pointer; box-shadow:0 0 12px rgba(245,115,31,.55); }
.mv-bar.playing .mv-play { font-size:12px; }
.mv-mid { flex:1 1 auto; min-width:0; display:flex; flex-direction:column; gap:4px; }
.mv-title { display:flex; align-items:center; gap:10px; font:12.5px var(--font); color:#e8eaf0; white-space:nowrap; }
.mv-title b { font-family:ui-monospace, SFMono-Regular, Menlo, monospace; font-weight:600; }
.mv-modes { display:flex; gap:2px; background:#1e2230; border-radius:7px; padding:2px; }
.mv-modes button { background:transparent; border:0; color:#9aa3b5; font:11.5px var(--font); padding:2px 8px; border-radius:5px; cursor:pointer; }
.mv-modes button.on { background:#3a1d0e; color:#ffd2b3; }
.mv-label { margin-left:auto; font:700 18px system-ui, sans-serif; color:#ffd2b3; min-width:84px; text-align:right; }
.mv-x { background:transparent; border:0; color:#7d8496; cursor:pointer; font-size:13px; padding:0 2px; }
#mv-scrub { width:100%; accent-color:#f5731f; height:14px; margin:0; }
.mv-area { flex:0 1 auto; min-width:0; max-width:55%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#ffd2b3; font-weight:600; margin-right:4px; }
.mv-scale { display:flex; align-items:center; gap:6px; font:10.5px var(--font); color:#9aa3b5; }
.mv-scale i { flex:1; height:6px; border-radius:3px; background:linear-gradient(90deg, rgb(45,12,80), rgb(140,30,100), rgb(225,75,45), rgb(245,125,25), rgb(253,225,110), rgb(255,250,190)); }
#map .leaflet-bottom { bottom:96px; }
.pulse-label { display:none; }
.warnline { color:var(--warn); }
.step-kpis .kpi .v, .sum-kpis .kpi .v { white-space:nowrap; }
.note.ctx26 { color:#bfe6f5; background:#13232b; border:1px solid #1f4a5c; border-radius:8px; padding:8px 10px; margin-top:8px; }
.summary .case-line { font-size:clamp(11px, 0.92vw, 13.5px); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.summary .case-line b { font-size:1.15em; }
.cases-row { flex-wrap:nowrap; } .cases-row .case-btns { flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; gap:6px; }
.cases-row .case-btns::-webkit-scrollbar { display:none; }
.cases-row .case-btns .pill { white-space:nowrap; font-size:clamp(11px, 0.85vw, 12.5px); padding:4px 9px; }
.cases-row .seg-l { white-space:nowrap; }
.cases-row { flex-wrap:wrap; row-gap:6px; } .cases-row .seg-l { width:100%; } .cases-row .case-btns { width:100%; }

.ask { width:100%; border-collapse:collapse; margin-top:8px; font-size:13px; }
.ask th { text-align:left; color:var(--muted); font-weight:600; padding:6px 8px; border-bottom:1px solid var(--line); }
.ask td { padding:7px 8px; border-bottom:1px solid var(--line); vertical-align:top; } .ask td:first-child { width:46%; }
.asklink { background:none; border:0; padding:0; color:var(--accent); font:inherit; text-align:left; cursor:pointer; } .asklink:hover { text-decoration:underline; }
.flash { outline:2px solid var(--accent); outline-offset:3px; transition:outline-color .3s; }
#map:fullscreen { border-radius:0; }
.leaflet-control-fs a { font-size:18px; line-height:30px; }

header.top p.ver { margin:6px 0 0; font-size:12px; line-height:1.4; color:var(--muted, #9aa); max-width:760px; }
header.top p.ver a { color:inherit; text-decoration:underline; }
