:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --text: #1a1917;
  --muted: #5c5952;
  --line: #e0ddd3;
  --accent: #0b6e4f;
  --accent-strong: #095a41;
  --accent-text: #ffffff;
  --accent-soft: #e3f1ea;
  --warn-bg: #fff4d6;
  --warn-text: #6a4a00;
  --radius: 12px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141412;
    --surface: #1e1e1b;
    --text: #edece7;
    --muted: #a8a59c;
    --line: #35342f;
    --accent: #56cfa1;
    --accent-strong: #7adcb7;
    --accent-text: #0b1d15;
    --accent-soft: #1b3228;
    --warn-bg: #3a2f10;
    --warn-text: #f3d98a;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: -0.01em;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
body.has-sticky { padding-bottom: 72px; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.skip { position: absolute; left: 8px; top: -60px; z-index: 10; background: var(--accent); color: var(--accent-text); padding: 10px 16px; border-radius: 8px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 8px; color: var(--accent-text); }

.wrap { max-width: 820px; margin: 0 auto; padding: 0 16px; }
.content { min-width: 0; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { max-width: 1140px; display: flex; align-items: center; gap: 8px 28px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 8px; min-height: 56px; font-weight: 800; font-size: 20px; letter-spacing: -0.02em; color: var(--text); text-decoration: none; }
.logo:hover { color: var(--text); }
.logo-mark { color: var(--accent); flex: none; }
.site-header nav { display: flex; gap: 4px; margin: 0 -10px; overflow-x: auto; scrollbar-width: none; }
.site-header nav::-webkit-scrollbar { display: none; }
.site-header nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 600; white-space: nowrap; border-radius: 8px; }
.site-header nav a:hover { color: var(--text); background: var(--bg); }
.site-header nav a[aria-current="page"] { color: var(--accent); }

/* Text */
main { padding: 28px 0 72px; }
h1 { font-size: 30px; line-height: 1.3; letter-spacing: -0.03em; margin: 0 0 16px; text-wrap: balance; }
h2 { font-size: 22px; line-height: 1.4; letter-spacing: -0.02em; margin: 52px 0 14px; }
h3 { font-size: 18px; line-height: 1.4; margin: 24px 0 8px; }
p { margin: 0 0 14px; }
.lead { color: var(--muted); font-size: 17px; margin: 0 0 16px; }
.sub { font-size: 13px; color: var(--muted); }

.crumb ol { display: flex; flex-wrap: wrap; list-style: none; padding: 0; margin: 0 0 10px; font-size: 14px; }
.crumb li + li::before { content: "›"; margin: 0 8px; color: var(--muted); }
.crumb a { color: var(--muted); text-decoration: none; display: inline-block; padding: 4px 0; }
.crumb a:hover { color: var(--accent); text-decoration: underline; }

/* Brand hero */
.hero {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: var(--accent); color: var(--accent-text);
  border-radius: var(--radius); padding: 36px 16px; margin: 0 0 18px; text-align: center;
}
.hero-name { font-size: 42px; font-weight: 800; line-height: 1.2; letter-spacing: -0.03em; }
.hero-noun { font-size: 24px; font-weight: 700; }
.hero-tag { font-size: 14px; font-weight: 700; background: var(--accent-text); color: var(--accent); border-radius: 999px; padding: 2px 14px; margin-top: 10px; }
.hero-tag:empty { display: none; }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; list-style: none; padding: 0; margin: 0 0 16px; }
.facts li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; font-size: 13px; color: var(--muted); line-height: 1.4; }
.facts strong { display: block; font-size: 18px; color: var(--text); font-variant-numeric: tabular-nums; margin-bottom: 2px; }

.notice { background: var(--warn-bg); color: var(--warn-text); border-radius: 8px; padding: 10px 14px; font-size: 14px; }
.disclosure { font-size: 13px; color: var(--muted); border-left: 3px solid var(--line); padding: 2px 0 2px 12px; }

details.log { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 16px; margin: 16px 0; font-size: 14px; }
details.log summary { cursor: pointer; font-weight: 600; padding: 12px 0; }
details.log ul { margin: 0 0 12px; padding-left: 18px; color: var(--muted); }

