:root {
  --map-global-header-height: 65px;
}

.map-top-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-height: var(--map-global-header-height);
  margin: -12px -12px 12px;
  padding: 0 20px;
  border-bottom: 1px solid #edf0f5;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.map-shell-mode .app-shell {
  padding: 0;
}

.map-shell-mode .map-top-header {
  margin: 0;
}

.map-top-left,
.map-top-right {
  display: flex;
  align-items: center;
  min-width: 0;
}

.map-top-left {
  grid-row: 1;
  justify-self: start;
  gap: 12px;
}

.map-top-right {
  grid-row: 1;
  justify-self: end;
}

.map-menu-button {
  position: relative;
  flex: 0 0 auto;
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #1d2939;
  cursor: pointer;
  padding: 0;
}

.map-settings-menu {
  position: relative;
  flex: 0 0 auto;
}

.map-settings-menu summary {
  list-style: none;
}

.map-settings-menu summary::-webkit-details-marker {
  display: none;
}

.map-menu-button span,
.map-menu-button::before,
.map-menu-button::after {
  position: absolute;
  left: 10px;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.map-menu-button span {
  top: 19px;
}

.map-menu-button::before {
  top: 13px;
}

.map-menu-button::after {
  top: 25px;
}

.map-menu-button:focus-visible {
  outline: 2px solid rgba(35, 103, 209, 0.45);
  outline-offset: 2px;
}

.map-settings-menu[open] .map-menu-button {
  background: #f3f5f8;
  color: #111827;
}

.map-settings-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 2100;
  display: grid;
  gap: 6px;
  width: 190px;
  padding: 8px;
  border: 1px solid rgba(16, 24, 40, 0.12);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(16, 24, 40, 0.18);
}

.map-settings-menu.display-settings-open .map-settings-panel {
  display: none;
}

.map-settings-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #1d2939;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  padding: 0 26px 0 10px;
  text-align: left;
}

.map-settings-row::after {
  position: absolute;
  right: 11px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid #667085;
  border-bottom: 2px solid #667085;
  content: "";
  transform: translateY(-50%) rotate(-45deg);
}

.map-settings-row:hover,
.map-settings-row:focus-visible,
.map-settings-submenu[open] > .map-settings-row {
  background: #f3f5f8;
  outline: 0;
}

.map-settings-submenu[open] > .map-settings-row::after {
  transform: translateY(-65%) rotate(45deg);
}

.map-admin-menu-list {
  display: grid;
  gap: 3px;
  padding: 4px 0 2px;
}

.map-admin-menu-list a,
.map-admin-menu-list .tab-more-control {
  border-radius: 6px;
}

.map-admin-menu-list a {
  display: flex;
  align-items: center;
  min-height: 34px;
  color: #344054;
  font-size: 13px;
  font-weight: 850;
  padding: 0 10px;
  text-decoration: none;
}

.map-admin-menu-list a:hover,
.map-admin-menu-list a:focus-visible,
.map-admin-menu-list a.active {
  background: #eef5ff;
  color: var(--blue);
  outline: 0;
}

.map-display-settings-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 2110;
  display: grid;
  gap: 14px;
  width: 280px;
  padding: 14px;
  border: 1px solid rgba(16, 24, 40, 0.12);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(16, 24, 40, 0.18);
}

.map-display-settings-panel[hidden] {
  display: none;
}

.map-display-settings-head,
.map-display-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.map-display-settings-head strong {
  color: #1d2939;
  font-size: 15px;
  font-weight: 950;
}

.map-display-settings-head button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid #e4e7ec;
  border-radius: 6px;
  background: #ffffff;
  color: #1d2939;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.map-display-settings-row {
  min-height: 36px;
  color: #344054;
  font-size: 13px;
  font-weight: 900;
}

.map-display-settings-row-stack {
  align-items: stretch;
  flex-direction: column;
  gap: 8px;
}

.growth-band-mode-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid #d8deea;
  border-radius: 8px;
  background: #f8fafc;
}

.growth-band-mode-control button {
  display: inline-grid;
  place-items: center;
  min-width: 0;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #475467;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  line-height: 1;
}

.growth-band-mode-control button[aria-pressed="true"] {
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.18);
}

