/* Global smoothing and baseline */
html, body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

/* Typography */
body {
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  font-size: 15px; /* between 14–16px */
  line-height: 1.5; /* 1.4–1.6 */
}

img, canvas, video { image-rendering: auto; }
svg { shape-rendering: geometricPrecision; text-rendering: optimizeLegibility; }

/* Light/Dark color scheme hint for UA widgets */
.dark { color-scheme: dark; }

/* Palette */
:root {
  --bg: #fafafa;
  --fg: #18212f;
  --border: #e5e7eb;
  --muted: #edf1f5;
  --surface: #ffffff;
  --sidebar: #f7f7f8;
  --primary: #3B82F6;         /* accent */
  --primary-700: #2563EB;     /* accent hover */
  /* Layout helpers (kept minimal; no JS-managed keyboard var) */
  --composer-h: 96px;        /* nominal composer height for spacing */
}

.dark {
  --bg: #121212;            /* background */
  --fg: #E0E0E0;            /* text */
  --border: #2D2D2D;        /* subtle borders */
  --muted: #161616;         /* muted surfaces */
  --surface: #1A1A1A;       /* elevated surface */
  --sidebar: #151515;       /* sidebar */
  --primary: #3B82F6;       /* accent */
  --primary-700: #2563EB;   /* accent hover */
}

/* Base surfaces */
body { background: var(--bg); color: var(--fg); }

