html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #f5f5f5;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.85)),
    url('hoover_institution.png');
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  color: #333;
  line-height: 1.5;
}

html {
  font-size: 14px;
}

/* PAGE SUB-HERO */
.page-sub-hero {
  background: #7A1522;
  background-image:
    linear-gradient(135deg, rgba(122, 21, 34, 0.88) 0%, rgba(140, 21, 21, 0.85) 100%),
    url('hoover_institution.png');
  background-size: cover;
  background-position: center;
  color: #fff;
  padding: 2rem 2rem 2.25rem;
}
.page-sub-hero-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.page-sub-hero-breadcrumb {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 0.5rem;
}
.page-sub-hero-breadcrumb a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color 0.2s;
}
.page-sub-hero-breadcrumb a:hover {
  color: rgba(255,255,255,0.85);
}
.page-sub-hero h1 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.35rem;
}
.page-sub-hero-desc {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.75);
  margin: 0;
}

/* TOP NAVBAR */
.top-nav {
  background-color: #3a3a3a;
  padding: 12px 0;
  border-bottom: 2px solid rgba(255,255,255,0.15);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 9999;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* LEFT SIDE: Logo + Title */
.nav-left {
  display: flex;
  align-items: center;
  user-select: none;
  gap: 8px;
}

.nav-home-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.nav-home-link:hover {
  opacity: 0.85;
}

.nav-logo {
  height: 32px;
  width: auto;
}

.nav-title {
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

/* RIGHT SIDE: Links */
.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
}

.nav-links a {
  color: #ffffff;
  text-decoration: none;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  position: relative;
  transition: background 0.25s ease, color 0.25s ease;
}

/* HOVER BACKGROUND EFFECT */
.nav-links a:hover {
  background-color: rgba(255,255,255,0.10);
}

/* MAROON UNDERLINE EFFECT (HOVER + ACTIVE) */
.nav-links a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -3px;
  width: 0;
  height: 3px;
  background: #8C1D14;
  transform: translateX(-50%);
  transition: width 0.25s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 70%;
}

/* Leaflet controls - push below navbar */
.leaflet-top.leaflet-left {
  margin-top: 70px;
}

/* About the Authors page */
.authors-page .page-main {
  max-width: 1180px;
  margin: 32px auto;
  padding: 0 48px;
}

.page-hero-card {
  background: #ffffff;
  border-radius: 8px;
  padding: 24px 28px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  margin-bottom: 28px;
}

.page-hero-card h1 {
  font-size: 1.9rem;
  margin-bottom: 8px;
}

.page-hero-card p {
  font-size: 1rem;
  margin-bottom: 0;
  line-height: 1.6;
  color: #555;
}

.authors-grid-card {
  background: #ffffff;
  border-radius: 8px;
  padding: 24px 28px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
}

.author-card {
  flex: 1 1 320px;
  max-width: 580px;
}

.author-photo {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin-bottom: 16px;
  filter: grayscale(100%);
}

