:root {
  --bg: #f5efe3;
  --bg-strong: #143642;
  --panel: rgba(255, 250, 242, 0.88);
  --panel-strong: #fffaf2;
  --line: rgba(20, 54, 66, 0.14);
  --text: #17313a;
  --muted: #5a7178;
  --accent: #cb5f2f;
  --accent-soft: rgba(203, 95, 47, 0.12);
  --cluster: #1a6a8f;
  --shadow: 0 22px 60px rgba(23, 49, 58, 0.16);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(203, 95, 47, 0.20), transparent 36%),
    radial-gradient(circle at top right, rgba(26, 106, 143, 0.18), transparent 28%),
    linear-gradient(180deg, #f7f1e7, #eef4f6 58%, #f4ede3);
  color: var(--text);
  font-family: "IBM Plex Sans KR", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(360px, 450px) 1fr;
  height: 100vh;
  gap: 18px;
  padding: 18px;
  overflow: hidden;
}

.sidebar,
.map-shell {
  min-height: 0;
  height: 100%;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: var(--radius-xl);
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  scrollbar-gutter: stable;
}

.sidebar > * {
  flex-shrink: 0;
}

.brand-block {
  position: relative;
  isolation: isolate;
  overflow: visible;
  min-height: 176px;
  padding: 22px 22px 20px;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(20, 54, 66, 0.98), rgba(26, 106, 143, 0.86)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent);
  color: white;
}

.brand-block > * {
  position: relative;
  z-index: 1;
}

.brand-block::after {
  content: "";
  position: absolute;
  inset: auto -18% -35% auto;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.78;
}

.hero-title {
  margin: 10px 0 8px;
  font-family: "Fraunces", serif;
  font-size: clamp(24px, 3.2vw, 36px);
  line-height: 1.04;
  overflow-wrap: anywhere;
}

.hero-copy {
  margin: 0;
  max-width: 28ch;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.84);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-card {
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.stat-value {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
}

.control-panel {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
}

.field-label {
  display: block;
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.field-label + .field-control,
.field-control + .field-label {
  margin-top: 6px;
}

.field-control {
  width: 100%;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
}

.field-control:focus {
  outline: 2px solid rgba(26, 106, 143, 0.24);
  border-color: rgba(26, 106, 143, 0.35);
}

.control-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.ghost-button {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.ghost-button:hover {
  background: rgba(20, 54, 66, 0.06);
}

.ghost-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.ghost-button--accent {
  background: rgba(26, 106, 143, 0.08);
  border-color: rgba(26, 106, 143, 0.18);
  color: #1a5f7e;
}

.control-status {
  margin-top: 10px;
  min-height: 18px;
  font-size: 12px;
  color: var(--muted);
}

.control-status[data-tone="success"] {
  color: #1d6e59;
}

.control-status[data-tone="error"] {
  color: #9b3f2b;
}

.list-section {
  flex: 0 0 auto;
  min-height: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: visible;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.section-header h2 {
  margin: 0;
  font-size: 18px;
}

.section-count {
  color: var(--muted);
  font-size: 13px;
}

.result-list {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 12px;
  min-height: auto;
  overflow: visible;
  padding-right: 0;
}

.result-card {
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  overflow: hidden;
}

.result-card__body {
  display: block;
  width: 100%;
  padding: 16px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.result-card__body:hover {
  background: rgba(26, 106, 143, 0.06);
}

.result-card__body:focus-visible {
  outline: 2px solid rgba(26, 106, 143, 0.32);
  outline-offset: -2px;
}

.result-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.result-card__title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  word-break: keep-all;
}

.result-card__badge {
  flex: none;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.result-card__region,
.result-card__address {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.result-card__meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(20, 54, 66, 0.07);
  color: var(--text);
  font-size: 12px;
}

.empty-state {
  padding: 24px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.52);
}

.map-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow: var(--shadow);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.6), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.58));
}

.map-frame {
  flex: 1;
  min-height: 72vh;
  background:
    radial-gradient(circle at 18% 24%, rgba(255, 255, 255, 0.72), transparent 18%),
    radial-gradient(circle at 82% 12%, rgba(255, 255, 255, 0.45), transparent 14%),
    linear-gradient(180deg, #d5e9f2 0%, #dceff5 39%, #e8efdf 39.01%, #f1e7d7 100%);
}

.leaflet-container {
  background:
    radial-gradient(circle at 18% 24%, rgba(255, 255, 255, 0.72), transparent 18%),
    radial-gradient(circle at 82% 12%, rgba(255, 255, 255, 0.45), transparent 14%),
    linear-gradient(180deg, #d5e9f2 0%, #dceff5 39%, #e8efdf 39.01%, #f1e7d7 100%);
  font-family: "IBM Plex Sans KR", sans-serif;
}

.leaflet-control-zoom {
  border: 0;
  box-shadow: 0 14px 28px rgba(23, 49, 58, 0.16);
}

.leaflet-control-zoom a {
  width: 36px;
  height: 36px;
  line-height: 34px;
  border: 1px solid rgba(23, 49, 58, 0.12);
  color: var(--text);
  background: rgba(255, 250, 242, 0.96);
}

.leaflet-control-zoom a:hover {
  background: white;
}

.hotel-marker-shell,
.safehotelmap-cluster {
  background: transparent;
  border: 0;
}

.user-location-shell {
  background: transparent;
  border: 0;
}

.user-location-dot {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(47, 111, 148, 0.92);
  border: 3px solid rgba(255, 255, 255, 0.98);
  box-shadow: 0 0 0 8px rgba(90, 169, 222, 0.18), 0 12px 20px rgba(19, 54, 74, 0.16);
}

.user-location-dot::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 999px;
  background: white;
  opacity: 0.96;
}

.province-label-marker {
  background: transparent;
  border: 0;
}

.province-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(23, 49, 58, 0.12);
  background: rgba(255, 255, 255, 0.74);
  color: #18343f;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  box-shadow: 0 14px 24px rgba(23, 49, 58, 0.12);
  backdrop-filter: blur(8px);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.province-label::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--province-accent, #5f7580);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--province-fill, #e4ebef) 72%, white);
}

