/* Keizaal Atlas — Admin Console design system.
   Same dark + gold Elder Scrolls feel as the map, built as one consistent system:
   tokens → layout shell → components → page bits. Nothing page-specific lives in components. */

:root {
  color-scheme: dark;
  --bg: #0b0e0f;
  --bg-2: #0f1314;
  --panel: #14191b;
  --panel-2: #191f22;
  --panel-3: #1f272a;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --gold: #c5aa68;
  --gold-2: #e8c879;
  --gold-soft: rgba(197, 170, 104, 0.12);
  --gold-line: rgba(197, 170, 104, 0.35);
  --text: #ebe7dc;
  --text-2: #cfc9bb;
  --muted: #968f7d;
  --muted-2: #6e695d;
  --ok: #62b86f;  --ok-soft: rgba(98, 184, 111, 0.14);
  --warn: #dba843; --warn-soft: rgba(219, 168, 67, 0.14);
  --bad: #e2694b;  --bad-soft: rgba(226, 105, 75, 0.14);
  --info: #5fb5cb; --info-soft: rgba(95, 181, 203, 0.14);
  --violet: #b4acff; --violet-soft: rgba(140, 130, 255, 0.16);
  --r-sm: 8px; --r: 12px; --r-lg: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --serif: "Cinzel", "Palatino Linotype", Georgia, serif;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --mono: Consolas, "SF Mono", Menlo, monospace;
  --side-w: 248px;
  --top-h: 60px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased; caret-color: transparent;
}
input, textarea, select, [contenteditable="true"] { caret-color: auto; }
a { color: var(--gold-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; color: var(--text); }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(197, 170, 104, 0.35); }

svg.i { width: 18px; height: 18px; flex: 0 0 auto; }

/* ── shell ─────────────────────────────────────────────────────────────── */
.cx-shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh;
  background: linear-gradient(to right, var(--bg-2) calc(var(--side-w) - 1px), var(--line) calc(var(--side-w) - 1px), var(--line) var(--side-w), var(--bg) var(--side-w)); }
.cx-side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--bg-2);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 12px;
}
.cx-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.cx-brand .mark { width: 34px; height: 34px; border-radius: 8px; display: block; flex: 0 0 auto;
  box-shadow: 0 0 0 1px var(--gold-line), 0 2px 10px rgba(0, 0, 0, .45); }
.cx-brand b { display: block; font: 700 14px var(--serif); color: var(--gold-2); letter-spacing: .4px; }
.cx-brand span { display: block; font-size: 10.5px; letter-spacing: 1.6px; color: var(--muted); text-transform: uppercase; }
.cx-nav-h { font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted-2); padding: 14px 10px 6px; }
.cx-nav a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text-2);
  font-size: 13.5px; text-decoration: none; position: relative;
}
.cx-nav a svg { width: 17px; height: 17px; flex: 0 0 auto; opacity: .75; }
.cx-nav a:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.cx-nav a.on { background: var(--gold-soft); color: var(--gold-2); }
.cx-nav a.on svg { opacity: 1; }
.cx-nav a.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--gold-2); }
.cx-nav .count { margin-left: auto; font-size: 11px; font-weight: 700; color: #fff; background: var(--bad);
  border-radius: 9px; padding: 0 7px; line-height: 18px; }