.author-card h2 {
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.author-role {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: #555;
}

.author-card p {
  margin: 0;
  line-height: 1.6;
  color: #555;
}

.author-card > p:last-child {
  margin-bottom: 18px;
}

/* Stack nicely on small screens */
@media (max-width: 880px) {
  .authors-page .page-main {
    max-width: none;
    padding: 0 16px;
  }

  .authors-grid-card {
    flex-direction: column;
  }

  .author-card {
    max-width: none;
  }
}

/* Footer Styles */
.site-footer {
  position: relative;
  background-color: #3a3a3a;
  color: white;
  padding: 12px 0;
  margin-top: auto;
  width: 100%;
  overflow: hidden;
  flex-shrink: 0;
  border-top: 2px solid rgba(255,255,255,0.15);
  box-shadow: 0 -1px 3px rgba(0,0,0,0.1);
}

.footer-content {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-logo {
  height: 32px;
  width: auto;
}

.footer-title {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.footer-nav {
  display: flex;
  align-items: center;
  gap: 0;
}

.footer-nav a {
  color: white;
  text-decoration: none;
  font-size: 13px;
  padding: 6px 14px;
  transition: opacity 0.2s;
}

.footer-nav a:hover {
  opacity: 0.75;
  text-decoration: none;
}

.footer-bottom {
  text-align: center;
  margin-top: 8px;
  font-size: 11px;
  opacity: 0.6;
  padding: 0 16px;
}

/* Stack nicely on small screens */
@media (max-width: 880px) {
  .footer-grid-card {
    flex-direction: column;
  }

  .footer-card {
    max-width: none;
  }
}

main,
.page-content {
  flex: 1 0 auto;
}

.page-wrapper {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}

.container {
  max-width: 1400px;
  margin: 40px auto 0.75rem auto;
  padding: 0.75rem;
  background-color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.15rem;
}

.hoover-logo {
  height: 32px;
  width: auto;
}

h1 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

h2 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

h3 {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: #555;
}

.citation {
  font-size: 0.75rem;
  margin: 0.2rem 0 0.8rem 0;
  line-height: 1.3;
  color: #666;
}

/* CHANGED: removed padding and margin-bottom so district.html's !important override works cleanly */
.map-card {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 0;
  margin-bottom: 0;
  background: white;
}

.stats-header-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 16px 0 8px 0;
}

.stats-header-row h3 {
  font-size: 1.1rem;
  margin: 0;
}

.stats-selection-label span + span {
  margin-left: 16px;
}

.stats-selection-label span {
  font-size: 0.9rem;
  color: #555;
}

.hero-map {
  height: 500px;
  border-radius: 4px;
}

.statistics-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

@media (max-width: 900px) {
  .statistics-container {
    display: block;
  }

  .statistics-container .stats-card {
    margin-bottom: 16px;
  }

  .stats-header-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats-selection-label {
    margin-top: 8px;
    font-size: 0.85rem;
  }

  .stats-selection-label span + span {
    margin-left: 0;
    margin-top: 4px;
    display: block;
  }
}

.card,
.section-card {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 1rem;
  background: white;
}

/* CHANGED: removed height: 100% so cards size to content, not fill grid row */
.stats-card {
  display: flex;
  flex-direction: column;
}

.stats-card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tool-summary-card {
  border: 1px solid #ddd;
  border-top: 1px solid #eee;
  border-radius: 6px;
  padding: 1.25rem;
  background: white;
  margin-top: 20px;
}

select, input[type="text"] {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.95rem;
}

/* Custom Dropdown Styles */
.custom-dropdown {
  position: relative;
  width: 100%;
}

.custom-dropdown-input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
  box-sizing: border-box;
}

.custom-dropdown-input:focus {
  outline: none;
  border-color: #666;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
}

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

.custom-dropdown-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 6px 6px;
  max-height: 250px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.custom-dropdown-list.active {
  display: block;
  animation: fadeInDropdown 0.15s ease-out;
}

.custom-dropdown-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  color: #333;
  border-bottom: 1px solid #f0f0f0;
}

.custom-dropdown-item:hover {
  background-color: #f5f5f5;
}

.custom-dropdown-item.highlighted {
  background-color: #e8e8e8;
}

.custom-dropdown-item.selected {
  background-color: #8C1515;
  color: white;
}

.statistics-container .card canvas {
  max-width: 100% !important;
  height: 350px !important;
  width: 100% !important;
  display: block;
}

.statistics-container .card div[style*="overflow-x"] {
  max-width: 100%;
  width: 100%;
}

.stats-table-wrapper {
  overflow-x: auto;
  font-size: 0.6rem;
  margin-top: 0.3rem;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  border: 1px solid #ddd;
}

.stats-table thead {
  font-weight: bold;
  background-color: #7A1522;
  color: white;
}

.stats-table th {
  text-align: center;
  padding: 0.4rem 0.3rem;
  vertical-align: middle;
  border: 1px solid #ddd;
  white-space: normal;
  word-wrap: break-word;
}

.stats-table td {
  padding: 0.3rem 0.4rem;
  vertical-align: middle;
  border: 1px solid #ddd;
  white-space: nowrap;
}

.stats-table tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

.stats-table tbody tr:last-child {
  font-weight: bold;
  background-color: #f0f0f0;
}

