:root {
  color-scheme: dark;
  --bg: #0b0d12;
  --bg-2: #121722;
  --panel: rgba(19, 24, 34, 0.18);
  --panel-strong: rgba(18, 23, 33, 0.32);
  --panel-solid: rgba(15, 18, 27, 0.56);
  --text: #f5f7fb;
  --muted: #a7afbf;
  --accent: #c9a7ff;
  --accent-2: #8bd3ff;
  --user: rgba(39, 47, 66, 0.78);
  --assistant: rgba(45, 36, 59, 0.78);
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  --layer-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
  --custom-background-image: none;
  --bg-motion-duration: 26s;
  --bg-shimmer-duration: 18s;
  --bg-bubbles-duration: 24s;
  --bg-motion-play-state: running;
  --bg-parallax-x: 0px;
  --bg-parallax-y: 0px;
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #eef2fa;
  --bg-2: #dfe7f4;
  --panel: rgba(255, 255, 255, 0.24);
  --panel-strong: rgba(255, 255, 255, 0.42);
  --panel-solid: rgba(255, 255, 255, 0.62);
  --text: #182033;
  --muted: #556079;
  --accent: #7f6dff;
  --accent-2: #56bdf2;
  --user: rgba(229, 236, 247, 0.76);
  --assistant: rgba(239, 233, 255, 0.78);
  --border: rgba(36, 49, 82, 0.1);
  --shadow: 0 24px 60px rgba(91, 113, 158, 0.14);
  --layer-shadow: 0 16px 36px rgba(91, 113, 158, 0.08);
}

:root[data-theme='aero'] {
  color-scheme: light;
  --bg: #d6f5ff;
  --bg-2: #a8daf6;
  --panel: rgba(255, 255, 255, 0.1);
  --panel-strong: rgba(255, 255, 255, 0.12);
  --panel-solid: rgba(240, 253, 255, 0.22);
  --text: #0f3550;
  --muted: #2b6e8e;
  --accent: #5dd2ff;
  --accent-2: #7af0b3;
  --user: rgba(225, 247, 255, 0.42);
  --assistant: rgba(235, 252, 255, 0.38);
  --border: rgba(109, 214, 255, 0.34);
  --shadow: 0 28px 70px rgba(62, 144, 187, 0.14);
  --layer-shadow: 0 16px 36px rgba(72, 166, 205, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: Inter, system-ui, sans-serif;
  background: linear-gradient(180deg, var(--bg), var(--bg-2) 58%, var(--bg));
  color: var(--text);
}

html.theme-switching body,
html.theme-switching .background-stage::before,
html.theme-switching .background-stage::after,
html.theme-switching .background-stage__art,
html.theme-switching .layer,
html.theme-switching .profile-card,
html.theme-switching .agent-tab,
html.theme-switching .chat-frame,
html.theme-switching .composer,
html.theme-switching .message__bubble,
html.theme-switching .select-input,
html.theme-switching .secondary-button,
html.theme-switching .icon-button {
  transition: background 0.28s ease, color 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease, opacity 0.28s ease, filter 0.28s ease;
}

body {
  position: relative;
  overflow: hidden;
}

body.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

button,
input,
textarea,
select {
  font: inherit;
}

a {
  color: inherit;
}

option {
  background: #151923;
  color: #f5f7fb;
}

*::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

*::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(201, 167, 255, 0.38), rgba(139, 211, 255, 0.34));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

:root[data-theme='light'] *::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(127, 109, 255, 0.24), rgba(86, 189, 242, 0.28));
}

:root[data-theme='aero'] *::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.18);
}

:root[data-theme='aero'] *::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(118, 235, 255, 0.74));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

:root[data-theme='light'] option {
  background: #ffffff;
  color: #182033;
}

:root[data-theme='aero'] option {
  background: #e9fbff;
  color: #0f3550;
}

.background-stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.background-stage::before,
.background-stage::after,
.background-stage__art,
.background-stage__scene,
.background-stage__clouds,
.background-stage__bubbles,
.background-stage__grain {
  position: absolute;
  inset: 0;
}

.background-stage::before,
.background-stage::after {
  content: '';
  pointer-events: none;
}

.background-stage__art {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(1.04);
  animation: bgDriftDark var(--bg-motion-duration) ease-in-out infinite alternate;
  animation-play-state: var(--bg-motion-play-state);
}

.background-stage__scene,
.background-stage__clouds,
.background-stage__bubbles {
  opacity: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  transition: opacity 0.28s ease;
  pointer-events: none;
}

.background-stage__scene {
  transform: translate3d(calc(var(--bg-parallax-x) * 0.12), calc(var(--bg-parallax-y) * 0.12), 0) scale(1.02);
}

.background-stage__clouds {
  transform: translate3d(calc(var(--bg-parallax-x) * 0.34), calc(var(--bg-parallax-y) * 0.24), 0) scale(1.04);
}

.background-stage__bubbles {
  transform: translate3d(calc(var(--bg-parallax-x) * 0.56), calc(var(--bg-parallax-y) * 0.42), 0) scale(1.01);
  mix-blend-mode: screen;
}

:root[data-background-style='aurora'] .background-stage__art {
  background-image:
    var(--custom-background-image),
    radial-gradient(circle at 12% 18%, rgba(139, 211, 255, 0.22), transparent 20%),
    radial-gradient(circle at 74% 14%, rgba(201, 167, 255, 0.24), transparent 24%),
    radial-gradient(circle at 82% 70%, rgba(102, 135, 255, 0.18), transparent 22%),
    radial-gradient(circle at 28% 78%, rgba(255, 158, 205, 0.12), transparent 18%),
    linear-gradient(145deg, rgba(10, 12, 18, 0.96), rgba(16, 21, 32, 0.88));
}

