/* ---------- Design tokens ---------- */
:root {
  --bg: #0b0d12;
  --bg-elev: #12151c;
  --surface: #161a23;
  --surface-2: #1d2230;
  --surface-hover: #222838;
  --border: #272d3b;
  --border-strong: #353d50;
  --text: #e7e9ef;
  --text-muted: #9aa3b5;
  --text-faint: #6b7385;
  --accent: #7c7ff5;
  --accent-strong: #6366f1;
  --accent-contrast: #ffffff;
  --accent-soft: rgba(124, 127, 245, 0.14);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.14);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.14);
  --danger: #f87171;
  --danger-strong: #ef4444;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.14);
  --focus: 0 0 0 3px rgba(124, 127, 245, 0.45);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 14px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sidebar-w: 236px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f6fa;
    --bg-elev: #ffffff;
    --surface: #ffffff;
    --surface-2: #f1f3f8;
    --surface-hover: #eceff6;
    --border: #e1e5ee;
    --border-strong: #cdd3df;
    --text: #151925;
    --text-muted: #5a6274;
    --text-faint: #8a92a3;
    --accent: #5b5ef0;
    --accent-strong: #4f46e5;
    --accent-soft: rgba(91, 94, 240, 0.1);
    --success: #059669;
    --success-soft: rgba(5, 150, 105, 0.1);
    --warning: #b45309;
    --warning-soft: rgba(217, 119, 6, 0.12);
    --danger: #dc2626;
    --danger-strong: #dc2626;
    --danger-soft: rgba(220, 38, 38, 0.1);
    --info: #2563eb;
    --info-soft: rgba(37, 99, 235, 0.1);
    --focus: 0 0 0 3px rgba(91, 94, 240, 0.35);
    --shadow: 0 10px 30px rgba(20, 25, 40, 0.12);
    --shadow-sm: 0 1px 2px rgba(20, 25, 40, 0.06);
    color-scheme: light;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; display: inline-block; vertical-align: bottom; }
.right { text-align: right; }
.pos { color: var(--success); }
.neg { color: var(--danger); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--accent-strong); color: #fff; padding: 8px 12px; border-radius: var(--radius-sm); }
.skip-link:focus { left: 8px; }
.noscript { padding: 24px; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: none;
  background: var(--bg-elev); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; align-self: flex-start;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.brand-logo {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #a855f7); color: #fff; font-weight: 800;
}
.brand-name { font-weight: 650; font-size: 15px; }
.brand-name small { color: var(--text-muted); font-weight: 500; margin-left: 2px; }
.nav { list-style: none; margin: 6px 0 0; padding: 0 10px; display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-weight: 500;
}
.nav a:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.sidebar-footer { margin-top: auto; padding: 14px; border-top: 1px solid var(--border); display: grid; gap: 10px; }
.whoami { display: flex; align-items: center; gap: 10px; min-width: 0; }
.whoami-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--surface-2); color: var(--text-muted); font-weight: 700; text-transform: uppercase;
}
.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.view { padding: 28px 32px 48px; max-width: 1280px; width: 100%; outline: none; }

@media (max-width: 860px) {
  .sidebar {
    position: fixed; z-index: 40; left: 0; top: 0; transform: translateX(-100%);
    transition: transform .2s ease; box-shadow: var(--shadow);
  }
  .shell.nav-open .sidebar { transform: none; }
  .topbar {
    display: flex; align-items: center; gap: 8px; padding: 10px 14px;
    border-bottom: 1px solid var(--border); background: var(--bg-elev); position: sticky; top: 0; z-index: 30;
  }
  .topbar-title { font-weight: 600; }
  .view { padding: 18px 16px 40px; }
}

