/* ==========================================================================
   NexaForge — Design System & Stylesheet
   Dark Glassmorphism • Vivid Cyber Accents • Micro-Interactions
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-dark: #0a0d14;
  --bg-card: rgba(18, 24, 38, 0.72);
  --bg-card-hover: rgba(26, 34, 52, 0.85);
  --bg-input: rgba(14, 18, 28, 0.8);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(129, 140, 248, 0.4);
  --border-glow: rgba(99, 102, 241, 0.2);

  --accent-primary: #6366f1;       /* Indigo */
  --accent-secondary: #a855f7;     /* Purple */
  --accent-cyan: #06b6d4;          /* Cyan */
  --accent-pink: #ec4899;          /* Pink */
  --accent-success: #10b981;       /* Emerald */
  --accent-warning: #f59e0b;       /* Amber */
  --accent-danger: #ef4444;        /* Rose */

  --gradient-brand: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --gradient-cyan: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --gradient-glow: radial-gradient(circle at center, rgba(99, 102, 241, 0.15) 0%, transparent 70%);

  /* Typography */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Text Colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --text-inverse: #0b0f19;

  /* Shadows & Glass */
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px -5px rgba(99, 102, 241, 0.35);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Ambient Background Glows ────────────────────────────────────────────── */
.glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
  animation: orbFloat 20s infinite alternate ease-in-out;
}
.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.35) 0%, transparent 70%);
  top: -150px;
  left: 10%;
}
.orb-2 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.3) 0%, transparent 70%);
  top: 30%;
  right: -100px;
  animation-duration: 25s;
}
.orb-3 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.2) 0%, transparent 70%);
  bottom: -200px;
  left: 20%;
  animation-duration: 28s;
}

@keyframes orbFloat {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.08); }
  100% { transform: translate(-30px, 50px) scale(0.95); }
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(10, 13, 20, 0.75);
  border-bottom: 1px solid var(--border-subtle);
  width: 100%;
}
.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--gradient-brand);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
}
.brand-text {
  display: flex;
  flex-direction: column;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand-accent {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-tagline {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.status-badge-btn,
.status-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
  outline: none;
}
.status-badge-btn:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: var(--border-hover);
  color: var(--text-main);
  transform: translateY(-1px);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-warning);
  box-shadow: 0 0 6px var(--accent-warning);
  flex-shrink: 0;
  transition: all 0.3s ease;
}
.status-badge-btn.online .status-dot,
.status-badge.online .status-dot {
  background: var(--accent-success);
  box-shadow: 0 0 10px var(--accent-success);
}
.status-badge-btn.offline .status-dot,
.status-badge.offline .status-dot {
  background: var(--accent-danger);
  box-shadow: 0 0 10px var(--accent-danger);
}
.status-hint-tag {
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.nav-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
}
.nav-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.primary-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  background: var(--gradient-brand);
  color: #fff;
  border: none;
  font-family: var(--font-body);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.35);
  transition: var(--transition-normal);
}
.primary-pill-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.55);
}

/* ── Main Layout ─────────────────────────────────────────────────────────── */
.main-content {
  position: relative;
  z-index: 10;
  max-width: 1040px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
  width: 100%;
  flex: 1;
}

/* ── Hero Section ────────────────────────────────────────────────────────── */
.hero-section {
  text-align: center;
  margin-bottom: 2.5rem;
}
.tech-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.tech-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
}
.gradient-text {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 660px;
  margin: 0 auto 2rem;
}

/* ── Mode Switcher ───────────────────────────────────────────────────────── */
.mode-switcher-container {
  display: flex;
  justify-content: center;
}
.mode-switcher {
  display: inline-flex;
  padding: 5px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  gap: 4px;
}
.mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-normal);
}
.mode-tab:hover {
  color: var(--text-main);
}
.mode-tab.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.badge-mini {
  font-size: 0.65rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
}

/* ── Glass Panel ─────────────────────────────────────────────────────────── */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), 0 0 40px -10px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  position: relative;
}

