/* USLivingCost — feuille de style alignee sur la maquette (maket.png).
   Theme clair uniquement : la maquette de reference est claire, on ne bascule
   donc pas automatiquement en sombre. */

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

:root {
  --bg-page: #f6f7f9;
  --bg-primary: #ffffff;
  --bg-secondary: #f6f7f9;
  --bg-tertiary: #f6f7f9;
  --bg-input: #f3f4f7;

  --text-primary: #14171f;
  --text-secondary: #5f6673;
  --text-tertiary: #8b93a1;

  --border-tertiary: #e6e8ee;
  --border-secondary: #d7dbe3;

  --accent: #2b7cf0;
  --accent-dark: #1a67d6;
  --accent-soft: #eaf2fe;

  --green: #159a5b;
  --green-soft: #e8f7ef;
  --purple: #6b46e5;
  --purple-soft: #f0ecfd;
  --amber: #e08a1e;

  --header-bg: #ffffff;
  --header-text: #14171f;

  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.04);
  --shadow-hover: 0 4px 12px rgba(16, 24, 40, 0.08), 0 16px 32px rgba(16, 24, 40, 0.08);
  --shadow-focus: 0 0 0 3px var(--accent-soft);

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --page-max: 1280px;

  /* Animation durations */
  --duration-fast: 120ms;
  --duration-normal: 200ms;
  --duration-slow: 300ms;
  --duration-slower: 500ms;

  /* Easing functions */
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-in: cubic-bezier(0.55, 0.055, 0.675, 0.19);
  --ease-in-out: cubic-bezier(0.645, 0.045, 0.355, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ============================================================
   Dark Mode Variables
   ============================================================ */

@media (prefers-color-scheme: dark) {
  :root:not(.light) {
    --bg-page: #0f1117;
    --bg-primary: #14171f;
    --bg-secondary: #0f1117;
    --bg-tertiary: #1a1f2e;
    --bg-input: #1a1f2e;

    --text-primary: #f4f5f7;
    --text-secondary: #a8adb8;
    --text-tertiary: #7a8290;

    --border-tertiary: #2d3342;
    --border-secondary: #3d4454;

    --accent-soft: #1a2a4a;
    --green-soft: #153a26;
    --purple-soft: #2a1a4a;

    --header-bg: #14171f;
    --header-text: #f4f5f7;

    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.2), 0 16px 32px rgba(0, 0, 0, 0.2);
    --shadow-focus: 0 0 0 3px var(--accent-soft);
  }
}

/* Explicit dark/light mode classes */
:root.light {
  --bg-page: #f6f7f9;
  --bg-primary: #ffffff;
  --bg-secondary: #f6f7f9;
  --bg-tertiary: #f6f7f9;
  --bg-input: #f3f4f7;

  --text-primary: #14171f;
  --text-secondary: #5f6673;
  --text-tertiary: #8b93a1;

  --border-tertiary: #e6e8ee;
  --border-secondary: #d7dbe3;

  --accent-soft: #eaf2fe;
  --green-soft: #e8f7ef;
  --purple-soft: #f0ecfd;

  --header-bg: #ffffff;
  --header-text: #14171f;

  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.04);
  --shadow-hover: 0 4px 12px rgba(16, 24, 40, 0.08), 0 16px 32px rgba(16, 24, 40, 0.08);
  --shadow-focus: 0 0 0 3px var(--accent-soft);
}

.dark {
  --bg-page: #0f1117;
  --bg-primary: #14171f;
  --bg-secondary: #0f1117;
  --bg-tertiary: #1a1f2e;
  --bg-input: #1a1f2e;

  --text-primary: #f4f5f7;
  --text-secondary: #a8adb8;
  --text-tertiary: #7a8290;

  --border-tertiary: #2d3342;
  --border-secondary: #3d4454;

  --accent-soft: #1a2a4a;
  --green-soft: #153a26;
  --purple-soft: #2a1a4a;

  --header-bg: #14171f;
  --header-text: #f4f5f7;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.2), 0 16px 32px rgba(0, 0, 0, 0.2);
  --shadow-focus: 0 0 0 3px var(--accent-soft);
}

body {
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
img { display: block; max-width: 100%; }

.wrap { width: 100%; max-width: var(--page-max); margin: 0 auto; padding: 1.5rem; }
.wrap + .wrap { padding-top: 0; }
.home-body { padding-top: 22px; padding-bottom: 10px; }

/* ============================================================ en-tete */

.site-header {
  background: var(--header-bg);
  color: var(--header-text);
  border-bottom: 1px solid var(--border-tertiary);
  position: sticky;
  top: 0;
  z-index: 40;
}
.site-header-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  padding-top: 12px;
  padding-bottom: 12px;
  flex-wrap: nowrap;
}
/* Hamburger menu toggle button */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.nav-toggle:hover {
  background: var(--bg-secondary);
}
.nav-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.nav-toggle-icon {
  position: relative;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: background 0.2s, transform 0.2s;
}
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  transition: transform 0.2s;
}
.nav-toggle-icon::before { top: -7px; }
.nav-toggle-icon::after { bottom: -7px; }

/* Active state - X icon */
.nav-toggle[aria-expanded="true"] .nav-toggle-icon {
  background: transparent;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile navigation drawer */
@media (max-width: 1024px) {
  .site-header .nav-toggle,
  .site-header-inner .nav-toggle,
  .nav-toggle {
    display: flex !important;
  }
  
  .site-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    background: var(--bg-primary);
    border-left: 1px solid var(--border-tertiary);
    box-shadow: var(--shadow-xl);
    padding: 80px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
  }
  
  .site-nav.open {
    transform: translateX(0);
  }
  
  .site-nav a {
    padding: 14px 16px;
    font-size: 16px;
    border-radius: var(--radius-sm);
    border-bottom: none;
    color: var(--text-primary);
    text-decoration: none;
    pointer-events: auto;
    z-index: 1001;
    position: relative;
  }
  
  .site-nav a:hover,
  .site-nav a:focus {
    background: var(--accent-soft);
    color: var(--accent);
  }
  
  /* Overlay when menu is open */
  .nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 999;
    pointer-events: none;
  }
  
  .nav-overlay.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  
  /* Hide search on mobile, it is moved into the drawer */
  .top-search { display: none; }
  .site-nav .top-search-clone { display: flex; }
  .site-meta {
    padding-left: 0;
    border-left: none;
    flex-shrink: 0;
  }
}

/* Restore desktop styles at larger screens */
@media (min-width: 1025px) {
  .site-nav {
    position: static;
    transform: none;
    box-shadow: none;
    border: none;
    padding: 0;
    flex-direction: row;
    width: auto;
    max-width: none;
  }
  .site-nav a {
    padding: 4px 0;
    font-size: 13.25px;
  }
  .nav-overlay { display: none; }
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-primary);
  text-decoration: none;
  flex-shrink: 0;
}
.brand-flag {
  width: 24px;
  height: 16px;
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(16, 24, 40, 0.1);
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.15; }
.brand-copy strong {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand-copy > span {
  font-size: 10.5px;
  color: var(--text-tertiary);
  letter-spacing: 0.01em;
}

.top-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 300px;
  max-width: 330px;
  margin-left: 6px;
}
.top-search-icon {
  position: absolute;
  left: 12px;
  font-size: 14px;
  color: var(--text-tertiary);
  pointer-events: none;
}
.top-search input {
  width: 100%;
  font-family: inherit;
  font-size: 12.75px;
  padding: 9px 12px 9px 33px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--bg-input);
  color: var(--text-primary);
}
.top-search input::placeholder { color: var(--text-tertiary); }
.top-search input:focus {
  outline: none;
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(43, 124, 240, 0.12);
}
.top-search-btn { display: none; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
}
.site-nav a {
  font-size: 13.25px;
  font-weight: 500;
  color: #3b4351;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] {
  color: var(--text-primary);
  font-weight: 600;
  border-bottom-color: var(--accent);
}
.site-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-secondary);
  padding-left: 18px;
  border-left: 1px solid var(--border-tertiary);
}
.lang-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lang-flag {
  display: inline-flex;
  width: 18px;
  height: 12px;
  flex-shrink: 0;
}
.lang-flag svg {
  width: 18px;
  height: 12px;
  display: block;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(16, 24, 40, 0.12);
}
.lang-flag .flag-es { display: none; }
.lang-flag.is-es .flag-us { display: none; }
.lang-flag.is-es .flag-es { display: block; }
.site-meta-caret { font-size: 9px; color: var(--text-tertiary); }

