/* Personal AI ambient background and interaction effects — 2026-09-10 */
.ai-shell.lobe-inspired {
  --ai-ambient-violet: 125, 96, 255;
  --ai-ambient-blue: 52, 139, 255;
  --ai-ambient-cyan: 54, 224, 255;
  --ai-pointer-x: 58%;
  --ai-pointer-y: 42%;
  isolation: isolate;
  overflow: hidden;
}

.ai-ambient-layer {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ai-shell.lobe-inspired > .ai-sidebar,
.ai-shell.lobe-inspired > .ai-main {
  position: relative;
  z-index: 1;
}

#ai-ambient-particles,
#ai-ambient-particles > div,
#ai-ambient-particles canvas {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}

#ai-ambient-particles {
  z-index: 2;
  opacity: .82;
  transition: opacity .3s ease;
}

.ai-ambient-glow {
  position: absolute;
  border-radius: 999px;
  opacity: .46;
  filter: blur(62px);
  will-change: transform;
}

.ai-ambient-glow-a {
  top: -19%;
  left: 15%;
  width: 42%;
  height: 46%;
  background: rgba(var(--ai-ambient-violet), .3);
  animation: aiAmbientFloatA 18s ease-in-out infinite alternate;
}

.ai-ambient-glow-b {
  right: -13%;
  bottom: 4%;
  width: 40%;
  height: 50%;
  background: rgba(var(--ai-ambient-blue), .26);
  animation: aiAmbientFloatB 22s ease-in-out infinite alternate;
}

.ai-ambient-glow-c {
  bottom: -25%;
  left: 31%;
  width: 36%;
  height: 42%;
  background: rgba(var(--ai-ambient-cyan), .14);
  animation: aiAmbientFloatC 25s ease-in-out infinite alternate;
}

.ai-ambient-pointer {
  position: absolute;
  z-index: 3;
  inset: 0;
  opacity: 0;
  background: radial-gradient(circle 220px at var(--ai-pointer-x) var(--ai-pointer-y), rgba(var(--ai-ambient-cyan), .13), rgba(var(--ai-ambient-violet), .055) 38%, transparent 72%);
  transition: opacity .35s ease;
}

.ai-shell.ai-pointer-active .ai-ambient-pointer { opacity: 1; }

.ai-ambient-noise {
  position: absolute;
  z-index: 4;
  inset: 0;
  opacity: .038;
  background-image:
    repeating-linear-gradient(103deg, rgba(255,255,255,.28) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(17deg, rgba(255,255,255,.13) 0 1px, transparent 1px 5px);
  background-size: 5px 7px, 7px 5px;
  mix-blend-mode: soft-light;
}

.ai-shell.ai-ambient-off .ai-ambient-layer { display: none; }
.ai-shell.ai-ambient-glow #ai-ambient-particles { display: none; }

/* Let a wallpaper remain visible, then place readable glass only where content lives. */
.ai-shell.lobe-inspired.is-aqua.aqua-wallpaper .ai-aqua-fluid {
  filter: blur(var(--ai-aqua-wallpaper-blur, 0px)) saturate(106%) contrast(101%);
}

.ai-shell.lobe-inspired.is-aqua.aqua-wallpaper .ai-aqua-fluid::before {
  background: rgba(0, 0, 0, calc((1 - var(--ai-aqua-brightness, .7)) * .3));
}

.ai-shell.lobe-inspired.is-aqua.aqua-wallpaper .ai-aqua-fluid::after {
  background: linear-gradient(135deg,
    rgba(9, 12, 25, calc(var(--ai-aqua-wallpaper-frost, .15) * .72)),
    rgba(16, 21, 41, calc(var(--ai-aqua-wallpaper-frost, .15) * .48)) 48%,
    rgba(6, 9, 20, calc(var(--ai-aqua-wallpaper-frost, .15) * .76)));
}

.ai-shell.lobe-inspired.aqua-wallpaper #ai-ambient-particles { opacity: .46; }
.ai-shell.lobe-inspired.aqua-wallpaper .ai-ambient-glow { opacity: .27; }

.ai-shell.lobe-inspired.aqua-wallpaper .ai-main {
  background: linear-gradient(180deg, rgba(10, 13, 25, .31), rgba(7, 9, 18, .23));
  -webkit-backdrop-filter: blur(4px) saturate(108%);
  backdrop-filter: blur(4px) saturate(108%);
}

.ai-shell.lobe-inspired.aqua-wallpaper .ai-message-list {
  background: linear-gradient(90deg, rgba(5, 8, 18, .16), transparent 18%, transparent 82%, rgba(5, 8, 18, .12));
}

.ai-shell.lobe-inspired.aqua-wallpaper .ai-message.assistant .ai-bubble {
  padding: 1rem 1.1rem .78rem;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(9, 13, 27, .68), rgba(7, 10, 21, .52));
  box-shadow: inset 0 1px rgba(255,255,255,.045), 0 16px 42px rgba(0,0,0,.16);
  -webkit-backdrop-filter: blur(13px) saturate(112%);
  backdrop-filter: blur(13px) saturate(112%);
}

