/* ═══════════════════════════════════════════════════════════════
   GHG Calculator — Professional Light Theme
   ═══════════════════════════════════════════════════════════════ */

/* ── Page section ─────────────────────────────────────────────── */
.calc-app {
  padding-bottom: 4rem;
}
.calc-app__grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.calc-panel,
.calc-results {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(15,23,42,.06), 0 4px 20px rgba(15,23,42,.05);
}
.calc-panel h2,
.calc-results__top h2 {
  color: #1e293b;
  margin-bottom: .4rem;
  font-size: 1.45rem;
  line-height: 1.25;
}

/* ── Section label ──────────────────────────────────────────────── */
.section-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #10b981;
  margin-bottom: .5rem;
}

/* ── Status banner ──────────────────────────────────────────────── */
.calc-status {
  margin: 0 0 1rem;
  padding: .55rem 1rem;
  border-radius: 8px;
  font-size: .84rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.calc-status--loading {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}
.calc-status--ok {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #065f46;
}
.calc-status--error {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #be123c;
}

/* ── Scope tabs ─────────────────────────────────────────────────── */
.scope-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
  margin: 0 0 1.5rem;
}
.scope-tab {
  display: flex;
  align-items: center;
  gap: .7rem;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  color: #374151;
  border-radius: 10px;
  padding: .9rem;
  cursor: pointer;
  text-align: left;
  font-family: var(--sans);
  transition: all .15s;
  min-width: 0;
}
.scope-tab:hover {
  border-color: #10b981;
  background: #f0fdf4;
  color: #1e293b;
}
.scope-tab--active {
  background: #f0fdf4;
  border-color: #10b981;
  color: #064e3b;
  box-shadow: 0 0 0 3px rgba(16,185,129,.1);
}
.scope-tab__num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .82rem;
  font-weight: 700;
  flex-shrink: 0;
  color: #374151;
  transition: all .15s;
}
.scope-tab--active .scope-tab__num {
  background: #10b981;
  color: #ffffff;
}
.scope-tab__label {
  display: block;
  font-size: .84rem;
  font-weight: 600;
  line-height: 1.1;
}
.scope-tab__desc {
  display: block;
  font-size: .7rem;
  color: #94a3b8;
  margin-top: .25rem;
  line-height: 1.1;
}
.scope-tab--active .scope-tab__desc { color: #374151; }

/* ── Cascading dropdowns ────────────────────────────────────────── */
.dd-group {
  margin-top: 1rem;
}
.field-label {
  display: block;
  margin-bottom: .45rem;
  font-size: .88rem;
  font-weight: 500;
  color: #374151;
}
.field-input {
  width: 100%;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  border-radius: 8px;
  padding: .85rem 1rem;
  font-size: .95rem;
  font-family: var(--sans);
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.field-input:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16,185,129,.12);
}
.field-input::placeholder { color: #94a3b8; }
.field-select {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='7' viewBox='0 0 12 7' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-color: #ffffff;
  padding-right: 40px;
}
.field-select option {
  background: #ffffff;
  color: #1e293b;
}

/* ── Factor preview card ────────────────────────────────────────── */
.factor-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem 1rem;
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 10px;
}
.factor-preview__label {
  display: block;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: #64748b;
  margin-bottom: .3rem;
}
.factor-preview__value {
  font-size: .95rem;
  color: #059669;
  font-weight: 700;
}

/* ── Add to inventory button ────────────────────────────────────── */
#dd-add {
  margin-top: 1.25rem;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  color: #ffffff;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all .15s;
  box-shadow: 0 2px 8px rgba(16,185,129,.35);
  font-family: var(--sans);
}
#dd-add:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 4px 14px rgba(16,185,129,.45);
  transform: translateY(-1px);
}

/* ── Divider ────────────────────────────────────────────────────── */
.calc-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 2rem 0 1.5rem;
  color: #94a3b8;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.calc-divider::before,
.calc-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

/* ── Custom source section ──────────────────────────────────────── */
.calc-manual {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
}
.calc-manual h3 {
  color: #1e293b;
  font-size: 1rem;
  margin: 0 0 .35rem;
}
.calc-manual p {
  color: #64748b;
  font-size: .86rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}
