/* ==========================================================================
   Qanoonak — AI Legal Assistant
   Apple-inspired liquid glass, ambient glow and neon accents
   ========================================================================== */

:root {
  --as-bg: #040913;
  --as-bg-soft: #071121;
  --as-ink: #eef4ff;
  --as-ink-soft: #c9d6eb;
  --as-muted: #8d9fbe;
  --as-faint: #64748b;
  --as-blue: #3b82f6;
  --as-blue-soft: #60a5fa;
  --as-indigo: #6366f1;
  --as-gold: #d9b44a;
  --as-mint: #34d399;
  --as-rose: #fb7185;
  --as-line: rgba(148, 163, 184, 0.16);
  --as-glass: rgba(15, 23, 42, 0.72);
  --as-glass-strong: rgba(15, 23, 42, 0.92);
  --as-radius: 28px;
  --as-shadow: 0 40px 100px -46px rgba(0, 0, 0, 0.95),
    0 0 50px rgba(59, 130, 246, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --as-font: "Tajawal", "Segoe UI", Tahoma, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body.as-body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--as-bg);
  color: var(--as-ink);
  font-family: var(--as-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.as-body.is-locked {
  overflow: hidden;
}

::selection {
  background: rgba(59, 130, 246, 0.5);
  color: #fff;
}

.as-body ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.as-body ::-webkit-scrollbar-track {
  background: transparent;
}

.as-body ::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.28);
  border-radius: 999px;
}

.as-body ::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.45);
}

.as-body :focus-visible {
  outline: 2px solid rgba(147, 197, 253, 0.85);
  outline-offset: 3px;
}

.as-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.as-skip {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 200;
  transform: translateY(-150%);
  border-radius: 12px;
  background: #eaf2ff;
  color: #0f172a;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.as-skip:focus {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Ambient background
   -------------------------------------------------------------------------- */
.as-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1200px 760px at 82% -12%, rgba(30, 64, 175, 0.34), transparent 62%),
    radial-gradient(900px 620px at 8% 16%, rgba(67, 56, 202, 0.2), transparent 64%),
    radial-gradient(800px 620px at 52% 108%, rgba(201, 162, 39, 0.1), transparent 64%),
    linear-gradient(180deg, #050b17 0%, #040913 48%, #030710 100%);
}

.as-bg__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.055) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 75% 62% at 50% 18%, #000 10%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 75% 62% at 50% 18%, #000 10%, transparent 78%);
  opacity: 0.7;
}

.as-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.38;
  will-change: transform;
  animation: asOrbFloat 24s ease-in-out infinite;
}

.as-orb--blue {
  width: 560px;
  height: 560px;
  top: -180px;
  right: -140px;
  background: radial-gradient(circle at 32% 32%, #2563eb, #1e40af 48%, transparent 72%);
}

.as-orb--indigo {
  width: 480px;
  height: 480px;
  top: 28%;
  left: -210px;
  background: radial-gradient(circle at 50% 50%, #4f46e5, #312e81 46%, transparent 72%);
  animation-delay: -8s;
  animation-duration: 28s;
}

.as-orb--gold {
  width: 380px;
  height: 380px;
  bottom: -150px;
  right: 18%;
  background: radial-gradient(circle at 50% 50%, #d9b44a, #92400e 44%, transparent 72%);
  opacity: 0.2;
  animation-delay: -14s;
  animation-duration: 32s;
}

.as-bg__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, transparent 30%, rgba(3, 7, 16, 0.58) 100%),
    linear-gradient(180deg, transparent 55%, rgba(3, 7, 16, 0.85) 100%);
}

@keyframes asOrbFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  33% {
    transform: translate3d(-38px, 34px, 0) scale(1.07);
  }
  66% {
    transform: translate3d(26px, -28px, 0) scale(0.94);
  }
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.as-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px 18px 0;
}

.as-header::before {
  content: "";
  position: absolute;
  inset: 0 0 -26px;
  z-index: -1;
  background: linear-gradient(180deg, rgba(4, 9, 19, 0.92) 20%, rgba(4, 9, 19, 0.55) 62%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: none;
}

.as-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.82), rgba(15, 23, 42, 0.56));
  box-shadow:
    0 22px 60px -32px rgba(0, 0, 0, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 40px -20px rgba(59, 130, 246, 0.35);
  backdrop-filter: blur(28px) saturate(170%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
}

.as-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 4px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.as-brand__mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(140deg, #3b82f6, #4338ca 62%, #1e1b4b);
  box-shadow:
    0 10px 26px -10px rgba(59, 130, 246, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(191, 219, 254, 0.28);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.as-brand:hover .as-brand__mark {
  transform: translateY(-1px) rotate(-2deg);
  box-shadow:
    0 16px 34px -12px rgba(59, 130, 246, 0.95),
    0 0 24px rgba(99, 102, 241, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.as-brand__dot {
  position: absolute;
  bottom: -3px;
  left: -3px;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--as-gold);
  border: 2px solid #060d1b;
  box-shadow: 0 0 10px rgba(217, 180, 74, 0.8);
}

.as-brand__copy {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.as-brand__name {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #f4f8ff;
}

.as-brand__sub {
  margin-top: 4px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.32em;
  color: rgba(148, 163, 184, 0.72);
}

.as-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.as-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 9px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #a9b8d1;
  text-decoration: none;
  transition: color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.as-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.as-nav a.is-active {
  color: #eaf2ff;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.24), rgba(99, 102, 241, 0.14));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 0 22px -8px rgba(59, 130, 246, 0.55);
}

.as-nav a.is-active::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--as-blue-soft);
  box-shadow: 0 0 8px var(--as-blue-soft);
  transform: translateX(-50%);
}

.as-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.as-aman-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.28);
  background: rgba(16, 185, 129, 0.1);
  color: #86efac;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  transition: background 0.22s ease, box-shadow 0.22s ease;
}

.as-aman-chip span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--as-mint);
  box-shadow: 0 0 8px var(--as-mint);
  animation: asPulseDot 1.8s ease-in-out infinite;
}

