/* ============================================
   SolidSun Kalkulačka — design tokens
   Per brand manual 2024: Oxford + Fire primary,
   Stolzl font, solar-grid pattern.
   ============================================ */

:root {
  /* Oxford — primary dark (modry podton, ne cerna) */
  --oxford:    #000D20;
  --oxford-90: #0a1830;
  --oxford-80: #142340;

  /* Fire — primary red (CTA, akcent) */
  --fire:      #D40000;
  --fire-700:  #b00000;
  --fire-100:  #fde4e4;

  /* Dark grays */
  --gunmetal:  #1E2838;
  --charcoal:  #404A57;
  --slate:     #5E6876;
  --taupe:     #828994;

  /* Light grays */
  --french:    #BDC0C4;
  --timberwolf:#D8D9DB;
  --platinum:  #E5E6E7;
  --white:     #FFFFFF;

  /* Semantic */
  --bg:        #F4F5F6;
  --surface:   #FFFFFF;
  --line:      var(--platinum);
  --line-2:    #EEEFF0;
  --ink-900:   var(--oxford);
  --ink-700:   var(--gunmetal);
  --ink-500:   var(--charcoal);
  --ink-400:   var(--slate);
  --ink-300:   var(--taupe);

  /* Legacy aliases (used across components) */
  --navy-950: #000814;
  --navy-900: var(--oxford);
  --navy-800: var(--gunmetal);
  --navy-700: var(--charcoal);
  --navy-600: var(--slate);
  --navy-500: var(--slate);
  --navy-100: #e8eaf0;
  --navy-50:  #f4f5f8;
  --red-700:  var(--fire-700);
  --red-600:  var(--fire);
  --red-500:  var(--fire);
  --red-100:  var(--fire-100);
  /* No saturated green/amber per brand — use Fire for accents, Oxford/grays for the rest.
     Savings/positive: dark Oxford with subtle green-tinted background. */
  --green-800: #1a4a26;
  --green-700: #1f5a2e;
  --green-600: #246837;
  --green-500: #2e7d40;
  --green-100: #e6efe8;
  --amber-700: #8a4a00;
  --amber-600: var(--fire-700);
  --amber-500: var(--fire);
  --amber-100: var(--fire-100);

  /* System */
  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 0 rgba(0,13,32,0.04), 0 1px 2px rgba(0,13,32,0.04);
  --shadow:    0 1px 2px rgba(0,13,32,0.04), 0 6px 18px rgba(0,13,32,0.06);
  --shadow-lg: 0 12px 32px rgba(0,13,32,0.10), 0 4px 10px rgba(0,13,32,0.06);

  --sidebar-w: 264px;

  /* Stolzl analog: DM Sans (closest free Stolzl-like grotesque) — Book→400, Regular→500 */
  --font-sans: "DM Sans", "Inter", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

/* Brand "frame" grid — solar-panel intersection crosses */
.brand-grid {
  position: relative;
}
.brand-grid::before {
  content: "";
  position: absolute;
  inset: 8px;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(0,13,32,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,13,32,0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: 0 0;
  opacity: 0.7;
}

* { box-sizing: border-box; }

html, body, #root {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink-900);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--ink-900); }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* tabular numbers everywhere a number is shown */
.num, .metric-value, .table td.num, .stat-value { font-variant-numeric: tabular-nums; }

/* ================= APP SHELL ================= */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ----- Sidebar ----- */
.sidebar {
  background: var(--navy-900);
  color: #d8e0ee;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--navy-950);
}

.sidebar__logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 24px 22px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar__logo-img {
  height: 54px;
  width: auto;
  display: block;
}
.sidebar__logo .mark {
  width: 30px; height: 30px;
  border-radius: 7px;
  background: var(--red-600);
  position: relative;
  display: grid; place-items: center;
  flex: 0 0 auto;
}
.sidebar__logo .mark::before {
  content: "";
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
}
.sidebar__logo .mark::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 4px;
  background: conic-gradient(from 0deg, transparent 0 30deg, rgba(255,255,255,0.55) 30deg 60deg, transparent 60deg 90deg, rgba(255,255,255,0.55) 90deg 120deg, transparent 120deg 150deg, rgba(255,255,255,0.55) 150deg 180deg, transparent 180deg 210deg, rgba(255,255,255,0.55) 210deg 240deg, transparent 240deg 270deg, rgba(255,255,255,0.55) 270deg 300deg, transparent 300deg 330deg, rgba(255,255,255,0.55) 330deg 360deg);
  -webkit-mask: radial-gradient(circle, transparent 7px, #000 7.5px);
          mask: radial-gradient(circle, transparent 7px, #000 7.5px);
  opacity: .85;
}
.sidebar__logo .wordmark {
  display: flex; flex-direction: column; line-height: 1.1;
}
.sidebar__logo .wordmark b {
  color: #fff; font-size: 16px; letter-spacing: 0.02em; font-weight: 700;
}
.sidebar__logo .wordmark span {
  font-size: 10.5px; color: #aab7cc; letter-spacing: 0.04em;
}

.sidebar__progress {
  padding: 14px 22px 10px;
  display: flex; align-items: center; gap: 10px;
}
.sidebar__progress .bar {
  flex: 1; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden;
}
.sidebar__progress .bar > i {
  display: block; height: 100%; background: var(--red-500); border-radius: 2px; transition: width .25s;
}
.sidebar__progress .label {
  font-size: 11px; color: #8c9bb6; letter-spacing: 0.04em; text-transform: uppercase;
}

.sidebar__nav { padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: #c4cee0;
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 13.5px;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-item .num {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.08);
  font-size: 11.5px; color: #b6c2d8; font-weight: 600;
}
.nav-item.active {
  background: var(--navy-700);
  color: #fff;
}
.nav-item.active .num { background: var(--red-600); color: #fff; }
.nav-item.done .num {
  background: var(--green-600); color: #fff;
}
.nav-item .check { color: #6f7c92; font-size: 12px; }
.nav-item.done .check { color: var(--green-500); }

.sidebar__foot {
  padding: 14px 16px 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; flex-direction: column; gap: 10px;
}
.toggle-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  padding: 10px 12px;
  border-radius: 10px;
}
.toggle-row__label {
  display: flex; flex-direction: column; line-height: 1.2;
}
.toggle-row__label b { color: #fff; font-weight: 600; font-size: 12.5px; }
.toggle-row__label span { font-size: 10.5px; color: #8c9bb6; }
.switch {
  width: 34px; height: 20px; border-radius: 99px;
  background: rgba(255,255,255,0.18);
  position: relative; cursor: pointer; flex: 0 0 auto;
  transition: background .15s;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff;
  transition: transform .15s;
}
.switch.on { background: var(--red-600); }
.switch.on::after { transform: translateX(14px); }

/* ----- Main canvas ----- */
.main {
  display: flex; flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 20;
}
.topbar__crumbs { color: var(--ink-400); font-size: 12.5px; letter-spacing: .02em; }
.topbar__crumbs b { color: var(--ink-700); font-weight: 600; }
.topbar__title { font-size: 16px; font-weight: 600; color: var(--ink-900); margin-right: auto; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-700);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s, transform .05s;
}
.btn:hover { border-color: var(--ink-300); color: var(--ink-900); }
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: #fff;
}
.btn--primary:hover { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.btn--accent {
  background: var(--red-600); border-color: var(--red-600); color: #fff;
}
.btn--accent:hover { background: var(--red-700); border-color: var(--red-700); color: #fff; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--ink-500); }
.btn--ghost:hover { color: var(--ink-900); background: var(--line-2); }
.btn .ic { font-size: 14px; line-height: 1; }

.scroll {
  flex: 1; overflow-y: auto;
  padding: 28px 28px 80px;
}
.canvas {
  max-width: 1180px;
  margin: 0 auto;
  display: flex; flex-direction: column; gap: 24px;
}

/* ----- Page header ----- */
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  padding-bottom: 4px;
}
.page-header h1 {
  font-size: 26px; font-weight: 700; color: var(--ink-900);
  margin: 0 0 6px; letter-spacing: -0.01em;
}
.page-header .eyebrow {
  font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--red-600); font-weight: 600;
  margin-bottom: 6px;
}
.page-header p {
  margin: 0; color: var(--ink-500); max-width: 640px; font-size: 14px;
}

/* ----- Cards ----- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card > .card__head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; gap: 10px;
}
.card > .card__head .badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--navy-50); color: var(--navy-800);
  padding: 4px 8px; border-radius: 99px;
}
.card > .card__head h3 {
  margin: 0; font-size: 14.5px; font-weight: 600; color: var(--ink-900);
}
.card > .card__head .sub {
  margin-left: auto; color: var(--ink-400); font-size: 12px;
}
.card > .card__body { padding: 20px; }
.card > .card__body--tight { padding: 14px 20px; }

/* ----- Form grid ----- */
.grid {
  display: grid; gap: 14px 18px;
  grid-template-columns: repeat(12, 1fr);
}
.col-3  { grid-column: span 3; }
.col-4  { grid-column: span 4; }
.col-5  { grid-column: span 5; }
.col-6  { grid-column: span 6; }
.col-7  { grid-column: span 7; }
.col-8  { grid-column: span 8; }
.col-9  { grid-column: span 9; }
.col-12 { grid-column: span 12; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label {
  font-size: 12px; font-weight: 500; color: var(--ink-700);
  display: flex; align-items: center; gap: 6px;
}
.field > label .hint { color: var(--ink-400); font-weight: 400; }
.field > label .req { color: var(--red-600); }

.input, .select, .textarea {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink-900);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
  width: 100%;
  font-variant-numeric: tabular-nums;
}
.textarea { height: auto; padding: 10px 12px; min-height: 80px; resize: vertical; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-300); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--navy-600);
  box-shadow: 0 0 0 3px rgba(36,74,135,0.15);
}

.input-group { display: flex; align-items: stretch; }
.input-group .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .suffix {
  display: inline-flex; align-items: center; padding: 0 10px;
  border: 1px solid var(--line); border-left: 0;
  background: var(--bg);
  color: var(--ink-500); font-size: 12px;
  border-radius: 0 8px 8px 0;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%23586378' stroke-width='1.5' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px;
  padding-right: 30px;
}

/* segmented */
.segmented {
  display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.segmented button {
  border: 0; background: transparent;
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--ink-500);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.segmented button:hover { color: var(--ink-900); }
.segmented button.on { background: #fff; color: var(--navy-800); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }

/* checkbox tiles */
.tile-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}
.tile {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color .12s, background .12s;
  user-select: none;
}
.tile:hover { border-color: var(--ink-300); }
.tile.on {
  border-color: var(--navy-600);
  background: var(--navy-50);
}
.tile .check {
  width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid var(--ink-300);
  display: grid; place-items: center;
  background: #fff;
  flex: 0 0 auto;
}
.tile.on .check {
  background: var(--navy-700); border-color: var(--navy-700);
}
.tile.on .check::after {
  content: ""; width: 8px; height: 5px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px,-1px);
}
.tile .label { font-size: 13px; color: var(--ink-900); font-weight: 500; }
.tile .desc { font-size: 11.5px; color: var(--ink-400); }

/* number-stepper */
.stepper {
  display: inline-flex; align-items: stretch; height: 38px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden;
}
.stepper button {
  width: 36px; border: 0; background: transparent; cursor: pointer; color: var(--ink-500);
  font-size: 16px;
}
.stepper button:hover { background: var(--bg); color: var(--ink-900); }
.stepper input {
  width: 56px; text-align: center; border: 0; outline: none; font-variant-numeric: tabular-nums;
  background: transparent;
}

/* ----- Hero metric ----- */
.hero-metric {
  position: relative;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 85% 0%, rgba(226,0,26,0.45), transparent 55%),
    linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 60%, var(--red-700) 130%);
  color: #fff;
  padding: 24px 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero-metric::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 92% 110%, rgba(255,255,255,0.07), transparent 50%);
  pointer-events: none;
}
.hero-metric .label {
  font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; color: #bcc8e0;
  font-weight: 600;
}
.hero-metric .value {
  font-size: 64px; line-height: 1; font-weight: 700; margin: 8px 0 6px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.hero-metric .value small { font-size: 28px; font-weight: 600; color: #cdd5e7; margin-left: 8px; }
.hero-metric .desc { color: #cdd5e7; font-size: 13px; max-width: 460px; }
.hero-metric .pill {
  position: absolute; right: 24px; top: 24px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 6px 10px; border-radius: 99px; font-size: 11.5px; color: #fff; backdrop-filter: blur(2px);
}

/* ----- Stat row (small metrics) ----- */
.stats {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}
.stat .label { font-size: 11.5px; color: var(--ink-500); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500;}
.stat .value { font-size: 20px; font-weight: 700; color: var(--ink-900); margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 12px; font-weight: 500; color: var(--ink-500); margin-left: 4px; }
.stat--pos .value { color: var(--green-700); }
.stat--accent .value { color: var(--red-600); }

/* ----- Detail table ----- */
.dl {
  display: grid;
  grid-template-columns: 1fr auto;
  row-gap: 8px;
  column-gap: 16px;
  font-size: 13px;
}
.dl > dt { color: var(--ink-500); }
.dl > dd { margin: 0; color: var(--ink-900); font-weight: 600; font-variant-numeric: tabular-nums; }
.dl > dt, .dl > dd {
  padding: 6px 0;
  border-bottom: 1px dashed var(--line-2);
}
.dl > :nth-last-child(-n+2) { border-bottom: 0; }

/* ----- Service-only ----- */
.service-only { display: none; }
.app.service-on .service-only { display: block; }
.service-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-500); font-weight: 600;
  padding: 3px 8px; border-radius: 99px;
  background: var(--bg);
  border: 1px dashed var(--ink-300);
}
.service-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-400); }

