/*! solar.css — the Pakistan solar calculator.
    Uses the platform tokens from site.css; adds a warm solar accent that only
    appears in this tool, so each tool has an identity without a new system. */

.solar {
  --sun: #E8A013;          /* solar accent, used sparingly */
  --sun-soft: #FDF3E0;
  --panel: #123B57;        /* deep panel blue for the result headline */
}

/* ------------------------------- hero -------------------------------- */
.solar-hero { padding: 34px 0 26px; }
.solar-hero-inner { display: grid; gap: 24px; align-items: center; }
@media (min-width: 900px) {
  .solar-hero-inner { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 40px; }
}
.solar-hero h1 { margin-bottom: 12px; }
.solar-hero-lead { font-size: 1.05rem; color: var(--ink-2); max-width: 56ch; margin-bottom: 18px; }
.solar-hero-meta {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); margin-top: 14px;
}

/* A drawn roof rather than a stock photo: no image weight, no licence. */
.roof-art { width: 100%; height: auto; max-width: 420px; margin-inline: auto; display: block; }

/* ------------------------------ stepper ------------------------------ */
.stepper { display: flex; gap: 6px; margin-bottom: 18px; }
.step-dot {
  flex: 1; display: grid; gap: 5px; padding-top: 8px;
  border-top: 3px solid var(--line); color: var(--muted);
  font-size: .78rem; line-height: 1.3;
}
.step-dot-num {
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase;
}
.step-dot.is-done { border-top-color: var(--brand); color: var(--ink-2); }
.step-dot.is-current { border-top-color: var(--sun); color: var(--ink); font-weight: 600; }
@media (max-width: 560px) { .step-dot-label { display: none; } .step-dot { padding-bottom: 4px; } }

/* ------------------------------- panels ------------------------------ */
.solar-tool { padding-bottom: 20px; scroll-margin-top: 70px; }
.step-panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm);
}
.step-panel h2 { font-size: 1.25rem; margin-bottom: 4px; }
.step-panel > p.lead { color: var(--muted); font-size: .92rem; margin-bottom: 20px; }
.step-block { margin-bottom: 22px; }
.step-block > h3 { font-size: 1rem; margin-bottom: 4px; }
.step-block > p { font-size: .88rem; color: var(--muted); margin-bottom: 12px; }

.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  padding: 10px 16px; min-height: 44px;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); font: inherit; font-size: .93rem;
  cursor: pointer; color: var(--ink);
}
.choice:hover { border-color: #a9b7c4; }
.choice.is-active {
  border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); font-weight: 600;
}

.step-nav {
  display: flex; gap: 10px; justify-content: space-between;
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line);
}
.step-nav .btn--primary { margin-left: auto; }

/* ------------------------------ presets ------------------------------ */
.preset-grid { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .preset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.preset {
  text-align: left; padding: 14px 16px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); font: inherit; color: var(--ink);
  display: grid; gap: 4px;
}
.preset:hover { border-color: var(--sun); background: var(--sun-soft); }
.preset-name { font-weight: 650; }
.preset-hint { font-size: .82rem; color: var(--muted); line-height: 1.4; }

/* ---------------------------- catalogue ------------------------------ */
.cat { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px; }
.cat > summary {
  padding: 11px 14px; cursor: pointer; font-weight: 600; font-size: .93rem; list-style: none;
}
.cat > summary::-webkit-details-marker { display: none; }
.cat-count {
  font-family: var(--font-mono); font-size: .68rem; color: var(--muted);
  background: var(--desk); padding: 2px 6px; border-radius: 4px; margin-left: 4px;
}
.cat-grid {
  display: grid; gap: 8px; padding: 0 14px 14px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.chip {
  display: grid; gap: 2px; padding: 10px 12px; min-height: 52px; text-align: left;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); font: inherit; cursor: pointer; color: var(--ink);
}
.chip:hover { border-color: var(--sun); background: var(--sun-soft); }
.chip.is-chosen { border-color: var(--brand); background: var(--brand-soft); }
.chip.is-chosen::after {
  content: "Added"; font-family: var(--font-mono); font-size: .6rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--brand-ink);
}
.chip-name { font-size: .88rem; font-weight: 500; line-height: 1.25; }
.chip-watts { font-family: var(--font-mono); font-size: .7rem; color: var(--muted); }

