/* styles.css · pronostico-series-temporales · 1000HW
 * Cache-bust: ?v=1
 * Vanilla CSS · mobile-first · paleta 1000HW (void/acid/concrete/structure)
 * WCAG 2.1 AA compliant · prefers-reduced-motion respetado
 *
 * Diseño: hero + 1 sección de carga + 1 sección de config + 1 sección de resultado
 * Colores uPlot: azul histórico, naranja predicción, banda gris translúcida.
 */

/* ============================================================
 * 0. CUSTOM PROPERTIES (design tokens)
 * ============================================================ */
:root {
  /* Paleta canónica 1000HW */
  --void:        #050505;
  --concrete:    #1A1A1E;
  --structure:   #2A2A30;
  --acid:        #CCFF00;
  --acid-dim:    #A8CC00;
  --softgray:    #9CA3AF;
  --text-light:  #E5E7EB;
  --text-mid:    #B5B7C0;
  --text-dim:    #8B8E98;
  --danger:      #FF6B6B;
  --warn:        #FFB74D;
  --success:     #4ADE80;
  --info:        #60A5FA;

  /* uPlot colors (forecast chart) */
  --forecast-historical:  #60A5FA;  /* blue */
  --forecast-prediction:  #FF8A65;  /* orange */
  --forecast-band:        rgba(255, 138, 101, 0.18);
  --forecast-axis:        #6B7280;
  --forecast-grid:        rgba(255, 255, 255, 0.06);

  /* Tipografía */
  --font-display: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', Monaco, Consolas, monospace;
  --font-body:    'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Espaciado */
  --space-1:  4px;
  --space-2:  8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Otros */
  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 14px;
  --shadow-md: 0 6px 22px rgba(0,0,0,0.45);
  --shadow-lg: 0 14px 50px rgba(0,0,0,0.55);

  /* Transiciones */
  --t-fast: 150ms cubic-bezier(.4,0,.2,1);
  --t-mid:  300ms cubic-bezier(.4,0,.2,1);
  --t-slow: 600ms cubic-bezier(.4,0,.2,1);
}

/* ============================================================
 * 1. RESET + BASE
 * ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background-color: var(--void);
  color: var(--text-light);
  line-height: 1.55;
  font-size: 16px;
  background-image:
    radial-gradient(circle at 20% 0%, rgba(204, 255, 0, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(96, 165, 250, 0.03) 0%, transparent 40%);
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-4);
  line-height: 1.2;
}

h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-top: var(--space-6); }
h3 { font-size: clamp(1.15rem, 2.2vw, 1.35rem); margin-top: var(--space-5); }

p { margin: 0 0 var(--space-4); }

a {
  color: var(--acid);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--t-fast);
}
a:hover { color: var(--acid-dim); }
a:focus-visible { outline: 2px solid var(--acid); outline-offset: 2px; border-radius: 2px; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0;
}

/* Focus-visible global */
*:focus-visible {
  outline: 2px solid var(--accent, var(--acid));
  outline-offset: 2px;
  border-radius: 2px;
}

/* ============================================================
 * 2. SKIP-LINK (WCAG AA)
 * ============================================================ */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--acid);
  color: var(--void);
  padding: var(--space-3) var(--space-4);
  z-index: 1000;
  text-decoration: none;
  font-weight: 700;
  border-radius: 0 0 var(--radius) 0;
  transition: top var(--t-fast);
}
.skip-link:focus { top: 0; }

/* ============================================================
 * 3. CONTAINER
 * ============================================================ */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.accent { color: var(--acid); }
.brand-acid { color: var(--acid); }

/* ============================================================
 * 4. NAV
 * ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5, 5, 5, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--structure);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.nav-back {
  color: var(--text-mid);
  text-decoration: none;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  transition: background var(--t-fast);
}
.nav-back:hover { background: var(--concrete); color: var(--text-light); }
.nav-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--structure);
  border-radius: var(--radius);
  overflow: hidden;
}
.lang-btn {
  padding: var(--space-2) var(--space-3);
  background: transparent;
  color: var(--text-mid);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  transition: background var(--t-fast), color var(--t-fast);
}
.lang-btn:hover { background: var(--concrete); color: var(--text-light); }
.lang-btn.active {
  background: var(--acid);
  color: var(--void);
}
.lang-btn[aria-pressed="true"] {
  background: var(--acid);
  color: var(--void);
}

/* ============================================================
 * 5. HERO
 * ============================================================ */
