:root {
  --navy: #07111f;
  --navy-2: #10223d;
  --blue: #2563eb;
  --cyan: #22d3ee;
  --gold: #f6c453;
  --green: #16a34a;
  --ink: #172033;
  --muted: #667085;
  --line: #e4eaf2;
  --surface: #ffffff;
  --bg: #f3f6fa;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
.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; }

.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { height: 70px; padding: 0 max(20px, env(safe-area-inset-left)); color: white; background: var(--navy); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.09); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: white; }
.brand strong, .brand span { display: block; letter-spacing: .06em; }
.brand strong { font-size: 14px; }
.brand span { margin-top: 2px; color: #9fb0c9; font-size: 9px; }
.agent-pill { max-width: 46vw; padding: 8px 11px; border-radius: 999px; background: rgba(255,255,255,.08); color: #dce5f2; display: flex; align-items: center; gap: 7px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,.13); }

main { width: min(1180px, 100%); margin: 0 auto; padding: 30px 22px 90px; flex: 1; }
.hero { padding: 8px 2px 24px; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.hero h1 { margin: 0; color: var(--navy); font-size: clamp(28px, 5vw, 42px); letter-spacing: -.04em; }
.hero > p:last-child { margin: 9px 0 0; color: var(--muted); font-size: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 8px 30px rgba(16,34,61,.05); }
.toolbar { display: grid; grid-template-columns: 150px auto 140px minmax(210px,1fr) auto; gap: 12px; align-items: end; padding: 16px; }
.toolbar label { display: grid; gap: 7px; color: #556070; font-size: 11px; font-weight: 700; }
select, input[type="search"], .register-card input { width: 100%; min-height: 43px; padding: 0 13px; border: 1px solid #d7deea; border-radius: 10px; color: var(--ink); background: white; outline: none; }
select:focus, input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.segment { height: 43px; display: flex; padding: 3px; border-radius: 11px; background: #edf1f7; }
.segment-btn { min-width: 92px; padding: 0 16px; border: 0; border-radius: 8px; color: #667085; background: transparent; font-weight: 800; }
.segment-btn.active { color: white; background: var(--blue); box-shadow: 0 3px 10px rgba(37,99,235,.25); }
.segment-btn.premium.active { color: #412d00; background: var(--gold); box-shadow: 0 3px 10px rgba(246,196,83,.35); }
.check-filter { height: 43px; padding: 0 12px; display: flex !important; align-items: center; gap: 8px !important; border: 1px solid #d7deea; border-radius: 10px; white-space: nowrap; }
.check-filter input { accent-color: var(--blue); }
.summary-row { min-height: 61px; padding: 0 4px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.summary-row > div { display: grid; gap: 3px; }
#summaryLabel { color: var(--navy); font-size: 14px; font-weight: 800; }
#updatedAt { color: #8a94a6; font-size: 11px; }
.count-badge { padding: 7px 11px; border-radius: 999px; color: #1d4ed8; background: #eaf1ff; font-size: 12px; font-weight: 800; white-space: nowrap; }
.state-card { padding: 70px 20px; text-align: center; color: var(--muted); background: white; border: 1px dashed #ccd5e2; border-radius: 16px; }

.user-list { display: grid; gap: 9px; }
.user-card { display: grid; grid-template-columns: minmax(170px,1.4fr) minmax(170px,1fr) 80px 84px 102px; gap: 12px; align-items: center; min-height: 78px; padding: 13px 15px; background: white; border: 1px solid var(--line); border-radius: 14px; transition: .16s ease; }
.user-card:hover { border-color: #c8d5e9; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(16,34,61,.06); }
.user-card.checked { background: #f0fdf4; border-color: #a7e6ba; }
.nickname { min-width: 0; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tiktok-link { min-width: 0; padding: 7px 0; border: 0; color: #1d4ed8; background: transparent; text-align: left; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tiktok-link:hover { text-decoration: underline; }
.league { justify-self: center; padding: 5px 9px; border-radius: 7px; color: #334155; background: #edf2f7; font-size: 12px; font-weight: 800; }
.kind { justify-self: center; color: #64748b; font-size: 12px; font-weight: 700; }
.kind.premium { color: #7a5200; }
.check-btn { padding: 9px 10px; border: 1px solid #d9e0ea; border-radius: 9px; color: #64748b; background: white; font-size: 12px; font-weight: 800; }
.checked .check-btn { color: white; border-color: var(--green); background: var(--green); }

footer { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; min-height: 52px; padding: 8px max(18px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); display: flex; align-items: center; justify-content: space-between; gap: 14px; color: #7a8597; background: rgba(243,246,250,.92); border-top: 1px solid rgba(214,222,234,.9); backdrop-filter: blur(14px); font-size: 11px; }
.quiet-btn { padding: 7px 10px; border: 1px solid #d9e0ea; border-radius: 8px; color: #667085; background: #fff; font-size: 11px; white-space: nowrap; }
.modal { position: fixed; z-index: 100; inset: 0; padding: 24px; display: grid; place-items: center; background: rgba(5,13,25,.72); backdrop-filter: blur(10px); }
.register-card { width: min(420px, 100%); padding: 30px; border-radius: 22px; background: white; box-shadow: 0 24px 80px rgba(0,0,0,.24); }
.register-card > img { width: 62px; height: 62px; margin-bottom: 18px; border: 1px solid #e1e6ed; border-radius: 15px; object-fit: cover; }
.register-card h2 { margin: 0; color: var(--navy); font-size: 28px; letter-spacing: -.04em; }
.register-card > p:not(.eyebrow) { margin: 9px 0 23px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.register-card label { display: grid; gap: 7px; margin-top: 14px; color: #475467; font-size: 12px; font-weight: 800; }
.register-card button { width: 100%; height: 48px; margin-top: 22px; border: 0; border-radius: 11px; color: white; background: var(--blue); font-weight: 800; }
.register-card button:disabled { opacity: .6; cursor: wait; }
.form-error { display: block; min-height: 18px; margin-top: 10px; color: #dc2626; font-size: 12px; text-align: center; }
.toast { position: fixed; z-index: 120; left: 50%; bottom: 72px; padding: 10px 15px; border-radius: 9px; color: white; background: var(--navy); box-shadow: 0 8px 30px rgba(0,0,0,.2); font-size: 12px; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 840px) {
  main { padding: 22px 14px 86px; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .segment { grid-column: 1 / -1; grid-row: 1; }
  .segment-btn { flex: 1; }
  .search-wrap { grid-column: 1 / -1; }
  .user-card { grid-template-columns: minmax(0,1fr) auto; gap: 7px 12px; padding: 14px; }
  .nickname { grid-column: 1; }
  .league { grid-column: 2; grid-row: 1; }
  .tiktok-link { grid-column: 1; grid-row: 2; }
  .kind { grid-column: 2; grid-row: 2; }
  .check-btn { grid-column: 1 / -1; grid-row: 3; width: 100%; }
}

@media (max-width: 520px) {
  .topbar { height: 62px; padding-inline: 14px; }
  .brand img { width: 34px; height: 34px; }
  .hero { padding-top: 4px; }
  .hero h1 { font-size: 30px; }
  .hero > p:last-child { line-height: 1.5; }
  .toolbar { padding: 13px; gap: 10px; }
  .check-filter { justify-content: center; }
  footer span { max-width: 72%; line-height: 1.35; }
  .register-card { padding: 25px 21px; }
}
