/* ==========================================================================
   MY WEBSITE — All-In-One AI Tools Platform
   Design System & Stylesheet (Pure CSS3, Dark/Light Theme, 3D Glassmorphism)
   ========================================================================== */

:root {
  /* Typography */
  --font-display: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  /* Brand Accents (10% Accent Budget) */
  --accent-purple: #7c3aed;
  --accent-blue: #2563eb;
  --accent-cyan: #06b6d4;
  --accent-cyan-soft: #38bdf8;
  --grad-brand: linear-gradient(135deg, #7c3aed 0%, #2563eb 52%, #06b6d4 100%);
  --grad-brand-hover: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 52%, #22d3ee 100%);

  /* Dark Theme Palette (Default — 60% Canvas, 30% Structural Surfaces) */
  --bg-canvas: #060913;
  --bg-elevated: #0c1122;
  --bg-surface: rgba(15, 22, 42, 0.72);
  --bg-surface-solid: #10172d;
  --bg-surface-hover: rgba(22, 31, 58, 0.88);
  --bg-input: rgba(10, 15, 30, 0.85);
  --bg-header: rgba(6, 9, 19, 0.78);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-on-accent: #ffffff;

  --border-subtle: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.26);
  --border-glow: rgba(56, 189, 248, 0.36);

  /* Semantic Colors (paired with text/icons, never hue-only) */
  --status-success: #22c55e;
  --status-success-bg: rgba(34, 197, 94, 0.12);
  --status-warning: #f59e0b;
  --status-warning-bg: rgba(245, 158, 11, 0.12);
  --status-danger: #ef4444;
  --status-danger-bg: rgba(239, 68, 68, 0.12);
  --status-info: #38bdf8;
  --status-info-bg: rgba(56, 189, 248, 0.12);

  /* Elevation & Radii */
  --shadow-card: 0 18px 45px -22px rgba(2, 6, 23, 0.85);
  --shadow-glow: 0 0 36px -10px rgba(56, 189, 248, 0.24), 0 0 24px -12px rgba(124, 58, 237, 0.28);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  /* Motion */
  --ease-settle: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 160ms var(--ease-settle);
  --transition-med: 260ms var(--ease-settle);

  /* Layout */
  --container-max: 1240px;
  --header-height: 64px;
}

[data-theme="light"] {
  --bg-canvas: #f8fafc;
  --bg-elevated: #ffffff;
  --bg-surface: rgba(255, 255, 255, 0.88);
  --bg-surface-solid: #ffffff;
  --bg-surface-hover: #ffffff;
  --bg-input: #ffffff;
  --bg-header: rgba(248, 250, 252, 0.86);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --border-subtle: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.18);
  --border-glow: rgba(37, 99, 235, 0.32);

  --status-success: #15803d;
  --status-success-bg: rgba(21, 128, 61, 0.09);
  --status-warning: #b45309;
  --status-warning-bg: rgba(180, 83, 9, 0.09);
  --status-danger: #b91c1c;
  --status-danger-bg: rgba(185, 28, 28, 0.09);
  --status-info: #0369a1;
  --status-info-bg: rgba(3, 105, 161, 0.09);

  --shadow-card: 0 12px 32px -18px rgba(15, 23, 42, 0.14);
  --shadow-glow: 0 14px 36px -14px rgba(37, 99, 235, 0.18);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.005em;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

:focus-visible {
  outline: 2px solid var(--accent-cyan-soft);
  outline-offset: 2px;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

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

/* ==========================================================================
   Animated Ambient 3D Mesh Background (Compositor-Only)
   ========================================================================== */
.ambient-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(95px);
  opacity: 0.24;
  will-change: transform;
}

[data-theme="light"] .ambient-orb {
  opacity: 0.12;
}

.ambient-orb--purple {
  width: 560px;
  height: 560px;
  top: -160px;
  left: -120px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.72), transparent 70%);
  animation: driftOrbA 22s ease-in-out infinite alternate;
}

.ambient-orb--cyan {
  width: 520px;
  height: 520px;
  top: 22%;
  right: -140px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.65), transparent 70%);
  animation: driftOrbB 26s ease-in-out infinite alternate;
}

.ambient-orb--blue {
  width: 480px;
  height: 480px;
  bottom: -180px;
  left: 34%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.55), transparent 70%);
  animation: driftOrbA 28s ease-in-out infinite alternate-reverse;
}

.ambient-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--border-subtle) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border-subtle) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 15%, #000 35%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 15%, #000 35%, transparent 100%);
  opacity: 0.45;
}