/* Search form moved into the drawer: only shown while the drawer exists */
.site-nav .top-search-clone { display: none; }

/* ============================================================ hero */

.hero {
  position: relative;
  color: #fff;
  margin-bottom: 0;
  background-image:
    linear-gradient(90deg, rgba(9, 32, 66, 0.92) 0%, rgba(9, 32, 66, 0.62) 42%,
                    rgba(9, 32, 66, 0.15) 78%, rgba(9, 32, 66, 0.05) 100%),
    var(--hero-image);
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
}
.hero-content {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 2.1rem 1.5rem 2rem;
  min-height: 232px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.17em;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 8px;
}
.hero h1 {
  font-size: clamp(26px, 3.1vw, 40px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: #fff;
  max-width: 780px;
}
.hero-copy {
  font-size: 14.5px;
  color: rgba(255, 255, 255, 0.88);
  max-width: 46ch;
  margin-top: 10px;
  line-height: 1.55;
}
.hero-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: var(--radius-md);
  padding: 6px;
  margin-top: 20px;
  max-width: 520px;
  box-shadow: 0 10px 28px rgba(6, 22, 46, 0.28);
}
.hero-search-icon {
  position: absolute;
  margin-left: 10px;
  font-size: 15px;
  color: var(--text-tertiary);
  pointer-events: none;
}
.hero-search input {
  flex: 1;
  font-family: inherit;
  font-size: 13.5px;
  padding: 8px 10px 8px 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
}
.hero-search input:focus { outline: none; }
.hero-search .btn {
  padding: 9px 22px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

/* ============================================================ cartes categories */

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 0;
  margin-bottom: 22px;
}
.category-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: 15px 17px;
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.category-card:hover {
  border-color: var(--border-secondary);
  transform: translateY(-1px);
}
.category-icon {
  width: 43px;
  height: 43px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 19px;
  flex-shrink: 0;
}
.category-green .category-icon { background: var(--green); color: #fff; }
.category-blue .category-icon { background: var(--accent); color: #fff; }
.category-purple .category-icon { background: var(--purple); color: #fff; }
.category-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.category-copy strong { font-size: 14.5px; font-weight: 700; }
.category-copy small {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}
.category-arrow {
  margin-left: auto;
  font-size: 20px;
  color: #b6bcc7;
  line-height: 1;
  flex-shrink: 0;
}

/* ============================================================ grille principale */

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.98fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 26px;
}

.feature-panel {
  grid-column: 1;
  grid-row: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.feature-top {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 18px;
  padding: 16px;
}
.feature-image-panel { position: relative; }
.feature-image {
  width: 100%;
  height: 100%;
  min-height: 218px;
  border-radius: var(--radius-md);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.feature-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #1d2b45;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.feature-badge::before { content: "⌖"; font-size: 11px; }

.feature-summary { display: flex; flex-direction: column; }
.feature-summary h2 {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.feature-subtitle {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.feature-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.feature-metric {
  border-radius: var(--radius-md);
  padding: 11px 12px;
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  position: relative;
}
.feature-metric .label {
  font-size: 10.75px;
  font-weight: 600;
  color: var(--text-secondary);
  padding-left: 21px;
  min-height: 26px;
  line-height: 1.28;
}
.feature-metric .label::before {
  position: absolute;
  left: 12px;
  top: 10px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 9px;
  color: #fff;
}
.feature-metric .value {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.feature-metric .sub {
  font-size: 10px;
  color: var(--text-tertiary);
  line-height: 1.3;
}
.feature-metric-green { background: var(--green-soft); border-color: #d5efe1; }
.feature-metric-green .label::before { content: "◔"; background: var(--green); }
.feature-metric-blue { background: var(--accent-soft); border-color: #d8e7fd; }
.feature-metric-blue .label::before { content: "▣"; background: var(--accent); }
.feature-metric-purple { background: var(--purple-soft); border-color: #e2d9fb; }
.feature-metric-purple .label::before { content: "⌂"; background: var(--purple); }

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
}
.mini-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 26px;
  position: relative;
}
.mini-stats > div::before {
  position: absolute;
  left: 0;
  top: 2px;
  font-size: 14px;
  color: var(--text-tertiary);
}
.mini-stats > div:nth-child(1)::before { content: "☷"; }
.mini-stats > div:nth-child(2)::before { content: "▤"; }
.mini-stats > div:nth-child(3)::before { content: "◑"; }
.mini-stats span { font-size: 10.5px; color: var(--text-secondary); line-height: 1.25; min-height: 26px; }
.mini-stats strong {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* onglets de la fiche ville */
.feature-tabs {
  display: flex;
  gap: 26px;
  padding: 0 16px;
  border-top: 1px solid var(--border-tertiary);
  border-bottom: 1px solid var(--border-tertiary);
  overflow-x: auto;
}
.feature-tabs a {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 11px 0 10px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.feature-tabs a:hover { color: var(--text-primary); }
.feature-tabs a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

.feature-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(0, 0.84fr);
  gap: 0;
}
.budget-panel {
  padding: 16px;
  border-right: 1px solid var(--border-tertiary);
}
.salary-panel { padding: 16px; }

.budget-head h3 {
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 1px;
}
.budget-head p {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-bottom: 14px;
}

.budget-layout {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}
.budget-donut {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: var(--donut);
  display: grid;
  place-items: center;
  position: relative;
}
.budget-donut::after {
  content: "";
  position: absolute;
  inset: 27px;
  background: #fff;
  border-radius: 50%;
}
.budget-donut > div {
  position: relative;
  z-index: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
}
.budget-donut strong {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.budget-donut span { font-size: 9.5px; color: var(--text-tertiary); }

.budget-list { list-style: none; display: grid; gap: 9px; }
.budget-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.budget-label { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); }
.budget-label i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--swatch);
  flex-shrink: 0;
}
.budget-list strong { font-weight: 600; min-width: 30px; text-align: right; }

.salary-need {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  margin-top: 2px;
}
.salary-scale {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  font-size: 10.5px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}
.salary-track {
  height: 5px;
  border-radius: 99px;
  background: #e4e8ef;
  position: relative;
}
.salary-track > span {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 99px;
  background: var(--accent);
}
.salary-track::after {
  content: "";
  position: absolute;
  left: 58%;
  top: 50%;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  transform: translate(-50%, -50%);
}
.salary-btn {
  display: block;
  margin-top: 14px;
  text-align: center;
  font-size: 12.5px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

/* ============================================================ colonne laterale */

.sidebar-stack {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  gap: 16px;
  align-content: start;
}
.sidebar-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 15px 16px;
}
.sidebar-head { margin-bottom: 10px; }
.sidebar-head h3 {
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-head p {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.city-list { list-style: none; display: grid; gap: 1px; }
.city-list a {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  color: var(--text-primary);
}
.city-list a:hover .city-copy strong { color: var(--accent); }
.city-thumb {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-input);
}
.city-copy { display: flex; flex-direction: column; min-width: 0; }
.city-copy strong {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.city-copy small {
  font-size: 10.5px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}
.city-price {
  font-size: 11.5px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.city-list .category-arrow { font-size: 16px; }

.compare-mini-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  background: var(--accent-soft);
  border-radius: var(--radius-md);
  padding: 12px;
  margin: 0 -4px -2px;
}
.compare-mini-form label {
  font-size: 10.5px;
  color: var(--text-secondary);
  grid-row: auto;
}
.compare-mini-form select {
  width: 100%;
  font-size: 11.5px;
  padding: 7px 8px;
  border-radius: 7px;
  border: 1px solid #cfe0fa;
  background: #fff;
  color: var(--text-primary);
}
.compare-mini-form .btn {
  grid-column: 1 / -1;
  margin-top: 4px;
  font-size: 12.5px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.quick-links { list-style: none; display: grid; gap: 2px; }
.quick-links a {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-tertiary);
}
.quick-links li:last-child a { border-bottom: none; padding-bottom: 0; }
.quick-links a::before {
  content: "◈";
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
}
.quick-links strong { display: block; font-size: 12px; font-weight: 600; }
.quick-links small { display: block; font-size: 10.5px; color: var(--text-tertiary); }
.quick-copy { display: flex; flex-direction: column; min-width: 0; }
.quick-links .category-arrow { font-size: 15px; }
.quick-links a:hover strong { color: var(--accent); }

/* ============================================================ articles */

.feature-links-panel {
  grid-column: 1;
  grid-row: 2;
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 16px;
  margin-bottom: 0;
}
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.article-card {
  display: flex;
  flex-direction: column;
  color: var(--text-primary);
}
.article-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  background-size: cover;
  background-position: center;
  background-color: var(--bg-input);
  margin-bottom: 9px;
}
.article-kicker {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 3px;
}
.article-card strong {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 4px;
}
.article-card:hover strong { color: var(--accent); }
.article-card small {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ============================================================ explorateur / tableaux */

.explorer-panel {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 16px;
  margin-bottom: 24px;
}

.browse-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}
.browse-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 16px;
}

/* ============================================================ composants communs */

.breadcrumbs {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 1rem 0 0.9rem;
}
.breadcrumbs a { color: var(--text-secondary); }
.breadcrumbs a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumbs li { list-style: none; display: flex; gap: 6px; }

h1 {
  font-size: 25px;
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.025em;
}
h2 { font-size: 17px; font-weight: 700; margin-bottom: 0.6rem; letter-spacing: -0.01em; }
h3 { font-size: 14px; font-weight: 700; margin-bottom: 0.35rem; }
.lede { font-size: 14px; color: var(--text-secondary); max-width: 68ch; margin-top: 0.6rem; }
section { margin-bottom: 2rem; }
.section-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.section-head p { font-size: 12.5px; color: var(--text-secondary); }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 10px;
}
.metric-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-tertiary);
}
.metric-card .label { font-size: 12px; color: var(--text-secondary); margin-bottom: 2px; }
.metric-card .value {
  font-size: 21px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.metric-card .sub { font-size: 11px; color: var(--text-tertiary); margin-top: 3px; }
.metric-card.accent { background: var(--accent-soft); border-color: transparent; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
}
table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 880px; }
thead tr { background: var(--bg-secondary); }
thead th {
  padding: 9px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-tertiary);
  white-space: nowrap;
}
th.sortable { cursor: pointer; user-select: none; }
th.sortable::after { content: " ⇕"; color: var(--text-tertiary); font-size: 10px; }
th.sortable[aria-sort="ascending"]::after { content: " ↑"; color: var(--accent); }
th.sortable[aria-sort="descending"]::after { content: " ↓"; color: var(--accent); }
tbody tr { border-bottom: 1px solid var(--border-tertiary); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #fafbfc; }
td { padding: 8px 10px; vertical-align: middle; }
th.rowhead {
  font-weight: 500;
  text-align: left;
  color: var(--text-secondary);
  padding: 8px 10px;
  white-space: normal;
}
td.city-cell { font-weight: 600; white-space: nowrap; }
td.city-cell a { color: inherit; }
td.city-cell a:hover { color: var(--accent); text-decoration: underline; }
.city-meta { font-size: 10.5px; color: var(--text-tertiary); font-weight: 400; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.rank { color: var(--text-tertiary); font-variant-numeric: tabular-nums; }

.badge {
  display: inline-block;
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 99px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-up { background: #fdecec; color: #b3342f; }
.badge-dn { background: #e9f6ee; color: #1c7a48; }
.badge-eq { background: #f1f2f5; color: #5f6673; }
.badge-base { background: var(--accent-soft); color: var(--accent); }

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-end;
  margin-bottom: 0.9rem;
}
.controls label { font-size: 12.5px; color: var(--text-secondary); }
select, input[type="text"], input[type="number"] {
  font-family: inherit;
  font-size: 13px;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-secondary);
  background: var(--bg-primary);
  color: var(--text-primary);
}
input[type="text"], input[type="number"] { width: 150px; }
input:focus, select:focus, button:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(43, 124, 240, 0.12);
}
.search-wrap { position: relative; }
.search-wrap input { padding-left: 27px; }
.search-icon {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--text-tertiary);
  pointer-events: none;
}
.btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  display: inline-block;
}
.btn:hover { background: var(--accent-dark); }
.btn.secondary {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-color: var(--border-secondary);
}
.btn.secondary:hover { background: var(--bg-secondary); }

.panel {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
}
.panel.tinted { background: var(--bg-secondary); }
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px 18px;
  align-items: end;
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12.5px; color: var(--text-secondary); }
.field input, .field select { width: 100%; }

.result-list { list-style: none; display: grid; gap: 8px; }
.result-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
  justify-content: space-between;
  font-size: 13px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-tertiary);
}
.result-list li:last-child { border-bottom: none; padding-bottom: 0; }
.result-list .k { color: var(--text-secondary); }
.result-list .v {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
}
.result-list .result-total {
  border-top: 2px solid var(--border-secondary);
  margin-top: 4px;
  padding-top: 10px;
}
.result-list .result-total .k {
  color: var(--text-primary);
  font-weight: 700;
}
.result-list .result-total .v {
  color: var(--accent);
  font-size: 16px;
}
.output-note { font-size: 11.5px; color: var(--text-tertiary); margin-top: 0.6rem; }
.move-note { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--border-tertiary); }

