:root {
  color-scheme: light;
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  font-size: 16px;
  color: #202623;
  background: #eef1ee;
  --ink: #202623;
  --muted: #66706a;
  --line: #d7ddd8;
  --surface: #ffffff;
  --soft: #f4f6f3;
  --accent: #177a5b;
  --accent-dark: #0d5e45;
  --focus: #0866c6;
  --grade-1: #198754;
  --grade-2: #72a83b;
  --grade-3: #d5a500;
  --grade-4: #e1692d;
  --grade-5: #c9363e;
  --unknown: #777f7b;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body { background: #eef1ee; }

button,
input,
select,
textarea { font: inherit; letter-spacing: 0; }

button,
select,
input[type="checkbox"],
input[type="radio"] { cursor: pointer; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 50%, transparent);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 9999;
  padding: 10px 14px;
  color: #fff;
  background: #111;
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

.app-header {
  position: relative;
  z-index: 600;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
}

.brand-block,
.header-actions,
.user-button,
.map-actions,
.location-row,
.dialog-header,
.dialog-actions,
.live-indicator,
.info-note,
.compact-button { display: flex; align-items: center; }

.brand-block { gap: 11px; min-width: 0; }

.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 3px solid var(--accent);
  color: transparent;
  background: #fff;
}

.brand-mark::before {
  content: "";
  width: 4px;
  height: 18px;
  background: var(--accent);
}

.brand-block strong,
.brand-block span { display: block; }
.brand-block strong { font-size: 16px; line-height: 1.25; }
.brand-block div > span { margin-top: 2px; color: var(--muted); font-size: 12px; }

.header-actions { gap: 8px; }

.icon-button,
.user-button,
.compact-button,
.tab-button,
.primary-action,
.secondary-action,
.dialog-primary,
.dialog-secondary,
.danger-button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
}

.icon-button {
  width: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink);
  background: var(--soft);
}

.icon-button svg,
.compact-button svg,
.primary-action svg,
.secondary-action svg,
.dialog-actions svg,
.info-note svg { width: 18px; height: 18px; flex: 0 0 auto; }

.user-button { gap: 8px; padding: 4px 10px 4px 5px; color: var(--ink); background: var(--soft); }

.user-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--accent-dark);
  font-weight: 800;
}

.workspace {
  position: relative;
  height: calc(100vh - 62px);
  height: calc(100dvh - 62px);
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
}

.side-panel {
  position: relative;
  z-index: 500;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow: hidden;
}

@media (min-width: 701px) {
  .workspace { transition: grid-template-columns 160ms ease; }
  .workspace.is-panel-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
  .workspace.is-panel-collapsed .side-panel { visibility: hidden; border-right: 0; }
}