.statistics-container table {
  font-size: 0.6rem !important;
  table-layout: fixed;
  width: 100%;
}

.statistics-container table th {
  padding: 0.4rem 0.2rem !important;
  vertical-align: middle;
  background-color: #7A1522 !important;
  color: white !important;
  text-align: left !important;
  font-weight: bold !important;
}

.statistics-container table td {
  padding: 0.4rem 0.2rem !important;
  vertical-align: middle;
}

.statistics-container table th:first-child,
.statistics-container table tbody tr td:first-child {
  text-align: center !important;
}

#stateSummaryWrapper,
#districtSummaryWrapper {
  min-height: 300px;
  width: 100%;
}

.explainer-box {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 1rem;
  margin: 1.5rem 0;
  background: white;
}

.explainer-box h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 0.4rem;
}

.explainer-box p {
  line-height: 1.6;
}

.card p {
  line-height: 1.6;
}

/* Password Modal */
.password-modal {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.password-modal.hidden {
  display: none;
}


.password-modal-content {
  background: white;
  padding: 3rem;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  text-align: center;
  max-width: 400px;
  width: 90%;
}

.password-modal-content h2 {
  margin: 0 0 1rem 0;
  color: #333;
  font-size: 1.5rem;
}

.password-modal-content p {
  color: #666;
  margin: 0 0 1.5rem 0;
  font-size: 0.95rem;
}

.password-modal-content input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  margin-bottom: 1.5rem;
  box-sizing: border-box;
}

.password-modal-content input:focus {
  outline: none;
  border-color: #8C1515;
  box-shadow: 0 0 0 3px rgba(140, 21, 21, 0.1);
}

.password-modal-content button {
  width: 100%;
  padding: 0.75rem;
  background: #8C1515;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.password-modal-content button:hover {
  background: #6d0f0f;
}

.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background-color: #7A1522;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  transition: opacity 0.3s ease, background-color 0.3s ease;
  z-index: 999;
  opacity: 0;
}

.back-to-top.show {
  display: flex;
  opacity: 1;
}

.back-to-top:hover {
  background-color: #8C1515;
}

.section-wrapper {
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 1));
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.toc-container {
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #7A1522 0%, #8C1515 100%);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 1.5rem;
  flex-shrink: 0;
}

/* Two-column layout for methodology page */
.methodology-layout {
  display: flex;
  align-items: flex-start;
  gap: 40px;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
  overflow: visible;
}

/* Left sidebar: TOC column */
#toc-column {
  flex: 0 0 260px;
  overflow: visible;
  position: sticky;
  top: 90px;
  align-self: flex-start;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  z-index: 5;
}

/* Right column: Main content */
#methodology-main {
  flex: 1 1 auto;
  min-width: 0;
}

/* Tablet: Stack vertically, TOC at top */
@media (max-width: 1024px) {
  .methodology-layout {
    flex-direction: column;
  }

  #toc-column {
    flex: none;
    position: relative;
    top: 0;
    max-height: none;
    overflow: visible;
    margin-bottom: 2rem;
  }

  .methodology-content,
  .content-area {
    padding-left: 0;
  }
}

@media (max-width: 768px) {
  .methodology-section,
  .methodology-section {
    padding: 1.5rem;
  }

  .state-methodology-section,
  .state-selector-section {
    padding: 1.5rem;
  }

  .methodology-section h2 {
    font-size: 1.3rem;
  }

  .toc-container,
  #table-of-contents {
    padding: 1rem;
  }

  .state-selector,
  select#state-selector {
    max-width: 100%;
  }
}

/* Header card styling */
.header-card {
  background: white;
  border: 1px solid #e4e4e4;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
}

.header-card h1 {
  margin-top: 0;
  font-size: 1.75rem;
  color: #333;
}

.header-card .citation {
  margin-bottom: 0;
  color: #666;
}

/* Back to Methodology Button */
.back-to-methodology-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #7A1522 0%, #8C1515 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(140, 21, 21, 0.3);
  margin-bottom: 1.5rem;
}

