:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5b6370;
  --line: #dfe3e8;
  --accent: #1456d9;
  --good: #0a7a45;
  --bad: #c62828;
  --warn-bg: #fff4d6;
  --warn-text: #7a5300;
  --ok-bg: #e3f4ea;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111318;
    --surface: #1a1d24;
    --text: #eceef2;
    --muted: #a3abb8;
    --line: #2d323c;
    --accent: #7aa7ff;
    --good: #4cc98a;
    --bad: #ff7b72;
    --warn-bg: #3d3212;
    --warn-text: #ffd774;
    --ok-bg: #153524;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  word-break: keep-all;
}
.top, main { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.top { padding-top: 40px; padding-bottom: 8px; }
h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); line-height: 1.3; margin: 0 0 8px; }
.top p { color: var(--muted); margin: 0; max-width: 46em; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }
h2 small { font-weight: 400; color: var(--muted); font-size: .85rem; }
a { color: var(--accent); }

.panel, .card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin: 16px 0;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.grid .wide { grid-column: 1 / -1; }
label { display: block; font-size: .92rem; font-weight: 600; }
label small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
input[type="number"], input[type="email"], select {
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
input:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; align-items: start; }
.card { margin: 0; }
.card.best { border-color: var(--good); box-shadow: 0 0 0 1px var(--good); }
.card.best h2::after {
  content: "가장 많이 남음";
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ok-bg);
  color: var(--good);
  font-size: .75rem;
  white-space: nowrap;
}
.profit { font-size: 2rem; font-weight: 700; margin: 0; font-variant-numeric: tabular-nums; color: var(--good); }
.profit.loss { color: var(--bad); }
.margin { margin: 0 0 12px; color: var(--muted); font-size: .9rem; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; font-variant-numeric: tabular-nums; }
td { padding: 6px 0; border-top: 1px solid var(--line); }
td:last-child { text-align: right; white-space: nowrap; padding-left: 12px; }
tr.minus td { color: var(--muted); }
tr.sub td { font-weight: 600; }

details { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
summary { cursor: pointer; font-weight: 600; font-size: .92rem; }
details label { margin-top: 12px; }
label.check { font-weight: 400; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.note { color: var(--muted); font-size: .85rem; margin: 10px 0 0; }
.flag, .tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
}
.flag, .tag.warn { background: var(--warn-bg); color: var(--warn-text); }
.tag.ok { background: var(--ok-bg); color: var(--good); }

.sources { padding-left: 0; list-style: none; margin: 0; font-size: .9rem; }
.sources li { padding: 6px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.sources li:first-child { border-top: 0; }
.cta { margin-bottom: 48px; }
.button {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--surface);
  font-weight: 700;
  text-decoration: none;
}
button.button { border: 0; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
button.button:disabled { opacity: .6; cursor: progress; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.waitlist { max-width: 560px; margin-top: 16px; }
.waitlist-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: stretch; }
.waitlist-row input { flex: 1 1 220px; margin-top: 4px; }
.waitlist-row .button { margin-top: 4px; }
.waitlist fieldset { border: 0; padding: 0; margin: 16px 0 12px; display: flex; gap: 6px 18px; flex-wrap: wrap; }
.waitlist legend { padding: 0; margin-bottom: 6px; font-size: .92rem; font-weight: 600; }
.waitlist legend small { font-weight: 400; color: var(--muted); font-size: .8rem; }
.status { margin: 10px 0 0; font-size: .92rem; font-weight: 600; min-height: 1.5em; }
.status.ok { color: var(--good); }
.status.error { color: var(--bad); }