:root[data-background-style='nebula'] .background-stage__art {
  background-image:
    var(--custom-background-image),
    radial-gradient(circle at 20% 24%, rgba(255, 165, 207, 0.22), transparent 24%),
    radial-gradient(circle at 68% 16%, rgba(125, 157, 255, 0.22), transparent 22%),
    radial-gradient(circle at 78% 74%, rgba(110, 225, 206, 0.15), transparent 20%),
    linear-gradient(160deg, rgba(10, 12, 20, 0.98), rgba(23, 20, 42, 0.9));
}

:root[data-background-style='monolith'] .background-stage__art {
  background-image:
    var(--custom-background-image),
    linear-gradient(120deg, rgba(255, 255, 255, 0.05) 0 8%, transparent 8% 18%, rgba(255, 255, 255, 0.03) 18% 26%, transparent 26% 100%),
    radial-gradient(circle at 82% 18%, rgba(139, 211, 255, 0.16), transparent 18%),
    linear-gradient(180deg, rgba(11, 13, 18, 0.98), rgba(20, 25, 36, 0.92));
}

:root[data-background-style='meadow'] .background-stage__art {
  background-image:
    var(--custom-background-image),
    radial-gradient(circle at 18% 20%, rgba(201, 167, 255, 0.16), transparent 18%),
    radial-gradient(circle at 74% 16%, rgba(139, 211, 255, 0.2), transparent 18%),
    linear-gradient(180deg, rgba(14, 19, 34, 0.92), rgba(36, 65, 112, 0.88) 54%, rgba(28, 91, 61, 0.92) 76%, rgba(12, 42, 28, 0.98));
}

:root[data-background-style='cirrus'] .background-stage__art {
  background-image:
    var(--custom-background-image),
    radial-gradient(circle at 18% 26%, rgba(255, 255, 255, 0.1), transparent 12%),
    radial-gradient(circle at 62% 18%, rgba(139, 211, 255, 0.18), transparent 16%),
    radial-gradient(circle at 80% 32%, rgba(255, 255, 255, 0.08), transparent 14%),
    linear-gradient(180deg, rgba(13, 18, 31, 0.94), rgba(32, 56, 102, 0.84) 52%, rgba(22, 38, 72, 0.96));
}

:root[data-background-style='sunrise'] .background-stage__art {
  background-image:
    var(--custom-background-image),
    radial-gradient(circle at 50% 26%, rgba(255, 210, 140, 0.18), transparent 12%),
    radial-gradient(circle at 76% 18%, rgba(255, 160, 203, 0.12), transparent 16%),
    linear-gradient(180deg, rgba(23, 22, 43, 0.92), rgba(81, 88, 151, 0.76) 42%, rgba(238, 157, 122, 0.72) 72%, rgba(80, 78, 138, 0.9));
}

:root[data-background-style='lagoon'] .background-stage__art {
  background-image:
    var(--custom-background-image),
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.14), transparent 14%),
    radial-gradient(circle at 74% 16%, rgba(120, 237, 255, 0.18), transparent 18%),
    linear-gradient(180deg, rgba(9, 23, 42, 0.92), rgba(31, 88, 137, 0.8) 46%, rgba(43, 163, 173, 0.72) 72%, rgba(10, 62, 80, 0.92));
}

:root[data-background-style='custom'] .background-stage__art {
  background-image:
    linear-gradient(180deg, rgba(11, 13, 18, 0.3), rgba(20, 25, 36, 0.42)),
    var(--custom-background-image);
  background-size: cover, contain;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}

:root[data-theme='light'][data-background-style='aurora'] .background-stage__art {
  background-image:
    var(--custom-background-image),
    radial-gradient(circle at 12% 18%, rgba(86, 189, 242, 0.18), transparent 20%),
    radial-gradient(circle at 74% 14%, rgba(127, 109, 255, 0.16), transparent 24%),
    radial-gradient(circle at 82% 70%, rgba(86, 189, 242, 0.14), transparent 22%),
    radial-gradient(circle at 28% 78%, rgba(255, 158, 205, 0.1), transparent 18%),
    linear-gradient(145deg, rgba(246, 249, 255, 0.96), rgba(224, 233, 246, 0.88));
}

:root[data-theme='light'][data-background-style='nebula'] .background-stage__art {
  background-image:
    var(--custom-background-image),
    radial-gradient(circle at 20% 24%, rgba(255, 165, 207, 0.16), transparent 24%),
    radial-gradient(circle at 68% 16%, rgba(127, 109, 255, 0.14), transparent 22%),
    radial-gradient(circle at 78% 74%, rgba(110, 225, 206, 0.14), transparent 20%),
    linear-gradient(160deg, rgba(246, 249, 255, 0.98), rgba(232, 238, 249, 0.9));
}

:root[data-theme='light'][data-background-style='monolith'] .background-stage__art {
  background-image:
    var(--custom-background-image),
    linear-gradient(120deg, rgba(31, 44, 72, 0.05) 0 8%, transparent 8% 18%, rgba(31, 44, 72, 0.03) 18% 26%, transparent 26% 100%),
    radial-gradient(circle at 82% 18%, rgba(86, 189, 242, 0.16), transparent 18%),
    linear-gradient(180deg, rgba(246, 249, 255, 0.98), rgba(224, 233, 246, 0.92));
}

:root[data-theme='light'][data-background-style='meadow'] .background-stage__art {
  background-image:
    var(--custom-background-image),
    radial-gradient(circle at 16% 18%, rgba(255, 255, 255, 0.46), transparent 16%),
    radial-gradient(circle at 78% 14%, rgba(86, 189, 242, 0.16), transparent 18%),
    linear-gradient(180deg, rgba(244, 250, 255, 0.98), rgba(177, 222, 248, 0.9) 56%, rgba(146, 214, 164, 0.94) 78%, rgba(224, 239, 228, 0.98));
}

