/* Mapiia Temperatura — consola de vigilancia térmica del arrozal. */

@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/barlow-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/barlow-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/barlow-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/barlow-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Semi Condensed'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/barlow-semi-condensed-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Semi Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/barlow-semi-condensed-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Semi Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/barlow-semi-condensed-latin-700-normal.woff2') format('woff2'); }

:root {
  color-scheme: light;
  --ground: #f3f5f1;
  --surface: #ffffff;
  --surface-sunk: #e9ede7;
  --ink: #17261f;
  --ink-2: #3d4d45;
  --muted: #5e6e66;
  --rule: #d3dbd4;
  --rule-strong: #aab6ae;
  --focus: #1d5fbf;

  --alert: #b3261e;
  --alert-soft: #fbe9e6;
  --exceeded: #9a6412;
  --exceeded-soft: #fbf0dc;
  --normal: #276b45;
  --normal-soft: #e3f1e8;
  --insufficient: #6b756f;
  --insufficient-soft: #eceeec;
  --no-scene: #9aa39e;

  --terra: #2f5aa8;
  --aqua: #1f8f6e;
  --threshold: #b3261e;

  --font: 'Barlow', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-cond: 'Barlow Semi Condensed', 'Barlow', 'Arial Narrow', system-ui, sans-serif;

  --step--1: 0.8125rem;
  --step-0: 0.9375rem;
  --step-1: 1.125rem;
  --step-2: 1.375rem;
  --step-3: 1.875rem;
  --step-4: 3rem;

  --radius-s: 4px;
  --radius-m: 8px;
  --shadow-float: 0 6px 24px rgba(23, 38, 31, 0.16);
  --gutter: clamp(16px, 2.2vw, 28px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --ground: #121a16;
    --surface: #18221d;
    --surface-sunk: #0f1612;
    --ink: #e6ece7;
    --ink-2: #c3cdc6;
    --muted: #93a39a;
    --rule: #2b3831;
    --rule-strong: #43534a;
    --focus: #7fb0ff;
    --alert: #ff7a6b;
    --alert-soft: #3a1b18;
    --exceeded: #e8b04f;
    --exceeded-soft: #33270f;
    --normal: #6cc793;
    --normal-soft: #16301f;
    --insufficient: #9aa59f;
    --insufficient-soft: #232b27;
    --no-scene: #56615b;
    --terra: #5f88d8;
    --aqua: #2f9a7a;
    --threshold: #ff7a6b;
    --shadow-float: 0 6px 24px rgba(0, 0, 0, 0.45);
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --ground: #121a16;
  --surface: #18221d;
  --surface-sunk: #0f1612;
  --ink: #e6ece7;
  --ink-2: #c3cdc6;
  --muted: #93a39a;
  --rule: #2b3831;
  --rule-strong: #43534a;
  --focus: #7fb0ff;
  --alert: #ff7a6b;
  --alert-soft: #3a1b18;
  --exceeded: #e8b04f;
  --exceeded-soft: #33270f;
  --normal: #6cc793;
  --normal-soft: #16301f;
  --insufficient: #9aa59f;
  --insufficient-soft: #232b27;
  --no-scene: #56615b;
  --terra: #5f88d8;
  --aqua: #2f9a7a;
  --threshold: #ff7a6b;
  --shadow-float: 0 6px 24px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, h4 { font-family: var(--font-cond); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: 0.005em; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--ink); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

/* ───── Topbar ───── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 0 var(--gutter);
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand svg { width: 26px; height: 26px; flex: none; }
.brand-name { font-family: var(--font-cond); font-weight: 700; font-size: var(--step-1); }
.brand-name span { font-weight: 500; color: var(--muted); }
.nav { display: flex; gap: 2px; height: 100%; }
.nav a {
  display: flex; align-items: center; padding: 0 12px; height: 100%;
  text-decoration: none; color: var(--ink-2); font-weight: 500;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current='page'] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.freshness { font-size: var(--step--1); color: var(--muted); text-align: right; line-height: 1.25; }
.freshness strong { color: var(--ink-2); font-weight: 600; }
.freshness.stale strong { color: var(--exceeded); }
.user-menu { position: relative; }
.icon-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 10px; border-radius: var(--radius-s);
  border: 1px solid var(--rule); background: var(--surface); cursor: pointer;
}
.icon-button:hover { border-color: var(--rule-strong); }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; z-index: 30;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-m);
  box-shadow: var(--shadow-float); padding: 6px;
}
.menu-header { padding: 8px 10px 10px; border-bottom: 1px solid var(--rule); margin-bottom: 4px; }
.menu-header small { display: block; color: var(--muted); }
.menu button, .menu a {
  display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none;
  border-radius: var(--radius-s); cursor: pointer; text-decoration: none; color: var(--ink);
}
.menu button:hover, .menu a:hover { background: var(--surface-sunk); }
.nav-toggle { display: none; }

.demo-banner {
  padding: 8px var(--gutter); background: var(--exceeded-soft); color: var(--ink);
  border-bottom: 1px solid var(--exceeded); font-size: var(--step--1);
}
.demo-banner strong { color: var(--exceeded); }

/* ───── Monitor layout ───── */
#app.fixed-layout { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
#app.fixed-layout > main { flex: 1; min-height: 0; }
.monitor {
  display: grid;
  height: 100%;
  min-height: 560px;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: 'reading map' 'ribbon ribbon';
}
.monitor > * { min-width: 0; }
.reading { grid-area: reading; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--rule); }
.map-area { grid-area: map; position: relative; min-height: 420px; background: var(--surface-sunk); }
.ribbon-area { grid-area: ribbon; background: var(--surface); border-top: 1px solid var(--rule); padding: 12px var(--gutter) 14px; }
#map { position: absolute; inset: 0; }

.reading-section { padding: 18px 22px; border-bottom: 1px solid var(--rule); }
.reading-section:last-child { border-bottom: 0; }
.reading-date { font-size: var(--step-2); }
.reading-sub { color: var(--muted); font-size: var(--step--1); margin-top: 2px; }

.segmented { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: var(--radius-s); overflow: hidden; background: var(--surface); }
.segmented button {
  border: 0; background: transparent; padding: 6px 12px; cursor: pointer; min-height: 34px;
  display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 500;
}
.segmented button + button { border-left: 1px solid var(--rule-strong); }
.segmented button[aria-pressed='true'] { background: var(--ink); color: var(--surface); font-weight: 600; }
.segmented button:disabled { color: var(--no-scene); cursor: not-allowed; }
.controls-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* State readout: the headline of the reading panel. */
.state-line { display: flex; align-items: center; gap: 8px; font-family: var(--font-cond); font-weight: 600; font-size: var(--step-1); }
.state-glyph { width: 14px; height: 14px; flex: none; }
.state-alert { color: var(--alert); }
.state-exceeded { color: var(--exceeded); }
.state-normal { color: var(--normal); }
.state-insufficient_data { color: var(--insufficient); }
.state-no_scene { color: var(--no-scene); }
.state-explain { color: var(--ink-2); margin-top: 4px; font-size: var(--step--1); max-width: 42ch; }

.headline-temp { display: flex; align-items: baseline; gap: 10px; margin-top: 14px; }
.headline-temp .value { font-family: var(--font-cond); font-weight: 600; font-size: var(--step-4); line-height: 1; letter-spacing: -0.01em; }
.headline-temp .unit { font-family: var(--font-cond); font-size: var(--step-2); color: var(--ink-2); }
.headline-temp .label { color: var(--muted); font-size: var(--step--1); line-height: 1.2; }
.threshold-gap { margin-top: 4px; font-size: var(--step--1); color: var(--ink-2); }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 14px; margin-top: 16px; }
.stat dt { color: var(--muted); font-size: var(--step--1); }
.stat dd { margin: 0; font-family: var(--font-cond); font-weight: 600; font-size: var(--step-1); }

