:root {
  --panel-width: 450px;
  --panel-min: 300px;
  --panel-max: 1000px;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --line: #d9e0e8;
  --text: #17202a;
  --muted: #667085;
  --blue: #2f7df6;
  --orange: #fb8c00;
  --shadow: 0 10px 28px rgba(17, 24, 39, 0.12);
}

@font-face {
  font-family: "Pretendard";
  src: url("../font/Pretendard-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Pretendard";
  src: url("../font/Pretendard-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-family: "Pretendard", "Segoe UI", "Noto Sans KR", Arial, sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: flex;
  width: 100vw;
  height: 100vh;
}

.side-panel {
  width: var(--panel-width);
  min-width: var(--panel-min);
  max-width: var(--panel-max);
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--panel);
  border-right: 1px solid var(--line);
  z-index: 20;
  overflow: hidden;
}

.brand-bar {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.brand-bar h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 600;
}

.brand-bar p {
  margin: 6px 0 0;
  font-size: 15px;
  color: var(--muted);
}

.panel-section {
  min-height: 0;
  flex: 1 1 50%;
  display: flex;
  flex-direction: column;
  padding: 12px;
  overflow: hidden;
}

.parcel-section {
  border-bottom: 1px solid var(--line);
}

.well-section {
  background: #fbfcfe;
}

.search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.section-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 4px 0 12px;
}

.section-toolbar h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
}

.section-toolbar h2 strong {
  color: var(--blue);
}

.soft-button {
  height: 32px;
  padding: 0 12px;
  border: 1px solid #bbdefb;
  border-radius: 16px;
  color: #1976d2;
  background: #e3f2fd;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.search-row input,
.filter-row select,
.control-label select {
  width: 100%;
  height: 38px;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  padding: 0 10px;
  background: #ffffff;
}

.search-row button,
.remove-button {
  border: 0;
  border-radius: 6px;
  background: #1f6feb;
  color: #ffffff;
  cursor: pointer;
}

.search-row button {
  min-width: 68px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.metric-card {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.metric-card span {
  display: block;
  font-size: 15px;
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin-top: 6px;
  font-size: 25px;
  font-weight: 600;
  line-height: 1.2;
}

.control-label {
  display: grid;
  gap: 6px;
  font-size: 15px;
  color: var(--muted);
}

.compact-control {
  grid-template-columns: auto minmax(120px, 1fr);
  align-items: center;
  margin-bottom: 8px;
}

.column-toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 8px;
  color: #344054;
  font-size: 14px;
}

.column-toggle-group label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
}

.column-toggle-group input {
  width: 14px;
  height: 14px;
  margin: 0;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.panel-table-wrap {
  flex: 1;
  min-height: 0;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 15px;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid #edf1f5;
  white-space: nowrap;
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #475467;
  background: #f8fafc;
  font-weight: 600;
}

.header-filter {
  width: 100%;
  min-width: 112px;
  height: 30px;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  padding: 0 8px;
  color: #344054;
  background: #ffffff;
  font-weight: 600;
}

.is-hidden-column {
  display: none;
}

.remove-button {
  width: 30px;
  height: 28px;
  background: #d92d20;
}

.panel-resizer {
  width: 6px;
  cursor: col-resize;
  background: #eef2f6;
  border-right: 1px solid #d5dde7;
  z-index: 22;
}

.panel-resizer:hover,
.panel-resizer.dragging {
  background: #cbdaf8;
}

.map-stage {
  position: relative;
  flex: 1;
  min-width: 0;
}

#map {
  width: 100%;
  height: 100%;
}

.basemap-switcher {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.basemap-button {
  width: 74px;
  height: 64px;
  padding: 4px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.basemap-button.active {
  border-color: var(--blue);
}

.basemap-button img {
  display: block;
  width: 100%;
  height: 38px;
  object-fit: cover;
  border-radius: 5px;
}

.basemap-button span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1;
}

.map-info-bar {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 500;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid rgba(208, 215, 222, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  font-size: 15px;
}

.legend {
  position: absolute;
  right: 14px;
  bottom: 70px;
  z-index: 500;
  min-width: 160px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  font-size: 14px;
}

.map-notice {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 510;
  max-width: min(420px, calc(100vw - 32px));
  padding: 10px 12px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #7c2d12;
  background: #fff7ed;
  box-shadow: var(--shadow);
  font-size: 13px;
}

.legend h2 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
}

.legend-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.18);
}

.leaflet-tooltip.parcel-label {
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  color: #005CFF;
  font-size: 15px;
  font-weight: 600;
  text-shadow:
    -1px -1px 0 #fff,
    1px -1px 0 #fff,
    -1px 1px 0 #fff,
    1px 1px 0 #fff,
    0 0 4px #fff;
  pointer-events: none;
}

.well-value-label {
  padding: 0;
  border: 0;
  background: transparent;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-shadow:
    -1px -1px 0 #111,
    1px -1px 0 #111,
    -1px 1px 0 #111,
    1px 1px 0 #111,
    0 0 4px #000;
}

.leaflet-well-pane path.leaflet-interactive:hover {
  fill: #00FFFF;
  stroke: #FFFFFF;
  stroke-width: 4;
}

.legend-symbol {
  position: relative;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.legend-symbol::before {
  content: "";
  display: block;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--symbol-color);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.32);
}

.legend-symbol.ring1,
.legend-symbol.ring2,
.legend-symbol.ring3,
.legend-symbol.ring4 {
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--symbol-color);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
}

.legend-symbol.ring1 {
  width: 18px;
  height: 18px;
}

.legend-symbol.ring2 {
  width: 22px;
  height: 22px;
  box-shadow: 0 0 0 1px #fff, 0 0 0 3px rgba(0, 0, 0, 0.35);
}

.legend-symbol.ring3 {
  width: 26px;
  height: 26px;
  box-shadow: 0 0 0 1px #fff, 0 0 0 4px rgba(255, 255, 255, 0.9), 0 0 0 6px rgba(0, 0, 0, 0.35);
}

.legend-symbol.ring4 {
  width: 30px;
  height: 30px;
  box-shadow: 0 0 0 1px #fff, 0 0 0 4px rgba(255, 255, 255, 0.9), 0 0 0 7px rgba(255, 255, 255, 0.75), 0 0 0 9px rgba(0, 0, 0, 0.35);
}

.legend-symbol.ring1::before,
.legend-symbol.ring2::before,
.legend-symbol.ring3::before,
.legend-symbol.ring4::before {
  width: 8px;
  height: 8px;
  border: 0;
  box-shadow: none;
}

.legend-symbol.size1::before {
  width: 9px;
  height: 9px;
}

.legend-symbol.size2::before {
  width: 12px;
  height: 12px;
}

.legend-symbol.size3::before {
  width: 15px;
  height: 15px;
}

.legend-symbol.size4::before {
  width: 18px;
  height: 18px;
}

.legend-symbol.size5::before {
  width: 21px;
  height: 21px;
}

@media (max-width: 760px) {
  .app-shell {
    flex-direction: column;
  }

  .side-panel {
    width: 100% !important;
    max-width: none;
    height: 42vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .panel-resizer {
    display: none;
  }

  .basemap-switcher {
    top: 10px;
    right: 10px;
  }

  .basemap-button {
    width: 62px;
  }
}
