/* Cax Cosmic visual layer — review branch only. No behavior or data changes. */
html[data-cax-theme="dark"] {
  color-scheme: dark;
  --cax-accent:#a98aff;
  --cax-line:#393052;
  --cax-muted:#b6accd;
  --cosmic-panel:#171329;
  --cosmic-edge:rgba(186,155,255,.19);
  --cosmic-glow:rgba(143,88,255,.18);
  background:#090718!important;
}
html[data-cax-theme="dark"] body {
  color:#f2edff;
  background:radial-gradient(ellipse 80% 55% at 85% 0%,rgba(96,51,175,.24),transparent 70%),#090718!important;
}
html[data-cax-theme="dark"] .layout {
  background:radial-gradient(ellipse at 80% 8%,rgba(99,59,173,.19),transparent 52%),linear-gradient(140deg,#0b0919,#120e24 62%,#090718)!important;
}
html[data-cax-theme="dark"] .layout:before {
  background:linear-gradient(90deg,#0b091a,#261741 50%,#0b091a)!important;
  color:#dfd0ff!important;
  border-bottom:1px solid rgba(194,163,255,.13);
}
html[data-cax-theme="dark"] .rail,
html[data-cax-theme="dark"] .sidebar,
html[data-cax-theme="dark"] .memberlist,
html[data-cax-theme="dark"] .ss-nav {
  background:linear-gradient(180deg,rgba(27,20,49,.97),rgba(13,11,28,.98))!important;
  border-color:var(--cosmic-edge)!important;
}
html[data-cax-theme="dark"] .main,
html[data-cax-theme="dark"] .chat,
html[data-cax-theme="dark"] .workspace {
  background:transparent!important;
}
html[data-cax-theme="dark"] .main .header,
html[data-cax-theme="dark"] .sidebar .header {
  background:rgba(29,21,50,.75)!important;
  border-color:var(--cosmic-edge)!important;
  backdrop-filter:blur(10px);
}
html[data-cax-theme="dark"] .messages {
  background:radial-gradient(ellipse at 88% 15%,rgba(103,56,177,.12),transparent 55%),transparent!important;
}
html[data-cax-theme="dark"] .rail button {
  background:#251a43!important;
  border:1px solid rgba(181,140,255,.18);
  color:#d7c0ff!important;
  transition:background .18s ease,box-shadow .18s ease,transform .18s ease;
}
html[data-cax-theme="dark"] .rail button:hover,
html[data-cax-theme="dark"] .rail button.active {
  background:linear-gradient(135deg,#7650ca,#a273f0)!important;
  color:white!important;
  box-shadow:0 0 20px rgba(160,106,255,.25);
}
html[data-cax-theme="dark"] .item {color:#c5b9df!important;border-radius:10px}
html[data-cax-theme="dark"] .item:hover,
html[data-cax-theme="dark"] .item.active {
  background:rgba(149,103,240,.17)!important;
  color:#fff!important;
}
html[data-cax-theme="dark"] .pane,
html[data-cax-theme="dark"] .modal,
html[data-cax-theme="dark"] .profile,
html[data-cax-theme="dark"] .cax-profile,
html[data-cax-theme="dark"] .ss-modal,
html[data-cax-theme="dark"] .toast,
html[data-cax-theme="dark"] .cax-voice-panel,
html[data-cax-theme="dark"] #cax-ext-panel {
  background:linear-gradient(145deg,rgba(36,26,65,.97),rgba(18,15,35,.98))!important;
  border:1px solid var(--cosmic-edge)!important;
  color:#f4eeff!important;
  box-shadow:0 18px 52px rgba(5,3,18,.38)!important;
}
html[data-cax-theme="dark"] .message {
  border-radius:12px;
  transition:background .15s ease;
}
html[data-cax-theme="dark"] .message:hover {background:rgba(154,107,232,.11)!important}
html[data-cax-theme="dark"] .composer {background:rgba(17,12,35,.48)!important}
html[data-cax-theme="dark"] input:not([type="checkbox"]),
html[data-cax-theme="dark"] textarea,
html[data-cax-theme="dark"] select {
  background:rgba(34,26,59,.92)!important;
  border:1px solid rgba(188,159,255,.25)!important;
  color:#f4efff!important;
  border-radius:12px;
}
html[data-cax-theme="dark"] input:focus-visible,
html[data-cax-theme="dark"] textarea:focus-visible,
html[data-cax-theme="dark"] select:focus-visible,
html[data-cax-theme="dark"] button:focus-visible {
  outline:2px solid #c6a4ff;
  outline-offset:2px;
}
html[data-cax-theme="dark"] input::placeholder,
html[data-cax-theme="dark"] textarea::placeholder {color:#a99cbe}
html[data-cax-theme="dark"] button.primary,
html[data-cax-theme="dark"] .tabs button.active {
  background:linear-gradient(135deg,#8858db,#b183f8)!important;
  color:white!important;
  border-radius:11px;
}
html[data-cax-theme="dark"] button.outline,
html[data-cax-theme="dark"] .tabs button {
  background:rgba(58,42,95,.65)!important;
  border-color:rgba(188,159,255,.23)!important;
  color:#eee3ff!important;
}
html[data-cax-theme="dark"] .avatar {
  border-radius:50%!important;
  background:linear-gradient(135deg,#5a3c95,#302350);
}
html[data-cax-theme="dark"] .account {
  background:rgba(35,25,58,.95)!important;
  border-color:var(--cosmic-edge)!important;
}
html[data-cax-theme="dark"] .pill {
  background:rgba(118,75,188,.22)!important;
  border-color:rgba(185,147,255,.25)!important;
  color:#e8d9ff!important;
}
html[data-cax-theme="dark"] .muted,
html[data-cax-theme="dark"] .label,
html[data-cax-theme="dark"] small {color:#b7accd}
html[data-cax-theme="dark"] .divider {border-color:var(--cosmic-edge)!important}
@media (prefers-reduced-motion:reduce) {
  html[data-cax-theme="dark"] .rail button,
  html[data-cax-theme="dark"] .message {transition:none!important}
}
