/* =====================================================================
   Mugshot.Chat — main site
   Booking-room dark: warm sodium-lamp orange on near-black, with the chat
   itself given the whole stage. Everything else gets out of the way.
   ===================================================================== */

:root {
  --brand:        #F16324;
  --brand-hot:    #ff8244;
  --brand-deep:   #b8410f;
  --brand-tint:   rgba(241, 99, 36, .12);
  --brand-tint-2: rgba(241, 99, 36, .28);

  --bg:        #0b0b0d;
  --bg-2:      #101014;
  --surface:   #16161b;
  --surface-2: #1d1d23;
  --surface-3: #26262e;
  --line:      #26262e;
  --line-soft: #1c1c22;

  --ink:       #ecedf0;
  --ink-2:     #9aa0ab;
  --ink-3:     #646a75;

  --live:      #2ecc71;
  --danger:    #ef4444;
  --danger-bg: rgba(239, 68, 68, .12);
  --warn:      #f0a500;

  --radius:    14px;
  --radius-sm: 10px;
  --radius-xs: 7px;

  --shadow-lg: 0 24px 60px -18px rgba(0, 0, 0, .75);
  --shadow-md: 0 10px 30px -12px rgba(0, 0, 0, .6);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --rail: 268px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Sodium-lamp wash so pure black doesn't read as "dead page". */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1100px 520px at 50% -12%, rgba(241, 99, 36, .10), transparent 62%),
    radial-gradient(760px 420px at 100% 108%, rgba(241, 99, 36, .05), transparent 60%);
  z-index: 0;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: var(--brand-hot); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #33333d; }

/* ---------------------------------------------------------------- shell */

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100dvh;
  max-width: 1240px;
  margin: 0 auto;
}

/* ---------------------------------------------------------------- masthead */

