/* ============================================================
   HEATING CALCULATOR v4 — Heaton.by
   ============================================================ */

:root {
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --font-body: 'General Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* === LIGHT === */
:root, [data-theme="light"] {
  --color-bg: #f4f6f8;
  --color-surface: #ffffff;
  --color-surface-2: #f9fafb;
  --color-surface-offset: #edf0f3;
  --color-border: #d6dbe2;
  --color-divider: #e2e6eb;
  --color-text: #1a2332;
  --color-text-muted: #5e6b7a;
  --color-text-faint: #9ba5b1;
  --color-primary: #0969a6;
  --color-primary-hover: #075a8e;
  --color-primary-active: #064d78;
  --color-primary-light: #e8f3fb;
  --color-accent: #d97706;
  --color-accent-light: #fef3c7;
  --color-success: #16803c;
  --color-success-light: #dcfce7;
  --color-error: #dc2626;
  --color-error-light: #fee2e2;
  --color-row-stripe: #f7f8fa;
  --color-row-hover: #eef3f8;
  --shadow-sm: 0 1px 2px rgba(26,35,50,0.06);
  --shadow-md: 0 4px 12px rgba(26,35,50,0.08);
  --shadow-lg: 0 12px 32px rgba(26,35,50,0.12);
}

/* === DARK === */
[data-theme="dark"] {
  --color-bg: #0f1419;
  --color-surface: #161b22;
  --color-surface-2: #1c2129;
  --color-surface-offset: #1a1f27;
  --color-border: #30363d;
  --color-divider: #21262d;
  --color-text: #c9d1d9;
  --color-text-muted: #8b949e;
  --color-text-faint: #484f58;
  --color-primary: #58a6dd;
  --color-primary-hover: #79b8e8;
  --color-primary-active: #3d8ec4;
  --color-primary-light: #162636;
  --color-accent: #f59e0b;
  --color-accent-light: #2d2410;
  --color-success: #3fb950;
  --color-success-light: #122117;
  --color-error: #f85149;
  --color-error-light: #2d1214;
  --color-row-stripe: #1c2129;
  --color-row-hover: #22272e;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0f1419; --color-surface: #161b22; --color-surface-2: #1c2129;
    --color-surface-offset: #1a1f27; --color-border: #30363d; --color-divider: #21262d;
    --color-text: #c9d1d9; --color-text-muted: #8b949e; --color-text-faint: #484f58;
    --color-primary: #58a6dd; --color-primary-hover: #79b8e8; --color-primary-active: #3d8ec4;
    --color-primary-light: #162636; --color-accent: #f59e0b; --color-accent-light: #2d2410;
    --color-success: #3fb950; --color-success-light: #122117;
    --color-error: #f85149; --color-error-light: #2d1214;
    --color-row-stripe: #1c2129; --color-row-hover: #22272e;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3); --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  }
}

/* === BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; scroll-behavior: smooth; }
body { min-height: 100dvh; line-height: 1.6; font-family: var(--font-body); font-size: var(--text-base); color: var(--color-text); background-color: var(--color-bg); }
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.25; }
p { text-wrap: pretty; }
button { cursor: pointer; background: none; border: none; }
table { border-collapse: collapse; width: 100%; }
a, button, [role="button"], input, textarea, select {
  transition: color var(--transition-interactive), background var(--transition-interactive), border-color var(--transition-interactive), box-shadow var(--transition-interactive);
}
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: var(--radius-sm); }
::selection { background: color-mix(in srgb, var(--color-primary) 25%, transparent); color: var(--color-text); }

/* === LAYOUT === */
.app-container { max-width: 1200px; margin: 0 auto; padding: 0 var(--space-4); }

/* === HEADER === */
.header { padding: var(--space-4) 0; border-bottom: 1px solid var(--color-divider); margin-bottom: var(--space-8); }
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.logo-area { display: flex; align-items: center; gap: var(--space-3); }
.logo-icon { flex-shrink: 0; border-radius: var(--radius-sm); }
.logo-text { font-size: var(--text-lg); font-weight: 600; color: var(--color-text); }
.theme-toggle { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-md); color: var(--color-text-muted); background: var(--color-surface); border: 1px solid var(--color-border); }
.theme-toggle:hover { color: var(--color-text); background: var(--color-surface-offset); }