.cx-nav .soon { margin-left: auto; font-size: 9.5px; color: var(--muted-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 0 5px; }
.cx-side-foot { margin-top: auto; padding: 14px 8px 4px; border-top: 1px solid var(--line); display: grid; gap: 6px; font-size: 12.5px; }
.cx-side-foot a { color: var(--muted); }

.cx-main { min-width: 0; display: flex; flex-direction: column; }
.cx-top {
  position: sticky; top: 0; z-index: 40; height: var(--top-h); display: flex; align-items: center; gap: 16px;
  padding: 0 28px; background: rgba(11, 14, 15, 0.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.cx-menu-btn { display: none; }
.cx-crumbs { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-crumbs b { color: var(--text); font-weight: 600; }
.cx-search { position: relative; margin-left: auto; width: min(460px, 46vw); }
.cx-search input {
  width: 100%; height: 36px; padding: 0 12px 0 36px; background: var(--panel); border: 1px solid var(--line-2);
  border-radius: 10px; color: var(--text); font: 13.5px var(--sans);
}
.cx-search input::placeholder { color: var(--muted-2); }
.cx-search input:focus { outline: none; border-color: var(--gold-line); box-shadow: 0 0 0 3px var(--gold-soft); }
.cx-search svg { position: absolute; left: 11px; top: 10px; width: 16px; height: 16px; color: var(--muted); }
.cx-search kbd { position: absolute; right: 9px; top: 8px; }
kbd { font: 11px var(--mono); color: var(--muted); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--panel-2); }
.cx-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60; background: var(--panel); border: 1px solid var(--gold-line);
  border-radius: var(--r); box-shadow: var(--shadow); padding: 6px; max-height: 70vh; overflow: auto;
}
.cx-results .h { font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted-2); padding: 8px 10px 4px; }
.cx-results button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; color: var(--text);
  padding: 8px 10px; border-radius: 8px; cursor: pointer; font: 13.5px var(--sans);
}
.cx-results button .sub { color: var(--muted); font-size: 12px; margin-left: auto; }
.cx-results button:hover, .cx-results button.sel { background: var(--gold-soft); }
.cx-me { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.cx-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--panel-3); display: grid; place-items: center;
  font-weight: 700; color: var(--gold-2); border: 1px solid var(--line-2); overflow: hidden; flex: 0 0 auto; }
.cx-avatar img { width: 100%; height: 100%; object-fit: cover; }

.cx-page { padding: 26px 28px 60px; max-width: 1360px; width: 100%; margin: 0 auto; }
.cx-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.cx-page-head h1 { font: 700 24px var(--serif); color: var(--text); letter-spacing: .3px; }
.cx-page-head p { margin: 4px 0 0; color: var(--muted); }
.cx-page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── components ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: 600 13px var(--sans); cursor: pointer;
  white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--panel-3); border-color: rgba(255, 255, 255, 0.2); text-decoration: none; }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #1a1407; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: #f3b3a2; border-color: rgba(226, 105, 75, 0.45); background: rgba(226, 105, 75, 0.08); }