.masthead {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(22, 22, 27, .92), rgba(11, 11, 13, .55));
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--brand-hot), var(--brand-deep));
  box-shadow: 0 6px 18px -6px rgba(241, 99, 36, .8);
  flex: 0 0 auto;
}
.brand-mark svg { width: 21px; height: 21px; fill: #fff; }

.brand-text {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}
.brand-name {
  display: block;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -.015em;
  line-height: 1.15;
}
.brand-tag {
  display: block;
  font-size: .705rem;
  color: var(--ink-3);
  letter-spacing: .07em;
  text-transform: uppercase;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 9px;
  border-radius: 999px;
  background: rgba(46, 204, 113, .10);
  border: 1px solid rgba(46, 204, 113, .26);
  color: #8bf0b6;
  font-size: .74rem;
  font-weight: 600;
  white-space: nowrap;
}
.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 rgba(46, 204, 113, .6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(46, 204, 113, .55); }
  70%  { box-shadow: 0 0 0 7px rgba(46, 204, 113, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

.masthead-spacer { flex: 1; }

.masthead-actions { display: flex; align-items: center; gap: 8px; }

/* identity chip */
.me {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color .15s, background .15s;
}
.me:hover { border-color: var(--brand-tint-2); background: var(--surface-2); }
.me img { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-3); }
.me-name { font-size: .845rem; font-weight: 600; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-tag {
  font-size: .62rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 5px; background: var(--surface-3); color: var(--ink-2);
}

.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  transition: color .15s, border-color .15s, background .15s;
}
.icon-btn:hover { color: var(--ink); border-color: var(--surface-3); background: var(--surface-2); }
.icon-btn svg { width: 17px; height: 17px; fill: currentColor; }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 17px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform .12s, filter .15s, background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(140deg, var(--brand-hot), var(--brand-deep));
  color: #fff;
  box-shadow: 0 8px 22px -10px rgba(241, 99, 36, .9);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border-color: var(--line); background: var(--surface); color: var(--ink-2); }
.btn-ghost:hover { color: var(--ink); border-color: var(--surface-3); background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-sm { padding: 7px 12px; font-size: .8rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------------------------------------------------------------- layout */

.stage {
  display: grid;
  grid-template-columns: 1fr var(--rail);
  min-height: 0;
}

.room {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 0;
  min-width: 0;
  position: relative;
}

/* ------------------------------------------------------- admin strip */

.admin-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  background: linear-gradient(90deg, rgba(239, 68, 68, .16), rgba(239, 68, 68, .05));
  border-bottom: 1px solid rgba(239, 68, 68, .28);
  font-size: .78rem;
  color: #ffb4b4;
}
.admin-strip b { color: #fff; letter-spacing: .05em; font-size: .7rem; text-transform: uppercase; }
.admin-strip code { font-family: var(--mono); font-size: .72rem; color: #ffd9d9; }
.admin-strip .spacer { flex: 1; }
.admin-strip button {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(239, 68, 68, .4);
  color: #ffd9d9;
  font-size: .74rem;
  font-weight: 600;
}
.admin-strip button:hover { background: rgba(239, 68, 68, .18); color: #fff; }

/* ------------------------------------------------------- welcome banner */

.welcome {
  margin: 18px 20px 4px;
  padding: 22px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    linear-gradient(140deg, rgba(241, 99, 36, .13), transparent 55%),
    var(--surface);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.welcome::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(90deg, rgba(255,255,255,.028) 0 1px, transparent 1px 34px);
  pointer-events: none;
}
.welcome h2 {
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 6px;
}
.welcome p {
  color: var(--ink-2);
  font-size: .885rem;
  max-width: 46ch;
  margin-bottom: 16px;
}
.welcome-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.welcome-note { font-size: .77rem; color: var(--ink-3); }

/* ---------------------------------------------------------------- log */

.log {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 20px 20px;
  scroll-behavior: smooth;
  min-height: 0;
}

.log-status {
  text-align: center;
  padding: 26px 0;
  color: var(--ink-3);
  font-size: .84rem;
}

.load-more {
  display: block;
  margin: 0 auto 14px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: .78rem;
}
.load-more:hover { color: var(--ink); border-color: var(--surface-3); }

.daybreak {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 12px;
  color: var(--ink-3);
  font-size: .7rem;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.daybreak::before, .daybreak::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}

/* one message */
.msg {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 11px;
  padding: 4px 8px 4px 0;
  border-radius: var(--radius-xs);
  position: relative;
  animation: rise .18s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .msg { animation: none; } }

.msg + .msg { margin-top: 2px; }
.msg.fresh-author { margin-top: 14px; }
.msg:hover { background: rgba(255, 255, 255, .022); }
.msg.mine .msg-name { color: var(--brand-hot); }
.msg.pending { opacity: .55; }
.msg.removing { opacity: 0; transform: scale(.98); transition: opacity .2s, transform .2s; }

.msg-avatar {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--surface-2);
  object-fit: cover;
}
/* Every line keeps its avatar and its header. Grouping consecutive lines
   under one name reads well until a message is deleted, trimmed off the top,
   or simply scrolled to — and then nobody can tell who said it. Spacing does
   the grouping instead; attribution is never implied. */

.msg-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 1px;
  flex-wrap: wrap;
}

.msg-name { font-weight: 700; font-size: .875rem; }
.msg-time { font-size: .7rem; color: var(--ink-3); }

.badge {
  font-size: .59rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--ink-2);
}
.badge.staff { background: rgba(239, 68, 68, .18); color: #ff9d9d; }
.badge.bot   { background: var(--brand-tint); color: var(--brand-hot); }
.badge.guest { background: var(--surface-3); color: var(--ink-3); }

.msg-body {
  font-size: .9rem;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  min-width: 0;
}
.msg-body a { color: var(--brand-hot); word-break: break-all; }
.msg-body img.gtc-image {
  max-width: min(340px, 100%);
  border-radius: var(--radius-sm);
  display: block;
  margin-top: 7px;
  border: 1px solid var(--line);
}
.msg-body ul, .msg-body ol { margin: 6px 0 4px 18px; }
.msg-body li { margin: 2px 0; }
.msg-ip {
  font-family: var(--mono);
  font-size: .66rem;
  color: var(--ink-3);
  margin-left: 2px;
}

/* per-message moderation, admins only */
.msg-tools {
  position: absolute;
  top: -9px;
  right: 8px;
  display: none;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  box-shadow: var(--shadow-md);
}
.msg:hover .msg-tools { display: flex; }
.msg-tools button {
  width: 27px; height: 27px;
  display: grid; place-items: center;
  border-radius: 6px;
  color: var(--ink-2);
  font-size: .82rem;
}
.msg-tools button:hover { background: var(--surface-3); color: var(--ink); }
.msg-tools button.danger:hover { background: var(--danger-bg); color: #ff8f8f; }

/* bot flavour, carried over from the Guess The Charge integration */
.gtc-points  { color: var(--live); font-weight: 700; }
.gtc-penalty { color: var(--danger); font-weight: 700; }
.gtc-streak  { color: var(--warn); font-weight: 700; }
.gtc-hint    { color: var(--ink-2); font-style: italic; }
.gtc-answer, .gtc-remaining-option { cursor: pointer; }
.gtc-answer:hover, .gtc-remaining-option:hover { color: var(--brand-hot); }

/* ---------------------------------------------------------------- composer */

.composer {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(11, 11, 13, .4), var(--bg-2));
}

.composer-shell {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 8px 8px 8px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.composer-shell:focus-within {
  border-color: var(--brand-tint-2);
  box-shadow: 0 0 0 3px var(--brand-tint);
}

.composer textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  border: 0;
  outline: none;
  background: none;
  font-size: .9rem;
  line-height: 1.45;
  padding: 6px 0;
  max-height: 132px;
}
.composer textarea::placeholder { color: var(--ink-3); }

.composer-send {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--brand-hot), var(--brand-deep));
  color: #fff;
  flex: 0 0 auto;
  transition: filter .15s, opacity .15s;
}
.composer-send svg { width: 17px; height: 17px; fill: currentColor; }
.composer-send:disabled { opacity: .35; }
.composer-send:not(:disabled):hover { filter: brightness(1.1); }

.composer-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 7px;
  padding: 0 4px;
  font-size: .73rem;
  color: var(--ink-3);
  min-height: 18px;
}
.composer-meta .spacer { flex: 1; }
.composer-meta .count.warn { color: var(--warn); }
.composer-meta .count.over { color: var(--danger); }