/* ── Workspace Card ──────────────────────────────────────────────────────── */
.workspace-card {
  padding: 2.25rem;
  margin-bottom: 3.5rem;
  transition: var(--transition-normal);
}

/* ── AI Input Zone ───────────────────────────────────────────────────────── */
.zone-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 0.75rem;
}
.sparkle-icon {
  font-size: 1.1rem;
}
.instruction-box {
  position: relative;
  display: flex;
  align-items: center;
}
.instruction-input {
  width: 100%;
  padding: 1.1rem 1.4rem;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  transition: var(--transition-normal);
}
.instruction-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25), 0 0 20px rgba(99, 102, 241, 0.2);
}
.clear-input-btn {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
}
.clear-input-btn:hover {
  color: var(--text-main);
}

.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.9rem;
}
.chip-label {
  font-size: 0.78rem;
  color: var(--text-subtle);
  font-weight: 600;
  margin-right: 0.25rem;
}
.prompt-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: var(--font-body);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
}
.prompt-chip:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.35);
  color: #c7d2fe;
  transform: translateY(-1px);
}

/* ── Dropzone ────────────────────────────────────────────────────────────── */
.dropzone {
  margin-top: 1.75rem;
  border: 2px dashed rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.015);
  cursor: pointer;
  position: relative;
  transition: var(--transition-normal);
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.04);
}
.dropzone.dragover {
  transform: scale(1.008);
}
.file-input-hidden {
  display: none;
}
.upload-icon-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  display: grid;
  place-items: center;
  margin: 0 auto 1rem;
  color: #c7d2fe;
  transition: var(--transition-fast);
}
.dropzone:hover .upload-icon-circle {
  transform: translateY(-2px);
  background: rgba(99, 102, 241, 0.15);
  color: #fff;
}
.dropzone-text {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.dropzone-primary {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-main);
}
.dropzone-secondary {
  font-size: 0.8rem;
  color: var(--text-subtle);
}

/* ── File Preview inside Dropzone ────────────────────────────────────────── */
.file-preview-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  text-align: left;
}
.preview-thumb-container {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.file-icon-placeholder {
  font-size: 1.5rem;
}
.preview-details {
  flex: 1;
  min-width: 0;
}
.preview-filename {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.preview-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.remove-file-btn {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: var(--transition-fast);
}
.remove-file-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

/* ── Action Footer ───────────────────────────────────────────────────────── */
.action-footer {
  margin-top: 2rem;
  display: flex;
  justify-content: flex-end;
}
.execute-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 2rem;
  border-radius: var(--radius-md);
  background: var(--gradient-brand);
  color: #fff;
  border: none;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
  transition: var(--transition-normal);
}
.execute-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(168, 85, 247, 0.6);
}
.execute-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── Studio Mode ─────────────────────────────────────────────────────────── */
.studio-subtabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.studio-subtab {
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}
.studio-subtab:hover {
  color: var(--text-main);
}
.studio-subtab.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #fff;
}

.tool-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.tool-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.1rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
  transition: var(--transition-fast);
}
.tool-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  transform: translateY(-2px);
}
.tool-card.active {
  background: rgba(99, 102, 241, 0.18);
  border-color: var(--accent-primary);
  color: #fff;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.25);
}
.tool-icon {
  font-size: 1.6rem;
  margin-bottom: 0.4rem;
}
.tool-name {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.15rem;
}
.tool-desc {
  font-size: 0.7rem;
  color: var(--text-subtle);
}

.tool-params-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}
.param-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 0.6rem;
}
.slider-input-combo {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.range-slider {
  flex: 1;
  accent-color: var(--accent-primary);
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
}
.number-input, .text-input {
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  outline: none;
}
.number-input:focus, .text-input:focus {
  border-color: var(--accent-primary);
}
.full-width {
  width: 100%;
}
.param-unit {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}
.dimensions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}
.param-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-subtle);
  margin-top: 0.5rem;
}