.hero {
  padding: var(--space-7) 0 var(--space-5);
  text-align: left;
}
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.tag {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 100px;
  letter-spacing: 0.02em;
  border: 1px solid var(--structure);
}
.tag-acid {
  background: rgba(204, 255, 0, 0.1);
  color: var(--acid);
  border-color: rgba(204, 255, 0, 0.25);
}
.tag-priv {
  background: rgba(74, 222, 128, 0.08);
  color: var(--success);
  border-color: rgba(74, 222, 128, 0.22);
}

.hero h1 {
  font-size: clamp(1.9rem, 4.8vw, 3rem);
  margin-bottom: var(--space-5);
  line-height: 1.15;
}

.hero-lede {
  font-size: 1.1rem;
  color: var(--text-mid);
  max-width: 920px;
  margin-bottom: var(--space-5);
}
.hero-lede strong { color: var(--text-light); }

.hero-disclaimer {
  background: var(--concrete);
  border-left: 4px solid var(--acid);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  font-size: 0.95rem;
  color: var(--text-mid);
  max-width: 920px;
}

/* ============================================================
 * 6. MODAL (privacy)
 * FIX C2 (2026-07-05): respeta atributo HTML5 `hidden` — sin esto, el
 * `.modal { display: flex }` sobrescribe el user-agent `[hidden] { display: none }`
 * por specificity CSS y el backdrop atrapa todos los clicks incluso tras
 * `el.hidden = true`.
 * ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.modal:not([hidden]) {
  display: flex;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal-card {
  position: relative;
  background: var(--concrete);
  border: 1px solid var(--structure);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}
.modal-title { margin-bottom: var(--space-3); }
.modal-desc { color: var(--text-mid); margin-bottom: var(--space-4); }
.modal-actions { display: flex; justify-content: flex-end; gap: var(--space-3); }

/* ============================================================
 * 7. TOOL SECTION
 * ============================================================ */
.tool-section { padding: var(--space-5) 0 var(--space-7); }
.tool-card {
  background: var(--concrete);
  border: 1px solid var(--structure);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-md);
}
.data-section { margin-bottom: var(--space-6); }
.section-title { margin-bottom: var(--space-3); display: flex; align-items: center; gap: var(--space-2); }
.section-subtitle { margin-top: var(--space-5); margin-bottom: var(--space-3); color: var(--text-mid); font-size: 1.1rem; }
.panel-hint { color: var(--text-mid); margin-bottom: var(--space-4); font-size: 0.95rem; }

