:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1a202c;
  --text-secondary: #64748b;
  --primary: #2563eb;
  --primary-light: #dbeafe;
  /* Energy Navigator brand (navy + amber) alongside D1 blues */
  --en-navy: #082851;
  --en-navy-mid: #0d3a72;
  --en-amber: #fca035;
  --en-amber-hover: #e88e2a;
  --en-amber-soft: rgba(252, 160, 53, 0.18);
  --pass: #16a34a;
  --pass-bg: #dcfce7;
  --fail: #dc2626;
  --fail-bg: #fee2e2;
  --action: #d97706;
  --action-bg: #fef3c7;
  --info: #2563eb;
  --info-bg: #dbeafe;
  --note: #7c3aed;
  --note-bg: #ede9fe;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Montserrat, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* Site chrome uses shared shell in index.html (navigator-header.css); avoid global `header {}` overriding .en-header-main. */

/* Tool name strip — above main nav (brand navy + amber accent) */
.app-tool-bar {
  background: linear-gradient(135deg, var(--en-navy) 0%, var(--en-navy-mid) 100%);
  border-bottom: 3px solid var(--en-amber);
  padding: 10px 24px;
  max-width: 100%;
}

.app-tool-bar-label {
  display: block;
  max-width: 1200px;
  margin: 0 auto;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
}

.app-tool-bar-label::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  margin-top: 8px;
  border-radius: 2px;
  background: var(--en-amber);
}

/* Upload Section */
.upload-section {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 32px;
  text-align: center;
  margin: 32px 0;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}

.upload-section.dragover {
  border-color: var(--en-amber);
  background: var(--en-amber-soft);
  box-shadow: 0 0 0 4px rgba(252, 160, 53, 0.18);
}

.drop-icon {
  color: var(--text-secondary);
  margin-bottom: 12px;
  transition: color 0.2s, transform 0.2s;
}

.upload-section.dragover .drop-icon {
  color: var(--en-amber);
  transform: translateY(-4px);
}

.upload-section h2 {
  font-size: 18px;
  margin-bottom: 8px;
}

.upload-section p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 28px;
}

/* Review panel: upload + FAQ below analyze (left); “This page” blurb (right) */
.review-intro-grid {
  display: grid;
  gap: 16px 24px;
  align-items: start;
  margin-bottom: 8px;
}

@media (min-width: 720px) {
  .review-intro-grid {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
    align-items: stretch;
  }

  .review-verification-col {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 0;
  }
}

.review-upload-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.upload-section.upload-section--compact {
  padding: 22px 18px;
  margin: 0;
  text-align: center;
}

.upload-section--compact .drop-icon {
  margin-bottom: 8px;
}

.upload-section--compact h2 {
  font-size: 16px;
  margin-bottom: 8px;
}

.upload-two-pdf-hint {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
  margin: 0 auto 14px;
  max-width: 520px;
  text-align: center;
}

.upload-section--compact p {
  font-size: 13px;
  margin-bottom: 16px;
}

.file-inputs--compact {
  gap: 16px;
  margin-bottom: 16px;
}

.upload-h2k-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0 0 8px;
  max-width: 560px;
  line-height: 1.45;
}

.file-inputs--h2k {
  margin-bottom: 12px;
}

.review-upload-col .file-box--h2k {
  max-width: 240px;
  padding: 10px 10px;
}

.file-drop-target--small {
  padding: 8px 10px;
  min-height: auto;
}

.file-name--small {
  font-size: 12px;
  margin-top: 6px;
}

.h2k-supplementary-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.h2k-supplementary-block .h2k-subhead {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--en-navy-mid);
  margin: 12px 0 8px;
}

.h2k-supplementary-block .h2k-subhead:first-child {
  margin-top: 0;
}

.h2k-system-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}

.h2k-system-card .h2k-rank {
  font-weight: 700;
  font-size: 13px;
  color: var(--en-navy);
  margin-bottom: 6px;
}

.review-upload-col .file-box {
  padding: 14px 12px;
  width: 100%;
  max-width: 280px;
}

.review-verification-col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
}

.official-faq-open--below-upload {
  width: 100%;
  white-space: normal;
  align-self: stretch;
}

.official-faq-open {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--en-navy);
  background: var(--surface);
  border: 2px solid var(--en-navy);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}

@media (max-width: 719px) {
  .official-faq-open {
    width: 100%;
    white-space: normal;
  }
}

.official-faq-open:hover {
  background: var(--en-amber-soft);
  border-color: var(--en-amber);
  color: var(--en-navy);
}

/* NBC verification blurb — under Analyze */
.verification-segment {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: left;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--en-amber);
}

.verification-segment-text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  margin: 0;
}

.verification-segment-text strong {
  color: var(--en-navy);
}

/* ── "What's next" dropdown (sits below verification segment) ── */
.platform-teaser-dropdown {
  margin-top: 10px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(8, 40, 81, 0.18);
  background: linear-gradient(145deg, var(--en-navy) 0%, var(--en-navy-mid) 42%, #1a4a7c 100%);
}

.platform-teaser-dropdown-summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  padding: 10px 16px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.platform-teaser-dropdown-summary::-webkit-details-marker {
  display: none;
}

.platform-teaser-dropdown-summary::before {
  content: "\25B6";
  font-size: 9px;
  transition: transform 0.2s;
  flex-shrink: 0;
  color: var(--en-amber);
}

.platform-teaser-dropdown[open] > .platform-teaser-dropdown-summary::before {
  transform: rotate(90deg);
}

.platform-teaser-dropdown-summary:hover {
  background: rgba(255, 255, 255, 0.06);
}

.platform-teaser-dropdown-body {
  padding: 4px 16px 14px;
  color: #f1f5f9;
}

.platform-teaser-dropdown-body > p {
  font-size: 12.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
  margin: 0 0 12px;
}

/* Compact branded platform teaser (legacy — hidden; chips/modals still use sub-classes) */
.platform-teaser {
  display: none;
}

.platform-teaser-inner {
  background: linear-gradient(145deg, var(--en-navy) 0%, var(--en-navy-mid) 42%, #1a4a7c 100%);
  color: #f1f5f9;
  padding: 18px 20px 16px;
  padding-right: 100px;
  position: relative;
}

.platform-teaser-inner::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -8%;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, var(--en-amber-soft) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Orange house-in-circle mark (Energy Navigator icon) */
.platform-teaser-mark {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 76px;
  height: auto;
  z-index: 2;
  object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.28));
  pointer-events: none;
}

@media (max-width: 420px) {
  .platform-teaser-inner {
    padding-right: 86px;
  }

  .platform-teaser-mark {
    width: 58px;
    top: 12px;
    right: 12px;
  }
}

.platform-teaser-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--en-navy);
  background: var(--en-amber);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.platform-teaser-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 10px;
  line-height: 1.25;
  position: relative;
  z-index: 1;
}

.platform-teaser-intro {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
  margin: 0 0 10px;
  position: relative;
  z-index: 1;
}

.platform-teaser-footnote {
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.78);
  margin: 0 0 14px;
  position: relative;
  z-index: 1;
}

.platform-teaser-operator {
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(252, 160, 53, 0.28);
  position: relative;
  z-index: 1;
}

.platform-teaser-operator--section {
  margin-top: 20px;
  margin-bottom: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(252, 160, 53, 0.35);
  border-radius: 0 0 10px 10px;
}

.platform-teaser-chips-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.65);
  margin: 0 0 8px;
  position: relative;
  z-index: 1;
}

.platform-teaser-inline-link {
  color: #ffd089;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 208, 137, 0.45);
}

.platform-teaser-inline-link:hover {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.55);
}