.as-aman-chip:hover {
  background: rgba(16, 185, 129, 0.18);
  box-shadow: 0 0 20px -6px rgba(52, 211, 153, 0.5);
}

.as-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035));
  color: #c7d5ec;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease,
    color 0.2s ease, box-shadow 0.2s ease;
}

.as-icon-btn:hover {
  transform: translateY(-1px);
  color: #fff;
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(59, 130, 246, 0.16);
  box-shadow: 0 0 20px -6px rgba(59, 130, 246, 0.55);
}

.as-icon-btn:active {
  transform: scale(0.95);
}

.as-header__menu {
  display: none;
}

@keyframes asPulseDot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.78);
  }
}

/* --------------------------------------------------------------------------
   Layout + hero
   -------------------------------------------------------------------------- */
.as-main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 30px 18px 44px;
}

.as-hero {
  position: relative;
  max-width: 830px;
  margin: 0 auto 26px;
  text-align: center;
}

.as-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid rgba(147, 197, 253, 0.2);
  background: rgba(37, 99, 235, 0.1);
  color: #a9c8ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.as-eyebrow i {
  width: 14px;
  height: 14px;
  color: var(--as-gold);
}

.as-title {
  margin: 16px 0 0;
  font-size: clamp(2rem, 4.4vw, 3.5rem);
  font-weight: 900;
  line-height: 1.14;
  letter-spacing: -0.03em;
  color: #f7faff;
}

.as-title span {
  background: linear-gradient(102deg, #93c5fd 4%, #60a5fa 30%, #c7d2fe 58%, #f0d28a 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 34px rgba(96, 165, 250, 0.26));
}

.as-subtitle {
  max-width: 690px;
  margin: 14px auto 0;
  color: #9fb0cb;
  font-size: clamp(13.5px, 1.5vw, 16px);
  line-height: 1.85;
}

.as-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.as-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.035);
  color: #9fb1cc;
  font-size: 10.5px;
  font-weight: 700;
}

.as-badge i {
  width: 12px;
  height: 12px;
}

.as-badge--blue i {
  color: #7dd3fc;
}

.as-badge--gold i {
  color: var(--as-gold);
}

.as-badge--mint i {
  color: var(--as-mint);
}

.as-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 344px;
  gap: 18px;
  align-items: stretch;
}

.chat-column {
  position: relative;
  min-width: 0;
}

/* --------------------------------------------------------------------------
   Chat shell
   -------------------------------------------------------------------------- */
.chat-shell {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  height: clamp(620px, calc(100vh - 320px), 860px);
  min-height: 0;
  overflow: hidden;
  border-radius: var(--as-radius);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.84), rgba(7, 14, 28, 0.92));
  box-shadow:
    0 0 50px rgba(59, 130, 246, 0.2),
    0 46px 110px -50px rgba(0, 0, 0, 0.98),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(32px) saturate(165%);
  -webkit-backdrop-filter: blur(32px) saturate(165%);
}

.chat-shell::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 46%;
  z-index: -1;
  background:
    radial-gradient(80% 100% at 18% 0%, rgba(59, 130, 246, 0.13), transparent 70%),
    radial-gradient(70% 100% at 92% 0%, rgba(99, 102, 241, 0.1), transparent 72%);
  pointer-events: none;
}

.chat-shell::after {
  content: "";
  position: absolute;
  inset: auto 10% -40px;
  height: 140px;
  z-index: -1;
  background: radial-gradient(ellipse, rgba(59, 130, 246, 0.16), transparent 70%);
  filter: blur(26px);
  pointer-events: none;
}

.chat-topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008));
}

.chat-identity {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.chat-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(140deg, #3b82f6, #4f46e5 58%, #312e81);
  border: 1px solid rgba(191, 219, 254, 0.35);
  box-shadow:
    0 0 26px -6px rgba(59, 130, 246, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.chat-avatar::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 17px;
  border: 1px solid rgba(96, 165, 250, 0.32);
  animation: asAvatarPulse 3.2s ease-out infinite;
  pointer-events: none;
}

.chat-avatar i {
  width: 21px;
  height: 21px;
}

.chat-avatar__status {
  position: absolute;
  bottom: -2px;
  left: -2px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--as-mint);
  border: 2.5px solid #0a1426;
  box-shadow: 0 0 9px rgba(52, 211, 153, 0.9);
}

@keyframes asAvatarPulse {
  0% {
    opacity: 0.7;
    transform: scale(0.94);
  }
  70%,
  100% {
    opacity: 0;
    transform: scale(1.18);
  }
}

.chat-identity__text {
  min-width: 0;
}

.chat-identity__title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 14.5px;
  font-weight: 900;
  color: #f2f7ff;
  white-space: nowrap;
}

.chat-identity__title .as-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.26);
  background: rgba(16, 185, 129, 0.1);
  color: #6ee7b7;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.chat-identity__title .as-live-badge::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--as-mint);
  box-shadow: 0 0 6px var(--as-mint);
}

.chat-identity__status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 3px 0 0;
  color: #8fa2c0;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.chat-identity__status i {
  width: 11px;
  height: 11px;
  color: #6ee7b7;
}

.chat-topbar__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.chat-top-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 11px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #aebdd6;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.chat-top-btn i {
  width: 14px;
  height: 14px;
}

.chat-top-btn:hover {
  color: #fff;
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(96, 165, 250, 0.36);
}

.chat-top-btn--danger:hover {
  color: #fecdd3;
  background: rgba(244, 63, 94, 0.13);
  border-color: rgba(251, 113, 133, 0.36);
}

/* Quick suggestions */
.quick-strip {
  position: relative;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(7, 14, 28, 0.35), rgba(7, 14, 28, 0.1));
}

