
/* MBS Platform. Airy blue palette; auth layout based on the MBS UI kit. */
:root {
  --mbs-brand:#0877bd; --mbs-muted:#68717d; --mbs-line:#e3e7ec;
  --bg-primary:#f8f9fb; --bg-secondary:#f1f3f5; --bg-elevated:#fff;
  --bg-hover:#f1f3f5; --bg-selected:#eaf5fe; --bg-selected-hover:#dcefff;
  --text-primary:#222831; --text-secondary:#3b4048; --text-muted:#68717d; --text-subtle:#68717d;
  --border-primary:#cbd1d9; --border-secondary:#e3e7ec; --border-accent:#99cef0;
  --input-border:#cbd1d9; --accent:#06669f; --accent-solid:#0877bd; --accent-solid-hover:#06669f;
  --accent-soft:#eaf5fe; --focus-ring:#0877bd; --focus-bg:#eaf5fe;
  --sidebar-bg:#fff; --sidebar-border:#e3e7ec; --sidebar-text:#222831;
  --sidebar-muted:#68717d; --sidebar-hover:#f1f3f5; --sidebar-active:#eaf5fe;
}
:root[data-theme=dark] {
  --mbs-brand:#8dc9f4; --mbs-muted:#a6aeb9; --mbs-line:#343941;
  --bg-primary:#141619; --bg-secondary:#191c20; --bg-elevated:#1d2025;
  --bg-hover:#292d33; --bg-selected:#142f46; --bg-selected-hover:#1c3d58;
  --text-primary:#edf0f4; --text-secondary:#cbd1d9; --text-muted:#a6aeb9; --text-subtle:#a6aeb9;
  --border-primary:#515861; --border-secondary:#343941; --border-accent:#5aa7db;
  --input-bg:#191c20; --input-border:#515861; --modal-bg:#1d2025;
  --accent:#8dc9f4; --accent-solid:#0877bd; --accent-solid-hover:#06669f;
  --accent-soft:#142f46; --focus-ring:#8dc9f4; --focus-bg:#142f46;
  --sidebar-bg:#1d2025; --sidebar-border:#343941; --sidebar-text:#edf0f4;
  --sidebar-muted:#a6aeb9; --sidebar-hover:#292d33; --sidebar-active:#142f46;
}
.brand-lockup { font-family:Inter,Arial,sans-serif; letter-spacing:0; gap:11px; }
.brand-lockup .brand-logo { flex:0 0 38px; width:38px; height:38px; }
.brand-lockup .brand-wordmark { font-weight:700; letter-spacing:0; }
.brand-icon { background:center/contain no-repeat url('/mbs-icon.svg'); }
.brand-icon>* { visibility:hidden; }
.auth-landing {
  display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  align-items:stretch; justify-content:stretch; gap:0; padding:0;
  position:relative; min-height:100svh; background:var(--bg-elevated);
}
:root[data-theme=dark] .auth-landing { background:var(--bg-elevated); color:var(--text-primary); }
.auth-landing .auth-card {
  grid-column:1; grid-row:1; justify-self:center; align-self:center;
  width:min(440px,calc(100% - 96px)); margin:128px 0;
  padding:0; text-align:left; border:0; border-radius:0;
  background:transparent; box-shadow:none;
}
:root[data-theme=dark] .auth-landing .auth-card { background:transparent; border:0; }
.auth-landing .auth-card>.brand-lockup {
  display:inline-flex; position:absolute; top:32px; left:48px;
  width:auto; color:var(--text-primary); font-size:20px;
}
.auth-landing .auth-card>.brand-lockup .brand-wordmark { font-size:20px; }
.auth-landing .auth-card h1 {
  font-size:30px; line-height:1.3; font-weight:600; letter-spacing:-.035em;
  margin:0 0 12px; color:var(--text-primary);
}
.auth-landing .auth-card>.muted {
  margin:0; color:var(--text-muted); font-size:14px; line-height:1.7;
}
.auth-landing .auth-card form { gap:22px; margin-top:32px; }
.auth-landing .auth-card label { gap:8px; color:var(--text-primary); font-size:14px; font-weight:500; }
.auth-landing .auth-card input {
  min-height:48px; padding:12px 14px; border:1px solid var(--input-border);
  border-radius:8px; background:var(--input-bg,var(--bg-elevated));
  color:var(--text-primary); font:inherit; transition:border-color .15s,box-shadow .15s;
}
.auth-landing .auth-card input:focus { border-color:var(--focus-ring); box-shadow:0 0 0 3px var(--accent-soft); }
.auth-landing .auth-card .primary-button {
  min-height:48px; margin:4px 0 0; padding:12px 18px; border:1px solid #0877bd;
  border-radius:8px; background:#0877bd; color:#fff; font-size:14px; font-weight:600;
  box-shadow:0 1px 2px #17212b08; cursor:pointer;
}
.auth-landing .auth-card .primary-button:hover:not(:disabled) { background:#06669f; border-color:#06669f; }
.auth-landing .auth-card .primary-button:focus-visible { outline:2px solid var(--focus-ring); outline-offset:3px; }
.auth-landing .auth-card .primary-button:disabled { opacity:.6; cursor:wait; }
.auth-landing .auth-card .error-banner { border-radius:8px; font-size:13px; line-height:1.5; }
.auth-landing .auth-switch { color:var(--accent); padding-top:18px; }
.auth-landing .auth-welcome {
  position:relative; isolation:isolate; grid-column:2; grid-row:1;
  display:flex; align-items:center; justify-content:center; flex-direction:column;
  min-height:100svh; width:100%; max-width:none; overflow:hidden;
  padding:72px 56px; background:#edf7ff; color:#fff; text-align:center;
}
:root[data-theme=dark] .auth-landing .auth-welcome { background:#10283b; }
.auth-welcome::before,.auth-welcome::after {
  content:""; position:absolute; z-index:-1; width:410px; height:410px; pointer-events:none;
  background-image:linear-gradient(#a9d6f51a 1px,transparent 1px),linear-gradient(90deg,#a9d6f51a 1px,transparent 1px);
  background-size:42px 42px;
}
.auth-welcome::before { top:-1px; right:-1px; mask-image:linear-gradient(225deg,#000,transparent 75%); }
.auth-welcome::after { bottom:-1px; left:-1px; mask-image:linear-gradient(45deg,#000,transparent 75%); }
.auth-landing .auth-welcome>.brand-lockup {
  width:auto; justify-content:center; margin:0 0 48px; gap:16px; color:#fff;
}
.auth-welcome>.brand-lockup .brand-logo { flex:0 0 56px; width:56px; height:56px; }
.auth-welcome>.brand-lockup .brand-icon { width:56px; height:56px; }
.auth-welcome>.brand-lockup .brand-wordmark { font-size:30px; font-weight:600; }
.auth-welcome-copy { max-width:480px; }
.auth-welcome .auth-eyebrow { color:#397ca9; font-size:11px; font-weight:600; letter-spacing:.12em; }
.auth-welcome h2 { margin:20px 0; font-size:clamp(32px,3vw,44px); line-height:1.16; font-weight:600; letter-spacing:-.04em; }
.auth-welcome h2 em { color:#0877bd; }
.auth-welcome-copy p { max-width:440px; margin:0 auto; font-size:15px; line-height:1.8; color:#52718a; }
:root[data-theme=dark] .auth-welcome-copy p { color:#52718a; }
.auth-landing .auth-channel-scene,.auth-landing .auth-ui-preview { display:none; }
.auth-welcome .auth-welcome-note { margin:48px 0 0; max-width:390px; font-size:12px; line-height:1.7; color:#64869f; }
@media(max-width:1100px) {
  .auth-landing .auth-welcome { padding:56px 32px; }
  .auth-landing .auth-card { width:calc(100% - 80px); max-width:420px; }
  .auth-landing .auth-card>.brand-lockup { left:40px; }
  .auth-landing .auth-card h1 { font-size:27px; }
}
@media(max-width:1023px) {
  .auth-landing { display:flex; align-items:center; justify-content:center; padding:104px 24px 40px; min-height:100svh; }
  .auth-landing .auth-welcome { display:none; }
  .auth-landing .auth-card { width:min(440px,100%); max-width:440px; margin:48px 0; padding:0; }
  .auth-landing .auth-card>.brand-lockup { top:28px; left:24px; font-size:20px; }
  .auth-landing .auth-card h1 { font-size:30px; }
}
@media(max-width:420px) {
  .auth-landing { padding:96px 20px 32px; }
  .auth-landing .auth-card { margin:24px 0; }
  .auth-landing .auth-card>.brand-lockup { top:24px; left:20px; }
  .auth-landing .auth-card>.brand-lockup .brand-wordmark { font-size:18px; }
  .auth-landing .auth-card>.brand-lockup .brand-logo { flex-basis:34px; width:34px; height:34px; }
  .auth-landing .auth-card h1 { font-size:27px; }
}
@media(prefers-reduced-motion:reduce) { .auth-landing * { transition:none!important; animation:none!important; } }

:root[data-theme=dark] .auth-landing .auth-welcome h2 em { color:#0877bd; }
:root[data-theme=dark] .auth-landing .auth-eyebrow { color:#397ca9; }
:root[data-theme=dark] .auth-landing .auth-welcome-note { color:#64869f; }
.auth-landing { height:100svh; overflow-y:auto; }

/* Soft sky and cloud layers. No motion or decorative UI controls. */
:root {
  --bg-primary:#f6f9fd; --bg-secondary:#f1f6fb; --bg-hover:#f1f7fd;
  --bg-selected:#eaf5fe; --bg-selected-hover:#dcefff;
  --text-primary:#203248; --text-secondary:#455f77; --text-muted:#657d92;
  --border-secondary:#e3edf5; --border-primary:#cbddea; --input-border:#cbddea;
}
.auth-landing .auth-card input { border-radius:11px; border-color:#ccdfed; }
.auth-landing .auth-card .primary-button { border-radius:11px; background:#0877bd; border-color:#0877bd; box-shadow:0 3px 10px #0877bd12; }
.auth-landing .auth-card .primary-button:hover:not(:disabled) { background:#06669f; border-color:#06669f; }
.auth-landing .auth-card h1 { font-weight:550; letter-spacing:-.035em; }
.auth-landing .auth-welcome { background:linear-gradient(160deg,#e6f3ff 0%,#eff8ff 58%,#f8fcff 100%); color:#234e72; }
.auth-landing .auth-welcome>.brand-lockup { color:#234e72; }
.auth-welcome::before {
  width:950px; height:600px; right:-260px; top:-180px; left:auto; bottom:auto;
  mask-image:none; opacity:.95; filter:blur(2px);
  background:radial-gradient(ellipse 32% 20% at 28% 40%,#ffffffc9 0%,#ffffff80 55%,transparent 75%),
             radial-gradient(ellipse 40% 25% at 67% 35%,#ffffffc9 0%,#ffffff80 52%,transparent 75%);
}
.auth-welcome::after {
  width:1100px; height:500px; left:-200px; bottom:-210px; top:auto;
  mask-image:none; opacity:.9; filter:blur(1px);
  background:radial-gradient(ellipse 30% 30% at 18% 50%,#fff 0%,#ffffffb0 58%,transparent 78%),
             radial-gradient(ellipse 35% 40% at 50% 60%,#fff 0%,#ffffffb0 58%,transparent 78%),
             radial-gradient(ellipse 35% 30% at 83% 50%,#fff 0%,#ffffffb0 58%,transparent 78%);
}
.auth-welcome h2 { font-weight:500; }
.auth-welcome .auth-eyebrow { color:#397ca9; }
.auth-welcome h2 em { color:#0877bd; }
.auth-welcome-copy p { color:#52718a; }
.auth-welcome .auth-welcome-note { color:#64869f; }
:root[data-theme=dark] {
  --bg-primary:#111a24; --bg-secondary:#141f2c; --bg-elevated:#182331;
  --text-primary:#edf4fb; --text-secondary:#c0d1e2; --text-muted:#a0b6ca;
  --border-primary:#4b657d; --border-secondary:#2d4357; --input-border:#4b657d;
  --sidebar-bg:#182331; --sidebar-border:#2d4357; --sidebar-text:#edf4fb; --sidebar-muted:#a0b6ca;
}
:root[data-theme=dark] .auth-landing .auth-welcome { background:linear-gradient(160deg,#10283b,#152f47); color:#e1f0fc; }
:root[data-theme=dark] .auth-landing .auth-welcome>.brand-lockup { color:#e1f0fc; }
:root[data-theme=dark] .auth-landing .auth-welcome-copy p { color:#bad2e5; }
:root[data-theme=dark] .auth-landing .auth-welcome h2 em { color:#8dc9f4; }
:root[data-theme=dark] .auth-landing .auth-eyebrow,:root[data-theme=dark] .auth-landing .auth-welcome-note { color:#9cbfd9; }
:root[data-theme=dark] .auth-welcome::before,:root[data-theme=dark] .auth-welcome::after { opacity:.035; }
:root[data-theme=dark] .auth-landing .auth-card input { border-color:#4b657d; }

/*
 * Dashboard shell/menu/button styling adapted from TailAdmin Free (MIT).
 * Copyright (c) 2023 TailAdmin. See /licenses/tailadmin.MIT.txt.
 * Existing messenger layout and event handlers remain the source of behavior.
 */
@media(min-width:761px) {
  .desktop-application-layout { --desktop-navigation-width:88px; }
  .desktop-application-layout.navigation-expanded { --desktop-navigation-width:280px; }
  .desktop-navigation { border-right-color:var(--border-secondary); }
  .desktop-navigation-brand { min-height:80px; padding:20px 22px; gap:0; }
  .navigation-collapsed .desktop-navigation-brand { align-items:center; justify-content:center; }
  .desktop-navigation nav { gap:8px; padding:8px 18px; }
  .desktop-navigation nav button,.desktop-navigation-toggle { min-height:44px; border-radius:8px; padding:10px 12px; font-size:14px; font-weight:500; }
  .navigation-collapsed .desktop-navigation nav button { justify-content:center; padding:10px; }
  .desktop-navigation nav button svg { flex-basis:20px; width:20px; height:20px; }
  .desktop-navigation nav button.active { background:var(--bg-selected); color:var(--accent); }
  .desktop-navigation nav button:not(.active):hover { background:var(--bg-hover); color:var(--text-primary); }
  .desktop-navigation-toggle { margin: auto 18px 18px; width:calc(100% - 36px); }
  .navigation-expanded .desktop-navigation-brand .brand-wordmark { font-size:20px; }
  .workspace-name-row { color:var(--text-muted); font-size:12px; margin-left:49px; }
}
@media(min-width:1001px) {
  .desktop-application-content>.app-shell { grid-template-rows:80px minmax(0,1fr); }
}
.workspace-messages-header,.chat-header {
  background:var(--bg-elevated); border-bottom:1px solid var(--border-secondary);
}
.workspace-messages-title h1 { font-size:20px; font-weight:600; letter-spacing:-.02em; }
.workspace-message-actions>button { border-radius:8px; }
.connection-card { border:1px solid var(--border-secondary); border-radius:16px; box-shadow:none; }
.primary-button,.secondary-button { border-radius:8px; font-weight:500; }
.secondary-button { border:1px solid var(--border-secondary); background:var(--bg-elevated); box-shadow:0 1px 2px #10182808; }
.secondary-button:hover:not(:disabled) { background:var(--bg-hover); }
@media(prefers-reduced-motion:reduce) {
 .desktop-application-layout,.desktop-navigation nav button,.desktop-navigation-toggle { transition:none; }
}