.platform-teaser-chips {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.platform-teaser-chips li {
  padding: 0;
  margin: 0;
}

.platform-teaser-chip {
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(252, 160, 53, 0.4);
  color: rgba(255, 255, 255, 0.96);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.platform-teaser-chip:hover {
  background: rgba(252, 160, 53, 0.22);
  border-color: var(--en-amber);
  transform: translateY(-1px);
}

.platform-teaser-chip:focus {
  outline: 2px solid var(--en-amber);
  outline-offset: 2px;
}

.platform-teaser-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.platform-teaser-map {
  font-size: 12px;
  font-weight: 600;
  color: var(--en-amber);
  text-decoration: none;
  border-bottom: 1px solid rgba(252, 160, 53, 0.5);
  padding-bottom: 1px;
}

.platform-teaser-map:hover {
  color: #ffd089;
  border-bottom-color: rgba(255, 208, 137, 0.7);
}

/* “Find out more” modal — wider + branded header */
.platform-more-dialog {
  width: min(92vw, 720px) !important;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.platform-more-header {
  padding: 14px 18px;
  border-bottom: 3px solid var(--en-amber);
  background: linear-gradient(135deg, var(--en-navy) 0%, var(--en-navy-mid) 100%);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.platform-more-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
  flex: 1;
}

.platform-more-header .official-faq-close {
  color: rgba(255, 255, 255, 0.85);
}

.platform-more-header .official-faq-close:hover {
  color: #fff;
}

.platform-more-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 18px 20px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}

.platform-more-body p {
  margin: 0 0 10px;
  color: var(--text-secondary);
}

.platform-more-body p strong,
.platform-more-body li strong {
  color: var(--text);
}

.platform-more-body ul {
  margin: 0 0 12px;
  padding-left: 1.2em;
  color: var(--text-secondary);
}

.platform-more-body li {
  margin-bottom: 6px;
}

.platform-more-body a {
  color: var(--en-navy);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(252, 160, 53, 0.5);
  text-underline-offset: 2px;
}

.platform-more-body a:hover {
  text-decoration-color: var(--en-amber);
}

.platform-more-mapline {
  margin-top: 12px;
  font-size: 13px;
}

.official-faq-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: rgba(15, 23, 42, 0.45);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.official-faq-modal.active {
  display: flex;
}

.official-faq-dialog {
  background: var(--surface);
  border-radius: 12px;
  width: min(92vw, 640px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.official-faq-header {
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--en-navy) 0%, var(--en-navy-mid) 100%);
  border-bottom: 3px solid var(--en-amber);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.official-faq-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
  flex: 1;
}

.official-faq-header .official-faq-close {
  color: rgba(255, 255, 255, 0.85);
}

.official-faq-header .official-faq-close:hover {
  color: #fff;
}

.official-faq-close {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0 4px;
}

.official-faq-close:hover {
  color: var(--text);
}

.official-faq-body {
  overflow-y: auto;
  padding: 16px 18px 22px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.official-faq-section {
  background: var(--surface);
  border: 1px solid rgba(8, 40, 81, 0.12);
  border-radius: 10px;
  border-left: 4px solid var(--en-amber);
  padding: 14px 16px 16px;
  box-shadow: 0 1px 3px rgba(8, 40, 81, 0.06);
}

.official-faq-body p {
  margin: 0 0 10px;
  color: var(--text-secondary);
}

.official-faq-body p:last-child {
  margin-bottom: 0;
}

.official-faq-body ul {
  margin: 0 0 10px 1.15rem;
  padding: 0;
  color: var(--text-secondary);
}

.official-faq-body li {
  margin-bottom: 6px;
}

.official-faq-body li:last-child {
  margin-bottom: 0;
}

.official-faq-q {
  font-size: 14px;
  font-weight: 700;
  color: var(--en-navy);
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--en-amber-soft);
}

.official-faq-body a {
  color: var(--en-navy);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(252, 160, 53, 0.55);
  text-underline-offset: 2px;
}

.official-faq-body a:hover {
  color: #0a3266;
  text-decoration-color: var(--en-amber);
}

.file-inputs {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.file-box {
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 20px;
  width: 260px;
  text-align: center;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.file-box.box-dragover {
  border-color: var(--en-amber);
  background: var(--en-amber-soft);
  box-shadow: 0 0 0 3px rgba(252, 160, 53, 0.22);
}

.file-box.has-file {
  border-color: var(--pass);
  border-style: solid;
  background: var(--pass-bg);
}

.file-box label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.file-box input[type="file"] {
  display: none;
}

.file-drop-target {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.file-box .file-btn {
  display: inline-block;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: all 0.15s;
}

.file-box .file-btn:hover {
  border-color: var(--en-amber);
  color: var(--en-navy);
}

.drop-hint {
  font-size: 11px;
  color: var(--text-secondary);
}

.file-box .file-name {
  font-size: 12px;
  color: var(--pass);
  margin-top: 6px;
  min-height: 18px;
  font-weight: 600;
  word-break: break-all;
}

.analyze-btn {
  background: var(--en-amber);
  color: var(--en-navy);
  border: none;
  padding: 12px 40px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.12s;
  box-shadow: 0 2px 8px rgba(252, 160, 53, 0.35);
}

.analyze-btn:hover:not(:disabled) {
  background: var(--en-amber-hover);
  box-shadow: 0 3px 12px rgba(252, 160, 53, 0.45);
  transform: translateY(-1px);
}

.analyze-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.analyze-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.analyze-btn--secondary {
  background: var(--surface);
  color: var(--en-navy);
  border: 2px solid var(--en-navy);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: none;
}

.analyze-btn--secondary:hover:not(:disabled) {
  background: rgba(8, 40, 81, 0.06);
  transform: translateY(-1px);
}

/* Heated floor / rough-in — inspector PDF review + internal .h2k QA */
.heated-floor-details {
  margin: 0 0 16px;
}

.heated-floor-details-summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  list-style: none;
  margin: 0 0 8px;
  user-select: none;
}

.heated-floor-details-summary::-webkit-details-marker {
  display: none;
}

.heated-floor-details[open] .heated-floor-details-summary {
  margin-bottom: 10px;
}

.card--heated-floor-callout .heated-floor-lead,
.mechanical-subsection--heated-floor .heated-floor-lead {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
}

.card--heated-floor-callout .heated-floor-lead code,
.mechanical-subsection--heated-floor .heated-floor-lead code {
  font-size: 12px;
}

.heated-floor-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 720px) {
  .heated-floor-two-col {
    grid-template-columns: 1fr;
  }
}

/* Status (N/A / Rough-in / Proposed): same scale as .kv values and card body */
.card--heated-floor-callout .heated-floor-headline,
.card--heated-floor-callout .heated-floor-status-line,
.card--heated-floor-callout p.heated-floor-headline.heated-floor-status-line,
.mechanical-subsection--heated-floor .heated-floor-headline,
.mechanical-subsection--heated-floor .heated-floor-status-line,
.mechanical-subsection--heated-floor p.heated-floor-headline.heated-floor-status-line {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: normal;
  color: var(--text-primary);
  margin: 4px 0 0;
}

.h2k-compare-card p.heated-floor-headline {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  margin: 0;
  color: var(--text-primary);
}

ul.heated-floor-detail-list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
}

ul.heated-floor-detail-list li {
  margin-bottom: 6px;
}

.h2k-compare-card .h2k-compare-files {
  font-size: 13px;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.h2k-cmp-table-wrap {
  overflow-x: auto;
}

.h2k-cmp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.h2k-cmp-table th,
.h2k-cmp-table td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.h2k-cmp-table th {
  background: rgba(8, 40, 81, 0.06);
  font-weight: 700;
  color: var(--en-navy);
}

.h2k-cmp-row--ok .h2k-cmp-status {
  color: var(--pass);
  font-weight: 700;
}

.h2k-cmp-row--diff .h2k-cmp-status {
  color: var(--fail);
  font-weight: 700;
}

.h2k-cmp-row--diff {
  background: rgba(220, 53, 69, 0.04);
}

.h2k-cmp-row--info .h2k-cmp-status {
  color: #b8860b;
  font-weight: 600;
}

.h2k-cmp-row--info {
  background: rgba(184, 134, 11, 0.04);
}

.h2k-cmp-section-header td {
  background: var(--en-navy);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.03em;
  padding: 7px 10px;
  border: none;
}

.h2k-cmp-label {
  font-weight: 600;
  max-width: 240px;
}

.h2k-cmp-cell {
  font-size: 12px;
  word-break: break-word;
  max-width: 280px;
  white-space: pre-line;
}

.h2k-cmp-detail {
  font-size: 12px;
  color: var(--text-secondary);
  max-width: 300px;
  white-space: pre-line;
}

.h2k-compare-loading {
  padding: 24px;
  text-align: center;
  color: var(--text-secondary);
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(8, 40, 81, 0.25);
  border-top-color: var(--en-navy);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

.analyze-btn .spinner {
  border-color: rgba(8, 40, 81, 0.3);
  border-top-color: var(--en-navy);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Results */
#results { display: none; }

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .results-grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 14px 18px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

/* Energy Navigator brand navy — report section titles */
.card-header.card-header--brand {
  background: linear-gradient(90deg, var(--en-navy-mid) 0%, var(--en-navy) 100%);
  color: #fff;
  border-bottom: none;
  text-transform: none;
  letter-spacing: 0.03em;
  font-size: 14px;
  font-weight: 800;
}

/* Amber accent — performance summary card header only */
.card--perf-summary > .card-header.card-header--brand {
  background: linear-gradient(135deg, var(--en-amber) 0%, var(--en-amber-hover) 100%);
  color: var(--en-navy);
  border-bottom: none;
}

.card-header.card-header--brand-sub {
  background: var(--primary-light);
  color: var(--en-navy);
  border-bottom: 1px solid var(--border);
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 12px;
  font-weight: 700;
}

.checks-section {
  margin-top: 8px;
}

.checks-section-title {
  margin: 20px 0 10px;
  padding: 10px 18px;
  background: linear-gradient(135deg, var(--en-amber) 0%, var(--en-amber-hover) 100%);
  color: var(--en-navy);
  font-size: 15px;
  font-weight: 800;
  border-radius: var(--radius);
  letter-spacing: 0.04em;
  border: 1px solid rgba(8, 40, 81, 0.12);
}

.checks-section-inner .checks-subcard {
  margin-top: 12px;
}

.checks-section-inner .checks-subcard:first-child {
  margin-top: 0;
}

.check-card-body {
  padding-top: 12px !important;
}

.results-grid--envelope-only {
  grid-template-columns: 1fr;
}

.card-body { padding: 18px; }

.card.full-width {
  grid-column: 1 / -1;
}

/* Inspector report (Pass/fail tab): 3-column body under performance summary */
.inspector-report-body-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 18px;
  align-items: start;
  margin-bottom: 20px;
}

.inspector-report-body-grid > .inspector-report-card {
  min-width: 0;
}

.inspector-report-body-grid > .inspector-report-span-all {
  grid-column: 1 / -1;
}

.inspector-report-body-grid > .inspector-report-span-2 {
  grid-column: span 2;
}

@media (max-width: 1180px) {
  .inspector-report-body-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inspector-report-body-grid > .inspector-report-span-2 {
    grid-column: span 2;
  }

  .inspector-report-body-grid .card--heated-floor-callout .heated-floor-two-col,
  .inspector-report-body-grid .mechanical-subsection--heated-floor .heated-floor-two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .inspector-report-body-grid {
    grid-template-columns: 1fr;
  }

  .inspector-report-body-grid > .inspector-report-span-2 {
    grid-column: 1 / -1;
  }
}

/* Verdict Banner */
.verdict-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.verdict-banner.PASS { background: var(--pass-bg); border: 1px solid var(--pass); }
/* FAIL: neutral bar — red only on the badge “button”, not the full banner */
.verdict-banner.FAIL {
  background: var(--surface);
  border: 1px solid var(--border);
}
.verdict-banner.ACTION { background: var(--action-bg); border: 1px solid var(--action); }
.verdict-banner.REVIEW { background: var(--info-bg); border: 1px solid var(--info); }
.verdict-banner.review-na {
  background: #f1f5f9;
  border: 1px solid #94a3b8;
}

.verdict-badge {
  font-size: 20px;
  font-weight: 800;
  padding: 4px 16px;
  border-radius: 6px;
  color: white;
}

.verdict-badge.PASS { background: var(--pass); }
.verdict-badge.FAIL { background: var(--fail); }
.verdict-badge.ACTION { background: var(--action); }
.verdict-badge.REVIEW { background: var(--info); }
.verdict-badge.review-na { background: #64748b; }

.upload-mismatch-sub {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
}

.upload-mismatch-card .upload-mismatch-msg {
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 16px;
  color: var(--text);
}

.upload-file-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 13px;
}

.upload-file-list li {
  margin: 8px 0;
  word-break: break-all;
}

.upload-file-list code {
  font-size: 12px;
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
}

.upload-file-label {
  color: var(--text-secondary);
  font-weight: 600;
  display: inline-block;
  min-width: 180px;
}

.upload-mismatch-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.verdict-details { font-size: 14px; }
.verdict-details strong { display: block; font-size: 16px; margin-bottom: 2px; }

/* Export toolbar (top of results) */
.export-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  margin-bottom: 20px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 55%, #e0e7ff 100%);
  border: 1px solid #c7d2fe;
  box-shadow: var(--shadow);
}

.export-toolbar-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.export-toolbar-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #3730a3;
}

.export-toolbar-hint {
  font-size: 13px;
  color: var(--text-secondary);
}

.export-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.export-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.export-btn:active {
  transform: scale(0.98);
}

.export-btn-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.export-btn-csv {
  background: #fff;
  color: #334155;
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.export-btn-csv:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.export-btn-pdf {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.export-btn-pdf:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
}

.export-btn-pdf .export-btn-icon {
  stroke: #fff;
}

.export-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@media (max-width: 520px) {
  .export-toolbar {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .export-toolbar-actions {
    justify-content: center;
  }
}

/* KV pairs */
.kv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}

.kv-grid--single {
  grid-template-columns: 1fr;
}

/* Inspector — Project information: one grid, three columns */
.kv-grid--3col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 12px;
}

.card--project-info .kv-grid--3col .kv--project-info-span {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .inspector-report-body-grid .card--project-info .kv-grid--3col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .inspector-report-body-grid .card--project-info .kv-grid--3col {
    grid-template-columns: 1fr;
  }
}

.card--project-info .kv-grid + .kv-grid {
  margin-top: 4px;
}

.kv { font-size: 13px; }
.kv .label { color: var(--text-secondary); font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; }
.kv .value { font-weight: 600; }

/* Orange accent on section headers that contain 9.36 compliance data */
.card-header.card-header--brand.card-header--compliance {
  background: linear-gradient(90deg, var(--brand, #e87722) 0%, #d16a1e 100%);
  color: #fff;
  border-bottom: none;
}

/* Envelope — RSI row + assembly description stacked in value column */
.kv.kv--envelope-assembly .value.envelope-assembly-value {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  text-align: right;
}

.kv.kv--envelope-assembly .envelope-assembly-rsi {
  font-weight: 600;
}

.kv.kv--envelope-assembly .envelope-assembly-modelled {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  width: 100%;
  max-width: min(100%, 26rem);
}

.kv.kv--envelope-assembly .envelope-assembly-modelled-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  color: var(--text-secondary);
}

.kv.kv--envelope-assembly .envelope-assembly-desc {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-secondary);
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  max-width: 100%;
}

.kv.kv--envelope-assembly .envelope-assembly-desc--empty {
  opacity: 0.55;
}

/* Envelope — reference vs proposed compare */
.envelope-compare-wrap {
  display: flex;
  flex-direction: column;
}

.mechanical-subsection .envelope-compare-wrap.envelope-compare-wrap--mech {
  margin-top: 4px;
}

.envelope-compare-row {
  display: grid;
  grid-template-columns: minmax(6.5rem, 11rem) minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px 18px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.envelope-compare-row:last-child {
  border-bottom: none;
}

.envelope-compare-row--head {
  padding-top: 0;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

.envelope-compare-rowlabel {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  color: var(--text-secondary);
  line-height: 1.35;
  padding-top: 4px;
}

.envelope-compare-colhead {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  color: var(--en-navy);
  padding-bottom: 2px;
  text-align: right;
}

.envelope-compare-cell {
  min-width: 0;
}

.envelope-compare-cell-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  text-align: right;
}

.envelope-compare-cell-inner .envelope-assembly-rsi {
  font-weight: 600;
}

.envelope-compare-cell-inner .envelope-assembly-area {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 1px;
}

.envelope-compare-cell-inner .envelope-assembly-modelled {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  width: 100%;
  max-width: min(100%, 26rem);
}

.envelope-compare-cell-inner .envelope-assembly-modelled-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  color: var(--text-secondary);
}

.envelope-compare-cell-inner .envelope-assembly-desc {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-secondary);
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  max-width: 100%;
}

.envelope-compare-cell-inner .envelope-assembly-desc--empty {
  opacity: 0.55;
}

.envelope-compare-cell-hint {
  display: none;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.envelope-compare-cell--simple {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.envelope-compare-area-value {
  font-weight: 600;
  font-size: 13px;
}

@media (max-width: 900px) {
  .envelope-compare-row--head {
    display: none;
  }

  .envelope-compare-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .envelope-compare-wrap > .envelope-compare-row:not(.envelope-compare-row--head) ~ .envelope-compare-row:not(.envelope-compare-row--head) {
    border-top: 1px solid var(--border);
  }

  .envelope-compare-rowlabel {
    padding-top: 0;
  }

  .envelope-compare-cell-hint {
    display: block;
  }
}

.kv .value a,
.bc-name a {
  color: var(--primary);
  font-weight: inherit;
  text-underline-offset: 2px;
}

/* Performance summary — outcome + jurisdiction tier target */
.perf-summary-top {
  text-align: center;
  margin-bottom: 4px;
}

.perf-summary-outcome {
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0 auto 8px;
  line-height: 1.35;
  text-transform: none;
}

.perf-summary-outcome--fail {
  display: inline-block;
  color: #9d174d;
  font-size: 1rem;
  background: transparent;
  border: 1px solid #e7e5e4;
  border-radius: 9999px;
  padding: 6px 18px;
}

.perf-summary-outcome--pass {
  display: inline-block;
  color: #166534;
  font-size: 0.95rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 9999px;
  padding: 5px 16px;
}

.perf-summary-outcome--neutral {
  display: inline-block;
  color: var(--text-secondary);
  font-size: 0.95rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 5px 16px;
}

.perf-summary-target {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 16px;
  line-height: 1.4;
}

.perf-summary-target strong {
  color: var(--text);
  font-weight: 700;
}

.perf-thresholds-caption {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0 0 10px;
}

.perf-thresholds-table-wrap {
  margin-bottom: 12px;
}

.perf-inspector-tier-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.perf-inspector-tier-table th,
.perf-inspector-tier-table td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  text-align: left;
}

.perf-inspector-tier-table th {
  background: var(--bg);
  font-weight: 700;
  color: var(--text);
}

.perf-inspector-tier-table td:nth-child(2),
.perf-inspector-tier-table td:nth-child(3) {
  white-space: nowrap;
}

.perf-thresholds-passlist,
.perf-thresholds-juris-notes {
  margin: 0 0 10px 1.1em;
  padding: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text);
}

.perf-thresholds-passlist li,
.perf-thresholds-juris-notes li {
  margin-bottom: 6px;
}

.perf-thresholds-juris {
  margin-bottom: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.perf-thresholds-juris-lead {
  margin: 0 0 6px;
  font-size: 12px;
  line-height: 1.45;
}

.perf-thresholds-juris-notes {
  margin-bottom: 0;
}

.perf-thresholds-p {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
  margin: 0 0 8px;
}

.perf-thresholds-p strong {
  color: var(--text);
}

/* ── Inspector side-by-side comparison table ── */
.perf-comparison {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.perf-comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.perf-comparison-table th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  padding: 6px 10px;
  text-align: right;
  border-bottom: 2px solid var(--border);
}

.perf-comparison-table th:first-child {
  text-align: left;
}

.perf-comparison-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
}

.perf-comp-label {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.perf-comp-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.perf-comp-result {
  font-weight: 700;
}

/* % Improvement row highlight */
.perf-row--improvement-pass td {
  background: rgba(22,128,57,.06);
}
.perf-row--improvement-fail td {
  background: rgba(220,38,38,.05);
}

.perf-comp-divider td {
  border-top: 2px solid var(--border);
}

.perf-comparison-table .cell-pass {
  color: var(--pass);
  font-weight: 800;
}

.perf-comparison-table .cell-fail {
  color: var(--fail);
  font-weight: 800;
}

/* Alberta Tier 1: peak cooling vs reference is context-only (not pass/fail). */
.perf-comparison-table .cell-info-warn {
  color: #b86e00;
  font-weight: 800;
}

/* Peak cooling load expandable note */
.pk-cooling-details {
  margin: 8px 0 2px;
  border-radius: 6px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.pk-cooling-summary {
  cursor: pointer;
  font-size: .82rem;
  font-weight: 600;
  padding: 7px 12px;
  background: rgba(184,110,0,.05);
  color: #8a5200;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pk-cooling-summary::-webkit-details-marker { display: none; }
.pk-cooling-summary::before {
  content: "\25B6";
  font-size: .65rem;
  transition: transform .15s ease;
}
.pk-cooling-details[open] > .pk-cooling-summary::before {
  transform: rotate(90deg);
}
.pk-cooling-body {
  padding: 10px 14px;
  font-size: .82rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}
.pk-cooling-body p { margin: 0 0 6px; }
.pk-cooling-body p:last-child { margin-bottom: 0; }

/* ── Collapsible thresholds (<details>) ── */
.perf-inspector-thresholds {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.perf-inspector-thresholds[open] .perf-inspector-thresholds-body {
  margin-top: 10px;
}

.perf-inspector-thresholds-head {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--en-navy);
  margin: 0;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.perf-inspector-thresholds-head::-webkit-details-marker {
  display: none;
}

.perf-inspector-thresholds-head::before {
  content: "▶";
  font-size: 9px;
  transition: transform 0.15s ease;
  display: inline-block;
}

.perf-inspector-thresholds[open] > .perf-inspector-thresholds-head::before {
  transform: rotate(90deg);
}

.card-subhead {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  color: var(--text-secondary);
  margin: 16px 0 10px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.envelope-fdwr-breakdown .card-subhead {
  margin-top: 16px;
}

/* Mechanical card: grouped systems + first subhead flush under card header */
.mechanical-systems > .mechanical-subsection:first-of-type .card-subhead {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* Distinct mechanical subsection headers */
.mech-subhead {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
  padding: 7px 10px;
  border-radius: 5px;
  border-top: none;
  margin: 18px 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mechanical-systems > .mechanical-subsection:first-of-type .mech-subhead {
  margin-top: 0;
}
.mech-subhead-icon { font-size: 14px; line-height: 1; }

.mech-subhead--heating {
  background: #fef3ed;
  color: #b84d00;
  border-left: 3px solid #e87722;
}
.mech-subhead--fan {
  background: #f0f4f8;
  color: #475569;
  border-left: 3px solid #94a3b8;
}
.mech-subhead--cooling {
  background: #eff6ff;
  color: #1e40af;
  border-left: 3px solid #3b82f6;
}
.mech-subhead--dhw {
  background: #fef9ee;
  color: #92400e;
  border-left: 3px solid #f59e0b;
}
.mech-subhead--vent {
  background: #f0fdf4;
  color: #166534;
  border-left: 3px solid #22c55e;
}

.mechanical-subsection {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.mechanical-subsection:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.fan-power-note {
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: .82rem;
  line-height: 1.45;
}
.fan-power-note--muted {
  background: var(--bg);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.fan-power-note--info {
  background: rgba(184,110,0,.06);
  color: #8a5200;
  border: 1px solid rgba(184,110,0,.18);
}
.fan-power-note--ok {
  background: rgba(22,128,57,.05);
  color: #1a6b34;
  border: 1px solid rgba(22,128,57,.15);
}

.combo-system-note {
  font-size: .82rem;
  line-height: 1.5;
  padding: 8px 12px;
  margin: 6px 0 10px;
  border-radius: 6px;
  background: rgba(59,130,246,.06);
  color: #1e3a5f;
  border: 1px solid rgba(59,130,246,.18);
}

.mechanical-systems .kv-grid {
  margin-bottom: 4px;
}

/* Mechanical — heating: 3×2 (equipment / mfr / model | fuel / AFUE / output) */
.card--mechanical-proposed .kv-grid--mech-heating {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 14px;
}

@media (max-width: 820px) {
  .card--mechanical-proposed .kv-grid--mech-heating {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .card--mechanical-proposed .kv-grid--mech-heating {
    grid-template-columns: 1fr;
  }
}

.checks-mech-subsection {
  margin-bottom: 10px;
}

.checks-mech-subsection:last-child {
  margin-bottom: 0;
}

.checks-mech-subhead {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  color: var(--text-secondary);
  margin: 14px 0 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.checks-mech-subsection:first-of-type .checks-mech-subhead {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.fdwr-ref-muted {
  color: var(--text-secondary);
  font-weight: 500;
}

.fdwr-band-alert {
  background: var(--fail-bg);
  border: 1px solid var(--fail);
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--fail);
}

.fdwr-band-alert .fdwr-band-alert-hint {
  margin: 10px 0 0;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  color: var(--text-primary);
  font-weight: 500;
}

.fdwr-outcomes-block {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 2px solid var(--en-amber);
}

.fdwr-house-work {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 2px solid var(--en-amber);
}

.fdwr-house-work .fdwr-outcomes-block {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.fdwr-house-work-heading {
  margin-bottom: 10px;
  color: var(--en-navy);
}

.fdwr-outcomes-block .card-subhead {
  margin-top: 0;
  color: var(--en-navy);
}

.fdwr-work-note {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
  margin: 0 0 10px;
}

.fdwr-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.fdwr-work-details {
  margin: 0 0 12px;
}

/* Disclosure summaries as dropdown-style buttons */
.fdwr-work-details-summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--en-navy);
  list-style: none;
  text-align: left;
  background: linear-gradient(180deg, #fff 0%, #f4f7fb 100%);
  border: 1px solid rgba(8, 40, 81, 0.18);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(8, 40, 81, 0.06);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.fdwr-work-details-summary:hover {
  background: #fff;
  border-color: rgba(8, 40, 81, 0.28);
  box-shadow: 0 2px 6px rgba(8, 40, 81, 0.08);
}

.fdwr-work-details-summary:focus {
  outline: 2px solid var(--en-amber);
  outline-offset: 2px;
}

.fdwr-work-details-summary-label {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.fdwr-work-details-summary-icon {
  flex-shrink: 0;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--en-navy);
  opacity: 0.85;
  transition: transform 0.2s ease;
}

.fdwr-work-details[open] > .fdwr-work-details-summary .fdwr-work-details-summary-icon {
  transform: rotate(180deg);
}

.fdwr-work-details-summary::-webkit-details-marker {
  display: none;
}

.fdwr-work-details[open] > .fdwr-work-details-summary {
  margin-bottom: 10px;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
}

/* Fenestration card: reference left, proposed right */
.fdwr-fenestration-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
  align-items: start;
}

.fdwr-fenestration-col {
  min-width: 0;
}

.fdwr-fenestration-col--reference {
  padding-right: 14px;
  border-right: 1px solid var(--border);
}

.fdwr-fenestration-col--proposed {
  padding-left: 2px;
}

.fdwr-fenestration-col-head {
  margin-top: 0 !important;
  padding-top: 0 !important;
  border-top: none !important;
}

.fdwr-kv-perf {
  margin-bottom: 6px;
}

.fdwr-fdwr-pct-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 12px;
  margin-bottom: 8px;
}

.fdwr-fdwr-pct-row .fdwr-fdwr-pct-kv {
  flex: 1 1 140px;
  min-width: 0;
}

.fdwr-fdwr-pct-row .fdwr-denom-dropdown {
  flex: 0 1 auto;
  margin: 0;
  min-width: 0;
}

.fdwr-fdwr-pct-row .fdwr-denom-dropdown .fdwr-work-details-summary {
  padding: 8px 12px;
  font-size: 12px;
  white-space: nowrap;
}

.fdwr-fdwr-pct-row .fdwr-denom-dropdown .fdwr-work-calc {
  max-width: min(100vw - 48px, 420px);
}

.fdwr-fenestration-sub {
  margin-top: 10px;
}

/* House dimensions: proposed AG wall sum + FDWR math (calc-only disclosure) */
.dimensions-ag-wall-calc-wrap {
  margin-top: 14px;
}

.dimensions-ag-wall-calc-wrap .fdwr-work-details:first-child {
  margin-top: 0;
}

@media (max-width: 900px) {
  .fdwr-fenestration-two-col {
    grid-template-columns: 1fr;
  }

  .fdwr-fenestration-col--reference {
    padding-right: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 14px;
    margin-bottom: 4px;
  }

  .fdwr-fenestration-col--proposed {
    padding-left: 0;
  }
}

/* Same face/size as .kv body text (not monospace) */
.fdwr-work-calc {
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-primary);
  background: var(--surface-alt, rgba(0, 0, 0, 0.04));
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  margin: 0 0 12px;
  white-space: pre-wrap;
  overflow-x: auto;
}

/* Match .kv .label — section cues inside AG wall sum / FDWR work */
.fdwr-work-calc-label {
  font-size: 11px;
  font-weight: inherit;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-secondary);
  margin: 12px 0 6px;
}

.fdwr-work-calc-label:first-child {
  margin-top: 0;
}

.fdwr-work-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.45;
  font-family: inherit;
  margin-bottom: 10px;
}

.fdwr-work-table th,
.fdwr-work-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}

.fdwr-work-table td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fdwr-work-table td.fdwr-work-eq {
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
  white-space: nowrap;
}

.fdwr-work-table tr.fdwr-work-total td {
  font-weight: 600;
  border-bottom: 2px solid var(--border);
}

.fdwr-work-table caption {
  caption-side: top;
  text-align: left;
  font-size: 11px;
  font-weight: inherit;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-secondary);
  padding: 0 0 8px;
}

/* Performance warning */
.perf-warning {
  background: var(--fail-bg);
  border: 1px solid var(--fail);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--fail);
}

.perf-warning strong {
  display: block;
  margin-bottom: 2px;
}

/* Metrics row */
.metrics-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
  transition: opacity 0.2s;
}

.metrics-row.metrics-invalid {
  opacity: 0.4;
  position: relative;
}

.metrics-row.metrics-conditional .metric {
  opacity: 0.55;
}

.metrics-conditional-banner {
  background: var(--action-bg);
  border: 1px solid var(--action);
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 14px;
  font-size: .85rem;
  line-height: 1.5;
  color: #7c4d00;
}
.metrics-conditional-banner strong { color: #92400e; }

.action-required-banner {
  background: var(--fail-bg);
  border-left: 4px solid var(--fail);
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 18px;
  page-break-inside: avoid;
}
.action-required-banner h3 {
  margin: 0 0 6px;
  font-size: .95rem;
  color: var(--fail);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.action-required-banner p {
  margin: 0 0 6px;
  font-size: .85rem;
  line-height: 1.5;
  color: var(--text);
}
.action-required-banner p:last-child { margin-bottom: 0; }
.action-required-banner code {
  background: rgba(220,38,38,.08);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: .82rem;
}

.report-details-divider {
  margin: 28px 0 18px;
  padding: 0 0 6px;
  border-bottom: 2px solid var(--en-navy);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--en-navy);
  letter-spacing: .02em;
}

.findings-item {
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: .85rem;
  line-height: 1.5;
}
.findings-item--fail { background: var(--fail-bg); border-left: 3px solid var(--fail); }
.findings-item--action { background: var(--action-bg); border-left: 3px solid var(--action); }
.findings-item--info { background: var(--info-bg); border-left: 3px solid var(--info); }
.findings-item strong { display: block; margin-bottom: 2px; }
.findings-item .findings-action { color: var(--text-secondary); font-size: .82rem; margin-top: 3px; }

.metric {
  flex: 1;
  min-width: 120px;
  text-align: center;
  padding: 14px 8px;
  background: var(--bg);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.metric .number {
  font-size: 24px;
  font-weight: 800;
}

/* FDWR: keep % and ref. target as one tight block above the label */
.metric-value-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
}

.metric .metric-target {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.3;
  margin: 0;
  padding: 0 4px;
}

.metric .metric-target strong {
  color: var(--text-primary);
  font-weight: 700;
}

.metric--fdwr {
  min-width: 140px;
}

.metric .label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 8px;
}

/* % Improvement metric — green highlight when passing */
.metric--improvement-primary .number {
  color: var(--pass, #168039);
}

/* Alberta: muted 9.36.7 tier metrics (informational only) */
.metric--muted-tier {
  opacity: 0.45;
}
.metric--muted-tier .number {
  color: var(--text-secondary);
}

/* Alberta note under performance summary */
.perf-ab-note {
  font-size: .78rem;
  color: var(--text-secondary);
  margin: 2px 0 0;
  font-style: italic;
}

/* Check list */
.check-list { list-style: none; }

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--bg);
  font-size: 13px;
}

.check-item:last-child { border-bottom: none; }

.status-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

.status-pill.PASS { background: var(--pass-bg); color: var(--pass); }
.status-pill.FAIL { background: var(--fail-bg); color: var(--fail); }
.status-pill.INFO { background: var(--info-bg); color: var(--info); }
.status-pill.NOTE { background: var(--note-bg); color: var(--note); }
.status-pill.REQUIRED { background: var(--action-bg); color: var(--action); }
.status-pill.Required { background: var(--action-bg); color: var(--action); }

.check-content { flex: 1; min-width: 0; }

.check-summary {
  cursor: pointer;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.check-summary:hover .explain-toggle { color: var(--primary); }

.check-name { font-weight: 600; }
.check-detail { color: var(--text-secondary); }

.explain-toggle {
  font-size: 10px;
  color: var(--text-secondary);
  margin-left: 6px;
  flex-shrink: 0;
  transition: color 0.15s;
}

.check-explain {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.25s ease;
  opacity: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
  background: var(--bg);
  border-radius: 6px;
  padding: 0 12px;
  margin-top: 0;
}

.check-explain.open {
  max-height: 300px;
  opacity: 1;
  padding: 10px 12px;
  margin-top: 8px;
}

/* Site copyright (all pages) */
.site-copyright-bar {
  text-align: center;
  padding: 14px 16px 22px;
  font-size: 12px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  background: var(--bg, #f8fafc);
}

.site-copyright-bar p {
  margin: 0;
}

/* Error */
.error-box {
  background: var(--fail-bg);
  border: 1px solid var(--fail);
  border-radius: var(--radius);
  padding: 16px 20px;
  color: var(--fail);
  font-size: 14px;
  margin: 20px 0;
  display: none;
}

/* App navigation & summary panels */
.app-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  max-width: 1200px;
  margin: 0 auto;
}

.nav-tab {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  border: 2px solid rgba(8, 40, 81, 0.2);
  background: var(--surface);
  color: var(--en-navy);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.nav-tab:hover {
  border-color: var(--en-amber);
  background: var(--en-amber-soft);
  color: var(--en-navy);
}

.nav-tab.active {
  background: var(--en-amber);
  border-color: var(--en-amber);
  color: var(--en-navy);
  box-shadow: 0 2px 8px rgba(252, 160, 53, 0.35);
}

.nav-panel {
  display: none;
}

.nav-panel.active {
  display: block;
}

.summary-panel-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.summary-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 6px;
}

.summary-desc {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 640px;
  line-height: 1.5;
}

.summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.summary-btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}

.summary-btn:hover {
  background: var(--bg);
}

.summary-btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.summary-btn-primary:hover {
  filter: brightness(1.05);
}

.analytics-content {
  min-height: 120px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-top: 4px;
}

.status-bar {
  display: flex;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 20px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.bar-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2em;
}

.bar-seg.PASS { background: var(--pass); }
.bar-seg.FAIL { background: var(--fail); }
.bar-seg.ACTION { background: var(--action); }
.bar-seg.REVIEW { background: var(--info); }

.failure-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.failure-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--bg);
  font-size: 13px;
}

.failure-list li:last-child { border-bottom: none; }

.fail-name { color: var(--text); }
.fail-count {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--fail-bg);
  color: var(--fail);
}

