/* ── Code+ Design Tool Suite — Shared Design System ─────────────────────── */
/* Jeff Seabold, FAIA | jeffseaboldfaia.org/tools | v1.0 April 2026         */

:root {
  --navy:       #1B2A4A;
  --navy-mid:   #2E4272;
  --slate:      #4A6FA5;
  --blue-lt:    #D6E4F7;
  --blue-pale:  #EEF4FC;
  --green-dk:   #1A5C38;
  --green-md:   #2E7D52;
  --green-lt:   #D6EFE0;
  --amber:      #8B6914;
  --amber-lt:   #FFF8DC;
  --orange:     #E07B39;
  --orange-lt:  #FDE9D9;
  --red-dk:     #C0392B;
  --red-lt:     #FDECEA;
  --gray-dk:    #4A4A4A;
  --gray-md:    #888780;
  --gray-lt:    #F2F2F2;
  --white:      #FFFFFF;
  --energy:     #3B6D11;
  --energy-lt:  #EAF3DE;
  --resilience: #633806;
  --resil-lt:   #FFF3E0;
  --regen:      #085041;
  --regen-lt:   #E1F5EE;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.10);
  --max-w: 1100px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--gray-dk);
  background: #F7F8FA;
}

a { color: var(--navy-mid); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Site nav ────────────────────────────────────────────────────────────── */
.site-nav {
  background: var(--navy);
  border-bottom: 2px solid var(--slate);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0;
  height: 52px;
}
.nav-brand {
  font-size: 14px;
  font-weight: 400;
  color: #fff;
  margin-right: auto;
  white-space: nowrap;
  display: flex;
  align-items: baseline;
  gap: 0;
  text-decoration: none;
}
.nav-brand-arch {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 15px;
  color: #F4F1EC;
  letter-spacing: 0.01em;
}
.nav-brand-datum {
  font-family: system-ui, -apple-system, sans-serif;
  font-style: normal;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: #C9A84C;
}
.nav-links { display: flex; gap: 2px; }
.nav-link {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: rgba(255,255,255,0.1); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--slate); color: #fff; }
.nav-link.tool-link {
  background: rgba(255,255,255,0.08);
  border: 0.5px solid rgba(255,255,255,0.15);
}

/* ── My Project nav link ─────────────────────────────────────────────────── */
.nav-link--project {
  background: rgba(201,168,76,0.18);
  border: 0.5px solid rgba(201,168,76,0.45);
  color: #E8D5A3;
  font-weight: 500;
}
.nav-link--project:hover { background: rgba(201,168,76,0.30); color: #fff; }
.nav-link--project.active { background: #8B6914; border-color: #8B6914; color: #fff; }

/* ── Account nav link ────────────────────────────────────────────────────── */
.nav-link--account {
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.80);
  border: 0.5px solid rgba(255,255,255,0.25);
  margin-left: 4px;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.nav-link--account:hover { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.45); }
.nav-link--account.active { background: var(--slate); color: #fff; border-color: var(--slate); }
.nav-link--account.signed-in {
  background: rgba(59,109,17,0.20);
  border-color: rgba(97,175,39,0.40);
  color: #A8D878;
}
.nav-link--account.signed-in:hover { background: rgba(59,109,17,0.32); color: #C5ECA0; }

/* ── Dashboard nav link ──────────────────────────────────────────────────── */
.nav-link--dashboard {
  background: rgba(92, 61, 143, 0.22);
  border: 0.5px solid rgba(92, 61, 143, 0.45);
  color: #C4AEE8;
  font-weight: 600;
}
.nav-link--dashboard:hover { background: rgba(92, 61, 143, 0.36); color: #fff; border-color: rgba(92, 61, 143, 0.70); }
.nav-link--dashboard.active { background: #5C3D8F; border-color: #5C3D8F; color: #fff; }

/* ── Nav path badge (remodel / new construction indicator) ──────────────── */
.nav-path-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: middle;
  margin-left: 4px;
}
.nav-path-badge.remodel {
  background: rgba(224, 123, 57, 0.22);
  border: 0.5px solid rgba(224, 123, 57, 0.50);
  color: #F0A876;
}
.nav-path-badge.new-con {
  background: rgba(59, 109, 17, 0.22);
  border: 0.5px solid rgba(59, 109, 17, 0.50);
  color: #93CC68;
}

/* ── Retrofit-path tool nav links ────────────────────────────────────────── */
.nav-link--retrofit {
  background: rgba(224, 123, 57, 0.10);
  border: 0.5px solid rgba(224, 123, 57, 0.30);
  color: rgba(255,255,255,0.80);
}
.nav-link--retrofit:hover { background: rgba(224, 123, 57, 0.22); color: #fff; }
.nav-link--retrofit.active { background: var(--orange); border-color: var(--orange); color: #fff; }

/* ── Nav dropdown ────────────────────────────────────────────────────────── */
.nav-dropdown { position: relative; }
.nav-dropdown-trigger {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  white-space: nowrap;
  cursor: pointer;
  background: rgba(59,106,158,0.28);
  border: 0.5px solid rgba(127,164,206,0.40);
  display: flex; align-items: center; gap: 4px;
  transition: background 0.15s, color 0.15s;
  user-select: none;
}
.nav-dropdown-trigger:hover { background: rgba(59,106,158,0.50); color: #fff; }
.nav-dropdown-trigger .dd-caret { font-size: 9px; opacity: 0.7; transition: transform 0.15s; }
.nav-dropdown.open .dd-caret { transform: rotate(180deg); }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: #1B2A4A;
  border: 0.5px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  min-width: 240px;
  padding: 6px;
  padding-top: 10px;  /* visual top gap without dead zone */
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  white-space: nowrap;
}
/* Invisible bridge extends above the menu to eliminate hover dead zone */
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -16px;
  left: 0;
  right: 0;
  height: 16px;
}
/* Click/tap path: JS toggles .open on the .nav-dropdown (works everywhere) */
.nav-dropdown.open .nav-dropdown-menu { display: block; }
/* Hover-open is a desktop-only enhancement; touch devices use the click path
   so menus cannot get stuck open under a finger */
@media (hover: hover) and (pointer: fine) {
  .nav-dropdown:hover .nav-dropdown-menu { display: block; }
  .nav-dropdown:hover .dd-caret { transform: rotate(180deg); }
}
.nav-dropdown-menu a {
  display: block;
  padding: 7px 11px;
  border-radius: 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.80);
  text-decoration: none;
  transition: background 0.12s;
}
.nav-dropdown-menu a:hover { background: rgba(255,255,255,0.10); color: #fff; text-decoration: none; }
.nav-dropdown-menu a.active { background: rgba(59,106,158,0.45); color: #fff; }
.nav-dropdown-menu .dd-divider {
  height: 0.5px; background: rgba(255,255,255,0.12); margin: 5px 0;
}
.nav-dropdown-menu .dd-label {
  font-size: 9px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255,255,255,0.35); padding: 4px 11px 2px;
}

/* ── Hamburger button (hidden above 900px) ───────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 9px 10px;
  background: rgba(255,255,255,0.06);
  border: 0.5px solid rgba(255,255,255,0.30);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
  transition: transform 0.15s, opacity 0.15s;
}
.nav-hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ── Mobile / tablet nav (below 900px): hamburger + vertical menu ────────── */
@media (max-width: 900px) {
  .nav-hamburger { display: inline-flex; }
  .nav-links { display: none; }
  .site-nav.nav-open .nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    background: var(--navy);
    border-bottom: 2px solid var(--slate);
    padding: 10px 1rem 16px;
    gap: 4px;
    max-height: calc(100vh - 52px);
    overflow-y: auto;
    box-shadow: 0 14px 28px rgba(0,0,0,0.40);
  }
  .site-nav.nav-open .nav-link,
  .site-nav.nav-open .nav-dropdown-trigger {
    display: flex;
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
  }
  .site-nav.nav-open .nav-link--account { margin-left: 0; }
  .site-nav.nav-open .nav-dropdown { position: static; }
  /* Submenus render expanded in the mobile menu so every destination is one
     tap away; no hover and no second tap required */
  .site-nav.nav-open .nav-dropdown-menu {
    display: block;
    position: static;
    min-width: 0;
    padding: 2px 0 4px 10px;
    margin: 2px 0 6px 12px;
    border: none;
    border-left: 2px solid rgba(255,255,255,0.18);
    border-radius: 0;
    box-shadow: none;
    white-space: normal;
  }
  .site-nav.nav-open .nav-dropdown-menu::before { display: none; }
  .site-nav.nav-open .nav-dropdown-menu a { padding: 8px 11px; font-size: 13px; }
}

/* ── My Project dropdown — link-as-trigger with project name header ──────── */
/* The <a> inside .nav-project-drop stays clickable (goes to project.html);
   hovering the parent div shows the dropdown just like any .nav-dropdown.   */
.nav-project-drop > .nav-link--project { padding-right: 8px; }
/* Project dropdown needs extra width for project names and action labels */
.nav-project-drop .nav-dropdown-menu { min-width: 280px; }
.nav-dropdown-menu .dd-proj-name {
  padding: 8px 12px 4px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
  border-bottom: 0.5px solid rgba(255,255,255,0.10);
  margin-bottom: 2px;
}
.nav-dropdown-menu a.dd-new-project {
  color: rgba(255,160,80,0.90);
  font-weight: 600;
}
.nav-dropdown-menu a.dd-new-project:hover { background: rgba(224,123,57,0.15); color: #F0A876; }

/* ── Project banner ──────────────────────────────────────────────────────── */
.project-banner {
  border-bottom: 0.5px solid #D0D5E0;
  padding: 7px 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  gap: 12px;
}
.project-banner--empty {
  background: #F4F6FA;
  color: #888780;
}
.project-banner--loaded {
  background: #EEF2F8;
  border-left: 3px solid #1B2A4A;
}
.project-banner__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.project-banner__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #4A6FA5;
}
.project-banner__name {
  font-weight: 600;
  color: #1B2A4A;
}
.project-banner__detail {
  font-size: 12px;
  color: #555555;
}
.project-banner__prompt { color: #888780; }
.project-banner__start {
  font-size: 12px;
  font-weight: 600;
  color: #1B2A4A;
  white-space: nowrap;
}
.project-banner__start:hover { text-decoration: underline; }
.project-banner__edit {
  font-size: 12px;
  font-weight: 600;
  color: #4A6FA5;
  white-space: nowrap;
  flex-shrink: 0;
}
.project-banner__edit:hover { text-decoration: underline; }

/* ── Page shell ──────────────────────────────────────────────────────────── */
.page-wrap { max-width: var(--max-w); margin: 0 auto; padding: 1.25rem; }

/* ── WIP banner ──────────────────────────────────────────────────────────── */
.wip-banner {
  background: var(--amber-lt);
  border: 1px solid #EF9F27;
  border-left: 4px solid var(--amber);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 13px;
  line-height: 1.6;
  color: var(--amber);
}
.wip-banner strong { font-size: 14px; display: block; margin-bottom: 3px; color: #633806; }
.wip-banner { position: relative; padding-right: 2.4rem; }
.wip-dismiss {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--amber);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.12s, background 0.12s;
}
.wip-dismiss:hover { opacity: 1; background: rgba(139,105,20,0.12); }
/* Presentation safety: never print the WIP notice */
@media print {
  .wip-banner { display: none !important; }
}

/* ── Prefill attribution chip ────────────────────────────────────────────── */
.prefill-chip {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--blue-lt);
  color: var(--navy-mid);
  border: 0.5px solid #B5D4F4;
  vertical-align: middle;
  line-height: 1.7;
  white-space: nowrap;
}
@media print {
  .prefill-chip { display: none !important; }
}

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 0.5px solid #D8DCE6;
  border-radius: var(--radius-lg);
  padding: 1rem 1.125rem;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 0.75rem; }
.card-label {
  font-size: 11px;
  font-weight: 600;
  color: #555555;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.625rem;
}

/* ── Form elements ────────────────────────────────────────────────────────── */
label { display: block; font-size: 13px; color: #333333; margin-bottom: 4px; font-weight: 500; }
select, input[type=text], input[type=number] {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid #D0D5E0;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  background: var(--white);
  color: var(--gray-dk);
  transition: border-color 0.15s;
}
select:focus, input:focus {
  outline: none;
  border-color: var(--slate);
  box-shadow: 0 0 0 2px rgba(74,111,165,0.15);
}
.field { margin-bottom: 0.625rem; }
.field-hint { font-size: 12px; color: #555555; margin-top: 3px; line-height: 1.5; }
.field-hint a { color: var(--slate); }

/* ── Input highlighted (user-entry) ─────────────────────────────────────── */
.input-highlight {
  background: #FFFAED;
  border-color: var(--amber);
  font-weight: 600;
  color: #1B2A4A;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, transform 0.1s;
  text-decoration: none;
}
.btn:hover { opacity: 0.88; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-energy  { background: var(--green-dk); color: #fff; }
.btn-resil   { background: var(--amber); color: #fff; }
.btn-regen   { background: var(--regen); color: #fff; }
.btn-ghost   { background: transparent; border: 1px solid #D0D5E0; color: var(--gray-dk); }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; margin-top: 0.5rem; }

/* ── Metric cards ─────────────────────────────────────────────────────────── */
.metrics { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin: 0.75rem 0; }
.metric {
  background: #F4F6FA;
  border-radius: var(--radius-md);
  padding: 0.625rem 0.75rem;
  text-align: center;
}
.metric-val { font-size: 20px; font-weight: 700; margin-bottom: 1px; }
.metric-lbl { font-size: 12px; color: #444444; line-height: 1.4; }
.metric.positive .metric-val { color: var(--green-dk); }
.metric.warning  .metric-val { color: var(--orange); }
.metric.info     .metric-val { color: var(--navy-mid); }
.metric.neutral  .metric-val { color: var(--gray-dk); }

/* ── Three-column comparison ─────────────────────────────────────────────── */
.col-headers { display: grid; grid-template-columns: 1fr 0.6fr 1fr; gap: 6px; margin-bottom: 6px; }
.col-hdr {
  padding: 6px 10px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.col-hdr.baseline { background: #ECEEF2; color: #4A4A4A; }
.col-hdr.delta    { background: var(--energy-lt); color: var(--energy); }
.col-hdr.improved { background: var(--blue-lt); color: var(--navy); }

.upg-row-wrap {
  background: var(--white);
  border: 0.5px solid #D8DCE6;
  border-radius: var(--radius-lg);
  margin-bottom: 6px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.upg-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s;
}
.upg-row-head:hover { background: #F7F8FA; }
.upg-row-title { font-size: 14px; font-weight: 600; flex: 1; color: var(--navy); }
.cascade-pill {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--energy-lt);
  color: var(--energy);
  border: 0.5px solid #97C459;
  font-weight: 600;
}
.upg-row-body { display: none; border-top: 0.5px solid #ECEEF2; padding: 8px 12px; }
.upg-row-body.open { display: block; }
.three-grid { display: grid; grid-template-columns: 1fr 0.6fr 1fr; gap: 6px; }
.cell {
  padding: 8px 10px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-line;
}
.cell.baseline { background: #F4F6FA; color: #4A4A4A; }
.cell.delta    { background: var(--energy-lt); color: #27500A; }
.cell.improved { background: var(--blue-pale); color: var(--navy); }
.row-source    { font-size: 11px; color: #555555; margin-top: 5px; }

/* ── Results panel ────────────────────────────────────────────────────────── */
.results-panel {
  background: #F0F3F8;
  border: 0.5px solid #CDD3E2;
  border-radius: var(--radius-lg);
  padding: 0.875rem;
  margin-top: 0.875rem;
}
.results-title { font-size: 15px; font-weight: 600; color: var(--navy); margin-bottom: 0.625rem; }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 0.625rem; }
.footnote {
  font-size: 11px;
  color: #555555;
  margin-top: 0.625rem;
  line-height: 1.6;
  padding-top: 6px;
  border-top: 0.5px solid #D0D5E0;
}

/* ── Multi-year chart ─────────────────────────────────────────────────────── */
.chart-card {
  background: var(--white);
  border: 0.5px solid #D8DCE6;
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin: 0.625rem 0;
}
.chart-title { font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.chart-area { position: relative; height: 180px; }
.chart-area svg { width: 100%; height: 100%; }
.chart-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: #555555; margin-top: 4px; }
.leg-swatch { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }

/* ── Sidebar layout ───────────────────────────────────────────────────────── */
.sidebar-layout { display: grid; grid-template-columns: 255px 1fr; gap: 1rem; align-items: start; }
.sidebar { display: flex; flex-direction: column; gap: 0; }

/* ── Certification families ───────────────────────────────────────────────── */
.family-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}
.family-bar.energy     { background: var(--energy-lt); border: 0.5px solid #97C459; }
.family-bar.resilience { background: var(--resil-lt);  border: 0.5px solid #EF9F27; }
.family-bar.regenerative { background: var(--regen-lt); border: 0.5px solid #5DCAA5; }
.family-name { font-size: 14px; font-weight: 600; }
.family-name.energy      { color: var(--energy); }
.family-name.resilience  { color: var(--resilience); }
.family-name.regenerative{ color: var(--regen); }
.family-desc { font-size: 12px; color: #444444; }

.cert-grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(295px,1fr)); gap: 10px; }
.cert-card-v {
  background: var(--white);
  border: 0.5px solid #D8DCE6;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.cert-card-v.energy      { border-top: 3px solid #639922; }
.cert-card-v.resilience  { border-top: 3px solid #BA7517; }
.cert-card-v.regenerative{ border-top: 3px solid #1D9E75; }

/* ── Tabs ─────────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 1.5px solid #D0D5E0; margin-bottom: 1rem; }
.tab-btn {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  color: #555555;
  margin-bottom: -1.5px;
  transition: color 0.15s;
}
.tab-btn:hover { color: var(--navy); }
.tab-btn.active { color: var(--navy); border-bottom-color: var(--navy); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Toggles ──────────────────────────────────────────────────────────────── */
.toggle-row { display: flex; gap: 4px; margin-bottom: 0.5rem; }
.toggle-opt {
  flex: 1;
  padding: 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  border: 0.5px solid #D0D5E0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: #555555;
  background: var(--white);
  transition: all 0.12s;
}
.toggle-opt.on {
  background: var(--blue-pale);
  border-color: var(--slate);
  color: var(--navy);
}

/* ── Filter pills ─────────────────────────────────────────────────────────── */
.filter-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 1rem; align-items: center; }
.filter-label { font-size: 13px; color: #444444; }
.filter-pill {
  padding: 4px 12px;
  border-radius: 20px;
  border: 0.5px solid #D0D5E0;
  font-size: 13px;
  cursor: pointer;
  background: var(--white);
  color: #444444;
  font-family: var(--font);
  white-space: nowrap;
  transition: all 0.12s;
}
.filter-pill:hover { border-color: var(--slate); color: var(--navy); }
.filter-pill.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.filter-pill.energy.on  { background: var(--green-dk); border-color: var(--green-dk); }
.filter-pill.resilience.on { background: var(--amber); border-color: var(--amber); }
.filter-pill.regenerative.on { background: var(--regen); border-color: var(--regen); }

/* ── Contract Q-card ──────────────────────────────────────────────────────── */
.q-progress { display: flex; gap: 5px; margin-bottom: 0.875rem; }
.q-step { flex: 1; height: 4px; border-radius: 2px; background: #D8DCE6; transition: background 0.2s; }
.q-step.done { background: var(--navy); }
.q-text { font-size: 16px; font-weight: 600; margin-bottom: 0.875rem; color: var(--navy); }
.q-opts { display: flex; flex-direction: column; gap: 5px; }
.q-opt {
  padding: 9px 12px;
  border: 0.5px solid #D0D5E0;
  border-radius: var(--radius-md);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  background: var(--white);
  color: var(--gray-dk);
  font-family: var(--font);
  transition: all 0.12s;
}
.q-opt:hover { border-color: var(--slate); background: var(--blue-pale); }
.q-opt.sel { background: var(--blue-pale); color: var(--navy); border-color: var(--slate); }

/* ── Contract result ──────────────────────────────────────────────────────── */
.doc-pkg { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 0.875rem; }
.doc-pkg-card { background: var(--blue-pale); border-radius: var(--radius-md); padding: 0.75rem; }
.doc-role { font-size: 11px; color: var(--slate); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 3px; }
.doc-num { font-size: 16px; font-weight: 700; color: var(--navy); margin-bottom: 2px; }
.doc-sub { font-size: 11px; color: var(--slate); line-height: 1.4; }
.watch-list { display: flex; flex-direction: column; gap: 5px; margin: 0.625rem 0; }
.watch-item {
  padding: 6px 9px 6px 12px;
  border-left: 3px solid var(--amber);
  background: var(--amber-lt);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px;
  line-height: 1.6;
  color: #3A2000;
}
.watch-item strong { font-weight: 600; display: block; margin-bottom: 1px; }

/* ── Flash/resource bar ───────────────────────────────────────────────────── */
.resource-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  background: var(--blue-pale);
  border: 0.5px solid #B5D4F4;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  font-size: 13px;
  color: var(--navy-mid);
}
.resource-bar a { color: var(--navy); font-weight: 600; }

/* ── Page hero ────────────────────────────────────────────────────────────── */
.page-hero { padding: 1.25rem 0 1rem; margin-bottom: 1rem; border-bottom: 0.5px solid #D0D5E0; }
.page-hero h1 { font-size: 26px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.page-hero p { font-size: 14px; color: #444444; max-width: 720px; line-height: 1.7; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 0.5px solid #D0D5E0;
  margin-top: 2.5rem;
  padding: 1.25rem;
  background: #ECEEF4;
  text-align: center;
  font-size: 10px;
  color: #555555;
  line-height: 1.8;
}
.site-footer a { color: var(--slate); }
.site-footer strong { color: var(--navy); font-weight: 600; }

/* ── Cascade note ─────────────────────────────────────────────────────────── */
.cascade-note {
  font-size: 12px;
  color: var(--green-dk);
  padding: 4px 8px;
  background: var(--energy-lt);
  border-radius: var(--radius-sm);
  margin-top: 4px;
  line-height: 1.5;
}

/* ── Commodity tracker ────────────────────────────────────────────────────── */
.comm-row { display: flex; align-items: center; gap: 7px; padding: 4px 0; font-size: 13px; }
.t-bar { height: 5px; border-radius: 3px; background: #E0E3EA; flex: 1; overflow: hidden; }
.t-fill { height: 100%; border-radius: 3px; }
.t-up { background: #C0392B; } .t-dn { background: #3B6D11; } .t-fl { background: #888780; }
.comm-delta { font-size: 12px; font-weight: 600; min-width: 40px; text-align: right; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar-layout { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .three-grid { grid-template-columns: 1fr; }
  .col-headers { display: none; }
  .doc-pkg { grid-template-columns: 1fr; }
  /* Nav link hiding removed: below 900px the hamburger menu handles nav */
}

/* ── Mobile pass (July 2026) — shared rules for every tool page ────────────
   Review-first doctrine: on a phone the site must READ well (reports,
   analyses, advisor chat) even where heavy data entry stays a desktop job.
   These rules ride behind a media query so desktop is untouched. !important
   is used deliberately: page-level inline styles otherwise outrank a linked
   stylesheet, and these must win on small screens. */
@media (max-width: 640px) {
  /* iOS zooms the whole page when a focused field's font is under 16px.
     Keeping inputs at 16px kills the zoom-jump on every form page. */
  input[type=text], input[type=number], input[type=email], select, textarea {
    font-size: 16px !important;
  }
  /* Wide data tables (IBC matrix, cost table, use tradeoff) scroll inside
     their own box instead of stretching the page sideways. */
  table { display: block; overflow-x: auto; max-width: 100%; }
  /* Pill rows and button rows wrap instead of overflowing. */
  .pf-mode-bar, .cta-pair, .wiz-progress { flex-wrap: wrap !important; }
  /* Two-column layouts on tool pages collapse. */
  .pf-two-col { grid-template-columns: 1fr !important; }
  /* The project context card stacks into two readable columns. */
  .context-card { display: grid !important; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
  .context-card .ctx-edit { grid-column: 1 / -1; }
}
