/* ══════════════════════════════════════════════════════════════
   Electra EV Finder — M3 Theme Tokens + Custom Styles
   WCAG 2.2 AA compliant
   ══════════════════════════════════════════════════════════════ */

:root {
  /* ── M3 Color System (seed: #2D6A31) ── */
  --md-sys-color-primary: #2D6A31;
  --md-sys-color-on-primary: #FFFFFF;
  --md-sys-color-primary-container: #B4ECBA;
  --md-sys-color-on-primary-container: #002109;

  --md-sys-color-secondary: #52634F;
  --md-sys-color-on-secondary: #FFFFFF;
  --md-sys-color-secondary-container: #D5E8CE;
  --md-sys-color-on-secondary-container: #101F0E;

  --md-sys-color-tertiary: #7B5800;
  --md-sys-color-on-tertiary: #FFFFFF;
  --md-sys-color-tertiary-container: #FFDEAA;
  --md-sys-color-on-tertiary-container: #271D00;

  --md-sys-color-error: #BA1A1A;
  --md-sys-color-on-error: #FFFFFF;
  --md-sys-color-error-container: #FFDAD6;
  --md-sys-color-on-error-container: #410002;

  --md-sys-color-surface: #F8FBF6;
  --md-sys-color-on-surface: #191C18;
  --md-sys-color-on-surface-variant: #414942;
  --md-sys-color-surface-container: #ECEEEA;
  --md-sys-color-surface-container-low: #F2F5EF;
  --md-sys-color-surface-container-high: #E6E9E3;
  --md-sys-color-surface-container-highest: #E1E4DE;
  --md-sys-color-surface-container-lowest: #FFFFFF;
  --md-sys-color-outline: #717971;
  --md-sys-color-outline-variant: #C1C9BB;
  --md-sys-color-inverse-surface: #2E312C;
  --md-sys-color-inverse-on-surface: #EFF2EB;

  /* ── M3 Typography ── */
  --md-sys-typescale-body-medium-font: 'Roboto', system-ui, -apple-system, sans-serif;
  --md-ref-typeface-plain: 'Roboto', system-ui, -apple-system, sans-serif;
  --md-ref-typeface-brand: 'Roboto', system-ui, -apple-system, sans-serif;

  /* ── M3 Shape (px scale) ── */
  --md-sys-shape-corner-xs: 4px;
  --md-sys-shape-corner-small: 8px;
  --md-sys-shape-corner-medium: 12px;
  --md-sys-shape-corner-large: 16px;
  --md-sys-shape-corner-extra-large: 28px;
  --md-sys-shape-corner-full: 9999px;

  /* ── Elevation (3-level tonal shadow system) ── */
  --md-sys-elevation-1: 0 1px 2px rgba(0,0,0,.3), 0 1px 3px 1px rgba(0,0,0,.15);
  --md-sys-elevation-2: 0 1px 2px rgba(0,0,0,.3), 0 2px 6px 2px rgba(0,0,0,.15);
  --md-sys-elevation-3: 0 4px 8px 3px rgba(0,0,0,.15), 0 1px 3px rgba(0,0,0,.3);

  /* ── State Layers ── */
  --md-sys-state-hover: rgba(45,106,49,.08);
  --md-sys-state-pressed: rgba(45,106,49,.12);

  /* ── Spacing ── */
  --md-sys-gap: 16px;

  /* ── Segment Colors ── */
  --segment-budget: #388E3C;
  --segment-midrange: #7B1FA2;
  --segment-uppermid: #1565C0;
  --segment-premium: #F57F17;
  --segment-luxury: #AD1457;

  /* ── Origin Colors ── */
  --origin-china: #1565C0;
  --origin-korea: #7B1FA2;
  --origin-japan: #E65100;
  --origin-usa: #C62828;
  --origin-europe: #1B5E20;
}

/* ── Base Reset ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 100%; /* 16px base — supports 200% zoom */
  scroll-behavior: smooth;
}