/* ----- Tooltip ----- */
.tip {
  display: inline-grid; place-items: center;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); color: var(--ink-500);
  font-size: 9.5px; font-weight: 700;
  cursor: help;
  position: relative;
  border: 1px solid var(--line);
}
.tip:hover::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--ink-900); color: #fff;
  padding: 6px 10px; border-radius: 6px; font-size: 11.5px; line-height: 1.3;
  white-space: nowrap;
  z-index: 10;
}

/* ----- Section header inside card ----- */
.section-title {
  display: flex; align-items: center; gap: 8px;
  margin: 4px 0 10px;
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-500); font-weight: 600;
}
.section-title::after {
  content: ""; flex: 1; height: 1px; background: var(--line-2);
}

/* ----- Print export ----- */
.print-only { display: none; }

@media print {
  @page { size: A4; margin: 16mm 14mm; }
  html, body { background: #fff; }
  .sidebar, .topbar, .no-print { display: none !important; }
  .app { grid-template-columns: 1fr; }
  .scroll { overflow: visible !important; padding: 0; }
  .canvas { display: none; }
  .print-only { display: block; }

  .print-only h1 { font-size: 22pt; margin: 6mm 0 4mm; color: #0a1c3d;}
  .print-only h2 {
    font-size: 13pt; color: #0a1c3d; margin: 8mm 0 2mm;
    border-bottom: 1.5px solid #0a1c3d;
    padding-bottom: 1mm;
  }
  .print-only p, .print-only td, .print-only th, .print-only li { font-size: 10.5pt; line-height: 1.4; color: #1a2236; }
  .print-only .header-bar {
    display: flex; align-items: flex-end; justify-content: space-between;
    border-bottom: 2px solid #d20012;
    padding-bottom: 4mm;
  }
  .print-only table {
    width: 100%; border-collapse: collapse; margin: 2mm 0 4mm;
  }
  .print-only table th, .print-only table td {
    text-align: left; padding: 2mm 3mm;
    border-bottom: 0.5px solid #c8cdd8;
    vertical-align: top;
  }
  .print-only table th { color: #586378; font-weight: 500; width: 38%; }
  .print-only table td { font-weight: 600; }
  .print-only .highlight { background: #fde4e7; }
  .print-only .footer-bar { color: #586378; font-size: 9pt; margin-top: 8mm; border-top: 0.5px solid #c8cdd8; padding-top: 2mm; }
}

/* ----- Tooltip / inline ic ----- */
.ic-i {
  display: inline-grid; place-items: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--navy-100); color: var(--navy-800);
  font-size: 10px; font-weight: 700; cursor: help;
}

/* ===== Module 3 specific ===== */
.house-stage {
  background:
    linear-gradient(180deg, #cfe2f5 0%, #e9f0f8 60%, #f4f5f8 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  padding: 12px;
  position: relative;
  overflow: hidden;
  aspect-ratio: 540 / 360;
}
.house-stage > svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* loading dot */
.dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ink-300); display: inline-block;
}
.dot--on { background: var(--green-500); }

/* drawer/details */
details.renov {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
details.renov > summary {
  list-style: none;
  padding: 12px 16px;
  font-weight: 600; font-size: 13.5px; color: var(--ink-900);
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
}
details.renov > summary::-webkit-details-marker { display: none; }
details.renov > summary::after {
  content: "+"; margin-left: auto; font-size: 18px; color: var(--ink-400);
  transition: transform .15s;
}
details.renov[open] > summary::after { transform: rotate(45deg); }
details.renov > div { padding: 0 16px 14px; }

/* ===== Heat-pump catalog list (03.G) ===== */
.hp-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.hp-brand {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  overflow: hidden;
}
.hp-brand + .hp-brand { margin-top: 14px; }
.hp-brand__head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(180deg, #fafbfc 0%, #f4f5f7 100%);
  border-bottom: 1px solid var(--line-2);
}
.hp-brand__name {
  font-size: 13px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--ink-900); text-transform: uppercase;
}
.hp-brand__count {
  font-size: 11.5px; color: var(--ink-400);
  background: #fff;
  border: 1px solid var(--line);
  padding: 2px 8px; border-radius: 99px;
}
.hp-brand__price-range {
  margin-left: auto;
  font-size: 12px; color: var(--ink-500);
  font-variant-numeric: tabular-nums;
}
.hp-brand__price-range b { color: var(--ink-900); font-weight: 600; }
.hp-list { display: flex; flex-direction: column; }
.hp-row {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-top: 1px solid var(--line-2);
}
.hp-row:first-child { border-top: 0; }
.hp-row:hover { background: #fafbfc; }
.hp-row__power {
  background: var(--navy-900);
  color: #fff;
  border-radius: 8px;
  text-align: center;
  padding: 8px 6px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
}
.hp-row__power .num { font-size: 22px; }
.hp-row__power .unit { font-size: 10.5px; font-weight: 500; opacity: 0.7; letter-spacing: 0.04em; }
.hp-row__name {
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.hp-row__name .model {
  font-size: 13.5px; font-weight: 600; color: var(--ink-900);
}
.hp-row__tags { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.hp-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em;
  padding: 3px 8px; border-radius: 99px;
  background: var(--navy-50); color: var(--navy-800);
  border: 1px solid var(--line);
  text-transform: uppercase;
}
.hp-tag--split    { background: #eaf3fb; color: #1d4f7e; border-color: #d4e6f5; }
.hp-tag--monoblok { background: #f0eee9; color: #5a4a1f; border-color: #e3dccb; }
.hp-tag--aio      { background: var(--fire-100); color: var(--fire-700); border-color: #f5cccc; }
.hp-tag--phase    { background: #fff; color: var(--ink-500); }
.hp-row__price {
  font-size: 13.5px; font-weight: 700; color: var(--ink-900);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.hp-row__price small {
  display: block; font-size: 10.5px; font-weight: 500;
  color: var(--ink-400); letter-spacing: 0.04em; text-transform: uppercase;
  margin-bottom: 2px;
}
.hp-empty {
  padding: 14px 16px; font-size: 12.5px; color: var(--ink-500);
  background: var(--bg); border-radius: 10px; border: 1px dashed var(--line);
}
.hp-empty b { color: var(--ink-900); }

/* Toolbar above brand list */
.hp-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 14px;
}
.hp-toolbar__left { display: flex; align-items: center; gap: 10px; }
.hp-toolbar__lbl {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-500);
}
.hp-toolbar__legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--ink-500); line-height: 1.5;
}
.hp-toolbar__legend b { color: var(--ink-900); font-weight: 600; }
.hp-toolbar__legend .dotsep { color: var(--ink-300); }

/* Subgroup (All in one / Samostatné) */
.hp-sub + .hp-sub { border-top: 1px solid var(--line); }
.hp-sub__head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px;
  background: #fcfcfd;
  border-top: 1px solid var(--line-2);
}
.hp-sub__tag {
  display: inline-flex; align-items: center;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em;
  padding: 3px 10px; border-radius: 99px;
  text-transform: uppercase;
}
.hp-sub__tag--aio { background: var(--fire-100); color: var(--fire-700); border: 1px solid #f5cccc; }
.hp-sub__tag--sam { background: var(--navy-50); color: var(--navy-800); border: 1px solid var(--line); }
.hp-sub__desc { font-size: 11.5px; color: var(--ink-500); }
@media (max-width: 720px) {
  .hp-row { grid-template-columns: 64px 1fr; }
  .hp-row__price { grid-column: 1 / -1; text-align: left; padding-left: 80px; }
}

/* ============================================
   Interest tiles (Module 01.A)
   ============================================ */
.int-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.int-tile {
  display: grid;
  grid-template-columns: 44px 1fr 28px;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color .12s, background .12s, box-shadow .12s;
  font-family: inherit;
  width: 100%;
}
.int-tile:hover { border-color: var(--ink-300); }
.int-tile.on {
  border-color: var(--fire);
  background: var(--fire-100);
  box-shadow: 0 0 0 3px rgba(212, 0, 0, 0.08);
}
.int-tile.is-disabled { cursor: not-allowed; opacity: 0.6; }
.int-tile__icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--navy-50);
  color: var(--ink-900);
  font-size: 22px;
  line-height: 1;
}
.int-tile.on .int-tile__icon {
  background: var(--fire);
  color: #fff;
}
.int-tile__body { min-width: 0; }
.int-tile__title {
  font-size: 14.5px; font-weight: 700; color: var(--ink-900);
  display: flex; align-items: center; gap: 8px;
}
.int-tile__badge {
  display: inline-flex; align-items: center;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 99px;
  background: var(--navy-50); color: var(--ink-500);
  border: 1px solid var(--line);
}
.int-tile__desc { font-size: 12px; color: var(--ink-500); margin-top: 2px; }
.int-tile__check {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1.5px solid var(--ink-300);
  color: var(--ink-300);
  font-size: 13px; font-weight: 700;
  background: var(--surface);
}
.int-tile.on .int-tile__check {
  border-color: var(--fire);
  background: var(--fire);
  color: #fff;
}
.hint-row {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--fire-700);
  background: var(--fire-100);
  border: 1px solid #f5cccc;
  padding: 8px 12px;
  border-radius: var(--radius);
}

/* ============================================
   Source picker — 01.D icon tiles
   ============================================ */
.source-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.source-tile {
  display: grid;
  grid-template-columns: 48px 1fr 24px;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .12s, background .12s, box-shadow .12s;
  font-family: inherit;
  text-align: left;
  width: 100%;
}
.source-tile:hover {
  border-color: var(--ink-300);
  background: var(--navy-50);
}
.source-tile.on {
  border-color: var(--navy-700);
  background: var(--navy-50);
  box-shadow: 0 0 0 3px rgba(36,74,135,0.10);
}
.source-tile__icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--bg);
  display: grid;
  place-items: center;
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
  transition: background .12s;
}
.source-tile.on .source-tile__icon {
  background: var(--navy-100);
}
.source-tile__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-700);
  line-height: 1.25;
}
.source-tile.on .source-tile__label {
  color: var(--navy-800);
  font-weight: 600;
}
.source-tile__check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-300);
  background: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background .12s, border-color .12s;
}
.source-tile.on .source-tile__check {
  background: var(--navy-700);
  border-color: var(--navy-700);
}
.source-tile.on .source-tile__check::after {
  content: "";
  width: 8px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
  display: block;
}

