/* =========================================================================
   RealtimeChat — "Framer-analysis" system
   Flat near-black canvas (#090909), Geist + Inter, binary ink hierarchy with
   ONE signal accent (blue #0099ff — links/focus/selection only, never a fill).
   Primary action = white pill. Gradient is scarce: the logo mark + one
   atmosphere card. The signature motion is the live-connection pulse.
   ========================================================================= */

:root {
  /* Surfaces — canvas up through hairlines */
  --canvas: #090909;
  --canvas-2: #0d0d0d;
  --surface-1: #141414;
  --surface-2: #1c1c1c;
  --surface-inset: #0b0b0b;
  --hairline: #262626;
  --hairline-2: #1f1f1f;
  --hairline-soft: #1a1a1a;
  --border-strong: #333333;

  /* Ink */
  --ink: #ffffff;
  --ink-muted: #999999;
  --ink-faint: #666666;
  --ink-disabled: #5a5a5a;

  /* Signal accent (never a fill) */
  --accent: #0099ff;
  --accent-hover: #47b6ff;
  --accent-soft: rgba(0, 153, 255, 0.1);
  --accent-brd: rgba(0, 153, 255, 0.35);

  /* Status */
  --good: #22c55e;
  --warn: #ff7a3d;
  --danger: #ff5577;
  --danger-ink: #ff8fa6;
  --danger-soft: rgba(255, 85, 119, 0.1);
  --danger-brd: rgba(255, 85, 119, 0.28);
  --warn-soft: rgba(255, 122, 61, 0.1);
  --warn-brd: rgba(255, 122, 61, 0.28);

  /* Scarce gradient spotlight */
  --grad: linear-gradient(140deg, #6a4cf5, #d44df0 65%, #ff7a3d);
  --grad-admin: linear-gradient(150deg, #d44df0 0%, #6a4cf5 95%);

  /* Shape */
  --radius: 20px;
  --radius-md: 15px;
  --radius-sm: 10px;
  --pill: 9999px;

  /* Type */
  --font-display: "Geist", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "Geist", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.9);
  --shadow-card: 0 12px 30px -12px rgba(0, 0, 0, 0.8);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-feature-settings: "cv01" 1, "cv05" 1, "cv09" 1, "cv11" 1, "ss03" 1, "ss07" 1;
  letter-spacing: -0.011em;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ---- Keyframes ---- */
@keyframes pulseGreen {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5), 0 0 8px rgba(34, 197, 94, 0.8); }
  50% { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0), 0 0 12px rgba(34, 197, 94, 1); }
}
@keyframes pulseAmber {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 122, 61, 0.55), 0 0 7px rgba(255, 122, 61, 0.85); }
  50% { box-shadow: 0 0 0 4px rgba(255, 122, 61, 0), 0 0 11px rgba(255, 122, 61, 1); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@keyframes shimmer { 0% { background-position: -320px 0; } 100% { background-position: 320px 0; } }

/* ---- Top bar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  background: rgba(9, 9, 9, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline-soft);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--grad);
  box-shadow: 0 0 14px rgba(106, 76, 245, 0.5);
}
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 16px; letter-spacing: -0.03em; }
.brand-accent { color: var(--ink); }
.topnav { display: flex; gap: 24px; }
.topnav a {
  color: var(--ink-muted); text-decoration: none; font-size: 14px; font-weight: 500;
  transition: color 0.15s;
}
.topnav a:hover { color: var(--ink); }
.topnav a.active { color: var(--accent); }
.topnav a.active:hover { color: var(--accent-hover); }

/* ---- Page ---- */
.page { max-width: 960px; margin: 0 auto; padding: 56px 24px 80px; }

/* ---- Hero ---- */
.hero { text-align: center; padding: 8px 0 40px; }
.hero.compact { padding: 0; text-align: left; }
.eyebrow {
  font-family: var(--font-body); text-transform: uppercase; letter-spacing: 0.16em;
  font-size: 12px; font-weight: 600; color: var(--ink-muted); margin: 0 0 18px;
}
.hero-title {
  font-family: var(--font-display); font-weight: 500; line-height: 0.98;
  font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -0.04em; margin: 0 0 18px;
  color: var(--ink);
}
.hero-title.small { font-size: clamp(1.6rem, 4vw, 2.4rem); letter-spacing: -0.035em; }
.hero-sub {
  color: var(--ink-muted); max-width: 500px; margin: 0 auto;
  font-size: 18px; line-height: 1.4; letter-spacing: -0.18px;
}
.hero.compact .hero-sub { margin: 0; max-width: 560px; font-size: 16px; letter-spacing: -0.16px; }

/* ---- Create room form ---- */
.create-room {
  display: flex; gap: 12px; max-width: 580px; margin: 34px auto 0; flex-wrap: wrap;
}
.field {
  width: 100%;
  background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius-sm);
  color: var(--ink); padding: 13px 15px; font-size: 15px; font-family: var(--font-body);
  letter-spacing: -0.15px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.create-room .field { flex: 1 1 240px; width: auto; }
.field::placeholder { color: var(--ink-faint); }
.field:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---- Buttons ---- */
.btn {
  font-family: var(--font-body); font-weight: 500; font-size: 14px; letter-spacing: -0.14px;
  border-radius: var(--pill); padding: 11px 20px; border: 1px solid transparent;
  cursor: pointer; transition: opacity 0.15s, transform 0.1s, background 0.15s, border-color 0.15s;
  color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:disabled { color: var(--ink-disabled); background: var(--surface-1); border-color: var(--hairline-soft); opacity: 0.9; cursor: not-allowed; }
.btn-primary {
  background: var(--ink); color: #000;
}
.btn-primary:hover:not(:disabled) { opacity: 0.88; }
.btn-primary:active:not(:disabled) { transform: scale(0.97); }
.btn-ghost { background: var(--surface-1); border-color: var(--border-strong); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }

/* Spinner used inside a disabled "Summarizing…" button */
.spinner {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  display: inline-block; animation: spin 0.7s linear infinite;
}

/* ---- Rooms list ---- */
.rooms { margin-top: 54px; }
.rooms-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.rooms-head h2 { font-family: var(--font-display); font-weight: 500; font-size: 22px; letter-spacing: -0.025em; margin: 0; }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 500; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--hairline);
  padding: 4px 12px; border-radius: var(--pill);
}
.room-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.room-card {
  background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius-md);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  display: flex; align-items: center;
}
.room-card:hover { background: var(--surface-2); border-color: var(--border-strong); }
.room-link { flex: 1; display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; text-decoration: none; color: var(--ink); }
.room-summary-link { flex: none; margin-right: 16px; white-space: nowrap; }