:root[data-theme='light'][data-background-style='cirrus'] .background-stage__art {
  background-image:
    var(--custom-background-image),
    radial-gradient(circle at 18% 26%, rgba(255, 255, 255, 0.52), transparent 12%),
    radial-gradient(circle at 64% 18%, rgba(127, 109, 255, 0.14), transparent 16%),
    radial-gradient(circle at 80% 30%, rgba(255, 255, 255, 0.44), transparent 14%),
    linear-gradient(180deg, rgba(246, 249, 255, 0.98), rgba(202, 225, 247, 0.94) 48%, rgba(227, 237, 249, 0.98));
}

:root[data-theme='light'][data-background-style='sunrise'] .background-stage__art {
  background-image:
    var(--custom-background-image),
    radial-gradient(circle at 50% 24%, rgba(255, 222, 166, 0.36), transparent 12%),
    radial-gradient(circle at 78% 18%, rgba(255, 179, 209, 0.18), transparent 16%),
    linear-gradient(180deg, rgba(246, 248, 255, 0.98), rgba(205, 221, 255, 0.92) 42%, rgba(255, 207, 176, 0.9) 76%, rgba(255, 242, 226, 0.98));
}

:root[data-theme='light'][data-background-style='lagoon'] .background-stage__art {
  background-image:
    var(--custom-background-image),
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.48), transparent 14%),
    radial-gradient(circle at 72% 16%, rgba(86, 189, 242, 0.2), transparent 18%),
    linear-gradient(180deg, rgba(243, 251, 255, 0.98), rgba(189, 231, 244, 0.92) 44%, rgba(157, 223, 219, 0.92) 72%, rgba(228, 247, 245, 0.98));
}

:root[data-theme='light'][data-background-style='custom'] .background-stage__art {
  background-image:
    linear-gradient(180deg, rgba(246, 249, 255, 0.18), rgba(224, 233, 246, 0.28)),
    var(--custom-background-image);
  background-size: cover, contain;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}

:root[data-theme='aero'][data-background-style='aurora'] .background-stage__art,
:root[data-theme='aero'][data-background-style='nebula'] .background-stage__art,
:root[data-theme='aero'][data-background-style='monolith'] .background-stage__art {
  background-image:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.8), transparent 20%),
    radial-gradient(circle at 78% 18%, rgba(124, 238, 255, 0.42), transparent 22%),
    radial-gradient(circle at 74% 78%, rgba(125, 255, 182, 0.28), transparent 18%),
    linear-gradient(180deg, rgba(233, 254, 255, 0.9), rgba(168, 219, 246, 0.9) 52%, rgba(114, 198, 235, 0.95)),
    linear-gradient(0deg, rgba(106, 196, 111, 0.78) 0 14%, rgba(255, 255, 255, 0) 14% 100%);
}

:root[data-theme='aero'][data-background-style='meadow'] .background-stage__art {
  background-image: none;
  opacity: 0;
}

:root[data-theme='aero'][data-background-style='meadow'] .background-stage__scene {
  opacity: 1;
  background-image: url('/assets/backgrounds/aero-meadow-scene.png');
  animation: meadowSceneDrift 20s ease-in-out infinite alternate;
  animation-play-state: var(--bg-motion-play-state);
}

:root[data-theme='aero'][data-background-style='meadow'] .background-stage__clouds {
  opacity: 0.92;
  background-image: url('/assets/backgrounds/aero-meadow-clouds.png');
  background-position: center -8vh;
  animation: meadowCloudsFloat 24s ease-in-out infinite alternate;
  animation-play-state: var(--bg-motion-play-state);
}

:root[data-theme='aero'][data-background-style='meadow'] .background-stage__bubbles {
  opacity: 0.58;
  background-image: url('/assets/backgrounds/aero-meadow-bubbles.png');
  background-size: 70%;
  background-position: center 16%;
  animation: meadowBubblesFloat 14s ease-in-out infinite alternate;
  animation-play-state: var(--bg-motion-play-state);
}

:root[data-theme='aero'][data-background-style='cirrus'] .background-stage__art {
  background-image:
    radial-gradient(circle at 14% 20%, rgba(255, 255, 255, 0.84), transparent 16%),
    radial-gradient(circle at 80% 14%, rgba(145, 241, 255, 0.42), transparent 18%),
    linear-gradient(180deg, rgba(240, 253, 255, 0.96), rgba(177, 227, 250, 0.92) 48%, rgba(141, 207, 243, 0.94));
}

:root[data-theme='aero'][data-background-style='sunrise'] .background-stage__art {
  background-image:
    radial-gradient(circle at 50% 28%, rgba(255, 240, 185, 0.9), transparent 10%),
    radial-gradient(circle at 70% 16%, rgba(255, 188, 214, 0.28), transparent 16%),
    linear-gradient(180deg, rgba(241, 250, 255, 0.98), rgba(197, 224, 255, 0.94) 36%, rgba(255, 191, 157, 0.94) 72%, rgba(255, 240, 220, 0.98)),
    radial-gradient(144% 26% at 50% 100%, rgba(94, 198, 227, 0.86) 0 18%, transparent 19%);
}

:root[data-theme='aero'][data-background-style='lagoon'] .background-stage__art {
  background-image:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.88), transparent 16%),
    radial-gradient(circle at 76% 14%, rgba(131, 241, 255, 0.42), transparent 18%),
    linear-gradient(180deg, rgba(239, 252, 255, 0.98), rgba(166, 224, 247, 0.94) 42%, rgba(115, 216, 218, 0.94) 72%, rgba(126, 181, 234, 0.96)),
    radial-gradient(132% 20% at 50% 100%, rgba(66, 188, 208, 0.82) 0 14%, transparent 15%);
}

:root[data-theme='aero'][data-background-style='custom'] .background-stage__art {
  background-image:
    radial-gradient(circle at 16% 18%, rgba(255, 255, 255, 0.68), transparent 20%),
    linear-gradient(180deg, rgba(224, 250, 255, 0.12), rgba(77, 190, 233, 0.28)),
    var(--custom-background-image);
  background-size: auto, cover, cover;
  background-position: center, center, center;
  background-repeat: no-repeat, no-repeat, no-repeat;
}