.meter { margin-top: 16px; }
.meter-label { display: flex; justify-content: space-between; gap: 8px; font-size: var(--step--1); color: var(--ink-2); }
.meter-track { position: relative; height: 10px; margin-top: 6px; background: var(--surface-sunk); border-radius: 2px; overflow: hidden; }
.meter-fill { position: absolute; inset: 0 auto 0 0; background: var(--alert); }
.meter-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); }
.meter-note { margin-top: 5px; font-size: var(--step--1); color: var(--muted); }

.qc-bar { display: flex; height: 10px; margin-top: 8px; border-radius: 2px; overflow: hidden; background: var(--surface-sunk); }
.qc-bar span { display: block; height: 100%; }
.qc-legend { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; margin-top: 8px; font-size: var(--step--1); }
.qc-legend dt { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.qc-legend dd { margin: 0; text-align: right; }
.swatch { width: 10px; height: 10px; border-radius: 2px; flex: none; display: inline-block; }

.section-title { font-size: var(--step-0); font-family: var(--font-cond); font-weight: 600; color: var(--ink); margin-bottom: 8px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.section-title small { font-family: var(--font); font-weight: 400; color: var(--muted); font-size: var(--step--1); }

.simulator input[type='range'] { width: 100%; accent-color: var(--ink); margin: 10px 0 2px; }
.simulator-values { display: flex; justify-content: space-between; font-size: var(--step--1); color: var(--muted); }
.simulator-result { margin-top: 8px; padding: 10px 12px; border-radius: var(--radius-s); background: var(--surface-sunk); font-size: var(--step--1); }
.simulator-result strong { font-family: var(--font-cond); font-size: var(--step-1); }
.link-button { border: 0; background: none; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: var(--step--1); }

.zone-list { list-style: none; margin: 0; padding: 0; }
.zone-list li + li { border-top: 1px solid var(--rule); }
.zone-list button { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 0; border: 0; background: none; text-align: left; cursor: pointer; }
.zone-list button:hover .zone-name { text-decoration: underline; }
.zone-name { font-weight: 600; }
.zone-meta { color: var(--muted); font-size: var(--step--1); grid-column: 1 / -1; }

/* ───── Map overlays ───── */
.map-panel {
  position: absolute; z-index: 5; background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius-m); box-shadow: var(--shadow-float);
}
.legend { left: 12px; bottom: 30px; padding: 10px 12px 8px; width: min(300px, calc(100% - 24px)); }
.legend-title { font-size: var(--step--1); font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.legend-ramp { position: relative; height: 12px; margin: 22px 0 4px; border-radius: 2px; }
.legend-threshold { position: absolute; top: -20px; bottom: -3px; width: 2px; background: var(--ink); transform: translateX(-1px); }
.legend-threshold span { position: absolute; top: -1px; left: 5px; white-space: nowrap; font-size: var(--step--1); font-weight: 600; }
.legend-threshold.flip span { left: auto; right: 5px; }
.legend-ticks { display: flex; justify-content: space-between; font-size: var(--step--1); color: var(--muted); }
.legend-keys { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: var(--step--1); color: var(--ink-2); }
.legend-keys span { display: inline-flex; align-items: center; gap: 5px; }
.hatch { background-image: repeating-linear-gradient(135deg, var(--no-scene) 0 2px, transparent 2px 5px); border: 1px solid var(--no-scene); }
.opacity-control { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--rule); }
.opacity-head { display: flex; justify-content: space-between; align-items: baseline; font-size: var(--step--1); }
.opacity-head label { font-weight: 600; }
.opacity-control input[type='range'] { width: 100%; margin: 6px 0 2px; accent-color: var(--ink); }
.basemap-switch { right: 12px; top: 12px; padding: 4px; display: flex; gap: 2px; }
.basemap-switch button { border: 0; background: none; padding: 6px 10px; border-radius: var(--radius-s); cursor: pointer; font-size: var(--step--1); font-weight: 500; }
.basemap-switch button[aria-pressed='true'] { background: var(--ink); color: var(--surface); }
.map-tooltip {
  position: absolute; z-index: 6; pointer-events: none; padding: 8px 10px; min-width: 150px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-s);
  box-shadow: var(--shadow-float); font-size: var(--step--1); line-height: 1.35;
}
.map-tooltip strong { font-family: var(--font-cond); font-size: var(--step-1); }
.map-message { pointer-events: none; }
.map-message .button { pointer-events: auto; margin-top: 10px; }
.headline-empty { margin-top: 14px; font-family: var(--font-cond); font-weight: 600; font-size: var(--step-2); color: var(--muted); }
.note-inline { margin-top: 12px; padding: 8px 10px; border-left: 3px solid var(--rule-strong); background: var(--surface-sunk); font-size: var(--step--1); color: var(--ink-2); }
.map-message { left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 16px 20px; max-width: 360px; text-align: center; }