.data-controls { display: flex; flex-direction: column; gap: var(--space-4); margin-bottom: var(--space-4); }
.data-row { display: flex; flex-direction: column; gap: var(--space-2); }
.data-row-inline { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.data-label { font-weight: 600; color: var(--text-light); font-size: 0.95rem; }
.data-select, .data-textarea {
  background: var(--void);
  border: 1px solid var(--structure);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  color: var(--text-light);
  font-family: var(--font-body);
  transition: border-color var(--t-fast);
}
.data-select:focus, .data-textarea:focus { border-color: var(--acid); outline: none; }
.data-textarea {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  min-height: 90px;
  resize: vertical;
}
.data-meta { color: var(--text-dim); font-size: 0.85rem; }
.example-row { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.example-row .data-select { flex: 1; min-width: 0; }

/* Dropzone */
.dropzone {
  border: 2px dashed var(--structure);
  border-radius: var(--radius);
  padding: var(--space-6) var(--space-4);
  text-align: center;
  cursor: pointer;
  background: var(--void);
  transition: border-color var(--t-fast), background var(--t-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}
.dropzone:hover, .dropzone-active {
  border-color: var(--acid);
  background: rgba(204, 255, 0, 0.04);
}
.dropzone-icon { font-size: 2.4rem; }
.dropzone-text { font-weight: 600; }
.dropzone-help { color: var(--text-dim); font-size: 0.85rem; }

/* Preview table */
.preview-wrap {
  background: var(--void);
  border: 1px solid var(--structure);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: 260px;
  overflow-y: auto;
}
.preview-table {
  padding: var(--space-3);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.preview-empty { color: var(--text-dim); font-style: italic; }
.preview-table table { border-collapse: collapse; width: 100%; }
.preview-table th, .preview-table td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--structure);
  text-align: left;
  white-space: nowrap;
}
.preview-table th {
  background: var(--concrete);
  font-weight: 700;
  color: var(--text-light);
  position: sticky;
  top: 0;
}

/* Sheet picker */
.sheet-picker {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* ============================================================
 * 8. FORM
 * ============================================================ */
.form-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.form-row { display: flex; flex-direction: column; gap: var(--space-2); }
.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
.form-row-2col > div { display: flex; flex-direction: column; gap: var(--space-2); }
.form-label { font-weight: 600; font-size: 0.95rem; }
.form-hint { color: var(--text-dim); font-size: 0.82rem; }
.form-input {
  background: var(--void);
  border: 1px solid var(--structure);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  color: var(--text-light);
  font-family: var(--font-body);
  transition: border-color var(--t-fast);
}
.form-input:focus { border-color: var(--acid); outline: none; }
.form-input[type="number"] { font-family: var(--font-mono); }

/* CTA row */
.cta-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding-top: var(--space-3);
}
.compare-hint { color: var(--text-dim); font-size: 0.85rem; }

/* ============================================================
 * 9. BUTTONS
 * ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
  border: 1px solid transparent;
  cursor: pointer;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-lg { padding: var(--space-4) var(--space-6); font-size: 1.05rem; }
.btn-primary {
  background: var(--acid);
  color: var(--void);
}
.btn-primary:hover:not(:disabled) { background: var(--acid-dim); }
.btn-secondary {
  background: var(--structure);
  color: var(--text-light);
  border-color: var(--structure);
}
.btn-secondary:hover:not(:disabled) { background: var(--concrete); border-color: var(--softgray); }
.btn-ghost {
  background: transparent;
  color: var(--text-mid);
  border-color: var(--structure);
}
.btn-ghost:hover:not(:disabled) { color: var(--text-light); border-color: var(--softgray); }

/* ============================================================
 * 10. PROGRESS BAR
 * ============================================================ */
.progress-wrap {
  margin: var(--space-4) 0;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.progress-track {
  flex: 1;
  height: 8px;
  background: var(--structure);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--acid), var(--info));
  transition: width 250ms ease;
}
.progress-label { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-mid); min-width: 40px; text-align: right; }

/* WASM init loading */
.wasm-init {
  background: var(--concrete);
  border: 1px solid var(--structure);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-5) 0;
}
.wasm-init-icon { font-size: 2.5rem; animation: spin 2s linear infinite; }
.wasm-init-text { font-weight: 600; color: var(--text-light); }
.wasm-init-progress { width: 100%; max-width: 320px; height: 6px; background: var(--structure); border-radius: 3px; overflow: hidden; }
.wasm-init-progress-fill { height: 100%; width: 0%; background: var(--acid); transition: width 300ms ease; }

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ============================================================
 * 11. STATS ROW
 * ============================================================ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
  margin: var(--space-4) 0;
}
.stats-row-metrics {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.stat {
  background: var(--void);
  border: 1px solid var(--structure);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
}
.stat-icon { font-size: 1.3rem; }
.stat-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text-light);
}
.stat-label { font-size: 0.85rem; color: var(--text-dim); }
.stat-metric .stat-num { font-size: 1.25rem; }

/* ============================================================
 * 12. CHART
 * ============================================================ */