.quick-strip__label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: #7f93b3;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.quick-strip__label i {
  width: 12px;
  height: 12px;
  color: var(--as-gold);
}

.quick-chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 1px 4px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 14px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 14px), transparent 100%);
}

.quick-chips::-webkit-scrollbar {
  display: none;
}

.quick-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.24);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(99, 102, 241, 0.07));
  color: #c7dbff;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  scroll-snap-align: start;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 8px 22px -20px rgba(59, 130, 246, 0.9);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), color 0.22s ease,
    border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.quick-chip::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(115deg, rgba(147, 197, 253, 0.95), rgba(99, 102, 241, 0.2) 42%, rgba(217, 180, 74, 0.75));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}

.quick-chip i {
  width: 12px;
  height: 12px;
  color: #7dd3fc;
}

.quick-chip:hover {
  transform: translateY(-2px);
  color: #fff;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.3), rgba(99, 102, 241, 0.16));
  box-shadow:
    0 0 22px -4px rgba(59, 130, 246, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.quick-chip:hover::before {
  opacity: 1;
}

.quick-chip:active {
  transform: translateY(0) scale(0.97);
}

/* --------------------------------------------------------------------------
   Conversation
   -------------------------------------------------------------------------- */
.chat-messages {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 20px 18px 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.msg {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: asMsgIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.msg--user {
  flex-direction: row-reverse;
}

.msg--user.just-sent {
  animation: asMsgOut 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.msg__avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.34), rgba(67, 56, 202, 0.24));
  color: #dbeafe;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.msg__avatar i {
  width: 17px;
  height: 17px;
}

.msg--user .msg__avatar {
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.42), rgba(30, 64, 175, 0.3));
  color: #eff6ff;
}

.msg__content {
  min-width: 0;
  max-width: min(720px, 89%);
}

.msg--user .msg__content {
  max-width: min(580px, 84%);
}

.msg__meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 3px 6px;
  color: #7e91b0;
  font-size: 10px;
  font-weight: 600;
}

.msg--user .msg__meta {
  justify-content: flex-end;
}

.msg__meta strong {
  color: #a9bad4;
  font-size: 10.5px;
  font-weight: 800;
}

.msg__meta .msg__urgent {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(251, 113, 133, 0.3);
  background: rgba(244, 63, 94, 0.12);
  color: #fda4af;
  font-size: 8.5px;
  font-weight: 800;
}

.msg__bubble {
  position: relative;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.085);
  background: linear-gradient(180deg, rgba(20, 33, 57, 0.8), rgba(11, 20, 38, 0.78));
  box-shadow:
    0 18px 46px -38px rgba(0, 0, 0, 1),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: #d3dff0;
  font-size: 13.5px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.msg--ai .msg__bubble {
  border-bottom-right-radius: 6px;
}

.msg__bubble--welcome {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.msg.is-highlight .msg__bubble {
  animation: asHighlight 2.4s ease;
}

@keyframes asHighlight {
  0%,
  100% {
    box-shadow:
      0 18px 46px -38px rgba(0, 0, 0, 1),
      inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }
  18%,
  62% {
    border-color: rgba(217, 180, 74, 0.6);
    box-shadow:
      0 0 0 4px rgba(217, 180, 74, 0.12),
      0 0 36px -8px rgba(217, 180, 74, 0.65);
  }
}

.msg--user .msg__bubble {
  border-color: rgba(147, 197, 253, 0.35);
  border-bottom-left-radius: 6px;
  background: linear-gradient(140deg, #2f6fe4, #3f46cf 62%, #3730a3);
  color: #f8fbff;
  box-shadow:
    0 16px 40px -24px rgba(37, 99, 235, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.msg--user .msg__bubble p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.85;
}

.msg__bubble p {
  margin: 0 0 9px;
}

.msg__bubble p:last-child {
  margin-bottom: 0;
}

.answer-title {
  margin: 0 0 8px;
  color: #f4f8ff;
  font-size: 16.5px;
  font-weight: 900;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.answer-intro {
  margin: 0 0 13px;
  color: #c4d2e8;
  font-size: 13.5px;
  line-height: 1.9;
}

.answer-section {
  margin-top: 14px;
}

.answer-section__head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 8px;
  color: #9cc3ff;
  font-size: 12.5px;
  font-weight: 800;
}

.answer-section__head::before {
  content: "";
  width: 3px;
  height: 13px;
  border-radius: 999px;
  background: linear-gradient(180deg, #60a5fa, #6366f1);
  box-shadow: 0 0 8px rgba(96, 165, 250, 0.55);
}

.answer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
}

.answer-list li {
  position: relative;
  padding-inline-start: 17px;
  color: #c3d0e4;
  font-size: 13px;
  line-height: 1.9;
}

.answer-list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 2px;
  top: 0.74em;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, #60a5fa, #818cf8);
  box-shadow: 0 0 8px rgba(96, 165, 250, 0.65);
}

.answer-list li strong {
  color: #e7eeff;
  font-weight: 800;
}

/* Legal references */
.cite-box {
  margin-top: 15px;
  padding: 11px 13px;
  border-radius: 13px;
  border: 1px solid rgba(217, 180, 74, 0.22);
  background:
    linear-gradient(135deg, rgba(217, 180, 74, 0.09), rgba(217, 180, 74, 0.025)),
    rgba(8, 15, 29, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.cite-box__head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
  color: #e8cd85;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.cite-box__head i {
  width: 13px;
  height: 13px;
}

.cite-item {
  display: grid;
  gap: 1px;
  padding: 6px 0;
  border-top: 1px dashed rgba(217, 180, 74, 0.14);
}

.cite-item:first-of-type {
  border-top: 0;
  padding-top: 2px;
}

.cite-item strong {
  color: #efdfae;
  font-size: 11.5px;
  font-weight: 800;
}

.cite-item span {
  color: #98a9c1;
  font-size: 10.5px;
  line-height: 1.7;
}

.answer-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 13px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(96, 165, 250, 0.18);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(37, 99, 235, 0.035));
  color: #b9cce9;
  font-size: 11.5px;
  line-height: 1.8;
}

.answer-tip i {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-top: 2px;
  color: #93c5fd;
}

.answer-tip strong {
  color: #dbeafe;
  font-weight: 800;
}

.answer-tip--urgent {
  border-color: rgba(251, 113, 133, 0.24);
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.13), rgba(244, 63, 94, 0.035));
  color: #f2c8cf;
}