.pill-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.pill-radio {
  cursor: pointer;
}
.pill-radio input {
  display: none;
}
.pill-radio span {
  display: inline-block;
  padding: 0.45rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition-fast);
}
.pill-radio input:checked + span {
  background: var(--gradient-brand);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.35);
}

/* ── Processing Overlay ──────────────────────────────────────────────────── */
.processing-card {
  padding: 3rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}
.processing-spinner-ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid rgba(99, 102, 241, 0.15);
  border-top-color: var(--accent-primary);
  animation: spin 1s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
}
.processing-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.processing-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.progress-bar-wrapper {
  width: 100%;
  max-width: 380px;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 0 auto;
}
.progress-bar-fill.indeterminate {
  width: 40%;
  height: 100%;
  background: var(--gradient-brand);
  border-radius: var(--radius-full);
  animation: indeterminateProgress 1.6s infinite ease-in-out;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes indeterminateProgress {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(120%); }
  100% { transform: translateX(300%); }
}

/* ── Result Card ─────────────────────────────────────────────────────────── */
.result-card {
  padding: 2rem;
  margin-top: 1.5rem;
  background: rgba(16, 24, 39, 0.8);
  border: 1px solid rgba(16, 185, 129, 0.3);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.result-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.success-icon-badge {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--accent-success);
  display: grid;
  place-items: center;
}
.result-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}
.result-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ── AI Verified Response Box ────────────────────────────────────────── */
.ai-response-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.ai-response-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}
.ai-response-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-cyan);
}
.verification-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--accent-success);
}
.verification-badge.failed {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}
.ai-response-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #e2e8f0;
  margin-bottom: 0.85rem;
}
.verification-details-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.verification-target {
  font-family: var(--font-mono);
  color: #a5b4fc;
  font-weight: 600;
}
.verification-audit {
  color: #cbd5e1;
}

.result-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.metric-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.metric-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-subtle);
  font-weight: 700;
  letter-spacing: 0.05em;
}
.metric-val {
  font-size: 1.15rem;
  font-weight: 700;
  font-family: var(--font-mono);
}
.text-success {
  color: var(--accent-success);
}
.badge-efficiency {
  color: var(--accent-cyan);
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.35);
  transition: var(--transition-fast);
}
.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.5);
}
.secondary-btn {
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}
.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.09);
}

/* ── Features Showcase Grid ─────────────────────────────────────────────── */
.features-showcase {
  margin-top: 2rem;
}
.section-title {
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 1.5rem;
}
.feature-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}
.feature-card {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  transition: var(--transition-normal);
}
.feature-card:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(255, 255, 255, 0.04);
}
.feature-icon {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
}
.feature-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.feature-desc {
  font-size: 0.825rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ── RAG Assistant Drawer ────────────────────────────────────────────────── */
.assistant-drawer {
  position: fixed;
  bottom: 90px;
  right: 25px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: 80vh;
  border-radius: var(--radius-xl);
  background: rgba(14, 18, 28, 0.92);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 25px 40px -10px rgba(0, 0, 0, 0.7), 0 0 30px rgba(99, 102, 241, 0.2);
  display: flex;
  flex-direction: column;
  z-index: 60;
  transform: translateY(20px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-bounce);
}
.assistant-drawer.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}
.drawer-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer-title-block {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.assistant-avatar {
  font-size: 1.4rem;
}
.assistant-name {
  font-size: 0.95rem;
  font-weight: 700;
}
.assistant-badge {
  font-size: 0.65rem;
  color: var(--accent-cyan);
  font-weight: 600;
}
.close-drawer-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
}
.close-drawer-btn:hover {
  color: var(--text-main);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.chat-bubble {
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  line-height: 1.45;
  max-width: 90%;
  animation: slideUp 0.2s ease-out;
}
.chat-bubble.bot {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.chat-bubble.user {
  background: var(--gradient-brand);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-sources {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-subtle);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.4rem;
}
.suggested-questions {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.rag-chip {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
  font-size: 0.75rem;
  font-family: var(--font-body);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  transition: var(--transition-fast);
}
.rag-chip:hover {
  background: rgba(99, 102, 241, 0.22);
  color: #fff;
}

.chat-input-bar {
  padding: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 0.5rem;
}
.chat-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  padding: 0.55rem 1rem;
  color: var(--text-main);
  font-size: 0.85rem;
  font-family: var(--font-body);
  outline: none;
}
.chat-input:focus {
  border-color: var(--accent-primary);
}
.chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-brand);
  border: none;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: var(--transition-fast);
}
.chat-send-btn:hover {
  transform: scale(1.05);
}

