/* AXOM Support — player help center and staff desk.
   Same tokens as the lobby (main_webapp/assets/axom-casino.css). */
:root {
  --ink: #0e0f11; --s0: #0b0c0e; --s1: #15171a; --s2: #1c1f23; --s3: #252930; --s4: #2e333b;
  --line: rgba(241, 235, 223, .08); --line-2: rgba(241, 235, 223, .14); --line-3: rgba(241, 235, 223, .22);
  --text: #f1ebdf; --text-2: #b9b2a5; --text-3: #9a948a;
  --gold: #d9b25f; --gold-hi: #e6c378; --gold-ink: #17120a; --gold-text: #e3c27c; --gold-tint: rgba(217, 178, 95, .14);
  --teal: #4cc9b6; --ok: #5fd08f; --pending: #86b4ff; --warn: #f0a347; --fail: #f27b7b;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Archivo", "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--ink); }
body { color: var(--text); font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, dl, dd { margin: 0; }
svg { display: block; fill: currentColor; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .92em; overflow-wrap: anywhere; }
:focus-visible { outline: 2px solid #f1d79a; outline-offset: 2px; border-radius: 6px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; font-weight: 600; font-size: 15px; white-space: nowrap; transition: background-color 140ms var(--ease), color 140ms var(--ease); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--gold); color: var(--gold-ink); }
.btn-primary:hover:not(:disabled) { background: var(--gold-hi); }
.btn-secondary { background: var(--s3); border: 1px solid var(--line-2); }
.btn-secondary:hover:not(:disabled) { background: var(--s4); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--s2); color: var(--text); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--text-2); flex-shrink: 0; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--s2); color: var(--text); }
.link { color: var(--gold-text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.hint { font-size: 13px; color: var(--text-3); }
.count { font-size: 13px; color: var(--text-3); font-weight: 500; }

/* status pills — words + colour */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap; color: var(--pending); background: rgba(134, 180, 255, .12); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.s-answered { color: var(--ok); background: rgba(95, 208, 143, .12); }
.pill.s-closed { color: var(--text-3); background: rgba(162, 157, 148, .12); }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(95, 208, 143, .14); flex-shrink: 0; }
.live-dot.offline { background: var(--fail); box-shadow: 0 0 0 4px rgba(242, 123, 123, .14); }

/* gate */
.gate { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px; text-align: center; background: var(--ink); z-index: 50; }
.gate-mark { width: 52px; height: 42px; }
.gate strong { font: 700 20px/1.3 var(--display); font-stretch: 87.5%; }
.gate span { color: var(--text-2); max-width: 36ch; }
body:not([data-mode="loading"]) .gate:not(.is-error) { display: none; }

/* shared bar */
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; height: calc(56px + var(--safe-t)); padding: var(--safe-t) 12px 0; background: rgba(14, 15, 17, .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.bar-back { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--text-2); flex-shrink: 0; }
.bar-back svg { width: 22px; height: 22px; }
.bar-back:hover { background: var(--s2); color: var(--text); }
.bar-title { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; font-weight: 600; }
.bar-title.stack { flex-direction: column; align-items: flex-start; gap: 0; }
.bar-title.stack small { font-size: 12.5px; color: var(--text-3); font-weight: 400; }
.bar-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.bar-mark { width: 26px; height: 21px; flex-shrink: 0; }

/* ══════════ player help center ══════════ */
.help-main { width: min(720px, 100%); margin: 0 auto; padding: 20px 16px calc(40px + var(--safe-b)); }
.help-hero h1 { font: 700 28px/1.15 var(--display); font-stretch: 87.5%; }
.help-hero h1 span { color: var(--gold-text); }
.help-hero p { color: var(--text-2); margin-top: 6px; }
.topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 20px 0 28px; }
.topic { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 92px; padding: 14px; border-radius: 16px; background: var(--s1); border: 1px solid var(--line); text-align: left; transition: border-color 160ms var(--ease), background-color 160ms var(--ease); }
.topic:hover { border-color: var(--line-3); background: var(--s2); }
.topic-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--gold-tint); color: var(--gold-text); font-weight: 700; font-size: 17px; }
.topic b { font-size: 15px; font-weight: 600; }
.topic small { font-size: 12.5px; color: var(--text-2); line-height: 1.35; }
.section-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.section-row h2 { font: 700 19px/1.2 var(--display); font-stretch: 87.5%; }
.ticket-list { display: grid; gap: 8px; }
.ticket { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; width: 100%; padding: 14px 16px; border-radius: 14px; background: var(--s1); border: 1px solid var(--line); text-align: left; transition: border-color 160ms var(--ease); }
.ticket:hover { border-color: var(--line-3); }
.ticket.is-unread { border-color: rgba(95, 208, 143, .4); }
.ticket-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ticket-top b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket time { font-size: 12.5px; color: var(--text-3); text-align: right; }
.ticket p { grid-column: 1 / -1; font-size: 13.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket .ticket-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); }
.empty { display: grid; justify-items: center; gap: 6px; padding: 26px 16px; text-align: center; border: 1px dashed var(--line-2); border-radius: 16px; color: var(--text-2); font-size: 14px; }
.empty strong { color: var(--text); }
.help-foot { margin-top: 28px; font-size: 13px; color: var(--text-3); }

