:root {
  color-scheme: dark;
  --ocean: #0b2229;
  --map-ocean: #112e37;
  --line: #294750;
  --ink: #e4efeb;
  --muted: #a1b8b8;
  --teal: #72d3c6;
  --sand: #dfba7a;
  --sans: "Noto Sans KR", sans-serif;
  --serif: "Noto Serif KR", Georgia, serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--ocean);
  font: 15px/1.5 var(--sans);
  font-variant-numeric: tabular-nums;
}
button, select { font: inherit; }
button, select, a { -webkit-tap-highlight-color: transparent; }
button, select { color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; }

.dashboard {
  display: grid;
  grid-template-columns: minmax(540px, 32%) minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  min-height: 720px;
}
.map-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  background: var(--map-ocean);
  border-right: 1px solid var(--line);
}
.map-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px 10px;
}
h1, h2 { margin: 0; font-family: var(--serif); font-weight: 650; }
h1 { font-size: 26px; letter-spacing: -0.035em; }
h2 { font-size: 30px; letter-spacing: -0.04em; }
.map-header > span { color: var(--muted); font-size: 14px; white-space: nowrap; }
.map-header strong { color: var(--ink); font-size: 17px; font-weight: 550; }
.satellite-toggle {
  margin-left: auto;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--ocean);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}