.dark body { background: var(--bg); color: var(--fg); }
.dark ::selection { background: var(--primary); color: #fff; }
.dark ::-moz-selection { background: var(--primary); color: #fff; }

/* Common shells */
.dark header,
.dark .composer,
.dark .dark-surface {
  background: rgba(26,26,26,.85) !important;
  backdrop-filter: saturate(120%) blur(6px);
}
.dark aside { background: var(--sidebar) !important; }
.dark .border, .dark .border-border, .dark .border-sidebar-border { border-color: var(--border) !important; }
.dark .hover\:bg-muted:hover { background: #202020 !important; }
.dark .bg-muted { background: var(--muted) !important; }
.dark .bg-surface, .dark .bg-surface-elevated, .dark .surface, .dark .surface-elevated { background: var(--surface) !important; }

/* Composer elevation */
.composer { box-shadow: 0 -8px 24px rgba(0,0,0,.06); }
.dark .composer { box-shadow: 0 -10px 24px rgba(0,0,0,.35); }
/* Keep composer pinned and stable at the viewport bottom */
.composer { position: fixed; left: 0; right: 0; bottom: 0 !important; transform: none !important; }
html, body { overscroll-behavior-y: contain; }

/* Reserve space so last messages aren't hidden under the composer */
#chatScroll { padding-bottom: calc(var(--composer-h, 120px) + 16px + env(safe-area-inset-bottom)) !important; }

/* Keep things simple; no special body locking */

/* Topographic animated background (light/dark aware) */
:root {
  --topo-bg: url("data:image/svg+xml;utf8,\
  <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'>\
    <g fill='none' stroke='%2318212F' stroke-opacity='0.06' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'>\
      <path d='M-5 30 C 30 10, 70 10, 105 30 C 140 50, 170 50, 205 30'/>\
      <path d='M-5 60 C 25 40, 80 35, 110 55 C 150 80, 160 75, 205 60'/>\
      <path d='M-5 90 C 20 70, 75 70, 110 90 C 145 110, 175 110, 205 90'/>\
      <path d='M-5 120 C 35 100, 65 100, 105 120 C 145 140, 165 140, 205 120'/>\
      <path d='M-5 150 C 25 130, 85 130, 120 150 C 155 170, 175 170, 205 150'/>\
      <path d='M-5 180 C 30 160, 60 160, 95 180 C 130 200, 170 200, 205 180'/>\
    </g>\
  </svg>");
}

.dark { /* brighter strokes on dark */
  --topo-bg: url("data:image/svg+xml;utf8,\
  <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'>\
    <g fill='none' stroke='%23FFFFFF' stroke-opacity='0.08' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'>\
      <path d='M-5 30 C 30 10, 70 10, 105 30 C 140 50, 170 50, 205 30'/>\
      <path d='M-5 60 C 25 40, 80 35, 110 55 C 150 80, 160 75, 205 60'/>\
      <path d='M-5 90 C 20 70, 75 70, 110 90 C 145 110, 175 110, 205 90'/>\
      <path d='M-5 120 C 35 100, 65 100, 105 120 C 145 140, 165 140, 205 120'/>\
      <path d='M-5 150 C 25 130, 85 130, 120 150 C 155 170, 175 170, 205 150'/>\
      <path d='M-5 180 C 30 160, 60 160, 95 180 C 130 200, 170 200, 205 180'/>\
    </g>\
  </svg>");
}

.topo-bg {
  position: fixed;
  inset: 0;
  z-index: 0; /* content will be lifted above */
  pointer-events: none;
  background-color: var(--bg);
  background-image: var(--topo-bg);
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed; /* nice feel on scroll */
  animation: topo-pan 45s linear infinite alternate;
}

@keyframes topo-pan {
  from { background-position: 0% 0%; }
  to   { background-position: 100% 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .topo-bg { animation: none; }
}

/* Ensure app content sits above the background layer */
.app-fullheight { position: relative; z-index: 1; }

/* Cards/buttons */
.card-hover { box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.04); border-radius: 12px; }
.dark .card-hover { background: #11161c; border-color: #1b2230; color: var(--fg); box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.35); }
.btn-hero { border-radius: 12px; }
.dark .btn-hero { background: var(--primary) !important; background-image: none !important; color: #fff !important; }
.dark .btn-hero:hover { background: var(--primary-700) !important; }
.dark .btn-outline-hero { border-color: var(--primary) !important; color: var(--primary) !important; }
.dark .btn-outline-hero:hover { background: var(--primary) !important; color: #fff !important; }

/* Buttons & inputs focus/hover states */
button, a, input, textarea, select { transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
*:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 10px; }
.focus-ring { box-shadow: 0 0 0 3px rgba(59,130,246,0.35); }

/* Chat bubbles */
.dark .bubble-user {
  background: linear-gradient(180deg, #1f50d6, #1d4ed8) !important;
  color: #ffffff !important;
  border-color: #1e40af !important;
}
.dark .bubble-bot {
  background: var(--surface) !important;
  color: var(--fg) !important;
  border-color: var(--border) !important;
}
.dark .msg-time { color: #98a2b3 !important; opacity: 0.9 !important; }

/* Error bubble */
.bubble-error { background: #fff1f2 !important; color: #7f1d1d !important; border-color: #fecdd3 !important; }
.dark .bubble-error { background: #1f1414 !important; color: #fecaca !important; border-color: #7f1d1d !important; }

/* Chat bubbles shared rules */
.chat-bubble { max-width: 70%; border-radius: 14px; }
.msg-enter { animation: msgIn .25s ease-out both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* Redesigned composer helpers */
.chat-input-wrap {
  position: relative;
  transition: box-shadow .2s ease, border-color .2s ease, transform .15s ease, background-color .2s ease;
  /* soft primary glow in the corner */
  background-image: radial-gradient(120% 80% at 0% 0%, color-mix(in oklab, var(--primary) 6%, transparent) 0%, transparent 60%);
  align-items: center; /* center content vertically so text sits nicely */
  min-width: 0; /* allow flex shrink to avoid overflow */
}
.chat-input-wrap:hover { transform: translateY(-1px); box-shadow: 0 10px 20px rgba(0,0,0,.06); }
.dark .chat-input-wrap:hover { box-shadow: 0 14px 26px rgba(0,0,0,.35); }
.chat-input-wrap:focus-within { box-shadow: 0 0 0 3px rgba(59,130,246,0.25), 0 12px 24px rgba(59,130,246,0.08); border-color: #93c5fd; }
/* left accent bar */
/* Removed left accent bar */
.chat-input-wrap::before { content: none; }
/* ensure content paints over pseudo-elements */
.chat-input-wrap > * { position: relative; z-index: 1; }

/* Make composer textarea align and size consistently */
.chat-input-wrap textarea {
  min-height: 56px; /* match design pill height */
  font-size: 18px;
  line-height: 1.5;
  font-weight: 600;
  padding-top: 14px;
  padding-bottom: 14px;
}
.dark .chat-input-wrap textarea { background: transparent !important; }

#attachmentsBar { display: flex; }
.attachment-chip { display: inline-flex; align-items: center; gap: .5rem; background: var(--muted); color: var(--fg); border: 1px solid var(--border); border-radius: 9999px; padding: .25rem .5rem; font-size: 12px; }
.attachment-chip button { color: #6b7280; }
.attachment-chip button:hover { color: #111827; }

/* Command palette items */
.cmd-item { display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; cursor: pointer; }
.cmd-item:hover, .cmd-item.active { background: var(--muted); }
.cmd-prefix { color: #6b7280; font-size: 12px; margin-left: .25rem; }

/* Floating intro composer */
.intro-composer { border-radius: 16px; }
.float-anim { animation: floatY 3.8s ease-in-out infinite; }
@keyframes floatY { 0% { transform: translateY(0); } 50% { transform: translateY(-6px); } 100% { transform: translateY(0); } }

/* Polished intro shell */
.intro-shell { position: relative; overflow: hidden; }
.intro-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4);
}
.glow-spot {
  width: 38rem; height: 38rem; border-radius: 9999px;
  position: relative;
  background:
    radial-gradient(closest-side,
      rgba(37, 99, 235, 0.35) 0%,
      rgba(37, 99, 235, 0.20) 35%,
      rgba(37, 99, 235, 0.10) 60%,
      rgba(37, 99, 235, 0.00) 75%
    );
  filter: blur(36px) saturate(120%);
  opacity: .7;
}
.glow-spot::after {
  content: "";
  position: absolute; inset: 18%; border-radius: inherit;
  background: radial-gradient(closest-side,
    rgba(37, 99, 235, 0.45) 0%,
    rgba(37, 99, 235, 0.00) 70%
  );
  filter: blur(30px);
  opacity: .9;
}
.dark .glow-spot {
  background:
    radial-gradient(closest-side,
      rgba(37, 99, 235, 0.42) 0%,
      rgba(37, 99, 235, 0.24) 35%,
      rgba(37, 99, 235, 0.12) 60%,
      rgba(37, 99, 235, 0.00) 75%
    );
}
.intro-shell textarea::placeholder { color: #6b7280; }
.dark .intro-shell textarea::placeholder { color: #8b93a6; }
.intro-shell:focus-within {
  box-shadow: 0 0 0 4px rgba(59,130,246,0.22), 0 20px 40px rgba(0,0,0,0.12);
}

/* Capsule input redesign */

.capsule-input {
  display: flex; align-items: center; gap: .5rem;
  border-radius: 12px; /* square box with soft rounded corners */
  padding: .5rem 1rem;
  background: #fff;
  border: 2px solid #d1d5db;
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  position: relative;
  transition: box-shadow .2s ease, transform .15s ease, border-color .2s ease;
  min-width: 0; /* allow flex shrink to avoid overflow */
}
.capsule-input:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.15);
  border-color: #9ca3af; /* subtle contrast on hover */
  background-color: #fcfcfc; /* gentle lift */
}
.capsule-textarea {
  flex: 1; max-height: 180px; resize: none; border: none; outline: none; background: transparent;
  color: #111827; /* black-ish text in light mode */
  font-size: 18px; line-height: 1.5; font-weight: 500;
  /* Keep same feel/height as bottom composer */
  min-height: 28px; padding-top: 0; padding-bottom: 0;
  overflow: hidden;
}
.dark .capsule-textarea { background: transparent !important; color: var(--fg) !important; }
/* Placeholders */
.capsule-textarea::placeholder { color: #6b7280; }
.dark .capsule-textarea::placeholder { color: #8b93a6; }
.capsule-send {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; /* square with rounded corners */
  color: #fff; border: none;
  position: relative; overflow: hidden;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-700) 100%);
  box-shadow: 0 6px 18px rgba(37,99,235,0.35), 0 2px 6px rgba(0,0,0,0.15);
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}
.capsule-send:disabled { opacity: .6; cursor: not-allowed; }
/* Unified send button polish for both intro and bottom composer */
#sendBtn {
  position: relative; overflow: hidden; border: none;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-700) 100%);
  color: #fff !important;
  box-shadow: 0 8px 22px rgba(37,99,235,0.35), 0 3px 8px rgba(0,0,0,0.18);
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
  /* make it a square with rounded corners */
  width: 56px; height: 56px; padding: 0; border-radius: 12px;
  white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center;
}
#sendBtn span { display: none !important; }
#sendBtn:disabled { opacity: .6; cursor: not-allowed; box-shadow: none; }

/* Hover/active interactions */
#sendBtn:hover, .capsule-send:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(37,99,235,0.45), 0 6px 12px rgba(0,0,0,0.18); }
#sendBtn:active, .capsule-send:active { transform: translateY(0); box-shadow: 0 6px 16px rgba(37,99,235,0.30), 0 2px 6px rgba(0,0,0,0.15); filter: brightness(.98); }

/* Focus ring (keyboard) */
#sendBtn:focus-visible, .capsule-send:focus-visible { outline: 3px solid rgba(59,130,246,0.35); outline-offset: 2px; }

/* Subtle sheen sweep on hover */
#sendBtn::after, .capsule-send::after {
  content: ""; position: absolute; inset: -20% -40%;
  background: linear-gradient(120deg, rgba(255,255,255,0) 30%, rgba(255,255,255,0.25) 50%, rgba(255,255,255,0) 70%);
  transform: translateX(-150%) rotate(12deg);
  pointer-events: none;
}
#sendBtn:hover::after, .capsule-send:hover::after { animation: sheen 900ms ease forwards; }
@keyframes sheen { to { transform: translateX(150%) rotate(12deg); } }

/* Icon micro-motion */
#sendBtn i, .capsule-send i { transition: transform .25s ease; will-change: transform; }
#sendBtn:hover i, .capsule-send:hover i { transform: translateX(2px); }
#sendBtn:active i, .capsule-send:active i { transform: translateX(4px) scale(0.98); }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  #sendBtn, .capsule-send { transition: none; }
  #sendBtn::after, .capsule-send::after { display: none; }
}
/* accent bar like the main composer */
/* Removed left accent bar */
.capsule-input::before { content: none; }
.capsule-input:focus-within {
  box-shadow: 0 0 0 4px rgba(59,130,246,0.18), 0 20px 40px rgba(0,0,0,0.16);
}
/* Precise focus colors per theme */
html:not(.dark) .capsule-input:focus-within { border-color: #93c5fd; }
.dark .capsule-input { background: #141414; border-color: #3A3A3A; }
.dark .capsule-input:focus-within {
  border-color: #3A3A3A;
  box-shadow: 0 0 0 4px rgba(59,130,246,0.25), 0 24px 48px rgba(0,0,0,0.32), inset 0 0 0 1px rgba(255,255,255,0.04);
}

/* Suggestion pills */
.suggest-scroll { overflow-x: auto; overflow-y: hidden; flex: 1; scroll-behavior: smooth; }
.suggest-scroll { scrollbar-width: none; }
.suggest-scroll::-webkit-scrollbar { display: none; }
.suggest-pills { display: flex; gap: .75rem; align-items: stretch; white-space: nowrap; }
.pill-card {
  display: inline-flex; align-items: center; gap: .75rem; padding: .75rem 1rem; border-radius: 9999px; background: #0F1115; color: #E5E7EB;
  border: 1px solid rgba(255,255,255,0.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}
.pill-icon { width: 36px; height: 36px; border-radius: 9999px; display: inline-flex; align-items: center; justify-content: center; background: #151922; }
.pill-blue { color: #60A5FA; background: #0F1A2E; }
.pill-content { display: inline-flex; flex-direction: column; text-align: left; }
.pill-title { font-weight: 800; letter-spacing: 0.1px; }
.pill-sub { font-size: 12px; opacity: .75; }
.pill-nav { width: 36px; height: 36px; border-radius: 9999px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); color: #E5E7EB; }
.pill-nav:hover { background: rgba(255,255,255,0.1); }

/* Inputs */
.dark textarea, .dark input, .dark select {
  background: #0f141b !important;
  border-color: var(--border) !important;
  color: var(--fg) !important;
}
.dark ::placeholder { color: #8b93a6; }

/* Removed send button styles */

/* Scrollbars */
body, #chatScroll { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
body::-webkit-scrollbar, #chatScroll::-webkit-scrollbar { width: 8px; height: 8px; }
body::-webkit-scrollbar-track, #chatScroll::-webkit-scrollbar-track { background: transparent; }
body::-webkit-scrollbar-thumb, #chatScroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 8px; }
body::-webkit-scrollbar-thumb:hover, #chatScroll::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.25); }

/* Glass utility */
.glass-panel { background: rgba(255,255,255,0.7); backdrop-filter: blur(16px) saturate(140%); }
.dark .glass-panel { background: rgba(20,20,20,0.65); }
.glass-panel.border { border-color: rgba(255,255,255,0.4); }
.dark .glass-panel.border { border-color: rgba(255,255,255,0.08); }

/* Icon button hovers */
.dark .icon-button, .dark button { -webkit-tap-highlight-color: transparent; }

/* Images on dark */
.dark img { filter: none; }

/* Status dot */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #9aa3b2; }
.status .dot { display:none !important; width:0 !important; height:0 !important; padding:0 !important; margin:0 !important; box-shadow:none !important; background:transparent !important; }
.status.offline .dot { background: #ef4444; box-shadow: 0 0 0 2px rgba(239,68,68,.25); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); color: var(--fg); }
.dark .site-footer { background: #151515; }

/* A11y */
.visually-hidden { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

/* Sidebar polish (non-invasive, keeps existing semantics) */
.bg-sidebar {
  position: relative;
  background: linear-gradient(
      180deg,
      color-mix(in oklab, var(--surface) 88%, transparent) 0%,
      transparent 40%
    ), var(--sidebar) !important;
}
.dark .bg-sidebar {
  background: linear-gradient(
      180deg,
      rgba(255,255,255,0.02) 0%,
      transparent 40%
    ), var(--sidebar) !important;
}
.bg-sidebar::before {
  /* faint primary glow tucked in the top-left corner */
  content: "";
  position: absolute; inset: -20% 40% 70% -20%;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--primary) 20%, transparent) 0%, transparent 70%);
  pointer-events: none;
  filter: blur(20px);
}
.dark .bg-sidebar::before { opacity: 0.6; }

/* Sidebar nav items: subtle motion and left accent */
.bg-sidebar nav a,
.bg-sidebar nav button {
  position: relative;
  overflow: hidden;
  transition: transform .15s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease, color .2s ease;
}
.bg-sidebar nav a::before,
.bg-sidebar nav button::before {
  content: "";
  position: absolute; left: 6px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px;
  background: var(--primary);
  opacity: 0; transform: scaleY(.2); transform-origin: center;
  transition: opacity .2s ease, transform .2s ease;
}
.bg-sidebar nav a:hover,
.bg-sidebar nav button:hover { transform: translateX(2px); }
.bg-sidebar nav a:hover::before,
.bg-sidebar nav button:hover::before { opacity: .6; transform: scaleY(1); }

/* Keep active item clearly highlighted; add a gentle glow */
.bg-sidebar nav a.bg-primary {
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.12), 0 8px 18px rgba(59,130,246,0.25);
}
.bg-sidebar nav a.bg-primary::before { opacity: 1; transform: scaleY(1); background: rgba(255,255,255,0.9); }
.dark .bg-sidebar nav a.bg-primary::before { background: rgba(255,255,255,0.85); }

/* Sessions list items — cohesive cards look without breaking layout */
#sessionsList > *,
#sessionsListMobile > * {
  border-radius: 12px;
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease;
}
#sessionsList > *:hover,
#sessionsListMobile > *:hover {
  transform: translateX(2px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.06);
}
.dark #sessionsList > *:hover,
.dark #sessionsListMobile > *:hover { box-shadow: 0 10px 22px rgba(0,0,0,0.32); }

/* Title loader animation used for empty chat titles in the sessions list */
/* Feedback button enhanced styling */
.feedback-btn { position: relative; color:#fff; background:linear-gradient(135deg,#6366f1,#8b5cf6,#ec4899); background-size:200% 200%; transition:background-position .6s ease, transform .25s ease, box-shadow .4s ease; box-shadow:0 4px 14px -4px rgba(99,102,241,.55),0 2px 6px -2px rgba(0,0,0,.25); }
.feedback-btn:hover { background-position:100% 0; transform:translateY(-2px); box-shadow:0 10px 24px -6px rgba(99,102,241,.6),0 4px 12px -4px rgba(0,0,0,.35); }
.feedback-btn:active { transform:translateY(0); }
.feedback-btn::after { content:''; position:absolute; inset:0; border-radius:inherit; padding:2px; background:linear-gradient(135deg,rgba(255,255,255,.45),rgba(255,255,255,0)); -webkit-mask:linear-gradient(#000,#000) content-box,linear-gradient(#000,#000); mask:linear-gradient(#000,#000) content-box,linear-gradient(#000,#000); -webkit-mask-composite:xor; mask-composite:exclude; opacity:.5; pointer-events:none; transition:opacity .4s; }
.feedback-btn:hover::after { opacity:.85; }
@keyframes feedbackPulse { 0%{filter:brightness(1);} 50%{filter:brightness(1.12);} 100%{filter:brightness(1);} }
.feedback-btn { animation:feedbackPulse 5s ease-in-out infinite; }
.dark .feedback-btn { box-shadow:0 4px 18px -4px rgba(99,102,241,.7),0 2px 8px -3px rgba(0,0,0,.55); }
.dark .feedback-btn:hover { box-shadow:0 12px 30px -8px rgba(99,102,241,.75),0 6px 16px -6px rgba(0,0,0,.65); }
#statusBadge.empty-status { padding:0 !important; min-width:0; border:none !important; }
/* Forțează ascunderea oricărui text rămas în statusBadge (fallback dacă un script legacy inserează text) */
#statusBadge { font-size:0 !important; line-height:0 !important; }
#statusBadge * { display:none !important; }
.session-title .loader {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  vertical-align: middle;
  --color: hsl(0, 0%, 60%);
  --animation: 2s ease-in-out infinite;
  height: 20px;
}

.session-title .loader .circle {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 20px;
  height: 20px;
  border: solid 2px var(--color);
  border-radius: 50%;
  margin: 0 6px;
  background-color: transparent;
  animation: circle-keys var(--animation);
}

.session-title .loader .circle .dot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--color);
  animation: dot-keys var(--animation);
}

.session-title .loader .circle .outline {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  animation: outline-keys var(--animation);
}

.session-title .loader .circle:nth-child(2) { animation-delay: 0.3s; }
.session-title .loader .circle:nth-child(3) { animation-delay: 0.6s; }
.session-title .loader .circle:nth-child(4) { animation-delay: 0.9s; }
.session-title .loader .circle:nth-child(5) { animation-delay: 1.2s; }

.session-title .loader .circle:nth-child(2) .dot { animation-delay: 0.3s; }
.session-title .loader .circle:nth-child(3) .dot { animation-delay: 0.6s; }
.session-title .loader .circle:nth-child(4) .dot { animation-delay: 0.9s; }
.session-title .loader .circle:nth-child(5) .dot { animation-delay: 1.2s; }

.session-title .loader .circle:nth-child(1) .outline { animation-delay: 0.9s; }
.session-title .loader .circle:nth-child(2) .outline { animation-delay: 1.2s; }
.session-title .loader .circle:nth-child(3) .outline { animation-delay: 1.5s; }
.session-title .loader .circle:nth-child(4) .outline { animation-delay: 1.8s; }
.session-title .loader .circle:nth-child(5) .outline { animation-delay: 2.1s; }

@keyframes circle-keys {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes dot-keys {
  0% { transform: scale(1); }
  50% { transform: scale(0); }
  100% { transform: scale(1); }
}

@keyframes outline-keys {
  0% {
    transform: scale(0);
    outline: solid 12px var(--color);
    outline-offset: 0;
    opacity: 1;
  }
  100% {
    transform: scale(1);
    outline: solid 0 transparent;
    outline-offset: 12px;
    opacity: 0;
  }
}
/* From Uiverse.io by D3OXY */ 
/* DEOXY Was Here */
.form {
  --background: #d3d3d3;
  --input-focus: #2d8cf0;
  --font-color: #323232;
  --font-color-sub: #000000;
  --bg-color: #fff;
  --main-color: #323232;
  padding: 20px;
  background: var(--background);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 20px;
  border-radius: 5px;
  border: 2px solid var(--main-color);
  box-shadow: 4px 4px var(--main-color);
}

.form > p {
  font-family: var(--font-DelaGothicOne);
  color: var(--font-color);
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
}

.form > p > span {
  font-family: var(--font-SpaceMono);
  color: var(--font-color-sub);
  font-weight: 600;
  font-size: 17px;
}

.separator {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.separator > div {
  width: 100px;
  height: 3px;
  border-radius: 5px;
  background-color: var(--font-color-sub);
}

.separator > span {
  color: var(--font-color);
  font-family: var(--font-SpaceMono);
  font-weight: 600;
}

.oauthButton {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  /* margin: 50px auto 0 auto; */
  /* Make consistent and responsive inside modal */
  box-sizing: border-box;
  padding: 0 14px;
  width: 100%;
  height: 44px;
  border-radius: 5px;
  border: 2px solid var(--main-color);
  background-color: var(--bg-color);
  box-shadow: 4px 4px var(--main-color);
  font-size: 16px;
  font-weight: 600;
  color: var(--font-color);
  cursor: pointer;
  transition: all 250ms;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.oauthButton::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  background-color: #212121;
  z-index: -1;
  -webkit-box-shadow: 4px 8px 19px -3px rgba(0, 0, 0, 0.27);
  box-shadow: 4px 8px 19px -3px rgba(0, 0, 0, 0.27);
  transition: all 250ms;
}

.oauthButton:hover {
  color: #e8e8e8;
}

.oauthButton:hover::before {
  width: 100%;
}

.form > input, .form form input {
  /* Match oauth buttons */
  box-sizing: border-box;
  width: 100%;
  height: 44px;
  border-radius: 0px;
  border: 2px solid #d1d5db; /* gri */
  background-color: #fff; /* alb */
  box-shadow: 0 8px 24px rgba(0,0,0,0.10); /* floating effect */
  font-size: 15px;
  font-weight: 600;
  color: #000 !important;
  padding: 5px 10px;
  outline: none;
}

.icon {
  width: 1.5rem;
  height: 1.5rem;
}

/* Login modal: narrower and slightly taller card */
.modal-narrow-tall {
  max-width: 360px; /* narrower than max-w-md (~448px) */
  width: 100%;
  padding: 28px; /* a bit taller via padding */
}
.button {
  --primary: #ff5569; /* Accent color */
  --neutral-1: #2e2e2e; /* Dark background */
  --neutral-2: #1a1a1a; /* Darker background */
  --radius: 14px;

  cursor: pointer;
  border-radius: var(--radius);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
  border: none;
  box-shadow: 0 0.5px 0.5px 1px rgba(0, 0, 0, 0.2),
    0 10px 20px rgba(0, 0, 0, 0.2), 0 4px 5px 0px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s ease;
  min-width: 200px;
  padding: 20px;
  height: 68px;
  font-family: "Galano Grotesque", Poppins, Montserrat, sans-serif;
  font-style: normal;
  font-size: 18px;
  font-weight: 600;
  color: #ffffff; /* Text color */
  background: var(--neutral-1); /* Button background */
}
.button:hover {
  transform: scale(1.02);
  box-shadow: 0 0 1px 2px rgba(255, 255, 255, 0.3),
    0 15px 30px rgba(0, 0, 0, 0.3), 0 10px 3px -3px rgba(0, 0, 0, 0.04);
}
.button:active {
  transform: scale(1);
  box-shadow: 0 0 1px 2px rgba(255, 255, 255, 0.3),
    0 10px 3px -3px rgba(0, 0, 0, 0.2);
}
.button:after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  border: 2.5px solid transparent;
  background: linear-gradient(var(--neutral-1), var(--neutral-2)) padding-box,
    linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.45))
      border-box;
  z-index: 0;
  transition: all 0.4s ease;
}
.button:hover::after {
  transform: scale(1.05, 1.1);
  box-shadow: inset 0 -1px 3px 0 rgba(50, 50, 50, 1); /* Adjusted shine colour to a darker tone */
}

.button::before {
  content: "";
  inset: 7px 6px 6px 6px;
  position: absolute;
  background: linear-gradient(to top, var(--neutral-1), var(--neutral-2));
  border-radius: 30px;
  filter: blur(0.5px);
  z-index: 2;
}
.state p {
  display: flex;
  align-items: center;
  justify-content: center;
}
.state .icon {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  margin: auto;
  transform: scale(1.25);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.state .icon svg {
  overflow: visible;
}

/* Outline */
.outline {
  position: absolute;
  border-radius: inherit;
  overflow: hidden;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.4s ease;
  inset: -2px -3.5px;
}
.outline::before {
  content: "";
  position: absolute;
  inset: -100%;
  background: conic-gradient(
    from 180deg,
    transparent 60%,
    rgb(22, 22, 22) 80%,
    transparent 100%
  );
  animation: spin 2s linear infinite;
  animation-play-state: paused;
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
.button:hover .outline {
  opacity: 1;
}
.button:hover .outline::before {
  animation-play-state: running;
}

/* Letters */
.state p span {
  display: block;
  opacity: 0;
  animation: slideDown 0.8s ease forwards calc(var(--i) * 0.03s);
}
.button:hover p span {
  opacity: 1;
  animation: wave 0.5s ease forwards calc(var(--i) * 0.02s);
}
.button:focus p span {
  opacity: 1;
  animation: disapear 0.6s ease forwards calc(var(--i) * 0.03s);
}
@keyframes wave {
  30% {
    opacity: 1;
    transform: translateY(4px) translateX(0) rotate(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px) translateX(0) rotate(0);
    color: var(--primary);
  }
  100% {
    opacity: 1;
    transform: translateY(0) translateX(0) rotate(0);
  }
}
@keyframes slideDown {
  0% {
    opacity: 0;
    transform: translateY(-20px) translateX(5px) rotate(-90deg);
    color: var(--primary);
    filter: blur(5px);
  }
  30% {
    opacity: 1;
    transform: translateY(4px) translateX(0) rotate(0);
    filter: blur(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px) translateX(0) rotate(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) translateX(0) rotate(0);
  }
}
@keyframes disapear {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translateX(5px) translateY(20px);
    color: var(--primary);
    filter: blur(5px);
  }
}

/* Plane */
.state--default .icon svg {
  animation: land 0.6s ease forwards;
}
.button:hover .state--default .icon {
  transform: rotate(45deg) scale(1.25);
}
.button:focus .state--default svg {
  animation: takeOff 0.8s linear forwards;
}
.button:focus .state--default .icon {
  transform: rotate(0) scale(1.25);
}
@keyframes takeOff {
  0% {
    opacity: 1;
  }
  60% {
    opacity: 1;
    transform: translateX(70px) rotate(45deg) scale(2);
  }
  100% {
    opacity: 0;
    transform: translateX(160px) rotate(45deg) scale(0);
  }
}
@keyframes land {
  0% {
    transform: translateX(-60px) translateY(30px) rotate(-50deg) scale(2);
    opacity: 0;
    filter: blur(3px);
  }
  100% {
    transform: translateX(0) translateY(0) rotate(0);
    opacity: 1;
    filter: blur(0);
  }
}

/* Contrail */
.state--default .icon:before {
  content: "";
  position: absolute;
  top: 50%;
  height: 2px;
  width: 0;
  left: -5px;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.5));
}
.button:focus .state--default .icon:before {
  animation: contrail 0.8s linear forwards;
}
@keyframes contrail {
  0% {
    width: 0;
    opacity: 1;
  }
  8% {
    width: 15px;
  }
  60% {
    opacity: 0.7;
    width: 80px;
  }
  100% {
    opacity: 0;
    width: 160px;
  }
}

/* States */
.state {
  padding-left: 29px;
  z-index: 2;
  display: flex;
  position: relative;
}
.state--default span:nth-child(4) {
  margin-right: 5px;
}
.state--sent {
  display: none;
}
.state--sent svg {
  transform: scale(1.25);
  margin-right: 8px;
}
.button:focus .state--default {
  position: absolute;
}
.button:focus .state--sent {
  display: flex;
}
.button:focus .state--sent span {
  opacity: 0;
  animation: slideDown 0.8s ease forwards calc(var(--i) * 0.2s);
}
.button:focus .state--sent .icon svg {
  opacity: 0;
  animation: appear 1.2s ease forwards 0.8s;
}
@keyframes appear {
  0% {
    opacity: 0;
    transform: scale(4) rotate(-40deg);
    color: var(--primary);
    filter: blur(4px);
  }
  30% {
    opacity: 1;
    transform: scale(0.6);
    filter: blur(1px);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}


/* Ensure internal vertical rhythm feels taller */
.modal-narrow-tall .separator { margin: 4px 0; }
.modal-narrow-tall form { gap: 16px; }
.modal-narrow-tall h3 { margin-top: 4px; margin-bottom: 6px; }

/* Remove blue outline on chat inputs only */

/* When the desktop sidebar is open, offset the fixed composer to the content area */
@media (min-width: 768px) {
  .sidebar-open #bottomComposer {
    left: 16rem; /* w-64 sidebar width */
    width: calc(100% - 16rem);
  }
}
.chat-input-wrap textarea:focus,
.chat-input-wrap textarea:focus-visible,
.capsule-textarea:focus,
.capsule-textarea:focus-visible {
  outline: none !important;
}

/* Remove focus glow on the intro (chat nou) capsule container */
.capsule-input:focus-within { box-shadow: none !important; border-color: inherit !important; }
/* If intro-shell is used anywhere, disable its focus ring too */
.intro-shell:focus-within { box-shadow: none !important; }

/* Mobile: keep chat input fully on-screen and avoid horizontal overflow */
@media (max-width: 640px) {
  /* Prevent stray horizontal scroll */
  html, body { overflow-x: hidden; }

  /* Contain intro glow so it doesn't push layout horizontally */
  /* Allow overflow so focused input shadow/border isn't clipped */
  #introComposer .relative { overflow: visible; max-width: 100%; }
  #introComposer .mx-auto { max-width: 100% !important; }
  /* The inner width-limited wrapper in index.html */
  #introComposer .w-full { max-width: 100% !important; }

  /* Make input containers span the full width */
  .capsule-input,
  .chat-input-wrap {
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
  }

  /* Slightly tighter paddings/radii for small screens */
  .capsule-input { padding: 8px 8px 8px 12px; border-radius: 16px; }
  .chat-input-wrap { padding: 6px; border-radius: 12px; }

  /* Use 16px to avoid iOS zoom; reduce min height */
  .capsule-textarea,
  .chat-input-wrap textarea {
    font-size: 16px;
    min-height: 48px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  /* Keep send buttons proportional */
  #sendBtn { min-height: 48px; min-width: 48px; padding-left: 12px; padding-right: 12px; border-radius: 12px; }
  .capsule-send { width: 36px; height: 36px; }

  /* Reduce glow size to avoid overflow */
  .glow-spot { width: 26rem; height: 26rem; }

  /* Some mobile browsers mis-handle fixed attachment causing overflow jitter */
  .topo-bg { background-attachment: scroll; }

  /* Final guard: no element should exceed viewport width */
  body * { max-width: 100%; }

  /* When keyboard is open, give the intro composer a bit more top space */
  .kb-open #introComposer { margin-top: 14px !important; }
  .kb-open .capsule-textarea { scroll-margin-top: 64px; }
}

/* Disable hover effects on touch devices (focus: login modal) */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover-driven animations and transitions for modal buttons */
  #loginPrompt .oauthButton,
  #loginPrompt .button {
    transition: none !important;
    -webkit-tap-highlight-color: transparent;
  }

  #loginPrompt .oauthButton:hover {
    color: inherit !important;
    transform: none !important;
  }
  #loginPrompt .oauthButton:hover::before {
    width: 0 !important;
  }

  #loginPrompt .button:hover {
    transform: none !important;
    box-shadow: none !important;
  }
  #loginPrompt .button:hover::after {
    transform: none !important;
    box-shadow: none !important;
  }
  #loginPrompt .button .outline,
  #loginPrompt .button:hover .outline {
    opacity: 0 !important;
  }
  #loginPrompt .button:hover p span,
  #loginPrompt .button p span {
    animation: none !important;
    opacity: 1 !important;
  }

  /* Neutralize Tailwind hover utilities inside modal */
  #loginPrompt .hover\:bg-muted:hover { background: inherit !important; }

  /* General: avoid hover transforms on icons/links in the modal */
  #loginPrompt [role="button"]:hover,
  #loginPrompt button:hover,
  #loginPrompt a:hover,
  #loginPrompt .icon-button:hover {
    transform: none !important;
    box-shadow: none !important;
  }

  /* Global mobile: disable hover interactions across app */
  a, button, [role="button"], input, textarea, select,
  .chat-input-wrap, .capsule-input, .pill-nav,
  #sendBtn, .capsule-send,
  .bg-sidebar nav a, .bg-sidebar nav button,
  #sessionsList > *, #sessionsListMobile > *,
  .cmd-item {
    transition: none !important;
    -webkit-tap-highlight-color: transparent;
  }

  /* Neutralize common hover transforms/shadows */
  a:hover, button:hover, [role="button"]:hover,
  .chat-input-wrap:hover, .capsule-input:hover, .pill-nav:hover,
  #sendBtn:hover, .capsule-send:hover,
  .bg-sidebar nav a:hover, .bg-sidebar nav button:hover,
  #sessionsList > *:hover, #sessionsListMobile > *:hover,
  .cmd-item:hover {
    transform: none !important;
    box-shadow: none !important;
    filter: none !important;
    color: inherit !important;
  }

  /* Stop hover-driven pseudo animations (sheen, outlines, accents) */
  #sendBtn:hover::after, .capsule-send:hover::after,
  .button:hover::after { animation: none !important; transform: none !important; box-shadow: none !important; }
  .bg-sidebar nav a:hover::before, .bg-sidebar nav button:hover::before { opacity: 0 !important; transform: none !important; }

  /* Tailwind-like hover utility neutralizers where present */
  .hover\:bg-muted:hover, .hover\:bg-gray-100:hover, .hover\:bg-slate-100:hover, .hover\:bg-neutral-100:hover { background: inherit !important; }
  .hover\:shadow:hover, .hover\:shadow-lg:hover, .hover\:shadow-md:hover { box-shadow: none !important; }
  .hover\:translate-x-\[2px\]:hover, .hover\:translate-x-1:hover { transform: none !important; }
}

/* Dark theme input styles */
.dark .capsule-input {
  background: #000 !important;
  border-color: #333 !important;
}

/* Send button styles */
.send-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 8px; /* colțuri rotunjite */
  background-color: var(--main-color);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.send-button:hover {
  background-color: var(--hover-color);
}

/* Text color for input on light theme */
.capsule-input {
  color: #000 !important;
}

/* Text color for input on dark theme */
.dark .capsule-input {
  color: #fff !important; /* alb */
}

