/* Staging: keep the existing palette while giving each dashboard its working area. */
.app-shell:not(.landing-mode) .topbar,
.app-shell:not(.landing-mode) .content > .hero { display: none !important; }
.app-shell:not(.landing-mode) .content {
  max-width: none;
  padding: 18px clamp(24px, 3.2vw, 64px) 24px;
}
.app-shell:not(.landing-mode) .content > .footer { margin-top: 14px; }
.page-heading { position: relative; flex: none; display: flex; align-items: center; min-height: 95px; margin: 0 0 10px; padding: 12px 23px; overflow: hidden; border-radius: 19px; background: linear-gradient(105deg, #082e66, #1654a8 69%, #2d6ad0); box-shadow: 0 11px 28px rgba(11, 54, 115, .16); color: #fff; isolation: isolate; }
.page-heading::before,.page-heading::after { content: ''; position: absolute; z-index: -1; border: 1px solid rgba(189, 218, 255, .17); border-radius: 50%; pointer-events: none; }
.page-heading::before { width: 270px; height: 270px; right: -28px; top: -145px; box-shadow: 0 0 0 55px rgba(178, 214, 255, .045); }
.page-heading::after { width: 345px; height: 345px; right: -110px; top: -179px; }
.page-heading-copy { position: relative; z-index: 1; min-width: 0; }
.page-heading-kicker { display: inline-flex; align-items: center; gap: 7px; color: #b9d7f9; font-size: 10px; font-weight: 800; letter-spacing: .13em; line-height: 1.1; }
.page-heading-kicker i { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #dfff54; box-shadow: 0 0 0 4px rgba(223, 255, 84, .16); }
.page-compact-title { margin: 4px 0 0; color: #fff; font-size: clamp(23px, 2.25vw, 31px); font-weight: 800; letter-spacing: -.035em; line-height: 1.1; }
#compactPageIntro { max-width: 900px; margin: 5px 0 0; color: #d7e8ff; font-size: clamp(11px, .94vw, 13px); line-height: 1.25; }
.app-shell.landing-mode .page-heading { display: none; }
.app-shell:not(.landing-mode) #mainNav button[data-view="overview"] { position: relative; border: 1px solid #1956a2; background: linear-gradient(115deg, #0d3b7c, #2665b7); color: #fff; box-shadow: 0 5px 13px rgba(14, 65, 132, .2); }
.app-shell:not(.landing-mode) #mainNav button[data-view="overview"]:hover { background: linear-gradient(115deg, #114b99, #3377cc); }
.app-shell:not(.landing-mode) #mainNav button[data-view="overview"] .nav-icon { color: #dfff54; font-size: 24px; }
.app-shell #mainNav .nav-analysis-caption { height: 30px; min-height: 30px; padding: 9px 11px 0; border-top: 1px solid #d6e3f0; color: #627f9d; font-size: 10px; font-weight: 800; letter-spacing: .15em; white-space: nowrap; }
.app-shell.sidebar-collapsed .sidebar:not(:hover) #mainNav .nav-analysis-caption { color: transparent; }
@media (max-width: 620px) { #mainNav .nav-analysis-caption { display: none !important; } }

/* Profile and Sentra are two lenses of the same map page. */
.app-shell:has(.map-story-layout):not(.landing-mode) .main-area { height: 100dvh; min-height: 0; overflow: hidden; }
.app-shell:has(.map-story-layout):not(.landing-mode) .content {
  height: 100dvh;
  min-height: 0;
  padding-block: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.app-shell:has(.map-story-layout) #viewContent { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.app-shell:has(.map-story-layout) .content > .footer { display: none; }
.map-story-layout { flex: 1; min-height: 0; margin: 0; display: flex; }
.map-story-layout > .map-card { flex: 1; min-width: 0; min-height: 0; height: 100%; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.map-story-layout > .map-card .map-wrap { flex: 1; min-height: 0 !important; height: auto !important; margin: 4px 10px 7px; }
.map-story-layout > .map-card .map-wrap > svg[role="img"] { top: 70px; height: calc(100% - 145px); }
.map-story-layout .map-wrap.is-province-view > svg[role="img"] { top: 48px; height: calc(100% - 90px); }
.map-story-layout .map-head { flex: none; padding: 9px 16px 3px; }
.map-story-layout .map-head h3 { font-size: 16px; }
.map-story-layout .map-head small { font-size: 11px; }
.map-story-layout .map-hint { flex: none; padding: 0 14px 7px; font-size: 11px; }
.map-story-layout .map-watermark { top: 77px; }

.map-unified-toolbar { display: flex; flex: none; align-items: end; gap: 12px; padding: 10px 14px 8px; border-bottom: 1px solid #e2ecf6; background: #fff; }
.map-unified-tabs { display: flex; flex: none; gap: 5px; padding: 4px; border-radius: 12px; background: #eff5fb; }
.map-unified-tabs button { min-height: 38px; padding: 8px 10px; border: 0; border-radius: 9px; background: transparent; color: #315476; font-family: inherit; font-size: 12px; font-weight: 750; line-height: 1.1; cursor: pointer; white-space: nowrap; }
.map-unified-tabs button.active { background: #0e438c; color: white; box-shadow: 0 3px 9px rgba(11,54,115,.18); }
.map-unified-tabs button:hover:not(.active),.map-unified-tabs button:focus-visible:not(.active) { background: #dfeaf7; outline: none; }
.map-unified-toolbar .controls { display: flex; flex-wrap: nowrap; align-items: end; justify-content: flex-end; flex: 1 1 0; min-width: 0; width: auto; gap: 8px; }
.map-unified-toolbar .control { flex: 0 1 145px; min-width: 0; }
.map-unified-toolbar .control:has(#itemSelect) { flex-basis: 220px; min-width: 0; }
.map-unified-toolbar .control:has(#sentraLuSelect) { flex-basis: 210px; min-width: 0; }
.map-unified-toolbar .control:has(#sentraYear),.map-unified-toolbar .control:has(#profileYear) { flex: 0 0 132px; min-width: 132px; }
.map-unified-toolbar .search-select { min-width: 0; width: 100%; }
.map-unified-toolbar .search-select-input { min-width: 0; font-size: 12px; }
.map-unified-toolbar .control label { font-size: 10px; margin-bottom: 3px; }
.map-unified-toolbar .control select { width: 100%; min-height: 40px; font-size: 12px; }

.map-story-layout .map-story-region { min-height: 62px; padding: 6px 9px; }
.map-story-layout .map-story-region span { font-size: 9px; }
.map-story-layout .map-story-region b { font-size: 11px; }
.map-story-layout .map-story-region strong { font-size: 18px; }
.map-story-layout .map-story-national { min-height: 62px; padding: 6px 9px; }
.map-story-layout .map-story-national b { font-size: 16px; }
.map-story-layout .map-story-national small { font-size: 10px; }
.map-story-layout .map-story-province { padding: 10px 12px; width: min(270px, 30%); }
.map-story-layout .map-story-province > b { font-size: 17px; }
.map-story-layout .map-story-province li { font-size: 10px; padding: 5px 0; }
.map-tooltip.profile-map-tooltip { width: min(305px, calc(100vw - 24px)); }
.profile-tip-head strong { font-size: 15px; }
.profile-tip-lead b { font-size: 13px; }
.profile-tip-metrics b { font-size: 14px; }
.profile-tip-list > span b,.profile-tip-list > span strong { font-size: 10px; }
.map-story-layout .map-wrap.has-selection-panel .map-story-national { display: none; }
.map-story-selection { position: absolute; z-index: 18; top: 10px; right: 12px; width: min(335px, 36%); max-height: calc(100% - 54px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid #cbdff0; border-radius: 15px; background: #fff; box-shadow: 0 10px 30px rgba(12, 45, 86, .18); color: #173a5d; }
.map-story-selection-head { display: flex; flex-direction: column; gap: 3px; padding: 11px 14px; background: linear-gradient(115deg, #0b356e, #2867bd); color: #fff; }
.map-story-selection-head small { font-size: 10px; font-weight: 800; letter-spacing: .07em; color: #bed8fa; }
.map-story-selection-head strong { font-size: 19px; line-height: 1.18; }
.map-story-selection-main { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.map-story-selection-main > summary { display: flex; align-items: center; justify-content: space-between; padding: 10px 13px; font-size: 12px; font-weight: 800; color: #194b83; cursor: pointer; list-style: none; }
.map-story-selection-main > summary::-webkit-details-marker,.map-story-selection-lu > summary::-webkit-details-marker { display: none; }
.map-story-selection-main > summary span { transition: transform .2s ease; }
.map-story-selection-main:not([open]) > summary span { transform: rotate(-90deg); }
.map-story-selection-list { padding: 0 9px 9px; }
.map-story-selection-lu { border-top: 1px solid #e4edf5; }
.map-story-selection-lu > summary { display: grid; grid-template-columns: 23px minmax(0, 1fr) auto; gap: 7px; align-items: center; padding: 8px 3px; cursor: pointer; list-style: none; }
.map-story-selection-lu > summary i { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; background: #e8f1fb; color: #1b5aa2; font-size: 10px; font-style: normal; font-weight: 800; }
.map-story-selection-lu > summary b { font-size: 11px; line-height: 1.25; }
.map-story-selection-lu > summary strong { font-size: 11px; color: #1452a3; }
.map-story-selection-children { padding: 3px 6px 9px 33px; background: #f5f9fe; border-radius: 8px; }
.map-story-selection-children > div { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; font-size: 10px; line-height: 1.25; }
.map-story-selection-children > div + div { border-top: 1px solid #e0eaf4; }
.map-story-selection-children > div b { flex: none; color: #1554a2; }
.map-story-selection-children > small { display: block; margin-top: 3px; color: #617c96; font-size: 9px; }
.map-story-selection-children p { margin: 5px 0; font-size: 10px; }

/* Detailed LU shares remain available without lengthening the map page. */
.map-lu-drawer { position: absolute; z-index: 30; right: 18px; bottom: 17px; max-width: min(560px, 65vw); }
.map-lu-drawer > summary { display: block; float: right; padding: 8px 12px; border: 1px solid #bcd4ed; border-radius: 9px; background: #fff; color: #123f7b; box-shadow: 0 5px 13px rgba(12,56,108,.14); font-size: 12px; font-weight: 800; cursor: pointer; }
.map-lu-drawer[open] > summary { margin-bottom: 7px; }
.map-lu-drawer-content { clear: both; max-height: min(68dvh, 620px); overflow: auto; border: 1px solid #d5e5f3; border-radius: 13px; background: #fff; box-shadow: 0 18px 45px rgba(13,48,88,.2); }
.map-lu-drawer-content .focus-profile { margin: 0; border: 0; box-shadow: none; }
.map-lu-drawer-content .focus-profile-grid { grid-template-columns: 1fr; }

@media (max-width: 1250px) {
  .map-unified-toolbar { align-items: stretch; flex-direction: column; gap: 6px; }
  .map-unified-toolbar .controls { justify-content: flex-start; flex: none; width: 100%; }
  .map-unified-toolbar .control:has(#itemSelect) { flex: 1 1 210px; }
  .map-unified-toolbar .control:has(#sentraLuSelect) { flex: 1 1 180px; }
  .map-unified-toolbar .control:has(#metricSelect) { flex: 1 1 145px; }
  .map-unified-toolbar .control:has(#profileYear) { margin-left: auto; }
}
@media (max-width: 1000px) {
  .map-story-layout > .map-card .map-wrap > svg[role="img"] { top: 66px; height: calc(100% - 132px); }
}
@media (max-width: 620px) {
  .page-heading { min-height: 78px; margin-bottom: 6px; padding: 9px 12px; border-radius: 12px; }
  .page-heading-kicker { font-size: 8px; }
  .page-compact-title { margin-top: 3px; font-size: 20px; }
  #compactPageIntro { margin-top: 3px; font-size: 10px; }
  .app-shell:not(.landing-mode) .content { padding: 7px 8px 75px; }
  .app-shell:has(.map-story-layout):not(.landing-mode) .content { height: 100dvh; padding: 6px 7px 76px; }
  .map-unified-toolbar { padding: 5px 6px; gap: 4px; }
  .map-unified-tabs { width: 100%; }
  .map-unified-tabs button { flex: 1; font-size: 11px; min-height: 34px; }
  .map-unified-toolbar .controls { width: 100%; gap: 4px; flex-wrap: wrap; }
  .map-unified-toolbar .control { flex: 1 1 75px; min-width: 75px; }
  .map-unified-toolbar .control:has(#itemSelect) { flex: 2 1 130px; }
  .map-unified-toolbar .control:has(#sentraLuSelect) { flex: 2 1 120px; }
  .map-unified-toolbar .control:has(#sentraYear),.map-unified-toolbar .control:has(#profileYear) { flex: 1 0 100px; min-width: 100px; }
  .map-unified-toolbar .control label { font-size: 8px; }
  .map-unified-toolbar .control select { min-height: 34px; font-size: 10px; }
  .map-story-layout > .map-card .map-wrap { margin: 2px 4px 4px; overflow-x: auto; overflow-y: hidden; }
  .map-story-layout > .map-card .map-wrap > svg[role="img"] { top: 64px; left: 0; width: 750px; min-width: 750px; height: calc(100% - 115px); }
  .map-story-layout .map-story-region { min-height: 50px; padding: 4px 5px; }
  .map-story-layout .map-story-region strong { font-size: 13px; }
  .map-story-layout .map-story-national { min-height: 50px; }
  .map-story-layout .map-hint { display: none; }
  .map-lu-drawer { right: 8px; bottom: 8px; max-width: calc(100% - 16px); }
  .map-lu-drawer-content { max-height: 53dvh; }
  .map-story-selection { width: min(310px, calc(100vw - 32px)); right: 7px; top: 7px; max-height: calc(100% - 50px); }
}