.background-stage__art::before,
.background-stage__art::after {
  content: '';
  position: absolute;
  border-radius: 999px;
  filter: blur(12px);
}

.background-stage__art::before {
  width: 38vw;
  height: 38vw;
  min-width: 280px;
  min-height: 280px;
  top: -10vw;
  right: -8vw;
  background: radial-gradient(circle, rgba(201, 167, 255, 0.2), transparent 68%);
}

.background-stage__art::after {
  width: 30vw;
  height: 30vw;
  min-width: 240px;
  min-height: 240px;
  bottom: -8vw;
  left: -6vw;
  background: radial-gradient(circle, rgba(139, 211, 255, 0.14), transparent 70%);
}

.background-stage__grain {
  opacity: 0.08;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 120px 120px;
  mask-image: radial-gradient(circle at center, black, transparent 90%);
  animation: grainFloat var(--bg-shimmer-duration) linear infinite;
  animation-play-state: var(--bg-motion-play-state);
}

:root[data-background-motion='off'] {
  --bg-motion-play-state: paused;
}

:root[data-background-motion-intensity='subtle'] {
  --bg-motion-duration: 34s;
  --bg-shimmer-duration: 24s;
  --bg-bubbles-duration: 32s;
}

:root[data-background-motion-intensity='normal'] {
  --bg-motion-duration: 22s;
  --bg-shimmer-duration: 15s;
  --bg-bubbles-duration: 20s;
}

:root[data-background-motion-intensity='vivid'] {
  --bg-motion-duration: 14s;
  --bg-shimmer-duration: 10s;
  --bg-bubbles-duration: 12s;
}

:root[data-theme='light'] .background-stage__art {
  animation-name: bgDriftLight;
}

:root[data-theme='aero'] .background-stage__art {
  animation-name: bgDriftAero;
}

:root[data-theme='dark'] .background-stage::before,
:root:not([data-theme]) .background-stage::before {
  background:
    radial-gradient(circle at 24% 28%, rgba(255, 255, 255, 0.04), transparent 18%),
    radial-gradient(circle at 72% 62%, rgba(139, 211, 255, 0.07), transparent 16%);
  filter: blur(4px);
  animation: shimmerDark var(--bg-shimmer-duration) ease-in-out infinite alternate;
  animation-play-state: var(--bg-motion-play-state);
}

:root[data-theme='light'] .background-stage::before {
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 255, 255, 0.44), transparent 16%),
    radial-gradient(circle at 80% 68%, rgba(127, 109, 255, 0.08), transparent 14%);
  animation: shimmerLight var(--bg-shimmer-duration) ease-in-out infinite alternate;
  animation-play-state: var(--bg-motion-play-state);
}

:root[data-theme='aero'] .background-stage::before {
  background:
    radial-gradient(circle at 14% 20%, rgba(255, 255, 255, 0.82), transparent 14%),
    radial-gradient(circle at 82% 26%, rgba(127, 243, 255, 0.46), transparent 12%),
    radial-gradient(circle at 22% 74%, rgba(117, 255, 188, 0.34), transparent 12%);
  filter: blur(2px);
  animation: aeroGlow var(--bg-shimmer-duration) ease-in-out infinite alternate;
  animation-play-state: var(--bg-motion-play-state);
}

:root[data-theme='aero'] .background-stage::after {
  inset: auto;
  width: 68vw;
  height: 68vw;
  max-width: 980px;
  max-height: 980px;
  left: -12vw;
  bottom: -36vw;
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.74) 0 2.8%, transparent 3%),
    radial-gradient(circle at 36% 18%, rgba(255, 255, 255, 0.56) 0 2.2%, transparent 2.5%),
    radial-gradient(circle at 48% 12%, rgba(170, 252, 255, 0.82) 0 2%, transparent 2.3%),
    radial-gradient(circle at 60% 16%, rgba(140, 255, 202, 0.74) 0 2.4%, transparent 2.7%),
    radial-gradient(circle at 76% 10%, rgba(255, 255, 255, 0.42) 0 1.6%, transparent 2%);
  opacity: 0.72;
  animation: aeroBubbles var(--bg-bubbles-duration) linear infinite;
  animation-play-state: var(--bg-motion-play-state);
}

.app-shell {
  position: relative;
  z-index: 1;
  height: 100vh;
  padding: 18px;
}

.app {
  height: 100%;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
}

.sidebar {
  height: 100%;
  padding: 22px;
  overflow: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.brand__emoji {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  font-size: 28px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(201, 167, 255, 0.35), rgba(139, 211, 255, 0.25));
}

:root[data-theme='aero'] .brand__emoji {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(149, 234, 255, 0.42));
  border: 1px solid rgba(112, 208, 255, 0.36);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 10px 24px rgba(83, 178, 214, 0.18);
}

.brand__title {
  font-size: 18px;
  font-weight: 700;
}

.brand__subtitle {
  font-size: 13px;
}

.brand__subtitle,
.muted,
.chat__header p,
.message__author,
.message__meta,
.facts,
.chat-list__preview {
  color: var(--muted);
}

.card {
  padding: 18px;
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--layer-shadow);
}

.layer {
  position: relative;
  backdrop-filter: blur(18px);
}

.layer--sidebar,
.layer--chats {
  background: var(--panel);
}

.layer--agents {
  background: rgba(18, 23, 33, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 10px;
  box-shadow: var(--layer-shadow);
}

:root[data-theme='aero'] .layer--sidebar,
:root[data-theme='aero'] .layer--chats,
:root[data-theme='aero'] .layer--agents,
:root[data-theme='aero'] .layer--chat,
:root[data-theme='aero'] .profile-card,
:root[data-theme='aero'] .composer {
  backdrop-filter: blur(22px) saturate(1.2);
}

:root[data-theme='aero'] .layer--sidebar,
:root[data-theme='aero'] .layer--chats,
:root[data-theme='aero'] .layer--agents,
:root[data-theme='aero'] .layer--chat {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(185, 241, 255, 0.04));
  border-color: rgba(112, 208, 255, 0.2);
}

