  :root {
    --primary: #1a3a5c;
    --primary-light: #2a5a8c;
    --accent: #3498db;
    --accent-light: #ebf5fb;
    --success: #27ae60;
    --success-bg: #eafaf1;
    --warning: #e67e22;
    --danger: #e74c3c;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-500: #868e96;
    --gray-700: #495057;
    --gray-900: #212529;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
}
* { margin:0; padding:0; box-sizing:border-box; }
  body { font-family:'Segoe UI',-apple-system,BlinkMacSystemFont,sans-serif; background:var(--gray-100); color:var(--gray-900); }

  /* ── NAV ── */
  .topbar {
    /* background:linear-gradient(135deg,var(--primary),var(--primary-light)); */
    background-color:var(--primary);
    margin-top: 100px;
    padding:12px 32px;
    display:flex;
    align-items:center;
    justify-content:space-between;
  }
  .calculator-title {
    padding: 20px 0;
    line-height: 4.5rem;
    margin-right: 24px;
  }
  .calculator-logo {
    width: 180px;
    max-width: 38%;
    height: auto;
    flex-shrink: 0;
  }
  .topbar h1 { color:#fff; font-size:16px; font-weight:600; letter-spacing:-0.3px; }
  .topbar .nav-links { display:flex; gap:20px; }
  .topbar .nav-links a { color:rgba(255,255,255,0.7); text-decoration:none; font-size:13px; }
  .topbar .nav-links a.active { color:#fff; font-weight:600; }
  .topbar .tab-label { background:rgba(255,255,255,0.15); color:#fff; font-size:11px; padding:4px 12px; border-radius:12px; }

  /* ── MAIN LAYOUT ── */
  .main { display:grid; grid-template-columns:380px 1fr; gap:0; min-height:calc(100vh - 48px); }

  /* ── LEFT PANEL ── */
  .panel-left { background:#fff; padding:28px 24px; border-right:1px solid var(--gray-200); overflow-y:auto; }
  .panel-title { font-size:16px; font-weight:700; color:var(--primary); margin-bottom:20px; text-transform:uppercase; letter-spacing:0.5px; }
  .field { margin-bottom:16px; }
  .field label { display:block; font-size:13px; color:var(--gray-700); margin-bottom:5px; font-weight:500; }
  .field input, .field select {
    width:100%; padding:10px 14px; border:1px solid var(--gray-300); border-radius:6px;
    font-size:14px; color:var(--gray-900); background:var(--gray-50); transition:border 0.2s;
  }
  .field input[disabled], .field select[disabled] {
    opacity:0.55;
    cursor:not-allowed;
  }
  .field input:focus, .field select:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px rgba(52,152,219,0.1); }
  .cop-option-block {
    margin-bottom:12px;
  }
  .cop-mode-option {
    display:flex;
    align-items:center;
    gap:8px;
    font-size:13px;
    color:var(--gray-700);
    font-weight:500;
    cursor:pointer;
  }
  .cop-mode-option input[type="radio"] {
    width:auto;
    margin:0;
    accent-color:var(--accent);
  }
  .cop-option-block select,
  .cop-option-block input[type="text"] {
    margin-top:8px;
  }
  .field-group-title { font-size:11px; text-transform:uppercase; letter-spacing:1px; color:var(--accent); font-weight:700; margin:22px 0 10px; }
  .help-text { font-size:11px; color:var(--gray-500); margin-top:4px; line-height:1.5; }
  .help-text strong { color:var(--accent); }
  .advanced-toggle { color:var(--accent); font-size:12px; cursor:pointer; margin:12px 0; display:inline-flex; align-items:center; gap:4px; font-weight:500; }
  .advanced-toggle:hover { text-decoration:underline; }
  .advanced-section { display:none; }
  .advanced-section.open { display:block; }

  /* ── COP builder (tipo de sistema + antigüedad) ── */
  .cop-builder { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:8px; }
  .cop-builder-field label { display:block; font-size:11px; color:var(--gray-500); margin-bottom:4px; font-weight:500; }
  .cop-builder-field select { width:100%; padding:8px 10px; border:1px solid var(--gray-300); border-radius:6px; font-size:13px; color:var(--gray-900); background:var(--gray-50); }
  .cop-builder-field select[disabled] { opacity:0.55; cursor:not-allowed; }
  .cop-estimate { margin-top:10px; font-size:12px; color:var(--gray-700); background:var(--gray-50); border:1px dashed var(--gray-300); border-radius:6px; padding:8px 12px; }
  .cop-estimate strong { color:var(--primary); font-size:15px; }
  .cop-estimate-range { color:var(--gray-500); margin-left:4px; }

  /* ── Selector de escenarios ── */
  .scenario-selector { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:6px; }
  .scenario-option {
    display:flex; flex-direction:column; align-items:center; gap:2px;
    border:1px solid var(--gray-300); border-radius:8px; padding:10px 6px;
    cursor:pointer; text-align:center; transition:border 0.2s, background 0.2s;
  }
  .scenario-option:hover { border-color:var(--accent); }
  .scenario-option input[type="radio"] { accent-color:var(--accent); margin:0; }
  .scenario-option:has(input:checked) { border-color:var(--accent); background:rgba(52,152,219,0.08); }
  .scenario-option .scenario-name { font-size:11px; font-weight:600; color:var(--gray-700); text-transform:uppercase; letter-spacing:0.5px; }
  .scenario-option .scenario-pct { font-size:16px; font-weight:700; color:var(--primary); }
  .scenario-edit { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:8px; }
  .scenario-edit-field label { display:block; font-size:10px; color:var(--gray-500); margin-bottom:3px; }
  .scenario-edit-field input { width:100%; padding:6px 8px; border:1px solid var(--gray-300); border-radius:6px; font-size:13px; background:var(--gray-50); }

  /* ── #7 Fuentes de ahorro (inputs) ── */
  .sources-list { display:flex; flex-direction:column; gap:6px; margin-top:6px; }
  /* label.source-item: gana en especificidad a `.field label { display:block }` */
  label.source-item { display:flex; align-items:center; gap:8px; font-size:13px; color:var(--gray-700); cursor:pointer; margin-bottom:0; }
  .source-item input[type="checkbox"] { width:auto; flex:0 0 auto; margin:0; accent-color:var(--accent); }
  .source-item .source-name { flex:1 1 auto; min-width:0; }
  .source-item .source-weight { flex:0 0 auto; width:62px; padding:5px 8px; border:1px solid var(--gray-300); border-radius:6px; font-size:13px; background:var(--gray-50); text-align:right; }
  .source-item .source-unit { flex:0 0 auto; color:var(--gray-500); font-size:12px; }
  .sources-total { font-size:11px; color:var(--gray-500); margin-top:8px; }
  .sources-total.warn { color:#c0392b; font-weight:600; }

  /* ── #6 Modelo de negocio (inputs) ── */
  .modelo-fields { margin-top:4px; }

  /* ── #8 Campo atenuado cuando no se usa ── */
  .field-muted { opacity:0.5; }

  /* ── RIGHT PANEL ── */
  .panel-right { padding:28px 32px; overflow-y:auto; }
  .results-title { font-size:16px; font-weight:700; color:var(--primary); margin-bottom:16px; text-transform:uppercase; letter-spacing:0.5px; display:flex; justify-content:space-between; align-items:center; }
  .btn-export {
    display:inline-flex; align-items:center; gap:6px; background:var(--primary); color:#fff;
    border:none; padding:10px 20px; border-radius:6px; font-size:13px; font-weight:600; cursor:pointer;
    transition:background 0.2s;
  }
  .btn-export:hover { background:var(--primary-light); }
  .btn-export svg { width:16px; height:16px; }

  /* Hero cards */
  .hero-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:20px; }
  .hero-card { padding:20px; border-radius:var(--radius); color:#fff; text-align:center; }
  .hero-card.green { background:linear-gradient(135deg,#1e8449,var(--success)); }
  .hero-card.blue { background:linear-gradient(135deg,var(--primary),var(--primary-light)); }
  .hero-card .hero-label { font-size:9px; text-transform:uppercase; letter-spacing:1.2px; opacity:0.85; margin-bottom:6px; }
  .hero-card .hero-value { font-size:26px; font-weight:700; }
  .hero-card .hero-band { font-size:10px; opacity:0.85; margin-top:4px; font-weight:500; }
  .hero-card .hero-sub { font-size:10px; opacity:0.7; margin-top:4px; }

  /* Banda de escenarios */
  .scenario-band { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-bottom:18px; }
  .scenario-band-item { border-radius:8px; padding:12px 8px; text-align:center; background:#fff; border:1px solid var(--gray-200); }
  .scenario-band-item.esperado { border-color:var(--success); background:rgba(30,132,73,0.06); }
  .scenario-band-item .sb-label { font-size:10px; text-transform:uppercase; letter-spacing:0.8px; color:var(--gray-500); font-weight:600; }
  .scenario-band-item .sb-pct { font-size:13px; font-weight:600; color:var(--accent); margin-top:2px; }
  .scenario-band-item .sb-value { font-size:18px; font-weight:700; color:var(--primary); margin-top:4px; }
  .scenario-band-item.esperado .sb-value { color:var(--success); }

  /* Nota inline (fuente CO2) — panel derecho oscuro: texto claro */
  .result-note-inline { font-size:10px; color:rgba(255,255,255,0.7); font-style:italic; margin:4px 0 8px; line-height:1.5; }

  /* Tabla de sensibilidad — sobre fondo azul oscuro */
  .sensitivity-intro { font-size:11px; color:rgba(255,255,255,0.75); line-height:1.5; margin-bottom:8px; }
  .sensitivity-table { width:100%; border-collapse:collapse; font-size:12px; margin-bottom:8px; }
  .sensitivity-table th { text-align:left; padding:6px 8px; color:rgba(255,255,255,0.6); font-weight:600; border-bottom:1px solid rgba(255,255,255,0.2); text-transform:uppercase; font-size:10px; letter-spacing:0.5px; }
  .sensitivity-table th:not(:first-child), .sensitivity-table td:not(:first-child) { text-align:right; }
  .sensitivity-table td { padding:6px 8px; border-bottom:1px solid rgba(255,255,255,0.1); color:rgba(255,255,255,0.9); }
  .sensitivity-table tr.sens-current { background:rgba(52,152,219,0.25); font-weight:700; color:#fff; }
  .sens-tag { display:inline-block; font-size:9px; background:var(--accent); color:#fff; padding:1px 6px; border-radius:10px; margin-left:6px; vertical-align:middle; font-weight:600; }

  /* ── #6 Payback hero (solo calculadora avanzada) ── */
  .payback-hero {
    display:flex; flex-direction:column; gap:4px;
    background:linear-gradient(135deg,#1e8449,var(--success));
    color:#fff; border-radius:var(--radius); padding:16px 18px; margin-bottom:10px;
  }
  .payback-hero.negative { background:linear-gradient(135deg,#922b21,#c0392b); }
  .payback-hero .payback-main { display:flex; justify-content:space-between; align-items:baseline; gap:10px; }
  .payback-hero .payback-label { font-size:11px; text-transform:uppercase; letter-spacing:1px; opacity:0.9; }
  .payback-hero .payback-value { font-size:22px; font-weight:700; }
  .payback-hero .payback-sub { font-size:11px; opacity:0.85; }

  /* ── #7 Desglose de fuentes (resultados) ── */
  .sources-breakdown { display:flex; flex-direction:column; gap:8px; margin:6px 0 4px; }
  .source-bar-row { display:flex; flex-direction:column; gap:3px; }
  .source-bar-head { display:flex; justify-content:space-between; font-size:12px; color:#fff; }
  .source-bar-name { font-weight:500; }
  .source-bar-val { opacity:0.8; }
  .source-bar-track { height:8px; border-radius:4px; background:rgba(255,255,255,0.18); overflow:hidden; }
  .source-bar-fill { height:100%; background:linear-gradient(90deg,var(--accent),var(--primary-light)); border-radius:4px; transition:width 0.3s; }

  /* Result sections */
  .result-container {
    float: left;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
}
  .result-section-title {
    font-size:1.75rem;
    text-transform:uppercase;
    letter-spacing:1px;
    color:var(--accent);
    font-weight:700;
    margin:18px 0 8px;
    }
  .result-row {
    display:flex;
    justify-content:space-between;
    padding:5px 0;
    font-size:1.5rem;
}
  /* El tema global define `.highlight { float:left; display:block; ... }`.
     Lo neutralizamos para que la fila destacada ocupe el ancho completo. */
  .panel-right .result-row.highlight {
    float:none;
    display:flex;
    width:100%;
    overflow:visible;
    margin-bottom:0;
    line-height: 1.5;
}
  .result-row .r-label {
    /* color:var(--gray-700);  */
    color: white;
  }
  .result-row .r-value {
    font-weight:700;
    /* color:var(--gray-900);  */
    color: white;
    font-size: 1.75rem;
  }
  .result-row.highlight .r-label { color:var(--success); font-weight:600; }
  .result-row.highlight .r-value { color:var(--success); }

  /* Bar chart */
  .bar-section { background:var(--gray-50); border-radius:var(--radius); padding:16px 20px; margin-top:20px; }
  .bar-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
  .bar-header .bar-title { font-size:11px; text-transform:uppercase; letter-spacing:0.5px; color:var(--gray-700); font-weight:600; }
  .bar-header .bar-pct { font-size:16px; font-weight:700; color:var(--success); }
  .bar-track { width:100%; height:28px; background:var(--gray-200); border-radius:4px; overflow:hidden; display:flex; }
  .bar-paid { background:linear-gradient(90deg,var(--primary),var(--accent)); height:100%; transition:width 0.5s ease; }
  .bar-saved { background:repeating-linear-gradient(45deg,var(--danger),var(--danger) 3px,rgba(231,76,60,0.3) 3px,rgba(231,76,60,0.3) 6px); height:100%; transition:width 0.5s ease; }
  .bar-legend { display:flex; gap:20px; margin-top:10px; font-size:11px; color:var(--gray-700); }
  .bar-legend span { display:flex; align-items:center; gap:6px; }
  .legend-dot { width:10px; height:10px; border-radius:2px; flex-shrink:0; }
  .legend-dot.blue { background:var(--primary); }
  .legend-dot.red { background:var(--danger); }

  /* Note */
  .note { background:var(--accent-light); border:1px solid rgba(52,152,219,0.2); border-radius:var(--radius); padding:12px 16px; margin-top:18px; font-size:11px; color:var(--gray-700); line-height:1.6; }
  .note strong { color:var(--primary); }

  /* ═══════════════════════════════════════ */
  /* REPORT OVERLAY                         */
  /* ═══════════════════════════════════════ */
  .report-overlay {
    display:none; position:fixed; inset:0; background:rgba(0,0,0,0.5); z-index:1000;
    justify-content:center; align-items:flex-start; padding:20px; overflow-y:auto;
  }
  .report-overlay.open { display:flex; }
  #printReportRoot { display:none; }
  .print-watermark { display:none; }
  .report-container {
    background:#fff; width:100%; max-width:900px; border-radius:var(--radius);
    box-shadow:var(--shadow-lg); position:relative; margin:20px auto;
    max-height:calc(100vh - 40px);
    display:flex;
    flex-direction:column;
    overflow:hidden;
  }
  .report-toolbar {
    position:sticky; top:0; background:#fff; padding:12px 20px; border-bottom:1px solid var(--gray-200);
    display:flex; justify-content:space-between; align-items:center; z-index:30; border-radius:var(--radius) var(--radius) 0 0;
    isolation:isolate;
    flex:0 0 auto;
  }
  .report-toolbar .toolbar-title { font-size:14px; font-weight:600; color:var(--primary); }
  .report-toolbar .toolbar-actions { display:flex; gap:8px; }
  .toolbar-btn {
    padding:8px 16px; border-radius:5px; font-size:12px; font-weight:600; cursor:pointer; border:1px solid var(--gray-300);
    background:#fff; color:var(--gray-700); transition:all 0.2s;
  }
  .toolbar-btn:hover { background:var(--gray-50); }
  .toolbar-btn.primary { background:var(--primary); color:#fff; border-color:var(--primary); }
  .toolbar-btn.primary:hover { background:var(--primary-light); }
  .report-body { padding:0; overflow-y:auto; flex:1 1 auto; min-height:0; }

  /* Report inner styles */
  .rpt-header { background:linear-gradient(135deg,var(--primary),var(--primary-light)); color:#fff; padding:36px 32px 28px; }
  .rpt-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
  }
  .rpt-header h1 { font-size:42px; font-weight:700; margin-bottom:6px; line-height:1.05; color:#4f9bd1; }
  .rpt-header p { font-size:13px; opacity:0.8; }
  .report-logo {
    width: 190px;
    max-width: 34%;
    min-width: 140px;
    height: auto;
    flex-shrink: 0;
  }
  .rpt-print-url {
    display: none;
    color: #346c8c;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    margin-top: 14px;
  }
  .rpt-print-url-footer {
    margin: 18px 0 0;
    padding: 0 32px 24px;
  }
  .rpt-badges { display:flex; gap:8px; margin-top:14px; flex-wrap:wrap; }
  .rpt-badge { background:rgba(255,255,255,0.15); border:1px solid rgba(255,255,255,0.25); border-radius:16px; padding:4px 12px; font-size:11px; }
  .rpt-content { padding:28px 32px; }
  .rpt-kpi-row { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:24px; }
  .rpt-kpi { background:var(--gray-50); border:1px solid var(--gray-200); border-radius:6px; padding:16px; text-align:center; }
  .rpt-kpi .kpi-label { font-size:9px; text-transform:uppercase; letter-spacing:1px; color:var(--gray-500); margin-bottom:4px; }
  .rpt-kpi .kpi-value { font-size:24px; font-weight:700; }
  .rpt-kpi .kpi-value.green { color:var(--success); }
  .rpt-kpi .kpi-value.blue { color:var(--primary); }
  .rpt-section-title { font-size:14px; font-weight:700; color:var(--primary); margin:24px 0 12px; padding-bottom:8px; border-bottom:2px solid var(--gray-200); }
  .rpt-2col { display:grid; grid-template-columns:1fr 1fr; gap:24px; }
  .rpt-param-row { display:flex; justify-content:space-between; padding:6px 0; font-size:13px; border-bottom:1px solid var(--gray-100); }
  .rpt-param-row:last-child { border-bottom:none; }
  .rpt-param-row .p-label { color:var(--gray-700); }
  .rpt-param-row .p-value { font-weight:600; }
  .rpt-result-header { font-size:10px; text-transform:uppercase; letter-spacing:1px; color:var(--accent); font-weight:700; margin:14px 0 6px; }
  .rpt-result-row { display:flex; justify-content:space-between; padding:4px 0; font-size:12px; }
  .rpt-result-row .rr-label { color:var(--gray-700); }
  .rpt-result-row .rr-value { font-weight:600; }

  /* Report tables */
  .rpt-table { width:100%; border-collapse:collapse; font-size:12px; margin:12px 0; }
  .rpt-table th { background:var(--primary); color:#fff; padding:8px 12px; text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:0.5px; }
  .rpt-table th:first-child { border-radius:6px 0 0 0; }
  .rpt-table th:last-child { border-radius:0 6px 0 0; }
  .rpt-table td { padding:8px 12px; border-bottom:1px solid var(--gray-200); color:var(--gray-700); }
  .rpt-table tr:nth-child(even) td { background:var(--gray-50); }
  .rpt-table .bold { font-weight:700; color:var(--gray-900); }
  .rpt-table .green { color:var(--success); font-weight:700; }

  /* Report info boxes */
  .rpt-info-box { background:var(--accent-light); border:1px solid rgba(52,152,219,0.25); border-radius:6px; padding:16px 20px; margin:16px 0; font-size:12px; line-height:1.7; color:var(--gray-700); }
  .rpt-info-box h4 { font-size:13px; color:var(--primary); margin-bottom:8px; }
  .rpt-info-box ul { margin:6px 0 6px 16px; }
  .rpt-info-box li { margin-bottom:3px; }
  .rpt-reco-box { background:var(--accent-light); border:1px solid rgba(52,152,219,0.2); border-radius:6px; padding:12px 16px; margin:12px 0; font-size:12px; }
  .rpt-reco-box strong { color:var(--primary); }
  .rpt-note { font-size:11px; color:var(--gray-500); font-style:italic; margin:8px 0; }

  /* Report bar */
  .rpt-bar-section { background:var(--gray-50); border-radius:6px; padding:16px 20px; margin:16px 0; }
  .rpt-bar-header { display:flex; justify-content:space-between; margin-bottom:10px; }
  .rpt-bar-title { font-size:11px; text-transform:uppercase; letter-spacing:0.5px; color:var(--gray-700); font-weight:600; }
  .rpt-bar-pct { font-size:16px; font-weight:700; color:var(--success); }

  /* Report conclusion */
  .rpt-conclusion { background:linear-gradient(135deg,var(--primary),var(--primary-light)); color:#fff; border-radius:6px; padding:24px 28px; margin-top:24px; }
  .rpt-conclusion h3 { font-size:16px; margin-bottom:8px; }
  .rpt-conclusion p { font-size:13px; opacity:0.9; line-height:1.6; }

  /* Report footer */
  .rpt-footer { padding:16px 32px; font-size:10px; color:var(--gray-500); border-top:1px solid var(--gray-200); text-align:center; }

  /* Detail toggle in report */
  .rpt-details summary { cursor:pointer; font-weight:600; font-size:13px; color:var(--accent); padding:6px 0; }
  .rpt-details summary:hover { opacity:0.8; }
  .rpt-details[open] summary { margin-bottom:8px; }

  /* Print styles */
  @media print {
    @page {
      size: A4;
      margin: 14mm;
    }
    body.printing-report > * {
      display: none !important;
    }
    body.printing-report #printReportRoot {
      display: block !important;
      position: relative;
      overflow: visible !important;
    }
    body.printing-report #printReportRoot,
    body.printing-report #printReportRoot * {
      visibility: visible !important;
    }
    html body.printing-report,
    body.printing-report {
      overflow: visible !important;
    }
    body.printing-report .print-watermark {
      display: flex !important;
      position: fixed;
      inset: 0;
      flex-direction: column;
      align-items: center;
      justify-content: space-evenly;
      pointer-events: none;
      z-index: 0;
      overflow: hidden;
      padding: 10mm 10mm 8mm;
    }
    body.printing-report .print-watermark-row {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-around;
      gap: 20px;
    }
    body.printing-report .print-watermark-logo {
      width: 39%;
      max-width: 350px;
      height: auto;
      opacity: 0.12;
      transform: rotate(-18deg);
      -webkit-print-color-adjust: exact;
      print-color-adjust: exact;
    }
    body.printing-report .print-report-container {
      box-shadow:none !important;
      max-width:100% !important;
      width: 100% !important;
      max-height: none !important;
      height: auto !important;
      border-radius:0 !important;
      margin:0 !important;
      position: relative;
      z-index: 1;
      background: transparent !important;
      display: block !important;
      overflow: visible !important;
    }
    body.printing-report .report-body,
    body.printing-report .rpt-content,
    body.printing-report .rpt-header,
    body.printing-report .rpt-footer {
      padding-left: 0 !important;
      padding-right: 0 !important;
    }
    body.printing-report .report-body {
      overflow: visible !important;
      max-height: none !important;
      height: auto !important;
      flex: none !important;
    }
    body.printing-report .rpt-header {
      padding-top: 0 !important;
      page-break-inside: avoid;
    }
    body.printing-report .rpt-content,
    body.printing-report .rpt-header,
    body.printing-report .rpt-footer,
    body.printing-report .rpt-print-url-footer {
      position: relative;
      z-index: 1;
    }
    body.printing-report .rpt-header-top {
      align-items: center;
    }
    body.printing-report .rpt-header-top > div {
      flex: 1 1 auto;
    }
    body.printing-report .report-logo {
      width: 170px;
      max-width: 170px;
    }
    body.printing-report .rpt-print-url {
      display: block;
    }
    body.printing-report .rpt-badges {
      justify-content: center;
      text-align: center;
    }
    body.printing-report .rpt-kpi-row,
    body.printing-report .rpt-2col,
    body.printing-report .rpt-bar-section,
    body.printing-report .rpt-conclusion,
    body.printing-report .rpt-info-box,
    body.printing-report .rpt-reco-box,
    body.printing-report .rpt-table,
    body.printing-report .rpt-details {
      page-break-inside: avoid;
    }
    body.printing-report .rpt-details summary {
      list-style: none;
      cursor: default;
    }
    body.printing-report .rpt-details summary::-webkit-details-marker {
      display: none;
    }
    body.printing-report .rpt-details > *:not(summary) {
      display: block !important;
    }
  }

  @media (max-width:1024px) {
    .topbar {
      margin-top: 0;
    }
  }
  @media (max-width:900px) {
    .main { grid-template-columns:1fr; }
    .rpt-kpi-row { grid-template-columns:1fr 1fr; }
    .rpt-2col { grid-template-columns:1fr; }
    .topbar {
      gap: 16px;
    }
    .calculator-logo {
      width: 150px;
      max-width: 34%;
    }
    .rpt-header-top {
      flex-direction: column;
      align-items: flex-start;
    }
    .report-logo {
      width: 168px;
      max-width: 60%;
    }
    .report-toolbar {
      gap: 12px;
      align-items: flex-start;
      flex-direction: column;
    }
    .report-toolbar .toolbar-actions {
      width: 100%;
      flex-wrap: wrap;
    }
  }
  @media (max-width:640px) {
    .topbar {
      flex-direction: column;
      align-items: flex-start;
      padding: 18px 20px;
    }
    .calculator-title {
      margin-right: 0;
      padding: 0;
      line-height: 1.2;
    }
    .calculator-logo {
      width: 160px;
      max-width: 100%;
      align-self: flex-end;
    }
    .panel-left,
    .panel-right,
    .rpt-content,
    .rpt-header,
    .rpt-footer {
      padding-left: 20px;
      padding-right: 20px;
    }
  }