/* ============================================================ Rent affordability calculator */
.rent-calculator {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.rent-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-tertiary);
}

.rent-field { display: flex; flex-direction: column; gap: 6px; }

.rent-field label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.rent-field-input {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.rent-field-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.rent-field-prefix {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0 12px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.rent-field-input input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text-primary);
  outline: none;
  width: 100%;
}

.rent-field-input input::-webkit-outer-spin-button,
.rent-field-input input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.rent-field-input input[type=number] { -moz-appearance: textfield; }

.rent-select {
  background: var(--bg-input);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text-primary);
  outline: none;
  width: 100%;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.rent-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.rent-results {
  display: grid;
  gap: 10px;
}

.rent-result-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.rent-result-card:hover {
  border-color: var(--border-secondary);
  box-shadow: var(--shadow-card);
}
.rent-result-card:active { transform: scale(0.995); }

.rent-result-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

.rent-result-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rent-result-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rent-result-detail {
  font-size: 11.5px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rent-result-value {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}

.rent-result-badge {
  margin-left: auto;
  flex-shrink: 0;
}

.rent-result-card[data-metric=\"share\"] .rent-result-value { color: var(--purple); }
.rent-result-card[data-metric=\"income\"] .rent-result-value { color: var(--accent); }
.rent-result-card[data-metric=\"leftover\"] .rent-result-value { color: var(--green); }
.rent-result-card[data-metric=\"affordable\"] .rent-result-value { color: var(--amber); }

/* Animation for value updates */
.rent-result-value.updated {
  animation: moveValuePop 0.3s ease-out;
}

/* ============================================================ Moving cost calculator */
.move-calculator {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1024px) {
  .move-calculator { grid-template-columns: 1fr; }
}

.move-inputs {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.move-group {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-tertiary);
}
.move-group:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.move-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}

.move-group-icon {
  font-size: 15px;
  opacity: 0.9;
}

.move-fields { display: grid; gap: 12px; }

.move-field { display: flex; flex-direction: column; gap: 6px; }
.move-field--main { grid-column: span 1; }

.move-field label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.move-field-input {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.move-field-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.move-field-prefix {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0 12px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.move-field-input input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text-primary);
  outline: none;
  width: 100%;
  min-width: 0;
}

.move-field-input input::-webkit-outer-spin-button,
.move-field-input input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.move-field-input input[type=number] { -moz-appearance: textfield; }

.move-field-input--inline { flex-wrap: wrap; }
.move-field-input--inline input { flex: 1 1 80px; min-width: 80px; }
.move-field-suffix {
  font-size: 12.5px;
  color: var(--text-tertiary);
  padding: 0 14px;
  white-space: nowrap;
}

/* Results panel */
.move-results {
  display: grid;
  gap: 10px;
}

.move-result-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.move-result-card:hover {
  border-color: var(--border-secondary);
  box-shadow: var(--shadow-card);
}
.move-result-card:active { transform: scale(0.995); }

.move-result-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

.move-result-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.move-result-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.move-result-detail {
  font-size: 11.5px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.move-result-value {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Total card */
.move-total-card {
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--purple-soft) 100%);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-top: 8px;
  box-shadow: 0 2px 8px rgba(43, 124, 240, 0.12);
}

.move-total-icon {
  font-size: 24px;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.6);
  border-radius: var(--radius-md);
}

.move-total-info { flex: 1; min-width: 0; }

.move-total-label {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--accent-dark);
}

.move-total-detail {
  font-size: 12px;
  color: var(--text-secondary);
}

.move-total-value {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent-dark);
  white-space: nowrap;
}

/* Animation for value updates */
.move-result-value.updated,
.move-total-value.updated {
  animation: moveValuePop 0.3s ease-out;
}

@keyframes moveValuePop {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); color: var(--green); }
  100% { transform: scale(1); }
}