:root[data-theme='light'] .layer--agents {
  background: rgba(255, 255, 255, 0.34);
}

.layer--chat {
  background: var(--panel-strong);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 28px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.sidebar-section + .sidebar-section {
  margin-top: 16px;
}

.card__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  color: var(--muted);
}

.new-chat-button,
.secondary-button,
.composer button,
.icon-button,
.chat-list__delete,
.agent-tab,
.chat-list__item {
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, opacity 0.22s ease, box-shadow 0.22s ease;
}

.new-chat-button,
.secondary-button,
.composer button {
  border: 0;
  border-radius: 16px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
}

.new-chat-button:hover,
.secondary-button:hover,
.composer button:hover,
.chat-list__item:hover,
.chat-list__delete:hover,
.agent-tab:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.new-chat-button,
.composer button {
  color: #0f1115;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

:root[data-theme='aero'] .new-chat-button,
:root[data-theme='aero'] .composer button {
  color: #0f3550;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(120, 245, 190, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 10px 24px rgba(80, 201, 171, 0.18);
}

.secondary-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
}

:root[data-theme='aero'] .secondary-button {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(188, 244, 255, 0.42));
  border-color: rgba(112, 208, 255, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.chat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-list__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.chat-list__item {
  width: 100%;
  text-align: left;
  padding: 11px 13px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
}

.chat-list__delete,
.icon-button {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  padding: 0;
  font-size: 20px;
}

.icon-button svg {
  width: 24px;
  height: 24px;
  display: block;
}

:root[data-theme='aero'] .icon-button,
:root[data-theme='aero'] .chat-list__delete {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(163, 233, 255, 0.32));
  border-color: rgba(112, 208, 255, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 8px 18px rgba(90, 183, 219, 0.14);
}

.icon-button--large {
  width: 60px;
  height: 60px;
  font-size: 22px;
}

.chat-list__delete:hover {
  color: #ffd0d0;
  border-color: rgba(255, 120, 120, 0.35);
}

.chat-list__item--active {
  background: rgba(201, 167, 255, 0.14);
  border-color: rgba(201, 167, 255, 0.45);
}

.chat-list__title {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}

.chat-list__preview {
  display: block;
  font-size: 13px;
  line-height: 1.4;
}

.memory-input {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 12px 14px;
}

.notes-panel {
  padding: 0;
  overflow: hidden;
}

.notes-panel__summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  cursor: pointer;
}

.notes-panel__summary::-webkit-details-marker,
.profile-settings summary::-webkit-details-marker {
  display: none;
}

.notes-panel__body {
  padding: 0 18px 18px;
}

.notes-panel__chevron {
  color: var(--muted);
  transition: transform 0.2s ease;
}

.notes-panel[open] .notes-panel__chevron {
  transform: rotate(180deg);
}

.select-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(20, 25, 36, 0.86);
  color: var(--text);
  padding: 12px 14px;
  appearance: none;
}

:root[data-theme='light'] .select-input {
  background: rgba(255, 255, 255, 0.92);
  color: #182033;
}

.chat-panel {
  height: 100%;
  min-height: 0;
  padding: 10px 4px 10px 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat__header {
  position: relative;
  z-index: 20;
  overflow: visible;
  padding: 4px 2px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 18px;
  align-items: start;
}

.chat__header-main {
  min-width: 0;
}

.chat__header h1 {
  margin: 0 0 8px;
  font-size: 22px;
}

.section-kicker {
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

:root[data-theme='aero'] .section-kicker,
:root[data-theme='aero'] .card__label,
:root[data-theme='aero'] .profile-card__meta,
:root[data-theme='aero'] .brand__subtitle,
:root[data-theme='aero'] .muted {
  color: #2f7395;
}

.agent-tabs-wrap {
  margin-bottom: 12px;
  min-height: 132px;
}

.agent-tabs {
  display: grid;
  gap: 10px;
}

.agent-tabs__rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  align-items: stretch;
}

.agent-tabs__rail:empty {
  display: none;
}

.agent-tab {
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 18px;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  min-width: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  will-change: transform, opacity;
}

.agent-tab--compact {
  min-height: 72px;
}

.agent-tab--compact .agent-tab__title {
  font-size: 15px;
}

.agent-tab--active {
  background: linear-gradient(180deg, rgba(201, 167, 255, 0.22), rgba(139, 211, 255, 0.14));
  border-color: rgba(201, 167, 255, 0.32);
}

:root[data-theme='aero'] .agent-tab {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(191, 244, 255, 0.22));
  border-color: rgba(112, 208, 255, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 10px 20px rgba(90, 183, 219, 0.08);
}

:root[data-theme='aero'] .agent-tab--active {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(125, 237, 196, 0.42));
  border-color: rgba(92, 216, 185, 0.36);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 14px 28px rgba(84, 188, 185, 0.14);
}

.agent-tab--expanded {
  min-height: 74px;
  display: grid;
  gap: 6px;
  align-content: center;
}

.agent-tab--ghost-target {
  opacity: 0.7;
}

:root[data-theme='light'] .agent-tab__eyebrow {
  color: rgba(24, 32, 51, 0.64);
}

.agent-tab--ghost {
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease, filter 0.3s ease;
  filter: blur(0px);
}

.agent-tab--settled {
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.34s ease, box-shadow 0.24s ease;
}

.agent-tab__eyebrow {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(245, 247, 251, 0.7);
}

.agent-tab__title {
  display: block;
  font-weight: 700;
}

.agent-tab__meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

:root[data-theme='aero'] .agent-tab__eyebrow {
  color: rgba(15, 53, 80, 0.58);
}

.agent-tab--expanded .agent-tab__meta {
  color: var(--text);
  opacity: 0.86;
}