/* ---- Chat / Workshop view toggle ---- */
.view-toggle-bar {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 0 0 28px;
}
.view-toggle-name {
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  letter-spacing: 0.04em; color: var(--ink-faint); transition: color 0.2s;
}
.toggle-switch { position: relative; display: inline-flex; cursor: pointer; }
.toggle-switch-check {
  position: absolute; opacity: 0; width: 0; height: 0; margin: 0;
}
.toggle-switch-bar {
  position: relative; width: 46px; height: 26px; border-radius: var(--pill);
  background: var(--surface-2); border: 1px solid var(--hairline);
  transition: background 0.2s, border-color 0.2s;
}
.toggle-switch-handle {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--ink-muted);
  transition: transform 0.2s, background 0.2s;
}
.toggle-switch-check:checked + .toggle-switch-bar {
  background: var(--accent-soft); border-color: var(--accent-brd);
}
.toggle-switch-check:checked + .toggle-switch-bar .toggle-switch-handle {
  transform: translateX(20px); background: var(--accent);
}
.toggle-switch-check:focus-visible + .toggle-switch-bar {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
/* The active side's label brightens. */
.view-toggle-bar:has(.toggle-switch-check:not(:checked)) [data-view-off],
.view-toggle-bar:has(.toggle-switch-check:checked) [data-view-on] {
  color: var(--ink);
}
.room-name { font-family: var(--font-display); font-weight: 500; font-size: 16px; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
a.room-name { color: var(--accent); }
a.room-name:hover { color: var(--accent-hover); }
.room-meta { color: var(--ink-muted); font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 10px var(--good); animation: pulseGreen 2.4s infinite; }
.dot-closed { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-faint); }
.empty {
  color: var(--ink-muted); text-align: center; padding: 32px 20px;
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius); background: var(--canvas-2);
  line-height: 1.45;
}