body {
  font-family: var(--md-sys-typescale-body-medium-font);
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── M3 Button Sizing & Padding ── */
md-filled-button,
md-outlined-button,
md-text-button {
  --md-filled-button-label-text-size: 14px;
  --md-filled-button-container-height: 40px;
  --md-outlined-button-label-text-size: 14px;
  --md-outlined-button-container-height: 40px;
  --md-text-button-label-text-size: 14px;
  --md-text-button-container-height: 40px;
  padding-inline: 20px;
}

/* Compact buttons inside filter bars — padding = corner radius (height/2) */
.filter-bar md-outlined-button {
  --md-outlined-button-container-height: 36px;
  --md-outlined-button-label-text-size: 13px;
  padding-inline: 18px;
}
.filter-bar md-filled-button {
  padding-inline: 20px;
}

/* ── Skip to Content (WCAG 2.4.1) ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: 0.75rem 1.5rem;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border-radius: var(--md-sys-shape-corner-small);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 1rem;
}

/* ── Layout ── */
.app-wrap {
  max-width: 87.5rem; /* 1400px */
  margin: 0 auto;
  padding: 1rem;
}

/* ── App Header — M3 Top App Bar (flat primary) ── */
.app-header {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  padding: 20px 28px;
  border-radius: var(--md-sys-shape-corner-large);
  margin-bottom: var(--md-sys-gap);
  box-shadow: var(--md-sys-elevation-2);
}

.app-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.app-header__title {
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0;
}

.app-header__subtitle {
  font-size: 12px;
  opacity: .75;
  margin-top: 4px;
  font-weight: 400;
  letter-spacing: .15px;
}

.app-header__badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,.1);
  border-radius: var(--md-sys-shape-corner-small);
  padding: 4px 10px 4px 8px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .3px;
}

/* ── Navigation — text-link style ── */
.app-nav {
  background: var(--md-sys-color-surface-container-lowest);
  border-radius: var(--md-sys-shape-corner-medium);
  padding: 0 16px;
  margin-bottom: var(--md-sys-gap);
  box-shadow: var(--md-sys-elevation-1);
  display: flex;
  align-items: center;
}

.app-nav__list {
  display: flex;
  list-style: none;
  gap: 4px;
}

.app-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 2.5px solid transparent;
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  color: var(--md-sys-color-on-surface-variant);
  white-space: nowrap;
  transition: color .15s, border-color .15s;
  min-height: 44px; /* WCAG 2.5.8 target size */
  letter-spacing: .1px;
}

.app-nav__link .material-symbols-outlined {
  font-size: 18px;
  opacity: .6;
}

.app-nav__link:hover {
  color: var(--md-sys-color-primary);
  border-bottom-color: var(--md-sys-color-primary);
}

.app-nav__link--active {
  color: var(--md-sys-color-primary);
  font-weight: 500;
  border-bottom-color: var(--md-sys-color-primary);
}

.app-nav__link:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

/* ── Hamburger toggle (mobile) ── */
.nav-toggle {
  display: none; /* shown via media query */
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  border-radius: var(--md-sys-shape-corner-small);
  transition: background .15s;
}

.nav-toggle:hover {
  background: var(--md-sys-state-hover);
}

.nav-toggle .material-symbols-outlined {
  font-size: 24px;
}

/* ── Main Content ── */
main {
  min-height: 60vh;
}

/* ── Cards ── */
.card {
  background: var(--md-sys-color-surface-container-lowest);
  border-radius: var(--md-sys-shape-corner-large);
  padding: 20px 24px;
  box-shadow: var(--md-sys-elevation-1);
}

.card--elevated {
  box-shadow: var(--md-sys-elevation-2);
}

/* ── KPI Row ── */
.kpi-row {
  display: grid;
  grid-template-columns: 1fr 1fr; /* mobile-first: 2-col */
  gap: var(--md-sys-gap);
  margin-bottom: var(--md-sys-gap);
}

.kpi {
  background: var(--md-sys-color-surface-container-low);
  border-radius: var(--md-sys-shape-corner-medium);
  padding: 18px 20px;
}

.kpi__icon {
  font-size: 20px;
  margin-bottom: 8px;
  display: block;
}

.kpi--link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.kpi--link:hover {
  transform: translateY(-2px);
  box-shadow: var(--md-sys-elevation-2);
}

.kpi--link:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