/* === INPUT === */
.input-section { margin-bottom: var(--space-10); }
.section-title { font-size: var(--text-xl); font-weight: 700; margin-bottom: var(--space-2); }
.section-desc { color: var(--color-text-muted); font-size: var(--text-sm); margin-bottom: var(--space-6); }
.input-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-6); }
.input-group { display: flex; flex-direction: column; gap: var(--space-1); }
.input-group label { font-size: var(--text-sm); font-weight: 500; color: var(--color-text-muted); }
.input-group input[type="number"], .input-group select {
  padding: var(--space-2) var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--color-surface); font-size: var(--text-base); font-weight: 500; font-variant-numeric: tabular-nums;
}
.input-group input[type="number"]:focus, .input-group select:focus {
  border-color: var(--color-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 15%, transparent); outline: none;
}
.input-group input[type="range"] { width: 100%; accent-color: var(--color-primary); margin-top: var(--space-1); }
.hint { font-size: var(--text-xs); color: var(--color-text-faint); }
.hint a { color: var(--color-primary); text-decoration: none; }
.hint a:hover { text-decoration: underline; }

/* === ENTITY TYPE BADGE === */
.entity-badge {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px 6px; border-radius: 99px; font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.entity-badge.phys { background: var(--color-success-light); color: var(--color-success); }
.entity-badge.legal { background: var(--color-accent-light); color: var(--color-accent); }

/* === SYSTEMS === */
.systems-selection { margin-top: var(--space-6); }
.subsection-title { font-size: var(--text-lg); font-weight: 600; margin-bottom: var(--space-4); }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-3); }
.system-checkbox { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); cursor: pointer; transition: all var(--transition-interactive); user-select: none; }
.system-checkbox:hover { border-color: var(--color-primary); background: var(--color-primary-light); }
.system-checkbox.active { border-color: var(--color-primary); background: var(--color-primary-light); box-shadow: 0 0 0 1px var(--color-primary); }
.system-checkbox input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--color-primary); flex-shrink: 0; }
.system-checkbox .system-label { font-size: var(--text-sm); font-weight: 500; line-height: 1.3; }
.system-checkbox .system-fuel { font-size: var(--text-xs); color: var(--color-text-muted); display: block; }
.system-color-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* === SETTINGS PANEL === */
.settings-panel {
  margin-bottom: var(--space-1); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  background: var(--color-surface); overflow: hidden;
}
.settings-toggle {
  display: flex; align-items: center; gap: var(--space-2); padding: var(--space-4) var(--space-5);
  font-size: var(--text-sm); font-weight: 600; color: var(--color-text-muted); cursor: pointer;
  list-style: none; user-select: none;
}
.settings-toggle::-webkit-details-marker { display: none; }
.settings-toggle::before {
  content: ''; display: inline-block; width: 6px; height: 6px; border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 200ms;
}
details[open] .settings-toggle::before { transform: rotate(45deg); }
.settings-toggle svg { color: var(--color-primary); flex-shrink: 0; }
.settings-toggle:hover { color: var(--color-text); }
.settings-content { padding: 0 var(--space-5) var(--space-5); }
.settings-group { margin-bottom: var(--space-5); }
.settings-group:last-child { margin-bottom: 0; }
.settings-group-title { font-size: var(--text-sm); font-weight: 600; color: var(--color-text); margin-bottom: var(--space-3); padding-bottom: var(--space-2); border-bottom: 1px solid var(--color-divider); }
.settings-desc { font-size: var(--text-xs); color: var(--color-text-faint); line-height: 1.5; margin-bottom: var(--space-3); margin-top: calc(-1 * var(--space-2)); }

/* Fix #1: align inputs on the same baseline regardless of label height */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--space-3); align-items: start; }

.input-group-sm { display: grid; grid-template-rows: auto auto auto; gap: 2px; }
.input-group-sm label { font-size: var(--text-xs); font-weight: 500; color: var(--color-text-muted); min-height: 2.4em; display: flex; align-items: flex-end; }
.input-group-sm input, .input-group-sm select {
  padding: var(--space-1) var(--space-2); border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: var(--color-surface-2); font-size: var(--text-sm); font-variant-numeric: tabular-nums;
}
.input-group-sm input:focus, .input-group-sm select:focus { border-color: var(--color-primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 12%, transparent); outline: none; }
.input-group-sm input[readonly] { opacity: 0.65; cursor: default; }
.input-group-sm .hint { font-size: 0.7rem; color: var(--color-text-faint); margin-top: 1px; }

/* === EXPANDABLE SUB-BLOCKS (equipment & infra) === */
.equip-list,
.infra-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Outer details row — the collapsible per-system block */
.equip-item,
.infra-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  overflow: hidden;
}