/* ============================================================ Time to save (moving calculator) */
.move-savings-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-tertiary);
}

.move-savings-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.move-savings-icon { font-size: 20px; }

.move-savings-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.move-savings-input {
  margin-bottom: 20px;
}

.move-savings-input label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.move-savings-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
  margin-bottom: 12px;
}
.move-savings-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.move-savings-input-wrap .move-field-prefix {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0 12px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.move-savings-input-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text-primary);
  outline: none;
  width: 100%;
}

.move-savings-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.move-preset-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.move-preset-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.move-preset-btn[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.move-savings-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

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

.move-savings-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.move-savings-card:hover {
  border-color: var(--border-secondary);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.move-savings-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.move-savings-value {
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  line-height: 1.1;
  margin-bottom: 6px;
}

.move-savings-detail {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* Animation for savings value updates */
.move-savings-value.updated {
  animation: moveValuePop 0.3s ease-out;
}

/* ============================================================ Lifestyle calculator */
.lifestyle-calculator-section {
  margin-top: 32px;
}

.lifestyle-calculator {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.lifestyle-input {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-tertiary);
}

@media (max-width: 640px) {
  .lifestyle-input { grid-template-columns: 1fr; }
}

.lifestyle-field { display: flex; flex-direction: column; gap: 6px; }

.lifestyle-field label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.lifestyle-field-input {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.lifestyle-field-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.lifestyle-field-prefix {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0 12px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.lifestyle-field-input input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text-primary);
  outline: none;
  width: 100%;
}

.lifestyle-field-input input::-webkit-outer-spin-button,
.lifestyle-field-input input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.lifestyle-field-input input[type=number] { -moz-appearance: textfield; }

.lifestyle-field select {
  background: var(--bg-input);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text-primary);
  outline: none;
  width: 100%;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.lifestyle-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.lifestyle-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

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

.lifestyle-card {
  position: relative;
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.lifestyle-card:hover {
  border-color: var(--border-secondary);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.lifestyle-card--base {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.lifestyle-card--cheaper {
  border-color: var(--green);
  background: var(--green-soft);
}
.lifestyle-card--pricier {
  border-color: var(--amber);
  background: #fff8eb;
}

.lifestyle-card-badge {
  position: absolute;
  top: -10px;
  left: 16px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  color: #fff;
}
.lifestyle-card--base .lifestyle-card-badge { background: var(--accent); }
.lifestyle-card--cheaper .lifestyle-card-badge { background: var(--green); }
.lifestyle-card--pricier .lifestyle-card-badge { background: var(--amber); }

.lifestyle-card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.lifestyle-card-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.lifestyle-card-header strong {
  font-size: 15px;
  color: var(--text-primary);
  display: block;
  margin-bottom: 2px;
}

.lifestyle-card-meta {
  font-size: 11.5px;
  color: var(--text-tertiary);
}

.lifestyle-card-value {
  font-size: 28px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.1;
}
.lifestyle-card--base .lifestyle-card-value { color: var(--accent-dark); }
.lifestyle-card--cheaper .lifestyle-card-value { color: var(--green); }
.lifestyle-card--pricier .lifestyle-card-value { color: var(--amber); }

.lifestyle-card-detail {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: auto;
}

.lifestyle-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--border-tertiary);
}

.lifestyle-btn-primary {
  background: var(--accent);
  color: #fff;
}
.lifestyle-btn-primary:hover { background: var(--accent-dark); }

.lifestyle-btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-tertiary);
}
.lifestyle-btn-secondary:hover { background: var(--accent-soft); border-color: var(--accent); }

.lifestyle-calculator-section .output-note {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-tertiary);
}

.link-list { list-style: none; display: grid; gap: 7px; font-size: 13px; }
.link-list li { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.link-list .meta { color: var(--text-tertiary); font-size: 12px; }
.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
  list-style: none;
}
.state-grid a {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  color: var(--text-primary);
  font-size: 12.5px;
  border: 1px solid var(--border-tertiary);
}
.state-grid a:hover { background: var(--accent-soft); border-color: #d8e7fd; }
.state-grid .count { color: var(--text-tertiary); font-size: 11.5px; font-variant-numeric: tabular-nums; }

.note { font-size: 12px; color: var(--text-secondary); line-height: 1.65; }
.note strong { color: var(--text-primary); }
.stack { display: grid; gap: 0.6rem; }
.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}
.definition-list {
  display: grid;
  grid-template-columns: minmax(0, 175px) 1fr;
  gap: 0.7rem 1.1rem;
  font-size: 13px;
}
.definition-list dt { font-weight: 700; }
.definition-list dd { color: var(--text-secondary); }
.formula {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  display: inline-block;
  margin-top: 4px;
}
.src-list { list-style: none; display: grid; gap: 10px; font-size: 13px; }
.src-list li { border-left: 3px solid var(--border-secondary); padding-left: 10px; }
.src-list .meta { color: var(--text-tertiary); font-size: 11.5px; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 0.7rem;
}
.legend span { display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.up { background: #b3342f; }
.dot.dn { background: #1c7a48; }
.dot.eq { background: #5f6673; }

/* ============================================================ pied de page */

footer.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-tertiary);
  background: var(--bg-primary);
}
footer.site-footer .wrap {
  font-size: 12px;
  color: var(--text-secondary);
  padding-top: 1.2rem;
  padding-bottom: 1.2rem;
}
footer.site-footer a { color: var(--text-secondary); }
footer.site-footer a:hover { color: var(--accent); }

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1.3fr);
  gap: 1.6rem 2.5rem;
  align-items: start;
  padding: 2rem 0 1.9rem;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.footer-brand strong {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.footer-brand span { font-size: 11.5px; color: var(--text-tertiary); }

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.footer-links li { margin: 0; }
.footer-links a {
  font-size: 12.5px;
  text-decoration: none;
}
.footer-links a:hover { text-decoration: underline; }

.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-tertiary);
}
.footer-meta a { color: var(--accent); }

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.3rem;
    padding: 1.6rem 0;
  }
}

[hidden] { display: none !important; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ============================================================ responsive */

@media (max-width: 1100px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .feature-panel, .feature-links-panel, .sidebar-stack {
    grid-column: auto;
    grid-row: auto;
  }
  .site-nav { gap: 16px; }
  .top-search { max-width: 240px; }
}

@media (max-width: 900px) {
  .category-grid { grid-template-columns: minmax(0, 1fr); }
  .feature-top { grid-template-columns: minmax(0, 1fr); }
  .feature-image { min-height: 180px; }
  .feature-bottom { grid-template-columns: minmax(0, 1fr); }
  .budget-panel { border-right: none; border-bottom: 1px solid var(--border-tertiary); }
  .article-grid { grid-template-columns: minmax(0, 1fr); }
  .browse-grid { grid-template-columns: minmax(0, 1fr); }
  .top-search { display: none; }
}

@media (max-width: 640px) {
  .wrap { padding: 1.05rem; }
  .hero-content { padding: 1.6rem 1.05rem; min-height: 0; }
  .hero h1 { font-size: 27px; }
  .hero-copy { font-size: 13.5px; }
  .hero-search { max-width: none; }
  .site-header-inner { gap: 14px; flex-wrap: wrap; }
  .site-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .brand-copy strong { font-size: 16px; }
  .brand-copy > span { font-size: 9.5px; }
  .feature-metrics { grid-template-columns: minmax(0, 1fr); }
  .mini-stats { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .budget-layout { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .compare-mini-form { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 21px; }
  .definition-list { grid-template-columns: 1fr; gap: 0.3rem; }
  .definition-list dd { margin-bottom: 0.5rem; }
}

/* ============================================================ Compare tool (modern card design) */
.compare-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
  padding: 20px;
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

@media (max-width: 900px) {
  .compare-controls { grid-template-columns: 1fr; }
}

.compare-field { display: flex; flex-direction: column; gap: 6px; }

.compare-field label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.compare-select {
  background: var(--bg-input);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text-primary);
  outline: none;
  width: 100%;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.compare-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.compare-salary-input {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.compare-salary-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.compare-salary-prefix {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0 12px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.compare-salary-input input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text-primary);
  outline: none;
  width: 100%;
}

.compare-summary {
  margin-bottom: 24px;
}

.compare-summary-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--purple-soft) 100%);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: 0 2px 8px rgba(43, 124, 240, 0.12);
}

