:root {
  color-scheme: light;
  --red: #e30618;
  --red-dark: #b70012;
  --ink: #111111;
  --muted: #73736f;
  --line: #deded8;
  --surface: #ffffff;
  --soft: #f2f2ee;
  --canvas: #e9e9e4;
  --green: #14885f;
  --shadow: 0 18px 55px rgba(17, 17, 17, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; background: var(--canvas); color: var(--ink); }
body { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.icon-sprite { position: fixed; width: 0; height: 0; overflow: hidden; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.eyebrow { color: var(--red); font-size: 10px; font-weight: 900; letter-spacing: .18em; }

.entry-animation {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  gap: 0;
  text-align: center;
  background: #fff;
  transition: opacity .3s ease, visibility .3s ease;
}
.entry-logo-stage { width: min(820px, 96vw); max-height: 66vh; aspect-ratio: 53 / 30; }
.entry-logo-signature { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 18px 36px rgba(227,6,19,.1)); }
.entry-signature-path { fill: none; stroke: var(--red); stroke-width: 4.35; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: entry-signature-draw 1.48s cubic-bezier(.42,0,.18,1) forwards; }
.entry-call-letter { fill: #1d1d1b; stroke: none; opacity: 0; animation: entry-call-write .16s ease-out forwards; }
.entry-call-letter:nth-child(1) { animation-delay: 1.18s; }
.entry-call-letter:nth-child(2) { animation-delay: 1.25s; }
.entry-call-letter:nth-child(3) { animation-delay: 1.32s; }
.entry-call-letter:nth-child(4) { animation-delay: 1.39s; }
.entry-animation span { margin-top: -3vh; color: var(--muted); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; opacity: 0; animation: entry-subtitle-in .3s ease-out 1.5s forwards; }
.entry-animation.is-done { opacity: 0; visibility: hidden; }
@keyframes entry-signature-draw { to { stroke-dashoffset: 0; } }
@keyframes entry-call-write { to { opacity: 1; } }
@keyframes entry-subtitle-in { to { opacity: 1; } }

.auth-view { width: 100%; max-width: 100%; min-height: 100dvh; padding: 12px; overflow-x: hidden; overflow-y: auto; background: radial-gradient(circle at 8% 8%, #f7c9cc 0, transparent 25%), var(--canvas); }
.auth-panel {
  width: 100%;
  min-width: 0;
  min-height: calc(100dvh - 24px);
  display: grid;
  grid-template-columns: 1.06fr .94fr;
  border: 1px solid var(--line);
  border-radius: 36px;
  overflow: hidden;
  background: #f8f8f5;
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset;
}
.auth-copy { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: center; padding: clamp(44px, 7vw, 112px); background: radial-gradient(circle at 18% 14%, rgba(227,6,24,.22), transparent 31%), var(--ink); color: white; overflow: hidden; }
.auth-copy::after { content: ""; position: absolute; right: clamp(28px, 5vw, 72px); bottom: clamp(28px, 5vw, 72px); left: clamp(28px, 5vw, 72px); z-index: -1; height: 1px; background: linear-gradient(90deg, var(--red) 0 30%, rgba(255,255,255,.14) 30%); }
.auth-copy h1 { max-width: 720px; margin: 22px 0; font-size: clamp(52px, 5.8vw, 84px); line-height: .92; letter-spacing: -.07em; }
.auth-copy p { max-width: 560px; margin: 0; color: #adada8; font-size: 17px; line-height: 1.55; }
.auth-lines { position: absolute; inset: auto -20% 1%; z-index: -2; display: grid; gap: 8px; opacity: .07; transform: rotate(-7deg); font-size: 34px; font-weight: 900; white-space: nowrap; }
.auth-lines span:nth-child(odd) { animation: ticker 18s linear infinite; }
.auth-lines span:nth-child(even) { animation: ticker 16s linear infinite reverse; }
@keyframes ticker { to { transform: translateX(-25%); } }
.auth-form-wrap { min-width: 0; display: grid; place-items: center; padding: clamp(32px, 5.5vw, 86px); background: #f8f8f5; }
.auth-form { width: min(540px, 100%); min-width: 0; max-width: 100%; display: grid; gap: 17px; transition: opacity .14s ease, transform .18s cubic-bezier(.2,.75,.25,1); }
.auth-form.is-transitioning-out { opacity: 0; pointer-events: none; }
.auth-form.is-transitioning-out[data-transition-direction="left"] { transform: translateX(-26px); }
.auth-form.is-transitioning-out[data-transition-direction="right"] { transform: translateX(26px); }
.auth-form.is-transitioning-in { opacity: 0; pointer-events: none; }
.auth-form.is-transitioning-in[data-transition-direction="left"] { transform: translateX(26px); }
.auth-form.is-transitioning-in[data-transition-direction="right"] { transform: translateX(-26px); }
.auth-form h2 { margin: 9px 0 7px; font-size: clamp(38px, 4vw, 56px); line-height: .98; letter-spacing: -.06em; }
.auth-form p { margin: 0; color: var(--muted); }
label, fieldset { display: grid; gap: 8px; color: #2b2b29; font-size: 12px; font-weight: 800; }
fieldset { margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 10px; }
input, select, textarea {
  width: 100%;
  min-height: 54px;
  padding: 0 17px;
  border: 1px solid var(--line);
  border-radius: 17px;
  outline: none;
  background: #fff;
  color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
textarea { min-height: 120px; padding: 14px 16px; resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 42px; background-image: linear-gradient(45deg, transparent 50%, #666 50%), linear-gradient(135deg, #666 50%, transparent 50%); background-position: calc(100% - 19px) 21px, calc(100% - 14px) 21px; background-size: 5px 5px; background-repeat: no-repeat; }
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 4px rgba(227, 6, 19, .08); }
input:disabled, select:disabled { color: #9a9eaa; background-color: var(--soft); cursor: not-allowed; }
.avatar-options { display: flex; flex-wrap: wrap; gap: 10px; }
.avatar-choice { width: 58px; height: 58px; padding: 3px; border: 1px solid var(--line); border-radius: 18px; background: white; }
.avatar-choice img { width: 100%; height: 100%; border-radius: 14px; object-fit: cover; }
.avatar-choice[aria-pressed="true"] { border-color: var(--red); box-shadow: 0 0 0 4px rgba(227, 6, 19, .08); }
.form-error { min-height: 20px; color: var(--red) !important; font-weight: 700; }

.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 20px; border: 0; border-radius: 999px; font-weight: 850; }
.button.primary { background: var(--red); color: white; }
.button.primary:hover { background: var(--red-dark); }
.button.secondary { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.button.link { background: transparent; color: var(--red); }
.icon-button { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--ink); }

.app-shell { height: 100dvh; display: grid; grid-template-columns: 64px 248px minmax(0, 1fr) auto; gap: 6px; padding: 6px; background: var(--ink); }
.space-rail { position: relative; z-index: 20; width: 64px; display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 8px; border: 1px solid var(--line); border-radius: 22px; background: white; overflow: visible; transition: width .2s ease, box-shadow .2s ease; }
.space-rail:hover, .space-rail:focus-within { width: 216px; align-items: stretch; box-shadow: 16px 0 40px rgba(18,20,25,.16); }
.rail-logo, .rail-button, .space-button { width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center; border: 0; border-radius: 15px; }
.rail-logo { background: var(--ink); }
.rail-logo img { width: 40px; filter: brightness(0) invert(1); }
.rail-button { color: var(--red); background: #fff0f1; }
.space-list { display: grid; align-content: start; gap: 7px; width: 100%; overflow-y: auto; }
.space-list, .channel-list { scrollbar-width: none; }
.space-list::-webkit-scrollbar, .channel-list::-webkit-scrollbar { display: none; }
.space-button { position: relative; margin: auto; display: flex; align-items: center; justify-content: flex-start; gap: 10px; padding: 0; background: var(--soft); color: var(--ink); font-size: 12px; font-weight: 900; overflow: hidden; transition: width .2s ease, padding .2s ease, border-radius .2s ease; }
.space-button-mark { min-width: 46px; height: 46px; display: grid; place-items: center; }
.space-button-label { min-width: 0; opacity: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: opacity .14s ease; }
.space-rail:hover .space-button, .space-rail:focus-within .space-button { width: 100%; margin: 0; padding-right: 12px; border-radius: 14px; }
.space-rail:hover .space-button-label, .space-rail:focus-within .space-button-label { opacity: 1; }
.space-button.active { background: var(--red); color: white; }

.channel-sidebar { min-width: 0; display: grid; grid-template-rows: auto 1fr auto; border: 1px solid var(--line); border-radius: 22px; background: white; overflow: hidden; }
.channel-sidebar > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px; border-bottom: 1px solid var(--line); }
.channel-home-button { min-width: 44px; height: 44px; display: none; align-items: center; justify-content: center; gap: 9px; padding: 0 14px; border: 0; border-radius: 14px; background: var(--red); color: white; font-weight: 850; }
.channel-home-button svg { width: 19px; height: 19px; }
.channel-sidebar h2 { overflow: hidden; margin: 4px 0 0; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.channel-list { padding: 14px; overflow-y: auto; }
.channel-group { margin-bottom: 24px; }
.channel-group-title { display: flex; justify-content: space-between; align-items: center; margin: 0 6px 8px; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.channel-button { width: 100%; min-height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: #565651; text-align: left; }
.channel-button:hover, .channel-button.active { background: var(--soft); color: var(--ink); }
.channel-button.active { background: var(--ink); color: white; box-shadow: none; }
.channel-button > span:first-of-type { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-chip { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 10px; padding: 14px; border-top: 1px solid var(--line); }
.profile-chip strong, .profile-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-chip small { color: var(--green); }
.avatar { width: 42px; height: 42px; overflow: hidden; border-radius: 14px; background: var(--soft); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.workspace { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); border: 1px solid var(--line); border-radius: 22px; background: white; overflow: hidden; }
.workspace-header { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.workspace-header h1 { margin: 4px 0 0; font-size: 22px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.badge-button { position: relative; }
.button-badge { position: absolute; top: -7px; right: -7px; min-width: 21px; height: 21px; display: grid; place-items: center; padding: 0 6px; border: 2px solid white; border-radius: 999px; background: var(--red); color: white; font-size: 10px; line-height: 1; }
.content-scroll { overflow-y: auto; padding: clamp(24px, 3.5vw, 48px); background: var(--soft); }
.content-scroll { scrollbar-width: none; }
.content-scroll::-webkit-scrollbar { display: none; }
body[data-main-view="home"] .app-shell { grid-template-columns: 64px minmax(0, 1fr) auto; }
body[data-main-view="home"] .channel-sidebar { display: none; }
body:not([data-main-view="home"]) .app-shell { grid-template-columns: 76px minmax(0, 1fr) auto; }
body:not([data-main-view="home"]) .space-rail { display: none; }
body:not([data-main-view="home"]) .channel-sidebar { position: relative; z-index: 22; width: 76px; transition: width .2s ease, box-shadow .2s ease; }
body:not([data-main-view="home"]) .channel-sidebar:hover,
body:not([data-main-view="home"]) .channel-sidebar:focus-within { width: 248px; box-shadow: 16px 0 40px rgba(18,20,25,.16); }
body:not([data-main-view="home"]) .channel-sidebar > header { min-height: 76px; justify-content: center; padding: 15px; }
body:not([data-main-view="home"]) .channel-home-button { display: inline-flex; padding: 0; }
body:not([data-main-view="home"]) .channel-home-button span,
body:not([data-main-view="home"]) .channel-sidebar-title,
body:not([data-main-view="home"]) .channel-sidebar > header > .icon-button,
body:not([data-main-view="home"]) .channel-button > span,
body:not([data-main-view="home"]) .channel-favorite,
body:not([data-main-view="home"]) .profile-chip > div:nth-child(2),
body:not([data-main-view="home"]) .profile-chip > .icon-button,
body:not([data-main-view="home"]) .channel-group-title { display: none; }
body:not([data-main-view="home"]) .channel-list { padding: 10px; }
body:not([data-main-view="home"]) .channel-group { display: grid; gap: 7px; margin-bottom: 16px; }
body:not([data-main-view="home"]) .channel-row { display: block; }
body:not([data-main-view="home"]) .channel-button { width: 46px; height: 46px; min-height: 46px; justify-content: center; padding: 0; border-radius: 14px; }
body:not([data-main-view="home"]) .channel-button > svg { width: 20px; height: 20px; }
body:not([data-main-view="home"]) .profile-chip { grid-template-columns: 46px; justify-content: center; padding: 10px; }
body:not([data-main-view="home"]) .profile-chip .avatar { width: 46px; height: 46px; }
body:not([data-main-view="home"]) .channel-sidebar:hover > header,
body:not([data-main-view="home"]) .channel-sidebar:focus-within > header { justify-content: flex-start; padding: 15px; }
body:not([data-main-view="home"]) .channel-sidebar:hover .channel-home-button,
body:not([data-main-view="home"]) .channel-sidebar:focus-within .channel-home-button { padding: 0 14px; }
body:not([data-main-view="home"]) .channel-sidebar:hover .channel-home-button span,
body:not([data-main-view="home"]) .channel-sidebar:focus-within .channel-home-button span { display: inline; }
body:not([data-main-view="home"]) .channel-sidebar:hover .channel-group-title,
body:not([data-main-view="home"]) .channel-sidebar:focus-within .channel-group-title { display: flex; }
body:not([data-main-view="home"]) .channel-sidebar:hover .channel-row,
body:not([data-main-view="home"]) .channel-sidebar:focus-within .channel-row { display: grid; }
body:not([data-main-view="home"]) .channel-sidebar:hover .channel-button,
body:not([data-main-view="home"]) .channel-sidebar:focus-within .channel-button { width: 100%; justify-content: flex-start; padding: 0 12px; border-radius: 999px; }
body:not([data-main-view="home"]) .channel-sidebar:hover .channel-button > span,
body:not([data-main-view="home"]) .channel-sidebar:focus-within .channel-button > span,
body:not([data-main-view="home"]) .channel-sidebar:hover .channel-favorite,
body:not([data-main-view="home"]) .channel-sidebar:focus-within .channel-favorite,
body:not([data-main-view="home"]) .channel-sidebar:hover .profile-chip > div:nth-child(2),
body:not([data-main-view="home"]) .channel-sidebar:focus-within .profile-chip > div:nth-child(2),
body:not([data-main-view="home"]) .channel-sidebar:hover .profile-chip > .icon-button,
body:not([data-main-view="home"]) .channel-sidebar:focus-within .profile-chip > .icon-button { display: flex; }
body:not([data-main-view="home"]) .channel-sidebar:hover .profile-chip,
body:not([data-main-view="home"]) .channel-sidebar:focus-within .profile-chip { grid-template-columns: 42px 1fr auto; justify-content: initial; padding: 14px; }
.logout-button { border-color: var(--red); background: var(--red); color: white; }
.logout-button:hover { background: var(--red-dark); }
.dashboard-intro { max-width: 760px; margin-bottom: 32px; }
.dashboard-intro h2 { margin: 8px 0; font-size: clamp(34px, 4vw, 58px); line-height: 1; letter-spacing: -.05em; }
.dashboard-intro p { color: var(--muted); font-size: 17px; line-height: 1.6; }
.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.action-grid .card::before { content: "01"; width: max-content; color: var(--red); font-size: 10px; font-weight: 900; letter-spacing: .14em; }
.action-grid .card:nth-child(2)::before { content: "02"; }
.card { position: relative; display: grid; gap: 15px; padding: 28px; border: 1px solid var(--line); border-radius: 28px; background: white; box-shadow: none; }
.card h3 { margin: 0; font-size: 27px; line-height: 1; letter-spacing: -.04em; }
.section-block { margin-top: 34px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-radius: 999px; background: var(--ink); color: white; }
.section-heading h2 { margin: 5px 0 0; font-size: 22px; letter-spacing: -.03em; }
.empty-state { padding: 28px; border: 1px solid var(--line); border-radius: 24px; background: white; color: var(--muted); }
.conference-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.conference-card { display: grid; gap: 10px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, #fff, #fafafb); }
.conference-card h3, .conference-card p { margin: 0; }
.conference-card p { color: var(--muted); }

.chat-view { min-height: 0; display: grid; grid-template-rows: 1fr auto; }
.message-list { overflow-y: auto; padding: 28px; background: var(--soft); }
.message { display: grid; grid-template-columns: 42px 1fr; gap: 12px; margin-bottom: 18px; }
.message-body { min-width: 0; }
.message-meta { display: flex; gap: 8px; align-items: baseline; }
.message-meta time { color: var(--muted); font-size: 11px; }
.message-delivery { padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 11px; cursor: default; }
.message-pending { opacity: .68; }
.message-pending[data-delivery="failed"] { opacity: 1; }
.message-pending[data-delivery="failed"] .message-delivery { color: var(--red); cursor: pointer; }
.message-body p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.message-composer { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); background: white; }

.call-view { min-height: 0; display: grid; grid-template-rows: 1fr auto; background: #111318; }
.call-stage { position: relative; min-height: 0; }
.video-grid { width: 100%; height: 100%; min-height: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-content: center; gap: 12px; padding: 16px; overflow: auto; }
.video-tile { position: relative; min-height: 220px; overflow: hidden; border: 1px solid #2a2e38; border-radius: 18px; background: #1b1e25; }
.video-tile video { width: 100%; height: 100%; object-fit: cover; }
.video-tile video.mirror-camera { transform: none; }
.video-label { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 6px; align-items: center; max-width: calc(100% - 24px); padding: 7px 10px; border-radius: 10px; background: rgba(0, 0, 0, .68); color: white; font-size: 12px; }
.video-label > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-playback-button { position: absolute; inset: 50% auto auto 50%; z-index: 4; min-height: 42px; display: inline-flex; align-items: center; gap: 6px; padding: 0 16px; transform: translate(-50%, -50%); border: 1px solid rgba(255,255,255,.22); border-radius: 999px; background: rgba(11,13,18,.84); color: white; font: inherit; font-size: 12px; font-weight: 800; backdrop-filter: blur(12px); }
.media-playback-button svg { width: 17px; height: 17px; }
.participant-media-state { display: flex; gap: 5px; margin-left: 3px; }
.participant-media-state svg { width: 14px; height: 14px; }
.call-controls { display: flex; justify-content: center; gap: 10px; padding: 14px; background: #171a20; }
.control-button { min-width: 92px; display: grid; place-items: center; gap: 4px; padding: 10px; border: 1px solid #3a3a38; border-radius: 999px; background: #222220; color: white; font-size: 11px; }
.control-button[aria-pressed="true"] { background: white; color: var(--ink); }
.control-button.danger { background: var(--red); border-color: var(--red); }
.call-network-badge { position: absolute; top: 14px; left: 14px; z-index: 3; display: grid; grid-template-columns: 8px auto; align-items: center; gap: 1px 8px; max-width: min(310px, calc(100% - 28px)); padding: 8px 11px; border: 1px solid rgba(255,255,255,.13); border-radius: 12px; background: rgba(11,13,18,.72); color: white; backdrop-filter: blur(12px); pointer-events: none; }
.call-network-badge > span { grid-row: 1 / 3; width: 8px; height: 8px; border-radius: 50%; background: #8e949f; }
.call-network-badge strong { font-size: 11px; }
.call-network-badge small { color: #b9bdc6; font-size: 9px; }
.call-network-badge[data-quality="good"] > span { background: #40cc91; box-shadow: 0 0 0 4px rgba(64,204,145,.12); }
.call-network-badge[data-quality="fair"] > span { background: #f0b84e; box-shadow: 0 0 0 4px rgba(240,184,78,.12); }
.call-network-badge[data-quality="poor"] > span { background: #ff5d68; box-shadow: 0 0 0 4px rgba(255,93,104,.12); }
.network-mode-settings { display: grid; gap: 18px; }
.network-mode-settings fieldset { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.network-mode-option { display: grid; grid-template-columns: 22px minmax(0,1fr); align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: white; cursor: pointer; }
.network-mode-option:has(input:checked) { border-color: #ff9ba1; background: #fff7f7; box-shadow: inset 3px 0 var(--red); }
.network-mode-option input { width: 18px; height: 18px; accent-color: var(--red); }
.network-mode-option > span { display: grid; gap: 3px; }
.network-mode-option strong { font-size: 13px; }
.network-mode-option small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.network-route-status { display: grid; grid-template-columns: 9px minmax(0,1fr); align-items: center; gap: 10px; padding: 13px 14px; border-radius: 15px; background: var(--soft); }
.network-route-status > span { width: 9px; height: 9px; border-radius: 50%; background: #f0b84e; box-shadow: 0 0 0 4px rgba(240,184,78,.13); }
.network-route-status[data-available="true"] > span { background: #40cc91; box-shadow: 0 0 0 4px rgba(64,204,145,.13); }
.network-route-status > div { display: grid; gap: 3px; }
.network-route-status strong { font-size: 12px; }
.network-route-status small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.transcript-panel { position: absolute; right: 18px; bottom: 18px; z-index: 4; width: min(420px, calc(100% - 36px)); max-height: 38%; overflow-y: auto; padding: 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: rgba(11,13,18,.82); color: white; backdrop-filter: blur(12px); }
.transcript-line { margin: 0 0 8px; font-size: 13px; line-height: 1.45; }
.transcript-line:last-child { margin-bottom: 0; }
.transcript-line strong { color: #ff7079; }

.whiteboard-view { position: absolute; inset: 0; z-index: 8; display: grid; grid-template-rows: auto 1fr; background: #f4f4f0; color: var(--ink); }
.whiteboard-header { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 16px 10px 20px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); }
.whiteboard-header > div:first-child { display: grid; gap: 2px; }
.whiteboard-header strong { font-size: 18px; }
.whiteboard-header-actions { display: flex; align-items: center; gap: 8px; }
.whiteboard-header-actions .button { min-height: 40px; padding: 0 14px; }
.whiteboard-access { padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; font-weight: 750; }
.whiteboard-access[data-access="edit"] { border-color: #acd8c8; background: #e9f7f1; color: var(--green); }
.whiteboard-body { min-height: 0; display: grid; grid-template-columns: 82px minmax(0, 1fr) 112px; }
.whiteboard-tools { z-index: 2; display: flex; flex-direction: column; align-items: stretch; gap: 5px; padding: 10px 8px; border-right: 1px solid var(--line); background: white; overflow-y: auto; }
.whiteboard-tool { min-height: 58px; display: grid; place-items: center; align-content: center; gap: 3px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: #666; font: inherit; font-size: 10px; font-weight: 700; cursor: pointer; }
.whiteboard-tool svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.whiteboard-tool:hover { background: var(--soft); color: var(--ink); }
.whiteboard-tool.is-active { border-color: #222; background: #111; color: white; }
.whiteboard-tool-danger { margin-top: auto; color: var(--red); }
.whiteboard-color { width: 42px; height: 42px; flex: 0 0 auto; align-self: center; padding: 3px; border: 1px solid var(--line); border-radius: 50%; background: white; cursor: pointer; }
.whiteboard-color::-webkit-color-swatch { border: 0; border-radius: 50%; }
.whiteboard-canvas-wrap { position: relative; min-width: 0; min-height: 0; margin: 12px; border: 1px solid #d9d9d2; border-radius: 16px; background-color: #fff; background-image: radial-gradient(#d8d8d1 1px, transparent 1px); background-size: 22px 22px; overflow: hidden; box-shadow: 0 12px 35px rgba(20,20,20,.06); }
#whiteboard-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.whiteboard-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 5px; pointer-events: none; color: #9a9a94; text-align: center; }
.whiteboard-empty strong { color: #5f5f5b; font-size: 20px; }
.whiteboard-text-editor { position: absolute; z-index: 4; width: min(280px, calc(100% - 16px)); display: flex; border: 1px solid #111; border-radius: 10px; background: white; box-shadow: var(--shadow); overflow: hidden; }
.whiteboard-text-editor input { min-width: 0; flex: 1; border: 0; border-radius: 0; box-shadow: none; }
.whiteboard-text-editor button { width: 42px; border: 0; background: #111; color: white; font-size: 20px; }
.whiteboard-participants { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 8px; border-left: 1px solid var(--line); background: white; overflow-y: auto; }
.whiteboard-participant { position: relative; width: 82px; min-height: 82px; display: grid; place-items: center; border: 2px solid white; border-radius: 50%; background: #17191f; box-shadow: 0 0 0 1px var(--line), 0 5px 18px rgba(0,0,0,.13); overflow: visible; }
.whiteboard-participant video, .whiteboard-participant img { width: 100%; height: 100%; aspect-ratio: 1; border-radius: 50%; object-fit: cover; }
.whiteboard-participant > span { position: absolute; left: 50%; bottom: -5px; max-width: 100px; transform: translate(-50%, 50%); padding: 3px 7px; border-radius: 999px; background: #111; color: white; font-size: 9px; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.whiteboard-permission-list { display: grid; gap: 8px; }
.whiteboard-permission-list > p { margin: 0 0 8px; color: var(--muted); }
.whiteboard-permission-row { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.whiteboard-permission-row img { width: 38px; height: 38px; border-radius: 10px; }
.whiteboard-permission-row input { width: 20px; height: 20px; }

.drawer { width: min(340px, 90vw); display: grid; grid-template-rows: auto 1fr; border: 1px solid var(--line); border-radius: 26px; background: white; overflow: hidden; }
.drawer header { display: flex; justify-content: space-between; align-items: center; padding: 18px; border-bottom: 1px solid var(--line); }
.drawer-content, #drawer-content { padding: 16px; overflow-y: auto; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.member-row .avatar { width: 36px; height: 36px; }
.invite-links { display: grid; gap: 12px; }
.invite-link-card { padding: 14px; box-shadow: none; }

dialog { width: min(560px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(11, 13, 18, .55); backdrop-filter: blur(3px); }
dialog form > header { display: flex; justify-content: space-between; align-items: center; padding: 20px; border-bottom: 1px solid var(--line); }
#modal-content { display: grid; gap: 14px; padding: 20px; }
.prejoin-dialog { width: min(980px, calc(100vw - 32px)); overflow: hidden; }
.prejoin-shell { display: grid; max-height: min(820px, calc(100dvh - 32px)); }
.prejoin-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 24px 26px; border-bottom: 1px solid var(--line); }
.prejoin-header h2 { margin: 7px 0 5px; font-size: clamp(26px, 3vw, 38px); letter-spacing: -.04em; }
.prejoin-header p { margin: 0; color: var(--muted); }
.prejoin-content { min-height: 0; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(290px, .75fr); gap: 22px; padding: 22px 26px; overflow-y: auto; }
.prejoin-preview { position: relative; min-height: 390px; overflow: hidden; border-radius: 26px; background: var(--ink); }
.prejoin-preview video { width: 100%; height: 100%; min-height: 390px; display: block; object-fit: cover; transform: none; }
.prejoin-placeholder { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; color: white; text-align: center; }
.prejoin-placeholder svg { width: 42px; height: 42px; margin-bottom: 4px; color: #aeb3bf; }
.prejoin-placeholder span { color: #aeb3bf; font-size: 12px; }
.prejoin-preview-controls { position: absolute; right: 14px; bottom: 14px; left: 14px; display: flex; justify-content: center; gap: 9px; }
.device-toggle { min-height: 40px; padding: 0 13px; border: 1px solid rgba(255,255,255,.18); border-radius: 12px; background: rgba(17,19,24,.78); color: white; font-size: 12px; font-weight: 800; backdrop-filter: blur(10px); }
.device-toggle[aria-pressed="false"] { background: var(--red); border-color: var(--red); }
.prejoin-devices { align-content: start; display: grid; gap: 14px; }
.device-readiness { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.device-readiness span { min-height: 40px; display: flex; align-items: center; padding: 0 11px; border-radius: 11px; background: var(--soft); color: var(--muted); font-size: 11px; font-weight: 800; }
.device-readiness [data-state="ready"] { background: #eaf7f1; color: var(--green); }
.device-readiness [data-state="error"] { background: #fff0f1; color: var(--red); }
.microphone-meter { height: 7px; overflow: hidden; border-radius: 99px; background: #e8eaf0; }
.microphone-meter span { width: 0; height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--green), #69cc97); transition: width .08s linear; }
.prejoin-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 26px; border-top: 1px solid var(--line); }
.prejoin-footer > span { color: var(--muted); font-size: 12px; }
.lobby-dialog { width: min(460px, calc(100vw - 32px)); }
.lobby-shell { display: grid; justify-items: center; gap: 12px; padding: 38px; text-align: center; }
.lobby-shell h2 { margin: 2px 0 0; font-size: 30px; letter-spacing: -.04em; }
.lobby-shell p { margin: 0; color: var(--muted); line-height: 1.55; }
.lobby-pulse { width: 70px; height: 70px; display: grid; place-items: center; border-radius: 24px; background: #fff0f1; color: var(--red); animation: lobby-pulse 1.8s ease-in-out infinite; }
.lobby-pulse svg { width: 30px; height: 30px; }
.lobby-state { margin: 5px 0 10px; color: var(--green); font-size: 13px; }
.admission-section { display: grid; gap: 10px; margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.admission-section h3 { margin: 0; font-size: 15px; }
.admission-card { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 9px; padding: 10px; border: 1px solid #ffd2d5; border-radius: 13px; background: #fff8f8; }
.admission-card .avatar { width: 38px; height: 38px; }
.admission-actions { display: flex; gap: 6px; }
.admission-actions .button { min-height: 34px; padding: 0 10px; font-size: 11px; }
@keyframes lobby-pulse { 50% { transform: scale(1.06); box-shadow: 0 0 0 14px rgba(227,6,19,.06); } }
.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: grid; gap: 8px; }
.toast { max-width: 360px; padding: 13px 16px; border-radius: 12px; background: var(--ink); color: white; box-shadow: var(--shadow); }

@media (max-width: 900px) {
  body { overflow: auto; }
  .auth-view { padding: 0; }
  .auth-panel { min-height: 100vh; grid-template-columns: 1fr; border: 0; border-radius: 0; }
  .auth-copy { min-height: 205px; justify-content: flex-end; padding: 28px 24px; }
  .auth-copy::after { right: 24px; bottom: 16px; left: 24px; }
  .auth-copy h1 { max-width: 650px; margin: 13px 0; font-size: 40px; line-height: .96; }
  .auth-copy p { max-width: 600px; font-size: 14px; line-height: 1.45; }
  .auth-form-wrap { place-items: start center; padding: 30px 20px 42px; }
  .app-shell { height: 100dvh; grid-template-columns: 64px minmax(0, 1fr); grid-template-rows: 1fr 72px; }
  .space-rail { grid-column: 1; grid-row: 1 / 3; }
  .channel-sidebar { grid-column: 2; grid-row: 2; display: flex; min-width: 0; border-top: 1px solid var(--line); border-right: 0; overflow: hidden; }
  .channel-sidebar > header, .channel-sidebar > footer { display: none; }
  .channel-list { flex: 1; min-width: 0; display: flex; gap: 8px; padding: 10px; overflow-x: auto; overscroll-behavior-x: contain; }
  .channel-group { display: flex; gap: 8px; margin: 0; }
  .channel-group-title { display: none; }
  .channel-button { width: auto; min-width: max-content; padding: 0 14px; }
  .workspace { grid-column: 2; grid-row: 1; min-height: 0; }
  .workspace-header { min-width: 0; gap: 8px; padding: 12px 10px; }
  .workspace-header > div:first-child { min-width: 0; }
  .workspace-header h1 { overflow: hidden; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
  .header-actions { flex: 0 0 auto; gap: 6px; }
  .header-actions .button span { display: none; }
  .header-actions .button { width: 42px; min-height: 42px; padding: 0; }
  .content-scroll { padding: 20px 14px; }
  .dashboard-intro h2 { font-size: 36px; }
  .action-grid { grid-template-columns: 1fr; }
  .video-grid { grid-template-columns: 1fr; padding: 8px; }
  .video-tile { min-height: 260px; }
  .control-button { flex: 1; min-width: 0; padding: 8px 4px; }
  .call-controls { gap: 7px; padding: 10px 8px; }
  .control-button span { display: none; }
  .transcript-panel { right: 8px; bottom: 8px; width: calc(100% - 16px); max-height: 32%; }
  .drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; box-shadow: var(--shadow); }
  .prejoin-dialog { width: 100vw; max-width: none; height: 100dvh; max-height: none; border-radius: 0; }
  .prejoin-shell { height: 100%; max-height: none; grid-template-rows: auto minmax(0, 1fr) auto; }
  .prejoin-header { padding: 18px; }
  .prejoin-header h2 { font-size: 25px; }
  .prejoin-header p { font-size: 12px; }
  .prejoin-content { grid-template-columns: 1fr; gap: 16px; padding: 16px 18px; }
  .prejoin-preview, .prejoin-preview video { min-height: 245px; }
  .prejoin-preview { max-height: 38vh; }
  .prejoin-footer { padding: 14px 18px; }
  .prejoin-footer > span { display: none; }
  .prejoin-footer .button { width: 100%; }
  .device-readiness { grid-template-columns: 1fr; }
  .whiteboard-view { position: fixed; inset: 0; }
  .whiteboard-header { min-height: 58px; padding: 8px 10px; }
  .whiteboard-header .eyebrow, .whiteboard-header-actions .button span, .whiteboard-access { display: none; }
  .whiteboard-header strong { font-size: 15px; }
  .whiteboard-header-actions .button { width: 42px; min-height: 42px; padding: 0; }
  .whiteboard-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr) 74px; }
  .whiteboard-tools { grid-row: 1; flex-direction: row; padding: 6px 8px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; }
  .whiteboard-tool { min-width: 48px; min-height: 48px; flex: 0 0 auto; }
  .whiteboard-tool span { display: none; }
  .whiteboard-tool-danger { margin-top: 0; margin-left: auto; }
  .whiteboard-color { min-width: 40px; width: 40px; height: 40px; margin: 4px; }
  .whiteboard-canvas-wrap { grid-row: 2; margin: 7px; border-radius: 11px; }
  .whiteboard-participants { grid-row: 3; flex-direction: row; justify-content: flex-start; padding: 6px 10px 11px; border-left: 0; border-top: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; }
  .whiteboard-participant { width: 52px; min-width: 52px; min-height: 52px; }
  .whiteboard-participant > span { max-width: 70px; font-size: 8px; }
}

/* Product workspace */
button, .button, .channel-button, .compact-room, .command-result { transition: transform .16s ease, border-color .16s ease, background-color .16s ease, color .16s ease, box-shadow .16s ease; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(227, 6, 19, .24); outline-offset: 2px; }
button:disabled { cursor: not-allowed; opacity: .48; }
.button:not(:disabled):active, .icon-button:not(:disabled):active { transform: translateY(1px); }
.button.secondary:hover, .icon-button:hover { border-color: #c9ccd3; background: #fafafa; }
.muted-copy { margin: 0; color: var(--muted); line-height: 1.55; }
.compact-action { min-height: 34px; padding: 0 11px; font-size: 11px; white-space: nowrap; }
.stack-form { display: grid; gap: 16px; }
.space-access { display: grid; gap: 18px; }
.segmented-control { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 4px; padding: 4px; border-radius: 15px; background: var(--soft); }
.segmented-control button { min-height: 42px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 850; }
.segmented-control button[aria-pressed="true"] { background: white; color: var(--ink); box-shadow: 0 3px 12px rgba(20,22,28,.08); }
.space-access-form, .room-create-form { gap: 13px; }
.space-access-form .muted-copy, .room-create-form .muted-copy { margin-bottom: 3px; }
.space-access-form .button, .room-create-form .button { width: 100%; }
.field-hint { display: block; margin-top: 6px; color: var(--muted); font-size: 9px; font-weight: 550; line-height: 1.45; }
.space-quota-note { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid #d7e6df; border-radius: 14px; background: #f2faf6; }
.space-quota-note strong { padding: 6px 9px; border-radius: 999px; background: white; color: var(--green); font-size: 10px; white-space: nowrap; }
.space-quota-note span { color: #53605a; font-size: 10px; line-height: 1.4; }
.space-quota-note[data-full="true"] { border-color: #ffd1d4; background: #fff5f5; }
.space-quota-note[data-full="true"] strong { color: var(--red); }
.channel-settings-list { display: grid; gap: 10px; }
.channel-settings-list .room-create-form { margin-bottom: 8px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }

.guest-entry-form { padding: 24px; border: 1px solid #ffd4d7; border-radius: 24px; background: linear-gradient(145deg, #fff, #fff8f8); box-shadow: 0 20px 55px rgba(36, 24, 28, .08); }
.dashboard-toolbar { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; min-height: 138px; padding: 25px 28px; border-radius: 24px; background: var(--ink); color: white; overflow: hidden; }
.dashboard-toolbar::after { display: none; }
.dashboard-toolbar h2 { margin: 7px 0 0; font-size: clamp(32px, 3.4vw, 48px); line-height: .95; letter-spacing: -.055em; }
.dashboard-hero-actions { display: flex; flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.dashboard-toolbar .button.secondary { border-color: rgba(255,255,255,.24); background: rgba(255,255,255,.08); color: white; }
.room-directory-section { margin-top: 16px; padding: 22px; border: 1px solid var(--line); border-radius: 24px; background: white; }
.room-directory-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.room-directory-heading h2 { margin: 5px 0 0; font-size: 25px; letter-spacing: -.035em; }
.room-directory-count { color: var(--muted); font-size: 11px; font-weight: 800; white-space: nowrap; }
.room-directory-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.room-directory-card { min-width: 0; min-height: 78px; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: white; color: var(--ink); text-align: left; }
.room-directory-card:hover { border-color: #c8cbd2; background: #fafafa; transform: translateY(-1px); }
.room-directory-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--soft); color: var(--red); }
.room-directory-icon svg { width: 19px; height: 19px; }
.room-directory-icon img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.space-directory-card.active { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.space-directory-card.active .room-directory-arrow { color: var(--red); font-weight: 900; }
.space-directory-create { border-style: dashed; background: #fffafa; }
.space-directory-create .room-directory-icon { background: #ffecef; }
.room-directory-card > span:nth-child(2) { min-width: 0; display: grid; gap: 4px; }
.room-directory-card strong, .room-directory-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-directory-card strong { font-size: 13px; }
.room-directory-card small { color: var(--muted); font-size: 10px; }
.room-directory-arrow { color: #a8abb3; font-size: 17px; }
.room-directory-empty { grid-template-columns: minmax(0,1fr) auto; align-items: center; padding: 16px; border: 1px dashed #d7d9df; border-radius: 16px; }
.room-directory-empty p { margin: 0; color: var(--muted); line-height: 1.45; }
.overview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 12px 0 28px; }
.overview-card { position: relative; min-width: 0; min-height: 150px; padding: 21px; border: 1px solid var(--line); border-radius: 26px; background: #fff; box-shadow: none; overflow: hidden; }
.overview-card::after { display: none; }
.overview-card-wide { grid-column: auto; }
.overview-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.overview-card-head svg { color: #9ca1ad; }
.compact-list { display: grid; gap: 8px; }
.empty-compact { min-height: 66px; place-items: center; padding: 14px; border: 1px dashed #d8dae0; border-radius: 14px; color: var(--muted); font-size: 13px; text-align: center; }
.compact-room { width: 100%; min-width: 0; display: grid; grid-template-columns: 34px minmax(0,1fr); align-items: center; gap: 10px; padding: 9px; border: 1px solid transparent; border-radius: 999px; background: var(--soft); color: var(--ink); text-align: left; }
.compact-room > svg { width: 18px; height: 18px; color: var(--red); justify-self: center; }
.compact-room span, .meeting-compact span { min-width: 0; display: grid; gap: 2px; }
.compact-room strong, .compact-room small, .meeting-compact strong, .meeting-compact small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-room small, .meeting-compact small { color: var(--muted); font-size: 11px; }
.compact-room:hover { border-color: #e1e3e8; background: white; box-shadow: 0 8px 22px rgba(22,26,37,.06); transform: translateY(-1px); }
.meeting-compact { display: grid; grid-template-columns: minmax(120px, auto) minmax(0,1fr) auto; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 18px; background: var(--soft); }
.meeting-compact time { color: var(--red); font-size: 12px; font-weight: 850; }
.meeting-compact-actions, .modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }

.channel-row { min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) 34px; align-items: center; gap: 2px; }
.channel-favorite { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 9px; background: transparent; color: #b8bbc3; opacity: 0; }
.channel-row:hover .channel-favorite, .channel-favorite:focus-visible, .channel-favorite[aria-pressed="true"] { opacity: 1; }
.channel-favorite svg { width: 16px; height: 16px; }
.channel-favorite[aria-pressed="true"] { color: #e7a500; }
.channel-favorite[aria-pressed="true"] svg { fill: currentColor; }
.channel-participants { flex: 0 0 auto !important; display: flex; align-items: center; padding-left: 5px; overflow: visible !important; }
.channel-participants img { width: 20px; height: 20px; margin-left: -5px; border: 2px solid white; border-radius: 999px; background: var(--soft); object-fit: cover; }
.channel-participants b { min-width: 18px; height: 18px; display: grid; place-items: center; margin-left: 3px; border-radius: 999px; background: #eaf7f1; color: var(--green); font-size: 9px; }
.member-row > span { min-width: 0; flex: 1; }
.member-row small { color: var(--muted); }
.presence-pill { width: max-content; display: inline-flex; align-items: center; gap: 5px; margin-top: 5px; padding: 3px 7px; border-radius: 999px; background: #eaf7f1; color: var(--green); font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.presence-busy, .presence-dnd, .presence-call { background: #fff0f1; color: var(--red); }
.presence-away, .presence-out-of-office { background: #fff6df; color: #9c6900; }
.member-call-button { min-height: 34px; padding: 0 10px; font-size: 11px; }

.smart-invite { display: grid; gap: 18px; }
.smart-invite-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; padding: 15px; border: 1px solid var(--line); border-radius: 16px; }
.permission-grid legend { padding: 0 5px; }
.permission-grid label, .attendee-picker label { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 7px; border-radius: 10px; background: var(--soft); font-weight: 700; }
.permission-grid input, .attendee-picker input { width: 17px; min-height: 17px; margin: 0; accent-color: var(--red); box-shadow: none; }
.invite-created-result:empty { display: none; }
.invite-registry { display: grid; gap: 9px; padding-top: 4px; border-top: 1px solid var(--line); }
.compact-heading h3 { margin: 12px 0 0; font-size: 16px; }
.invite-registry-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 11px; border-radius: 13px; background: var(--soft); }
.invite-registry-row > div { min-width: 0; display: grid; gap: 3px; }
.invite-registry-row small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.attendee-picker { max-height: 150px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; overflow-y: auto; }
.profile-avatar-options { display: flex; flex-wrap: wrap; gap: 10px; }
.member-profile-card { display: grid; grid-template-columns: 78px minmax(0,1fr); align-items: center; gap: 16px; }
.member-profile-card > img { width: 78px; height: 78px; border-radius: 22px; background: var(--soft); object-fit: cover; }
.member-profile-card h3, .member-profile-card p { margin: 0; }
.member-profile-card p { margin-top: 5px; color: var(--muted); }
.member-profile-card .button { grid-column: 1 / -1; }

.meeting-workspace-panel { position: absolute; top: 12px; right: 12px; bottom: 12px; z-index: 7; width: min(390px, calc(100% - 24px)); display: grid; grid-template-rows: auto auto minmax(0,1fr) auto; gap: 12px; padding: 17px; border: 1px solid rgba(255,255,255,.14); border-radius: 20px; background: rgba(20,23,29,.96); color: white; box-shadow: 0 25px 70px rgba(0,0,0,.35); backdrop-filter: blur(18px); }
.meeting-workspace-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.meeting-workspace-panel h2 { margin: 4px 0 0; font-size: 19px; }
.meeting-workspace-panel .icon-button { border-color: #3b404c; background: #272b34; color: white; }
.meeting-workspace-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-button { min-height: 31px; padding: 0 10px; border: 1px solid #3a3f4a; border-radius: 999px; background: #252932; color: #e6e8ed; font-size: 10px; font-weight: 800; }
.chip-button:hover { border-color: #727986; }
.meeting-items { min-height: 0; display: grid; align-content: start; gap: 8px; overflow-y: auto; }
.meeting-items-empty { padding: 22px 14px; border: 1px dashed #3e434d; border-radius: 14px; color: #aeb3bd; font-size: 12px; line-height: 1.5; text-align: center; }
.meeting-item { display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 9px; padding: 10px; border: 1px solid #303540; border-radius: 13px; background: #20242c; }
.meeting-item-toggle { width: 27px; height: 27px; display: grid; place-items: center; padding: 0; border: 1px solid #4a505c; border-radius: 9px; background: transparent; color: transparent; }
.meeting-item.is-done .meeting-item-toggle { border-color: var(--green); background: var(--green); color: white; }
.meeting-item.is-done p { color: #8f949e; text-decoration: line-through; }
.meeting-item-toggle svg { width: 15px; height: 15px; }
.meeting-item p { margin: 6px 0 4px; font-size: 12px; line-height: 1.45; }
.meeting-item small { color: #9399a5; font-size: 9px; }
.item-kind { display: inline-flex; width: max-content; padding: 3px 6px; border-radius: 6px; background: rgba(255,255,255,.08); color: #ff8e95; font-size: 8px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.protocol-document { display: grid; gap: 12px; }
.protocol-document > p { margin: 0; color: var(--muted); }
.protocol-document section { padding: 14px; border-radius: 14px; background: var(--soft); }
.protocol-document h3 { margin: 0 0 8px; }
.protocol-document section p, .protocol-document ul { margin: 0; color: #525765; line-height: 1.55; }
.protocol-confirmation { display: grid; gap: 12px; border: 1px solid #ffd3d6; background: #fff8f8 !important; }
.protocol-confirmation .button { width: 100%; }

.call-dock { position: fixed; right: 16px; bottom: 16px; left: 326px; z-index: 80; min-width: 0; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid #303540; border-radius: 18px; background: rgba(22,25,31,.96); color: white; box-shadow: 0 18px 55px rgba(0,0,0,.28); backdrop-filter: blur(16px); }
.call-dock-live { display: flex; align-items: center; gap: 6px; color: #ff858c; font-size: 9px; font-weight: 900; letter-spacing: .1em; }
.call-dock-live span { width: 8px; height: 8px; border-radius: 999px; background: var(--red); box-shadow: 0 0 0 5px rgba(227,6,19,.16); }
.call-dock-copy { min-width: 0; display: grid; gap: 3px; }
.call-dock-copy strong, .call-dock-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-dock-copy small { color: #aeb3bd; font-size: 10px; }
.call-dock-actions { display: flex; align-items: center; gap: 7px; }
.call-dock .icon-button { width: 38px; height: 38px; border-color: #3b404b; background: #262a33; color: white; }
.call-dock .icon-button[aria-pressed="false"] { color: #ff8a91; }
.call-dock .danger-icon { border-color: var(--red); background: var(--red); }
.incoming-call { position: fixed; top: 18px; right: 18px; z-index: 110; width: min(520px, calc(100vw - 36px)); display: grid; grid-template-columns: 48px minmax(0,1fr) auto auto; align-items: center; gap: 11px; padding: 13px; border: 1px solid #ffd0d3; border-radius: 18px; background: white; box-shadow: 0 22px 65px rgba(25,20,23,.18); }
.incoming-call .avatar { width: 48px; height: 48px; }
.incoming-call > div:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.incoming-call strong, .incoming-call small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.incoming-call small { color: var(--muted); font-size: 10px; }

.command-dialog { width: min(720px, calc(100vw - 30px)); margin-top: min(15vh, 130px); overflow: hidden; }
.command-shell > header { display: grid; grid-template-columns: 26px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 15px 18px; }
.command-shell > header input { min-height: 46px; padding: 0; border: 0; border-radius: 0; box-shadow: none; font-size: 17px; }
kbd { display: inline-grid; place-items: center; min-width: 25px; height: 24px; padding: 0 6px; border: 1px solid #d9dce2; border-bottom-width: 2px; border-radius: 6px; background: #f7f8fa; color: #737885; font: 700 10px/1 inherit; }
.command-results { max-height: min(52vh, 460px); display: grid; align-content: start; gap: 4px; padding: 8px; overflow-y: auto; border-top: 1px solid var(--line); }
.command-empty { padding: 35px 18px; color: var(--muted); text-align: center; }
.command-result { width: 100%; min-width: 0; display: grid; grid-template-columns: 38px minmax(0,1fr); align-items: center; gap: 10px; padding: 9px; border: 0; border-radius: 12px; background: white; color: var(--ink); text-align: left; }
.command-result:hover, .command-result:focus-visible { background: var(--soft); }
.command-result > svg, .command-result > img { width: 34px; height: 34px; padding: 7px; border-radius: 10px; background: #fff0f1; color: var(--red); object-fit: cover; }
.command-result > span { min-width: 0; display: grid; gap: 2px; }
.command-result strong, .command-result small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.command-result small { color: var(--muted); font-size: 10px; }
.command-shell > footer { display: flex; justify-content: space-between; padding: 11px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.device-readiness { grid-template-columns: repeat(3, minmax(0,1fr)); }
.device-readiness [data-state="warning"] { background: #fff6df; color: #9c6900; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr) 64px 62px; gap: 6px; padding: 6px; }
  .workspace { grid-column: 1; grid-row: 1; }
  .workspace, .channel-sidebar, .space-rail { border-radius: 20px; }
  .channel-sidebar { grid-column: 1; grid-row: 2; border: 1px solid var(--line); }
  .space-rail, .space-rail:hover, .space-rail:focus-within { grid-column: 1; grid-row: 3; width: auto; min-width: 0; flex-direction: row; align-items: center; padding: 6px 10px; border: 1px solid var(--line); overflow: hidden; box-shadow: none; }
  .space-list { min-width: 0; flex: 1; display: flex; gap: 7px; overflow-x: auto; }
  .rail-logo, .rail-button, .space-button { flex: 0 0 45px; width: 45px; height: 45px; border-radius: 14px; }
  .rail-logo img { width: 39px; }
  .space-button, .space-rail:hover .space-button, .space-rail:focus-within .space-button { width: 45px; margin: 0; padding: 0; }
  .space-button-mark { min-width: 45px; height: 45px; }
  .space-button-label { display: none; }
  .channel-row { grid-template-columns: auto; }
  .channel-favorite { display: none; }
  .overview-grid { grid-template-columns: 1fr; }
  .room-directory-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .overview-card-wide { grid-column: auto; }
  .dashboard-toolbar { min-height: 148px; align-items: stretch; flex-direction: column; padding: 22px; border-radius: 22px; }
  .dashboard-hero-actions { width: 100%; }
  .dashboard-hero-actions .button { flex: 1; }
  .dashboard-intro h2, .dashboard-toolbar h2 { font-size: 30px; }
  .meeting-compact { grid-template-columns: 1fr auto; }
  .meeting-compact time { grid-column: 1 / -1; }
  .smart-invite-grid, .permission-grid, .attendee-picker { grid-template-columns: 1fr; }
  .call-dock { right: 8px; bottom: 134px; left: 8px; grid-template-columns: auto minmax(0,1fr) auto; padding: 9px; border-radius: 16px; }
  .call-dock-live { display: none; }
  .call-dock-copy small { max-width: 32vw; }
  .call-dock-actions { gap: 4px; }
  .call-dock-actions .icon-button, .call-dock-actions .button { width: 34px; height: 34px; min-height: 34px; padding: 0; }
  .call-dock-actions .button span { display: none; }
  .call-dock-actions svg { width: 17px; height: 17px; }
  .incoming-call { top: 8px; right: 8px; left: 8px; width: auto; grid-template-columns: 42px minmax(0,1fr) minmax(0,1fr); }
  .incoming-call .avatar { width: 42px; height: 42px; }
  .incoming-call > div:nth-child(2) { grid-column: 2 / -1; }
  .incoming-call .button.secondary { grid-column: 2; }
  .incoming-call .button.primary { grid-column: 3; }
  .incoming-call .button { min-height: 38px; padding: 0 9px; }
  .meeting-workspace-panel { top: 6px; right: 6px; bottom: 6px; width: calc(100% - 12px); }
  .call-controls { justify-content: flex-start; overflow-x: auto; }
  .control-button { flex: 0 0 58px; }
  .command-dialog { margin-top: 8px; }
  .command-shell > footer { display: none; }
  .device-readiness { grid-template-columns: 1fr; }
  body[data-main-view="home"] .app-shell { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr) 62px; }
  body[data-main-view="home"] .space-rail { grid-row: 2; }
  body:not([data-main-view="home"]) .app-shell { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr) 64px; }
  body:not([data-main-view="home"]) .channel-sidebar,
  body:not([data-main-view="home"]) .channel-sidebar:hover,
  body:not([data-main-view="home"]) .channel-sidebar:focus-within { grid-column: 1; grid-row: 2; width: auto; box-shadow: none; }
  body:not([data-main-view="home"]) .channel-sidebar > header { min-height: 0; display: flex; padding: 8px; border: 0; }
  body:not([data-main-view="home"]) .channel-home-button,
  body:not([data-main-view="home"]) .channel-sidebar:hover .channel-home-button,
  body:not([data-main-view="home"]) .channel-sidebar:focus-within .channel-home-button { min-width: 44px; padding: 0; }
  body:not([data-main-view="home"]) .channel-home-button span,
  body:not([data-main-view="home"]) .channel-sidebar:hover .channel-home-button span,
  body:not([data-main-view="home"]) .channel-sidebar:focus-within .channel-home-button span,
  body:not([data-main-view="home"]) .channel-sidebar-title,
  body:not([data-main-view="home"]) .channel-sidebar > header > .icon-button,
  body:not([data-main-view="home"]) .profile-chip { display: none; }
  body:not([data-main-view="home"]) .channel-list { padding: 8px; }
  body:not([data-main-view="home"]) .channel-group { display: flex; gap: 7px; margin: 0; }
  body:not([data-main-view="home"]) .channel-row,
  body:not([data-main-view="home"]) .channel-sidebar:hover .channel-row,
  body:not([data-main-view="home"]) .channel-sidebar:focus-within .channel-row { display: block; }
  body:not([data-main-view="home"]) .channel-button,
  body:not([data-main-view="home"]) .channel-sidebar:hover .channel-button,
  body:not([data-main-view="home"]) .channel-sidebar:focus-within .channel-button { width: 46px; justify-content: center; padding: 0; border-radius: 14px; }
  body:not([data-main-view="home"]) .channel-button > span,
  body:not([data-main-view="home"]) .channel-sidebar:hover .channel-button > span,
  body:not([data-main-view="home"]) .channel-sidebar:focus-within .channel-button > span,
  body:not([data-main-view="home"]) .channel-favorite { display: none; }
}

@media (max-width: 560px) {
  .auth-panel, .auth-copy, .auth-form-wrap, .auth-form { min-width: 0; max-width: 100%; }
  .auth-copy { min-height: 168px; padding: 20px; }
  .auth-copy::after { right: 20px; bottom: 11px; left: 20px; }
  .auth-copy h1 { margin: 9px 0; font-size: 34px; }
  .auth-copy p { max-width: 340px; font-size: 12px; }
  .auth-lines { font-size: 24px; }
  .auth-form-wrap { width: 100%; padding: 25px max(16px, env(safe-area-inset-right)) 34px max(16px, env(safe-area-inset-left)); overflow-x: hidden; }
  .auth-form { gap: 14px; }
  .auth-form h2 { font-size: 34px; }
  .avatar-choice { width: 50px; height: 50px; border-radius: 16px; }
  .avatar-choice img { border-radius: 12px; }
  .workspace-header { padding: 10px; }
  .workspace-header .eyebrow { display: none; }
  .workspace-header h1 { margin: 0; font-size: 16px; }
  .header-actions { max-width: 60%; overflow-x: auto; scrollbar-width: none; }
  .content-scroll { padding: 10px; }
  .dashboard-toolbar { min-height: 174px; padding: 21px 19px 25px; border-radius: 22px; }
  .dashboard-toolbar h2 { font-size: 32px; }
  .dashboard-hero-actions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-hero-actions .button { min-width: 0; padding: 0 10px; font-size: 11px; }
  .room-directory-section { padding: 16px; border-radius: 20px; }
  .room-directory-heading h2 { font-size: 21px; }
  .room-directory-grid, .room-directory-empty { grid-template-columns: 1fr; }
  .room-directory-empty .button { width: 100%; }
  .overview-card { padding: 17px; border-radius: 22px; }
  .action-grid .card { padding: 18px; }
  .meeting-compact { gap: 8px; }
  .member-row { flex-wrap: wrap; }
  .member-row > span { min-width: calc(100% - 52px); }
  .invite-registry-row { grid-template-columns: 1fr; }
  .modal-actions { align-items: stretch; flex-direction: column-reverse; }
  .modal-actions .button { width: 100%; }
  .prejoin-preview-controls { flex-direction: column; position: relative; inset: auto; padding: 12px; }
  .prejoin-preview { display: grid; grid-template-rows: minmax(140px,1fr) auto; max-height: none; }
  .prejoin-placeholder { position: relative; min-height: 140px; padding: 12px; }
  .prejoin-preview video { min-height: 0; max-height: 210px; }
  .prejoin-preview-controls .device-toggle { width: 100%; }
  .message-list { padding: 16px 12px; }
  .message-composer { grid-template-columns: 1fr; padding: 10px; }
  .call-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 8px; overflow: visible; }
  .control-button { width: 100%; min-width: 0; min-height: 48px; border-radius: 14px; }
  .call-network-badge { top: 8px; left: 8px; max-width: calc(100% - 16px); }
  .network-mode-option { padding: 12px; }
}

/* One navigation rail: rooms live here, spaces live on the home screen. */
.channel-sidebar { display: none !important; }
body[data-main-view] .app-shell,
body[data-main-view="home"] .app-shell,
body:not([data-main-view="home"]) .app-shell { grid-template-columns: 64px minmax(0, 1fr) auto; }
body:not([data-main-view="home"]) .space-rail { display: flex; }
.room-rail-button .space-button-mark svg { width: 20px; height: 20px; }

@media (max-width: 900px) {
  body[data-main-view] .app-shell,
  body[data-main-view="home"] .app-shell,
  body:not([data-main-view="home"]) .app-shell { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr) 62px; }
  body[data-main-view] .space-rail,
  body:not([data-main-view="home"]) .space-rail { grid-column: 1; grid-row: 2; display: flex; }
}

/* Refined workspace navigation */
.app-shell { transition: grid-template-columns .2s ease; }
.space-list { flex: 1; }
.room-rail-button.voice-start { margin-top: 20px; overflow: visible; }
.room-rail-button.voice-start::before { content: ""; position: absolute; top: -11px; left: 7px; width: 32px; height: 1px; background: var(--line); transition: width .2s ease; }
.space-rail:hover .room-rail-button.voice-start::before,
.space-rail:focus-within .room-rail-button.voice-start::before { width: calc(100% - 14px); }
.rail-profile { width: 46px; min-height: 46px; display: grid; grid-template-columns: 46px 1fr 38px; align-items: center; gap: 9px; margin-top: auto; overflow: hidden; }
.rail-profile .avatar { width: 46px; height: 46px; flex: 0 0 46px; }
.rail-profile-copy { min-width: 0; display: grid; gap: 2px; opacity: 0; white-space: nowrap; }
.rail-profile-copy strong, .rail-profile-copy small { overflow: hidden; text-overflow: ellipsis; }
.rail-profile-copy small { color: var(--green); font-size: 10px; }
.rail-profile .icon-button { width: 38px; height: 38px; opacity: 0; }
.space-rail:hover .rail-profile, .space-rail:focus-within .rail-profile { width: 100%; }
.space-rail:hover .rail-profile-copy, .space-rail:focus-within .rail-profile-copy,
.space-rail:hover .rail-profile .icon-button, .space-rail:focus-within .rail-profile .icon-button { opacity: 1; }

@media (min-width: 901px) {
  body[data-main-view] .app-shell:has(> .space-rail:hover),
  body[data-main-view] .app-shell:has(> .space-rail:focus-within) { grid-template-columns: 216px minmax(0, 1fr) auto; }
  .space-rail:hover, .space-rail:focus-within { width: 100%; }
}

/* Telegram-like compact chat */
.chat-view { background: #eceee9; }
.message-list { display: flex; flex-direction: column; gap: 7px; padding: 22px clamp(18px, 5vw, 72px); background-color: #eceee9; background-image: radial-gradient(rgba(26,28,31,.045) .8px, transparent .8px); background-size: 17px 17px; }
.message { width: fit-content; max-width: min(72%, 680px); display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 8px; margin: 0; }
.message > .avatar { width: 34px; height: 34px; align-self: end; border-radius: 50%; }
.message-body { padding: 9px 12px 8px; border: 1px solid #dfe1dc; border-radius: 16px 16px 16px 5px; background: white; box-shadow: 0 2px 5px rgba(25,28,32,.05); }
.message-meta { gap: 7px; }
.message-meta strong { font-size: 11px; color: #ca1020; }
.message-meta time { margin-left: auto; font-size: 9px; }
.message-body p { margin-top: 2px; font-size: 14px; line-height: 1.38; }
.message-own { align-self: flex-end; grid-template-columns: minmax(0,1fr); }
.message-own > .avatar { display: none; }
.message-own .message-body { border-color: #f4c9cc; border-radius: 16px 16px 5px 16px; background: #ffe8ea; }
.message-own .message-meta strong { display: none; }
.message-composer { margin: 10px clamp(10px, 3vw, 36px) 14px; padding: 7px; border: 1px solid #dadcd7; border-radius: 22px; box-shadow: 0 10px 25px rgba(25,28,32,.08); }
.message-composer input { border: 0; box-shadow: none; }
.message-composer .button { min-width: 112px; }

/* Account settings: compact Telegram-inspired master/detail page */
.settings-view { min-height: 0; overflow: auto; padding: clamp(14px,3vw,34px); background: #f3f3ef; }
.settings-shell { width: min(1120px,100%); min-height: 100%; display: grid; grid-template-columns: 300px minmax(0,1fr); align-items: start; gap: 16px; margin: 0 auto; }
.settings-navigation, .settings-content { border: 1px solid var(--line); border-radius: 24px; background: white; }
.settings-navigation { position: sticky; top: 0; overflow: hidden; }
.settings-back { width: 100%; min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 17px; border: 0; border-bottom: 1px solid var(--line); background: white; color: var(--ink); font: inherit; font-size: 12px; font-weight: 850; cursor: pointer; }
.settings-back:hover { background: var(--soft); }
.settings-back svg { width: 18px; height: 18px; }
.settings-profile-card { display: flex; align-items: center; gap: 13px; padding: 18px; border-bottom: 1px solid var(--line); }
.settings-profile-avatar { width: 58px; height: 58px; flex: 0 0 58px; overflow: hidden; border-radius: 18px; background: var(--soft); }
.settings-profile-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.settings-profile-card > div:last-child { min-width: 0; display: grid; gap: 3px; }
.settings-profile-card strong, .settings-profile-card span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-profile-card strong { font-size: 15px; }
.settings-profile-card span { color: var(--muted); font-size: 10px; }
.settings-navigation-list { display: grid; gap: 3px; padding: 8px; }
.settings-navigation-item { width: 100%; min-height: 62px; display: grid; grid-template-columns: 38px minmax(0,1fr); align-items: center; gap: 9px; padding: 8px 10px; border: 0; border-radius: 15px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.settings-navigation-item:hover { background: var(--soft); }
.settings-navigation-item.is-active { background: #111318; color: white; }
.settings-navigation-item > svg { width: 19px; height: 19px; justify-self: center; }
.settings-navigation-item > span { min-width: 0; display: grid; gap: 3px; }
.settings-navigation-item strong { font-size: 12px; }
.settings-navigation-item small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.settings-navigation-item.is-active small { color: #b9bdc7; }
.settings-content { min-height: 560px; padding: clamp(22px,4vw,42px); }
.settings-section-heading { margin-bottom: 24px; }
.settings-section-heading h2 { margin: 8px 0 8px; font-size: clamp(30px,4vw,46px); line-height: .98; letter-spacing: -.05em; }
.settings-section-heading p { max-width: 620px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.settings-card { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: white; }
.settings-profile-form-card { padding: 22px; }
.settings-profile-form-card .profile-settings-form { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.settings-profile-form-card .profile-settings-form > fieldset,
.settings-profile-form-card .profile-settings-form > button { grid-column: 1 / -1; }
.settings-profile-form-card fieldset { margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 18px; }
.settings-profile-form-card legend { padding: 0 7px; font-size: 11px; font-weight: 850; }
.settings-profile-form-card .button { justify-self: start; min-width: 190px; }
.settings-info-row { min-height: 78px; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 13px 17px; border-bottom: 1px solid var(--line); }
.settings-info-row:last-of-type { border-bottom: 0; }
.settings-info-row > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: var(--soft); color: var(--red); }
.settings-info-row > span svg { width: 19px; height: 19px; }
.settings-info-row > div { min-width: 0; display: grid; gap: 3px; }
.settings-info-row strong { font-size: 12px; }
.settings-info-row small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.settings-info-row > b { padding: 7px 10px; border-radius: 999px; background: #edf7f2; color: var(--green); font-size: 9px; white-space: nowrap; }
.settings-danger-button { margin: 16px; border: 1px solid #ffd1d4; background: #fff4f4; color: var(--red); }
body[data-main-view="settings"] .header-actions > button:not(#logout-button) { display: none; }

/* Plans and account administration */
.plans-view, .admin-view { min-height: 0; overflow: auto; padding: clamp(18px,3vw,38px); background: #f3f3ef; }
.plans-content, .admin-content { width: min(1180px,100%); margin: 0 auto; }
.plans-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.plans-hero h2 { margin: 8px 0; font-size: clamp(34px,5vw,58px); line-height: .94; letter-spacing: -.055em; }
.plans-hero p { max-width: 650px; margin: 0; color: var(--muted); line-height: 1.55; }
.plans-back { flex: 0 0 auto; }
.plans-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.plan-card { min-height: 430px; display: flex; flex-direction: column; padding: 24px; border: 1px solid var(--line); border-radius: 26px; background: white; }
.plan-card.is-featured { border-color: #ff9ca3; box-shadow: 0 22px 55px rgba(227,6,19,.1); }
.plan-card.is-current { box-shadow: inset 0 0 0 2px var(--ink); }
.plan-badge { align-self: flex-start; padding: 7px 10px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.plan-card.is-featured .plan-badge { background: var(--red); color: white; }
.plan-card h3 { margin: 27px 0 12px; font-size: 31px; letter-spacing: -.04em; }
.plan-price { display: grid; gap: 3px; }
.plan-price strong { font-size: 28px; }
.plan-price span { color: var(--muted); font-size: 10px; }
.plan-features { display: grid; gap: 12px; margin: 26px 0; padding: 0; list-style: none; }
.plan-features li { position: relative; padding-left: 21px; font-size: 12px; line-height: 1.45; }
.plan-features li::before { content: '✓'; position: absolute; left: 0; color: var(--red); font-weight: 900; }
.plan-card > .button { width: 100%; margin-top: auto; }
.plans-note { display: grid; gap: 5px; margin-top: 14px; padding: 18px 20px; border-radius: 20px; background: var(--ink); color: white; }
.plans-note p { margin: 0; color: #bfc3cb; font-size: 11px; line-height: 1.5; }
.admin-user-list { display: grid; gap: 8px; }
.admin-user-row { display: grid; grid-template-columns: minmax(220px,1fr) 150px auto auto auto; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 20px; background: white; }
.admin-user-row[data-requested-plan] { border-color: #f2aaaf; box-shadow: inset 4px 0 var(--red); }
.admin-user-identity { min-width: 0; display: flex; align-items: center; gap: 11px; }
.admin-user-identity img { width: 44px; height: 44px; border-radius: 14px; object-fit: cover; }
.admin-user-identity > div { min-width: 0; display: grid; gap: 3px; }
.admin-user-identity strong, .admin-user-identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-identity small { color: var(--muted); font-size: 9px; }
.admin-user-row select { min-height: 40px; }
.admin-toggle { display: flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.admin-toggle input { width: 17px; height: 17px; accent-color: var(--red); }
body[data-main-view="plans"] .header-actions > button:not(#logout-button), body[data-main-view="admin"] .header-actions > button:not(#logout-button) { display: none; }

/* Icon-first call controls */
.call-controls { gap: 8px; padding: 10px; }
.call-controls .control-button { min-width: 50px; width: 50px; height: 50px; padding: 0; border-radius: 16px; }
.call-controls .control-button span { display: none; }
.call-controls .control-button svg { width: 21px; height: 21px; }
.workspace-header { min-height: 64px; }
.header-actions { gap: 6px; }
.header-actions .button { width: 42px; min-height: 42px; padding: 0; }
.header-actions .button span { display: none; }
.call-network-badge { display: none; }

/* Movable background-call bubble */
.call-dock { position: fixed; right: 28px; bottom: 28px; left: auto; z-index: 180; width: 154px; height: 154px; display: block; padding: 0; border: 0; border-radius: 50%; background: transparent; color: white; box-shadow: none; overflow: visible; touch-action: none; }
.call-bubble-preview { position: relative; width: 154px; height: 154px; display: block; padding: 0; overflow: hidden; border: 4px solid white; border-radius: 50%; background: #17191f; box-shadow: 0 18px 50px rgba(0,0,0,.3), 0 0 0 1px rgba(0,0,0,.12); cursor: grab; }
.call-bubble-preview:active { cursor: grabbing; }
.call-bubble-preview video, .call-bubble-preview > img { width: 100%; height: 100%; object-fit: cover; }
.call-bubble-preview video { transform: none; }
.call-bubble-caption { position: absolute; right: 9px; bottom: 9px; left: 9px; display: grid; gap: 1px; padding: 6px 8px; border-radius: 999px; background: rgba(10,12,16,.74); color: white; backdrop-filter: blur(8px); pointer-events: none; }
.call-bubble-caption strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.call-bubble-caption time { font-size: 8px; color: #d5d8de; }
.call-dock-actions { position: absolute; top: 50%; right: calc(100% + 10px); display: flex; gap: 6px; padding: 6px; transform: translate(12px,-50%) scale(.94); border: 1px solid rgba(255,255,255,.13); border-radius: 999px; background: rgba(18,20,26,.94); box-shadow: 0 14px 35px rgba(0,0,0,.28); opacity: 0; pointer-events: none; transition: opacity .16s ease, transform .16s ease; backdrop-filter: blur(14px); }
.call-dock:hover .call-dock-actions, .call-dock:focus-within .call-dock-actions { opacity: 1; pointer-events: auto; transform: translate(0,-50%) scale(1); }
.call-dock .call-dock-actions .icon-button { width: 38px; height: 38px; border-color: #3b404b; background: #262a33; color: white; }
.call-dock .call-dock-actions .icon-button[aria-pressed="false"] { color: #ff8a91; }
.call-dock .call-dock-actions .danger-icon { border-color: var(--red); background: var(--red); }

/* Distraction-free whiteboard */
.whiteboard-view { height: 100%; min-height: 0; grid-template-rows: minmax(0,1fr); overflow: hidden; }
body[data-board-open="true"][data-main-view="call"] .workspace { grid-template-rows: minmax(0,1fr); }
body[data-board-open="true"][data-main-view="call"] .workspace-header { display: none; }
body[data-board-open="true"] .call-view { grid-row: 1; min-height: 0; height: 100%; }
body[data-board-open="true"] .call-stage { min-height: 0; overflow: hidden; }
.whiteboard-header { position: absolute; top: 12px; right: 12px; z-index: 6; min-height: 0; padding: 6px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.9); box-shadow: 0 10px 28px rgba(20,20,20,.1); }
.whiteboard-header > div:first-child { display: none; }
.whiteboard-header-actions { gap: 5px; }
.whiteboard-header-actions .icon-button { width: 40px; height: 40px; }
.whiteboard-body { height: 100%; min-height: 0; grid-template-columns: 66px minmax(0,1fr) 92px; overflow: hidden; }
.whiteboard-tools { justify-content: flex-start; gap: 6px; padding: 12px 8px; border: 0; background: rgba(255,255,255,.94); box-shadow: 8px 0 25px rgba(20,20,20,.05); scrollbar-width: none; }
.whiteboard-tools::-webkit-scrollbar { display: none; }
.whiteboard-tool { min-height: 46px; height: 46px; border-radius: 14px; }
.whiteboard-tool span { display: none; }
.whiteboard-color { width: 40px; min-width: 40px; height: 40px; min-height: 40px; aspect-ratio: 1; padding: 3px; border-radius: 50%; }
.whiteboard-color::-webkit-color-swatch-wrapper { padding: 0; }
.whiteboard-canvas-wrap { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.whiteboard-participants { padding-top: 70px; border-left: 0; background: rgba(255,255,255,.86); box-shadow: -8px 0 25px rgba(20,20,20,.04); }
.whiteboard-participant { width: 64px; min-width: 64px; min-height: 64px; cursor: grab; }
.whiteboard-participant video.mirror-camera { transform: none; }
#whiteboard-canvas[data-tool="select"] { cursor: default; }
#whiteboard-canvas[data-tool="eraser"] { cursor: not-allowed; }
.shortcut-list { display: grid; gap: 4px; }
.shortcut-list p { display: grid; grid-template-columns: minmax(92px,auto) 1fr; align-items: center; gap: 14px; margin: 0; padding: 9px 0; border-bottom: 1px solid var(--line); }
.shortcut-list kbd { justify-self: start; padding: 5px 8px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 7px; background: var(--soft); font: 700 12px/1 system-ui,sans-serif; }
#whiteboard-redo svg { transform: scaleX(-1); }

@media (max-width: 900px) {
  .call-controls { display: flex; flex-wrap: nowrap; justify-content: flex-start; gap: 4px; padding: 8px 4px; overflow-x: auto; }
  .call-controls .control-button { flex: 1 0 40px; min-width: 40px; width: 40px; height: 44px; min-height: 44px; border-radius: 13px; }
  .rail-profile, .space-rail:hover .rail-profile, .space-rail:focus-within .rail-profile { position: relative; display: block; width: 42px; min-width: 42px; height: 42px; min-height: 42px; margin: 0; }
  .rail-profile .avatar { width: 42px; height: 42px; }
  .rail-profile-copy { display: none; }
  .rail-profile .icon-button { position: absolute; inset: 0; width: 42px; height: 42px; opacity: 1; border: 0; background: transparent; }
  .rail-profile .icon-button svg { opacity: 0; }
  .room-rail-button.voice-start { margin-top: 0; margin-left: 18px; }
  .room-rail-button.voice-start::before { top: 7px; left: -10px; width: 1px; height: 32px; }
  .message { max-width: 88%; }
  .call-dock { right: 16px; bottom: 82px; left: auto; width: 112px; height: 112px; }
  .call-bubble-preview { width: 112px; height: 112px; border-width: 3px; }
  .call-dock-actions { right: 50%; top: auto; bottom: calc(100% + 8px); transform: translate(50%,10px) scale(.94); }
  .call-dock:hover .call-dock-actions, .call-dock:focus-within .call-dock-actions { transform: translate(50%,0) scale(1); }
  .call-dock .call-dock-actions .icon-button { width: 34px; height: 34px; }
  .whiteboard-view { position: absolute; inset: 0; height: 100%; }
  .whiteboard-body { grid-template-columns: 1fr; }
  .whiteboard-header { top: 82px; right: 8px; padding: 5px; border-radius: 18px; }
  .whiteboard-header-actions { flex-direction: column; }
  .whiteboard-header-actions .icon-button { width: 38px; height: 38px; }
  .whiteboard-tools { padding-right: 8px; }
  .whiteboard-participants { height: 74px; min-height: 0; box-sizing: border-box; align-items: center; padding: 6px 10px; overflow-x: auto; overflow-y: hidden; }
  .settings-view { padding: 8px; }
  .settings-shell { grid-template-columns: 1fr; gap: 8px; }
  .settings-navigation { position: static; border-radius: 19px; }
  .settings-navigation-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .settings-navigation-item { min-height: 54px; grid-template-columns: 1fr; place-items: center; padding: 8px 4px; text-align: center; }
  .settings-navigation-item > span { display: grid; }
  .settings-navigation-item small { display: none; }
  .settings-navigation-item strong { font-size: 11px; }
  .settings-profile-card { padding: 12px 14px; }
  .settings-profile-avatar { width: 48px; height: 48px; flex-basis: 48px; border-radius: 15px; }
  .settings-content { min-height: 0; padding: 20px 14px; border-radius: 19px; }
  .settings-section-heading h2 { font-size: 31px; }
  .settings-profile-form-card { padding: 14px; }
  .settings-profile-form-card .profile-settings-form { grid-template-columns: 1fr; }
  .settings-profile-form-card .profile-settings-form > * { grid-column: 1; }
  .settings-profile-form-card .button { width: 100%; }
  .settings-info-row { grid-template-columns: 38px minmax(0,1fr); padding: 12px; }
  .settings-info-row > b { grid-column: 2; justify-self: start; }
  .plans-view, .admin-view { padding: 14px 8px; }
  .plans-hero { align-items: stretch; flex-direction: column; }
  .plans-hero h2 { font-size: 39px; }
  .plans-back { align-self: flex-start; }
  .plans-grid { grid-template-columns: 1fr; }
  .plan-card { min-height: 0; }
  .admin-user-row { grid-template-columns: 1fr 1fr; }
  .admin-user-identity { grid-column: 1 / -1; }
  .admin-user-row .compact-action { grid-column: 1 / -1; width: 100%; }
}

.rail-logo { background: #f2f2ee; color: var(--ink); }
.rail-logo svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.home-plan-entry { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; padding: 18px 22px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.home-plan-entry p { margin: 5px 0 0; font-size: 13px; color: var(--muted); }
.home-plan-entry .button { flex-shrink: 0; }
.account-management { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-bottom: 16px; }
.account-management #logout-button { color: var(--red); }
.header-actions { overflow: visible; max-width: none; }
.workspace-header { position: relative; z-index: 12; }
.workspace-menu { position: relative; }
.workspace-menu > summary { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; list-style: none; cursor: pointer; letter-spacing: 2px; }
.workspace-menu > summary::-webkit-details-marker { display: none; }
.workspace-menu[open] > summary { background: var(--soft); }
.workspace-menu-items { position: absolute; right: 0; top: calc(100% + 8px); width: min(260px,calc(100vw - 30px)); padding: 8px; display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: 0 12px 36px #0002; }
.header-actions .workspace-menu-items .button { width: 100%; padding: 12px; justify-content: flex-start; text-align: left; border: 0; border-radius: 10px; min-height: 44px; }
.header-actions .workspace-menu-items .button span { display: inline; }
body[data-main-view="settings"] .workspace-menu, body[data-main-view="plans"] .workspace-menu, body[data-main-view="admin"] .workspace-menu { display: none; }
.logout-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.invite-presets { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.invite-preset { text-align: left; display: grid; gap: 6px; padding: 16px 12px; border: 1px solid var(--line); border-radius: 14px; background: white; color: var(--ink); cursor: pointer; font: inherit; }
.invite-preset small { color: var(--muted); line-height: 1.4; font-size: 12px; }
.invite-preset[aria-pressed="true"] { border-color: var(--red); background: #fff5f5; }
.invite-scenario-note { margin: 0; padding: 14px; border-radius: 12px; background: var(--soft); line-height: 1.5; font-size: 14px; }
.invite-advanced { border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.invite-advanced > summary { cursor: pointer; font-weight: 650; font-size: 14px; }
.invite-advanced[open] > summary { margin-bottom: 18px; }
.invite-advanced .permission-grid { margin-top: 18px; }
@media (max-width: 600px) {
  .home-plan-entry { padding: 14px; gap: 12px; align-items: flex-start; }
  .home-plan-entry strong { font-size: 14px; }
  .home-plan-entry p { font-size: 12px; }
  .home-plan-entry .button { padding: 10px 12px; min-height: 42px; font-size: 12px; }
  .home-plan-entry .button svg { display: none; }
  .invite-presets { gap: 5px; }
  .invite-preset { padding: 12px 8px; font-size: 13px; }
  .invite-preset small { font-size: 11px; }
  .account-management { justify-content: flex-start; }
  .account-management .button { font-size: 12px; padding: 10px 12px; }
}

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