/* LostIRC chat, 2030: a modern app layout with the old phosphor soul. Pixel ghosts, glowing channel names,
   pulse lines and afterglow. Single dark theme on purpose (it is a terminal at heart). */
:root {
  --bg: #07090d;
  --bg-1: #0a0d12;
  --bg-2: #10151c;
  --bg-3: #141a22;
  --line: rgba(255,255,255,.07);
  --line-2: rgba(255,255,255,.12);
  --text: #ece6d8;
  --soft: #a7adb8;
  --dim: #8b93a1;
  --amber: #ffb547;
  --amber-dim: #a8783a;
  --cyan: #6fd3d8;
  --rose: #ff7a7a;
  --gold: #e2b53e;
  --parch: #eadcc0;
  --display: "VT323", "Courier New", monospace;
  --ui: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --head: 64px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--ui); overflow: hidden; }
[hidden] { display: none !important; }
a { color: var(--cyan); }
button { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--mono); }
.small { font-size: 12px; }
.dim { color: var(--dim); }
.cyan { color: var(--cyan); }
.grow { flex: 1 1 auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow { margin: 0; font: 600 11px var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.noscript { padding: 24px; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* pixel ghost avatars (drawn by chat2030.js) */
.ava { display: inline-flex; flex: none; width: 40px; height: 40px; }
.ava svg { width: 100%; height: 100%; shape-rendering: crispEdges; stroke: none; }
.ava-sm { width: 28px; height: 28px; }
.ava-xl { width: 56px; height: 56px; filter: drop-shadow(0 0 12px rgba(255,181,71,.55)); }

/* ---------------- the front door ---------------- */
.door { height: calc(100dvh - var(--head) - env(safe-area-inset-top, 0px)); overflow-y: auto; background: radial-gradient(60% 50% at 50% 25%, #121a24 0%, var(--bg) 70%); }
.door-in { max-width: 1040px; margin: 0 auto; padding: 48px max(16px, env(safe-area-inset-right, 0px)) 48px max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-wrap: wrap; gap: 28px; align-items: stretch; }
.door-card { flex: 1 1 420px; min-width: 0; padding: 36px; border-radius: 28px; background: rgba(16,21,28,.88); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.04); display: flex; flex-direction: column; gap: 22px; }
.door-brand { display: flex; align-items: center; gap: 14px; }
.door-brand h1 { margin: 0; font: 52px/.9 var(--display); color: var(--amber); text-shadow: 0 0 16px rgba(255,181,71,.45); }
.door-brand p { margin: 6px 0 0; font-size: 13px; }
.field { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 8px; }
.field legend { margin-bottom: 10px; padding: 0; }
.row { display: flex; gap: 10px; }
#nickIn { flex: 1; min-width: 0; height: 56px; padding: 0 18px; border-radius: 16px; background: var(--bg); border: 1px solid rgba(255,181,71,.45); box-shadow: 0 0 0 4px rgba(255,181,71,.08); color: var(--text); font: 500 20px var(--ui); outline: 0; }
#nickIn:focus { border-color: var(--amber); box-shadow: 0 0 0 4px rgba(255,181,71,.16); }
.hint { margin: 0; font-size: 13px; color: var(--dim); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 12px; cursor: pointer; font-weight: 600; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--soft); }
.chip:has(input:checked) { background: rgba(255,181,71,.12); border-color: rgba(255,181,71,.5); color: #ffd18a; }
.chip input { accent-color: var(--amber); margin: 0; }
.go { height: 64px; border: 0; border-radius: 18px; background: var(--amber); color: var(--bg); font: 700 20px var(--ui); display: flex; align-items: center; justify-content: center; gap: 12px; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2), 0 0 32px rgba(255,181,71,.45), 0 12px 30px rgba(255,181,71,.18); transition: transform .12s, box-shadow .2s; }
.go:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.3), 0 0 44px rgba(255,181,71,.6), 0 14px 34px rgba(255,181,71,.22); }
.go:disabled { opacity: .6; cursor: progress; transform: none; }
.go svg { width: 22px; height: 22px; stroke-width: 2.2; }
.door-foot { margin: 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--dim); }
.link { background: none; border: 0; padding: 0; color: var(--cyan); text-decoration: underline; cursor: pointer; font: inherit; }
.door-err { margin: 0; padding: 10px 14px; border-radius: 12px; background: rgba(255,122,122,.1); border: 1px solid rgba(255,122,122,.35); color: #ffc2c2; font-size: 14px; }
.door-side { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.panel { padding: 24px; border-radius: 24px; background: var(--bg-1); border: 1px solid var(--line); }
.door-side .panel { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.live-list { display: flex; flex-direction: column; gap: 14px; }
.live { display: flex; align-items: center; gap: 14px; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.live b { font: 400 26px/1 var(--display); width: 120px; flex: none; }
.live .bars { flex: 1; height: 28px; }
.live span:last-child { font: 13px var(--mono); color: var(--soft); width: 70px; text-align: right; flex: none; }
.live-note { margin: 0; color: var(--dim); font-size: 14px; }
.bars { display: flex; align-items: flex-end; gap: 3px; }
.bars i { flex: 1; min-width: 2px; border-radius: 2px; background: #2a3440; }
.realm { display: flex; align-items: center; gap: 18px; padding: 22px 26px; border-radius: 24px; background: linear-gradient(180deg, #211912, #1b1510); border: 1px solid #3a2c1e; text-decoration: none; color: var(--parch); }
.realm > span:first-child { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.realm-k { color: #a8874a; }
.realm-t { font-size: 17px; }
.realm-btn { flex: none; font-weight: 600; color: #120e0a; background: var(--gold); border-radius: 12px; padding: 12px 14px; }
.realm:hover .realm-btn { box-shadow: 0 0 16px rgba(226,181,62,.5); }

/* ---------------- the app shell ---------------- */
.shell { height: calc(100dvh - var(--head) - env(safe-area-inset-top, 0px)); display: flex; position: relative; overflow: hidden; }
.rail { flex: 0 0 76px; padding: 14px 0; display: flex; flex-direction: column; align-items: center; gap: 12px; background: #05070a; border-right: 1px solid var(--line); overflow-y: auto; scrollbar-width: none; }
.rail-rule { width: 32px; height: 1px; background: var(--line-2); flex: none; }
.rail-list { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.tile { position: relative; width: 48px; height: 48px; flex: none; border-radius: 24px; border: 0; background: var(--bg-3); color: var(--text); display: flex; align-items: center; justify-content: center; cursor: pointer; font: 24px/1 var(--display); transition: border-radius .18s, background .18s, box-shadow .18s; }
.tile:hover { border-radius: 16px; background: #1c2430; }
.tile.on { border-radius: 16px; background: var(--amber); color: var(--bg); box-shadow: 0 0 18px rgba(255,181,71,.5); }
.tile.home { border-radius: 16px; box-shadow: 0 0 16px rgba(255,181,71,.3), inset 0 0 0 1px rgba(255,181,71,.45); }
.tile.home.on { background: var(--bg-3); box-shadow: 0 0 22px rgba(255,181,71,.55), inset 0 0 0 2px var(--amber); }
.tile.home .ava { width: 28px; height: 28px; }
.tile.add { background: none; border: 1px dashed rgba(111,211,216,.5); color: var(--cyan); }
.tile.add:hover { background: rgba(111,211,216,.08); }
.badge { position: absolute; right: -4px; bottom: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--rose); color: var(--bg); font: 700 11px/18px var(--ui); text-align: center; border: 2px solid #05070a; }
.tile .pip { position: absolute; left: -14px; width: 4px; height: 8px; border-radius: 0 4px 4px 0; background: var(--text); }

.side { flex: 0 0 264px; display: flex; flex-direction: column; background: var(--bg-1); border-right: 1px solid var(--line); min-height: 0; overflow-y: auto; }
.side-head { padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
.wordmark { font: 30px/1 var(--display); color: var(--amber); letter-spacing: .04em; text-shadow: 0 0 10px rgba(255,181,71,.45); }
.side-head .small { margin-top: 6px; }
.side-k { padding: 16px 18px 6px; }
.side-list { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }
.chan { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 10px; border-radius: 10px; border: 0; background: none; text-align: left; cursor: pointer; color: var(--soft); }
.chan:hover { background: rgba(255,255,255,.04); color: var(--text); }
.chan.on { background: rgba(255,181,71,.1); box-shadow: inset 2px 0 0 var(--amber); color: var(--amber); }
.chan.unread { color: var(--text); font-weight: 600; }
.chan .n { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan .bars { width: 52px; height: 16px; gap: 2px; flex: none; }
.chan .bars i { background: currentColor; opacity: .5; }
.chan.on .bars i { background: var(--amber); }
.chan .cnt { font: 700 11px/18px var(--ui); min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--rose); color: var(--bg); text-align: center; }
.chan .x { visibility: hidden; width: 24px; height: 24px; border-radius: 6px; border: 0; background: none; color: var(--dim); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.chan:hover .x, .chan .x:focus-visible { visibility: visible; }
.chan .x svg { width: 14px; height: 14px; }
.chan .ava { width: 22px; height: 22px; }
.me { margin: 12px; padding: 12px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.me .ava { width: 34px; height: 34px; }
.me-t { flex: 1; min-width: 0; }
.me-n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#mePing { color: var(--cyan); }
#mePing.off { color: var(--dim); }
.ghost-btn { flex: none; font-weight: 600; font-size: 12px; color: var(--text); background: transparent; border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.ghost-btn:hover { border-color: var(--amber); }
.ghost-btn.live { background: var(--cyan); border-color: var(--cyan); color: var(--bg); box-shadow: 0 0 12px rgba(111,211,216,.45); }

.stage { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; position: relative; }
.top { height: 64px; flex: none; padding: 0 20px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(0deg, rgba(255,255,255,.012) 0 1px, transparent 1px 3px); }
.title { margin: 0; font: 400 30px/1 var(--display); color: var(--amber); text-shadow: 0 0 12px rgba(255,181,71,.4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
.topic { margin: 0; flex: 1; min-width: 0; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.05); color: var(--dim); font: 600 12px var(--mono); flex: none; }
.pill .dot { width: 8px; height: 8px; border-radius: 4px; background: currentColor; }
.pill.on { background: rgba(111,211,216,.1); color: var(--cyan); }
.pill.on .dot { box-shadow: 0 0 8px var(--cyan); animation: breathe 2.4s ease-in-out infinite; }
.pill.demo { background: rgba(195,139,255,.12); color: #c38bff; }
@keyframes breathe { 50% { opacity: .35; } }
.icon-btn { width: 40px; height: 40px; flex: none; border-radius: 12px; border: 1px solid var(--line-2); background: transparent; color: var(--text); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.icon-btn:hover, .icon-btn[aria-expanded="true"] { border-color: var(--amber); color: var(--amber); }
.icon-btn.big { width: 56px; height: 56px; border-radius: 16px; background: var(--bg-2); }
.icon-btn.big svg { width: 22px; height: 22px; }
.composer .icon-btn { border: 0; color: var(--dim); }
.only-narrow { display: none !important; }

.tabs { flex: none; gap: 8px; padding: 10px 14px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tab { flex: none; display: flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); font-weight: 600; font-size: 14px; cursor: pointer; }
.tab.on { background: var(--amber); color: var(--bg); border-color: var(--amber); }
.tab .cnt { padding: 0 6px; border-radius: 8px; background: var(--rose); color: var(--bg); font: 700 11px/16px var(--ui); }

/* the conversation */
.feeds { flex: 1; min-height: 0; position: relative; }
.feed { position: absolute; inset: 0; overflow-y: auto; padding: 18px 22px 8px; display: flex; flex-direction: column; gap: 4px; scrollbar-width: thin; scrollbar-color: #2a3440 transparent; }
.feed > :first-child { margin-top: auto; }
.grp { display: flex; gap: 14px; padding: 6px 8px; margin: 4px -8px 0; border-radius: 12px; }
.grp:hover { background: rgba(255,255,255,.02); }
.grp > .ava { margin-top: 2px; }
.grp-b { min-width: 0; flex: 1; }
.grp-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.who { font-weight: 600; cursor: pointer; background: none; border: 0; padding: 0; }
.who:hover { text-decoration: underline; }
.time { font: 11px var(--mono); color: var(--dim); }
.role { font: 600 10px var(--mono); letter-spacing: .08em; color: var(--bg); border-radius: 4px; padding: 1px 5px; }
.line { line-height: 1.5; overflow-wrap: anywhere; color: var(--text); padding: 1px 0; position: relative; }
.line .t { position: absolute; left: -62px; top: 3px; width: 48px; text-align: right; font: 10px var(--mono); color: var(--dim); opacity: 0; }
.line:hover .t { opacity: 1; }
.line.act { font-style: italic; color: var(--soft); }
.line.me-tagged { background: rgba(255,181,71,.08); box-shadow: -10px 0 0 rgba(255,181,71,.08), inset 2px 0 0 var(--amber); margin-left: -10px; padding-left: 10px; border-radius: 0 6px 6px 0; }
.line.notice { color: var(--cyan); }
.reply { margin: 2px 0 2px; padding-left: 12px; border-left: 2px solid var(--amber); box-shadow: -8px 0 16px -10px var(--amber); }
.reply-to { font: 12px var(--mono); color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.reply-to:hover { color: var(--soft); }
.ev { display: flex; align-items: center; gap: 10px; padding: 4px 0 4px 54px; font-size: 13px; color: var(--dim); }
.ev svg { width: 14px; height: 14px; flex: none; }
.ev.err { color: #ffb3b3; }
.ev.srv { font-family: var(--mono); font-size: 12px; padding-left: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ev.join { color: #7fb8a0; }
.day { display: flex; align-items: center; gap: 12px; margin: 10px 0; color: var(--dim); font: 12px var(--mono); }
.day::before, .day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.split { display: flex; align-items: center; gap: 12px; margin: 8px 0; padding: 10px 14px; border-radius: 12px; background: rgba(255,122,122,.08); border: 1px solid rgba(255,122,122,.3); color: #ffb3b3; font: 13px var(--mono); }
.split .r { margin-left: auto; color: var(--cyan); }
.split.healed { background: rgba(111,211,216,.06); border-color: rgba(111,211,216,.25); }
.split svg { width: 18px; height: 18px; }
.focus .grp:not(.lit), .focus .ev { opacity: .28; transition: opacity .2s; }

/* RealmBot cards */
.card { display: flex; gap: 14px; margin: 8px 0; }
.card-ico { width: 40px; height: 40px; flex: none; border-radius: 12px; background: #1b150e; border: 1px solid #a8874a; display: flex; align-items: center; justify-content: center; color: var(--gold); }
.card-b { flex: 1; min-width: 0; max-width: 580px; border-radius: 14px; background: linear-gradient(180deg, #211912, #1b1510); border: 1px solid #3a2c1e; padding: 14px 16px; display: flex; gap: 16px; align-items: center; color: var(--parch); }
.card-b > div { flex: 1; min-width: 0; }
.card-k { font: 600 11px var(--ui); letter-spacing: .14em; text-transform: uppercase; color: #a8874a; }
.card-t { margin-top: 4px; font-size: 16px; }
.card-t b { color: var(--gold); }
.card-s { margin-top: 6px; font: 12px var(--mono); color: #b3a283; }
.card-bar { margin-top: 10px; height: 6px; border-radius: 3px; background: #3a2c1e; overflow: hidden; }
.card-bar i { display: block; height: 100%; background: var(--gold); box-shadow: 0 0 8px var(--gold); animation: fill 1.2s ease-out; }
@keyframes fill { from { width: 0; } }
.card-a { flex: none; font-weight: 600; font-size: 13px; color: #120e0a; background: var(--gold); border-radius: 10px; padding: 10px 12px; text-decoration: none; }
.card.small .card-b { padding: 10px 14px; font-size: 14px; }

.typing { height: 24px; flex: none; padding: 0 22px; display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 13px; }
.wave { display: flex; align-items: center; gap: 2px; }
.wave i { width: 3px; border-radius: 2px; background: var(--c, #c38bff); animation: wave 1s ease-in-out infinite; }
.wave i:nth-child(1) { height: 6px; } .wave i:nth-child(2) { height: 12px; animation-delay: .1s; } .wave i:nth-child(3) { height: 8px; animation-delay: .2s; } .wave i:nth-child(4) { height: 14px; animation-delay: .3s; } .wave i:nth-child(5) { height: 5px; animation-delay: .4s; }
@keyframes wave { 50% { transform: scaleY(.35); } }

.composer { flex: none; margin: 0 20px 18px; padding: 6px 6px 6px 16px; border-radius: 18px; background: var(--bg-2); border: 1px solid rgba(255,181,71,.3); display: flex; align-items: center; gap: 8px; transition: box-shadow .2s, border-color .2s; }
.composer:focus-within { border-color: rgba(255,181,71,.6); box-shadow: 0 0 0 4px rgba(255,181,71,.07), 0 0 24px rgba(255,181,71,.1); }
.prompt { color: var(--amber-dim); white-space: nowrap; font-size: 13px; max-width: 30%; overflow: hidden; text-overflow: ellipsis; }
#msg { flex: 1; min-width: 0; height: 44px; background: transparent; border: 0; outline: 0; color: var(--text); font: 15px var(--ui); }
#msg::placeholder { color: var(--dim); }
.send { height: 44px; padding: 0 18px; border-radius: 12px; border: 0; background: var(--amber); color: var(--bg); font: 700 14px var(--ui); display: flex; align-items: center; gap: 8px; cursor: pointer; box-shadow: 0 0 16px rgba(255,181,71,.4); flex: none; }
.send:hover { box-shadow: 0 0 22px rgba(255,181,71,.6); }
.send svg { width: 16px; height: 16px; stroke-width: 2.2; }
.composer.off { opacity: .6; }

.palette, .picker { position: absolute; left: 20px; right: 20px; bottom: 84px; z-index: 5; max-width: 520px; padding: 6px; border-radius: 18px; background: rgba(16,21,28,.98); border: 1px solid rgba(111,211,216,.3); box-shadow: 0 -10px 40px rgba(0,0,0,.6), 0 0 24px rgba(111,211,216,.08); }
.opt { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px; cursor: pointer; }
.opt[aria-selected="true"] { background: rgba(111,211,216,.12); }
.opt b { font: 600 15px var(--mono); color: var(--text); min-width: 96px; }
.opt[aria-selected="true"] b { color: var(--cyan); }
.opt span { color: var(--soft); font-size: 13px; }
.opt .ava { width: 24px; height: 24px; }
.picker { max-height: 320px; overflow-y: auto; }
.palette { max-height: min(360px, 50vh); overflow-y: auto; }
.picker h3 { margin: 8px 8px 4px; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 2px; }
.picker-grid button { height: 44px; border: 0; border-radius: 10px; background: none; cursor: pointer; font-size: 22px; color: var(--amber); display: flex; align-items: center; justify-content: center; }
.picker-grid button:hover, .picker-grid button:focus-visible { background: rgba(255,181,71,.1); }
.picker-grid .glyph { width: 24px; height: 24px; margin: 0; }

/* people */
.people { flex: 0 0 272px; padding: 16px 12px; background: var(--bg-1); border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.pulse-card { padding: 14px; border-radius: 14px; }
.pulse-k { display: flex; justify-content: space-between; align-items: baseline; }
.pulse { margin-top: 12px; height: 44px; }
.pulse i:last-child { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.people-k { padding: 0 6px; }
.people-list { display: flex; flex-direction: column; gap: 2px; }
.person { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; border: 0; background: none; text-align: left; cursor: pointer; color: var(--text); transition: opacity .6s; }
.person:hover, .person.lit { background: rgba(255,255,255,.05); }
.person .ava { width: 28px; height: 28px; position: relative; }
.person .st { position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 5px; border: 2px solid var(--bg-1); background: #3a4350; }
.person .st.awake { background: var(--cyan); }
.person .st.idle { background: var(--amber-dim); }
.person .pw { position: relative; display: flex; }
.person .pn { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.person .pn b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .pn b i { font: normal 400 13px var(--mono); color: var(--dim); }
.person .pn span { font: 11px var(--mono); color: #b3a283; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* channel directory */
.dir { position: absolute; inset: 0; z-index: 20; background: rgba(5,7,10,.72); backdrop-filter: blur(4px); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; }
.dir-card { width: 100%; max-width: 640px; max-height: 100%; display: flex; flex-direction: column; border-radius: 22px; background: var(--bg-2); border: 1px solid var(--line-2); box-shadow: 0 30px 80px rgba(0,0,0,.6); overflow: hidden; }
.dir-top { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.dir-top h2 { margin: 0; font: 400 28px/1 var(--display); color: var(--amber); }
.dir-search { flex: 1; min-width: 0; }
#dirSearch { width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font: 15px var(--ui); outline: 0; }
#dirSearch:focus { border-color: var(--cyan); }
.dir-note { margin: 0; padding: 10px 16px; color: var(--dim); }
.dir-rows { overflow-y: auto; padding: 0 8px 8px; }
.drow { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 70px; gap: 2px 12px; align-items: center; padding: 10px 12px; border: 0; border-radius: 12px; background: none; text-align: left; cursor: pointer; color: var(--text); }
.drow:hover, .drow.sel { background: rgba(255,181,71,.08); }
.drow b { font: 400 22px/1 var(--display); color: var(--amber); }
.drow .u { font: 12px var(--mono); color: var(--soft); text-align: right; }
.drow .tp { grid-column: 1 / -1; font-size: 13px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drow.in b::after { content: " · joined"; font: 12px var(--mono); color: var(--cyan); }

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

/* narrower screens: the people list becomes a drawer */
@media (max-width: 1180px) {
  .people { position: absolute; right: 0; top: 0; bottom: 0; z-index: 10; box-shadow: -20px 0 50px rgba(0,0,0,.5); transform: translateX(105%); transition: transform .22s ease; }
  .people.open { transform: none; }
}
/* phones: channels become tabs and a drawer */
@media (max-width: 820px) {
  .rail { display: none; }
  .only-narrow { display: flex !important; }
  .side { position: absolute; left: 0; top: 0; bottom: 0; z-index: 10; width: 284px; box-shadow: 20px 0 50px rgba(0,0,0,.5); transform: translateX(-105%); transition: transform .22s ease; }
  .side.open { transform: none; }
  .top { padding: 0 12px; gap: 10px; }
  .topic { display: none; }
  .title { max-width: none; flex: 1; font-size: 26px; }
  .feed { padding: 14px 12px 6px; }
  .grp { gap: 10px; }
  .grp > .ava { width: 32px; height: 32px; }
  .ev { padding-left: 42px; }
  .line .t { display: none; }
  .composer { margin: 0 10px 12px; padding-left: 12px; }
  .prompt { display: none; }
  .send { padding: 0 14px; }
  .palette, .picker { left: 10px; right: 10px; bottom: 76px; }
  .door-in { padding-top: 20px; }
  .door-card { padding: 24px; }
  .door-brand h1 { font-size: 44px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
