@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url(/fonts/IBMPlexSans-400.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url(/fonts/IBMPlexSans-500.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url(/fonts/IBMPlexSans-600.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url(/fonts/IBMPlexMono-400.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url(/fonts/IBMPlexMono-500.woff2) format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 500; font-display: swap; src: url(/fonts/SpaceGrotesk-500.woff2) format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 700; font-display: swap; src: url(/fonts/SpaceGrotesk-700.woff2) format("woff2"); }
:root {
  /* palettes.css supplies --bg --panel --line --fg --muted --accent --on-accent --ok --warn --bad --deep --hover --btn --btn-hover
     --badge --b-open --b-open-fg --b-bad --b-bad-fg and color-scheme; Chat's own tokens are derived from them here */
  --bg-2: var(--hover); --bg-3: var(--btn); --dim: var(--muted);
  --accent-bg: color-mix(in srgb, var(--accent) 18%, var(--panel)); --link: var(--b-open-fg);
  --mention: color-mix(in srgb, var(--warn) 22%, var(--panel)); --mention-fg: var(--warn); --mention-line: var(--warn);
  --danger: var(--bad); --code: var(--deep); --code-fg: var(--b-bad-fg); --shadow: 0 8px 30px rgba(0,0,0,.35);
  --side: var(--deep); --side-2: var(--hover); --side-fg: var(--fg); --side-dim: var(--muted); --side-line: var(--line);
  --side-active: var(--accent); --side-active-fg: var(--on-accent); --side-strong: var(--fg);
  --r: 3px;
  --display: "Space Grotesk", -apple-system, "Segoe UI", sans-serif; --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 15px/1.45 "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji"; background: var(--bg); color: var(--fg); overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }
.i.sm { width: 15px; height: 15px; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--dim); }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- auth ---------- */
.auth { height: var(--app-h, 100dvh); display: flex; background: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 32px 32px, linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 32px 32px, var(--deep); padding: max(16px, env(safe-area-inset-top)) 16px 16px; overflow: auto; }
.auth-card { margin: auto; width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 32px; }
.auth-card h1 { margin: 12px 0 4px; font: 700 22px/1.2 var(--display); letter-spacing: -.02em; }
.auth-card p { color: var(--dim); margin: 0 0 20px; }
.auth-card .logo { width: 48px; height: 48px; }
.field { display: block; margin-bottom: 14px; min-width: 0; }
.field span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.field input, .field textarea, .field select, .input { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
.field input:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--accent); box-shadow: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border-radius: 3px; border: 1px solid var(--line); background: none; font-weight: 500; font-size: 14px; }
.btn:hover { background: var(--bg-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.btn.sm { padding: 4px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.err { color: var(--danger); font-size: 14px; min-height: 20px; margin: 4px 0 8px; }
.or { text-align: center; color: var(--dim); font-size: 13px; margin: 14px 0; }
.switch-link { text-align: center; margin-top: 16px; font-size: 14px; }
.linkish { background: none; border: none; color: var(--link); padding: 0; font-weight: 600; }

/* ---------- layout ----------
   An instrument panel: square edges, hairline rules, fixed columns, monospace for anything machine-like. */
.shell { --side-w: 304px; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr) auto; height: 100vh; height: var(--app-h, 100dvh); background: var(--deep); padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); }
.side { grid-column: 1; grid-row: 1; color: var(--side-fg); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.side-head { display: flex; align-items: center; gap: 2px; height: 52px; flex: none; padding: 0 8px 0 14px; border-bottom: 1px solid var(--line); }
.ws-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 6px 4px 0; text-align: left; color: var(--fg); }
.ws-btn b { font: 700 16px/1.2 var(--display); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-btn .i { color: var(--dim); }
.side-btn { background: none; border: none; color: var(--dim); padding: 7px; border-radius: 3px; display: inline-flex; }
.side-btn:hover { background: var(--side-2); color: var(--side-strong); }
.new-btn { background: var(--accent); color: var(--on-accent); margin-left: 4px; }
.new-btn:hover { background: var(--accent); color: var(--on-accent); filter: brightness(1.08); }
.side-scroll { overflow-y: auto; flex: 1; padding: 0 0 12px; min-height: 0; }
.fchips { display: flex; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; background: var(--deep); }
.fchips::-webkit-scrollbar { display: none; }
.fchip { flex: 1 0 auto; border: 0; background: none; color: var(--dim); padding: 8px 10px 7px; font: 500 10.5px var(--mono); letter-spacing: .05em; text-transform: uppercase; box-shadow: inset 0 -2px 0 transparent; }
.fchip small { color: var(--accent); font: inherit; }
.fchip:hover { color: var(--fg); }
.fchip.on { color: var(--fg); box-shadow: inset 0 -2px 0 var(--accent); }
.nav-item { background: none; border: 0; color: var(--side-fg); text-align: left; text-decoration: none; }
.nav-item:hover { text-decoration: none; }
.conv-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px 8px 14px; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); min-height: 52px; }
.conv-row:hover { background: var(--side-2); }
.conv-row.active { background: color-mix(in srgb, var(--rc, var(--accent)) 11%, var(--panel)); box-shadow: inset 2px 0 0 var(--rc, var(--accent)); }
.conv-row.muted { opacity: .55; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-top, .row-sub { display: flex; align-items: center; gap: 8px; min-width: 0; }
.conv-row .label { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; color: var(--side-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-top time { flex: none; font: 10.5px var(--mono); color: var(--dim); }
.prev { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.4; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub > .i { color: var(--dim); }
.draft { color: var(--accent); font: 500 11px var(--mono); }
.conv-row.unread .label { font-weight: 600; }
.conv-row.unread .prev { color: var(--fg); }
.conv-row.unread:not(:has(.badge)) .row-sub::after { content: ""; flex: none; width: 6px; height: 6px; background: var(--accent); }
.badge { background: var(--accent); color: var(--on-accent); border-radius: 2px; font: 600 10.5px/16px var(--mono); padding: 0 5px; min-width: 16px; text-align: center; flex: none; }
.side-empty { color: var(--dim); font-size: 13px; padding: 18px 14px; }
.side-label { padding: 12px 14px 5px; color: var(--dim); font: 500 10.5px var(--mono); letter-spacing: .05em; text-transform: uppercase; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.side-link { display: flex; align-items: center; gap: 8px; background: none; border: 0; color: var(--dim); padding: 12px 14px; font-size: 13px; }
.side-link:hover { color: var(--fg); }
.folder-bar { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 14px; color: var(--dim); font: 500 10.5px var(--mono); letter-spacing: .05em; text-transform: uppercase; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.dock { grid-column: 1; grid-row: 2; display: flex; padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); }
.dock-btn { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: 0; padding: 8px 0 6px; color: var(--dim); box-shadow: inset 0 2px 0 transparent; }
.dock-btn + .dock-btn { border-left: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.dock-btn .i { width: 16px; height: 16px; }
.dock-btn span:not(.av):not(.dot) { font: 500 9.5px var(--mono); letter-spacing: .03em; text-transform: uppercase; }
.dock-btn:hover { color: var(--fg); background: var(--side-2); }
.dock-btn.on { color: var(--fg); box-shadow: inset 0 2px 0 var(--accent); }
.dock-btn em { position: absolute; top: 3px; left: calc(50% + 5px); background: var(--accent); color: var(--on-accent); border-radius: 2px; font: 600 9.5px/14px var(--mono); padding: 0 3px; min-width: 14px; text-align: center; font-style: normal; }
.dock-btn .av { width: 16px; height: 16px; font-size: 9px; }
.dock-btn .av .dot { width: 7px; height: 7px; right: -2px; bottom: -2px; border-width: 1px; border-color: var(--deep); }
.dock-btn.dnd .av { opacity: .5; }

.av { width: 36px; height: 36px; border-radius: 3px; display: inline-grid; place-items: center; background-color: color-mix(in srgb, var(--c, transparent) 24%, var(--panel)); color: color-mix(in srgb, var(--c, var(--fg)) 78%, var(--fg)); font: 500 14px var(--mono); flex: none; position: relative; background-size: cover; background-position: center; user-select: none; }
.av.s20 { width: 20px; height: 20px; font-size: 10.5px; }
.av.s24 { width: 24px; height: 24px; font-size: 11px; }
.av.s32 { width: 32px; height: 32px; font-size: 13px; }
.av.s44 { width: 44px; height: 44px; font-size: 18px; }
.av.s72 { width: 72px; height: 72px; font-size: 28px; }
.av.s120 { width: 120px; height: 120px; font-size: 44px; }
.dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--side-dim); display: inline-block; flex: none; }
.dot.on { background: var(--ok); border-color: var(--ok); }
.av .dot { position: absolute; right: -2px; bottom: -2px; border: 2px solid var(--deep); width: 10px; height: 10px; background: var(--muted); }
.av.s20 .dot, .av.s24 .dot { width: 8px; height: 8px; border-width: 1.5px; }
.av .dot.on { background: var(--ok); }
/* room tiles: a square in the room's colour with its first letter, never a # */
.rt { width: 32px; height: 32px; border-radius: 3px; display: inline-grid; place-items: center; position: relative; flex: none; background: color-mix(in srgb, var(--c, var(--accent)) 20%, var(--panel)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c, var(--accent)) 45%, transparent); color: color-mix(in srgb, var(--c, var(--accent)) 82%, var(--fg)); font: 500 14px var(--mono); user-select: none; }
.rt.s20 { width: 20px; height: 20px; font-size: 10.5px; }
.rt.s24 { width: 24px; height: 24px; font-size: 11.5px; }
.rt.s44 { width: 44px; height: 44px; font-size: 19px; }
.rt-corner { position: absolute; right: -3px; bottom: -3px; width: 14px; height: 14px; border-radius: 2px; display: grid; place-items: center; background: var(--deep); color: var(--dim); }
.rt-corner .i { width: 9px; height: 9px; }
.rt.s20 .rt-corner, .rt.s24 .rt-corner { display: none; }
.rt.duo { background: none; box-shadow: none; }
.rt.duo .av { position: absolute; width: 62%; height: 62%; font-size: 10px; }
.rt.duo .av:first-child { left: 0; top: 0; }
.rt.duo .av:last-child { right: 0; bottom: 0; box-shadow: 0 0 0 1.5px var(--deep); }
.rt.duo.s20 .av, .rt.duo.s24 .av { font-size: 8px; }

.main { grid-column: 2; grid-row: 1 / 3; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); border-left: 1px solid var(--line); }
.head { display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px; height: 52px; flex: none; border-bottom: 1px solid var(--line); box-shadow: inset 0 2px 0 var(--room, transparent); }
.head-tile { background: none; border: 0; padding: 0; display: inline-flex; }
.head-title { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.head-tools { display: flex; align-items: center; flex: none; border: 1px solid var(--line); border-radius: 3px; }
.head-tools .icon-btn { border-radius: 0; }
.head-tools .icon-btn + .icon-btn { border-left: 1px solid var(--line); }
.head h1 { font: 700 15.5px/1.25 var(--display); letter-spacing: -.01em; margin: 0; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-star { color: var(--accent); fill: var(--accent); width: 11px; height: 11px; }
.head .topic { color: var(--dim); font: 11px/1.4 var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.head .spacer { flex: 1; }
.icon-btn { background: none; border: 0; border-radius: 3px; padding: 7px; display: inline-flex; align-items: center; gap: 4px; color: var(--dim); font: 12px var(--mono); }
.icon-btn .i { width: 16px; height: 16px; }
.icon-btn:hover { background: color-mix(in srgb, var(--fg) 8%, transparent); color: var(--fg); }
.icon-btn.on { color: var(--accent); }
.huddle-btn.live { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.back-btn { display: none; }

.msgs { flex: 1; overflow-y: auto; padding: 0 0 10px; min-height: 0; overscroll-behavior: contain; container-type: inline-size; }
.pane-scroll, .list-view { container-type: inline-size; }
.intro { padding: 24px 16px 16px; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.intro h2 { margin: 10px 0 2px; font: 700 21px/1.2 var(--display); letter-spacing: -.015em; }
.intro p { margin: 0 0 12px; color: var(--dim); max-width: 560px; }
.day { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 7px 16px 5px; background: var(--bg); font: 500 10.5px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--dim); }
.day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.new-line { display: flex; align-items: center; gap: 10px; padding: 7px 16px 5px; color: var(--accent); font: 500 10.5px var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.new-line::after { content: ""; flex: 1; height: 1px; background: var(--accent); }

/* messages are a log. Narrow: author and time above the text. Wide: fixed columns for time, author, text. A line in each person's colour runs down what they said. */
.msg { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; padding: 0 14px; align-items: start; }
.msg:not(.cont):not(.sys) { padding-top: 7px; }
.msg:hover { background: color-mix(in srgb, var(--fg) 4%, transparent); }
.msg .gutter { grid-column: 1; grid-row: 1; display: flex; align-items: center; gap: 6px; min-width: 0; padding-bottom: 2px; }
.msg .stamp { grid-column: 2; grid-row: 1; font: 10.5px/20px var(--mono); color: var(--dim); white-space: nowrap; }
.msg.cont .gutter, .msg.cont .stamp { display: none; }
.msg-body { grid-column: 1 / -1; grid-row: 2; min-width: 0; padding: 1px 0 1px 10px; border-left: 2px solid color-mix(in srgb, var(--c, var(--line)) 60%, transparent); }
.msg.cont .msg-body { grid-row: 1; }
.msg.mine { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.msg.mine .msg-body { border-left-color: var(--accent); }
.msg.mine .msg-meta b { color: var(--accent); }
.msg.mentioned { background: color-mix(in srgb, var(--warn) 11%, transparent); }
.msg.mentioned .msg-body { border-left-color: var(--warn); }
.msg.flash { animation: flash 2s ease-out; }
@keyframes flash { from { background: var(--mention); } to { background: transparent; } }
.msg-meta { display: flex; align-items: center; gap: 6px; min-width: 0; }
.msg-meta b { font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: color-mix(in srgb, var(--c, var(--fg)) 72%, var(--fg)); }
.msg-meta b:hover { text-decoration: underline; }
@container (min-width: 640px) {
  .msg { grid-template-columns: 44px 150px minmax(0, 1fr); column-gap: 0; padding: 0 16px; }
  .msg:not(.cont):not(.sys) { padding-top: 6px; }
  .msg .stamp, .msg.cont .stamp { display: block; grid-column: 1; grid-row: 1; line-height: 22px; }
  .msg.cont .stamp { opacity: 0; }
  .msg.cont:hover .stamp { opacity: 1; }
  .msg .gutter { grid-column: 2; padding: 1px 12px 0 0; }
  .msg .msg-body, .msg.cont .msg-body { grid-column: 3; grid-row: 1; }
}
.msg-content { max-width: 820px; }
.edited { display: block; font: 10.5px var(--mono); color: var(--dim); }
.tag { font: 500 9.5px var(--mono); letter-spacing: .04em; text-transform: uppercase; background: var(--bg-3); color: var(--dim); padding: 1px 4px; border-radius: 2px; flex: none; }
.status-emoji { font-size: 13px; }
.text { word-wrap: break-word; overflow-wrap: anywhere; }
.text p { margin: 0; }
.text p + p { margin-top: 5px; }
.text.deleted { color: var(--dim); font: 12.5px var(--mono); }
.text code { background: color-mix(in srgb, var(--fg) 8%, transparent); color: inherit; border-radius: 2px; padding: 1px 4px; font: 13px var(--mono); }
.text pre { background: var(--code); border: 1px solid var(--line); border-radius: 3px; padding: 9px 12px; overflow-x: auto; margin: 5px 0; font: 12.5px/1.55 var(--mono); }
.text pre code { background: none; padding: 0; color: var(--fg); }
.text blockquote { border-left: 2px solid var(--line); margin: 4px 0; padding: 0 10px; color: var(--dim); }
.text ul, .text ol { margin: 3px 0; padding-left: 20px; }
.text .big-emoji, .text.big-emoji { font-size: 28px; line-height: 1.2; }
.mention { background: var(--accent-bg); color: var(--accent); border-radius: 2px; padding: 0 3px; font-weight: 500; cursor: pointer; }
.mention.me, .mention.all { background: var(--accent); color: var(--on-accent); }
.chan-link { cursor: pointer; font-weight: 500; color: color-mix(in srgb, var(--c, var(--accent)) 80%, var(--fg)); }
.chan-link::before { content: ""; display: inline-block; width: 7px; height: 7px; background: var(--c, var(--accent)); margin-right: 4px; vertical-align: 1px; }
.note-link { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 3px; padding: 1px 7px; background: var(--bg-2); color: var(--fg); font-weight: 500; }
.files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 5px; }
.file-img { max-width: min(360px, 100%); max-height: 300px; border-radius: 3px; border: 1px solid var(--line); cursor: zoom-in; display: block; }
.file-card { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 3px; padding: 7px 10px; min-width: min(220px, 100%); max-width: 360px; background: var(--panel); color: var(--fg); }
.file-card:hover { background: var(--bg-2); text-decoration: none; }
.file-card .fi { width: 32px; height: 32px; border-radius: 3px; background: var(--accent-bg); color: var(--accent); display: grid; place-items: center; flex: none; }
.file-card div { min-width: 0; }
.file-card b { display: block; font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card small { color: var(--dim); font: 11px var(--mono); }
.reacts { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.react { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: none; border-radius: 2px; padding: 0 6px; font: 11.5px var(--mono); height: 22px; }
.react.mine { border-color: var(--accent); background: var(--accent-bg); }
.react:hover { border-color: var(--dim); }
.react.add { color: var(--dim); opacity: 0; padding: 0 4px; }
.msg:hover .react.add { opacity: 1; }
/* replies hang off the message like a tree */
.thread-sum { display: inline-flex; align-items: center; gap: 6px; margin-top: 3px; padding: 1px 6px 1px 0; border: 0; background: none; font: 11.5px var(--mono); }
.thread-sum::before { content: "└─"; color: var(--dim); }
.thread-sum .av { width: 16px; height: 16px; font-size: 9px; }
.thread-sum:hover b { text-decoration: underline; }
.thread-sum b { color: var(--accent); font-weight: 500; }
.thread-sum small { color: var(--dim); font: inherit; }
.pin-note, .bcast-note { font: 10.5px var(--mono); color: var(--dim); display: flex; align-items: center; gap: 4px; margin-bottom: 1px; }
.bcast-note a { cursor: pointer; }
.msg.sys .msg-body { border-left: 0; padding-left: 0; grid-column: 1; grid-row: 1; }
.msg.sys .text { font: 11.5px/20px var(--mono); color: var(--dim); }
.msg.sys .text b { font-weight: 500; }
.msg.sys .text .i { color: var(--ok); width: 12px; height: 12px; }
@container (min-width: 640px) { .msg.sys .msg-body { grid-column: 2 / -1; } }
.tools { position: absolute; right: 12px; top: -12px; display: none; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; box-shadow: 0 2px 10px rgba(0,0,0,.2); z-index: 4; white-space: nowrap; }
.msg:hover .tools, .tools.open { display: flex; }
.tools button { background: none; border: none; padding: 5px 6px; color: var(--dim); display: inline-flex; }
.tools button + button { border-left: 1px solid var(--line); }
.tools button:hover { background: var(--bg-3); color: var(--fg); }
.tools button.on { color: var(--accent); }
.edit-box textarea { width: 100%; border: 1px solid var(--accent); border-radius: 3px; padding: 8px; resize: vertical; min-height: 60px; background: var(--bg); }
.edit-box .row { display: flex; gap: 6px; margin-top: 6px; font: 11px var(--mono); color: var(--dim); align-items: center; }
.seen { display: flex; justify-content: flex-end; align-items: center; gap: 4px; padding: 3px 16px 2px; font: 10.5px var(--mono); color: var(--dim); }

/* composer: a flat command bar across the foot; everything else lives behind the + */
.composer { flex: none; position: relative; }
.composer-box { border-top: 1px solid var(--line); background: var(--panel); padding-bottom: env(safe-area-inset-bottom); }
.composer-row { display: flex; align-items: flex-end; gap: 2px; padding: 6px 8px; }
.composer textarea { flex: 1; min-width: 0; display: block; border: none; outline: none; resize: none; padding: 6px; max-height: 40vh; background: transparent; min-height: 32px; }
.composer textarea::placeholder { font: 13px var(--mono); }
.add-btn.on { color: var(--accent); }
.send { flex: none; background: var(--accent); color: var(--on-accent); border: none; border-radius: 3px; width: 32px; height: 32px; margin-left: 2px; display: inline-grid; place-items: center; }
.send .i { width: 15px; height: 15px; }
.send:not(:disabled):hover { filter: brightness(1.08); }
.send:disabled { background: var(--bg-3); color: var(--dim); cursor: default; }
.composer-tray:not([hidden]) { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 0 8px 8px; }
.tray-btn { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: none; color: var(--dim); border-radius: 3px; padding: 3px 8px; font: 11px var(--mono); }
.tray-btn:hover, .tray-btn.on { color: var(--fg); border-color: var(--dim); }
.format-btns:not([hidden]) { display: inline-flex; gap: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 3px; padding: 2px 4px 2px 8px; font: 11.5px var(--mono); max-width: 220px; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { background: none; border: none; padding: 2px; display: inline-flex; color: var(--dim); }
.chip.busy { opacity: .6; }
.typing { min-height: 16px; font: 10.5px/16px var(--mono); color: var(--dim); padding: 0 16px; }
.archived-bar, .join-bar { padding: 12px 16px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--panel); color: var(--dim); font-size: 13.5px; }
.join-bar { color: var(--fg); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.join-bar p { margin: 0; }
.bcast-opt { display: flex; align-items: center; gap: 6px; font: 11px var(--mono); color: var(--dim); padding: 0 12px 7px; }

/* popovers & menus */
.pop { position: fixed; z-index: 50; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; box-shadow: 0 6px 24px rgba(0,0,0,.3); padding: 3px; max-height: 320px; overflow-y: auto; min-width: 220px; }
.pop .opt { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: none; padding: 8px 10px; border-radius: 3px; text-align: left; font-size: 14px; }
.pop .opt small { color: var(--dim); margin-left: auto; }
.pop .opt.sel, .pop .opt:hover { background: color-mix(in srgb, var(--fg) 9%, transparent); }
.pop .opt.danger { color: var(--danger); }
.pop .opt.danger:hover { background: var(--danger); color: #fff; }
.pop hr { border: none; border-top: 1px solid var(--line); margin: 4px 0; }
.emoji-pop { width: 320px; }
.emoji-pop input { margin-bottom: 6px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-grid button { background: none; border: none; font-size: 22px; padding: 4px; border-radius: 3px; line-height: 1; }
.emoji-grid button:hover { background: var(--bg-3); }

/* right pane */
.pane { grid-column: 3; grid-row: 1 / 3; width: 392px; border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.pane .head { padding: 0 6px 0 14px; }
.pane .head h1 { font-size: 14.5px; }
.pane .head small { font: 11px var(--mono); }
.pane .head small { color: var(--dim); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pane-scroll { overflow-y: auto; flex: 1; min-height: 0; }
.reply-count { display: flex; align-items: center; gap: 10px; padding: 10px 14px 2px; text-transform: uppercase; letter-spacing: .05em; color: var(--dim); font: 500 11px var(--mono); }
.reply-count::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.pane-sec { padding: 14px 20px; border-bottom: 1px solid var(--line); }
.pane-sec h3 { font-size: 12.5px; font-weight: 500; margin: 0 0 6px; color: var(--dim); display: flex; align-items: center; justify-content: space-between; }
.pane-sec p { margin: 0; }
.tabs { display: flex; padding: 0 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; flex: none; }
.tabs button { background: none; border: 0; padding: 8px 12px 7px; font: 500 10.5px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--dim); white-space: nowrap; flex: none; box-shadow: inset 0 -2px 0 transparent; }
.tabs button:hover { color: var(--fg); }
.tabs button.on { color: var(--fg); box-shadow: inset 0 -2px 0 var(--accent); }
.tabs small { font: inherit; color: var(--accent); }
.person { display: flex; align-items: center; gap: 10px; padding: 7px 20px; }
.person:hover { background: var(--bg-2); }
.person .who { flex: 1; min-width: 0; cursor: pointer; }
.person .who small { display: block; color: var(--dim); font-size: 12px; }
.profile { padding: 24px 20px; text-align: center; }
.profile h2 { margin: 12px 0 2px; }
.profile p { margin: 2px 0; color: var(--dim); }
.profile .actions { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.kv { display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px; padding: 12px 20px; font-size: 14px; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; word-break: break-all; }

/* list views */
.list-view { flex: 1; overflow-y: auto; min-height: 0; padding-bottom: env(safe-area-inset-bottom); }
.list-head { padding: 16px 20px 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card { margin: 10px 16px; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 8px; padding: 6px 12px; font: 11.5px var(--mono); color: var(--dim); background: var(--bg-2); border-bottom: 1px solid var(--line); cursor: pointer; }
.card-head b { color: var(--fg); }
.card .msg:last-child { padding-bottom: 8px; }
.card .more-replies { padding: 4px 14px 10px 60px; font-size: 13px; }
.empty { text-align: center; color: var(--dim); padding: 48px 20px; }
.empty .i { width: 40px; height: 40px; opacity: .5; margin-bottom: 8px; }
.row-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.row-item:hover { background: var(--bg-2); }
.row-item .grow { flex: 1; min-width: 0; }
.row-item .grow small { display: block; color: var(--dim); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-sec { padding: 14px 16px 4px; font: 500 10.5px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--dim); }
.hint { color: var(--dim); font-size: 13px; }
table.admin { width: calc(100% - 40px); margin: 0 20px; border-collapse: collapse; font-size: 14px; }
table.admin th, table.admin td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); }
table.admin th { color: var(--dim); font-weight: 600; font-size: 13px; }

/* notes */
.notes { display: grid; grid-template-columns: 290px 1fr; flex: 1; min-height: 0; }
.notes-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.notes-list .top { padding: 10px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--line); }
.filters { display: flex; gap: 4px; flex-wrap: wrap; }
.filters button { border: 1px solid var(--line); background: var(--bg); border-radius: 3px; padding: 2px 10px; font-size: 12px; font-weight: 600; color: var(--dim); }
.filters button.on { color: var(--fg); border-color: var(--accent); }
.notes-scroll { overflow-y: auto; flex: 1; }
.folder-head { padding: 10px 14px 4px; font: 500 10.5px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--dim); display: flex; align-items: center; gap: 6px; }
.note-item { display: block; width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid var(--line); padding: 10px 14px; }
.note-item:hover { background: var(--bg-3); }
.note-item.active { background: var(--accent-bg); box-shadow: inset 3px 0 0 var(--accent); }
.note-item b { display: flex; align-items: center; gap: 5px; font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.note-item small { display: block; color: var(--dim); font-size: 12px; margin-top: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.note-item .meta { display: flex; gap: 6px; align-items: center; margin-top: 3px; color: var(--dim); font-size: 11px; }
.editor { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.editor-bar { display: flex; align-items: center; gap: 2px; padding: 6px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.editor-bar .sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }
.editor-bar .spacer { flex: 1; }
.editor-bar .saved { font-size: 12px; color: var(--dim); margin-right: 8px; white-space: nowrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.seg button { background: none; border: none; padding: 3px 10px; font-size: 13px; color: var(--dim); }
.seg button.on { background: var(--bg-3); color: var(--fg); font-weight: 600; }
.editor-body { flex: 1; display: flex; min-height: 0; }
.editor-body > * { flex: 1; min-width: 0; overflow-y: auto; }
.editor-body.split > .note-preview { border-left: 1px solid var(--line); }
.note-title { border: none; outline: none; font: 700 25px/1.2 var(--display); letter-spacing: -.02em; padding: 20px 32px 4px; background: transparent; width: 100%; }
.note-src { border: none; outline: none; resize: none; padding: 12px 32px 40px; font: 15px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; background: transparent; width: 100%; height: 100%; }
.note-preview { padding: 12px 32px 40px; }
.note-preview h1 { font-size: 26px; margin: 18px 0 8px; }
.note-preview h2 { font-size: 21px; margin: 16px 0 6px; }
.note-preview h3 { font-size: 17px; margin: 14px 0 4px; }
.note-preview p { margin: 0 0 10px; }
.note-preview hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }
.note-preview li.task { list-style: none; margin-left: -22px; }
.note-preview li.task input { margin-right: 8px; }
.note-preview li.task.done > span { text-decoration: line-through; color: var(--dim); }
.note-preview table { border-collapse: collapse; margin: 8px 0; }
.note-preview td, .note-preview th { border: 1px solid var(--line); padding: 4px 10px; }
.banner { background: var(--mention); color: var(--mention-fg); padding: 8px 16px; font-size: 14px; display: flex; gap: 10px; align-items: center; }
.note-editor-col { display: flex; flex-direction: column; min-height: 0; }
.revs { width: 280px; flex: none !important; border-left: 1px solid var(--line); background: var(--bg-2); }
.rev { padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.rev b { display: block; }

/* modal */
.modal-wrap { position: fixed; inset: 0 0 auto; height: var(--app-h, 100dvh); background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 40; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 3px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow); }
.modal header { display: flex; align-items: center; padding: 18px 22px 8px; }
.modal header h2 { flex: 1; margin: 0; font: 700 17px/1.25 var(--display); letter-spacing: -.015em; }
.modal .body { padding: 8px 22px 12px; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 22px 18px; }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 14px; }
.pick-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 3px; margin-top: 8px; }
.pick-list label { display: flex; align-items: center; gap: 10px; padding: 6px 10px; cursor: pointer; }
.pick-list label:hover { background: var(--bg-2); }
.switcher .modal { max-width: 600px; }
.switcher input { border: none; border-bottom: 1px solid var(--line); border-radius: 0; padding: 16px 20px; font-size: 17px; width: 100%; outline: none; background: transparent; }
.switcher .results { max-height: 50vh; overflow-y: auto; padding: 6px; }
.switcher .opt { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: none; padding: 8px 12px; border-radius: 3px; text-align: left; }
.switcher .opt small { color: var(--dim); margin-left: auto; }
.switcher .opt.sel { background: color-mix(in srgb, var(--fg) 9%, transparent); }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: grid; place-items: center; z-index: 60; cursor: zoom-out; }
.lightbox img { max-width: 94vw; max-height: 94vh; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 3px; z-index: 70; box-shadow: var(--shadow); font-size: 14px; }
.offline { background: var(--bad); color: var(--deep); text-align: center; font-size: 13px; padding: 3px; }

/* polls */
.poll { border: 1px solid var(--line); border-radius: 3px; padding: 10px 12px; margin-top: 4px; max-width: 520px; background: var(--bg); }
.poll-q { font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.poll-opt { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 3px; background: var(--bg-2); padding: 7px 10px; margin-bottom: 6px; overflow: hidden; min-height: 38px; }
.poll-opt:hover:not(:disabled) { border-color: var(--dim); }
.poll-opt:disabled { cursor: default; }
.poll-opt.mine { border-color: var(--accent); }
.poll-opt .bar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent-bg); transition: width .3s; }
.poll-opt > span:not(.bar) { position: relative; }
.poll-opt .lbl { flex: 1; min-width: 0; }
.poll-opt .who { display: flex; gap: 2px; }
.poll-opt .cnt { font-weight: 700; min-width: 16px; text-align: right; }
.poll-foot { font-size: 12px; color: var(--dim); }
/* forwarded messages */
.fwd { background: color-mix(in srgb, var(--fg) 5%, transparent); border-radius: 3px; padding: 8px 10px; margin: 6px 0; max-width: 640px; }
.fwd-head { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 2px; }
.fwd-head span { color: var(--dim); }
.fwd .hint { font-size: 12px; cursor: pointer; }

/* huddles */
.live-pill { display: inline-flex; align-items: center; gap: 2px; font: 500 11px var(--mono); color: var(--ok); flex: none; }
.live-pill .i { width: 13px; height: 13px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(43,172,118,.25); flex: none; animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(43,172,118,.08); } }
#huddle-bar:empty { display: none; }
.hb { margin: 8px; padding: 12px; border-radius: 3px; background: color-mix(in srgb, var(--ok) 13%, var(--panel)); color: var(--fg); border: 1px solid color-mix(in srgb, var(--ok) 30%, var(--line)); }
.hb-top { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.hb-top .linkish { color: var(--fg); flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-time { font-variant-numeric: tabular-nums; font-size: 12px; opacity: .8; }
.hb-people { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.hb-person { position: relative; border-radius: 3px; }
.hb-person.connecting { opacity: .5; }
.hb-person.speaking .av, .tile.speaking { box-shadow: 0 0 0 3px var(--ok); }
.mute-dot { position: absolute; right: -4px; bottom: -4px; background: #c0392b; color: #fff; border-radius: 3px; width: 16px; height: 16px; display: grid; place-items: center; }
.mute-dot .i { width: 10px; height: 10px; }
.hctl { display: flex; gap: 6px; }
.hctl.big { justify-content: center; gap: 12px; padding: 14px; }
.hbtn { flex: 1; display: inline-grid; place-items: center; height: 32px; border-radius: 3px; border: none; background: color-mix(in srgb, var(--fg) 12%, transparent); color: var(--fg); }
.hctl.big .hbtn { flex: none; width: 52px; height: 52px; border-radius: 3px; }
.hbtn:hover { background: color-mix(in srgb, var(--fg) 20%, transparent); }
.hbtn.off { background: #c0392b; }
.hbtn.on { background: var(--fg); color: var(--bg); }
.hbtn.leave { background: #c0392b; }
.hbtn.leave:hover { background: #e04836; }
#huddle-full { --fg: #f2f2f0; --bg: #111013; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 30; background: #111013; color: #fff; display: flex; flex-direction: column; }
.hf-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; }
.hf-grid { flex: 1; min-height: 0; display: grid; gap: 10px; padding: 0 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); grid-auto-rows: minmax(160px, 1fr); }
.hf-grid.n1 { grid-template-columns: 1fr; }
.hf-grid.n2 { grid-template-columns: 1fr 1fr; }
.tile { position: relative; background: #1d1b21; border-radius: 3px; overflow: hidden; display: grid; place-items: center; min-height: 0; }
.tile.screen { grid-column: 1 / -1; grid-row: span 2; background: #000; }
.tile video { width: 100%; height: 100%; object-fit: cover; }
.tile.screen video { object-fit: contain; }
.tile video.mirror { transform: scaleX(-1); }
.tile-name { position: absolute; left: 10px; bottom: 10px; background: rgba(0,0,0,.55); padding: 3px 8px; border-radius: 3px; font-size: 13px; display: flex; align-items: center; gap: 4px; }
.ring { position: fixed; top: 20px; right: 20px; z-index: 65; background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 3px; box-shadow: var(--shadow); padding: 16px; display: grid; grid-template-columns: auto 1fr; gap: 12px 14px; align-items: center; width: min(360px, calc(100vw - 32px)); }
.ring-btns { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; }
@media (max-width: 700px) {
  #huddle-full { left: 0; }
  .shell:not(.show-side) #huddle-bar { display: none; }
  .hf-grid { grid-template-columns: 1fr; padding: 0 10px; }
  .hf-grid.n2 { grid-template-columns: 1fr; }
}

/* custom emoji */
img.emoji { width: 22px; height: 22px; object-fit: contain; vertical-align: -5px; }
.big-emoji img.emoji { width: 36px; height: 36px; }
.react img.emoji { width: 16px; height: 16px; vertical-align: -3px; }
.emoji-grid img.emoji { width: 24px; height: 24px; }
.emoji-sec { grid-column: 1 / -1; font-size: 12px; font-weight: 700; color: var(--dim); padding: 6px 2px 2px; }
.emoji-add { display: flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 13px; }
.emoji-manage { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-manage > span { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 3px; padding: 2px 4px 2px 6px; font-size: 13px; }
/* link previews */
.previews { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.preview { position: relative; max-width: 520px; background: color-mix(in srgb, var(--fg) 5%, transparent); border-radius: 3px; padding: 8px 10px; }
.preview a { display: flex; gap: 12px; color: var(--fg); text-decoration: none; }
.preview a:hover b { color: var(--link); text-decoration: underline; }
.preview img { width: 88px; height: 88px; object-fit: cover; border-radius: 3px; flex: none; order: 2; }
.preview div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.preview small { color: var(--dim); font-weight: 600; }
.preview span { color: var(--dim); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.preview-x { position: absolute; top: 2px; right: 2px; opacity: 0; }
.msg:hover .preview-x { opacity: 1; }
/* clips and media */
.file-media { max-width: min(420px, 100%); max-height: 320px; border-radius: 3px; background: #000; }
.file-audio { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 3px; padding: 8px 10px; background: var(--bg-2); }
.file-audio audio { width: min(320px, 70vw); }
.clip { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.clip-live, .clip-review { width: 100%; max-height: 300px; border-radius: 3px; background: #000; }
audio.clip-review { background: none; }
.clip-live.mirror { transform: scaleX(-1); }
.clip-mic { width: 96px; height: 96px; border-radius: 3px; display: grid; place-items: center; background: var(--accent-bg); color: var(--accent); }
.clip-mic .i { width: 40px; height: 40px; }
.clip-time { font-variant-numeric: tabular-nums; color: var(--dim); }
/* channel bookmarks */
.bm-bar { display: flex; align-items: center; gap: 4px; padding: 5px 16px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; flex: none; }
.bm { display: inline-flex; align-items: center; border-radius: 3px; flex: none; background: color-mix(in srgb, var(--fg) 7%, transparent); }
.bm:hover { background: var(--bg-3); }
.bm a { display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; color: var(--fg); font: 11.5px var(--mono); text-decoration: none; cursor: pointer; max-width: 220px; }
.bm a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-x { display: none; background: none; border: none; color: var(--dim); padding: 2px 4px 2px 0; }
.bm:hover .bm-x { display: inline-flex; }
.bm-add { display: inline-flex; align-items: center; gap: 4px; background: none; border: none; color: var(--dim); font-size: 13px; padding: 3px 6px; border-radius: 3px; flex: none; }
.bm-add:hover { background: var(--bg-3); color: var(--fg); }
kbd { font: 12px ui-monospace, Menlo, monospace; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 3px; padding: 1px 6px; background: var(--bg-2); }

.guest-note { margin: 0 14px 8px; padding: 6px 12px; border-radius: 3px; background: var(--side-2); color: var(--side-dim); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.dot.idle { background: var(--warn); border-color: var(--warn); }
.av .dot.idle { background: var(--warn); }
.btn.on { border-color: var(--accent); color: var(--accent); }
.tools .quick { font-size: 15px; padding: 3px 5px; }
.tools .quick img.emoji { width: 16px; height: 16px; }
.revs.comments { width: 320px; display: flex; flex-direction: column; }
.revs.comments #comments-list { flex: 1; overflow-y: auto; }
.rev.resolved { opacity: .6; }
.rev blockquote { cursor: pointer; border-left: 3px solid var(--accent); padding-left: 8px; color: var(--dim); }
.comment-form { padding: 10px 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.comment-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 3px; padding: 8px; resize: vertical; background: var(--bg); }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; padding: 8px 20px 20px; }
.file-tile { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 3px; padding: 10px; color: var(--fg); text-decoration: none; background: var(--bg); min-width: 0; }
.file-tile:hover { background: var(--bg-2); text-decoration: none; }
.file-tile img, .file-tile-ic { width: 100%; height: 110px; object-fit: cover; border-radius: 3px; background: var(--bg-3); display: grid; place-items: center; color: var(--dim); }
.file-tile b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-tile small { color: var(--dim); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-box { width: 180px; height: 180px; background: #fff; border-radius: 3px; padding: 4px; flex: none; } .qr-box svg { width: 100%; height: 100%; display: block; }

/* palette picker */
.pal-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.pal { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 3px; padding: 3px 10px 3px 4px; background: var(--bg); font-size: 13px; }
.pal.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-bg); }
.pal .sw { width: 18px; height: 18px; border-radius: 3px; border: 2px solid var(--panel); }
.md-img { max-width: min(100%, 640px); max-height: 420px; border-radius: 3px; border: 1px solid var(--line); display: block; margin: 6px 0; cursor: zoom-in; }
.note-link.missing { border-style: dashed; color: var(--dim); }
.ws-settings { padding: 0 20px; }
/* usage */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; padding: 0 20px 8px; }
.stat { border: 1px solid var(--line); border-radius: 3px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 22px; font-weight: 800; }
.stat span { font-size: 12px; color: var(--dim); }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 90px; margin: 8px 20px 0; border-bottom: 1px solid var(--line); }
.bar { flex: 1; min-height: 2px; background: var(--accent); border-radius: 2px 2px 0 0; opacity: .85; }
.bar:hover { opacity: 1; }
.row-item.inactive { opacity: .6; }
.text.clamp { max-height: 300px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.show-more { font-size: 12px; margin: 2px 0 4px; }
.quotes { margin: 4px 0; }
.msg-quote { margin: 4px 0; padding: 6px 10px; border-left: 3px solid var(--accent); background: var(--bg-3); border-radius: 0 8px 8px 0; cursor: pointer; font-size: 13px; }
.msg-quote div { margin-top: 2px; color: var(--fg); }
.hl-c { color: var(--dim); font-style: italic; } .hl-s { color: #4fb37c; } .hl-n { color: #d7a85b; } .hl-k { color: #7aa2f7; font-weight: 600; }
.blocks { margin: 4px 0; display: flex; flex-direction: column; gap: 8px; max-width: 640px; }
.blocks.busy { opacity: .6; pointer-events: none; }
.bk-h { margin: 2px 0; font-size: 16px; font-weight: 800; }
.bk-div { border: 0; border-top: 1px solid var(--line); margin: 2px 0; }
.bk-sec { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.bk-sec > .text { flex: 1 1 200px; min-width: 0; }
.bk-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; flex: 1 1 100%; font-size: 13px; }
.bk-acc { flex: none; }
.bk-img img { max-width: 100%; max-height: 360px; border-radius: 3px; border: 1px solid var(--line); display: block; cursor: zoom-in; }
.bk-img figcaption { font-size: 12px; color: var(--dim); margin-top: 4px; }
.bk-ctx { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--dim); }
.bk-ctx-img { width: 20px; height: 20px; border-radius: 3px; object-fit: cover; }
.bk-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bk-actions .input { width: auto; }
.bk-input { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.bk-input > span { font-weight: 600; }
.bk-opts { display: flex; flex-direction: column; gap: 2px; }
.bk-builder { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bk-builder textarea { font: 12px ui-monospace, monospace; }
.bk-preview { border: 1px solid var(--line); border-radius: 3px; padding: 10px; overflow: auto; max-height: 460px; }
@media (max-width: 760px) { .bk-builder { grid-template-columns: 1fr; } }
.task-row input[type=checkbox] { width: 18px; height: 18px; margin: 2px 4px 0 0; flex: none; }
.task-row.done b { text-decoration: line-through; opacity: .6; }
.overdue { color: #e5484d; font-weight: 600; }
.tag.resolved { color: var(--ok); background: rgba(43,172,118,.12); margin-left: 6px; }
.rec-dot { color: #e5484d; font-size: 11px; font-weight: 800; letter-spacing: .04em; animation: pulse 1.5s infinite; }
.hbtn.rec { background: #e5484d; color: #fff; }
.ws-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.ws-row > span { flex: 1; }
tr.inactive td { opacity: .5; }
.keyboard .composer { padding-bottom: 6px; }
.keyboard .typing { height: 0; padding: 0; overflow: hidden; }
/* tablets and small laptops: a narrower list, and the side pane slides over the conversation */
@media (min-width: 701px) and (max-width: 1100px) {
  .shell { --side-w: 272px; grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .pane { position: fixed; top: 0; right: 0; bottom: 0; z-index: 20; width: min(420px, 62vw); box-shadow: -8px 0 30px rgba(0,0,0,.3); padding-top: env(safe-area-inset-top); }
  .head .topic { max-width: 30vw; }
}
/* phones: one screen at a time, with the dock as the tab bar */
@media (max-width: 700px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .shell .side { display: none; }
  .shell.show-side .side { display: flex; }
  .shell.show-side .main { display: none; }
  .shell.show-pane .main { display: none; }
  .shell.show-pane .dock, .shell.no-dock .dock, .shell:has(.notes.editing) .dock { display: none; }
  .dock { grid-row: 2; background: var(--deep); }
  .main { grid-column: 1; grid-row: 1; border-left: 0; }
  .shell.no-dock .main { grid-row: 1 / 3; }
  .pane { grid-column: 1; grid-row: 1 / 3; width: auto; min-width: 0; border-left: 0; }
  .back-btn { display: inline-flex; }
  .shell:not(.no-dock):not(:has(.notes.editing)) .main .back-btn { display: none; }
  .notes { grid-template-columns: 1fr; }
  .notes.editing .notes-list { display: none; }
  .notes:not(.editing) .editor { display: none; }
  .note-title, .note-src, .note-preview { padding-left: 16px; padding-right: 16px; }
  .revs { display: none; }
  .head .topic:empty { display: none; }
  .head { padding: 0 8px 0 4px; gap: 6px; }
  #huddle-full { left: 0; }
  .shell:not(.show-side) #huddle-bar { display: none; }
  .hf-grid { grid-template-columns: 1fr; padding: 0 10px; }
  .hf-grid.n2 { grid-template-columns: 1fr; }
}
.keyboard .composer-box { padding-bottom: 0; }
.keyboard .typing { min-height: 0; height: 0; padding: 0; overflow: hidden; }
/* fingers: bigger targets, and 16px text so iOS does not zoom the page on focus */
@media (pointer: coarse) {
  textarea, input, select { font-size: 16px !important; }
  .fchip { padding: 11px 10px 10px; }
  .tools button { padding: 9px; }
  .react { height: 28px; }
  .tray-btn { padding: 7px 11px; }
  .icon-btn { padding: 9px; }
}
