:root {
  --bg: #f6f3ec;
  --paper: #fffdf8;
  --panel: #ffffff;
  --panel-2: #f8f6f0;
  --ink: #172235;
  --muted: #687183;
  --line: #d8d1c3;
  --blue: #1f4e79;
  --red: #9b3d3d;
  --green: #2f6f58;
  --gold: #a77b2d;
  --button: #172235;
  --button-hover: #243551;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Malgun Gothic", "맑은 고딕", "Noto Sans KR", system-ui, sans-serif;
  font-size: 14px;
}

button {
  font: inherit;
}

a {
  color: inherit;
}

.site-header,
main > section,
footer {
  width: min(1080px, calc(100% - 32px));
  margin: auto;
}

.site-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 3px;
  color: #ffffff;
  background: var(--ink);
  font: 800 11px "Malgun Gothic", "맑은 고딕", sans-serif;
}

.brand strong {
  font: 800 14px "Malgun Gothic", "맑은 고딕", sans-serif;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

nav a {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 7px 11px;
  color: var(--ink);
  background: transparent;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
}

nav a:hover {
  border-color: var(--ink);
  background: var(--white);
}

.hero {
  min-height: auto;
  display: grid;
  align-content: center;
  padding: 44px 0 24px;
}

.home-hero,
.service-hero {
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--gold);
  font: 800 10px "Malgun Gothic", "맑은 고딕", sans-serif;
  letter-spacing: 0.16em;
}

h1,
h2 {
  margin: 0;
  letter-spacing: -0.025em;
}

h1 {
  max-width: 760px;
  color: var(--ink);
  font-family: "Malgun Gothic", "맑은 고딕", "Noto Sans KR", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.28;
}

h1 em {
  color: var(--ink);
  font-style: normal;
}

.hero-copy {
  max-width: none;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.58;
  word-break: keep-all;
  white-space: nowrap;
}

.wip-list {
  padding: 24px 0 34px;
}

.wip-list h2 {
  font-family: "Malgun Gothic", "맑은 고딕", "Noto Sans KR", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.wip-index {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.wip-index a {
  display: grid;
  grid-template-columns: 92px 260px 1fr;
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  color: var(--ink);
  text-decoration: none;
}

.wip-index a:hover strong {
  color: var(--blue);
}

.wip-index span {
  color: var(--gold);
  font: 800 10px "Malgun Gothic", "맑은 고딕", sans-serif;
  letter-spacing: 0.14em;
}

.wip-index strong {
  font-family: "Malgun Gothic", "맑은 고딕", "Noto Sans KR", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
}

.wip-index small {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.service-board {
  padding: 18px 0;
}

.service-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 12px;
}

.service-card {
  min-height: 178px;
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 18px;
  color: var(--ink);
  background: var(--panel);
  text-decoration: none;
  box-shadow: none;
}

.service-card p {
  margin: auto 0 6px;
  color: var(--gold);
  font: 800 10px "Malgun Gothic", "맑은 고딕", sans-serif;
  letter-spacing: 0.14em;
}

.service-card h3 {
  margin: 0;
  font-family: "Malgun Gothic", "맑은 고딕", "Noto Sans KR", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.015em;
}

.service-card small {
  max-width: 520px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  word-break: keep-all;
}

.service-card b {
  margin-top: 14px;
  color: var(--ink);
  font-size: 12px;
}

.service-number {
  width: max-content;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 5px 9px;
  background: var(--panel-2);
  color: var(--muted);
  font: 800 10px "Malgun Gothic", "맑은 고딕", sans-serif;
}

.active-service,
.pending-service {
  background: var(--panel);
}

.market-note {
  max-width: 760px;
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 18px 20px;
  color: var(--muted);
  background: var(--panel);
  line-height: 1.55;
}

.market-note b {
  color: var(--ink);
}

.calc-note {
  margin: 12px 4px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  word-break: keep-all;
}

.calc-note b {
  color: var(--ink);
  font-weight: 800;
}

.calculator {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 20px;
  background: var(--panel);
  box-shadow: none;
  backdrop-filter: none;
}

.chart-panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 16px;
  background: var(--panel-2);
}

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

.chart-head h3 {
  margin: 0;
  font-family: "Malgun Gothic", "맑은 고딕", "Noto Sans KR", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.chart-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chart-legend i {
  width: 18px;
  height: 3px;
  border-radius: 999px;
}

.legend-adr {
  background: var(--gold);
}

.legend-kospi {
  background: var(--blue);
}

.chart-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  background: var(--paper);
}

#priceChart {
  display: block;
  width: 100%;
  min-height: 210px;
}

