/* === Login Overlay === */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #002677 0%, #1E3D6A 50%, #0166F5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-overlay.hidden { display: none; }
.login-card {
  background: #fff;
  border-radius: 14px;
  padding: 40px 36px 32px;
  width: 380px;
  max-width: 92vw;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  text-align: center;
}
.login-card svg { margin-bottom: 16px; }
.login-card h2 {
  font-size: 1.4rem;
  color: #002677;
  margin-bottom: 4px;
}
.login-subtitle {
  font-size: .82rem;
  color: #666;
  margin-bottom: 24px;
}
.login-card form { text-align: left; }
.login-card label {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  color: #444;
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: 4px;
  margin-top: 14px;
}
.login-card input[type="text"],
.login-card input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #D8D8D8;
  border-radius: 6px;
  font-size: .9rem;
  transition: border-color .15s;
}
.login-card input:focus {
  outline: none;
  border-color: #0166F5;
  box-shadow: 0 0 0 3px rgba(1,102,245,.15);
}
.login-btn {
  width: 100%;
  padding: 12px;
  margin-top: 20px;
  border: none;
  border-radius: 6px;
  background: #0166F5;
  color: #fff;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.login-btn:hover { background: #002677; }
.login-error {
  color: #CC0000;
  font-size: .8rem;
  margin-top: 10px;
  min-height: 1.2em;
  text-align: center;
}

/* === Goals Tab === */
.goals-full {
  height: 100%;
  overflow-y: auto;
  padding: 20px 28px;
  background: var(--uhc-gray);
}
.goals-header {
  text-align: center;
  margin-bottom: 24px;
}
.goals-header h2 {
  font-size: 1.3rem;
  color: var(--uhc-blue);
  margin-bottom: 6px;
}
.goals-header p {
  font-size: .85rem;
  color: #555;
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.5;
}
.goals-section {
  margin-bottom: 28px;
}
.goals-section h3 {
  font-size: 1rem;
  color: var(--uhc-navy);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--uhc-light-blue);
}
.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.goal-card {
  background: #fff;
  border-radius: 8px;
  padding: 16px 18px;
  border-left: 4px solid var(--uhc-ribbon);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.goal-card.accent-orange { border-left-color: var(--uhc-orange); }
.goal-card.accent-navy { border-left-color: var(--uhc-navy); }
.goal-card h4 {
  font-size: .88rem;
  color: var(--uhc-blue);
  margin-bottom: 6px;
}
.goal-card p {
  font-size: .8rem;
  color: #444;
  line-height: 1.5;
  margin: 0;
}
.big5-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
.big5-card {
  background: #fff;
  border-radius: 10px;
  padding: 18px 14px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  border-top: 4px solid var(--uhc-ribbon);
}
.big5-card .big5-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--uhc-blue);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 10px;
}
.big5-card h4 {
  font-size: .82rem;
  color: var(--uhc-blue);
  margin-bottom: 6px;
  line-height: 1.3;
}
.big5-card p {
  font-size: .74rem;
  color: #555;
  line-height: 1.4;
}
.table-stakes {
  background: #fff;
  border-radius: 8px;
  padding: 14px 20px;
  border-left: 4px solid var(--uhc-orange);
  font-size: .84rem;
  color: #333;
  line-height: 1.5;
}
.table-stakes strong { color: var(--uhc-blue); }
.vision-mission-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.vm-card {
  background: #fff;
  border-radius: 10px;
  padding: 22px 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  text-align: center;
}
.vm-card h4 {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--uhc-ribbon);
  margin-bottom: 8px;
}
.vm-card p {
  font-size: .88rem;
  color: #333;
  line-height: 1.55;
  font-style: italic;
}
.customers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.customer-card {
  background: #fff;
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.customer-card h4 {
  font-size: .82rem;
  color: var(--uhc-blue);
  margin-bottom: 4px;
}
.customer-card p {
  font-size: .76rem;
  color: #555;
  line-height: 1.4;
}
@media (max-width: 900px) {
  .big5-grid { grid-template-columns: repeat(2, 1fr); }
  .vision-mission-row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .big5-grid { grid-template-columns: 1fr; }
  .goals-full { padding: 14px 12px; }
}

/* === Tenable Issue Cards === */
.tenable-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #FFF3F0;
  border: 1px solid #FFCCC2;
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 14px;
  font-size: .84rem;
  color: #333;
}
.tenable-severity {
  display: inline-block;
  background: #CC0000;
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: .04em;
  white-space: nowrap;
  flex-shrink: 0;
}
.tenable-card {
  border-left-color: #CC0000 !important;
}
.tenable-card p {
  margin-bottom: 6px;
}
.tenable-card p strong {
  color: #002677;
}

