:root {
  --bg: #f4f7f8;
  --surface: #ffffff;
  --ink: #142027;
  --muted: #65747f;
  --line: #dce5e8;
  --green: #1b8a5a;
  --blue: #236fc8;
  --red: #c4483d;
  --amber: #ad7416;
  --teal: #0f7d87;
  --shadow: 0 12px 30px rgba(28, 47, 56, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(15, 125, 135, 0.12), transparent 360px),
    linear-gradient(180deg, #eef6f5 0, var(--bg) 300px);
  color: var(--ink);
  font-family:
    "Segoe UI",
    "Noto Sans KR",
    system-ui,
    sans-serif;
}

button,
select,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1680px, 100%);
  margin: 0 auto;
  padding: 14px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(28, 47, 56, 0.07);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 6px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.subtitle {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.ghost-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
}

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

.ghost-button.is-active {
  border-color: rgba(15, 125, 135, 0.38);
  background: rgba(15, 125, 135, 0.1);
  color: var(--teal);
}

.sync-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 154px;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
}

.sync-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(27, 138, 90, 0.14);
}

.filters,
.summary,
.station-list,
.map-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
  margin-bottom: 10px;
}

.filters label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

select {
  min-width: 132px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 32px 9px 10px;
  background: #fff;
  color: var(--ink);
}

.search-label input {
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
}

.search-button {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  padding: 0 14px;
  background: var(--teal);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(64px, 1fr));
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: #eef4f5;
}

.segmented button {
  min-height: 38px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button.is-active {
  background: var(--teal);
  color: #fff;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.checks input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.dashboard {
  margin-top: 0;
}

.source-box {
  border: 1px solid rgba(15, 125, 135, 0.22);
  border-radius: 8px;
  margin-bottom: 16px;
  padding: 10px 12px;
  background: rgba(15, 125, 135, 0.08);
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.source-box.warning {
  border-color: rgba(173, 116, 22, 0.28);
  background: rgba(173, 116, 22, 0.11);
  color: var(--amber);
}

.seo-footer {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.seo-footer h2 {
  margin-bottom: 8px;
  font-size: 17px;
}

.seo-footer p {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.seo-link-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.seo-link-grid a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 11px;
  background: #fff;
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 10px;
  background: var(--line);
}

.summary article {
  min-height: 76px;
  padding: 14px;
  background: var(--surface);
}

.summary span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.content-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.58fr) minmax(720px, 1.42fr);
  gap: 10px;
  align-items: stretch;
  height: calc(100vh - 246px);
  min-height: 560px;
}

.station-list,
.map-panel {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.side-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) minmax(240px, 0.9fr);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  padding: 16px;
}

.section-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.section-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.map-location-button {
  min-height: 36px;
  border: 0;
  border-radius: 7px;
  padding: 0 13px;
  background: var(--teal);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 8px 16px rgba(15, 125, 135, 0.2);
}

.map-location-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.map-location-button.is-active {
  background: var(--green);
}

.list-body {
  display: grid;
  gap: 10px;
  max-height: none;
  overflow: auto;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.station-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: linear-gradient(180deg, #fff, #fafeff);
  color: var(--ink);
  text-align: left;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.station-card:hover {
  border-color: rgba(15, 125, 135, 0.42);
  box-shadow: 0 10px 22px rgba(28, 47, 56, 0.1);
  transform: translateY(-1px);
}

.station-card.is-selected {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 125, 135, 0.13);
}

.card-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-title strong {
  font-size: 16px;
}

.address {
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.badges,
.charger-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge,
.count-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
}

.badge.fast {
  background: rgba(35, 111, 200, 0.11);
  color: var(--blue);
}

.badge.slow {
  background: rgba(173, 116, 22, 0.13);
  color: var(--amber);
}

.count-chip.available {
  background: rgba(27, 138, 90, 0.12);
  color: var(--green);
}

.count-chip.busy {
  background: rgba(35, 111, 200, 0.12);
  color: var(--blue);
}

.count-chip.fault {
  background: rgba(196, 72, 61, 0.12);
  color: var(--red);
}

.distance {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(15, 125, 135, 0.1);
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.map-canvas {
  position: relative;
  height: calc(100% - 105px);
  min-height: 430px;
  overflow: hidden;
  border-radius: 0 0 8px 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.55) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.55) 1px, transparent 1px),
    #dce9e6;
  background-size: 72px 72px;
}

.map-canvas.has-kakao {
  background: #e5ecef;
}

.map-canvas.has-kakao::before,
.map-canvas.has-kakao::after {
  display: none;
}

.map-canvas::before,
.map-canvas::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.map-canvas::before {
  inset: 92px -80px auto 18%;
  height: 120px;
  border: 18px solid rgba(255, 255, 255, 0.8);
  transform: rotate(-11deg);
}

.map-canvas::after {
  left: -6%;
  right: 8%;
  bottom: 112px;
  height: 96px;
  border: 16px solid rgba(255, 255, 255, 0.74);
  transform: rotate(14deg);
}