.equip-item > summary,
.infra-item > summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
}
.equip-item > summary::-webkit-details-marker,
.infra-item > summary::-webkit-details-marker { display: none; }
.equip-item > summary::before,
.infra-item > summary::before {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 180ms;
  flex-shrink: 0;
}
.equip-item[open] > summary::before,
.infra-item[open] > summary::before { transform: rotate(45deg); }

.equip-item > summary:hover,
.infra-item > summary:hover { color: var(--color-text); }

/* System name in the summary */
.equip-item .sys-name,
.infra-item .sys-name {
  flex: 1;
  font-weight: 600;
  color: var(--color-text);
  font-size: var(--text-xs);
}

/* Total shown in summary */
.equip-item .sys-total,
.infra-item .sys-total {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--color-primary);
  font-size: var(--text-xs);
  margin-left: auto;
}

/* Inner sub-form inside the details */
.equip-sub,
.infra-sub {
  padding: var(--space-2) var(--space-3) var(--space-3);
  border-top: 1px solid var(--color-divider);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Row inside sub-form */
.sub-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.sub-row label {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  font-weight: 500;
  min-width: 160px;
  flex: 1;
}
.sub-row input[type="number"] {
  width: 90px;
  padding: 2px var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.sub-row input[type="number"]:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 12%, transparent);
  outline: none;
}
.sub-row input[type="radio"] {
  accent-color: var(--color-primary);
  width: 14px; height: 14px;
  flex-shrink: 0;
  cursor: pointer;
}

/* Radio option row (for alternative infra variants) */
.radio-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.radio-option label {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  font-weight: 500;
  flex: 1;
  min-width: 140px;
  cursor: pointer;
}
.radio-option input[type="radio"] {
  accent-color: var(--color-primary);
  width: 14px; height: 14px;
  flex-shrink: 0;
  cursor: pointer;
}
.radio-option input[type="number"] {
  width: 90px;
  padding: 2px var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.radio-option input[type="number"]:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 12%, transparent);
  outline: none;
}

/* Obv-select: radio buttons for PP vs Nerzh */
.obv-select {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: var(--space-1) 0;
  border-top: 1px dashed var(--color-divider);
  margin-top: 2px;
}
.obv-select .obv-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-faint);
  font-weight: 600;
  margin-bottom: 2px;
}

/* Hidden total input (hidden, used as the canonical value read by JS) */
input.equip-total-hidden,
input.infra-total-hidden {
  display: none;
}

/* Sub-total display row */
.sub-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-1);
  border-top: 1px dashed var(--color-divider);
  margin-top: 2px;
}
.sub-total-row .sub-total-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text-muted);
}
.sub-total-row .sub-total-val {
  font-size: var(--text-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-primary);
}

/* === MAINTENANCE SECTION === */
.maintenance-hint {
  font-size: 0.7rem;
  color: var(--color-text-faint);
  line-height: 1.4;
  margin-top: 2px;
}

/* === TABLE MAINTENANCE ROW === */
.row-maintenance td { font-weight: 600; }

/* === TOOLTIP === */
.tooltip-wrap { position: relative; display: inline-flex; align-items: center; gap: 4px; }
.tooltip-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--color-primary-light); color: var(--color-primary);
  font-size: 0.6rem; font-weight: 700; cursor: default; line-height: 1;
  flex-shrink: 0;
}
.tooltip-popup {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 100;
  width: 260px;
  padding: var(--space-2) var(--space-3);
  background: var(--color-text);
  color: var(--color-bg);
  border-radius: var(--radius-md);
  font-size: 0.7rem;
  line-height: 1.5;
  pointer-events: none;
  box-shadow: var(--shadow-md);
}
.tooltip-wrap:hover .tooltip-popup,
.tooltip-wrap:focus-within .tooltip-popup { display: block; }

/* === KPI === */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-6); justify-items: center; }
.kpi-card {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  padding: var(--space-5); display: flex; flex-direction: column; width: 100%;
  min-height: 140px; text-align: center; align-items: center; justify-content: space-between;
}
.kpi-label { font-size: var(--text-xs); color: var(--color-text); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: var(--space-2); }
.kpi-system-name { font-size: var(--text-lg); font-weight: 700; line-height: 1.2; margin-bottom: auto; color: var(--color-text); }
.kpi-system-name.highlight { color: var(--color-primary); }
.kpi-value {
  font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--color-text); margin-top: var(--space-3);
}
.kpi-number { font-size: var(--text-lg); font-weight: 700; }
.kpi-currency { font-size: var(--text-xs); font-weight: 500; color: var(--color-text-muted); }
.kpi-suffix { font-size: var(--text-xs); font-weight: 500; color: var(--color-text-muted); }
.kpi-sub { font-size: var(--text-xs); color: var(--color-text-faint); margin-top: var(--space-1); }