/* -------------------------- appliance rows --------------------------- */
.ap-row {
  padding: 14px; margin-bottom: 10px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.ap-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ap-name { font-weight: 650; }
.ap-head .icon-btn { margin-left: auto; }
.ap-fields { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .ap-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ap-total { justify-content: flex-end; }
.ap-kwh {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 1.05rem; font-weight: 700; color: var(--brand-ink); padding-top: 4px;
}
.ap-flags { display: grid; gap: 6px; margin-top: 10px; }
.ap-factor { font-family: var(--font-mono); font-size: .7rem; color: var(--muted); }
.ap-note {
  margin: 10px 0 0; padding: 9px 11px; font-size: .82rem; line-height: 1.5;
  background: var(--sun-soft); color: #7a5200; border-radius: var(--radius-sm);
}
.switch--sm { font-size: .85rem; align-items: flex-start; }
.switch--sm input { width: 16px; height: 16px; margin-top: 2px; flex: none; }
.muted-inline { color: var(--muted); font-family: var(--font-mono); font-size: .76rem; }

.backup-list { display: grid; gap: 8px; margin-bottom: 14px; }
@media (min-width: 640px) { .backup-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.backup-summary {
  font-family: var(--font-mono); font-size: .8rem; color: var(--brand-ink);
  background: var(--brand-soft); padding: 10px 12px; border-radius: var(--radius-sm);
}

/* ------------------------------ live bar ----------------------------- */
.live-bar {
  position: sticky; bottom: 0; z-index: 20;
  display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
  margin-top: 14px; padding: 12px 16px;
  background: var(--ink); color: #fff; border-radius: var(--radius);
}
.live-item { display: grid; gap: 1px; }
.live-label {
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .1em;
  text-transform: uppercase; opacity: .65;
}
.live-value {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 1.1rem; font-weight: 700;
}
.live-count { margin-left: auto; font-size: .8rem; opacity: .7; }
@media (max-width: 560px) { .live-count { margin-left: 0; width: 100%; } }

/* ------------------------------- result ------------------------------ */
.result-hero {
  text-align: center; padding: 30px 22px;
  background: var(--panel); color: #fff; border-radius: var(--radius) var(--radius) 0 0;
}
.result-eyebrow {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .14em;
  text-transform: uppercase; opacity: .7;
}
.result-kw {
  font-size: clamp(3rem, 2rem + 8vw, 4.6rem); font-weight: 800;
  letter-spacing: -.04em; line-height: 1; margin: 8px 0 4px;
}
.result-kw span { font-size: .35em; font-weight: 600; letter-spacing: -.02em; margin-left: 4px; }
.result-sub { opacity: .85; font-size: .95rem; }
.result-badge {
  display: inline-block; margin-top: 14px; padding: 5px 14px; border-radius: 999px;
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  background: rgba(255,255,255,.16);
}
.result-badge--large, .result-badge--xl { background: var(--sun); color: #2a1c00; }

.gauge { padding: 20px 22px; background: var(--surface); border-bottom: 1px solid var(--line); }
.gauge-track {
  position: relative; height: 10px; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-soft), var(--sun-soft));
}
.gauge-fill {
  position: absolute; inset: 0 auto 0 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--sun));
}
.gauge-marker {
  position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 3px solid var(--panel); transform: translate(-50%, -50%);
}
.gauge-scale {
  display: flex; justify-content: space-between; margin-top: 8px;
  font-family: var(--font-mono); font-size: .68rem; color: var(--muted);
}
.gauge-value { font-weight: 700; color: var(--panel); }

.result-cards {
  display: grid; gap: 1px; background: var(--line);
  border-bottom: 1px solid var(--line);
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
}
.result-card { background: var(--surface); padding: 18px; display: grid; gap: 3px; }
.result-card-label {
  font-family: var(--font-mono); font-size: .64rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
.result-card-value {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15;
}
.result-card-note { font-size: .78rem; color: var(--muted); line-height: 1.4; }

.result-body {
  background: var(--surface); border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius); padding: 22px;
}
.result-shell { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }

.working { display: grid; gap: 2px; margin: 12px 0 0; }
.working-row {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 9px 12px; font-size: .87rem; background: var(--surface-2); border-radius: 4px;
}
.working-row span:last-child {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink);
}
.working-row span:first-child { color: var(--ink-2); }

.result-table { width: 100%; border-collapse: collapse; font-size: .88rem; margin-top: 10px; }
.result-table th {
  text-align: left; padding: 9px 10px; border-bottom: 1.5px solid var(--line);
  font-family: var(--font-mono); font-size: .64rem; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted);
}
.result-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.result-table .num {
  text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums;
}
.result-table tfoot td { font-weight: 700; border-bottom: 0; }

@media (max-width: 620px) {
  .result-table thead { display: none; }
  .result-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px;
    padding: 10px 0; border-bottom: 1px solid var(--line); }
  .result-table td { border: 0; padding: 2px 0; }
  .result-table td:first-child { grid-column: 1 / -1; font-weight: 600; }
  .result-table td::before {
    content: attr(data-label) ": "; color: var(--muted); font-size: .78rem;
  }
  .result-table .num { text-align: left; }
  .result-table tfoot tr { grid-template-columns: 1fr; }
}

.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.disclaimer {
  margin-top: 20px; padding: 16px 18px; font-size: .85rem; line-height: 1.6;
  background: var(--warn-soft); color: #6b4500; border-radius: var(--radius);
}
.lead-cta {
  margin-top: 16px; padding: 20px; text-align: center;
  background: var(--brand-soft); border-radius: var(--radius);
}
.lead-cta h3 { margin-bottom: 6px; }
.lead-cta p { font-size: .88rem; color: var(--brand-ink); margin-bottom: 14px; }

/* ------------------------------- print ------------------------------- */
@media print {
  @page { size: A4; margin: 14mm; }
  html, body { background: #fff !important; padding: 0 !important; }
  .site-header, .site-footer, .solar-hero, .stepper, .step-panel, .step-nav,
  .live-bar, .ad-slot, .content-section, .breadcrumbs, .toasts, .modal,
  .result-actions, .lead-cta, .skip-link, .account-btn { display: none !important; }
  .wrap { padding: 0 !important; max-width: none !important; }
  .result-shell { border: 0 !important; }
  .result-hero {
    background: #fff !important; color: #14181f !important;
    border-bottom: 2px solid #14181f; text-align: left; padding: 0 0 12px;
  }
  .result-kw { color: #14181f; }
  .result-badge { background: #eee !important; color: #14181f !important; }
  .gauge { display: none; }
  .result-cards { gap: 0; border: 0; grid-template-columns: repeat(2, 1fr); }
  .result-card { border-bottom: 1px solid #ddd; padding: 10px 0; }
  .result-body { border: 0; padding: 14px 0 0; }
  .working-row, .disclaimer { background: #f6f6f6 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .result-table tr, .working-row, .disclaimer { break-inside: avoid; }
  .result-table thead { display: table-header-group; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