.quick-emoji { display: flex; gap: 2px; }
.quick-emoji button {
  width: 24px; height: 24px;
  border-radius: 6px;
  font-size: .95rem;
  line-height: 1;
  opacity: .65;
  transition: opacity .12s, background .12s;
}
.quick-emoji button:hover { opacity: 1; background: var(--surface-2); }

.composer-locked {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px dashed var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: .865rem;
  flex-wrap: wrap;
}
.composer-locked .spacer { flex: 1; }

/* ---------------------------------------------------------------- rail */

.rail {
  border-left: 1px solid var(--line-soft);
  background: var(--bg-2);
  overflow-y: auto;
  padding: 16px 14px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: .705rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.card-head .count {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: .68rem;
  letter-spacing: 0;
}
.card-body { padding: 12px 14px; }

.roster { max-height: 320px; overflow-y: auto; padding: 6px; }
.roster-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  font-size: .84rem;
}
.roster-row:hover { background: var(--surface-2); }
.roster-row img { width: 26px; height: 26px; border-radius: 8px; background: var(--surface-3); }
.roster-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster-row .badge { margin-left: auto; }
.roster-empty { padding: 14px; text-align: center; color: var(--ink-3); font-size: .8rem; }

.rules { list-style: none; display: grid; gap: 9px; }
.rules li {
  display: flex;
  gap: 9px;
  font-size: .815rem;
  color: var(--ink-2);
  line-height: 1.45;
}
.rules li::before {
  content: '';
  width: 5px; height: 5px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--brand);
  flex: 0 0 auto;
}

.identity { display: grid; gap: 11px; }
.identity-row { display: flex; align-items: center; gap: 11px; }
.identity-row img { width: 42px; height: 42px; border-radius: 12px; background: var(--surface-3); }
.identity-name { font-weight: 700; font-size: .93rem; }
.identity-sub { font-size: .755rem; color: var(--ink-3); }
.identity-actions { display: flex; gap: 7px; flex-wrap: wrap; }