/* sheet (topic answers + new ticket) */
.sheet { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; background: rgba(5, 6, 7, .68); animation: fade 200ms var(--ease); }
.sheet-card { width: min(620px, 100%); max-height: calc(100dvh - var(--safe-t) - 16px); display: flex; flex-direction: column; background: var(--s1); border: 1px solid var(--line-2); border-bottom: 0; border-radius: 20px 20px 0 0; animation: rise 220ms var(--ease); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 12px 8px 20px; }
.sheet-head h2 { font: 700 20px/1.2 var(--display); font-stretch: 87.5%; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 0 20px calc(20px + var(--safe-b)); }
.answers { display: grid; gap: 8px; margin-bottom: 18px; }
.answer { border: 1px solid var(--line); border-radius: 12px; background: var(--s2); }
.answer summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 0 14px; cursor: pointer; font-weight: 500; list-style: none; }
.answer summary::-webkit-details-marker { display: none; }
.answer summary svg { width: 16px; height: 16px; color: var(--text-3); transition: transform 160ms var(--ease); }
.answer[open] summary svg { transform: rotate(90deg); }
.answer p { padding: 0 14px 14px; font-size: 14px; color: var(--text-2); }
.answer a { color: var(--gold-text); text-decoration: underline; }
.compose-new { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.compose-new label { font-weight: 600; }
textarea { width: 100%; resize: none; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--s0); color: var(--text); font-size: 16px; line-height: 1.45; }
textarea::placeholder, input::placeholder { color: var(--text-3); }
textarea:focus, input:focus, select:focus { outline: none; border-color: rgba(217, 178, 95, .7); box-shadow: 0 0 0 3px rgba(217, 178, 95, .18); }
.compose-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* player chat */
.chat { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; background: var(--ink); }
.chat-status { padding: 10px 16px; font-size: 13.5px; color: var(--text-2); border-bottom: 1px solid var(--line); background: var(--s1); }
.chat-status:empty { display: none; }
.thread { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 14px 12px; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: min(560px, 88%); }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg-av { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--s3); flex-shrink: 0; font-size: 12px; font-weight: 600; color: var(--text-2); }
.msg-av svg { width: 18px; height: 15px; }
.msg-body { display: grid; gap: 3px; min-width: 0; }
.msg-meta { font-size: 11.5px; color: var(--text-3); padding: 0 4px; }
.msg.me .msg-meta { text-align: right; }
.bubble { padding: 10px 13px; border-radius: 16px 16px 16px 4px; background: var(--s2); font-size: 14.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.me .bubble { border-radius: 16px 16px 4px 16px; background: var(--gold); color: var(--gold-ink); }
.attach { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 10px; border-radius: 8px; background: rgba(0, 0, 0, .18); font-size: 13px; font-weight: 600; }
.attach svg { width: 15px; height: 15px; }
.day { align-self: center; font-size: 12px; color: var(--text-3); padding: 2px 10px; border-radius: 999px; background: var(--s1); }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px calc(10px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--s1); }
.composer textarea { max-height: 140px; padding: 11px 14px; }
.send { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--gold); color: var(--gold-ink); flex-shrink: 0; transition: background-color 140ms var(--ease); }
.send:hover { background: var(--gold-hi); }
.send:disabled { opacity: .5; }
.send svg { width: 20px; height: 20px; }
.closed-note { padding: 16px; padding-bottom: calc(16px + var(--safe-b)); text-align: center; font-size: 14px; color: var(--text-2); border-top: 1px solid var(--line); background: var(--s1); }

