:root {
      --bg: #f5f7f3;
      --paper: #ffffff;
      --ink: #142033;
      --muted: #657184;
      --line: #d9dfd5;
      --navy: #16324a;
      --green: #167a4b;
      --green-soft: #e7f4ed;
      --blue: #2464b4;
      --blue-soft: #e8f0fb;
      --amber: #b56a14;
      --amber-soft: #fff1db;
      --red: #bd3b35;
      --red-soft: #fdebea;
      --slate-soft: #edf1f4;
      --shadow: 0 14px 34px rgba(20, 32, 51, 0.08);
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      background: var(--bg);
      color: var(--ink);
      line-height: 1.55;
    }

    a {
      color: var(--blue);
    }

    .wrap {
      width: min(1180px, calc(100% - 32px));
      margin: 0 auto;
    }

    .comparison-wrap {
      display: grid;
      grid-template-columns: max-content;
      width: fit-content;
      max-width: none;
    }

    .comparison-wrap > .section-head,
    .comparison-wrap > .table-toolbar,
    .comparison-wrap > .surplus-panel,
    .comparison-wrap > .finance-panel,
    .comparison-wrap > .detail-tabs,
    .comparison-wrap > .detail-section {
      grid-column: 1;
      justify-self: start;
      width: 100%;
      min-width: 0;
      max-width: calc(100vw - 32px);
      margin-left: 0;
      margin-right: 0;
      contain: inline-size;
    }

    .top {
      background: var(--navy);
      color: #fff;
      padding: 34px 0 28px;
      border-bottom: 5px solid #7fb069;
    }

    .finance-panel { display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px 18px;margin: 0 0 12px; padding: 9px 14px; background: #edf3f7; border: 1px solid #c3d4df; border-radius: 8px; }
    .finance-panel[hidden] {display:none}
    .scenario-notice { max-width: min(1080px,calc(100vw - 32px)); white-space: normal; padding: 12px 16px; background: #fff5dc; border-left: 4px solid #bd891c; }
    .finance-controls { display:flex;flex-wrap:wrap;align-items:center;gap:8px 20px;min-width:0;font-size:.84rem; }
    .finance-period, .finance-duration { display:flex;align-items:center;gap:8px;min-width:0;color:#526577;white-space:nowrap; }
    .finance-duration {flex:1 1 230px;max-width:310px}
    .finance-term {display:flex;align-items:center;flex-wrap:wrap;gap:8px 28px;min-width:0;max-width:100%}
    .finance-term .finance-duration {flex:0 0 auto;width:auto;max-width:none}
    .finance-interest {font-size:.8rem;line-height:1.35;white-space:nowrap;color:var(--ink)}
    .finance-interest[hidden] {display:none}
    .finance-period select { width:176px;height:34px;color:var(--ink);font:inherit; }
    .finance-controls input[type="range"] {width:300px;min-width:300px;flex:0 0 300px;margin:0}
    .finance-controls .range-row {display:flex;align-items:center;gap:6px;flex:0 1 auto;min-width:0;min-height:34px}
    .finance-controls .range-row output {min-width:0;flex:0 0 auto;text-align:left;white-space:nowrap;font-weight:750;color:var(--green)}
    .finance-switches { display:flex;flex-wrap:wrap;gap:6px 18px;color:#243e52;margin-left:auto; }
    .finance-switches label { display:flex;align-items:center;gap:5px;white-space:nowrap; }
    .finance-switch {display:inline-flex;align-items:center;gap:6px;min-width:0}
    .finance-help {position:fixed;inset:auto 22px 22px auto;margin:0;width:min(440px,calc(100vw - 44px));max-height:calc(100vh - 44px);overflow:auto;padding:18px;background:var(--paper);color:var(--ink);border:1px solid #cbd6c5;border-radius:8px;box-shadow:0 24px 70px rgba(20,32,51,.28);font-size:.9rem;line-height:1.55}
    .finance-help header {display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}
    .finance-help h3 {margin:0;font-size:1.05rem}
    .finance-help p {margin:0 0 12px}
    .finance-help p:last-child {margin-bottom:0}
    .finance-help-note {padding:10px 12px;background:#edf3f7;border-left:3px solid #7191a8}
    .finance-summary { display: flex; flex-wrap: wrap; gap: 3px 20px; margin: 10px 0 0; font-size: .84rem; color: #536777; }
    .finance-summary strong { color: var(--ink); font-weight: 650; }
    .finance-panel details {margin:0;padding:0;min-width:0}
    .finance-panel details[open] {grid-column:1/-1;border-top:1px solid #cbd9e2;padding-top:8px}
    .finance-panel:has(details[open]) .finance-controls {grid-column:1/-1}
    .finance-panel summary { cursor: pointer; color: #245474; font-size: .84rem;white-space:nowrap; }
    .finance-panel details p { max-width: 1050px; font-size: .9rem; line-height: 1.5; }
    .package-note { display: block; flex-basis: 100%; color: #536271; font-size: .72rem; line-height: 1.2; }
    @media(max-width: 1050px) { .finance-controls {gap:8px 14px}.finance-duration{flex-basis:200px}.finance-switches{gap:6px 12px} }
    @media(max-width: 720px) { .finance-panel {grid-template-columns:minmax(0,1fr);padding:10px 12px;gap:10px}.finance-duration{flex-basis:220px;max-width:100%}.finance-term{width:100%}.finance-term .finance-duration{width:100%;flex-basis:100%;max-width:none}.finance-controls .range-row{flex:1}.finance-controls input[type="range"]{width:auto;min-width:0;flex:1}.finance-interest{white-space:normal}.finance-period{flex:1 1 100%}.finance-period select{flex:1;min-width:0}.finance-panel details{border-top:1px solid #cbd9e2;padding-top:8px}.finance-switches{gap:6px 16px}.finance-switches label{white-space:normal}.finance-help{inset:auto 12px 12px;width:calc(100vw - 24px);max-height:78vh} }
    .top-line {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 18px;
      margin-bottom: 8px;
    }

    .kicker {
      margin: 0;
      color: #a9c7df;
      font-size: 0.86rem;
      font-weight: 700;
      letter-spacing: 0;
      text-transform: uppercase;
    }

    .last-updated {
      margin: 0;
      color: #c8d7e3;
      font-size: 0.84rem;
      font-weight: 750;
      white-space: nowrap;
    }

    h1, h2, h3 {
      letter-spacing: 0;
      line-height: 1.15;
    }

    h1 {
      max-width: 980px;
      margin: 0;
      font-size: clamp(2rem, 5vw, 4.2rem);
      font-weight: 800;
    }

    .lead {
      max-width: 930px;
      margin: 16px 0 0;
      color: #dbe8f1;
      font-size: 1.08rem;
    }

    .support-link {
      margin: 16px 0 0;
    }

    .support-link a {
      display: inline-flex;
      align-items: center;
      min-height: 34px;
      padding: 0 12px;
      color: #f5fbff;
      border: 1px solid rgba(255, 255, 255, 0.24);
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.07);
      text-decoration: none;
      font-weight: 800;
    }

    .support-link a:hover {
      background: rgba(255, 255, 255, 0.13);
    }

    main {
      padding: 0 0 44px;
    }

    .band {
      padding: 34px 0;
      border-bottom: 1px solid var(--line);
      background: var(--bg);
    }

    .band:nth-of-type(even) {
      background: #ffffff;
    }

    .section-head {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: 20px;
      margin-bottom: 20px;
    }

    h2 {
      margin: 0;
      font-size: clamp(1.5rem, 3vw, 2.2rem);
    }

    .section-head p {
      max-width: 540px;
      margin: 0;
      color: var(--muted);
    }

    .fact-grid,
    .spec-grid,
    .kpi-grid {
      display: grid;
      gap: 14px;
    }

    .fact-grid {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .spec-grid {
      grid-template-columns: 1fr 1fr;
    }

    .kpi-grid {
      grid-template-columns: repeat(4, minmax(0, 1fr));
      margin: 18px 0;
    }

    .fact,
    .panel,
    .kpi {
      background: var(--paper);
      border: 1px solid var(--line);
      border-radius: 8px;
      box-shadow: var(--shadow);
    }

    .fact,
    .panel,
    .kpi {
      padding: 18px;
    }

    .fact b,
    .kpi b {
      display: block;
      margin-bottom: 5px;
      font-size: 1.45rem;
      line-height: 1.05;
    }

    .fact span,
    .kpi span,
    .muted {
      color: var(--muted);
      font-size: 0.92rem;
    }

    .issue-list {
      display: grid;
      gap: 10px;
      margin: 0;
      padding: 0;
      list-style: none;
    }

    .issue-list li {
      padding: 14px 16px;
      background: var(--paper);
      border: 1px solid var(--line);
      border-left: 5px solid var(--amber);
      border-radius: 8px;
    }

    .issue-list li.good {
      border-left-color: var(--green);
    }

    .issue-list li.risk {
      border-left-color: var(--red);
    }

    pre {
      overflow: auto;
      margin: 0;
      padding: 16px;
      color: #dce7ef;
      background: #172235;
      border-radius: 8px;
      font-size: 0.84rem;
    }

    code {
      font-family: "JetBrains Mono", Consolas, monospace;
    }

    details {
      border-top: 1px solid var(--line);
      margin-top: 14px;
      padding-top: 12px;
    }

    summary {
      cursor: pointer;
      font-weight: 700;
    }

    details > div {
      animation: reveal 180ms ease-out;
    }

    @keyframes reveal {
      from {
        opacity: 0;
        transform: translateY(-4px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .app-shell {
      background: #f8faf7;
    }

    .toolbar {
      display: grid;
      grid-template-columns: 1.1fr 1fr;
      gap: 14px;
      align-items: stretch;
      margin-top: 18px;
    }

    .control-panel {
      background: var(--paper);
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 16px;
    }

    .control-panel h3 {
      margin: 0 0 12px;
      font-size: 1rem;
    }

    .control-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }

    label.check,
    .component-check {
      display: flex;
      gap: 9px;
      align-items: center;
      min-height: 42px;
      padding: 8px 10px;
      border: 1px solid var(--line);
      background: #fbfcfb;
      border-radius: 8px;
      font-size: 0.9rem;
    }

    input[type="checkbox"] {
      width: 18px;
      height: 18px;
      accent-color: var(--green);
      flex: 0 0 auto;
    }

    select,
    input[type="range"] {
      width: 100%;
    }

    select {
      height: 40px;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 0 10px;
      background: #fff;
      color: var(--ink);
    }

    .range-row {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 12px;
      align-items: center;
    }

    .range-row output {
      min-width: 72px;
      text-align: right;
      font-weight: 800;
      color: var(--green);
    }

    .buttons {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 12px;
    }

    button {
      min-height: 38px;
      padding: 0 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      color: var(--ink);
      font-weight: 700;
      cursor: pointer;
      transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
    }

    button:hover {
      border-color: #9fb0a0;
      transform: translateY(-1px);
    }

    button.primary {
      color: #fff;
      border-color: var(--green);
      background: var(--green);
    }

    .table-toolbar {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      justify-content: flex-start;
      align-items: center;
      margin: 18px 0 12px;
      font-size:.86rem;
    }

    .table-toolbar label {
      display: flex;
      gap: 10px;
      align-items: center;
      min-width: 0;
      white-space: nowrap;
    }

    .toolbar-actions {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 10px;
      margin-left: auto;
      min-width: 0;
    }

    .table-toolbar label .muted {
      flex: 0 0 auto;
    }

    .table-toolbar .compare-toggle {
      color: var(--ink);
      font-weight: 750;
      text-transform: none;
      white-space: normal;
    }

    .compare-toggle span {
      line-height: 1.25;
    }

    .table-toolbar select {
      width: auto;
      min-width: 210px;
    }

    .toolbar-button {
      display: inline-flex;
      gap: 8px;
      align-items: center;
      min-height: 42px;
    }

    .toolbar-button svg {
      width: 18px;
      height: 18px;
      fill: none;
      stroke: currentColor;
      stroke-width: 2;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .variant-table-wrap {
      width: fit-content;
      max-width: calc(100vw - 32px);
      margin-inline: auto;
      overflow: hidden;
      background: var(--paper);
      border: 1px solid var(--line);
      border-radius: 8px;
      box-shadow: var(--shadow);
    }

    .comparison-wrap.is-loading {
      grid-template-columns: minmax(0, min(1191px, calc(100vw - 32px)));
    }

    .comparison-wrap.is-loading .variant-table-scroll,
    .comparison-wrap.is-loading .table-footer,
    .comparison-wrap.is-loading > .surplus-panel,
    .comparison-wrap.is-loading > .detail-tabs,
    .comparison-wrap.is-loading > .detail-section {
      display: none;
    }

    .table-loading {
      display: none;
      min-height: 671px;
      width: min(1189px, calc(100vw - 34px));
      max-width: 100%;
      color: var(--ink);
      background: var(--paper);
      overflow: hidden;
    }

    .comparison-wrap.is-loading .table-loading {
      display: block;
    }

    .loading-status {
      position: absolute;
      right: 18px;
      bottom: 18px;
      z-index: 2;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      min-height: 34px;
      padding: 7px 10px;
      color: var(--muted);
      background: rgba(255, 255, 255, 0.92);
      border: 1px solid var(--line);
      border-radius: 8px;
      box-shadow: 0 8px 22px rgba(20, 32, 51, 0.08);
    }

    .loading-spinner {
      width: 16px;
      height: 16px;
      border: 2px solid #d7e3ee;
      border-top-color: var(--blue);
      border-radius: 999px;
      animation: spin 800ms linear infinite;
    }

    .loading-status span {
      font-size: 0.82rem;
      font-weight: 800;
    }

    .loading-table {
      min-width: 1189px;
      width: 1189px;
      height: 671px;
      table-layout: fixed;
    }

    .loading-table th,
    .loading-table td {
      height: 70px;
    }

    .loading-table th {
      height: 48px;
    }

    .loading-table i {
      display: block;
      height: 20px;
      border-radius: 6px;
      background: linear-gradient(90deg, #edf2f6, #f7fafc, #edf2f6);
      background-size: 220% 100%;
      animation: shimmer 1200ms ease-in-out infinite;
    }

    .loading-table td:first-child i {
      width: 72%;
    }

    .loading-table td:not(:first-child) i {
      width: 84%;
      margin-left: auto;
    }

    @keyframes spin {
      to { transform: rotate(360deg); }
    }

    @keyframes shimmer {
      to { background-position-x: -220%; }
    }

    .variant-table-scroll {
      width: 100%;
      max-width: 100%;
      max-height: min(calc(100vh - 160px), 760px);
      overflow: auto;
      -webkit-overflow-scrolling: touch;
    }

    .variant-table {
      width: max-content;
      min-width: max-content;
      border-collapse: collapse;
      font-size: 0.92rem;
    }

    .variant-table.loading-table {
      width: 1189px;
      min-width: 1189px;
    }

    .variant-table th,
    .variant-table td {
      padding: 12px 14px;
      border-bottom: 1px solid #e6ebe2;
      text-align: right;
      vertical-align: middle;
      white-space: nowrap;
      overflow-wrap: normal;
      word-break: normal;
    }

    .variant-table th {
      position: sticky;
      top: 0;
      z-index: 2;
      background: #eef3ea;
      color: #344258;
      font-size: 0.78rem;
      text-transform: uppercase;
      white-space: normal;
      overflow-wrap: normal;
      word-break: keep-all;
    }

    .variant-table th:has(.header-info-popup) {
      position: sticky;
    }

    .variant-table th:has(.header-info-popup):hover,
    .variant-table th:has(.sort-head:focus-visible) {
      z-index: 8;
    }

    .variant-table th:first-child,
    .variant-table td:first-child {
      text-align: left;
    }

    .variant-table tbody tr:nth-child(even) td {
      background: #fafafa;
    }

    .variant-table tbody tr {
      height: 70px;
    }

    .variant-table th[data-col="investment"],
    .variant-table td[data-col="investment"] {
      width: 145px;
      min-width: 145px;
    }

    .variant-table th[data-col="investment"] {
      text-align: center;
    }

    .variant-table th[data-col="investment"] .sort-head {
      justify-content: center;
      width: 100%;
    }

    .variant-table th[data-col="clean-annual"],
    .variant-table th[data-col="annual"],
    .variant-table td[data-col="clean-annual"],
    .variant-table td[data-col="annual"] {
      width: 150px;
      min-width: 150px;
    }

    .variant-table th[data-col="saving"],
    .variant-table td[data-col="saving"] {
      width: 150px;
      min-width: 150px;
    }

    .variant-table th[data-col="payback"],
    .variant-table td[data-col="payback"] {
      width: 117px;
      min-width: 117px;
    }

    /* Reserve the longest amount/difference, including the secondary annual value. */
    .variant-table [data-col="loan"],
    .variant-table [data-col="fo-total"] {min-width:145px}
    .variant-table [data-col="fo-increase"] {min-width:170px}
    .variant-table [data-col="interest"] {min-width:175px}
    .variant-table [data-col="operation"],
    .variant-table [data-col="service"],
    .variant-table [data-col="renewal"] {min-width:140px}
    .variant-table [data-col="heating-kwh"] {min-width:120px}
    .variant-table [data-col="heating-cost"],
    .variant-table [data-col="water-cost"] {min-width:110px}
    .variant-table [data-col="energy-flat"],
    .variant-table [data-col="annual-flat"],
    .variant-table [data-col="saving-flat"] {min-width:200px}

    .variant-table tbody tr:hover td {
      background: #e5e8ed;
      box-shadow: inset 0 1px 0 rgba(80, 91, 108, 0.16), inset 0 -1px 0 rgba(80, 91, 108, 0.16);
    }

    .variant-table tbody tr.is-compare-anchor td {
      background: #e5e8ed;
      box-shadow: inset 0 1px 0 rgba(80, 91, 108, 0.16), inset 0 -1px 0 rgba(80, 91, 108, 0.16);
    }

    .variant-table:has(td[data-col="investment"]:hover) td[data-col="investment"],
    .variant-table:has(td[data-col="saving-pct"]:hover) td[data-col="saving-pct"],
    .variant-table:has(td[data-col="clean-annual"]:hover) td[data-col="clean-annual"],
    .variant-table:has(td[data-col="annual"]:hover) td[data-col="annual"],
    .variant-table:has(td[data-col="saving"]:hover) td[data-col="saving"],
    .variant-table:has(td[data-col="payback"]:hover) td[data-col="payback"],
    .variant-table:has(td[data-col="operation"]:hover) td[data-col="operation"],
    .variant-table:has(td[data-col="heating-kwh"]:hover) td[data-col="heating-kwh"],
    .variant-table:has(td[data-col="water-kwh"]:hover) td[data-col="water-kwh"],
    .variant-table:has(td[data-col="fixed-cost"]:hover) td[data-col="fixed-cost"],
    .variant-table:has(td[data-col="heating-cost"]:hover) td[data-col="heating-cost"],
    .variant-table:has(td[data-col="water-cost"]:hover) td[data-col="water-cost"],
    .variant-table:has(td[data-col="energy-flat"]:hover) td[data-col="energy-flat"],
    .variant-table:has(td[data-col="energy-saving"]:hover) td[data-col="energy-saving"],
    .variant-table:has(td[data-col="energy-saving-flat"]:hover) td[data-col="energy-saving-flat"],
    .variant-table:has(td[data-col="annual-flat"]:hover) td[data-col="annual-flat"],
    .variant-table:has(td[data-col="surplus"]:hover) td[data-col="surplus"],
    .variant-table:has(td[data-col="saving-flat"]:hover) td[data-col="saving-flat"] {
      background: var(--score-bg, #fbfdf9);
    }

    .sort-head {
      display: inline-flex;
      flex-wrap: wrap;
      gap: 5px;
      align-items: center;
      min-height: 24px;
      padding: 0;
      border: 0;
      background: transparent;
      color: inherit;
      font: inherit;
      text-transform: inherit;
    }

    .sort-head:hover {
      transform: none;
      color: var(--green);
    }

    .header-info-popup {
      position: absolute;
      top: calc(100% + 8px);
      right: 8px;
      z-index: 20;
      display: none;
      box-sizing: border-box;
      width: min(330px, calc(100vw - 42px));
      padding: 10px 12px;
      border: 1px solid #9fb9d8;
      border-radius: 8px;
      background: #f4f9ff;
      color: #28425f;
      box-shadow: 0 14px 32px rgba(20, 32, 51, 0.18);
      font-size: 0.78rem;
      font-weight: 750;
      line-height: 1.42;
      text-align: left;
      text-transform: none;
      white-space: normal;
      overflow-wrap: break-word;
      word-break: normal;
    }

    .variant-table th:hover .header-info-popup,
    .variant-table th:has(.sort-head:focus-visible) .header-info-popup {
      display: block;
    }

    .sort-mark {
      color: var(--green);
      font-size: 0.75rem;
    }

    .variant-name {
      max-width: 280px;
      font-weight: 800;
      line-height: 1.25;
    }

    .variant-name small {
      display: block;
      margin-top: 4px;
      color: var(--muted);
      font-weight: 600;
    }

    .component-pills {
      display: flex;
      flex-wrap: wrap;
      gap: 5px;
      min-width: 220px;
    }

    .current-state-label {
      font-weight: 900;
      color: var(--ink);
    }

    .component-pill {
      display: inline-flex;
      align-items: center;
      min-height: 23px;
      padding: 0 7px;
      border-radius: 999px;
      background: #edf1f4;
      color: #445267;
      font-size: 0.74rem;
      font-weight: 800;
      white-space: nowrap;
      cursor: default;
      transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
    }

    .component-pill:hover,
    .component-pill:focus-visible {
      background: #dce9e0;
      color: var(--green);
      outline: none;
    }

    #variantRows[data-highlight-component="heatPump"] .component-pill[data-component="heatPump"],
    #variantRows[data-highlight-component="fve"] .component-pill[data-component="fve"],
    #variantRows[data-highlight-component="roof"] .component-pill[data-component="roof"],
    #variantRows[data-highlight-component="windows"] .component-pill[data-component="windows"],
    #variantRows[data-highlight-component="facade"] .component-pill[data-component="facade"] {
      background: #fff3cc;
      color: #5f4506;
      box-shadow: 0 0 0 2px rgba(216, 166, 35, 0.34);
      transform: translateY(-1px);
    }

    .variant-warning {
      position: relative;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      place-items: center;
      width: 26px;
      height: 26px;
      border: 1px solid #efc46f;
      border-radius: 7px;
      background: #fff6df;
      color: #b26b00;
      cursor: help;
    }

    .variant-warning svg {
      width: 18px;
      height: 18px;
      fill: none;
      stroke: currentColor;
      stroke-width: 2.1;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .variant-warning span {
      position: absolute;
      bottom: calc(100% + 8px);
      left: 0;
      z-index: 12;
      display: none;
      box-sizing: border-box;
      width: min(420px, calc(100vw - 42px));
      max-width: calc(100vw - 42px);
      padding: 10px 12px;
      border: 1px solid #e2b45f;
      border-radius: 8px;
      background: #fff8e8;
      color: #67410f;
      box-shadow: 0 14px 32px rgba(20, 32, 51, 0.18);
      font-size: 0.82rem;
      font-weight: 800;
      line-height: 1.45;
      text-align: left;
      white-space: normal;
      overflow-wrap: break-word;
      word-break: normal;
    }

    .variant-warning:hover span,
    .variant-warning:focus-visible span {
      display: block;
    }

    .money-positive {
      color: var(--green);
      font-weight: 900;
    }

    .money-negative {
      color: var(--red);
      font-weight: 900;
    }

    .diff-cell {
      display: inline-flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 2px;
      font: inherit;
      font-weight: inherit;
      white-space: nowrap;
    }

    .diff-cell-detail {
      min-height: 30px;
      width: 100%;
      margin: -3px -5px;
      padding: 3px 5px;
      border-radius: 6px;
      font-weight: 900;
    }

    .diff-cell-simple {
      display: inline;
      min-height: 0;
      width: auto;
    }

    .diff-main {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      justify-content: flex-end;
      width: 100%;
    }

    .diff-cell-simple .diff-main {
      display: inline;
      width: auto;
    }

    .diff-secondary {
      color: currentColor;
      font-size: 0.72rem;
      font-weight: inherit;
      opacity: 0.72;
    }

    .diff-positive {
      color: var(--green);
    }

    .diff-negative {
      color: var(--red);
    }

    .diff-zero {
      color: var(--muted);
    }

    .diff-icon-placeholder {
      visibility: hidden;
      flex: 0 0 auto;
    }

    .info-cell {
      display: inline-flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 2px;
      min-height: 30px;
      margin: -3px -5px;
      padding: 3px 5px;
      border-radius: 6px;
      color: inherit;
      font: inherit;
      font-weight: 900;
      text-align: right;
    }

    .info-cell.is-active {
      transform: none;
      color: var(--blue);
      outline: none;
    }

    .info-cell.is-active {
      background: var(--blue-soft);
      box-shadow: 0 0 0 2px rgba(36, 100, 180, 0.18);
    }

    .info-main {
      display: inline-flex;
      align-items: center;
      justify-content: flex-end;
      gap: 6px;
      white-space: nowrap;
    }

    .info-icon {
      display: inline-grid;
      place-items: center;
      width: 17px;
      min-width: 17px;
      max-width: 17px;
      height: 17px;
      min-height: 17px;
      max-height: 17px;
      box-sizing: border-box;
      padding: 0;
      border: 1px solid #a8b5c6;
      border-radius: 999px;
      color: #51627a;
      font-size: 0.68rem;
      font-weight: 900;
      line-height: 1;
      text-align: center;
    }

    .info-detail-button {
      appearance: none;
      align-items: center;
      justify-content: center;
      flex: 0 0 17px;
      margin: 0;
      padding: 0;
      background: transparent;
      font-family: inherit;
      font-size: 0.68rem;
      font-weight: 900;
      line-height: 1;
      cursor: pointer;
    }

    .info-detail-button:hover,
    .info-detail-button:focus-visible,
    .info-cell.is-active .info-icon {
      border-color: var(--blue);
      background: var(--blue);
      color: #fff;
      outline: none;
    }

    .info-secondary {
      display: block;
      min-height: 0;
      padding: 0;
      border: 0;
      background: transparent;
      color: var(--muted);
      font: inherit;
      font-size: 0.72rem;
      font-weight: 700;
      line-height: 1.55;
      text-align: right;
      cursor: pointer;
    }

    .info-secondary:hover,
    .info-secondary:focus-visible {
      color: var(--blue);
      outline: none;
    }

    .row-actions {
      display: inline-flex;
      gap: 4px;
      justify-content: flex-end;
      white-space: nowrap;
    }

    .icon-button {
      display: inline-grid;
      place-items: center;
      width: 32px;
      height: 32px;
      min-height: 32px;
      padding: 0;
      border: 0;
      border-radius: 6px;
      background: transparent;
      color: #8892a0;
    }

    .icon-button:hover {
      background: #edf1f4;
      color: var(--ink);
      transform: none;
    }

    .icon-button:disabled {
      opacity: 0.28;
      cursor: default;
    }

    .icon-button:disabled:hover {
      background: transparent;
      color: #8892a0;
    }

    .icon-button svg {
      width: 17px;
      height: 17px;
      stroke: currentColor;
      stroke-width: 2;
      fill: none;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .table-footer {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 14px;
      padding: 12px 14px;
      background: #fff;
      border-top: 1px solid var(--line);
      border-radius: 0 0 8px 8px;
    }

    .table-footer.is-zebra-even {
      background: #fafafa;
    }

    .add-variant-button {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      min-height: 36px;
      padding: 8px 12px;
      background: transparent;
      border-color: #cfd8cf;
      color: var(--green);
      font-weight: 850;
    }

    .add-variant-button svg {
      width: 17px;
      height: 17px;
      fill: none;
      stroke: currentColor;
      stroke-width: 2.2;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .add-variant-button:disabled {
      color: var(--muted);
      border-color: var(--line);
      opacity: 0.55;
      cursor: default;
    }

    .surplus-panel {
      display: none;
      margin-top: 14px;
      padding: 16px;
      background: var(--paper);
      border: 1px solid var(--line);
      border-radius: 8px;
      box-shadow: var(--shadow);
    }

    .surplus-panel.is-visible {
      display: block;
    }

    .surplus-panel .surplus-description {
      display: block;
      margin-top: 6px;
    }

    .detail-tabs {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 8px;
      margin-top: 14px;
    }

    .detail-tab {
      display: inline-flex;
      align-items: center;
      min-height: 36px;
      padding: 0 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      color: var(--ink);
      font-weight: 800;
      text-decoration: none;
    }

    .detail-tab.is-active {
      color: #fff;
      border-color: var(--green);
      background: var(--green);
    }

    .reset-all-button {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      min-height: 36px;
      margin-left: auto;
      padding: 0 12px;
      border: 1px solid #d9c4c2;
      border-radius: 8px;
      background: #fff;
      color: var(--red);
      font-weight: 850;
    }

    .reset-all-button:hover,
    .reset-all-button:focus-visible {
      border-color: var(--red);
      background: var(--red-soft);
      color: var(--red);
      outline: none;
      transform: none;
    }

    .reset-all-button:disabled {
      border-color: var(--line);
      background: #f7f8f7;
      color: #9aa3ad;
      cursor: default;
      opacity: 0.7;
    }

    .reset-all-button:disabled:hover {
      border-color: var(--line);
      background: #f7f8f7;
      color: #9aa3ad;
    }

    .reset-all-button svg {
      width: 17px;
      height: 17px;
      fill: none;
      stroke: currentColor;
      stroke-width: 2.1;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .detail-section {
      display: none;
      margin-top: 16px;
      padding: 18px;
      background: var(--paper);
      border: 1px solid var(--line);
      border-radius: 8px;
      box-shadow: var(--shadow);
    }

    .detail-section.is-active {
      display: block;
    }

    .detail-section h3 {
      margin: 0 0 8px;
    }

    .detail-table-wrap {
      width: 100%;
      max-width: 100%;
      overflow-x: auto;
      overflow-y: visible;
      -webkit-overflow-scrolling: touch;
    }

    .compact-table {
      width: 100%;
      border-collapse: collapse;
      margin-top: 12px;
      font-size: 0.9rem;
    }

    .compact-table th,
    .compact-table td {
      padding: 9px 10px;
      border-bottom: 1px solid #e6ebe2;
      text-align: right;
      overflow-wrap: anywhere;
    }

    .compact-table th:first-child,
    .compact-table td:first-child,
    .compact-table th:nth-child(2),
    .compact-table td:nth-child(2) {
      text-align: left;
    }

    .compact-table .section-row th {
      padding-top: 16px;
      padding-bottom: 7px;
      color: var(--green);
      background: #eef5ee;
      border-top: 1px solid #d8e5d6;
      border-bottom: 1px solid #d8e5d6;
      font-size: 0.78rem;
      text-align: left;
      text-transform: uppercase;
      letter-spacing: 0.03em;
    }

    #inputTable th:nth-child(2),
    #inputTable td:nth-child(2) {
      text-align: right;
    }

    #serviceTable th:nth-child(2),
    #serviceTable td:nth-child(2),
    #serviceTable th:nth-child(3),
    #serviceTable td:nth-child(3),
    #serviceTable th:nth-child(4),
    #serviceTable td:nth-child(4) {
      text-align: right;
    }

    #serviceTable th:nth-child(5),
    #serviceTable td:nth-child(5) {
      text-align: left;
    }

    .editable-value {
      display: inline-flex;
      align-items: center;
      justify-content: flex-end;
      gap: 6px;
      min-width: 0;
      white-space: nowrap;
    }

    .editable-value.is-edited-value .editable-text {
      font-weight: 900;
      font-style: italic;
    }

    .inline-edit-button {
      display: inline-grid;
      place-items: center;
      flex: 0 0 24px;
      width: 24px;
      height: 24px;
      padding: 0;
      border: 0;
      border-radius: 6px;
      background: transparent;
      color: #8a96a6;
    }

    .inline-edit-button:hover,
    .inline-edit-button:focus-visible {
      background: #edf1f4;
      color: var(--blue);
      outline: none;
      transform: none;
    }

    .reset-edit-button:hover,
    .reset-edit-button:focus-visible {
      color: var(--red);
    }

    .inline-edit-button svg {
      width: 15px;
      height: 15px;
      fill: none;
      stroke: currentColor;
      stroke-width: 2.1;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .sticky-edit-tray {
      position: fixed;
      left: 50%;
      bottom: 12px;
      z-index: 45;
      display: none;
      width: min(1180px, calc(100vw - 24px));
      transform: translateX(-50%);
      gap: 8px;
      padding: 10px;
      border: 1px solid #c8d3df;
      border-radius: 10px;
      background: rgba(255, 255, 255, 0.96);
      box-shadow: 0 18px 48px rgba(20, 32, 51, 0.2);
      backdrop-filter: blur(8px);
    }

    .sticky-edit-tray.is-visible {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    }

    .sticky-editor {
      display: grid;
      grid-template-columns: minmax(120px, 1fr) minmax(96px, 130px) auto 30px;
      align-items: center;
      gap: 8px;
      padding: 8px;
      border: 1px solid #dce3ea;
      border-radius: 8px;
      background: #f8fafb;
    }

    .sticky-editor span {
      min-width: 0;
      color: var(--ink);
      font-size: 0.82rem;
      font-weight: 850;
      line-height: 1.25;
    }

    .sticky-editor input {
      width: 100%;
      min-height: 32px;
      padding: 5px 8px;
      border: 1px solid #b8c4d1;
      border-radius: 6px;
      color: var(--ink);
      font: inherit;
      font-weight: 800;
      text-align: right;
    }

    .sticky-editor input:invalid {
      border-color: var(--red);
      background: var(--red-soft);
    }

    .sticky-editor small {
      color: var(--muted);
      font-size: 0.76rem;
      white-space: nowrap;
    }

    .sticky-editor button {
      display: inline-grid;
      place-items: center;
      width: 30px;
      height: 30px;
      padding: 0;
      border: 0;
      border-radius: 6px;
      background: transparent;
      color: #7b8796;
      font-size: 1.25rem;
      line-height: 1;
    }

    .sticky-editor button:hover,
    .sticky-editor button:focus-visible {
      background: #edf1f4;
      color: var(--red);
      outline: none;
      transform: none;
    }

    .modal-backdrop {
      position: fixed;
      inset: 0;
      z-index: 50;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
      background: rgba(20, 32, 51, 0.42);
    }

    .modal-backdrop.is-open {
      display: flex;
    }

    .modal {
      width: min(720px, 100%);
      max-height: calc(100vh - 40px);
      overflow: auto;
      background: #fff;
      border-radius: 8px;
      box-shadow: 0 24px 70px rgba(20, 32, 51, 0.28);
    }

    .modal header,
    .modal footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 16px 18px;
      border-bottom: 1px solid var(--line);
    }

    .modal footer {
      border-top: 1px solid var(--line);
      border-bottom: 0;
      justify-content: flex-end;
    }

    .modal h3 {
      margin: 0;
    }

    .modal-body {
      padding: 18px;
    }

    .form-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }

    .form-field {
      display: grid;
      gap: 6px;
      font-weight: 800;
    }

    .form-field input,
    .form-field select {
      width: 100%;
      height: 40px;
      padding: 0 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      font: inherit;
      font-weight: 500;
    }

    .component-editor {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      margin-top: 12px;
    }

    .column-editor {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      margin-top: 12px;
    }

    .column-group-title {
      grid-column: 1 / -1;
      margin-top: 8px;
      color: #5b6575;
      font-size: 0.78rem;
      font-weight: 900;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .column-option {
      display: flex;
      gap: 9px;
      align-items: flex-start;
      padding: 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fbfcfb;
      font-weight: 800;
    }

    .column-option input {
      width: 18px;
      height: 18px;
      margin-top: 1px;
      accent-color: var(--green);
    }

    .column-option small {
      display: block;
      margin-top: 2px;
      color: #6a7280;
      font-weight: 500;
    }

    .model-summary {
      margin-top: 14px;
      padding: 13px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fbfcfb;
    }

    .summary-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }

    .summary-item {
      padding: 10px;
      border: 1px solid #e5ebe4;
      border-radius: 8px;
      background: #fff;
    }

    .summary-item span {
      display: block;
      color: var(--muted);
      font-size: 0.78rem;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.03em;
    }

    .summary-item strong {
      display: block;
      margin-top: 3px;
      color: var(--ink);
      font-size: 0.98rem;
    }

    .summary-warning {
      margin: 0;
      color: #8a4f00;
      font-weight: 800;
      line-height: 1.45;
    }

    .detail-popup {
      position: fixed;
      inset: 22px 22px 22px auto;
      z-index: 60;
      width: min(860px, calc(100vw - 44px));
      max-height: calc(100vh - 44px);
      overflow: auto;
      padding: 18px;
      background: #fff;
      border: 1px solid #cbd6c5;
      border-radius: 8px;
      box-shadow: 0 24px 70px rgba(20, 32, 51, 0.28);
      opacity: 0;
      pointer-events: none;
      transform: translateX(calc(100% + 28px));
      transition: opacity 180ms ease, transform 180ms ease;
    }

    .detail-popup.is-open {
      opacity: 1;
      pointer-events: auto;
      transform: translateX(0);
    }

    .detail-popup[data-mode="compact"] {
      width: min(440px, calc(100vw - 44px));
    }

    .detail-popup header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 14px;
      margin-bottom: 12px;
    }

    .detail-popup h3 {
      margin: 0;
    }

    .detail-popup table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.9rem;
    }

    .detail-popup .compact-detail-table {
      font-size: 0.92rem;
    }

    .compact-detail-calculation {
      display: block;
      margin-top: 3px;
      color: var(--muted);
      font-size: 0.78rem;
      font-weight: 400;
      line-height: 1.4;
    }

    .detail-popup th,
    .detail-popup td {
      padding: 8px 0;
      border-bottom: 1px solid #eef2ec;
      text-align: left;
      vertical-align: top;
    }

    .detail-popup td:last-child {
      text-align: right;
      font-weight: 800;
    }

    .detail-more {
      width: 100%;
      margin-top: 14px;
    }

    @media (max-width: 860px) {
      .detail-popup {
        inset: auto 12px 12px;
        width: auto;
        max-height: min(78vh, 720px);
        border-radius: 12px 12px 8px 8px;
        transform: translateY(calc(100% + 24px));
      }

      .detail-popup.is-open {
        transform: translateY(0);
      }

      .detail-popup[data-mode="compact"] {
        width: auto;
      }
    }

    .formula-list {
      display: grid;
      gap: 10px;
      margin: 0;
      padding: 0;
      list-style: none;
    }

    .formula-list li {
      padding: 12px 14px;
      background: var(--paper);
      border: 1px solid var(--line);
      border-radius: 8px;
    }

    .formula-list code {
      display: block;
      margin-top: 5px;
      color: #25364c;
      white-space: normal;
    }

    .note {
      padding: 14px 16px;
      border: 1px solid var(--line);
      border-left: 5px solid var(--blue);
      background: var(--blue-soft);
      border-radius: 8px;
    }

    @media (max-width: 980px) {
      .fact-grid,
      .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .spec-grid,
      .toolbar,
      .form-grid,
      .component-editor,
      .column-editor {
        grid-template-columns: 1fr;
      }

      .table-toolbar {
        justify-content: stretch;
      }

      .toolbar-actions {
        width: 100%;
        margin-left: 0;
      }

      .table-toolbar label {
        width: 100%;
      }

      .table-toolbar select {
        flex: 1 1 auto;
        min-width: 0;
      }

      .toolbar-button {
        width: 100%;
        justify-content: center;
      }
    }

    @media (max-width: 640px) {
      .wrap {
        width: min(100% - 20px, 1180px);
      }

      .comparison-wrap,
      .comparison-wrap > .table-toolbar,
      .comparison-wrap > .surplus-panel,
      .comparison-wrap > .finance-panel,
      .comparison-wrap > .detail-tabs,
      .comparison-wrap > .detail-section {
        max-width: calc(100vw - 20px);
      }

      .variant-table-wrap {
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
        margin-inline: 0;
        overflow: hidden;
      }

      .variant-table-scroll {
        width: 100%;
        max-width: 100%;
        max-height: min(64vh, 620px);
        overflow: auto;
        -webkit-overflow-scrolling: touch;
      }

      .top {
        padding-top: 24px;
      }

      .top-line {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
      }

      .fact-grid,
      .kpi-grid,
      .control-grid,
      .component-editor {
        grid-template-columns: 1fr;
      }

      .table-footer {
        align-items: flex-start;
        flex-direction: column;
      }

      .section-head {
        display: block;
      }

      .section-head p {
        margin-top: 8px;
      }
    }

body.app-page .top {
      padding: 22px 0 18px;
    }

    body.app-page h1 {
      font-size: clamp(1.9rem, 4vw, 3rem);
    }

    body.app-page .lead {
      max-width: 860px;
      font-size: 1rem;
    }

    body.app-page .band {
      padding-top: 26px;
    }

    body.app-page .section-head h2 {
      font-size: clamp(1.4rem, 2.4vw, 1.9rem);
    }

.ops-reason {grid-column:1;justify-self:start;max-width:calc(100vw - 32px);white-space:normal;font-size:.76rem;line-height:1.4;color:#65778a;margin:-4px 0 10px}
.ops-reason[hidden] {display:none}
