.ex-page { max-width: 1040px; margin: 0 auto; padding: 0 14px 30px; background: var(--bg); }
.ex-header { padding: 18px 0 14px; border-bottom: 1px solid var(--border); }
.ex-header-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ex-back { color: var(--primary); text-decoration: none; font-size: .86rem; font-weight: 600; }
.ex-print { padding: 6px 10px; border: 1px solid var(--border); border-radius: 5px; background: var(--field); color: var(--text); font: inherit; font-size: .8rem; cursor: pointer; }
.ex-header h1 { text-align: left; font-size: 1.45rem; margin: 10px 0 2px; }
.ex-subtitle, .ex-dates, .ex-state, .ex-note { color: var(--muted); font-size: .82rem; }
.ex-period-bar { display: flex; align-items: center; gap: 8px; padding: 12px 0; }
.ex-period-bar label { font-size: .82rem; font-weight: 650; flex: none; }
.ex-period-bar select { flex: 1; min-width: 0; height: 40px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 5px; background: var(--field); color: var(--field-text); font: inherit; }
.ex-period-bar button { flex: none; width: 40px; height: 40px; padding: 0; border: 1px solid var(--border); border-radius: 5px; background: var(--field); color: var(--text); font-size: 1.4rem; cursor: pointer; }
.ex-state { margin: 0; min-height: 1.1em; }
.ex-state:empty { display: none; }
.ex-state.ex-error { color: var(--danger); }
.ex-dates { margin: 5px 0 12px; }
.ex-section { padding: 14px 0 16px; border-top: 1px solid var(--border); }
.ex-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.ex-section-head h2 { font-size: 1.05rem; margin: 0; }
.ex-section-head span { font-size: .76rem; color: var(--muted); text-align: right; }
.ex-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.ex-kpi { min-height: 90px; display: flex; flex-direction: column; padding: 11px; background: var(--card); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.ex-kpi span { color: var(--muted); font-size: .75rem; line-height: 1.25; }
.ex-kpi strong { color: var(--text); font-size: 1.42rem; line-height: 1.25; margin-top: 6px; font-variant-numeric: tabular-nums; }
.ex-kpi-main strong { color: var(--primary); }
.ex-kpi small { color: var(--muted); font-size: .7rem; margin-top: 3px; }
.ex-note { line-height: 1.35; margin: 9px 0; }
.ex-note:empty { display: none; }
.ex-chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 18px 0 7px; }
.ex-chart-head h3 { font-size: .9rem; margin: 0; }
.ex-chart-head span { color: var(--muted); font-size: .76rem; }
.ex-rain-controls { display: flex; align-items: center; }
.ex-rain-controls select { min-width: 74px; height: 32px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 5px; background: var(--field); color: var(--field-text); font: inherit; font-size: .78rem; }
.ex-chart { position: relative; width: 100%; height: 205px; }
.ex-graph { break-inside: avoid; page-break-inside: avoid; }
.ex-table-scroll { overflow-x: auto; }
.ex-table { width: 100%; border-collapse: collapse; font-size: .86rem; text-align: left; }
.ex-table th, .ex-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); background: none; }
.ex-table th { color: var(--muted); font-size: .75rem; }
.ex-table td:not(:first-child), .ex-table th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.ex-table td strong { display: block; font-size: .97rem; }
.ex-table td small { display: block; color: var(--muted); font-size: .7rem; line-height: 1.3; }
.ex-legend { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: .75rem; }
.ex-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; }
.ex-dot-chalet { margin-left: 10px; background: #c45229; }
.ex-dot-pluvio { background: #187c91; }
.ex-footer { padding: 20px 0; text-align: center; border-top: 1px solid var(--border); }
.ex-footer a { color: var(--primary); text-decoration: none; font-size: .85rem; }
@media (min-width: 700px) {
  .ex-page { padding: 0 24px 40px; }
  .ex-header { padding-top: 28px; }
  .ex-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ex-chart { height: 260px; }
}
@page { size: A4 portrait; margin: 12mm; }
@media print {
  :root { color-scheme: light; }
  .ex-page { max-width: none; margin: 0; padding: 0; background: #fff; color: #111827; font-size: 10pt; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .ex-header { padding: 0 0 8mm; border-color: #cbd5e1; }
  .ex-back, .ex-print, .ex-period-bar, .ex-footer, .ex-rain-controls select { display: none !important; }
  .ex-header h1 { margin-top: 0; color: #111827; }
  .ex-section { border-color: #cbd5e1; padding: 5mm 0; }
  .ex-section:not(.ex-graphs), .ex-graph, .ex-kpis, .ex-table tr { break-inside: avoid; page-break-inside: avoid; }
  .ex-section-head h2, .ex-chart-head h3, .ex-kpi strong, .ex-table td strong { color: #111827; }
  .ex-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); border-color: #cbd5e1; }
  .ex-kpi { min-height: 20mm; padding: 3mm; background: #fff; border-color: #cbd5e1; }
  .ex-kpi-main strong { color: #1d4ed8; }
  .ex-subtitle, .ex-dates, .ex-note, .ex-section-head span, .ex-chart-head span, .ex-legend, .ex-kpi span, .ex-kpi small, .ex-table td small, .ex-table th { color: #475569; }
  .ex-graphs { break-before: page; page-break-before: always; }
  .ex-graph { margin-bottom: 8mm; }
  .ex-chart { height: 43mm; }
  .ex-chart canvas { max-height: 100% !important; }
  .ex-chart-head { margin-top: 5mm; }
  .ex-table-scroll { overflow: visible; }
  .ex-table th, .ex-table td { border-color: #cbd5e1; }
  #rain-legend { display: inline !important; }
}