.back-to-methodology-btn:hover {
  background: linear-gradient(135deg, #6F1010 0%, #7A1522 100%);
  transform: translateX(-4px);
  box-shadow: 0 6px 16px rgba(140, 21, 21, 0.4);
}

.back-to-methodology-btn:active {
  background: linear-gradient(135deg, #5a0808 0%, #6F1010 100%);
}

.toc-header {
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0 0 1.25rem 0;
  padding-bottom: 1rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
  justify-content: space-between;
}

.toc-header:hover {
  color: rgba(255, 255, 255, 0.9);
}

.toc-toggle {
  font-size: 1.2rem;
  transition: transform 0.25s ease;
  transform: rotate(0deg);
}

.toc-header.collapsed .toc-toggle {
  transform: rotate(-90deg);
}

#toc-body {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.25s ease, opacity 0.25s ease;
}

#toc-card.toc-open #toc-body {
  max-height: 800px;
  opacity: 1;
}

.toc-content {
  max-height: 800px;
  overflow-y: auto;
}

.toc-content ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-content li {
  margin: 0;
  padding: 0;
}

.toc-content a {
  display: block;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: 0.75rem 1rem;
  margin-bottom: 0.25rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.toc-content a:last-child {
  margin-bottom: 0;
}

.toc-content a:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  transform: translateX(4px);
  border-left-color: white;
}

.toc-content a.active {
  background: rgba(255, 255, 255, 0.25);
  color: white;
  font-weight: 700;
  border-left-color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.toc-item.nested {
  padding-left: 2rem;
  font-size: 0.85rem;
}

/* Tab container spacing */
.tab-container {
  margin-top: 10px !important;
}

/* Header variants spacing */
header {
  margin-bottom: 0 !important;
}
.hero,
.page-title {
  margin-bottom: 10px !important;
}

/* Collapsible section button */
.collapsible-section {
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  color: #333;
  transition: color 0.2s ease;
}

.collapsible-section:hover {
  color: #7a0e0e;
}

/* Section subtitle under comparison heading */
.section-subtitle {
  margin: 4px 0 16px 0;
  font-size: 0.9rem;
  color: #6b7280;
}

/* Map helper text */
.map-helper-text {
  margin: 4px 0 8px 0;
  font-size: 0.85rem;
  color: #6b7280;
}

/* KPI pill styling */
.kpi-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.kpi-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 6px 18px;
  border-radius: 999px;
  background: #f3f4f6;
  font-size: 0.85rem;
}

.kpi-label {
  font-weight: 500;
  color: #4b5563;
}

.kpi-value {
  font-weight: 600;
  color: #0f1419;
}

/* Reusable section divider and vertical spacing for District Lookup page */
.section-divider {
  border: none;
  border-bottom: 1px solid #d9d9d9;
  margin: 40px 0;
}

.page-section {
  margin-top: 24px;
}

.comparison-section {
  margin-top: 30px !important;
}

.chart-and-tables-divider {
  margin-top: 20px;
  margin-bottom: 20px;
  border-top: 1px solid #e0e0e0;
}

.tool-summary {
  margin-top: 40px !important;
}

.sources-box {
  margin-top: 15px;
  padding-left: 10px;
}

/* CHANGED: removed padding-top so district.html's !important override works cleanly */
.stats-panel {
  padding-top: 0;
}

/* Tighten comparison section spacing */
.comparison-section {
  margin-top: 24px !important;
}

/* 3. Status labels alignment */
.stats-selection-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #6b7280;
}

.stats-selection-label span {
  font-size: 0.9rem;
  color: #6b7280;
}

.stats-selection-label strong {
  color: #333;
  font-weight: 500;
}

/* 4. Table spacing polish */
.statistics-container table td,
.statistics-container table th {
  padding: 8px 10px !important;
}

#stateSummaryWrapper,
#districtSummaryWrapper {
  margin-top: 1.2rem;
}

#stateSummaryWrapper h3,
#districtSummaryWrapper h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

/* 5. Tool Summary / Sources block separation */
.tool-summary-card {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 1.5rem;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-top: 32px !important;
}