/* === UHC Brand Tokens === */
:root {
  --uhc-blue: #002677;
  --uhc-ribbon: #0166F5;
  --uhc-light-blue: #CCE0FC;
  --uhc-navy: #1E3D6A;
  --uhc-orange: #FF612B;
  --uhc-white: #FFFFFF;
  --uhc-gray: #F4F4F4;
  --uhc-border: #D8D8D8;
  --sidebar-width: 340px;
  --header-height: 64px;
  --tab-height: 44px;
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; color: #222; background: var(--uhc-gray); }

/* === Header === */
.uhc-header {
  height: var(--header-height);
  background: var(--uhc-blue);
  color: var(--uhc-white);
  display: flex;
  align-items: center;
  padding: 0 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  position: relative;
  z-index: 10;
}
.header-inner { display: flex; align-items: center; width: 100%; gap: 16px; }
.header-logo { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.header-logo h1 { font-size: 1.2rem; font-weight: 600; letter-spacing: -.02em; }
.header-subtitle { font-size: .78rem; opacity: .75; margin-top: 1px; }

/* === Auth Bar === */
.auth-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.auth-status {
  font-size: .72rem;
  padding: 3px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.12);
  white-space: nowrap;
}
.auth-status.ok { background: rgba(76,175,80,.3); }
.auth-input {
  width: 180px;
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 4px;
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: .75rem;
}
.auth-input::placeholder { color: rgba(255,255,255,.5); }
.auth-btn {
  padding: 4px 12px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 4px;
  background: transparent;
  color: #fff;
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.auth-btn:hover { background: rgba(255,255,255,.15); }
.auth-btn-oauth { background: var(--uhc-ribbon); border-color: var(--uhc-ribbon); }
.auth-btn-oauth:hover { background: #0050cc; }
.auth-btn-signout { background: rgba(255,97,43,.6); border-color: var(--uhc-orange); }
.auth-divider { font-size: .7rem; opacity: .5; }

/* === Tab Bar === */
.tab-bar {
  height: var(--tab-height);
  background: var(--uhc-navy);
  display: flex;
  align-items: stretch;
  padding: 0 12px;
  gap: 2px;
  overflow-x: auto;
  position: relative;
  z-index: 9;
}
.tab-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,.7);
  font-size: .82rem;
  font-weight: 500;
  padding: 0 18px;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color .2s, border-color .2s, background .2s;
}
.tab-btn:hover { color: #fff; background: rgba(255,255,255,.07); }
.tab-btn.active {
  color: #fff;
  border-bottom-color: var(--uhc-orange);
  background: rgba(255,255,255,.1);
}

/* === Main Content === */
.main-content {
  height: calc(100vh - var(--header-height) - var(--tab-height));
  position: relative;
}
.tab-panel {
  display: none;
  position: absolute;
  inset: 0;
}
.tab-panel.active { display: block; }

.panel-split {
  display: flex;
  height: 100%;
}

/* === Sidebar === */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--uhc-white);
  border-right: 1px solid var(--uhc-border);
  padding: 20px;
  overflow-y: auto;
}
.sidebar h2 {
  font-size: 1.05rem;
  color: var(--uhc-blue);
  margin-bottom: 6px;
}
.solution-tag {
  display: inline-block;
  background: var(--uhc-light-blue);
  color: var(--uhc-blue);
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  margin-bottom: 10px;
}
.sidebar p { font-size: .85rem; color: #444; line-height: 1.5; margin-bottom: 12px; }

/* === Live Tool Sections === */
.live-tool {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 2px solid var(--uhc-light-blue);
}
.live-tool h4 {
  font-size: .78rem;
  color: var(--uhc-ribbon);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 4px;
}
.live-tool .tool-desc {
  font-size: .76rem;
  color: #666;
  margin-bottom: 8px;
  line-height: 1.4;
}
.tool-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--uhc-border);
  border-radius: 5px;
  font-size: .82rem;
  margin-bottom: 6px;
}
.tool-btn {
  width: 100%;
  padding: 7px;
  border: none;
  border-radius: 5px;
  background: var(--uhc-ribbon);
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.tool-btn:hover:not(:disabled) { background: var(--uhc-blue); }
.tool-btn:disabled { opacity: .4; cursor: not-allowed; }
.tool-result {
  margin-top: 8px;
  font-size: .78rem;
  color: #444;
  line-height: 1.5;
  min-height: 20px;
  max-height: 55vh;
  overflow-y: auto;
}
.tool-result .res-label { color: #666; }
.tool-result .res-value { font-weight: 600; color: var(--uhc-blue); }
.tool-result.error { color: #CC0000; }
.tool-result.loading { color: var(--uhc-ribbon); font-style: italic; }

/* === Map Container === */
.map-container {
  flex: 1;
  position: relative;
  background: #e8e8e8;
}

/* === Overview Full Layout === */
.overview-full {
  height: 100%;
  overflow: hidden;
  padding: 14px 24px 10px;
  background: var(--uhc-gray);
  display: flex;
  flex-direction: column;
}
.overview-intro {
  text-align: center;
  flex-shrink: 0;
  margin-bottom: 12px;
}
.overview-intro h2 {
  font-size: 1.15rem;
  color: var(--uhc-blue);
  margin-bottom: 3px;
}
.overview-intro p {
  font-size: .82rem;
  color: #555;
  line-height: 1.45;
  max-width: 720px;
  margin: 0 auto;
}
.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr 1fr;
  gap: 12px;
  flex: 1;
  min-height: 0;
}
.solution-card {
  background: var(--uhc-white);
  border-radius: 8px;
  border-left: 4px solid var(--uhc-ribbon);
  padding: 14px 16px;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}
.solution-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,.1);
}
.solution-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.problem-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.solution-card-header h3 {
  font-size: .9rem;
  color: var(--uhc-blue);
  margin: 0;
}
.solution-card .solution-tag { margin: 0; font-size: .68rem; padding: 2px 8px; }
.solution-card .card-summary {
  font-size: .8rem;
  color: #444;
  line-height: 1.45;
  margin: 0;
  flex: 1;
}
.solution-card .card-read-more {
  font-size: .74rem;
  font-weight: 600;
  color: var(--uhc-ribbon);
  flex-shrink: 0;
  margin-top: auto;
}