.compare-summary-icon {
  font-size: 28px;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.6);
  border-radius: var(--radius-md);
}

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

.compare-summary-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 6px;
}

.compare-summary-main {
  font-size: 15.5px;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 6px;
}

.compare-summary-main strong { color: var(--accent-dark); }

.compare-summary-delta {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

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

.compare-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.compare-card:hover {
  border-color: var(--border-secondary);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}
.compare-card:active { transform: scale(0.995); }

.compare-card--equivalence {
  border-color: var(--accent);
  background: var(--accent-soft);
  grid-column: 1 / -1;
}

.compare-card-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.compare-card-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }

.compare-card-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compare-card-detail {
  font-size: 11.5px;
  color: var(--text-tertiary);
}

.compare-card-values {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.compare-card-value {
  font-size: 15.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  white-space: nowrap;
}

.compare-card-value--a { color: var(--text-secondary); }
.compare-card-value--b { color: var(--accent); }
.compare-card--equivalence .compare-card-value--a { color: var(--accent-dark); }
.compare-card--equivalence .compare-card-value--b { color: var(--accent); font-size: 17px; }

.compare-card-divider {
  width: 1px;
  height: 24px;
  background: var(--border-tertiary);
  margin: 0 4px;
}

.compare-card-delta {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
}

/* ============================================================ Tax calculator */
.tax-calculator {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.tax-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-tertiary);
}

.tax-field { display: flex; flex-direction: column; gap: 6px; }

.tax-field label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.tax-field-input {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tax-field-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.tax-field-prefix {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0 12px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.tax-field-input input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text-primary);
  outline: none;
  width: 100%;
}

.tax-select {
  background: var(--bg-input);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text-primary);
  outline: none;
  width: 100%;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tax-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.tax-field--checkbox { grid-column: 1 / -1; }
.tax-field--checkbox .checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
}
.tax-field--checkbox input[type=checkbox] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
#taxPreTaxWrap { display: none; }
#taxPreTaxWrap.visible { display: flex; }

.tax-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

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