.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin: 16px 0; }
.toc strong { display: block; margin-bottom: 4px; }
.toc ol { margin: 0; padding-left: 20px; }
.toc a { display: inline-block; padding: 3px 0; text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* Coupons */
.coupons { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.coupon { display: flex; align-items: stretch; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.coupon-info { flex: 1; min-width: 0; padding: 14px 16px; }
.coupon-benefit { font-size: 18px; font-weight: 700; line-height: 1.4; margin: 6px 0 4px; }
.coupon-until { font-size: 13px; color: var(--muted); margin: 0; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 1px 8px; }
.dday { display: inline-block; margin-left: 6px; font-size: 12px; font-weight: 700; color: var(--warn-text); background: var(--warn-bg); border-radius: 6px; padding: 0 6px; }

button.code {
  flex: none; width: 190px; min-height: 76px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font: inherit; cursor: pointer;
  background: var(--accent); color: var(--accent-text);
  border: 0; border-left: 2px dashed var(--surface); padding: 10px 12px;
  transition: background-color 0.15s;
}
button.code:hover { background: var(--accent-strong); }
button.code:focus-visible { outline-offset: -4px; outline-color: var(--accent-text); }
.code-text { font-family: var(--mono); font-size: 17px; font-weight: 700; letter-spacing: 0.04em; overflow-wrap: anywhere; text-align: center; }
.code-action { font-size: 13px; font-weight: 600; opacity: 0.9; }

.empty { color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 18px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; background: var(--accent); color: var(--accent-text); text-decoration: none; font-weight: 700; border-radius: 10px; padding: 0 20px; }
.btn:hover { background: var(--accent-strong); color: var(--accent-text); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; white-space: nowrap; }
.btn.off { background: var(--line); color: var(--muted); cursor: not-allowed; }

.promo { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 10px 0; }
.promo h3 { margin: 0 0 4px; }
.promo p { margin: 0 0 12px; color: var(--muted); }
.promo .until { font-size: 13px; color: var(--muted); margin-left: 10px; }

.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; padding: 14px 0; }
.faq p { margin: 0 0 14px; color: var(--muted); }

/* Tables (card comparison) */
.table-scroll { overflow-x: auto; margin: 12px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 15px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 600; background: var(--bg); }
tr:last-child td { border-bottom: 0; }
ul.plain { margin: 0; padding-left: 18px; }

/* Link lists */
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 12px 0; list-style: none; }
.chips a { display: inline-flex; align-items: center; min-height: 40px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 16px; text-decoration: none; color: var(--text); font-size: 15px; font-weight: 500; }
.chips a:hover { border-color: var(--accent); color: var(--accent); }
.chips.small { gap: 6px; margin: 8px 0 0; }
.chips.small a { min-height: 32px; font-size: 13px; padding: 0 10px; }

.brand-list { list-style: none; padding: 0; margin: 12px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.brand-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 2px 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.brand-list li:last-child { border-bottom: 0; }
.brand-list a { font-weight: 700; text-decoration: none; }
.brand-list a:hover { text-decoration: underline; }
.brand-list span { font-size: 13px; color: var(--muted); }

.cat-block { margin: 36px 0; }
.cat-block h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 4px; }
.cat-block h2 a { font-size: 14px; font-weight: 600; text-decoration: none; }
.cat-block .lead { font-size: 15px; margin: 0; }

.finder { margin: 20px 0 8px; }
.finder label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.finder input { width: 100%; min-height: 48px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--muted); border-radius: 10px; padding: 0 14px; }
.finder input::placeholder { color: var(--muted); }
.finder-status { min-height: 22px; margin: 6px 0 0; font-size: 14px; color: var(--muted); }

/* Sidebar */
.side { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); }
.side section { margin-bottom: 20px; }
.side-title { margin: 0; font-weight: 700; font-size: 15px; }
.side-title a { display: inline-block; padding: 6px 0; color: var(--text); text-decoration: none; }
.side-title a:hover { color: var(--accent); }

.sticky { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--surface); border-top: 1px solid var(--line); padding: 10px 16px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); text-align: center; }
.sticky .btn { width: 100%; max-width: 420px; }
/* Shown at the top so it never covers the coupon that was just tapped. */
.toast { position: fixed; left: 50%; top: 12px; z-index: 6; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity 0.2s; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; }

.site-footer { border-top: 1px solid var(--line); padding: 24px 0 32px; font-size: 13px; color: var(--muted); }
.site-footer .wrap { max-width: 1140px; }
.site-footer a { display: inline-block; padding: 8px 0; color: var(--muted); }
.has-sticky .site-footer { padding-bottom: 32px; }

@media (min-width: 980px) {
  body { font-size: 17px; }
  .wrap.with-side { max-width: 1140px; display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 48px; align-items: start; }
  .side { margin-top: 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
}
@media (max-width: 560px) {
  h1 { font-size: 24px; }
  h2 { font-size: 20px; margin-top: 40px; }
  .hero { padding: 26px 12px; }
  .hero-name { font-size: 32px; }
  .hero-noun { font-size: 20px; }
  .facts li { padding: 10px; }
  .facts strong { font-size: 15px; white-space: nowrap; }
  .coupon { flex-direction: column; }
  button.code { width: 100%; min-height: 60px; flex-direction: row; gap: 12px; border-left: 0; border-top: 2px dashed var(--surface); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .toast, button.code { transition: none; }
}