.cell-drawer { right: 12px; bottom: 30px; width: min(380px, calc(100% - 24px)); padding: 14px 16px 12px; }
.cell-drawer header { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.cell-drawer h3 { font-size: var(--step-1); }
.close-button { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 2px 6px; }
.close-button:hover { color: var(--ink); }

.maplibregl-ctrl-attrib { font-family: var(--font); font-size: 11px; }
.maplibregl-ctrl-group { border-radius: var(--radius-s) !important; }

/* ───── Ribbon (thermal calendar) ───── */
.ribbon-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 8px; }
.ribbon-head h2 { font-size: var(--step-1); }
.ribbon-keys { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--step--1); color: var(--ink-2); }
.ribbon-keys span { display: inline-flex; align-items: center; gap: 5px; }
.ribbon-scroll { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.ribbon svg { display: block; }
.ribbon .row-label { font-size: 12px; fill: var(--muted); font-family: var(--font); }
.ribbon .month-label { font-size: 12px; fill: var(--ink-2); font-family: var(--font-cond); font-weight: 600; }
.ribbon .day-cell { cursor: pointer; }
.ribbon .day-cell:focus { outline: none; }
.ribbon .day-cell:focus-visible rect.frame, .ribbon .day-cell.selected rect.frame { stroke: var(--ink); stroke-width: 2; }
.ribbon .frame { fill: none; stroke: transparent; }

/* ───── Pages ───── */
.page { max-width: 1240px; margin: 0 auto; padding: 28px var(--gutter) 64px; }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head h1 { font-size: var(--step-3); }
.page-head p { color: var(--ink-2); max-width: 64ch; margin-top: 6px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 18px 20px; }
.panel + .panel { margin-top: 18px; }
.panel-title { font-size: var(--step-1); margin-bottom: 12px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.panel-title small { font-family: var(--font); font-weight: 400; font-size: var(--step--1); color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--rule); border-radius: var(--radius-m); background: var(--surface); margin-bottom: 18px; }
.kpi { padding: 14px 18px; }
.kpi + .kpi { border-left: 1px solid var(--rule); }
.kpi dt { color: var(--muted); font-size: var(--step--1); }
.kpi dd { margin: 4px 0 0; font-family: var(--font-cond); font-weight: 600; font-size: var(--step-3); line-height: 1.05; }
.kpi dd small { font-family: var(--font); font-size: var(--step--1); font-weight: 400; color: var(--muted); }

.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--rule); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.chart .threshold-line { stroke: var(--threshold); stroke-width: 1.5; stroke-dasharray: 6 4; }
.chart .threshold-label { fill: var(--threshold); font-size: 12px; font-weight: 600; font-family: var(--font); }
.chart .series-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .series-terra { stroke: var(--terra); }
.chart .series-aqua { stroke: var(--aqua); }
.chart .dot-terra { fill: var(--terra); }
.chart .dot-aqua { fill: var(--aqua); }
.chart .dot-ring { stroke: var(--surface); stroke-width: 2; }
.chart .band { fill: var(--ink); opacity: 0.08; }
.chart .bar-above { fill: var(--alert); }
.chart .crosshair { stroke: var(--rule-strong); stroke-width: 1; }
.chart .series-label { font-size: 12px; font-weight: 600; font-family: var(--font); }
.chart .label-terra { fill: var(--terra); }
.chart .label-aqua { fill: var(--aqua); }
.chart-tooltip {
  position: absolute; pointer-events: none; z-index: 4; min-width: 180px; padding: 8px 10px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-s); box-shadow: var(--shadow-float);
  font-size: var(--step--1); line-height: 1.4;
}
.chart-tooltip .t-row { display: flex; justify-content: space-between; gap: 12px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: var(--step--1); color: var(--ink-2); margin-top: 6px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-line { width: 18px; height: 0; border-top: 2px solid; display: inline-block; }
.legend-dash { width: 18px; height: 0; border-top: 2px dashed var(--threshold); display: inline-block; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
table.data th { text-align: left; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--rule-strong); white-space: nowrap; }
table.data td { padding: 8px 10px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
table.data td.num, table.data th.num { text-align: right; }
table.data tbody tr:hover { background: var(--surface-sunk); }
table.data button.row-link { border: 0; background: none; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; color: var(--ink); }

.badge { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; white-space: nowrap; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 14px;
  border-radius: var(--radius-s); border: 1px solid var(--ink); background: var(--ink); color: var(--surface);
  font-weight: 600; cursor: pointer; text-decoration: none;
}
.button:hover { filter: brightness(1.15); }
.button.secondary { background: var(--surface); color: var(--ink); border-color: var(--rule-strong); }
.button:disabled { opacity: 0.55; cursor: progress; }
select.select { min-height: 38px; padding: 0 10px; border: 1px solid var(--rule-strong); border-radius: var(--radius-s); background: var(--surface); }

.month-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px 22px; }
.month h3 { font-size: var(--step-0); margin-bottom: 6px; }
.month h3::first-letter { text-transform: uppercase; }
.month-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.month-days .dow { font-size: 11px; color: var(--muted); text-align: center; }
.month-day { aspect-ratio: 1; border-radius: 3px; display: grid; grid-template-rows: 1fr 1fr; overflow: hidden; border: 0; padding: 0; cursor: pointer; background: var(--surface-sunk); position: relative; }
.month-day span { display: block; }
.month-day em { position: absolute; top: 1px; left: 3px; font-style: normal; font-size: 10px; color: var(--ink); mix-blend-mode: normal; }

.prose { max-width: 72ch; }
.prose h2 { font-size: var(--step-2); margin: 32px 0 10px; }
.prose h3 { font-size: var(--step-1); margin: 22px 0 8px; }
.prose p, .prose li { color: var(--ink-2); }
.prose p + p { margin-top: 10px; }
.prose ul { padding-left: 20px; }
.prose li + li { margin-top: 6px; }
.prose code { font-size: 0.92em; background: var(--surface-sunk); padding: 1px 5px; border-radius: 3px; }
.params { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 12px 0; }
.params dt { color: var(--muted); }
.params dd { margin: 0; font-weight: 600; }

.form { display: grid; gap: 14px; max-width: 420px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; }
.field input {
  width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid var(--rule-strong);
  border-radius: var(--radius-s); background: var(--surface);
}
.field .hint { font-size: var(--step--1); color: var(--muted); margin-top: 4px; }
.form-error { color: var(--alert); font-weight: 500; }
.form-ok { color: var(--normal); font-weight: 500; }

/* ───── Login ───── */
.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr); }
.login-visual { position: relative; background: #17261f; color: #e6ece7; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.login-visual h1 { font-size: clamp(2rem, 4vw, 3.4rem); max-width: 14ch; color: #f3f5f1; }
.login-visual p { max-width: 46ch; color: #c3cdc6; margin-top: 14px; }
.login-grid { position: absolute; inset: auto -40px -40px auto; width: 70%; opacity: 0.9; }
.login-form-wrap { display: flex; align-items: center; justify-content: center; padding: 40px var(--gutter); background: var(--surface); }
.login-form-wrap .form { width: 100%; }
.login-form-wrap h2 { font-size: var(--step-2); }

.empty-state { padding: 48px 20px; text-align: center; color: var(--ink-2); }
.empty-state h2 { font-size: var(--step-2); margin-bottom: 8px; }
.loading { color: var(--muted); padding: 24px; }

@media (max-width: 1100px) {
  #app.fixed-layout { height: auto; display: block; }
  .monitor { height: auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: 'map' 'reading' 'ribbon'; }
  .map-area { height: 62vh; min-height: 380px; }
  .reading { border-right: 0; border-top: 1px solid var(--rule); overflow: visible; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n + 3) { border-top: 1px solid var(--rule); }
}
@media (max-width: 760px) {
  .topbar { gap: 10px; }
  .nav-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; top: 56px; left: 0; right: 0; height: auto; flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--rule); box-shadow: var(--shadow-float); padding: 6px var(--gutter); }
  .nav.open { display: flex; }
  .nav a { height: 44px; border-bottom: 0; border-left: 3px solid transparent; }
  .nav a[aria-current='page'] { border-left-color: var(--ink); }
  .freshness { display: none; }
  .login-screen { grid-template-columns: 1fr; }
  .login-visual { min-height: 260px; padding: 28px var(--gutter); }
  .legend { bottom: 12px; }
  .cell-drawer { left: 12px; right: 12px; bottom: 12px; width: auto; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .headline-temp .value { font-size: 2.5rem; }
  .params { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .segmented button[aria-pressed='true'], .basemap-switch button[aria-pressed='true'] { outline: 2px solid CanvasText; }
}
