@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Syne:wght@600;700;800&display=swap');

/* ── Mitch.pro Design System Tokens (Fallbacks for theme.js) ───────── */
:root {
  --t-bg: #070510;
  --t-bg2: rgba(22, 13, 44, 0.7);
  --t-bg3: rgba(42, 23, 76, 0.74);
  --t-fg: #faf7ff;
  --t-fg2: #b4a9c9;
  --t-fg3: #8a7c9f;
  --t-ac: #b86cff;
  --t-ac2: #e47cff;
  --t-ac3: #8257ff;
  --t-bd: rgba(224, 198, 255, 0.16);
  --t-bda: rgba(194, 126, 255, 0.48);
  --t-gl: rgba(180, 94, 255, 0.35);
  --t-gls: rgba(180, 94, 255, 0.14);
  --t-gr: linear-gradient(135deg, #7957f1, #ca57f5 56%, #ff5fa7);
  --t-radius: 16px;
  --t-font: 'DM Sans', Figtree, system-ui, -apple-system, sans-serif;
  --t-display: 'Syne', Figtree, system-ui, sans-serif;

  /* Cinny Typography & Link Color Overrides */
  --font-secondary: var(--t-font, 'DM Sans', sans-serif) !important;
  --tc-link: var(--t-ac, #b86cff) !important;
  --_164xfge1: var(--t-font, 'DM Sans', sans-serif) !important;
}

/* ── Cinny Theme Engine Variables Overrides Riding theme.js ─────── */
:root,
html,
body,
body.dark-theme,
body.light-theme,
body.silver-theme,
body.butter-theme,
.oq6d071w,
._15q3ngn0,
._15q3ngn1,
._15q3ngn2 {
  --oq6d070: var(--t-bg, #070510) !important;        /* Main base surface */
  --oq6d071: var(--t-bg2, rgba(22, 13, 44, 0.7)) !important; /* Hover base surface */
  --oq6d072: var(--t-bg3, rgba(42, 23, 76, 0.74)) !important; /* Active base surface */
  --oq6d073: var(--t-bd, rgba(224, 198, 255, 0.16)) !important; /* Divider border */
  --oq6d074: var(--t-fg, #faf7ff) !important;        /* Primary text */
  --oq6d075: var(--t-bg2, rgba(22, 13, 44, 0.7)) !important; /* Panel / sidebar bg */
  --oq6d076: var(--t-bg3, rgba(42, 23, 76, 0.74)) !important; /* Hover panel */
  --oq6d077: var(--t-bg3, rgba(42, 23, 76, 0.74)) !important; /* Active panel */
  --oq6d078: var(--t-bd, rgba(224, 198, 255, 0.16)) !important; /* Panel border */
  --oq6d079: var(--t-fg, #faf7ff) !important;        /* Panel text */
  --oq6d07a: var(--t-bg3, rgba(42, 23, 76, 0.74)) !important; /* Message bubble / input */
  --oq6d07b: var(--t-bg2, rgba(22, 13, 44, 0.7)) !important;  /* Hover bubble */
  --oq6d07c: var(--t-bg3, rgba(42, 23, 76, 0.74)) !important; /* Active bubble */
  --oq6d07d: var(--t-bda, rgba(194, 126, 255, 0.48)) !important;/* Bubble border */
  --oq6d07e: var(--t-fg, #faf7ff) !important;        /* Bubble text */
  --oq6d07f: var(--t-ac, #b86cff) !important;        /* Primary brand accent */
  --oq6d07g: var(--t-ac2, #e47cff) !important;
  --oq6d07h: var(--t-ac3, #8257ff) !important;
  --oq6d07i: var(--t-ac3, #8257ff) !important;
  --oq6d07j: #ffffff !important;                    /* Contrast text on accent */
  --oq6d07k: var(--t-gls, rgba(180, 94, 255, 0.14)) !important; /* Tinted accent bg */
  --oq6d07l: var(--t-gl, rgba(180, 94, 255, 0.35)) !important;
  --oq6d07m: var(--t-gl, rgba(180, 94, 255, 0.35)) !important;
  --oq6d07n: var(--t-bda, rgba(194, 126, 255, 0.48)) !important;
  --oq6d07o: var(--t-ac, #b86cff) !important;
  --oq6d07p: var(--t-bg, #070510) !important;
  --oq6d07q: var(--t-bg2, rgba(22, 13, 44, 0.7)) !important;
  --oq6d07r: var(--t-bg3, rgba(42, 23, 76, 0.74)) !important;
  --oq6d07s: var(--t-bg3, rgba(42, 23, 76, 0.74)) !important;
  --oq6d07t: var(--t-fg, #faf7ff) !important;
  --oq6d07u: var(--t-bg2, rgba(22, 13, 44, 0.7)) !important;
  --oq6d07v: var(--t-bg3, rgba(42, 23, 76, 0.74)) !important;
  --oq6d07w: var(--t-bg3, rgba(42, 23, 76, 0.74)) !important;
  --oq6d07x: var(--t-bd, rgba(224, 198, 255, 0.16)) !important;
  --oq6d07y: var(--t-fg2, #b4a9c9) !important;
  --oq6d071t: rgba(0, 0, 0, 0.65) !important;
  --oq6d071u: rgba(0, 0, 0, 0.35) !important;
  --oq6d071v: rgba(4, 2, 10, 0.78) !important;
}

/* ── Global Document Layout (Full Screen) ────────────────────────── */
html {
  height: 100%;
  overflow: hidden;
  background-color: var(--t-bg) !important;
}

body {
  height: 100vh !important;
  max-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  color: var(--t-fg) !important;
  font-family: var(--t-font) !important;
  position: relative;
  isolation: isolate;
}

/* Subtle Cosmic Galaxy Nebula when no custom wallpaper is active */
html:not([data-bglayer]):not(.theme-light) body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 18%, rgba(168, 85, 247, 0.18) 0%, transparent 40%),
    radial-gradient(circle at 84% 82%, rgba(236, 72, 153, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 52% 42%, rgba(99, 102, 241, 0.08) 0%, transparent 55%),
    radial-gradient(circle, rgba(235, 213, 255, 0.25) 0 1px, transparent 1.3px);
  background-size: auto, auto, auto, 74px 74px;
  opacity: 0.8;
}

/* Cinny Full-Height Root Container */
#root {
  flex: 1 1 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  position: relative !important;
  z-index: 1 !important;
  background: transparent !important;
}

/* ── Space Sidebar (Leftmost Strip) ──────────────────────────────── */
._1ho1fyw0 {
  background: var(--t-bg2) !important;
  border-right: 1px solid var(--t-bd) !important;
  backdrop-filter: blur(20px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(140%) !important;
}

._1ho1fyw4 {
  border-radius: 14px !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease !important;
}

._1ho1fyw4:hover {
  transform: scale(1.06) !important;
  box-shadow: 0 0 16px var(--t-gl) !important;
}

._1ho1fyw4:before {
  border-radius: 0 4px 4px 0 !important;
  background: var(--t-gr, linear-gradient(180deg, #b86cff, #ff73c5)) !important;
  box-shadow: 0 0 12px var(--t-gl) !important;
}

/* ── Room List Sidebar ───────────────────────────────────────────── */
._1xki9of1,
._1xki9of0,
._18fjf6z0 {
  background: var(--t-bg2) !important;
  border-right: 1px solid var(--t-bd) !important;
  backdrop-filter: blur(20px) saturate(135%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(135%) !important;
}

._1xki9of2,
._18fjf6z1 {
  border-bottom: 1px solid var(--t-bd) !important;
}

/* Room Items */
.t4fedt8 {
  margin: 2px 8px !important;
  border-radius: 12px !important;
  border: 1px solid transparent !important;
  transition: all 0.15s ease !important;
}

.t4fedt8:hover {
  background: var(--t-gls) !important;
  border-color: var(--t-bda) !important;
  transform: translateX(2px);
}

.t4fedt8[aria-selected="true"] {
  background: var(--t-gls) !important;
  border-color: var(--t-bda) !important;
  box-shadow: 0 4px 18px var(--t-gls), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

.t4fedt8[aria-selected="true"] .t4fedto {
  color: var(--t-fg) !important;
  font-weight: 600 !important;
}

/* ── Chat Main View & Room Header ────────────────────────────────── */
.hru6be0,
.hru6bec,
.hru6bed,
._1t5i6nr1,
.ty6xms1,
._1v145rl1 {
  background: var(--t-bg2) !important;
  border-bottom: 1px solid var(--t-bd) !important;
  backdrop-filter: blur(22px) !important;
  -webkit-backdrop-filter: blur(22px) !important;
}

/* Room Title Styling */
.hru6be0 h1,
.hru6be0 h2,
.hru6be0 [role="heading"],
.hru6be0 ._1xny9xl5,
.hru6be0 ._1xny9xl6 {
  font-family: var(--t-display, 'Syne', sans-serif) !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  color: var(--t-fg) !important;
}

/* ── Chat Messages Timeline ──────────────────────────────────────── */
._161nxver {
  background: var(--t-bg3) !important;
  border: 1px solid var(--t-bd) !important;
  border-radius: 16px !important;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18) !important;
}

._161nxveo {
  transition: transform 0.18s ease !important;
}
._161nxveo:hover {
  transform: translateY(-2px) !important;
}

/* Avatars */
._1684mq5c,
._1684mq5d,
._1684mq51 {
  border-radius: 12px !important;
}

/* Quotes */
._1m2qi7r3 {
  border-left: 3px solid var(--t-ac, #b86cff) !important;
  background: var(--t-gls) !important;
  border-radius: 0 10px 10px 0 !important;
  padding: 6px 12px !important;
}

/* Code & Inline Code */
._1m2qi7r4,
code,
pre {
  background: var(--t-bg3) !important;
  border: 1px solid var(--t-bd) !important;
  border-radius: 8px !important;
  color: var(--t-fg) !important;
  font-family: 'JetBrains Mono', Consolas, Monaco, monospace !important;
}

/* Mentions / User Pills */
._1m2qi7rh {
  background: var(--t-gls) !important;
  border: 1px solid var(--t-bda) !important;
  color: var(--t-fg) !important;
  border-radius: 6px !important;
  padding: 1px 6px !important;
}

/* ── Composer & Textarea ─────────────────────────────────────────── */
.ay20pp9,
.coabsl0 {
  background: var(--t-bg2) !important;
  border: 1px solid var(--t-bd) !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.ay20pp9:has(textarea:focus),
.coabsl0:focus-within {
  border-color: var(--t-bda) !important;
  box-shadow: 0 4px 24px var(--t-gls), 0 0 0 1px var(--t-bda) !important;
}

textarea {
  font-family: var(--t-font) !important;
  color: var(--t-fg) !important;
}

textarea::placeholder {
  color: var(--t-fg2) !important;
}

/* ── Buttons & Interactive Elements ──────────────────────────────── */
.epr39zm,
button[data-priority="300"],
button[data-variant="primary"],
.epr39zd[data-variant="primary"] {
  background: var(--t-gr, linear-gradient(135deg, #a855f7, #7c3aed)) !important;
  border: 1px solid var(--t-bda) !important;
  color: #ffffff !important;
  border-radius: 12px !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 16px var(--t-gls) !important;
  transition: all 0.18s ease !important;
}

.epr39zm:hover,
button[data-priority="300"]:hover,
button[data-variant="primary"]:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 22px var(--t-gl) !important;
  filter: brightness(1.08) !important;
}

/* Secondary Buttons */
.epr39zn,
button[data-priority="200"],
button[data-variant="secondary"] {
  background: var(--t-bg3) !important;
  border: 1px solid var(--t-bd) !important;
  color: var(--t-fg) !important;
  border-radius: 12px !important;
  transition: all 0.18s ease !important;
}

.epr39zn:hover,
button[data-priority="200"]:hover,
button[data-variant="secondary"]:hover {
  background: var(--t-bg2) !important;
  border-color: var(--t-bda) !important;
}

/* ── Modals, Dialogs & Popovers ──────────────────────────────────── */
._1fc5sz51,
._5z5e2h1,
._1cmtvyv0,
._1f6snux0,
._1vnya282,
dialog {
  background: var(--t-bg2) !important;
  border: 1px solid var(--t-bd) !important;
  border-radius: 20px !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6), 0 0 35px var(--t-gls) !important;
  backdrop-filter: blur(28px) saturate(145%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(145%) !important;
}

._1oc5jl82 {
  background: rgba(4, 2, 10, 0.75) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

/* ── Auth / Login Card ───────────────────────────────────────────── */
._15upz2y1 {
  background: var(--t-bg2) !important;
  border: 1px solid var(--t-bda) !important;
  border-radius: 24px !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 40px var(--t-gls) !important;
  backdrop-filter: blur(24px) saturate(145%) !important;
}

/* ── Theme Button Removal (Cinny UI Integration) ─────────────────── */
#theme-btn {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

/* ── Custom Scrollbars ───────────────────────────────────────────── */
/* Completely disable scrollbars on page shell & hidden scroll containers */
html,
body,
#root,
._4yxtfde,
._4yxtfd2,
.no-scrollbar {
  scrollbar-width: none !important;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar,
#root::-webkit-scrollbar,
._4yxtfde::-webkit-scrollbar,
._4yxtfd2::-webkit-scrollbar,
.no-scrollbar::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Only style scrollbars on explicit scrollable content */
._4yxtfdf,
._4yxtfdg,
._4yxtfdi,
._4yxtfdj,
.scrollable,
textarea,
pre,
[role="listbox"] {
  scrollbar-width: thin !important;
  scrollbar-color: var(--t-bda) transparent !important;
}
._4yxtfdf::-webkit-scrollbar,
._4yxtfdg::-webkit-scrollbar,
._4yxtfdi::-webkit-scrollbar,
._4yxtfdj::-webkit-scrollbar,
.scrollable::-webkit-scrollbar,
textarea::-webkit-scrollbar,
pre::-webkit-scrollbar,
[role="listbox"]::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
._4yxtfdf::-webkit-scrollbar-track,
._4yxtfdg::-webkit-scrollbar-track,
._4yxtfdi::-webkit-scrollbar-track,
._4yxtfdj::-webkit-scrollbar-track,
.scrollable::-webkit-scrollbar-track,
textarea::-webkit-scrollbar-track,
pre::-webkit-scrollbar-track,
[role="listbox"]::-webkit-scrollbar-track {
  background: transparent;
}
._4yxtfdf::-webkit-scrollbar-thumb,
._4yxtfdg::-webkit-scrollbar-thumb,
._4yxtfdi::-webkit-scrollbar-thumb,
._4yxtfdj::-webkit-scrollbar-thumb,
.scrollable::-webkit-scrollbar-thumb,
textarea::-webkit-scrollbar-thumb,
pre::-webkit-scrollbar-thumb,
[role="listbox"]::-webkit-scrollbar-thumb {
  background: var(--t-bda) !important;
  border-radius: 999px !important;
}
._4yxtfdf::-webkit-scrollbar-thumb:hover,
._4yxtfdg::-webkit-scrollbar-thumb:hover,
._4yxtfdi::-webkit-scrollbar-thumb:hover,
._4yxtfdj::-webkit-scrollbar-thumb:hover,
.scrollable::-webkit-scrollbar-thumb:hover,
textarea::-webkit-scrollbar-thumb:hover,
pre::-webkit-scrollbar-thumb:hover,
[role="listbox"]::-webkit-scrollbar-thumb:hover {
  background: var(--t-ac) !important;
}

/* ── SSO Floating Banner (Only when logged out) ─────────────────── */
#mitch-sso-banner {
  display: none;
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  background: var(--t-bg2);
  border: 1px solid var(--t-bda);
  border-radius: 16px;
  padding: 10px 22px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 30px var(--t-gls);
  backdrop-filter: blur(20px) saturate(150%);
  color: var(--t-fg);
  font-family: var(--t-font);
  font-size: 14px;
  align-items: center;
  gap: 16px;
  animation: mitchBannerPulse 4s ease-in-out infinite alternate;
}

@keyframes mitchBannerPulse {
  0% { box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 20px var(--t-gls); }
  100% { box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), 0 0 35px var(--t-gl); }
}

#mitch-sso-btn {
  background: var(--t-gr, linear-gradient(135deg, #a855f7, #6366f1));
  color: #fff;
  padding: 7px 16px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px var(--t-gls);
  transition: all 0.18s ease;
}

#mitch-sso-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--t-gl);
}

/* ── Matrix Push Notification Opt-in Banner ──────────────────────── */
#mitch-push-banner {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: 400px;
  z-index: 99999;
  background: var(--t-bg2, rgba(22, 13, 44, 0.88));
  border: 1px solid var(--t-bda, rgba(194, 126, 255, 0.48));
  border-radius: 16px;
  padding: 14px 18px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), 0 0 30px var(--t-gls, rgba(180, 94, 255, 0.2));
  backdrop-filter: blur(24px) saturate(160%);
  color: var(--t-fg, #faf7ff);
  font-family: var(--t-font, system-ui);
  font-size: 13.5px;
  line-height: 1.45;
  transition: all 0.25s ease;
}

#mitch-push-banner.show {
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: mitchPushSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes mitchPushSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.mitch-push-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 14px;
  color: var(--t-fg, #faf7ff);
}

.mitch-push-icon {
  font-size: 18px;
}

.mitch-push-desc {
  color: var(--t-fg2, #b4a9c9);
  font-size: 13px;
}

.mitch-push-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.mitch-push-btn-later {
  background: transparent;
  border: 1px solid var(--t-bd, rgba(224, 198, 255, 0.16));
  color: var(--t-fg2, #b4a9c9);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mitch-push-btn-later:hover {
  background: var(--t-bg3, rgba(42, 23, 76, 0.74));
  color: var(--t-fg, #faf7ff);
}

.mitch-push-btn-enable {
  background: var(--t-gr, linear-gradient(135deg, #a855f7, #6366f1));
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--t-gls, rgba(180, 94, 255, 0.2));
  transition: all 0.15s ease;
}

.mitch-push-btn-enable:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--t-gl, rgba(180, 94, 255, 0.35));
}