@keyframes driftOrbA {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(48px, 36px, 0) scale(1.08); }
}

@keyframes driftOrbB {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-44px, 42px, 0) scale(1.06); }
}

/* ==========================================================================
   Layout Container & Section Spacing
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

main {
  flex: 1;
}

.section {
  padding: 84px 0;
}

.section--compact {
  padding: 56px 0;
}

.section--bordered {
  border-top: 1px solid var(--border-subtle);
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.section-header__copy {
  max-width: 640px;
}

.section-kicker {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent-cyan-soft);
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

[data-theme="light"] .section-kicker {
  color: var(--accent-blue);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.page-title {
  font-size: clamp(2.15rem, 4.2vw, 3.65rem);
}

.section-title {
  font-size: clamp(1.65rem, 2.8vw, 2.35rem);
}

.section-subtitle {
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 1.02rem;
  max-width: 62ch;
}

.gradient-text {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ==========================================================================
   Top Navigation Bar (Strict 3-Zone Contract, Single-Row, <= 64px)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-height);
  background: var(--bg-header);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
}

.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

/* Zone 1: Brand Wordmark (single-line, zero subtitle clutter) */
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--text-primary);
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--grad-brand);
  display: grid;
  place-items: center;
  color: #ffffff;
  box-shadow: 0 6px 18px -6px rgba(37, 99, 235, 0.7);
}

/* Zone 2: Clean Text Nav Links (No Pill Enclosures) */
.primary-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.nav-link {
  position: relative;
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
  padding: 6px 2px;
  transition: color var(--transition-fast);
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--grad-brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-fast);
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text-primary);
}

.nav-link.is-active::after,
.nav-link:hover::after {
  transform: scaleX(1);
}

/* Zone 3: Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}

.icon-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--bg-surface-hover);
}

.mobile-menu-btn {
  display: none;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.925rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.btn--sm {
  min-height: 36px;
  padding: 8px 14px;
  font-size: 0.85rem;
}

.btn--primary {
  background: var(--grad-brand);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 24px -10px rgba(37, 99, 235, 0.65);
}

.btn--primary:hover {
  background: var(--grad-brand-hover);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px -10px rgba(6, 182, 212, 0.55);
}

.btn--secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(12px);
}

.btn--secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-glow);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
}

.btn--ghost:hover {
  color: var(--text-primary);
}

.btn--danger {
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border: 1px solid rgba(239, 68, 68, 0.28);
}

.btn--danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* ==========================================================================
   Mobile Navigation Drawer
   ========================================================================== */
.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.68);
  backdrop-filter: blur(6px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-med);
}

.mobile-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 86vw);
  background: var(--bg-elevated);
  border-left: 1px solid var(--border-subtle);
  z-index: 100;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  transform: translateX(100%);
  transition: transform var(--transition-med);
}

.mobile-drawer.is-open {
  transform: translateX(0);
}

.mobile-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-drawer__nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-drawer__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.mobile-drawer__link:hover,
.mobile-drawer__link.is-active {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.mobile-drawer__footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ==========================================================================
   Hero Section & 3D Interactive Stage
   ========================================================================== */
.hero {
  padding: 64px 0 72px;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 48px;
  align-items: stretch;
}

.hero__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero__headline {
  font-size: clamp(2.4rem, 4.5vw, 3.85rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
  max-width: 14ch;
}

.hero__subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 52ch;
  margin-bottom: 28px;
}

/* Search Bar */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 6px 6px 6px 16px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  max-width: 560px;
}

.search-bar:focus-within {
  border-color: var(--accent-cyan-soft);
  box-shadow: var(--shadow-glow);
}

.search-bar__icon {
  color: var(--text-muted);
  flex-shrink: 0;
  display: inline-flex;
}

.search-bar__input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.95rem;
  color: var(--text-primary);
  min-height: 40px;
}

.search-bar__input::placeholder {
  color: var(--text-muted);
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.hero__meta-line {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* 3D Perspective Stage */
.hero-stage {
  perspective: 1200px;
  display: flex;
  align-items: stretch;
}

.hero-3d-frame {
  position: relative;
  width: 100%;
  min-height: 420px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 240ms var(--ease-settle), border-color var(--transition-fast), box-shadow var(--transition-med);
  box-shadow: var(--shadow-card);
}

.hero-3d-frame:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
}

.hero-3d-frame__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translateZ(0);
}

.hero-3d-frame__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 9, 19, 0.08) 0%, rgba(6, 9, 19, 0.25) 55%, rgba(6, 9, 19, 0.88) 100%);
  pointer-events: none;
}

