:root {
  --fg: #1a1a1a;
  --muted: #666;
  --accent: #2255cc;
  --bg: #fafafa;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
}

header, main, footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

header { border-bottom: 1px solid #ddd; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
header nav { font-size: 0.9rem; color: var(--muted); }
header nav a { color: var(--accent); text-decoration: none; margin: 0 0.25rem; }
fieldset { margin: 0.75rem 0; }
fieldset legend { font-weight: 600; }
footer { border-top: 1px solid #ddd; color: var(--muted); margin-top: 2rem; }

h1 a { color: var(--accent); text-decoration: none; }

form label { display: block; margin: 0.5rem 0; }
input[type="text"] { padding: 0.4rem; font-size: 1rem; }
button { padding: 0.5rem 1rem; font-size: 1rem; cursor: pointer; }

table.stt-jobs { width: 100%; border-collapse: collapse; margin-top: 0.75rem; }
table.stt-jobs th, table.stt-jobs td { padding: 0.4rem 0.5rem; border-bottom: 1px solid #eee; text-align: left; font-size: 0.95rem; }
.stt-status { display: inline-block; padding: 0 0.4rem; border-radius: 4px; font-size: 0.85rem; background: #eef; color: #225; }
.stt-status-done { background: #def7e0; color: #155724; }
.stt-status-failed, .stt-status-canceled { background: #fde2e2; color: #821818; }
.stt-status-processing, .stt-status-uploaded { background: #fff3c4; color: #644400; }
.stt-err { color: #821818; }
.stt-upload { margin: 1rem 0; padding: 0.75rem 1rem; background: #fff; border: 1px solid #eee; border-radius: 6px; }
.stt-result { background: #fff; padding: 0.75rem; border: 1px solid #eee; white-space: pre-wrap; }

.credit-chip { display: inline-block; padding: 0.15rem 0.5rem; background: #eef6ff; color: #1b3a7a;
  border-radius: 999px; font-size: 0.85rem; text-decoration: none; }
.credit-chip:hover { background: #dceaff; }
.credit-balance { font-size: 1.15rem; }
.credit-held { color: #644400; }
table.credit-tx { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
table.credit-tx th, table.credit-tx td { padding: 0.35rem 0.5rem; border-bottom: 1px solid #eee;
  text-align: left; font-size: 0.9rem; }
table.credit-tx td.num { text-align: right; font-variant-numeric: tabular-nums; }
.credit-tx-type { display: inline-block; padding: 0 0.4rem; border-radius: 4px; font-size: 0.8rem; }
.credit-tx-charge  { background: #def7e0; color: #155724; }
.credit-tx-hold    { background: #fff3c4; color: #644400; }
.credit-tx-capture { background: #e6e6f7; color: #2a2a6a; }
.credit-tx-release { background: #eef; color: #225; }
.credit-tx-refund  { background: #fde2e2; color: #821818; }
.credit-tx-adjust  { background: #eee; color: #444; }
/* Order statuses (re-uses credit-tx-type styling) */
.credit-tx-ready    { background: #eef; color: #225; }
.credit-tx-approved { background: #def7e0; color: #155724; }
.credit-tx-canceled { background: #fde2e2; color: #821818; }
.credit-tx-failed   { background: #fde2e2; color: #821818; }
.credit-tx-refunded { background: #f5e2fa; color: #5a1873; }
.credit-tx-partially_refunded { background: #faeede; color: #7a3a00; }

.badge-test { display: inline-block; background: #f5e2fa; color: #5a1873; padding: 0.1rem 0.4rem;
  border-radius: 4px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em; margin-right: 0.35rem; }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin: 1rem 0; }
.plan-card { background: #fff; border: 1px solid #eee; border-radius: 8px; padding: 1rem; }
.plan-card h3 { margin: 0 0 0.25rem 0; }
.plan-price { font-size: 1.4rem; font-weight: 600; margin: 0.25rem 0; }
.btn-primary { display: inline-block; background: var(--accent); color: #fff; padding: 0.5rem 1rem;
  border-radius: 6px; text-decoration: none; }
.btn-primary:hover { background: #1a44a8; }

table.glossary-list, table.glossary-entries { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
table.glossary-list th, table.glossary-list td,
table.glossary-entries th, table.glossary-entries td {
  padding: 0.4rem 0.5rem; border-bottom: 1px solid #eee; text-align: left; font-size: 0.9rem;
}
table.glossary-entries tr.disabled td { opacity: 0.55; }
.glossary-add { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: end; }
.glossary-add label { display: inline-flex; gap: 0.25rem; align-items: center; }

.stt-diff { margin: 0.5rem 0 1rem 0; padding: 0.5rem 0.75rem; border-left: 3px solid var(--accent);
  background: #f4f7ff; font-size: 0.9rem; }
.stt-diff details > summary { cursor: pointer; }
.stt-diff .change { display: inline-block; margin: 0.15rem 0.5rem 0.15rem 0; }
.stt-diff .change s { color: #b00020; opacity: 0.75; }
.stt-diff .change b { color: #155724; }

.kakao-btn { display: inline-block; padding: 0.5rem 1rem; background: #FEE500; color: #191919;
  border-radius: 6px; text-decoration: none; font-weight: 600; }
.kakao-btn:hover { background: #f1d800; }

.legal-doc { max-width: 720px; line-height: 1.6; }
.legal-doc h1 { margin-top: 0; }
.legal-doc h2 { margin-top: 1.5rem; }
.legal-doc table { border-collapse: collapse; margin: 0.5rem 0; }
.legal-doc th, .legal-doc td { padding: 0.4rem 0.6rem; border: 1px solid #ddd; }
.legal-doc code { background: #f4f4f4; padding: 0 0.2rem; border-radius: 3px; }
.legal-meta { color: var(--muted); margin-top: 2rem; }
.footer-meta p { margin: 0.25rem 0; }
.footer-meta a { color: var(--accent); text-decoration: none; margin: 0 0.15rem; }
.footer-meta a:hover { text-decoration: underline; }

.apikey-flash { background: #fffceb; border: 1px solid #f1d800; padding: 1rem; border-radius: 6px; margin: 1rem 0; }
.apikey-plain { background: #1a1a1a; color: #fafafa; padding: 0.75rem; border-radius: 4px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; user-select: all; word-break: break-all; }
table.apikey-list { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
table.apikey-list th, table.apikey-list td { padding: 0.4rem 0.5rem; border-bottom: 1px solid #eee;
  text-align: left; font-size: 0.9rem; }
table.apikey-list tr.disabled td { opacity: 0.55; }

.landing h2 { font-size: 1.6rem; line-height: 1.3; margin: 0.5rem 0 1rem 0; }
.landing-features { padding-left: 1.25rem; line-height: 1.8; }
.landing-cta { margin: 1.5rem 0; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.landing-cta .btn-primary { font-size: 1.05rem; }