/* === Detail Modal === */
.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.detail-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.detail-modal {
  background: var(--uhc-white);
  border-radius: 12px;
  width: 90%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px 32px 24px;
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
  position: relative;
  transform: translateY(20px);
  transition: transform .2s;
}
.detail-overlay.open .detail-modal {
  transform: translateY(0);
}
.detail-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #999;
  cursor: pointer;
  line-height: 1;
}
.detail-modal-close:hover { color: #333; }
.detail-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.detail-modal-header .problem-icon {
  width: 38px;
  height: 38px;
  font-size: .9rem;
}
.detail-modal-header h2 {
  font-size: 1.15rem;
  color: var(--uhc-blue);
  margin: 0;
}
.detail-modal .solution-tag {
  margin-bottom: 14px;
}
.detail-modal h4 {
  font-size: .82rem;
  color: var(--uhc-navy);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 14px 0 6px;
}
.detail-modal p {
  font-size: .88rem;
  color: #333;
  line-height: 1.6;
  margin: 0 0 8px;
}
.detail-modal p strong {
  color: var(--uhc-blue);
}
.detail-modal-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 10px 22px;
  background: var(--uhc-ribbon);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.detail-modal-btn:hover {
  background: var(--uhc-blue);
}
.tech-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}
.tech-chip {
  display: inline-block;
  background: var(--uhc-light-blue);
  color: var(--uhc-blue);
  font-size: .72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 14px;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .overview-grid { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .overview-full { padding: 10px 10px; overflow-y: auto; }
  .overview-grid { grid-template-columns: 1fr; grid-template-rows: auto; }
  .detail-modal { padding: 20px 18px; width: 95%; }
}

/* === Stats Panel === */
.stats-panel { margin-top: 12px; }
.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid #eee;
  font-size: .82rem;
}
.stat-row .label { color: #666; }
.stat-row .value { font-weight: 600; color: var(--uhc-blue); }

/* === Legend Panel === */
.legend-panel { margin-top: 16px; }
.legend-panel h4 {
  font-size: .78rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 8px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  margin-bottom: 5px;
}
.legend-swatch {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* === KPI Grid === */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.kpi-card {
  background: var(--uhc-gray);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}
.kpi-card .kpi-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--uhc-blue);
}
.kpi-card .kpi-label {
  font-size: .72rem;
  color: #666;
  margin-top: 2px;
}

