:root {
  --orange: #f26722;
  --orange-dark: #d84e0b;
  --orange-soft: #fff0e7;
  --ink: #17202b;
  --ink-soft: #46515e;
  --paper: #fffdf9;
  --cream: #f7f3eb;
  --white: #ffffff;
  --line: #ded9cf;
  --green: #147d64;
  --red: #c53a2d;
  --shadow: 0 18px 50px rgba(45, 35, 24, 0.08);
  --radius-large: 28px;
  --radius-medium: 18px;
  --radius-small: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family:
    Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic",
    sans-serif;
  line-height: 1.6;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(242, 103, 34, 0.32);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  color: var(--white);
  background: var(--ink);
  border-radius: 8px;
  transform: translateY(-160%);
}

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

.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 92px 0 148px;
  background:
    linear-gradient(rgba(23, 32, 43, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 32, 43, 0.035) 1px, transparent 1px),
    var(--cream);
  background-size: 48px 48px;
  border-bottom: 1px solid var(--line);
}

.hero::after {
  content: "";
  position: absolute;
  right: max(3vw, 24px);
  bottom: -106px;
  width: 310px;
  height: 310px;
  border: 74px solid var(--orange);
  border-radius: 50%;
  opacity: 0.96;
}

.hero__content {
  position: relative;
  z-index: 1;
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: var(--orange-dark);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 790px;
  margin: 0;
  font-size: clamp(3.2rem, 8vw, 7.3rem);
  font-weight: 900;
  letter-spacing: -0.075em;
  line-height: 0.98;
}

.hero h1 span {
  color: var(--orange);
}

.hero__description {
  max-width: 650px;
  margin: 32px 0 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2vw, 1.2rem);
  word-break: keep-all;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 34px;
}

.hero__meta span {
  padding: 8px 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.main-content {
  position: relative;
  z-index: 2;
  margin-top: -70px;
  padding-bottom: 100px;
}

.file-protocol-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  padding: 20px 22px;
  color: #6f2c13;
  background: #fff4ed;
  border: 1px solid #f3b28e;
  border-left: 6px solid var(--orange);
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow);
}

.file-protocol-warning[hidden] {
  display: none;
}

.file-protocol-warning strong {
  display: block;
  color: #4b1f0e;
  font-size: 1rem;
}

.file-protocol-warning p {
  margin: 6px 0 0;
  font-size: 0.85rem;
  line-height: 1.6;
  word-break: keep-all;
}

.file-protocol-warning code {
  padding: 2px 5px;
  color: #7c2d12;
  background: #ffe4d3;
  border-radius: 5px;
}

.file-protocol-warning a {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  color: #ffffff;
  background: var(--orange);
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
}

.file-protocol-warning a:hover {
  background: #d94d14;
}

.file-protocol-warning a:focus-visible {
  outline: 3px solid rgba(242, 103, 34, 0.3);
  outline-offset: 3px;
}

.search-card,
.map-card,
.chart-card,
.table-card,
.method-card,
.comparison-section {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow);
}

.search-card {
  padding: 34px;
}

.map-card {
  margin-top: 24px;
  padding: 34px;
}

.map-card__heading {
  align-items: center;
  margin-bottom: 12px;
}

.map-toolbar {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
}

.map-toolbar label {
  color: #5f6973;
  font-size: 0.8rem;
  font-weight: 750;
}

.map-toolbar select {
  height: 42px;
  padding: 0 34px 0 13px;
  color: var(--ink);
  background: #fcfbf8;
  border: 1px solid #d7d2c8;
  border-radius: 10px;
  font-weight: 750;
}

.map-intro {
  max-width: 780px;
  margin: 0 0 22px;
  color: #69737e;
  font-size: 0.88rem;
  word-break: keep-all;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
  align-items: stretch;
}

.map-visual {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: #cbd5e1;
  border: 1px solid #a5b2c0;
  border-radius: var(--radius-medium);
}

