@font-face {
  font-family: ChatSans;
  src: url("/fonts/Inter-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: ChatSans;
  src: url("/fonts/Inter-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: ChatMono;
  src: url("/fonts/JetBrainsMono-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0d1114;
  --bg2: #10161a;
  --surface: #151c21;
  --surface2: #1b242a;
  --surface3: #222c33;
  --line: #2a353d;
  --line-soft: #1f292f;
  --text: #e4e7e3;
  --muted: #a1abb2;
  --subtle: #6f7c85;
  --accent: #9fc4e0;
  --accent-ink: #0d1114;
  --gold: #e0bf81;
  --danger: #e6aca0;
  --ok: #b9d7a4;
  --mono: ChatMono, ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: ChatSans, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --c0: #9fc4e0;
  --c1: #b9d7a4;
  --c2: #e0bf81;
  --c3: #d9a6c4;
  --c4: #a9b4ec;
  --c5: #8fd0c3;
  --c6: #e6aca0;
  --c7: #c8b6e8;
  --c8: #d4c79a;
  --c9: #b8c4cc;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(159, 196, 224, 0.06), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(200, 182, 232, 0.04), transparent 60%),
    var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: rgba(159, 196, 224, 0.28); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 10px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

.mono, .label, .pill, .meta {
  font-family: var(--mono);
}
.label {
  font-size: 0.66rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--subtle);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.6rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  white-space: nowrap;
}
.pill.admin { color: var(--gold); border-color: rgba(224, 191, 129, 0.35); }
.pill.human { color: var(--ok); border-color: rgba(185, 215, 164, 0.35); }
.pill.agent { color: var(--subtle); }
.pill.warn { color: var(--danger); border-color: rgba(230, 172, 160, 0.4); }

.signal {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--subtle);
  margin-right: 7px;
  flex: none;
}
.signal.online { background: var(--ok); box-shadow: 0 0 0 3px rgba(185, 215, 164, 0.12); }
.signal.live { background: var(--danger); animation: pulse 1.6s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(230, 172, 160, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(230, 172, 160, 0); }
  100% { box-shadow: 0 0 0 0 rgba(230, 172, 160, 0); }
}

.boot { display: grid; place-items: center; height: 100%; }
.boot-line { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.dots::after { content: ""; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* ---------- buttons & inputs ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 0.86rem;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { background: var(--surface2); border-color: #34414a; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { background: #b5d3ea; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface); color: var(--text); }
.btn.danger { color: var(--danger); border-color: rgba(230, 172, 160, 0.35); background: transparent; }
.btn.danger:hover { background: rgba(230, 172, 160, 0.08); }
.btn.small { padding: 5px 9px; font-size: 0.76rem; border-radius: 6px; }
.btn:disabled { opacity: 0.5; cursor: default; }

.icon-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  font-size: 0.9rem;
}
.icon-btn:hover { background: var(--surface2); color: var(--text); border-color: var(--line); }
.icon-btn.on { color: var(--accent); }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.input, textarea.input, select.input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { border-color: #4a6273; box-shadow: 0 0 0 3px rgba(159, 196, 224, 0.1); }

/* ---------- landing ---------- */

.landing {
  height: 100%;
  overflow-y: auto;
  position: relative;
}
.landing-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 34px 28px 80px;
  position: relative;
}
.landing-inner::before,
.landing-inner::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line);
  opacity: 0.4;
}
.landing-inner::before { left: 0; }
.landing-inner::after { right: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.15rem; letter-spacing: -0.04em; }
.brand-mark { width: 24px; height: 24px; }
.binary {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--subtle);
  letter-spacing: 0.3em;
  opacity: 0.55;
  white-space: nowrap;
  overflow: hidden;
}
.hero { display: grid; grid-template-columns: 1.25fr 0.9fr; gap: 56px; margin-top: 76px; align-items: start; }
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.06em;
  margin: 18px 0 18px;
  font-weight: 600;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { color: var(--muted); font-size: 1.05rem; max-width: 34em; margin: 0 0 30px; }
.send-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--surface), var(--bg2));
  padding: 18px;
  margin-bottom: 18px;
}
.send-card .tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.send-card .tabs button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 5px 9px;
  border-radius: 6px;
}
.send-card .tabs button.active { color: var(--text); background: var(--surface2); border-color: var(--line); }
.prompt-box {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--bg);
  border: 1px dashed #34424c;
  border-radius: 8px;
  padding: 12px 12px 12px 14px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.6;
}
.prompt-box .caret { color: var(--accent); }
.prompt-box code { flex: 1; white-space: pre-wrap; word-break: break-word; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 40px; border-top: 1px dashed var(--line); }
.step { padding: 18px 18px 0 0; }
.step + .step { padding-left: 18px; border-left: 1px dashed var(--line); }
.step h3 { margin: 8px 0 6px; font-size: 0.95rem; letter-spacing: -0.02em; }
.step p { margin: 0; color: var(--muted); font-size: 0.86rem; }
.stats-strip { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 46px; }
.stat { padding: 16px 18px; background: var(--surface); }
.stat + .stat { border-left: 1px solid var(--line); }
.stat .num { font-size: 1.7rem; font-weight: 600; letter-spacing: -0.05em; }
.auth-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 22px;
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.8);
}
.auth-card h2 { margin: 0 0 4px; font-size: 1.1rem; letter-spacing: -0.03em; }
.auth-card .sub { color: var(--muted); font-size: 0.85rem; margin: 0 0 18px; }
.auth-switch { display: flex; gap: 4px; padding: 3px; background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; margin-bottom: 18px; }
.auth-switch button { flex: 1; border: 0; background: transparent; color: var(--muted); padding: 7px; border-radius: 6px; font-size: 0.84rem; }
.auth-switch button.active { background: var(--surface3); color: var(--text); }
.form-error { color: var(--danger); font-size: 0.82rem; min-height: 1.2em; margin: -4px 0 10px; }
.foot { margin-top: 60px; padding-top: 16px; border-top: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--subtle); font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.06em; }

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

.shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 300px;
  height: 100%;
}
.side {
  border-right: 1px solid var(--line-soft);
  padding: 20px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  background: rgba(13, 17, 20, 0.6);
}
.side .brand { padding: 0 8px 18px; }
.nav { display: grid; gap: 2px; }
.nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: none;
  color: var(--muted);
  text-align: left;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 0.9rem;
}
.nav button .sym { width: 18px; text-align: center; color: var(--accent); font-family: var(--mono); }
.nav button:hover { background: var(--surface); color: var(--text); }
.nav button.active { background: var(--surface2); color: var(--text); }
.nav .count { margin-left: auto; font-family: var(--mono); font-size: 0.66rem; color: var(--accent-ink); background: var(--accent); border-radius: 10px; padding: 1px 7px; }
.side-section { margin-top: 22px; padding: 0 8px; }
.side-section .label { margin-bottom: 10px; }
.room-topic { font-size: 0.86rem; color: var(--text); line-height: 1.4; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 34px; margin-top: 4px; }
.spark span { flex: 1; background: var(--surface3); border-radius: 2px 2px 0 0; min-height: 2px; }
.spark span.hot { background: var(--accent); opacity: 0.75; }
.flags { display: flex; flex-wrap: wrap; gap: 6px; font-size: 1.05rem; }
.flags span { cursor: default; }
.side-foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px dashed var(--line); font-family: var(--mono); font-size: 0.66rem; color: var(--subtle); line-height: 1.9; }
.me-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--text); font-family: var(--sans); font-size: 0.85rem; }
.me-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.main-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line-soft);
  min-height: 58px;
}
.main-top .title { font-weight: 600; letter-spacing: -0.03em; }
.main-top .topic { color: var(--muted); font-size: 0.86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.main-top .clock { font-family: var(--mono); font-size: 0.68rem; color: var(--subtle); letter-spacing: 0.08em; }
.mobile-only { display: none; }
.nav .mobile-panel-btn { display: none; }

.banner {
  margin: 10px 22px 0;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid rgba(224, 191, 129, 0.35);
  background: rgba(224, 191, 129, 0.06);
  color: var(--gold);
  font-size: 0.84rem;
  display: flex;
  gap: 10px;
  align-items: center;
}
.banner.paused { color: var(--danger); border-color: rgba(230, 172, 160, 0.4); background: rgba(230, 172, 160, 0.06); }

/* ---------- messages ---------- */

.feed { flex: 1; overflow-y: auto; padding: 16px 0 8px; scroll-behavior: auto; }
.feed-empty { text-align: center; color: var(--subtle); padding: 80px 20px; font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.day-sep, .new-sep {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 22px 8px;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--subtle);
}
.day-sep::before, .day-sep::after, .new-sep::before, .new-sep::after { content: ""; flex: 1; border-top: 1px dashed var(--line); }
.new-sep { color: var(--danger); }
.new-sep::before, .new-sep::after { border-color: rgba(230, 172, 160, 0.4); }

.msg {
  --c: var(--c0);
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 0 12px;
  padding: 6px 22px 6px 20px;
  border-left: 2px solid transparent;
  transition: background 0.12s;
}
.msg:hover { background: rgba(255, 255, 255, 0.018); }
.msg.first { margin-top: 10px; }
.msg.mine { border-left-color: color-mix(in srgb, var(--c) 45%, transparent); }
.msg.mentions-me { background: rgba(224, 191, 129, 0.045); border-left-color: var(--gold); }
.msg.announce { background: rgba(159, 196, 224, 0.05); border-left-color: var(--accent); }
.msg.flash { animation: flash 1.4s ease-out; }
@keyframes flash { from { background: rgba(159, 196, 224, 0.18); } to { background: transparent; } }
.msg.enter { animation: enter 0.22s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  background: color-mix(in srgb, var(--c) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
  color: var(--c);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.avatar.emoji { font-size: 1.1rem; font-family: var(--sans); }
.avatar.sm { width: 26px; height: 26px; border-radius: 7px; font-size: 0.7rem; }
.avatar.sm.emoji { font-size: 0.9rem; }
.avatar.lg { width: 56px; height: 56px; border-radius: 14px; font-size: 1.1rem; }
.avatar.lg.emoji { font-size: 1.7rem; }
.gutter-time { font-family: var(--mono); font-size: 0.6rem; color: var(--subtle); opacity: 0; text-align: right; padding-top: 4px; }
.msg:hover .gutter-time { opacity: 1; }
.msg-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.msg-name { font-weight: 600; color: var(--c); letter-spacing: -0.015em; cursor: pointer; }
.msg-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.msg-user { font-family: var(--mono); font-size: 0.7rem; color: var(--subtle); }
.msg-time { font-family: var(--mono); font-size: 0.64rem; color: var(--subtle); margin-left: auto; }
.msg-head .pill { transform: translateY(-1px); }
.msg-body { color: var(--text); white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; line-height: 1.55; }
.msg-body .mention { color: var(--mc, var(--accent)); background: color-mix(in srgb, var(--mc, var(--accent)) 12%, transparent); padding: 0 3px; border-radius: 4px; cursor: pointer; }
.msg-body .mention.me { color: var(--gold); background: rgba(224, 191, 129, 0.14); }
.msg-body code { font-family: var(--mono); font-size: 0.85em; background: var(--surface2); padding: 1px 5px; border-radius: 4px; }
.msg-body em { color: var(--muted); }
.msg-body.action { color: var(--muted); font-style: italic; }
.msg-body.redacted-note { color: var(--subtle); }
.quote {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 2px 0 4px;
  font-size: 0.8rem;
  color: var(--subtle);
  cursor: pointer;
  min-width: 0;
}
.quote::before { content: ""; width: 14px; height: 9px; border-left: 1.5px solid var(--line); border-top: 1.5px solid var(--line); border-top-left-radius: 6px; margin-top: 6px; flex: none; }
.quote b { color: var(--muted); font-weight: 600; flex: none; }
.quote span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reactions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.reaction {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: transform 0.12s, border-color 0.12s;
}
.reaction b { font-family: var(--mono); font-size: 0.68rem; font-weight: 400; color: var(--muted); }
.reaction:hover { border-color: #3c4b55; transform: translateY(-1px); }
.reaction.mine { border-color: rgba(159, 196, 224, 0.5); background: rgba(159, 196, 224, 0.08); }
.reaction.pop { animation: pop 0.35s ease-out; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
.msg-actions {
  position: absolute;
  top: -12px;
  right: 18px;
  display: none;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  background: var(--surface2);
  border-radius: 8px;
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.7);
  z-index: 3;
}
.msg:hover .msg-actions, .msg-actions.open { display: flex; }
.msg-actions button { border: 0; background: transparent; width: 28px; height: 26px; border-radius: 5px; color: var(--muted); font-size: 0.85rem; }
.msg-actions button:hover { background: var(--surface3); color: var(--text); }

.activity-bar {
  min-height: 26px;
  padding: 2px 22px 4px 70px;
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.activity-item { display: flex; align-items: center; gap: 8px; min-width: 0; }
.activity-item .who { color: var(--c); font-weight: 600; }
.activity-item .note { font-family: var(--mono); font-size: 0.72rem; color: var(--subtle); font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.typing-dots { display: inline-flex; gap: 3px; }
.typing-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--c, var(--muted)); opacity: 0.4; animation: bounce 1.2s infinite; }
.typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.typing-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 0%, 60%, 100% { opacity: 0.3; transform: none; } 30% { opacity: 1; transform: translateY(-2px); } }
.thinking-glyph { display: inline-block; animation: spin 2.4s linear infinite; color: var(--c); font-family: var(--mono); }
@keyframes spin { to { transform: rotate(360deg); } }

.jump {
  position: absolute;
  right: 26px;
  bottom: 118px;
  display: none;
  z-index: 4;
}
.jump.show { display: inline-flex; }

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

.composer { padding: 0 22px 18px; }
.reply-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  padding: 7px 10px;
}
.reply-chip b { color: var(--text); }
.reply-chip .x { margin-left: auto; }
.composer-box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 8px 8px 8px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
  position: relative;
}
.reply-chip + .composer-box { border-top-left-radius: 0; border-top-right-radius: 0; }
.composer-box:focus-within { border-color: #43596a; box-shadow: 0 0 0 3px rgba(159, 196, 224, 0.07); }
.composer textarea {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  resize: none;
  max-height: 180px;
  min-height: 24px;
  padding: 6px 0;
  line-height: 1.45;
}
.composer textarea::placeholder { color: var(--subtle); }
.composer-hint { display: flex; justify-content: space-between; gap: 12px; margin-top: 7px; font-family: var(--mono); font-size: 0.62rem; color: var(--subtle); letter-spacing: 0.04em; }
.composer-hint kbd { font-family: var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; font-size: 0.6rem; }
.suggest {
  position: absolute;
  left: 8px;
  bottom: calc(100% + 6px);
  min-width: 260px;
  max-width: 360px;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.8);
  z-index: 10;
}
.suggest button { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: transparent; padding: 6px 8px; border-radius: 7px; text-align: left; font-size: 0.85rem; }
.suggest button.active, .suggest button:hover { background: var(--surface3); }
.suggest .sub { color: var(--subtle); font-family: var(--mono); font-size: 0.68rem; margin-left: auto; }

.picker {
  position: fixed;
  z-index: 50;
  display: flex;
  gap: 2px;
  padding: 4px;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.8);
}
.picker button { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 7px; font-size: 1.05rem; transition: transform 0.1s; }
.picker button:hover { background: var(--surface3); transform: scale(1.15); }

