/* DEADLINE: CAMPUS admin — neutral light/dark admin look, no external fonts. */
:root {
  --bg: #f4f5f7; --panel: #ffffff; --panel2: #f8f9fb; --line: #e2e5ea; --line2: #cfd4dc;
  --text: #1c2027; --muted: #6a7280; --accent: #2f6fde; --accent-2: #e8f0fd; --accent-text: #fff;
  --ok: #1f9d55; --ok-bg: #e6f6ec; --warn: #b7791f; --warn-bg: #fdf4e3; --err: #d23f3f; --err-bg: #fdecec;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --radius: 10px; --side: 210px;
  /* charts (stats page): categorical slots 1-2 + a sequential blue ramp for the retention cells */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s0: #a3a9b3; --gridline: #e8e9ec; --axisline: #c9ced6;
  /* rarity badges (UR gold · SSR violet · SR blue · R gray) */
  --ur-bg: #fbecc4; --ur-ink: #7a4f00; --ssr-bg: #ece4fd; --ssr-ink: #5b33b5; --sr-bg: #deecfc; --sr-ink: #1b56a0; --r-bg: #eef0f3; --r-ink: #5b6370;
  --rc0: #eef4fd; --rc1: #cde2fb; --rc2: #9ec5f4; --rc3: #6da7ec; --rc4: #3987e5; --rc5: #1c5cab; --rc-ink: #0b0b0b; --rc-ink3: #0b0b0b; --rc-ink-strong: #fff;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111418; --panel: #1a1e24; --panel2: #20252c; --line: #2b313a; --line2: #3a414c;
    --text: #e6e9ee; --muted: #9aa3b0; --accent: #5b93f5; --accent-2: #1f2b40; --accent-text: #fff;
    --ok: #4cc38a; --ok-bg: #16291f; --warn: #e0a84a; --warn-bg: #2d2416; --err: #f07070; --err-bg: #331b1d;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s0: #5d6572; --gridline: #262b33; --axisline: #3a414c;
    --ur-bg: #3b2e10; --ur-ink: #f2c75c; --ssr-bg: #2c2346; --ssr-ink: #bba5f7; --sr-bg: #16293f; --sr-ink: #80b4f0; --r-bg: #262b33; --r-ink: #aab2bf;
    --rc0: #1c2330; --rc1: #1b2f4d; --rc2: #184f95; --rc3: #1c5cab; --rc4: #2a78d6; --rc5: #5598e7; --rc-ink: #e6e9ee; --rc-ink3: #fff; --rc-ink-strong: #fff;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111418; --panel: #1a1e24; --panel2: #20252c; --line: #2b313a; --line2: #3a414c;
  --text: #e6e9ee; --muted: #9aa3b0; --accent: #5b93f5; --accent-2: #1f2b40; --accent-text: #fff;
  --ok: #4cc38a; --ok-bg: #16291f; --warn: #e0a84a; --warn-bg: #2d2416; --err: #f07070; --err-bg: #331b1d;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s0: #5d6572; --gridline: #262b33; --axisline: #3a414c;
  --ur-bg: #3b2e10; --ur-ink: #f2c75c; --ssr-bg: #2c2346; --ssr-ink: #bba5f7; --sr-bg: #16293f; --sr-ink: #80b4f0; --r-bg: #262b33; --r-ink: #aab2bf;
  --rc0: #1c2330; --rc1: #1b2f4d; --rc2: #184f95; --rc3: #1c5cab; --rc4: #2a78d6; --rc5: #5598e7; --rc-ink: #e6e9ee; --rc-ink3: #fff; --rc-ink-strong: #fff;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
h1 { font-size: 20px; } h2 { font-size: 17px; } h3 { font-size: 15px; } h4 { font-size: 14px; }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
pre { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow: auto; max-height: 60vh; margin: 0; white-space: pre-wrap; word-break: break-all; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.gap16 > * + * { margin-top: 16px; }

/* ---------- layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; height: 56px; display: flex; align-items: center; gap: 12px;
  padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; letter-spacing: .2px; white-space: nowrap; }
.brand small { font-weight: 500; color: var(--muted); margin-left: 6px; }
.topbar .spacer { flex: 1; }
.savestate { font-size: 12px; color: var(--muted); white-space: nowrap; }
.savestate.err { color: var(--err); }
.layout { display: flex; min-height: calc(100vh - 56px); }
.side {
  width: var(--side); flex: 0 0 var(--side); background: var(--panel); border-right: 1px solid var(--line);
  padding: 12px 8px; position: sticky; top: 56px; height: calc(100vh - 56px); overflow: auto;
}
.side a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--text);
  font-weight: 600; text-decoration: none; margin-bottom: 2px;
}
.side a img { width: 22px; height: 22px; }
.side a:hover { background: var(--panel2); }
.side a.active { background: var(--accent-2); color: var(--accent); }
.side .count { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 500; }
.side .navsep { font-size: 11px; font-weight: 700; color: var(--muted); padding: 14px 12px 4px; letter-spacing: .3px; }
main { flex: 1; min-width: 0; padding: 20px 24px 80px; max-width: 1180px; }
.pagehead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.pagehead h1 { flex: 1; min-width: 200px; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 4px; }

@media (max-width: 860px) {
  .topbar { padding: 0 10px; gap: 8px; }
  .brand small { display: none; }
  .layout { display: block; }
  .side {
    position: sticky; top: 56px; z-index: 15; width: auto; height: auto; display: flex; overflow-x: auto;
    padding: 6px 8px; border-right: 0; border-bottom: 1px solid var(--line); gap: 4px;
  }
  .side a { flex: 0 0 auto; margin: 0; padding: 7px 10px; font-size: 13px; }
  .side a img { width: 18px; height: 18px; }
  .side .count { display: none; }
  .side .navsep { display: none; }
  main { padding: 14px 12px 80px; }
  .hide-sm { display: none !important; }
}

/* ---------- cards ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card > .card-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.card > .card-h h2, .card > .card-h h3 { flex: 1; }
.card > .card-b { padding: 16px; }
.card.collapsed > .card-b { display: none; }
.card.collapsed > .card-h { border-bottom: 0; }
.card.off > .card-h { opacity: .75; }
.card-h.clickable { cursor: pointer; user-select: none; }
.chev { width: 18px; text-align: center; color: var(--muted); transition: transform .15s; }
.card.collapsed .chev { transform: rotate(-90deg); }
.modicon { width: 26px; height: 26px; }
.grid { display: grid; gap: 12px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.c5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid.top { align-items: start; }
@media (max-width: 1100px) { .grid.c5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) { .grid.c2, .grid.c3 { grid-template-columns: minmax(0, 1fr); } .grid.c4, .grid.c5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { padding: 14px 16px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 22px; font-weight: 800; margin-top: 2px; }
.stat .s { font-size: 12px; color: var(--muted); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label { font-size: 12.5px; font-weight: 700; color: var(--text); }
.field > .help { font-size: 12px; color: var(--muted); }
.field > .help.warn { color: var(--warn); }
input[type=text], input[type=number], input[type=date], input[type=time], input[type=password], input[type=search], select, textarea {
  width: 100%; min-width: 0; padding: 8px 10px; border: 1px solid var(--line2); border-radius: 8px;
  background: var(--panel); color: var(--text); font: inherit; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-2); }
input[readonly] { background: var(--panel2); color: var(--muted); }
input[type=number] { text-align: right; }
input[type=color] { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--line2); border-radius: 8px; background: var(--panel); }
textarea { min-height: 80px; resize: vertical; }
select { padding-right: 26px; }
.inline { display: flex; gap: 6px; align-items: center; min-width: 0; }
.inline > * { min-width: 0; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px;
  border-radius: 8px; border: 1px solid var(--line2); background: var(--panel); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none;
}
button:hover, .btn:hover { background: var(--panel2); text-decoration: none; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.primary:hover { filter: brightness(1.07); background: var(--accent); }
button.danger { color: var(--err); border-color: var(--err); background: transparent; }
button.danger.solid { background: var(--err); color: #fff; }
button.ghost { border-color: transparent; background: transparent; }
button.ghost:hover { background: var(--panel2); }
button.sm, .btn.sm { padding: 4px 9px; font-size: 12.5px; }
button.icon { padding: 4px 7px; min-width: 30px; }
button.big { padding: 14px 26px; font-size: 17px; border-radius: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: var(--panel); }
.seg button + button { border-left: 1px solid var(--line2); }
.seg button.on { background: var(--accent); color: var(--accent-text); }

/* switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-weight: 600; font-size: 13px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 40px; height: 22px; border-radius: 11px; background: var(--line2); position: relative; transition: background .15s; flex: 0 0 auto; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { left: 21px; }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--accent-2); }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--panel2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.live { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.upcoming { background: var(--accent-2); color: var(--accent); border-color: transparent; }
.badge.ended { background: var(--panel2); color: var(--muted); }
.badge.err { background: var(--err-bg); color: var(--err); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.chip { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 11.5px; background: var(--panel2); border: 1px solid var(--line); margin: 1px 2px 1px 0; }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.num { text-align: right; white-space: nowrap; }
table.t td.idx { color: var(--muted); font-weight: 700; white-space: nowrap; width: 1%; }
table.t td.act { white-space: nowrap; width: 1%; text-align: right; }
table.t tr.clickrow { cursor: pointer; }
table.t tr.clickrow:hover td { background: var(--panel2); }
.tfoot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 10px; }
input.w60, select.w60 { width: 64px; } input.w80, select.w80 { width: 88px; } input.w100, select.w100 { width: 108px; } input.w120, select.w120 { width: 124px; }
@media (max-width: 720px) {
  table.t.cards thead { display: none; }
  table.t.cards, table.t.cards tbody, table.t.cards tr, table.t.cards td { display: block; width: 100%; }
  table.t.cards tr { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; padding: 6px; }
  table.t.cards td { border: 0; padding: 4px 4px; text-align: left; }
  table.t.cards td[data-label]::before { content: attr(data-label); display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
  table.t.cards td.act { text-align: left; width: auto; }
  table.t.cards td.idx { width: auto; }
  input.w60, input.w80, input.w100, input.w120, select.w60, select.w80, select.w100, select.w120 { width: 100%; }
}

/* reward editor */
.reward { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-width: 260px; }
.reward img.ri { width: 24px; height: 24px; flex: 0 0 auto; }
.reward select.rt { width: 170px; flex: 0 0 auto; }
.reward input.ra { width: 96px; flex: 0 0 auto; }
.reward .rx { flex: 1 1 160px; min-width: 140px; }
@media (max-width: 720px) { .reward { min-width: 0; } .reward select.rt { flex: 1 1 120px; } }

/* issues */
.issues { border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.issues.has-err { background: var(--err-bg); }
.issues.has-warn { background: var(--warn-bg); }
.issues.clean { background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.issues ul { margin: 6px 0 0; padding-left: 0; list-style: none; }
.issues li { margin: 3px 0; display: flex; gap: 6px; align-items: baseline; }
.issues li .lv { flex: 0 0 auto; font-weight: 800; font-size: 11px; padding: 0 6px; border-radius: 4px; }
.issues li .lv.error { background: var(--err); color: #fff; }
.issues li .lv.warn { background: var(--warn); color: #fff; }
.issues .more { margin-top: 6px; }

/* key picker */
.keypick { display: flex; flex-direction: column; gap: 6px; }
.keyprev { display: flex; align-items: center; gap: 10px; min-height: 20px; }
.keyprev img { max-height: 90px; max-width: 200px; border-radius: 6px; border: 1px solid var(--line); background: repeating-conic-gradient(var(--panel2) 0% 25%, var(--panel) 0% 50%) 50% / 16px 16px; }

/* assets */
.agrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.acard { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.acard .thumb { height: 130px; display: flex; align-items: center; justify-content: center; background: repeating-conic-gradient(var(--panel2) 0% 25%, var(--panel) 0% 50%) 50% / 16px 16px; border-bottom: 1px solid var(--line); }
.acard .thumb img { max-width: 100%; max-height: 130px; }
.acard .meta { padding: 8px 10px; font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.acard .key { font-family: ui-monospace, Menlo, monospace; font-size: 12px; word-break: break-all; text-align: left; justify-content: flex-start; white-space: normal; padding: 3px 6px; }
.acard.pending { opacity: .6; }
.acard.selectable { cursor: pointer; }
.acard.selectable:hover { border-color: var(--accent); }
.dropzone { border: 2px dashed var(--line2); border-radius: 10px; padding: 16px; text-align: center; color: var(--muted); }
.dropzone.over { border-color: var(--accent); background: var(--accent-2); }
.uploadprev { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.uploadprev img { max-height: 120px; max-width: 220px; border-radius: 6px; border: 1px solid var(--line); }

/* modal */
.backdrop { position: fixed; inset: 0; background: rgba(10, 12, 16, .55); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 12px 12px; overflow: auto; }
.modal { background: var(--panel); color: var(--text); border-radius: 12px; width: 100%; max-width: 620px; box-shadow: 0 20px 50px rgba(0,0,0,.3); border: 1px solid var(--line); }
.modal.wide { max-width: 980px; }
.modal-h { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal-h h3 { flex: 1; }
.modal-b { padding: 16px 18px; max-height: 70vh; overflow: auto; }
.modal-f { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* toast */
#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #1c2027; color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 90vw; }
.toast { border: 1px solid rgba(255,255,255,.12); }
.toast.act { display: flex; align-items: center; gap: 12px; pointer-events: auto; padding: 8px 8px 8px 16px; }
.toast .toastbtn { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.35); }
.toast .toastbtn:hover { background: rgba(255,255,255,.25); }
.toast.err { background: var(--err); }
.toast.ok { background: var(--ok); }

/* diff */
.diff h4 { margin: 12px 0 4px; }
.diff ul { margin: 0; padding-left: 18px; }
.diff .add { color: var(--ok); } .diff .del { color: var(--err); } .diff .chg { color: var(--warn); }

/* dashboard */
.publishbox { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px; }
.publishbox .grow p { margin: 4px 0 0; }
.evlist { list-style: none; margin: 0; padding: 0; }
.evlist li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.evlist li:last-child { border-bottom: 0; }
.swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line2); flex: 0 0 auto; display: inline-block; }
.empty { padding: 20px; text-align: center; color: var(--muted); }

/* login */
.loginwrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.loginbox { width: 100%; max-width: 360px; padding: 28px; }
.loginbox h1 { font-size: 20px; margin-bottom: 4px; }
.loginbox .err { color: var(--err); font-size: 13px; min-height: 20px; margin-top: 8px; }
.loginbox button { width: 100%; margin-top: 8px; }
img.ri { width: 24px; height: 24px; flex: 0 0 auto; }
.field > .seg, .field > .inline > .seg { align-self: flex-start; }
.agrid > .empty { grid-column: 1 / -1; }

/* ---------- 통계 (stats dashboard) ---------- */
.intro { margin: -6px 0 14px; }
.kpi .v { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.kpi .s { margin-top: 4px; line-height: 1.4; }
.kpi .s.strong { color: var(--text); font-weight: 600; }
.delta { font-size: 12px; font-weight: 700; white-space: nowrap; }
.delta.up { color: var(--ok); } .delta.down { color: var(--err); }
.delta .muted { font-weight: 500; }
.mini .kpi { box-shadow: none; background: var(--panel2); }
.mini .kpi .v { font-size: 18px; }
.emptystate { padding: 48px 20px; text-align: center; }
.emptystate .big { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.key { display: inline-block; width: 14px; height: 3px; border-radius: 2px; background: var(--s1); flex: 0 0 auto; }
.key.s2 { background: var(--s2); }
.chart { position: relative; width: 100%; min-height: 240px; }
.chart svg { display: block; touch-action: pan-y; }
.lc .grid { stroke: var(--gridline); stroke-width: 1; }
.lc .axis { stroke: var(--axisline); stroke-width: 1; }
.lc .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.lc .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; stroke: var(--s1); }
.lc .ln.s2 { stroke: var(--s2); }
.lc .area { fill: var(--s1); opacity: .1; stroke: none; }
.lc .dot { fill: var(--s1); stroke: var(--panel); stroke-width: 2; }
.lc .dot.s2 { fill: var(--s2); }
.lc .cross { stroke: var(--axisline); stroke-width: 1; }
.lc .hidden { display: none; }
.lc .hit { fill: transparent; cursor: crosshair; }
.charttip { position: absolute; top: 8px; z-index: 2; background: var(--panel); border: 1px solid var(--line2); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; box-shadow: 0 6px 18px rgba(0,0,0,.12); pointer-events: none; min-width: 170px; }
.charttip .tt-h { font-weight: 700; margin-bottom: 4px; }
.charttip .tt-r { display: flex; align-items: center; gap: 6px; }
.charttip .tt-r strong { margin-left: auto; padding-left: 12px; font-variant-numeric: tabular-nums; }
details.daily { margin-top: 12px; }
details.daily summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 13px; }
table.t.dense td, table.t.dense th { padding: 4px 8px; font-size: 12.5px; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) 168px; align-items: center; gap: 10px; font-size: 12.5px; }
.bars.compact .bar-row { grid-template-columns: 120px minmax(0, 1fr) 100px; }
.bar-l { color: var(--muted); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-t { height: 14px; background: var(--panel2); border-radius: 0 4px 4px 0; }
.bar-f { height: 100%; background: var(--s1); border-radius: 0 4px 4px 0; }
.bar-v { white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar-x { color: var(--muted); margin-left: 8px; font-size: 11.5px; }
.bar-row.hi .bar-l { color: var(--text); }
.bar-row.hi .bar-x { color: var(--warn); font-weight: 700; }
.bar-row.hi .bar-x::before { content: "⚠ "; }
table.t.ret td, table.t.ret th { padding: 5px 8px; font-size: 12.5px; }
table.t.ret td.rc { text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; border-bottom: 2px solid var(--panel); border-left: 2px solid var(--panel); min-width: 54px; }
table.t.ret tr.avg td { border-bottom: 1px solid var(--line2); }
.rc0 { background: var(--rc0); color: var(--rc-ink); } .rc1 { background: var(--rc1); color: var(--rc-ink); } .rc2 { background: var(--rc2); color: var(--rc-ink); }
.rc3 { background: var(--rc3); color: var(--rc-ink3); } .rc4 { background: var(--rc4); color: var(--rc-ink-strong); } .rc5 { background: var(--rc5); color: var(--rc-ink-strong); }
.rc-na { color: var(--muted); background: transparent; font-weight: 500 !important; }
.retwrap { max-height: 420px; overflow: auto; }
ul.explain { list-style: none; padding: 0; margin: 12px 0 0; font-size: 12.5px; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 2px 14px; }
ul.explain strong { font-weight: 700; }
.opsmini { margin-top: 16px; }
.opsrow { gap: 8px 22px; font-size: 13px; }
@media (max-width: 720px) {
  .bar-row { grid-template-columns: 40px minmax(0, 1fr) 132px; gap: 8px; }
  table.t.ret td, table.t.ret th { padding: 4px 4px; font-size: 12px; }
  table.t.ret td.rc { min-width: 40px; }
  .bars.compact .bar-row { grid-template-columns: 92px minmax(0, 1fr) 84px; }
  .kpi .v { font-size: 19px; }
  table.t.cards td.num { text-align: left; }
}
@media (max-width: 860px) { .grid.c5 > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; } }
#btnUndo { font-size: 13px; }

/* ---------- 편집 기록 ---------- */
table.t tr.current td { background: var(--ok-bg); }

/* ---------- 공지 (notice editor + game popup preview) ---------- */
textarea.tall { min-height: 220px; }
.noticegrid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.np-side { position: sticky; top: 72px; }
@media (max-width: 1100px) { .noticegrid { grid-template-columns: minmax(0, 1fr); } .np-side { position: static; } }
.np-phone { background: #2a2f3a; border-radius: 18px; padding: 10px; }
.np-dim { background: rgba(0, 0, 0, .45); border-radius: 12px; padding: 22px 14px; min-height: 260px; display: flex; align-items: center; }
.np-modal { background: #fffaf3; color: #2b2622; border-radius: 14px; width: 100%; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.35); padding-bottom: 14px; }
.np-title { font-weight: 800; font-size: 15px; text-align: center; padding: 12px 12px 10px; }
.np-banner { aspect-ratio: 16 / 9; margin: 0 12px 10px; border-radius: 10px; overflow: hidden; background: #e9e2d8; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #8a7f72; }
.np-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.np-banner.ph { border: 2px dashed #d3c8b8; }
.np-body { white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.55; padding: 0 16px; max-height: 240px; overflow: auto; }
.np-btn { margin: 14px auto 0; width: 70%; text-align: center; background: #ff7a59; color: #fff; font-weight: 800; border-radius: 12px; padding: 9px 0; }
.np-link { text-align: center; color: #8a7f72; margin-top: 6px; }
.np-board { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.np-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.np-item:last-child { border-bottom: 0; }
.np-item.me { background: var(--accent-2); }
.np-tag { font-size: 11px; font-weight: 800; color: #fff; background: #50afe6; border-radius: 6px; padding: 1px 7px; flex: 0 0 auto; }
.np-tag.pin { background: #e2557f; }

/* menu items moved into the app build */
.side a[hidden] { display: none; }

/* ---------- 현황 (캐릭터 · 뽑기 · 유저 · 랭킹 · 스테이지) ---------- */
.rar { display: inline-block; min-width: 34px; text-align: center; padding: 0 6px; border-radius: 6px; font-size: 11px; font-weight: 800; letter-spacing: .3px; line-height: 18px; background: var(--r-bg); color: var(--r-ink); vertical-align: 1px; }
.rar.r-ur { background: var(--ur-bg); color: var(--ur-ink); }
.rar.r-ssr { background: var(--ssr-bg); color: var(--ssr-ink); }
.rar.r-sr { background: var(--sr-bg); color: var(--sr-ink); }
.hname { white-space: nowrap; }
.toolbar { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar select { width: auto; min-width: 140px; }
.toolbar.scrollx { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
.searchbox { flex: 1 1 260px; max-width: 360px; }
table.t.data th { padding: 0; }
table.t.data th:not(:has(button)) { padding: 6px 8px; }
table.t.data th .th-sort { width: 100%; justify-content: flex-start; gap: 4px; border: 0; border-radius: 0; background: transparent; padding: 6px 8px; font-size: 12px; color: var(--muted); font-weight: 700; }
table.t.data th.num .th-sort { justify-content: flex-end; }
table.t.data th .th-sort:hover { color: var(--text); background: var(--panel2); }
table.t.data th.sorted .th-sort { color: var(--accent); }
table.t.data th .arrow { font-size: 10px; opacity: .55; }
table.t.data th.sorted .arrow { opacity: 1; }
table.t.data td { white-space: nowrap; }
table.t.data tr.hi td { background: var(--warn-bg); }
table.t.data tr.hi:hover td { background: var(--warn-bg); filter: brightness(.98); }
table.t.data .badge { margin-left: 6px; }
.pcell { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 64px; }
.pbar { width: 64px; height: 4px; border-radius: 2px; background: var(--panel2); overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--s1); border-radius: 0 2px 2px 0; }
ol.rank5 { margin: 0; padding: 0; list-style: none; counter-reset: rk; }
ol.rank5 li { counter-increment: rk; display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; flex-wrap: wrap; }
ol.rank5 li:last-child { border-bottom: 0; }
ol.rank5 li::before { content: counter(rk); width: 20px; height: 20px; border-radius: 50%; background: var(--panel2); color: var(--muted); font-weight: 800; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
ol.rank5 .num { font-weight: 700; font-variant-numeric: tabular-nums; }
.key.sq { width: 10px; height: 10px; border-radius: 2px; }
.key.s3 { background: var(--s3); } .key.s0 { background: var(--s0); }
.sb .sbr { stroke: var(--panel); stroke-width: 1; }
.sb .sbr.s1 { fill: var(--s1); } .sb .sbr.s2 { fill: var(--s2); } .sb .sbr.s3 { fill: var(--s3); } .sb .sbr.s0 { fill: var(--s0); }
.sb .colhi { fill: var(--panel2); }
.charttip .tt-sum { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.ratebox { border: 1px solid var(--line); border-radius: 8px; padding: 10px 10px 6px; min-width: 0; }
.ratebox > .row { margin-bottom: 6px; }
table.t.rates td { padding: 4px 6px; }
table.t.rates td .small { font-size: 11px; line-height: 1.2; }
.vd { display: inline-block; font-size: 12px; font-weight: 700; white-space: nowrap; }
.vd.ok { color: var(--ok); } .vd.warn { color: var(--warn); } .vd.err { color: var(--err); }
td.d-ok { color: var(--text); } td.d-warn { color: var(--warn); font-weight: 700; } td.d-err { color: var(--err); font-weight: 700; }
.note { border-radius: 6px; padding: 6px 8px; margin-top: 8px; }
.note.warn { background: var(--warn-bg); color: var(--warn); }
.bars.names .bar-row { grid-template-columns: 150px minmax(0, 1fr) 72px; }
.bars.names .bar-l { color: var(--text); font-weight: 600; }
.pager { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-top: 12px; }
.sumwrap .sechead { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 4px 0 8px; }
.sumtile { color: var(--text); text-decoration: none; display: block; transition: border-color .12s; }
.sumtile:hover { border-color: var(--accent); text-decoration: none; }
.sumtile .k { display: flex; justify-content: space-between; }
.sumtile .go { color: var(--accent); font-weight: 800; }
.sumtile .v { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userhead { padding: 14px 16px; }
.userhead h2 { font-size: 19px; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.kv > div:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chip.hero { padding: 2px 8px 2px 3px; font-size: 12px; display: inline-flex; align-items: center; gap: 2px; }
.tl { max-height: 560px; overflow: auto; font-size: 13px; }
.tl-day { position: sticky; top: 0; background: var(--panel); font-size: 12px; font-weight: 800; color: var(--muted); padding: 8px 0 4px; border-bottom: 1px solid var(--line); z-index: 1; }
.tl-row { display: grid; grid-template-columns: 44px 12px minmax(0, 1fr); gap: 6px; align-items: baseline; padding: 4px 0; }
.tl-t { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.tl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line2); align-self: center; }
.tl-x { overflow-wrap: anywhere; }
.tl-row.pull .tl-dot { background: var(--s2); } .tl-row.buy .tl-dot { background: var(--ok); } .tl-row.stage .tl-dot { background: var(--s1); } .tl-row.prog .tl-dot { background: var(--s3); }
.tl-row.buy .tl-x { font-weight: 700; }
.scrolly { max-height: 560px; overflow: auto; }
table.t.rank tr.top3 .rk { background: var(--ur-bg); color: var(--ur-ink); }
.rk { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px; padding: 0 5px; border-radius: 11px; background: var(--panel2); font-weight: 800; font-size: 12px; }
textarea.uids { min-height: 96px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
@media (max-width: 720px) {
  .bars.names .bar-row { grid-template-columns: 118px minmax(0, 1fr) 64px; }
  .searchbox { max-width: none; }
  .toolbar select { flex: 1 1 140px; }
  .sumtile .v { font-size: 16px; }
}
textarea.uids { max-width: 560px; }