/* =========================================================================
   Chat room
   ========================================================================= */
.chat-shell {
  position: relative;
  display: flex; flex-direction: column;
  height: calc(100vh - 130px); min-height: 460px;
  background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.chat-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 16px 22px; border-bottom: 1px solid var(--hairline-soft);
  background: var(--canvas);
}
.chat-title h1 { font-family: var(--font-display); font-weight: 500; font-size: 19px; letter-spacing: -0.025em; margin: 0; }
.chat-status { display: flex; align-items: center; gap: 7px; margin-top: 6px; font-size: 13.5px; color: var(--ink-muted); }
.conn-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.conn-dot.connecting { background: var(--warn); animation: pulseAmber 1.4s infinite; }
.conn-dot.online { background: var(--good); box-shadow: 0 0 10px var(--good); animation: pulseGreen 2.4s infinite; }
.conn-dot.offline { background: var(--danger); box-shadow: 0 0 8px var(--danger); }

.roster { display: flex; flex-direction: column; align-items: flex-end; gap: 9px; max-width: 45%; }
.roster-count {
  font-family: var(--font-display); font-weight: 600; font-size: 16px; letter-spacing: -0.02em; color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px;
}
.roster-count::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--good); box-shadow: 0 0 10px var(--good); animation: pulseGreen 2.4s infinite;
}
.roster-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.chip {
  font-size: 12px; color: var(--ink); background: var(--surface-1);
  border: 1px solid var(--hairline); border-radius: var(--pill); padding: 3px 10px; white-space: nowrap;
}
.chip.chip-you { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-brd); }

.closed-banner {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 22px; background: var(--danger-soft);
  border-bottom: 1px solid var(--danger-brd); color: var(--danger-ink); font-size: 12.5px; line-height: 1.4;
}
.closed-banner::before {
  content: ""; flex: none; width: 7px; height: 7px; border-radius: 2px;
  background: var(--danger); box-shadow: 0 0 8px rgba(255, 85, 119, 0.7);
}

.messages { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 22px 10px; display: flex; flex-direction: column; gap: 15px; }
.messages::-webkit-scrollbar { width: 9px; }
.messages::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 8px; }

.msg { max-width: 78%; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg-sender { font-size: 12px; color: var(--ink-muted); font-weight: 500; padding: 0 2px; }
.msg.mine .msg-sender { color: var(--accent); font-weight: 600; }
.msg-bubble {
  padding: 10px 14px; border-radius: var(--radius-md); border-top-left-radius: 5px;
  line-height: 1.4; font-size: 15px; letter-spacing: -0.15px;
  background: var(--surface-1); border: 1px solid var(--hairline-2); color: var(--ink);
  word-wrap: break-word; overflow-wrap: anywhere;
}
.msg.mine .msg-bubble {
  background: var(--ink); color: #000; border: none; font-weight: 450;
  border-top-left-radius: var(--radius-md); border-top-right-radius: 5px;
}
.msg-time { font-size: 11px; color: var(--ink-faint); padding: 0 2px; }

/* Per-message vote bar (agree / disagree) + net score */
.msg-votes { display: inline-flex; align-items: center; gap: 6px; padding: 0 2px; margin-top: 3px; flex-wrap: wrap; }
.msg.mine .msg-votes { justify-content: flex-end; }
.vote-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-body); font-size: 11.5px; font-weight: 500; line-height: 1;
  color: var(--ink-muted); background: var(--surface-1);
  border: 1px solid var(--hairline); border-radius: var(--pill);
  padding: 5px 11px; cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s, transform 0.1s;
}
.vote-btn:hover:not(:disabled) { color: var(--ink); border-color: var(--border-strong); background: var(--surface-2); }
.vote-btn:active:not(:disabled) { transform: scale(0.94); }
.vote-btn:disabled { cursor: default; opacity: 0.85; }
.vote-btn .vote-ico { font-size: 12px; line-height: 1; }
.vote-btn .vote-num { font-family: var(--font-mono); color: var(--ink-faint); }
.vote-up.voted { color: var(--good); border-color: rgba(34, 197, 94, 0.4); background: rgba(34, 197, 94, 0.08); }
.vote-up.voted .vote-num { color: var(--good); }
.vote-down.voted { color: var(--danger-ink); border-color: var(--danger-brd); background: var(--danger-soft); }
.vote-down.voted .vote-num { color: var(--danger-ink); }
.vote-net {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 600;
  padding: 4px 8px; color: var(--ink-faint);
}
.vote-net.pos { color: var(--good); }
.vote-net.neg { color: var(--danger-ink); }