.project-history-card .project-table-wrap {
  padding: 0;
  overflow-x: auto;
  max-height: min(70vh, 560px);
  overflow-y: auto;
}

.project-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.project-table th,
.project-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.project-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 1;
}

.project-table tbody tr:hover {
  background: #f8fafc;
}

.project-table-hint {
  font-weight: 400;
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: normal;
}

.project-table tbody tr.project-row-clickable {
  cursor: pointer;
}

.project-table tbody tr.project-row-clickable:focus {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

/* Saved review detail modal (All projects) */
.review-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 25000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.review-detail-modal[hidden] {
  display: none !important;
}

.review-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.review-detail-dialog {
  position: relative;
  width: min(960px, 100%);
  max-height: min(92vh, 900px);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.review-detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.review-detail-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-detail-close {
  border: none;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0 4px;
  border-radius: 6px;
}

.review-detail-close:hover {
  color: var(--text);
  background: var(--border);
}

.review-detail-body {
  overflow: auto;
  padding: 20px 24px 28px;
  flex: 1;
  min-height: 0;
}

.review-detail-body .verdict-banner {
  margin-top: 0;
}

.review-detail-loading {
  margin: 0;
  padding: 24px;
  color: var(--text-secondary);
  text-align: center;
}

.legacy-snapshot-banner .card-body {
  border-left: 3px solid var(--action);
}

.cell-muted {
  color: var(--text-secondary);
  font-size: 12px;
}

.cell-files {
  font-size: 11px;
  line-height: 1.4;
  max-width: 220px;
}

.cell-files .fname {
  display: inline-block;
  word-break: break-all;
}

.mini-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.mini-pill-PASS { background: var(--pass-bg); color: var(--pass); }
.mini-pill-FAIL { background: var(--fail-bg); color: var(--fail); }
.mini-pill-ACTION { background: var(--action-bg); color: var(--action); }
.mini-pill-REVIEW { background: var(--info-bg); color: var(--info); }
.mini-pill-N\/A { background: #e2e8f0; color: #475569; }

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

.empty-state h3 {
  color: var(--text);
  margin-bottom: 8px;
}

.builder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.builder-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.bc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.bc-header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.bc-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.bc-name { font-weight: 700; font-size: 15px; line-height: 1.3; word-break: break-word; }
.bc-count { font-size: 12px; color: var(--text-secondary); text-align: right; flex-shrink: 0; }

.bc-body { padding: 16px; }

.bc-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.bc-metric {
  text-align: center;
  padding: 10px;
  background: var(--bg);
  border-radius: 8px;
}

.bc-val {
  font-size: 1.25rem;
  font-weight: 800;
}

.bc-val.good { color: var(--pass); }
.bc-val.warn { color: var(--action); }
.bc-val.bad { color: var(--fail); }

.bc-lbl {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-top: 4px;
}

.bc-failures h4,
.bc-recent h4 {
  font-size: 12px;
  text-transform: uppercase;
  margin: 16px 0 8px;
  color: var(--text-secondary);
}

.bc-recent-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.bc-recent-main {
  min-width: 0;
  flex: 1;
}

.bc-rname {
  display: block;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bc-rbuilder {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Screen: print header hidden; PDF/print uses body.printing (export button). */
.print-only {
  display: none !important;
}

@media print {
  @page {
    margin: 10mm 10mm 14mm 10mm;
    size: letter;
  }
  @page :first {
    margin-top: 8mm;
  }

  /* One footer credit in the print report block — hide site bar so © does not repeat */
  .site-copyright-bar {
    display: none !important;
  }

  /* Hide review chrome on any print — avoids a blank-looking first page when #results is the only real content */
  .review-intro-grid,
  .platform-teaser {
    display: none !important;
  }

  /* Navy section headers whenever #results is printed */
  #results .card > .card-header {
    background: linear-gradient(90deg, var(--en-navy-mid) 0%, var(--en-navy) 100%) !important;
    color: #fff !important;
    border-bottom: none !important;
    font-weight: 800 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  #results .card--perf-summary > .card-header.card-header--brand,
  #results .checks-section-title {
    background: linear-gradient(135deg, var(--en-amber) 0%, var(--en-amber-hover) 100%) !important;
    color: var(--en-navy) !important;
    border: 1px solid rgba(8, 40, 81, 0.12) !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  #results .checks-section-title {
    padding: 5px 8px !important;
    font-size: 10px !important;
    margin: 6px 0 4px !important;
  }

  body.printing #en-header-shell,
  body.printing .upload-section,
  body.printing .review-intro-grid,
  body.printing .review-verification-col,
  body.printing .official-faq-open--below-upload,
  body.printing .platform-teaser,
  body.printing #platformTopicModal,
  body.printing #appToolBar,
  body.printing .export-toolbar,
  body.printing .error-box,
  body.printing .app-nav,
  body.printing .summary-panel-head {
    display: none !important;
  }

  body.printing {
    background: #fff !important;
  }

  body.printing .container {
    max-width: 100%;
    padding: 8px 10px;
  }

  body.printing .print-only {
    display: block !important;
  }

  body.printing .no-print {
    display: none !important;
  }

  body.printing .verdict-banner {
    display: none !important;
  }

  body.printing .check-explain,
  body.printing .explain-toggle {
    display: none !important;
  }

  body.printing .perf-warning {
    display: none !important;
  }

  /* Omit all native <details> blocks (FDWR show-work, screening thresholds, heated-floor More info, etc.) */
  body.printing #results details,
  body.printing #reviewDetailBody details {
    display: none !important;
  }

  /* Saved review modal: report lives in #reviewDetailBody while #results may be in a hidden tab */
  body.printing.printing-review-modal #panel-review,
  body.printing.printing-review-modal #panel-analytics,
  body.printing.printing-review-modal #panel-service-providers {
    display: none !important;
  }

  body.printing.printing-review-modal #reviewDetailModal {
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    display: block !important;
    background: transparent !important;
  }

  body.printing.printing-review-modal .review-detail-backdrop {
    display: none !important;
  }

  body.printing.printing-review-modal .review-detail-dialog {
    max-width: 100% !important;
    max-height: none !important;
    width: 100% !important;
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
  }

  body.printing.printing-review-modal .review-detail-toolbar {
    display: none !important;
  }

  body.printing.printing-review-modal .review-detail-body {
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
  }

  /* Pass/fail tab may be hidden if user was on All projects — still print #results */
  body.printing.printing-main-results #panel-review {
    display: block !important;
  }

  body.printing.printing-main-results #panel-analytics,
  body.printing.printing-main-results #panel-service-providers {
    display: none !important;
  }

  /* Compact layout */
  body.printing #results,
  body.printing #reviewDetailBody {
    font-size: 9px;
    line-height: 1.3;
    color: #111;
    padding-bottom: 0;
    page-break-before: auto;
  }

  body.printing #results .card > .card-header,
  body.printing #reviewDetailBody .card > .card-header {
    background: linear-gradient(90deg, var(--en-navy-mid) 0%, var(--en-navy) 100%) !important;
    color: #fff !important;
    border-bottom: none !important;
    font-weight: 800 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing #results .card--perf-summary > .card-header.card-header--brand,
  body.printing #results .checks-section-title,
  body.printing #reviewDetailBody .card--perf-summary > .card-header.card-header--brand,
  body.printing #reviewDetailBody .checks-section-title {
    background: linear-gradient(135deg, var(--en-amber) 0%, var(--en-amber-hover) 100%) !important;
    color: var(--en-navy) !important;
    border: 1px solid rgba(8, 40, 81, 0.12) !important;
    padding: 5px 8px !important;
    font-size: 10px !important;
    margin: 6px 0 4px !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing .print-report-header {
    border-bottom: 1px solid #cbd5e1;
    padding-bottom: 8px;
    margin-bottom: 10px;
  }

  body.printing .print-brand-full-logo {
    display: block;
    max-height: 48px;
    width: auto;
    margin-bottom: 8px;
  }

  /* Print footer: © centered on page width; logo bottom-right only */
  body.printing .print-page-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    pointer-events: none;
    display: flex !important;
    justify-content: center;
    align-items: flex-end;
    margin: 0;
    padding: 0;
  }

  body.printing .print-page-footer-inner {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: flex-end;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 52px;
    padding: 10px 10mm 8px 12mm;
    background: #fff;
    border-top: 1px solid #e2e8f0;
  }

  body.printing .print-footer-copy--center {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    margin: 0;
    padding: 0;
    font-size: 8px;
    color: #64748b;
    text-align: center;
    line-height: 1.35;
    max-width: 58%;
    width: max-content;
  }

  body.printing .print-footer-logo-slot {
    margin-left: auto;
    flex-shrink: 0;
    z-index: 1;
  }

  body.printing .print-footer-sun {
    display: block;
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin: 0;
  }

  body.printing .print-report-h1 {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 4px 0;
    color: #0f172a;
  }

  body.printing .print-report-h1--brand {
    color: var(--en-navy);
  }

  body.printing .print-report-subtitle {
    font-size: 11px;
    font-weight: 600;
    margin: 0 0 6px 0;
    color: #1e293b;
  }

  body.printing .print-report-meta {
    font-size: 9px;
    color: #334155;
  }

  body.printing .print-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 700;
    font-size: 9px;
    margin-right: 4px;
  }

  body.printing .print-badge.PASS { background: #dcfce7; color: #166534; }
  body.printing .print-badge.FAIL { background: #fee2e2; color: #991b1b; }
  body.printing .print-badge.ACTION { background: #fef3c7; color: #92400e; }
  body.printing .print-badge.REVIEW { background: #dbeafe; color: #1e40af; }

  body.printing .card {
    margin-bottom: 5px !important;
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #e2e8f0;
  }

  body.printing .card-header.card-header--brand,
  body.printing .card-header.card-header--brand-sub {
    background: linear-gradient(90deg, var(--en-navy-mid) 0%, var(--en-navy) 100%) !important;
    color: #fff !important;
    border-bottom: none !important;
  }

  body.printing .card-header.card-header--brand.card-header--compliance {
    background: linear-gradient(90deg, #e87722 0%, #d16a1e 100%) !important;
    color: #fff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing .card--perf-summary > .card-header.card-header--brand {
    background: linear-gradient(135deg, var(--en-amber) 0%, var(--en-amber-hover) 100%) !important;
    color: var(--en-navy) !important;
  }

  body.printing .card-header.card-header--brand-sub {
    background: var(--en-navy-mid) !important;
  }

  body.printing .card-header {
    padding: 5px 8px !important;
    font-size: 10px !important;
  }

  body.printing .card-body {
    padding: 4px 6px !important;
  }

  body.printing .results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  body.printing .results-grid--envelope-only {
    grid-template-columns: 1fr !important;
  }

  body.printing .inspector-report-body-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  body.printing .inspector-report-body-grid > .inspector-report-span-2,
  body.printing .inspector-report-body-grid > .inspector-report-span-all {
    grid-column: 1 / -1 !important;
  }

  body.printing .card--perf-summary,
  body.printing .card--project-info {
    page-break-after: avoid;
  }

  body.printing .card--project-info .kv-grid--3col {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 4px 8px !important;
  }

  body.printing .card--mechanical-proposed .kv-grid--mech-heating {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 4px 8px !important;
  }

  body.printing .card--envelope-proposed {
    page-break-before: always;
    break-before: always;
  }

  body.printing .card--fenestration-fdwr {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  body.printing .card--mechanical-proposed {
    page-break-inside: auto;
    break-inside: auto;
  }

  body.printing .checks-section {
    page-break-before: auto;
    margin-top: 4px;
  }

  body.printing .checks-section .checks-subcard {
    page-break-inside: avoid;
    break-inside: avoid;
    margin-bottom: 6px !important;
  }

  body.printing .mechanical-subsection {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  body.printing .card-subhead {
    page-break-after: avoid;
    break-after: avoid;
  }

  body.printing .envelope-compare-row--head {
    display: grid !important;
  }

  body.printing .envelope-compare-row {
    grid-template-columns: minmax(6.5rem, 11rem) minmax(0, 1fr) minmax(0, 1fr) !important;
    padding: 4px 0 !important;
  }

  body.printing .envelope-compare-cell-hint {
    display: none !important;
  }

  body.printing .envelope-assembly-modelled {
    padding: 2px 0 !important;
    margin-top: 2px !important;
  }

  body.printing .envelope-assembly-desc {
    font-size: 8px !important;
    line-height: 1.3 !important;
  }

  body.printing .report-details-divider {
    page-break-before: auto;
  }

  body.printing .card--perf-summary {
    margin-bottom: 8px !important;
  }

  body.printing .card-header--brand,
  body.printing .card-header--brand-sub {
    padding: 5px 8px !important;
    font-size: 9px !important;
  }

  body.printing .perf-summary-outcome--fail {
    font-size: 0.82rem !important;
    padding: 4px 12px !important;
    margin-bottom: 6px !important;
  }

  body.printing .perf-summary-outcome--pass,
  body.printing .perf-summary-outcome--neutral {
    font-size: 0.78rem !important;
    padding: 3px 10px !important;
  }

  body.printing .perf-summary-target {
    font-size: 11px !important;
    margin-bottom: 12px !important;
  }

  /* ── Comparison table (print) ── */
  body.printing .perf-comparison {
    margin-top: 10px !important;
    padding-top: 8px !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  body.printing .pk-cooling-details {
    border: 1px solid #ccc !important;
  }
  body.printing .pk-cooling-summary {
    background: rgba(184,110,0,.05) !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  body.printing .pk-cooling-summary::before { content: "" !important; }

  body.printing .perf-comparison-table {
    font-size: 9px !important;
  }

  body.printing .perf-comparison-table th {
    font-size: 8px !important;
    padding: 4px 6px !important;
  }

  body.printing .perf-comparison-table td {
    padding: 4px 6px !important;
  }

  body.printing .metrics-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    align-items: end;
  }

  body.printing .metric .number {
    font-size: 16px !important;
  }

  body.printing .metric .metric-target {
    font-size: 9px !important;
  }

  body.printing .metric .label {
    font-size: 8px !important;
  }

  body.printing .metric--improvement-primary .number {
    color: #168039 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  body.printing .metric--muted-tier {
    opacity: 0.45 !important;
  }
  body.printing .perf-row--improvement-pass td {
    background: rgba(22,128,57,.06) !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  body.printing .perf-row--improvement-fail td {
    background: rgba(220,38,38,.05) !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing .card-subhead {
    font-size: 9px !important;
    margin-top: 12px !important;
    margin-bottom: 8px !important;
  }

  body.printing .mech-subhead {
    font-size: 10px !important;
    padding: 5px 8px !important;
    margin-top: 14px !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  body.printing .mech-subhead-icon { font-size: 11px !important; }
  body.printing .mech-subhead--heating,
  body.printing .mech-subhead--fan,
  body.printing .mech-subhead--cooling,
  body.printing .mech-subhead--dhw,
  body.printing .mech-subhead--vent {
    background: #fef3ed !important;
    color: #b84d00 !important;
    border-left: 3px solid #e87722 !important;
  }

  body.printing .combo-system-note {
    background: rgba(59,130,246,.06) !important;
    color: #1e3a5f !important;
    border: 1px solid rgba(59,130,246,.18) !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing .check-list {
    gap: 2px;
  }

  body.printing .check-summary {
    font-size: 9px;
  }

  body.printing .status-pill {
    font-size: 8px;
    padding: 1px 5px;
  }

  body.printing .kv {
    font-size: 9px;
  }

  /* Heated floor card: match normal report body size (screen uses large status line) */
  body.printing .card--heated-floor-callout .heated-floor-headline,
  body.printing .card--heated-floor-callout .heated-floor-status-line,
  body.printing .mechanical-subsection--heated-floor .heated-floor-headline,
  body.printing .mechanical-subsection--heated-floor .heated-floor-status-line {
    font-size: 9px !important;
    font-weight: 600 !important;
    letter-spacing: normal !important;
    line-height: 1.4 !important;
    margin: 2px 0 0 !important;
  }

  body.printing .card--heated-floor-callout .heated-floor-two-col,
  body.printing .mechanical-subsection--heated-floor .heated-floor-two-col {
    gap: 10px !important;
  }

  body.printing .card--heated-floor-callout ul.heated-floor-detail-list,
  body.printing .mechanical-subsection--heated-floor ul.heated-floor-detail-list {
    font-size: 9px !important;
    line-height: 1.35 !important;
  }

  /* .h2k digest “Heated floor” line (inline font-size on screen) */
  body.printing #results p.heated-floor-headline,
  body.printing #reviewDetailBody p.heated-floor-headline {
    font-size: 9px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
  }
}