.hero-3d-frame__caption {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 22px;
  transform: translateZ(32px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.hero-3d-frame__title {
  color: #f8fafc;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}

.hero-3d-frame__desc {
  color: #cbd5e1;
  font-size: 0.84rem;
  margin-top: 4px;
}

/* Full-width KPI Strip below Hero Split */
.stats-strip {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.stat-cell {
  padding: 24px;
  border-right: 1px solid var(--border-subtle);
}

.stat-cell:last-child {
  border-right: none;
}

.stat-cell__value {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.stat-cell__label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ==========================================================================
   Glassmorphism Cards, Tools Grid & 3D Tilt Hover
   ========================================================================== */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

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

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

.glass-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-med);
}

.glass-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  background: var(--bg-surface-hover);
  box-shadow: var(--shadow-glow);
}

@keyframes cardFadeSlideIn {
  from {
    opacity: 0;
    translate: 0 14px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

.card-enter {
  animation: cardFadeSlideIn 340ms var(--ease-settle) both;
  animation-delay: var(--enter-delay, 0ms);
  will-change: opacity, transform;
}

.tool-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.tool-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.18), rgba(6, 182, 212, 0.18));
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  color: var(--accent-cyan-soft);
  flex-shrink: 0;
}

[data-theme="light"] .tool-card__icon {
  color: var(--accent-blue);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(37, 99, 235, 0.1));
}

.fav-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.fav-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.fav-btn.is-active {
  color: #f43f5e;
  border-color: rgba(244, 63, 94, 0.35);
  background: rgba(244, 63, 94, 0.1);
}

.tool-card__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

/* Zero-pill unboxed metadata */
.meta-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.meta-line__accent {
  color: var(--accent-cyan-soft);
  font-weight: 600;
}

[data-theme="light"] .meta-line__accent {
  color: var(--accent-blue);
}

.tool-card__desc {
  color: var(--text-secondary);
  font-size: 0.925rem;
  margin-bottom: 20px;
  flex: 1;
}

.tool-card__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.tool-card__actions .btn {
  flex: 1;
}

/* Category Card */
.category-card {
  gap: 12px;
}

.category-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.category-card__count {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.category-card__title {
  font-size: 1.05rem;
  font-weight: 700;
}

.category-card__desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  flex: 1;
}

.category-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-cyan-soft);
  margin-top: 4px;
}

[data-theme="light"] .category-card__link {
  color: var(--accent-blue);
}

/* ==========================================================================
   Filter Controls & Segmented Bars
   ========================================================================== */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.segmented-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.segmented-btn {
  min-height: 36px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.segmented-btn:hover {
  color: var(--text-primary);
}

.segmented-btn.is-active {
  background: var(--grad-brand);
  color: #ffffff;
}

.category-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.filter-tab {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}

.filter-tab:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.filter-tab.is-active {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--accent-cyan-soft);
}

/* ==========================================================================
   Pricing Section & Comparison Table
   ========================================================================== */
.pricing-card--featured {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
}

.pricing-price {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin: 14px 0 4px;
}

.pricing-price__period {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0 24px;
  flex: 1;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.feature-list svg {
  color: var(--accent-cyan-soft);
  flex-shrink: 0;
  margin-top: 2px;
}

[data-theme="light"] .feature-list svg {
  color: var(--accent-blue);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.data-table th {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
  white-space: nowrap;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: var(--bg-surface-hover);
}

.num-col {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Testimonials & FAQ Accordion
   ========================================================================== */
.testimonial-quote {
  font-size: 0.98rem;
  color: var(--text-primary);
  margin-bottom: 20px;
  flex: 1;
}

.testimonial-author {
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.testimonial-author__name {
  font-weight: 700;
  font-size: 0.95rem;
}

.testimonial-author__role {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 860px;
}

.faq-item {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  overflow: hidden;
}

.faq-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  text-align: left;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-primary);
}

.faq-trigger svg {
  flex-shrink: 0;
  transition: transform var(--transition-fast);
  color: var(--text-muted);
}

.faq-item.is-open .faq-trigger svg {
  transform: rotate(180deg);
  color: var(--accent-cyan-soft);
}

.faq-panel {
  display: none;
  padding: 0 22px 18px;
  color: var(--text-secondary);
  font-size: 0.94rem;
}

.faq-item.is-open .faq-panel {
  display: block;
}

/* ==========================================================================
   Forms, Inputs, Auth Pages & Notice Banners
   ========================================================================== */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.94rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-cyan-soft);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16);
}