/* Server-rendered copy in the rail. This is the page's only durable text —
   the chat above it is user-generated and deliberately not indexed — so it is
   real, visible, scrollable content rather than anything tucked out of sight. */
.prose h2 {
  font-size: .93rem;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: 7px;
}
.prose p {
  font-size: .815rem;
  line-height: 1.55;
  color: var(--ink-2);
}
.prose p + p { margin-top: 9px; }
.prose a { color: var(--brand-hot); text-decoration: none; }
.prose a:hover { text-decoration: underline; }

.faq { padding: 6px 8px 10px; }
.faq details {
  border-bottom: 1px solid var(--line-soft);
}
.faq details:last-child { border-bottom: 0; }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 9px 6px 9px 20px;
  position: relative;
  font-size: .815rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: '+';
  position: absolute;
  left: 5px;
  top: 8px;
  color: var(--brand);
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.4;
}
.faq details[open] summary::before { content: '\2212'; }
.faq summary:hover { color: var(--brand-hot); }
.faq details p {
  padding: 0 6px 11px 20px;
  font-size: .79rem;
  line-height: 1.55;
  color: var(--ink-2);
}

.rail-foot {
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: .715rem;
  color: var(--ink-3);
}
.rail-foot a { color: var(--ink-3); text-decoration: none; }
.rail-foot a:hover { color: var(--ink-2); }

/* ---------------------------------------------------------------- modals */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 4, 6, .78);
  backdrop-filter: blur(6px);
}
.overlay.open { display: flex; animation: fade .16s ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  width: 100%;
  max-width: 430px;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: lift .18s ease-out;
}
.sheet.wide { max-width: 760px; }
@keyframes lift { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }

.sheet-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.sheet-head h3 { font-size: 1.06rem; font-weight: 800; letter-spacing: -.015em; }
.sheet-head .sub { font-size: .78rem; color: var(--ink-3); margin-top: 2px; }
.sheet-close {
  margin-left: auto;
  width: 32px; height: 32px;
  border-radius: 9px;
  display: grid; place-items: center;
  color: var(--ink-3);
  font-size: 1.25rem;
  line-height: 1;
}
.sheet-close:hover { background: var(--surface-2); color: var(--ink); }
.sheet-body { padding: 18px 20px 20px; }

