/* Staff dashboard (staff.html) - built on the site's colors in style.css */
body.staff { background: var(--bg); min-height: 100vh; }
.staff [hidden] { display: none !important; }

.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate-card { width: min(420px, 100%); display: grid; gap: 16px; text-align: center; padding: 36px 28px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--line); }
.gate-card img { width: 140px; height: auto; margin: 0 auto; }
.gate-card h1 { font-size: 26px; }

.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }

/* ---- the menu on the left: groups with a title, open / closed */
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 14px; padding: 18px 12px 14px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg)); border-right: 1px solid var(--line-soft); overflow-y: auto; z-index: 30;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 2px 10px 6px; text-decoration: none; color: var(--text); }
.side-brand img { width: 64px; height: auto; }
.side-brand span { font: 12px/1 var(--pixel); color: var(--brand); letter-spacing: .08em; padding: 4px 7px; border-radius: 6px; background: color-mix(in srgb, var(--brand) 14%, transparent); }
.side-nav { display: grid; gap: 1px; align-content: start; }
.side-nav a { position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 10px; color: var(--muted);
  text-decoration: none; font-weight: 600; font-size: 14px; transition: background .12s ease, color .12s ease; }
.side-nav a span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-nav a:hover { background: var(--surface); color: var(--text); }
.side-nav a.on { background: color-mix(in srgb, var(--brand) 13%, transparent); color: var(--text); }
.side-nav a.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); }
.side-nav a.on .ico { color: var(--brand); opacity: 1; }
.ico { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav-group { margin-top: 12px; }
.nav-group-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 12px 6px; border: 0; background: none; cursor: pointer;
  color: var(--dim); font: 700 11px/1 var(--sans); text-transform: uppercase; letter-spacing: .1em; }
.nav-group-head span { flex: 1; text-align: left; }
.nav-group-head:hover { color: var(--muted); }
.nav-group-head .chev { width: 14px; height: 14px; transition: transform .15s ease; }
.nav-group.closed .chev { transform: rotate(-90deg); }
.nav-group.closed .nav-group-body { display: none; }
.nav-group:not(.closed) .nav-group-n { display: none; }
.nav-group-body { display: grid; gap: 1px; }
.badge-n { margin-left: auto; min-width: 20px; padding: 2px 7px; border-radius: 999px; background: var(--rose); color: #12050a;
  font-size: 11.5px; text-align: center; line-height: 1.3; }
.side-foot { margin-top: auto; display: grid; gap: 8px; padding: 10px 4px 0; border-top: 1px solid var(--line-soft); }
.side-foot .muted { overflow-wrap: anywhere; }

/* ---- the bar at the top: where you are + refresh / alerts / settings */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; margin: 0 calc(-1 * clamp(16px, 3vw, 40px)) 22px;
  padding: 12px clamp(16px, 3vw, 40px); background: rgba(7, 7, 11, .78); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft); }
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; }
.crumbs span { color: var(--dim); font-weight: 600; }
.crumbs span:empty { display: none; }
.crumbs span:not(:empty)::after { content: "/"; margin-left: 8px; color: var(--line); }
.crumbs b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line-soft);
  background: var(--surface); color: var(--muted); cursor: pointer; transition: color .12s ease, border-color .12s ease, background .12s ease; }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover, .icon-btn[aria-expanded="true"] { color: var(--text); border-color: var(--line); background: var(--surface-2); }
.menu-btn { display: none; }
.side-scrim { display: none; }
.dot-n { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--rose); color: #12050a;
  font-size: 11px; line-height: 18px; text-align: center; border: 2px solid var(--bg); box-sizing: content-box; }
