html,
body {
  max-width: 100%;
  overflow-x: hidden !important;
}

body.split-home {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(135deg, #f7f0e6 0%, #fbfaf6 56%, #edf2ed 100%);
  color: #2a2420;
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
}

.split-home-page {
  width: min(1120px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  align-content: center;
  gap: 34px;
  padding: 56px 0;
  box-sizing: border-box;
}

.split-intro {
  max-width: 760px;
}

.split-kicker {
  margin: 0 0 12px;
  color: #a9461d;
  font-size: 13px;
  font-weight: 900;
}

.split-intro h1 {
  margin: 0;
  color: #2a2420;
  font-family: "Gowun Batang", "Noto Serif KR", serif;
  font-size: clamp(42px, 7vw, 84px);
  line-height: 1.04;
  letter-spacing: 0;
}

.split-lead {
  max-width: 650px;
  margin: 18px 0 0;
  color: #5d564e;
  font-size: 18px;
  line-height: 1.7;
  word-break: keep-all;
}

.split-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.split-card {
  min-height: 218px;
  display: grid;
  align-content: end;
  gap: 12px;
  padding: 28px;
  border: 1px solid rgba(86, 66, 45, .16);
  border-radius: 8px;
  background: rgba(255, 250, 240, .76);
  color: #2f2a24;
  text-decoration: none;
  box-shadow: 0 18px 46px rgba(54, 37, 22, .10);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.split-card:hover,
.split-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(84, 122, 90, .42);
  box-shadow: 0 24px 58px rgba(54, 37, 22, .16);
  outline: none;
}

.split-card-primary {
  background: linear-gradient(135deg, rgba(255, 250, 240, .92), rgba(244, 236, 220, .88));
}

.split-card-label {
  width: fit-content;
  border: 1px solid rgba(201, 95, 42, .26);
  border-radius: 999px;
  padding: 6px 10px;
  color: #a9461d;
  background: rgba(255, 255, 255, .58);
  font-size: 12px;
  font-weight: 900;
}

.split-card strong {
  color: #263b2d;
  font-size: 30px;
  line-height: 1.15;
}

.split-card span:last-child {
  color: #655f57;
  font-size: 15px;
  line-height: 1.65;
  word-break: keep-all;
}

body.presentation-only {
  background: #f6efe3;
}

body.presentation-only #mapMode,
body.presentation-only #map-section,
body.presentation-only #slideMode {
  display: none !important;
}

body.presentation-only #imageSlideDeck {
  display: flex !important;
}

body.presentation-only #imageDeckSkipToMap,
body.presentation-only #imageDeckMapCta,
body.presentation-only .image-deck-help,
body.presentation-only #imageDeckDots .image-deck-dot:last-child {
  display: none !important;
}

#mapMode,
#mapMode.visible {
  max-width: 100vw;
  overflow-x: hidden !important;
}

@media (max-width: 860px) {
  .split-home-page {
    width: min(100% - 28px, 680px);
    padding: 32px 0;
  }

  .split-choice {
    grid-template-columns: 1fr;
  }

  .split-card {
    min-height: 184px;
    padding: 22px;
  }

  .split-lead {
    font-size: 16px;
  }

  body.presentation-only {
    overflow: auto !important;
  }

  #mapMode.visible {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto minmax(300px, 38dvh) auto !important;
  }

  #mapMode.visible .map-header {
    width: 100vw;
    min-width: 0;
    height: auto !important;
    min-height: 96px !important;
    overflow-x: hidden;
    overflow-y: hidden;
    flex-wrap: wrap;
    gap: 8px;
    align-content: center;
    padding: 12px 10px 8px;
    white-space: normal;
    scrollbar-width: none;
  }

  #mapMode.visible .map-header::-webkit-scrollbar {
    display: none;
  }

  #mapMode .map-title-small {
    flex: 1 0 100%;
    max-width: none;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #mapMode .map-help,
  #mapMode .ai-badges {
    display: none !important;
  }

  #mapMode .v5-header-actions {
    flex: 1 1 100%;
    margin-left: 0;
    gap: 5px;
    flex-wrap: wrap;
  }

  #mapMode .v5-header-btn,
  #mapMode.visible .map-header .nav-btn {
    flex: 0 1 auto;
    padding: 6px 9px;
    font-size: 11px;
  }

  #mapMode.visible .full-map-wrap {
    width: 100vw;
    margin: 0 !important;
    overflow: hidden;
  }

  #mapMode.visible .right-panel {
    width: 100vw;
    overflow-x: hidden;
  }

  #mapMode .map-empty-state {
    left: 20px !important;
    right: 20px !important;
    top: 50% !important;
    width: auto !important;
    max-width: calc(100vw - 40px) !important;
    box-sizing: border-box;
    transform: translateY(-50%) !important;
    padding: 18px 14px;
  }

  #mapMode .map-empty-state span {
    font-size: 11.5px;
    line-height: 1.55;
    max-width: 280px;
    margin: 0 auto;
    overflow: visible;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  #mapMode .right-content {
    overflow-x: hidden;
    padding-left: 10px;
    padding-right: 10px;
  }

  #mapMode .v5-top-panel,
  #mapMode .v5-tab-card,
  #mapMode .panel-card {
    max-width: calc(100vw - 20px);
    box-sizing: border-box;
    overflow: hidden;
  }

  #mapMode .tabs {
    width: 100%;
  }

  #mapMode .v5-source-chips {
    max-width: 100%;
    overflow-x: hidden;
    flex-wrap: wrap;
  }

  #mapMode .v5-source-chip {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.35;
  }

  #mapMode .v5-tab-card .v5-source-chips {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  #mapMode .v5-tab-card .v5-source-chip {
    width: 100%;
    justify-content: center;
    padding: 6px 7px;
    font-size: 10.5px;
    text-align: center;
  }
}
