/* Neutral dark surfaces. White glass and colored action accents keep their existing styles. */
:root:not([data-theme="white"]) {
  --bg: #141414;
  --surface: #1b1b1b;
  --surface2: #252525;
  --line: rgba(255,255,255,.14);
}
html:not([data-theme="white"]) body {
  background: linear-gradient(180deg,#1a1a1a,var(--bg) 60%);
}
html:not([data-theme="white"]) body::before {
  background-image: linear-gradient(rgba(255,255,255,.025) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.025) 1px,transparent 1px);
}
html:not([data-theme="white"]) .ambient-cyan { background: #555; }
html:not([data-theme="white"]) .ambient-violet { background: #3d3d3d; }
html:not([data-theme="white"]) :is(.login-story,.login-entry) { background: transparent; }
html:not([data-theme="white"]) .panel { background: linear-gradient(145deg,rgba(30,30,30,.96),rgba(24,24,24,.96)); }
html:not([data-theme="white"]) .feature-panel { background: linear-gradient(135deg,#242424,#1b1b1b); }
html:not([data-theme="white"]) .continuity-strip { background: rgba(255,255,255,.035); }
html:not([data-theme="white"]) .topbar { background: rgba(20,20,20,.96); }
html:not([data-theme="white"]) :is(.sidebar,.mobile-nav) {
  background: linear-gradient(145deg,rgba(255,255,255,.11),rgba(255,255,255,.025) 42%,rgba(255,255,255,.065)),rgba(20,20,20,.6);
  border-color: rgba(255,255,255,.16);
  box-shadow: inset 1px 0 0 rgba(255,255,255,.1),inset -1px 0 0 rgba(255,255,255,.04),0 8px 28px rgba(0,0,0,.18);
  backdrop-filter: blur(24px) saturate(100%);
  -webkit-backdrop-filter: blur(24px) saturate(100%);
}
html:not([data-theme="white"]) .mobile-nav {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.13),0 -4px 24px rgba(0,0,0,.18);
}
html:not([data-theme="white"]) .sidebar-card { background: rgba(255,255,255,.035); }
html:not([data-theme="white"]) :is(.nav-item:hover,.nav-item.active,.mobile-nav .active) {
  background: linear-gradient(135deg,rgba(255,255,255,.16),rgba(255,255,255,.065));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18),inset 0 0 0 1px rgba(255,255,255,.08),0 3px 10px rgba(0,0,0,.12);
  color: #f1f1f1;
}
html:not([data-theme="white"]) .nav-item.active>span { color: #f1f1f1; }
html:not([data-theme="white"]) .message.user>.message-bubble {
  background: linear-gradient(135deg,#2b2b2b,#242424);
  border-color: rgba(255,255,255,.14);
}
html:not([data-theme="white"]) .message.assistant>.message-bubble {
  background: #1c1c1c;
  border-color: rgba(255,255,255,.09);
}
html:not([data-theme="white"]) :is(.composer,.quick-ask-form) { background: #121212; }
html:not([data-theme="white"]) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),textarea) { background: #121212; }
html:not([data-theme="white"]) :is(.composer textarea,.quick-ask-form input) { background: transparent; }
html:not([data-theme="white"]) :is(dialog,dialog footer,.large-upload-dialog,.learning-options,.email-draft,#email-review-dialog .email-actions) { background: #1b1b1b; }
html:not([data-theme="white"]) :is(.code-block,.message-content pre) { background: #141414; }
html:not([data-theme="white"]) .message-content .code-block pre { background: transparent; }
html:not([data-theme="white"]) .file-drop-overlay { background: radial-gradient(ellipse at center,#333333ed,#171717e8); }
html:not([data-theme="white"]) .app-loading { background: #141414; }
html:not([data-theme="white"]) .app-refreshing { background: #252525ed; }
html:not([data-theme="white"]) #calendar-view { --cal-surface: rgba(28,28,28,.85); }
/* Move the glass itself between destinations; no animation runs while idle. */
@media (prefers-reduced-motion:no-preference) {
  html:not([data-theme="white"])[data-ui-motion] .sidebar nav { position: relative; isolation: isolate; }
  html:not([data-theme="white"])[data-ui-motion] .mobile-nav { isolation: isolate; }
  html:not([data-theme="white"])[data-ui-motion] .motion-selection {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    z-index: -1;
    pointer-events: none;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.18);
    background: linear-gradient(135deg,rgba(255,255,255,.19),rgba(255,255,255,.06) 48%,rgba(255,255,255,.1));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.25),inset 0 -1px 0 rgba(255,255,255,.045),0 3px 10px rgba(0,0,0,.12);
  }
  html:not([data-theme="white"])[data-ui-motion] .motion-ready>.motion-selection {
    transition: transform 220ms cubic-bezier(.22,1,.36,1),width 220ms ease,height 220ms ease,scale 150ms ease;
  }
  html:not([data-theme="white"])[data-ui-motion] .motion-ready button.active {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
  }
  html:not([data-theme="white"])[data-ui-motion] :is(.sidebar nav,.mobile-nav) button {
    transition: transform 150ms cubic-bezier(.2,.8,.2,1),color 150ms ease,box-shadow 150ms ease,background-color 150ms ease;
  }
  html:not([data-theme="white"])[data-ui-motion] :is(.sidebar nav,.mobile-nav) button:active:not(:disabled) { transform: scale(.97); }
  html:not([data-theme="white"])[data-ui-motion] .motion-ready:has(button.active:active)>.motion-selection { scale: .98; }
}
@media (max-width:1199px) {
  html:not([data-theme="white"]) .chat-panel { background: none; }
}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))) {
  html:not([data-theme="white"]) :is(.sidebar,.mobile-nav) { background: #252525; }
}
@media (prefers-reduced-transparency:reduce) {
  html:not([data-theme="white"]) :is(.sidebar,.mobile-nav) {
    background: #252525;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