.province-label.is-active {
  background: color-mix(in srgb, var(--province-accent, #5f7580) 88%, white);
  color: white;
  border-color: transparent;
  box-shadow: 0 18px 32px rgba(23, 49, 58, 0.2);
}

.province-label.is-active::before {
  background: white;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.28);
}

.province-label.is-dim {
  opacity: 0.3;
  transform: translate(-50%, -50%) scale(0.96);
}

.hotel-pin {
  position: relative;
  width: 20px;
  height: 28px;
  transform-origin: 50% 100%;
  filter: saturate(1.02);
}

.hotel-pin::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1px;
  width: 18px;
  height: 18px;
  border-radius: 999px 999px 999px 2px;
  background: linear-gradient(180deg, #dd7a46, #bc4d2a);
  border: 2px solid rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 16px rgba(23, 49, 58, 0.22);
  transform: rotate(-45deg);
}

.hotel-pin::after {
  content: "";
  position: absolute;
  left: 9px;
  bottom: 1px;
  width: 4px;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(180deg, #bc4d2a, #8f3419);
  transform: translateX(-50%);
}

.hotel-pin__core {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 251, 245, 0.96);
  box-shadow: inset 0 0 0 1px rgba(23, 49, 58, 0.08);
  z-index: 1;
}

.hotel-pin.is-merged::before {
  background: linear-gradient(180deg, #2d718d, #20556d);
}

.hotel-pin.is-merged::after {
  background: linear-gradient(180deg, #20556d, #183f52);
}

.hotel-pin__badge {
  position: absolute;
  top: -5px;
  right: -5px;
  z-index: 2;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff7ef;
  color: #9c451d;
  border: 1px solid rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 16px rgba(23, 49, 58, 0.18);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

.hotel-pin.is-merged .hotel-pin__badge {
  color: #1f5e7a;
}

.hotel-pin.is-spiderfied {
  animation: spiderfy-pin-in 0.24s ease;
}

.safehotelmap-popup .leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: 18px;
  background: #fffaf2;
  box-shadow: 0 16px 32px rgba(23, 49, 58, 0.16);
}

.safehotelmap-popup .leaflet-popup-content {
  margin: 0;
}

.safehotelmap-popup .leaflet-popup-tip {
  background: #fffaf2;
}

.safehotelmap-popup .leaflet-popup-close-button {
  color: #6c5544;
  padding: 10px 12px 0 0;
}

.naver-popup-card {
  min-width: 240px;
  padding: 12px 14px;
  border-radius: 18px;
  background: #fffaf2;
  box-shadow: 0 16px 32px rgba(23, 49, 58, 0.16);
  font-family: "IBM Plex Sans KR", sans-serif;
}

.popup-title {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.4;
}

.popup-line {
  margin: 4px 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.naver-cluster-bubble {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  color: white;
  font-size: 12px;
  font-weight: 700;
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 24px rgba(19, 54, 74, 0.22);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.naver-cluster-bubble span {
  line-height: 1;
}

.naver-cluster-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 16px 28px rgba(19, 54, 74, 0.28);
}

.naver-cluster-bubble.cluster-level-1 {
  background: linear-gradient(180deg, #2d718d, #20556d);
}

.naver-cluster-bubble.cluster-level-2 {
  background: linear-gradient(180deg, #3a7f7b, #295d59);
}

.naver-cluster-bubble.cluster-level-3 {
  background: linear-gradient(180deg, #98754c, #725538);
}

.naver-cluster-bubble.cluster-level-4 {
  background: linear-gradient(180deg, #a45f4a, #7a4335);
}

.naver-cluster-bubble.cluster-level-5 {
  background: linear-gradient(180deg, #864950, #5f2d35);
}

.map-error-panel {
  display: grid;
  gap: 8px;
  place-items: start;
  margin: 18px;
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(255, 250, 242, 0.96);
  border: 1px solid rgba(23, 49, 58, 0.12);
  box-shadow: 0 16px 32px rgba(23, 49, 58, 0.12);
}

.map-error-panel strong {
  font-size: 14px;
}

.map-error-panel span {
  color: var(--muted);
  line-height: 1.5;
}

@keyframes spiderfy-pin-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.72);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1100px) {
  .page-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .sidebar {
    order: 2;
    height: auto;
    overflow: visible;
  }

  .map-shell {
    order: 1;
    height: auto;
    min-height: 58vh;
  }

  .map-frame {
    min-height: 58vh;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 12px;
    gap: 12px;
  }

  .sidebar,
  .map-shell {
    border-radius: 22px;
  }

  .sidebar {
    padding: 16px;
  }

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

  .control-actions {
    justify-content: stretch;
  }

  .control-actions .ghost-button {
    width: 100%;
  }

  .result-card__header {
    flex-direction: column;
    gap: 8px;
  }
}
