:root {
  --bg-main: #F9FAFB;
  --bg-secondary: #FFFFFF;
  --text-main: #111827;
  --text-muted: #6B7280;
  --text-faint: #9CA3AF;
  --primary-main: #4F46E5;
  --primary-bg: #EEF2FF;
  --primary-text: #FFFFFF;
  --primary-text-active: #4338CA;
  --border-main: #E5E7EB;
  --danger-main: #DC2626;
  --danger-bg: #FEE2E2;
  --danger-text: #B91C1C;
  --valid-bg: #F0FDF4;
  --valid-text: #166534;
  --invalid-bg: #FEF2F2;
  --invalid-text: #B91C1C;
  --font-family: 'Inter', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --radius: 0.5rem; /* 8px */
}

/* --- Base & Reset --- */
*, *::before, *::after { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; }
h1 { font-size: 1.125rem; }
h2 { font-size: 0.875rem; text-transform: uppercase; color: var(--text-faint); letter-spacing: 0.05em; margin-bottom: 0.5rem; }
h3 { font-size: 1rem; }
h4 { font-size: 0.875rem; }

section { display: flex; flex-direction: column; gap: 1rem; }
button { font-family: inherit; }
.hidden { display: none; }
code { font-family: var(--font-mono); }

/* --- Tailwind-compatible utility classes for SimpleLandingPage --- */
.min-h-screen { min-height: 100vh; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.bg-gradient-to-br { background: linear-gradient(to bottom right, var(--gradient-from), var(--gradient-via), var(--gradient-to)); }
.from-purple-600 { --gradient-from: #9333ea; }
.via-blue-600 { --gradient-via: #2563eb; }
.to-pink-600 { --gradient-to: #dc2626; }
.relative { position: relative; }
.absolute { position: absolute; }
.overflow-hidden { overflow: hidden; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.aurora-background {
  background: linear-gradient(to bottom right, rgba(139, 92, 246, 0.2), rgba(59, 130, 246, 0.2), rgba(34, 197, 94, 0.2));
}
.top-8 { top: 2rem; }
.right-8 { right: 2rem; }
.bottom-4 { bottom: 1rem; }
.left-4 { left: 1rem; }
.z-10 { z-index: 10; }
.text-center { text-align: center; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.max-w-4xl { max-width: 56rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mb-12 { margin-bottom: 3rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-16 { margin-bottom: 4rem; }
.mb-2 { margin-bottom: 0.5rem; }
.text-5xl { font-size: 3rem; line-height: 1; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-mono { font-family: var(--font-mono); }
.text-white { color: white; }
.text-blue-100 { color: #dbeafe; }
.text-blue-50 { color: #eff6ff; }
.text-white\/70 { color: rgba(255, 255, 255, 0.7); }
.drop-shadow-2xl { filter: drop-shadow(0 25px 25px rgb(0 0 0 / 0.15)); }
.bg-gradient-to-r { background: linear-gradient(to right, var(--gradient-from), var(--gradient-to)); }
.from-cyan-400 { --gradient-from: #22d3ee; }
.to-green-400 { --gradient-to: #4ade80; }
.from-blue-500 { --gradient-from: #3b82f6; }
.to-cyan-500 { --gradient-to: #06b6d4; }
.bg-clip-text { background-clip: text; -webkit-background-clip: text; }
.text-transparent { color: transparent; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25); }
.transform { transform: translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); }
.hover\:scale-105:hover { --tw-scale-x: 1.05; --tw-scale-y: 1.05; }
.hover\:transform:hover { transform: translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); }
.hover\:scale-110:hover { --tw-scale-x: 1.1; --tw-scale-y: 1.1; }
.hover\:bg-black\/40:hover { background-color: rgba(0, 0, 0, 0.4); }
.transition-all { transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1); }
.transition-transform { transition: transform 150ms cubic-bezier(0.4, 0, 0.2, 1); }
.duration-300 { transition-duration: 300ms; }
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.flex-col { flex-direction: column; }
.gap-8 { gap: 2rem; }
.gap-2 { gap: 0.5rem; }
.gap-16 { gap: 4rem; }
.bg-black\/20 { background-color: rgba(0, 0, 0, 0.2); }
.backdrop-blur-sm { backdrop-filter: blur(4px); }
.group:hover .hover\:scale-110 { --tw-scale-x: 1.1; --tw-scale-y: 1.1; }

/* Responsive classes */
@media (min-width: 768px) {
  .md\:text-7xl { font-size: 4.5rem; line-height: 1; }
  .md\:text-2xl { font-size: 1.5rem; line-height: 2rem; }
  .md\:text-5xl { font-size: 3rem; line-height: 1; }
  .md\:text-xl { font-size: 1.25rem; line-height: 1.75rem; }
  .md\:flex-row { flex-direction: row; }
  .md\:gap-16 { gap: 4rem; }
}

/* Animation keyframes */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

/* Variables for transforms */
:root {
  --tw-translate-x: 0;
  --tw-translate-y: 0;
  --tw-rotate: 0;
  --tw-skew-x: 0;
  --tw-skew-y: 0;
  --tw-scale-x: 1;
  --tw-scale-y: 1;
}

/* --- Additional utility classes for Stage components --- */
.p-6 { padding: 1.5rem; }
.p-4 { padding: 1rem; }
.p-3 { padding: 0.75rem; }
.p-2 { padding: 0.5rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-gray-900 { color: #111827; }
.text-gray-700 { color: #374151; }
.text-gray-600 { color: #4b5563; }
.text-green-800 { color: #166534; }
.text-yellow-800 { color: #92400e; }
.mb-1 { margin-bottom: 0.25rem; }
.mt-4 { margin-top: 1rem; }
.ml-5 { margin-left: 1.25rem; }
.w-full { width: 100%; }
.h-32 { height: 8rem; }
.h-20 { height: 5rem; }
.h-24 { height: 6rem; }
.border { border-width: 1px; }
.border-gray-300 { border-color: #d1d5db; }
.border-green-200 { border-color: #bbf7d0; }
.border-yellow-200 { border-color: #fef08a; }
.border-gray-200 { border-color: #e5e7eb; }
.rounded { border-radius: 0.25rem; }
.focus\:outline-none:focus { outline: none; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px currentColor; }
.focus\:ring-blue-500:focus { --tw-ring-color: #3b82f6; }
.focus\:ring-yellow-500:focus { --tw-ring-color: #eab308; }
.focus\:ring-green-500:focus { --tw-ring-color: #22c55e; }
.focus\:ring-purple-500:focus { --tw-ring-color: #a855f7; }
.focus\:ring-orange-500:focus { --tw-ring-color: #f97316; }
.bg-blue-600 { background-color: #2563eb; }
.bg-green-600 { background-color: #16a34a; }
.bg-yellow-600 { background-color: #ca8a04; }
.bg-gray-300 { background-color: #d1d5db; }
.bg-gray-400 { background-color: #9ca3af; }
.bg-green-50 { background-color: #f0fdf4; }
.bg-yellow-50 { background-color: #fefce8; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-600 { background-color: #4b5563; }
.hover\:bg-blue-700:hover { background-color: #1d4ed8; }
.hover\:bg-green-700:hover { background-color: #15803d; }
.hover\:bg-yellow-700:hover { background-color: #a16207; }
.hover\:bg-gray-400:hover { background-color: #9ca3af; }
.hover\:bg-gray-700:hover { background-color: #374151; }
.disabled\:bg-gray-400:disabled { background-color: #9ca3af; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-12 { padding-left: 3rem; padding-right: 3rem; }
.list-disc { list-style-type: disc; }
.block { display: block; }
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.gap-6 { gap: 1.5rem; }
.gap-4 { gap: 1rem; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.border-t { border-top-width: 1px; }
.pt-4 { padding-top: 1rem; }
.max-h-96 { max-height: 24rem; }
.overflow-y-auto { overflow-y: auto; }
.whitespace-pre-wrap { white-space: pre-wrap; }

/* Color variants */
.text-blue-600 { color: #2563eb; }
.text-green-600 { color: #16a34a; }
.text-purple-600 { color: #9333ea; }
.text-orange-600 { color: #ea580c; }
.text-gray-800 { color: #1f2937; }

/* Large grid responsive */
@media (min-width: 1024px) {
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --- Glass-themed Northern Lights styling --- */
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.max-w-2xl { max-width: 42rem; }
.h-40 { height: 10rem; }
.p-8 { padding: 2rem; }
.p-6 { padding: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-xl { border-radius: 0.75rem; }
.bg-white\/10 { background-color: rgba(255, 255, 255, 0.1); }
.bg-black\/20 { background-color: rgba(0, 0, 0, 0.2); }
.backdrop-blur-sm { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.backdrop-blur-md { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.border { border-width: 1px; }
.border-white\/30 { border-color: rgba(255, 255, 255, 0.3); }
.border-white\/20 { border-color: rgba(255, 255, 255, 0.2); }
.text-white\/90 { color: rgba(255, 255, 255, 0.9); }
.text-white\/60 { color: rgba(255, 255, 255, 0.6); }
.placeholder-white\/60::placeholder { color: rgba(255, 255, 255, 0.6); }
.focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }
.focus\:ring-2:focus { box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.5); }
.focus\:ring-cyan-400:focus { --tw-ring-color: #22d3ee; }
.focus\:border-transparent:focus { border-color: transparent; }
.leading-relaxed { line-height: 1.625; }
.resize-none { resize: none; }
.pointer-events-none { pointer-events: none; }
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.focus-within\:opacity-100:focus-within { opacity: 1; }
.disabled\:opacity-50:disabled { opacity: 0.5; }
.disabled\:transform-none:disabled { transform: none; }
.disabled\:cursor-not-allowed:disabled { cursor: not-allowed; }
.from-cyan-400 { --gradient-from: #22d3ee; }
.to-blue-500 { --gradient-to: #3b82f6; }
.from-purple-600 { --gradient-from: #9333ea; }
.via-blue-600 { --gradient-via: #2563eb; }
.to-pink-600 { --gradient-to: #ec4899; }
.w-5 { width: 1.25rem; }
.h-5 { height: 1.25rem; }
.border-2 { border-width: 2px; }
.border-white\/30 { border-color: rgba(255, 255, 255, 0.3); }
.border-t-white { border-top-color: white; }
.animate-spin { animation: spin 1s linear infinite; }

/* Animation keyframes */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- App Layout --- */
.app-container { min-height: 100vh; }
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-main);
  padding: 0 1.5rem;
}
.header-content { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.header-left, .header-right { display: flex; align-items: center; gap: 0.75rem; }
.logo { width: 32px; height: 32px; background-color: var(--primary-main); border-radius: 50%; }
.header-separator {
  width: 1px;
  height: 24px;
  background-color: var(--border-main);
  margin: 0 0.5rem;
}

.main-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
  align-items: flex-start;
}
.sidebar {
  position: sticky; top: 76px; /* header height + padding */
  background: var(--bg-secondary);
  border: 1px solid var(--border-main);
  border-radius: var(--radius);
  padding: 1rem;
}
.sidebar nav { display: flex; flex-direction: column; gap: 0.25rem; }
.shortcuts { margin-top: 1.5rem; border-top: 1px solid var(--border-main); padding-top: 1rem; }
.shortcuts h3 { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; margin-bottom: 0.5rem; }
.shortcuts div { display: flex; gap: 0.5rem; }
.shortcuts button { flex: 1; text-align: center; padding: 0.25rem; background: var(--bg-main); border: 1px solid var(--border-main); border-radius: 0.25rem; font-size: 0.75rem; cursor: pointer; }
.shortcuts button:hover { background: #f0f0f0; }

.content-pane { background: var(--bg-secondary); border: 1px solid var(--border-main); border-radius: var(--radius); }
.content-wrapper { display: flex; flex-direction: column; }
.content-body { padding: 1rem; }
.footer { padding: 0 1.5rem 1rem; color: var(--text-muted); font-size: 0.75rem; text-align: center; }

/* --- Components --- */
.btn {
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-main);
  background-color: var(--bg-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  position: relative;
  overflow: hidden;
}
.btn:hover:not(:disabled) { background-color: var(--bg-main); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background-color: var(--primary-main); color: var(--primary-text); border-color: var(--primary-main); }
.btn-primary:hover:not(:disabled) { background-color: var(--primary-text-active); }
.btn-danger { background-color: var(--danger-bg); color: var(--danger-text); border-color: transparent; }
.btn-danger:hover:not(:disabled) { background-color: #FCA5A5; color: #7f1d1d;}
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
.btn-large { padding: 0.75rem 1.5rem; font-size: 1rem; }
.as-label { display: inline-block; }

/* Knight Rider Animation */
@keyframes knight-rider-glow {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}

.knight-rider::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 100%;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: knight-rider-glow 2.5s infinite linear;
  opacity: 0.8;
  filter: blur(5px);
}

.pill {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  background-color: var(--bg-main);
  color: var(--text-muted);
}
.pill.valid { background-color: var(--valid-bg); color: var(--valid-text); }
.pill.invalid { background-color: var(--invalid-bg); color: var(--invalid-text); }

.nav-item {
  width: 100%; text-align: left;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-weight: 500;
  border: none; background: transparent; cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.nav-item:hover { background-color: var(--bg-main); }
.nav-item.active { background-color: var(--primary-bg); color: var(--primary-text-active); }

.tabs { border-bottom: 1px solid var(--border-main); padding: 0 1rem; }
.tab-item {
  padding: 0.5rem 1rem;
  border: none; border-bottom: 2px solid transparent;
  background: transparent;
  font-weight: 500;
  color: var(--text-muted);
}
.tab-item.active { border-bottom-color: var(--primary-main); color: var(--primary-main); }

.row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.row-left, .row-right { display: flex; align-items: center; gap: 0.75rem; }

.labeled-input { display: block; }
.label-text { display: block; font-weight: 500; margin-bottom: 0.25rem; font-size: 0.875rem; }
.input-wrapper { display: flex; align-items: center; gap: 0.5rem; }

.input, .textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-main);
  border-radius: var(--radius);
  background-color: var(--bg-secondary);
  font-family: inherit;
  font-size: 1rem;
}
.textarea { font-family: var(--font-mono); font-size: 0.875rem; }
.input:focus, .textarea:focus { outline: 2px solid var(--primary-main); border-color: transparent; }
.input-wrapper .input { flex-grow: 1; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.prompts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }

.secrets-list { display: flex; flex-direction: column; gap: 0.5rem; }
.secret-item { display: grid; grid-template-columns: 280px 1fr; align-items: center; gap: 0.5rem; }
.secret-key { font-family: var(--font-mono); font-size: 0.875rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.secret-item .input { flex: 1; }

.log-container { border: 1px solid var(--border-main); border-radius: var(--radius); max-height: 65vh; overflow-y: auto; }
.log-table { width: 100%; border-collapse: collapse; }
.log-table th, .log-table td { padding: 0.5rem; text-align: left; border-bottom: 1px solid var(--border-main); }
.log-table th { position: sticky; top: 0; background: var(--bg-main); font-size: 0.75rem; text-transform: uppercase; }
.log-table tr:last-child td { border-bottom: none; }
.log-table td:nth-child(1) { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); }

.code-block {
  background-color: var(--bg-main);
  border: 1px solid var(--border-main);
  border-radius: var(--radius);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  white-space: pre-wrap;
  word-break: break-all;
}

.help-text { color: var(--text-muted); font-size: 0.875rem; margin-top: 0.25rem; }

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 20px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
}
input:checked + .slider {
  background-color: var(--primary-main);
}
input:checked + .slider:before {
  transform: translateX(14px);
}
.slider.round {
  border-radius: 34px;
}
.slider.round:before {
  border-radius: 50%;
}
.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

/* --- Onboarding Styles --- */
.page-container { width: 100%; height: 100%; display: flex; flex-direction: column; }
.page-container.center { align-items: center; justify-content: center; text-align: center; }

/* Stylish Landing Page */
.stylish-landing-page {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  background-size: cover;
  background-position: center;
  position: relative;
  transition: background-image 1s ease-in-out;
}
.stylish-landing-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
}
.landing-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.landing-content h1 { font-size: 2.5rem; }
.landing-content .greeting { font-size: 1.25rem; font-weight: 500; }
.landing-content .event {
  font-size: 1.125rem;
  line-height: 1.6;
  background: rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border-radius: var(--radius);
}
.loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid #fff;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.page-top-controls {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 10;
  background: rgba(0,0,0,0.3);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
}
.page-top-controls .toggle-label span {
    color: white;
}

.tagline {
    font-style: italic;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(0,0,0,0.25);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    display: inline-block;
    font-size: 0.875rem;
}

.ephemeral-comment {
    font-size: 0.875rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.7);
    margin-top: -1rem;
}

.landing-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.language-selector {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    padding: 0.5rem;
    border-radius: var(--radius);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23ffffff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: right 0.7rem top 50%;
    background-size: .65rem auto;
    padding-right: 2rem;
}
.language-selector option {
    background: #333;
    color: white;
}


.btn.btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
}

.btn.btn-secondary:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.2);
}

.selection-container { max-width: 700px; }
.prp-bot-intro { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: 2rem; }
.speech-bubble { background: var(--bg-secondary); border: 1px solid var(--border-main); padding: 1rem 1.5rem; border-radius: var(--radius); position: relative; font-size: 1.125rem; font-weight: 500; }
.speech-bubble::before { content: ''; position: absolute; top: 50%; left: -10px; transform: translateY(-50%); width: 0; height: 0; border-top: 10px solid transparent; border-bottom: 10px solid transparent; border-right: 10px solid var(--border-main); }
.selection-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.card { background: var(--bg-secondary); border: 1px solid var(--border-main); border-radius: var(--radius); padding: 2rem; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; }
.card:hover { transform: translateY(-5px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05); }
.card-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.card h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.card p { color: var(--text-muted); }

.form-intake-page { padding: 2rem; justify-content: space-between; align-items: center; }
.form-header { text-align: center; max-width: 800px; }
.form-header h1 { font-size: 1.75rem; }
.form-header p { color: var(--text-muted); margin-top: 0.5rem; }
.form-intake-body { width: 100%; max-width: 900px; margin: 2rem auto; border: 2px dashed transparent; border-radius: var(--radius); transition: border-color 0.2s; background: var(--bg-secondary); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06); }
.form-intake-body.dragging { border-color: var(--primary-main); }
.form-footer { text-align: center; }
.drop-overlay { position: fixed; inset: 0; background: rgba(238, 242, 255, 0.8); z-index: 99; display: flex; align-items: center; justify-content: center; }
.drop-overlay div { font-size: 1.5rem; font-weight: 600; color: var(--primary-text-active); background: var(--bg-secondary); padding: 2rem 3rem; border-radius: var(--radius); border: 2px dashed var(--primary-main); }

/* Filofax Form Styles */
.filofax-tabs { display: flex; border-bottom: 1px solid var(--border-main); background: var(--bg-main); padding: 0 1rem; border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }
.filofax-tab { padding: 0.75rem 1rem; border: none; background: transparent; cursor: pointer; font-weight: 500; color: var(--text-muted); position: relative; }
.filofax-tab.active { color: var(--primary-main); }
.filofax-tab.active::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--primary-main); }
.filofax-panel { padding: 1.5rem; }
.filofax-panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.filofax-panel-grid .labeled-input { grid-column: span 1; }
.filofax-panel-grid .full-width { grid-column: 1 / -1; }

.ai-assist-btn {
    padding: 0.5rem;
    background: transparent;
    border: 1px solid var(--border-main);
    border-radius: var(--radius);
    cursor: pointer;
    line-height: 1;
}
.ai-assist-btn:hover { background: var(--primary-bg); }
.ai-assist-btn:disabled { opacity: 0.5; cursor: not-allowed; }
@keyframes spin-assist { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.ai-assist-btn.loading { animation: spin-assist 1s linear infinite; }


.checkbox-group { display: flex; flex-direction: column; gap: 0.75rem; }
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-weight: 500; }
.checkbox-label input { display: none; }
.checkbox-custom { width: 18px; height: 18px; border: 2px solid var(--border-main); border-radius: 0.25rem; display: flex; align-items: center; justify-content: center; transition: background-color 0.2s, border-color 0.2s; }
.checkbox-label input:checked + .checkbox-custom { background: var(--primary-main); border-color: var(--primary-main); }
.checkbox-custom svg { width: 12px; height: 12px; stroke: white; display: none; }
.checkbox-label input:checked + .checkbox-custom svg { display: block; }

/* --- Chat Styles --- */
.chat-container { width: 100%; max-width: 600px; height: 80vh; max-height: 700px; background: var(--bg-secondary); border: 1px solid var(--border-main); border-radius: var(--radius); display: flex; flex-direction: column; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04); }
.chat-header { display: flex; align-items: center; gap: 0.75rem; padding: 1rem; border-bottom: 1px solid var(--border-main); justify-content: space-between; }
.chat-header-left { display: flex; align-items: center; gap: 0.75rem; }
.chat-header .logo.small { width: 24px; height: 24px; }
.chat-header h3 { font-size: 1rem; }
.chat-header p { font-size: 0.75rem; color: var(--text-muted); }
.chat-messages { flex: 1; padding: 1rem; overflow-y: auto; display: flex; flex-direction: column; gap: 1rem; }
.message-bubble { max-width: 80%; padding: 0.75rem 1rem; border-radius: 1.25rem; line-height: 1.5; }
.message-bubble.bot { background: var(--bg-main); border-bottom-left-radius: 0.25rem; align-self: flex-start; }
.message-bubble.user { background: var(--primary-main); color: var(--primary-text); border-bottom-right-radius: 0.25rem; align-self: flex-end; }
.chat-input-area { display: flex; padding: 1rem; border-top: 1px solid var(--border-main); gap: 0.5rem; }
.chat-input-area input { flex: 1; padding: 0.75rem; border: 1px solid var(--border-main); border-radius: var(--radius); }
.chat-input-area input:focus { outline: 2px solid var(--primary-main); border-color: transparent; }
.chat-input-area button { padding: 0.75rem 1rem; border: none; background: var(--primary-main); color: var(--primary-text); border-radius: var(--radius); cursor: pointer; }
.chat-input-area button:disabled { background: var(--text-faint); }
.message-bubble.typing { display: flex; align-items: center; gap: 5px; }
.message-bubble.typing span { width: 8px; height: 8px; background-color: var(--text-faint); border-radius: 50%; animation: typing-dots 1.2s infinite ease-in-out; }
.message-bubble.typing span:nth-child(2) { animation-delay: 0.2s; }
.message-bubble.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-dots { 0%, 60%, 100% { transform: scale(1); opacity: 0.6; } 30% { transform: scale(1.4); opacity: 1; } }

/* TTS Settings Slider */
.tts-settings { display: flex; flex-direction: column; gap: 1rem; }
.tts-slider { display: grid; grid-template-columns: 100px 1fr 50px; align-items: center; gap: 1rem; }
.tts-slider label { font-weight: 500; }
.tts-slider span { font-family: var(--font-mono); font-size: 0.875rem; color: var(--text-muted); }