.form-error {
  font-size: 0.82rem;
  color: var(--status-danger);
}

.notice-box {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--status-info-bg);
  color: var(--text-primary);
  font-size: 0.88rem;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.notice-box--warning {
  background: var(--status-warning-bg);
}

.notice-box--success {
  background: var(--status-success-bg);
}

.auth-shell {
  min-height: calc(100vh - var(--header-height) - 180px);
  display: grid;
  place-items: center;
  padding: 48px 0;
}

.auth-card {
  width: 100%;
  max-width: 460px;
}

/* ==========================================================================
   Dashboard & Admin Workspace Sidebar Layout
   ========================================================================== */
.workspace-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 32px;
  padding: 36px 0 72px;
  align-items: start;
}

.workspace-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-nav-btn {
  width: 100%;
  min-height: 42px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: left;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.sidebar-nav-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.sidebar-nav-btn.is-active {
  background: var(--grad-brand);
  color: #ffffff;
}

.workspace-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.workspace-panel {
  display: none;
  flex-direction: column;
  gap: 24px;
}

.workspace-panel.is-active {
  display: flex;
}

/* Code / API Blueprint Block */
.code-block {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.55;
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  overflow-x: auto;
  white-space: pre;
}

/* Status Indicators (Always paired with explicit text) */
.status-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
}

.status-label--success { color: var(--status-success); }
.status-label--warning { color: var(--status-warning); }
.status-label--info { color: var(--status-info); }

/* ==========================================================================
   Empty State, Skeleton Loading & Modal
   ========================================================================== */
.empty-state {
  padding: 48px 24px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.skeleton-card {
  height: 220px;
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-surface-hover) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border: 1px solid var(--border-subtle);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(8px);
  z-index: 120;
  display: none;
  place-items: center;
  padding: 20px;
}

.modal-backdrop.is-open {
  display: grid;
}

.modal-dialog {
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

/* ==========================================================================
   Toast Stack & Back-to-Top
   ========================================================================== */
.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 140;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 40px));
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-primary);
  animation: toastIn 200ms var(--ease-settle);
}

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

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 50;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-surface-solid);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-card);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast);
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  border-color: var(--accent-cyan-soft);
}

/* ==========================================================================
   Footer (Quiet, Structured, Zero Telemetry Tickers)
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  padding: 56px 0 32px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, minmax(0, 1fr));
  gap: 36px;
  margin-bottom: 40px;
}

.footer-col__title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Responsive Breakpoints (Mobile <= 640px, Tablet <= 960px, Desktop 1240px+)
   ========================================================================== */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero__grid { grid-template-columns: 1fr; }
  .stats-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-cell { border-bottom: 1px solid var(--border-subtle); }
  .workspace-layout { grid-template-columns: 1fr; }
  .workspace-sidebar { position: static; flex-direction: row; overflow-x: auto; }
  .sidebar-nav-btn { width: auto; white-space: nowrap; }
}

@media (max-width: 900px) {
  .primary-nav { display: none; }
  .header-auth-desktop { display: none; }
  .mobile-menu-btn { display: inline-flex; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .section { padding: 56px 0; }
  .grid-3, .grid-4, .grid-2, .stats-strip, .footer-grid {
    grid-template-columns: 1fr;
  }
  .stat-cell { border-right: none; }
  .search-bar { flex-wrap: wrap; padding: 10px; }
  .search-bar .btn { width: 100%; }
  .hero-3d-frame { min-height: 280px; }
  .tool-card__actions { flex-direction: column; }
  .tool-card__actions .btn { width: 100%; }
}

/* ==========================================================================
   Advanced AI Chatbot Studio (chat.html)
   ========================================================================== */
body[data-page="chat"] {
  font-family: var(--font-body), 'Noto Sans Bengali', sans-serif;
}

.chat-shell {
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr);
  height: calc(100vh - var(--header-height));
  overflow: hidden;
  border-top: 1px solid var(--border-subtle);
}

.chat-sidebar {
  background: var(--bg-elevated);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 14px;
  min-height: 0;
}

.chat-sidebar__top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-history-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 4px;
}

.chat-history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.chat-history-item:hover {
  background: var(--bg-surface);
}

.chat-history-item.is-active {
  background: var(--bg-surface-hover);
  border-color: var(--border-glow);
}

.chat-history-item__select {
  flex: 1;
  min-width: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-history-item__title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-history-item__meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-history-item__actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  opacity: 0.78;
}

.chat-mini-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.chat-mini-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}

