:root {
  --ink: #252422;
  --muted: #706f6c;
  --line: #deddd9;
  --panel: #ffffff;
  --canvas: #f6f5f2;
  --accent: #ff6b35;
  --accent-dark: #d94c1e;
  --soft-accent: #fff1eb;
  --danger: #a12622;
  --radius: 12px;
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 0 28px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { font-size: 20px; font-weight: 800; letter-spacing: -0.04em; }
.topnav { display: flex; gap: 24px; color: var(--muted); font-size: 14px; }
.topnav a.active { color: var(--ink); font-weight: 700; }

.app-shell { min-height: calc(100vh - 64px); display: grid; grid-template-columns: 220px 1fr; }
.sidebar {
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  background: #efeee9;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sidebar-label, .eyebrow { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.sidebar a { padding: 10px 12px; border-radius: 8px; }
.sidebar a.active { background: var(--panel); font-weight: 700; }
.sidebar-note { margin-top: auto; color: var(--muted); font-size: 12px; }
.content { padding: 32px; max-width: 1500px; width: 100%; margin: 0 auto; }

.page-heading { margin-bottom: 24px; }
.page-heading h1 { margin: 5px 0 8px; font-size: clamp(26px, 4vw, 38px); letter-spacing: -0.04em; }
.page-heading p { margin: 0; color: var(--muted); }
.heading-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.action-row { display: flex; align-items: center; gap: 10px; }
.action-row form { margin: 0; }

.two-column { display: grid; grid-template-columns: minmax(340px, 0.85fr) minmax(420px, 1.15fr); gap: 20px; }
.card, .metric-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 5px 20px rgb(37 36 34 / 5%);
}
.card { padding: 22px; }
.card h2 { margin: 0 0 16px; font-size: 17px; }
.form-panel { display: flex; flex-direction: column; gap: 18px; }
.form-panel form { display: flex; flex-direction: column; gap: 16px; }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 700; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: white;
}
input:focus, textarea:focus { outline: 2px solid rgb(255 107 53 / 20%); border-color: var(--accent); }
input[readonly] { background: #f7f6f3; color: var(--muted); }
.optional, .helper { color: var(--muted); font-weight: 400; font-size: 12px; }
.helper { margin: 6px 0 0; line-height: 1.5; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  cursor: pointer;
  font-weight: 700;
}
.button.primary { color: white; background: var(--accent); border-color: var(--accent); }
.button.primary:hover { background: var(--accent-dark); }
.button.secondary { background: white; }
.button.full { width: 100%; margin-top: 4px; }
.button:disabled { opacity: .55; cursor: wait; }

.search-results { display: grid; gap: 6px; max-height: 230px; overflow-y: auto; }
.address-result {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  cursor: pointer;
}
.address-result:hover { border-color: var(--accent); background: var(--soft-accent); }
.address-result span { color: var(--muted); font-size: 12px; }
.coordinate-row { display: flex; gap: 16px; color: var(--muted); font-size: 12px; }
.coordinate-row strong { color: var(--ink); }

.panel-heading { display: flex; justify-content: space-between; gap: 16px; align-items: start; }
.panel-heading h2 { margin-bottom: 5px; }
.panel-heading p { color: var(--muted); font-size: 12px; margin: 0; }
.badge { padding: 6px 9px; background: var(--soft-accent); border-radius: 999px; color: var(--accent-dark); font-size: 11px; white-space: nowrap; }
.map { height: 590px; margin-top: 16px; border-radius: 9px; background: #e5e3dc; overflow: hidden; }
.detail-map { height: 430px; }
.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 18px; }
.alert-error { color: var(--danger); border: 1px solid #eab7b4; background: #fff1f0; }

.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.metric-card { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.metric-card span { color: var(--muted); font-size: 12px; }
.metric-card strong { font-size: 18px; }
.detail-list { display: grid; grid-template-columns: 110px 1fr; gap: 13px; font-size: 13px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; word-break: break-word; }
.notice { margin-top: 20px; padding: 14px; background: #f3f2ed; border-radius: 8px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.text-link { color: var(--accent-dark); font-size: 12px; font-weight: 700; }
.analysis-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: -10px 0 20px; }
.analysis-meta span { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: white; font-size: 11px; }
.analysis-section { margin-bottom: 20px; }
.section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: start; }
.section-heading h2 { margin-bottom: 5px; }
.section-heading p { margin: 0 0 16px; color: var(--muted); font-size: 12px; }
.table-scroll { overflow-x: auto; }
.metric-table { width: 100%; border-collapse: collapse; min-width: 620px; }
.metric-table th, .metric-table td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: right; }
.metric-table thead th { color: var(--muted); font-size: 12px; background: #f8f7f4; }
.metric-table th:first-child { text-align: left; }
.metric-table tbody th { font-size: 13px; }
.metric-table td { font-weight: 700; }
.metric-table small { display: block; margin-top: 3px; color: var(--muted); font-weight: 400; }
.summary-grid.compact { margin: 4px 0 10px; }
.summary-grid.compact.three { grid-template-columns: repeat(3, 1fr); }
.subheading { margin: 16px 0 10px; font-size: 13px; color: var(--muted); }
.entity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.entity-card h2 { display: flex; justify-content: space-between; }
.entity-card h2 span { color: var(--accent-dark); }
.entity-list { display: grid; max-height: 390px; overflow-y: auto; }
.entity-list article { display: flex; justify-content: space-between; align-items: start; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.entity-list article:last-child { border-bottom: 0; }
.entity-list article strong { font-size: 13px; }
.entity-list article span { color: var(--muted); font-size: 11px; text-align: right; max-width: 55%; }
.empty { color: var(--muted); font-size: 12px; }
.source-grid { display: grid; grid-template-columns: 100px 1fr 100px 1fr; gap: 12px; font-size: 12px; }
.source-grid dt { color: var(--muted); }
.source-grid dd { margin: 0; }

.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;
}
.analysis-map-page { overflow: hidden; }
.analysis-map-page .app-shell {
  display: block;
  height: calc(100vh - 64px);
  min-height: 0;
}
.analysis-map-page .sidebar { display: none; }
.analysis-map-page .content {
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  padding: 0;
}
.analysis-map-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #e6e5df;
}
.analysis-map { position: absolute; inset: 0; }
.map-address-search {
  position: absolute;
  z-index: 8;
  top: 16px;
  left: 50%;
  width: min(460px, calc(100% - 470px));
  min-width: 320px;
  transform: translateX(-50%);
}
.map-address-search form {
  display: grid;
  grid-template-columns: 1fr auto;
  overflow: hidden;
  border: 1px solid rgb(222 221 217 / 90%);
  border-radius: 12px;
  background: rgb(255 255 255 / 97%);
  box-shadow: 0 7px 25px rgb(20 20 18 / 18%);
}
.map-address-search input {
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding: 12px 14px;
  background: transparent;
}
.map-address-search input:focus { outline: 0; }
.map-address-search form > button {
  border: 0;
  padding: 0 16px;
  color: white;
  background: var(--accent);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}
.map-address-results {
  max-height: 330px;
  margin-top: 6px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgb(255 255 255 / 98%);
  box-shadow: 0 10px 30px rgb(20 20 18 / 18%);
}
.map-address-result {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 5px;
  padding: 15px 16px;
  border: 0;
  border-bottom: 1px solid #efede8;
  color: var(--ink);
  background: white;
  cursor: pointer;
  line-height: 1.45;
  text-align: left;
}
.map-address-result:last-child { border-bottom: 0; }
.map-address-result:hover, .map-address-result:focus {
  outline: 0;
  background: var(--soft-accent);
}
.map-address-result strong { font-size: 15px; }
.map-address-result span { color: var(--muted); font-size: 13px; }
.map-address-search-status {
  margin: 5px 10px 0;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  text-shadow: 0 1px 2px white;
}
.analysis-sheet {
  position: absolute;
  z-index: 5;
  inset: 0 auto 0 0;
  width: min(440px, calc(100% - 48px));
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px;
  border: 0;
  border-right: 1px solid rgb(222 221 217 / 85%);
  border-radius: 0 16px 16px 0;
  background: rgb(255 255 255 / 94%);
  box-shadow: 8px 0 28px rgb(20 20 18 / 15%);
  backdrop-filter: blur(14px);
  transition: transform .22s ease;
}
.sheet-toggle {
  position: absolute;
  z-index: 7;
  top: 18px;
  left: 440px;
  width: 34px;
  height: 52px;
  padding: 0;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 10px 10px 0;
  color: var(--ink);
  background: rgb(255 255 255 / 94%);
  box-shadow: 5px 3px 14px rgb(20 20 18 / 12%);
  cursor: pointer;
  font-size: 27px;
  line-height: 1;
  transition: left .22s ease;
}
.analysis-map-shell.sheet-collapsed .analysis-sheet { transform: translateX(-100%); }
.analysis-map-shell.sheet-collapsed .sheet-toggle { left: 0; }
.analysis-map-shell.sheet-collapsed .sheet-toggle span[aria-hidden] {
  display: inline-block;
  transform: rotate(180deg);
}
.sheet-handle { display: none; }
.sheet-header { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.sheet-header h2 { margin: 4px 0 0; font-size: 24px; letter-spacing: -.03em; }
.sheet-header p {
  max-width: 285px;
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sheet-kicker { color: var(--muted); font-size: 12px; }
.sheet-detail-link {
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.radius-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin: 18px 0 9px;
  padding: 4px;
  border-radius: 11px;
  background: #f1f0ec;
}
.radius-button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
}
.radius-button small {
  margin-left: 3px;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgb(255 107 53 / 12%);
  color: var(--accent-dark);
  font-size: 9px;
}
.radius-button.active {
  color: var(--ink);
  background: white;
  box-shadow: 0 2px 8px rgb(37 36 34 / 10%);
}
.sheet-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
}
.primary-standard { color: var(--accent-dark); font-weight: 700; }
.indicator-score-section {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid #f0dfd7;
  border-radius: 14px;
  background: linear-gradient(145deg, #fffaf7, #fff);
}
.indicator-score-section > h3 {
  margin: 0 0 13px;
  font-size: 18px;
  letter-spacing: -.025em;
}
.score-overview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin-bottom: 12px;
}
.score-overview > div {
  display: grid;
  gap: 5px;
  padding: 14px;
  border-radius: 12px;
  color: white;
  background: linear-gradient(145deg, #ff6b35, #e84e18);
}
.score-overview > div:last-child {
  color: var(--ink);
  background: #f1eee9;
}
.score-overview span {
  font-size: 12px;
  font-weight: 750;
  opacity: .85;
}
.score-overview strong {
  font-size: 28px;
  letter-spacing: -.045em;
  white-space: nowrap;
}
.score-overview strong small {
  margin-left: 3px;
  font-size: 13px;
}
.indicator-score-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}
.indicator-score-card {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 14px;
  border: 1px solid #ece7e2;
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.indicator-score-card:hover {
  border-color: #efb49d;
  box-shadow: 0 5px 16px rgb(74 45 32 / 8%);
  transform: translateY(-1px);
}
.indicator-score-card.active {
  border-color: var(--accent);
  background: var(--soft-accent);
  box-shadow: 0 0 0 2px rgb(255 107 53 / 10%);
}
.indicator-score-card > span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.indicator-score-card > strong {
  font-size: 30px;
  letter-spacing: -.04em;
}
.indicator-score-card > strong small {
  margin-left: 2px;
  color: var(--muted);
  font-size: 13px;
}
.indicator-score-card > i {
  display: block;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #eee9e5;
}
.indicator-score-card > i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #ff9b75);
}
.indicator-score-card > em {
  color: var(--accent-dark);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}
.indicator-detail-stack { margin-top: 10px; }
.indicator-detail {
  padding: 12px;
  border: 1px solid #eee9e4;
  border-radius: 11px;
  background: #fff;
}
.indicator-detail > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.indicator-detail > header strong { font-size: 15px; }
.indicator-detail > header span {
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 800;
}
.indicator-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  margin-top: 10px;
}
.indicator-detail-grid div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px;
  border-radius: 8px;
  background: #f8f6f3;
}
.indicator-detail-grid span { color: var(--muted); font-size: 10px; }
.indicator-detail-grid b { font-size: 14px; }
.indicator-detail > p, .indicator-place-list > p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}
.indicator-place-list {
  max-height: 190px;
  margin-top: 9px;
  overflow-y: auto;
}
.indicator-place-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid #f1eeeb;
}
.indicator-place-list > div span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}
.indicator-place-list > div b {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.indicator-place-list > div small { color: var(--muted); font-size: 10px; }
.indicator-place-list > div em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  white-space: nowrap;
}
.indicator-score-caution {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.45;
}
.map-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 13px;
}
.map-summary-grid article {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 2px 8px;
  padding: 13px;
  border: 1px solid #eceae5;
  border-radius: 11px;
  background: #fbfaf8;
}
.map-summary-grid span { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.map-summary-grid strong { font-size: 20px; letter-spacing: -.03em; }
.map-summary-grid small { color: var(--muted); font-size: 11px; text-align: right; }
.sheet-section { margin-top: 14px; padding-top: 14px; border-top: 1px solid #ebe9e4; }
.sheet-section-title { display: flex; justify-content: space-between; gap: 12px; }
.sheet-section-title h3 { margin: 0; font-size: 13px; }
.sheet-section-title > span { color: var(--accent-dark); font-size: 9px; font-weight: 700; }
.contribution-result {
  margin-right: -8px;
  margin-left: -8px;
  padding: 14px 8px 12px;
  border-radius: 10px;
  background: #fff8f4;
}
.contribution-list { display: grid; gap: 11px; margin-top: 12px; }
.contribution-list article { display: grid; gap: 5px; }
.contribution-list article > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.contribution-list strong { font-size: 11px; }
.contribution-list b { color: var(--accent-dark); font-size: 12px; }
.contribution-list small { color: var(--muted); font-size: 8px; }
.contribution-track {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #eadfd9;
}
.contribution-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #ff9b75);
}
.contribution-result > p {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}
.layer-heading {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.layer-heading span { display: flex; flex-direction: column; gap: 3px; }
.layer-heading strong { font-size: 13px; }
.layer-heading small { color: var(--muted); font-size: 9px; font-weight: 400; }
.layer-heading b, .nearby-section summary small {
  color: var(--accent-dark);
  font-size: 9px;
  font-weight: 700;
}
.fixed-grid-metric.layer-active,
.radius-living-metric.layer-active,
.nearby-section.layer-active {
  margin-right: -8px;
  margin-left: -8px;
  padding-right: 8px;
  padding-left: 8px;
  border-radius: 8px;
  background: var(--soft-accent);
}
.living-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 11px; }
.living-row div { display: flex; flex-direction: column; gap: 4px; }
.living-row span { color: var(--muted); font-size: 9px; }
.living-row strong { font-size: 13px; }
.fixed-grid-metric > p, .radius-living-metric > p,
.sgis-household-metric > p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}
.housing-type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.housing-type-grid span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 7px;
  color: var(--muted);
  background: #f7f6f2;
  font-size: 9px;
}
.housing-type-grid strong { color: var(--ink); }
.grid-map-button {
  width: 100%;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid #f2b9a4;
  border-radius: 8px;
  color: var(--accent-dark);
  background: var(--soft-accent);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}