.btn.danger:hover { background: rgba(226, 105, 75, 0.16); }
.btn.ghost { background: none; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.05); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.linkbtn { background: none; border: 0; color: var(--gold-2); cursor: pointer; font: 600 13px var(--sans); padding: 0; }
.linkbtn:hover { text-decoration: underline; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-h h3 { font-size: 14px; font-weight: 700; }
.card-h .sub { color: var(--muted); font-size: 12.5px; }
.card-b { padding: 16px 18px; }
.card-b.flush { padding: 0; }

.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.side { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: block;
  color: inherit; text-decoration: none; transition: border-color .12s, transform .12s; }
a.tile:hover { border-color: var(--gold-line); text-decoration: none; transform: translateY(-1px); }
.tile .l { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.tile .n { font: 700 26px var(--serif); color: var(--text); margin-top: 6px; line-height: 1.1; }
.tile .n.gold { color: var(--gold-2); }
.tile .s { font-size: 12px; color: var(--muted); margin-top: 4px; }
.tile.ok .n { color: var(--ok); } .tile.warn .n { color: var(--warn); } .tile.bad .n { color: var(--bad); }

.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px;
  font-weight: 600; white-space: nowrap; background: var(--panel-3); color: var(--text-2); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.pill.plain::before { display: none; }
.pill.ok { background: var(--ok-soft); color: #9fe0a8; } .pill.warn { background: var(--warn-soft); color: #f0cd84; }
.pill.bad { background: var(--bad-soft); color: #f5ad99; } .pill.info { background: var(--info-soft); color: #95dbea; }
.pill.violet { background: var(--violet-soft); color: #cdc8ff; } .pill.gold { background: var(--gold-soft); color: var(--gold-2); }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); } .dot.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }

.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover { background: rgba(255, 255, 255, 0.025); text-decoration: none; }
.list-row .t { font-weight: 600; } .list-row .s { color: var(--muted); font-size: 12.5px; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .chev { color: var(--muted-2); }

.attn { display: flex; gap: 14px; align-items: flex-start; }
.attn .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; }
.attn .ic svg { width: 17px; height: 17px; }
.attn.bad .ic { background: var(--bad-soft); color: var(--bad); } .attn.warn .ic { background: var(--warn-soft); color: var(--warn); }
.attn.info .ic { background: var(--info-soft); color: var(--info); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line);
  white-space: nowrap; background: var(--panel); position: sticky; top: var(--top-h); z-index: 1; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: rgba(255, 255, 255, 0.022); }
.tbl .muted { color: var(--muted); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }

.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty svg { width: 34px; height: 34px; color: var(--muted-2); margin-bottom: 10px; }
.empty b { display: block; color: var(--text-2); font-size: 15px; margin-bottom: 4px; }

.skel { background: linear-gradient(90deg, var(--panel-2) 25%, var(--panel-3) 37%, var(--panel-2) 63%); background-size: 400% 100%;
  animation: skel 1.4s ease infinite; border-radius: 8px; }
@keyframes skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.note { background: var(--gold-soft); border: 1px solid var(--gold-line); border-radius: var(--r-sm); padding: 10px 14px; color: var(--text-2); font-size: 13px; }
.note.bad { background: var(--bad-soft); border-color: rgba(226, 105, 75, .45); color: #f5c2b4; }
.note.ok { background: var(--ok-soft); border-color: rgba(98, 184, 111, .45); color: #b3e5ba; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.meter { height: 8px; border-radius: 5px; background: var(--panel-3); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ok); border-radius: 5px; }
.meter.warn i { background: var(--warn); } .meter.bad i { background: var(--bad); }

.feed-row { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--line); align-items: start; }
.feed-row:last-child { border-bottom: 0; }
.feed-row .when { color: var(--muted-2); font-size: 12px; white-space: nowrap; }

.spark { width: 100%; height: 64px; display: block; }

/* placeholder for pages still being rebuilt */
.wip { text-align: center; padding: 70px 20px; }
.wip h2 { font: 700 20px var(--serif); margin-bottom: 8px; }

/* ⌘K palette */
.cx-pal-back { position: fixed; inset: 0; z-index: 2000; background: rgba(0, 0, 0, 0.55); display: flex; justify-content: center; padding-top: 12vh; }
.cx-pal { width: min(620px, 94vw); background: var(--panel); border: 1px solid var(--gold-line); border-radius: var(--r-lg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .65); overflow: hidden; align-self: flex-start; }
.cx-pal input { width: 100%; height: 52px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text);
  padding: 0 18px; font: 16px var(--sans); }
.cx-pal input:focus { outline: none; }
.cx-pal .cx-results { position: static; border: 0; box-shadow: none; border-radius: 0; max-height: 52vh; }
.cx-pal-foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 11.5px; }

/* side panel (player profile etc.) */
.cx-drawer-back { position: fixed; inset: 0; z-index: 900; background: rgba(0, 0, 0, 0.35); }
.cx-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 901; width: min(760px, 100vw); background: var(--bg-2);
  border-left: 1px solid var(--line-2); box-shadow: -20px 0 60px rgba(0, 0, 0, .5); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .22s cubic-bezier(.2, .8, .2, 1); }
.cx-drawer.in { transform: none; }
.cx-drawer-h { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.cx-drawer-b { overflow-y: auto; flex: 1; padding: 18px 20px 40px; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 600; font-size: 13px; border-bottom: 2px solid transparent; text-decoration: none; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--gold-2); border-bottom-color: var(--gold-2); }

/* form controls */
.field { display: grid; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field small { color: var(--muted); font-size: 12px; }
.inp, select.inp, textarea.inp {
  height: 36px; padding: 0 11px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 9px; color: var(--text);
  font: 13.5px var(--sans); width: 100%;
}
textarea.inp { height: auto; padding: 9px 11px; line-height: 1.5; resize: vertical; }
.inp:focus { outline: none; border-color: var(--gold-line); box-shadow: 0 0 0 3px var(--gold-soft); }

/* toasts from ui-dialogs.js: match the console */
.kz-toast { font-family: var(--sans); }

/* ── responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .grid.side { grid-template-columns: 1fr; }
  .grid.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .cx-shell { grid-template-columns: 1fr; }
  .cx-side { position: fixed; left: 0; top: 0; bottom: 0; z-index: 1000; width: 270px; transform: translateX(-102%); transition: transform .2s; }
  body.cx-nav-open .cx-side { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, .6); }
  .cx-menu-btn { display: inline-flex; }
  .cx-top { padding: 0 14px; gap: 10px; }
  .cx-search { width: auto; flex: 1; }
  .cx-search kbd, .cx-me .name { display: none; }
  .cx-page { padding: 18px 14px 50px; }
  .grid.c2, .grid.c3 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 12px; } .tile .n { font-size: 22px; }
  .tbl th { top: var(--top-h); }
}


/* ── chips, filters, tables (Players / Groups) ─────────────────────────── */
.chip { height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text-2);
  font: 600 12.5px var(--sans); cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: rgba(255, 255, 255, .22); color: var(--text); }
.chip.on { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold-2); }
.cx-views { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: thin; }
.cx-filters { margin-bottom: 14px; }
.cx-search-inline { position: relative; min-width: 260px; flex: 0 1 340px; }
.cx-search-inline svg { position: absolute; left: 10px; top: 10px; width: 16px; height: 16px; color: var(--muted); }
.cx-search-inline .inp { padding-left: 34px; }
.tbl tr.sel td { background: rgba(197, 170, 104, 0.06); }
.cx-players tbody tr { cursor: pointer; }
.tbl input[type=checkbox], .cx-pick-row input, .cx-cbx input { width: 16px; height: 16px; accent-color: var(--gold); cursor: pointer; }
.cx-who { display: flex; align-items: center; gap: 10px; }
.cx-who .cx-avatar { position: relative; overflow: visible; }
.cx-who .cx-avatar img { border-radius: 50%; }
.cx-who .cx-avatar i.on { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); border: 2px solid var(--panel); }
.cx-pager { display: flex; gap: 12px; justify-content: center; align-items: center; margin: 14px 0; flex-wrap: wrap; }
.cx-pages { display: inline-flex; gap: 4px; align-items: center; }
.cx-pages .btn { min-width: 30px; justify-content: center; padding: 0 8px; }
.cx-pages .btn.on { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold-2); font-weight: 700; cursor: default; }
.cx-bulk { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 8px;
  background: #221d12; border: 1px solid var(--gold-line); border-radius: 14px; padding: 8px 10px 8px 16px; box-shadow: 0 16px 50px rgba(0, 0, 0, .6);
  color: var(--gold-2); max-width: calc(100vw - 24px); overflow-x: auto; }