/* === CHARTS === */
.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-4); }
.chart-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-5); }
.chart-card-wide { grid-column: 1 / -1; }
.chart-title { font-size: var(--text-base); font-weight: 600; margin-bottom: var(--space-4); }
.chart-container { position: relative; height: 280px; }
.chart-container-tall { height: 340px; }

/* === TABLE === */
.table-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-5); margin-bottom: var(--space-6); overflow: hidden; }
.table-wrapper { overflow-x: auto; margin: 0 calc(-1 * var(--space-5)); padding: 0 var(--space-5); }
#comparison-table { font-size: var(--text-sm); font-variant-numeric: tabular-nums; min-width: 600px; }
#comparison-table th {
  text-align: left; padding: var(--space-3) var(--space-3); font-weight: 600; font-size: var(--text-xs);
  color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 2px solid var(--color-primary); white-space: nowrap; position: sticky; top: 0;
  background: var(--color-surface);
}
#comparison-table td {
  padding: var(--space-2) var(--space-3); white-space: nowrap;
  border-bottom: 1px solid var(--color-divider);
}
#comparison-table tr:last-child td { border-bottom: none; }

/* Zebra striping */
#comparison-table tbody tr.row-even { background: var(--color-surface); }
#comparison-table tbody tr.row-odd { background: var(--color-row-stripe); }

/* Hover highlight */
#comparison-table tbody tr:hover { background: var(--color-row-hover); }

/* Text/info rows */
#comparison-table .row-info td { color: var(--color-text-muted); font-weight: 500; font-size: var(--text-xs); }
#comparison-table .row-separator td {
  height: var(--space-3); border-bottom: none; padding: 0;
}
#comparison-table .row-section-header td {
  padding-top: var(--space-3); padding-bottom: var(--space-2);
  font-weight: 700; font-size: var(--text-xs); text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--color-text-faint);
  border-bottom: 1px solid var(--color-divider);
}

.row-label { font-weight: 500; color: var(--color-text); min-width: 200px; white-space: normal !important; }
#comparison-table .row-highlight { background: var(--color-primary-light) !important; font-weight: 600; }
#comparison-table .row-highlight:hover { background: var(--color-row-hover) !important; }
.best-value { color: var(--color-success); font-weight: 600; }
.worst-value { color: var(--color-error); }

/* Prominent maintenance row */
#comparison-table .row-maintenance td {
  font-weight: 600;
}
#comparison-table .row-maintenance .row-label {
  color: var(--color-accent);
}

/* === ADVANTAGES === */
.advantages-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-6); margin-bottom: var(--space-8); }
.advantages-title { font-size: var(--text-lg); font-weight: 700; margin-bottom: var(--space-6); color: var(--color-primary); }
.advantages-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-5); }
.advantage-item { display: flex; flex-direction: column; gap: var(--space-2); }
.advantage-icon { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-lg); background: var(--color-primary-light); color: var(--color-primary); }
.advantage-item h4 { font-size: var(--text-sm); font-weight: 600; }
.advantage-item p { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.5; }

/* === FOOTER === */
.footer { padding: var(--space-6) 0; border-top: 1px solid var(--color-divider); text-align: center; font-size: var(--text-sm); color: var(--color-text-faint); }


/* === RESULTS DIVIDER === */
.results-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-8) 0 var(--space-6);
}
.results-divider::before,
.results-divider::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
}
.results-divider span {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* === KPI HINTS === */
.kpi-hints {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-2);
  justify-items: center;
  text-align: center;
}
.kpi-hints span {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-weight: 500;
  line-height: 1.3;
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
  .app-container { padding: 0 var(--space-3); }
  .input-grid { grid-template-columns: 1fr 1fr; }
  .checkbox-grid { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
  .chart-container { height: 240px; }
  .advantages-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr 1fr; }
  .settings-toggle { padding: var(--space-3) var(--space-4); font-size: var(--text-xs); }
}
@media (max-width: 420px) {
  .input-grid { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: no-preference) {
  .kpi-card, .chart-card, .table-card, .advantages-card {
    animation: fadeUp 400ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  @keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
}
