@media (max-height: 930px) {
  .app-shell {
    padding-top: 36px;
    padding-bottom: 36px;
  }

  .page-header {
    margin-bottom: 42px;
  }

  .map-stage,
  .map-root {
    min-height: min(560px, calc(100vh - 220px));
  }

  .map-root svg {
    max-height: calc(100vh - 190px);
  }
}

@media (max-height: 780px) {
  .app-shell {
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .page-header {
    margin-bottom: 24px;
  }

  .map-stage,
  .map-root {
    min-height: 500px;
  }

  .map-root svg {
    max-height: none;
  }
}

@media (max-width: 1400px) {
  .app-shell {
    padding-right: clamp(24px, 3vw, 48px);
    padding-left: clamp(24px, 3vw, 48px);
  }

  .page-header {
    gap: 32px;
  }

  .workspace {
    gap: 28px;
  }

  .map-root svg {
    width: min(100%, 860px);
  }
}

@media (max-width: 1180px) {
  .page-header {
    margin-bottom: 36px;
  }

  .workspace {
    grid-template-columns: 280px minmax(420px, 1fr);
  }

  .workspace > .summary-panel {
    position: static;
    grid-column: 1 / -1;
    grid-row: 2;
    width: auto;
    max-width: none;
  }

  .map-stage,
  .map-root {
    min-height: min(500px, calc(100vh - 190px));
  }

  .summary-body {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
  }

  .summary-body p {
    margin: 4px 0;
  }
}

body.is-embed-mode:not(.is-embed-fullscreen) .app-shell {
  padding: 18px;
}

body.is-embed-mode:not(.is-embed-fullscreen) .page-header {
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 22px;
}

body.is-embed-mode:not(.is-embed-fullscreen) .header-rule {
  display: none;
}

body.is-embed-mode:not(.is-embed-fullscreen) .page-header h1 {
  font-size: 1.35rem;
}

body.is-embed-mode:not(.is-embed-fullscreen) .workspace {
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 18px;
}

body.is-embed-mode:not(.is-embed-fullscreen) .workspace > .summary-panel {
  position: static;
  grid-column: 1 / -1;
  grid-row: 2;
  width: auto;
  max-width: none;
}

body.is-embed-mode:not(.is-embed-fullscreen) .map-stage,
body.is-embed-mode:not(.is-embed-fullscreen) .map-root {
  min-height: 420px;
}

body.is-embed-mode:not(.is-embed-fullscreen) .map-root svg {
  width: 100%;
}

body.is-embed-mode:not(.is-embed-fullscreen) .filter-section {
  padding: 10px;
}

body.is-embed-mode:not(.is-embed-fullscreen) .filter-option {
  margin: 6px 0;
  font-size: 0.86rem;
}

body.is-embed-mode:not(.is-embed-fullscreen) .summary-body {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

body.is-embed-mode:not(.is-embed-fullscreen) .summary-body p {
  margin: 4px 0;
}

body.is-embed-mode.is-embed-fullscreen .app-shell {
  padding: 24px;
}

@media (max-width: 900px) {
  .app-shell {
    padding: 32px 18px;
  }

  .page-header {
    grid-template-columns: 1fr;
    gap: 18px;
    margin-bottom: 32px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .map-stage,
  .map-root {
    min-height: 420px;
  }

  .workspace > .summary-panel {
    position: static;
    grid-column: auto;
    grid-row: auto;
    width: auto;
    max-width: none;
    margin-bottom: 16px;
  }
}

@media (max-width: 620px) {
  .app-shell {
    padding: 24px 14px;
  }

  .page-header h1 {
    font-size: 1.35rem;
  }

  .map-stage,
  .map-root {
    min-height: 340px;
  }

  .summary-body {
    display: block;
  }

  .app-footer {
    justify-content: center;
  }
}