.answer-tip--urgent i {
  color: #fda4af;
}

/* Message actions */
.msg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
}

.msg-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.025));
  color: #adc0dc;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.2s ease, color 0.2s ease, border-color 0.2s ease,
    background 0.2s ease, box-shadow 0.2s ease;
}

.msg-action i {
  width: 12px;
  height: 12px;
}

.msg-action:hover {
  transform: translateY(-1px);
  color: #fff;
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(59, 130, 246, 0.16);
  box-shadow: 0 0 16px -5px rgba(59, 130, 246, 0.55);
}

.msg-action.is-saved {
  border-color: rgba(217, 180, 74, 0.42);
  background: rgba(217, 180, 74, 0.12);
  color: #f0d492;
}

.msg-action.is-saved i {
  fill: currentColor;
}

.msg-action--appointment {
  border-color: rgba(147, 197, 253, 0.24);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(99, 102, 241, 0.1));
  color: #cfe0ff;
}

.msg-action--appointment:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.3), rgba(99, 102, 241, 0.18));
  box-shadow: 0 0 20px -5px rgba(59, 130, 246, 0.65);
}

.msg-action--copied {
  color: #86efac;
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(16, 185, 129, 0.12);
}

/* Related questions */
.related {
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.related__label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 7px;
  color: #7488a7;
  font-size: 9.5px;
  font-weight: 800;
}

.related__label i {
  width: 11px;
  height: 11px;
}

.related-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.related-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.03);
  color: #93a7c4;
  font-family: inherit;
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.related-chip:hover {
  color: #dbeafe;
  border-color: rgba(96, 165, 250, 0.35);
  background: rgba(59, 130, 246, 0.1);
}

/* Typing indicator */
.typing-msg .msg__bubble {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #60a5fa;
  box-shadow: 0 0 7px rgba(96, 165, 250, 0.7);
  animation: asTyping 1.25s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

.typing-text {
  color: #9db6d9;
  font-size: 10.5px;
  font-weight: 600;
}

@keyframes asTyping {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

@keyframes asMsgIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes asMsgOut {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --------------------------------------------------------------------------
   Welcome state
   -------------------------------------------------------------------------- */
.welcome-card {
  position: relative;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(59, 130, 246, 0.14), transparent 58%),
    linear-gradient(160deg, rgba(20, 34, 60, 0.78), rgba(9, 17, 32, 0.72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.welcome-card__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(217, 180, 74, 0.24);
  background: rgba(217, 180, 74, 0.09);
  color: #e6cb87;
  font-size: 9px;
  font-weight: 800;
}

.welcome-card__eyebrow i {
  width: 11px;
  height: 11px;
}

.welcome-card h3 {
  margin: 10px 0 6px;
  color: #f5f9ff;
  font-size: 19px;
  font-weight: 900;
  line-height: 1.5;
}

.welcome-card > p {
  margin: 0;
  color: #a9bad3;
  font-size: 12.5px;
  line-height: 1.9;
}

.welcome-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 13px;
}

.welcome-topic {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 11px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(255, 255, 255, 0.028);
  color: #b3c4dd;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  text-align: start;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease, border-color 0.2s ease,
    background 0.2s ease;
}

.welcome-topic i {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: #7dd3fc;
}

.welcome-topic:hover {
  transform: translateY(-1px);
  color: #fff;
  border-color: rgba(96, 165, 250, 0.32);
  background: rgba(59, 130, 246, 0.1);
}

.welcome-starters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 13px;
}

.welcome-starter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.22);
  background: rgba(37, 99, 235, 0.09);
  color: #b8d4ff;
  font-family: inherit;
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.welcome-starter:hover {
  color: #fff;
  background: rgba(37, 99, 235, 0.2);
  border-color: rgba(96, 165, 250, 0.42);
}

.welcome-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: #7386a4;
  font-size: 9.5px;
  line-height: 1.75;
}

.welcome-note i {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  margin-top: 1px;
  color: #6b7f9d;
}

/* --------------------------------------------------------------------------
   Composer
   -------------------------------------------------------------------------- */
.composer-wrap {
  position: relative;
  padding: 11px 14px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
  background: linear-gradient(180deg, rgba(7, 14, 28, 0.45), rgba(6, 12, 24, 0.92));
}

.composer {
  position: relative;
  padding: 9px 11px 7px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.018));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 18px 50px -36px rgba(0, 0, 0, 1);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.composer:focus-within {
  border-color: rgba(96, 165, 250, 0.5);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.025));
  box-shadow:
    0 0 0 4px rgba(37, 99, 235, 0.1),
    0 0 36px -10px rgba(59, 130, 246, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.composer textarea {
  display: block;
  width: 100%;
  min-height: 40px;
  max-height: 148px;
  padding: 3px 2px;
  resize: none;
  overflow-y: auto;
  border: 0;
  background: transparent;
  color: #edf3ff;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.8;
  outline: 0;
}

.composer textarea::placeholder {
  color: #647894;
}

.composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 3px;
}

.composer-tools {
  display: flex;
  align-items: center;
  gap: 5px;
}

.composer-tool {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: #7f93b2;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.composer-tool i {
  width: 14px;
  height: 14px;
}