.tax-result-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.tax-result-card:hover {
  border-color: var(--border-secondary);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.tax-result-card--gross { border-left: 4px solid var(--purple); }
.tax-result-card--federal { border-left: 4px solid #dc2626; }
.tax-result-card--state { border-left: 4px solid #ea580c; }
.tax-result-card--fica { border-left: 4px solid #2563eb; }
.tax-result-card--pretax { border-left: 4px solid var(--green); }
.tax-result-card--net { border-left: 4px solid var(--accent); }
.tax-result-card--rate { border-left: 4px solid var(--amber); }

.tax-result-card--highlight {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.tax-result-card--payperiod { background: var(--purple-soft); border-color: var(--purple); }

.tax-result-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.tax-result-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }

.tax-result-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tax-result-detail {
  font-size: 11.5px;
  color: var(--text-tertiary);
}

.tax-result-value {
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.tax-result-card--gross .tax-result-value { color: var(--purple); }
.tax-result-card--federal .tax-result-value { color: #dc2626; }
.tax-result-card--state .tax-result-value { color: #ea580c; }
.tax-result-card--fica .tax-result-value { color: #2563eb; }
.tax-result-card--pretax .tax-result-value { color: var(--green); }
.tax-result-card--net .tax-result-value { color: var(--accent); }
.tax-result-card--rate .tax-result-value { color: var(--amber); }

/* Animation for tax value updates */
.tax-result-value.updated {
  animation: moveValuePop 0.3s ease-out;
}

/* ============================================================ Salary page card designs */
.salary-glance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

@media (max-width: 640px) {
  .salary-glance-grid { grid-template-columns: 1fr; }
}

.salary-glance-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.salary-glance-card:hover {
  border-color: var(--border-secondary);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.salary-glance-card--primary {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.salary-glance-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.salary-glance-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }

.salary-glance-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.salary-glance-value {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  line-height: 1.1;
}
.salary-glance-card--primary .salary-glance-value { color: var(--accent-dark); }

.salary-glance-detail {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* What this wage buys */
.wage-buys-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

@media (max-width: 640px) {
  .wage-buys-grid { grid-template-columns: 1fr; }
}

.wage-buys-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.wage-buys-card:hover {
  border-color: var(--border-secondary);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.wage-buys-card--highlight {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.wage-buys-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.wage-buys-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }

.wage-buys-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wage-buys-value {
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  line-height: 1.1;
}
.wage-buys-card--highlight .wage-buys-value { color: var(--accent-dark); }

.wage-buys-detail {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.4;
}

/* Peer cities grid */
.peer-cities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

@media (max-width: 640px) {
  .peer-cities-grid { grid-template-columns: 1fr; }
}

.peer-city-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.peer-city-card:hover {
  border-color: var(--border-secondary);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.peer-city-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.peer-city-link {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.peer-city-link:hover { text-decoration: underline; }

.peer-city-diff { flex-shrink: 0; }

.peer-city-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border-tertiary);
}

@media (max-width: 480px) {
  .peer-city-metrics { grid-template-columns: 1fr; }
}

.peer-city-metric {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: center;
}

.peer-city-metric-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.peer-city-metric-value {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}


/* ============================================================ Compare export button */
.compare-field--action { align-self: end; }

.compare-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-tertiary);
  color: var(--text-primary);
  padding: 11px 16px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}
.compare-export-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.compare-export-btn:active { transform: scale(0.98); }

/* ============================================================ Print styles for PDF export */
@media print {
  /* Hide everything not needed in PDF */
  .site-header,
  .site-footer,
  .site-nav,
  .top-search,
  .site-meta,
  .compare-controls,
  .compare-field--action,
  .breadcrumb,
  .output-note,
  .section-head p,
  .legend,
  .src-list,
  .two-col,
  .link-list,
  .definition-list,
  .note,
  .move-note,
  .btn,
  button,
  .compare-mini-form,
  .sidebar-stack,
  .article-grid,
  .feature-links-panel,
  .home-grid > aside,
  .home-grid > .feature-panel .feature-tabs,
  .hero,
  .category-grid,
  .home-body > section:first-child {
    display: none !important;
  }

  /* Page setup */
  body {
    background: white !important;
    color: black !important;
    font-size: 12pt;
    line-height: 1.5;
  }

  .wrap {
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  main {
    max-width: none !important;
    padding: 0 !important;
  }

  /* Title */
  h1 {
    font-size: 24pt !important;
    color: black !important;
    margin-bottom: 0.5rem !important;
    page-break-after: avoid;
  }

  .lede {
    font-size: 12pt !important;
    color: #333 !important;
    margin-bottom: 1.5rem !important;
  }

  /* Summary card */
  .compare-summary-card {
    display: flex !important;
    background: #f0f4f8 !important;
    border: 2px solid #2b7cf0 !important;
    border-radius: 8px !important;
    padding: 16px 20px !important;
    margin-bottom: 1.5rem !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .compare-summary-icon {
    font-size: 24px !important;
  }

  .compare-summary-label {
    font-size: 10pt !important;
    font-weight: 700 !important;
    color: #1a67d6 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
  }

  .compare-summary-main {
    font-size: 13pt !important;
    color: black !important;
    line-height: 1.4 !important;
    margin: 6px 0 !important;
  }

  .compare-summary-main strong {
    color: #1a67d6 !important;
  }

  .compare-summary-delta {
    font-size: 11pt !important;
    font-weight: 600 !important;
    color: #2b7cf0 !important;
  }

  /* Compare grid */
  .compare-grid {
    display: block !important;
  }

  .compare-card {
    display: flex !important;
    background: white !important;
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    padding: 14px 16px !important;
    margin-bottom: 10px !important;
    page-break-inside: avoid;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .compare-card--equivalence {
    border: 2px solid #2b7cf0 !important;
    background: #f0f4f8 !important;
  }

  .compare-card-icon {
    font-size: 20px !important;
    width: 36px !important;
    height: 36px !important;
    background: #f0f0f0 !important;
  }

  .compare-card-label {
    font-size: 12pt !important;
    font-weight: 600 !important;
    color: black !important;
  }

  .compare-card-detail {
    font-size: 10pt !important;
    color: #666 !important;
  }

  .compare-card-values {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
    margin-top: 6px !important;
  }

  .compare-card-value {
    font-size: 13pt !important;
    font-weight: 700 !important;
    color: black !important;
  }

  .compare-card-value--a { color: #555 !important; }
  .compare-card-value--b { color: #2b7cf0 !important; }

  .compare-card-divider {
    width: 1px !important;
    height: 20px !important;
    background: #ddd !important;
    margin: 0 8px !important;
  }

  .compare-card-delta {
    font-size: 10pt !important;
    font-weight: 600 !important;
    padding: 2px 8px !important;
    border-radius: 4px !important;
    background: #f0f0f0 !important;
  }

  .compare-card-delta .badge-up {
    background: #dc2626 !important;
    color: white !important;
    padding: 2px 8px !important;
    border-radius: 4px !important;
    font-size: 9pt !important;
  }

  .compare-card-delta .badge-dn {
    background: #16a34a !important;
    color: white !important;
    padding: 2px 8px !important;
    border-radius: 4px !important;
    font-size: 9pt !important;
  }

  .compare-card-delta .badge-eq {
    background: #6b7280 !important;
    color: white !important;
    padding: 2px 8px !important;
    border-radius: 4px !important;
    font-size: 9pt !important;
  }

  /* Suggested comparisons */
  .link-list {
    display: block !important;
  }

  .link-list li {
    margin-bottom: 6px !important;
  }

  .link-list a {
    color: #2b7cf0 !important;
    text-decoration: underline !important;
  }

  /* Page header for PDF */
  body::before {
    content: "USLivingCost — City Comparison Report";
    display: block;
    font-size: 10pt;
    color: #666;
    margin-bottom: 1rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.5rem;
  }

  body::after {
    content: "Generated on " attr(data-date) " · Source: US Census ACS, BEA RPP, BLS OEWS";
    display: block;
    margin-top: 2rem;
    font-size: 9pt;
    color: #999;
    text-align: center;
    border-top: 1px solid #ddd;
    padding-top: 0.5rem;
  }

  /* Avoid breaking cards across pages */
  .compare-card,
  .compare-summary-card {
    break-inside: avoid;
  }
}

/* ============================================================ Calculator share/embed buttons */
.calculator-share {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-tertiary);
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-tertiary);
  color: var(--text-primary);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}
.share-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.share-btn:active { transform: scale(0.98); }

.share-btn--embed {
  background: var(--bg-primary);
}

.share-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 6px;
  min-width: 220px;
  z-index: 50;
  display: none;
  flex-direction: column;
  gap: 2px;
}
.share-dropdown[hidden] { display: none; }
.share-dropdown:not([hidden]) { display: flex; }

.share-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-primary);
  text-align: left;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.1s;
}
.share-dropdown-item:hover {
  background: var(--bg-secondary);
}

.share-dropdown-divider {
  border: none;
  border-top: 1px solid var(--border-tertiary);
  margin: 4px 0;
}

.share-dropdown-embed {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 8px 0;
}

.share-dropdown-embed label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.share-dropdown-embed input {
  width: 100%;
  padding: 8px 10px;
  font-family: monospace;
  font-size: 11.5px;
  background: var(--bg-input);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

.share-btn-copy {
  align-self: flex-start;
  padding: 6px 12px;
  font-size: 12px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}
.share-btn-copy:hover { background: var(--accent-dark); }

/* Toast notification for copy */
.share-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  font-size: 13.5px;
  font-weight: 500;
  z-index: 1000;
  animation: shareToastIn 0.3s ease-out;
}

@keyframes shareToastIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
  .share-dropdown {
    right: 0;
    left: 0;
    min-width: auto;
  }
}

/* ============================================================ Cost breakdown calculator */
.cost-breakdown {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.cost-input {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-tertiary);
}

.cost-input label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.cost-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
  margin-bottom: 12px;
}
.cost-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.cost-input-prefix {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0 12px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.cost-input-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text-primary);
  outline: none;
  width: 100%;
}

.cost-input-suffix {
  font-size: 13px;
  color: var(--text-tertiary);
  padding: 0 14px;
}

.cost-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cost-preset-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.cost-preset-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.cost-preset-btn[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.cost-categories {
  display: grid;
  gap: 16px;
}

.cost-category {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cost-category:hover {
  border-color: var(--border-secondary);
  box-shadow: var(--shadow-card);
}

.cost-category-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.cost-category-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.cost-category-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  margin-bottom: 2px;
}

.cost-category-detail {
  font-size: 11.5px;
  color: var(--text-tertiary);
}

.cost-category-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.cost-slider {
  flex: 1;
  max-width: 200px;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border-tertiary);
  border-radius: 3px;
  outline: none;
}
.cost-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s;
}
.cost-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.cost-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.cost-category-values {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.cost-category-share {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  min-width: 44px;
}

.cost-category-amount {
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.cost-sub-items {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border-tertiary);
}

.cost-sub-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cost-sub-item label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  min-width: 100px;
}

.cost-sub-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cost-sub-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.cost-sub-suffix {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.cost-summary {
  display: grid;
  gap: 12px;
  margin-top: 24px;
  padding: 20px;
  background: var(--accent-soft);
  border-radius: var(--radius-lg);
  border: 1px solid var(--accent);
}

.cost-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.cost-summary-row:not(:last-child) {
  border-bottom: 1px solid rgba(43, 124, 240, 0.15);
}

.cost-summary-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.cost-summary-value {
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.cost-summary-value--surplus.positive { color: var(--green); }
.cost-summary-value--surplus.negative { color: #dc2626; }

.cost-summary-row--savings .cost-summary-value {
  color: var(--accent);
}

@media (max-width: 640px) {
  .cost-category-controls { flex-direction: column; align-items: stretch; }
  .cost-slider { max-width: none; }
  .cost-category-values { justify-content: space-between; }
}

/* ============================================================ Methodology visual diagrams */
.methodology-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.overview-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.overview-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.overview-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 12px;
}

.overview-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.overview-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

/* Pipeline diagram */
.pipeline-diagram {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding: 24px;
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  flex-wrap: nowrap;
}

.pipeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 180px;
  flex-shrink: 0;
}

.pipeline-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.pipeline-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.pipeline-detail {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.4;
}

.pipeline-arrow {
  font-size: 20px;
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .pipeline-diagram {
    flex-direction: column;
    align-items: stretch;
  }
  .pipeline-step {
    flex-direction: row;
    text-align: left;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
  }
  .pipeline-arrow {
    display: none;
  }
  .pipeline-step::before {
    content: "→";
    color: var(--accent);
    font-weight: 700;
  }
  .pipeline-step:first-child::before {
    display: none;
  }
}

/* Formula visual */
.formula-visual {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 24px;
}

.formula-visual h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-tertiary);
}

.formula-diagram {
  overflow-x: auto;
}

.formula-flow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.formula-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  min-width: 120px;
  font-size: 13px;
}

.formula-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}

.formula-value {
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.formula-input {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
}

.formula-input .formula-value { color: var(--accent-dark); }

.formula-const {
  background: var(--bg-secondary);
  border: 1px solid var(--border-tertiary);
}

.formula-result {
  background: var(--green-soft);
  border: 1px solid var(--green);
}

.formula-result .formula-value { color: var(--green); }

.formula-op {
  font-size: 20px;
  color: var(--text-secondary);
  font-weight: 600;
}

.formula-equals {
  font-size: 24px;
  color: var(--accent);
  font-weight: 700;
}

@media (max-width: 640px) {
  .formula-flow {
    gap: 6px;
  }
  .formula-box {
    padding: 10px 12px;
    min-width: 100px;
  }
  .formula-value { font-size: 14px; }
  .formula-op { font-size: 16px; }
  .formula-equals { font-size: 20px; }
}


/* ============================================================ Rent vs Buy calculator */
.rent-buy-calculator {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.rent-buy-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-tertiary);
}

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

.rent-buy-group {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 20px;
}

.rent-buy-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-tertiary);
}

.rent-buy-fields { display: grid; gap: 14px; }