.kpi__label {
  font-size: 11px;
  color: var(--md-sys-color-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 500;
}

.kpi__value {
  font-size: 26px;
  font-weight: 400;
  color: var(--md-sys-color-primary);
  margin: 4px 0 2px;
  letter-spacing: -.5px;
}

.kpi__sub {
  font-size: 11px;
  color: var(--md-sys-color-on-surface-variant);
}

/* Inner anchor that makes KPI value/sub clickable without disrupting tile layout */
.kpi__link {
  display: contents;
  color: inherit;
  text-decoration: none;
}
.kpi__link:hover .kpi__value,
.kpi__link:focus-visible .kpi__value {
  text-decoration: underline;
  text-decoration-color: var(--md-sys-color-primary);
  text-underline-offset: 3px;
}

/* ── Info Strip (Used page summary stats) ── */
.info-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--md-sys-color-surface-container);
  border-radius: var(--md-sys-shape-corner-medium);
  padding: 1rem 2rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.info-strip__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 2rem;
  gap: 2px;
}
.info-strip__value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--md-sys-color-primary);
  line-height: 1.2;
}
.info-strip__label {
  font-size: 0.75rem;
  color: var(--md-sys-color-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.info-strip__divider {
  width: 1px;
  height: 2.5rem;
  background: var(--md-sys-color-outline-variant);
  flex-shrink: 0;
}

/* ── Filter Bar ── */
.filter-bar {
  background: var(--md-sys-color-surface-container-lowest);
  border-radius: var(--md-sys-shape-corner-medium);
  padding: 16px 20px;
  margin-bottom: var(--md-sys-gap);
  display: flex;
  flex-direction: column; /* mobile-first: stacked */
  gap: 16px;
  align-items: stretch;
  box-shadow: var(--md-sys-elevation-1);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: 11px;
  color: var(--md-sys-color-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 500;
}

.filter-bar select {
  padding: 8px 12px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-xs);
  background: var(--md-sys-color-surface-container-lowest);
  font-size: 13px;
  font-family: inherit;
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  outline: none;
  transition: border-color .2s, border-width .1s;
}

.filter-bar select:focus {
  border-color: var(--md-sys-color-primary);
  border-width: 2px;
}

/* ── EV Card Grid ── */
.ev-grid {
  display: grid;
  grid-template-columns: 1fr; /* mobile-first: single column */
  gap: var(--md-sys-gap);
  margin-bottom: var(--md-sys-gap);
}

.ev-card {
  background: var(--md-sys-color-surface-container-lowest);
  border-radius: var(--md-sys-shape-corner-large);
  padding: 20px 24px;
  box-shadow: var(--md-sys-elevation-1);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow 0.2s;
}

.ev-card:hover {
  box-shadow: var(--md-sys-elevation-2);
}

.ev-card__brand {
  font-size: 11px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.ev-card__model {
  font-size: 16px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
}

.ev-card__price {
  font-size: 20px;
  font-weight: 400;
  color: var(--md-sys-color-primary);
}

.ev-card__specs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--md-sys-color-on-surface-variant);
}

.ev-card__spec {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ev-card__badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ev-card__actions {
  margin-top: auto;
  padding-top: 8px;
}

/* ── EV Card link wrapper ── */
.ev-card-link {
  text-decoration: none;
  display: block;
  border-radius: var(--md-sys-shape-corner-large);
}
.ev-card-link:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}
.ev-card__cta {
  display: block;
  margin-top: auto;
  padding-top: 8px;
}
.ev-card__cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border-radius: var(--md-sys-shape-corner-full);
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1px;
  width: 100%;
  transition: box-shadow 0.2s;
}
.ev-card-link:hover .ev-card__cta-btn,
.ev-card-link:focus-visible .ev-card__cta-btn {
  box-shadow: var(--md-sys-elevation-1);
}

/* ── Clickable table rows ── */
.data-table tbody tr[data-href] { cursor: pointer; }
.data-table__chevron {
  width: 28px;
  padding-right: 12px;
  text-align: right;
  color: var(--md-sys-color-on-surface-variant);
  opacity: 0.35;
}
.data-table__chevron .material-symbols-outlined { font-size: 18px; vertical-align: middle; }
.data-table tbody tr[data-href]:hover .data-table__chevron {
  opacity: 1;
  color: var(--md-sys-color-primary);
}

/* ── Segmented Control (Browse page) ── */
.seg-control {
  display: flex;
  background: var(--md-sys-color-surface-container);
  border-radius: var(--md-sys-shape-corner-full);
  padding: 4px;
  gap: 4px;
  margin-bottom: 1rem;
}
.seg-control__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  padding: 10px 20px;
  border: none;
  border-radius: var(--md-sys-shape-corner-full);
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
.seg-control__btn .material-symbols-outlined { font-size: 18px; }
.seg-control__btn--active {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  box-shadow: var(--md-sys-elevation-1);
}
.seg-control__btn:not(.seg-control__btn--active):hover {
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}
.seg-control__btn:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

/* ── Ad container ── */
.ad-container {
  margin: 1.5rem 0;
  min-height: 90px;
  text-align: center;
}


/* ── Badges (M3 Chips) ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--md-sys-shape-corner-full);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .3px;
  white-space: nowrap;
}

.badge--fbt,
.badge-yes {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.badge--segment,
.badge-seg {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.badge-no {
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
}

.badge-used {
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
}

.badge--saving-high {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.badge--saving-mid {
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
}

.badge--saving-low {
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface-variant);
}

.badge--body {
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface-variant);
}

/* ── Incentive status badges ── */
.badge--active {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.badge--expired {
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface-variant);
  text-decoration: line-through;
}

.badge--upcoming {
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
}

.badge--warning {
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
  text-decoration: none;
}

/* ── Data Table ── */
.data-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

.data-table thead th {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-on-surface-variant);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.data-table thead th:hover {
  color: var(--md-sys-color-primary);
  background: var(--md-sys-state-hover);
}

.data-table thead th a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.data-table thead th a:hover {
  color: var(--md-sys-color-primary);
}

.data-table thead th a:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