.composer-tool:hover {
  color: #dbeafe;
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(96, 165, 250, 0.22);
}

.composer-tool.is-listening {
  color: #fda4af;
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(251, 113, 133, 0.35);
  animation: asPulseDot 1.2s ease-in-out infinite;
}

.composer-count {
  margin-inline-start: 3px;
  color: #586b88;
  font-size: 9px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.composer-count.is-near {
  color: #fcd34d;
}

.composer-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.composer-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 7px 0 0;
  color: #5f7290;
  font-size: 9px;
  line-height: 1.6;
  text-align: center;
}

.composer-note i {
  width: 10px;
  height: 10px;
}

.send-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(191, 219, 254, 0.42);
  background: linear-gradient(135deg, #3b82f6, #4f46e5 62%, #4338ca);
  color: #fff;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  box-shadow:
    0 0 22px rgba(59, 130, 246, 0.42),
    0 10px 26px -12px rgba(37, 99, 235, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease,
    filter 0.22s ease;
}

.send-btn::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -70%;
  width: 45%;
  transform: skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  transition: left 0.6s ease;
  pointer-events: none;
}

.send-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow:
    0 0 34px rgba(99, 102, 241, 0.6),
    0 14px 32px -12px rgba(37, 99, 235, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.send-btn:hover::before {
  left: 130%;
}

.send-btn:active {
  transform: scale(0.97);
}

.send-btn:disabled {
  cursor: wait;
  filter: saturate(0.7);
  opacity: 0.62;
  transform: none;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.24);
}

.send-btn i {
  width: 15px;
  height: 15px;
}

.send-btn__spinner {
  display: none;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: asSpin 0.8s linear infinite;
}

.send-btn.is-busy .send-btn__spinner {
  display: inline-block;
}

.send-btn.is-busy .send-btn__icon {
  display: none;
}

@keyframes asSpin {
  to {
    transform: rotate(360deg);
  }
}

.chat-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 10px 2px 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(245, 158, 11, 0.13);
  background: rgba(245, 158, 11, 0.055);
  color: #b49a6a;
  font-size: 9.5px;
  line-height: 1.7;
}

.chat-disclaimer i {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  margin-top: 1px;
  color: #d3a84e;
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */
.as-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: clamp(620px, calc(100vh - 320px), 860px);
  min-height: 0;
  overflow-y: auto;
  padding-inline-end: 2px;
  scrollbar-width: thin;
}

.side-card {
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.112);
  background: linear-gradient(165deg, rgba(19, 32, 56, 0.76), rgba(8, 15, 29, 0.82));
  box-shadow:
    0 30px 80px -55px rgba(0, 0, 0, 0.98),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(26px) saturate(160%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
}

.side-card--workspace {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 320px;
  padding: 13px;
}

.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.side-head h2 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: #dce8fa;
  font-size: 12.5px;
  font-weight: 900;
}

.side-head h2 i {
  width: 14px;
  height: 14px;
  color: #7dd3fc;
}

.side-close {
  display: none;
}

.side-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.035);
}

.side-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 4px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #879ab7;
  font-family: inherit;
  font-size: 9.5px;
  font-weight: 800;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.side-tab i {
  width: 11px;
  height: 11px;
}

.side-tab:hover {
  color: #c9d9f0;
}

.side-tab.is-active {
  color: #fff;
  border-color: rgba(147, 197, 253, 0.18);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.28), rgba(99, 102, 241, 0.14));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 15px -6px rgba(59, 130, 246, 0.6);
}

.side-tab__count {
  display: inline-grid;
  place-items: center;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: #b7c8df;
  font-size: 8px;
  font-weight: 800;
}

.side-tab.is-active .side-tab__count {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.side-panels {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  margin-top: 10px;
}

.side-panel {
  display: none;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.side-panel.is-active {
  display: flex;
  animation: asFadeIn 0.25s ease both;
}

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

.side-new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-bottom: 8px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px dashed rgba(96, 165, 250, 0.3);
  background: rgba(37, 99, 235, 0.075);
  color: #b9d4ff;
  font-family: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.side-new i {
  width: 13px;
  height: 13px;
}

.side-new:hover {
  color: #fff;
  background: rgba(37, 99, 235, 0.16);
  border-color: rgba(96, 165, 250, 0.5);
}

.side-search {
  position: relative;
  margin-bottom: 8px;
}

.side-search i {
  position: absolute;
  top: 50%;
  inset-inline-start: 9px;
  width: 12px;
  height: 12px;
  color: #667a99;
  transform: translateY(-50%);
  pointer-events: none;
}

.side-search input {
  width: 100%;
  height: 32px;
  padding: 0 29px 0 10px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: #dbe6f7;
  font-family: inherit;
  font-size: 10px;
  outline: 0;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.side-search input::placeholder {
  color: #5f7290;
}

.side-search input:focus {
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(255, 255, 255, 0.05);
}

.side-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  padding-inline-end: 2px;
}

.history-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 8px 8px 8px 6px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  font-family: inherit;
  text-align: start;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.07);
}

.history-item.is-active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(99, 102, 241, 0.06));
  border-color: rgba(96, 165, 250, 0.22);
}

.history-item__icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.045);
  color: #7f96b6;
}

.history-item.is-active .history-item__icon {
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(96, 165, 250, 0.25);
}

.history-item__icon i {
  width: 13px;
  height: 13px;
}

.history-item__body {
  min-width: 0;
  flex: 1;
}