.calc-field-row {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}
.calc-field-row > div { width: 100%; }

/* ── Data stats (secondary — bottom of panel) ───────────────────── */
.calc-panel__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e2e8f0;
}
.stat-card.mini {
  padding: .85rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  text-align: center;
}
.stat-card.mini .stat-card__value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: .2rem;
}
.stat-card.mini .stat-card__label {
  color: #64748b;
  font-size: .75rem;
}

/* ── Results panel ──────────────────────────────────────────────── */
.calc-results__panel {
  margin-bottom: 1.5rem;
}
.calc-results__top p {
  margin-top: .35rem;
  color: #64748b;
  font-size: .9rem;
}
.calc-results__summary {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 1.25rem;
}
.summary-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem 1.1rem;
}
.summary-card span {
  display: block;
  font-size: .75rem;
  color: #64748b;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.summary-card strong {
  display: block;
  margin-top: .5rem;
  font-size: 1.6rem;
  color: #1e293b;
  font-weight: 700;
}
.summary-card small {
  color: #94a3b8;
  font-size: .78rem;
  display: block;
  margin-top: .2rem;
}
.summary-card:first-child {
  background: #f0fdf4;
  border-color: #6ee7b7;
}
.summary-card:first-child strong { color: #059669; }
.summary-card:first-child span { color: #065f46; }

/* ── Inventory table ────────────────────────────────────────────── */
.calc-table-wrap {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-top: 1rem;
}
.calc-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}
.calc-table thead { background: #f8fafc; }
.calc-table th,
.calc-table td {
  padding: .9rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
  vertical-align: middle;
  color: #475569;
}
.calc-table tr:last-child td { border-bottom: none; }
.calc-table th {
  color: #374151;
  font-weight: 600;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.calc-table td:first-child { min-width: 220px; }
.calc-table td strong {
  display: block;
  color: #1e293b;
  font-weight: 600;
  margin-bottom: .1rem;
}
.calc-table button {
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1rem;
  padding: .25rem .5rem;
  border-radius: 4px;
  transition: all .15s;
}
.calc-table button:hover { color: #ef4444; background: #fff1f2; }

/* ── Action buttons ─────────────────────────────────────────────── */
.calc-actions {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-top: 1.25rem;
}
.download-actions {
  display: grid;
  gap: .75rem;
  margin-bottom: 0;
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  color: #064e3b;
  background: #ecfdf5;
  border: 1.5px solid #6ee7b7;
  border-radius: 8px;
  padding: .8rem 1.3rem;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  transition: all .15s;
  font-family: var(--sans);
}
.btn-secondary:hover { background: #d1fae5; border-color: #34d399; }
.btn-block { width: 100%; }
.btn-tertiary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  color: #374151;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: .8rem 1.3rem;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  font-family: var(--sans);
  transition: all .15s;
}
.btn-tertiary:hover { background: #f1f5f9; border-color: #94a3b8; }
.calc-note {
  color: #94a3b8;
  font-size: .82rem;
}

/* ── Methodology section ────────────────────────────────────────── */
.calc-methodology {
  margin-top: 2rem;
  padding: 2rem;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15,23,42,.04);
}
.calc-methodology h2 { color: #1e293b; margin-bottom: .75rem; }
.calc-methodology ul {
  list-style: disc;
  padding-left: 1.1rem;
  color: #64748b;
  line-height: 1.8;
}
.calc-methodology p { margin-top: 1rem; color: #64748b; }
.calc-disclaimer {
  margin-top: 1rem;
  border-left: 3px solid #10b981;
  padding-left: 1rem;
}

/* ── Old search/filter (hidden — replaced by dropdowns) ─────────── */
.search-results,
.calc-filter-bar,
.search-hint { display: none; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (min-width: 1024px) {
  .download-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 1023px) {
  .calc-results__summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 860px) {
  .calc-panel__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .calc-panel,
  .calc-results,
  .calc-methodology {
    padding: 1.25rem;
    border-radius: 12px;
  }
  .scope-tab__desc { display: none; }
  .scope-tab { padding: .75rem .65rem; gap: .5rem; }
  .factor-preview { grid-template-columns: 1fr; }
  .calc-results__summary { grid-template-columns: 1fr 1fr; }
  .calc-panel__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .download-actions { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .calc-results__summary { grid-template-columns: 1fr; }
  .scope-tabs { gap: .5rem; }
  .scope-tab { padding: .65rem .5rem; }
  .scope-tab__num { width: 24px; height: 24px; font-size: .75rem; }
}

/* ═══════════════════════════════════════════════════════════════
   GHG Calculator — Feature Enhancements (v2)
   ═══════════════════════════════════════════════════════════════ */

/* Module badge */
.module-badge {
  background: #dbeafe; color: #1d4ed8;
  font-size: .65rem; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: .05em;
  vertical-align: middle; margin-left: 6px;
}

/* CEA notice */
.cea-notice {
  display: flex; align-items: flex-start; gap: 8px;
  background: #fef3c7; border: 1px solid #fbbf24;
  border-radius: 8px; padding: 10px 14px;
  font-size: .8rem; color: #92400e; margin: 8px 0 12px;
}
.cea-notice svg { flex-shrink: 0; margin-top: 1px; }

/* Section title in results panel */
.calc-section-title {
  font-size: .85rem; font-weight: 700;
  color: #374151; text-transform: uppercase;
  letter-spacing: .06em; margin: 0 0 14px;
  display: flex; align-items: center; gap: 8px;
}
.section-badge {
  background: #d1fae5; color: #065f46;
  font-size: .65rem; padding: 2px 8px;
  border-radius: 20px; font-weight: 700;
  text-transform: uppercase;
}

/* ── Feature 1: Hotspot Chart ───────────────────────────────────── */
.calc-hotspot {
  background: #fff; border: 1px solid #e5e7eb;
  border-radius: 12px; padding: 20px;
  margin-bottom: 16px;
}
.hotspot-grid {
  display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
}
.hotspot-chart-wrap {
  width: 180px; height: 180px; flex-shrink: 0;
}
.hotspot-legend {
  flex: 1; min-width: 160px;
  display: flex; flex-direction: column; gap: 6px;
}
.hs-legend-item {
  display: flex; align-items: center; gap: 8px;
  font-size: .78rem; color: #374151;
}
.hs-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.hs-label { flex: 1; }
.hs-pct { font-weight: 700; color: #6b7280; }

/* ── Feature 4: Intensity Metrics ──────────────────────────────── */
.calc-intensity {
  background: #fff; border: 1px solid #e5e7eb;
  border-radius: 12px; padding: 20px; margin-bottom: 16px;
}
.intensity-inputs {
  display: flex; gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.intensity-inputs > div { flex: 1; min-width: 140px; }
.field-input--sm { padding: 8px 10px; font-size: .85rem; }
.intensity-results {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr));
  gap: 10px;
}
.intensity-card {
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 8px; padding: 12px;
}
.intensity-val {
  font-size: 1.25rem; font-weight: 800;
  color: #0f172a; margin-bottom: 4px;
}
.intensity-lbl {
  font-size: .75rem; color: #64748b; margin-bottom: 2px;
}
.intensity-brsr {
  font-size: .68rem; color: #059669; font-weight: 600;
}

/* ── Feature 8: Sector Benchmarking ────────────────────────────── */
.calc-benchmark {
  background: #fff; border: 1px solid #e5e7eb;
  border-radius: 12px; padding: 20px; margin-bottom: 16px;
}
.benchmark-controls {
  display: flex; gap: 10px; margin-bottom: 14px;
}
.benchmark-result { margin-top: 12px; }
.bench-info {
  background: #f0fdf4; border: 1px solid #bbf7d0;
  border-radius: 8px; padding: 12px;
  font-size: .85rem; color: #065f46; line-height: 1.6;
}
.bench-result-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px,1fr));
  gap: 10px; margin-bottom: 10px;
}
.bench-card {
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 8px; padding: 12px; text-align: center;
}
.bench-val { font-size: 1.2rem; font-weight: 800; color: #0f172a; }
.bench-lbl { font-size: .72rem; color: #64748b; margin-top: 3px; }
.bench-note { font-size: .72rem; color: #94a3b8; }

/* ── Feature 7: Year-on-Year ────────────────────────────────────── */
.calc-yoy {
  background: #fff; border: 1px solid #e5e7eb;
  border-radius: 12px; padding: 20px; margin-bottom: 16px;
}
.yoy-controls {
  display: flex; gap: 10px; align-items: center;
  flex-wrap: wrap; margin-bottom: 14px;
}
.yoy-table-wrap { overflow-x: auto; }
.yoy-delete {
  background: none; border: none; cursor: pointer;
  color: #ef4444; font-size: .8rem; padding: 2px 6px;
}

/* ── Feature 6: Commute Module ──────────────────────────────────── */
.commute-grid {
  display: flex; flex-direction: column; gap: 8px;
  margin: 12px 0;
}
.commute-row {
  display: flex; align-items: center; gap: 10px;
}
.commute-mode {
  width: 130px; font-size: .82rem; color: #374151; flex-shrink: 0;
}
.commute-row .field-input {
  flex: 1; max-width: 120px; padding: 7px 10px;
}
.commute-pct {
  width: 40px; font-size: .78rem; color: #6b7280;
  font-weight: 600; text-align: right;
}
.commute-preview {
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 8px; padding: 10px 14px;
  font-size: .85rem; color: #64748b; margin: 10px 0;
}
.commute-preview--active {
  background: #f0fdf4; border-color: #bbf7d0;
  color: #065f46;
}

/* ── BRSR Export button ─────────────────────────────────────────── */
.btn-brsr {
  background: linear-gradient(135deg, #059669, #0d9488);
  color: #fff; border: none;
  border-radius: 8px; padding: 10px 16px;
  font-weight: 700; font-size: .85rem; cursor: pointer;
  transition: opacity .15s;
}
.btn-brsr:hover { opacity: .88; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .hotspot-grid { flex-direction: column; }
  .hotspot-chart-wrap { width: 160px; height: 160px; margin: 0 auto; }
  .commute-mode { width: 90px; font-size: .75rem; }
  .intensity-results { grid-template-columns: 1fr 1fr; }
}


/* Feature Pack 2 CSS */
.spend-grid { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.spend-row { display: flex; align-items: center; gap: 10px; }
.spend-cat { width: 160px; font-size: .82rem; color: #374151; flex-shrink: 0; }
.spend-row .field-input { flex: 1; max-width: 140px; padding: 7px 10px; }

.calc-anomaly { background: #fff8f0; border: 1px solid #fbbf24; border-radius: 12px; padding: 16px 20px; margin-bottom: 16px; }
.anomaly-item { font-size: .82rem; color: #92400e; padding: 6px 0; border-bottom: 1px solid #fde68a; line-height: 1.5; }
.anomaly-item:last-child { border-bottom: none; }

.calc-netzero, .calc-sbti, .calc-levers, .calc-offsets {
  background: #fff; border: 1px solid #e5e7eb;
  border-radius: 12px; padding: 20px; margin-bottom: 16px;
}
.nz-milestones {
  display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap;
}
.nz-milestone {
  flex: 1; min-width: 100px; text-align: center;
  background: #f0fdf4; border: 1px solid #bbf7d0;
  border-radius: 8px; padding: 10px;
  font-size: .8rem; color: #065f46;
}
.nz-milestone strong { display: block; font-size: 1.1rem; color: #059669; }

.sbti-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.sbti-card {
  background: #f0fdf4; border: 1px solid #bbf7d0;
  border-radius: 8px; padding: 14px;
}
.sbti-val { font-size: 1.2rem; font-weight: 800; color: #065f46; margin-bottom: 4px; }
.sbti-lbl { font-size: .78rem; font-weight: 700; color: #374151; margin-bottom: 4px; }
.sbti-desc { font-size: .72rem; color: #64748b; line-height: 1.5; }
.sbti-note { font-size: .75rem; color: #94a3b8; }
.sbti-note a { color: #059669; }

.levers-list { display: flex; flex-direction: column; gap: 8px; }
.lever-card {
  display: flex; gap: 12px; align-items: flex-start;
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 8px; padding: 12px;
}
.lever-icon { font-size: 1.3rem; flex-shrink: 0; }
.lever-body { flex: 1; }
.lever-title { font-weight: 600; color: #0f172a; font-size: .88rem; margin-bottom: 4px; }
.lever-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .72rem; margin-bottom: 3px; }
.lever-scope { color: #0369a1; font-weight: 600; }
.lever-reduction { color: #059669; font-weight: 700; }
.lever-cost { color: #6b7280; }
.lever-time { color: #6b7280; }
.lever-brsr { font-size: .7rem; color: #9333ea; font-weight: 600; }

.offsets-total { font-size: .9rem; color: #0f172a; margin-bottom: 10px; }
.offset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 10px; margin-bottom: 10px; }
.offset-card {
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 10px; padding: 14px; text-decoration: none;
  transition: border-color .15s; display: block;
}
.offset-card:hover { border-color: #059669; }
.offset-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: .7rem; font-weight: 700; margin-bottom: 6px; }
.offset-name { font-weight: 700; font-size: .85rem; color: #0f172a; margin-bottom: 4px; }
.offset-desc { font-size: .75rem; color: #64748b; line-height: 1.4; }

/* AI Chat */
.chat-toggle {
  position: fixed; bottom: 24px; right: 24px;
  width: 52px; height: 52px; border-radius: 50%;
  background: #059669; color: #fff;
  border: none; cursor: pointer; z-index: 500;
  box-shadow: 0 4px 16px rgba(5,150,105,.4);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s;
}
.chat-toggle:hover { transform: scale(1.08); }
.chat-panel {
  position: fixed; bottom: 88px; right: 24px;
  width: 320px; max-height: 440px;
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 16px; box-shadow: 0 8px 32px rgba(0,0,0,.12);
  display: flex; flex-direction: column; z-index: 500;
}
.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid #e2e8f0;
  font-weight: 700; font-size: .9rem; color: #0f172a;
}
.chat-close { background: none; border: none; cursor: pointer; color: #94a3b8; font-size: 1rem; }
.chat-messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg { padding: 8px 12px; border-radius: 10px; font-size: .82rem; line-height: 1.5; max-width: 92%; }
.chat-msg--user { background: #059669; color: #fff; align-self: flex-end; border-radius: 10px 10px 2px 10px; }
.chat-msg--bot { background: #f1f5f9; color: #0f172a; align-self: flex-start; border-radius: 10px 10px 10px 2px; }
.chat-msg--loading { opacity: .6; }
.chat-form { display: flex; gap: 6px; padding: 10px 12px; border-top: 1px solid #e2e8f0; }
.chat-form input { flex: 1; padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: .82rem; outline: none; }
.chat-form input:focus { border-color: #059669; }
.chat-form button { background: #059669; color: #fff; border: none; border-radius: 8px; padding: 8px 12px; font-size: .8rem; cursor: pointer; }
.chat-note { font-size: .65rem; color: #94a3b8; text-align: center; padding: 4px 12px 8px; }

/* Water & Waste module */
.ww-section-label { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #64748b; margin-bottom: 8px; }
.ww-grid { display: flex; flex-direction: column; gap: 7px; margin-bottom: 10px; }
.ww-row { display: flex; align-items: center; gap: 10px; }
.ww-cat { width: 190px; font-size: .8rem; color: #374151; flex-shrink: 0; }
.ww-row .field-input { flex: 1; max-width: 130px; padding: 7px 10px; }
.ww-preview { font-size: .82rem; color: #475569; background: #f1f5f9; border-radius: 8px; padding: 8px 12px; }

@media (max-width: 640px) {
  .sbti-grid { grid-template-columns: 1fr; }
  .spend-cat { width: 110px; font-size: .75rem; }
  .ww-cat { width: 130px; font-size: .74rem; }
  .chat-panel { width: calc(100vw - 32px); right: 16px; }
}
