:root {
  --bg: #faf6ee;
  --surface: #ffffff;
  --surface-sunken: #f1ead9;
  --fg: #2b2420;
  --muted: #7a7064;
  --border: #e4dac4;
  --accent: #b5542e;
  --accent-soft: #f3e2d5;
  --good: #3f7d4f;
  --good-soft: #e3efe1;
  --step-bg: #fbf8f1;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1712;
    --surface: #26201a;
    --surface-sunken: #1f1a15;
    --fg: #f1e9dd;
    --muted: #a99d8c;
    --border: #3c332a;
    --accent: #e08a5f;
    --accent-soft: #3a2a20;
    --good: #7fbf8f;
    --good-soft: #243024;
    --step-bg: #211b15;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1c1712;
  --surface: #26201a;
  --surface-sunken: #1f1a15;
  --fg: #f1e9dd;
  --muted: #a99d8c;
  --border: #3c332a;
  --accent: #e08a5f;
  --accent-soft: #3a2a20;
  --good: #7fbf8f;
  --good-soft: #243024;
  --step-bg: #211b15;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Noto Sans KR", -apple-system, "Malgun Gothic", sans-serif;
  padding: 28px 16px 56px;
}

.wrap { max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }

header.top { display: flex; flex-direction: column; gap: 6px; }
.eyebrow {
  font-size: 13px; font-weight: 700; color: var(--accent);
  letter-spacing: 0.04em; text-transform: uppercase;
}
h1 {
  font-weight: 900; font-size: clamp(26px, 7vw, 32px);
  margin: 0; line-height: 1.25; text-wrap: balance;
}
.sub { color: var(--muted); font-size: 15px; line-height: 1.6; margin: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  display: flex; flex-direction: column; gap: 18px;
}

.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field label { font-size: 14px; font-weight: 700; color: var(--fg); }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: -4px; }

input[type="number"], select {
  font: inherit; font-size: 16px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: 10px;
  padding: 11px 12px;
  width: 100%;
}
input[type="number"]:focus, select:focus {
  outline: 2px solid var(--accent); outline-offset: 1px;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 14px; font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface-sunken);
  color: var(--fg);
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
  user-select: none;
}
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

button.primary {
  font: inherit; font-size: 16px; font-weight: 800;
  background: var(--accent); color: #fff;
  border: none; border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
}
button.primary:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
button.primary:active { opacity: 0.88; }

.results { display: flex; flex-direction: column; gap: 14px; }
.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.results-head h2 { font-size: 18px; margin: 0; font-weight: 800; }
.count-pill {
  font-size: 13px; font-weight: 700;
  background: var(--good-soft); color: var(--good);
  border-radius: 999px; padding: 4px 11px;
  white-space: nowrap;
}

.benefit {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 6px;
  min-width: 0;
}
.benefit .name { font-size: 16.5px; font-weight: 800; }
.benefit .amount {
  font-size: 15px; font-weight: 700; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.benefit .desc { font-size: 14px; color: var(--muted); line-height: 1.55; }
.benefit .meta { font-size: 12.5px; color: var(--muted); }

.toggle-btn {
  font: inherit; font-size: 14px; font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: none; border-radius: 10px;
  padding: 10px 14px;
  margin-top: 4px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
}
.toggle-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle-btn .arrow { transition: transform 0.15s ease; flex: none; }
.toggle-btn[aria-expanded="true"] .arrow { transform: rotate(180deg); }

.detail {
  display: flex; flex-direction: column; gap: 16px;
  padding-top: 4px;
}

.docs {
  background: var(--step-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.docs .docs-title { font-size: 13.5px; font-weight: 800; margin-bottom: 8px; }
.docs ul { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--fg); line-height: 1.7; }

.track { display: flex; flex-direction: column; gap: 10px; }
.track-title {
  font-size: 14px; font-weight: 800;
  display: flex; align-items: center; gap: 8px;
}
.track-title .dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--accent); flex: none;
}
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.steps li {
  background: var(--step-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px 10px 40px;
  position: relative;
  font-size: 13.5px;
  line-height: 1.6;
}
.steps li .num {
  position: absolute; left: 10px; top: 10px;
  width: 20px; height: 20px; border-radius: 999px;
  background: var(--accent); color: #fff;
  font-size: 11.5px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
}
.steps li b { font-weight: 800; }

.empty {
  text-align: center; color: var(--muted); font-size: 14px;
  padding: 24px 12px; border: 1px dashed var(--border); border-radius: 14px;
}

.disclaimer {
  font-size: 12.5px; color: var(--muted); line-height: 1.6;
  border-top: 1px solid var(--border); padding-top: 14px;
}

.qa-row { display: flex; gap: 8px; align-items: flex-start; }
.qa-row textarea {
  flex: 1; min-width: 0;
  font: inherit; font-size: 15px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: 10px;
  padding: 11px 12px;
  resize: vertical;
  min-height: 46px;
}
.qa-row textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button.qa-send {
  font: inherit; font-size: 14px; font-weight: 800;
  background: var(--accent); color: #fff;
  border: none; border-radius: 10px;
  padding: 0 16px;
  height: 46px;
  cursor: pointer;
  flex: none;
}

footer.site-footer {
  text-align: center; font-size: 12.5px; color: var(--muted);
  padding-top: 8px;
}
footer.site-footer a { color: var(--accent); }

/* --- admin page --- */
.admin-wrap { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.key-row { display: flex; gap: 8px; }
.key-row input {
  flex: 1; font: inherit; font-size: 15px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: 10px;
  padding: 11px 12px;
}
.admin-item {
  background: var(--step-bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
  font-size: 14px; line-height: 1.55;
  display: flex; flex-direction: column; gap: 4px;
}
.admin-item .q { font-weight: 700; }
.admin-item .at { color: var(--muted); font-size: 12px; }
.admin-item-actions { display: flex; gap: 8px; margin-top: 4px; }
.admin-item-actions button {
  font: inherit; font-size: 12.5px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent);
  border: none; border-radius: 8px; padding: 6px 10px;
  cursor: pointer;
}
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-actions button {
  font: inherit; font-size: 13px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent);
  border: none; border-radius: 8px; padding: 8px 12px;
  cursor: pointer;
}

[hidden] { display: none !important; }
