:root {
  --ink: #18252b;
  --muted: #66737b;
  --paper: #fbf4e6;
  --panel: #fffaf0;
  --water: #64c3d2;
  --park: #76a85c;
  --street: #d8c7aa;
  --accent: #cf3f2f;
  --gold: #d49a2a;
  --steel: #3f6578;
  --blue: #347aa1;
  --glass: #78c4d5;
  --good: #277f57;
  --shadow: 0 18px 42px rgba(18, 31, 38, 0.22);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Final mobile map-first override. Keep this at the end of the file. */
@media (max-width: 900px) {
  .game-shell {
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(58vh, 68dvh) minmax(0, 1fr) !important;
    height: 100vh !important;
    height: 100dvh !important;
  }

  .map-stage {
    min-height: 58vh !important;
    height: 100% !important;
    border-bottom: 1px solid rgba(24, 37, 43, 0.22);
  }

  #city-map {
    height: 100% !important;
    touch-action: none !important;
  }

  .manager-panel {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    grid-template-rows: auto auto minmax(0, 1fr) !important;
    gap: 4px !important;
    padding: 6px !important;
    border-left: 0 !important;
    border-top: 1px solid rgba(24, 37, 43, 0.14) !important;
  }

  .brand-strip {
    min-height: 30px !important;
    align-items: center !important;
  }

  .brand-strip .eyebrow {
    display: none !important;
  }

  h1 {
    font-size: 20px !important;
  }

  #pause-toggle {
    width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    font-size: 14px !important;
  }

  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 4px !important;
  }

  .stats-grid div {
    min-height: 38px !important;
    padding: 4px !important;
  }

  .stats-grid span {
    font-size: 7px !important;
  }

  .stats-grid strong {
    font-size: 11px !important;
  }

  .panel-tabs {
    display: none !important;
  }

  .panel-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 5px !important;
  }

  .panel-page.active {
    padding: 6px !important;
  }

  .operations-panel.panel-page.active,
  .opportunity-panel.panel-page.active,
  .portfolio-panel.panel-page.active,
  .goals-panel.panel-page.active {
    display: block !important;
  }

  .selected-building.panel-page.active,
  .map-layers-panel.panel-page.active,
  .competition-panel.panel-page.active,
  .market-panel.panel-page.active {
    grid-column: auto !important;
  }

  .panel-heading {
    gap: 4px !important;
  }

  .panel-heading .eyebrow {
    font-size: 8px !important;
  }

  .panel-heading strong {
    font-size: 12px !important;
  }

  .operations-grid {
    display: none !important;
  }

  .next-move-card {
    margin-top: 4px !important;
    padding: 6px !important;
  }

  .next-move-card strong {
    font-size: 13px !important;
  }

  .next-move-card button,
  .opportunity-item button {
    min-height: 28px !important;
    font-size: 10px !important;
  }

  .opportunity-item,
  .portfolio-item,
  .goal-card {
    min-height: 45px !important;
    padding: 6px !important;
  }

  .opportunity-item strong,
  .portfolio-item strong,
  .goal-card strong {
    font-size: 12px !important;
  }

  .opportunity-item span,
  .portfolio-item span,
  .goal-card span {
    font-size: 10px !important;
  }

  .goal-progress {
    height: 7px !important;
  }

  .map-toolbar {
    left: 10px !important;
    top: 10px !important;
    gap: 6px !important;
  }

  .map-toolbar button {
    width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    font-size: 16px !important;
  }

  .map-ops-hud {
    left: 58px !important;
    right: 8px !important;
    top: 10px !important;
    width: auto !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 5px !important;
  }

  .map-ops-hud div {
    min-height: 34px !important;
    padding: 5px 7px !important;
  }

  .map-ops-hud div:nth-child(n + 3) {
    display: none !important;
  }

  .map-ops-hud span {
    font-size: 7px !important;
  }

  .map-ops-hud strong {
    font-size: 11px !important;
  }

  .ticker {
    left: 8px !important;
    right: 8px !important;
    bottom: 8px !important;
    max-height: 32px !important;
    padding: 6px 8px !important;
    font-size: 10px !important;
  }
}

@media (max-width: 560px) {
  .game-shell {
    grid-template-rows: minmax(66vh, 72dvh) minmax(0, 1fr) !important;
  }

  .map-stage {
    min-height: 66vh !important;
  }

  .brand-strip {
    display: none !important;
  }

  .manager-panel {
    grid-template-rows: auto minmax(0, 1fr) !important;
    padding: 5px !important;
  }

  .stats-grid div {
    min-height: 34px !important;
    padding: 3px 4px !important;
  }

  .stats-grid span {
    margin-bottom: 0 !important;
    font-size: 7px !important;
  }

  .stats-grid strong {
    font-size: 10px !important;
  }

  .panel-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 4px !important;
  }

  .operations-panel.panel-page.active,
  .portfolio-panel.panel-page.active {
    display: none !important;
  }

  .selected-photo-wrap {
    max-height: 74px !important;
  }
}

/* Final game-box layout: no page scrollbars, no internal scroll UI. */
html,
body {
  height: 100%;
  overflow: hidden !important;
  overscroll-behavior: none;
}

body {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}

.game-shell {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  overflow: hidden !important;
}

.map-stage {
  min-height: 0 !important;
  height: 100% !important;
  touch-action: none !important;
  overscroll-behavior: none !important;
  user-select: none !important;
}

.manager-panel {
  display: grid !important;
  grid-template-rows: auto auto auto minmax(0, 1fr) !important;
  gap: 7px !important;
  width: 100% !important;
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 0 !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
  padding: 9px !important;
  border-left: 1px solid rgba(24, 37, 43, 0.12) !important;
  border-top: 0 !important;
}

.panel-tabs {
  position: static !important;
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 5px !important;
  padding: 0 !important;
  background: transparent !important;
  backdrop-filter: none !important;
}

.panel-tabs button {
  min-height: 34px !important;
  padding: 0 4px !important;
  font-size: 11px !important;
}

.panel-stack {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-auto-rows: minmax(0, 1fr) !important;
  gap: 7px !important;
  min-height: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
}

.panel-page,
.panel-page.active,
.selected-building,
.operations-panel,
.education-panel,
.portfolio-panel,
.opportunity-panel,
.city-updates-panel,
.suggestions-panel,
.goals-panel,
.map-layers-panel,
.strategy-panel,
.competition-panel,
.market-panel,
.portfolio-list,
.opportunity-list,
.goal-list,
.city-updates,
.rival-list,
.achievement-list,
.timeline-list,
.idea-list,
.strategy-list {
  overflow: hidden !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.panel-page::-webkit-scrollbar,
.selected-building::-webkit-scrollbar,
.operations-panel::-webkit-scrollbar,
.education-panel::-webkit-scrollbar,
.portfolio-panel::-webkit-scrollbar,
.opportunity-panel::-webkit-scrollbar,
.city-updates-panel::-webkit-scrollbar,
.suggestions-panel::-webkit-scrollbar,
.goals-panel::-webkit-scrollbar,
.map-layers-panel::-webkit-scrollbar,
.strategy-panel::-webkit-scrollbar,
.competition-panel::-webkit-scrollbar,
.market-panel::-webkit-scrollbar,
.portfolio-list::-webkit-scrollbar,
.opportunity-list::-webkit-scrollbar,
.goal-list::-webkit-scrollbar,
.city-updates::-webkit-scrollbar,
.rival-list::-webkit-scrollbar,
.achievement-list::-webkit-scrollbar,
.timeline-list::-webkit-scrollbar,
.idea-list::-webkit-scrollbar,
.strategy-list::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.panel-page.active {
  min-height: 0 !important;
  max-height: none !important;
  padding: 8px !important;
}

.operations-panel,
.opportunity-panel,
.portfolio-panel,
.goals-panel,
.selected-building,
.map-layers-panel,
.competition-panel,
.market-panel {
  cursor: pointer;
}

.operations-panel.panel-page.active,
.opportunity-panel.panel-page.active,
.portfolio-panel.panel-page.active,
.goals-panel.panel-page.active,
.map-layers-panel.panel-page.active,
.competition-panel.panel-page.active,
.market-panel.panel-page.active,
.selected-building.panel-page.active {
  max-height: none !important;
}

.strategy-panel.panel-page.active,
.education-panel.panel-page.active,
.suggestions-panel.panel-page.active,
.city-updates-panel.panel-page.active,
.data-note {
  display: none !important;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 5px !important;
}

.stats-grid div {
  min-height: 48px !important;
  padding: 6px !important;
}

.stats-grid span {
  font-size: 9px !important;
}

.stats-grid strong {
  font-size: clamp(12px, 1.35vw, 15px) !important;
  line-height: 1.05 !important;
}

.operations-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 4px !important;
  margin-top: 5px !important;
}