.rent-buy-field { display: flex; flex-direction: column; gap: 6px; }

.rent-buy-field label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.rent-buy-field-input {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.rent-buy-field-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.rent-buy-field-prefix {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0 12px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.rent-buy-field-input input,
.rent-buy-field-input select {
  flex: 1;
  border: none;
  background: transparent;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text-primary);
  outline: none;
  width: 100%;
}

.rent-buy-field-input--inline { flex-wrap: wrap; }
.rent-buy-field-input--inline input,
.rent-buy-field-input--inline select { flex: 1 1 100px; min-width: 100px; }

.rent-buy-field-suffix {
  font-size: 12.5px;
  color: var(--text-tertiary);
  padding: 0 14px;
  white-space: nowrap;
}

.rent-buy-results {
  margin-top: 24px;
}

.rent-buy-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

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

.rent-buy-summary-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-tertiary);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.rent-buy-summary-card:hover {
  border-color: var(--border-secondary);
  box-shadow: var(--shadow-card);
}

.rent-buy-summary-card--buy { border-color: var(--accent); background: var(--accent-soft); }
.rent-buy-summary-card--rent { border-color: var(--purple); background: var(--purple-soft); }
.rent-buy-summary-card--diff { border-color: var(--amber); background: #fff8eb; }

.rent-buy-summary-icon { font-size: 28px; }

.rent-buy-summary-content { display: flex; flex-direction: column; gap: 4px; }

.rent-buy-summary-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.rent-buy-summary-detail {
  font-size: 11.5px;
  color: var(--text-tertiary);
}

.rent-buy-summary-value {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.rent-buy-summary-card--buy .rent-buy-summary-value { color: var(--accent); }
.rent-buy-summary-card--rent .rent-buy-summary-value { color: var(--purple); }
.rent-buy-summary-card--diff .rent-buy-summary-value { color: var(--amber); }

.rent-buy-breakdown { margin-top: 24px; }

.rent-buy-breakdown h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-tertiary);
}

.rent-buy-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

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

.rent-buy-breakdown-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.rent-buy-breakdown-card h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-tertiary);
}

.rent-buy-cost-list { list-style: none; display: grid; gap: 8px; }

.rent-buy-cost-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.rent-buy-cost-list li:last-child { border-bottom: none; }

.rent-buy-cost-total {
  font-weight: 700;
  color: var(--text-primary);
  border-top: 1px solid var(--border-tertiary);
  padding-top: 10px;
  margin-top: 4px;
}

.rent-buy-cost-grand {
  font-weight: 800;
  font-size: 15px;
  color: var(--accent);
  border-top: 2px solid var(--accent);
  padding-top: 12px;
  margin-top: 8px;
}

.rent-buy-summary-card--rent .rent-buy-cost-grand { color: var(--purple); border-color: var(--purple); }

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

/* ============================================================ Commute cost calculator */
.commute-calculator {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.commute-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-tertiary);
}

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

.commute-group {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 20px;
}

.commute-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-tertiary);
}

.commute-fields { display: grid; gap: 14px; }

.commute-field { display: flex; flex-direction: column; gap: 6px; }

.commute-field label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.commute-field-input {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.commute-field-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.commute-field-prefix {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0 12px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.commute-field-input input,
.commute-field-input select {
  flex: 1;
  border: none;
  background: transparent;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text-primary);
  outline: none;
  width: 100%;
}

.commute-field-input--inline { flex-wrap: wrap; }
.commute-field-input--inline input,
.commute-field-input--inline select { flex: 1 1 100px; min-width: 100px; }

.commute-field-suffix {
  font-size: 12.5px;
  color: var(--text-tertiary);
  padding: 0 14px;
  white-space: nowrap;
}

.commute-results {
  margin-top: 24px;
}

.commute-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

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

.commute-summary-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-tertiary);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.commute-summary-card:hover {
  border-color: var(--border-secondary);
  box-shadow: var(--shadow-card);
}

.commute-summary-card--drive { border-color: var(--accent); background: var(--accent-soft); }
.commute-summary-card--carpool { border-color: var(--purple); background: var(--purple-soft); }
.commute-summary-card--transit { border-color: var(--green); background: var(--green-soft); }

.commute-summary-icon { font-size: 28px; }

.commute-summary-content { display: flex; flex-direction: column; gap: 4px; }

.commute-summary-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.commute-summary-detail {
  font-size: 11.5px;
  color: var(--text-tertiary);
}

.commute-summary-value {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.commute-summary-card--drive .commute-summary-value { color: var(--accent); }
.commute-summary-card--carpool .commute-summary-value { color: var(--purple); }
.commute-summary-card--transit .commute-summary-value { color: var(--green); }

.commute-breakdown { margin-top: 24px; }

.commute-breakdown h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-tertiary);
}

.commute-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

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

.commute-breakdown-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.commute-breakdown-card h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-tertiary);
}

.commute-cost-list { list-style: none; display: grid; gap: 8px; }

.commute-cost-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.commute-cost-subtotal {
  font-weight: 700;
  color: var(--text-primary);
  border-top: 1px solid var(--border-tertiary);
  padding-top: 10px;
  margin-top: 4px;
}

.commute-cost-grand {
  font-weight: 800;
  font-size: 15px;
  color: var(--accent);
  border-top: 2px solid var(--accent);
  padding-top: 12px;
  margin-top: 8px;
}

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

/* ============================================================ Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.theme-toggle:hover {
  background: var(--bg-secondary);
  border-color: var(--accent);
  transform: scale(1.05);
}
.theme-toggle:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}
.theme-toggle .theme-icon-sun,
.theme-toggle .theme-icon-moon {
  font-size: 18px;
  transition: opacity var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
  position: absolute;
}
.theme-toggle .theme-icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
.theme-toggle .theme-icon-moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}
.dark .theme-toggle .theme-icon-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}
.dark .theme-toggle .theme-icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* ============================================================ Language selector */
.language-selector {
  background: var(--bg-input);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm);
  padding: 6px 28px 6px 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235f6673' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.language-selector:hover {
  border-color: var(--accent);
}
.language-selector:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

@media (max-width: 640px) {
  .site-header-inner { gap: 10px; }
  .brand-copy > span { display: none; }
  .brand-copy strong { font-size: 15.5px; }
  .language-selector {
    padding: 4px 20px 4px 6px;
    font-size: 11px;
    background-position: right 6px center;
  }
  .theme-toggle { width: 32px; height: 32px; }
}

/* ============================================================ Retirement calculator */
.retirement-calculator {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.retirement-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-tertiary);
}

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

.retirement-group {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 20px;
}

.retirement-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-tertiary);
}

.retirement-fields { display: grid; gap: 14px; }

.retirement-field { display: flex; flex-direction: column; gap: 6px; }

.retirement-field label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.retirement-field-input {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.retirement-field-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.retirement-field-prefix {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0 12px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.retirement-field-input input,
.retirement-field-input select {
  flex: 1;
  border: none;
  background: transparent;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text-primary);
  outline: none;
  width: 100%;
}

.retirement-field-input--inline { flex-wrap: wrap; }
.retirement-field-input--inline input,
.retirement-field-input--inline select { flex: 1 1 100px; min-width: 100px; }

.retirement-field-suffix {
  font-size: 12.5px;
  color: var(--text-tertiary);
  padding: 0 14px;
  white-space: nowrap;
}

.retirement-results {
  margin-top: 24px;
}

.retirement-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

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

.retirement-summary-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-tertiary);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.retirement-summary-card:hover {
  border-color: var(--border-secondary);
  box-shadow: var(--shadow-card);
}

.retirement-summary-card--nest { border-color: var(--green); background: var(--green-soft); }
.retirement-summary-card--income { border-color: var(--accent); background: var(--accent-soft); }
.retirement-summary-card--gap { border-color: var(--amber); background: #fff8eb; }

.retirement-summary-icon { font-size: 28px; }

.retirement-summary-content { display: flex; flex-direction: column; gap: 4px; }

.retirement-summary-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.retirement-summary-detail {
  font-size: 11.5px;
  color: var(--text-tertiary);
}

.retirement-summary-value {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.retirement-summary-card--nest .retirement-summary-value { color: var(--green); }
.retirement-summary-card--income .retirement-summary-value { color: var(--accent); }
.retirement-summary-card--gap .retirement-summary-value { color: var(--amber); }

.retirement-breakdown { margin-top: 24px; }

.retirement-breakdown h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-tertiary);
}

