/* Hackdisc. Layout follows the familiar chat-app shape (server rail | channels | chat | members).
   Look (2026-10-15): "Night Blue", the same system as HackLive: deep navy, one bright blue for actions,
   rounded cards/buttons, pill tags, Outfit (SIL OFL, self-hosted in fonts/). Dark by default, light via html[data-theme]. */
@font-face { font-family: "Outfit"; font-weight: 100 900; font-display: swap; src: url("fonts/outfit-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Outfit"; font-weight: 100 900; font-display: swap; src: url("fonts/outfit-latin-ext-wght-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }

:root, html[data-theme="dark"] {
  --bg-0: #050512;      /* rail */
  --bg-1: #0b0c1f;      /* sidebar / members */
  --bg-2: #101225;      /* chat */
  --bg-3: #191d2c;      /* inputs, hovers */
  --bg-4: #232838;      /* active */
  --ink: #fcfcfc;
  --ink-2: #c4c9d4;
  --ink-3: #8b93a3;
  --line: #262b3a;
  --accent: #2b8cff;
  --accent-btn: #0070d1;
  --accent-ink: #ffffff;
  --accent-soft: rgba(43, 140, 255, .14);
  --ok: #3ddc84;
  --warn: #f5b942;
  --danger: #ff5c63;
  --stage: #050512;
  --shadow: 0 12px 34px rgba(0, 0, 0, .45);
  --glow: radial-gradient(ellipse at 50% 115%, rgba(0, 112, 209, .35), transparent 60%);
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg-0: #e9eef6;
  --bg-1: #f4f6fa;
  --bg-2: #fcfcfc;
  --bg-3: #eef1f6;
  --bg-4: #e2e8f2;
  --ink: #1d1f24;
  --ink-2: #363636;
  --ink-3: #6b7280;
  --line: #e3e6ec;
  --accent: #0070d1;
  --accent-btn: #0070d1;
  --accent-ink: #ffffff;
  --accent-soft: rgba(0, 112, 209, .1);
  --ok: #1f9d55;
  --warn: #b7791f;
  --danger: #d93a41;
  --stage: #08081c;
  --shadow: 0 12px 34px rgba(16, 40, 80, .1);
  --glow: radial-gradient(ellipse at 50% 115%, rgba(0, 112, 209, .12), transparent 60%);
  color-scheme: light;
}
:root {
  --sans: "Outfit", "Segoe UI", system-ui, sans-serif;
  --code: ui-monospace, "Cascadia Code", Consolas, monospace;
  --rail-w: 76px;
  --side-w: 252px;
  --members-w: 240px;
  --r: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg-2); color: var(--ink); font: 16px/1.45 var(--sans); overflow: hidden; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border: 3px solid transparent; background-clip: padding-box; border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 18px; font: 600 15px var(--sans); border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-3); transition: background .15s, box-shadow .15s, border-color .15s; }
.btn:hover { background: var(--bg-4); }
.btn-primary { background: var(--accent-btn); color: #fff; border-color: var(--accent-btn); font-weight: 700; }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); box-shadow: 0 6px 18px rgba(0, 112, 209, .3); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-wide { width: 100%; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:disabled { opacity: .5; cursor: default; box-shadow: none; }
label { display: grid; gap: 7px; font: 500 14px var(--sans); color: var(--ink-2); }
input[type="text"], input[type="password"], input:not([type]), select, textarea {
  width: 100%; padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); font: 16px var(--sans); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
.form-error { color: var(--danger); font-size: 14px; min-height: 1em; margin: 0; }

/* ---------- auth ---------- */
.auth { height: 100%; display: grid; place-items: center; padding: 16px; overflow: auto;
  background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-1) 30%, color-mix(in srgb, #0a2a5a 75%, var(--bg-1)) 75%, var(--bg-1) 100%); }
html[data-theme="light"] .auth { background: linear-gradient(180deg, #eef4fc 0%, #fcfcfc 70%); }
.auth-card { width: min(440px, 100%); display: grid; gap: 16px; padding: 34px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 30px; box-shadow: var(--shadow); }
.auth-card h1 { font: 500 34px/1.1 var(--sans); letter-spacing: -.03em; margin: 0; }
.auth-card p { margin: 0; }
.brand { display: flex; align-items: center; gap: 10px; font: 700 20px var(--sans); letter-spacing: -.03em; }
.brand i { color: var(--accent); font-style: normal; font-weight: 400; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #fff; font: 700 17px var(--sans);
  background: linear-gradient(135deg, #2b8cff, #0070d1 55%, #3b2fd9); box-shadow: 0 6px 16px rgba(0, 112, 209, .35); }
.invite-banner { padding: 12px 14px; border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 14px; font-size: 15px; }

/* ---------- app grid ---------- */
.app { height: 100%; display: grid; grid-template-columns: var(--rail-w) var(--side-w) 1fr var(--members-w); }
.app.no-members { grid-template-columns: var(--rail-w) var(--side-w) 1fr 0; }
.app.no-members .members { display: none; }

/* rail */
.rail { background: var(--bg-0); display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 0; overflow-y: auto; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail-sep { width: 32px; height: 2px; border-radius: 2px; background: var(--line); flex: none; }
.guild-btn { position: relative; width: 50px; height: 50px; flex: none; display: grid; place-items: center; background: var(--bg-3); border-radius: 50%; font: 600 16px var(--sans); transition: border-radius .15s, background .15s, color .15s; }
.guild-btn:hover { border-radius: 16px; background: var(--accent-btn); color: #fff; }
.guild-btn.active { border-radius: 16px; background: linear-gradient(135deg, #2b8cff, #0070d1 60%, #3b2fd9); color: #fff; box-shadow: 0 6px 16px rgba(0, 112, 209, .35); }
.guild-btn::before { content: ""; position: absolute; left: -13px; top: 50%; width: 4px; height: 0; border-radius: 0 4px 4px 0; background: var(--ink); transform: translateY(-50%); transition: height .15s; }
.guild-btn.unread::before { height: 8px; }
.guild-btn:hover::before { height: 20px; }
.guild-btn.active::before { height: 40px; }
.guild-btn.add { color: var(--ok); font-size: 26px; font-weight: 300; }
.guild-btn.add:hover { background: var(--ok); color: #fff; }
.guild-btn .voice-dot { position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border-radius: 50%; background: var(--ok); border: 3px solid var(--bg-0); }

/* sidebar */
.sidebar { background: var(--bg-1); display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.guild-header { height: 56px; flex: none; display: flex; align-items: center; padding: 0 10px 0 16px; border-bottom: 1px solid var(--line); font: 600 17px var(--sans); letter-spacing: -.01em; gap: 8px; }
.guild-header .gh-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; color: var(--ink-2); flex: none; border-radius: 8px; }
.icon-btn:hover { color: var(--ink); background: var(--bg-3); }
.icon-btn.on { color: var(--accent); }
.icon-btn.danger { color: var(--danger); }
.icon-btn svg { width: 20px; height: 20px; }
.channel-list { flex: 1; overflow-y: auto; padding: 12px 8px; }
.cat { display: flex; align-items: center; justify-content: space-between; padding: 16px 8px 6px; font: 600 12px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.cat:first-child { padding-top: 4px; }
.cat .icon-btn { width: 22px; height: 22px; border-radius: 6px; }
.cat .icon-btn svg { width: 16px; height: 16px; }
.chan { width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 10px; margin: 2px 0; color: var(--ink-3); text-align: left; position: relative; border-radius: 10px; }
.chan:hover { background: var(--bg-3); color: var(--ink-2); }
.chan.active { background: var(--accent-soft); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(43, 140, 255, .35); }
.chan.unread { color: var(--ink); font-weight: 600; }
.chan.unread::before { content: ""; position: absolute; left: -8px; top: 50%; width: 4px; height: 8px; border-radius: 0 4px 4px 0; background: var(--ink); transform: translateY(-50%); }
.chan .glyph { width: 20px; flex: none; color: var(--ink-3); font: 500 19px var(--sans); text-align: center; }
.chan.active .glyph { color: var(--accent); }
.chan .glyph svg { width: 18px; height: 18px; vertical-align: -3px; }
.chan .cname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan .chan-tools { display: none; }
.chan:hover .chan-tools { display: flex; }
.chan-tools .icon-btn { width: 24px; height: 24px; border-radius: 6px; }
.chan-tools .icon-btn svg { width: 15px; height: 15px; }
.voice-users { margin: 0 0 4px 28px; }
.vuser { display: flex; align-items: center; gap: 8px; padding: 4px 8px; color: var(--ink-2); font-size: 15px; border-radius: 8px; }
.vuser:hover { background: var(--bg-3); }
.vuser .vname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vuser .vicons { display: flex; align-items: center; gap: 3px; color: var(--ink-3); }
.vuser .vicons svg { width: 15px; height: 15px; }
.live-badge { font: 700 10px var(--sans); padding: 2px 6px; border-radius: 999px; background: var(--danger); color: #fff; letter-spacing: .06em; }

/* avatar */
.avatar { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%; font: 600 13px var(--sans); color: #fff; position: relative; text-transform: uppercase; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 40px; height: 40px; font-size: 16px; }
.avatar.speaking { box-shadow: 0 0 0 2px var(--bg-1), 0 0 0 4px var(--ok); }
.status { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border: 3px solid var(--bg-1); background: var(--ink-3); border-radius: 50%; }
.status.online { background: var(--ok); }

/* voice connection panel (bottom of sidebar) */
.voice-panel { flex: none; margin: 0 8px 8px; padding: 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; display: grid; gap: 8px; }
.vp-top { display: flex; align-items: center; gap: 8px; }
.vp-status { flex: 1; min-width: 0; }
.vp-status b { display: flex; align-items: center; gap: 6px; font: 600 14px var(--sans); color: var(--ok); }
.vp-status b::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 25%, transparent); }
.vp-status b.connecting { color: var(--warn); }
.vp-status span { display: block; font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.vp-actions .btn { min-height: 34px; padding: 0 8px; font-size: 13px; }
.vp-actions .btn.on { background: var(--accent-btn); color: #fff; border-color: var(--accent-btn); }

/* user panel */
.user-panel { flex: none; height: 60px; display: flex; align-items: center; gap: 6px; padding: 0 8px; background: var(--bg-0); }
.up-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 5px 6px; border-radius: 10px; }
.up-who:hover { background: var(--bg-3); }
.up-names { min-width: 0; line-height: 1.15; }
.up-names b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-names span { display: block; font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-panel .avatar .status { border-color: var(--bg-0); }

/* main */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg-2); }
.main-header { height: 56px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 18px; border-bottom: 1px solid var(--line); }
.main-header .mh-title { font: 600 17px var(--sans); display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.main-header .mh-title .glyph { color: var(--ink-3); font: 500 21px var(--sans); display: inline-flex; }
.main-header .mh-title .glyph svg { width: 20px; height: 20px; }
.main-header .mh-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-only { display: none !important; }
.main-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* messages */
.messages { flex: 1; overflow-y: auto; padding: 16px 0 8px; overflow-anchor: none; }
.chan-intro { margin: 0 16px 10px; padding: 24px; border-radius: 24px; background: var(--bg-1); border: 1px solid var(--line); background-image: var(--glow); }
.chan-intro .big-glyph { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px; background: linear-gradient(135deg, #2b8cff, #0070d1 55%, #3b2fd9); color: #fff; font: 500 36px var(--sans); margin-bottom: 12px; box-shadow: 0 8px 20px rgba(0, 112, 209, .35); }
.chan-intro h2 { font: 500 30px/1.1 var(--sans); letter-spacing: -.03em; margin: 0 0 6px; }
.chan-intro p { margin: 0; color: var(--ink-3); }
.load-older { display: flex; margin: 0 auto 12px; }
.msg { position: relative; display: grid; grid-template-columns: 40px 1fr; column-gap: 14px; padding: 2px 48px 2px 18px; }
.msg.first { margin-top: 14px; padding-top: 4px; }
.msg:hover { background: color-mix(in srgb, var(--bg-3) 55%, transparent); }
.msg.mentioned { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.msg .avatar { margin-top: 2px; }
.msg .gutter { font: 11px var(--sans); color: var(--ink-3); visibility: hidden; text-align: right; padding-top: 4px; }
.msg:hover .gutter { visibility: visible; }
.msg-head { display: flex; align-items: baseline; gap: 8px; }
.msg-head .author { font-weight: 600; }
.msg-head time { font: 12px var(--sans); color: var(--ink-3); }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.msg-body .edited { font-size: 11px; color: var(--ink-3); margin-left: 4px; }
.msg-body code { font: 14px var(--code); background: var(--bg-3); padding: 1px 5px; border-radius: 6px; }
.msg-body pre { font: 14px/1.45 var(--code); background: var(--bg-1); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 4px 0; overflow-x: auto; white-space: pre; }
.msg-body .mention { background: var(--accent-soft); color: var(--accent); padding: 0 4px; border-radius: 6px; font-weight: 600; }
.msg-body blockquote { margin: 2px 0; padding-left: 12px; border-left: 3px solid var(--bg-4); border-radius: 2px; color: var(--ink-2); }
.attach { margin-top: 6px; }
.attach img, .attach video { display: block; max-width: min(420px, 100%); max-height: 320px; border: 1px solid var(--line); border-radius: 14px; cursor: zoom-in; background: var(--bg-1); }
.attach audio { max-width: 100%; }
.attach .file { display: inline-flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-1); max-width: 100%; }
.attach .file a { font-weight: 600; overflow-wrap: anywhere; }
.msg-tools { position: absolute; right: 18px; top: -14px; display: none; padding: 2px; background: var(--bg-1); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.msg:hover .msg-tools { display: flex; }
.msg-tools .icon-btn { width: 30px; height: 30px; }
.msg-tools .icon-btn svg { width: 17px; height: 17px; }
.msg-edit textarea { min-height: 44px; resize: none; }
.msg-edit .small { margin-top: 4px; }

/* composer */
.composer-wrap { flex: none; padding: 0 16px 6px; }
.composer { display: flex; align-items: flex-end; gap: 4px; background: var(--bg-3); border: 1px solid var(--line); border-radius: 14px; padding: 4px 8px; }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer textarea { flex: 1; min-height: 42px; max-height: 40vh; resize: none; background: transparent; border: 0; padding: 10px 4px; outline: none; font: 16px/1.375 var(--sans); }
.composer textarea:focus { outline: none; }
.composer .icon-btn { height: 42px; }
.pending-attach { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 6px; background: var(--bg-1); border: 1px solid var(--line); border-radius: 14px; font-size: 14px; }
.pending-attach img { width: 48px; height: 48px; object-fit: cover; border-radius: 10px; }
.pending-attach span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.typing { height: 22px; padding: 2px 20px 0; font-size: 13px; color: var(--ink-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.typing .dots { display: inline-block; width: 24px; }
.typing .dots i { display: inline-block; width: 5px; height: 5px; margin-right: 2px; border-radius: 50%; background: var(--ink-2); animation: blink 1.2s infinite; }
.typing .dots i:nth-child(2) { animation-delay: .2s; } .typing .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.drop-hint { position: absolute; inset: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 18%, transparent); border: 3px dashed var(--accent); border-radius: 24px; font: 500 28px var(--sans); pointer-events: none; z-index: 5; }

/* voice stage */
.stage { flex: 1; min-height: 0; background: var(--stage); background-image: radial-gradient(ellipse at 50% 120%, rgba(0, 112, 209, .28), transparent 60%); color: #fcfcfc; display: flex; flex-direction: column; position: relative; }
.stage-empty { flex: 1; display: grid; place-items: center; text-align: center; padding: 24px; }
.stage-empty h2 { font: 500 34px/1.1 var(--sans); letter-spacing: -.03em; margin: 0 0 8px; }
.stage-empty p { color: #8b93a3; margin: 0 0 18px; }
.stage-users { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.tiles { flex: 1; min-height: 0; display: grid; gap: 10px; padding: 12px; align-content: center; justify-content: center; }
.tiles.focus-mode { grid-template-columns: 1fr !important; grid-template-rows: 1fr auto; align-content: stretch; }
.tile { position: relative; background: #191d24; border: 1px solid #262b3a; border-radius: 18px; overflow: hidden; display: grid; place-items: center; aspect-ratio: 16 / 9; min-width: 0; }
.tile.speaking { box-shadow: inset 0 0 0 3px var(--ok); }
.tile video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.tile.camera video { object-fit: cover; }
.tile.self.camera video { transform: scaleX(-1); }
.tile .avatar { width: 84px; height: 84px; font-size: 32px; }
.tile .tile-name { position: absolute; left: 10px; bottom: 10px; max-width: calc(100% - 20px); display: flex; align-items: center; gap: 6px; padding: 5px 12px; background: rgba(8, 8, 28, .78); backdrop-filter: blur(6px); border-radius: 999px; font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tile .tile-name svg { width: 14px; height: 14px; flex: none; }
.tile .tile-actions { position: absolute; right: 10px; top: 10px; display: none; gap: 4px; }
.tile:hover .tile-actions { display: flex; }
.tile-actions .icon-btn { background: rgba(8, 8, 28, .78); color: #fcfcfc; border-radius: 10px; }
.tile-actions .icon-btn:hover { background: #0070d1; }
.tile .watch { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 12px; }
.tile .watch p { margin: 0; color: #c4c9d4; }
.tile .vol { position: absolute; left: 10px; right: 10px; top: 10px; display: none; align-items: center; gap: 8px; padding: 5px 12px; background: rgba(8, 8, 28, .8); border-radius: 999px; font: 12px var(--sans); }
.tile:hover .vol { display: flex; }
.tile .vol input { flex: 1; accent-color: var(--accent); }
.focus-strip { display: flex; gap: 10px; overflow-x: auto; height: 110px; }
.focus-strip .tile { height: 100%; flex: none; aspect-ratio: 16 / 9; border-radius: 14px; }
.focus-strip .tile .avatar { width: 44px; height: 44px; font-size: 17px; }
.stage-bar { flex: none; display: flex; justify-content: center; gap: 10px; padding: 14px; }
.round { width: 54px; height: 54px; display: grid; place-items: center; background: #191d24; color: #fcfcfc; border: 1px solid #2c3240; border-radius: 50%; transition: background .15s; }
.round:hover { background: #232834; }
.round.on { background: #fcfcfc; color: #0070d1; border-color: #fcfcfc; }
.round.off { background: #ff5c63; border-color: #ff5c63; color: #fff; }
.round.hang { background: #ff5c63; border-color: #ff5c63; color: #fff; width: 70px; border-radius: 999px; }
.round svg { width: 24px; height: 24px; }
.share-note { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); max-width: min(560px, calc(100% - 24px)); padding: 10px 16px; background: rgba(8, 8, 28, .85); backdrop-filter: blur(6px); border: 1px solid #2c3240; border-radius: 14px; font-size: 14px; text-align: center; z-index: 3; }

/* members */
.members { background: var(--bg-1); overflow-y: auto; padding: 16px 8px; border-left: 1px solid var(--line); min-width: 0; }
.members h3 { font: 600 12px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 16px 10px 6px; }
.members h3:first-child { margin-top: 0; }
.member { width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px 10px; text-align: left; border-radius: 10px; }
.member:hover { background: var(--bg-3); }
.member.offline { opacity: .45; }
.member .mname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.member .crown { color: var(--warn); font-size: 13px; }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(5, 5, 18, .7); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .12s; }
.modal { width: min(470px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--bg-2); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); }
.modal.wide { width: min(620px, 100%); }
.modal-head { padding: 26px 26px 6px; }
.modal-head h2 { font: 500 26px/1.15 var(--sans); letter-spacing: -.02em; margin: 0 0 6px; }
.modal-head p { margin: 0; color: var(--ink-3); }
.modal-body { padding: 14px 26px; display: grid; gap: 14px; }
.modal-foot { padding: 16px 26px; background: var(--bg-1); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.choice { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--bg-3); border: 1px solid var(--line); border-radius: 16px; width: 100%; text-align: left; font-weight: 600; }
.choice:hover { border-color: var(--accent); background: var(--accent-soft); }
.choice svg { width: 22px; height: 22px; color: var(--accent); }
.radio-row { display: grid; gap: 8px; }
.radio-row label { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--bg-3); border: 1px solid var(--line); border-radius: 14px; font: 500 15px var(--sans); color: var(--ink); cursor: pointer; }
.radio-row label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-row input { accent-color: var(--accent); }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; font-size: 14px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 3px solid transparent; }
.swatch.sel { border-color: var(--ink); }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--bg-3); border: 1px solid var(--line); border-radius: 12px; }
.seg button { padding: 8px 18px; font: 500 14px var(--sans); border-radius: 9px; }
.seg button.active { background: var(--accent-btn); color: #fff; }
.hint { font-size: 13px; color: var(--ink-3); margin: 0; }
.inv-list { display: grid; gap: 6px; max-height: 220px; overflow-y: auto; }
.inv-row { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 12px; background: var(--bg-3); border: 1px solid var(--line); border-radius: 12px; }
.inv-row > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.inv-row code { font: 600 14px var(--code); }
.inv-row .hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.danger-zone { border-top: 1px solid var(--line); padding-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
details summary { color: var(--ink-2); }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(5, 5, 18, .9); display: grid; place-items: center; padding: 24px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 14px; }

/* toasts & context menu */
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 70; width: min(420px, calc(100% - 32px)); }
.toast { padding: 12px 16px; background: var(--ink); color: var(--bg-2); border-radius: 14px; box-shadow: var(--shadow); font-size: 15px; animation: fade .15s; }
.toast.error { background: var(--danger); color: #fff; }
@keyframes fade { from { opacity: 0; } }
.ctx-menu { position: fixed; z-index: 80; min-width: 190px; background: var(--bg-1); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; }
.ctx-menu button { display: block; width: 100%; text-align: left; padding: 8px 12px; font-size: 15px; border-radius: 8px; }
.ctx-menu button:hover { background: var(--accent-btn); color: #fff; }
.ctx-menu button.danger { color: var(--danger); }
.ctx-menu button.danger:hover { background: var(--danger); color: #fff; }
.ctx-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.scrim { display: none; }

/* ---------- phones ---------- */
@media (max-width: 860px) {
  .app, .app.no-members { grid-template-columns: 1fr; }
  .rail, .sidebar { position: fixed; top: 0; bottom: 0; z-index: 30; transform: translateX(calc(-100% - var(--rail-w) - 24px)); transition: transform .18s; }
  .rail { left: 0; width: var(--rail-w); }
  .sidebar { left: var(--rail-w); width: min(var(--side-w), calc(100vw - var(--rail-w) - 40px)); }
  .app.nav-open .rail, .app.nav-open .sidebar { transform: none; }
  .members { position: fixed; right: 0; top: 0; bottom: 0; width: min(var(--members-w), 80vw); z-index: 30; transform: translateX(120%); transition: transform .18s; display: block !important; }
  .app.members-open .members { transform: none; }
  .app.nav-open .scrim, .app.members-open .scrim { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(5, 5, 18, .55); }
  .mobile-only { display: inline-grid !important; }
  .msg { padding-right: 16px; grid-template-columns: 36px 1fr; column-gap: 12px; }
  .msg .avatar { width: 36px; height: 36px; }
  .msg-tools { display: flex; position: static; grid-column: 2; justify-self: start; box-shadow: none; border: 0; background: transparent; opacity: .6; }
  .msg:not(:hover) .msg-tools { display: none; }
  .composer-wrap { padding: 0 8px calc(6px + env(safe-area-inset-bottom)); }
  .tiles { grid-template-columns: 1fr !important; overflow-y: auto; align-content: start; }
  .round { width: 48px; height: 48px; }
  .tile .tile-actions, .tile .vol { display: flex; }
}