/* ── Floating Assistant FAB ──────────────────────────────────────────────── */
.floating-assistant-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 55;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-full);
  background: var(--gradient-brand);
  color: #fff;
  border: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.45);
  transition: var(--transition-bounce);
}
.floating-assistant-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 30px rgba(168, 85, 247, 0.6);
}
.floating-btn-glow {
  position: absolute;
  inset: -2px;
  border-radius: var(--radius-full);
  background: var(--gradient-brand);
  filter: blur(8px);
  z-index: -1;
  opacity: 0.7;
}

/* ── Settings Modal ──────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.modal-card {
  width: 100%;
  max-width: 460px;
  padding: 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}
.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
}
.modal-desc {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.45;
}
.modal-desc code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.api-test-result {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  min-height: 20px;
}
.api-test-result.success {
  color: var(--accent-success);
}
.api-test-result.error {
  color: var(--accent-danger);
}

/* ── Toast Notifications ─────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  animation: slideRight 0.25s ease-out;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.toast.success {
  background: rgba(16, 185, 129, 0.9);
  color: #fff;
}
.toast.error {
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
}
.toast.info {
  background: rgba(99, 102, 241, 0.9);
  color: #fff;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.app-footer {
  border-top: 1px solid var(--border-subtle);
  background: rgba(10, 13, 20, 0.6);
  backdrop-filter: blur(12px);
  padding: 1.5rem;
  margin-top: auto;
  position: relative;
  z-index: 10;
}
.footer-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-subtle);
}
.footer-copy strong {
  color: var(--text-main);
}
.footer-meta span {
  color: var(--text-muted);
}

/* ── Animations ──────────────────────────────────────────────────────────── */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideRight {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── Continuous In-Memory Stream Editing ─────────────────────────────────── */
.chained-stream-box {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: rgba(14, 20, 32, 0.75);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.chained-stream-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.chained-stream-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: #c7d2fe;
}
.stream-status-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.chained-stream-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}
.chained-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.chained-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
  font-weight: 500;
}
.chained-chip:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: var(--border-hover);
  color: #fff;
  transform: translateY(-1px);
}
.chained-form {
  width: 100%;
}
.chained-input-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.chained-input {
  flex: 1;
  background: rgba(10, 13, 20, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  color: var(--text-main);
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition-fast);
}
.chained-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}
.chained-submit-btn {
  background: var(--gradient-brand);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.65rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.chained-submit-btn:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}
.chained-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