.field { margin-bottom: 15px; }
.field label {
  display: block;
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.field input, .field select {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-2);
  outline: none;
  font-size: .9rem;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus {
  border-color: var(--brand-tint-2);
  box-shadow: 0 0 0 3px var(--brand-tint);
}
.field .hint { font-size: .76rem; color: var(--ink-3); margin-top: 6px; line-height: 1.45; }

.alert {
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  margin-bottom: 15px;
  border: 1px solid transparent;
}
.alert-error { background: var(--danger-bg); border-color: rgba(239, 68, 68, .3); color: #ffb0b0; }
.alert-warn  { background: rgba(240, 165, 0, .12); border-color: rgba(240, 165, 0, .3); color: #ffd98a; }

.swap { text-align: center; margin-top: 16px; font-size: .82rem; color: var(--ink-3); }
.swap button { color: var(--brand-hot); font-weight: 600; }
.swap button:hover { text-decoration: underline; }

/* avatar picker */
.avatars {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
}
.avatars button {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  background: var(--bg-2);
  display: grid;
  place-items: center;
  transition: border-color .12s, transform .12s;
}
.avatars button:hover { transform: translateY(-2px); }
.avatars button.sel { border-color: var(--brand); background: var(--brand-tint); }
.avatars img { width: 76%; height: 76%; }

/* one-time credentials */
.cred {
  font-family: var(--mono);
  font-size: .93rem;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-2);
  word-break: break-all;
  user-select: all;
}

/* ---------------------------------------------------------------- admin panel */

.admin-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.admin-toolbar input {
  flex: 1;
  min-width: 160px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-2);
  outline: none;
  font-size: .86rem;
}
.admin-tabs { display: flex; gap: 4px; }
.admin-tabs button {
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  font-size: .8rem;
  color: var(--ink-2);
}
.admin-tabs button.on { background: var(--brand-tint); border-color: var(--brand-tint-2); color: var(--brand-hot); }

.admin-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.admin-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: .68rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--surface);
}
.admin-table td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.admin-table tr:hover td { background: var(--surface-2); }
.admin-user { display: flex; align-items: center; gap: 8px; }
.admin-user img { width: 24px; height: 24px; border-radius: 7px; background: var(--surface-3); }
.admin-ip { font-family: var(--mono); font-size: .73rem; color: var(--ink-2); }
.admin-acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.admin-acts button {
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid var(--line);
  font-size: .73rem;
  color: var(--ink-2);
}
.admin-acts button:hover { color: var(--ink); border-color: var(--surface-3); background: var(--surface-3); }
.admin-acts button.danger { color: #ff9d9d; border-color: rgba(239, 68, 68, .3); }
.admin-acts button.danger:hover { background: var(--danger-bg); color: #ffbcbc; }
.admin-scroll { max-height: min(56dvh, 460px); overflow-y: auto; }

.tag-banned { color: #ff9d9d; font-weight: 700; font-size: .74rem; }
.tag-muted  { color: var(--warn); font-weight: 700; font-size: .74rem; }
.tag-ok     { color: var(--ink-3); font-size: .74rem; }

.log-list { display: grid; gap: 7px; font-size: .8rem; }
.log-row {
  display: flex;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  background: var(--bg-2);
  color: var(--ink-2);
  flex-wrap: wrap;
}
.log-row .when { color: var(--ink-3); font-family: var(--mono); font-size: .72rem; }
.log-row .what { color: var(--ink); font-weight: 600; }

/* ---------------------------------------------------------------- toasts */

.toasts {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-size: .84rem;
  box-shadow: var(--shadow-md);
  animation: toastin .2s ease-out;
  max-width: min(90vw, 460px);
}
.toast.err { border-color: rgba(239, 68, 68, .4); color: #ffbcbc; }
.toast.ok  { border-color: rgba(46, 204, 113, .35); color: #a7efc6; }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* jump-to-latest */
.jump {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 5;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--brand-tint-2);
  background: var(--surface-2);
  color: var(--brand-hot);
  font-size: .8rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
}
.jump:hover { background: var(--surface-3); }

/* ---------------------------------------------------------------- responsive */

.rail-toggle { display: none; }

@media (max-width: 900px) {
  :root { --rail: 0px; }
  .stage { grid-template-columns: 1fr; }
  .rail-toggle { display: grid; }
  .rail {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(300px, 86vw);
    z-index: 150;
    border-left: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform .22s ease;
    padding-top: 20px;
  }
  .rail.open { transform: none; }
  .rail-scrim {
    position: fixed;
    inset: 0;
    z-index: 140;
    background: rgba(4, 4, 6, .6);
    display: none;
  }
  .rail-scrim.open { display: block; }
  .welcome { margin: 14px 14px 2px; padding: 18px; }
  .log { padding: 12px 14px 18px; }
  .composer { padding: 10px 14px 14px; }
  .masthead { padding: 11px 14px; }
  .brand-tag { display: none; }
  .avatars { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 560px) {
  .me-name { display: none; }
  .me { padding: 4px; }
  .live-pill span.label { display: none; }
  .msg { grid-template-columns: 32px 1fr; gap: 9px; }
  .msg-avatar { width: 32px; height: 32px; border-radius: 9px; }
  .welcome h2 { font-size: 1.14rem; }
}

/* ------------------------------------------------------- arre.st record card
   A bare booking URL says nothing, so the server expands one into a card. The
   markup is anchor > (img + span.rec-body + span.rec-src), all inline elements
   forced to grid, because the whole thing has to be one clickable link. */
.rec-card {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  padding: 9px 11px 9px 9px;
  max-width: min(420px, 100%);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: border-color .16s ease, background .16s ease;
}
.rec-card:hover {
  background: var(--surface-3);
  border-color: var(--surface-3);
  border-left-color: var(--brand-hot);
}
.rec-shot {
  width: 56px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-xs);
  background: var(--surface-3);
  display: block;
}
/* No mugshot on file — a flat plate rather than a broken-image icon. */
.rec-shot-empty {
  background: var(--surface-3);
  border: 1px dashed var(--line);
}
.rec-body { display: grid; gap: 2px; min-width: 0; }
.rec-name {
  font-weight: 700;
  font-size: .86rem;
  color: var(--ink);
  line-height: 1.25;
}
.rec-meta { font-size: .7rem; color: var(--ink-3); }
.rec-charge {
  font-size: .72rem;
  color: var(--ink-2);
  line-height: 1.35;
  /* Charge strings run long and all-caps; two lines is the whole budget. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rec-more { font-size: .68rem; color: var(--brand-hot); }
.rec-src {
  align-self: start;
  font-family: var(--mono);
  font-size: .6rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-3);
}
/* The card is a link, but it must not inherit the raw-URL link treatment. */
.msg-body a.rec-card { word-break: normal; color: inherit; }

@media (max-width: 420px) {
  .rec-card { grid-template-columns: 44px 1fr; }
  .rec-shot { width: 44px; height: 58px; }
  .rec-src { display: none; }
}
/* The short "arre.st/FL-117035842" chip that sits above a card. */
.msg-body a.rec-ref {
  font-family: var(--mono);
  font-size: .76rem;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px dotted var(--surface-3);
  word-break: normal;
}
.msg-body a.rec-ref:hover { color: var(--brand-hot); border-bottom-color: var(--brand-hot); }

/* --------------------------------------------------------- Mugshot TV card
   The live announcement. State comes from live_broadcasts, so the "Live now"
   flag turns itself off when the stream ends rather than lying forever. */
.tv-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
  padding: 10px;
  max-width: min(440px, 100%);
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: border-color .16s ease, transform .16s ease;
}
.tv-card:hover { border-color: var(--surface-3); transform: translateY(-1px); }
.tv-card.is-live { border-color: rgba(239, 68, 68, .45); }
.tv-card.is-live:hover { border-color: var(--danger); }

.tv-shot { position: relative; display: block; line-height: 0; }
.tv-shot img {
  width: 160px;
  height: 90px;
  object-fit: cover;
  border-radius: var(--radius-xs);
  background: var(--surface-3);
  display: block;
}
/* Play glyph drawn in CSS — a triangle costs nothing and never 404s. */
.tv-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(10, 10, 12, .62);
  border: 1px solid rgba(255, 255, 255, .28);
}
.tv-play::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent #fff;
  transform: translateX(1px);
}
.tv-card:hover .tv-play { background: var(--danger); border-color: var(--danger); }

.tv-body { display: grid; gap: 3px; min-width: 0; }
.tv-flag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.tv-card.is-live .tv-flag { color: #ff9d9d; }
.tv-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  animation: tv-pulse 1.7s ease-in-out infinite;
}
@keyframes tv-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(239, 68, 68, .55); }
  50%      { opacity: .65; box-shadow: 0 0 0 5px rgba(239, 68, 68, 0); }
}
.tv-title {
  font-weight: 700;
  font-size: .86rem;
  color: var(--ink);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tv-sub { font-size: .7rem; color: var(--ink-3); }
.msg-body a.tv-card { word-break: normal; color: inherit; }

@media (prefers-reduced-motion: reduce) {
  .tv-dot { animation: none; }
  .tv-card:hover { transform: none; }
}
@media (max-width: 460px) {
  .tv-card { grid-template-columns: 1fr; }
  .tv-shot img { width: 100%; height: auto; aspect-ratio: 16 / 9; }
}

/* A line AutoMod rewrote. The flash runs once, when the swap lands, so the
   room notices the change instead of quietly reading different words than it
   read a second ago. */
.msg.revised { animation: msg-revised 1.4s ease-out 1; }

@keyframes msg-revised {
  0%   { background: rgba(255, 152, 0, .22); }
  100% { background: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .msg.revised { animation: none; }
}