.data-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.data-table tbody tr:hover td {
  background: var(--md-sys-state-hover);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr td a {
  color: var(--md-sys-color-primary);
  text-decoration: none;
  font-weight: 500;
}

.data-table tbody tr td a:hover {
  text-decoration: underline;
}

.data-table tbody tr td a:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

/* ── Chart Cards ── */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr; /* mobile-first: single column */
  gap: var(--md-sys-gap);
  margin-bottom: var(--md-sys-gap);
}

.chart-card {
  background: var(--md-sys-color-surface-container-lowest);
  border-radius: var(--md-sys-shape-corner-large);
  padding: 20px 24px;
  box-shadow: var(--md-sys-elevation-1);
}

.chart-card__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: .1px;
}

.chart-card canvas {
  max-height: 260px;
}

/* ── Footer ── */
.app-footer {
  text-align: center;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 12px;
  padding: 20px 0 12px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  margin-top: var(--md-sys-gap);
  letter-spacing: .15px;
}

.app-footer a {
  color: var(--md-sys-color-primary);
  text-decoration: none;
}

.app-footer a:hover {
  text-decoration: underline;
}

.app-footer a:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

.app-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.375rem 1rem;
  margin-top: 0.5rem;
}

/* ── Visually Hidden (screen reader only) ── */
.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;
}

/* ── Skeleton Loading ── */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.skeleton-card {
  background: var(--md-sys-color-surface-container-lowest);
  border-radius: var(--md-sys-shape-corner-large);
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: var(--md-sys-elevation-1);
}

.skeleton-title {
  height: 20px;
  width: 40%;
  background: var(--md-sys-color-surface-container-high);
  border-radius: var(--md-sys-shape-corner-small);
  margin-bottom: 16px;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-line {
  height: 14px;
  background: var(--md-sys-color-surface-container);
  border-radius: var(--md-sys-shape-corner-small);
  margin-bottom: 10px;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-line:nth-child(2) { animation-delay: 0.1s; }
.skeleton-line:nth-child(3) { animation-delay: 0.2s; }
.skeleton-line:nth-child(4) { animation-delay: 0.3s; }

/* ── Detail Page Utilities ── */
.spec-dt {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.spec-dd {
  font-weight: 500;
  font-size: 16px;
}

.section-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: .1px;
}

.section-title .material-symbols-outlined {
  font-size: 18px;
}

/* ── Detail Page Grid ── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--md-sys-gap);
}

/* ── FBT Near-Threshold Advisory ── */
.fbt-advisory {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: var(--md-sys-color-secondary-container);
  border-radius: var(--md-sys-shape-corner-small);
  font-size: 13px;
  color: var(--md-sys-color-on-secondary-container);
  line-height: 1.5;
}

.fbt-advisory .material-symbols-outlined {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — Mobile-First
   Base = mobile (<768px), scale up with min-width
   ══════════════════════════════════════════════════════════ */

/* Mobile: hamburger visible, nav list hidden */
@media (max-width: 47.999rem) {
  .nav-toggle {
    display: flex;
  }

  .app-nav {
    position: relative;
    padding: 0;
  }

  .app-nav__list {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: 8px 0;
  }

  .app-nav--open .app-nav__list {
    display: flex;
  }

  .app-nav__link {
    padding: 14px 20px;
    min-height: 44px;
    border-bottom: none;
    border-left: 3px solid transparent;
  }

  .app-nav__link--active {
    border-left-color: var(--md-sys-color-primary);
    border-bottom: none;
  }

  .app-nav__link:hover {
    border-bottom: none;
    background: var(--md-sys-state-hover);
  }

  /* Header stacks vertically on mobile */
  .app-header__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Detail page grids stack on mobile */
  .detail-grid {
    grid-template-columns: 1fr !important;
  }

  /* Info strip collapses to vertical on narrow screens */
  .info-strip {
    flex-direction: column;
    gap: 0.5rem;
  }
  .info-strip__divider {
    width: 100%;
    height: 1px;
  }
}

/* ── Tablet (768px+) ── */
@media (min-width: 48rem) {
  .nav-toggle {
    display: none;
  }

  .app-nav__list {
    display: flex !important; /* override mobile hidden state */
  }

  .kpi-row {
    grid-template-columns: repeat(3, 1fr);
  }

  .ev-grid {
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  }

  .chart-grid {
    grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  }

  .filter-bar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
  }

  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Desktop (1100px+) ── */
@media (min-width: 68.75rem) {
  .kpi-row {
    grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
  }
}

/* ── Listing detail — gallery image ── */
.gallery__img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  max-height: 440px;
  object-fit: cover;
  border-radius: var(--md-sys-shape-corner-medium);
  display: block;
}

/* ── Listing detail — lightbox full image ── */
.lightbox__img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
}