.history-item__title {
  display: block;
  overflow: hidden;
  color: #b9c9df;
  font-size: 10.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item.is-active .history-item__title {
  color: #f0f6ff;
}

.history-item__meta {
  display: block;
  margin-top: 2px;
  color: #5f7290;
  font-size: 8.5px;
  font-weight: 500;
}

.history-item__delete,
.fav-item__delete,
.appointment-item__cancel {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: #5d708e;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.history-item:hover .history-item__delete,
.fav-item:hover .fav-item__delete,
.appointment-item:hover .appointment-item__cancel {
  opacity: 1;
}

.history-item__delete:hover,
.fav-item__delete:hover,
.appointment-item__cancel:hover {
  color: #fda4af;
  background: rgba(244, 63, 94, 0.12);
}

.history-item__delete i,
.fav-item__delete i,
.appointment-item__cancel i {
  width: 12px;
  height: 12px;
}

@media (hover: none), (pointer: coarse) {
  .history-item__delete,
  .fav-item__delete,
  .appointment-item__cancel {
    opacity: 1;
  }
}

.side-empty {
  display: grid;
  place-items: center;
  gap: 6px;
  flex: 1;
  min-height: 120px;
  padding: 18px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(148, 163, 184, 0.14);
  color: #6d809e;
  text-align: center;
}

.side-empty i {
  width: 22px;
  height: 22px;
  color: #4e6a92;
}

.side-empty strong {
  color: #93a5c0;
  font-size: 10.5px;
  font-weight: 800;
}

.side-empty span {
  max-width: 190px;
  font-size: 9px;
  line-height: 1.7;
}

.side-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.side-footer__note {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #5c6f8d;
  font-size: 8px;
}

.side-footer__note i {
  width: 10px;
  height: 10px;
}

.side-clear {
  border: 0;
  background: transparent;
  color: #6b7f9c;
  font-family: inherit;
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s ease;
}

.side-clear:hover {
  color: #fda4af;
}

/* Favorites */
.fav-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 9px;
  border-radius: 10px;
  border: 1px solid rgba(217, 180, 74, 0.16);
  background: linear-gradient(135deg, rgba(217, 180, 74, 0.07), rgba(217, 180, 74, 0.015));
  cursor: pointer;
  text-align: start;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.fav-item:hover {
  transform: translateY(-1px);
  border-color: rgba(217, 180, 74, 0.34);
  background: linear-gradient(135deg, rgba(217, 180, 74, 0.12), rgba(217, 180, 74, 0.03));
}

.fav-item__icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 7px;
  background: rgba(217, 180, 74, 0.12);
  color: #e5c579;
}

.fav-item__icon i {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.fav-item__body {
  min-width: 0;
  flex: 1;
}

.fav-item__title {
  display: block;
  overflow: hidden;
  color: #e5d4a7;
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fav-item__question {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 2px;
  color: #8b9bb4;
  font-size: 8.5px;
  line-height: 1.6;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Appointments */
.appointment-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px;
  border-radius: 10px;
  border: 1px solid rgba(96, 165, 250, 0.17);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(37, 99, 235, 0.02));
}

.appointment-item__date {
  display: grid;
  place-items: center;
  width: 38px;
  flex-shrink: 0;
  padding: 5px 2px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(96, 165, 250, 0.18);
}

.appointment-item__date strong {
  color: #dbeafe;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.appointment-item__date span {
  margin-top: 2px;
  color: #8fb3e3;
  font-size: 7.5px;
  font-weight: 700;
}

.appointment-item__body {
  min-width: 0;
  flex: 1;
}

.appointment-item__title {
  display: block;
  color: #cfe0f8;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1.5;
}

.appointment-item__meta {
  display: block;
  margin-top: 2px;
  color: #7d92b1;
  font-size: 8.5px;
  line-height: 1.6;
}

.appointment-status {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.1);
  color: #fcd34d;
  font-size: 7.5px;
  font-weight: 800;
}

/* Categories + Aman */
.side-card--topics {
  padding: 12px 13px;
}

.side-card--topics h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 9px;
  color: #b6c7df;
  font-size: 10.5px;
  font-weight: 900;
}

.side-card--topics h3 i {
  width: 12px;
  height: 12px;
  color: #7dd3fc;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.category-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 7px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(255, 255, 255, 0.025);
  color: #95a8c4;
  font-family: inherit;
  font-size: 8.5px;
  font-weight: 700;
  text-align: start;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.category-btn i {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  color: #7dd3fc;
}

.category-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-btn:hover {
  color: #eaf2ff;
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(96, 165, 250, 0.28);
}

.aman-card {
  position: relative;
  overflow: hidden;
  padding: 13px;
  border-radius: 18px;
  border: 1px solid rgba(52, 211, 153, 0.24);
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(16, 185, 129, 0.2), transparent 60%),
    linear-gradient(155deg, rgba(6, 43, 38, 0.86), rgba(7, 22, 28, 0.9));
  box-shadow:
    0 20px 50px -38px rgba(0, 0, 0, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.aman-card::after {
  content: "";
  position: absolute;
  top: -30px;
  left: -30px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.22), transparent 70%);
  filter: blur(8px);
  pointer-events: none;
}

.aman-card__head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
}

.aman-card__head span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.26);
  color: #6ee7b7;
}

.aman-card__head i {
  width: 14px;
  height: 14px;
}

.aman-card__head strong {
  color: #a7f3d0;
  font-size: 11px;
  font-weight: 900;
}

.aman-card p {
  position: relative;
  margin: 0 0 8px;
  color: #8fc4b4;
  font-size: 8.5px;
  line-height: 1.7;
}

.aman-card__actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.aman-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 7px;
  border: 1px solid rgba(52, 211, 153, 0.24);
  background: rgba(16, 185, 129, 0.1);
  color: #a7f3d0;
  font-family: inherit;
  font-size: 8px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.aman-link:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(52, 211, 153, 0.45);
}