.operations-grid div {
  min-height: 42px !important;
  padding: 5px !important;
}

.operations-grid span,
.building-metrics span {
  font-size: 8px !important;
}

.operations-grid strong {
  font-size: 14px !important;
}

.next-move-card {
  margin-top: 5px !important;
  padding: 7px !important;
}

.next-move-card span,
.directive-list,
.next-move-card p,
.intel-grid,
#famous-tenants,
#price-note,
.secondary-actions {
  display: none !important;
}

.next-move-card strong {
  font-size: 15px !important;
  line-height: 1.08 !important;
}

.next-move-card button {
  min-height: 30px !important;
  font-size: 11px !important;
}

.opportunity-list,
.portfolio-list,
.goal-list {
  display: grid !important;
  gap: 5px !important;
}

.opportunity-item,
.portfolio-item,
.goal-card {
  min-height: 56px !important;
  padding: 7px !important;
}

.opportunity-item:nth-child(n + 2),
.portfolio-item:nth-child(n + 2),
.goal-card:nth-child(n + 2) {
  display: none !important;
}

.opportunity-item strong,
.portfolio-item strong,
.goal-card strong {
  font-size: 13px !important;
  line-height: 1.12 !important;
}

.opportunity-item span,
.portfolio-item span,
.goal-card span {
  font-size: 11px !important;
  line-height: 1.2 !important;
}

.opportunity-item button {
  min-height: 32px !important;
  padding: 0 9px !important;
}

.selected-building.panel-page.active,
.map-layers-panel.panel-page.active,
.competition-panel.panel-page.active,
.market-panel.panel-page.active {
  grid-column: 1 / -1 !important;
}

.selected-photo-wrap {
  aspect-ratio: 16 / 5.4 !important;
  max-height: 96px !important;
  cursor: grab !important;
  touch-action: none !important;
  user-select: none !important;
}

.selected-photo-wrap.dragging-photo {
  cursor: grabbing !important;
}

.selected-building .address,
.fact-copy {
  display: -webkit-box !important;
  overflow: hidden !important;
  -webkit-box-orient: vertical;
}

.selected-building .address {
  -webkit-line-clamp: 2;
}

.fact-copy {
  margin: 5px 0 !important;
  font-size: 12px !important;
  line-height: 1.25 !important;
  -webkit-line-clamp: 2;
}

.badge-row {
  max-height: 58px !important;
  overflow: hidden !important;
}

.building-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 4px !important;
}

.building-metrics div {
  min-height: 42px !important;
  padding: 5px !important;
}

.building-metrics strong {
  font-size: 12px !important;
}

.action-row {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 4px !important;
}

.action-row button,
.filter-row button,
.toggle-grid label {
  min-height: 32px !important;
  font-size: 10px !important;
}

.ticker {
  max-height: 36px !important;
  overflow: hidden !important;
}

@media (max-width: 900px) {
  .game-shell {
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(170px, 36vh) minmax(0, 1fr) !important;
  }

  .manager-panel {
    height: auto !important;
    max-height: none !important;
    border-left: 0 !important;
    border-top: 1px solid rgba(24, 37, 43, 0.12) !important;
  }
}

@media (max-width: 560px) {
  .game-shell {
    grid-template-rows: 150px minmax(0, 1fr) !important;
  }

  .manager-panel {
    gap: 4px !important;
    padding: 7px !important;
  }

  .panel-stack {
    gap: 5px !important;
  }

  .stats-grid div {
    min-height: 44px !important;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: #102f3c;
  color: var(--ink);
}

button {
  border: 0;
  border-radius: 8px;
  min-height: 42px;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  color: #fff;
  background: var(--ink);
  transition: transform 140ms ease, filter 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 10px 24px rgba(18, 31, 38, 0.2);
}

button:active {
  transform: translateY(0);
}

a {
  color: #b7372c;
  font-weight: 900;
}

.game-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(220px, 40vh) minmax(0, 1fr);
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  contain: layout paint size;
}

.map-stage {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.42) 0, transparent 28%),
    radial-gradient(circle at 82% 72%, rgba(44, 91, 111, 0.3) 0, transparent 38%),
    linear-gradient(135deg, #91d8de 0, var(--water) 48%, #3d91a8 100%);
}

#city-map {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#city-map.dragging {
  cursor: grabbing;
}

.map-toolbar {
  position: absolute;
  left: 18px;
  top: 18px;
  display: grid;
  gap: 8px;
  z-index: 4;
}

.map-toolbar button,
#pause-toggle {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 19px;
  line-height: 1;
  color: #fffaf0;
  background: linear-gradient(180deg, rgba(29, 48, 57, 0.94), rgba(18, 31, 38, 0.94));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
}

.map-ops-hud {
  position: absolute;
  left: 76px;
  top: 18px;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(4, minmax(106px, 1fr));
  gap: 8px;
  width: min(720px, calc(100% - 112px));
  pointer-events: none;
}

.map-ops-hud div {
  min-width: 0;
  min-height: 50px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 250, 240, 0.94), rgba(231, 242, 241, 0.82)),
    rgba(255, 255, 255, 0.7);
  box-shadow: 0 10px 24px rgba(18, 31, 38, 0.18);
}

.map-ops-hud span {
  display: block;
  margin-bottom: 3px;
  color: #6e5544;
  font-size: 10px;
  font-weight: 1000;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.map-ops-hud strong {
  display: block;
  overflow-wrap: anywhere;
  color: #18252b;
  font-size: 14px;
  line-height: 1.08;
}

.map-attribution {
  position: absolute;
  right: 12px;
  bottom: 8px;
  z-index: 2;
  max-width: min(360px, calc(100% - 36px));
  padding: 5px 7px;
  border-radius: 6px;
  background: rgba(255, 250, 240, 0.78);
  color: rgba(24, 37, 43, 0.76);
  font-size: 10px;
  font-weight: 800;
  pointer-events: none;
}

.subway-legend {
  position: absolute;
  left: 18px;
  bottom: 74px;
  z-index: 3;
  display: grid;
  width: min(360px, calc(100% - 36px));
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  background: rgba(255, 252, 244, 0.9);
  box-shadow: 0 16px 36px rgba(12, 28, 36, 0.16);
  backdrop-filter: blur(14px);
  pointer-events: none;
}

.subway-legend > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.subway-legend span {
  color: #6f5a3d;
  font-size: 10px;
  font-weight: 1000;
  text-transform: uppercase;
}

.subway-legend strong {
  overflow: hidden;
  color: #172b33;
  font-size: 12px;
  font-weight: 1000;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subway-legend.is-live strong {
  color: #22543e;
}

.subway-legend.is-estimate strong {
  color: #80601f;
}

.subway-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.subway-chip-row b {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border: 1px solid rgba(23, 43, 51, 0.12);
  border-left: 5px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.78);
  color: #172b33;
  font-size: 10px;
  font-weight: 1000;
  line-height: 1;
}

.subway-mode-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.subway-mode-row i {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(23, 43, 51, 0.08);
  border-radius: 7px;
  background: rgba(235, 244, 240, 0.76);
  font-style: normal;
}

.subway-mode-row i span {
  color: #6f5a3d;
  font-size: 8px;
  line-height: 1;
}

.subway-mode-row i strong {
  overflow: hidden;
  color: #172b33;
  font-size: 12px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subway-legend p {
  margin: 0;
  color: #53636a;
  font-size: 10px;
  font-weight: 760;
  line-height: 1.25;
}

.skyline-jumpbar {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 72px;
  z-index: 4;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  max-width: min(920px, calc(100% - 36px));
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.9);
  box-shadow: 0 14px 36px rgba(18, 31, 38, 0.2);
}

.skyline-jumpbar > span {
  color: #6e5544;
  font-size: 11px;
  font-weight: 1000;
  text-transform: uppercase;
  white-space: nowrap;
}

.skyline-jumps {
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.skyline-jumps::-webkit-scrollbar {
  display: none;
}

.skyline-jumps button {
  flex: 0 0 auto;
  min-height: 30px;
  max-width: 142px;
  padding: 0 10px;
  border: 1px solid rgba(24, 37, 43, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #263941;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: none;
}

.skyline-jumps button.active {
  background: linear-gradient(180deg, #e5b24f, #b9791a);
  color: #22170a;
}

.hover-card {
  position: absolute;
  left: 28px;
  top: 28px;
  z-index: 5;
  display: block !important;
  grid-template-columns: none !important;
  width: max-content !important;
  max-width: min(280px, calc(100% - 36px)) !important;
  padding: 8px 11px !important;
  border: 1px solid rgba(24, 37, 43, 0.18);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.98);
  box-shadow: 0 12px 30px rgba(15, 30, 38, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px) scale(0.98);
  transition: opacity 130ms ease, transform 130ms ease;
}

.hover-card.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.hover-photo-wrap {
  display: none !important;
  min-height: 0 !important;
}

.hover-photo-wrap img {
  display: none;
  width: 100%;
  height: 100%;
  min-height: 132px;
  object-fit: cover;
}

.hover-photo-wrap.has-photo img {
  display: none !important;
}

.hover-photo-wrap.has-photo .hover-photo-fallback {
  display: none;
}

.hover-photo-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.88);
  font-size: 26px;
  font-weight: 1000;
}

.hover-copy {
  min-width: 0;
}

.hover-copy h2 {
  margin: 0;
  color: #18252b;
  font-size: 14px;
  line-height: 1.1;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.hover-copy .eyebrow,
#hover-address,
#hover-fact {
  display: none !important;
}

.hover-stat-row {
  display: none !important;
}

.hover-stat-row span {
  padding: 5px 7px;
  border: 1px solid rgba(24, 37, 43, 0.12);
  border-radius: 7px;
  background: #fff;
  color: #18252b;
  font-size: 12px;
  font-weight: 900;
}

.ticker {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 3;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.94);
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.manager-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 7px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
  min-height: 0;
  padding: 9px;
  overflow: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: auto;
  -webkit-overflow-scrolling: touch;
  border-left: 0;
  border-top: 1px solid rgba(24, 37, 43, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.97), rgba(239, 229, 211, 0.98)),
    repeating-linear-gradient(0deg, transparent 0, transparent 30px, rgba(24, 37, 43, 0.04) 31px);
}