@media (max-width: 600px) {
  .source-picker { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 380px) {
  .source-picker { grid-template-columns: 1fr; }
  .source-tile { grid-template-columns: 40px 1fr 20px; }
}

/* ============================================
   Hamburger / mobile menu button
   ============================================ */
.btn--menu {
  display: none;
  width: 40px; height: 40px;
  padding: 0;
  align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}
.btn--menu span {
  display: block; width: 18px; height: 2px;
  background: var(--ink-900);
  position: relative;
}
.btn--menu span::before, .btn--menu span::after {
  content: ""; position: absolute; left: 0; right: 0; height: 2px;
  background: var(--ink-900);
}
.btn--menu span::before { top: -6px; }
.btn--menu span::after { top: 6px; }

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0, 13, 32, 0.45);
  z-index: 90;
}

/* ============================================
   Mobile breakpoints
   ============================================ */
@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 280px; height: 100vh;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open {
    transform: translateX(0);
  }
  .sidebar-backdrop.is-open {
    display: block;
  }
  .btn--menu {
    display: inline-flex;
  }
  .topbar {
    height: 56px;
    padding: 0 14px;
    gap: 10px;
  }
  .topbar__crumbs {
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
  }
  .topbar .btn:not(.btn--menu) .ic + :not(.ic),
  .topbar .btn--ghost { /* hide label-only buttons not vital on mobile */ }
  .topbar .btn:not(.btn--menu):not(.btn--accent) {
    display: none; /* show only the primary print/save action */
  }
  .topbar .btn--accent .ic { margin: 0; }
  .topbar .btn--accent {
    padding: 8px 12px; font-size: 12px;
  }
  .scroll {
    padding: 16px 14px 80px;
  }
  .canvas { gap: 14px; }
  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .page-header h1 { font-size: 22px; }
  .page-header p { font-size: 13px; }
  .page-header .btn { align-self: flex-start; }
  /* Stack all grid cols */
  .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9 {
    grid-column: span 12;
  }
  .grid { gap: 12px; }
  .card__head {
    flex-wrap: wrap;
    gap: 8px;
  }
  .card__head h3 { font-size: 15px; }
  .card__head .sub { font-size: 11.5px; width: 100%; margin-left: 0; }
  .card__body { padding: 14px; }
  /* Interest tiles full-width stack */
  .int-grid { grid-template-columns: 1fr; }
  /* HP row: stack price */
  .hp-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .hp-summary { grid-template-columns: 1fr !important; }
  .stat .value { font-size: 22px; }
  /* Stepper smaller */
  .stepper input { width: 44px; }
  /* Larger tap targets */
  .input, .select, .btn, .nav-item, .tile {
    min-height: 40px;
  }
}