.calculation-details, .raw-grid-details { margin-top: 10px; }
.calculation-details > summary, .raw-grid-details > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}
.raw-grid-details > summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.raw-grid-details > summary span { font-size: 9px; font-weight: 400; }
.calculation-list { margin-top: 7px; border-top: 1px solid #eeeae4; }
.calculation-list article {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid #f1efeb;
  font-size: 9px;
}
.calculation-list article strong { color: var(--muted); }
.calculation-list article span { text-align: right; }
.calculation-list article b { color: var(--accent-dark); }
.raw-grid-details > p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}
.nearby-section details > summary {
  display: flex;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  font-weight: 800;
}
.nearby-section details > summary::-webkit-details-marker { display: none; }
.nearby-section summary > span { display: flex; align-items: center; gap: 7px; }
.nearby-section summary strong { color: var(--accent-dark); }
.place-list { margin-top: 7px; }
.place-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid #f0efeb;
  cursor: pointer;
}
.place-list article:hover,
.place-list article:focus-visible,
.place-list article.place-selected {
  margin-right: -7px;
  margin-left: -7px;
  padding-right: 7px;
  padding-left: 7px;
  border-radius: 7px;
  outline: 0;
  background: var(--soft-accent);
}
.place-list [hidden] { display: none; }
.place-list article:last-child { border-bottom: 0; }
.place-list article div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.place-list article strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.place-list article span { color: var(--muted); font-size: 9px; }
.place-list article b { color: var(--muted); font-size: 10px; white-space: nowrap; }
.sheet-empty { margin: 9px 0 0; color: var(--muted); font-size: 10px; }
.sheet-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 9px;
}
.sheet-source { margin: 9px 0 0; color: var(--muted); font-size: 8px; line-height: 1.45; }
.map-place-dot {
  display: block;
  width: 14px;
  height: 14px;
  border: 2px solid white;
  border-radius: 50%;
  background: #2867d8;
  box-shadow: 0 2px 7px rgb(0 0 0 / 35%);
  cursor: pointer;
}
.map-place-dot.schools { background: #7b3fc6; }
.map-place-dot.academies { background: #16a36a; }
.map-place-dot.competitors { background: #e44335; }
.map-place-dot.apartments { background: #2867d8; }
.map-place-dot.selected {
  width: 22px;
  height: 22px;
  border-width: 4px;
  box-shadow: 0 3px 12px rgb(0 0 0 / 45%);
}
.recommendation-shell { max-width: 1240px; margin: 0 auto; padding: 34px; }
.recommendation-header h1 { margin: 5px 0 8px; font-size: 32px; letter-spacing: -.04em; }
.recommendation-header > p:last-child { margin: 0; color: var(--muted); font-size: 14px; }
.recommendation-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
  padding: 18px;
  border: 1px solid #e9e6df;
  border-radius: 14px;
  background: white;
}
.recommendation-filters label { display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 700; }
.recommendation-filters select { min-height: 44px; padding: 0 12px; border: 1px solid #dcd8d0; border-radius: 9px; color: var(--ink); background: white; font-size: 14px; }
.recommendation-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr); gap: 18px; margin-top: 18px; }
.recommendation-map { min-height: 650px; border: 1px solid #e5e1da; border-radius: 16px; background: #eeeae4; }
.recommendation-results { overflow: hidden; border: 1px solid #e5e1da; border-radius: 16px; background: white; }
.recommendation-results > header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 18px; border-bottom: 1px solid #ece9e3; }
.recommendation-results > header span { color: var(--muted); font-size: 10px; }
.recommendation-results > header h2 { margin: 4px 0 0; font-size: 19px; }
.recommendation-results > header > strong { color: var(--accent-dark); font-size: 15px; }
.recommendation-list { max-height: 580px; overflow-y: auto; padding: 8px; }
.recommendation-card { display: flex; gap: 12px; padding: 13px 10px; border: 1px solid transparent; border-bottom-color: #efede8; cursor: pointer; }
.recommendation-card:hover, .recommendation-card:focus-visible, .recommendation-card.active { border-color: #f1b69e; border-radius: 11px; outline: 0; background: var(--soft-accent); }
.recommendation-rank { display: flex; width: 29px; height: 29px; flex: 0 0 29px; align-items: center; justify-content: center; border-radius: 50%; color: white; background: var(--accent); font-size: 12px; font-weight: 800; }
.recommendation-card-main { min-width: 0; flex: 1; }
.recommendation-card-main > header { display: flex; justify-content: space-between; gap: 12px; }
.recommendation-card-main > header strong { font-size: 14px; }
.recommendation-card-main > header b { color: var(--accent-dark); font-size: 16px; }
.recommendation-card-main > p { margin: 5px 0 8px; color: var(--muted); font-size: 10px; }
.recommendation-scores { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.recommendation-scores span { padding: 5px 3px; border-radius: 5px; background: #f4f2ee; text-align: center; font-size: 9px; }
.recommendation-card-main > button { width: 100%; margin-top: 9px; padding: 7px; border: 0; border-radius: 7px; color: white; background: var(--ink); cursor: pointer; font-size: 10px; font-weight: 800; }
.recommendation-guide, .recommendation-empty { margin-top: 18px; padding: 42px 24px; border: 1px dashed #d9d4ca; border-radius: 14px; color: var(--muted); text-align: center; background: white; }
.recommendation-guide strong, .recommendation-empty strong { color: var(--ink); font-size: 16px; }
.recommendation-guide p, .recommendation-empty p { margin: 7px 0 0; font-size: 12px; }
.grid-overlap-label {
  display: inline-flex;
  min-width: 34px;
  height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 1px solid rgb(255 255 255 / 90%);
  border-radius: 999px;
  color: white;
  background: rgb(217 76 30 / 88%);
  box-shadow: 0 2px 8px rgb(0 0 0 / 25%);
  font-size: 10px;
  font-weight: 800;
}
.map-instruction {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  padding: 9px 13px;
  border-radius: 999px;
  color: white;
  background: rgb(37 36 34 / 78%);
  box-shadow: 0 5px 20px rgb(0 0 0 / 18%);
  font-size: 11px;
  white-space: nowrap;
}
.relocate-status {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: white;
  background: rgb(27 27 25 / 58%);
  backdrop-filter: blur(4px);
}
.relocate-status[hidden] { display: none; }
.relocate-status small { opacity: .8; }
.loading-spinner {
  width: 32px;
  height: 32px;
  margin-bottom: 5px;
  border: 3px solid rgb(255 255 255 / 35%);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.analysis-footnote {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 4px 0;
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 920px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content { padding: 22px 16px; }
  .two-column { grid-template-columns: 1fr; }
  .map { height: 420px; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-grid.compact.three { grid-template-columns: repeat(2, 1fr); }
  .entity-grid { grid-template-columns: 1fr; }
  .recommendation-shell { padding: 22px 0; }
  .recommendation-layout { grid-template-columns: 1fr; }
  .recommendation-map { min-height: 420px; }
  .analysis-map-page .content { padding: 0; }
  .map-address-search {
    right: 54px;
    left: auto;
    width: min(430px, calc(100% - 110px));
    min-width: 0;
    transform: none;
  }
}

@media (max-width: 560px) {
  .topbar { padding: 0 16px; gap: 22px; }
  .topnav { gap: 12px; }
  .topnav a:nth-child(3), .topnav a:nth-child(4) { display: none; }
  .heading-actions { align-items: start; flex-direction: column; }
  .action-row { align-items: stretch; flex-direction: column; width: 100%; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-grid.compact.three { grid-template-columns: 1fr; }
  .recommendation-filters { grid-template-columns: 1fr; }
  .recommendation-map { min-height: 330px; }
  .source-grid { grid-template-columns: 90px 1fr; }
  .analysis-map-page .topbar { height: 54px; }
  .analysis-map-page .app-shell { height: calc(100vh - 54px); }
  .analysis-map-shell { border-radius: 0; }
  .map-address-search {
    top: 10px;
    right: 58px;
    width: calc(100% - 70px);
  }
  .analysis-sheet {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 58%;
    padding: 12px 16px 16px;
    border-right: 0;
    border-radius: 18px 18px 0 0;
    transform: none;
  }
  .sheet-toggle {
    top: auto;
    right: 12px;
    bottom: 58%;
    left: auto;
    width: 46px;
    height: 32px;
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
    transition: bottom .22s ease;
  }
  .analysis-map-shell.sheet-collapsed .analysis-sheet { transform: translateY(100%); }
  .analysis-map-shell.sheet-collapsed .sheet-toggle { right: 12px; bottom: 0; left: auto; }
  .analysis-map-shell.sheet-collapsed .sheet-toggle span[aria-hidden] { transform: rotate(-90deg); }
  .sheet-handle {
    display: block;
    width: 38px;
    height: 4px;
    margin: 0 auto 10px;
    border-radius: 999px;
    background: #d8d6d0;
  }
  .map-instruction { top: 12px; bottom: auto; }
}