.brand-strip {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
}

.brand-strip > div {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: #7a4d35;
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1;
  overflow-wrap: anywhere;
}

h2 {
  margin-bottom: 5px;
  font-size: 24px;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.stats-grid,
.building-metrics,
.market-pulse {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.stats-grid div,
.market-pulse div,
.building-metrics div,
.selected-building,
.operations-panel,
.education-panel,
.portfolio-panel,
.opportunity-panel,
.city-updates-panel,
.suggestions-panel,
.goals-panel,
.map-layers-panel,
.strategy-panel,
.competition-panel,
.market-panel {
  border: 1px solid rgba(24, 37, 43, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 5px 18px rgba(24, 37, 43, 0.06);
}

.stats-grid div {
  min-width: 0;
  min-height: 48px;
  padding: 7px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 250, 240, 0.72)),
    linear-gradient(90deg, rgba(52, 122, 161, 0.12), transparent 42%);
}

.market-pulse {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.market-pulse div {
  min-height: 43px;
  padding: 7px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(52, 122, 161, 0.14), rgba(255, 255, 255, 0.72)),
    rgba(255, 255, 255, 0.7);
}

.building-metrics div {
  min-height: 50px;
  padding: 7px;
}

.stats-grid span,
.market-pulse span,
.building-metrics span {
  display: block;
  margin-bottom: 2px;
  color: #6e5544;
  font-size: 10px;
  font-weight: 900;
}

.stats-grid strong,
.market-pulse strong,
.building-metrics strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 15px;
}

.market-pulse strong {
  font-size: 13px;
}

.building-metrics div:nth-last-child(-n + 2) {
  background:
    linear-gradient(135deg, rgba(52, 122, 161, 0.12), rgba(255, 255, 255, 0.72)),
    rgba(255, 255, 255, 0.66);
}

.selected-building,
.operations-panel,
.education-panel,
.portfolio-panel,
.opportunity-panel,
.city-updates-panel,
.suggestions-panel,
.goals-panel,
.map-layers-panel,
.strategy-panel,
.competition-panel,
.market-panel {
  display: none;
  min-height: 0;
  overflow: auto;
  padding: 9px;
  content-visibility: auto;
  contain-intrinsic-size: 220px;
  overscroll-behavior: contain;
}

.panel-page.active {
  display: block;
  min-height: 0;
}

.panel-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  position: sticky;
  top: 0;
  z-index: 6;
  padding: 3px 0;
  background: rgba(255, 250, 240, 0.9);
  backdrop-filter: blur(10px);
}

.panel-tabs button {
  min-height: 34px;
  padding: 0 4px;
  border: 1px solid rgba(24, 37, 43, 0.12);
  background: rgba(255, 255, 255, 0.86);
  color: #263941;
  font-size: 11px;
  box-shadow: none;
  overflow-wrap: anywhere;
}

.panel-tabs button.active {
  background: linear-gradient(180deg, #347aa1, #244b62);
  color: #fffaf0;
}

.panel-stack {
  display: flex;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: auto;
  flex-direction: column;
  gap: 7px;
  padding-right: 2px;
}

.manager-panel,
.panel-stack,
.panel-page,
.selected-building,
.operations-panel,
.education-panel,
.portfolio-panel,
.opportunity-panel,
.city-updates-panel,
.suggestions-panel,
.goals-panel,
.map-layers-panel,
.strategy-panel,
.competition-panel,
.market-panel,
.portfolio-list,
.city-updates,
.skyline-jumps {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.manager-panel::-webkit-scrollbar,
.panel-stack::-webkit-scrollbar,
.panel-page::-webkit-scrollbar,
.selected-building::-webkit-scrollbar,
.operations-panel::-webkit-scrollbar,
.education-panel::-webkit-scrollbar,
.portfolio-panel::-webkit-scrollbar,
.opportunity-panel::-webkit-scrollbar,
.city-updates-panel::-webkit-scrollbar,
.suggestions-panel::-webkit-scrollbar,
.goals-panel::-webkit-scrollbar,
.map-layers-panel::-webkit-scrollbar,
.strategy-panel::-webkit-scrollbar,
.competition-panel::-webkit-scrollbar,
.market-panel::-webkit-scrollbar,
.portfolio-list::-webkit-scrollbar,
.city-updates::-webkit-scrollbar,
.skyline-jumps::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.operations-panel.panel-page.active {
  max-height: clamp(108px, 20vh, 184px);
}

.portfolio-panel.panel-page.active {
  max-height: clamp(58px, 10vh, 96px);
}

.opportunity-panel.panel-page.active {
  max-height: clamp(92px, 16vh, 150px);
}

.goals-panel.panel-page.active {
  max-height: clamp(82px, 14vh, 136px);
}

.selected-building.panel-page.active {
  max-height: clamp(225px, 43vh, 410px);
}

.strategy-panel.panel-page.active,
.education-panel.panel-page.active,
.market-panel.panel-page.active,
.suggestions-panel.panel-page.active {
  max-height: clamp(96px, 16vh, 170px);
}

.map-layers-panel.panel-page.active,
.competition-panel.panel-page.active,
.city-updates-panel.panel-page.active {
  max-height: clamp(142px, 30vh, 282px);
}

.panel-stack .panel-page.active {
  min-height: 0;
}

.selected-building {
  border-color: rgba(207, 63, 47, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 246, 230, 0.82)),
    linear-gradient(135deg, rgba(207, 63, 47, 0.1), transparent 34%);
}

.selected-building.panel-page.active {
  max-height: clamp(330px, 58vh, 620px);
}

.strategy-panel.panel-page.active {
  max-height: clamp(96px, 18vh, 180px);
}

.operations-panel {
  border-color: rgba(52, 122, 161, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(233, 244, 241, 0.84)),
    linear-gradient(135deg, rgba(52, 122, 161, 0.12), transparent 38%);
}

.operations-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 7px;
}

.next-move-card {
  display: grid;
  gap: 5px;
  margin-top: 7px;
  padding: 9px;
  border: 1px solid rgba(207, 63, 47, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(207, 63, 47, 0.1), rgba(255, 255, 255, 0.74)),
    rgba(255, 255, 255, 0.66);
}

.next-move-card span {
  color: #7a4d35;
  font-size: 10px;
  font-weight: 1000;
  text-transform: uppercase;
}

.next-move-card strong {
  color: #263941;
  font-size: 16px;
}

.next-move-card p {
  margin: 0;
  color: #5e6d72;
  font-size: 11px;
  line-height: 1.25;
}