/* ── System Diagnostics Modal (Recruiter Audit) ─────────────────────────── */
.diagnostics-card {
  max-width: 640px;
  width: 92%;
}
.diagnostics-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.diagnostics-pulse-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: #a7f3d0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.status-dot.green {
  background: var(--accent-success);
  box-shadow: 0 0 8px var(--accent-success);
}
.status-dot.amber {
  background: var(--accent-warning);
  box-shadow: 0 0 8px var(--accent-warning);
}
.status-dot.red {
  background: var(--accent-danger);
  box-shadow: 0 0 8px var(--accent-danger);
}
.services-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.25rem 0;
}
.service-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}
.service-item-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(255, 255, 255, 0.05);
}
.service-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.service-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.service-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.service-badge-pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}
.service-badge-pill.online {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.service-badge-pill.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.service-badge-pill.offline {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.diagnostics-note-box {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  color: #cbd5e1;
  line-height: 1.45;
  align-items: flex-start;
}
.diagnostics-note-box svg {
  color: var(--accent-primary);
  flex-shrink: 0;
  margin-top: 2px;
}
.diagnostics-note-box code {
  color: #a5b4fc;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

/* ── Chat Typography Cleanups (No Raw Syntax Artifacts) ──────────────────── */
.chat-bubble h1,
.chat-bubble h2,
.chat-bubble h3,
.chat-bubble h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin: 0.6rem 0 0.3rem 0;
}
.chat-bubble ul,
.chat-bubble ol {
  padding-left: 1.2rem;
  margin: 0.4rem 0;
}
.chat-bubble li {
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
}
.chat-bubble strong {
  color: #f1f5f9;
  font-weight: 600;
}

/* ── Footer Link ─────────────────────────────────────────────────────────── */
.footer-author-link {
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dotted rgba(6, 182, 212, 0.5);
  transition: all var(--transition-fast);
}
.footer-author-link:hover {
  color: #fff;
  border-bottom-color: #fff;
}

/* ── Comprehensive Responsive & Mobile-First Media Queries ──────────────── */

/* Tablet & Smaller Desktops (<= 900px) */
@media (max-width: 900px) {
  .main-content {
    padding: 2.25rem 1.25rem 4.5rem;
  }
  .feature-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .tool-selector-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

/* Standard Mobile Screens & Tablets (<= 768px) */
@media (max-width: 768px) {
  .header-inner {
    padding: 0.65rem 1rem;
  }
  .workspace-card {
    padding: 1.35rem 1rem;
    border-radius: var(--radius-lg);
  }
  .hero-title {
    font-size: clamp(1.85rem, 6vw, 2.65rem);
  }
  .hero-subtitle {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
  }
  .result-metrics-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 1rem;
  }
  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }
  .action-footer {
    justify-content: stretch;
  }
  .execute-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Smartphone Screens (<= 640px) */
@media (max-width: 640px) {
  .main-content {
    padding: 1.25rem 0.75rem 4rem;
  }
  
  /* Header Mobile Adaptations */
  .brand {
    gap: 0.5rem;
  }
  .brand-logo {
    width: 32px;
    height: 32px;
  }
  .brand-name {
    font-size: 1.1rem;
  }
  .header-nav {
    gap: 0.35rem;
  }
  .status-badge-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
  }
  .status-hint-tag {
    display: none;
  }
  .nav-btn {
    width: 34px;
    height: 34px;
  }
  .primary-pill-btn.header-rag-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    gap: 0.35rem;
  }

  /* Mode Switcher */
  .mode-switcher-container {
    width: 100%;
  }
  .mode-switcher {
    width: 100%;
    max-width: 100%;
    display: flex;
    padding: 4px;
  }
  .mode-tab {
    flex: 1 1 0;
    justify-content: center;
    padding: 0.55rem 0.4rem;
    font-size: 0.8rem;
    gap: 0.35rem;
  }
  .badge-mini {
    display: none;
  }

  /* AI Mode Input & Dropzone */
  .ai-instruction-bar {
    padding: 0.65rem 0.85rem;
  }
  .prompt-chips-wrapper {
    margin-top: 1rem;
  }
  .prompt-chips {
    gap: 0.35rem;
  }
  .prompt-chip {
    font-size: 0.75rem;
    padding: 0.4rem 0.75rem;
  }
  .dropzone-area {
    min-height: 160px;
    padding: 1.5rem 0.75rem;
  }
  .dropzone-icon {
    width: 44px;
    height: 44px;
    font-size: 1.4rem;
  }
  .dropzone-title {
    font-size: 0.95rem;
  }
  .dropzone-desc {
    font-size: 0.75rem;
  }

  /* Studio Subtabs & Grid */
  .studio-subtabs {
    width: 100%;
    gap: 0.35rem;
  }
  .studio-subtab {
    flex: 1 1 0;
    text-align: center;
    padding: 0.55rem 0.5rem;
    font-size: 0.8rem;
  }
  .tool-selector-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  .tool-card {
    padding: 0.85rem 0.5rem;
  }
  .tool-icon {
    font-size: 1.35rem;
  }
  .tool-name {
    font-size: 0.8rem;
  }
  .tool-desc {
    font-size: 0.65rem;
  }

  /* Studio Parameters */
  .tool-params-box {
    padding: 1rem 0.85rem;
  }
  .slider-input-combo {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .number-input-compact {
    width: 100% !important;
    text-align: center;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Result Card & Actions */
  .result-card {
    padding: 1.25rem 0.85rem;
  }
  .result-header {
    gap: 0.65rem;
  }
  .success-icon-badge {
    width: 38px;
    height: 38px;
    min-width: 38px;
  }
  .result-title {
    font-size: 1.05rem;
  }
  .result-subtitle {
    font-size: 0.75rem;
    word-break: break-all;
  }
  .ai-response-box {
    padding: 1rem 0.85rem;
  }
  .ai-response-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
  .verification-details-bar {
    flex-direction: column;
    gap: 0.3rem;
  }
  .result-actions {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }
  .download-btn,
  .result-actions .secondary-btn {
    width: 100%;
    justify-content: center;
    text-align: center;
    padding: 0.85rem 1rem;
  }

  /* Chained Stream Box */
  .chained-stream-box {
    padding: 1rem 0.85rem;
  }
  .chained-stream-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
  .chained-input-group {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .chained-submit-btn {
    width: 100%;
    justify-content: center;
  }

  /* Modals on Mobile */
  .modal-backdrop {
    padding: 0.5rem;
  }
  .modal-card {
    width: 100%;
    max-width: 100%;
    max-height: calc(100vh - 1rem);
    padding: 1.25rem 1rem;
    border-radius: var(--radius-lg);
  }
  .modal-footer {
    flex-direction: column-reverse;
    gap: 0.5rem;
  }
  .modal-footer button {
    width: 100%;
    justify-content: center;
  }
  .service-item-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem;
  }
  .service-badge-pill {
    align-self: flex-start;
  }

  /* RAG Assistant Drawer - Native Full-Screen on Smartphone */
  .assistant-drawer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
    z-index: 150;
  }
  .assistant-drawer.open {
    transform: none;
  }
  .chat-input-bar {
    padding: 0.75rem 0.85rem;
    padding-bottom: max(0.85rem, env(safe-area-inset-bottom));
  }

  /* Floating Assistant Button */
  .floating-assistant-btn {
    bottom: max(1.25rem, calc(env(safe-area-inset-bottom) + 0.5rem));
    right: max(1rem, env(safe-area-inset-right));
    padding: 0.65rem 1rem;
    font-size: 0.8rem;
  }

  /* Features Grid */
  .feature-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* Compact Mobile Screens (<= 400px - iPhone SE, Galaxy compact) */
@media (max-width: 400px) {
  .header-inner {
    padding: 0.5rem 0.65rem;
  }
  .brand-tagline {
    display: none;
  }
  .brand-name {
    font-size: 1rem;
  }
  .status-badge-btn {
    padding: 0.3rem 0.45rem;
    font-size: 0.7rem;
  }
  .header-rag-btn span {
    font-size: 0.7rem;
  }
  .nav-btn {
    width: 32px;
    height: 32px;
  }
  .hero-title {
    font-size: 1.65rem;
  }
  .tool-selector-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
  }
  .tool-card {
    padding: 0.7rem 0.4rem;
  }
  .tool-icon {
    font-size: 1.2rem;
  }
  .tool-name {
    font-size: 0.75rem;
  }
  .tool-desc {
    display: none;
  }
}

/* PWA Standalone Display Mode Enhancements */
@media (display-mode: standalone) {
  body {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
  }
  .app-header {
    padding-top: env(safe-area-inset-top);
  }
  .app-footer {
    padding-bottom: max(1.5rem, calc(env(safe-area-inset-bottom) + 1rem));
  }
}


