:root {
  --ink: #17212b;
  --muted: #66717d;
  --line: #dce2e7;
  --soft: #f4f6f7;
  --white: #fff;
  --green: #0d8a62;
  --green-dark: #08704f;
  --green-soft: #e8f6f1;
  --blue: #2868c7;
  --yellow: #f7d447;
  --red: #c33b3b;
  --shadow: 0 10px 35px rgba(20, 35, 45, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f7f8f9;
  letter-spacing: 0;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #f7f8f9; }
button, input, textarea { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.topbar { height: 68px; padding: 0 max(24px, calc((100vw - 1180px) / 2)); background: var(--white); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-weight: 750; }
.brand > img { width: 34px; height: 34px; display: block; border-radius: 6px; }
.secure-mark { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.secure-mark i { width: 8px; height: 8px; background: var(--green); border-radius: 50%; box-shadow: 0 0 0 4px var(--green-soft); }
.workspace { max-width: 1180px; margin: 0 auto; padding: 48px 24px 70px; }
.intro { margin-bottom: 28px; }
.eyebrow { color: var(--green); font-weight: 800; font-size: 11px; margin: 0 0 10px; }
.intro h1, .dashboard-head h1, .login-panel h1 { font-size: 34px; line-height: 1.15; margin: 0; }
.intro > p:last-child { color: var(--muted); margin: 10px 0 0; }
.activity-band { margin: 0 0 30px; padding: 24px 0 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.activity-copy { min-width: 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; }
.activity-copy .eyebrow { margin-bottom: 6px; }
.activity-copy h2 { font-size: 24px; margin: 0 0 6px; }
.activity-copy > div > span { color: var(--muted); font-size: 12px; }
.activity-totals { display: flex; gap: 24px; white-space: nowrap; }
.activity-totals span, .heatmap-legend span { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.activity-totals b { color: var(--ink); font-size: 26px; line-height: 1; }
.activity-totals i, .heatmap-legend i { width: 10px; height: 10px; border-radius: 2px; background: #e5e9eb; }
.activity-totals i.success, .heatmap-legend i.success { background: #118b63; }
.heatmap-scroll { min-width: 0; width: 100%; margin-top: 20px; overflow-x: auto; padding-bottom: 4px; }
.heatmap-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; margin-bottom: 9px; }
.heatmap-head, .heatmap-legend { width: 1111px; }
.activity-grid { display: grid; grid-auto-flow: column; grid-template-columns: repeat(36, 26px); grid-template-rows: repeat(2, 26px); gap: 5px; width: 1111px; height: 57px; }
.activity-cell { width: 26px; height: 26px; border-radius: 4px; background: #e5e9eb; display: grid; place-items: center; color: #65717a; font-size: 10px; font-weight: 800; font-variant-numeric: tabular-nums; }
.activity-cell.success-1 { background: #b8e4d3; }
.activity-cell.success-2 { color: white; background: #58bf96; }
.activity-cell.success-3 { color: white; background: #118b63; }
.activity-cell:hover { box-shadow: inset 0 0 0 2px var(--ink); }
.heatmap-legend { display: flex; justify-content: flex-end; gap: 14px; margin-top: 11px; }
.work-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr); gap: 22px; align-items: stretch; }
.tool-panel, .result-panel { background: var(--white); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 28px; }
.result-panel { display: flex; min-height: 645px; flex-direction: column; }
.section-head, .result-head { display: flex; align-items: flex-start; gap: 13px; }
.section-head h2, .result-head h2 { font-size: 16px; margin: 1px 0 4px; }
.section-head p, .result-head p { font-size: 13px; color: var(--muted); margin: 0; }
.step { flex: 0 0 auto; width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 6px; display: grid; place-items: center; font-size: 10px; color: var(--muted); font-weight: 800; }
.method-grid { border: 0; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.method { position: relative; min-height: 68px; border: 1px solid var(--line); border-radius: 6px; display: flex; align-items: center; gap: 12px; padding: 12px 13px; cursor: pointer; transition: border-color .15s, background .15s; }
.method:hover { border-color: #aeb9c1; }
.method.selected { border-color: var(--green); background: #fbfffd; box-shadow: inset 0 0 0 1px var(--green); }
.method input { position: absolute; opacity: 0; pointer-events: none; }
.method > i { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 6px; }
.method .pix { background: #31b78a; }
.method .ideal { background: #c9246b; }
.method .upi { background: linear-gradient(135deg, #f47b20 0 47%, #fff 48% 52%, #159447 53%); }
.method .kakao { background: var(--yellow); }
.method span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.method b { font-size: 14px; }
.method small { color: var(--muted); font-size: 11px; }
.method em { margin-left: auto; width: 18px; height: 18px; border: 1px solid var(--line); border-radius: 50%; color: transparent; display: grid; place-items: center; font-style: normal; font-size: 11px; }
.method.selected em { color: white; background: var(--green); border-color: var(--green); }
.divider { height: 1px; background: var(--line); margin: 27px 0; }
.field { display: flex; flex-direction: column; gap: 8px; margin-top: 17px; }
.field > span, .result-field > span { font-size: 12px; font-weight: 750; }
.field input, .field textarea, .result-field textarea { width: 100%; border: 1px solid #cfd7dd; background: white; border-radius: 6px; color: var(--ink); outline: 0; transition: border-color .15s, box-shadow .15s; }
.field input { height: 43px; padding: 0 12px; }
.field textarea, .result-field textarea { padding: 12px; line-height: 1.5; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.masked { -webkit-text-security: disc; }
.check { margin: 12px 0 20px; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; cursor: pointer; }
.check input { accent-color: var(--green); }
.primary, .secondary, .text-button, .nav-button { border: 0; border-radius: 6px; cursor: pointer; font-weight: 750; }
.primary { min-height: 44px; padding: 0 16px; background: var(--green); color: white; display: inline-flex; justify-content: center; align-items: center; gap: 12px; }
.primary:hover { background: var(--green-dark); }
.primary:disabled { opacity: .55; cursor: wait; }
.tool-panel > .primary { width: 100%; }
.secondary { min-height: 39px; padding: 0 14px; color: var(--ink); background: white; border: 1px solid #cfd7dd; }
.secondary:hover { background: var(--soft); }
.form-error { min-height: 18px; color: var(--red); font-size: 12px; margin: 10px 0 0; }
.empty-state, .loading-state, .failed-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-state .link-symbol { width: 62px; height: 62px; display: grid; place-items: center; border: 1px dashed #b9c4cb; border-radius: 50%; color: var(--green); font-size: 25px; margin-bottom: 16px; }
.empty-state strong, .loading-state strong, .failed-state strong { font-size: 15px; }
.empty-state span, .loading-state span { color: var(--muted); font-size: 12px; margin-top: 7px; }
.spinner { width: 42px; height: 42px; border: 3px solid var(--green-soft); border-top-color: var(--green); border-radius: 50%; margin-bottom: 18px; animation: spin .8s linear infinite; }
.loading-state time { margin-top: 18px; padding: 7px 11px; background: var(--soft); border-radius: 5px; font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }
.success-state { margin-top: 28px; }
.success-title { display: flex; align-items: center; gap: 12px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.success-title > span { width: 39px; height: 39px; border-radius: 50%; display: grid; place-items: center; color: white; background: var(--green); font-weight: 800; }
.success-title div { display: flex; flex-direction: column; gap: 4px; }
.success-title small { color: var(--muted); }
.amount { margin: 20px 0; background: var(--soft); border-left: 3px solid var(--green); padding: 13px 15px; display: flex; align-items: center; justify-content: space-between; }
.amount span { color: var(--muted); font-size: 12px; }
.amount strong { font-size: 22px; }
.qr-result { margin: 0 0 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.qr-result > span { align-self: flex-start; font-size: 12px; font-weight: 750; }
.qr-code { width: 236px; height: 236px; padding: 8px; background: white; display: grid; place-items: center; }
.qr-code img, .qr-code canvas { display: block; width: 220px; height: 220px; object-fit: contain; image-rendering: pixelated; }
.result-field { display: flex; flex-direction: column; gap: 8px; }
.result-field textarea { background: #fbfcfc; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; resize: none; overflow-wrap: anywhere; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 10px; }
.link-button { text-decoration: none; font-size: 13px; }
.extra-result { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.text-button { background: transparent; color: var(--green); padding: 9px 0 0; }
.quota-line { border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; margin: 20px 0 0; padding-top: 16px; }
.quota-line b { color: var(--ink); }
.failed-icon { width: 52px; height: 52px; border-radius: 50%; background: #faecec; color: var(--red); display: grid; place-items: center; font-weight: 900; font-size: 23px; margin-bottom: 16px; }
.failed-state p { color: var(--muted); font-size: 13px; line-height: 1.55; max-width: 320px; }
.failed-state button { margin-top: 7px; }
footer { height: 66px; padding: 0 max(24px, calc((100vw - 1180px) / 2)); border-top: 1px solid var(--line); color: var(--muted); display: flex; align-items: center; justify-content: space-between; font-size: 11px; }
footer a { text-decoration: none; }

/* Admin */
.admin-page main { max-width: 1180px; margin: 0 auto; padding: 48px 24px 80px; }
.topbar nav { display: flex; align-items: center; gap: 18px; font-size: 13px; }
.topbar nav a { color: var(--muted); text-decoration: none; }
.nav-button { padding: 8px 0; color: var(--red); background: transparent; }
.login-view { min-height: calc(100vh - 164px); display: grid; place-items: center; }
.login-panel { width: min(390px, 100%); background: white; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 34px; }
.admin-mark { width: 42px; height: 42px; display: block; border-radius: 6px; margin-bottom: 25px; }
.login-panel h1 { font-size: 25px; }
.login-panel .primary { width: 100%; margin-top: 20px; }
.dashboard-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 25px; }
.stats-band { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--ink); color: white; border-radius: 8px; overflow: hidden; }
.stats-band > div { padding: 22px 24px; border-right: 1px solid #39434d; display: flex; flex-direction: column; gap: 7px; }
.stats-band > div:last-child { border-right: 0; }
.stats-band span { color: #acb5bd; font-size: 11px; }
.stats-band strong { font-size: 25px; }
.create-band { margin-top: 22px; padding: 22px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.create-band h2, .table-title h2 { font-size: 17px; margin: 0 0 5px; }
.create-band p { color: var(--muted); margin: 0; font-size: 12px; }
.create-band form { display: grid; grid-template-columns: minmax(160px, 1fr) 110px 100px auto; align-items: end; gap: 10px; }
.field.compact { margin: 0; }
.new-key { margin-top: 17px; border: 1px solid #9ed7c4; background: var(--green-soft); padding: 14px 16px; border-radius: 6px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.new-key div { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 7px; }
.new-key span { color: var(--green-dark); font-size: 11px; font-weight: 750; }
.new-key textarea { width: 100%; height: 128px; padding: 9px 10px; border: 1px solid #9ed7c4; border-radius: 5px; background: white; color: var(--ink); font: 750 13px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; resize: vertical; }
.new-key > button { flex: 0 0 auto; }
.table-section { margin-top: 28px; }
.table-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.table-title span { color: var(--muted); font-size: 12px; }
.table-wrap { border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; background: white; }
table { width: 100%; border-collapse: collapse; min-width: 1010px; }
th, td { text-align: left; padding: 15px 17px; border-bottom: 1px solid var(--line); font-size: 12px; }
th { background: #f5f7f8; color: var(--muted); font-size: 10px; text-transform: uppercase; }
th:first-child, td:first-child { width: 44%; }
tbody tr:last-child td { border-bottom: 0; }
.key-cell { min-width: 360px; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.key-cell code { max-width: 100%; padding: 5px 7px; margin-left: -7px; border-radius: 4px; color: var(--ink); font-size: 15px; line-height: 1.45; font-weight: 800; overflow-wrap: anywhere; }
.key-cell code.copyable { cursor: pointer; }
.key-cell code.copyable:hover, .key-cell code.copyable:focus { background: var(--green-soft); box-shadow: inset 0 0 0 1px #9ed7c4; outline: 0; }
.key-cell > span { color: var(--muted); font-size: 12px; }
.credit-cell strong { font-size: 16px; }
.credit-cell span { color: var(--muted); }
.toggle { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; }
.toggle i { width: 32px; height: 18px; background: #bac2c8; border-radius: 10px; position: relative; transition: background .15s; }
.toggle i::after { content: ""; position: absolute; width: 14px; height: 14px; left: 2px; top: 2px; border-radius: 50%; background: white; transition: transform .15s; }
.toggle input:checked + i { background: var(--green); }
.toggle input:checked + i::after { transform: translateX(14px); }
.toggle span { color: var(--muted); }
.adjust { display: flex; gap: 6px; }
.adjust input { width: 74px; height: 34px; border: 1px solid #cfd7dd; border-radius: 5px; padding: 0 8px; }
.adjust button { min-height: 34px; }
.danger-button { min-height: 34px; padding: 0 10px; border: 1px solid #e0b8b8; border-radius: 5px; background: white; color: var(--red); font-size: 11px; font-weight: 750; cursor: pointer; }
.danger-button:hover { background: #faecec; }
.table-empty { text-align: center; color: var(--muted); padding: 50px 20px; font-size: 13px; }

@media (max-width: 850px) {
  .work-grid { grid-template-columns: 1fr; }
  .result-panel { min-height: 500px; }
  .stats-band { grid-template-columns: 1fr 1fr; }
  .stats-band > div:nth-child(2) { border-right: 0; }
  .stats-band > div:nth-child(-n+2) { border-bottom: 1px solid #39434d; }
  .create-band { align-items: stretch; flex-direction: column; }
  .create-band form { grid-template-columns: 1fr 110px 100px auto; }
}
@media (max-width: 560px) {
  .topbar { height: 60px; padding: 0 16px; }
  .workspace, .admin-page main { padding: 32px 15px 55px; }
  .intro h1, .dashboard-head h1 { font-size: 28px; }
  .activity-copy { gap: 18px; }
  .heatmap-head, .heatmap-legend { width: 356px; }
  .activity-grid { grid-template-columns: repeat(18, 16px); grid-template-rows: repeat(4, 16px); gap: 4px; width: 356px; height: 76px; }
  .activity-cell { width: 16px; height: 16px; border-radius: 3px; font-size: 8px; }
  .tool-panel, .result-panel, .login-panel { padding: 21px 17px; }
  .method-grid { grid-template-columns: 1fr; }
  .result-panel { min-height: 470px; }
  .dashboard-head { align-items: flex-start; }
  .stats-band > div { padding: 18px; }
  .create-band form { grid-template-columns: 1fr; }
  .new-key { align-items: stretch; flex-direction: column; }
  footer { padding: 0 16px; }
}
