:root { --bg: #f4f5f7; --card: #fff; --line: #d9dde3; --ink: #1c2330; --sub: #5b6676; --pri: #0f5fa8; --plus: #0d6b2c; --minus: #b3261e; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 "Malgun Gothic", "Apple SD Gothic Neo", sans-serif; }
header { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 10px 16px; background: #14202e; color: #fff; }
header h1 { margin: 0; font-size: 17px; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav button { border: 0; background: transparent; color: #b9c6d6; padding: 8px 12px; border-radius: 6px; font: inherit; cursor: pointer; }
nav button.on { background: #24384f; color: #fff; font-weight: 700; }
#who { margin-left: auto; color: #b9c6d6; font-size: 13px; }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.cards { margin-bottom: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.card small { display: block; color: var(--sub); }
.card b { font-size: 21px; font-variant-numeric: tabular-nums; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; overflow-x: auto; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
input, select { height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; min-width: 0; }
button.act { height: 36px; padding: 0 14px; border: 0; border-radius: 6px; background: var(--pri); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
button.act.gray { background: #6b7686; }
button.act.red { background: var(--minus); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th { color: var(--sub); font-weight: 700; background: #fafbfc; }
th:first-child, td:first-child, td.l, th.l { text-align: left; }
tr.pick { cursor: pointer; }
tr.pick:hover { background: #eef4fb; }
.plus { color: var(--plus); font-weight: 700; }
.minus { color: var(--minus); font-weight: 700; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 12px; background: #e6ebf1; }
.tag.on { background: #d8f0de; color: var(--plus); }
.tag.bad { background: #fbe1df; color: var(--minus); }
#msg { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #14202e; color: #fff; padding: 10px 18px; border-radius: 8px; max-width: 90vw; }
pre { white-space: pre-wrap; word-break: break-all; font: 12px/1.5 Consolas, monospace; background: #f7f8fa; padding: 10px; border-radius: 6px; max-height: 320px; overflow: auto; }
h3 { margin: 0 0 10px; font-size: 15px; }
.hintline { color: var(--sub); font-size: 13px; }
.lbl { min-width: 150px; font-weight: 700; }
.tablewrap { overflow-x: auto; }
.tag.wait { background: #fff1cf; color: #8a5a00; }
button.act.small { height: 28px; padding: 0 10px; font-size: 13px; }
button.act:disabled { opacity: .55; cursor: default; }
.linkbtn { border: 1px solid #44566d; background: transparent; color: #d5deea; border-radius: 6px; padding: 5px 10px; font: inherit; font-size: 13px; cursor: pointer; margin-left: 10px; }
.linkbtn:hover { background: #24384f; }
.loginbox { max-width: 360px; margin: 48px auto; display: grid; gap: 10px; }
.loginbox input, .loginbox button { width: 100%; height: 42px; }
.card.main { border-color: var(--pri); background: #eef5fc; }
.steps { margin: 0; padding-left: 20px; color: var(--sub); }
.steps li { margin: 4px 0; }
.pagetitle { margin: 0 0 14px; font-size: 19px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.pagetitle small { font-size: 13px; font-weight: 400; color: var(--sub); }
.notice p { margin: 8px 0 0; white-space: pre-wrap; }
.formbox .row { align-items: center; }
textarea { width: 100%; min-height: 110px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid var(--pri); outline-offset: 1px; }

/* 아바타 설정의 작은 그림 */
.avthumb { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; display: block; box-shadow: 0 0 0 1.5px #c9a24a; background: #1d1436; }

/* 쿠폰 번호 */
.cpcode { font: 700 13px/1.4 Consolas, "Courier New", monospace; letter-spacing: .06em; user-select: all; }

/* 수수료 요율 표 (게임별) */
table.rates { width: auto; min-width: 360px; margin-top: 4px; }
table.rates td:first-child { font-weight: 700; }
table.rates input { height: 32px; }
.wrapcell { display: inline-block; white-space: normal; max-width: 210px; line-height: 1.45; }
.card b.small { font-size: 14px; line-height: 1.5; display: block; margin-top: 4px; }

/* 금액별 채널 설정 표 */
table.chan td { white-space: normal; vertical-align: middle; }
table.chan td:first-child { font-weight: 700; white-space: nowrap; }
table.chan td.nw { white-space: nowrap; }
.seedpick { display: flex; flex-wrap: wrap; gap: 4px 6px; min-width: 300px; }
.seedpick label { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 14px; font-size: 12px; cursor: pointer; font-variant-numeric: tabular-nums; }
.seedpick label:has(input:checked) { border-color: var(--pri); background: #eef5fc; color: var(--pri); font-weight: 700; }
.seedpick input, table.chan input[type="checkbox"] { height: 15px; width: 15px; padding: 0; margin: 0; }

/* ── 움직임: 일하는 화면이라 짧고 조용하게 ── */
.pagetitle, .cards, .box { animation: rise .3s cubic-bezier(.16, 1, .3, 1) backwards; }
#main > :nth-child(2) { animation-delay: .04s; }
#main > :nth-child(3) { animation-delay: .08s; }
#main > :nth-child(n + 4) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.cards .card { animation: rise .35s cubic-bezier(.16, 1, .3, 1) backwards; }
.cards .card:nth-child(2) { animation-delay: .03s; }
.cards .card:nth-child(3) { animation-delay: .06s; }
.cards .card:nth-child(4) { animation-delay: .09s; }
.cards .card:nth-child(n + 5) { animation-delay: .12s; }
#msg:not([hidden]) { animation: msg-in .26s cubic-bezier(.16, 1, .3, 1); }
@keyframes msg-in { from { opacity: 0; transform: translate(-50%, 12px); } }
button.act, .linkbtn, nav button { transition: background-color .14s, filter .14s, transform .12s cubic-bezier(.16, 1, .3, 1); }
button.act:hover { filter: brightness(1.08); }
button.act:active { transform: scale(.97); }
tr.pick { transition: background-color .12s; }
input, select, textarea { transition: border-color .14s, box-shadow .14s; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--pri); box-shadow: 0 0 0 3px rgba(15, 95, 168, .14); outline: 0; }
.tag { transition: background-color .2s, color .2s; }
.loginbox { animation: rise .45s cubic-bezier(.16, 1, .3, 1) backwards; }
#side button { transition: background-color .15s, color .15s, padding-left .2s cubic-bezier(.16, 1, .3, 1); }
#side button.on { padding-left: 27px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* 파트너 화면: 왼쪽 메뉴 + 본문 */
body.console { min-height: 100vh; }
body.console header { position: sticky; top: 0; z-index: 5; }
body.console #who { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; color: #fff; }
body.console #who .bal { color: #ffd98a; font-weight: 700; font-variant-numeric: tabular-nums; }
.layout { display: grid; grid-template-columns: 228px minmax(0, 1fr); align-items: start; }
.layout main { max-width: 1100px; margin: 0; width: 100%; }
#side { position: sticky; top: 52px; align-self: start; height: calc(100vh - 52px); overflow-y: auto; background: #1b2838; padding: 10px 0 24px; }
#side .grp { margin-top: 12px; padding: 6px 16px; font-size: 12px; font-weight: 700; color: #8ea3bb; letter-spacing: .02em; border-top: 1px solid #2a3b50; }
#side button { display: block; width: 100%; text-align: left; border: 0; background: transparent; color: #d5deea; padding: 9px 16px 9px 22px; font: inherit; cursor: pointer; }
#side button:hover { background: #24384f; }
#side button.on { background: var(--pri); color: #fff; font-weight: 700; }
.menubtn { display: none; border: 1px solid #44566d; background: transparent; color: #fff; border-radius: 6px; padding: 6px 12px; font: inherit; cursor: pointer; }
@media (max-width: 820px) {
  .menubtn { display: inline-block; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  #side { display: none; position: static; height: auto; }
  body.menu-open #side { display: block; }
  body.console header h1 { font-size: 15px; }
  .lbl { min-width: 100%; }
  input, select { max-width: 100%; }
}
