/* Moderation app additions on top of the shared design system. Only theme tokens, no fixed colours. */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  align-items: center;
  margin-bottom: var(--s4);
}
.toolbar .search {
  flex: 1 1 240px;
  min-height: var(--tap);
  padding: 0 var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 0.8rem;
  white-space: nowrap;
}
.chip-brand { background: var(--brand-soft); color: var(--ink); }
.chip-warn { background: var(--surface-2); color: var(--warn-text); }
.chip-danger { background: var(--surface-2); color: var(--danger-text); }
.chip-ok { background: var(--surface-2); color: var(--ok-text); }
.row-main { display: flex; flex-direction: column; min-width: 0; }
.row-main .muted { font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager { display: flex; gap: var(--s3); align-items: center; justify-content: flex-end; margin-top: var(--s3); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: var(--s2) var(--s4); margin: 0 0 var(--s4); }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; }
.history { list-style: none; padding: 0; margin: 0; }
.history li { padding: var(--s2) 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.history li:last-child { border-bottom: 0; }
textarea.text-edit {
  width: 100%;
  min-height: 64px;
  padding: var(--s2) var(--s3);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) / 2);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  resize: vertical;
}
textarea.text-edit.edited { border-color: var(--brand); }
textarea.text-edit:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.texts { display: flex; flex-direction: column; gap: var(--s3); }
.text-row { padding: var(--s4); }
.text-row header { display: flex; gap: var(--s3); align-items: center; justify-content: space-between; margin-bottom: var(--s2); }
.text-row code { font-size: 0.85rem; color: var(--ink-2); }
.text-cols { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.text-col label { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--ink-2); margin-bottom: 4px; }
.link-btn { border: 0; background: none; color: var(--brand-text); font: inherit; font-size: 0.8rem; cursor: pointer; padding: 0; }
.stats { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin-bottom: var(--s5); }
.stat { display: block; padding: var(--s4); color: inherit; text-decoration: none; }
.stat strong { display: block; font-size: 2rem; font-family: var(--font-display, inherit); line-height: 1.1; }
.stat.urgent strong { color: var(--danger-text); }
.tabs { display: flex; gap: var(--s2); margin-bottom: var(--s4); border-bottom: 1px solid var(--line); }
.tab { padding: var(--s2) var(--s3); border: 0; border-bottom: 2px solid transparent; background: none; color: var(--ink-2); font: inherit; cursor: pointer; }
.tab[aria-selected='true'] { border-bottom-color: var(--brand); color: var(--ink); font-weight: 600; }
.evidence { white-space: pre-wrap; padding: var(--s4); background: var(--surface-2); border-radius: var(--radius); margin: 0 0 var(--s4); }
.evidence-media { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s4); }
.evidence-media img { width: 120px; height: 120px; object-fit: cover; border-radius: calc(var(--radius) / 2); }
.detail-grid { display: grid; gap: var(--s5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .detail-grid { grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); } }
.decide .field select, .decide .field textarea { width: 100%; }
.decide textarea { min-height: 96px; padding: var(--s3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; }
.graph-card { margin-bottom: var(--s5); }
.graph { width: 100%; height: auto; max-height: 460px; display: block; }
.gnode { cursor: pointer; }
.gnode circle { fill: var(--surface-2); stroke: var(--line); stroke-width: 2; }
.gnode.center circle { fill: var(--brand-soft); stroke: var(--brand); }
.gnode.out circle { stroke: var(--danger); stroke-dasharray: 3 3; }
.gnode:hover circle { stroke: var(--brand); }
.ginit { font-weight: 700; fill: var(--ink); font-size: 14px; }
.glabel { fill: var(--ink-2); font-size: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: var(--s4); list-style: none; padding: 0; margin: var(--s3) 0 var(--s4); font-size: 0.85rem; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: var(--s2); }

/* Chat moderation */
.gate { max-width: 560px; }
.gate .text-edit { min-height: 80px; }
.takeover-banner {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: var(--s3);
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s3);
  padding: var(--s3) var(--s4);
  border: 2px solid var(--warn);
  border-radius: var(--radius);
  background: var(--surface);
}
.staff-msgs { list-style: none; padding: 0; margin: 0 0 var(--s4); display: flex; flex-direction: column; gap: var(--s2); }
.staff-msg { padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.staff-msg.hidden { border-style: dashed; opacity: 0.75; }
.staff-msg.takeover { border-color: var(--warn); }
.staff-msg-head { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; font-size: 0.85rem; }
.staff-msg-body { margin: var(--s1) 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.staff-msg-actions { display: flex; gap: var(--s3); margin-top: var(--s2); }
.staff-msg .history { margin-top: var(--s2); padding-left: var(--s3); border-left: 3px solid var(--line); }
.staff-composer { position: sticky; bottom: 0; display: flex; gap: var(--s2); align-items: flex-end; padding: var(--s3) 0; background: var(--bg); }
.staff-composer .text-edit { flex: 1; }
.participant { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; justify-content: space-between; }
aside .card + .card { margin-top: var(--s4); }
.history li.reported { padding-left: var(--s3); border-left: 3px solid var(--danger); }

/* Groups */
.mod-cover { width: 64px; height: 40px; flex: none; border-radius: calc(var(--radius) / 2); background: linear-gradient(135deg, var(--brand-soft), var(--surface-2)) center / cover; }
.mod-hero { aspect-ratio: 2 / 1; margin: calc(-1 * var(--s5)) calc(-1 * var(--s5)) var(--s3); border-radius: var(--radius) var(--radius) 0 0; background: linear-gradient(135deg, var(--brand-soft), var(--surface-2)) center / cover; }
.cover-btn { margin-bottom: var(--s3); cursor: pointer; }
.invite-form .mini { display: flex; align-items: center; gap: var(--s2); font-size: 0.85rem; color: var(--ink-2); }
.invite-form .mini input { width: 72px; min-height: var(--tap); padding: 0 var(--s2); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; }
.participant code { font-size: 0.85rem; overflow-wrap: anywhere; }

/* Verification */
.verify-item { margin-bottom: var(--s4); }
.verify-head { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; margin-bottom: var(--s3); }
.verify-compare { display: flex; gap: var(--s3); flex-wrap: wrap; }
.verify-compare figure { margin: 0; }
.verify-compare img { display: block; width: 180px; height: 240px; object-fit: cover; border-radius: var(--radius); background: var(--surface-2); }
.verify-compare figure:first-child img { outline: 3px solid var(--brand); }
.verify-compare figcaption { font-size: 0.8rem; color: var(--ink-2); margin-top: 4px; }
.verify-actions { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; margin-top: var(--s4); }
.verify-actions .select { min-width: 220px; max-width: 360px; }
.signup-item { margin-bottom: var(--s4); }
.signup-facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--s1) var(--s4); margin: 0; }
.signup-facts dt { color: var(--ink-2); }
.signup-facts dd { margin: 0; overflow-wrap: anywhere; }
.signup-item .verify-actions .select { flex: 1 1 220px; max-width: 420px; }
.list-item .mini { display: flex; align-items: center; gap: var(--s2); font-size: 0.85rem; color: var(--ink-2); }
.list-item .mini .select { min-height: 36px; padding: 0 var(--s2); }
.scope-card { margin-bottom: var(--s3); }
.scope-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); margin-bottom: var(--s2); }
.scope-chip { margin: 0 var(--s2) var(--s2) 0; }