.cx-bulk .sep { width: 1px; height: 22px; background: var(--gold-line); margin: 0 4px; }
.cx-bulk-inline { display: flex; align-items: center; gap: 8px; padding: 8px 18px; background: #221d12; border-top: 1px solid var(--gold-line);
  border-bottom: 1px solid var(--gold-line); color: var(--gold-2); flex-wrap: wrap; }
.cx-bulk-inline b { margin-right: auto; }

/* ── player profile ─────────────────────────────────────────────────────── */
.cx-prof-h { display: flex; gap: 14px; align-items: flex-start; }
.cx-prof-h h2 { font: 700 21px var(--serif); }
.cx-avatar.lg { width: 56px; height: 56px; font-size: 22px; }
.cx-prof-actions { margin: 14px 0 6px; }
.cx-prof-b { padding-top: 2px; }
.cx-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.cx-check { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--muted-2); border-radius: 10px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 2px; }
.cx-check.ok { border-left-color: var(--ok); } .cx-check.warn { border-left-color: var(--warn); } .cx-check.bad { border-left-color: var(--bad); }
.cx-check .l { font-size: 11.5px; color: var(--muted); } .cx-check .v { font-weight: 700; } .cx-check .h { font-size: 11.5px; color: var(--muted); }
.cx-kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.cx-kv:last-child { border-bottom: 0; } .cx-kv span { color: var(--muted); }
.cx-tl-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--panel-3); color: var(--muted); }
.cx-tl-ic svg { width: 14px; height: 14px; }
.cx-tl-ic.error { background: var(--bad-soft); color: var(--bad); } .cx-tl-ic.admin { background: var(--gold-soft); color: var(--gold-2); }
.cx-tl-ic.feedback { background: var(--info-soft); color: var(--info); }
.cx-tl.error .t { color: #f5ad99; }
.cx-perm-g + .cx-perm-g { margin-top: 10px; }
.cx-switch { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; cursor: pointer; position: relative; }
.cx-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.cx-switch .tr { flex: 0 0 auto; width: 36px; height: 20px; border-radius: 10px; background: var(--panel-3); border: 1px solid var(--line-2); position: relative; transition: background .15s; margin-top: 1px; }
.cx-switch .tr::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.cx-switch input:checked + .tr { background: rgba(197, 170, 104, .35); border-color: var(--gold-line); }
.cx-switch input:checked + .tr::after { transform: translateX(16px); background: var(--gold-2); }
.cx-switch input:focus-visible + .tr { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.cx-switch input:disabled + .tr { opacity: .5; }
.cx-switch small { display: block; color: var(--muted); font-size: 12px; }
.cx-tools { display: grid; gap: 4px; padding-top: 6px; }
.cx-tool { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cx-tool:last-child { border-bottom: 0; }
.cx-tool small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.cx-pre { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font: 11.5px var(--mono); white-space: pre-wrap; max-height: 260px; overflow: auto; color: var(--text-2); }

/* ── split layout (Groups, Inbox) ────────────────────────────────────────── */
.cx-split { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px; align-items: start; }
.cx-split-list { padding: 6px; position: sticky; top: calc(var(--top-h) + 16px); max-height: calc(100vh - var(--top-h) - 40px); overflow: auto; }
.cx-split-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; color: var(--text-2); text-decoration: none; }
.cx-split-item:hover { background: rgba(255, 255, 255, .04); text-decoration: none; }
.cx-split-item.on { background: var(--gold-soft); color: var(--gold-2); }
.cx-split-item .grow { flex: 1; min-width: 0; }

/* ── dialogs built on ui-dialogs.css ─────────────────────────────────────── */
.cx-acc-dlg { width: min(480px, 94vw); }
.cx-choice { display: grid; gap: 8px; margin: 10px 0 14px; }
.cx-opt { display: flex; gap: 12px; align-items: flex-start; padding: 11px 12px; border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer; }
.cx-opt:hover { border-color: rgba(255, 255, 255, .22); }
.cx-opt.on { border-color: var(--gold-line); background: var(--gold-soft); }
.cx-opt input { margin-top: 3px; accent-color: var(--gold); }
.cx-opt small { display: block; color: var(--muted); font-size: 12px; }
.cx-end { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 6px; }
.cx-end .field { flex: 1 1 220px; }
.cx-cbx { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-2); cursor: pointer; }
.cx-picker { width: min(640px, 95vw); max-height: 88vh; display: flex; flex-direction: column; }
.cx-pick-list { overflow: auto; max-height: 46vh; }
.cx-pick-row { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.cx-pick-row:hover { background: rgba(255, 255, 255, .03); }
.cx-pick-row.dim { opacity: .55; cursor: default; }

@media (max-width: 860px) {
  .hide-sm { display: none; }
  .cx-split { grid-template-columns: 1fr; }
  .cx-split-list { position: static; max-height: none; display: flex; overflow-x: auto; }
  .cx-split-item { white-space: nowrap; }
  .cx-search-inline { min-width: 0; flex: 1 1 100%; }
  .cx-bulk { left: 12px; right: 12px; transform: none; bottom: 12px; }
  .cx-drawer { width: 100vw; }
}


/* ── messages ───────────────────────────────────────────────────────────── */
.cx-click { cursor: pointer; }
.cx-dbar { display: flex; height: 7px; border-radius: 4px; overflow: hidden; background: var(--panel-3); width: 160px; margin-bottom: 4px; }
.cx-dbar i { display: block; height: 100%; } .cx-dbar .ok { background: var(--ok); } .cx-dbar .bad { background: var(--bad); }
.cx-dbar .skip { background: var(--muted-2); } .cx-dbar .wait { background: var(--warn); }
.cx-compose { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cx-compose-side { position: sticky; top: calc(var(--top-h) + 16px); }
.cx-step { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-2);
  font-size: 12px; margin-right: 6px; border: 1px solid var(--gold-line); }
.cx-sum { display: flex; gap: 12px; align-items: center; padding: 4px 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.cx-sum .n { font: 700 32px var(--serif); color: var(--gold-2); }
.cx-thumb { height: 44px; border-radius: 6px; border: 1px solid var(--line-2); }
.cx-dm { display: flex; gap: 12px; background: #313338; border-radius: 10px; padding: 14px; color: #dbdee1; font: 14.5px/1.4 "gg sans", "Segoe UI", sans-serif; }
.cx-dm-av { width: 40px; height: 40px; border-radius: 50%; background: url("/site/assets/brand/logo-128.png?v=7d94daed4a96") center / cover; color: transparent;
  flex: 0 0 auto; overflow: hidden; }
.cx-dm-h { display: flex; gap: 6px; align-items: center; margin-bottom: 2px; }
.cx-dm-h b { color: #f2f3f5; } .cx-dm-h .bot { background: #5865f2; color: #fff; font-size: 10px; font-weight: 700; padding: 0 4px; border-radius: 3px; }
.cx-dm-t { word-wrap: break-word; } .cx-dm-t b { color: #f2f3f5; } .cx-dm .lnk { color: #00a8fc; }
.cx-dm-img { display: block; max-width: 100%; max-height: 260px; border-radius: 8px; margin-top: 8px; }
.cx-dm .muted { color: #949ba4; }

/* ── segmented control ─────────────────────────────────────────────────── */
.cx-seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; background: var(--panel); }
.cx-seg button { background: none; border: 0; border-right: 1px solid var(--line); color: var(--text-2); padding: 0 12px; height: 32px; cursor: pointer; font: 600 12.5px var(--sans); }
.cx-seg button:last-child { border-right: 0; }
.cx-seg button:hover { color: var(--text); background: rgba(255, 255, 255, .03); }
.cx-seg button.on { background: var(--gold-soft); color: var(--gold-2); }

/* ── inbox ───────────────────────────────────────────────────────────────── */
.cx-inbox { display: grid; grid-template-columns: minmax(280px, 34%) minmax(0, 1fr); gap: 16px; align-items: start; }
.cx-ib-list { max-height: calc(100vh - 230px); overflow: auto; position: sticky; top: calc(var(--top-h) + 16px); }
.cx-ib-item { display: grid; gap: 4px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--text-2); text-decoration: none; }
.cx-ib-item:hover { background: rgba(255, 255, 255, .025); text-decoration: none; }
.cx-ib-item.on { background: var(--gold-soft); box-shadow: inset 3px 0 0 var(--gold-2); }
.cx-ib-item.new b::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); margin-right: 7px; vertical-align: middle; }
.cx-ib-item b { color: var(--text); }
.cx-ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.cx-ib-msg { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; line-height: 1.55; }
.cx-ib-ctx { background: var(--bg-2); border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 8px;
  padding: 8px 12px; margin-bottom: 8px; font-size: 12.5px; color: var(--text-2); }
.cx-ib-ctx .q { color: var(--muted); }
.cx-sr { display: grid; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }

/* ── notices ─────────────────────────────────────────────────────────────── */
.cx-notice-dlg { width: min(620px, 95vw); max-height: 92vh; overflow: auto; }
.cx-banner { border-radius: 10px; padding: 12px 14px; border: 1px solid; font-size: 13.5px; }
.cx-banner.info { background: rgba(95, 181, 203, .12); border-color: rgba(95, 181, 203, .5); color: #c5eaf3; }
.cx-banner.warning { background: var(--warn-soft); border-color: rgba(219, 168, 67, .55); color: #f3dba8; }
.cx-banner.critical { background: var(--bad-soft); border-color: rgba(226, 105, 75, .55); color: #f5c2b4; }
.cx-banner.lock { background: radial-gradient(ellipse at top, #1d2224, #0b0e0f); border-color: var(--gold-line); text-align: center; padding: 26px 18px; color: var(--text-2); }

@media (max-width: 1100px) {
  .cx-compose { grid-template-columns: 1fr; } .cx-compose-side { position: static; }
  .cx-inbox { grid-template-columns: 1fr; } .cx-ib-list { position: static; max-height: 40vh; }
}


/* ── settings pages ─────────────────────────────────────────────────────── */
.cx-settings { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px; align-items: start; }
.cx-subnav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: calc(var(--top-h) + 16px); }
.cx-subnav a { padding: 8px 12px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-size: 13.5px; }
.cx-subnav a:hover { background: rgba(255, 255, 255, .04); text-decoration: none; }
.cx-subnav a.on { background: var(--gold-soft); color: var(--gold-2); }
.cx-fieldrow { max-width: 520px; }
.cx-savebar { position: fixed; left: calc(var(--side-w) + 24px); right: 24px; bottom: 20px; z-index: 60; display: flex; gap: 10px; align-items: center;
  background: #221d12; border: 1px solid var(--gold-line); border-radius: 12px; padding: 10px 12px 10px 18px; box-shadow: 0 16px 50px rgba(0, 0, 0, .6); color: var(--gold-2); }
.cx-savebar[hidden] { display: none; }
.cx-matrix th.c, .cx-matrix td.c { text-align: center; width: 110px; }
.cx-matrix tr.grp td { background: var(--panel-2); font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); padding: 8px 14px; }
.cx-matrix tbody tr.grp:hover td { background: var(--panel-2); }
.cx-ib-item .row { flex-wrap: nowrap; min-width: 0; }
.cx-ib-list { overflow-x: hidden; }

@media (max-width: 860px) {
  .cx-settings { grid-template-columns: 1fr; }
  .cx-subnav { position: static; flex-direction: row; overflow-x: auto; }
  .cx-subnav a { white-space: nowrap; }
  .cx-savebar { left: 12px; right: 12px; bottom: 12px; }
}

/* ── Messages: beta-form emails review + Team list ───────────────────────── */
.cx-modal-back { position: fixed; inset: 0; z-index: 400; background: rgba(0, 0, 0, .55); display: grid; place-items: center; padding: 16px; }
.cx-modal { width: min(760px, 100%); max-height: calc(100vh - 32px); overflow: auto; margin: 0; }
.col { display: flex; flex-direction: column; align-items: flex-start; }
.cx-team td { vertical-align: top; }
.cx-team-msg { white-space: pre-wrap; font-size: 12.5px; color: var(--text-2); background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; max-height: 120px; overflow: auto; max-width: 420px; }

.cx-opt.is-locked { opacity: .72; cursor: default; }

/* Messages: confirm list, previews (email + in-app card), tracking table */
.cx-confirm-list { margin: 0 0 12px; padding-left: 18px; display: grid; gap: 8px; }
.cx-mail { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #f7f7f5; color: #1d1d1d; }
.cx-mail-h { padding: 10px 12px; border-bottom: 1px solid #e3e3e0; background: #fff; display: grid; gap: 4px; }
.cx-mail-h .muted { color: #777 !important; }
.cx-mail-b { padding: 14px 12px; font-size: 13.5px; line-height: 1.55; }
.cx-mail-b .lnk { color: #1a64c8; text-decoration: underline; }
.cx-mail-f { margin-top: 16px; padding-top: 8px; border-top: 1px solid #ddd; font-size: 11.5px; color: #777; }
.cx-mail + .muted { color: var(--muted); }
.cx-appcard { border: 1px solid rgba(197,170,104,.45); border-radius: 14px; padding: 16px 18px; background: rgba(14,17,19,.98); }
.cx-appcard-from { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.cx-appcard-t { margin: 4px 0 8px; font: 700 17px 'Cinzel', Georgia, serif; color: #e8c879; }
.cx-appcard-b { font-size: 13.5px; line-height: 1.55; }
.cx-appcard-a { display: flex; justify-content: flex-end; margin-top: 12px; }
.cx-appcard-a span { padding: 6px 18px; border-radius: 999px; background: #5fc6dd; color: #04181d; font-weight: 700; font-size: 13px; }
.cx-track td { vertical-align: top; }

/* Inbox: the sender's account strip */
.cx-ib-who { color: inherit; text-decoration: none; border-bottom: 1px dashed var(--gold-line, rgba(197,170,104,.4)); }
.cx-ib-who:hover { color: var(--gold); }
.cx-ib-acc { display: grid; gap: 10px; padding: 12px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }
.cx-ib-acc-who { display: flex; gap: 10px; align-items: center; color: inherit; text-decoration: none; }
.cx-ib-acc-who:hover b { color: var(--gold); }
.cx-ib-acc-groups { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cx-chip-x { margin-left: 6px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }
.cx-chip-x:hover { color: var(--bad); }
.cx-ib-acc-act { gap: 6px; flex-wrap: wrap; }

/* Chat */
.cx-chat { display: grid; grid-template-columns: 300px 1fr; gap: 16px; min-height: calc(100vh - 200px); }
.cx-ch-list { overflow-y: auto; max-height: calc(100vh - 200px); padding: 6px; }
.cx-ch-item { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; color: inherit; text-decoration: none; }
.cx-ch-item:hover { background: var(--bg-2); }
.cx-ch-item.on { background: var(--gold-soft, rgba(197,170,104,.12)); }
.cx-ch-item .cx-avatar { position: relative; flex: none; }
.cx-online { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); border: 2px solid var(--bg); }
.cx-ch-pane { display: flex; flex-direction: column; max-height: calc(100vh - 200px); }
.cx-ch-log { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; min-height: 260px; }
.cx-bub { max-width: 72%; display: flex; flex-direction: column; gap: 3px; }
.cx-bub.me { align-self: flex-end; align-items: flex-end; }
.cx-bub.them { align-self: flex-start; }
.cx-bub-t { padding: 9px 12px; border-radius: 14px; line-height: 1.45; font-size: 14px; white-space: normal; word-wrap: break-word; }
.cx-bub.me .cx-bub-t { background: #2b4a53; color: #e9f6f8; border-bottom-right-radius: 4px; }
.cx-bub.them .cx-bub-t { background: var(--bg-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.cx-bub-m { font-size: 11px; color: var(--muted); }
.cx-ch-send { display: flex; gap: 8px; padding: 10px 12px 4px; border-top: 1px solid var(--line); align-items: flex-end; }
.cx-ch-send textarea { flex: 1; resize: none; }
@media (max-width: 860px) { .cx-chat { grid-template-columns: 1fr; } .cx-ch-list { max-height: 220px; } }
.cx-ib-noacc { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cx-lk-row { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 9px 10px; margin-bottom: 4px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2); color: var(--text); text-align: left; cursor: pointer; }
.cx-lk-row:hover { border-color: var(--gold); }
.cx-ib-invited { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border-color: rgba(122,209,122,.4); }

/* Watchlist: staff-only red name + eye wherever a watched player shows */
.cx-watch { color: #ff5a5a; margin-left: 5px; font-size: .92em; vertical-align: baseline; }
.cx-watched, b.cx-watched, h2.cx-watched { color: #ff6b6b !important; }

/* embedded in the map's "Full account" slide-out: the page only */
html.cx-embed .cx-side, html.cx-embed .cx-top, html.cx-embed .cx-embed-hide { display: none !important; }
html.cx-embed .cx-shell { grid-template-columns: 1fr; }
html.cx-embed .cx-page { padding: 16px 18px 40px; }