/* Disagreement reasons ("why do you disagree?") shown under a message */
.msg-reasons { display: flex; flex-direction: column; gap: 5px; margin-top: 5px; width: 100%; max-width: 440px; }
.msg-reason {
  display: flex; flex-direction: column; gap: 1px;
  font-size: 12.5px; line-height: 1.4;
  padding: 6px 11px; border-left: 2px solid var(--danger-brd);
  background: var(--danger-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.reason-author { color: var(--danger-ink); font-weight: 600; font-size: 11px; }
.reason-text { color: var(--ink); overflow-wrap: anywhere; }

.reason-form { display: flex; gap: 6px; margin-top: 5px; width: 100%; max-width: 440px; }
.reason-form[hidden] { display: none; }  /* beat the class rule's display:flex */
.reason-input {
  flex: 1; min-width: 0;
  font-family: var(--font-body); font-size: 12.5px; color: var(--ink);
  background: var(--surface-inset); border: 1px solid var(--danger-brd);
  border-radius: var(--pill); padding: 8px 14px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.reason-input::placeholder { color: var(--ink-faint); }
.reason-input:focus { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.reason-add {
  flex: none; font-family: var(--font-body); font-size: 12.5px; font-weight: 600;
  color: #fff; background: var(--danger); border: 1px solid var(--danger);
  border-radius: var(--pill); padding: 8px 17px; cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
}
.reason-add:hover { filter: brightness(1.08); }
.reason-add:active { transform: scale(0.96); }

/* Right-align the reason UI on my own (right-aligned) messages */
.msg.mine .msg-reasons, .msg.mine .reason-form { align-self: flex-end; }
.msg.mine .msg-reason {
  border-left: none; border-right: 2px solid var(--danger-brd);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm); text-align: right;
}

.msg-system {
  align-self: center; text-align: center; font-size: 12.5px; color: var(--ink-muted);
  background: var(--surface-1); border: 1px solid var(--hairline);
  padding: 5px 13px; border-radius: var(--pill);
}

.typing { min-height: 22px; padding: 4px 22px; color: var(--ink-muted); font-size: 13.5px; font-style: italic; display: flex; align-items: center; gap: 8px; }
.typing-dots { display: inline-flex; gap: 3px; }
.typing-dots span { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-muted); animation: blink 1.2s infinite; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

.composer { display: flex; gap: 12px; padding: 14px 20px 18px; border-top: 1px solid var(--hairline-soft); background: #0b0b0b; align-items: flex-end; }
.composer-input {
  flex: 1; resize: none; max-height: 140px; height: 48px;
  background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius-sm);
  color: var(--ink); padding: 13px 14px; font-family: var(--font-body); font-size: 15px; line-height: 1.4; letter-spacing: -0.15px;
}
.composer-input::placeholder { color: var(--ink-faint); }
.composer-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer-input:disabled { color: var(--ink-disabled); background: var(--canvas-2); border-color: var(--hairline-soft); }
.composer .btn { height: 48px; padding: 0 26px; }

/* Room-full takeover (revealed by chat.js over the whole chat shell) */
.room-blocker {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 24px; text-align: center; background: var(--canvas);
}
.room-blocker[hidden] { display: none; }
.room-blocker-icon {
  position: relative; width: 46px; height: 46px; border-radius: 50%;
  border: 2px solid rgba(255, 85, 119, 0.55); box-shadow: 0 0 18px rgba(255, 85, 119, 0.2);
  display: flex; align-items: center; justify-content: center;
}
.room-blocker-icon::after {
  content: ""; width: 24px; height: 3px; border-radius: 2px;
  background: var(--danger); transform: rotate(-45deg);
}
.room-blocker-text { margin: 0; max-width: 280px; font-size: 14px; line-height: 1.5; color: var(--ink-muted); }

/* ---- Nickname overlay ---- */
.overlay {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(9, 9, 9, 0.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  padding: 22px;
}
.overlay[hidden] { display: none; }
.overlay-card {
  width: min(92vw, 420px); background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 24px;
  box-shadow: 0 -0.5px 0 rgba(255, 255, 255, 0.12) inset, 0 30px 60px -20px rgba(0, 0, 0, 0.9);
}
.overlay-card h2 { font-family: var(--font-display); font-weight: 500; font-size: 22px; letter-spacing: -0.03em; margin: 0 0 6px; }
.overlay-sub { color: var(--ink-muted); margin: 0 0 18px; font-size: 14px; line-height: 1.45; }
#nick-form { display: flex; flex-direction: column; gap: 14px; }
#nick-form .btn { width: 100%; padding: 13px; }

/* =========================================================================
   Admin summaries
   ========================================================================= */
.admin-hero { display: flex; gap: 30px; align-items: stretch; margin-bottom: 30px; flex-wrap: wrap; }
.admin-hero .hero { flex: 1 1 420px; display: flex; flex-direction: column; justify-content: center; padding: 0; }
.atmo-card {
  width: 340px; flex: 1 1 260px; display: flex; flex-direction: column;
  padding: 26px; border-radius: 30px; background: var(--grad-admin); color: #fff;
  box-shadow: 0 26px 60px -26px rgba(160, 80, 240, 0.6);
}
.atmo-eyebrow { font-family: var(--font-body); font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255, 255, 255, 0.85); }
.atmo-line { margin-top: auto; padding-top: 44px; font-family: var(--font-display); font-weight: 500; font-size: 24px; line-height: 1.06; letter-spacing: -0.03em; }

.summary-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.summary-card {
  background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 22px;
}
.summary-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.summary-top .room-name { font-family: var(--font-display); font-weight: 500; font-size: 18px; letter-spacing: -0.025em; }
.summary-top .room-meta { margin-top: 6px; font-size: 13.5px; }
.summary-actions { display: flex; gap: 10px; flex: none; }
.summary-body { margin-top: 0; }
.summary-text {
  background: var(--surface-inset); border: 1px solid var(--hairline-2); border-radius: var(--radius-md);
  padding: 18px; line-height: 1.5; font-size: 14.5px; color: var(--ink); white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere;
}
.summary-text.muted { color: var(--ink-faint); font-style: italic; white-space: normal; }
.summary-foot {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--hairline-2);
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint);
}
.summary-foot:empty { display: none; }

/* Structured summary (rendered from the model's JSON) */
.summary-lead { font-size: 15px; line-height: 1.5; color: var(--ink); }
.summary-lead + .summary-lead { margin-top: 8px; }
.summary-lead .summary-label { font-weight: 600; }
.summary-section { margin-top: 16px; }
.summary-section:first-child { margin-top: 0; }
.summary-section h4 {
  font-family: var(--font-body); text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 11px; font-weight: 600; color: var(--ink-muted); margin: 0 0 8px;
}
.summary-section ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.summary-section li { font-size: 14px; line-height: 1.45; color: var(--ink); }

/* Inline summary editing on the admin page */
.hidden { display: none !important; }
.summary-edit { display: grid; gap: 6px; }
.summary-edit-label {
  font-family: var(--font-body); text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 11px; font-weight: 600; color: var(--ink-muted); margin-top: 6px;
}
.summary-edit-area {
  width: 100%; box-sizing: border-box; resize: vertical; font: inherit; font-size: 14px;
  line-height: 1.5; padding: 9px 11px; border-radius: 8px;
  border: 1px solid var(--hairline); background: var(--surface-1); color: var(--ink);
}
.summary-edit-actions { display: flex; align-items: center; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.summary-edit-note { font-size: 12px; color: var(--ink-muted); }
.summary-edit-note.err { color: var(--red, #D52B1E); }

/* Admin loading state (built by the inline script) */
.loading-line { display: flex; align-items: center; gap: 9px; color: var(--ink-muted); font-size: 14.5px; }
.skeleton-line {
  height: 11px; border-radius: 6px; margin-top: 12px;
  background: linear-gradient(90deg, #141414 25%, #2a2a2a 50%, #141414 75%);
  background-size: 320px 100%; animation: shimmer 1.4s linear infinite;
}

/* =========================================================================
   Auth (login) + top-bar user
   ========================================================================= */
.auth-wrap { display: flex; justify-content: center; padding: 48px 0; }
.auth-card {
  width: min(92vw, 400px); background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 28px;
  box-shadow: 0 -0.5px 0 rgba(255, 255, 255, 0.12) inset, 0 30px 60px -20px rgba(0, 0, 0, 0.9);
}
.auth-title { font-family: var(--font-display); font-weight: 500; font-size: 24px; letter-spacing: -0.03em; margin: 0 0 6px; }
.auth-sub { color: var(--ink-muted); margin: 0 0 20px; font-size: 14px; }
.auth-label { display: block; font-size: 12.5px; color: var(--ink-muted); margin: 14px 0 6px; }
.auth-submit { width: 100%; margin-top: 22px; padding: 13px; }
.auth-note { color: var(--ink-faint); font-size: 12.5px; margin: 18px 0 0; text-align: center; }
.auth-error {
  background: var(--danger-soft); border: 1px solid var(--danger-brd); color: var(--danger-ink);
  border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; margin-bottom: 4px;
}

.topnav { align-items: center; }
.topnav-user { color: var(--ink); font-size: 14px; font-weight: 500; }
.logout-form { display: inline; margin: 0; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ---- Flash messages ---- */
.flash-list { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; }
.flash {
  padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13.5px;
  border: 1px solid var(--hairline); background: var(--surface-1); color: var(--ink);
}
.flash.success { border-color: rgba(34, 197, 94, 0.4); background: rgba(34, 197, 94, 0.08); color: var(--good); }
.flash.error { border-color: var(--danger-brd); background: var(--danger-soft); color: var(--danger-ink); }

/* ---- User management (in-app admin) ---- */
.user-create { margin: 26px 0 6px; }
.user-create-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.user-create-form .field { flex: 1 1 180px; width: auto; }
.user-staff-check { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-muted); font-size: 13.5px; white-space: nowrap; }
.field-sm { padding: 8px 10px; font-size: 13px; }
.user-table { display: grid; gap: 8px; margin-top: 18px; }
.user-row {
  display: grid; grid-template-columns: 1.2fr 0.8fr 0.8fr 1fr 2.4fr; gap: 12px; align-items: center;
  background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius-md); padding: 12px 16px;
}
.user-row-head { background: transparent; border: none; padding: 0 16px; color: var(--ink-muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.1em; }
.user-name { font-weight: 500; color: var(--ink); word-break: break-all; }
.user-lastlogin { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); }
.user-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.user-actions form { display: inline-flex; gap: 6px; margin: 0; }
.user-you { color: var(--ink-faint); font-size: 13px; }
.badge { font-size: 11.5px; padding: 3px 9px; border-radius: var(--pill); border: 1px solid var(--hairline); color: var(--ink-muted); }
.badge-admin { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-brd); }
.badge-owner { color: #fff; background: var(--grad-admin); border: none; }
@media (max-width: 720px) {
  .user-row { grid-template-columns: 1fr; }
  .user-row-head { display: none; }
}

/* =========================================================================
   Member-facing room summary — editorial "report" layout
   One column of measured text, hairline rules, micro-labels, and a quiet
   staggered reveal. The accent stays a signal (labels/markers), never a fill.
   ========================================================================= */
.rs-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 34px;
}
.rs-title { margin-bottom: 10px; }
.rs-meta {
  margin: 0; color: var(--ink-muted); font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.rs-meta-sep { color: var(--ink-faint); }
.rs-nav { display: flex; gap: 10px; flex: none; padding-bottom: 4px; }

.rs-report {
  max-width: 640px;
  border-top: 1px solid var(--hairline);
  padding-top: 30px;
}

.rs-lede {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.15rem, 2.6vw, 1.45rem); line-height: 1.4; letter-spacing: -0.022em;
  color: var(--ink); margin: 0 0 8px;
}

.rs-section { margin-top: 34px; }
.rs-label {
  font-family: var(--font-body); text-transform: uppercase; letter-spacing: 0.16em;
  font-size: 11px; font-weight: 600; color: var(--ink-muted); margin: 0 0 14px;
  display: flex; align-items: center; gap: 12px;
}
.rs-label::after { content: ""; flex: 1; height: 1px; background: var(--hairline-2); }
.rs-label-accent { color: var(--accent); }
.rs-label-accent::after { background: var(--accent-brd); }

.rs-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.rs-list li {
  position: relative; padding-left: 26px;
  font-size: 15px; line-height: 1.55; color: var(--ink); letter-spacing: -0.1px;
}
.rs-list li::before {
  content: "—"; position: absolute; left: 0; top: 0;
  color: var(--ink-faint); font-size: 14px;
}
.rs-list-voted li::before { content: "▲"; color: var(--accent); font-size: 10px; top: 5px; }
.rs-list-check li::before { content: "✓"; color: var(--good); font-size: 13px; top: 1px; }
.rs-list-q li::before { content: "?"; color: var(--warn); font-weight: 600; font-size: 14px; }
.rs-list-q li { color: var(--ink-muted); }

.rs-sentiment {
  display: inline-block; margin: 0;
  border: 1px solid var(--hairline); border-radius: var(--pill);
  background: var(--surface-1); padding: 7px 16px;
  font-size: 14px; color: var(--ink); letter-spacing: -0.1px;
}

/* Plain-text fallback (no structured JSON): here pre-wrap is correct because
   the model text IS the whitespace — never wrap markup in this class. */
.rs-plain {
  font-size: 15px; line-height: 1.6; color: var(--ink);
  white-space: pre-wrap; overflow-wrap: anywhere;
}

.rs-foot {
  margin-top: 42px; padding-top: 14px; border-top: 1px solid var(--hairline-2);
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint);
}

/* Empty state — the admin hasn't generated one yet */
.rs-empty {
  max-width: 640px; text-align: center;
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--canvas-2); padding: 56px 32px;
}
.rs-empty-mark {
  width: 44px; height: 54px; margin: 0 auto 22px; position: relative;
  border: 1.5px solid var(--ink-faint); border-radius: 6px; opacity: 0.9;
}
.rs-empty-mark::before, .rs-empty-mark::after {
  content: ""; position: absolute; left: 9px; right: 9px; height: 1.5px;
  background: var(--ink-faint);
}
.rs-empty-mark::before { top: 14px; }
.rs-empty-mark::after { top: 24px; right: 17px; }
.rs-empty-title {
  font-family: var(--font-display); font-weight: 500; font-size: 20px;
  letter-spacing: -0.03em; color: var(--ink); margin: 0 0 8px;
}
.rs-empty-sub {
  color: var(--ink-muted); font-size: 14.5px; line-height: 1.5;
  max-width: 380px; margin: 0 auto 24px;
}

/* Quiet staggered reveal on load */
@keyframes rsRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.rs-reveal { animation: rsRise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
.rs-reveal:nth-child(2) { animation-delay: 0.06s; }
.rs-reveal:nth-child(3) { animation-delay: 0.12s; }
.rs-reveal:nth-child(4) { animation-delay: 0.18s; }
.rs-reveal:nth-child(5) { animation-delay: 0.24s; }
.rs-reveal:nth-child(6) { animation-delay: 0.30s; }
.rs-reveal:nth-child(7) { animation-delay: 0.36s; }
.rs-reveal:nth-child(8) { animation-delay: 0.42s; }

@media (max-width: 640px) {
  .rs-head { margin-bottom: 24px; }
  .rs-report { padding-top: 22px; }
  .rs-section { margin-top: 26px; }
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .page { padding: 32px 16px 56px; }
  .chat-shell { height: calc(100vh - 108px); }
  .msg { max-width: 86%; }
  .roster { max-width: 42%; }
  .topnav { gap: 16px; }
  .hero-title { font-size: clamp(1.9rem, 8vw, 2.4rem); }
  .admin-hero { flex-direction: column; }
  /* Column flex makes flex-basis a HEIGHT — reset so the hero/card size to content. */
  .admin-hero .hero, .admin-hero .atmo-card { flex: 0 0 auto; }
  .atmo-card { width: 100%; }
}

/* ---- Accessibility ---- */
.btn:focus-visible, .field:focus-visible, .topnav a:focus-visible, .composer-input:focus-visible, .room-link:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
