:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --ink: #15171b;
  --ink-2: #3b4049;
  --muted: #6b7280;
  --line: #e4e7ec;
  --accent: #2557eb;
  --accent-soft: #e9efff;
  --accent-ink: #ffffff;
  --ok: #15803d;
  --ok-soft: #e8f6ee;
  --warn: #b45309;
  --warn-soft: #fdf3e2;
  --danger: #c62828;
  --ig: #d6246e;
  --yt: #e60023;
  --tt: #00a8b0;
  --th: #4b5563;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1014; --surface: #161920; --surface-2: #1d2129; --ink: #eef0f3; --ink-2: #c9ced6; --muted: #9aa3af;
    --line: #272c35; --accent: #5b82ff; --accent-soft: #1b2440; --ok: #4ade80; --ok-soft: #12261b;
    --warn: #fbbf24; --warn-soft: #2a2110; --danger: #f87171; --th: #9ca3af;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1014; --surface: #161920; --surface-2: #1d2129; --ink: #eef0f3; --ink-2: #c9ced6; --muted: #9aa3af;
  --line: #272c35; --accent: #5b82ff; --accent-soft: #1b2440; --ok: #4ade80; --ok-soft: #12261b;
  --warn: #fbbf24; --warn-soft: #2a2110; --danger: #f87171; --th: #9ca3af;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}
button, input { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }

.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-inner { max-width: 760px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; }
.brand { font-weight: 800; letter-spacing: -.02em; font-size: 17px; color: var(--ink); }
.brand small { font-weight: 500; color: var(--muted); font-size: 12px; margin-left: 4px; }
.top-link { font-size: 14px; color: var(--ink-2); padding: 6px 10px; border-radius: 8px; }
.top-link:hover { background: var(--surface-2); }

.wrap { max-width: 760px; margin: 0 auto; padding: 20px 16px 140px; }
.dev-banner {
  font-size: 13px; color: var(--warn); background: var(--warn-soft); border-radius: 10px; padding: 8px 12px; margin-bottom: 16px;
}
h1 { font-size: 24px; letter-spacing: -.03em; margin: 4px 0 4px; }
.lede { color: var(--muted); margin: 0 0 20px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.step-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.step-no { font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 8px; }
.step-title { font-weight: 700; font-size: 16px; }

.link-input {
  width: 100%; padding: 14px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface);
  font-size: 16px; outline: none; transition: border-color .15s;
}
.link-input:focus { border-color: var(--accent); }
.detect { margin-top: 10px; font-size: 14px; min-height: 22px; display: flex; align-items: center; gap: 8px; }
.detect.ok { color: var(--ok); }
.detect.err { color: var(--danger); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--ok-soft); font-weight: 600; font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--th); flex: none; }
.dot.instagram { background: var(--ig); } .dot.youtube { background: var(--yt); } .dot.tiktok { background: var(--tt); } .dot.threads { background: var(--th); }

