/* ============================================================
   algofunds / chat
   Palette: deep teal-black field, apricot signal, mint for self.
   Identity is carried by colour rails and mono type, not avatars.
   ============================================================ */

:root {
  --bg: #0A1416;
  --bg-2: #0D1B1E;
  --surface: #122428;
  --surface-2: #162E32;
  --line: #1E383D;
  --line-soft: #16292D;
  --text: #E7F1EF;
  --text-dim: #9DB3B2;
  --text-faint: #6B8482;
  --accent: #FFB37A;
  --accent-ink: #2B1608;
  --mint: #6FE3C4;
  --danger: #FF9A8F;
  --author-s: 58%;
  --author-l: 70%;
  --own-tint: rgba(111, 227, 196, 0.055);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

html[data-theme="light"] {
  --bg: #F2F6F5;
  --bg-2: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #E8EFEE;
  --line: #D2DEDC;
  --line-soft: #E2EAE9;
  --text: #0C1D1F;
  --text-dim: #4C6462;
  --text-faint: #7A908E;
  --accent: #B0561A;
  --accent-ink: #FFF3E9;
  --mint: #0C8467;
  --danger: #B3402F;
  --author-s: 55%;
  --author-l: 33%;
  --own-tint: rgba(12, 132, 103, 0.06);
  --shadow: 0 18px 50px rgba(16, 40, 40, 0.14);
}

* { box-sizing: border-box; }

/* Class rules below set display on elements that also toggle [hidden].
   Keep [hidden] authoritative so hiding always wins. */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button, input, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------------- wordmark ---------------- */

.wordmark {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
}
.wordmark .slash { color: var(--accent); margin: 0 1px; }
.caret {
  display: inline-block;
  width: 7px;
  height: 13px;
  margin-left: 5px;
  background: var(--accent);
  vertical-align: -2px;
  animation: blink 1.15s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------------- sign in ---------------- */

.auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(255, 179, 122, 0.10), transparent 60%),
    repeating-linear-gradient(to bottom, var(--line-soft) 0 1px, transparent 1px 46px),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 396px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 34px 30px 30px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin: 26px 0 8px;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.022em;
}

.auth-sub {
  margin: 0 0 26px;
  color: var(--text-dim);
  font-size: 14px;
}

.field { display: block; margin-bottom: 14px; }
.field > span {
  display: block;
  margin-bottom: 7px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.field input {
  width: 100%;
  padding: 11px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--text);
  transition: border-color .15s ease;
}
.field input::placeholder { color: var(--text-faint); }
.field input:focus { border-color: var(--accent); outline: none; }

.err {
  margin: 4px 0 12px;
  color: var(--danger);
  font-size: 13.5px;
}

.btn-primary {
  width: 100%;
  margin-top: 8px;
  padding: 12px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: var(--r-md);
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: filter .15s ease, transform .1s ease;
}
.btn-primary:hover { filter: brightness(1.07); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary[disabled] { opacity: .55; cursor: default; }

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

.app {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  height: 54px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  padding-top: env(safe-area-inset-top);
  height: calc(54px + env(safe-area-inset-top));
}

.presence {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 5px 10px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  cursor: pointer;
}
.presence:hover { border-color: var(--text-faint); }

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  flex: none;
}
.dot[data-state="online"] { background: var(--mint); box-shadow: 0 0 0 3px rgba(111, 227, 196, .16); }
.dot[data-state="offline"] { background: var(--danger); }
.dot[data-state="connecting"] { background: var(--accent); animation: blink 1s steps(1) infinite; }

.bar-actions { display: flex; gap: 2px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  color: var(--text-dim);
  cursor: pointer;
  transition: background .14s ease, color .14s ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.on { color: var(--accent); }
.icon-btn.on:hover { color: var(--accent); }

.body {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 0;
  position: relative;
}

/* ---------------- roster ---------------- */

.roster {
  display: none;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--bg-2);
  padding: 16px 0 12px;
  min-height: 0;
}

.roster-head, .roster-foot {
  margin: 0;
  padding: 0 18px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.roster-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  text-transform: none;
  letter-spacing: 0.02em;
}
.roster-foot b { color: var(--text-dim); font-weight: 500; }

#roster-list {
  list-style: none;
  margin: 12px 0;
  padding: 0;
  overflow-y: auto;
  min-height: 0;
}
#roster-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 18px;
  font-size: 14px;
}
#roster-list .pip {
  width: 3px;
  height: 15px;
  border-radius: 2px;
  background: hsl(var(--h) var(--author-s) var(--author-l));
  flex: none;
}
#roster-list .rname { color: var(--text-dim); }
#roster-list li.self .rname { color: var(--text); font-weight: 600; }
#roster-list .empty { color: var(--text-faint); font-size: 13px; }

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