.chart-grid line {
  stroke: rgba(104, 113, 131, 0.22);
}

.chart-grid text,
.chart-date {
  fill: var(--muted);
  font: 700 11px "Malgun Gothic", "맑은 고딕", sans-serif;
}

.chart-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line-adr {
  stroke: var(--gold);
}

.chart-line-kospi {
  stroke: var(--blue);
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.88);
  text-align: center;
  font-size: 12px;
}

.chart-empty[hidden] {
  display: none;
}

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

.refresh-button {
  border: 1px solid var(--button);
  border-radius: 3px;
  padding: 8px 12px;
  color: #ffffff;
  background: var(--button);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.refresh-button:hover {
  background: var(--button-hover);
}

.refresh-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.section-title h2,
.guide h2 {
  font-family: "Malgun Gothic", "맑은 고딕", "Noto Sans KR", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.status {
  border: 1px solid var(--line);
  border-radius: 3px;
  margin-bottom: 10px;
  padding: 9px 12px;
  color: var(--muted);
  background: var(--panel-2);
  font-size: 12px;
}

.status[data-state="ok"] {
  color: var(--green);
  border-color: rgba(47, 111, 88, 0.3);
}

.status[data-state="error"] {
  color: var(--red);
  border-color: rgba(155, 61, 61, 0.3);
}

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

.quote-grid article {
  min-height: 104px;
  display: block;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 13px;
  background: var(--panel-2);
}

.quote-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.quote-grid small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.quote-grid strong {
  display: block;
  margin-top: 14px;
  color: var(--ink);
  font: 800 18px "Malgun Gothic", "맑은 고딕", sans-serif;
  letter-spacing: -0.025em;
}

.result-panel {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.result-panel article {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 14px;
  color: var(--ink);
  background: var(--white);
}

.result-panel span,
.result-panel small {
  color: var(--muted);
  font-size: 11px;
}

.result-panel strong {
  margin: 12px 0;
  color: var(--ink);
  font: 800 18px "Malgun Gothic", "맑은 고딕", sans-serif;
  letter-spacing: -0.025em;
}

#premiumRate[data-state="premium"] {
  color: var(--red);
}

#premiumRate[data-state="discount"] {
  color: var(--green);
}

#premiumRate[data-state="neutral"] {
  color: var(--blue);
}

.guide {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 18px;
  padding: 28px 0;
}

.guide ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide li {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 13px;
  color: var(--muted);
  background: var(--panel);
  font-size: 13px;
  line-height: 1.45;
}

.guide b {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

footer {
  display: grid;
  grid-template-columns: 1fr 1.3fr auto;
  gap: 18px;
  border-top: 1px solid var(--line);
  padding: 18px 0 26px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

footer strong {
  color: var(--ink);
  font-family: "Malgun Gothic", "맑은 고딕", "Noto Sans KR", system-ui, sans-serif;
  font-weight: 700;
}

footer p {
  margin: 4px 0 0;
}

@media (max-width: 900px) {
  .service-grid,
  .quote-grid,
  .result-panel,
  .guide {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero {
    min-height: auto;
    padding-top: 26px;
  }

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

  .hero-copy,
  .wip-index small {
    white-space: normal;
  }

  .wip-index a {
    grid-template-columns: 80px 1fr;
  }

  .wip-index small {
    grid-column: 2;
  }
}

@media (max-width: 620px) {
  .site-header,
  main > section,
  footer {
    width: calc(100% - 28px);
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px 0;
  }

  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .quote-grid,
  .result-panel,
  .service-grid {
    grid-template-columns: 1fr;
  }

  .market-note {
    grid-template-columns: 1fr;
  }

  .calculator {
    padding: 16px;
  }

  h1 {
    font-size: 16px;
  }

  footer {
    grid-template-columns: 1fr;
  }
}
