:root {
  --rail: #121317;
  --side: #1a1c21;
  --chat: #22242a;
  --raise: #2b2e36;
  --hover: #2a2d35;
  --active: #343843;
  --input: #2c2f37;
  --float: #16171b;
  --line: rgba(255, 255, 255, 0.07);
  --text: #eceef1;
  --soft: #d5d8de;
  --muted: #989eaa;
  --faint: #6c7280;
  --accent: #ff6a3d;
  --accent-hi: #ff8259;
  --accent-ink: #1d0f07;
  --accent-soft: rgba(255, 106, 61, 0.13);
  --green: #3fbf7f;
  --red: #ef5a5f;
  --red-soft: rgba(239, 90, 95, 0.14);
  --link: #6cb6ff;
  --shadow: 0 10px 32px rgba(0, 0, 0, 0.5);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

* { scrollbar-width: thin; scrollbar-color: #0d0e11 transparent; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--rail);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.sprite { position: absolute; }

.icon {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon.sm { width: 16px; height: 16px; }

.wordmark { margin: 0; font-weight: 800; letter-spacing: -0.03em; }
.wordmark span { color: var(--accent); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: none;
  padding: 9px 16px;
  background: var(--accent);
  border-radius: 6px;
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  transition: background-color 0.12s;
}
.btn:hover:not(:disabled) { background: var(--accent-hi); }
.btn:disabled { opacity: 0.5; }
.btn.wide { width: 100%; padding: 11px 16px; font-size: 15px; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.ghost { background: transparent; color: var(--soft); }
.btn.ghost:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.btn.subtle { background: var(--raise); color: var(--text); }
.btn.subtle:hover:not(:disabled) { background: var(--active); }
.btn.danger { background: transparent; color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.btn.danger:hover:not(:disabled),
.btn.armed { background: var(--red); color: #fff; box-shadow: none; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: var(--muted);
  transition: background-color 0.12s, color 0.12s;
}
.icon-btn:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.icon-btn.danger:hover:not(:disabled) { color: var(--red); }
.icon-btn.armed { width: auto; padding: 0 8px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; }

.only-narrow { display: none; }

.badge {
  flex: none;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge.owner { background: #3d4250; color: var(--text); }
.badge.banned { background: var(--red-soft); color: var(--red); }

/* ---------- avatars ---------- */

.avatar {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  user-select: none;
}
.avatar.md { width: 40px; height: 40px; font-size: 17px; }
.avatar.lg { width: 80px; height: 80px; font-size: 34px; }

.dot {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 14px;
  height: 14px;
  border: 3px solid var(--side);
  border-radius: 50%;
  background: var(--faint);
}
.dot.on { background: var(--green); }
.avatar.lg .dot { right: 2px; bottom: 2px; width: 22px; height: 22px; border-width: 5px; border-color: var(--float); }
.userbar .dot { border-color: var(--float); }

/* ---------- boot ---------- */

.boot {
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--faint);
}
.boot span { color: var(--accent); }

/* ---------- signed out ---------- */

.auth {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(900px 500px at 12% 8%, rgba(255, 106, 61, 0.09), transparent 60%),
    radial-gradient(800px 520px at 92% 96%, rgba(108, 182, 255, 0.07), transparent 60%),
    var(--rail);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 32px 32px 24px;
  background: var(--chat);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.auth-card .wordmark { font-size: 36px; text-align: center; }
.auth-sub { margin: 4px 0 22px; text-align: center; color: var(--muted); }

.auth-invite {
  margin: 0 0 18px;
  padding: 10px 12px;
  background: var(--accent-soft);
  border-radius: 8px;
  font-size: 14px;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  background: var(--rail);
  border-radius: 8px;
}
.tab { flex: 1; padding: 8px; border-radius: 6px; color: var(--muted); font-size: 14px; font-weight: 600; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--raise); color: var(--text); }

.field { display: block; margin-bottom: 16px; }
.field > span,
.label {
  display: block;
  margin-bottom: 7px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.field input,
.text-box {
  width: 100%;
  padding: 10px 12px;
  background: var(--rail);
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 15px;
}
.field input:focus,
.text-box:focus { outline: none; border-color: var(--accent); }
.field input::placeholder,
.text-box::placeholder { color: var(--faint); }

.hint { margin: -4px 0 14px; font-size: 13px; color: var(--muted); }
.form-error { min-height: 20px; margin: 0 0 10px; font-size: 13.5px; color: var(--red); }
.auth-foot { margin: 16px 0 0; text-align: center; font-size: 13px; color: var(--faint); }

/* ---------- signed in: frame ---------- */

.app {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 240px;
}
.app.hide-people { grid-template-columns: auto minmax(0, 1fr); }
.app.hide-people .people { display: none; }

.nav { display: flex; min-height: 0; }

/* server rail */

.rail {
  width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  overflow-y: auto;
  scrollbar-width: none;
  background: var(--rail);
}

.rail-brand {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.rail-sep { flex: none; width: 32px; height: 2px; border-radius: 1px; background: var(--line); }

.rail-item { position: relative; flex: none; display: flex; justify-content: center; width: 72px; }
.rail-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 0;
  border-radius: 0 4px 4px 0;
  background: var(--text);
  transform: translateY(-50%);
  transition: height 0.15s;
}
.rail-item:hover::before { height: 20px; }
.rail-item.active::before { height: 38px; }

.rail-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  transition: border-radius 0.15s, background-color 0.15s, color 0.15s;
}
.rail-item:hover .rail-icon,
.rail-item.active .rail-icon { border-radius: 16px; }
.rail-item.add .rail-icon { background: var(--raise); color: var(--green); }
.rail-item.add:hover .rail-icon { background: var(--green); color: #0c1f15; }
.rail-item.add::before { display: none; }

/* channel column */

.side { width: 240px; display: flex; flex-direction: column; min-height: 0; background: var(--side); }

.side-head { flex: none; height: 52px; border-bottom: 1px solid var(--line); }
.side-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 0 14px 0 16px;
  font-size: 16px;
  font-weight: 700;
  text-align: left;
  transition: background-color 0.12s;
}
button.side-title:hover { background: var(--hover); }
.side-title span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-title .icon { color: var(--muted); }

.channels { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 8px; }

.chan-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 4px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.chan-label .icon-btn { width: 24px; height: 24px; }

.chan-row { position: relative; margin-bottom: 2px; }
.chan {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 15.5px;
  font-weight: 500;
  text-align: left;
}
.chan .icon { color: var(--faint); }
.chan span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan:hover { background: var(--hover); color: var(--soft); }
.chan.active { background: var(--active); color: var(--text); }
.chan-row .chan-del { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; opacity: 0; }
.chan-row:hover .chan-del,
.chan-del:focus-visible { opacity: 1; }
.chan-row:hover .chan { padding-right: 32px; }

.side-empty { padding: 8px; color: var(--muted); font-size: 14px; }

.userbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 56px;
  padding: 0 8px;
  background: var(--float);
}
.me-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 4px 6px 4px 4px;
  border-radius: 6px;
  text-align: left;
}
.me-btn:hover { background: var(--hover); }
.me-text { min-width: 0; line-height: 1.2; }
.me-text b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.me-text small { font-size: 12px; color: var(--muted); }

/* ---------- chat column ---------- */

.chat { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--chat); }

.chat-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 52px;
  padding: 0 12px 0 16px;
  border-bottom: 1px solid var(--line);
}

.crumbs { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 16px; font-weight: 700; }
.crumbs .icon { color: var(--faint); }
.crumbs strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.crumbs .sub {
  padding-left: 12px;
  border-left: 1px solid var(--line);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.announce {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 16px;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.announce .icon { color: var(--accent); }
.announce p { flex: 1; min-width: 0; margin: 0; overflow-wrap: anywhere; }
.announce .icon-btn { width: 26px; height: 26px; }

.log { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 0 22px; overflow-wrap: anywhere; }

.empty { max-width: 46ch; margin: 14vh auto 0; padding: 0 20px; text-align: center; color: var(--muted); }
.empty b { display: block; margin-bottom: 6px; color: var(--text); font-size: 20px; font-weight: 700; }
.empty .empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }

.older { display: flex; margin: 8px auto 4px; }

.day {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 16px 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.day::before,
.day::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.msg {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  column-gap: 16px;
  padding: 2px 48px 2px 16px;
}
.msg.start { margin-top: 14px; }
.msg:hover,
.msg.editing { background: rgba(0, 0, 0, 0.13); }

.avatar-btn { align-self: start; margin-top: 2px; border-radius: 50%; }
.avatar-btn:hover { filter: brightness(1.12); }

.gutter-time {
  align-self: start;
  opacity: 0;
  color: var(--faint);
  font-size: 11px;
  line-height: 21px;
  text-align: right;
  white-space: nowrap;
}
.msg:hover .gutter-time { opacity: 1; }

.msg-main { min-width: 0; }
.msg-head { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
.who { font-size: 15.5px; font-weight: 600; }
.who:hover { text-decoration: underline; }
.msg-head .badge { align-self: center; }
.msg-head time { color: var(--faint); font-size: 12px; }

.txt { color: var(--soft); white-space: pre-wrap; }
.edited { margin-left: 5px; color: var(--faint); font-size: 11px; }

.msg-tools {
  position: absolute;
  top: -16px;
  right: 16px;
  z-index: 2;
  display: none;
  gap: 2px;
  padding: 2px;
  background: var(--side);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.msg-tools .icon-btn { width: 28px; height: 28px; }
.msg-tools .icon-btn.armed { width: auto; }
.msg:hover .msg-tools,
.msg.tapped .msg-tools,
.msg-tools:focus-within,
.msg-tools:has(.armed) { display: flex; }
.msg.editing .msg-tools { display: none; }

.edit-box {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  background: var(--input);
  border: 1px solid transparent;
  border-radius: 8px;
  resize: none;
  font-size: 15px;
  line-height: 1.4;
}
.edit-box:focus { outline: none; border-color: var(--accent); }
.edit-hint { display: block; margin: 4px 0 6px; color: var(--muted); font-size: 12px; }

.jump {
  position: absolute;
  left: 50%;
  bottom: 86px;
  z-index: 3;
  padding: 6px 14px;
  background: var(--accent);
  border-radius: 999px;
  box-shadow: var(--shadow);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 700;
  transform: translateX(-50%);
}

.notice {
  flex: none;
  margin: 0 16px 8px;
  padding: 8px 12px;
  background: var(--red-soft);
  border-radius: 6px;
  color: #ffb9bc;
  font-size: 13.5px;
}

.composer {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  margin: 0 16px 20px;
  padding: 5px 6px 5px 16px;
  background: var(--input);
  border-radius: 10px;
}
.composer textarea {
  flex: 1;
  min-width: 0;
  max-height: 180px;
  padding: 8px 0;
  background: none;
  border: 0;
  resize: none;
  font-size: 15.5px;
  line-height: 1.4;
}
.composer textarea:focus { outline: none; }
.composer textarea::placeholder { color: var(--faint); }
.composer .send { width: 36px; height: 36px; }
.composer .send:not(:disabled) { color: var(--accent); }
.composer .send:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent-hi); }

/* ---------- members ---------- */

.people { min-height: 0; overflow-y: auto; padding: 8px 8px 20px; background: var(--side); }

.people-head {
  margin: 0;
  padding: 16px 8px 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.person {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 5px 8px;
  border-radius: 6px;
  color: var(--soft);
  text-align: left;
}
.person:hover { background: var(--hover); color: var(--text); }
.person .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 500; }
.person.off { opacity: 0.45; }
.person.off:hover { opacity: 1; }

/* ---------- popovers: menus and profile cards ---------- */

.popover { position: fixed; z-index: 60; max-width: calc(100vw - 16px); }

.menu {
  min-width: 210px;
  padding: 6px;
  background: var(--float);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 4px;
  color: var(--soft);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}
.menu-item:hover { background: var(--accent); color: var(--accent-ink); }
.menu-item.danger { color: var(--red); }
.menu-item.danger:hover { background: var(--red); color: #fff; }
.menu-sep { height: 1px; margin: 4px; background: var(--line); }

.card {
  width: 300px;
  max-width: 100%;
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  background: var(--float);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.card-banner { height: 60px; border-radius: 11px 11px 0 0; }
.card-body { padding: 0 16px 16px; }
.card .avatar.lg { margin-top: -40px; border: 6px solid var(--float); box-sizing: content-box; }
.card-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 0; font-size: 20px; font-weight: 700; overflow-wrap: anywhere; }
.card-status { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.card-section { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.card-section h4 { margin: 0 0 5px; color: var(--soft); font-size: 12px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; }
.card-section p { margin: 0; color: var(--soft); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.card-section p.none { color: var(--faint); }
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 5px 14px; margin: 0; font-size: 13.5px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; color: var(--soft); overflow-wrap: anywhere; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.card-loading { padding: 24px 16px; color: var(--muted); font-size: 14px; }

/* ---------- dialog ---------- */

.dialog {
  width: min(520px, calc(100vw - 24px));
  max-height: min(88vh, 780px);
  padding: 0;
  background: var(--chat);
  border: 0;
  border-radius: 12px;
  box-shadow: var(--shadow);
  color: var(--text);
}
.dialog.wide { width: min(860px, calc(100vw - 24px)); }
.dialog[open] { display: flex; flex-direction: column; }
.dialog::backdrop { background: rgba(0, 0, 0, 0.7); }

.dialog-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 16px 12px 22px; }
.dialog-head h2 { min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 20px; font-weight: 700; }

.dialog-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 22px 22px; }

.dialog-section + .dialog-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.dialog-section h3 { margin: 0 0 10px; color: var(--soft); font-size: 12px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; }

.dialog-text { margin: 0 0 16px; color: var(--soft); }
.dialog-note { margin: 10px 0 0; color: var(--muted); font-size: 13px; }

.dialog-error { flex: none; margin: 0; padding: 10px 22px; background: var(--red-soft); color: #ffb9bc; font-size: 13.5px; }

.dialog-row { display: flex; align-items: center; gap: 8px; }
.dialog-row.wrap { flex-wrap: wrap; }
.dialog-row.end { justify-content: flex-end; margin-top: 18px; }
.dialog-row .text-box { flex: 1; min-width: 0; width: auto; }
.text-box.narrow { flex: none; width: 76px; }
textarea.text-box { display: block; min-height: 84px; resize: vertical; line-height: 1.4; }
.stack > * + * { margin-top: 10px; }

.inline-label { flex: none; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }

.counter { margin: 4px 0 0; color: var(--faint); font-size: 12px; text-align: right; }

.rows { display: flex; flex-direction: column; gap: 2px; }
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14.5px;
}
.row:hover { background: var(--hover); }
.row-main { flex: 1; min-width: 0; }
.row-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 600; overflow-wrap: anywhere; }
.row-title button { font-weight: 600; }
.row-title button:hover { text-decoration: underline; }
.row-detail { margin-top: 1px; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.row-actions { flex: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.row.spent .row-title { color: var(--muted); }
.rows > .dialog-note { margin: 6px 10px; }

.code-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  background: var(--rail);
  border: 1px dashed var(--accent);
  border-radius: 8px;
}
.code-box .code { font-family: var(--mono); font-size: 20px; font-weight: 700; letter-spacing: 0.04em; user-select: all; }
.code-box .dialog-note { flex-basis: 100%; margin: 0; }
.code-hint { font-family: var(--mono); font-size: 13.5px; }

/* admin panel */

.tab-bar { display: flex; flex-wrap: wrap; gap: 2px; margin: 0 0 18px; border-bottom: 1px solid var(--line); }
.tab-btn { padding: 8px 12px 10px; color: var(--muted); font-size: 14px; font-weight: 600; box-shadow: inset 0 -2px transparent; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); box-shadow: inset 0 -2px var(--accent); }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat { padding: 12px 14px; background: var(--side); border-radius: 8px; }
.stat b { display: block; font-size: 26px; font-weight: 700; line-height: 1.15; }
.stat span { color: var(--muted); font-size: 12.5px; }

.audit-time { flex: none; width: 150px; color: var(--muted); font-size: 12.5px; }

.scrim { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, 0.6); }

/* ---------- narrower screens ---------- */

@media (max-width: 1100px) {
  .app,
  .app.hide-people { grid-template-columns: auto minmax(0, 1fr); }
  .app.hide-people .people { display: block; }
  .people {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    width: 250px;
    transform: translateX(100%);
    transition: transform 0.16s ease-out;
  }
  .people.open { transform: none; }
}

@media (max-width: 760px) {
  .app,
  .app.hide-people { grid-template-columns: minmax(0, 1fr); }
  .only-narrow { display: inline-grid; }
  .nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 30;
    max-width: 92vw;
    transform: translateX(-100%);
    transition: transform 0.16s ease-out;
  }
  .nav.open { transform: none; }

  .auth-card { padding: 26px 20px 20px; }
  .chat-head { padding: 0 8px; }
  .crumbs .sub { display: none; }
  #invite-btn span { display: none; }
  .msg { column-gap: 12px; padding: 2px 12px; }
  .day { margin-left: 12px; margin-right: 12px; }
  .composer { margin: 0 8px 10px; }
  .notice { margin: 0 8px 8px; }
  .jump { bottom: 70px; }
  .chan-row .chan-del { opacity: 1; }
  .audit-time { width: auto; }
  .row { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