.aman-link i {
  width: 10px;
  height: 10px;
}

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */
.as-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.as-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.as-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 16, 0.74);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.as-modal__panel {
  position: relative;
  width: min(560px, 100%);
  max-height: 90dvh;
  overflow-y: auto;
  padding: 21px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(160deg, rgba(20, 34, 59, 0.98), rgba(7, 14, 28, 0.99));
  box-shadow:
    0 50px 130px -34px rgba(0, 0, 0, 1),
    0 0 60px -10px rgba(59, 130, 246, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.as-modal.is-open .as-modal__panel {
  transform: translateY(0) scale(1);
}

.as-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.as-modal__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
  color: #93c5fd;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.as-modal__eyebrow i {
  width: 11px;
  height: 11px;
}

.as-modal__head h2 {
  margin: 0;
  color: #f5f9ff;
  font-size: 18px;
  font-weight: 900;
}

.as-modal__head p {
  margin: 4px 0 0;
  color: #8fa2c0;
  font-size: 10.5px;
  line-height: 1.7;
}

.as-modal__close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #8fa2c0;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.as-modal__close:hover {
  color: #fff;
  background: rgba(244, 63, 94, 0.14);
}

.as-modal__close i {
  width: 15px;
  height: 15px;
}

.appointment-context {
  margin: 0 0 12px;
  padding: 8px 11px;
  border-radius: 10px;
  border: 1px solid rgba(96, 165, 250, 0.18);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(99, 102, 241, 0.045));
  color: #a8bdd9;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.form-field {
  display: grid;
  gap: 4px;
}

.form-field--full {
  grid-column: 1 / -1;
}

.form-field label {
  color: #9fb2cd;
  font-size: 10px;
  font-weight: 800;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 9px 10px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #e6eefb;
  font-family: inherit;
  font-size: 11px;
  outline: 0;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: #5e7290;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: rgba(96, 165, 250, 0.5);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #7f93b2 50%),
    linear-gradient(135deg, #7f93b2 50%, transparent 50%);
  background-position: calc(0% + 13px) calc(50% - 2px), calc(0% + 17px) calc(50% - 2px);
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  padding-inline-start: 30px;
}

.form-field select option {
  background: #0d1a2f;
  color: #e6eefb;
}

.form-field textarea {
  min-height: 58px;
  resize: vertical;
}

.form-times {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.time-slot {
  padding: 7px 4px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.03);
  color: #95a9c5;
  font-family: inherit;
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.time-slot:hover {
  color: #fff;
  border-color: rgba(96, 165, 250, 0.32);
}

.time-slot.is-selected {
  color: #fff;
  border-color: rgba(96, 165, 250, 0.5);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(99, 102, 241, 0.18));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.form-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.channel-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.03);
  color: #95a9c5;
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.channel-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.channel-option:has(input:checked) {
  color: #fff;
  border-color: rgba(96, 165, 250, 0.46);
  background: rgba(59, 130, 246, 0.16);
}

.channel-option i {
  width: 11px;
  height: 11px;
}

.form-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 9px;
  border-radius: 8px;
  border: 1px solid rgba(96, 165, 250, 0.14);
  background: rgba(37, 99, 235, 0.055);
  color: #8fa8c9;
  font-size: 9px;
  line-height: 1.7;
}

.form-note i {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  margin-top: 1px;
  color: #7dd3fc;
}

.modal-actions {
  display: flex;
  gap: 7px;
  margin-top: 13px;
}

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.btn-primary {
  border: 1px solid rgba(191, 219, 254, 0.4);
  background: linear-gradient(135deg, #3b82f6, #4f46e5);
  color: #fff;
  box-shadow:
    0 0 20px -4px rgba(59, 130, 246, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 28px -4px rgba(99, 102, 241, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #a9bbd3;
}

.btn-ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
}

.btn-primary i,
.btn-ghost i {
  width: 13px;
  height: 13px;
}

.appointment-success {
  display: none;
  padding: 8px 0 2px;
  text-align: center;
}

.appointment-success.is-visible {
  display: block;
  animation: asFadeIn 0.3s ease both;
}

.success-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 10px;
  border-radius: 16px;
  border: 1px solid rgba(52, 211, 153, 0.3);
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
  box-shadow: 0 0 28px -6px rgba(52, 211, 153, 0.5);
}

.success-icon i {
  width: 25px;
  height: 25px;
}

.appointment-success h3 {
  margin: 0 0 5px;
  color: #ecfdf5;
  font-size: 16px;
  font-weight: 900;
}

.appointment-success p {
  margin: 0 auto;
  max-width: 360px;
  color: #93b8ad;
  font-size: 10.5px;
  line-height: 1.8;
}

.success-ref {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px dashed rgba(52, 211, 153, 0.3);
  background: rgba(16, 185, 129, 0.08);
  color: #a7f3d0;
  font-family: inherit;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.success-details {
  margin: 12px 0 0;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.025);
  text-align: start;
}

.success-details div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
  color: #8fa3be;
  font-size: 9.5px;
}

.success-details strong {
  color: #d7e5f8;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Toast + footer + drawer backdrop
   -------------------------------------------------------------------------- */
.as-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  z-index: 130;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(410px, calc(100vw - 32px));
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(147, 197, 253, 0.28);
  background: linear-gradient(150deg, rgba(19, 33, 58, 0.97), rgba(8, 15, 29, 0.98));
  box-shadow:
    0 24px 60px -24px rgba(0, 0, 0, 0.95),
    0 0 28px -8px rgba(59, 130, 246, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  color: #dbe8fa;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.6;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 16px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  pointer-events: none;
}

.as-toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.as-toast i {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: #7dd3fc;
}

.as-toast.is-success {
  border-color: rgba(52, 211, 153, 0.3);
}

.as-toast.is-success i {
  color: #6ee7b7;
}

.as-toast.is-error {
  border-color: rgba(251, 113, 133, 0.3);
}

.as-toast.is-error i {
  color: #fda4af;
}

.as-footer {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 18px 28px;
}

.as-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: #5f7290;
  font-size: 9.5px;
}

.as-footer__brand {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #7e92b0;
  font-weight: 700;
}