.profile-card {
  position: relative;
  z-index: 40;
  overflow: visible;
  padding: 10px 12px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: rgba(18, 23, 33, 0.26);
  box-shadow: var(--layer-shadow);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  min-height: 72px;
}

:root[data-theme='light'] .profile-card {
  background: rgba(255, 255, 255, 0.28);
}

:root[data-theme='aero'] .profile-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(180, 241, 255, 0.12));
  border-color: rgba(112, 208, 255, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 18px 36px rgba(84, 188, 185, 0.08);
}

.profile-card__top {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.profile-card__top .card__label {
  margin-bottom: 0;
  flex: 0 0 auto;
}

.profile-card__name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-card__meta {
  margin-top: 0;
  font-size: 12px;
  line-height: 1.35;
  min-height: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-settings {
  position: relative;
  z-index: 100;
}

.profile-settings[open],
.profile-settings.profile-settings--open {
  z-index: 1000;
}

.profile-settings--closing {
  z-index: 1000;
}

.profile-settings__panel {
  position: absolute;
  top: calc(100% + 12px);
  right: -4px;
  width: 300px;
  max-height: 0;
  overflow: hidden;
  padding: 0 16px;
  border-radius: 22px;
  border: 1px solid transparent;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.01)), var(--panel-solid);
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  z-index: 1001;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top right;
  transition: max-height 0.28s ease, opacity 0.22s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), padding 0.28s ease, border-color 0.2s ease;
}

.profile-settings__panel::before {
  content: '';
  position: absolute;
  top: -9px;
  right: 24px;
  width: 18px;
  height: 18px;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  background: inherit;
  transform: rotate(45deg);
  border-top-left-radius: 5px;
}

.profile-settings__panel::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0));
  pointer-events: none;
}

:root[data-theme='aero'] .profile-settings__panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(202, 247, 255, 0.12)), var(--panel-solid);
  border-color: rgba(112, 208, 255, 0.28);
  box-shadow: 0 24px 50px rgba(77, 168, 199, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.profile-settings[open] .profile-settings__panel,
.profile-settings.profile-settings--open .profile-settings__panel,
.profile-settings--closing .profile-settings__panel {
  max-height: 620px;
  padding: 14px;
  border-color: var(--border);
}

.profile-settings[open] .profile-settings__panel,
.profile-settings.profile-settings--open .profile-settings__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.profile-settings--closing .profile-settings__panel {
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
}

.profile-settings__panel--expanded {
  max-height: 700px;
}

.profile-settings.profile-settings--open .profile-settings__panel.profile-settings__panel--expanded,
.profile-settings--closing .profile-settings__panel.profile-settings__panel--expanded {
  max-height: 700px;
}

.settings-field {
  display: grid;
  gap: 8px;
}

.settings-field__label {
  font-size: 13px;
  color: var(--muted);
}

.settings-upload {
  display: grid;
  gap: 8px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-6px);
  transition: max-height 0.24s ease, opacity 0.24s ease, transform 0.24s ease;
}

.settings-upload[hidden] {
  display: grid;
}

.settings-upload--visible {
  max-height: 120px;
  opacity: 1;
  transform: translateY(0);
}

.settings-upload__button {
  width: 100%;
  min-height: 46px;
}

.settings-upload__hint {
  font-size: 12px;
}

:root[data-theme='aero'] .memory-input,
:root[data-theme='aero'] .select-input {
  border-color: rgba(112, 208, 255, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(212, 247, 255, 0.58));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

:root[data-theme='aero'] .select-input {
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(212, 247, 255, 0.58)),
    radial-gradient(circle at 88% 50%, rgba(255, 255, 255, 0.84), transparent 16%);
}

:root[data-theme='aero'] .messages__empty,
:root[data-theme='aero'] .notes-panel,
:root[data-theme='aero'] .card {
  border-color: rgba(112, 208, 255, 0.24);
}

.chat-frame {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
}

.messages {
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 8px;
}

.messages::-webkit-scrollbar {
  width: 10px;
}

.messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.message {
  max-width: 820px;
}

.messages__empty {
  padding: 28px;
  border-radius: 18px;
  border: 1px dashed var(--border);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.message__bubble {
  margin-top: 6px;
  padding: 16px 18px;
  border-radius: 18px;
  line-height: 1.5;
  border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
  white-space: normal;
  overflow-wrap: anywhere;
}

.message__bubble > :first-child {
  margin-top: 0;
}

.message__bubble > :last-child {
  margin-bottom: 0;
}

.message__bubble p,
.message__bubble ul,
.message__bubble ol,
.message__bubble blockquote,
.message__bubble pre,
.message__bubble h1,
.message__bubble h2,
.message__bubble h3 {
  margin: 0 0 12px;
}

.message__bubble h1,
.message__bubble h2,
.message__bubble h3 {
  line-height: 1.25;
}

.message__bubble h1 {
  font-size: 1.2rem;
}

.message__bubble h2 {
  font-size: 1.08rem;
}

.message__bubble h3 {
  font-size: 1rem;
}

.message__bubble ul,
.message__bubble ol {
  padding-left: 20px;
}

.message__bubble blockquote {
  padding-left: 14px;
  border-left: 3px solid rgba(139, 211, 255, 0.42);
  color: var(--muted);
}

.message__bubble code {
  padding: 0.12em 0.36em;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.94em;
}

.message__bubble pre {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  overflow-x: auto;
}

.message__bubble pre code {
  padding: 0;
  background: transparent;
}

.message__bubble a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(139, 211, 255, 0.55);
}

.message__attachments {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.attachment-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  width: fit-content;
  max-width: min(100%, 420px);
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  text-decoration: none;
}

.attachment-chip__name {
  font-weight: 600;
  word-break: break-word;
}

.attachment-chip__meta {
  font-size: 12px;
  color: var(--muted);
}