.chart-wrap {
  background: var(--void);
  border: 1px solid var(--structure);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin: var(--space-4) 0;
}
.forecast-chart {
  width: 100%;
  min-height: 400px;
  height: 400px;
  position: relative;
}
.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--structure);
  font-size: 0.85rem;
}
.legend-item { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--text-mid); }
.legend-swatch {
  display: inline-block;
  width: 24px;
  height: 3px;
  border-radius: 2px;
}
.legend-historical { background: var(--forecast-historical); }
.legend-forecast { background: var(--forecast-prediction); }
.legend-band { background: var(--forecast-band); height: 12px; }

/* uPlot custom styles */
.uplot {
  font-family: var(--font-body) !important;
}
.u-axis {
  color: var(--forecast-axis) !important;
}
.u-legend {
  background: var(--concrete) !important;
  border: 1px solid var(--structure) !important;
  color: var(--text-light) !important;
}

/* ============================================================
 * 13. EXPORT ROW
 * ============================================================ */
.export-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-4) 0;
}

/* ============================================================
 * 14. FORECAST TABLE
 * ============================================================ */
.forecast-table-wrap {
  background: var(--void);
  border: 1px solid var(--structure);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: 460px;
  overflow-y: auto;
  margin-top: var(--space-3);
}
.forecast-table {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.forecast-table table { border-collapse: collapse; width: 100%; }
.forecast-table th, .forecast-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--structure);
  text-align: right;
  white-space: nowrap;
}
.forecast-table th:first-child, .forecast-table td:first-child { text-align: left; }
.forecast-table th {
  background: var(--concrete);
  font-weight: 700;
  color: var(--text-light);
  position: sticky;
  top: 0;
  text-align: right;
}
.forecast-table th:first-child { text-align: left; }
.forecast-table tbody tr:hover { background: var(--concrete); }

/* ============================================================
 * 15. ADSENSE
 * ============================================================ */
.ad-section { margin: var(--space-6) 0; padding: var(--space-4) 0; }
.adsbygoogle { display: block; min-height: 100px; }

/* ============================================================
 * 16. CONTENT SECTIONS
 * ============================================================ */
.content-section { padding: var(--space-6) 0; }
.content-list {
  list-style: none;
  padding-left: 0;
}
.content-list li {
  position: relative;
  padding-left: var(--space-5);
  margin-bottom: var(--space-3);
  color: var(--text-mid);
}
.content-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--acid);
  font-weight: 700;
}

.funcs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-3);
  margin: var(--space-4) 0;
}
.func-card {
  background: var(--concrete);
  border: 1px solid var(--structure);
  border-radius: var(--radius);
  padding: var(--space-3);
  font-size: 0.9rem;
}
.func-card p { margin: 0; color: var(--text-mid); }

.ets-honest {
  background: rgba(255, 183, 77, 0.08);
  border-left: 4px solid var(--warn);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  margin-top: var(--space-4);
  font-size: 0.95rem;
}

/* ============================================================
 * 17. CALLOUTS
 * ============================================================ */
.callout {
  border-radius: var(--radius);
  padding: var(--space-4);
  margin: var(--space-5) 0;
}
.callout-warn {
  background: rgba(255, 183, 77, 0.06);
  border-left: 4px solid var(--warn);
}
.callout-warn h3 { color: var(--warn); margin-bottom: var(--space-3); }

/* ============================================================
 * 18. FAQ
 * ============================================================ */
.faq-list { display: flex; flex-direction: column; gap: var(--space-2); }
.faq-item {
  background: var(--concrete);
  border: 1px solid var(--structure);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
}
.faq-item summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 30px;
  color: var(--text-light);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 0;
  font-size: 1.4rem;
  color: var(--acid);
  font-weight: 400;
  line-height: 1;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item summary:focus-visible { outline: 2px solid var(--acid); outline-offset: 2px; }
.faq-item p { margin-top: var(--space-3); color: var(--text-mid); font-size: 0.95rem; }

/* ============================================================
 * 19. FOOTER
 * ============================================================ */