/* Media stream and User 360 → Media (#39) */
.page.page-wide { max-width: 1200px; }
.media-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin-bottom: var(--s2); }
.media-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--s3); }
.media-tile { min-width: 0; display: flex; flex-direction: column; gap: var(--s1); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.media-tile.gone .media-file img { opacity: 0.55; }
.media-file { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.media-file a { position: absolute; inset: 0; }
.media-file img { display: block; width: 100%; height: 100%; object-fit: cover; }
.media-voice { display: grid; place-items: center; padding: var(--s2); width: 100%; }
.media-voice audio, .media-voice video { width: 100%; }
.media-voice video { max-height: 100%; background: #000; }
.media-badges { position: absolute; left: var(--s1); top: var(--s1); right: var(--s1); display: flex; flex-wrap: wrap; gap: 4px; pointer-events: none; }
.media-badges .chip { font-size: 0.72rem; }
.media-meta { display: flex; flex-direction: column; gap: 2px; padding: 0 var(--s2); font-size: 0.85rem; min-width: 0; }
.media-meta > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-hide { padding: 0 var(--s2) var(--s2); }
.media-reasons { display: flex; flex-wrap: wrap; gap: 4px; }
.media-reasons .chip { cursor: pointer; border: 1px solid var(--line); font-size: 0.78rem; }
.media-end { min-height: 48px; display: grid; place-items: center; }
@media (max-width: 520px) {
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
}

/* System (#49) */
.system-alert { display: flex; flex-direction: column; gap: 2px; padding: var(--s3) var(--s4); margin-bottom: var(--s3); border-radius: var(--radius); background: var(--surface-2); border-left: 4px solid var(--danger); }
.system-alert strong { color: var(--danger-text); }
.system-ok { display: flex; align-items: center; gap: var(--s2); color: var(--ok-text); margin: 0 0 var(--s4); }
.system-detail { display: block; font-family: ui-monospace, monospace; font-size: 0.82rem; color: var(--ink-2); overflow-wrap: anywhere; }
.system-instance { margin-bottom: var(--s5); }
.system-facts { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin: 0; }
.system-facts dt { font-size: 0.8rem; color: var(--ink-2); }
.system-facts dd { margin: 0; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; margin-bottom: var(--s5); }
.system-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.system-table th, .system-table td { padding: var(--s2); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.system-table thead th { font-weight: 600; white-space: nowrap; }
.system-table tr.failing td:first-child { color: var(--danger-text); font-weight: 600; }
.system-errors code { overflow-wrap: anywhere; }
.staff-login { max-width: 380px; margin: 12vh auto 0; }

.email-detail { padding: 0 var(--s3) var(--s3); }
.email-detail code { overflow-wrap: anywhere; }

/* Texts (CMS, #52): areas sidebar, sources, usage, import/export */
.texts-io { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); margin-bottom: var(--s4); }
.texts-io .mini { display: flex; align-items: center; gap: var(--s2); font-size: 0.85rem; color: var(--ink-2); }
.texts-io .mini .select { min-height: 36px; padding: 0 var(--s2); }
.texts-import { cursor: pointer; }
.texts-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--s4); align-items: start; }
.texts-areas { position: sticky; top: var(--s3); display: flex; flex-direction: column; max-height: calc(100dvh - 2 * var(--s3)); overflow-y: auto; }
.area-item { display: flex; align-items: center; gap: var(--s2); padding: 6px var(--s3); border: 0; border-radius: var(--radius); background: none; color: inherit; font: inherit; font-size: 0.92rem; text-align: left; cursor: pointer; }
.area-item:hover { background: var(--surface-2); }
.area-item.on { background: var(--surface-2); font-weight: 600; }
.area-item .chip { font-size: 0.72rem; padding: 0 6px; }
.texts-area-select { display: none; }
.texts-main { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.text-head { display: flex; gap: var(--s3); align-items: center; justify-content: space-between; }
.text-used { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 0 var(--s2); font-size: 0.8rem; }
.text-used .chip { font-size: 0.75rem; }
.text-base { margin: 4px 0 0; font-size: 0.8rem; overflow-wrap: anywhere; }
.chip.src-edited { background: var(--brand-soft); color: var(--ink); }
.chip.src-brand { background: var(--surface-2); color: var(--accent); }
.chip.src-missing { background: var(--surface-2); color: var(--danger-text); }
.text-preview { padding: var(--s2) 0 var(--s4); }
.texts-keys { font-family: ui-monospace, monospace; font-size: 0.8rem; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .texts-layout { grid-template-columns: minmax(0, 1fr); }
  .texts-areas { display: none; }
  .texts-area-select { display: block; }
}
.media-open { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; }
.media-open img { display: block; }
.texts-folder { margin-bottom: var(--s4); }
.texts-folder p { margin: 0 0 var(--s2); }
.texts-folder-files { margin: 0 0 var(--s2); padding-left: var(--s4); }
.texts-folder-error { border-color: var(--danger); }

/* Sales (#69) */
.sale-thumb { position: relative; display: inline-block; width: 48px; height: 48px; padding: 0; border: 0; border-radius: var(--r1, 6px); overflow: hidden; cursor: pointer; background: var(--line); vertical-align: middle; margin-right: var(--s2); }
.sale-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sale-kind { position: absolute; inset: auto 2px 2px auto; font-size: 0.7rem; color: #fff; text-shadow: 0 0 3px #000; }
.sale-ids { font-family: var(--font-mono, monospace); font-size: 0.8rem; white-space: nowrap; }
.stat-coins strong { font-size: 1.4rem; white-space: nowrap; }