.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 4px 0 14px; scrollbar-width: none; }
.tab {
  flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-2);
}
.tab[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.products { display: grid; gap: 8px; }
.product {
  text-align: left; width: 100%; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 14px;
  cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; transition: border-color .15s, background .15s;
}
.product:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.product[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.product.dim { opacity: .5; }
.product:disabled { cursor: not-allowed; }
.p-title { font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); }
.badge.korean { background: #e8f0ff; color: #1d4ed8; }
.badge.guarantee { background: var(--ok-soft); color: var(--ok); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.korean { background: #1b2440; color: #93b4ff; } }
:root[data-theme="dark"] .badge.korean { background: #1b2440; color: #93b4ff; }
.p-price { font-weight: 700; text-align: right; white-space: nowrap; }
.p-sub { color: var(--muted); font-size: 13px; grid-column: 1 / -1; }
.p-stats { font-size: 12.5px; color: var(--ink-2); grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; }
.p-stats .muted { color: var(--muted); }
.p-note { font-size: 12.5px; color: var(--warn); grid-column: 1 / -1; }

.qty-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.preset { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 14px; }
.preset[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.qty-input-wrap { display: flex; align-items: center; gap: 8px; }
.qty-input { width: 160px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 16px; }
.qty-input:focus { outline: none; border-color: var(--accent); }
.hint { font-size: 13px; color: var(--muted); }
.hint.err { color: var(--danger); }

.summary { display: grid; gap: 8px; font-size: 14px; }
.summary .row { display: flex; justify-content: space-between; gap: 12px; }
.summary .row span:first-child { color: var(--muted); flex: none; }
.summary .row span:last-child { text-align: right; word-break: break-all; }
.summary .total { font-size: 18px; font-weight: 800; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 2px; }
.field { margin-top: 14px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }
.field input[type="tel"] { width: 100%; padding: 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 16px; }
.consent { margin-top: 14px; background: var(--surface-2); border-radius: 10px; padding: 12px; font-size: 13px; color: var(--ink-2); }
.consent label { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; font-weight: 600; color: var(--ink); cursor: pointer; }
.consent input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); }

.paybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
.paybar-inner { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.paybar-total { flex: 1; min-width: 0; }
.paybar-total .lbl { font-size: 12px; color: var(--muted); }
.paybar-total .amt { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.btn {
  border: 0; border-radius: 12px; padding: 14px 20px; font-weight: 700; font-size: 16px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); white-space: nowrap;
}
.btn:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.btn.ghost { background: var(--surface-2); color: var(--ink); }
.error-box { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; }

.modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: none; align-items: flex-end; justify-content: center; z-index: 40; }
.modal-back.open { display: flex; }
.modal { background: var(--surface); width: 100%; max-width: 480px; border-radius: 18px 18px 0 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); }
@media (min-width: 600px) { .modal-back { align-items: center; } .modal { border-radius: 18px; } }
.modal h2 { margin: 0 0 6px; font-size: 18px; }
.modal p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.modal .actions { display: flex; gap: 8px; }
.modal .actions .btn { flex: 1; }

.recent { margin-top: 26px; }
.recent h2 { font-size: 15px; margin: 0 0 8px; color: var(--ink-2); }
.recent a { display: flex; justify-content: space-between; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; color: var(--ink); font-size: 14px; }
.recent a span:last-child { color: var(--muted); }

/* 주문 상태 페이지 */
.status-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 4px; }
.status-badge { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.status-badge.COMPLETED { background: var(--ok-soft); color: var(--ok); }
.status-badge.IN_PROGRESS, .status-badge.SUBMITTED, .status-badge.QUEUED { background: var(--accent-soft); color: var(--accent); }
.status-badge.NEEDS_REVIEW, .status-badge.PARTIAL { background: var(--warn-soft); color: var(--warn); }
.progress { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 14px 0 8px; }
.progress > div { height: 100%; background: var(--accent); border-radius: 999px; transition: width .6s ease; }
.progress-nums { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: 12px; padding: 8px 0; align-items: flex-start; }
.timeline .tick { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); flex: none; margin-top: 2px; }
.timeline li.done .tick { background: var(--accent); border-color: var(--accent); }
.timeline .t-label { font-weight: 600; }
.timeline .t-at { font-size: 13px; color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }
.skeleton { color: var(--muted); padding: 30px 0; text-align: center; }

@media (max-width: 480px) {
  h1 { font-size: 21px; }
  .card { padding: 15px; }
  .btn { padding: 13px 16px; }
}

/* ── v2: 링크 우선 주문 화면 ── */
.top-nav { display: flex; gap: 2px; }
.dot.web { background: var(--accent); }
.dot.facebook { background: #1877f2; } .dot.x { background: #111; } .dot.telegram { background: #229ed9; }
.dot.twitch { background: #9146ff; } .dot.chzzk { background: #00c73c; } .dot.discord { background: #5865f2; }
.hero { margin: 6px 0 16px; }
.hero h1 { margin-bottom: 12px; }
.field-label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.link-box { display: flex; gap: 8px; align-items: stretch; }
.link-box .link-input { flex: 1; min-width: 0; font-size: 16px; padding: 15px 14px; }
.paste-btn { flex: none; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 0 14px; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.paste-btn:hover { border-color: var(--accent); color: var(--accent); }
.inline-help { display: inline-block; margin-left: 6px; }
.inline-help summary { cursor: pointer; color: var(--accent); list-style: none; display: inline; }
.inline-help summary::-webkit-details-marker { display: none; }
.inline-help[open] { display: block; margin: 8px 0 0; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.inline-help ul { margin: 6px 0 0; padding-left: 18px; }
.target { margin-top: 12px; border-radius: 12px; }
.target.ok { background: var(--surface); border: 1.5px solid color-mix(in srgb, var(--ok) 40%, var(--line)); padding: 12px 14px; }
.target.err { color: var(--danger); font-size: 14px; padding: 4px 2px; }
.target-head { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.target-url { font-size: 12.5px; color: var(--muted); margin-top: 4px; word-break: break-all; }
.target-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; font-size: 13px; }
.target-actions a { font-weight: 700; }
.warn-line { margin-top: 8px; font-size: 13px; color: var(--warn); background: var(--warn-soft); border-radius: 8px; padding: 7px 10px; }
.step-hint { margin-left: auto; font-size: 13px; color: var(--ok); font-weight: 600; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 12px; }
.chip-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 11px; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.chip-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.badge.ranking { background: #fdeee6; color: #b4471a; }
.badge.traffic { background: #eceefe; color: #4338ca; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge.ranking { background: #3a2116; color: #ffb38f; }
  :root:not([data-theme="light"]) .badge.traffic { background: #20224a; color: #a5b4fc; }
}
.product { grid-template-columns: 1fr; }
.p-rows { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; margin-top: 6px; }
.p-row { display: flex; gap: 8px; font-size: 13px; min-width: 0; }
.p-row .k { color: var(--muted); flex: none; width: 30px; }
.p-row .v { color: var(--ink); font-weight: 600; min-width: 0; }
@media (max-width: 480px) { .p-rows { grid-template-columns: 1fr; } }
.p-guarantees { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.g-chip { font-size: 11.5px; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); }
.caution { background: var(--warn-soft); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 12px; color: var(--ink); }
.caution strong { color: var(--warn); }
.caution ul { margin: 6px 0 0; padding-left: 18px; }
.text-input { width: 100%; padding: 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 16px; resize: vertical; }
.text-input:focus { outline: none; border-color: var(--accent); }
.field .muted { color: var(--muted); font-weight: 500; }
.stepper { width: 40px; height: 42px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; font-size: 20px; cursor: pointer; color: var(--ink-2); }
.drip { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--accent); }
.drip-opts { display: grid; gap: 10px; margin-top: 10px; }
.expect { margin-top: 14px; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.expect-main { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.promise { margin: 10px 0 0; padding-left: 0; list-style: none; font-size: 13.5px; display: grid; gap: 4px; color: var(--ink-2); }
.promise strong { color: var(--ink); }
table.policy { width: 100%; border-collapse: collapse; margin: 14px 0 6px; font-size: 13.5px; }
table.policy caption { text-align: left; font-weight: 700; margin-bottom: 6px; }
table.policy th, table.policy td { border-top: 1px solid var(--line); padding: 8px 4px; text-align: left; vertical-align: top; }
table.policy th { width: 42%; color: var(--muted); font-weight: 600; }
.checks { margin-top: 14px; display: grid; gap: 8px; background: var(--surface-2); border-radius: 10px; padding: 12px; }
.checks label { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; font-size: 14px; cursor: pointer; }
.checks input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.why, .faq, .scorecard { margin-top: 28px; }
.why h2, .faq h2, .scorecard h2 { font-size: 17px; margin: 0 0 10px; }
.flow { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; counter-reset: f; }
.flow li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 12px 44px; position: relative; display: grid; gap: 2px; font-size: 14px; }
.flow li::before { counter-increment: f; content: counter(f); position: absolute; left: 14px; top: 12px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.flow li span { color: var(--muted); font-size: 13.5px; }
.sc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.sc-cell { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.sc-v { font-size: 20px; font-weight: 800; }
.sc-k { font-size: 12.5px; color: var(--muted); }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 6px; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 14.5px; }
.faq p { margin: 8px 0 0; color: var(--ink-2); font-size: 14px; }
.lookup { display: grid; grid-template-columns: 1fr 140px auto; gap: 6px; margin-bottom: 6px; }
.lookup input { padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); min-width: 0; font-size: 15px; }
.small-btn { padding: 10px 14px; font-size: 14px; }
@media (max-width: 480px) { .lookup { grid-template-columns: 1fr 1fr; } .lookup button { grid-column: 1 / -1; } }
.site-foot { margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); display: grid; gap: 6px; }
.foot-brand { font-weight: 800; color: var(--ink-2); }
.foot-info { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.muted { color: var(--muted); }

/* 주문 상태 페이지 */
.events { list-style: none; padding: 0; margin: 0; font-size: 13.5px; }
.events li { display: flex; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.events li:first-child { border-top: 0; }
.events .at { color: var(--muted); flex: none; width: 140px; white-space: nowrap; }
.refill-bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.refill-bar > div { height: 100%; background: var(--ok); }
.inline-form { display: flex; gap: 6px; margin-top: 8px; }
.inline-form input { flex: 1; min-width: 0; padding: 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); }