.retirement-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

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

.retirement-breakdown-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.retirement-breakdown-card h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-tertiary);
}

.retirement-cost-list { list-style: none; display: grid; gap: 8px; }

.retirement-cost-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.retirement-cost-subtotal {
  font-weight: 700;
  color: var(--text-primary);
  border-top: 1px solid var(--border-tertiary);
  padding-top: 10px;
  margin-top: 4px;
}

.retirement-cost-grand {
  font-weight: 800;
  font-size: 15px;
  color: var(--accent);
  border-top: 2px solid var(--accent);
  padding-top: 12px;
  margin-top: 8px;
}

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

/* ============================================================ College calculator */
.college-calculator {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.college-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-tertiary);
}

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

.college-group {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 20px;
}

.college-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-tertiary);
}

.college-fields { display: grid; gap: 14px; }

.college-field { display: flex; flex-direction: column; gap: 6px; }

.college-field label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.college-field-input {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.college-field-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.college-field-prefix {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0 12px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.college-field-input input,
.college-field-input select,
.college-field-input textarea {
  flex: 1;
  border: none;
  background: transparent;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text-primary);
  outline: none;
  width: 100%;
}

.college-field-input--inline { flex-wrap: wrap; }
.college-field-input--inline input,
.college-field-input--inline select { flex: 1 1 100px; min-width: 100px; }

.college-field-suffix {
  font-size: 12.5px;
  color: var(--text-tertiary);
  padding: 0 14px;
  white-space: nowrap;
}

.college-select {
  background: var(--bg-input);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text-primary);
  outline: none;
  width: 100%;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.college-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.college-results {
  margin-top: 24px;
}

.college-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

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

.college-summary-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-tertiary);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.college-summary-card:hover {
  border-color: var(--border-secondary);
  box-shadow: var(--shadow-card);
}

.college-summary-card--total { border-color: var(--accent); background: var(--accent-soft); }
.college-summary-card--gap { border-color: var(--amber); background: #fff8eb; }
.college-summary-card--monthly { border-color: var(--green); background: var(--green-soft); }

.college-summary-icon { font-size: 28px; }

.college-summary-content { display: flex; flex-direction: column; gap: 4px; }

.college-summary-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.college-summary-detail {
  font-size: 11.5px;
  color: var(--text-tertiary);
}

.college-summary-value {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.college-summary-card--total .college-summary-value { color: var(--accent); }
.college-summary-card--gap .college-summary-value { color: var(--amber); }
.college-summary-card--monthly .college-summary-value { color: var(--green); }

.college-breakdown { margin-top: 24px; }

.college-breakdown h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-tertiary);
}

.college-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

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

.college-breakdown-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.college-breakdown-card h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-tertiary);
}

.college-cost-list { list-style: none; display: grid; gap: 8px; }

.college-cost-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.college-cost-subtotal {
  font-weight: 700;
  color: var(--text-primary);
  border-top: 1px solid var(--border-tertiary);
  padding-top: 10px;
  margin-top: 4px;
}

.college-cost-grand {
  font-weight: 800;
  font-size: 15px;
  color: var(--accent);
  border-top: 2px solid var(--accent);
  padding-top: 12px;
  margin-top: 8px;
}

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

/* ============================================================
   Animations & Transitions
   ============================================================ */

/* Keyframe animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

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

@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0.3); }
  50% { opacity: 1; transform: scale(1.05); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes countUp {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================================
   Transition Utilities
   ============================================================ */

.transition-fast {
  transition: all var(--duration-fast) var(--ease-out);
}

.transition-normal {
  transition: all var(--duration-normal) var(--ease-out);
}

.transition-slow {
  transition: all var(--duration-slow) var(--ease-out);
}

.transition-colors {
  transition: color var(--duration-fast) var(--ease-out),
              background-color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

.transition-transform {
  transition: transform var(--duration-normal) var(--ease-out);
}

.transition-all {
  transition: all var(--duration-normal) var(--ease-in-out);
}

/* ============================================================
   Entrance Animations
   ============================================================ */

.animate-fade-in {
  animation: fadeIn var(--duration-normal) var(--ease-out) forwards;
}

.animate-fade-in-up {
  animation: fadeInUp var(--duration-slow) var(--ease-out) forwards;
}

.animate-fade-in-down {
  animation: fadeInDown var(--duration-slow) var(--ease-out) forwards;
}

.animate-slide-in-left {
  animation: slideInLeft var(--duration-slow) var(--ease-out) forwards;
}

.animate-slide-in-right {
  animation: slideInRight var(--duration-slow) var(--ease-out) forwards;
}

.animate-scale-in {
  animation: scaleIn var(--duration-normal) var(--ease-bounce) forwards;
}

.animate-bounce-in {
  animation: bounceIn var(--duration-slower) var(--ease-bounce) forwards;
}

/* Staggered animation delays */
.stagger-1 { animation-delay: 0ms; }
.stagger-2 { animation-delay: 100ms; }
.stagger-3 { animation-delay: 200ms; }
.stagger-4 { animation-delay: 300ms; }
.stagger-5 { animation-delay: 400ms; }
.stagger-6 { animation-delay: 500ms; }
.stagger-7 { animation-delay: 600ms; }
.stagger-8 { animation-delay: 700ms; }

/* ============================================================
   Hover & Focus Effects
   ============================================================ */

.lift-on-hover {
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}

.lift-on-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.lift-on-hover:active {
  transform: translateY(-2px);
}

.scale-on-hover {
  transition: transform var(--duration-fast) var(--ease-out);
}

.scale-on-hover:hover {
  transform: scale(1.02);
}

.scale-on-hover:active {
  transform: scale(0.98);
}

.grow-on-hover {
  transition: transform var(--duration-normal) var(--ease-out);
}

.grow-on-hover:hover {
  transform: scale(1.05);
}

.underline-animate {
  position: relative;
}

.underline-animate::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width var(--duration-normal) var(--ease-out);
}

.underline-animate:hover::after {
  width: 100%;
}

/*** Button animations ***/
.btn {
  transition: all var(--duration-fast) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left var(--duration-slow) var(--ease-out);
}

.btn:hover::before {
  left: 100%;
}

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

/*** Card animations ***/
.card {
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.card:active {
  transform: translateY(-2px);
}

/*** Input animations ***/
.field-input {
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

.field-input:focus {
  box-shadow: var(--shadow-focus);
}

.field-input:focus + .field-label,
.field-input:not(:placeholder-shown) + .field-label {
  transform: translateY(-1.5rem) scale(0.85);
  color: var(--accent);
}

/*** Number counting animation ***/
.counter {
  display: inline-block;
}

.counter.animating {
  animation: countUp var(--duration-slow) var(--ease-out);
}

/*** Loading states ***/
.skeleton {
  background: linear-gradient(90deg,
    var(--bg-secondary) 25%,
    var(--bg-tertiary) 50%,
    var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-tertiary);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

/*** Page transitions ***/
.page-enter {
  animation: fadeIn var(--duration-normal) var(--ease-out);
}

.page-exit {
  animation: fadeIn var(--duration-fast) var(--ease-in) reverse;
}

/*** Reduced motion ***/
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   Scroll Animations (IntersectionObserver)
   ============================================================ */

.scroll-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

.scroll-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-reveal-left {
  opacity: 0;
  transform: translateX(-30px);
}

.scroll-reveal-right {
  opacity: 0;
  transform: translateX(30px);
}

.scroll-reveal-left.visible,
.scroll-reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/*** Staggered list animations ***/
.stagger-list > * {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp var(--duration-slow) var(--ease-out) forwards;
}

.stagger-list > *:nth-child(1) { animation-delay: 0ms; }
.stagger-list > *:nth-child(2) { animation-delay: 80ms; }
.stagger-list > *:nth-child(3) { animation-delay: 160ms; }
.stagger-list > *:nth-child(4) { animation-delay: 240ms; }
.stagger-list > *:nth-child(5) { animation-delay: 320ms; }
.stagger-list > *:nth-child(6) { animation-delay: 400ms; }
.stagger-list > *:nth-child(7) { animation-delay: 480ms; }
.stagger-list > *:nth-child(8) { animation-delay: 560ms; }

/* Print styles - disable animations */
@media print {
  *,
  *::before,
  *::after {
    animation-duration: 0 !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0 !important;
  }
}