@media (min-width: 992px) {
  .page-section {
    margin-top: 32px;
  }

  .section-divider {
    margin: 32px 0;
  }

  .stats-selection-label {
    flex-direction: row;
    gap: 16px;
  }
}

/* Content wrapper for hero and dashboard cards */
.main-content {
  max-width: 1200px;
  margin: 24px auto 40px;
  padding: 0 20px;
  box-sizing: border-box;
}

/* Sensitivity page content wrapper */
.sensitivity-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* Standardized hero section */
.page-hero {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  padding: 20px 24px;
  margin-bottom: 24px;
  width: 100%;
  box-sizing: border-box;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 4px 0;
}

.page-subtitle {
  font-size: 1rem;
  color: #555555;
  margin: 0 0 4px 0;
}

.page-meta {
  font-size: 0.9rem;
  color: #777777;
  margin: 0;
}

/* Full-width content card for tabs */
.content-card {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  padding: 20px 24px;
  margin-bottom: 32px;
}

/* Container for both cards */
.results-row {
  display: flex;
  justify-content: center;
  gap: 24px;
  max-width: 1030px; /* 700 + 330 */
  margin: 0 auto 32px;
}

/* Base card styling */
.results-card {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

/* LEFT CARD (National Stress-Test Chart) */
.results-card-left {
  flex: 0 0 330px;
  max-width: 330px;
}

/* RIGHT CARD (State Heatmap) */
.results-card-right {
  flex: 0 0 700px;
  max-width: 700px;
}

/* Responsive stacking for tablets/phones */
@media (max-width: 1150px) {
  .results-row {
    flex-direction: column;
    align-items: center;
    max-width: 700px;
  }

  .results-card-left,
  .results-card-right {
    flex: 0 0 auto;
    width: 100%;
    max-width: 700px;
  }
}

@media (max-width: 900px) {
  .results-row {
    max-width: 100%;
  }

  .results-card-left,
  .results-card-right {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
  }
}

/* Details/Summary collapsible styling */
details > summary {
  cursor: pointer;
  user-select: none;
}

details > summary::before {
  content: '▼';
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.2s ease;
  font-size: 0.85rem;
}

details[open] > summary::before {
  transform: rotate(-90deg);
}

/* ========================================
   DROPDOWN NAVIGATION CSS
   ADDED FOR PENSION ANALYSIS DROPDOWN
   ======================================== */

/* Dropdown container */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

/* Dropdown trigger */
.nav-dropdown-trigger {
  color: #ffffff;
  text-decoration: none;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  position: relative;
  transition: background 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
}

/* Arrow */
.dropdown-arrow {
  font-size: 9px;
  transition: transform 0.25s ease;
}

/* Hover effect */
.nav-dropdown-trigger:hover {
  background-color: rgba(255,255,255,0.10);
}

/* Underline */
.nav-dropdown-trigger::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -3px;
  width: 0;
  height: 3px;
  background: #8C1D14;
  transform: translateX(-50%);
  transition: width 0.25s ease;
}

.nav-dropdown:hover .nav-dropdown-trigger::after {
  width: 70%;
}

/* Rotate arrow */
.nav-dropdown:hover .dropdown-arrow {
  transform: rotate(180deg);
}

/* Dropdown menu */
.nav-dropdown-menu {
  position: absolute;
  top: calc(100%);
  left: 0;
  background: #3a3a3a;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  min-width: 220px;
  display: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  z-index: 10000;
}

