
/* ===== foundations ===== */
:root {
  --bg-0: #090a0d;
  --bg-1: #0d0f13;
  --bg-2: #11141a;
  --bg-3: #171a21;
  --bg-4: #1d2129;
  --bg-5: #242933;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #f3f4f6;
  --text-soft: #c7cbd2;
  --muted: #858c98;
  --muted-2: #606773;
  --accent: #d84b4b;
  --accent-hover: #e15858;
  --accent-soft: rgba(216, 75, 75, 0.14);
  --green: #43b581;
  --amber: #d9a441;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg-0);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body { background: var(--bg-0); font-size: 14px; }
button, input, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid rgba(216, 75, 75, .7); outline-offset: 2px; }
.hidden { display: none !important; }
.mobile-only { display: none !important; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #242832; border: 3px solid transparent; background-clip: content-box; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #343946; border: 2px solid transparent; background-clip: content-box; }

.rift-mark {
  width: 42px;
  height: 42px;
  position: relative;
  display: inline-grid;
  place-items: center;
  transform: rotate(45deg);
}
.rift-mark span {
  position: absolute;
  width: 24px;
  height: 8px;
  background: currentColor;
  border-radius: 2px;
}
.rift-mark span:first-child { transform: translateY(-7px); }
.rift-mark span:last-child { transform: translateY(7px); }
.rift-mark.mini { width: 24px; height: 24px; }
.rift-mark.mini span { width: 16px; height: 5px; }
.rift-mark.mini span:first-child { transform: translateY(-5px); }
.rift-mark.mini span:last-child { transform: translateY(5px); }

/* Auth */
.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 460px;
  grid-template-rows: auto 1fr;
  gap: 48px 80px;
  padding: 42px max(6vw, 64px) 64px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 88%, rgba(216, 75, 75, .12), transparent 32%),
    radial-gradient(circle at 88% 12%, rgba(216, 75, 75, .08), transparent 28%),
    linear-gradient(135deg, #090a0d 0%, #0d0f13 60%, #0a0b0e 100%);
}
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 800; letter-spacing: .24em; z-index: 2; }
.auth-brand .rift-mark { color: var(--accent); width: 30px; height: 30px; }
.auth-brand .rift-mark span { width: 18px; height: 6px; }
.auth-brand .rift-mark span:first-child { transform: translateY(-5px); }
.auth-brand .rift-mark span:last-child { transform: translateY(5px); }
.auth-copy { align-self: center; max-width: 670px; z-index: 2; }
.eyebrow { margin: 0 0 18px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.auth-copy h1 { font-size: clamp(52px, 7vw, 92px); line-height: .96; letter-spacing: -.055em; margin: 0 0 28px; max-width: 720px; }
.auth-copy > p:last-child { color: var(--muted); font-size: 17px; line-height: 1.65; max-width: 540px; }
.auth-card {
  align-self: center;
  z-index: 3;
  padding: 8px;
  background: rgba(17, 20, 26, .86);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(0,0,0,.38);
  backdrop-filter: blur(24px);
}
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--bg-0); border-radius: 14px; }
.auth-tab { border: 0; background: transparent; color: var(--muted); border-radius: 10px; padding: 12px 16px; cursor: pointer; font-weight: 650; }
.auth-tab.active { background: var(--bg-4); color: var(--text); }
.auth-form { display: flex; flex-direction: column; gap: 16px; padding: 26px 22px 22px; }
.auth-form label { display: flex; flex-direction: column; gap: 8px; }
.auth-form label > span { color: var(--muted); font-size: 12px; font-weight: 650; }
.auth-form input {
  width: 100%; border: 1px solid var(--border); background: #0b0d11; color: var(--text); border-radius: 10px; padding: 12px 13px; transition: border-color .15s, background .15s;
}
.auth-form input:hover { border-color: var(--border-strong); }
.auth-form input:focus { border-color: rgba(216,75,75,.58); background: #0d0f14; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error { color: #ef7777; min-height: 18px; margin: -2px 0 -2px; font-size: 12px; }
.primary-button { border: 0; border-radius: 10px; background: var(--accent); color: white; font-weight: 750; padding: 12px 18px; cursor: pointer; transition: background .15s, transform .15s; }
.primary-button:hover:not(:disabled) { background: var(--accent-hover); }
.primary-button:active:not(:disabled) { transform: translateY(1px); }
.primary-button:disabled { cursor: not-allowed; opacity: .5; }
.auth-grid { position: absolute; inset: 0; opacity: .18; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(to right, black, transparent 52%); }

/* App shell */
.app-shell {
  height: 100vh;
  width: 100vw;
  display: grid;
  grid-template-columns: 72px 250px minmax(420px, 1fr) 240px;
  background: var(--bg-1);
}

.server-rail {
  background: #08090b;
  border-right: 1px solid var(--border);
  padding: 12px 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
}
.server-list { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.server-button {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 16px;
  background: var(--bg-3);
  color: var(--text-soft);
  display: grid;
  place-items: center;
  font-weight: 750;
  cursor: pointer;
  position: relative;
  transition: border-radius .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}
.server-button:hover { border-radius: 13px; background: var(--bg-5); color: var(--text); transform: translateY(-1px); }
.server-button.active { border-radius: 13px; background: var(--accent); color: white; }
.server-button.active::before {
  content: "";
  position: absolute;
  width: 3px;
  height: 26px;
  left: -9px;
  top: 11px;
  background: #fff;
  border-radius: 0 999px 999px 0;
}
.server-button.unread::after { content:""; position:absolute; left:-9px; width:4px; height:8px; border-radius:0 999px 999px 0; background:#fff; }
.home-button { background: #14171c; color: var(--accent); }
.home-button.active { color: white; }
.add-server, .join-server { color: var(--muted); font-size: 24px; background: transparent; border: 1px dashed var(--border-strong); }
.add-server:hover, .join-server:hover { color: var(--accent); background: var(--accent-soft); border-color: rgba(216,75,75,.35); }
.join-server { font-size: 19px; }
.rail-divider { width: 30px; height: 1px; background: var(--border-strong); margin: 1px 0 3px; }

.channel-panel { background: var(--bg-2); border-right: 1px solid var(--border); display: grid; grid-template-rows: 56px 1fr 58px; min-width: 0; }
.server-header { height: 56px; border-bottom: 1px solid var(--border); padding: 0 14px 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.server-header > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.server-header-kicker { color: var(--muted-2); font-size: 9px; letter-spacing: .16em; font-weight: 800; }
.server-header strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; }
.icon-button { border: 0; background: transparent; color: var(--muted); width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; }
.icon-button:hover { color: var(--text); background: var(--bg-4); }
.home-navigation, .channel-navigation { min-height: 0; overflow-y: auto; padding: 10px 8px; }
.home-navigation { display: flex; flex-direction: column; gap: 3px; }
.home-nav-item { border: 0; background: transparent; color: var(--muted); padding: 10px; border-radius: 8px; text-align: left; display: flex; gap: 10px; align-items: center; cursor: pointer; font-weight: 600; }
.home-nav-item:hover, .home-nav-item.active { background: var(--bg-4); color: var(--text); }
.home-nav-item span { width: 20px; text-align: center; color: var(--text-soft); }
.section-heading { margin: 18px 7px 5px; display: flex; align-items: center; justify-content: space-between; color: var(--muted-2); font-size: 10px; text-transform: uppercase; font-weight: 800; letter-spacing: .08em; }
.section-heading button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 17px; }
.empty-dm { color: var(--muted-2); padding: 10px 8px; font-size: 12px; line-height: 1.45; }
.current-user-panel { border-top: 1px solid var(--border); background: #0f1116; display: grid; grid-template-columns: 34px minmax(0, 1fr) 32px; align-items: center; gap: 9px; padding: 7px 8px 7px 10px; }
.current-user-copy { display: flex; flex-direction: column; min-width: 0; }
.current-user-copy strong { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.current-user-copy span { font-size: 10px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.channel-list { display: flex; flex-direction: column; gap: 2px; }
.channel-category { margin-top: 12px; }
.channel-category:first-child { margin-top: 2px; }
.channel-category-title { padding: 5px 8px; display: flex; align-items: center; justify-content: space-between; color: var(--muted-2); text-transform: uppercase; letter-spacing: .07em; font-size: 10px; font-weight: 800; }
.channel-category-title button { border: 0; background: transparent; color: var(--muted-2); cursor: pointer; font-size: 15px; }
.channel-item { width: 100%; border: 0; background: transparent; color: var(--muted); border-radius: 7px; padding: 7px 9px; display: grid; grid-template-columns: 20px minmax(0,1fr); gap: 5px; align-items: center; text-align: left; cursor: pointer; }
.channel-item:hover { background: rgba(255,255,255,.045); color: var(--text-soft); }
.channel-item.active { background: var(--bg-4); color: var(--text); }
.channel-item.unread { color: var(--text); font-weight: 650; }
.channel-symbol-small { color: var(--muted-2); font-weight: 700; font-size: 16px; text-align: center; }
.channel-item.active .channel-symbol-small { color: var(--accent); }
.channel-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.content-panel { min-width: 0; background: var(--bg-1); display: grid; grid-template-rows: 56px minmax(0, 1fr); }
.content-header { height: 56px; border-bottom: 1px solid var(--border); padding: 0 14px 0 18px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 1px 12px rgba(0,0,0,.12); z-index: 2; }
.channel-heading { min-width: 0; display: flex; align-items: center; gap: 10px; }
.channel-heading > .channel-symbol { color: var(--muted); font-size: 20px; }
.channel-heading > div { min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.channel-heading strong { font-size: 14px; white-space: nowrap; }
.channel-heading span:last-child { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-actions { display: flex; align-items: center; gap: 4px; }

.home-view { min-height: 0; overflow-y: auto; padding: clamp(28px, 5vw, 68px); }
.home-hero { max-width: 760px; margin: 0 auto 38px; }
.home-hero h2 { font-size: clamp(34px, 4vw, 54px); letter-spacing: -.04em; margin: 0 0 14px; }
.home-hero > p:last-child { color: var(--muted); font-size: 15px; line-height: 1.65; max-width: 620px; }
.home-grid { max-width: 760px; margin: 0 auto 36px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.home-card { min-height: 116px; border: 1px solid var(--border); background: var(--bg-2); border-radius: 14px; padding: 16px; display: grid; grid-template-columns: 40px minmax(0,1fr) auto; gap: 13px; align-items: center; }
.home-card.accent-card { border-color: rgba(216,75,75,.22); background: linear-gradient(135deg, rgba(216,75,75,.08), var(--bg-2) 55%); }
.card-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--bg-4); color: var(--text-soft); font-size: 18px; }
.accent-card .card-icon { color: var(--accent); background: var(--accent-soft); }
.home-card > div:nth-child(2) { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.home-card strong { font-size: 13px; }
.home-card span { color: var(--muted); font-size: 11px; line-height: 1.45; }
.text-button { border: 0; background: transparent; color: var(--accent); cursor: pointer; font-size: 12px; font-weight: 750; padding: 8px; }
.text-button:hover { color: #ef6464; }
.home-section-title { max-width: 760px; margin: 0 auto 12px; display: flex; justify-content: space-between; align-items: baseline; }
.home-section-title strong { font-size: 13px; }
.home-section-title span { color: var(--muted-2); font-size: 11px; }
.home-server-grid { max-width: 760px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.home-server-card { border: 1px solid var(--border); background: #101217; border-radius: 12px; padding: 14px; cursor: pointer; transition: border-color .14s, transform .14s, background .14s; }
.home-server-card:hover { transform: translateY(-2px); border-color: var(--border-strong); background: var(--bg-2); }
.home-server-card .server-card-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 11px; font-weight: 800; margin-bottom: 18px; }
.home-server-card strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; font-size: 12px; }
.home-server-card span { color: var(--muted); font-size: 10px; }
.empty-server-state { grid-column: 1 / -1; color: var(--muted-2); font-size: 12px; border: 1px dashed var(--border); border-radius: 12px; padding: 28px; text-align: center; }

.chat-view { min-height: 0; display: grid; grid-template-rows: minmax(0,1fr) 20px auto; }
.message-list { min-height: 0; overflow-y: auto; padding: 22px 0 12px; scroll-behavior: smooth; }
.channel-intro { padding: 44px 24px 24px; }
.channel-intro-icon { width: 52px; height: 52px; border-radius: 16px; background: var(--bg-4); display: grid; place-items: center; font-size: 27px; color: var(--text-soft); margin-bottom: 14px; }
.channel-intro h2 { margin: 0 0 6px; font-size: 25px; letter-spacing: -.025em; }
.channel-intro p { color: var(--muted); margin: 0; font-size: 13px; }
.message { display: grid; grid-template-columns: 40px minmax(0,1fr); gap: 12px; padding: 5px 22px; position: relative; }
.message:hover { background: rgba(255,255,255,.018); }
.avatar { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: white; font-size: 12px; font-weight: 800; user-select: none; flex: 0 0 auto; }
.message > .avatar { width: 40px; height: 40px; border-radius: 13px; }
.message-content { min-width: 0; }
.message-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.message-author { font-size: 12px; font-weight: 750; }
.message-time { color: var(--muted-2); font-size: 9px; }
.message-text { color: #d8dbe1; line-height: 1.5; white-space: pre-wrap; word-break: break-word; font-size: 13px; }
.typing-bar { height: 20px; padding: 0 24px; color: var(--muted); font-size: 10px; display: flex; align-items: center; }
.composer { margin: 0 18px 18px; min-height: 44px; border-radius: 12px; background: var(--bg-4); border: 1px solid transparent; display: grid; grid-template-columns: 36px minmax(0,1fr) 36px; align-items: end; padding: 4px 5px; transition: border-color .15s, background .15s; }
.composer:focus-within { border-color: rgba(216,75,75,.2); background: #20242c; }
.composer textarea { border: 0; outline: 0; resize: none; background: transparent; color: var(--text); line-height: 20px; max-height: 160px; min-height: 34px; padding: 7px 8px; overflow-y: auto; }
.composer textarea::placeholder { color: #6e7581; }
.composer-action, .send-button { border: 0; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; cursor: pointer; margin-bottom: 1px; }
.composer-action { background: transparent; color: var(--muted); font-size: 20px; }
.composer-action:hover { background: rgba(255,255,255,.05); color: var(--text); }
.send-button { background: var(--accent); color: white; font-size: 18px; }
.send-button:hover { background: var(--accent-hover); }

.voice-view { min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.voice-orbit { width: 116px; height: 116px; border-radius: 999px; display: grid; place-items: center; color: var(--accent); border: 1px solid rgba(216,75,75,.24); background: radial-gradient(circle, rgba(216,75,75,.08), transparent 70%); box-shadow: 0 0 50px rgba(216,75,75,.06); margin-bottom: 22px; }
.voice-view h2 { margin: 0 0 8px; font-size: 25px; }
.voice-view p { color: var(--muted); max-width: 430px; line-height: 1.6; margin: 0 0 22px; }

.member-panel { background: #0f1116; border-left: 1px solid var(--border); display: grid; grid-template-rows: 56px minmax(0,1fr); min-width: 0; }
.member-panel-heading { border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 14px; color: var(--muted); font-size: 11px; font-weight: 700; }
.member-panel-heading strong { color: var(--muted-2); font-size: 10px; }
.member-list { min-height: 0; overflow-y: auto; padding: 10px 8px; }
.member-group-title { color: var(--muted-2); text-transform: uppercase; font-size: 9px; font-weight: 800; letter-spacing: .08em; padding: 10px 7px 5px; }
.member-item { display: grid; grid-template-columns: 31px minmax(0,1fr); gap: 9px; align-items: center; padding: 6px 7px; border-radius: 8px; }
.member-item:hover { background: rgba(255,255,255,.035); }
.member-avatar-wrap { position: relative; width: 31px; height: 31px; }
.member-avatar-wrap .avatar { width: 31px; height: 31px; border-radius: 10px; font-size: 10px; }
.presence-dot { position: absolute; width: 10px; height: 10px; right: -2px; bottom: -1px; border: 2px solid #0f1116; border-radius: 50%; background: #4d535d; }
.presence-dot.online { background: var(--green); }
.member-copy { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.member-copy strong { font-size: 11px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.member-copy span { color: var(--muted-2); font-size: 9px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.member-item.offline { opacity: .48; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.66); backdrop-filter: blur(5px); display: grid; place-items: center; padding: 20px; }
.modal { width: min(430px, 100%); background: #14171d; border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: 0 26px 80px rgba(0,0,0,.48); overflow: hidden; }
.modal-head { padding: 20px 20px 6px; display: flex; justify-content: space-between; gap: 12px; }
.modal-head h3 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.modal-head button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 20px; }
.modal-copy { color: var(--muted); line-height: 1.5; font-size: 12px; padding: 0 20px; margin: 6px 0 14px; }
.modal-form { display: flex; flex-direction: column; gap: 13px; padding: 8px 20px 20px; }
.modal-form label { display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 650; }
.modal-form input, .modal-form select { width: 100%; border: 1px solid var(--border); background: #0c0e12; color: var(--text); border-radius: 9px; padding: 11px 12px; }
.modal-actions { padding-top: 5px; display: flex; justify-content: flex-end; gap: 8px; }
.secondary-button { border: 1px solid var(--border); background: var(--bg-3); color: var(--text-soft); border-radius: 9px; padding: 10px 14px; cursor: pointer; font-weight: 650; }
.secondary-button:hover { border-color: var(--border-strong); color: var(--text); }
.invite-code { margin: 8px 20px 20px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.invite-code code { background: #0b0d11; border: 1px solid var(--border); border-radius: 9px; padding: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.invite-code button { border: 0; border-radius: 9px; padding: 0 14px; background: var(--accent); color: white; cursor: pointer; font-weight: 700; }

.toast-region { position: fixed; top: 14px; right: 14px; z-index: 100; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: #171a20; border: 1px solid var(--border-strong); box-shadow: 0 12px 35px rgba(0,0,0,.35); border-radius: 10px; padding: 10px 13px; color: var(--text-soft); font-size: 11px; animation: toast-in .18s ease-out; }
.toast.error { border-color: rgba(216,75,75,.4); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 68px 230px minmax(390px, 1fr); }
  .member-panel { position: fixed; right: 0; top: 56px; bottom: 0; width: 240px; z-index: 10; box-shadow: -14px 0 40px rgba(0,0,0,.3); }
  .member-panel.closed { display: none; }
}

@media (max-width: 760px) {
  .mobile-only { display: grid !important; }
  .auth-screen { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; gap: 32px; padding: 26px 18px 36px; overflow-y: auto; }
  .auth-copy { align-self: end; }
  .auth-copy h1 { font-size: 50px; }
  .auth-card { align-self: start; }
  .form-row { grid-template-columns: 1fr; }
  .app-shell { grid-template-columns: minmax(0,1fr); }
  .server-rail, .channel-panel { position: fixed; top: 0; bottom: 0; z-index: 30; transform: translateX(-110%); transition: transform .18s ease; box-shadow: 20px 0 50px rgba(0,0,0,.35); }
  .server-rail { left: 0; width: 68px; }
  .channel-panel { left: 68px; width: 240px; }
  .app-shell.mobile-nav-open .server-rail, .app-shell.mobile-nav-open .channel-panel { transform: translateX(0); }
  .content-header { padding-left: 8px; }
  .channel-heading > div { display: flex; flex-direction: column; gap: 1px; }
  .channel-heading span:last-child { display: none; }
  .home-view { padding: 26px 18px; }
  .home-grid { grid-template-columns: 1fr; }
  .home-server-grid { grid-template-columns: 1fr 1fr; }
  .member-panel { width: min(260px, 86vw); }
  .message { padding-left: 14px; padding-right: 14px; }
  .composer { margin-left: 10px; margin-right: 10px; }
}

@media (max-width: 460px) {
  .home-server-grid { grid-template-columns: 1fr; }
  .home-card { grid-template-columns: 38px minmax(0,1fr); }
  .home-card .text-button { grid-column: 2; justify-self: start; padding-left: 0; }
}


/* ===== domain components ===== */
/* Rift UI v2
   Dense, app-first styling. No marketing layout, no glass cards, no decorative gradients. */

:root {
  --bg-0: #08090b;
  --bg-1: #0d0f12;
  --bg-2: #111318;
  --bg-3: #171a20;
  --bg-4: #1d2027;
  --bg-5: #242831;
  --border: #20242b;
  --border-strong: #2a2f38;
  --text: #f1f2f4;
  --text-soft: #c8ccd2;
  --muted: #8b929e;
  --muted-2: #616875;
  --accent: #d94f52;
  --accent-hover: #e05a5d;
  --accent-soft: rgba(217, 79, 82, .12);
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
}

body {
  background: var(--bg-0);
  font-size: 13px;
}

button,
input,
textarea {
  font-family: inherit;
}

/* ---------- Authentication ---------- */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: #0b0c0f;
  overflow-y: auto;
}

.auth-screen::before,
.auth-screen::after,
.auth-grid,
.auth-copy {
  display: none !important;
}

.auth-window {
  width: min(420px, 100%);
  background: #121419;
  border: 1px solid #252932;
  border-radius: 10px;
  padding: 30px 32px 26px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .34);
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-bottom: 24px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  text-transform: none;
}

.auth-brand .rift-mark {
  width: 25px;
  height: 25px;
  color: var(--accent);
}

.auth-brand .rift-mark span {
  width: 15px;
  height: 5px;
}

.auth-brand .rift-mark span:first-child { transform: translateY(-4px); }
.auth-brand .rift-mark span:last-child { transform: translateY(4px); }

.auth-heading {
  text-align: center;
  margin-bottom: 22px;
}

.auth-heading h1 {
  margin: 0 0 7px;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -.025em;
  font-weight: 650;
}

.auth-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0;
  margin-bottom: 22px;
  background: transparent;
  border-bottom: 1px solid var(--border-strong);
  border-radius: 0;
}

.auth-tab {
  position: relative;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 9px 8px 11px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.auth-tab:hover {
  color: var(--text-soft);
  background: transparent;
}

.auth-tab.active {
  background: transparent;
  color: var(--text);
}

.auth-tab.active::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.auth-form label > span {
  color: #a8aeb8;
  font-size: 11px;
  font-weight: 600;
}

.auth-form input {
  width: 100%;
  height: 40px;
  border: 1px solid #272c35;
  border-radius: 6px;
  background: #0c0e12;
  color: var(--text);
  padding: 0 11px;
  box-shadow: none;
  transition: border-color .12s ease, background .12s ease;
}

.auth-form input:hover {
  border-color: #343a45;
}

.auth-form input:focus {
  border-color: #555d6b;
  background: #0d0f13;
  outline: none;
}

.form-row {
  display: contents;
}

.form-error {
  min-height: 16px;
  margin: -3px 0 -2px;
  color: #f08082;
  font-size: 11px;
}

.primary-button,
.secondary-button {
  min-height: 38px;
  border-radius: 6px;
  font-weight: 650;
  font-size: 12px;
  cursor: pointer;
}

.primary-button {
  border: 1px solid #e05d60;
  background: var(--accent);
  color: #fff;
}

.primary-button:hover:not(:disabled) {
  background: var(--accent-hover);
}

.secondary-button {
  border: 1px solid var(--border-strong);
  background: #181b21;
  color: var(--text-soft);
  padding: 0 14px;
}

.secondary-button:hover {
  background: #1e2229;
  color: var(--text);
}

.primary-button.compact {
  min-height: 34px;
  padding: 0 14px;
}

.auth-form .primary-button {
  width: 100%;
  margin-top: 2px;
}

.auth-footer {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: #555c68;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ---------- Main application ---------- */
.app-shell {
  height: 100vh;
  width: 100vw;
  grid-template-columns: 64px 236px minmax(420px, 1fr) 224px;
  background: var(--bg-1);
}

.server-rail {
  background: #090a0c;
  border-right: 1px solid #171a20;
  padding: 10px 8px;
  gap: 7px;
}

.server-list {
  gap: 7px;
}

.server-button {
  flex-basis: 44px;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: #181b20;
  color: #b9bec7;
  font-size: 12px;
  box-shadow: none;
  transition: border-radius .12s ease, background .12s ease, color .12s ease;
}

.server-button:hover {
  border-radius: 11px;
  background: #242830;
  color: #fff;
  transform: none;
}

.server-button.active {
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
}

.server-button.active::before {
  left: -8px;
  top: 9px;
  width: 3px;
  height: 26px;
}

.home-button {
  background: #1b1e24;
  color: var(--accent);
}

.add-server,
.join-server {
  border: 1px solid #262b33;
  background: #121419;
  color: #8c939d;
  font-size: 20px;
}

.add-server:hover,
.join-server:hover {
  border-color: #363c46;
  background: #1c2026;
  color: #fff;
}

.join-server { font-size: 16px; }

.rail-divider {
  width: 30px;
  background: #252931;
  margin: 0 0 2px;
}

.channel-panel {
  background: #111318;
  border-right: 1px solid #20232a;
  grid-template-rows: 48px 1fr 52px;
}

.server-header {
  height: 48px;
  padding: 0 11px 0 13px;
  border-bottom: 1px solid #20232a;
}

.server-header-kicker {
  display: none;
}

.server-header strong {
  font-size: 13px;
  font-weight: 650;
}

.icon-button {
  width: 30px;
  height: 30px;
  border-radius: 5px;
  color: #858c97;
}

.icon-button:hover {
  background: #1d2026;
  color: #e8eaed;
}

.home-navigation,
.channel-navigation {
  padding: 8px 7px;
}

.home-navigation {
  gap: 2px;
}

.home-nav-item {
  min-height: 38px;
  border-radius: 5px;
  padding: 0 9px;
  gap: 9px;
  color: #939aa5;
  font-size: 12px;
  font-weight: 550;
}

.home-nav-item:hover {
  background: #191c22;
  color: #d8dbe0;
}

.home-nav-item.active {
  background: #20232a;
  color: #f2f3f5;
}

.home-nav-item span {
  color: #7e8590;
}

.section-heading {
  margin: 17px 8px 5px;
  color: #6f7682;
  font-size: 9px;
  letter-spacing: .07em;
}

.section-heading button {
  color: #737a85;
}

.empty-dm {
  padding: 9px 8px;
  color: #636a76;
  font-size: 11px;
}

.current-user-panel {
  min-height: 52px;
  grid-template-columns: 32px minmax(0, 1fr) 30px;
  gap: 8px;
  padding: 6px 7px 6px 9px;
  border-top: 1px solid #20232a;
  background: #0d0f13;
}

.current-user-copy strong {
  font-size: 11px;
  font-weight: 650;
}

.current-user-copy span {
  font-size: 9px;
  color: #717985;
}

.avatar {
  border-radius: 50%;
}

.channel-list {
  gap: 1px;
}

.channel-category {
  margin-top: 13px;
}

.channel-category-title {
  padding: 4px 7px;
  color: #676f7a;
  font-size: 9px;
  letter-spacing: .06em;
}

.channel-category-title button {
  color: #747c87;
}

.channel-item {
  min-height: 32px;
  border-radius: 5px;
  padding: 4px 7px;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 4px;
  color: #838b97;
  font-size: 12px;
}

.channel-item:hover {
  background: #191c21;
  color: #c9cdd3;
}

.channel-item.active {
  background: #20232a;
  color: #f0f1f3;
}

.channel-item.active .channel-symbol-small {
  color: #b8bdc5;
}

.channel-symbol-small {
  font-size: 14px;
  color: #686f7a;
}

.content-panel {
  background: #0d0f12;
  grid-template-rows: 48px minmax(0, 1fr);
}

.content-header {
  height: 48px;
  padding: 0 11px 0 15px;
  border-bottom: 1px solid #20232a;
  box-shadow: none;
  background: #0d0f12;
}

.channel-heading {
  gap: 8px;
}

.channel-heading > .channel-symbol {
  color: #747c88;
  font-size: 17px;
}

.channel-heading > div {
  gap: 9px;
}

.channel-heading strong {
  font-size: 12px;
  font-weight: 650;
}

.channel-heading span:last-child {
  color: #6f7681;
  font-size: 10px;
}

/* ---------- Home ---------- */
.home-view {
  min-height: 0;
  overflow-y: auto;
  padding: 28px 32px 36px;
}

.home-toolbar {
  width: min(760px, 100%);
  margin: 0 auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid #20232a;
  padding-bottom: 20px;
}

.home-toolbar h2 {
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -.02em;
}

.home-toolbar p {
  margin: 0;
  color: #767d88;
  font-size: 11px;
}

.home-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.home-section-title {
  width: min(760px, 100%);
  margin: 25px auto 9px;
  padding: 0 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #8e959f;
  font-size: 10px;
}

.home-section-title strong {
  color: #c9cdd3;
  font-size: 11px;
  font-weight: 650;
}

.home-section-title span {
  color: #666d78;
}

.home-server-grid {
  width: min(760px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.home-server-card {
  min-height: 58px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 11px;
  align-items: center;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  outline: none;
}

.home-server-card:hover,
.home-server-card:focus-visible {
  background: #15181d;
}

.server-card-icon {
  grid-row: 1 / 3;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #20232a;
  color: #e6e8eb;
  font-size: 11px;
  font-weight: 700;
}

.home-server-card strong {
  grid-column: 2;
  align-self: end;
  color: #e3e5e8;
  font-size: 12px;
  font-weight: 600;
}

.home-server-card > span {
  grid-column: 2;
  align-self: start;
  color: #6f7681;
  font-size: 10px;
}

.home-server-card::after {
  content: "›";
  grid-column: 3;
  grid-row: 1 / 3;
  color: #5e6570;
  font-size: 18px;
}

.empty-server-state {
  min-height: 190px;
  border: 1px dashed #262a31;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: #686f7a;
  font-size: 11px;
  background: transparent;
}

/* Old home marketing elements are intentionally removed/neutralised. */
.home-hero,
.home-grid,
.home-card,
.accent-card {
  display: none !important;
}

/* ---------- Chat ---------- */
.chat-view {
  background: #0d0f12;
}

.message-list {
  padding: 18px 0 12px;
}

.channel-intro {
  padding: 42px 18px 24px;
}

.channel-intro-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #1d2026;
  color: #9ba2ad;
  font-size: 24px;
}

.channel-intro h2 {
  margin: 12px 0 5px;
  font-size: 19px;
  letter-spacing: -.02em;
}

.channel-intro p {
  color: #767d88;
  font-size: 11px;
}

.message {
  padding: 3px 18px;
}

.message:hover {
  background: #101216;
}

.message > .avatar {
  width: 34px;
  height: 34px;
  font-size: 10px;
}

.message-content {
  padding-top: 1px;
}

.message-meta {
  gap: 7px;
}

.message-author {
  font-size: 12px;
  font-weight: 650;
}

.message-time {
  font-size: 9px;
  color: #666d77;
}

.message-text {
  margin-top: 2px;
  color: #d9dce0;
  font-size: 12px;
  line-height: 1.45;
}

.composer {
  margin: 0 16px 14px;
  min-height: 42px;
  border: 1px solid #282d35;
  border-radius: 7px;
  background: #171a20;
  box-shadow: none;
}

.composer:focus-within {
  border-color: #343a44;
}

.composer textarea {
  color: #e5e7ea;
  font-size: 12px;
}

.composer-action,
.send-button {
  color: #808893;
}

.composer-action:hover,
.send-button:hover {
  color: #e7e9ec;
  background: transparent;
}

.typing-bar {
  color: #757d88;
  font-size: 10px;
}

/* ---------- Members ---------- */
.member-panel {
  background: #101216;
  border-left: 1px solid #20232a;
}

.member-panel-heading {
  height: 48px;
  padding: 0 12px;
  border-bottom: 1px solid #20232a;
  color: #737b86;
  font-size: 10px;
}

.member-panel-heading strong {
  color: #626a75;
  font-size: 9px;
}

.member-list {
  padding: 10px 7px;
}

.member-group-title {
  margin: 12px 7px 5px;
  color: #656d78;
  font-size: 9px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.member-item {
  min-height: 38px;
  border-radius: 5px;
  padding: 5px 7px;
}

.member-item:hover {
  background: #191c21;
}

.member-item .avatar {
  width: 30px;
  height: 30px;
  font-size: 9px;
}

.member-copy strong {
  font-size: 11px;
}

.member-copy span {
  font-size: 9px;
  color: #69717c;
}

/* ---------- Modals ---------- */
.modal-backdrop {
  background: rgba(0, 0, 0, .64);
  backdrop-filter: none;
}

.modal {
  border: 1px solid #292e36;
  border-radius: 9px;
  background: #14161b;
  box-shadow: 0 18px 55px rgba(0, 0, 0, .5);
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 64px 228px minmax(360px, 1fr);
  }

  .member-panel {
    display: none;
  }

  .member-panel.open {
    display: block;
    position: fixed;
    z-index: 20;
    top: 0;
    right: 0;
    bottom: 0;
    width: 224px;
    box-shadow: -16px 0 38px rgba(0, 0, 0, .3);
  }
}

@media (max-width: 760px) {
  .auth-screen {
    align-items: flex-start;
    padding: 34px 16px;
  }

  .auth-window {
    padding: 26px 22px 22px;
    box-shadow: none;
  }

  .app-shell {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .server-rail {
    padding: 8px 6px;
  }

  .server-button {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .channel-panel {
    display: none;
    position: fixed;
    z-index: 30;
    left: 56px;
    top: 0;
    bottom: 0;
    width: min(250px, calc(100vw - 56px));
    box-shadow: 14px 0 34px rgba(0, 0, 0, .35);
  }

  .channel-panel.mobile-open {
    display: grid;
  }

  .content-panel {
    grid-column: 2;
  }

  .mobile-only {
    display: grid !important;
  }

  .home-view {
    padding: 20px 16px 28px;
  }

  .home-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 15px;
  }

  .home-actions {
    width: 100%;
  }

  .home-actions button {
    flex: 1;
  }
}

@media (max-width: 430px) {
  .auth-window {
    border: 0;
    background: transparent;
    padding-left: 8px;
    padding-right: 8px;
  }

  .auth-footer {
    display: none;
  }

  .channel-heading span:last-child {
    display: none;
  }
}


/* ===== desktop runtime ===== */
.desktop-titlebar {
  display: none;
}

body.desktop-runtime {
  padding-top: 32px;
}

body.desktop-runtime .desktop-titlebar {
  position: fixed;
  inset: 0 0 auto 0;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #090a0d;
  border-bottom: 1px solid rgba(255,255,255,.06);
  z-index: 10000;
  -webkit-app-region: drag;
  user-select: none;
}

.desktop-titlebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
  color: #b9bec8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}

.desktop-titlebar-mark {
  position: relative;
  width: 15px;
  height: 15px;
  transform: rotate(45deg);
  color: #d84b4b;
}

.desktop-titlebar-mark::before,
.desktop-titlebar-mark::after {
  content: "";
  position: absolute;
  left: 1px;
  width: 13px;
  height: 4px;
  border-radius: 1px;
  background: currentColor;
}

.desktop-titlebar-mark::before { top: 3px; }
.desktop-titlebar-mark::after { bottom: 3px; }

.desktop-window-controls {
  display: flex;
  height: 100%;
  -webkit-app-region: no-drag;
}

.desktop-window-button {
  width: 46px;
  height: 32px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #9aa1ad;
  display: grid;
  place-items: center;
  cursor: default;
  font-family: "Segoe UI", sans-serif;
  font-size: 12px;
}

.desktop-window-button:hover {
  background: rgba(255,255,255,.075);
  color: #fff;
}

.desktop-window-button.close:hover {
  background: #c42b1c;
  color: #fff;
}

body.desktop-runtime .auth-screen,
body.desktop-runtime .app-shell {
  height: calc(100vh - 32px);
  min-height: calc(100vh - 32px);
}

body.desktop-runtime .app-shell {
  width: 100vw;
}

body.desktop-runtime button,
body.desktop-runtime input,
body.desktop-runtime textarea,
body.desktop-runtime a {
  -webkit-app-region: no-drag;
}


/* ===== application primitives ===== */
/* Rift v0.2 interface additions. Keep surfaces flat, dense and app-like. */
:root {
  --panel-hover: rgba(255,255,255,.045);
  --panel-active: rgba(255,255,255,.075);
  --danger: #e05a5a;
}

.home-content { display:flex; flex-direction:column; gap:8px; max-width:900px; }
.home-actions { display:flex; gap:8px; align-items:center; }
.home-toolbar { max-width:900px; }
.secondary-button, .danger-button {
  border: 1px solid var(--border-strong);
  background: var(--bg-3);
  color: var(--text-soft);
  border-radius: 7px;
  padding: 8px 12px;
  font-weight: 650;
  cursor: pointer;
}
.secondary-button:hover { background: var(--bg-4); color: var(--text); }
.danger-button { color:#ffdede; border-color: rgba(224,90,90,.35); background: rgba(224,90,90,.10); }
.danger-button:hover { background: rgba(224,90,90,.18); }

.social-row {min-height:58px;display:grid;grid-template-columns:38px minmax(0,1fr) auto;gap:11px;align-items:center;padding:8px 10px;border-top:1px solid var(--border)}
.social-row:last-child{border-bottom:1px solid var(--border)}.social-row:hover{background:var(--panel-hover)}
.social-copy{min-width:0;display:flex;flex-direction:column;gap:2px}.social-copy strong{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.social-copy span{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.social-actions{display:flex;align-items:center;gap:6px}
.small-button{border:0;background:var(--bg-4);color:var(--text-soft);border-radius:7px;padding:7px 10px;cursor:pointer;font-size:11px;font-weight:650}.small-button:hover{color:var(--text);background:var(--bg-5)}.small-button.primary{background:var(--accent);color:white}.small-button.danger{color:#ffbcbc;background:rgba(224,90,90,.11)}
.empty-state{border:1px dashed var(--border-strong);border-radius:8px;min-height:110px;display:grid;place-items:center;color:var(--muted);text-align:center;padding:24px;font-size:12px}
.dm-list{display:flex;flex-direction:column;gap:2px}.dm-item{width:100%;border:0;background:transparent;color:var(--muted);display:grid;grid-template-columns:32px minmax(0,1fr) auto;gap:9px;align-items:center;text-align:left;padding:7px 8px;border-radius:7px;cursor:pointer}.dm-item:hover,.dm-item.active{background:var(--bg-4);color:var(--text)}.dm-item .avatar{width:32px;height:32px;font-size:10px}.dm-item-copy{min-width:0;display:flex;flex-direction:column;gap:2px}.dm-item-copy strong{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dm-item-copy span{color:var(--muted-2);font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.unread-dot{width:7px;height:7px;border-radius:50%;background:var(--accent)}
.channel-row{display:grid;grid-template-columns:minmax(0,1fr) 26px;align-items:center;gap:2px}.channel-row .channel-item{min-width:0}.channel-manage{border:0;background:transparent;color:var(--muted-2);width:26px;height:26px;border-radius:6px;cursor:pointer;opacity:0}.channel-row:hover .channel-manage{opacity:1}.channel-manage:hover{color:var(--text);background:var(--bg-4)}
.message{position:relative;padding-right:118px}.message:hover{background:rgba(255,255,255,.018)}.message-actions{position:absolute;right:12px;top:4px;display:none;align-items:center;border:1px solid var(--border-strong);background:var(--bg-2);border-radius:7px;overflow:hidden;box-shadow:0 6px 16px rgba(0,0,0,.2)}.message:hover .message-actions{display:flex}.message-actions button{border:0;background:transparent;color:var(--muted);height:28px;min-width:30px;padding:0 8px;cursor:pointer;font-size:11px}.message-actions button:hover{color:var(--text);background:var(--bg-4)}.message-actions button.danger:hover{color:#ffadad}
.reply-preview{border-left:2px solid var(--muted-2);margin:0 0 4px;padding-left:8px;color:var(--muted);font-size:11px;max-width:620px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reply-preview strong{color:var(--text-soft);margin-right:5px}
.reaction-strip{display:flex;gap:4px;flex-wrap:wrap;margin-top:5px}.reaction-chip{border:1px solid var(--border);background:var(--bg-3);color:var(--text-soft);border-radius:6px;padding:2px 6px;cursor:pointer;font-size:11px}.reaction-chip:hover,.reaction-chip.mine{border-color:rgba(216,75,75,.4);background:var(--accent-soft)}
.message-attachments{display:flex;flex-direction:column;gap:6px;margin-top:7px;max-width:520px}.message-image{max-width:min(460px,100%);max-height:320px;border-radius:8px;object-fit:contain;border:1px solid var(--border);background:#08090b}.file-attachment{display:flex;align-items:center;gap:9px;padding:9px 10px;border:1px solid var(--border);border-radius:7px;background:var(--bg-2);color:var(--text-soft);text-decoration:none}.file-attachment:hover{background:var(--bg-3)}.file-attachment small{color:var(--muted);margin-left:auto}
.reply-bar{margin:0 14px;min-height:46px;padding:7px 10px;border:1px solid var(--border);border-bottom:0;background:var(--bg-2);display:flex;align-items:center;justify-content:space-between;border-radius:8px 8px 0 0}.reply-bar>div{min-width:0}.reply-bar span{color:var(--muted);font-size:9px;text-transform:uppercase;letter-spacing:.06em;margin-right:6px}.reply-bar strong{font-size:11px}.reply-bar p{margin:2px 0 0;color:var(--muted);font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:600px}
.attachment-preview{margin:0 14px;border:1px solid var(--border-strong);border-bottom:0;border-radius:8px 8px 0 0;background:var(--bg-2);padding:7px;z-index:5}.pending-file{display:flex;align-items:center;gap:8px;padding:4px 6px;color:var(--text-soft);font-size:11px}.pending-file button{margin-left:auto;border:0;background:transparent;color:var(--muted);cursor:pointer}
.role-chip{display:inline-flex;align-items:center;gap:5px;font-size:9px;padding:2px 5px;border-radius:5px;background:rgba(255,255,255,.05);color:var(--text-soft);margin-right:3px}.role-dot{width:6px;height:6px;border-radius:50%}
.settings-section{padding:12px 0;border-top:1px solid var(--border)}.settings-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:7px 0}.settings-row>div{min-width:0}.settings-row strong{display:block;font-size:11px}.settings-row span{display:block;font-size:10px;color:var(--muted);margin-top:2px}
.role-row{display:grid;grid-template-columns:12px minmax(0,1fr) auto;gap:8px;align-items:center;padding:7px 0;border-top:1px solid var(--border)}.member-role-grid{display:flex;flex-direction:column;gap:4px;max-height:260px;overflow:auto}.member-role-row{display:grid;grid-template-columns:30px minmax(0,1fr) auto;gap:8px;align-items:center;padding:6px 0;border-top:1px solid var(--border)}.role-select{display:flex;gap:5px;flex-wrap:wrap;justify-content:flex-end}.role-toggle{border:1px solid var(--border);background:var(--bg-3);color:var(--muted);padding:3px 6px;border-radius:5px;cursor:pointer;font-size:9px}.role-toggle.active{color:#fff;border-color:var(--role-color,var(--accent));background:var(--accent-soft)}
.voice-view{overflow:auto}.voice-stage{width:min(720px,calc(100% - 48px));margin:50px auto;display:flex;flex-direction:column;align-items:center;gap:12px}.voice-channel-mark{width:64px;height:64px;border-radius:18px;display:grid;place-items:center;background:var(--bg-3);border:1px solid var(--border);color:var(--text);font-size:28px}.voice-stage h2{margin:4px 0 0;font-size:24px}.voice-stage>p{color:var(--muted);margin:0}.voice-participants{width:100%;display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px;margin:14px 0}.voice-person{border:1px solid var(--border);background:var(--bg-2);border-radius:8px;min-height:74px;display:flex;align-items:center;gap:10px;padding:10px}.voice-person .avatar{width:38px;height:38px}.voice-person-copy{min-width:0;display:flex;flex-direction:column;gap:3px}.voice-person-copy strong{font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.voice-person-copy span{font-size:9px;color:var(--muted)}.voice-controls{display:flex;gap:8px}
.modal-form select,.modal-form textarea{width:100%;border:1px solid var(--border);background:#0b0d11;color:var(--text);border-radius:7px;padding:9px 10px;resize:vertical}.modal-form select:focus,.modal-form textarea:focus{border-color:rgba(216,75,75,.58);outline:none}.reaction-picker{display:grid;grid-template-columns:repeat(4,1fr);gap:7px}.reaction-choice{border:1px solid var(--border);background:var(--bg-3);border-radius:8px;min-height:46px;font-size:21px;cursor:pointer}.reaction-choice:hover{background:var(--bg-4);border-color:var(--border-strong)}
@media(max-width:900px){.social-row{grid-template-columns:34px minmax(0,1fr)}.social-actions{grid-column:2;justify-content:flex-start}.message{padding-right:8px}.message-actions{position:static;display:flex;margin-top:5px;width:max-content}}