/* ---------------- stream ---------------- */

.stream-wrap { position: relative; min-height: 0; display: flex; }

.stream {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 0 18px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.stream::-webkit-scrollbar { width: 10px; }
.stream::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 99px;
  border: 3px solid var(--bg);
}

.stream-top {
  margin: 10px 0 18px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
}

.daysep {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 20px 16px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.daysep::before, .daysep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}

/* the signature: a colour rail per author, no avatars */
.group {
  --author: hsl(var(--h) var(--author-s) var(--author-l));
  position: relative;
  margin: 2px 20px 2px 20px;
  padding: 6px 10px 7px 15px;
  max-width: 940px;
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.group::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 3px;
  border-radius: 2px;
  background: var(--author);
  opacity: .55;
}
.group.own { background: var(--own-tint); }
.group.own::before { opacity: 1; }
.group:hover { background: var(--line-soft); }
.group.own:hover { background: var(--own-tint); }

.ghead {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 3px;
}
.gname {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--author);
}
.gtime {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-faint);
}

.line { position: relative; }
.line + .line { margin-top: 3px; }

.line .stamp {
  position: absolute;
  left: -60px;
  top: 3px;
  width: 46px;
  text-align: right;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
  opacity: 0;
  transition: opacity .12s ease;
}
.group:hover .line .stamp { opacity: 1; }
/* the group header already carries this time */
.line:first-of-type .stamp { display: none; }

.text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
}
.text a { color: var(--mint); text-underline-offset: 2px; }
.text a:hover { text-decoration-thickness: 2px; }

.del {
  position: absolute;
  right: -4px;
  top: 0;
  width: 24px;
  height: 24px;
  display: none;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text-faint);
  cursor: pointer;
}
.group.own .line:hover .del { display: grid; }
.del:hover { color: var(--danger); border-color: var(--danger); }

/* attachments */

.att { margin-top: 6px; }

.shot {
  display: block;
  max-width: min(420px, 100%);
  max-height: 340px;
  width: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  cursor: zoom-in;
  background: var(--surface);
}

.att video, .att audio {
  max-width: min(420px, 100%);
  border-radius: var(--r-md);
  display: block;
}

.filecard {
  display: flex;
  align-items: center;
  gap: 11px;
  max-width: 340px;
  padding: 10px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--text);
  transition: border-color .14s ease;
}
.filecard:hover { border-color: var(--accent); }
.filecard .ext {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--accent);
  text-transform: uppercase;
}
.filecard .fmeta { min-width: 0; }
.filecard .fname {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filecard .fsize {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-faint);
}

.linkcard {
  display: block;
  max-width: 380px;
  margin-top: 7px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: border-color .14s ease;
}
.linkcard:hover { border-color: var(--accent); }
.linkcard img { display: block; width: 100%; max-height: 168px; object-fit: cover; }
.linkcard .lc-body { padding: 10px 13px; }
.linkcard .lc-host {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.linkcard .lc-title {
  margin: 3px 0 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}
.linkcard .lc-desc {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* pending uploads */

.group.pending { opacity: .72; }
.bar-track {
  height: 3px;
  margin-top: 7px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
  max-width: 340px;
}
.bar-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width .16s linear;
}

/* jump to latest */

.jump {
  position: absolute;
  right: 20px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
}

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

.composer-wrap {
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
}

.typing {
  margin: 0 0 6px 4px;
  height: 14px;
  font-size: 12px;
  color: var(--text-faint);
  font-style: italic;
}
.typing:empty { display: none; }

.queue { display: flex; flex-wrap: wrap; gap: 8px; }
.queue:not(:empty) { margin-bottom: 8px; }
.chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px 5px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  max-width: 220px;
}
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.composer {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 5px;
  transition: border-color .14s ease;
}
.composer:focus-within { border-color: var(--accent); }

#input {
  flex: 1;
  min-height: 34px;
  max-height: 160px;
  padding: 7px 4px;
  background: transparent;
  border: 0;
  resize: none;
  outline: none;
  overflow-y: auto;
  line-height: 1.45;
}
#input::placeholder { color: var(--text-faint); }

.icon-btn.attach { flex: none; }
.icon-btn.send {
  flex: none;
  background: var(--accent);
  color: var(--accent-ink);
}
.icon-btn.send:hover { filter: brightness(1.07); background: var(--accent); color: var(--accent-ink); }
.icon-btn.send[disabled] { opacity: .4; cursor: default; filter: none; }

/* ---------------- overlays ---------------- */