.next-move-card button {
  width: 100%;
  min-height: 38px;
  margin-top: 2px;
  background: linear-gradient(180deg, #e5b24f, #b9791a);
  color: #24180c;
  font-size: 13px;
}

.operations-grid div {
  min-height: 46px;
  padding: 7px;
  border: 1px solid rgba(24, 37, 43, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.operations-grid span {
  display: block;
  margin-bottom: 3px;
  color: #6e5544;
  font-size: 11px;
  font-weight: 900;
}

.operations-grid strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 15px;
}

.directive-list {
  display: grid;
  gap: 6px;
  margin-top: 7px;
}

.directive-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  min-height: 48px;
  padding: 8px;
  border: 1px solid rgba(24, 37, 43, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(52, 122, 161, 0.16), rgba(255, 255, 255, 0.72)),
    rgba(255, 255, 255, 0.62);
  color: #263941;
  text-align: left;
  box-shadow: none;
}

.directive-card:hover {
  box-shadow: 0 10px 24px rgba(18, 31, 38, 0.14);
}

.directive-card span {
  width: fit-content;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(212, 154, 42, 0.16);
  color: #7a4d35;
  font-size: 11px;
  font-weight: 1000;
  text-transform: uppercase;
}

.directive-card strong {
  grid-column: 1;
  font-size: 14px;
  line-height: 1.1;
}

.directive-card em {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: #1f6649;
  font-size: 12px;
  font-style: normal;
  font-weight: 1000;
}

.directive-card b {
  display: none;
  grid-column: 1 / -1;
  color: #5e6d72;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.address,
.price-note,
.data-note {
  color: #66584b;
  font-size: 13px;
  line-height: 1.45;
}

.fact-copy {
  margin: 8px 0 6px;
  line-height: 1.45;
}

.selected-photo-wrap {
  width: 100%;
  aspect-ratio: 16 / 7.4;
  max-height: 128px;
  margin: 7px 0 8px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(24, 37, 43, 0.12);
  background: #dce6e4;
}

.selected-photo-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
}

.badge-row,
.filter-row,
.toggle-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 6px 0 8px;
}

.badge-row span,
.toggle-grid label {
  padding: 6px 8px;
  border: 1px solid rgba(24, 37, 43, 0.12);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
  color: #36464d;
  font-size: 12px;
  font-weight: 900;
}