.satellite-toggle[aria-pressed="true"] { border-color: var(--teal); color: var(--teal); }
.map-shell { position: relative; min-height: 0; overflow: hidden; background: var(--map-ocean); }
.satellite-layer { position: absolute; inset: 0; overflow: hidden; opacity: 1; pointer-events: none; }
.satellite-layer img { position: absolute; max-width: none; user-select: none; }
.resort-map {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  cursor: grab;
}
.map-shell.is-dragging .resort-map { cursor: grabbing; }
.geo-grid { stroke: #6a9b9f; stroke-opacity: 0.14; stroke-dasharray: 2 8; }
.atoll-boundary { fill: #276669; fill-opacity: 0.12; stroke: #37646b; stroke-width: 1; }
.atoll-boundary.active { fill: #2c7776; fill-opacity: 0.42; stroke: #55b9b0; stroke-width: 1.3; }
.satellite-enabled .atoll-boundary { fill-opacity: 0.06; }
.satellite-enabled .atoll-boundary.active { fill-opacity: 0.16; }
.resort-link { stroke: #a3c2bf; stroke-width: 0.7; stroke-opacity: 0.45; pointer-events: none; }
.marker-hit { fill: transparent; }
.resort-marker { stroke: #08242d; stroke-width: 1.2; }
.resort-marker.basic { stroke: #bdcbcb; }
.resort-point { cursor: pointer; text-decoration: none; }
.resort-label {
  font: 500 11.5px var(--sans);
  fill: #e1eeeb;
  paint-order: stroke;
  stroke: var(--map-ocean);
  stroke-width: 4px;
  stroke-linejoin: round;
}
.resort-point:hover .resort-marker,
.resort-point:focus-visible .resort-marker { stroke: #fff; stroke-width: 2; }
.resort-point:hover .resort-label,
.resort-point:focus-visible .resort-label { fill: #ffe3ac; }
.site-atoll-label { pointer-events: none; }
.site-atoll-label text {
  paint-order: stroke;
  stroke: var(--map-ocean);
  stroke-width: 5px;
  stroke-linejoin: round;
}
.atoll-name-ko { font: 650 17px var(--serif); fill: #edf4ef; }
.atoll-name-en { font: 450 11.5px var(--sans); fill: #accdcd; }
.site-atoll-label.context { opacity: 0.6; }
.map-tools {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: grid;
  border: 1px solid #3d626b;
  border-radius: 6px;
  overflow: hidden;
}
.map-tools button {
  width: 42px;
  height: 40px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #0c252e;
  cursor: pointer;
  font-size: 22px;
}
.map-tools button:last-child { border: 0; font-size: 12px; }
.map-tools button:hover { background: #20434c; }
.map-notice {
  position: absolute;
  bottom: 20px;
  left: 24px;
  max-width: calc(100% - 100px);
  margin: 0;
  padding: 7px 10px;
  color: var(--muted);
  background: var(--ocean);
  font-size: 12px;
}
.satellite-enabled .map-notice { bottom: 96px; }
.satellite-credit {
  position: absolute;
  bottom: 12px;
  left: 12px;
  max-width: min(330px, calc(100% - 100px));
  padding: 5px 8px;
  border-radius: 4px;
  background: rgb(11 34 41 / 90%);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}
.satellite-credit span { display: block; }
.satellite-credit [role="status"]:empty { display: none; }

.data-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  padding: 24px 28px 14px;
}
.data-header { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.mobile-title, .resort-cards { display: none; }
.data-freshness { margin: 0; color: var(--muted); font-size: 12px; }
.controls {
  display: grid;
  grid-template-columns: minmax(180px, 250px) minmax(160px, 205px) minmax(190px, 245px) auto 1fr;
  align-items: end;
  gap: 12px;
}
.controls label { display: grid; gap: 6px; }
.controls label > span { color: var(--muted); font-size: 12px; }
.controls select, .reset-button {
  height: 42px;
  border: 1px solid #38575f;
  border-radius: 5px;
  background: #102d35;
  padding: 0 12px;
  font-size: 14px;
}
.controls select { width: 100%; min-width: 0; }
.reset-button { cursor: pointer; background: transparent; color: var(--muted); }
.result-count { margin: 0; align-self: center; justify-self: end; padding-top: 22px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.result-count strong { color: var(--ink); font-size: 17px; font-weight: 600; }
.result-count span { padding: 0 6px; }
.dimension-guide { margin: 15px 0 13px; color: var(--muted); font-size: 12px; }
.table-shell { min-height: 0; overflow: auto; border-block: 1px solid #58747b; scrollbar-color: #41636a transparent; scrollbar-width: thin; }
table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.resort-col { width: 14.5%; }
.atoll-col { width: 7%; }
.villa-col { width: 3.5%; }
.profile-col { width: 34%; }
.reef-col { width: 14.5%; }
.dining-col { width: 12.5%; }
.pulse-col { width: 14%; }
th {
  position: sticky;
  z-index: 2;
  top: 0;
  height: 52px;
  padding: 10px 12px;
  border-bottom: 1px solid #4c6971;
  color: #b6cece;
  background: #0e2931;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
}
th span { color: var(--muted); font-size: 11px; }
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  color: #d3e2df;
  font-size: 15px;
  vertical-align: middle;
  overflow-wrap: anywhere;
}
tbody tr:last-child td { border-bottom: 0; }
.profile-head { text-align: center; }
.number-col { text-align: right; }
.resort-name { display: inline-block; color: #f0f5ef; font-size: 17px; font-weight: 650; text-decoration: none; line-height: 1.45; word-break: keep-all; overflow-wrap: anywhere; }
.resort-official { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.basic-status { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.unavailable, .data-unavailable { color: var(--muted); }
.data-unavailable { display: block; text-align: center; font-size: 14px; }
.chain-label { display: flex; align-items: center; gap: 6px; margin-top: 9px; color: #bbcdca; font-size: 12px; }
.chain-symbol { flex: 0 0 12px; width: 12px; height: 12px; fill: currentColor; }
.chain-hilton { color: #adcfe8; }
.chain-marriott { color: #e0b8a8; }
.atoll-cell strong { display: block; color: #dce9e4; font-size: 15px; font-weight: 500; }
.atoll-cell small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.profile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 18px; }
.profile-mini { min-width: 0; }
.profile-labels { display: flex; justify-content: space-between; align-items: end; gap: 6px; min-height: 18px; color: #bfd2ce; font-size: 12px; line-height: 1.4; }
.profile-labels span:last-child { text-align: right; }
.profile-value { display: grid; grid-template-columns: minmax(0, 1fr) 26px; align-items: center; gap: 9px; margin-top: 3px; }
.profile-value strong { color: #eff4ef; font-size: 14px; font-weight: 600; text-align: right; }
.table-axis, .hover-axis { position: relative; height: 5px; border-radius: 3px; background: #35575e; }
.table-axis i, .hover-axis i { position: absolute; left: 50%; top: -2px; width: 1px; height: 9px; background: #8da9aa; opacity: 0.7; }
.table-axis b, .hover-axis b { position: absolute; top: 50%; width: 8px; height: 8px; border: 1px solid #102a32; border-radius: 50%; background: #e1ebe6; transform: translate(-50%, -50%); }
.reef-score-line { display: flex; align-items: baseline; gap: 7px; }
.reef-score-line strong, .pulse-rating strong { color: #e9f2ed; font-size: 20px; font-weight: 650; }
.reef-dot { align-self: center; width: 7px; height: 7px; border-radius: 2px; }
.reef-label { display: block; margin-top: 3px; color: #b5d4ce; font-size: 12px; }
.reef-access { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.dining-cell { color: #c7dbd5; font-size: 14px; line-height: 1.65; white-space: normal; }
.pulse-headline { display: block; color: #b8e0d2; font-size: 14px; font-weight: 550; line-height: 1.45; }
.pulse-headline.cooling { color: #e3c39c; }
.pulse-rating { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 8px; margin-top: 5px; }
.pulse-rating span { color: var(--muted); font-size: 12px; }
.pulse-recent { display: block; margin-top: 5px; color: #b4c9c5; font-size: 12px; }
.data-footer { display: flex; justify-content: space-between; gap: 20px; padding-top: 10px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.data-footer p { margin: 0; }
.data-footer a { text-decoration: none; }
.empty-results { margin: 0; padding: 24px 16px; color: var(--muted); text-align: center; }

.map-tooltip {
  position: fixed;
  z-index: 100;
  width: 390px;
  max-width: calc(100vw - 32px);
  padding: 18px;
  border: 1px solid #4d7b80;
  border-radius: 7px;
  color: var(--ink);
  background: #102e38;
  box-shadow: 0 12px 36px #0005;
  pointer-events: none;
}
.hover-card-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid #395962; padding-bottom: 13px; }
.hover-card-head > div { min-width: 0; }
.hover-atoll { display: block; color: #adc8c9; font-size: 12px; }
.hover-card-head strong { display: block; margin-top: 5px; font: 650 21px/1.4 var(--serif); }
.hover-card-head small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.hover-reef { flex: 0 0 auto; text-align: right; }
.hover-reef em { font: 500 30px/1.2 var(--serif); }
.hover-reef span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.hover-dimensions { display: grid; gap: 15px; padding: 17px 0; }
.hover-axis-labels { display: grid; grid-template-columns: 1fr 36px 1fr; gap: 8px; margin-bottom: 7px; color: #c5d7d2; font-size: 12px; }
.hover-axis-labels strong { text-align: center; color: #eef4ee; font-size: 13px; }
.hover-axis-labels span:last-child { text-align: right; }
.hover-axis b { width: 10px; height: 10px; }
.hover-card-foot { border-top: 1px solid #395962; padding-top: 12px; color: #bacdca; font-size: 12px; line-height: 1.7; }
.hover-card-foot p { margin: 0; }
.hover-basic { padding-top: 12px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.hover-basic p { margin: 0 0 6px; }
.loading-screen { position: fixed; z-index: 200; inset: 0; display: grid; place-content: center; justify-items: center; gap: 16px; background: var(--ocean); color: var(--muted); }
.loading-screen.done { display: none; }
.loading-mark { width: 32px; height: 32px; border: 2px solid var(--line); border-top-color: var(--teal); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 2200px) {
  .dashboard { grid-template-columns: minmax(500px, 30%) minmax(0, 1fr); }
  .data-panel { padding-inline: 20px; }
  th, td { padding-inline: 9px; }
  .profile-grid { gap: 10px 12px; }
  .profile-labels { font-size: 11px; }
  .resort-name { font-size: 16px; }
  .controls { grid-template-columns: minmax(165px, 220px) minmax(140px, 185px) minmax(170px, 220px) auto 1fr; }
}
@media (max-width: 1199px) {
  .dashboard { display: block; height: auto; min-height: 100dvh; }
  .map-panel, .map-tooltip, .table-shell, .data-header h2 { display: none; }
  .data-panel { display: block; max-width: 960px; margin: 0 auto; padding: 24px 16px; }
  .data-header { display: block; margin-bottom: 20px; }
  .mobile-title { display: block; font-size: 25px; }
  .data-freshness { margin-top: 6px; }
  .controls { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .controls label { min-width: 0; }
  .controls label:nth-child(3) { grid-column: 1 / -1; }
  .controls select, .reset-button { height: 46px; font-size: 16px; }
  .result-count { padding-top: 0; }
  .dimension-guide { line-height: 1.65; }
  .resort-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .resort-card { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: #102a32; overflow-wrap: anywhere; }
  .resort-card-header { padding: 16px 16px 12px; }
  .resort-card h2 { margin: 0; font-family: var(--sans); line-height: 1.5; }
  .resort-card .resort-name { font-size: 19px; text-decoration: underline; text-decoration-color: #668781; text-underline-offset: 4px; }
  .resort-card .resort-official { font-size: 12px; }
  .card-atoll { margin: 8px 0 0; color: var(--ink); font-size: 13px; }
  .card-atoll span { color: var(--muted); }
  .card-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 12px 16px; border-top: 1px solid var(--line); gap: 8px; }
  .card-metrics dt { color: var(--muted); font-size: 11px; }
  .card-metrics dd { margin: 4px 0 0; color: var(--ink); font-size: 22px; font-weight: 650; }
  .card-metrics small { color: var(--muted); font-size: 11px; font-weight: 400; white-space: nowrap; }
  .card-details { border-top: 1px solid var(--line); }
  .card-details summary { min-height: 48px; padding: 13px 16px; color: var(--teal); cursor: pointer; font-size: 13px; }
  .card-details summary span { margin-left: 6px; color: var(--muted); font-size: 11px; }
  .card-details-content { padding: 0 16px 16px; }
  .card-details-content section + section { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
  .card-details h3 { margin: 0 0 12px; color: var(--ink); font-size: 14px; font-weight: 600; }
  .resort-card .profile-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .resort-card .profile-labels { font-size: 12px; }
  .resort-card .profile-value { margin-top: 6px; }
  .card-detail-note, .card-dining, .card-basic-note { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
  .card-dining { color: var(--ink); }
  .card-basic-note { margin: 0; padding: 12px 16px 16px; border-top: 1px solid var(--line); }
  .data-footer { display: block; padding-top: 20px; font-size: 12px; overflow-wrap: anywhere; }
  .data-footer p + p { margin-top: 10px; }
  .data-footer a { text-decoration: underline; }
}
@media (prefers-reduced-motion: reduce) {
  .loading-mark { animation: none; }
}