/* ---------- Page header ---------- */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-header .subtitle { color: var(--text-muted); margin-top: 4px; }
.page-header .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb { font-size: 12.5px; color: var(--text-muted); margin-bottom: 6px; }
.breadcrumb a { color: var(--text-muted); }
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Cards & layout ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-header .hint { color: var(--text-muted); font-size: 12.5px; }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }
.stack { display: grid; gap: 18px; }
.stack-sm { display: grid; gap: 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) { .grid-3 { grid-template-columns: minmax(0, 1fr); } }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.stat { padding: 18px; }
.stat .label { color: var(--text-muted); font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.stat .value { font-size: 28px; font-weight: 700; margin-top: 6px; letter-spacing: -0.02em; }
.stat .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 0; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surface-2); --btn-fg: var(--text); --btn-border: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: var(--radius-sm);
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-border);
  font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, opacity .12s;
}
.btn:hover:not(:disabled) { background: var(--surface-hover); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { --btn-bg: var(--accent-strong); --btn-fg: #fff; --btn-border: transparent; }
.btn-primary:hover:not(:disabled) { background: var(--accent); }
.btn-danger { --btn-bg: var(--danger-soft); --btn-fg: var(--danger); --btn-border: transparent; }
.btn-danger:hover:not(:disabled) { background: var(--danger-strong); color: #fff; }
.btn-danger-solid { --btn-bg: var(--danger-strong); --btn-fg: #fff; --btn-border: transparent; }
.btn-danger-solid:hover:not(:disabled) { background: var(--danger); }
.btn-ghost { --btn-bg: transparent; --btn-border: transparent; --btn-fg: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { color: var(--text); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-icon { width: 34px; padding: 0; }
.btn-icon svg { width: 18px; height: 18px; fill: currentColor; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--btn-fg); border-right-color: transparent; animation: spin .7s linear infinite;
}

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field > label, .field > .label { font-weight: 550; font-size: 13px; }
.field .help { color: var(--text-faint); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: minmax(0, 1fr); } .form-grid .span-2 { grid-column: auto; } }
.input, .select, .textarea {
  width: 100%; min-width: 0; height: 36px; padding: 0 11px;
  background: var(--bg); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font: inherit; transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; min-height: 90px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.textarea.code { font-family: var(--mono); font-size: 12.5px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.input[readonly], .textarea[readonly] { background: var(--surface-2); }
.input:user-invalid, .textarea:user-invalid { border-color: var(--danger); }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }
.input-affix { position: relative; }
.input-affix .affix { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; }
.input-affix .input { padding-left: 24px; }
input[type="file"].input { padding: 5px 8px; height: auto; }
input[type="file"]::file-selector-button {
  margin-right: 10px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  border-radius: 6px; padding: 4px 10px; font: inherit; cursor: pointer;
}
.form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { flex: 1 1 160px; }

/* Switch (checkbox) */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track {
  width: 36px; height: 20px; border-radius: 999px; background: var(--border-strong); position: relative; flex: none;
  transition: background .15s;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.switch input:checked + .track { background: var(--accent-strong); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: var(--focus); }
.switch input:disabled + .track { opacity: .5; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--text-muted); white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.plain::before { display: none; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; background: var(--surface); position: sticky; top: 0; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--surface-hover); }
.table tr.clickable { cursor: pointer; }
.table td.actions { text-align: right; white-space: nowrap; }
.table td.actions .btn + .btn { margin-left: 6px; }
.table .cell-main { font-weight: 600; }
.table .cell-sub { color: var(--text-muted); font-size: 12.5px; }

.thumb {
  width: 40px; height: 40px; border-radius: 9px; object-fit: cover; background: var(--surface-2);
  display: grid; place-items: center; color: var(--text-muted); font-weight: 700; flex: none; border: 1px solid var(--border);
}
.with-thumb { display: flex; align-items: center; gap: 12px; min-width: 0; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }

/* ---------- States ---------- */
.state { display: grid; place-items: center; gap: 10px; text-align: center; padding: 42px 20px; color: var(--text-muted); }
.state .state-title { color: var(--text); font-weight: 600; }
.state.error .state-title { color: var(--danger); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--border-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-hover), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Progress ---------- */
.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-strong), #a855f7); transition: width .15s; }

/* ---------- Media upload ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.media-card { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; }
.media-preview { aspect-ratio: 16 / 9; border-radius: var(--radius-sm); background: var(--surface-2); display: grid; place-items: center; overflow: hidden; color: var(--text-faint); }
.media-preview.square { aspect-ratio: 1; max-width: 140px; }
.media-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Markdown editor ---------- */
.md-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.md-editor .textarea { min-height: 240px; font-family: var(--mono); font-size: 12.5px; }
.md-preview { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; min-height: 240px; max-height: 480px; overflow: auto; background: var(--bg); }
@media (max-width: 860px) { .md-editor { grid-template-columns: minmax(0, 1fr); } }
.markdown h1, .markdown h2, .markdown h3 { margin: .8em 0 .4em; }
.markdown h1 { font-size: 20px; } .markdown h2 { font-size: 17px; } .markdown h3 { font-size: 15px; }
.markdown p, .markdown ul, .markdown ol, .markdown pre, .markdown blockquote { margin: 0 0 .75em; }
.markdown ul, .markdown ol { padding-left: 1.4em; }
.markdown code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.markdown pre { background: var(--surface-2); padding: 10px 12px; border-radius: var(--radius-sm); overflow: auto; }
.markdown pre code { background: none; padding: 0; }
.markdown blockquote { border-left: 3px solid var(--border-strong); padding-left: 12px; color: var(--text-muted); }
.markdown hr { border: none; border-top: 1px solid var(--border); margin: 1em 0; }

/* ---------- Code blocks ---------- */
.code-block { position: relative; }
.code-block pre {
  margin: 0; padding: 14px 16px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; word-break: break-all; overflow: auto; max-height: 360px;
}
.code-block .copy { position: absolute; top: 8px; right: 8px; }

/* ---------- Dialogs ---------- */
dialog.dialog {
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0; background: var(--surface); color: var(--text);
  width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow); max-height: calc(100vh - 48px);
}
dialog.dialog.wide { width: min(900px, calc(100vw - 32px)); }
dialog.dialog::backdrop { background: rgba(5, 7, 12, 0.6); backdrop-filter: blur(2px); }
.dialog-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-body { padding: 18px 20px; overflow: auto; max-height: calc(100vh - 200px); }
.dialog-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
dialog.dialog[open] { animation: pop .14s ease-out; }
@keyframes pop { from { transform: translateY(6px) scale(.98); opacity: 0; } }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 1000; display: grid; gap: 8px; width: min(380px, calc(100vw - 36px)); }
.toast {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  border-left: 4px solid var(--info); animation: slidein .18s ease-out;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast .toast-msg { flex: 1; overflow-wrap: anywhere; }
.toast .toast-close { background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 18px; line-height: 1; padding: 0 2px; }
.toast.leaving { opacity: 0; transform: translateX(10px); transition: all .2s; }
@keyframes slidein { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Login ---------- */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 10% -10%, var(--accent-soft), transparent 60%), var(--bg); }
.login-card { width: min(400px, 100%); padding: 28px; display: grid; gap: 18px; }
.login-card .brand { padding: 0; }
.login-card .error-box { background: var(--danger-soft); color: var(--danger); padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; }
.otp-input { letter-spacing: .4em; font-family: var(--mono); font-size: 18px; text-align: center; }

/* ---------- Misc ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs button {
  background: none; border: none; color: var(--text-muted); font: inherit; font-weight: 550; padding: 9px 12px; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.chip-list { display: flex; flex-wrap: wrap; gap: 4px; }
.json { font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-all; margin: 6px 0 0; color: var(--text-muted); max-width: 480px; }
details > summary { cursor: pointer; color: var(--text-muted); }
.divider { height: 1px; background: var(--border); margin: 4px 0; }
.result-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--surface-2); }

/* ---------- Support ---------- */
.inline-form .field.grow { flex: 3 1 260px; }
.counter {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); font: inherit; font-size: 12.5px; font-weight: 550;
}
button.counter { cursor: pointer; }
button.counter:hover { background: var(--surface-hover); color: var(--text); }
.counter.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.counter .counter-value { font-weight: 700; color: var(--text); }
.counter.danger .counter-value { color: var(--danger); }
.table td.unread-col { width: 1%; padding-right: 0; }
.unread-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.unread-dot.read { background: transparent; }
.table .cell-main.strong { font-weight: 750; }
.ticket-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .ticket-layout { grid-template-columns: minmax(0, 1fr); } }
.thread { display: grid; gap: 12px; max-height: 60vh; overflow-y: auto; padding: 2px; }
.msg { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; background: var(--bg); max-width: 88%; }
.msg.staff { justify-self: end; background: var(--accent-soft); border-color: transparent; }
.msg-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; margin-bottom: 4px; }
.msg-author { font-weight: 650; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