.household-filter-switch {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: #d0d5dd;
  cursor: pointer;
  padding: 2px;
  transition: background 0.16s ease;
}

.household-filter-switch span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(16, 24, 40, 0.22);
  transition: transform 0.16s ease;
}

.household-filter-switch.active,
.household-filter-switch[aria-checked="true"],
.household-filter-switch[aria-pressed="true"] {
  background: var(--blue);
}

.household-filter-switch.active span,
.household-filter-switch[aria-checked="true"] span,
.household-filter-switch[aria-pressed="true"] span {
  transform: translateX(20px);
}

.map-top-logo {
  flex: 0 0 auto;
  color: inherit;
  text-decoration: none;
}

.map-top-header .orulzip-logo {
  gap: 8px;
}

.map-top-header .orulzip-logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
}

.map-top-header .orulzip-logo-mark svg {
  width: 30px;
  height: 30px;
}

.map-top-header .orulzip-logo-word {
  color: #111827;
  font-size: 22px;
  font-weight: 950;
  letter-spacing: 0;
}

.map-top-search-panel {
  position: relative;
  flex: 0 1 300px;
  width: clamp(220px, 24vw, 320px);
  min-width: 0;
}

.map-top-header .map-top-search-panel {
  padding: 0;
}

.map-top-header .map-top-search-panel input {
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: #f3f5f8;
  color: #111827;
  font-size: 15px;
  font-weight: 800;
  padding: 0 18px 0 44px;
}

.map-top-header .map-top-search-panel input::placeholder {
  color: #7a8596;
}

.map-top-search-panel::after {
  position: absolute;
  top: 50%;
  left: 18px;
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 50%;
  color: #667085;
  content: "";
  pointer-events: none;
  transform: translateY(-58%);
}

.map-top-search-panel::before {
  position: absolute;
  top: calc(50% + 6px);
  left: 30px;
  width: 7px;
  height: 2px;
  border-radius: 999px;
  background: #667085;
  content: "";
  pointer-events: none;
  transform: rotate(45deg);
  transform-origin: center;
  z-index: 1;
}

.map-top-header .top-tabs {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  flex-wrap: nowrap;
  gap: 4px;
  margin: 0;
}

.map-top-header .top-tabs a {
  height: 64px;
  min-width: 128px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #344054;
  font-size: 15px;
  font-weight: 900;
  padding: 0 16px;
  box-shadow: none;
}

.map-top-header .top-tabs a.active {
  border-color: #0aa36e;
  background: transparent;
  color: #111827;
}

.map-top-header .tab-more-menu summary {
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #344054;
  font-size: 14px;
  font-weight: 900;
  padding: 0 10px;
}

.map-top-header .tab-more-menu.active summary,
.map-top-header .tab-more-menu[open] summary {
  background: #f3f5f8;
  color: #111827;
}

.map-floating-controls {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 630;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  transform: translateX(-50%);
}

.map-floating-period-select {
  position: relative;
  height: 42px;
}

.map-growth-metric-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 42px;
}

.map-floating-period-select select {
  width: 118px;
}

.map-growth-metric-select select {
  width: 82px;
}

.map-floating-period-select select,
.map-growth-metric-select select {
  height: 42px;
  appearance: none;
  border: 1px solid rgba(16, 24, 40, 0.14);
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.96);
  color: #1d2939;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  padding: 0 30px 0 14px;
  word-spacing: -2px;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.18);
  backdrop-filter: blur(8px);
}

.map-floating-period-select::after,
.map-growth-metric-select::after {
  content: "";
  position: absolute;
  right: 13px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid #475467;
  border-bottom: 2px solid #475467;
  pointer-events: none;
  transform: translateY(-65%) rotate(45deg);
}

.household-filter-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  border: 1px solid rgba(16, 24, 40, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #344054;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  padding: 0 14px;
  white-space: nowrap;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.18);
  backdrop-filter: blur(8px);
}

.household-filter-toggle:hover {
  border-color: rgba(47, 111, 237, 0.34);
  color: var(--blue);
}

.household-filter-toggle.active,
.household-filter-toggle[aria-pressed="true"] {
  border-color: rgba(47, 111, 237, 0.42);
  background: #e8f0ff;
  color: var(--blue);
}