.panel-heading { display: flex; justify-content: space-between; gap: 12px; padding: 20px 18px 14px; }
.eyebrow { margin: 0 0 5px; color: var(--accent-dark); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.panel-heading h1 { margin: 0; font-size: 22px; line-height: 1.25; }

.live-indicator { gap: 6px; align-self: flex-start; color: var(--muted); font-size: 11px; white-space: nowrap; }
.live-indicator > span { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.view-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--line); }
.tab-button { border-radius: 0; color: var(--muted); background: #fff; border-bottom: 3px solid transparent; font-weight: 700; }
.tab-button.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.tab-button span { display: inline-grid; place-items: center; min-width: 22px; height: 20px; margin-left: 4px; border-radius: 10px; color: #fff; background: #626c66; font-size: 11px; }

.filter-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 14px; background: #f8faf8; border-bottom: 1px solid var(--line); }
.filter-strip label > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; font-weight: 700; }
.filter-strip select { width: 100%; height: 36px; padding: 0 28px 0 9px; border: 1px solid #cdd4cf; border-radius: 4px; color: var(--ink); background: #fff; }
.check-filter { display: flex; align-items: center; gap: 8px; align-self: end; min-height: 36px; padding: 0 9px; border: 1px solid #cdd4cf; border-radius: 4px; background: #fff; }
.check-filter > span { margin: 0 !important; color: var(--ink) !important; font-size: 13px !important; }
.filter-strip :disabled { opacity: 0.5; cursor: not-allowed; }

.result-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.result-empty { padding: 44px 24px; color: var(--muted); text-align: center; }

.list-item {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: start;
  padding: 15px 16px;
  border: 0;
  border-bottom: 1px solid #e5e9e6;
  border-radius: 0;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.list-item:hover,
.list-item:focus-visible { background: #f5f8f5; }
.list-item-main { min-width: 0; }
.list-item strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.list-item p { display: -webkit-box; margin: 4px 0 0; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.list-item time { color: var(--muted); font-size: 10px; }

.obstacle-badge,
.facility-badge {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 900;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.8);
}
.obstacle-badge { position: relative; }
.obstacle-badge svg { width: 19px; height: 19px; stroke-width: 2.5; }

.map-shell { position: relative; min-width: 0; overflow: hidden; }
#map { width: 100%; height: 100%; background: #f1ece4; }
.leaflet-container { font-family: inherit; background: #f1ece4; }
.leaflet-control-zoom { border: 1px solid rgba(44, 57, 52, 0.2) !important; box-shadow: 0 4px 14px rgba(36, 46, 42, 0.14) !important; }
.leaflet-control-zoom a { color: #30423d !important; background: rgba(255, 253, 248, 0.96) !important; }
.maplibregl-canvas { outline: 0; }
.map-loading { position: absolute; z-index: 440; top: 14px; left: 50%; min-height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid rgba(45, 57, 52, 0.18); border-radius: 5px; color: #35423e; background: rgba(250, 248, 243, 0.94); box-shadow: 0 4px 14px rgba(36, 46, 42, 0.12); font-size: 11px; font-weight: 800; transform: translateX(-50%); }
.map-loading > span { width: 13px; height: 13px; border: 2px solid #9baaa4; border-top-color: var(--accent-dark); border-radius: 50%; animation: map-loading-spin 800ms linear infinite; }
.map-loading.has-error { color: #9c2530; }
.map-loading.has-error > span { display: none; }
.map-focus-control { position: absolute; z-index: 450; top: 14px; left: 58px; min-height: 42px; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 8px; align-items: center; max-width: min(360px, calc(100% - 250px)); padding: 4px 4px 4px 10px; border: 1px solid rgba(45, 57, 52, 0.2); border-radius: 5px; color: #293a35; background: rgba(250, 248, 243, 0.96); box-shadow: 0 5px 16px rgba(36, 46, 42, 0.15); }
.map-focus-control > svg { width: 17px; height: 17px; }
.map-focus-control strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.map-focus-control button { min-height: 32px; display: flex; align-items: center; gap: 5px; padding: 0 9px; border: 0; border-radius: 4px; color: #fff; background: #9c2530; font-size: 11px; font-weight: 800; white-space: nowrap; }
.map-focus-control button svg { width: 16px; height: 16px; }
.map-attribution { position: absolute; z-index: 450; right: 7px; bottom: 4px; margin: 0; padding: 2px 4px; color: #59645f; background: rgba(250, 248, 243, 0.84); font-size: 9px; }
.map-attribution a { color: inherit; }

@keyframes map-loading-spin { to { transform: rotate(360deg); } }

.layer-control {
  position: absolute;
  z-index: 450;
  top: 14px;
  right: 14px;
  width: 168px;
  padding: 12px;
  border: 1px solid rgba(37, 48, 41, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(32, 38, 35, 0.14);
}

.layer-control p { margin: 0 0 8px; font-size: 12px; font-weight: 800; }
.layer-control label { display: grid; grid-template-columns: 18px 16px 1fr; gap: 7px; align-items: center; min-height: 30px; font-size: 12px; }
.layer-mode { cursor: pointer; }
.layer-dot { width: 12px; height: 12px; border-radius: 50%; }
.layer-dot.reports { background: var(--grade-4); }
.layer-dot.facilities { background: #187da4; }
.layer-dot.route { background: #087f5b; }
.facility-layer-options { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 5px 0 7px 25px; }
.facility-layer-options button { min-width: 0; min-height: 32px; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 0 5px; border: 1px solid #cbd4cf; border-radius: 4px; color: #4b5954; background: #fff; font-size: 10px; font-weight: 800; }
.facility-layer-options button.is-active { color: #fff; border-color: #176fa3; background: #176fa3; }
.facility-layer-options button svg { width: 13px; height: 13px; }
.facility-layer-options button b { min-width: 17px; height: 17px; display: grid; place-items: center; border-radius: 9px; color: #176fa3; background: #e7f4fb; font-size: 9px; }

.route-planner { flex: 1; overflow-y: auto; background: #fff; }
.route-heading { padding: 18px 16px 12px; border-bottom: 1px solid var(--line); }
.route-heading h2 { margin: 0; font-size: 18px; line-height: 1.3; }
.route-field { display: block; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.route-field > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 800; }
.route-field > strong { display: block; font-size: 13px; line-height: 1.5; }
.route-field select { width: 100%; height: 42px; padding: 0 34px 0 10px; border: 1px solid #bfc9c2; border-radius: 5px; color: var(--ink); background: #fff; }
.route-field-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; }
.route-field-actions .compact-button { justify-content: center; min-width: 0; }
.route-field-actions .compact-button.is-active { color: #fff; background: var(--accent-dark); border-color: var(--accent-dark); }
.route-submit { width: calc(100% - 32px); min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 8px; margin: 14px 16px; border: 0; border-radius: 5px; color: #fff; background: var(--accent-dark); font-weight: 900; }
.route-submit:disabled { background: #77857f; cursor: wait; }
.route-amenities { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.route-amenities-heading { padding: 14px 16px 8px; }
.route-amenities-heading h3 { margin: 2px 0 0; font-size: 14px; }
.route-amenity-options { display: grid; grid-template-columns: 1fr; gap: 7px; padding: 0 16px 14px; }
.route-amenity-toggle { position: relative; display: block; }
.route-amenity-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.route-amenity-toggle > span { min-height: 42px; display: grid; grid-template-columns: 24px minmax(0, 1fr) 24px; gap: 8px; align-items: center; padding: 7px 9px; border: 1px solid #c6cec9; border-radius: 5px; color: #34423d; background: #fff; }
.route-amenity-toggle svg { width: 18px; height: 18px; }
.route-amenity-toggle strong { min-width: 0; font-size: 12px; line-height: 1.35; }
.route-amenity-toggle b { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: #48544f; background: #edf1ee; font-size: 10px; }
.route-amenity-toggle input:checked + span { border-color: var(--accent); color: var(--accent-dark); background: #edf7f2; box-shadow: inset 3px 0 0 var(--accent); }
.route-amenity-toggle input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--focus) 50%, transparent); outline-offset: 2px; }
.route-amenity-results { border-top: 1px solid var(--line); }
.route-amenity-results:empty { display: none; }
.route-amenity-item { width: 100%; min-height: 48px; display: grid; grid-template-columns: 30px minmax(0, 1fr) 18px; gap: 9px; align-items: center; padding: 8px 16px; border: 0; border-bottom: 1px solid #e8ece9; color: var(--ink); background: #fff; text-align: left; }
.route-amenity-item:hover { background: #f5f8f6; }
.route-amenity-item > span:first-child { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #1876a4; }
.route-amenity-item svg { width: 15px; height: 15px; }
.route-amenity-item strong, .route-amenity-item small { display: block; }
.route-amenity-item strong { font-size: 12px; }
.route-amenity-item small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.route-amenity-empty { margin: 0; padding: 13px 16px; color: var(--muted); font-size: 11px; }
.route-spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: map-loading-spin 800ms linear infinite; }
.route-result { border-top: 1px solid var(--line); }
.route-pending { margin: 0; padding: 18px 16px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.route-error { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 14px 16px; color: #9c2530; background: #fff3f3; font-size: 12px; font-weight: 800; line-height: 1.5; }
.route-error svg { width: 17px; height: 17px; flex: 0 0 17px; }
.route-status { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 15px 16px; border-bottom: 1px solid var(--line); }
.route-status > svg { width: 28px; height: 28px; }
.route-status span { display: block; margin-bottom: 3px; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.route-status strong { display: block; font-size: 13px; line-height: 1.55; }
.route-status.safe { color: #116044; background: #eef8f3; }
.route-status.caution { color: #815000; background: #fff8e8; }
.route-status.blocked { color: #982831; background: #fff1f2; }
.route-metrics { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.route-metrics span { min-width: 0; padding: 11px 6px; color: var(--muted); font-size: 9px; text-align: center; }
.route-metrics b { display: block; margin-bottom: 3px; overflow-wrap: anywhere; color: var(--ink); font-size: 13px; }
.route-obstacles { border-bottom: 1px solid var(--line); }
.route-obstacles h3 { margin: 0; padding: 12px 16px 7px; font-size: 11px; }
.route-obstacle { width: 100%; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 8px 16px 12px; border: 0; border-radius: 0; color: var(--ink); background: #fff; text-align: left; }
.route-obstacle:hover { background: #f6f8f6; }
.route-obstacle-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: #40554e; background: #e8efeb; }
.route-obstacle-icon svg { width: 16px; height: 16px; }
.route-obstacle strong,
.route-obstacle small { display: block; }
.route-obstacle strong { font-size: 12px; }
.route-obstacle small { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.route-obstacle em { padding: 4px 6px; border-radius: 4px; color: #5b4330; background: #f4e7d9; font-size: 9px; font-style: normal; font-weight: 900; white-space: nowrap; }
.route-result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 12px 16px 18px; }
.route-result-actions .compact-button { justify-content: center; }
.route-point { width: 34px; height: 34px; display: grid; place-items: center; border: 3px solid #fff; border-radius: 50%; color: #fff; box-shadow: 0 2px 9px rgba(20,27,23,.35); }
.route-point.start { background: #087f5b; }
.route-point.end { background: #9c2530; }
.route-point svg { width: 17px; height: 17px; stroke-width: 2.7; }
.route-amenity-marker { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border: 3px solid #fff; border-radius: 50%; color: #fff; box-shadow: 0 2px 9px rgba(20,27,23,.35); }
.route-amenity-marker.cafe { background: #a34a32; }
.route-amenity-marker.toilet { background: #176fa3; }
.route-amenity-marker.combined { background: #146b61; }
.route-amenity-marker > svg { width: 19px; height: 19px; stroke-width: 2.5; }
.route-amenity-marker small { position: absolute; right: -5px; bottom: -4px; min-width: 22px; height: 17px; display: grid; place-items: center; padding: 0 3px; border: 2px solid #fff; border-radius: 4px; color: #fff; background: #176fa3; font-size: 7px; font-weight: 900; }

.map-actions { position: absolute; z-index: 450; right: 14px; bottom: 76px; flex-direction: column; align-items: stretch; gap: 8px; }
.map-button { align-self: flex-end; background: #fff; box-shadow: 0 5px 18px rgba(32, 38, 35, 0.18); }
.primary-action,
.secondary-action { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 172px; padding: 0 14px; font-weight: 800; box-shadow: 0 7px 20px rgba(32, 38, 35, 0.18); }
.primary-action { color: #fff; background: var(--accent-dark); }
.secondary-action { color: var(--ink); background: #fff; border: 1px solid #cbd2cd; }

.legend {
  position: absolute;
  z-index: 450;
  left: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100% - 220px);
  overflow-x: auto;
  padding: 9px 11px;
  border: 1px solid rgba(37, 48, 41, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 5px 18px rgba(32, 38, 35, 0.12);
  font-size: 10px;
}

.map-provider-naver .legend {
  bottom: 42px;
}

.legend-title { font-weight: 800; }
.legend span { display: flex; align-items: center; gap: 3px; white-space: nowrap; }
.legend b { width: 20px; height: 20px; display: grid; flex: 0 0 20px; place-items: center; border-radius: 50%; color: #324b44; background: #e4ece8; }
.legend b svg { width: 13px; height: 13px; stroke-width: 2.5; }


.grade-1 { background: var(--grade-1); }
.grade-2 { background: var(--grade-2); }
.grade-3 { background: var(--grade-3); color: #302b00 !important; }
.grade-4 { background: var(--grade-4); }
.grade-5 { background: var(--grade-5); }
.grade-un { background: var(--unknown); }

.report-marker,
.facility-marker {
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(20, 27, 23, 0.35);
  font-weight: 900;
}
.report-marker { position: relative; width: 34px; height: 34px; }
.report-marker svg { width: 18px; height: 18px; stroke-width: 2.6; }
.road-damage-icon { overflow: visible; }
.road-damage-icon path { fill: none; stroke-width: 2.2; vector-effect: non-scaling-stroke; }
.obstacle-count { position: absolute; right: -4px; bottom: -4px; min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 3px; border: 2px solid #fff; border-radius: 9px; color: #fff; background: #253a34; font-size: 8px; font-weight: 900; line-height: 1; }
.facility-marker { position: relative; width: 38px; height: 38px; font-size: 14px; background: #52645d; }
.facility-marker > svg { width: 19px; height: 19px; stroke-width: 2.5; }
.facility-marker.type-WC { background: #176fa3; }
.facility-marker.type-PB { background: #3f6f62; }
.facility-marker.type-MU { background: #795548; }
.facility-marker.type-CF { background: #a34a32; }
.facility-marker.type-SH { background: #8a5b89; }
.facility-marker.type-AC { background: #496a91; }
.facility-marker.type-ET { background: #59625e; }
.facility-marker.type-HOSTED-WC { background: #146b61; }
.facility-marker::after { content: ""; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border: 2px solid #fff; border-radius: 50%; background: var(--unknown); }
.facility-marker.status-OK::after { background: var(--grade-1); }
.facility-marker.status-PT::after { background: var(--grade-3); }
.facility-marker.status-NO::after { background: var(--grade-5); }
.facility-toilet-badge { position: absolute; right: -8px; bottom: -5px; min-width: 22px; height: 17px; display: grid; place-items: center; padding: 0 3px; border: 2px solid #fff; border-radius: 4px; color: #fff; background: #176fa3; font-size: 7px; font-weight: 900; }
.facility-toilet-badge.is-hosted { min-width: 28px; background: #146b61; }
.facility-legend-icon { color: #fff !important; }
.facility-legend-icon.type-WC { background: #176fa3 !important; }
.facility-legend-icon.type-PB { background: #3f6f62 !important; }
.facility-legend-icon.type-MU { background: #795548 !important; }
.facility-legend-icon.type-CF { background: #a34a32 !important; }
.facility-legend-icon.type-SH { background: #8a5b89 !important; }
.facility-legend-icon.type-AC { background: #496a91 !important; }
.facility-legend-icon.type-ET { background: #59625e !important; }
.facility-legend-icon.hosted-toilet { background: #146b61 !important; }
.landmark-marker {
  width: 100px;
  height: 40px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 5px;
  align-items: center;
  padding: 5px 7px;
  border: 2px solid #405a54;
  border-radius: 5px;
  color: #263934;
  background: rgba(250, 247, 239, 0.96);
  box-shadow: 0 3px 9px rgba(39, 52, 48, 0.24);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.15;
  cursor: pointer;
}
.landmark-marker:hover,
.landmark-marker:focus-visible { border-color: #9c2530; outline: 2px solid rgba(156, 37, 48, 0.22); outline-offset: 2px; }
.landmark-marker svg { width: 22px; height: 22px; stroke-width: 2; }
.landmark-marker span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.map-error {
  width: min(360px, calc(100% - 32px));
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 60px auto;
  padding: 24px;
  border: 1px solid #c9d0cb;
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  text-align: center;
}
.map-error span { color: var(--muted); font-size: 12px; }
.map-error button { min-height: 38px; padding: 0 13px; border: 0; border-radius: 5px; color: #fff; background: var(--accent-dark); font-weight: 800; }

.app-dialog {
  width: min(620px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  padding: 0;
  border: 1px solid #cbd2cd;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 24px 70px rgba(20, 27, 23, 0.3);
  overflow: auto;
}

.app-dialog::backdrop { background: rgba(21, 28, 24, 0.48); }
.app-dialog > form,
.app-dialog > div:not(.dialog-header) { margin: 0; }
.login-dialog { width: min(430px, calc(100vw - 24px)); }
.compact-dialog { width: min(460px, calc(100vw - 24px)); padding: 22px; }
.form-dialog form { padding: 20px; }
.dialog-header { justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.dialog-header h2 { margin: 0; font-size: 22px; line-height: 1.3; }
.dialog-copy { color: var(--muted); line-height: 1.6; }

.login-dialog form { padding: 26px; }
.field-label { display: block; margin-bottom: 14px; color: #3e4742; font-size: 12px; font-weight: 800; }
.field-label > span { float: right; color: var(--muted); font-size: 10px; font-weight: 500; }
.field-label input,
.field-label select,
.field-label textarea {
  width: 100%;
  margin-top: 6px;
  border: 1px solid #bcc6bf;
  border-radius: 5px;
  color: var(--ink);
  background: #fff;
}
.field-label input,
.field-label select { height: 44px; padding: 0 11px; }
.field-label textarea { padding: 10px 11px; resize: vertical; }

.dialog-primary,
.dialog-secondary,
.danger-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 17px; font-weight: 800; }
.dialog-primary { color: #fff; background: var(--accent-dark); }
.dialog-secondary { color: var(--ink); background: #eef2ef; }
.danger-button { width: 100%; margin-top: 16px; color: #9c2530; background: #fff0f1; }
.login-dialog .dialog-primary { width: 100%; }
.dialog-actions { justify-content: flex-end; gap: 8px; margin-top: 18px; }

.form-error { min-height: 18px; margin: 8px 0 0; color: #b22631; font-size: 12px; font-weight: 700; }
.stepper { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0 0 18px; padding: 0; list-style: none; }
.stepper li { position: relative; display: grid; grid-template-columns: 26px 1fr; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.stepper li::before { content: ""; position: absolute; z-index: 0; top: 13px; left: 0; right: 0; height: 1px; background: var(--line); }
.stepper li:first-child::before { left: 13px; }
.stepper li:last-child::before { right: calc(100% - 13px); }
.stepper li::after { content: counter(list-item); position: relative; z-index: 1; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: #e6ebe7; font-weight: 800; }
.stepper li span { position: relative; z-index: 1; width: fit-content; padding-right: 5px; background: #fff; }
.stepper li.is-active { color: var(--accent-dark); font-weight: 800; }
.stepper li.is-active::after { color: #fff; background: var(--accent-dark); }

.form-step { display: none; }
.form-step.is-active { display: block; }
.upload-zone { min-height: 126px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 18px; border: 2px dashed #9eaaa2; border-radius: 6px; color: var(--muted); background: #f7f9f7; text-align: center; cursor: pointer; }
.upload-zone svg { width: 28px; height: 28px; color: var(--accent); }
.upload-zone strong { color: var(--ink); }
.upload-zone span { font-size: 11px; }
.upload-zone input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.photo-preview { display: flex; gap: 7px; margin-top: 9px; overflow-x: auto; }
.photo-preview img { width: 62px; height: 62px; flex: 0 0 auto; border-radius: 4px; object-fit: cover; background: #e7ebe8; }
.facility-photo-fields { margin: 14px 0; }
.facility-upload-zone { min-height: 112px; }
.facility-upload-zone strong { display: flex; align-items: center; gap: 6px; }
.facility-upload-zone em { color: #a53b31; font-size: 10px; font-style: normal; }
.facility-photo-preview { min-height: 0; }
.facility-photo-item { position: relative; flex: 0 0 72px; width: 72px; height: 72px; }
.facility-photo-item img { width: 72px; height: 72px; }
.facility-photo-remove { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(255, 255, 255, 0.9); border-radius: 50%; color: #fff; background: rgba(28, 35, 31, 0.82); }
.facility-photo-remove svg { width: 13px; height: 13px; }
.photo-location-status { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.photo-location-status svg { width: 14px; height: 14px; flex: 0 0 auto; color: var(--accent); }

.location-row { justify-content: space-between; gap: 12px; margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; }
.location-row strong,
.location-row span { display: block; }
.location-row strong { font-size: 13px; }
.location-row span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.compact-button { gap: 6px; min-height: 34px; padding: 0 10px; border: 1px solid #bdc7c0; color: var(--ink); background: #fff; font-size: 11px; font-weight: 800; white-space: nowrap; }
.info-note { gap: 7px; margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }

fieldset { margin: 0 0 18px; padding: 0; border: 0; }
legend { margin-bottom: 9px; font-size: 13px; font-weight: 900; }
legend em { margin-left: 4px; color: #b22631; font-size: 10px; font-style: normal; }
.difficulty-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.difficulty-option input,
.option-check input { position: absolute; opacity: 0; pointer-events: none; }
.difficulty-option span { min-height: 68px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px solid #c8d0ca; border-radius: 5px; background: #fff; font-size: 10px; text-align: center; }
.difficulty-option b { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: #fff; font-size: 13px; }
.difficulty-option input:checked + span { border: 3px solid var(--focus); padding: 0; }
.option-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.option-check span { min-height: 38px; display: flex; align-items: center; padding: 0 10px; border: 1px solid #c8d0ca; border-radius: 5px; color: var(--ink); background: #fff; font-size: 12px; }
.option-check input:checked + span { border-color: var(--accent); color: var(--accent-dark); background: #e9f4ef; font-weight: 800; }

.review-block { border-block: 1px solid var(--line); }
.review-row { display: grid; grid-template-columns: 104px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid #edf0ee; font-size: 13px; }
.review-row:last-child { border: 0; }
.review-row dt { color: var(--muted); }
.review-row dd { margin: 0; font-weight: 700; }
.consent-check { display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; font-size: 12px; line-height: 1.5; }
.consent-check input { margin-top: 3px; }

.two-column-form,
.survey-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.detail-dialog { padding: 22px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.detail-meta span { padding: 5px 8px; border-radius: 4px; color: #3f4943; background: #edf1ee; font-size: 11px; font-weight: 700; }
.detail-copy { color: #404944; line-height: 1.65; }
.detail-loading,
.detail-photo-error { color: var(--muted); line-height: 1.6; }
.detail-loading { min-height: 88px; display: flex; align-items: center; gap: 9px; }
.detail-loading::before {
  width: 16px;
  height: 16px;
  content: "";
  border: 2px solid #c8d0cb;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: detail-spin 0.8s linear infinite;
}
.detail-photo-error { padding: 9px 10px; border-left: 3px solid #ba4a3d; background: #fff5f2; }
.detail-photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 14px 0; }
.detail-photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 5px; }
.cleanup-launch { width: 100%; margin: 12px 0 8px; }
.cleanup-dialog { width: min(760px, calc(100vw - 28px)); }
.cleanup-body { padding: 0 20px 18px; }
.cleanup-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cleanup-options label { min-height: 44px; display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: #f8faf8; font-size: 12px; font-weight: 750; }
.cleanup-options input { width: 16px; height: 16px; accent-color: var(--accent-dark); }
.cleanup-llm-option { margin: 12px 0; }
.cleanup-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 14px; }
.cleanup-summary p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 12px; }
.cleanup-stat { min-width: 0; padding: 10px; border-left: 3px solid var(--accent); background: #f3f7f4; }
.cleanup-stat strong { display: block; font-size: 20px; }
.cleanup-stat span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.cleanup-preview-list { max-height: 260px; margin-top: 12px; overflow-y: auto; border-top: 1px solid var(--line); }
.cleanup-preview-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.cleanup-preview-item strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.cleanup-preview-item small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.cleanup-preview-item b { align-self: center; color: var(--accent-dark); font-size: 11px; }
.cleanup-actions { position: sticky; bottom: 0; padding: 12px 20px 18px; border-top: 1px solid var(--line); background: #fff; }
.cleanup-actions button:disabled { cursor: not-allowed; opacity: 0.45; }
@keyframes detail-spin { to { transform: rotate(360deg); } }
.survey-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 12px; }
.survey-table th,
.survey-table td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.detail-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 16px; }
.detail-actions .dialog-secondary,
.detail-actions .dialog-primary,
.detail-actions .danger-button { width: 100%; margin: 0; }
.survey-table th { width: 38%; color: var(--muted); }
.download-grid { display: grid; gap: 7px; margin-top: 16px; }
.download-grid a { min-height: 40px; display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 700; }

.toast { position: fixed; z-index: 3000; left: 50%; bottom: 22px; max-width: min(420px, calc(100vw - 24px)); padding: 11px 15px; border-radius: 6px; color: #fff; background: #202623; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22); opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: 180ms ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.is-hidden { display: none !important; }

@media (max-width: 900px) {
  .workspace { grid-template-columns: 310px minmax(0, 1fr); }
  .legend { max-width: calc(100% - 28px); overflow-x: auto; }
}

@media (max-width: 700px) {
  .panel-toggle { display: none; }
  .app-header {
    height: calc(56px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) calc(10px + env(safe-area-inset-right)) 0 calc(10px + env(safe-area-inset-left));
  }
  .brand-mark { width: 30px; height: 30px; }
  .brand-block strong { font-size: 14px; }
  .brand-block div > span { display: none; }
  .user-button { width: 40px; padding: 5px; }
  .user-button > span:last-child { display: none; }
  .workspace {
    height: calc(100vh - 56px - env(safe-area-inset-top));
    height: calc(100dvh - 56px - env(safe-area-inset-top));
    display: block;
  }
  .map-shell { height: 57%; }
  .side-panel {
    position: absolute;
    z-index: 520;
    left: 0;
    right: 0;
    bottom: 0;
    height: 43%;
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    border-right: 0;
    box-shadow: 0 -8px 26px rgba(32, 38, 35, 0.13);
  }
  .panel-heading { display: none; }
  .filter-strip { padding: 8px 10px; }
  .result-list { min-height: 0; }
  .list-item { padding: 11px 12px; }
  .layer-control { top: 10px; right: 10px; width: 176px; padding: 9px; }
  .map-focus-control { top: 190px; left: 10px; max-width: calc(100% - 20px); }
  .map-actions { right: 10px; bottom: 12px; gap: 6px; }
  .primary-action,
  .secondary-action { min-width: 0; width: 46px; height: 46px; padding: 0; border-radius: 50%; }
  .primary-action span,
  .secondary-action span { display: none; }
  .map-button { width: 40px; min-height: 40px; }
  .legend { left: 10px; right: 64px; bottom: 10px; gap: 7px; }
  .legend-title { display: none !important; }
  .app-dialog {
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }
  .form-dialog form { padding: 16px; }
  .difficulty-grid { grid-template-columns: repeat(5, minmax(52px, 1fr)); overflow-x: auto; }
  .difficulty-option span { min-height: 64px; }
}

@media (max-width: 480px) {
  .two-column-form,
  .survey-grid { grid-template-columns: 1fr; }
  .cleanup-options { grid-template-columns: 1fr; }
  .cleanup-summary { grid-template-columns: 1fr 1fr; }
  .detail-actions { grid-template-columns: 1fr; }
  .stepper li { grid-template-columns: 26px; justify-content: center; }
  .stepper li span { display: none; }
  .dialog-actions {
    position: sticky;
    bottom: calc(-16px + env(safe-area-inset-bottom));
    padding: 10px 0 env(safe-area-inset-bottom);
    background: #fff;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .map-loading > span { animation: none; }
}
