:root {
  --bg: #f1e8d8;
  --bg-deep: #e5efe7;
  --panel: rgba(255, 250, 243, 0.82);
  --panel-strong: #fff9f1;
  --text: #182028;
  --muted: #5f6a70;
  --line: rgba(24, 32, 38, 0.1);
  --gold: #c8872f;
  --navy: #15344e;
  --teal: #1e7c6d;
  --red: #b75a46;
  --green: #2c7c4f;
  --shadow: 0 22px 60px rgba(21, 52, 78, 0.12);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Noto Sans KR", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(200, 135, 47, 0.24), transparent 24%),
    radial-gradient(circle at 85% 12%, rgba(30, 124, 109, 0.15), transparent 20%),
    linear-gradient(160deg, #f8f1e6 0%, var(--bg) 38%, var(--bg-deep) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(21, 52, 78, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 52, 78, 0.02) 1px, transparent 1px);
  background-size: 28px 28px;
}

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.page-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.back-link,
.ghost-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(21, 52, 78, 0.07);
  color: var(--navy);
  font: 600 0.88rem "Space Grotesk", sans-serif;
}

.page-tag {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 250, 244, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font: 600 0.78rem "Space Grotesk", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-card,
.panel,
.metric-card,
.table-card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero-card {
  padding: 34px;
  border-radius: var(--radius-xl);
  margin-bottom: 20px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--gold);
  font: 600 0.78rem "Space Grotesk", sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-title {
  margin: 0;
  color: var(--navy);
  font: 700 clamp(2rem, 4vw, 3.5rem) "Space Grotesk", sans-serif;
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.hero-copy {
  max-width: 66ch;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.8;
}

.hero-grid,
.kpi-grid,
.input-grid,
.summary-grid {
  display: grid;
  gap: 16px;
}

.hero-grid {
  grid-template-columns: 1.3fr 0.9fr;
}

.input-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.input-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.input-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpi-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.metric-card,
.panel,
.table-card {
  border-radius: var(--radius-xl);
}

.metric-card {
  padding: 20px;
}

.metric-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font: 600 0.74rem "Space Grotesk", sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.metric-value {
  display: block;
  color: var(--navy);
  font: 700 1.7rem "Space Grotesk", sans-serif;
  letter-spacing: -0.04em;
}

.metric-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.panel,
.table-card {
  padding: 26px;
  margin-top: 18px;
}

.panel-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-title {
  margin: 0;
  color: var(--navy);
  font: 700 1.2rem "Space Grotesk", sans-serif;
  letter-spacing: -0.03em;
}

.panel-subtitle {
  color: var(--muted);
  font-size: 0.9rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  color: var(--muted);
  font: 600 0.74rem "Space Grotesk", sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.field small {
  color: var(--muted);
  font-size: 0.78rem;
}

.field input,
.field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--navy);
  font: 600 0.96rem "Space Grotesk", sans-serif;
  outline: none;
}

.field input:focus,
.field select:focus {
  border-color: var(--gold);
}

.switch-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font: 600 0.92rem "Space Grotesk", sans-serif;
}

.button.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--navy), #28597c);
}

.button.secondary {
  color: var(--navy);
  background: rgba(21, 52, 78, 0.08);
}

.summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.summary-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.chart-card {
  margin-top: 18px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid var(--line);
}

.chart-wrap {
  position: relative;
  overflow-x: auto;
}

.chart-svg {
  width: 100%;
  min-width: 720px;
  display: block;
}

.axis {
  stroke: rgba(24, 32, 38, 0.18);
  stroke-width: 1.2;
}

.grid-line {
  stroke: rgba(24, 32, 38, 0.07);
  stroke-width: 1;
  stroke-dasharray: 4 3;
}

.axis-label,
.chart-label {
  fill: var(--muted);
  font-size: 11px;
  font-family: "Space Grotesk", sans-serif;
}

.line-a {
  stroke: var(--red);
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-b {
  stroke: var(--gold);
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.area-a {
  fill: rgba(183, 90, 70, 0.12);
}

.bar-a {
  fill: rgba(21, 52, 78, 0.18);
}

.bar-b {
  fill: rgba(200, 135, 47, 0.28);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 14px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.legend-line,
.legend-box {
  flex-shrink: 0;
}

.legend-line {
  width: 16px;
  height: 4px;
  border-radius: 999px;
}

.legend-box {
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

.tooltip {
  position: absolute;
  z-index: 2;
  min-width: 180px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(18, 28, 36, 0.95);
  color: #fff8ee;
  font-size: 0.84rem;
  line-height: 1.7;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 28px rgba(20, 50, 74, 0.22);
}

.tooltip-title {
  margin-bottom: 6px;
  color: rgba(255, 248, 238, 0.66);
  font: 700 0.76rem "Space Grotesk", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

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

table.data-table {
  width: 100%;
  border-collapse: collapse;
}

table.data-table th,
table.data-table td {
  padding: 11px 12px;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  text-align: right;
}

table.data-table th {
  color: var(--muted);
  font: 600 0.72rem "Space Grotesk", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-top: none;
}

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

.note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.7;
}

.pill-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(21, 52, 78, 0.08);
  color: var(--navy);
  font: 600 0.82rem "Space Grotesk", sans-serif;
}

@media (max-width: 920px) {
  .hero-grid,
  .input-grid.two,
  .input-grid.three,
  .input-grid.four,
  .kpi-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(1120px, calc(100% - 18px));
    padding-top: 18px;
  }

  .page-nav,
  .panel-header {
    flex-direction: column;
    align-items: start;
  }

  .hero-card,
  .panel,
  .table-card {
    padding: 22px;
    border-radius: 24px;
  }
}