.search-input {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid rgba(24, 37, 43, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.filter-row button {
  min-height: 32px;
  padding: 7px;
  color: #263941;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(24, 37, 43, 0.12);
  font-size: 12px;
}

.filter-row button.active {
  color: #fffaf0;
  background: linear-gradient(180deg, #347aa1, #244b62);
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.toggle-grid label {
  display: flex;
  gap: 7px;
  align-items: center;
}

.tracker-status {
  margin: 6px 0 0;
  padding: 7px;
  border: 1px solid rgba(24, 37, 43, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: #5e6d72;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.city-helper-box {
  display: grid;
  gap: 7px;
  margin-top: 9px;
  padding: 9px;
  border: 1px solid rgba(24, 37, 43, 0.1);
  border-radius: 8px;
  background: rgba(255, 252, 244, 0.7);
}

.panel-heading.compact {
  margin: 0;
}

.city-helper-list {
  display: grid;
  gap: 6px;
  max-height: 238px;
  overflow: auto;
}

.city-helper-summary {
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid rgba(207, 63, 47, 0.16);
  border-radius: 8px;
  background: rgba(255, 247, 226, 0.84);
}

.city-helper-summary b {
  overflow: hidden;
  color: #172b33;
  font-size: 13px;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.city-helper-summary span {
  color: #5d6870;
  font-size: 11px;
  font-weight: 780;
  line-height: 1.25;
}

.city-helper-item {
  display: grid;
  min-height: 45px;
  padding: 8px;
  border: 1px solid rgba(24, 37, 43, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  color: #172b33;
  text-align: left;
}

.city-helper-item b {
  overflow: hidden;
  font-size: 12px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.city-helper-item span {
  overflow: hidden;
  color: #617078;
  font-size: 10px;
  font-weight: 820;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.city-helper-item:hover,
.city-helper-item:focus-visible {
  border-color: rgba(207, 63, 47, 0.34);
  background: rgba(255, 247, 226, 0.95);
}

.panel-art {
  margin: 7px 0 8px;
  overflow: hidden;
  border: 1px solid rgba(24, 37, 43, 0.14);
  border-radius: 8px;
  background: #dce6e4;
  box-shadow: 0 10px 26px rgba(24, 37, 43, 0.12);
}

.panel-art img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 6.6;
  max-height: 124px;
  object-fit: cover;
  object-position: center 52%;
}

.intel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 7px;
}

.auction-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 7px;
}

.auction-grid div {
  min-height: 48px;
  padding: 7px;
  border: 1px solid rgba(24, 37, 43, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(207, 63, 47, 0.09), rgba(255, 255, 255, 0.64)),
    rgba(255, 255, 255, 0.6);
}

.auction-grid span {
  display: block;
  margin-bottom: 3px;
  color: #6e5544;
  font-size: 11px;
  font-weight: 900;
}

.auction-grid strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 15px;
}

.intel-grid div {
  min-height: 48px;
  padding: 7px;
  border: 1px solid rgba(24, 37, 43, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.intel-grid span {
  display: block;
  margin-bottom: 3px;
  color: #6e5544;
  font-size: 11px;
  font-weight: 900;
}

.intel-grid strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 15px;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-top: 9px;
}

.secondary-actions {
  margin-top: 8px;
}

.auction-actions {
  grid-template-columns: 1fr 1fr;
  margin-top: 10px;
}

.auction-actions button:first-child {
  background: linear-gradient(180deg, #e5b24f, #a86f18);
  color: #24180c;
}

.auction-actions button:last-child {
  background: linear-gradient(180deg, #6b7b82, #36464d);
}

.secondary-actions button {
  background: linear-gradient(180deg, #6b7b82, #36464d);
}

.action-row button {
  padding: 7px 6px;
  min-height: 38px;
  font-size: 12px;
}

#buy-button {
  background: linear-gradient(180deg, #e44d3d, #a92f27);
}

#lease-button {
  background: linear-gradient(180deg, #4e7d94, #2f5264);
}

#retrofit-button {
  background: linear-gradient(180deg, #2e9568, #1f6649);
}

button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.45);
  opacity: 0.48;
  transform: none;
  box-shadow: none;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  min-width: 0;
}

.panel-heading strong {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

#lesson-copy {
  min-height: 72px;
  margin-bottom: 12px;
  line-height: 1.45;
}

#next-lesson {
  width: 100%;
  background: linear-gradient(180deg, #e5b24f, #c18420);
  color: #24180c;
}

.portfolio-list {
  display: grid;
  gap: 6px;
  max-height: 112px;
  overflow: auto;
}

.opportunity-list {
  display: grid;
  gap: 6px;
  margin-top: 7px;
}

.opportunity-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(24, 37, 43, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(229, 178, 79, 0.13), rgba(255, 255, 255, 0.68)),
    rgba(255, 255, 255, 0.58);
  font-size: 12px;
}

.opportunity-item strong,
.opportunity-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

.opportunity-item span {
  color: #5e6d72;
  font-weight: 800;
}

.opportunity-item span:last-of-type {
  display: none;
}

.opportunity-item button {
  min-height: 30px;
  padding: 0 10px;
  background: linear-gradient(180deg, #347aa1, #244b62);
  font-size: 11px;
}

.portfolio-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(24, 37, 43, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  font-size: 13px;
}

.portfolio-item strong {
  font-size: 14px;
}

.portfolio-item span {
  color: #66584b;
}

.city-updates {
  display: grid;
  gap: 6px;
  max-height: 170px;
  overflow: auto;
  overscroll-behavior: contain;
}

.idea-list,
.goal-list,
.strategy-list {
  display: grid;
  gap: 6px;
}

.idea-card,
.goal-card,
.strategy-card {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid rgba(24, 37, 43, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(52, 122, 161, 0.1), rgba(255, 255, 255, 0.62)),
    rgba(255, 255, 255, 0.58);
  font-size: 12px;
  line-height: 1.35;
}

.idea-card strong,
.goal-card strong,
.strategy-card strong {
  color: #263941;
  font-size: 13px;
}

.idea-card span,
.goal-card span,
.strategy-card span {
  color: #5e6d72;
}

.strategy-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  background:
    linear-gradient(135deg, rgba(212, 154, 42, 0.13), rgba(255, 255, 255, 0.68)),
    rgba(255, 255, 255, 0.62);
}

.strategy-card span {
  grid-column: 1 / -1;
}

.strategy-card b {
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(52, 122, 161, 0.12);
  color: #244b62;
  font-size: 11px;
}

.rival-list {
  display: grid;
  gap: 6px;
  margin-top: 7px;
}

.rival-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(24, 37, 43, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  font-size: 12px;
}

.goal-card {
  gap: 5px;
}

.strategy-card span {
  line-height: 1.25;
}

.rival-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
}

.rival-item strong,
.rival-item span {
  display: block;
}

.rival-item span {
  color: #5e6d72;
}

.save-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 7px;
}

.save-row button {
  min-height: 38px;
  background: linear-gradient(180deg, #347aa1, #244b62);
  font-size: 12px;
}

.save-row button:last-child {
  background: linear-gradient(180deg, #9c6750, #684235);
}

.goal-card.complete {
  border-color: rgba(39, 127, 87, 0.28);
  background:
    linear-gradient(135deg, rgba(39, 127, 87, 0.16), rgba(255, 255, 255, 0.68)),
    rgba(255, 255, 255, 0.62);
}

.goal-progress {
  height: 7px;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(24, 37, 43, 0.1);
}

.goal-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #347aa1, #2e9568);
}

.city-update {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px;
  align-items: start;
  padding: 7px;
  border: 1px solid rgba(24, 37, 43, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  line-height: 1.35;
}

.city-update b {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  color: #fffaf0;
  background: linear-gradient(180deg, #347aa1, #244b62);
  font-size: 11px;
}

.city-update.active {
  border-color: rgba(207, 63, 47, 0.38);
  background:
    linear-gradient(135deg, rgba(207, 63, 47, 0.14), rgba(255, 255, 255, 0.72)),
    rgba(255, 255, 255, 0.62);
}

.city-update.active b {
  background: linear-gradient(180deg, #e44d3d, #a92f27);
}

.city-update strong {
  display: block;
  margin-bottom: 2px;
}

.city-update span {
  color: #5e6d72;
}

.achievement-list,
.timeline-list {
  display: grid;
  gap: 6px;
  margin-top: 7px;
}

.achievement,
.timeline-item {
  padding: 7px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(24, 37, 43, 0.1);
  font-size: 12px;
  line-height: 1.35;
}

.achievement strong,
.timeline-item strong {
  display: block;
}

.data-note {
  margin-top: auto;
  padding-bottom: 4px;
}

@media (max-width: 760px) {
  body {
    overflow: hidden;
  }

  .game-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, 34vh) minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .map-stage {
    height: auto;
    min-height: 0;
  }

  .map-ops-hud {
    left: 70px;
    right: 8px;
    width: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .map-ops-hud div {
    min-width: 0;
    min-height: 42px;
    padding: 7px 8px;
  }

  .map-ops-hud strong {
    font-size: 12px;
    line-height: 1.1;
  }

  .skyline-jumpbar {
    display: none;
  }

  .ticker {
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 9px 10px;
    font-size: 12px;
  }

  .market-pulse {
    display: none;
  }

  .manager-panel {
    gap: 5px;
    width: 100vw;
    max-width: 100vw;
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
    border-left: 0;
    border-top: 1px solid rgba(24, 37, 43, 0.12);
  }

  .panel-stack {
    overflow: auto;
    gap: 5px;
  }

  .stats-grid div {
    min-height: 42px;
    padding: 6px 7px;
  }

  .stats-grid strong {
    font-size: clamp(13px, 4vw, 14px);
  }

  .stats-grid span {
    font-size: 9px;
  }

  .selected-building.panel-page.active {
    max-height: min(46vh, 420px);
  }

  .operations-panel.panel-page.active,
  .opportunity-panel.panel-page.active,
  .portfolio-panel.panel-page.active,
  .goals-panel.panel-page.active,
  .map-layers-panel.panel-page.active,
  .competition-panel.panel-page.active,
  .market-panel.panel-page.active,
  .education-panel.panel-page.active,
  .suggestions-panel.panel-page.active,
  .city-updates-panel.panel-page.active {
    max-height: min(34vh, 280px);
  }

  .strategy-panel.panel-page.active {
    display: none;
  }
}

@media (max-width: 1200px) {
  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  .game-shell {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 148px minmax(0, 1fr);
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: #efe5d3;
  }

  .map-stage {
    height: auto;
    min-height: 0;
  }

  .map-toolbar {
    left: 10px;
    top: 10px;
    gap: 5px;
  }

  .map-toolbar button {
    width: 34px;
    height: 34px;
    min-height: 34px;
    font-size: 15px;
  }

  .map-ops-hud {
    left: 52px;
    top: 10px;
    right: 8px;
    width: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .map-ops-hud div {
    min-width: 0;
    min-height: 34px;
    padding: 5px 7px;
  }

  .map-ops-hud div:nth-child(n + 3),
  .skyline-jumpbar,
  .subway-legend,
  .map-attribution,
  .market-pulse,
  .strategy-panel.panel-page.active,
  .education-panel.panel-page.active,
  .suggestions-panel.panel-page.active,
  .city-updates-panel.panel-page.active,
  .data-note {
    display: none;
  }

  .map-ops-hud span {
    margin-bottom: 1px;
    font-size: 8px;
  }

  .map-ops-hud strong {
    font-size: 11px;
    line-height: 1.1;
  }

  .ticker {
    left: 8px;
    right: 8px;
    bottom: 8px;
    max-height: 36px;
    padding: 7px 9px;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.2;
  }

  .manager-panel {
    grid-template-rows: auto auto auto minmax(0, 1fr);
    gap: 4px;
    width: 100vw;
    max-width: 100vw;
    height: auto;
    min-height: 0;
    max-height: none;
    padding: 7px 8px 6px;
    overflow: hidden;
    border-left: 0;
    border-top: 1px solid rgba(24, 37, 43, 0.12);
  }

  .brand-strip {
    align-items: center;
    min-width: 0;
  }

  .brand-strip .eyebrow {
    margin-bottom: 1px;
    font-size: 9px;
  }

  h1 {
    font-size: clamp(21px, 4vw, 27px);
  }

  h2 {
    font-size: clamp(20px, 4vw, 24px);
  }

  #pause-toggle {
    position: static;
    width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }

  .stats-grid div {
    min-height: 48px;
    padding: 5px 6px;
  }

  .stats-grid span {
    margin-bottom: 1px;
    font-size: 8px;
  }

  .stats-grid strong {
    font-size: clamp(12px, 2.1vw, 15px);
    line-height: 1.05;
  }

  .panel-tabs {
    position: static;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 2px 0;
    background: transparent;
    backdrop-filter: none;
  }

  .panel-tabs button {
    min-height: 32px;
    padding: 0 2px;
    font-size: 10px;
  }

  .panel-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(0, 1fr);
    gap: 6px;
    min-height: 0;
    overflow: hidden;
    padding: 0;
  }

  .panel-page.active {
    min-height: 0;
    max-height: none;
    overflow: hidden;
    padding: 8px;
  }

  .panel-heading {
    gap: 6px;
  }

  .panel-heading .eyebrow,
  .panel-heading strong {
    font-size: 11px;
    line-height: 1.1;
  }

  .operations-panel.panel-page.active,
  .opportunity-panel.panel-page.active,
  .portfolio-panel.panel-page.active,
  .goals-panel.panel-page.active,
  .map-layers-panel.panel-page.active,
  .competition-panel.panel-page.active,
  .market-panel.panel-page.active {
    max-height: none;
  }

  .operations-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin-top: 5px;
  }

  .operations-grid div {
    min-height: 42px;
    padding: 5px;
  }

  .operations-grid span {
    font-size: 8px;
  }

  .operations-grid strong {
    font-size: 14px;
  }

  .next-move-card {
    margin-top: 5px;
    padding: 7px;
  }

  .next-move-card span,
  .directive-list,
  .next-move-card p {
    display: none;
  }

  .next-move-card strong {
    font-size: 15px;
    line-height: 1.1;
  }

  .next-move-card button {
    min-height: 30px;
    font-size: 11px;
  }

  .opportunity-list,
  .goal-list,
  .portfolio-list {
    gap: 5px;
    max-height: none;
    overflow: hidden;
  }

  .opportunity-item {
    min-height: 60px;
    padding: 7px;
  }

  .opportunity-item:nth-child(n + 2),
  .goal-card:nth-child(n + 2),
  .portfolio-item:nth-child(n + 2) {
    display: none;
  }

  .opportunity-item button {
    min-height: 32px;
    padding: 0 8px;
  }

  .goal-card {
    padding: 7px;
  }

  .goal-card strong,
  .opportunity-item strong,
  .portfolio-item strong {
    font-size: 13px;
    line-height: 1.15;
  }

  .goal-card span,
  .opportunity-item span,
  .portfolio-item span,
  .address {
    font-size: 11px;
    line-height: 1.25;
  }

  .selected-building.panel-page.active,
  .map-layers-panel.panel-page.active,
  .competition-panel.panel-page.active,
  .market-panel.panel-page.active {
    grid-column: 1 / -1;
    max-height: none;
  }

  .selected-photo-wrap {
    aspect-ratio: 16 / 5.5;
    max-height: 92px;
  }

  .selected-building .address {
    display: -webkit-box;
    margin-bottom: 5px;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .badge-row {
    max-height: 64px;
    overflow: hidden;
  }

  .building-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .building-metrics div {
    min-height: 42px;
    padding: 5px;
  }

  .building-metrics span {
    font-size: 8px;
  }

  .building-metrics strong {
    font-size: 12px;
  }

  .intel-grid,
  #famous-tenants,
  #price-note,
  .secondary-actions {
    display: none;
  }

  .fact-copy {
    display: -webkit-box;
    margin: 5px 0;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.3;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .action-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .action-row button {
    min-height: 34px;
    padding: 0 4px;
    font-size: 10px;
  }

  .filter-row,
  .toggle-grid,
  .intel-grid,
  .auction-grid {
    gap: 4px;
  }

  .filter-row button,
  .toggle-grid label {
    min-height: 30px;
    font-size: 10px;
  }

  .search-input {
    min-height: 34px;
  }
}

/* UI polish pass: desktop operations room, clearer map chrome, denser cards. */
@media (min-width: 901px) {
  :root {
    --paper: #f7efe0;
    --panel: #fffdf7;
    --ink: #14242b;
    --muted: #5b6870;
    --accent: #c94633;
    --gold: #dba43a;
    --blue: #286f91;
    --shadow: 0 18px 38px rgba(12, 28, 36, 0.18);
  }

  body {
    background:
      linear-gradient(135deg, #173d49 0, #2f8391 52%, #f0dfbd 52%, #f7efe0 100%);
  }

  .game-shell {
    grid-template-columns: minmax(650px, 1fr) clamp(400px, 32vw, 460px);
  }

  .map-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
      linear-gradient(90deg, rgba(20, 36, 43, 0.18), transparent 18%, transparent 74%, rgba(20, 36, 43, 0.18)),
      linear-gradient(180deg, rgba(255, 250, 238, 0.18), transparent 30%);
  }

  #city-map {
    position: relative;
    z-index: 0;
  }

  .map-toolbar,
  .map-ops-hud,
  .skyline-jumpbar,
  .subway-legend,
  .hover-card,
  .ticker,
  .map-attribution {
    z-index: 3;
  }

  .map-toolbar {
    gap: 10px;
  }

  .map-toolbar button,
  #pause-toggle {
    border: 1px solid rgba(255, 255, 255, 0.16);
    background:
      linear-gradient(180deg, rgba(35, 57, 67, 0.98), rgba(13, 25, 31, 0.96));
    box-shadow: 0 12px 28px rgba(8, 18, 23, 0.28);
  }

  .map-ops-hud {
    gap: 10px;
  }

  .map-ops-hud div,
  .skyline-jumpbar,
  .subway-legend,
  .ticker {
    border-color: rgba(255, 255, 255, 0.58);
    background: rgba(255, 252, 244, 0.9);
    box-shadow: 0 16px 36px rgba(12, 28, 36, 0.16);
    backdrop-filter: blur(14px);
  }

  .ticker {
    right: auto;
    bottom: 18px;
    width: min(570px, calc(100% - 36px));
    min-height: 42px;
    display: flex;
    align-items: center;
    border-left: 5px solid var(--gold);
  }

  .map-attribution {
    bottom: 68px;
    background: rgba(255, 252, 244, 0.86);
  }

  .manager-panel {
    gap: 10px;
    padding: 16px 10px 12px;
    border-left: 1px solid rgba(20, 36, 43, 0.14);
    background:
      linear-gradient(180deg, rgba(255, 253, 247, 0.98), rgba(241, 232, 213, 0.98)),
      linear-gradient(90deg, rgba(40, 111, 145, 0.08), transparent 42%);
    box-shadow: -18px 0 42px rgba(12, 28, 36, 0.16);
  }

  .brand-strip {
    align-items: center;
    padding: 0 2px;
  }

  .brand-strip h1 {
    font-size: clamp(25px, 2.4vw, 34px);
    line-height: 0.96;
  }

  .stats-grid {
    gap: 8px;
  }

  .stats-grid div {
    min-height: 58px;
    padding: 9px 10px;
    border-color: rgba(20, 36, 43, 0.1);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(250, 244, 232, 0.9)),
      linear-gradient(90deg, rgba(40, 111, 145, 0.12), transparent 48%);
  }

  .stats-grid strong {
    font-size: clamp(16px, 1.35vw, 20px);
  }

  .panel-tabs {
    gap: 7px;
    padding: 2px;
    border: 1px solid rgba(20, 36, 43, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.42);
  }

  .panel-tabs button {
    min-height: 36px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.7);
    color: #20333b;
  }

  .panel-tabs button.active {
    background: linear-gradient(180deg, #2f7e9e, #1c536b);
    color: #fffdf7;
    box-shadow: 0 8px 18px rgba(18, 61, 78, 0.22);
  }

  .panel-stack {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-auto-rows: min-content;
    gap: 8px;
    overflow: auto;
    padding-right: 0;
  }

  .panel-page.active {
    max-height: none;
    padding: 10px;
    border-color: rgba(20, 36, 43, 0.1);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 250, 239, 0.86)),
      rgba(255, 255, 255, 0.68);
    box-shadow: 0 10px 26px rgba(20, 36, 43, 0.08);
  }

  .operations-panel.panel-page.active,
  .selected-building.panel-page.active,
  .map-layers-panel.panel-page.active,
  .competition-panel.panel-page.active,
  .market-panel.panel-page.active,
  .suggestions-panel.panel-page.active,
  .city-updates-panel.panel-page.active {
    grid-column: 1 / -1;
  }

  .operations-panel.panel-page.active {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(142px, 0.78fr);
    gap: 9px;
  }

  .operations-panel .panel-heading {
    grid-column: 1 / -1;
  }

  .operations-grid {
    margin-top: 0;
  }

  .next-move-card {
    margin-top: 0;
    align-content: start;
    background:
      linear-gradient(135deg, rgba(219, 164, 58, 0.22), rgba(255, 255, 255, 0.76)),
      rgba(255, 255, 255, 0.74);
  }

  .next-move-card button,
  .opportunity-item button,
  .action-row button,
  .save-row button {
    border-radius: 7px;
  }

  .opportunity-panel.panel-page.active,
  .portfolio-panel.panel-page.active,
  .goals-panel.panel-page.active {
    min-height: 0;
  }

  .opportunity-item,
  .portfolio-item,
  .goal-card,
  .strategy-card,
  .idea-card,
  .rival-item,
  .city-update,
  .achievement,
  .timeline-item {
    background: rgba(255, 255, 255, 0.68);
  }

  .opportunity-item {
    grid-template-columns: minmax(0, 1fr) minmax(62px, auto);
  }

  .portfolio-panel,
  .goals-panel {
    align-self: start;
  }
}

/* True final mobile map tray override. Keep this as the last mobile layout block. */
@media (max-width: 900px) {
  html,
  body,
  .game-shell,
  .map-stage,
  #city-map {
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    overflow: hidden !important;
  }

  html,
  body {
    position: fixed !important;
    inset: 0 !important;
  }

  .game-shell,
  .map-stage {
    position: fixed !important;
    inset: 0 !important;
    display: block !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
  }

  .sheet-handle {
    display: grid !important;
    place-items: center !important;
    gap: 3px !important;
    width: 100% !important;
    min-height: 28px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: #1c2d35 !important;
    box-shadow: none !important;
    touch-action: none !important;
  }

  .sheet-handle span {
    display: block !important;
    width: 52px !important;
    height: 5px !important;
    border-radius: 999px !important;
    background: rgba(32, 54, 62, 0.38) !important;
  }

  .sheet-handle strong {
    font-size: 10px !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-transform: uppercase !important;
  }

  .manager-panel {
    position: fixed !important;
    inset: auto 0 0 0 !important;
    z-index: 30 !important;
    display: grid !important;
    grid-template-rows: auto auto auto auto minmax(0, 1fr) !important;
    gap: 7px !important;
    width: 100vw !important;
    height: 64dvh !important;
    min-height: 64dvh !important;
    max-height: 64dvh !important;
    padding: 6px 8px 10px !important;
    overflow: hidden !important;
    border: 1px solid rgba(18, 37, 46, 0.2) !important;
    border-bottom: 0 !important;
    border-radius: 18px 18px 0 0 !important;
    background: linear-gradient(180deg, rgba(255, 253, 246, 0.97), rgba(239, 231, 211, 0.98)) !important;
    box-shadow: 0 -18px 45px rgba(13, 26, 34, 0.24) !important;
    transform: translate3d(0, calc(100% - 74px), 0) !important;
    transition: transform 180ms ease !important;
    will-change: transform !important;
  }

  .manager-panel.is-expanded {
    transform: translate3d(0, 0, 0) !important;
  }

  .manager-panel.is-collapsed {
    transform: translate3d(0, calc(100% - 74px), 0) !important;
  }

  .manager-panel.is-collapsed .brand-strip,
  .manager-panel.is-collapsed .market-pulse,
  .manager-panel.is-collapsed .panel-tabs,
  .manager-panel.is-collapsed .panel-stack {
    display: none !important;
  }

  .manager-panel .brand-strip,
  .stats-grid,
  .market-pulse,
  .panel-tabs,
  .panel-stack {
    min-width: 0 !important;
  }

  .stats-grid,
  .market-pulse,
  .panel-tabs {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  .panel-tabs {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    position: static !important;
    overflow: visible !important;
    padding: 0 !important;
    background: transparent !important;
    backdrop-filter: none !important;
  }

  .panel-tabs button {
    display: block !important;
    min-width: 0 !important;
    width: auto !important;
    min-height: 38px !important;
    padding: 0 4px !important;
    overflow: hidden !important;
    font-size: clamp(10px, 3vw, 13px) !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .panel-stack {
    display: grid !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
  }

  .panel-page.active {
    min-height: 0 !important;
    max-height: 100% !important;
    overflow: hidden !important;
    scrollbar-width: none !important;
  }
}

@media (max-width: 560px) {
  .manager-panel {
    height: 66dvh !important;
    min-height: 66dvh !important;
    max-height: 66dvh !important;
    transform: translate3d(0, calc(100% - 72px), 0) !important;
  }

  .manager-panel.is-expanded {
    transform: translate3d(0, 0, 0) !important;
  }

  .manager-panel.is-collapsed {
    transform: translate3d(0, calc(100% - 72px), 0) !important;
  }
}

/* Absolute final mobile swipe sheet override. */
.sheet-handle {
  display: none;
}

@media (max-width: 900px) {
  html,
  body {
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    overflow: hidden !important;
  }

  body {
    position: fixed !important;
    inset: 0 !important;
    overscroll-behavior: none !important;
  }

  .game-shell {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    display: block !important;
    overflow: hidden !important;
    padding: 0 !important;
  }

  .map-stage {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 0 !important;
    touch-action: none !important;
  }

  #city-map {
    width: 100vw !important;
    height: 100dvh !important;
    touch-action: none !important;
  }

  .manager-panel {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 30 !important;
    width: 100vw !important;
    height: min(58dvh, 520px) !important;
    min-height: 0 !important;
    max-height: min(58dvh, 520px) !important;
    display: grid !important;
    grid-template-rows: auto auto auto auto minmax(0, 1fr) !important;
    gap: 7px !important;
    padding: 6px 8px 10px !important;
    overflow: hidden !important;
    border: 1px solid rgba(18, 37, 46, 0.2) !important;
    border-bottom: 0 !important;
    border-radius: 18px 18px 0 0 !important;
    background: linear-gradient(180deg, rgba(255, 253, 246, 0.97), rgba(239, 231, 211, 0.98)) !important;
    box-shadow: 0 -18px 45px rgba(13, 26, 34, 0.24) !important;
    transform: translateY(calc(100% - 76px)) !important;
    transition: transform 180ms ease !important;
    will-change: transform !important;
    overscroll-behavior: contain !important;
  }

  .manager-panel.is-expanded {
    transform: translateY(0) !important;
  }

  .manager-panel.is-collapsed {
    transform: translateY(calc(100% - 76px)) !important;
  }

  .sheet-handle {
    display: grid !important;
    place-items: center !important;
    gap: 3px !important;
    width: 100% !important;
    min-height: 28px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #1c2d35 !important;
    box-shadow: none !important;
    cursor: grab !important;
    touch-action: none !important;
  }

  .sheet-handle span {
    display: block !important;
    width: 52px !important;
    height: 5px !important;
    border-radius: 999px !important;
    background: rgba(32, 54, 62, 0.38) !important;
  }

  .sheet-handle strong {
    font-size: 10px !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-transform: uppercase !important;
  }

  .manager-panel.is-collapsed .brand-strip,
  .manager-panel.is-collapsed .market-pulse,
  .manager-panel.is-collapsed .panel-tabs,
  .manager-panel.is-collapsed .panel-stack {
    display: none !important;
  }

  .manager-panel .brand-strip {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    min-height: 48px !important;
    padding: 0 !important;
  }

  .manager-panel .brand-strip h1 {
    max-width: 100% !important;
    overflow: hidden !important;
    font-size: clamp(24px, 7vw, 34px) !important;
    line-height: 0.98 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .manager-panel .brand-strip .eyebrow {
    font-size: 11px !important;
  }

  #pause-toggle {
    width: 52px !important;
    height: 52px !important;
    min-height: 52px !important;
  }

  .stats-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important;
    min-height: 38px !important;
  }

  .stats-grid div {
    min-width: 0 !important;
    min-height: 38px !important;
    padding: 6px 7px !important;
    overflow: hidden !important;
  }

  .stats-grid span {
    display: block !important;
    overflow: hidden !important;
    font-size: 9px !important;
    line-height: 1 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .stats-grid strong {
    display: block !important;
    overflow: hidden !important;
    font-size: clamp(12px, 3.7vw, 17px) !important;
    line-height: 1.1 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .market-pulse {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  .market-pulse div {
    min-height: 38px !important;
    padding: 6px !important;
    overflow: hidden !important;
  }

  .market-pulse span,
  .market-pulse strong {
    display: block !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .market-pulse span {
    font-size: 8px !important;
  }

  .market-pulse strong {
    font-size: 12px !important;
  }

  .panel-tabs {
    position: static !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 5px !important;
    padding: 0 !important;
    overflow: visible !important;
    background: transparent !important;
    backdrop-filter: none !important;
  }

  .panel-tabs button {
    min-width: 0 !important;
    min-height: 38px !important;
    padding: 0 4px !important;
    overflow: hidden !important;
    font-size: clamp(10px, 3vw, 13px) !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .panel-stack {
    display: grid !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
  }

  .panel-page {
    min-height: 0 !important;
    overflow: hidden !important;
    scrollbar-width: none !important;
  }

  .panel-page::-webkit-scrollbar,
  .panel-stack::-webkit-scrollbar,
  .manager-panel::-webkit-scrollbar {
    display: none !important;
  }

  .panel-page.active {
    display: grid !important;
    align-content: start !important;
    min-height: 0 !important;
    max-height: 100% !important;
    padding: 9px !important;
    overflow: hidden !important;
  }

  .panel-heading {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    align-items: baseline !important;
    gap: 8px !important;
  }

  .panel-heading strong {
    min-width: 0 !important;
    overflow: hidden !important;
    font-size: clamp(15px, 4.8vw, 22px) !important;
    line-height: 1.1 !important;
    text-align: right !important;
    text-overflow: ellipsis !important;
  }

  .next-move-card,
  .opportunity-item,
  .portfolio-item,
  .goal-card {
    overflow: hidden !important;
  }

  .opportunity-list,
  .portfolio-list,
  .goal-list {
    max-height: none !important;
    overflow: hidden !important;
  }

  .opportunity-item:nth-child(n + 3),
  .portfolio-item:nth-child(n + 3),
  .goal-card:nth-child(n + 3) {
    display: none !important;
  }

  .map-toolbar {
    top: max(10px, env(safe-area-inset-top)) !important;
    right: 10px !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 20 !important;
  }

  .map-ops-hud,
  .skyline-jumpbar {
    display: none !important;
  }

  .ticker {
    right: 8px !important;
    bottom: 86px !important;
    left: 8px !important;
    z-index: 18 !important;
    max-width: none !important;
    pointer-events: none !important;
  }

  .hover-card {
    z-index: 22 !important;
  }

  .map-attribution {
    right: auto !important;
    bottom: 80px !important;
    left: 8px !important;
    z-index: 17 !important;
    max-width: calc(100vw - 16px) !important;
    pointer-events: none !important;
  }
}

@media (max-width: 560px) {
  .manager-panel {
    height: min(64dvh, 540px) !important;
    max-height: min(64dvh, 540px) !important;
    transform: translateY(calc(100% - 72px)) !important;
  }

  .manager-panel.is-collapsed {
    transform: translateY(calc(100% - 72px)) !important;
  }

  .manager-panel.is-expanded {
    transform: translateY(0) !important;
  }

  .stats-grid {
    gap: 4px !important;
  }

  .stats-grid div {
    min-height: 36px !important;
    padding: 5px !important;
  }

  .stats-grid span {
    font-size: 8px !important;
  }

  .stats-grid strong {
    font-size: clamp(11px, 3.4vw, 14px) !important;
  }

  .panel-page.active {
    padding: 8px !important;
  }

  .action-row button,
  .opportunity-item button,
  .next-move-card button {
    min-width: 0 !important;
    min-height: 38px !important;
    padding: 0 8px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
}

/* Absolute final mobile map-first pass. This must stay after legacy mobile rules. */
@media (max-width: 900px) {
  .game-shell {
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(58vh, 68dvh) minmax(0, 1fr) !important;
  }

  .map-stage {
    min-height: 58vh !important;
    height: 100% !important;
  }

  .manager-panel {
    height: auto !important;
    grid-template-rows: auto auto minmax(0, 1fr) !important;
    gap: 4px !important;
    padding: 6px !important;
  }

  .panel-tabs {
    display: none !important;
  }

  .operations-grid,
  .directive-list,
  .brand-strip .eyebrow {
    display: none !important;
  }

  .map-toolbar button {
    width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
  }

  .map-ops-hud {
    left: 58px !important;
    right: 8px !important;
    top: 10px !important;
    width: auto !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .map-ops-hud div:nth-child(n + 3) {
    display: none !important;
  }
}

@media (max-width: 560px) {
  .game-shell {
    grid-template-rows: minmax(66vh, 72dvh) minmax(0, 1fr) !important;
  }

  .map-stage {
    min-height: 66vh !important;
  }

  .brand-strip,
  .operations-panel.panel-page.active,
  .portfolio-panel.panel-page.active {
    display: none !important;
  }

  .manager-panel {
    grid-template-rows: auto minmax(0, 1fr) !important;
    padding: 5px !important;
  }

  .stats-grid div {
    min-height: 34px !important;
    padding: 3px 4px !important;
  }

  .stats-grid span {
    margin-bottom: 0 !important;
    font-size: 7px !important;
  }

  .stats-grid strong {
    font-size: 10px !important;
  }

  .panel-stack {
    gap: 4px !important;
  }
}

@media (max-width: 560px) {
  .map-stage {
    min-height: 0;
  }

  .map-ops-hud {
    left: 62px;
    right: 8px;
    top: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: auto;
  }

  .map-ops-hud div {
    min-height: 42px;
    padding: 7px 8px;
  }

  .map-ops-hud div:nth-child(n + 3) {
    display: none;
  }

  .hover-card {
    grid-template-columns: 86px minmax(0, 1fr);
    width: calc(100% - 24px);
    padding: 8px;
  }

  .hover-photo-wrap,
  .hover-photo-wrap img {
    min-height: 106px;
  }

  .stats-grid,
  .building-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .panel-tabs {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .panel-tabs button {
    min-height: 32px;
    padding: 0 2px;
    font-size: 10px;
  }

  .action-row {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(22px, 6vw, 27px);
  }

  h2 {
    font-size: clamp(20px, 6vw, 24px);
  }
}

@media (max-width: 760px) {
  body {
    overflow: hidden;
  }

  .game-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 156px minmax(0, 1fr);
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  .map-stage {
    min-height: 0;
    height: auto;
  }

  .map-toolbar {
    left: 10px;
    top: 10px;
    gap: 5px;
  }

  .map-toolbar button,
  #pause-toggle {
    width: 36px;
    height: 36px;
    min-height: 36px;
    font-size: 16px;
  }

  .map-ops-hud {
    left: 54px;
    top: 10px;
    right: 8px;
    width: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .map-ops-hud div {
    min-width: 0;
    min-height: 34px;
    padding: 5px 7px;
  }

  .map-ops-hud div:nth-child(n + 3),
  .skyline-jumpbar,
  .map-attribution,
  .market-pulse,
  .strategy-panel.panel-page.active,
  .education-panel.panel-page.active,
  .suggestions-panel.panel-page.active,
  .city-updates-panel.panel-page.active,
  .data-note {
    display: none;
  }

  .map-ops-hud span {
    margin-bottom: 1px;
    font-size: 8px;
  }

  .map-ops-hud strong {
    font-size: 11px;
    line-height: 1.1;
  }

  .ticker {
    left: 8px;
    right: 8px;
    bottom: 8px;
    max-height: 38px;
    padding: 7px 9px;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.2;
  }

  .manager-panel {
    grid-template-rows: auto auto auto minmax(0, 1fr);
    gap: 4px;
    width: 100vw;
    max-width: 100vw;
    min-height: 0;
    padding: 7px 8px 6px;
    overflow: hidden;
    border-left: 0;
    border-top: 1px solid rgba(24, 37, 43, 0.12);
  }

  .brand-strip {
    align-items: center;
    min-width: 0;
  }

  .brand-strip .eyebrow {
    margin-bottom: 1px;
    font-size: 9px;
  }

  h1 {
    font-size: clamp(21px, 5.5vw, 25px);
  }

  h2 {
    font-size: clamp(20px, 5.5vw, 24px);
  }

  #pause-toggle {
    position: static;
    width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }

  .stats-grid div {
    min-height: 48px;
    padding: 5px 6px;
  }

  .stats-grid span {
    margin-bottom: 1px;
    font-size: 8px;
  }

  .stats-grid strong {
    font-size: clamp(12px, 3.4vw, 14px);
    line-height: 1.05;
  }

  .panel-tabs {
    position: static;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 2px 0;
    background: transparent;
    backdrop-filter: none;
  }

  .panel-tabs button {
    min-height: 32px;
    padding: 0 2px;
    font-size: 10px;
  }

  .panel-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(0, 1fr);
    gap: 6px;
    min-height: 0;
    overflow: hidden;
    padding: 0;
  }

  .panel-page.active {
    min-height: 0;
    max-height: none;
    overflow: hidden;
    padding: 8px;
  }

  .panel-heading {
    gap: 6px;
  }

  .panel-heading .eyebrow,
  .panel-heading strong {
    font-size: 11px;
    line-height: 1.1;
  }

  .operations-panel,
  .opportunity-panel,
  .portfolio-panel,
  .goals-panel,
  .selected-building,
  .map-layers-panel,
  .competition-panel,
  .market-panel {
    cursor: pointer;
  }

  .operations-panel.panel-page.active,
  .opportunity-panel.panel-page.active,
  .portfolio-panel.panel-page.active,
  .goals-panel.panel-page.active,
  .map-layers-panel.panel-page.active,
  .competition-panel.panel-page.active,
  .market-panel.panel-page.active {
    max-height: none;
  }

  .operations-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin-top: 5px;
  }

  .operations-grid div {
    min-height: 42px;
    padding: 5px;
  }

  .operations-grid span {
    font-size: 8px;
  }

  .operations-grid strong {
    font-size: 14px;
  }

  .next-move-card {
    margin-top: 5px;
    padding: 7px;
  }

  .next-move-card span,
  .directive-list,
  .next-move-card p {
    display: none;
  }

  .next-move-card strong {
    font-size: 15px;
    line-height: 1.1;
  }

  .next-move-card button {
    min-height: 30px;
    font-size: 11px;
  }

  .opportunity-list,
  .goal-list,
  .portfolio-list {
    gap: 5px;
    max-height: none;
    overflow: hidden;
  }

  .opportunity-item {
    min-height: 60px;
    padding: 7px;
  }

  .opportunity-item:nth-child(n + 2),
  .goal-card:nth-child(n + 2),
  .portfolio-item:nth-child(n + 2) {
    display: none;
  }

  .opportunity-item button {
    min-height: 32px;
    padding: 0 8px;
  }

  .goal-card {
    padding: 7px;
  }

  .goal-card strong,
  .opportunity-item strong,
  .portfolio-item strong {
    font-size: 13px;
    line-height: 1.15;
  }

  .goal-card span,
  .opportunity-item span,
  .portfolio-item span,
  .address {
    font-size: 11px;
    line-height: 1.25;
  }

  .selected-building.panel-page.active,
  .map-layers-panel.panel-page.active,
  .competition-panel.panel-page.active,
  .market-panel.panel-page.active {
    grid-column: 1 / -1;
    max-height: none;
  }

  .selected-photo-wrap {
    aspect-ratio: 16 / 5.5;
    max-height: 92px;
  }

  .selected-building .address {
    display: -webkit-box;
    margin-bottom: 5px;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .badge-row {
    max-height: 64px;
    overflow: hidden;
  }

  .building-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .building-metrics div {
    min-height: 42px;
    padding: 5px;
  }

  .building-metrics span {
    font-size: 8px;
  }

  .building-metrics strong {
    font-size: 12px;
  }

  .intel-grid,
  #famous-tenants,
  #price-note,
  .secondary-actions {
    display: none;
  }

  .fact-copy {
    display: -webkit-box;
    margin: 5px 0;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.3;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .action-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .action-row button {
    min-height: 34px;
    padding: 0 4px;
    font-size: 10px;
  }

  .filter-row,
  .toggle-grid,
  .intel-grid,
  .auction-grid {
    gap: 4px;
  }

  .filter-row button,
  .toggle-grid label {
    min-height: 30px;
    font-size: 10px;
  }

  .search-input {
    min-height: 34px;
  }
}
