:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #e5eaf2;
  --primary: #315efb;
  --primary-dark: #2448c5;
  --primary-soft: #edf2ff;
  --success: #15803d;
  --success-bg: #ecfdf3;
  --danger: #c2410c;
  --danger-bg: #fff7ed;
  --shadow: 0 18px 45px rgba(15, 23, 42, .08);
  --radius: 24px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #eef4ff 0, transparent 30%), var(--bg);
  color: var(--ink);
}
a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.page-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 44px; }
.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: stretch;
  background: linear-gradient(135deg, #172033, #273a63);
  color: white;
  padding: 34px;
  border-radius: 32px;
  box-shadow: var(--shadow);
}
.hero-copy h1 { margin: 10px 0 8px; font-size: clamp(32px, 5vw, 52px); letter-spacing: -0.04em; }
.hero-copy p { margin: 0; max-width: 680px; color: rgba(255,255,255,.78); line-height: 1.7; }
.eyebrow { display: inline-flex; color: #bfd0ff; font-weight: 800; letter-spacing: -.01em; }
.hero-actions { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; }
.ghost-link, .secondary-button, .primary-button, .text-button, .icon-button {
  border: 0;
  border-radius: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 800;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.ghost-link { background: rgba(255,255,255,.13); color: white; }
.hero-panel { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); border-radius: 24px; padding: 22px; }
.hero-panel ul { margin: 12px 0 0; padding-left: 20px; color: rgba(255,255,255,.82); line-height: 1.8; }
.main-grid { display: grid; gap: 18px; margin-top: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.card h2 { margin: 6px 0 0; font-size: 22px; letter-spacing: -.03em; }
.step-badge { display: inline-flex; padding: 5px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 900; }
.subtle-pill { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; background: #f8fafc; color: var(--muted); font-size: 12px; font-weight: 800; }
.head-actions { display: flex; gap: 8px; }
.icon-button { width: 36px; min-height: 36px; padding: 0; background: #f3f6fb; color: #42526b; }
.text-button { background: transparent; color: var(--primary); min-height: auto; padding: 0; }
.primary-button { background: var(--primary); color: #fff; box-shadow: 0 10px 20px rgba(49,94,251,.18); }
.primary-button:hover, .secondary-button:hover, .ghost-link:hover { transform: translateY(-1px); }
.primary-button:disabled, .secondary-button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.primary-button.is-loading, .secondary-button.is-loading { position: relative; }
.primary-button.is-loading::after, .secondary-button.is-loading::after {
  content: '...';
  display: inline-block;
  width: 0;
  margin-left: 2px;
  overflow: hidden;
  vertical-align: bottom;
  white-space: nowrap;
  animation: loadingDots 1.15s steps(4, end) infinite;
}
@keyframes loadingDots {
  from { width: 0; }
  to { width: 1.15em; }
}
.secondary-button { background: #f3f6fb; color: #24324b; border: 1px solid #e7edf6; }
.secondary-button.danger { color: var(--danger); background: var(--danger-bg); }
.form-grid { display: grid; grid-template-columns: 180px 280px minmax(260px, 420px) 220px; gap: 14px; align-items: end; }
.form-grid.slim { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 12px; }
label span { display: block; font-size: 13px; color: var(--muted); font-weight: 800; margin-bottom: 7px; }
input, select { width: 100%; min-height: 44px; border: 1px solid #dbe3ee; border-radius: 14px; padding: 0 13px; background: white; color: var(--ink); outline: none; }
input:focus, select:focus { border-color: #9db4ff; box-shadow: 0 0 0 4px rgba(49,94,251,.09); }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.button-row.compact { justify-content: flex-end; }
.site-buttons { margin-top: 12px; }
.inline-auto-action { align-self: end; }
.inline-auto-action .primary-button { width: 100%; min-height: 44px; white-space: nowrap; }
.secondary-site-buttons { justify-content: flex-start; }
.combo-wrap { position: relative; }
.combo-line { display: flex; gap: 8px; }
.combo-line input { flex: 1; }
.combo-line button { width: 46px; border: 1px solid #dbe3ee; border-radius: 14px; background: #f8fafc; }
.combo-list { position: absolute; left: 0; right: 0; z-index: 20; max-height: 280px; overflow: auto; margin-top: 6px; padding: 8px; background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.combo-option { width: 100%; display: block; text-align: left; border: 0; background: transparent; padding: 10px 12px; border-radius: 12px; color: var(--ink); }
.combo-option:hover, .combo-option:focus { background: #f3f6fb; }
.query-summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 16px; border: 1px solid #dfe7f2; background: #f8fafc; border-radius: 16px; margin-bottom: 14px; }
.advanced-box, .key-box, .upload-card details { margin-top: 14px; border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; background: #fbfcff; }
summary { font-weight: 900; color: #344054; cursor: pointer; }
.direct-url-row { display: flex; gap: 10px; margin-top: 12px; }
.status-box { white-space: pre-wrap; min-height: 58px; margin: 16px 0 0; padding: 15px; border-radius: 18px; border: 1px solid #e5eaf2; background: #f8fafc; color: #475467; font-family: inherit; line-height: 1.55; }
.status-box.success { border-color: #bbf7d0; background: var(--success-bg); color: #166534; }
.status-box.error { border-color: #fed7aa; background: var(--danger-bg); color: #9a3412; }
.candidate-list { margin-top: 14px; }
.candidate-grid { display: grid; gap: 10px; }
.candidate-card { padding: 14px; border-radius: 16px; background: #f8fafc; border: 1px solid var(--line); }
.candidate-card strong { display: block; margin-bottom: 4px; }
.site-action-row { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.drop-zone { min-height: 190px; border: 2px dashed #cbd5e1; border-radius: 22px; background: #f8fafc; display: grid; place-items: center; text-align: center; padding: 22px; gap: 8px; }
.drop-zone.dragover { border-color: var(--primary); background: #eef4ff; }
.drop-zone p { margin: 0; color: var(--muted); }
.upload-icon { font-size: 28px; color: var(--primary); }
.sheet-row { margin: 14px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.stats-grid div { padding: 14px; border-radius: 18px; background: #f8fafc; border: 1px solid var(--line); }
.stats-grid span { display: block; font-size: 12px; color: var(--muted); font-weight: 800; }
.stats-grid strong { display: block; margin-top: 8px; font-size: 20px; letter-spacing: -.02em; }
.map-layout { min-height: 420px; }
#map { width: 100%; min-height: 420px; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); background: #eef2f7; }
.map-empty { display: grid; place-items: center; text-align: center; color: var(--muted); }
.tab-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tab-button { border: 1px solid var(--line); background: #f8fafc; color: #475467; border-radius: 999px; padding: 9px 14px; font-weight: 900; }
.tab-button.active { background: var(--primary); color: white; border-color: var(--primary); }
.result-list { display: grid; gap: 10px; }
.result-list.empty { min-height: 120px; display: grid; place-items: center; color: var(--muted); background: #f8fafc; border-radius: 18px; border: 1px dashed var(--line); }
.place-card, .result-card-item { padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.place-title { font-weight: 900; }
.place-meta { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.map-popover { background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 12px; min-width: 220px; }
.map-popover-close { float: right; border: 0; background: #f3f6fb; border-radius: 999px; width: 24px; height: 24px; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; background: #111827; color: white; padding: 12px 16px; border-radius: 999px; box-shadow: var(--shadow); transition: .2s ease; z-index: 1000; max-width: min(520px, calc(100vw - 32px)); line-height: 1.45; text-align: center; white-space: normal; overflow-wrap: break-word; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.footer { text-align: center; color: var(--muted); font-size: 13px; margin-top: 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.hidden { display: none !important; }
.site-card.is-collapsed #configPanel,
.site-card.is-collapsed .status-box,
.site-card.is-collapsed .candidate-list { display: none; }
.site-card.is-collapsed #querySummary { display: flex !important; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 10px 0 0; }
@media (max-width: 860px) {
  .page-shell { width: min(100% - 22px, 1180px); padding-top: 14px; }
  .hero-card { grid-template-columns: 1fr; padding: 24px; border-radius: 24px; }
  .card { padding: 18px; border-radius: 22px; }
  .card-head { flex-direction: column; }
  .form-grid, .form-grid.slim { grid-template-columns: 1fr; }
  .direct-url-row, .button-row.compact { flex-direction: column; align-items: stretch; }
  .primary-button, .secondary-button, .ghost-link { width: 100%; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #map { min-height: 360px; }
}

/* v3.7.7 result review UI */
.section-subtitle { margin: 7px 0 0; color: var(--muted); line-height: 1.55; font-size: 14px; }
.result-head { align-items: flex-start; }
.result-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.view-toggle { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: #f8fafc; }
.view-button { min-height: 34px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: #667085; font-weight: 900; }
.view-button.active { background: #fff; color: var(--primary); box-shadow: 0 6px 14px rgba(15, 23, 42, .08); }
.result-summary-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.summary-card { position: relative; overflow: hidden; padding: 15px 16px; border: 1px solid var(--line); border-radius: 18px; background: #f8fafc; }
.summary-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: #cbd5e1; }
.summary-card span { display: block; color: var(--muted); font-size: 12px; font-weight: 900; }
.summary-card strong { display: block; margin-top: 7px; font-size: 21px; letter-spacing: -.03em; }
.summary-card.mapped::before { background: var(--primary); }
.summary-card.review::before { background: #f59e0b; }
.summary-card.excluded::before { background: #94a3b8; }
.summary-card.amount::before { background: #16a34a; }
.result-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.tab-row { margin-bottom: 0; }
.tab-button { display: inline-flex; align-items: center; gap: 7px; }
.tab-button span { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 24px; padding: 0 7px; border-radius: 999px; background: #fff; color: #475467; font-size: 12px; }
.tab-button.active span { background: rgba(255,255,255,.18); color: #fff; }
.sort-control { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.sort-control span { margin: 0; font-size: 12px; color: var(--muted); font-weight: 900; }
.sort-control select { min-height: 38px; border-radius: 12px; padding: 0 32px 0 12px; }
.result-list.card-mode { gap: 12px; }
.result-item { display: grid; gap: 11px; padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 8px 22px rgba(15, 23, 42, .045); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; cursor: pointer; }
.result-item:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(15, 23, 42, .07); border-color: #d5deea; }
.result-item.is-focused { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(49, 94, 251, .08), 0 14px 30px rgba(15, 23, 42, .07); }
.result-item.review { background: linear-gradient(180deg, #fff, #fffbeb); }
.result-item.excluded { background: #f8fafc; opacity: .86; }
.result-main-line { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.result-place-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.result-place { font-size: 18px; letter-spacing: -.02em; word-break: keep-all; overflow-wrap: anywhere; }
.result-amount { flex: 0 0 auto; font-size: 18px; letter-spacing: -.02em; color: #111827; }
.status-badge { display: inline-flex; align-items: center; min-height: 26px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 900; }
.status-badge.mapped { background: var(--primary-soft); color: var(--primary); }
.status-badge.review { background: #fff7ed; color: #b45309; }
.status-badge.excluded { background: #e2e8f0; color: #475569; }
.status-badge.pending { background: #f1f5f9; color: #64748b; }
.quick-meta { display: flex; flex-wrap: wrap; gap: 6px; color: #475467; font-size: 13px; }
.quick-meta span { display: inline-flex; align-items: center; min-height: 28px; padding: 0 9px; background: #f8fafc; border: 1px solid #eef2f7; border-radius: 999px; }
.result-purpose { margin: 0; color: #344054; line-height: 1.6; }
.result-detail-row { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; align-items: start; padding: 11px 12px; border-radius: 14px; background: #f8fafc; border: 1px solid #eef2f7; }
.result-detail-row.review { background: #fff7ed; border-color: #fed7aa; }
.result-detail-row.excluded { background: #f1f5f9; }
.detail-label { color: var(--muted); font-size: 12px; font-weight: 900; }
.detail-value { color: #344054; font-size: 13px; overflow-wrap: anywhere; }
.result-actions, .table-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-button { min-height: 32px; padding: 0 10px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; color: #334155; font-weight: 900; font-size: 12px; }
.mini-button:hover { background: #f8fafc; }
.mini-button.soft-review { background: #fff7ed; color: #b45309; border-color: #fed7aa; }
.mini-button.soft-exclude { background: #f1f5f9; color: #64748b; }
.table-mode { display: block; }
.result-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.result-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 880px; font-size: 14px; }
.result-table th { position: sticky; top: 0; z-index: 1; text-align: left; padding: 12px 14px; background: #f8fafc; color: #475467; font-size: 12px; font-weight: 900; border-bottom: 1px solid var(--line); }
.result-table td { padding: 13px 14px; border-bottom: 1px solid #eef2f7; vertical-align: top; }
.result-table tr:last-child td { border-bottom: 0; }
.result-table tbody tr:hover { background: #fbfcff; }
.result-table tr.review { background: #fffdf4; }
.result-table tr.excluded { background: #f8fafc; color: #64748b; }
.result-table small { display: block; margin-top: 5px; color: var(--muted); line-height: 1.45; }
.number-cell { text-align: right; white-space: nowrap; font-weight: 900; }
.empty-list { min-height: 120px; display: grid; place-items: center; color: var(--muted); background: #f8fafc; border-radius: 18px; border: 1px dashed var(--line); }
.empty-list p { margin: 0; }

@media (max-width: 860px) {
  .result-head-actions, .result-toolbar { width: 100%; align-items: stretch; flex-direction: column; }
  .view-toggle { width: 100%; }
  .view-button { flex: 1; }
  .result-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-card.amount { grid-column: 1 / -1; }
  .result-main-line { flex-direction: column; gap: 6px; }
  .result-amount { font-size: 20px; }
  .result-detail-row { grid-template-columns: 1fr; gap: 4px; }
  .sort-control { width: 100%; justify-content: space-between; }
}

/* v3.7.8 map-first flow refinements */
.flow-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #dfe8f5;
  border-radius: 18px;
  background: #f3f8ff;
}
.flow-message {
  margin-bottom: 14px;
  color: #52637a;
  font-weight: 800;
  line-height: 1.55;
}
.flow-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.flow-step {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #dbe5f2;
  border-radius: 999px;
  background: #fff;
  color: #667085;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}
.flow-step.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 22px rgba(49,94,251,.16);
}
.flow-step.done {
  border-color: #bbf7d0;
  background: #ecfdf3;
  color: #166534;
}
.flow-step.active::after {
  content: '';
  width: 6px;
  height: 6px;
  margin-left: 8px;
  border-radius: 999px;
  background: currentColor;
  animation: pulse-dot 1s infinite ease-in-out;
}
@keyframes pulse-dot {
  0%, 100% { opacity: .35; transform: scale(.75); }
  50% { opacity: 1; transform: scale(1.15); }
}
.status-details {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcff;
  padding: 14px 16px;
}
.status-details .status-box { margin-top: 12px; }
.site-status { white-space: pre-wrap; min-height: 58px; margin: 12px 0 0; padding: 15px; border-radius: 18px; border: 1px solid #e5eaf2; background: #f8fafc; color: #475467; font-family: inherit; line-height: 1.55; }
.site-status.success { border-color: #bbf7d0; background: var(--success-bg); color: #166534; }
.site-status.error { border-color: #fed7aa; background: var(--danger-bg); color: #9a3412; }
.combo-group-label {
  padding: 9px 12px 5px;
  color: #667085;
  font-size: 12px;
  font-weight: 900;
}
.combo-option strong { display: block; font-weight: 900; }
.combo-option span { display: none; }
.combo-empty { color: var(--muted); cursor: default; }
.map-card {
  border-color: #dbe7ff;
  box-shadow: 0 22px 58px rgba(15, 23, 42, .09);
}
.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: stretch;
  min-height: 560px;
}
#map { min-height: 560px; }
.selected-place-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fbfcff;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.selected-place-panel strong {
  font-size: 19px;
  letter-spacing: -.03em;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.selected-place-panel p {
  margin: 0;
  color: #475467;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.panel-kicker {
  display: inline-flex;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}
.selected-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.selected-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}
.selected-purpose {
  padding: 11px 12px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
}
.selected-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.upload-card {
  box-shadow: 0 12px 30px rgba(15, 23, 42, .055);
}
.upload-card .card-head { margin-bottom: 10px; }
.upload-card details { margin-top: 0; }
.upload-card .drop-zone {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: left;
  padding: 16px;
}
.upload-card .drop-zone p { font-size: 13px; }
.upload-card .upload-icon { font-size: 24px; }
.upload-card #parseButton { margin-top: 10px; }
.site-card.is-collapsed .flow-panel,
.site-card.is-collapsed .status-details { display: none; }

@media (max-width: 1040px) {
  .map-layout { grid-template-columns: 1fr; }
  .selected-place-panel { min-height: 170px; }
}
@media (max-width: 860px) {
  .flow-steps { grid-template-columns: 1fr; }
  #map { min-height: 420px; }
  .map-layout { min-height: 420px; }
  .upload-card .drop-zone { flex-direction: column; text-align: center; }
}
.site-card.no-agency .form-grid { grid-template-columns: 180px 280px 220px; max-width: 720px; }
.site-card.no-agency .site-buttons { margin-top: 12px; }
@media (max-width: 1040px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .inline-auto-action { grid-column: 1 / -1; } }
@media (max-width: 860px) { .site-card.no-agency .form-grid { grid-template-columns: 1fr; max-width: none; } }

/* v3.7.9: 지도 중심 흐름에서는 결과를 표로 먼저 보여줍니다. */
.result-card .result-head-actions { margin-left: auto; }
.result-list.table-mode { border-radius: 22px; overflow: hidden; }
.result-table td:nth-child(2) strong { display: block; margin-bottom: 4px; }
.result-table td:nth-child(5) { color: #344054; }

/* v3.8.0: 하위항목은 적정 폭으로 줄이고, 자동 가져오기 버튼을 조건 행 오른쪽에 배치 */
@media (max-width: 860px) {
  .form-grid, .form-grid.slim { grid-template-columns: 1fr; }
  .inline-auto-action { grid-column: auto; }
}

/* v3.8.2: 결과 요약 카드와 표/콤보박스 사용성 보완 */
.summary-card {
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.summary-card:hover {
  transform: translateY(-1px);
  border-color: #d0dcf0;
  box-shadow: 0 12px 24px rgba(15, 23, 42, .06);
}
.summary-card.active {
  border-color: rgba(49, 94, 251, .5);
  box-shadow: 0 0 0 4px rgba(49, 94, 251, .08);
  background: #ffffff;
}
.summary-card.amount.active {
  border-color: rgba(22, 163, 74, .45);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, .08);
}
.status-badge {
  white-space: nowrap;
  word-break: keep-all;
  line-height: 1;
}
.result-table th:first-child,
.result-table td:first-child {
  width: 94px;
  min-width: 94px;
}
.result-table tbody tr {
  cursor: pointer;
}
.result-table tbody tr:hover {
  background: #f7faff;
}
.result-table .status-badge {
  min-width: 68px;
  justify-content: center;
}
.combo-list {
  z-index: 80;
}
.combo-list.is-open-all {
  max-height: min(460px, calc(100vh - 220px));
}
.combo-group-label {
  position: sticky;
  top: -8px;
  z-index: 1;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
}
@media (max-width: 860px) {
  .result-table th:first-child,
  .result-table td:first-child {
    width: 88px;
    min-width: 88px;
  }
}

/* v3.8.3: 모바일 최적화 - 지도 중심 흐름 */
.mobile-quick-nav { display: none; }

@media (max-width: 720px) {
  :root { --radius: 18px; }
  body { background: #f5f7fb; }
  .page-shell {
    width: 100%;
    padding: 8px 10px 28px;
    overflow-x: hidden;
  }

  .hero-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px;
    border-radius: 22px;
  }
  .hero-copy h1 {
    margin: 6px 0;
    font-size: 28px;
    letter-spacing: -.04em;
  }
  .hero-copy p {
    font-size: 14px;
    line-height: 1.55;
  }
  .hero-panel {
    padding: 14px;
    border-radius: 18px;
  }
  .hero-panel ul {
    margin-top: 8px;
    padding-left: 18px;
    font-size: 13px;
    line-height: 1.65;
  }

  .mobile-quick-nav {
    position: sticky;
    top: 0;
    z-index: 70;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin: 10px 0;
    padding: 7px;
    border: 1px solid rgba(219, 227, 238, .9);
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(14px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, .07);
  }
  .mobile-quick-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border-radius: 999px;
    background: #f3f6fb;
    color: #344054;
    text-decoration: none;
    font-weight: 900;
    font-size: 14px;
  }
  .mobile-quick-nav a:nth-child(2) {
    background: var(--primary);
    color: #fff;
  }

  .main-grid { gap: 12px; margin-top: 10px; }
  .card {
    padding: 15px;
    border-radius: 20px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
  }
  .card-head {
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
  }
  .card h2 { font-size: 20px; }
  .head-actions { margin-left: auto; }
  .icon-button { width: 34px; min-height: 34px; }

  .form-grid,
  .form-grid.slim,
  .site-card.no-agency .form-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    max-width: none;
  }
  label span { font-size: 12px; margin-bottom: 6px; }
  input, select {
    min-height: 46px;
    border-radius: 14px;
    font-size: 16px;
  }
  .combo-line button {
    width: 48px;
    min-height: 46px;
  }
  .combo-list {
    position: fixed;
    left: 10px;
    right: 10px;
    top: 128px;
    bottom: 14px;
    max-height: none !important;
    margin: 0;
    padding: 10px;
    border-radius: 22px;
    z-index: 200;
    overscroll-behavior: contain;
  }
  .combo-option {
    min-height: 44px;
    padding: 11px 12px;
    font-size: 15px;
  }
  .combo-group-label {
    top: -10px;
    padding-top: 10px;
  }

  .inline-auto-action { grid-column: auto; }
  .inline-auto-action .primary-button,
  #autoExcelButton {
    min-height: 50px;
    border-radius: 16px;
    font-size: 17px;
  }
  .button-row.site-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .button-row.site-buttons .secondary-button,
  .button-row.site-buttons .primary-button {
    width: 100%;
    min-height: 44px;
    padding: 0 10px;
    font-size: 14px;
  }
  #stopFetchButton { grid-column: 1 / -1; }
  .advanced-box, .status-details, .key-box, .upload-card details {
    padding: 12px;
    border-radius: 16px;
  }
  .direct-url-row { flex-direction: column; }

  .flow-panel {
    padding: 12px;
    border-radius: 18px;
  }
  .flow-message {
    margin-bottom: 10px;
    font-size: 14px;
  }
  .flow-steps {
    display: flex;
    grid-template-columns: none;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .flow-steps::-webkit-scrollbar { display: none; }
  .flow-step {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 13px;
    font-size: 12px;
  }
  .site-status,
  .status-box {
    max-height: 180px;
    overflow: auto;
    font-size: 13px;
  }

  .map-card { padding: 12px; }
  .map-card .card-head {
    flex-direction: column;
    align-items: stretch;
  }
  .map-card .button-row.compact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .map-card .button-row.compact .primary-button,
  .map-card .button-row.compact .secondary-button {
    width: 100%;
  }
  .form-grid.slim {
    display: grid;
    grid-template-columns: 1fr;
  }
  .stats-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin: 12px -12px 12px;
    padding: 0 12px 2px;
    scrollbar-width: none;
  }
  .stats-grid::-webkit-scrollbar { display: none; }
  .stats-grid div {
    flex: 0 0 132px;
    padding: 12px;
    border-radius: 16px;
  }
  .stats-grid strong { font-size: 18px; }

  .map-layout {
    grid-template-columns: 1fr;
    gap: 10px;
    min-height: 0;
  }
  #map {
    min-height: 56svh;
    height: 56svh;
    border-radius: 18px;
  }
  .map-empty { min-height: 340px !important; height: 340px !important; }
  .selected-place-panel {
    min-height: auto;
    padding: 14px;
    border-radius: 18px;
  }
  .selected-place-panel strong { font-size: 17px; }
  .selected-place-panel p { font-size: 13px; }
  .selected-actions .mini-button { flex: 1; }
  .map-popover {
    max-width: min(280px, calc(100vw - 44px));
    min-width: 200px;
    padding: 10px;
    font-size: 13px;
  }

  .upload-card { padding: 14px; }
  .upload-card .card-head {
    flex-direction: row;
    align-items: center;
  }
  .upload-card .drop-zone {
    min-height: 82px;
    border-radius: 18px;
    padding: 14px;
    gap: 10px;
  }
  .upload-card .drop-zone strong { font-size: 15px; }
  .upload-card .drop-zone p { font-size: 12px; }

  .result-card { padding: 14px; }
  .result-head {
    flex-direction: column;
    align-items: stretch;
  }
  .result-head-actions .secondary-button { width: 100%; }
  .section-subtitle { font-size: 13px; }
  .result-summary-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin: 0 -14px 12px;
    padding: 0 14px 2px;
    scrollbar-width: none;
  }
  .result-summary-grid::-webkit-scrollbar { display: none; }
  .summary-card {
    flex: 0 0 128px;
    min-height: 80px;
    padding: 13px 14px;
    border-radius: 16px;
  }
  .summary-card.amount { flex-basis: 166px; }
  .summary-card strong { font-size: 20px; }

  .result-toolbar {
    position: sticky;
    top: 62px;
    z-index: 40;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin: 0 -14px 12px;
    padding: 10px 14px;
    border-top: 1px solid #eef2f7;
    border-bottom: 1px solid #eef2f7;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(12px);
  }
  .tab-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 7px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .tab-row::-webkit-scrollbar { display: none; }
  .tab-button {
    flex: 0 0 auto;
    padding: 9px 12px;
    white-space: nowrap;
  }
  .sort-control {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
  }
  .sort-control select { width: 100%; }

  .result-list.table-mode { overflow: visible; }
  .result-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }
  .result-table {
    display: block;
    min-width: 0;
    width: 100%;
    font-size: 14px;
  }
  .result-table thead { display: none; }
  .result-table tbody { display: grid; gap: 10px; }
  .result-table tr {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 8px 10px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .045);
  }
  .result-table tr.review { background: #fffdf4; }
  .result-table tr.excluded { background: #f8fafc; }
  .result-table td {
    display: block;
    padding: 0;
    border: 0;
    min-width: 0 !important;
    width: auto !important;
  }
  .result-table td:nth-child(1) {
    grid-row: 1 / span 3;
  }
  .result-table td:nth-child(2) {
    grid-column: 2;
  }
  .result-table td:nth-child(2) strong {
    font-size: 16px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }
  .result-table td:nth-child(2) small {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.45;
  }
  .result-table td:nth-child(3) {
    grid-column: 2;
    color: #667085;
    font-size: 13px;
  }
  .result-table td:nth-child(4) {
    grid-column: 2;
    text-align: left;
    font-size: 17px;
  }
  .result-table td:nth-child(5) {
    grid-column: 1 / -1;
    padding: 9px 10px;
    border-radius: 12px;
    background: #f8fafc;
    color: #475467;
    font-size: 13px;
    line-height: 1.45;
  }
  .result-table td:nth-child(5)::before {
    content: '주소·사유 '; 
    color: #667085;
    font-weight: 900;
  }
  .result-table td:nth-child(6) {
    grid-column: 1 / -1;
  }
  .table-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .table-actions .mini-button {
    min-height: 38px;
    width: 100%;
  }
  .result-table .status-badge {
    min-width: 62px;
    min-height: 30px;
    padding: 0 8px;
    justify-content: center;
    white-space: normal;
    line-height: 1.1;
  }

  .toast {
    bottom: 14px;
    width: calc(100vw - 24px);
    max-width: none;
    border-radius: 18px;
    padding: 13px 14px;
    font-size: 14px;
  }
  .footer { font-size: 12px; margin-top: 14px; }
}

@media (max-width: 390px) {
  .button-row.site-buttons { grid-template-columns: 1fr; }
  .card { padding: 13px; }
  #map { min-height: 52svh; height: 52svh; }
  .result-table tr { grid-template-columns: 66px minmax(0, 1fr); padding: 12px; }
  .summary-card { flex-basis: 118px; }
}

/* v3.8.5: 하위항목 전체 목록과 교육지원청 수집 안정화 */
.combo-list {
  max-height: min(620px, calc(100vh - 190px));
  overscroll-behavior: contain;
}
.combo-list.is-open-all {
  max-height: min(680px, calc(100vh - 170px));
}
.combo-group-label {
  position: static;
  top: auto;
  z-index: auto;
  padding: 12px 12px 5px;
  background: transparent;
  backdrop-filter: none;
}
.combo-option strong {
  line-height: 1.25;
}
@media (max-width: 860px) {
  .combo-list,
  .combo-list.is-open-all {
    max-height: none;
  }
  .combo-group-label {
    position: sticky;
    top: -10px;
    z-index: 1;
    background: rgba(255, 255, 255, .98);
    padding-top: 10px;
  }
}

/* v3.9.0: 지도 중심 구조 정리 - 자료 선택 / 지도 확인 / 검토 표 / 문제 해결 */
.v390-grid {
  gap: 16px;
}
.hero-card {
  grid-template-columns: minmax(0, 1fr) 280px;
  padding: 28px 30px;
  border-radius: 28px;
}
.hero-copy h1 {
  font-size: clamp(30px, 4vw, 44px);
}
.hero-panel {
  padding: 18px;
}
.section-badge {
  background: #eef4ff;
  color: var(--primary);
}
.muted-badge {
  background: #f1f5f9;
  color: #475569;
}
.compact-head {
  align-items: flex-start;
  margin-bottom: 14px;
}
.control-card {
  padding-bottom: 18px;
}
.control-card .section-subtitle,
.map-first-card .section-subtitle,
.table-card .section-subtitle,
.support-card .section-subtitle {
  margin-top: 6px;
}
.query-bar {
  grid-template-columns: 180px 280px minmax(260px, 1fr) 220px;
  gap: 12px;
}
.support-link-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.ghost-chip-button,
.ghost-chip-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid #e7edf6;
  background: #f8fafc;
  color: #475467;
  font-weight: 900;
  font-size: 12px;
  text-decoration: none;
}
.ghost-chip-button:hover,
.ghost-chip-link:hover {
  background: #eef4ff;
  color: var(--primary);
}
.compact-flow {
  display: grid;
  grid-template-columns: minmax(220px, .9fr) minmax(0, 1.6fr);
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  background: #f7fbff;
}
.compact-flow .flow-message {
  margin: 0;
  font-size: 14px;
}
.compact-flow .flow-steps {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}
.compact-flow .flow-step {
  min-height: 34px;
  padding: 0 9px;
  font-size: 12px;
}
.map-first-card {
  padding-top: 22px;
}
.map-head {
  align-items: flex-start;
  margin-bottom: 12px;
}
.map-actions {
  flex: 0 0 auto;
}
.compact-stats {
  margin: 12px 0;
}
.compact-stats div {
  padding: 12px 14px;
  border-radius: 16px;
}
.compact-stats strong {
  font-size: 18px;
}
.support-card {
  box-shadow: 0 12px 30px rgba(15, 23, 42, .055);
}
.support-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.support-details {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  background: #fbfcff;
}
.support-details[open] {
  background: #fff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .045);
}
.support-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.compact-drop-zone {
  min-height: 92px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  place-items: initial;
  align-items: center;
  text-align: left;
  padding: 14px;
  margin-top: 12px;
}
.compact-drop-zone p {
  margin-top: 4px;
}
.support-form {
  margin-top: 12px;
}
.support-card .status-box {
  max-height: 260px;
  overflow: auto;
}
.result-card.table-card {
  box-shadow: 0 14px 34px rgba(15, 23, 42, .06);
}
.site-card.is-collapsed .compact-flow {
  display: none;
}
@media (max-width: 1040px) {
  .query-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .query-bar .inline-auto-action {
    grid-column: 1 / -1;
  }
  .compact-flow {
    grid-template-columns: 1fr;
  }
  .support-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .hero-card {
    padding: 18px;
    border-radius: 22px;
  }
  .hero-panel {
    display: none;
  }
  .mobile-quick-nav {
    grid-template-columns: repeat(3, 1fr);
  }
  .query-bar,
  .site-card.no-agency .query-bar {
    grid-template-columns: 1fr;
    max-width: none;
  }
  .support-link-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }
  .support-link-row > span {
    grid-column: 1 / -1;
  }
  .ghost-chip-button,
  .ghost-chip-link {
    min-height: 38px;
    width: 100%;
  }
  .compact-flow .flow-steps {
    display: flex;
    overflow-x: auto;
    grid-template-columns: none;
  }
  .compact-flow .flow-step {
    flex: 0 0 auto;
  }
  .map-head {
    flex-direction: column;
    align-items: stretch;
  }
  .map-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .compact-drop-zone {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }
}

/* v3.9.1: 지도 중심 강화 - 요약을 지도 위 필터 바로 축소 */
.map-first-card {
  padding: 22px;
}
.map-first-card .map-head {
  margin-bottom: 14px;
  align-items: center;
}
.map-first-card .map-head h2 {
  font-size: 24px;
}
.map-first-card .map-actions .primary-button,
.map-first-card .map-actions .secondary-button {
  min-height: 40px;
  border-radius: 13px;
}
.map-filter-summary {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin: 0 0 12px;
  padding: 8px;
  border: 1px solid #dfe7f5;
  border-radius: 20px;
  background: #f8fbff;
  overflow-x: auto;
  scrollbar-width: none;
}
.map-filter-summary::-webkit-scrollbar { display: none; }
.map-filter-summary .summary-card {
  flex: 0 0 auto;
  min-width: 122px;
  min-height: 54px;
  padding: 9px 12px;
  border-radius: 15px;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.map-filter-summary .summary-card span {
  font-size: 13px;
  color: #475467;
  font-weight: 900;
  white-space: nowrap;
}
.map-filter-summary .summary-card strong {
  margin: 0;
  font-size: 20px;
  color: #111827;
  white-space: nowrap;
}
.map-filter-summary .summary-card.amount {
  margin-left: auto;
  min-width: 190px;
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.map-filter-summary .summary-card.amount span { color: #166534; }
.map-filter-summary .summary-card.active {
  background: #fff;
  border-color: rgba(49, 94, 251, .45);
  box-shadow: 0 0 0 4px rgba(49, 94, 251, .08);
}
.map-filter-summary .summary-card:hover {
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, .06);
}
.map-stat-sink {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.map-layout {
  min-height: 640px;
  grid-template-columns: minmax(0, 1fr) 320px;
}
#map {
  min-height: 640px;
}
.selected-place-panel {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-color: #dbe7ff;
  box-shadow: inset 4px 0 0 rgba(49, 94, 251, .18);
}
.selected-place-panel .panel-kicker {
  background: #eaf0ff;
}
.result-card .result-summary-grid {
  display: none;
}
.result-toolbar {
  padding-top: 2px;
}
.result-card .tab-row {
  margin-bottom: 0;
}
.result-table-wrap {
  max-height: 720px;
}
.result-table tbody tr.is-focused {
  background: #eef4ff !important;
  box-shadow: inset 4px 0 0 var(--primary);
}

@media (max-width: 1040px) {
  .map-layout { grid-template-columns: 1fr; min-height: 560px; }
  #map { min-height: 560px; }
}
@media (max-width: 720px) {
  .map-first-card { padding: 12px; }
  .map-first-card .map-head { gap: 10px; }
  .map-filter-summary {
    margin-bottom: 10px;
    padding: 6px;
    border-radius: 18px;
  }
  .map-filter-summary .summary-card {
    min-width: 104px;
    min-height: 50px;
    padding: 8px 10px;
  }
  .map-filter-summary .summary-card.amount {
    min-width: 168px;
    margin-left: 0;
  }
  .map-filter-summary .summary-card strong { font-size: 18px; }
  .map-layout { min-height: 520px; }
  #map { min-height: 520px; }
}

/* v3.10.0: Figma-inspired visual refresh — flat surfaces, compact hierarchy, map-first workspace */
:root {
  --bg: #f7f7f8;
  --card: #ffffff;
  --ink: #18181b;
  --muted: #71717a;
  --line: #e4e4e7;
  --line-strong: #d4d4d8;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --success: #15803d;
  --success-bg: #f0fdf4;
  --danger: #c2410c;
  --danger-bg: #fff7ed;
  --shadow: 0 1px 2px rgba(24, 24, 27, .04);
  --radius: 14px;
}

html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page-shell {
  width: min(1240px, calc(100% - 36px));
  margin: 0 auto;
  padding: 18px 0 36px;
}

/* app bar */
.hero-card.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  box-shadow: none;
}
.app-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.app-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
}
.hero-copy { min-width: 0; }
.hero-copy .eyebrow {
  display: block;
  color: #71717a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.2;
}
.app-title-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hero-copy h1 {
  margin: 3px 0 0;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -.025em;
}
.hero-copy p {
  margin: 3px 0 0;
  max-width: none;
  color: #71717a;
  font-size: 13px;
  line-height: 1.45;
}
.header-context {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafafa;
  color: #52525b;
  font-size: 12px;
  font-weight: 650;
}
.context-divider { width: 1px; height: 12px; background: var(--line-strong); }
.app-version {
  color: #71717a;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
}
.hero-panel { display: none !important; }

.main-grid.v390-grid { gap: 12px; margin-top: 12px; }
.card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.card-head { margin-bottom: 16px; }
.card h2,
.map-first-card .map-head h2 {
  margin: 4px 0 0;
  font-size: 20px;
  font-weight: 720;
  letter-spacing: -.025em;
}
.section-subtitle {
  margin-top: 5px !important;
  color: #71717a;
  font-size: 13px;
  line-height: 1.5;
}

/* section labels: remove pill-heavy dashboard feel */
.step-badge,
.section-badge,
.muted-badge {
  display: block;
  width: fit-content;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #71717a;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .02em;
}
.subtle-pill {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
  color: #71717a;
  font-size: 11px;
  font-weight: 650;
}

/* controls */
.ghost-link, .secondary-button, .primary-button, .text-button, .icon-button {
  min-height: 40px;
  padding: 0 13px;
  border-radius: 9px;
  font-weight: 700;
  transition: border-color .14s ease, background .14s ease, color .14s ease, box-shadow .14s ease;
}
.primary-button {
  background: var(--primary);
  color: #fff;
  box-shadow: none;
}
.primary-button:hover { background: var(--primary-dark); transform: none; }
.secondary-button {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: #3f3f46;
}
.secondary-button:hover { background: #fafafa; transform: none; border-color: #c4c4c8; }
.secondary-button.danger { border-color: #fed7aa; background: #fff; color: var(--danger); }
.icon-button {
  width: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: #52525b;
}
.icon-button:hover { background: #f4f4f5; }
.text-button { color: var(--primary); }

label span { color: #52525b; font-size: 12px; font-weight: 650; margin-bottom: 6px; }
input, select {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}
input:hover, select:hover { border-color: #a1a1aa; }
input:focus, select:focus {
  border-color: #93b4f8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}
.combo-line button {
  width: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: #52525b;
}
.combo-list {
  margin-top: 5px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(24, 24, 27, .10);
}
.combo-option { border-radius: 7px; padding: 9px 10px; }
.combo-option:hover, .combo-option:focus { background: #f4f4f5; }

.query-summary {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fafafa;
}

/* compact utility links — squared off and quiet */
.support-link-row { margin-top: 9px; gap: 6px; font-weight: 650; }
.support-link-row > span { margin-right: 2px; color: #a1a1aa; font-size: 11px; }
.ghost-chip-button,
.ghost-chip-link {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #71717a;
  font-size: 11px;
  font-weight: 650;
}
.ghost-chip-button:hover,
.ghost-chip-link:hover { border-color: var(--line); background: #fafafa; color: #3f3f46; }

/* progress — closer to a compact product status bar */
.flow-panel,
.compact-flow {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafafa;
}
.compact-flow { grid-template-columns: minmax(220px, .95fr) minmax(0, 1.55fr); gap: 12px; }
.flow-message,
.compact-flow .flow-message { color: #52525b; font-size: 12px; font-weight: 600; }
.compact-flow .flow-steps { gap: 5px; }
.flow-step,
.compact-flow .flow-step {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #71717a;
  font-size: 11px;
  font-weight: 650;
}
.flow-step.active {
  border-color: #bfdbfe;
  background: var(--primary-soft);
  color: #1d4ed8;
  box-shadow: none;
}
.flow-step.done { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.flow-step.active::after { width: 5px; height: 5px; margin-left: 6px; }

/* map workspace */
.map-context-bar {
  position: sticky;
  top: 8px;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 10px;
  padding: 9px 11px;
  border: 1px solid #dbeafe;
  border-radius: 9px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 1px 2px rgba(24, 24, 27, .04);
  backdrop-filter: blur(10px);
}
.map-context-copy { min-width: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.map-context-kicker { color: #71717a; font-size: 10px; font-weight: 720; letter-spacing: .02em; }
.map-context-title { color: #1e3a8a; font-size: 13px; font-weight: 780; letter-spacing: -.015em; }
.map-context-source { color: #71717a; font-size: 11px; font-weight: 600; }
.map-status-badge {
  flex: 0 0 auto;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border: 1px solid #e4e4e7;
  border-radius: 999px;
  background: #fafafa;
  color: #71717a;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}
.map-status-badge.fetch,
.map-status-badge.parse,
.map-status-badge.geocode { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.map-status-badge.fetch::before,
.map-status-badge.parse::before,
.map-status-badge.geocode::before {
  content: '';
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: statusPulse 1.25s ease-in-out infinite;
}
@keyframes statusPulse {
  0%, 100% { opacity: .45; transform: scale(.85); }
  50% { opacity: 1; transform: scale(1.2); }
}
.map-status-badge.done { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.map-status-badge.partial { border-color: #fed7aa; background: #fff7ed; color: #c2410c; }
.map-status-badge.error { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }

.map-card,
.map-first-card {
  padding: 18px;
  border-color: var(--line);
  box-shadow: var(--shadow);
}
.map-first-card .map-head { align-items: flex-start; margin-bottom: 12px; }
.map-first-card .map-actions .primary-button,
.map-first-card .map-actions .secondary-button { min-height: 38px; border-radius: 9px; }
.map-filter-summary {
  gap: 4px;
  margin: 0 0 10px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafafa;
}
.map-filter-summary .summary-card {
  min-width: 108px;
  min-height: 46px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  box-shadow: none;
  transition: background .14s ease, border-color .14s ease;
}
.map-filter-summary .summary-card::before { display: none; }
.map-filter-summary .summary-card span { color: #71717a; font-size: 11px; font-weight: 650; }
.map-filter-summary .summary-card strong { color: #27272a; font-size: 17px; font-weight: 720; }
.map-filter-summary .summary-card.amount {
  min-width: 176px;
  margin-left: auto;
  border-color: transparent;
  background: transparent;
}
.map-filter-summary .summary-card.amount span { color: #71717a; }
.map-filter-summary .summary-card.active {
  border-color: #bfdbfe;
  background: #fff;
  box-shadow: 0 1px 2px rgba(24, 24, 27, .04);
}
.map-filter-summary .summary-card.active span,
.map-filter-summary .summary-card.active strong { color: #1d4ed8; }
.map-filter-summary .summary-card:hover { background: #fff; transform: none; box-shadow: none; }

.map-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 10px; min-height: 620px; }
#map {
  min-height: 620px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f4f4f5;
}
.selected-place-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}
.selected-place-panel .panel-kicker,
.panel-kicker {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #71717a;
  font-size: 11px;
  font-weight: 700;
}
.selected-place-panel strong { font-size: 17px; font-weight: 720; letter-spacing: -.02em; }
.selected-place-panel p { color: #71717a; font-size: 13px; }
.selected-meta span,
.quick-meta span {
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fafafa;
  color: #52525b;
  font-size: 12px;
}

/* results */
.result-card.table-card { box-shadow: var(--shadow); }
.result-toolbar { gap: 10px; }
.tab-row { gap: 4px; }
.tab-button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #71717a;
  font-size: 12px;
  font-weight: 650;
}
.tab-button:hover { background: #f4f4f5; }
.tab-button.active {
  border-color: #bfdbfe;
  background: var(--primary-soft);
  color: #1d4ed8;
}
.tab-button span,
.tab-button.active span {
  min-width: 20px;
  min-height: 20px;
  padding: 0 5px;
  border-radius: 6px;
  background: rgba(255,255,255,.8);
  color: inherit;
  font-size: 10px;
}
.sort-control select { min-height: 36px; border-radius: 8px; }
.result-table-wrap { border: 1px solid var(--line); border-radius: 10px; }
.result-table th { padding: 10px 12px; background: #fafafa; color: #71717a; font-size: 11px; font-weight: 700; }
.result-table td { padding: 12px; border-bottom-color: #f0f0f1; }
.result-table tbody tr:hover { background: #fafafa; }
.result-table tbody tr.is-focused { background: var(--primary-soft) !important; box-shadow: inset 2px 0 0 var(--primary); }
.status-badge {
  min-height: 24px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}
.result-item {
  padding: 14px;
  border-radius: 10px;
  box-shadow: none;
}
.result-item:hover { transform: none; box-shadow: none; border-color: var(--line-strong); }
.result-detail-row { border-radius: 8px; }
.mini-button { min-height: 30px; border-radius: 7px; font-weight: 650; }

/* troubleshooting area */
.support-card { box-shadow: var(--shadow); }
.support-grid { gap: 8px; }
.support-details,
.advanced-box, .key-box, .upload-card details,
.status-details {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 13px;
  background: #fafafa;
  box-shadow: none;
}
.support-details[open] { background: #fff; box-shadow: none; }
.support-details summary,
summary { color: #3f3f46; font-size: 13px; font-weight: 700; }
.drop-zone,
.compact-drop-zone {
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  background: #fafafa;
}
.upload-icon { color: #71717a; font-size: 22px; }
.status-box,
.site-status {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fafafa;
  color: #52525b;
}
.empty-list,
.result-list.empty {
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: #fafafa;
}

.toast {
  border-radius: 10px;
  background: #27272a;
  box-shadow: 0 8px 24px rgba(24,24,27,.16);
  font-size: 13px;
}
.footer { margin-top: 14px; color: #a1a1aa; font-size: 12px; }
.footer a { color: #71717a; }

@media (max-width: 1040px) {
  .compact-flow { grid-template-columns: 1fr; }
  .map-layout { grid-template-columns: 1fr; min-height: 540px; }
  #map { min-height: 540px; }
}

@media (max-width: 720px) {
  .page-shell { width: min(100% - 20px, 1240px); padding-top: 10px; }
  .hero-card.app-header {
    min-height: auto;
    padding: 12px;
    border-radius: 12px;
  }
  .app-mark { flex-basis: 34px; width: 34px; height: 34px; border-radius: 9px; }
  .hero-copy h1 { font-size: 18px; }
  .hero-copy p { display: none; }
  .header-context { display: none; }
  .mobile-quick-nav {
    top: 8px;
    gap: 4px;
    margin: 8px 0 0;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255,255,255,.94);
    box-shadow: none;
  }
  .mobile-quick-nav a {
    min-height: 32px;
    border-radius: 7px;
    background: transparent;
    color: #71717a;
    font-size: 12px;
    font-weight: 650;
  }
  .mobile-quick-nav a:nth-child(2) { background: var(--primary-soft); color: #1d4ed8; }
  .main-grid.v390-grid { gap: 8px; margin-top: 8px; }
  .card { padding: 14px; border-radius: 12px; box-shadow: none; }
  .card h2, .map-first-card .map-head h2 { font-size: 18px; }
  .card-head { margin-bottom: 12px; }
  .query-bar { gap: 8px; }
  input, select { min-height: 44px; border-radius: 9px; }
  .inline-auto-action .primary-button, #autoExcelButton { min-height: 46px; border-radius: 9px; font-size: 15px; }
  .support-link-row { grid-template-columns: 1fr 1fr; }
  .ghost-chip-button, .ghost-chip-link { min-height: 34px; border: 1px solid var(--line); background: #fff; }
  .flow-panel, .compact-flow { padding: 9px; border-radius: 9px; }
  .compact-flow .flow-step { min-height: 30px; border-radius: 7px; }
  .map-first-card { padding: 10px; }
  .map-filter-summary { margin-bottom: 8px; border-radius: 9px; }
  .map-filter-summary .summary-card { min-width: 98px; min-height: 44px; border-radius: 7px; }
  .map-filter-summary .summary-card.amount { min-width: 158px; }
  .map-layout { gap: 8px; min-height: 500px; }
  #map { min-height: 54svh; height: 54svh; border-radius: 9px; }
  .map-empty { min-height: 320px !important; height: 320px !important; }
  .selected-place-panel { padding: 13px; border-radius: 9px; }
  .result-toolbar {
    top: 54px;
    margin: 0 -14px 10px;
    padding: 8px 14px;
    border-color: var(--line);
  }
  .result-table tr { border-radius: 9px; box-shadow: none; }
  .support-details { border-radius: 9px; }
  .toast { border-radius: 10px; }
}

/* v3.10.0 finishing touches */
.flow-step.active::after { animation: none; }
@media (max-width: 720px) {
  .map-filter-summary .summary-card.amount { margin-left: 0; }
}

/* v3.11.1: map + review workspace */
.app-mark {
  display: block;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  object-fit: cover;
}

.map-layout {
  grid-template-columns: minmax(0, 3fr) minmax(350px, 2fr);
  gap: 10px;
  min-height: 640px;
}
#map { min-height: 640px; }

.map-review-panel {
  min-width: 0;
  height: 640px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.map-review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 8px;
}
.map-review-head > div { min-width: 0; }
.map-review-head strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 720;
  letter-spacing: -.02em;
}
.map-review-count {
  flex: 0 0 auto;
  color: #52525b;
  font-size: 12px;
  font-weight: 700;
}
.map-review-helper {
  margin: 0;
  padding: 0 14px 11px;
  border-bottom: 1px solid #f0f0f1;
  color: #8a8a93;
  font-size: 11px;
  line-height: 1.45;
}
.map-review-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.map-review-empty {
  margin: 0;
  padding: 20px 14px;
  color: #8a8a93;
  font-size: 12px;
  line-height: 1.55;
}
.map-review-item {
  border-bottom: 1px solid #f0f0f1;
  background: #fff;
}
.map-review-item:last-child { border-bottom: 0; }
.map-review-item.is-active {
  background: var(--primary-soft);
  box-shadow: inset 2px 0 0 var(--primary);
}
.map-review-select {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.map-review-select:hover { background: #fafafa; }
.map-review-item.is-active .map-review-select:hover { background: transparent; }
.map-review-main { min-width: 0; }
.map-review-title-line {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.map-review-title-line > strong {
  min-width: 0;
  overflow: hidden;
  color: #27272a;
  font-size: 13px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.map-review-title-line .status-badge {
  flex: 0 0 auto;
  min-height: 20px;
  padding: 0 5px;
  font-size: 9px;
}
.map-review-meta {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: #8a8a93;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.map-review-amount {
  align-self: start;
  padding-top: 1px;
  color: #3f3f46;
  font-size: 12px;
  font-weight: 720;
  white-space: nowrap;
}
.map-review-detail {
  margin: -2px 12px 11px;
  padding: 11px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: rgba(255,255,255,.82);
}
.map-review-address,
.map-review-purpose {
  margin: 0;
  color: #52525b;
  font-size: 12px;
  line-height: 1.5;
}
.map-review-purpose {
  margin-top: 7px;
  color: #71717a;
}
.map-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #eef0f3;
}
.map-review-actions .mini-button {
  min-height: 28px;
  padding: 0 8px;
  background: #fff;
  font-size: 11px;
  text-decoration: none;
}

@media (max-width: 1040px) {
  .map-layout { grid-template-columns: 1fr; min-height: 0; }
  .map-review-panel { height: auto; max-height: 430px; }
}

@media (max-width: 720px) {
  .map-layout { min-height: 0; }
  .map-review-panel { max-height: 390px; border-radius: 9px; }
  .map-review-head { padding: 12px 12px 7px; }
  .map-review-helper { padding: 0 12px 9px; }
  .map-review-select { min-height: 68px; padding: 10px 11px; }
}


/* v3.11.2: quiet selection states */
.map-review-item.is-active {
  background: #fff;
  box-shadow: none;
}
.map-review-item.is-active .map-review-select:hover {
  background: #fafafa;
}
.result-item.is-focused {
  border-color: var(--line);
  box-shadow: none;
}
.result-table tbody tr.is-focused {
  background: inherit !important;
  box-shadow: none;
}
.result-table tbody tr.is-focused:hover {
  background: #fbfcff !important;
}
.map-review-actions {
  margin-top: 24px;
  padding-top: 0;
  border-top: 0;
}

/* v3.11.2: neutral expanded detail and vertically centered map link */
.map-review-detail {
  border-color: #e4e4e7;
  background: #fff;
}
.map-review-actions .mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.result-table tbody tr.is-focused.review {
  background: #fffdf4 !important;
}
.result-table tbody tr.is-focused.excluded {
  background: #f8fafc !important;
}

/* v3.14.0: source workspace polish + transactional map state + loading feedback */
.source-workspace {
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(250px, .85fr);
  gap: 24px;
  align-items: start;
}
.source-workspace > *,
.config-panel,
.query-bar,
.query-bar > *,
.flow-panel,
.flow-status-head,
.flow-steps,
.flow-step {
  min-width: 0;
}

/* Main source controls stay compact; do not stretch fields just to fill space. */
.source-workspace .query-bar {
  grid-template-columns: minmax(150px, .78fr) minmax(220px, 1.22fr);
  gap: 10px;
}
.source-workspace .query-bar #agencyComboWrap {
  grid-column: 1 / 2;
}
.source-workspace .query-bar .inline-auto-action {
  grid-column: 2 / 3;
}
.site-card.no-agency .source-workspace .query-bar {
  grid-template-columns: minmax(150px, .72fr) minmax(230px, 1.18fr) minmax(180px, .9fr);
  max-width: none;
}
.site-card.no-agency .source-workspace .query-bar .inline-auto-action {
  grid-column: auto;
}

/* Secondary actions are deliberately quieter than the primary CTA. */
.source-workspace .support-link-row {
  margin-top: 10px;
  gap: 4px;
}
.source-workspace .support-link-row > span {
  margin-right: 5px;
}
.source-workspace .ghost-chip-button,
.source-workspace .ghost-chip-link {
  min-height: 28px;
  padding: 0 7px;
  border-color: transparent;
  background: transparent;
  color: #7c7c84;
  font-size: 11px;
  font-weight: 620;
}
.source-workspace .ghost-chip-button:hover,
.source-workspace .ghost-chip-link:hover {
  border-color: transparent;
  background: #f4f4f5;
  color: #3f3f46;
}

/* Desktop: use the formerly empty right side as a vertical progress timeline. */
.source-workspace .flow-panel,
.source-workspace .compact-flow {
  display: block;
  margin-top: 0;
  padding: 2px 0 0 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.flow-status-head {
  margin-bottom: 12px;
}
.flow-title {
  display: block;
  margin-bottom: 5px;
  color: #3f3f46;
  font-size: 12px;
  font-weight: 720;
}
.source-workspace .flow-message,
.source-workspace .compact-flow .flow-message {
  margin: 0;
  color: #8a8a93;
  font-size: 11px;
  font-weight: 550;
  line-height: 1.5;
}
.source-workspace .flow-steps,
.source-workspace .compact-flow .flow-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  overflow: visible;
}
.source-workspace .flow-step,
.source-workspace .compact-flow .flow-step {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 31px;
  padding: 0 0 0 26px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #8a8a93;
  font-size: 12px;
  font-weight: 620;
  text-align: left;
}
.source-workspace .flow-step::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 50%;
  width: 8px;
  height: 8px;
  border: 1.5px solid #c7c7cc;
  border-radius: 50%;
  background: #fff;
  transform: translateY(-50%);
  z-index: 1;
}
.source-workspace .flow-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 9px;
  top: calc(50% + 5px);
  width: 1px;
  height: calc(100% - 10px);
  background: #e4e4e7;
}
.source-workspace .flow-step.done {
  border: 0;
  background: transparent;
  color: #62626a;
}
.source-workspace .flow-step.done::before {
  border-color: #a1a1aa;
  background: #a1a1aa;
  box-shadow: inset 0 0 0 2px #fff;
}
.source-workspace .flow-step.active {
  border: 0;
  background: transparent;
  color: #1d4ed8;
  box-shadow: none;
  font-weight: 720;
}
.source-workspace .flow-step.active::before {
  border-color: #2563eb;
  background: #2563eb;
  box-shadow: 0 0 0 3px #eff6ff;
}
.source-workspace .flow-step.active[data-flow-step="fetch"]::before,
.source-workspace .flow-step.active[data-flow-step="parse"]::before,
.source-workspace .flow-step.active[data-flow-step="geocode"]::before {
  animation: flowPulse 1.45s ease-in-out infinite;
}
@keyframes flowPulse {
  0%, 100% { transform: translateY(-50%) scale(1); box-shadow: 0 0 0 3px #eff6ff; }
  50% { transform: translateY(-50%) scale(1.18); box-shadow: 0 0 0 6px rgba(37, 99, 235, .08); }
}
.source-workspace .flow-step.active:last-child::after { content: none; }

/* Laptop: keep the useful two-column composition as long as it remains comfortable. */
@media (max-width: 900px) {
  .source-workspace {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .source-workspace .query-bar,
  .site-card.no-agency .source-workspace .query-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .source-workspace .query-bar #agencyComboWrap,
  .source-workspace .query-bar .inline-auto-action,
  .site-card.no-agency .source-workspace .query-bar .inline-auto-action {
    grid-column: auto;
  }
  .source-workspace .flow-panel,
  .source-workspace .compact-flow {
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fafafa;
  }
  .source-workspace .flow-steps,
  .source-workspace .compact-flow .flow-steps {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
  }
  .source-workspace .flow-step,
  .source-workspace .compact-flow .flow-step {
    justify-content: center;
    min-height: 32px;
    padding: 0 7px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    text-align: center;
  }
  .source-workspace .flow-step::before,
  .source-workspace .flow-step::after {
    display: none;
  }
  .source-workspace .flow-step.done {
    border-color: var(--line);
    background: #f4f4f5;
    color: #62626a;
  }
  .source-workspace .flow-step.active {
    border-color: #bfdbfe;
    background: var(--primary-soft);
    color: #1d4ed8;
  }
}

@media (max-width: 720px) {
  html, body { overflow-x: hidden; }
  .page-shell {
    width: 100%;
    max-width: 100%;
    padding: 10px 10px 28px;
  }
  .card,
  .card-head,
  .source-workspace,
  .config-panel,
  .query-bar,
  .query-bar > label,
  .inline-auto-action,
  .support-link-row,
  .flow-panel,
  .map-layout,
  .map-review-panel,
  .result-summary-grid,
  .result-toolbar,
  .support-grid {
    min-width: 0;
    max-width: 100%;
  }

  /* Source inputs: one clear vertical flow. */
  .source-workspace,
  .source-workspace .query-bar,
  .site-card.no-agency .source-workspace .query-bar {
    grid-template-columns: 1fr;
  }
  .source-workspace .query-bar #agencyComboWrap,
  .source-workspace .query-bar .inline-auto-action,
  .site-card.no-agency .source-workspace .query-bar .inline-auto-action {
    grid-column: 1;
  }
  .source-workspace .query-bar { gap: 10px; }
  .source-workspace .support-link-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 6px;
  }
  .source-workspace .support-link-row > span {
    grid-column: 1 / -1;
    margin: 2px 0 1px;
  }
  .source-workspace .ghost-chip-button,
  .source-workspace .ghost-chip-link {
    width: 100%;
    min-height: 32px;
    justify-content: flex-start;
    padding: 0 6px;
    border: 0;
    background: transparent;
    font-size: 11px;
  }

  /* Mobile progress: readable 3 + 2 grid, no horizontal scrolling and no tiny type. */
  .source-workspace .flow-panel,
  .source-workspace .compact-flow {
    padding: 10px;
  }
  .flow-status-head { margin-bottom: 9px; }
  .source-workspace .flow-message,
  .source-workspace .compact-flow .flow-message {
    font-size: 11px;
  }
  .source-workspace .flow-steps,
  .source-workspace .compact-flow .flow-steps {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
  }
  .source-workspace .flow-step,
  .source-workspace .compact-flow .flow-step {
    grid-column: span 2;
    min-width: 0;
    min-height: 34px;
    padding: 0 5px;
    font-size: 11.5px;
    line-height: 1.2;
    white-space: nowrap;
  }
  .source-workspace .flow-step:nth-child(4) { grid-column: 2 / span 2; }
  .source-workspace .flow-step:nth-child(5) { grid-column: 4 / span 2; }

  /* Neutral quick nav: do not imply that '지도' is always the current section. */
  .mobile-quick-nav a,
  .mobile-quick-nav a:nth-child(2) {
    border: 1px solid transparent;
    background: transparent;
    color: #71717a;
  }
  .mobile-quick-nav a:hover,
  .mobile-quick-nav a:focus-visible {
    border-color: var(--line);
    background: #f4f4f5;
    color: #3f3f46;
  }

  /* Give forms breathing room while allowing the map workspace to use a little more width. */
  .site-card,
  .result-card,
  .support-card { margin-left: 0; margin-right: 0; }
  .map-first-card {
    width: auto;
    margin-left: -4px;
    margin-right: -4px;
  }

  /* Keep the summary compact but fully visible without horizontal scroll. */
  .map-filter-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }
  .map-filter-summary .summary-card {
    min-width: 0;
    width: 100%;
  }
  .map-filter-summary .summary-card.amount {
    grid-column: 1 / -1;
    min-width: 0;
    width: 100%;
  }

  input,
  select,
  button,
  .combo-line,
  .combo-line input,
  .combo-line button {
    max-width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 390px) {
  .page-shell { padding-left: 10px; padding-right: 10px; }
  .card { padding: 12px; }
  .map-first-card { padding: 9px; }
  .source-workspace .flow-step,
  .source-workspace .compact-flow .flow-step {
    min-height: 33px;
    padding: 0 3px;
    font-size: 11px;
  }
}


@media (max-width: 720px) {
  .map-context-bar { position: sticky; top: 6px; align-items: flex-start; padding: 9px 10px; }
  .map-context-copy { display: grid; gap: 2px; }
  .map-context-title { font-size: 12px; line-height: 1.35; }
  .map-context-source { font-size: 10px; line-height: 1.35; }
  .map-status-badge { min-height: 26px; padding: 0 8px; font-size: 10px; }
}

@media (max-width: 460px) {
  .map-context-bar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .map-status-badge { justify-self: start; }
}


/* v3.14.0: 검색 진행 애니메이션 접근성 */
@media (prefers-reduced-motion: reduce) {
  .primary-button.is-loading::after,
  .secondary-button.is-loading::after,
  .source-workspace .flow-step.active[data-flow-step="fetch"]::before,
  .source-workspace .flow-step.active[data-flow-step="parse"]::before,
  .source-workspace .flow-step.active[data-flow-step="geocode"]::before,
  .map-status-badge.fetch::before,
  .map-status-badge.parse::before,
  .map-status-badge.geocode::before {
    animation: none !important;
  }
  .primary-button.is-loading::after,
  .secondary-button.is-loading::after { width: 1.15em; }
}