.ai-shell.lobe-inspired.aqua-wallpaper .ai-empty--horizon :is(h1, .ai-empty-copy) {
  text-shadow: 0 2px 14px rgba(0, 0, 0, .9);
}

.ai-shell.lobe-inspired.aqua-wallpaper .ai-empty-copy { color: #c0c3ce; }

.ai-shell.lobe-inspired.aqua-wallpaper .ai-sidebar {
  background: linear-gradient(180deg, rgba(12, 14, 27, .64), rgba(7, 9, 18, .54));
  -webkit-backdrop-filter: blur(18px) saturate(112%);
  backdrop-filter: blur(18px) saturate(112%);
}

.ai-shell.lobe-inspired.aqua-wallpaper .ai-topbar {
  background: rgba(11, 13, 24, .63);
  -webkit-backdrop-filter: blur(17px) saturate(118%);
  backdrop-filter: blur(17px) saturate(118%);
}

.ai-shell.lobe-inspired.aqua-wallpaper .ai-composer {
  background: rgba(12, 15, 29, .82);
  -webkit-backdrop-filter: blur(22px) saturate(120%);
  backdrop-filter: blur(22px) saturate(120%);
}

/* Sidebar resize handle: wider hit area, glowing rail, live width and reset affordance. */
.ai-shell.lobe-inspired .ai-resize-handle {
  right: -10px;
  width: 20px;
  z-index: 30;
}

.ai-shell.lobe-inspired .ai-resize-handle::before {
  content: "";
  position: absolute;
  top: 12%;
  bottom: 12%;
  left: 9px;
  width: 1px;
  border-radius: 99px;
  background: linear-gradient(180deg, transparent, rgba(var(--ai-ambient-cyan), .18) 25%, rgba(var(--ai-ambient-violet), .24) 72%, transparent);
  transition: width .2s ease, background .2s ease, box-shadow .2s ease;
}

.ai-shell.lobe-inspired .ai-resize-handle::after {
  content: "\2022\A\2022\A\2022";
  white-space: pre;
  position: absolute;
  top: 50%;
  left: 2px;
  display: grid;
  place-content: center;
  width: 16px;
  height: 54px;
  padding-bottom: 2px;
  border: 1px solid rgba(102, 216, 255, .2);
  border-radius: 10px;
  color: rgba(139, 225, 255, .52);
  font-size: 10px;
  line-height: 6px;
  background: linear-gradient(180deg, rgba(13, 31, 53, .91), rgba(31, 21, 65, .92));
  box-shadow: 0 5px 18px rgba(0, 0, 0, .32), inset 0 1px rgba(255,255,255,.08);
  transform: translateY(-50%);
  transition: transform .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.ai-shell.lobe-inspired .ai-resize-handle:hover::before,
.ai-shell.lobe-inspired.is-resizing .ai-resize-handle::before {
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(var(--ai-ambient-cyan), .72) 25%, rgba(var(--ai-ambient-violet), .8) 72%, transparent);
  box-shadow: 0 0 16px rgba(var(--ai-ambient-cyan), .46);
}

.ai-shell.lobe-inspired .ai-resize-handle:hover::after,
.ai-shell.lobe-inspired.is-resizing .ai-resize-handle::after {
  color: #e6fbff;
  border-color: rgba(var(--ai-ambient-cyan), .68);
  box-shadow: 0 0 0 3px rgba(var(--ai-ambient-cyan), .08), 0 0 23px rgba(var(--ai-ambient-cyan), .35), inset 0 1px rgba(255,255,255,.16);
  transform: translateY(-50%) scale(1.08);
}

.ai-resize-tooltip {
  position: absolute;
  z-index: 3;
  top: calc(50% - 46px);
  left: 23px;
  min-width: 48px;
  padding: 5px 7px;
  border: 1px solid rgba(113, 205, 255, .23);
  border-radius: 7px;
  color: #dcecff;
  font: 600 11px/1.1 ui-monospace, SFMono-Regular, Consolas, monospace;
  text-align: center;
  background: rgba(10, 15, 29, .94);
  box-shadow: 0 8px 24px rgba(0,0,0,.34);
  opacity: 0;
  transform: translateX(-5px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}

.ai-resize-tooltip::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -4px;
  width: 7px;
  height: 7px;
  border-left: 1px solid rgba(113,205,255,.23);
  border-bottom: 1px solid rgba(113,205,255,.23);
  background: rgba(10,15,29,.94);
  transform: translateY(-50%) rotate(45deg);
}

.ai-resize-handle:hover .ai-resize-tooltip,
.ai-shell.is-resizing .ai-resize-tooltip {
  opacity: 1;
  transform: translateX(0);
}

/* Consistent hover, focus and press feedback for primary Personal AI controls. */
.ai-shell.lobe-inspired :is(.ai-new-chat, .ai-send, .ai-tool-btn, .ai-thinking-toggle, .ai-scroll-latest, .ai-composer-action, .ai-model-select),
.ai-aqua-settings :is(button, .ai-aqua-option) {
  position: relative;
  isolation: isolate;
  transition: transform .18s ease, border-color .18s ease, color .18s ease, background .18s ease, box-shadow .18s ease;
}

.ai-shell.lobe-inspired :is(.ai-new-chat, .ai-send, .ai-tool-btn, .ai-thinking-toggle, .ai-scroll-latest, .ai-composer-action):hover,
.ai-aqua-settings :is(button, .ai-aqua-option):hover {
  transform: translateY(-1px);
  border-color: rgba(var(--ai-ambient-cyan), .4);
  box-shadow: 0 7px 20px rgba(14, 18, 40, .26), 0 0 17px rgba(var(--ai-ambient-violet), .12);
}

.ai-shell.lobe-inspired :is(.ai-new-chat, .ai-send, .ai-tool-btn, .ai-thinking-toggle, .ai-scroll-latest, .ai-composer-action):active,
.ai-aqua-settings :is(button, .ai-aqua-option):active {
  transform: translateY(0) scale(.975);
}

.ai-shell.lobe-inspired :is(button, [role="button"], select):focus-visible,
.ai-aqua-settings :is(button, input, select, [role="button"]):focus-visible {
  outline: 2px solid rgba(var(--ai-ambient-cyan), .88);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(var(--ai-ambient-cyan), .1);
}

.ai-touch-ripple {
  position: absolute;
  z-index: -1;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255,255,255,.55), rgba(var(--ai-ambient-cyan), .3) 38%, transparent 72%);
  transform: translate(-50%, -50%) scale(0);
  animation: aiTouchRipple .55s ease-out forwards;
  pointer-events: none;
}