/* Show on hover */
.nav-dropdown:hover .nav-dropdown-menu {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Menu items */
.nav-dropdown-menu a {
  display: block;
  color: #ffffff;
  text-decoration: none;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s ease, padding-left 0.2s ease;
  border-left: 3px solid transparent;
}

/* Remove underline from dropdown items */
.nav-dropdown-menu a::after {
  display: none !important;
}

/* Hover on items */
.nav-dropdown-menu a:hover {
  background: rgba(255,255,255,0.10);
  border-left-color: #8C1D14;
  padding-left: 22px;
}

/* Active page */
.nav-dropdown-menu a.active {
  background: rgba(140, 29, 20, 0.15);
  border-left-color: #8C1D14;
}

/* Rounded corners */
.nav-dropdown-menu a:first-child {
  border-radius: 6px 6px 0 0;
}

.nav-dropdown-menu a:last-child {
  border-radius: 0 0 6px 6px;
}

/* Mobile */
@media (max-width: 768px) {
  .nav-dropdown {
    width: 100%;
  }

  .nav-dropdown-trigger {
    width: 100%;
    justify-content: space-between;
    padding: 12px 18px;
  }

  .nav-dropdown-menu {
    position: static;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    box-shadow: none;
    border: none;
    border-left: 3px solid #8C1D14;
    margin-left: 18px;
    margin-top: 4px;
    background: rgba(255,255,255,0.05);
  }

  .nav-dropdown.mobile-open .nav-dropdown-menu {
    display: block;
    max-height: 400px;
  }

  .nav-dropdown-menu a {
    padding: 10px 18px;
    font-size: 13px;
  }
}

/* About section paragraph spacing */
.about-box p {
  margin-bottom: 1.5rem !important;
  line-height: 1.8;
  color: #374151;
}

.about-box p:last-child {
  margin-bottom: 0 !important;
}

/* ============================================================
   MOBILE NAVIGATION — hamburger button (hidden on desktop)
   ============================================================ */
.nav-hamburger {
  display: none;
}

@media (max-width: 768px) {

  /* --- Hamburger button --- */
  .nav-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    margin-left: 12px;
  }

  .nav-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  .nav-hamburger--open span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }

  .nav-hamburger--open span:nth-child(2) {
    opacity: 0;
  }

  .nav-hamburger--open span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }

  /* --- Nav inner needs position:relative for absolute dropdown --- */
  .nav-inner {
    position: relative;
    flex-wrap: wrap;
  }

  /* --- Shrink the title text so logo + title + hamburger fit --- */
  .nav-title {
    font-size: 12px;
    white-space: normal;
    max-width: 180px;
    line-height: 1.3;
  }

  .nav-logo {
    height: 28px;
  }

  /* --- Hide nav links by default on mobile --- */
  .nav-links {
    display: none !important;
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    background: #3a3a3a;
    flex-direction: column;
    padding: 8px 0 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    z-index: 9998;
    border-top: 1px solid rgba(255,255,255,0.12);
  }

  /* --- Show nav links when hamburger is open --- */
  .nav-inner.nav-open .nav-links {
    display: flex !important;
  }

  /* --- Full-width links, no underline animation --- */
  .nav-links > a,
  .nav-links .nav-dropdown-trigger {
    padding: 12px 20px;
    border-radius: 0;
    width: 100%;
    box-sizing: border-box;
    font-size: 15px;
  }

  .nav-links a::after {
    display: none;
  }

  /* ============================================================
     GENERAL PAGE CONTENT — mobile adjustments
     ============================================================ */

  /* Reduce page wrapper padding */
  .page-wrapper {
    padding: 0 12px;
    margin: 20px auto;
  }

  /* Container cards */
  .container {
    margin: 16px auto;
    padding: 0.5rem;
  }

  /* Stats/summary grids — single column */
  .statistics-container {
    grid-template-columns: 1fr !important;
  }

  /* Generic two-column grids — stack */
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns: repeat(2"] {
    grid-template-columns: 1fr !important;
  }

  /* Map height reduction */
  .hero-map {
    height: 320px;
  }

  /* Section headings */
  .stats-header-row {
    flex-direction: column;
    gap: 8px;
  }

  /* Footer — stack on mobile */
  .footer-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .footer-title {
    white-space: normal;
    font-size: 12px;
  }

  .footer-nav {
    flex-wrap: wrap;
  }

  .footer-nav a {
    font-size: 12px;
    padding: 4px 10px;
  }
}

/* ── iOS Safari auto-zoom prevention ──────────────────────────────────────
   Safari zooms the viewport whenever a focused input/select has font-size
   below 16px. Our root font-size is 14px, so 1rem = 14px triggers zoom.
   Force 16px on all interactive elements on mobile — desktop unaffected.
───────────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  select,
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="search"],
  input[type="tel"],
  textarea {
    font-size: 16px !important;
  }
}