.attachment-preview {
  display: block;
  max-width: min(100%, 420px);
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.12);
}

.attachment-preview--image,
.attachment-preview--video {
  width: 100%;
}

.attachment-preview--audio {
  width: min(100%, 420px);
}

.attachment-transcript {
  max-width: min(100%, 420px);
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  overflow: hidden;
}

.attachment-transcript__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  user-select: none;
}

.attachment-transcript__summary::-webkit-details-marker {
  display: none;
}

.attachment-transcript__summary::after {
  content: '▾';
  font-size: 12px;
  opacity: 0.75;
  transition: transform 160ms ease;
}

.attachment-transcript[open] .attachment-transcript__summary::after {
  transform: rotate(180deg);
}

.attachment-transcript__body {
  display: grid;
  gap: 4px;
  max-width: min(100%, 420px);
  padding: 0 12px 12px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.attachment-transcript--error {
  color: #ffb4b4;
}

.message__meta {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.4;
}

.message--assistant .message__bubble {
  background: var(--assistant);
}

:root[data-theme='aero'] .message--assistant .message__bubble,
:root[data-theme='aero'] .message--user .message__bubble {
  border-color: rgba(112, 208, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 10px 22px rgba(90, 183, 219, 0.1);
}

:root[data-theme='aero'] .message--assistant .message__bubble {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(197, 245, 255, 0.16));
}

:root[data-theme='aero'] .message--user .message__bubble {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(179, 255, 208, 0.18));
}

.message--user {
  align-self: flex-end;
}

.message--user .message__bubble {
  background: var(--user);
}

.assistant--status .message__bubble {
  color: var(--muted);
  border-style: dashed;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: var(--panel-solid);
  align-items: end;
}

.composer--dragover {
  border-color: rgba(139, 211, 255, 0.52);
  box-shadow: 0 0 0 1px rgba(139, 211, 255, 0.18), 0 20px 34px rgba(85, 144, 209, 0.16);
}

.composer__main {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.composer__actions {
  display: grid;
  gap: 10px;
  align-items: end;
}

.composer__attach {
  min-width: 86px;
}

.composer__attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.composer__upload-status {
  font-size: 12px;
}

.composer-attachment {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
}

.composer-attachment__name {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.composer-attachment__remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

:root[data-theme='aero'] .composer {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(201, 247, 255, 0.1));
  border-color: rgba(112, 208, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 20px 32px rgba(81, 173, 206, 0.08);
}

:root[data-theme='aero'] .attachment-chip,
:root[data-theme='aero'] .composer-attachment {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.44), rgba(201, 247, 255, 0.16));
  border-color: rgba(112, 208, 255, 0.24);
}

.composer textarea {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  min-width: 0;
  resize: none;
  overflow-y: auto;
  min-height: 24px;
  max-height: 220px;
  line-height: 1.5;
}

.composer button {
  height: fit-content;
}

.composer button:disabled {
  opacity: 0.7;
  cursor: progress;
}

.hidden {
  display: none;
}

@media (max-width: 1100px) {
  .chat__header {
    grid-template-columns: 1fr;
  }

  .profile-card {
    justify-self: end;
    width: min(100%, 300px);
    min-height: 72px;
  }

  .agent-tabs-wrap {
    min-height: 0;
  }
}

@keyframes bgDriftDark {
  0% { transform: scale(1.04) translate3d(0, 0, 0); filter: hue-rotate(0deg); }
  100% { transform: scale(1.08) translate3d(-1.5%, 1.8%, 0); filter: hue-rotate(8deg); }
}

@keyframes bgDriftLight {
  0% { transform: scale(1.02) translate3d(0, 0, 0); }
  100% { transform: scale(1.06) translate3d(1.2%, -1.4%, 0); }
}

@keyframes bgDriftAero {
  0% { transform: scale(1.01) translate3d(0, 0, 0); filter: saturate(1); }
  100% { transform: scale(1.05) translate3d(-1%, 1.4%, 0); filter: saturate(1.08); }
}

@keyframes grainFloat {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-1.5%, -1%, 0); }
}

@keyframes shimmerDark {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.66; }
  100% { transform: translate3d(2%, -1.5%, 0) scale(1.06); opacity: 0.92; }
}

@keyframes shimmerLight {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.54; }
  100% { transform: translate3d(-1.4%, 1.2%, 0) scale(1.04); opacity: 0.84; }
}

@keyframes aeroGlow {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.8; }
  100% { transform: translate3d(1.2%, -1.8%, 0) scale(1.08); opacity: 1; }
}

@keyframes aeroBubbles {
  0% { transform: translate3d(0, 0, 0); opacity: 0.38; }
  50% { opacity: 0.72; }
  100% { transform: translate3d(16vw, -34vw, 0); opacity: 0.18; }
}

@keyframes cloudSweep {
  0% { transform: translate3d(-2vw, 0, 0); opacity: 0.72; }
  100% { transform: translate3d(2.5vw, -1vw, 0); opacity: 0.96; }
}

@keyframes horizonDrift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(0.8vw, -0.6vw, 0) scale(1.02); }
}

@keyframes meadowSceneDrift {
  0% { transform: translate3d(calc(var(--bg-parallax-x) * 0.12), calc(var(--bg-parallax-y) * 0.12), 0) scale(1.02); }
  100% { transform: translate3d(calc(var(--bg-parallax-x) * 0.12 - 0.9%), calc(var(--bg-parallax-y) * 0.12 + 0.7%), 0) scale(1.05); }
}

@keyframes meadowCloudsFloat {
  0% { transform: translate3d(calc(var(--bg-parallax-x) * 0.34 - 1.6%), calc(var(--bg-parallax-y) * 0.24 - 2.2%), 0) scale(1.04); }
  100% { transform: translate3d(calc(var(--bg-parallax-x) * 0.34 + 2.8%), calc(var(--bg-parallax-y) * 0.24 - 4.8%), 0) scale(1.07); }
}