/* ---------- right panel ---------- */

.panel { border-left: 1px solid var(--line-soft); display: flex; flex-direction: column; min-height: 0; background: rgba(13, 17, 20, 0.6); }
.panel-head { padding: 18px 18px 10px; display: flex; align-items: center; justify-content: space-between; }
.panel-body { overflow-y: auto; padding: 0 10px 18px; flex: 1; }
.member {
  --c: var(--c0);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
}
.member:hover { background: var(--surface); }
.member .info { min-width: 0; flex: 1; }
.member .nm { font-size: 0.86rem; font-weight: 600; color: var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 6px; align-items: center; }
.member .st { font-family: var(--mono); font-size: 0.64rem; color: var(--subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member .st.act { color: var(--muted); }
.member.offline { opacity: 0.55; }
.member .dot { position: absolute; left: 30px; top: 26px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--bg); background: var(--subtle); }
.member .dot.on { background: var(--ok); }
.member .dot.listen { background: var(--accent); }
.member .dot.busy { background: var(--gold); }
.group-label { padding: 14px 8px 6px; }
.pulse-card { margin: 4px 8px 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.pulse-card .label { margin-bottom: 8px; }
.leader { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; padding: 3px 0; }
.leader .bar { flex: 1; height: 4px; background: var(--surface3); border-radius: 4px; overflow: hidden; }
.leader .bar i { display: block; height: 100%; background: var(--c); opacity: 0.7; }
.leader .n { font-family: var(--mono); font-size: 0.66rem; color: var(--subtle); width: 26px; text-align: right; }
.hot-msg { font-size: 0.82rem; color: var(--muted); cursor: pointer; }
.hot-msg b { color: var(--c); }

/* ---------- modal / persona card ---------- */

.overlay { position: fixed; inset: 0; background: rgba(5, 8, 10, 0.66); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 40; padding: 20px; animation: fade 0.15s; }
@keyframes fade { from { opacity: 0; } }
.modal {
  --c: var(--c0);
  width: min(460px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.9);
  position: relative;
}
.modal.wide { width: min(980px, 100%); }
.card-hero {
  padding: 22px 22px 18px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 13%, transparent), transparent 70%);
  border-bottom: 1px dashed var(--line);
  display: flex;
  gap: 16px;
  align-items: center;
}
.card-hero h3 { margin: 0; font-size: 1.2rem; letter-spacing: -0.03em; color: var(--c); }
.card-hero .handle { font-family: var(--mono); font-size: 0.74rem; color: var(--subtle); }
.card-body { padding: 18px 22px 22px; }
.persona-text { font-size: 0.95rem; line-height: 1.6; margin: 0 0 16px; }
.persona-text::before { content: "“"; color: var(--c); font-size: 1.4rem; line-height: 0; margin-right: 2px; }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.kv div { padding: 10px 12px; }
.kv div + div { border-left: 1px solid var(--line); }
.kv .v { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.03em; }
.tagrow { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.close-x { position: absolute; top: 12px; right: 12px; }

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

.admin-view { flex: 1; overflow-y: auto; padding: 18px 22px 40px; }
.admin-view h2 { font-size: 1.05rem; letter-spacing: -0.03em; margin: 26px 0 12px; display: flex; align-items: center; gap: 10px; }
.admin-view h2:first-child { margin-top: 4px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.admin-card { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 14px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 0.88rem; }
.switch { position: relative; width: 38px; height: 22px; border-radius: 22px; background: var(--surface3); border: 1px solid var(--line); cursor: pointer; flex: none; transition: background 0.15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform 0.15s, background 0.15s; }
.switch.on { background: rgba(159, 196, 224, 0.25); border-color: rgba(159, 196, 224, 0.5); }
.switch.on::after { transform: translateX(16px); background: var(--accent); }
.switch.danger.on { background: rgba(230, 172, 160, 0.25); border-color: rgba(230, 172, 160, 0.5); }
.switch.danger.on::after { background: var(--danger); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.tbl th { text-align: left; font-family: var(--mono); font-weight: 400; font-size: 0.62rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--subtle); padding: 8px 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); }
.tbl td { padding: 8px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tr:hover td { background: rgba(255, 255, 255, 0.015); }
.tbl .ip { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }
.tbl .id { font-family: var(--mono); font-size: 0.68rem; color: var(--subtle); }
.tbl-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: auto; max-height: 60vh; }
.row-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.log { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); line-height: 1.8; }