.as-footer__brand i {
  width: 13px;
  height: 13px;
  color: #6b86ab;
}

.as-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.as-footer__links a {
  color: #7086a5;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.as-footer__links a:hover {
  color: #dbeafe;
}

.as-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(2, 6, 16, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .as-nav a {
    padding: 9px 9px;
    font-size: 12px;
  }

  .as-workspace {
    grid-template-columns: minmax(0, 1fr) 318px;
  }

  .as-sidebar {
    gap: 10px;
  }
}

@media (max-width: 1080px) {
  .as-nav {
    display: none;
  }

  .as-header__menu {
    display: inline-grid;
  }

  .as-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .chat-shell {
    height: clamp(600px, calc(100vh - 230px), 860px);
  }

  .as-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 70;
    width: min(368px, 92vw);
    height: 100dvh;
    max-height: none;
    padding: 14px;
    overflow-y: auto;
    background:
      radial-gradient(90% 50% at 0% 0%, rgba(37, 99, 235, 0.16), transparent 64%),
      linear-gradient(170deg, rgba(8, 16, 31, 0.985), rgba(4, 9, 19, 0.995));
    border-inline-end: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 30px 0 90px -30px rgba(0, 0, 0, 1);
    transform: translateX(-104%);
    transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
  }

  body.sidebar-open .as-sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .as-drawer-backdrop {
    opacity: 1;
    visibility: visible;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .side-card--workspace {
    min-height: 340px;
    flex: 1;
  }

  .side-close {
    display: inline-grid;
  }

  .side-list {
    max-height: none;
  }

  .side-footer__note span {
    font-size: 8.5px;
  }
}

@media (max-width: 820px) {
  .as-header {
    padding: 10px 12px 0;
  }

  .as-header__inner {
    padding: 8px 10px;
    gap: 8px;
  }

  .as-main {
    padding: 22px 12px 32px;
  }

  .as-hero {
    margin-bottom: 20px;
  }

  .as-brand__sub {
    display: none;
  }

  .as-aman-chip span:not(:first-child) {
    display: none;
  }

  .chat-shell {
    border-radius: 22px;
    height: calc(100dvh - 208px);
    min-height: 560px;
    max-height: none;
  }

  .chat-topbar {
    padding: 11px 12px;
  }

  .chat-avatar {
    width: 39px;
    height: 39px;
    border-radius: 12px;
  }

  .chat-identity__title {
    font-size: 13px;
  }

  .chat-identity__status {
    font-size: 9.5px;
  }

  .chat-top-btn span {
    display: none;
  }

  .chat-top-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
  }

  .quick-strip {
    padding: 9px 11px;
  }

  .quick-strip__label {
    margin-bottom: 6px;
  }

  .chat-messages {
    padding: 16px 12px 8px;
    gap: 16px;
  }

  .msg__content {
    max-width: 91%;
  }

  .msg__bubble {
    padding: 12px 13px;
    font-size: 12.5px;
  }

  .answer-title {
    font-size: 15px;
  }

  .answer-intro,
  .answer-list li {
    font-size: 12px;
  }

  .composer-wrap {
    padding: 9px 10px 10px;
  }

  .composer-note {
    font-size: 8.5px;
  }

  .as-footer {
    padding: 0 12px 22px;
  }

  .as-footer__inner {
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 560px) {
  .as-header__actions .as-aman-chip {
    display: none;
  }

  .as-title {
    font-size: 1.9rem;
  }

  .as-subtitle {
    font-size: 12px;
  }

  .as-badges {
    gap: 5px;
  }

  .as-badge {
    font-size: 9px;
    padding: 5px 8px;
  }

  .as-badge:nth-child(2) {
    display: none;
  }

  .chat-identity__title .as-live-badge {
    display: none;
  }

  .quick-chip {
    font-size: 10px;
    padding: 7px 10px;
  }

  .msg__avatar {
    width: 29px;
    height: 29px;
    border-radius: 9px;
  }

  .msg__avatar i {
    width: 14px;
    height: 14px;
  }

  .msg__content {
    max-width: calc(100% - 39px);
  }

  .msg--user .msg__content {
    max-width: calc(100% - 39px);
  }

  .msg__meta {
    font-size: 9px;
  }

  .msg__meta strong {
    font-size: 9.5px;
  }

  .welcome-grid {
    grid-template-columns: 1fr;
  }

  .welcome-card {
    padding: 14px;
  }

  .welcome-card h3 {
    font-size: 16px;
  }

  .msg-actions {
    gap: 4px;
  }

  .msg-action {
    font-size: 9px;
    padding: 5px 7px;
  }

  .msg-action--appointment {
    flex-basis: 100%;
    justify-content: center;
  }

  .send-btn {
    height: 34px;
    padding: 0 11px;
  }

  .send-btn span:not(.send-btn__spinner) {
    display: none;
  }

  .send-btn i {
    width: 16px;
    height: 16px;
  }

  .composer-count {
    display: none;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-times {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .as-modal {
    padding: 10px;
  }

  .as-modal__panel {
    padding: 17px;
    border-radius: 20px;
  }

  .as-footer__links {
    justify-content: center;
    gap: 9px;
    font-size: 8.5px;
  }
}

@media (max-height: 700px) and (min-width: 1081px) {
  .chat-shell {
    height: calc(100vh - 250px);
    min-height: 520px;
  }

  .as-sidebar {
    height: calc(100vh - 250px);
    min-height: 520px;
  }

  .as-hero {
    margin-bottom: 18px;
  }

  .as-title {
    font-size: 2.4rem;
  }

  .as-subtitle {
    margin-top: 8px;
    font-size: 13px;
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .as-header__inner,
  .chat-shell,
  .side-card,
  .as-modal__panel,
  .as-toast {
    background: rgba(10, 19, 35, 0.98);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .chat-messages {
    scroll-behavior: auto;
  }
}