@keyframes aiAmbientFloatA {
  to { transform: translate3d(10%, 14%, 0) scale(1.12); }
}

@keyframes aiAmbientFloatB {
  to { transform: translate3d(-14%, -8%, 0) scale(.92); }
}

@keyframes aiAmbientFloatC {
  to { transform: translate3d(8%, -17%, 0) scale(1.08); }
}

@keyframes aiTouchRipple {
  75% { opacity: .45; }
  to { opacity: 0; transform: translate(-50%, -50%) scale(13); }
}

@media (max-width: 760px), (pointer: coarse) {
  .ai-ambient-pointer { display: none; }
  .ai-ambient-glow { filter: blur(48px); opacity: .31; }
  #ai-ambient-particles { opacity: .48; }
  .ai-resize-tooltip { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ai-ambient-glow,
  .ai-touch-ripple { animation: none !important; }
  .ai-ambient-pointer { display: none; }
  .ai-shell.lobe-inspired :is(button, [role="button"], select) { transition-duration: .01ms !important; }
}

html[data-workspace-performance="low"] .ai-ambient-glow,
html[data-workspace-performance="low"] #ai-ambient-particles,
.ai-shell.ai-ambient-static .ai-ambient-glow,
.ai-shell.ai-ambient-static #ai-ambient-particles {
  animation: none !important;
}

html[data-workspace-performance="low"] #ai-ambient-particles { display: none; }

.ai-site-wallpaper-admin {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 4px;
  padding: 12px;
  border: 1px solid rgba(var(--ai-ambient-cyan), .18);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(41, 118, 164, .09), rgba(104, 72, 190, .08));
}

.ai-site-wallpaper-admin[hidden] { display: none; }
#ai-admin-wallpaper-entry[hidden] { display: none !important; }
#ai-admin-wallpaper-entry:not([hidden]) { color: #bdefff; }
#ai-admin-wallpaper-entry:not([hidden]) i { color: rgb(var(--ai-ambient-cyan)); }
.ai-site-wallpaper-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ai-site-wallpaper-heading strong { color: #dcefff; font-size: 12px; }
.ai-site-wallpaper-heading small { color: #73cdea; font-size: 10px; }
.ai-site-wallpaper-preview { height: 78px; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; background-position: center; background-size: cover; box-shadow: inset 0 1px rgba(255,255,255,.08); }
.ai-site-wallpaper-preview[hidden] { display: none; }
.ai-site-wallpaper-actions { display: flex; gap: 7px; }
.ai-site-wallpaper-actions label,
.ai-site-wallpaper-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 30px; padding: 0 10px; border: 1px solid rgba(255,255,255,.14); border-radius: 8px; color: #dcecff; background: rgba(255,255,255,.045); font-size: 11px; cursor: pointer; }
.ai-site-wallpaper-actions label { flex: 1; border-color: rgba(var(--ai-ambient-cyan), .25); color: #bceeff; }
.ai-site-wallpaper-actions label:hover,
.ai-site-wallpaper-actions button:hover:not(:disabled) { border-color: rgba(var(--ai-ambient-cyan), .5); background: rgba(var(--ai-ambient-cyan), .09); box-shadow: 0 0 16px rgba(var(--ai-ambient-cyan), .1); }
.ai-site-wallpaper-actions button:disabled { opacity: .42; cursor: not-allowed; }
.ai-aqua-delete:disabled { opacity: .42; cursor: not-allowed; }
.ai-site-wallpaper-status { min-height: 16px; color: #8fa8bd; font-size: 10px; line-height: 16px; }
.ai-site-wallpaper-admin > p { margin: 0; color: #71869b; font-size: 10px; line-height: 1.5; }