/* ══════════ staff desk ══════════ */
.desk { display: flex; flex-direction: column; height: 100dvh; }
.desk-top { display: flex; align-items: center; gap: 16px; min-height: calc(60px + var(--safe-t)); padding: var(--safe-t) 16px 0; border-bottom: 1px solid var(--line); background: var(--s1); flex-shrink: 0; }
.desk-top .bar-title { flex: 0 0 auto; }
.desk-stats { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.desk-stats div { flex-shrink: 0; padding: 6px 12px; border-radius: 10px; background: var(--s2); }
.desk-stats dt { font-size: 11.5px; color: var(--text-3); }
.desk-stats dd { font-weight: 700; font-variant-numeric: tabular-nums; }
.desk-me { display: flex; align-items: center; gap: 8px; font-size: 14px; flex-shrink: 0; }
.role { font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--gold-tint); color: var(--gold-text); }
.readonly { display: flex; align-items: center; gap: 8px; padding: 8px 16px; font-size: 13.5px; color: var(--warn); background: rgba(240, 163, 71, .1); border-bottom: 1px solid rgba(240, 163, 71, .3); }
.readonly svg { width: 16px; height: 16px; }
.desk-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 340px minmax(0, 1fr) 300px; }
.queue { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--s1); }
.queue-tools { display: flex; gap: 6px; padding: 12px 12px 8px; }
.search { position: relative; flex: 1; }
.search svg { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--text-3); }
.search input { width: 100%; height: 44px; padding: 0 12px 0 38px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--s0); font-size: 15px; }
.scopes { display: flex; gap: 2px; padding: 0 8px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.scopes button { flex-shrink: 0; min-height: 42px; padding: 0 10px; font-size: 13.5px; font-weight: 500; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.scopes button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--gold); }
.scopes span { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; margin-left: 4px; border-radius: 10px; background: var(--gold); color: var(--gold-ink); font-size: 11px; font-weight: 700; }
.scopes span:empty { display: none; }
.queue-list { flex: 1; overflow-y: auto; padding: 8px; display: grid; align-content: start; gap: 6px; }
.qcard { position: relative; display: grid; gap: 3px; width: 100%; padding: 11px 12px 11px 16px; border-radius: 12px; text-align: left; border: 1px solid transparent; transition: background-color 140ms var(--ease); }
.qcard:hover { background: var(--s2); }
.qcard.is-selected { background: var(--s2); border-color: var(--line-3); }
.qcard::before { content: ""; position: absolute; left: 5px; top: 12px; bottom: 12px; width: 3px; border-radius: 2px; background: var(--s4); }
.qcard.p-high::before { background: var(--warn); }
.qcard.p-urgent::before { background: var(--fail); }
.qcard.p-low::before { background: transparent; }
.qrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.qrow b { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qwait { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-3); flex-shrink: 0; }
.qwait.is-late { color: var(--warn); font-weight: 600; }
.qprev { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qmeta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.qmeta .mine { color: var(--gold-text); font-weight: 600; }
.conv { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.conv-empty { flex: 1; display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center; color: var(--text-2); }
.conv-empty svg { width: 44px; height: 36px; opacity: .5; }
.conv-empty strong { color: var(--text); }
.conv-view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.conv-head { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.conv-who { flex: 1; min-width: 0; display: grid; }
.conv-who strong { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-who small { font-size: 12.5px; color: var(--text-3); }
.mobile-only { display: none !important; }
.desk .msg.staff { align-self: flex-end; flex-direction: row-reverse; }
.desk .msg.staff .bubble { border-radius: 16px 16px 4px 16px; background: #2a2416; border: 1px solid rgba(217, 178, 95, .25); color: var(--text); }
.desk .msg.staff .msg-meta { text-align: right; }
.desk-compose { padding: 10px 14px 12px; border-top: 1px solid var(--line); background: var(--s1); }
.desk-compose.is-note textarea { border-color: rgba(240, 163, 71, .5); background: #1a150c; }
.compose-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.compose-tabs button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.compose-tabs button svg { width: 13px; height: 13px; }
.compose-tabs button[aria-selected="true"] { background: var(--s3); color: var(--text); }
.compose-tabs button[data-mode="note"][aria-selected="true"] { color: var(--warn); }
.compose-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.templates { display: flex; gap: 6px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.templates button { flex-shrink: 0; height: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 12.5px; color: var(--text-2); }
.templates button:hover { color: var(--text); border-color: var(--line-3); }
.desk-compose.is-note .templates, .desk-compose.is-note #deskSendClose { display: none; }
.desk-locked { padding: 14px 16px; font-size: 14px; color: var(--text-2); border-top: 1px solid var(--line); background: var(--s1); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.details { border-left: 1px solid var(--line); background: var(--s1); overflow-y: auto; }
.details-inner { padding: 14px; display: grid; gap: 14px; }
.det-block h3, .det-block summary { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
.det-block summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; gap: 6px; }
.det-list div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.det-list dt { color: var(--text-3); }
.det-list dd { text-align: right; min-width: 0; overflow-wrap: anywhere; }
.field { display: grid; gap: 4px; margin-bottom: 8px; font-size: 13px; color: var(--text-3); }
.field select { height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--s0); color: var(--text); font-size: 14px; }
.det-actions { display: grid; gap: 6px; }
.events { display: grid; gap: 6px; }
.event { padding: 8px 10px; border-radius: 10px; background: var(--s2); font-size: 13px; overflow-wrap: anywhere; }
.event small { display: block; color: var(--text-3); font-size: 11.5px; margin-top: 2px; }
.event.note { border-left: 3px solid var(--warn); }

/* toast */
.toast { position: fixed; z-index: 60; left: 50%; top: calc(64px + var(--safe-t)); transform: translate(-50%, -8px); max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 12px; background: var(--s3); border: 1px solid var(--line-2); font-size: 14px; opacity: 0; pointer-events: none; transition: opacity 180ms var(--ease), transform 180ms var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: rgba(242, 123, 123, .5); }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(24px); } }

@media (min-width: 640px) {
  .topic-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sheet { align-items: center; }
  .sheet-card { border-radius: 20px; border-bottom: 1px solid var(--line-2); }
  .chat { left: 50%; width: min(760px, 100%); transform: translateX(-50%); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}
@media (max-width: 1180px) {
  .desk-grid { grid-template-columns: 320px minmax(0, 1fr); }
  .details { position: fixed; z-index: 25; top: 0; right: 0; bottom: 0; width: min(340px, 92vw); transform: translateX(100%); transition: transform 220ms var(--ease); box-shadow: -20px 0 40px rgba(0, 0, 0, .5); padding-top: var(--safe-t); }
  .details.is-open { transform: none; }
  #deskDetailsToggle { display: inline-flex !important; }
  .desk-stats div:nth-child(n+4) { display: none; }
}
@media (max-width: 760px) {
  .desk-top { gap: 10px; }
  .desk-top .bar-title span, .desk-me #deskName { display: none; }
  .desk-grid { grid-template-columns: minmax(0, 1fr); }
  .conv { display: none; }
  .desk.has-ticket .queue { display: none; }
  .desk.has-ticket .conv { display: flex; }
  .mobile-only { display: inline-flex !important; }
  .msg { max-width: 92%; }
  .templates { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