@keyframes meadowBubblesFloat {
  0% { transform: translate3d(calc(var(--bg-parallax-x) * 0.56 - 1%), calc(var(--bg-parallax-y) * 0.42 + 2.4%), 0) scale(0.78); opacity: 0.36; }
  100% { transform: translate3d(calc(var(--bg-parallax-x) * 0.56 + 1.6%), calc(var(--bg-parallax-y) * 0.42 - 5.4%), 0) scale(0.88); opacity: 0.64; }
}

:root[data-theme='aero'][data-background-style='meadow'] .background-stage::before,
:root[data-theme='aero'][data-background-style='lagoon'] .background-stage::before,
:root[data-theme='aero'][data-background-style='sunrise'] .background-stage::before {
  filter: blur(3px);
  animation: horizonDrift var(--bg-shimmer-duration) ease-in-out infinite alternate;
  animation-play-state: var(--bg-motion-play-state);
}

:root[data-theme='aero'][data-background-style='meadow'] .background-stage::before {
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.16), transparent 8%),
    radial-gradient(circle at 82% 12%, rgba(152, 240, 255, 0.14), transparent 8%);
}

:root[data-theme='aero'][data-background-style='sunrise'] .background-stage::before {
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 245, 198, 0.9), transparent 9%),
    radial-gradient(circle at 50% 30%, rgba(255, 203, 122, 0.38), transparent 16%);
}

:root[data-theme='aero'][data-background-style='lagoon'] .background-stage::before {
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.82), transparent 12%),
    radial-gradient(circle at 82% 24%, rgba(137, 244, 255, 0.34), transparent 14%);
}

:root[data-theme='aero'][data-background-style='meadow'] .background-stage::after,
:root[data-theme='aero'][data-background-style='cirrus'] .background-stage::after,
:root[data-theme='aero'][data-background-style='sunrise'] .background-stage::after,
:root[data-theme='aero'][data-background-style='lagoon'] .background-stage::after {
  inset: 0;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  left: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 14% 22%, rgba(255, 255, 255, 0.94) 0 5.6%, transparent 6.2%),
    radial-gradient(circle at 21% 22%, rgba(255, 255, 255, 0.9) 0 4.6%, transparent 5.2%),
    radial-gradient(circle at 30% 21%, rgba(255, 255, 255, 0.84) 0 4.1%, transparent 4.7%),
    radial-gradient(circle at 60% 16%, rgba(255, 255, 255, 0.9) 0 5.8%, transparent 6.4%),
    radial-gradient(circle at 68% 18%, rgba(255, 255, 255, 0.86) 0 4.8%, transparent 5.4%),
    radial-gradient(circle at 77% 17%, rgba(255, 255, 255, 0.82) 0 4.1%, transparent 4.7%),
    radial-gradient(circle at 49% 31%, rgba(255, 255, 255, 0.74) 0 5.4%, transparent 6%);
  filter: blur(2px);
  opacity: 0.96;
  animation: cloudSweep var(--bg-bubbles-duration) ease-in-out infinite alternate;
  animation-play-state: var(--bg-motion-play-state);
}

:root[data-theme='aero'][data-background-style='meadow'] .background-stage::after {
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 255, 255, 0.2) 0 2.6%, transparent 3%),
    radial-gradient(circle at 74% 16%, rgba(255, 255, 255, 0.16) 0 2.2%, transparent 2.6%),
    radial-gradient(circle at 64% 28%, rgba(120, 238, 255, 0.16) 0 2%, transparent 2.4%);
  filter: blur(1px);
  opacity: 0.6;
}

:root[data-theme='aero'][data-background-style='meadow'] .background-stage__grain {
  opacity: 0.04;
}

:root[data-theme='aero'][data-background-style='meadow'] .background-stage__art::before {
  width: 0;
  height: 0;
  min-width: 0;
  min-height: 0;
  background: none;
}

:root[data-theme='aero'][data-background-style='meadow'] .background-stage__art::after {
  width: 0;
  height: 0;
  min-width: 0;
  min-height: 0;
  background: none;
}

.login-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
}

.login-card {
  display: grid;
  gap: 28px;
  padding: 32px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(12, 16, 24, 0.62), rgba(14, 19, 30, 0.5));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px) saturate(160%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
}

.login-card__brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.login-card__content {
  display: grid;
  gap: 10px;
}

.login-card__title {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.08;
}

.login-card__text,
.login-card__hint {
  margin: 0;
}

.login-card__actions {
  display: grid;
  gap: 12px;
}

.login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 22px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(135deg, rgba(201, 167, 255, 0.96), rgba(139, 211, 255, 0.94));
  color: #0f172a;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 18px 40px rgba(72, 131, 214, 0.24);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.login-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 24px 48px rgba(72, 131, 214, 0.3);
  filter: saturate(1.04);
}

.login-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 3px;
}

:root[data-theme='light'] .login-card,
:root[data-theme='aero'] .login-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.4));
  border-color: rgba(255, 255, 255, 0.48);
}

:root[data-theme='light'] .login-button,
:root[data-theme='aero'] .login-button {
  color: #132238;
}

@media (max-width: 900px) {
  html,
  body {
    overflow: auto;
  }

  body {
    overflow: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
    padding: 0;
  }

  .app {
    height: auto;
    min-height: 100vh;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .sidebar {
    border-right: 0;
    padding: 18px 16px 0;
  }

  .chat-panel {
    min-height: 70vh;
    padding: 0 16px 18px;
  }

  .agent-tabs__rail {
    grid-template-columns: 1fr 1fr;
  }

  .profile-card {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .profile-card__top {
    flex-wrap: wrap;
  }

  .profile-settings__panel {
    right: -6px;
    width: min(300px, calc(100vw - 48px));
  }
}

@media (max-width: 640px) {
  body.login-body {
    padding: 16px;
  }

  .login-card {
    gap: 24px;
    padding: 24px;
    border-radius: 24px;
  }
}