.map-marker {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 3px solid #fff;
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(20, 32, 39, 0.22);
  transform: translate(-50%, -50%);
}

.map-marker.available {
  background: var(--green);
}

.map-marker.busy {
  background: var(--blue);
}

.map-marker.fault {
  background: var(--red);
}

.map-marker.is-selected {
  outline: 4px solid rgba(15, 125, 135, 0.25);
}

.map-empty {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 532px;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.kakao-map {
  position: absolute;
  inset: 0;
  z-index: 1;
  height: 100%;
  min-height: 430px;
}

.kakao-marker {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 3px solid #fff;
  border-radius: 999px 999px 999px 4px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(20, 32, 39, 0.28);
  transform: rotate(-45deg);
}

.kakao-marker span {
  transform: rotate(45deg);
}

.kakao-marker.available {
  background: var(--green);
}

.kakao-marker.busy {
  background: var(--blue);
}

.kakao-marker.fault {
  background: var(--red);
}

.kakao-marker.is-selected {
  outline: 5px solid rgba(15, 125, 135, 0.28);
}

.search-pin-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.search-map-pin {
  position: absolute;
  display: block;
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(20, 32, 39, 0.28);
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.search-map-pin.available {
  background: var(--green);
}

.search-map-pin.busy {
  background: var(--blue);
}

.search-map-pin.fault {
  background: var(--red);
}

.search-map-pin.is-selected {
  width: 26px;
  height: 26px;
  outline: 5px solid rgba(15, 125, 135, 0.22);
}

.map-legend {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: calc(100% - 28px);
  border: 1px solid rgba(220, 229, 232, 0.9);
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 18px rgba(20, 32, 39, 0.14);
}

.map-layer-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  background: #f8fbfc;
}

.map-layer-controls label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.map-layer-controls input {
  accent-color: var(--teal);
}

.parking-marker {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid #fff;
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  text-decoration: none;
  box-shadow: 0 8px 16px rgba(20, 32, 39, 0.24);
}

.parking-marker.ev {
  background: #6a48b7;
}

.parking-marker.public {
  background: #334155;
}

.user-marker {
  position: relative;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: #0f7d87;
  box-shadow:
    0 0 0 8px rgba(15, 125, 135, 0.18),
    0 8px 18px rgba(20, 32, 39, 0.25);
}

.user-marker span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #fff;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.legend-dot.user-location {
  background: var(--teal);
}

.legend-dot.available {
  background: var(--green);
}

.legend-dot.busy {
  background: var(--blue);
}

.legend-dot.fault {
  background: var(--red);
}

.legend-dot.ev-parking {
  background: #6a48b7;
}

.legend-dot.public-parking {
  background: #334155;
}

.station-detail-box {
  padding: 14px;
  overflow: auto;
  min-height: 0;
}

.empty-detail {
  display: grid;
  min-height: 260px;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.detail-title {
  margin-bottom: 14px;
}

.detail-title h2 {
  margin-bottom: 6px;
}

.detail-title p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.detail-block {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 14px;
}

.detail-block h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.parking-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.parking-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(106, 72, 183, 0.1);
  color: #5d3ea1;
  font-size: 12px;
  font-weight: 900;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 14px;
}

.meta-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.meta-grid span,
.mini-meta {
  color: var(--muted);
  font-size: 13px;
}

.meta-grid span {
  display: block;
  margin-bottom: 4px;
}

.meta-grid strong {
  display: block;
  font-size: 13px;
}

.map-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.map-links a {
  display: grid;
  min-height: 38px;
  place-items: center;
  border: 1px solid rgba(15, 125, 135, 0.25);
  border-radius: 7px;
  background: rgba(15, 125, 135, 0.08);
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.map-links a:hover {
  background: var(--teal);
  color: #fff;
}

.charger-row,
.parking-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  font-size: 13px;
}

.charger-row span,
.parking-row span {
  color: var(--muted);
}

.status-text.available {
  color: var(--green);
}

.status-text.busy {
  color: var(--blue);
}

.status-text.fault {
  color: var(--red);
}

.empty-list {
  padding: 42px 12px;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

@media (max-width: 1120px) {
  .content-grid {
    grid-template-columns: 1fr;
    height: auto;
  }

  .empty-detail {
    min-height: 180px;
  }
}

@media (max-width: 780px) {
  .app-shell {
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    justify-content: stretch;
  }

  .ghost-button {
    flex: 1;
  }

  .sync-box {
    width: 100%;
  }

  .filters {
    align-items: stretch;
    flex-direction: column;
  }

  .filters label,
  select,
  .search-label input,
  .search-button,
  .segmented {
    width: 100%;
  }

  .summary,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .station-list,
  .map-panel {
    min-height: auto;
  }

  .map-canvas {
    min-height: 430px;
  }

  .kakao-map {
    min-height: 430px;
  }

  .content-grid,
  .station-list,
  .map-panel {
    height: auto;
    min-height: auto;
  }

  .list-body {
    max-height: none;
  }
}