.seoul-map {
  width: 100%;
  min-height: 540px;
}

.seoul-map--fallback {
  display: grid;
  place-items: center;
  padding: 30px;
  color: #7c2f18;
  text-align: center;
}

.map-legend {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  max-width: calc(100% - 28px);
  padding: 10px 12px;
  color: #4c5661;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(222, 217, 207, 0.9);
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(45, 35, 24, 0.08);
  font-size: 0.7rem;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.legend-swatch {
  width: 11px;
  height: 11px;
  border: 1px solid #52606d;
  border-radius: 3px;
}

.legend-swatch--seoul {
  background: #f8fafc;
}

.legend-swatch--district {
  background: #fed7aa;
}

.legend-swatch--comparison {
  background: #0f766e;
}

.legend-swatch--selected {
  background: var(--orange);
}

.map-summary {
  display: flex;
  flex-direction: column;
  min-height: 540px;
  padding: 27px;
  color: var(--white);
  background: var(--ink);
  border-radius: var(--radius-medium);
}

.map-summary__eyebrow {
  margin: 0 0 10px;
  color: #ffb185;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.map-summary h3 {
  margin: 0;
  font-size: 1.65rem;
  letter-spacing: -0.045em;
  line-height: 1.25;
  word-break: keep-all;
}

.map-summary__guide {
  margin: 12px 0 24px;
  color: #c5cbd2;
  font-size: 0.82rem;
  word-break: keep-all;
}

.map-metrics {
  margin: 0;
}

.map-metrics div {
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.map-metrics dt {
  color: #aeb6bf;
  font-size: 0.72rem;
}

.map-metrics dd {
  margin: 3px 0 0;
  color: var(--white);
  font-size: 1.08rem;
  font-weight: 800;
}

.map-analyze-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  min-height: 50px;
  margin-top: auto;
  padding: 0 16px;
  color: var(--white);
  background: var(--orange);
  border: 0;
  border-radius: var(--radius-small);
  font-weight: 800;
  transition: background 160ms ease, transform 160ms ease;
}

.map-analyze-button:hover {
  background: var(--orange-dark);
  transform: translateY(-1px);
}

.map-analyze-button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.map-status {
  min-height: 21px;
  margin: 14px 2px 0;
  color: #737b84;
  font-size: 0.76rem;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 27px;
}

.section-heading h2,
.method-card h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: -0.04em;
  line-height: 1.25;
}

.section-heading > p,
.result-subtitle {
  margin: 0;
  color: #69737e;
  font-size: 0.9rem;
}

.search-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.15fr auto;
  gap: 13px;
  align-items: end;
}

.field {
  min-width: 0;
}

.field label {
  display: block;
  margin: 0 0 8px;
  color: #39434e;
  font-size: 0.84rem;
  font-weight: 750;
}