.bell-wrap { position: relative; }
.bell-pop { position: absolute; right: 0; top: 46px; width: min(360px, calc(100vw - 32px)); max-height: 440px; overflow: auto; padding: 10px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 20px 50px rgba(0, 0, 0, .55); z-index: 40; }
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 8px; }
.bell-list { display: grid; gap: 2px; }
.bell-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: 14px; }
.bell-item:hover { background: var(--surface-2); }
.bell-item.unread { background: color-mix(in srgb, var(--brand) 11%, transparent); }
.bell-item .ico { margin-top: 2px; color: var(--brand); }
.bell-item small { display: block; font-size: 12px; }
.bell-empty { padding: 10px 6px; }

.main { padding: 0 clamp(16px, 3vw, 40px) 60px; min-width: 0; }
.view { display: grid; gap: 18px; align-content: start; padding: 0; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.view-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.panel { display: grid; gap: 12px; align-content: start; padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.panel h2 { font-size: 16px; font-weight: 700; display: flex; gap: 8px; align-items: baseline; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.kpi { padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 4px; }
.kpi span { color: var(--muted); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.kpi b { font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi.alert b { color: var(--rose); }
.kpi.good b { color: var(--green); }

.chart svg { width: 100%; height: 160px; display: block; }
.chart .bar { fill: var(--brand); }
.chart .bar:hover { fill: var(--accent-2); }
.chart .axis { fill: var(--dim); font-size: 10px; }
.chart .grid { stroke: var(--line-soft); }
.bars { display: grid; gap: 8px; }
.bars .row { display: grid; grid-template-columns: minmax(80px, 1fr) 2fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.bars .row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .track { height: 8px; border-radius: 4px; background: var(--bg-2); overflow: hidden; }
.bars .track i { display: block; height: 100%; border-radius: 4px; background: var(--grad); }
.bars .row b { font-variant-numeric: tabular-nums; }
.empty { padding: 18px 4px; }

.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line-soft); }
.seg button { border: 0; background: none; color: var(--muted); font: 600 13.5px var(--sans); padding: 7px 14px; border-radius: 8px; cursor: pointer; }
.seg button.on { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }

.list { display: grid; gap: 10px; }
.item { display: grid; gap: 8px; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.item-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.item-top h3 { font-size: 16px; }
.item p { margin: 0; color: #cfcfe0; white-space: pre-wrap; overflow-wrap: anywhere; }
.item .meta { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.item-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.item-actions .input { flex: 1 1 200px; padding: 8px 12px; font-size: 14px; }
.btn-danger { background: transparent; border-color: rgba(251, 113, 133, .5); color: var(--rose); }
.btn-danger:hover { border-color: var(--rose); }

.inbox { display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); gap: 16px; min-height: 520px; }
.inbox-list { display: grid; gap: 6px; align-content: start; max-height: 72vh; overflow: auto; padding-right: 4px; }
.ticket { display: grid; gap: 3px; text-align: left; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-soft);
  color: var(--text); font: inherit; cursor: pointer; }
.ticket:hover { border-color: var(--line); }
.ticket.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.ticket b { font-size: 14.5px; display: flex; gap: 8px; align-items: center; }
.ticket b .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rose); flex: none; }
.ticket span { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-thread { display: grid; grid-template-rows: auto 1fr auto; gap: 12px; padding: 18px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); min-width: 0; }
.thread-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.thread-head h2 { font-size: 18px; }
.msgs { display: grid; gap: 10px; align-content: start; max-height: 52vh; overflow: auto; }
.msg { max-width: 80%; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; }
.msg small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 4px; }
.msg.staff-msg { justify-self: end; background: rgba(0, 154, 254, .16); border: 1px solid rgba(0, 154, 254, .35); }
.reply { display: grid; gap: 8px; }
.reply-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form .wide, .form .form-actions { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 12px; align-items: center; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form .input { flex: 1 1 200px; }

.toast { position: fixed; right: 20px; bottom: 20px; max-width: 360px; padding: 12px 16px; border-radius: 12px; background: var(--surface-2);
  border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); font-size: 14px; z-index: 50; }
.toast.bad { border-color: var(--rose); }

@media (max-width: 1100px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  /* the menu slides in from the left */
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 60px rgba(0, 0, 0, .6); }
  body.menu-open .side { transform: none; }
  .side-scrim { position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, .55); display: none; }
  body.menu-open .side-scrim { display: block; }
  .menu-btn { display: inline-grid; }
  .bell-pop { position: fixed; left: 12px; right: 12px; top: 62px; width: auto; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi b { font-size: 22px; }
  .view-head .player-search { max-width: none; flex: 1 1 100%; }
  .grid-2, .grid-3, .inbox, .form { grid-template-columns: 1fr; }
  .msg { max-width: 92%; }
}

.target-list { display: grid; gap: 6px; margin-top: 10px; }
.target { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line-soft); cursor: pointer; }
.target b { min-width: 60px; }
.target input { accent-color: var(--brand); width: 16px; height: 16px; }
.live-tag { font-style: normal; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; color: #0b2a12; background: var(--green); padding: 2px 6px; border-radius: 6px; }
.form .seg { flex-wrap: wrap; }

/* test payments */
.tp-link { cursor: pointer; align-items: center; justify-content: flex-start; }
.tp-link .meta { margin-left: auto; }
.check-row { display: flex; gap: 10px; align-items: center; color: var(--text); font-size: 14px; }
.check-row input { width: 18px; height: 18px; accent-color: var(--brand); }
#tp-links { margin-top: 14px; }

.rel-to { display: flex; gap: 10px; align-items: center; margin: 6px 0 0; font-size: 16px; }
.target.off { opacity: .7; }
.tp-form { margin-top: 14px; }
.tp-form [hidden] { display: none !important; }

/* players */
.player-search { max-width: 280px; }
.sub-head { margin: 22px 0 10px; font-size: 18px; }
.top-panel h2 { margin-bottom: 10px; }
.top-row { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.top-row .rank { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: var(--surface-2); color: var(--muted); }
.top-row.first .rank { background: var(--brand); color: #fff; }
.top-row .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { color: var(--muted); font-weight: 600; cursor: pointer; user-select: none; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.table th.sorted { color: var(--text); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.small { font-size: 12px; color: var(--muted); }

.req-on { color: #ffb84d; }

/* downloads */
.files-panel h2 { display: flex; gap: 10px; align-items: center; }
.badge-new { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 3px 8px; border-radius: 999px; background: var(--brand); color: #fff; }
.files-grid { display: grid; grid-template-columns: 90px repeat(4, minmax(110px, 1fr)); gap: 8px 10px; align-items: center; overflow-x: auto; }
.files-grid .btn { justify-content: center; }
.files-mc { font-size: 12px; color: var(--muted); font-weight: 600; }
.files-ed { font-size: 14px; }

/* names + pictures */
.side-me { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: 14px; }
.side-me:hover { background: var(--surface); }
.side-me img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; background: #2a2a3a; }
.side-me > span { display: grid; min-width: 0; line-height: 1.3; }
.side-me b, .side-me .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-me .muted { font-size: 11.5px; }
.avatar-sm { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex: none; background: #2a2a3a; }
.avatar-md { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; background: #2a2a3a; }
.ticket-who { display: flex; align-items: center; gap: 8px; }
.thread-who { display: flex; align-items: center; gap: 12px; }
.msg-row { display: flex; gap: 8px; align-items: flex-end; }
.msg-row.staff-row { flex-direction: row-reverse; }
.msg-row .msg { flex: 0 1 auto; }
.profile-form { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: start; }
.profile-pic { display: grid; gap: 8px; justify-items: center; }
.profile-pic img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; background: #2a2a3a; }
.chat-preview { display: grid; gap: 6px; padding: 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
@media (max-width: 640px) { .profile-form { grid-template-columns: 1fr; } }
.msg-row { max-width: 80%; }
.msg-row.staff-row { justify-self: end; }
.msg-row .msg { max-width: none; }

/* affiliates */
.aff-card { display: grid; gap: 14px; }
.aff-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.aff-head h2 { margin: 0; }
.aff-link { display: flex; gap: 8px; align-items: center; }
.aff-link code { padding: 7px 10px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line); font-size: 13px; }
.aff-kpis { margin: 0; }
.kpi-owed b { color: #3ddc84; }
.aff-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.aff-pct { display: flex; gap: 8px; align-items: center; }
.aff-pct-input { width: 90px; }
.aff-sales summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
.aff-sales .item { margin-top: 6px; }
.aff-refunded { opacity: .55; }

/* free codes */
.code-new { margin-top: 16px; padding: 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--brand); }
.code-new-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.code-new pre { margin: 0; font: 600 15px/1.7 ui-monospace, Consolas, monospace; letter-spacing: .04em; white-space: pre-wrap; user-select: all; }
.code-text { font: 600 15px ui-monospace, Consolas, monospace; letter-spacing: .04em; }
.code-item .item-top { align-items: center; }
.code-off { opacity: .5; }
#code-filter { margin: 4px 0 12px; }

/* affiliate link generator */
.aff-gen { border-color: var(--brand); }
.aff-gen-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 140px; gap: 14px; align-items: end; }
.aff-gen-link, .aff-gen-form .form-actions { grid-column: 1 / -1; }
.aff-gen-link { display: grid; gap: 6px; }
.aff-gen-url { display: block; padding: 12px 14px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font-size: 16px; overflow-wrap: anywhere; }
.aff-ok { color: #3ddc84; }
.aff-bad { color: #ff8b8b; }
@media (max-width: 760px) { .aff-gen-form { grid-template-columns: 1fr; } }

.aff-request { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 10px;
  background: rgba(61, 220, 132, .1); border: 1px solid rgba(61, 220, 132, .45); }
.aff-mail-input { width: 240px; }

/* creators */
.cr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.cr-card { display: grid; justify-items: center; gap: 6px; padding: 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); text-align: center; }
.cr-pic { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: #2a2a3a; }
.cr-name { font-weight: 700; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.cr-name:hover { text-decoration: underline; }

/* codes page: filter + "Delete old codes" on one row */
.code-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }


/* ---- nicer surfaces */
.panel, .kpi, .item { transition: border-color .15s ease; }
.panel:hover, .kpi:hover { border-color: color-mix(in srgb, var(--line) 60%, var(--brand) 40%); }
.kpi { position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--grad); opacity: .55; }
.view-head h1 { font-size: 26px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }

/* ---- settings */
.settings { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border-radius: 18px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.settings::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(3px); }
.settings-in { display: grid; gap: 6px; padding: 20px 22px; }
.settings-head { display: flex; align-items: center; justify-content: space-between; }
.settings-head h2 { font-size: 20px; }
.set-sec { display: grid; padding-top: 12px; }
.set-sec h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); margin-bottom: 4px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line-soft); font-size: 14.5px; font-weight: 600; }
.set-row > span:first-child small { display: block; font-weight: 500; font-size: 12px; }
.set-row .select { min-width: 190px; }
.set-row .input { padding: 8px 12px; font-size: 14px; }
.set-inline { display: flex; gap: 8px; align-items: center; }
.set-label { margin: 8px 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.set-checks { display: grid; gap: 8px; padding-bottom: 6px; }
.swatches { display: flex; gap: 8px; }
.swatches button { width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--sw); cursor: pointer; transition: transform .12s ease; }
.swatches button:hover { transform: scale(1.1); }
.swatches button.on { outline: 2px solid var(--text); outline-offset: 3px; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); transition: background .15s ease; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .15s ease, background .15s ease; }
.switch input:checked + i { background: var(--brand); border-color: var(--brand); }
.switch input:checked + i::after { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + i { outline: 2px solid var(--brand); outline-offset: 2px; }
.settings-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; border-top: 1px solid var(--line-soft); margin-top: 6px; }

/* colors */
body.staff[data-accent="purple"] { --brand: #8b5cf6; --accent-1: #7c3aed; --accent-2: #a78bfa; }
body.staff[data-accent="green"] { --brand: #22c55e; --accent-1: #16a34a; --accent-2: #4ade80; }
body.staff[data-accent="orange"] { --brand: #f59e0b; --accent-1: #ea580c; --accent-2: #fbbf24; }
body.staff[data-accent="pink"] { --brand: #ec4899; --accent-1: #db2777; --accent-2: #f472b6; }
body.staff[data-accent="red"] { --brand: #ef4444; --accent-1: #dc2626; --accent-2: #f87171; }
body.staff[data-accent] { --grad: linear-gradient(90deg, var(--accent-1), var(--accent-2)); }

/* spacing + text size */
body.staff[data-density="compact"] .panel { padding: 14px 16px; gap: 9px; }
body.staff[data-density="compact"] .item { padding: 11px 14px; gap: 6px; }
body.staff[data-density="compact"] .kpi { padding: 11px 14px; }
body.staff[data-density="compact"] .kpi b { font-size: 22px; }
body.staff[data-density="compact"] .view { gap: 12px; }
body.staff[data-density="compact"] .side-nav a { padding: 6px 12px; }
body.staff[data-density="compact"] .table th, body.staff[data-density="compact"] .table td { padding: 6px 8px; }
body.staff[data-text="s"] .main { zoom: .92; }
body.staff[data-text="l"] .main { zoom: 1.1; }

/* ---- accounts */
.ac-row { cursor: pointer; }
.ac-row:hover td, .ac-row.open td { background: var(--surface-2); }
.ac-who { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.ac-who > span { display: grid; line-height: 1.3; }
.ac-who small { font-size: 12px; }
.si-chip { display: inline-block; margin-right: 4px; padding: 2px 8px; border-radius: 999px; font: 700 11.5px/1.5 var(--sans); background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.si-google { color: #e8eaed; border-color: #5f6368; }
.si-discord { color: #c9cdfb; border-color: #5865f2; background: rgba(88, 101, 242, .15); }
.ac-detail > td { background: var(--bg-2); white-space: normal; padding: 14px; }
.ac-detail-wrap { position: sticky; left: 14px; }
.ac-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.ac-box { display: grid; gap: 6px; align-content: start; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-soft); }
.ac-box h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); margin-bottom: 2px; }
.ac-kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: 13.5px; padding: 4px 0; border-top: 1px solid var(--line-soft); }
.ac-kv:first-of-type { border-top: 0; }
.ac-kv b { text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.ac-kv small { grid-column: 1 / -1; font-size: 11.5px; }
.ac-refunded { opacity: .55; text-decoration: line-through; }
.ac-actions { margin-top: 12px; }
@media (max-width: 1000px) { .ac-detail-grid { grid-template-columns: 1fr; } }

/* creators: the text stays inside the card */
.cr-card { min-width: 0; }
.cr-name { max-width: 100%; }
.cr-by { max-width: 100%; overflow-wrap: anywhere; font-size: 12.5px; line-height: 1.4; }

/* mod usage */
.kpi-hint { color: var(--dim); font-size: 12px; line-height: 1.35; }
.us-table td { vertical-align: middle; }
.us-name { font-weight: 700; }
.us-name .badge-new { margin-left: 8px; vertical-align: 1px; }
.us-share { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.us-share .track { flex: 1; height: 8px; border-radius: 4px; background: var(--bg-2); overflow: hidden; }
.us-share .track i { display: block; height: 100%; border-radius: 4px; background: var(--grad); }
.us-share b { width: 40px; text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }

/* live: auto refresh status in the top bar */
.live { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-soft);
  background: var(--surface); color: var(--muted); font: 600 12.5px var(--sans); cursor: pointer; white-space: nowrap; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; }
.live.on { color: var(--text); }
.live.on i { background: var(--green); box-shadow: 0 0 0 0 rgba(74, 222, 128, .6); animation: live-dot 2s ease-out infinite; }
@keyframes live-dot { 0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, .55); } 70%, 100% { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); } }
@media (prefers-reduced-motion: reduce) { .live.on i { animation: none; } }
@media (max-width: 560px) { .live span { display: none; } .live { padding: 0 13px; } }

/* "turn on Windows pop-ups" bar */
.popbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding: 12px 14px; border-radius: 12px;
  background: color-mix(in srgb, var(--brand) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--brand) 45%, transparent); font-size: 14px; }
.popbar > .ico { color: var(--brand); }
.popbar > span { flex: 1; min-width: 0; }
.popbar-x { width: 32px; height: 32px; }
@media (max-width: 640px) { .popbar { flex-wrap: wrap; } }
.cr-site { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.cr-youtube { color: #ff6b81; background: rgba(255, 0, 51, .12); }
.cr-twitch { color: #bf94ff; background: rgba(145, 70, 255, .16); }

/* ---- phones: nothing wider than the screen (a wide row made the whole page zoom out and slide sideways) */
.main { overflow-x: clip; }
.side, .bell-pop, .msgs, .settings { overscroll-behavior: contain; }
.panel { grid-template-columns: minmax(0, 1fr); } /* a wide child scrolls inside the panel instead of stretching it */
.seg-scroll { max-width: 100%; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.seg-scroll::-webkit-scrollbar { display: none; }
.seg-scroll button { flex: none; white-space: nowrap; }

/* copy buttons (Minecraft names, emails) */
.copy-btn { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-left: 6px; padding: 0; vertical-align: middle; border-radius: 7px;
  border: 1px solid var(--line-soft); background: var(--surface-2); color: var(--muted); cursor: pointer; }
.copy-btn:hover { color: var(--text); border-color: var(--brand); }
.ac-mc { white-space: nowrap; }
.ac-mc span { font-weight: 600; }

/* streamers: Twitch / YouTube logo next to the name, LIVE + Watch while they stream */
.ac-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.st-badges { display: inline-flex; align-items: center; gap: 5px; }
.st-badges:empty { display: none; }
.st-ico { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; text-decoration: none; }
p .st-ico { display: inline-block; width: auto; height: auto; padding: 0 6px; font-weight: 700; font-size: 12px; }
.st-twitch-ico { color: #bf94ff; background: rgba(145, 70, 255, .16); }
.st-youtube-ico { color: #ff4d6d; background: rgba(255, 0, 51, .13); }
.st-ico.on { box-shadow: 0 0 0 2px #ff2d55; }
.st-live { display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px 1px 6px; border-radius: 6px; background: #e0102f; color: #fff;
  font: 800 10.5px/1.6 var(--sans); letter-spacing: .08em; }
.st-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: st-blink 1.4s ease-in-out infinite; }
@keyframes st-blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .st-live::before { animation: none; } }
.st-watch { background: #e0102f; border-color: #e0102f; color: #fff; }
.st-watch:hover { background: #ff2d55; border-color: #ff2d55; color: #fff; }
.st-watch-sm { padding: 2px 9px; font-size: 12px; line-height: 1.5; min-height: 0; }
.ac-row.is-live td { background: rgba(224, 16, 47, .06); }
.st-row b, .st-link { display: inline-flex; align-items: center; gap: 6px; justify-self: end; font-weight: 600; }
.st-twitch-ico svg, .st-row .st-link svg { flex: none; }
.st-hidden { opacity: .55; }
.st-flip { grid-column: 1 / -1; justify-self: start; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.st-flip:hover { color: var(--text); }
#ac-stream-note { margin: -4px 0 0; }
.ac-sort { display: none; align-items: center; gap: 8px; }
.ac-sort select { width: auto; padding: 7px 10px; }

@media (max-width: 700px) {
  .main { padding-bottom: 40px; }
  .view-head h1 { font-size: 23px; }
  .kpis { gap: 8px; }
  .kpi { padding: 11px 13px; }
  .kpi span { font-size: 11px; }
  .kpi b { font-size: 20px; }
  .panel { padding: 14px; }
  .topbar { margin-bottom: 14px; }
  /* Accounts: each person is a card instead of a 10-column row */
  .ac-sort { display: inline-flex; }
  .ac-table thead { display: none; }
  .ac-table, .ac-table tbody, .ac-table tr { display: block; }
  .ac-table tr.ac-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .ac-table tr.ac-row td { display: block; padding: 0; border: 0; white-space: normal; text-align: left; min-width: 0; overflow-wrap: anywhere; background: none; }
  .ac-table tr.ac-row td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 1px; color: var(--dim);
    font: 700 10.5px/1.4 var(--sans); text-transform: uppercase; letter-spacing: .06em; }
  .ac-table td.ac-who { grid-column: 1 / -1; min-width: 0; }
  .ac-table tr.ac-row.open, .ac-table tr.ac-row.is-live { background: var(--surface-2); border-radius: 12px; padding: 12px; }
  .ac-table tr.ac-detail { display: block; }
  .ac-table tr.ac-detail > td { display: block; padding: 10px 0 16px; border: 0; background: none; }
  .ac-detail-wrap { position: static; width: auto !important; }
  .ac-actions { flex-wrap: wrap; }
  .ac-who small { overflow-wrap: anywhere; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* emails page */
.mail-form { grid-template-columns: minmax(0, 1fr); }
.mail-form textarea { min-height: 200px; }
.mail-btn-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 12px; }
.mail-actions { flex-wrap: wrap; justify-content: flex-end; }
.mail-preview { width: 100%; height: 620px; border: 1px solid var(--line-soft); border-radius: 12px; background: #eef1f6; }
.mail-setup { border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); }
.mail-setup ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.mail-setup code { font-size: 12.5px; padding: 1px 6px; border-radius: 6px; background: var(--bg-2); color: var(--text); }
.mail-item .item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mail-bar { height: 6px; border-radius: 3px; background: var(--bg-2); overflow: hidden; }
.mail-bar i { display: block; height: 100%; background: var(--grad); }
.mail-warn { color: #ffb4a8; font-size: 13.5px; }
@media (max-width: 700px) { .mail-btn-row { grid-template-columns: 1fr; } .mail-preview { height: 480px; } .mail-actions .btn { flex: 1 1 100%; } }

/* email setup */
.mail-setup-form { display: grid; gap: 12px; }
.mail-setup-form #ms-provider { justify-self: start; }
.ms-fields { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 12px; }
.ms-fields[hidden] { display: none; }
.ms-help { grid-column: 1 / -1; margin: 0; }
.mail-status { font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; overflow-wrap: anywhere; }
.mail-status.ok { color: #3ddc84; background: rgba(61, 220, 132, .12); }
.mail-status.warn { color: #ffcf66; background: rgba(255, 207, 102, .12); }
.mail-status.off { color: var(--muted); background: var(--bg-2); }
.pay-msg.good { color: #3ddc84; }
#ms-msg { text-align: left; margin: 0; }
@media (max-width: 700px) { .ms-fields { grid-template-columns: 1fr; } }

/* emails: offer + who gets it */
.offer-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
#ml-offer-free.offer-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.offer-row[hidden], .pick-box[hidden], #ml-btn-url-field[hidden] { display: none; }
.offer-note { margin: -4px 0 0; }
.mail-offer { font-size: 13px; color: #9fd0ff; background: color-mix(in srgb, var(--brand) 10%, transparent); border-radius: 8px; padding: 6px 10px; overflow-wrap: anywhere; }
.pick-box { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line-soft); }
.pick-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pick-tools .input[type=search] { flex: 1 1 200px; }
.pick-tools select.input { flex: 0 0 auto; width: auto; }
.pick-list { display: grid; gap: 2px; max-height: 320px; overflow-y: auto; overscroll-behavior: contain; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.pick-row:hover { background: var(--surface); }
.pick-row input { width: 17px; height: 17px; flex: none; accent-color: var(--brand); }
.pick-who { display: grid; min-width: 0; line-height: 1.3; flex: 1; }
.pick-who b, .pick-who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-tag { flex: none; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; color: #ffcf66; background: rgba(255, 207, 102, .12); }
.pick-tag.buyer { color: #3ddc84; background: rgba(61, 220, 132, .12); }
@media (max-width: 700px) { .offer-row, #ml-offer-free.offer-row { grid-template-columns: 1fr 1fr; } }
.mail-btn-row:has(#ml-btn-url-field[hidden]) { grid-template-columns: minmax(0, 1fr); }
.pick-tag.notasked { color: var(--muted); background: var(--surface-2); }
#ml-to-note { display: block; margin-top: 4px; }

/* email stats */
.mail-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.mail-stat { font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line-soft); color: var(--muted); }
.mail-stat b { color: var(--text); }
.mail-stat.st-b b, .mail-stat.st-f b { color: #3ddc84; }
.mail-detail { display: grid; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.mail-detail[hidden] { display: none; }
.mail-kpis { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.mail-people td { vertical-align: middle; }

/* channel badges: logo + follower count, biggest first */
.st-pill { width: auto; min-width: 22px; gap: 4px; padding: 0 6px; display: inline-flex; align-items: center; }
.st-n { font: 700 11.5px/1 var(--sans); letter-spacing: .01em; }
.st-small { opacity: .7; }

/* updates: upload a release folder */
.up-pick { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.up-btn { cursor: pointer; }
.up-pick .pay-msg { text-align: left; flex: 1 1 240px; margin: 0; }
.pay-msg.good { color: #3ddc84; }
.up-item .item-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }

/* announcements */
.ann-form { grid-template-columns: minmax(0, 1fr); }
.ann-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.check-wrap { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.ann-preview { padding: 14px; border-radius: 12px; background: linear-gradient(180deg, rgba(20,30,60,.6), rgba(6,8,14,.9)), url("img/shots/auction-live.webp") center / cover, #10141f; min-height: 140px; }
.ann-card { max-width: 340px; margin: 0 auto; padding: 10px 12px; background: rgba(10, 12, 18, .92); border: 1px solid #2a3350; border-radius: 6px; font: 13px/1.4 var(--sans); }
.ann-top { display: flex; gap: 8px; font-size: 11px; letter-spacing: .06em; }
.ann-kind.ann-offer { color: #ffcf40; } .ann-kind.ann-update { color: #4ade80; } .ann-kind.ann-news { color: #5ee7ff; }
.ann-new { color: #ff5f5f; font-weight: 700; }
.ann-title { color: #fff; font-weight: 700; margin: 4px 0; }
.ann-body { margin: 0 0 4px; color: #d7dbe6; white-space: pre-wrap; overflow-wrap: anywhere; }
.ann-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ann-btn { padding: 3px 10px; border: 1px solid #44507a; background: #1b2238; color: #e6e9f2; border-radius: 4px; font-size: 12px; }
.ann-btn.go { background: #1f6f3c; border-color: #2f9a57; }
@media (max-width: 700px) { .ann-row { grid-template-columns: 1fr; } }

/* Required update: a pushed version ready to launch, and the Tick all button */
.req-launch { border-color: rgba(255, 99, 99, 0.35); margin-bottom: 16px; }
.req-launch h2 { margin-bottom: 6px; }
.req-launch .form-actions { margin-top: 12px; flex-wrap: wrap; }
.req-all { margin-left: 8px; padding: 2px 10px; font-size: 11px; text-transform: none; letter-spacing: 0; }