.dropzone {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(10, 20, 22, .8);
  backdrop-filter: blur(3px);
}
.dropzone p {
  padding: 26px 42px;
  border: 2px dashed var(--accent);
  border-radius: var(--r-lg);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 40px 20px 72px;
  background: rgba(6, 12, 13, .94);
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--r-sm);
}
.lb-close { position: absolute; top: 14px; right: 14px; color: #E7F1EF; }
.lb-close:hover { background: rgba(255, 255, 255, .12); }
.lb-dl {
  position: absolute;
  bottom: 22px;
  padding: 8px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%);
  z-index: 60;
  padding: 9px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow);
}

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

@media (min-width: 860px) {
  .body { grid-template-columns: 218px minmax(0, 1fr); }
  .roster { display: flex; }
  .scrim { display: none; }
  #roster-toggle { pointer-events: none; }
  .group { margin-left: 68px; }
}

@media (max-width: 859px) {
  .roster {
    position: fixed;
    z-index: 30;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(80vw, 280px);
    border-right: 0;
    border-left: 1px solid var(--line);
    padding-top: calc(16px + env(safe-area-inset-top));
    box-shadow: var(--shadow);
  }
  .roster.open { display: flex; }
  .group { margin-left: 12px; margin-right: 12px; }
  .line .stamp { display: none; }
  .del { display: grid; opacity: .55; right: 0; }
  .shot, .att video, .att audio { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ============================================================
   lobby
   ============================================================ */

.lobby {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.lobby-scroll { overflow-y: auto; }

.lobby-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: 30px 20px calc(48px + env(safe-area-inset-bottom));
}

.lobby-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.lobby-head h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.025em;
}
.room-count {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.who {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px 5px 8px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
}
.who:hover { border-color: var(--text-faint); color: var(--text); }
.who .pip {
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: hsl(var(--h, 30) var(--author-s) var(--author-l));
}

/* room cards */

.rooms { display: grid; gap: 10px; }

.room {
  --author: hsl(var(--h) var(--author-s) var(--author-l));
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 14px 17px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color .14s ease;
}
.room:hover { border-color: var(--text-faint); }
.room::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 2px;
  background: var(--author);
}

.room-name {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.012em;
  overflow-wrap: anywhere;
}
.room-meta {
  margin: 3px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 9px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}
.room-meta .live { color: var(--mint); }
.room-meta .tag {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.room-meta .tag.closed { color: var(--accent); border-color: var(--accent); }

.room-actions { display: flex; align-items: center; gap: 6px; }

.btn-ghost {
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .14s ease, color .14s ease;
  white-space: nowrap;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }

.btn-solid {
  padding: 8px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn-solid:hover { filter: brightness(1.07); }

.btn-danger {
  padding: 8px 10px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text-faint);
  font-size: 12px;
  cursor: pointer;
}
.btn-danger:hover { color: var(--danger); border-color: var(--danger); }

/* inline PIN entry inside a room card */

.pin-form {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.pin-form .err { width: 100%; margin: 0; }

.pin-input {
  width: 116px;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.26em;
  text-align: center;
}
.pin-input:focus { border-color: var(--accent); outline: none; }

.pin-row { display: flex; gap: 8px; align-items: center; }
.pin-row .pin-input { flex: 1 1 auto; width: auto; min-width: 0; }
.pin-row .btn-ghost { flex: none; }

.empty-note {
  margin: 0;
  padding: 26px 18px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  color: var(--text-faint);
  font-size: 14px;
}

/* create / join panels */

.panels {
  display: grid;
  gap: 14px;
  margin-top: 26px;
}

.panel {
  padding: 20px 20px 22px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.panel h2 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.panel-sub {
  margin: 0 0 16px;
  font-size: 13.5px;
  color: var(--text-dim);
}
.panel h2 + .field { margin-top: 16px; }

.vis {
  margin: 4px 0 14px;
  padding: 0;
  border: 0;
}
.vis legend {
  padding: 0;
  margin-bottom: 9px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.vis-opt {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.vis-opt + .vis-opt { margin-top: 8px; }
.vis-opt:has(input:checked) { border-color: var(--accent); background: var(--surface); }
.vis-opt input { margin-top: 3px; accent-color: var(--accent); flex: none; }
.vis-opt b { display: block; font-size: 14px; font-weight: 600; }
.vis-opt i {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 12.5px;
  color: var(--text-dim);
}

/* chat header additions */

.room-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.012em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 720px) {
  .panels { grid-template-columns: 1fr 1fr; align-items: start; }
}

@media (max-width: 520px) {
  .room { grid-template-columns: 1fr; }
  .room-actions { justify-content: flex-start; }
  .lobby-head h1 { font-size: 25px; }
}