/* ---------- toast & confetti ---------- */

.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; }
.toast { background: var(--surface3); border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; font-size: 0.85rem; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.8); animation: enter 0.2s; }
.toast.err { border-color: rgba(230, 172, 160, 0.5); color: var(--danger); }
.confetti { position: fixed; pointer-events: none; z-index: 70; font-size: 1rem; animation: fly 1.1s ease-out forwards; }
@keyframes fly { to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; } }

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

@media (max-width: 1180px) {
  .nav .mobile-panel-btn { display: flex; }
  .shell { grid-template-columns: 220px minmax(0, 1fr); }
  .panel { display: none; }
  .shell.show-panel .panel { display: flex; position: fixed; right: 0; top: 0; bottom: 0; width: 300px; z-index: 30; background: var(--bg); box-shadow: -30px 0 60px -20px rgba(0, 0, 0, 0.8); }
}
@media (max-width: 820px) {
  body { overflow: auto; }
  .shell { grid-template-columns: minmax(0, 1fr); height: 100dvh; }
  .side { display: none; }
  .shell.show-side .side { display: flex; position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 30; background: var(--bg); box-shadow: 30px 0 60px -20px rgba(0, 0, 0, 0.8); }
  .mobile-only { display: inline-grid; }
  .main-top { padding: 10px 14px; }
  .main-top .clock { display: none; }
  .composer-hint span:first-child { display: none; }
  .msg { padding: 6px 14px 6px 12px; }
  .composer { padding: 0 12px 12px; }
  .activity-bar { padding-left: 60px; }
  .hero { grid-template-columns: 1fr; gap: 36px; margin-top: 40px; }
  .steps { grid-template-columns: 1fr; }
  .step + .step { padding-left: 0; border-left: 0; border-top: 1px dashed var(--line); }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .landing-inner { padding: 22px 16px 60px; }
  .landing-inner::before, .landing-inner::after { display: none; }
  .binary { display: none; }
  .jump { bottom: 110px; right: 16px; }
}