.chat-mini-btn--danger:hover {
  color: var(--status-danger);
}

.chat-privacy-box {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.chat-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: transparent;
}

.chat-topbar {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-header);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.chat-topbar__controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.chat-select {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chat-stream-inner {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chat-welcome {
  margin: auto;
  width: 100%;
  max-width: 780px;
  padding: 28px 8px;
  text-align: center;
}

.chat-welcome__prompts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
  text-align: left;
}

.chat-prompt-card {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.chat-prompt-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-glow);
  background: var(--bg-surface-hover);
}

.chat-prompt-card__mode {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-cyan-soft);
}

[data-theme="light"] .chat-prompt-card__mode {
  color: var(--accent-blue);
}

.chat-prompt-card__text {
  font-size: 0.92rem;
  color: var(--text-primary);
  line-height: 1.45;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: toastIn 180ms var(--ease-settle);
}

.chat-msg--user {
  align-items: flex-end;
}

.chat-msg--assistant {
  align-items: flex-start;
}

.chat-bubble {
  max-width: min(760px, 92%);
  padding: 15px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  font-size: 0.96rem;
  line-height: 1.65;
  word-break: break-word;
}

.chat-msg--user .chat-bubble {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.24), rgba(37, 99, 235, 0.22));
  border-color: rgba(56, 189, 248, 0.3);
  color: var(--text-primary);
}

[data-theme="light"] .chat-msg--user .chat-bubble {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(37, 99, 235, 0.1));
}

.chat-msg--assistant .chat-bubble {
  width: 100%;
  max-width: 100%;
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
}

.chat-msg__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.chat-msg__action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.chat-msg__action-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
  border-color: var(--border-subtle);
}

/* Markdown Typography & Code Blocks inside Assistant Bubbles */
.chat-markdown h1,
.chat-markdown h2,
.chat-markdown h3 {
  margin: 14px 0 8px;
  font-family: var(--font-display);
}

.chat-markdown h1 { font-size: 1.35rem; }
.chat-markdown h2 { font-size: 1.18rem; }
.chat-markdown h3 { font-size: 1.04rem; }

.chat-markdown p {
  margin: 8px 0;
}

.chat-markdown p:first-child {
  margin-top: 0;
}

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

.chat-markdown ul,
.chat-markdown ol {
  margin: 8px 0 8px 22px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.chat-markdown blockquote {
  margin: 10px 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.chat-markdown code.inline-code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.chat-markdown a {
  color: var(--accent-cyan-soft);
  text-decoration: underline;
}

.chat-code-block {
  margin: 12px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: #050812;
  overflow: hidden;
}

[data-theme="light"] .chat-code-block {
  background: #0f172a;
  color: #f1f5f9;
}

.chat-code-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #94a3b8;
}

.copy-code-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 600;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.08);
  transition: background var(--transition-fast);
}

.copy-code-btn:hover {
  background: rgba(56, 189, 248, 0.25);
}

.chat-code-block pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.55;
  color: #e2e8f0;
}

.typing-cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  margin-left: 4px;
  vertical-align: middle;
  border-radius: 2px;
  background: var(--accent-cyan-soft);
  animation: cursorBlink 0.9s steps(2, start) infinite;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.15; }
}

.chat-composer-wrap {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-header);
  backdrop-filter: blur(14px);
}

.chat-composer {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-input-box {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 8px 10px 8px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.chat-input-box:focus-within {
  border-color: var(--accent-cyan-soft);
  box-shadow: var(--shadow-glow);
}

.chat-textarea {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  max-height: 180px;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.5;
  padding: 8px 0;
}

.chat-textarea::placeholder {
  color: var(--text-muted);
}

.chat-composer__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.chat-sidebar-mobile-btn {
  display: none;
}

.chat-sidebar-backdrop {
  display: none;
}

@media (max-width: 960px) {
  .chat-shell {
    grid-template-columns: 1fr;
    position: relative;
  }
  .chat-sidebar-mobile-btn {
    display: inline-flex;
  }
  .chat-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: min(310px, 86vw);
    z-index: 80;
    transform: translateX(-100%);
    transition: transform var(--transition-med);
  }
  .chat-sidebar.is-open {
    transform: translateX(0);
  }
  .chat-sidebar-backdrop.is-open {
    display: block;
    position: fixed;
    top: var(--header-height);
    inset-inline: 0;
    bottom: 0;
    background: rgba(2, 6, 23, 0.68);
    z-index: 75;
  }
  .chat-welcome__prompts {
    grid-template-columns: 1fr;
  }
}