.field select,
.field input {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  color: var(--ink);
  background: #fcfbf8;
  border: 1px solid #d7d2c8;
  border-radius: var(--radius-small);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field select:hover,
.field input:hover {
  border-color: #aaa196;
}

.field select:disabled {
  color: #9299a1;
  cursor: not-allowed;
}

.input-with-unit {
  position: relative;
}

.input-with-unit input {
  padding-right: 58px;
}

.input-with-unit span {
  position: absolute;
  top: 50%;
  right: 14px;
  color: #6c7580;
  font-size: 0.84rem;
  transform: translateY(-50%);
  pointer-events: none;
}

.field-hint {
  min-height: 20px;
  margin: 5px 0 -25px;
  color: var(--orange-dark);
  font-size: 0.78rem;
  font-weight: 700;
}

.primary-button,
.secondary-button,
.remove-button {
  border: 0;
  border-radius: var(--radius-small);
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-width: 190px;
  height: 52px;
  padding: 0 20px;
  color: var(--white);
  background: var(--orange);
}

.primary-button:hover {
  background: var(--orange-dark);
  transform: translateY(-2px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.form-note {
  margin: 30px 0 0;
  padding-top: 20px;
  color: #737b84;
  border-top: 1px solid #ece8e0;
  font-size: 0.82rem;
}

.status-message {
  margin: 20px 0;
  padding: 0;
  border-radius: var(--radius-small);
  font-size: 0.92rem;
}

.status-message:not(:empty) {
  padding: 14px 17px;
  color: #7c2f18;
  background: #fff0e9;
  border: 1px solid #f5c9b6;
}

.loading-panel {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
  padding: 28px 32px;
  background: var(--ink);
  border-radius: var(--radius-medium);
  color: var(--white);
}

.loading-panel p {
  margin: 2px 0 0;
  color: #bac0c8;
  font-size: 0.88rem;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, 0.22);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

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

.empty-state {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 38px;
  align-items: center;
  margin: 60px 0 20px;
  padding: 56px 64px;
  background: var(--cream);
  border-radius: var(--radius-large);
}

.empty-state__number {
  color: var(--orange);
  font-family: Georgia, serif;
  font-size: 6rem;
  font-style: italic;
  line-height: 1;
}

.empty-state h2 {
  margin: 0 0 10px;
  font-size: clamp(1.45rem, 3vw, 2.3rem);
  letter-spacing: -0.04em;
}

.empty-state p:last-child {
  max-width: 610px;
  margin: 0;
  color: var(--ink-soft);
}

.results {
  margin-top: 62px;
}

.section-heading--results {
  align-items: center;
}

.result-subtitle {
  margin-top: 7px;
}

.secondary-button {
  padding: 12px 17px;
  color: var(--orange-dark);
  background: var(--orange-soft);
  border: 1px solid #f7c8ad;
}

.secondary-button:hover {
  background: #ffe2d1;
  transform: translateY(-1px);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.metric-card {
  min-height: 185px;
  padding: 25px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
}

.metric-card--accent {
  color: var(--white);
  background: var(--orange);
  border-color: var(--orange);
}

.metric-card p {
  margin: 0 0 28px;
  color: inherit;
  font-size: 0.85rem;
  font-weight: 750;
  opacity: 0.82;
}

.metric-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  letter-spacing: -0.055em;
  line-height: 1.15;
}

.metric-card span {
  color: inherit;
  font-size: 0.78rem;
  opacity: 0.7;
}

.positive {
  color: var(--green) !important;
}

.negative {
  color: var(--red) !important;
}

.insight-card {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 24px;
  align-items: center;
  margin: 18px 0;
  padding: 22px 26px;
  color: var(--white);
  background: var(--ink);
  border-radius: var(--radius-medium);
}

.insight-card__label {
  padding-right: 22px;
  color: #ffb185;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.insight-card p {
  margin: 0;
  color: #eef0f2;
}

.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.chart-card,
.table-card {
  padding: 27px;
  box-shadow: none;
}

.chart-card__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
}

.chart-card__heading h3 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.chart-card__heading > span {
  padding: 4px 9px;
  color: #6f7780;
  background: var(--cream);
  border-radius: 999px;
  font-size: 0.72rem;
}

.chart {
  width: 100%;
  min-height: 350px;
}

.table-card {
  margin-top: 18px;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th,
td {
  padding: 15px 14px;
  text-align: right;
  border-bottom: 1px solid #ece8e0;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  color: #69727c;
  background: #faf8f4;
  font-size: 0.78rem;
}

td {
  font-size: 0.9rem;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.comparison-section {
  margin-top: 70px;
  padding: 34px;
  box-shadow: none;
}

.comparison-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.comparison-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 18px;
  background: var(--cream);
  border-radius: var(--radius-small);
}

.comparison-item strong,
.comparison-item span {
  display: block;
}

.comparison-item span {
  margin-top: 2px;
  color: #747d86;
  font-size: 0.77rem;
}

.remove-button {
  flex: 0 0 auto;
  width: 31px;
  height: 31px;
  color: #6f7780;
  background: var(--white);
  border: 1px solid var(--line);
}

.remove-button:hover {
  color: var(--red);
}

.comparison-chart {
  min-height: 360px;
  margin-top: 18px;
}

.method-card {
  margin-top: 70px;
  padding: 42px;
  box-shadow: none;
}

.method-card ol {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 28px 0;
  padding: 0;
  list-style: none;
  counter-reset: method;
}

.method-card li {
  position: relative;
  padding: 58px 20px 20px;
  background: var(--cream);
  border-radius: var(--radius-small);
  counter-increment: method;
  font-size: 0.88rem;
}

.method-card li::before {
  content: "0" counter(method);
  position: absolute;
  top: 16px;
  left: 20px;
  color: var(--orange);
  font-family: Georgia, serif;
  font-size: 1.65rem;
  font-style: italic;
  font-weight: 700;
}

.method-card__notice {
  margin: 0;
  padding-top: 20px;
  color: #6c7580;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
}

footer {
  color: #c8cdd3;
  background: var(--ink);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding-top: 28px;
  padding-bottom: 28px;
  font-size: 0.78rem;
}

.footer-content p {
  margin: 0;
}

@media (max-width: 1060px) {
  .hero::after {
    right: -90px;
    opacity: 0.75;
  }

  .search-form {
    grid-template-columns: repeat(2, 1fr);
  }

  .primary-button {
    width: 100%;
  }

  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .map-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
  }

  .method-card ol {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 24px, 1180px);
  }

  .hero {
    padding: 68px 0 115px;
  }

  .hero::after {
    right: -100px;
    bottom: -140px;
    width: 260px;
    height: 260px;
    border-width: 58px;
  }

  .hero h1 {
    font-size: clamp(3rem, 16vw, 5rem);
  }

  .main-content {
    margin-top: -55px;
  }

  .file-protocol-warning {
    display: block;
    padding: 18px;
  }

  .file-protocol-warning[hidden] {
    display: none;
  }

  .file-protocol-warning a {
    justify-content: center;
    width: 100%;
    margin-top: 14px;
  }

  .search-card,
  .map-card,
  .comparison-section,
  .method-card {
    padding: 24px 20px;
    border-radius: 21px;
  }

  .section-heading,
  .section-heading--results {
    display: block;
  }

  .section-heading > p,
  .result-subtitle,
  .section-heading .secondary-button {
    margin-top: 11px;
  }

  .search-form,
  .chart-grid {
    grid-template-columns: 1fr;
  }

  .map-card__heading {
    display: block;
  }

  .map-toolbar {
    justify-content: space-between;
    width: 100%;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #ece8e0;
  }

  .map-layout {
    grid-template-columns: 1fr;
  }

  .seoul-map {
    min-height: 390px;
  }

  .map-summary {
    min-height: auto;
  }

  .map-analyze-button {
    margin-top: 20px;
  }

  .map-legend {
    position: static;
    max-width: none;
    margin: 0 12px 12px;
  }

  .field-hint {
    margin-bottom: 0;
  }

  .empty-state {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 35px;
    padding: 35px 26px;
  }

  .empty-state__number {
    font-size: 3.8rem;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 150px;
  }

  .metric-card p {
    margin-bottom: 20px;
  }

  .insight-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .insight-card__label {
    padding: 0 0 8px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  }

  .chart-card,
  .table-card {
    padding: 22px 16px;
  }

  .chart {
    min-height: 310px;
  }

  .comparison-list,
  .method-card ol {
    grid-template-columns: 1fr;
  }

  .footer-content {
    display: block;
  }

  .footer-content p + p {
    margin-top: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .spinner {
    animation: none;
  }

  .primary-button,
  .secondary-button,
  .map-analyze-button {
    transition: none;
  }
}