/* === Filter Group === */
.filter-group {
  margin-bottom: 12px;
}
.filter-group label {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.filter-group select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--uhc-border);
  border-radius: 6px;
  font-size: .85rem;
  background: #fff;
  color: #333;
}

/* === Chart Panel === */
.chart-panel { margin-top: 14px; }
.chart-bar-group { margin-bottom: 10px; }
.chart-bar-label {
  font-size: .78rem;
  color: #444;
  margin-bottom: 3px;
}
.chart-bar-track {
  height: 20px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.chart-bar-fill {
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-size: .7rem;
  font-weight: 600;
  color: #fff;
  transition: width .6s ease;
}

/* === ArcGIS Overrides === */
.esri-view { border: none !important; }
.esri-popup__main-container { max-width: 320px !important; }
.esri-popup__header-title { color: var(--uhc-blue) !important; font-weight: 600 !important; }

/* === Mobile Auth Toggle Button === */
.auth-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 6px;
  color: #fff;
  padding: 6px;
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
  line-height: 0;
  transition: background .15s;
}
.auth-toggle:hover { background: rgba(255,255,255,.15); }

/* === Responsive — Tablet (<=900px) === */
@media (max-width: 900px) {
  .panel-split { flex-direction: column; }
  .sidebar {
    width: 100%;
    min-width: 0;
    max-height: 35vh;
    border-right: none;
    border-bottom: 1px solid var(--uhc-border);
  }
  .tab-btn { padding: 0 12px; font-size: .76rem; }
}