.footer-disclaimer {
  font-size: 0.88rem;
  color: var(--text-dim);
  font-style: italic;
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--structure);
}
.site-footer {
  padding: var(--space-6) 0;
  border-top: 1px solid var(--structure);
  background: var(--concrete);
  font-size: 0.9rem;
  color: var(--text-mid);
  text-align: center;
}
.site-footer p { margin-bottom: var(--space-2); }
.footer-brand { color: var(--text-light); font-weight: 700; }
.footer-meta { font-size: 0.82rem; color: var(--text-dim); }

/* ============================================================
 * 20. OFFLINE BANNER + DONATION TOAST
 * ============================================================ */
.offline-banner {
  position: fixed;
  bottom: 20px;
  right: 20px;
  max-width: 380px;
  background: var(--concrete);
  border: 1px solid var(--success);
  border-left: 4px solid var(--success);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.85rem;
  color: var(--text-light);
  box-shadow: var(--shadow-md);
  z-index: 90;
  animation: slideInRight 0.4s ease;
}
.offline-banner-icon { color: var(--success); font-weight: 700; font-size: 1.1rem; }
.offline-banner-text { flex: 1; }
.offline-banner-close {
  background: transparent;
  color: var(--text-mid);
  font-size: 1.4rem;
  line-height: 1;
  padding: 0 var(--space-1);
}
.offline-banner-close:hover { color: var(--text-light); }

@keyframes slideInRight {
  from { transform: translateX(110%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.donation-toast {
  position: fixed;
  bottom: 20px;
  left: 20px;
  max-width: 380px;
  background: var(--concrete);
  border: 1px solid var(--structure);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.9rem;
  box-shadow: var(--shadow-md);
  z-index: 90;
  animation: slideInLeft 0.4s ease;
}
.donation-toast-icon { font-size: 1.4rem; }
.donation-toast-content { flex: 1; }
.donation-toast-title { margin: 0; font-weight: 700; color: var(--text-light); }
.donation-toast-subtitle { margin: 2px 0 0; font-size: 0.8rem; color: var(--text-mid); }
.donation-toast-btn {
  background: var(--acid);
  color: var(--void);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.85rem;
}
.donation-toast-btn:hover { background: var(--acid-dim); }
.donation-toast-close {
  background: transparent;
  color: var(--text-mid);
  font-size: 1.3rem;
  line-height: 1;
  padding: 0 var(--space-1);
}
.donation-toast-close:hover { color: var(--text-light); }

@keyframes slideInLeft {
  from { transform: translateX(-110%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ============================================================
 * 21. RESPONSIVE
 * ============================================================ */
@media (max-width: 768px) {
  .nav-inner { flex-wrap: wrap; gap: var(--space-2); }
  .nav-back { font-size: 0.85rem; }
  .nav-brand { font-size: 0.95rem; }
  .lang-btn { padding: 4px 8px; font-size: 0.8rem; }
  .hero { padding: var(--space-5) 0; }
  .tool-card { padding: var(--space-3); }
  .form-row-2col { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .forecast-chart { min-height: 320px; height: 320px; }
  .offline-banner, .donation-toast {
    left: 10px;
    right: 10px;
    bottom: 10px;
    max-width: none;
  }
  .modal-card { padding: var(--space-4); }
  .cta-row { flex-direction: column; align-items: stretch; }
  .cta-row .btn { width: 100%; }
  .export-row { flex-direction: column; }
  .export-row .btn { width: 100%; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .funcs-grid { grid-template-columns: 1fr; }
}

/* ============================================================
 * 22. PRINT
 * ============================================================ */
@media print {
  .nav, .offline-banner, .donation-toast, .ad-section, .wasm-init, .dropzone, .cta-row, .export-row, .modal { display: none !important; }
  body { background: white; color: black; }
  .tool-card { box-shadow: none; border-color: #ddd; }
}

/* ============================================================
 * 23. REDUCED MOTION
 * ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .wasm-init-icon { animation: none; }
}

/* ============================================================
 * 24. UPLOT OVERRIDES
 * ============================================================ */
.u-wrap { background: transparent !important; }
.u-legend th { color: var(--text-light) !important; }
.u-legend td { color: var(--text-mid) !important; }