@media (max-width: 520px) {
  .page-header h1 { font-size: 19px; }
  .topbar__crumbs { font-size: 11px; }
  .card__body { padding: 12px; }
  .scroll { padding: 12px 10px 80px; }
  .btn { font-size: 12.5px; padding: 8px 12px; }
}

/* ============================================
   Segmented wrap variant
   ============================================ */
.segmented--wrap {
  display: flex; flex-wrap: wrap;
}
.segmented--wrap button {
  flex: 0 0 auto;
}

/* ============================================
   Hero metric — responsive font size
   ============================================ */
@media (max-width: 900px) {
  .hero-metric .value { font-size: 48px; }
  .hero-metric .value small { font-size: 22px; }
  .hero-metric { padding: 18px 20px; }
  .hero-metric .pill { right: 14px; top: 14px; font-size: 11px; }
}
@media (max-width: 520px) {
  .hero-metric .value { font-size: 38px; }
  .hero-metric .value small { font-size: 18px; }
  .hero-metric .desc { font-size: 12px; }
}

/* ============================================
   Tablet: col-6 stays half-width (≥600px)
   col-3/4 stack only on small mobile
   ============================================ */
@media (min-width: 600px) and (max-width: 900px) {
  .col-6 { grid-column: span 6; }
  .col-7, .col-8, .col-9 { grid-column: span 12; }
}
@media (max-width: 599px) {
  .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9 {
    grid-column: span 12;
  }
}

/* ============================================
   FVE Step bar — tablet / mobile
   ============================================ */
.fve-step-short { display: none; }

@media (max-width: 560px) {
  .fve-step-label { display: none; }
  .fve-step-short { display: inline; }
}

/* ============================================
   PENB segmented — wrap on narrow screens
   ============================================ */
@media (max-width: 680px) {
  /* Force segmented inside PENB card to stack vertically */
  .penb-version-switch.segmented {
    flex-direction: column;
    width: 100%;
  }
  .penb-version-switch.segmented button {
    width: 100%; text-align: left;
  }
}

/* ============================================
   Topbar: on tablet keep Reset button visible
   ============================================ */
@media (min-width: 600px) and (max-width: 900px) {
  .topbar .btn--ghost {
    display: inline-flex;
  }
}

/* ============================================
   HP toolbar legend: hide separators on mobile
   ============================================ */
@media (max-width: 600px) {
  .hp-toolbar__legend .dotsep { display: none; }
  .hp-toolbar__legend { flex-direction: column; gap: 3px; }
  .hp-brand__price-range { display: none; }
}