/* === Responsive — Mobile (<=768px) === */
@media (max-width: 768px) {
  :root {
    --header-height: auto;
    --tab-height: 48px;
  }

  /* Header stacks vertically */
  .uhc-header {
    height: auto;
    padding: 10px 14px;
  }
  .header-inner {
    flex-wrap: wrap;
    gap: 8px;
  }
  .header-logo h1 { font-size: 1rem; }
  .header-logo svg { width: 30px; height: 30px; }
  .header-subtitle { font-size: .7rem; }

  /* Auth toggle visible, auth bar collapsible */
  .auth-toggle { display: inline-flex; }
  .auth-bar {
    display: none;
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,.15);
    margin-left: 0;
  }
  .auth-bar.open { display: flex; }
  .auth-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 16px; /* prevents iOS zoom */
    border-radius: 6px;
  }
  .auth-btn {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    font-size: .8rem;
    border-radius: 6px;
    min-height: 44px; /* touch target */
  }
  .auth-divider { width: 100%; text-align: center; }

  /* Tab bar — scrollable, bigger touch targets */
  .tab-bar {
    height: var(--tab-height);
    padding: 0 6px;
    gap: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tab-bar::-webkit-scrollbar { display: none; }
  .tab-btn {
    padding: 0 14px;
    font-size: .78rem;
    min-height: 48px; /* touch target */
  }

  /* Main content fills remaining space */
  .main-content {
    height: calc(100vh - var(--tab-height));
    height: calc(100dvh - var(--tab-height));
    position: relative;
  }

  /* Sidebar on mobile — shorter, scrollable */
  .sidebar {
    max-height: 30vh;
    padding: 14px;
  }
  .sidebar h2 { font-size: .95rem; }
  .sidebar p { font-size: .8rem; }

  /* Map takes remaining space */
  .map-container { min-height: 40vh; }

  /* Tool inputs — touch-friendly */
  .tool-input {
    padding: 10px 12px;
    font-size: 16px; /* prevents iOS zoom */
    border-radius: 6px;
  }
  .tool-btn {
    padding: 12px;
    font-size: .85rem;
    min-height: 44px;
    border-radius: 6px;
  }

  /* Filter selects — touch-friendly */
  .filter-group select {
    padding: 10px 12px;
    font-size: 16px;
    min-height: 44px;
  }

  /* Overview cards */
  .overview-full { padding: 10px; overflow-y: auto; }
  .overview-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 10px;
  }
  .overview-intro h2 { font-size: 1rem; }
  .overview-intro p { font-size: .78rem; }
  .solution-card { padding: 12px 14px; }
  .solution-card-header h3 { font-size: .85rem; }

  /* Modal — near full-screen on mobile */
  .detail-modal {
    width: 96%;
    max-height: 90vh;
    padding: 18px 16px;
    border-radius: 10px;
  }
  .detail-modal-header h2 { font-size: 1rem; }
  .detail-modal p { font-size: .82rem; }
  .detail-modal-btn {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
    min-height: 44px;
  }
  .detail-modal-close {
    top: 8px;
    right: 10px;
    font-size: 1.6rem;
    padding: 4px 8px; /* bigger tap area */
  }

  /* KPI grid */
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi-card .kpi-value { font-size: 1.15rem; }

  /* ArcGIS popup override for mobile */
  .esri-popup__main-container { max-width: 280px !important; }
}

/* === Responsive — Small phones (<=480px) === */
@media (max-width: 480px) {
  .uhc-header { padding: 8px 10px; }
  .header-logo { gap: 10px; }
  .header-logo h1 { font-size: .88rem; }
  .header-logo svg { width: 26px; height: 26px; }
  .header-subtitle { display: none; }

  .tab-btn { padding: 0 10px; font-size: .72rem; }

  .sidebar {
    max-height: 25vh;
    padding: 10px;
  }
  .sidebar h2 { font-size: .88rem; }

  .overview-intro { margin-bottom: 8px; }
  .overview-intro h2 { font-size: .9rem; }
  .solution-card { padding: 10px 12px; }
  .solution-card .card-summary { font-size: .76rem; }

  .detail-modal { width: 100%; max-height: 95vh; border-radius: 8px 8px 0 0; margin-top: auto; }
  .detail-overlay { align-items: flex-end; }

  /* Stats more compact */
  .stat-row { font-size: .78rem; padding: 5px 0; }

  /* ArcGIS popup */
  .esri-popup__main-container { max-width: 240px !important; font-size: 12px !important; }
}

/* === Touch device enhancements === */
@media (hover: none) and (pointer: coarse) {
  .solution-card:hover { transform: none; box-shadow: none; }
  .solution-card:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
  }
  .tab-btn:hover { background: transparent; }
  .tab-btn:active { background: rgba(255,255,255,.12); }
}

/* === Safe area insets (notched phones) === */
@supports (padding: env(safe-area-inset-bottom)) {
  .uhc-header { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .tab-bar { padding-left: max(6px, env(safe-area-inset-left)); padding-right: max(6px, env(safe-area-inset-right)); }
}
