/* Tailwind-like utility classes - minimal subset for CodeCompass */
*, *::before, *::after { box-sizing: border-box; }
html { line-height: 1.5; -webkit-text-size-adjust: 100%; font-family: ui-sans-serif, system-ui, sans-serif; }
body { margin: 0; }

.h-full { height: 100%; }
.min-h-full { min-height: 100%; }
.w-full { width: 100%; }

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none; }
.block { display: block; }

.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

.shrink-0 { flex-shrink: 0; }
.grow { flex-grow: 1; }

.overflow-auto { overflow: auto; }
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }

.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }

.border { border-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-t { border-top-width: 1px; }
.border-l { border-left-width: 1px; }
.border-r { border-right-width: 1px; }
.border-l-4 { border-left-width: 4px; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.border-indigo-500 { border-color: #6366f1; }

.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-800 { background-color: #1f2937; }
.bg-indigo-50 { background-color: #eef2ff; }
.bg-indigo-100 { background-color: #e0e7ff; }
.bg-indigo-500 { background-color: #6366f1; }
.bg-indigo-600 { background-color: #4f46e5; }
.bg-indigo-700 { background-color: #4338ca; }
.bg-green-600 { background-color: #16a34a; }
.bg-yellow-600 { background-color: #ca8a04; }
.bg-red-600 { background-color: #dc2626; }

.text-white { color: #ffffff; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-gray-900 { color: #111827; }
.text-indigo-200 { color: #c7d2fe; }
.text-indigo-600 { color: #4f46e5; }
.text-indigo-700 { color: #4338ca; }
.text-green-600 { color: #16a34a; }
.text-red-600 { color: #dc2626; }

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

.leading-6 { line-height: 1.5rem; }
.leading-tight { line-height: 1.25; }

.tracking-tight { letter-spacing: -0.025em; }

.underline { text-decoration-line: underline; }
.no-underline { text-decoration-line: none; }
.italic { font-style: italic; }

.shadow { box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1); }
.shadow-sm { box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); }

.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.pt-3 { padding-top: 0.75rem; }
.pt-4 { padding-top: 1rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pl-4 { padding-left: 1rem; }
.pl-6 { padding-left: 1.5rem; }

.m-0 { margin: 0; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-4 { margin-left: 1rem; }
.ml-10 { margin-left: 2.5rem; }

.max-w-7xl { max-width: 80rem; }
.max-w-none { max-width: none; }

.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

.list-none { list-style-type: none; }
.list-disc { list-style-type: disc; }

/* Icon sizing — only apply default to SVGs without explicit sizing */
svg:not([style*="width"]) { width: 1em; height: 1em; }
.h-2 { height: 0.5rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.w-2 { width: 0.5rem; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.mr-2 { margin-right: 0.5rem; }

.hover\:bg-gray-50:hover { background-color: #f9fafb; }
.hover\:bg-indigo-500:hover { background-color: #6366f1; }
.hover\:text-white:hover { color: #ffffff; }
.hover\:text-indigo-900:hover { color: #312e81; }
.hover\:underline:hover { text-decoration-line: underline; }

.transition { transition-property: color, background-color, border-color; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }

/* Prose styles for rendered markdown */
.prose { max-width: 65ch; }
.prose p { margin-top: 1.25em; margin-bottom: 1.25em; }
.prose p:first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { margin-top: 1.5em; margin-bottom: 0.5em; font-weight: 600; }
.prose h1 { font-size: 1.5rem; }
.prose h2 { font-size: 1.25rem; }
.prose h3 { font-size: 1.125rem; }
.prose code { background-color: #f3f4f6; padding: 0.125rem 0.25rem; border-radius: 0.25rem; font-size: 0.875em; }
.prose pre { background-color: #1f2937; color: #f9fafb; padding: 1rem; border-radius: 0.5rem; overflow-x: auto; margin: 1rem 0; }
.prose pre code { background-color: transparent; padding: 0; }
.prose ul, .prose ol { padding-left: 1.5rem; margin: 1rem 0; }
.prose li { margin: 0.25rem 0; }
.prose a { color: #4f46e5; text-decoration: underline; }
.prose blockquote { border-left: 4px solid #e5e7eb; padding-left: 1rem; margin: 1rem 0; color: #6b7280; }

/* Additional utility classes for new pages */
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }
.min-w-0 { min-width: 0; }
.min-w-64 { min-width: 16rem; }
.max-w-md { max-width: 28rem; }
.max-h-40 { max-height: 10rem; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whitespace-nowrap { white-space: nowrap; }
.text-left { text-align: left; }
.text-center { text-align: center; }
.uppercase { text-transform: uppercase; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.divide-y > * + * { border-top-width: 1px; border-color: #e5e7eb; }
.divide-gray-100 > * + * { border-color: #f3f4f6; }
.last\:border-0:last-child { border-width: 0; }
.space-y-1 > * + * { margin-top: 0.25rem; }

.pl-0 { padding-left: 0; }
.pl-1 { padding-left: 0.25rem; }
.pl-2 { padding-left: 0.5rem; }
.pl-8 { padding-left: 2rem; }
.pl-12 { padding-left: 3rem; }
.pl-16 { padding-left: 4rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.p-8 { padding: 2rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-6 { margin-bottom: 1.5rem; }
.ml-1 { margin-left: 0.25rem; }
.mt-0 { margin-top: 0; }

.h-12 { height: 3rem; }
.w-12 { width: 3rem; }

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

.bg-green-50 { background-color: #f0fdf4; }
.bg-green-100 { background-color: #dcfce7; }
.hover\:bg-green-100:hover { background-color: #dcfce7; }
.bg-green-500 { background-color: #22c55e; }
.bg-green-600 { background-color: #16a34a; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-blue-100 { background-color: #dbeafe; }
.bg-blue-500 { background-color: #3b82f6; }
.bg-blue-600 { background-color: #2563eb; }
.bg-yellow-50 { background-color: #fefce8; }
.bg-yellow-100 { background-color: #fef9c3; }
.bg-yellow-900/50 { background-color: rgba(113, 63, 18, 0.5); }
.bg-purple-50 { background-color: #faf5ff; }
.bg-purple-100 { background-color: #f3e8ff; }
.bg-purple-500 { background-color: #a855f7; }
.bg-red-100 { background-color: #fee2e2; }
.bg-red-500 { background-color: #ef4444; }
.bg-amber-100 { background-color: #fef3c7; }
.bg-gray-200 { background-color: #e5e7eb; }
.bg-gray-500 { background-color: #6b7280; }

.text-green-500 { color: #22c55e; }
.text-green-600 { color: #16a34a; }
.text-green-700 { color: #15803d; }
.text-green-800 { color: #166534; }
.text-green-200 { color: #bbf7d0; }
.text-blue-600 { color: #2563eb; }
.text-blue-700 { color: #1d4ed8; }
.text-blue-800 { color: #1e40af; }
.text-blue-200 { color: #bfdbfe; }
.text-red-800 { color: #991b1b; }
.text-yellow-600 { color: #ca8a04; }
.text-yellow-700 { color: #a16207; }
.text-yellow-800 { color: #854d0e; }
.text-purple-200 { color: #e9d5ff; }
.text-purple-700 { color: #7e22ce; }
.text-red-600 { color: #dc2626; }
.text-red-200 { color: #fecaca; }
.text-amber-500 { color: #f59e0b; }
.text-amber-600 { color: #d97706; }
.text-gray-200 { color: #e5e7eb; }
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }
.text-gray-800 { color: #1f2937; }
.text-indigo-400 { color: #818cf8; }
.text-indigo-500 { color: #6366f1; }
.hover\:text-indigo-600:hover { color: #4f46e5; }

.border-gray-100 { border-color: #f3f4f6; }
.border-yellow-200 { border-color: #fef08a; }

.hover\:bg-gray-100:hover { background-color: #f3f4f6; }

input[type="checkbox"] { width: 1rem; height: 1rem; }
select { appearance: none; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e"); background-position: right 0.5rem center; background-repeat: no-repeat; background-size: 1.5em 1.5em; padding-right: 2.5rem; }

.focus\:border-indigo-500:focus { border-color: #6366f1; }
.focus\:ring-indigo-500:focus { --tw-ring-color: #6366f1; box-shadow: 0 0 0 3px var(--tw-ring-color); }
.focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }

pre { white-space: pre-wrap; word-break: break-word; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; }

@media (min-width: 640px) {
  .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:col-span-2 { grid-column: span 2 / span 2; }
}

/* Topology canvas styles */
.topology-container { position: relative; width: 100%; height: 600px; }
.topology-canvas { border: 1px solid #e5e7eb; border-radius: 0.5rem; background: #fff; }
.topology-controls { position: absolute; top: 1rem; left: 1rem; z-index: 10; }
.topology-info { position: absolute; top: 1rem; right: 1rem; z-index: 10; background: white; padding: 0.5rem; border-radius: 0.375rem; box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1); }

/* Fullscreen topology canvas styles */
.topology-container-fullscreen { position: relative; width: 100%; height: 100%; background: #fff; }
.topology-canvas-fullscreen { width: 100%; height: 100%; display: block; background: #fff; }

/* Node detail panel - overlay on right side */
.node-detail-panel {
  position: absolute;
  top: 1rem;
  right: 0;
  width: 340px;
  max-height: calc(60% - 1rem);
  overflow-y: auto;
  background: white;
  border-radius: 0.5rem 0 0 0.5rem;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  padding: 0.75rem;
  z-index: 20;
}

/* Edge list panel - persistent overlay on right side */
.edge-list-panel {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  width: 280px;
  max-height: calc(50% - 1.5rem);
  overflow-y: auto;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  padding: 0.75rem;
  z-index: 20;
}
.edge-list-panel.full-height {
  top: 1rem;
  bottom: 1rem;
  max-height: calc(100% - 2rem);
}

/* Additional utilities for fullscreen layout */
.w-screen { width: 100vw; }
.h-screen { height: 100vh; }
.max-h-32 { max-height: 8rem; }
.max-h-40 { max-height: 10rem; }
.max-h-48 { max-height: 12rem; }
.max-h-64 { max-height: 16rem; }
.max-h-80 { max-height: 20rem; }

/* Layout debug panel - floating panel on top-right showing save/load controls */
.layout-debug-panel {
  position: absolute;
  top: 5rem;
  right: 1rem;
  width: 240px;
  max-height: calc(50% - 1rem);
  overflow-y: auto;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  padding: 0.75rem;
  z-index: 20;
  font-size: 0.75rem;
}

.layout-debug-panel details summary {
  cursor: pointer;
  user-select: none;
}

.layout-debug-panel details summary:hover {
  color: #4f46e5;
}

.layout-debug-panel pre {
  margin: 0;
  word-break: break-all;
}

.bg-gray-900 { background-color: #111827; }
.text-gray-100 { color: #f3f4f6; }
.border-indigo-600 { border-color: #4f46e5; }
.hover\:bg-green-700:hover { background-color: #15803d; }
.text-red-500 { color: #ef4444; }
.hover\:text-red-700:hover { color: #b91c1c; }

/* Timeline event type styles */
.event-call { background-color: #dbeafe; color: #1e40af; }
.event-return { background-color: #dcfce7; color: #166534; }
.event-exception { background-color: #fee2e2; color: #991b1b; }
.event-spawn { background-color: #fef3c7; color: #92400e; }
.event-other { background-color: #f3f4f6; color: #374151; }

/* Process type styles for entry point badges */
.process-genserver { background-color: #dbeafe; color: #1e40af; }
.process-supervisor { background-color: #fce7f3; color: #9d174d; }
.process-liveview { background-color: #d1fae5; color: #065f46; }
.process-agent { background-color: #e0e7ff; color: #3730a3; }
.process-task { background-color: #fef3c7; color: #92400e; }
.process-other { background-color: #f3f4f6; color: #374151; }

/* Code paths timeline panel */
.timeline-event { transition: background-color 0.15s ease; }
.timeline-event:hover { background-color: #f9fafb; }
.timeline-event.selected { background-color: #eef2ff; }

/* Sessions page - caller tree styles */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

/* Additional size utilities */
.w-1\.5 { width: 0.375rem; }
.h-1\.5 { height: 0.375rem; }
.w-3 { width: 0.75rem; }
.h-3 { height: 0.75rem; }
.mr-1 { margin-right: 0.25rem; }
.gap-3 { gap: 0.75rem; }
.px-1\.5 { padding-left: 0.375rem; padding-right: 0.375rem; }
.max-h-96 { max-height: 24rem; }
.max-w-6xl { max-width: 72rem; }

/* Transform utilities */
.rotate-90 { transform: rotate(90deg); }
.transition-transform { transition-property: transform; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }

/* Additional color utilities for dark theme tree */
.bg-green-900 { background-color: #14532d; }
.text-green-300 { color: #86efac; }
.text-green-400 { color: #4ade80; }
.text-blue-400 { color: #60a5fa; }
.text-blue-500 { color: #3b82f6; }
.text-yellow-400 { color: #facc15; }
.text-yellow-500 { color: #eab308; }
.border-gray-700 { border-color: #374151; }

/* Grid utilities */
.lg\:col-span-1 { grid-column: span 1 / span 1; }

/* Last child utilities */
.last\:border-b-0:last-child { border-bottom-width: 0; }

/* Hover utilities */
.hover\:bg-gray-200:hover { background-color: #e5e7eb; }
.hover\:bg-red-100:hover { background-color: #fee2e2; }
.hover\:bg-red-200:hover { background-color: #fecaca; }
.hover\:bg-green-100:hover { background-color: #dcfce7; }
.hover\:bg-green-200:hover { background-color: #bbf7d0; }
.hover\:bg-yellow-200:hover { background-color: #fef08a; }
.hover\:bg-blue-200:hover { background-color: #bfdbfe; }
.hover\:bg-indigo-200:hover { background-color: #c7d2fe; }
.hover\:bg-indigo-700:hover { background-color: #4338ca; }
.hover\:text-gray-600:hover { color: #4b5563; }
.hover\:text-gray-800:hover { color: #1f2937; }
.hover\:text-indigo-800:hover { color: #3730a3; }
.hover\:text-blue-800:hover { color: #1e40af; }
.hover\:text-red-800:hover { color: #991b1b; }

/* Disabled state */
.disabled\:bg-gray-300:disabled { background-color: #d1d5db; }
.disabled\:cursor-not-allowed:disabled { cursor: not-allowed; }

/* Focus utilities */
.focus\:ring-indigo-500:focus { box-shadow: 0 0 0 2px #6366f1; }

/* Additional border utilities */
.border-indigo-100 { border-color: #e0e7ff; }

/* Right margin */
.mr-3 { margin-right: 0.75rem; }

/* Padding bottom */
.pb-4 { padding-bottom: 1rem; }
.pb-1 { padding-bottom: 0.25rem; }

/* Sessions page - node selection and detail panel styles */
.bg-blue-900 { background-color: #1e3a8a; }
.text-blue-300 { color: #93c5fd; }
.ring-1 { box-shadow: 0 0 0 1px var(--tw-ring-color, currentColor); }
.ring-blue-500 { --tw-ring-color: #3b82f6; }

/* Custom gray shades (between standard Tailwind values) */
.bg-gray-850 { background-color: #18212f; }
.hover\:bg-gray-750:hover { background-color: #293548; }
.hover\:bg-gray-800:hover { background-color: #1f2937; }
.hover\:text-gray-300:hover { color: #d1d5db; }

/* Gap utilities */
.gap-1 { gap: 0.25rem; }

/* Padding p-1 */
.p-1 { padding: 0.25rem; }

/* Rounded corners for specific sides */
.rounded-t { border-top-left-radius: 0.25rem; border-top-right-radius: 0.25rem; }
.rounded-b { border-bottom-left-radius: 0.25rem; border-bottom-right-radius: 0.25rem; }

/* Letter spacing */
.tracking-wider { letter-spacing: 0.05em; }

/* Word break */
.break-all { word-break: break-all; }

/* Additional text colors */
.text-indigo-900 { color: #312e81; }
.text-red-700 { color: #b91c1c; }

/* Margin auto */
.ml-auto { margin-left: auto; }

/* Flexbox justify/align */
.justify-center { justify-content: center; }
.items-end { align-items: flex-end; }

/* Position utilities */
.relative { position: relative; }
.absolute { position: absolute; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }

/* Height h-8 */
.h-8 { height: 2rem; }

/* Gradient backgrounds */
.bg-gradient-to-t { background-image: linear-gradient(to top, var(--tw-gradient-stops)); }
.from-gray-900 { --tw-gradient-from: #111827; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(17, 24, 39, 0)); }
.to-transparent { --tw-gradient-to: transparent; }

/* Column span */
.col-span-2 { grid-column: span 2 / span 2; }

/* Fixed widths for sidebar */
.w-80 { width: 20rem; }
.w-72 { width: 18rem; }
.w-64 { width: 16rem; }
.w-\[500px\] { width: 500px; }

/* Whitespace utilities */
.whitespace-pre-wrap { white-space: pre-wrap; }

/* Apps page utilities */
.gap-1\.5 { gap: 0.375rem; }
.w-1\.5 { width: 0.375rem; }
.h-1\.5 { height: 0.375rem; }
.w-1\/2 { width: 50%; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.gap-x-4 { column-gap: 1rem; }
.gap-y-1 { row-gap: 0.25rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }

/* Duration utilities */
.duration-300 { transition-duration: 300ms; }

/* Transition utilities */
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-colors { transition-property: color, background-color, border-color; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }

/* Purple colors */
.bg-purple-600 { background-color: #9333ea; }
.hover\:bg-purple-700:hover { background-color: #7e22ce; }

/* Orange colors */
.bg-orange-100 { background-color: #ffedd5; }
.bg-orange-400 { background-color: #fb923c; }
.text-orange-700 { color: #c2410c; }

/* Yellow shades for status indicators */
.bg-yellow-400 { background-color: #facc15; }

/* Additional hover colors */
.hover\:bg-green-700:hover { background-color: #15803d; }
.hover\:bg-red-700:hover { background-color: #b91c1c; }
.hover\:bg-yellow-700:hover { background-color: #a16207; }
.hover\:bg-blue-700:hover { background-color: #1d4ed8; }
.hover\:bg-blue-50:hover { background-color: #eff6ff; }
.hover\:bg-red-50:hover { background-color: #fef2f2; }

/* Red shades for file browser */
.bg-red-50 { background-color: #fef2f2; }
.border-red-200 { border-color: #fecaca; }

/* Disabled state utilities */
.disabled\:bg-gray-100:disabled { background-color: #f3f4f6; }
.disabled\:text-gray-500:disabled { color: #6b7280; }
.disabled\:opacity-50:disabled { opacity: 0.5; }

/* Focus ring utilities */
.focus\:ring-1:focus { box-shadow: 0 0 0 1px var(--tw-ring-color, #6366f1); }

/* Opacity utilities */
.opacity-50 { opacity: 0.5; }
.opacity-0 { opacity: 0; }

/* Apps page redesign utilities */
.rounded-xl { border-radius: 0.75rem; }
.gap-5 { gap: 1.25rem; }
.shadow-lg { box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); }
.hover\:shadow-md:hover { box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); }
.shadow-md { box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); }
.inset-0 { inset: 0; }
.z-50 { z-index: 50; }
.z-51 { z-index: 51; }
.flex-wrap { flex-wrap: wrap; }
.p-5 { padding: 1.25rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.w-10 { width: 2.5rem; }
.h-10 { height: 2.5rem; }
.w-16 { width: 4rem; }
.h-16 { height: 4rem; }
.max-w-lg { max-width: 32rem; }
.mx-4 { margin-left: 1rem; margin-right: 1rem; }
.mt-0\.5 { margin-top: 0.125rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
textarea { font-family: inherit; font-size: inherit; }
.w-3\.5 { width: 0.875rem; }
.h-3\.5 { height: 0.875rem; }
.hover\:text-red-500:hover { color: #ef4444; }
.hover\:text-gray-700:hover { color: #374151; }
.hover\:border-indigo-300:hover { border-color: #a5b4fc; }
.hover\:bg-indigo-50:hover { background-color: #eef2ff; }
.transition-opacity { transition-property: opacity; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.group-hover\/env\:opacity-100:is(.group\/env:hover *) { opacity: 1; }

/* Spin animation for loading spinner */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.animate-spin { animation: spin 1s linear infinite; }

/* ================================================================
   Premium AppsPage — Dark Theme & Glass Morphism
   ================================================================ */

/* Timshel-inspired page background */
.bg-dark-page {
  position: relative;
  background-color: #f8f6f1;
  background-image:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.78), transparent 44%),
    radial-gradient(circle at 84% 82%, rgba(221, 211, 193, 0.34), transparent 48%),
    linear-gradient(140deg, rgba(255, 255, 255, 0.6), rgba(245, 241, 232, 0.92) 46%, rgba(233, 225, 211, 0.64));
  color: #2d2822;
}
.bg-dark-page::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  opacity: 0.2;
  mix-blend-mode: multiply;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.74' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='0.34'/%3E%3C/svg%3E"),
    repeating-linear-gradient(
      12deg,
      rgba(72, 58, 42, 0.045) 0,
      rgba(72, 58, 42, 0.045) 1px,
      transparent 1px,
      transparent 3.5px
    ),
    repeating-linear-gradient(
      -9deg,
      rgba(255, 255, 255, 0.06) 0,
      rgba(255, 255, 255, 0.06) 1px,
      transparent 1px,
      transparent 4.5px
    );
  background-size: 220px 220px, 220px 220px, 220px 220px;
  background-repeat: repeat;
}
.bg-dark-page > * {
  position: relative;
  z-index: 1;
}

/* Warm top bar */
.navbar-dark {
  background: #faf7f0;
  border-bottom: 1px solid rgba(96, 81, 59, 0.16);
}

.topbar-shell {
  min-height: 3.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.1rem;
}

.topbar-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 1.15rem;
}

.topbar-brand {
  color: #2d2822;
  font-size: 1.16rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  flex-wrap: wrap;
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: rgba(82, 69, 53, 0.86);
  font-size: 0.83rem;
  font-weight: 500;
  line-height: 1;
  padding: 0.32rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 0;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.topbar-link:hover {
  color: #2b241c;
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(122, 105, 79, 0.22);
}

.topbar-link.is-active {
  color: #241d15;
  background: rgba(245, 236, 223, 0.92);
  border-color: rgba(122, 105, 79, 0.3);
}

.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.topbar-org-switch-form {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.topbar-org-select {
  max-width: 15rem;
  min-height: 1.9rem;
  font-size: 0.72rem;
  color: rgba(96, 81, 59, 0.9);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(122, 105, 79, 0.26);
  border-radius: 0;
  padding: 0.2rem 0.45rem;
}

.topbar-org-select:focus {
  outline: none;
  border-color: rgba(122, 105, 79, 0.46);
}

.topbar-user {
  font-size: 0.78rem;
  color: rgba(96, 81, 59, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 17rem;
}

.topbar-logout {
  font-size: 0.74rem;
  color: rgba(96, 81, 59, 0.9);
  background: transparent;
  border: 1px solid rgba(122, 105, 79, 0.2);
  border-radius: 0;
  padding: 0.28rem 0.56rem;
  cursor: pointer;
  white-space: nowrap;
}

.topbar-logout:hover {
  color: #281f17;
  border-color: rgba(122, 105, 79, 0.42);
  background: rgba(255, 255, 255, 0.72);
}

.topbar-app-tools {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.topbar-app-count {
  font-size: 0.74rem;
  color: rgba(84, 70, 53, 0.84);
  padding: 0.27rem 0.62rem;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(122, 105, 79, 0.2);
  border-radius: 0;
  white-space: nowrap;
}

.topbar-app-refresh {
  width: 1.9rem;
  height: 1.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(122, 105, 79, 0.24);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.72);
  color: rgba(84, 70, 53, 0.86);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.topbar-app-refresh:hover {
  border-color: rgba(122, 105, 79, 0.44);
  background: rgba(245, 236, 223, 0.92);
  color: #2b241c;
}

/* Keyboard focus visibility for primary control-plane actions */
.topbar-link:focus-visible,
.topbar-org-select:focus-visible,
.topbar-logout:focus-visible,
.topbar-app-refresh:focus-visible,
.orgs-btn:focus-visible,
.card-face-toggle:focus-visible,
.card-edit-trigger:focus-visible,
.card-control-btn:focus-visible,
.new-app-card:focus-visible,
.btn-gradient:focus-visible,
.btn-ghost-dark:focus-visible,
.dark-input:focus-visible,
.title-input-dark:focus-visible {
  outline: 2px solid rgba(123, 106, 82, 0.9);
  outline-offset: 2px;
}

.card-open-hitarea:focus-visible {
  outline: 2px solid rgba(123, 106, 82, 0.9);
  outline-offset: -2px;
}

@media (max-width: 900px) {
  .topbar-shell {
    min-height: unset;
    padding: 0.5rem 0;
    flex-wrap: wrap;
    row-gap: 0.45rem;
  }

  .topbar-left {
    width: 100%;
    flex-wrap: wrap;
    row-gap: 0.45rem;
  }

  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .topbar-user {
    max-width: 11.5rem;
  }

  .topbar-org-select {
    max-width: 100%;
    min-width: 10rem;
  }
}

/* Org management page */
.orgs-page {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-width: 72rem;
  margin: 0 auto;
}

.orgs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 0.8rem;
}

.orgs-card {
  border: 1px solid rgba(122, 105, 79, 0.2);
  background: rgba(255, 255, 255, 0.72);
  padding: 0.9rem 1rem;
}

.orgs-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #241d15;
}

.orgs-subtitle {
  margin: 0.3rem 0 0;
  color: rgba(84, 70, 53, 0.9);
  font-size: 0.82rem;
}

.orgs-help {
  margin: 0.32rem 0 0.6rem;
  color: rgba(84, 70, 53, 0.78);
  font-size: 0.78rem;
}

.orgs-alert {
  margin-top: 0.7rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid rgba(122, 105, 79, 0.28);
  font-size: 0.78rem;
}

.orgs-alert.error {
  border-color: rgba(180, 83, 56, 0.45);
  color: #7c2d12;
  background: rgba(254, 242, 242, 0.82);
}

.orgs-alert.success {
  border-color: rgba(20, 98, 62, 0.35);
  color: #14532d;
  background: rgba(236, 253, 245, 0.82);
}

.orgs-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  margin-bottom: 0.6rem;
}

.orgs-form-grid label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.72rem;
  color: rgba(84, 70, 53, 0.82);
}

.orgs-form-grid input,
.orgs-form-grid select {
  border: 1px solid rgba(122, 105, 79, 0.26);
  background: rgba(255, 255, 255, 0.92);
  padding: 0.38rem 0.45rem;
  color: #2b241c;
  font-size: 0.8rem;
}

.orgs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.9rem;
  padding: 0.24rem 0.62rem;
  border: 1px solid rgba(122, 105, 79, 0.28);
  background: rgba(245, 236, 223, 0.92);
  color: #2b241c;
  text-decoration: none;
  font-size: 0.76rem;
  cursor: pointer;
}

.orgs-btn:hover {
  border-color: rgba(122, 105, 79, 0.48);
  background: rgba(255, 255, 255, 0.85);
}

.orgs-btn.subtle {
  background: rgba(255, 255, 255, 0.8);
}

.orgs-inline-note {
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: rgba(84, 70, 53, 0.82);
}

.orgs-link {
  color: #7c2d12;
  text-decoration: underline;
}

.orgs-table {
  width: 100%;
  border-collapse: collapse;
}

.orgs-table th,
.orgs-table td {
  text-align: left;
  border-bottom: 1px solid rgba(122, 105, 79, 0.16);
  padding: 0.45rem 0.32rem;
  font-size: 0.76rem;
  color: #2d2822;
  vertical-align: middle;
}

.orgs-table th {
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: rgba(96, 81, 59, 0.76);
}

.orgs-actions {
  text-align: right;
}

.orgs-current-badge {
  display: inline-block;
  font-size: 0.65rem;
  padding: 0.18rem 0.38rem;
  border: 1px solid rgba(20, 98, 62, 0.32);
  color: #14532d;
  background: rgba(236, 253, 245, 0.7);
}

/* Premium app card grid */
.app-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 0;
  align-content: start;
}
@media (max-width: 980px) {
  .app-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 0;
  }
}
@media (max-width: 640px) {
  .app-card-grid {
    grid-template-columns: 1fr;
  }
}

/* Flip card container */
.app-card {
  position: relative;
  height: 320px;
  min-height: 320px;
  border-radius: 0;
  perspective: 1200px;
  isolation: isolate;
  transition: none;
}

.app-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.app-card.is-flipped .app-card-inner {
  transform: rotateY(180deg);
}

.app-card-face {
  position: absolute;
  inset: 0;
  border-radius: 0;
  overflow: hidden;
  backface-visibility: hidden;
  background: var(--app-gradient);
  border: 1px solid rgba(122, 105, 79, 0.2);
  box-shadow: none;
}

.app-card-front {
  background: var(--app-gradient);
}

.app-card-back {
  transform: rotateY(180deg);
  background:
    radial-gradient(circle at 88% 10%, rgba(255, 255, 255, 0.6), transparent 35%),
    linear-gradient(170deg, rgba(252, 249, 241, 0.94), rgba(243, 236, 224, 0.92)),
    var(--app-gradient);
}

/* Embedded app preview */
.app-preview-shell {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #f7f4ee;
}
.app-preview-frame {
  width: 100%;
  height: 100%;
  display: block;
  border: none;
  pointer-events: none;
  background: #f7f4ee;
}
.app-preview-fallback {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: none;
}

.card-front-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: none;
}

.card-open-hitarea {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  cursor: pointer;
}

.card-open-hitarea.is-disabled {
  pointer-events: none;
}

.card-front-content {
  position: absolute;
  left: 0.5rem;
  right: auto;
  bottom: 0.5rem;
  max-width: calc(100% - 1rem);
  z-index: 2;
  padding: 0.24rem 0.42rem;
  border-radius: 0;
  border: 1px solid rgba(122, 105, 79, 0.22);
  background: rgba(252, 248, 240, 0.72);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.app-card-front .card-front-content {
  pointer-events: none;
}

.card-front-content .card-title {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.15;
}

.card-front-content .card-subtitle {
  font-size: 0.6rem;
  margin-top: 0.1rem;
  color: rgba(59, 50, 39, 0.7);
}

.card-back-content {
  position: relative;
  z-index: 1;
  margin-top: 2.55rem;
  height: calc(100% - 2.55rem);
  overflow: auto;
  padding: 0.9rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.card-title {
  color: #2d2822;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  text-shadow: none;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  margin: 0;
}

.card-subtitle {
  color: rgba(59, 50, 39, 0.78);
  font-size: 0.72rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  margin-top: 0.2rem;
}

.card-route {
  color: rgba(64, 54, 42, 0.82);
  font-size: 0.66rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  margin-top: 0.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-face-toggle {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 3;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 0;
  border: 1px solid rgba(122, 105, 79, 0.28);
  background: rgba(250, 246, 237, 0.78);
  color: rgba(63, 53, 42, 0.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.card-face-toggle:hover {
  border-color: rgba(122, 105, 79, 0.48);
  background: rgba(248, 242, 231, 0.95);
  color: #2f281f;
}
.card-face-toggle-back {
  left: auto;
  right: 0.75rem;
}

.card-edit-trigger {
  position: absolute;
  top: 3rem;
  left: 0.75rem;
  z-index: 3;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 0;
  border: 1px solid rgba(122, 105, 79, 0.28);
  background: rgba(250, 246, 237, 0.78);
  color: rgba(63, 53, 42, 0.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.card-edit-trigger:hover {
  border-color: rgba(122, 105, 79, 0.48);
  background: rgba(248, 242, 231, 0.95);
  color: #2f281f;
}

.card-running-indicator {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.55rem;
  border-radius: 0;
  border: 1px solid rgba(122, 105, 79, 0.26);
  background: rgba(249, 244, 234, 0.86);
  color: rgba(63, 53, 42, 0.9);
  font-size: 0.63rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.app-card-front .card-running-indicator {
  pointer-events: none;
}

.app-card-back .card-running-indicator {
  right: auto;
  left: 0.75rem;
}

.status-indicator-dot {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: #6b7280;
}

/* status helper classes are reused from app status mapping */
.card-running-indicator.status-glow-green,
.card-running-indicator.status-glow-red,
.card-running-indicator.status-glow-yellow,
.card-running-indicator.status-glow-gray {
  background: rgba(249, 244, 234, 0.86);
  box-shadow: none;
}
.card-running-indicator.status-glow-green .status-indicator-dot {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
}
.card-running-indicator.status-glow-red .status-indicator-dot {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.7);
}
.card-running-indicator.status-glow-yellow .status-indicator-dot {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
}
.card-running-indicator.status-glow-gray .status-indicator-dot {
  background: #6b7280;
  box-shadow: 0 0 7px rgba(107, 114, 128, 0.6);
}

.card-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.card-control-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.55rem;
  border-radius: 0;
  border: 1px solid rgba(122, 105, 79, 0.22);
  background: rgba(255, 255, 255, 0.74);
  color: rgba(49, 41, 32, 0.9);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.card-control-btn:hover {
  border-color: rgba(106, 87, 63, 0.58);
  background: rgba(232, 223, 209, 0.68);
  color: #241d15;
}
.card-control-btn.active {
  border-color: rgba(106, 87, 63, 0.7);
  background: rgba(226, 216, 201, 0.85);
  color: #241d15;
}
.card-control-btn.success {
  border-color: rgba(43, 138, 79, 0.38);
  background: rgba(217, 239, 224, 0.84);
}
.card-control-btn.success:hover {
  border-color: rgba(43, 138, 79, 0.58);
  background: rgba(198, 233, 211, 0.92);
}
.card-control-btn.danger {
  border-color: rgba(181, 76, 71, 0.3);
  background: rgba(250, 231, 226, 0.86);
}
.card-control-btn.danger:hover {
  border-color: rgba(181, 76, 71, 0.52);
  background: rgba(246, 213, 206, 0.95);
}

.card-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* Frosted stat pills */
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.18rem 0.48rem;
  font-size: 0.66rem;
  color: rgba(65, 55, 42, 0.86);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 9999px;
  border: 1px solid rgba(122, 105, 79, 0.18);
}

/* "New App" dashed card */
.new-app-card {
  min-height: 320px;
  border: 1.5px dashed rgba(122, 105, 79, 0.3);
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
  background: rgba(255, 255, 255, 0.58);
}
.new-app-card:hover {
  border-color: rgba(106, 87, 63, 0.5);
  background: rgba(244, 236, 223, 0.86);
  box-shadow: none;
}

/* Glass modal backdrop */
.glass-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(78, 63, 44, 0.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 50;
}

/* Glass modal panel */
.glass-modal {
  position: relative;
  z-index: 51;
  background: rgba(252, 249, 242, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(122, 105, 79, 0.2);
  border-radius: 1rem;
  padding: 1.5rem;
  max-width: 32rem;
  width: calc(100% - 2rem);
  box-shadow: 0 18px 50px rgba(60, 46, 30, 0.2);
}
.glass-modal h2 { color: #2b251f; }

/* Dark themed inputs */
.dark-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #2f2922;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(122, 105, 79, 0.2);
  border-radius: 0.5rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.dark-input:focus {
  border-color: #7b6a52;
  box-shadow: 0 0 0 2px rgba(123, 106, 82, 0.24);
}
.dark-input::placeholder { color: rgba(95, 80, 62, 0.42); }

textarea.dark-input { resize: vertical; font-family: inherit; }

/* Dark option card (for choosing create mode) */
.dark-option-card {
  width: 100%;
  text-align: left;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(122, 105, 79, 0.16);
  border-radius: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  color: inherit;
}
.dark-option-card:hover {
  border-color: rgba(106, 87, 63, 0.48);
  background: rgba(245, 236, 223, 0.9);
}

/* Gradient primary button */
.btn-gradient {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fdfaf4;
  background: linear-gradient(135deg, #8b7659, #6f5e48);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-gradient:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(111, 94, 72, 0.35);
}
.btn-gradient.purple { background: linear-gradient(135deg, #a48660, #826a4e); }
.btn-gradient.purple:hover { box-shadow: 0 4px 14px rgba(130, 106, 78, 0.35); }

/* Secondary ghost button (dark theme) */
.btn-ghost-dark {
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  color: rgba(76, 63, 47, 0.82);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(122, 105, 79, 0.2);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.btn-ghost-dark:hover { color: #2a241c; border-color: rgba(122, 105, 79, 0.38); }

/* Dark error bar */
.error-bar-dark {
  padding: 0.5rem 1.5rem;
  background: rgba(248, 225, 219, 0.8);
  border-bottom: 1px solid rgba(181, 76, 71, 0.25);
  color: #8d3734;
  font-size: 0.875rem;
}

/* Dark env panel */
.env-panel-dark {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(122, 105, 79, 0.18);
  border-radius: 0.75rem;
  padding: 0.65rem 0.75rem;
}

.obs-panel-dark {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(122, 105, 79, 0.18);
  border-radius: 0.75rem;
  padding: 0.65rem 0.75rem;
  position: relative;
  z-index: 1;
}
.obs-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.obs-health-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  display: inline-block;
  margin-right: 0.35rem;
}
.obs-health-green { background: #22c55e; }
.obs-health-yellow { background: #f59e0b; }
.obs-health-red { background: #ef4444; }
.obs-health-gray { background: #6b7280; }
.obs-health-label {
  color: rgba(60, 50, 39, 0.86);
  font-size: 0.75rem;
  font-weight: 600;
}
.obs-refresh-btn {
  border: 1px solid rgba(122, 105, 79, 0.24);
  border-radius: 0.4rem;
  background: rgba(255, 255, 255, 0.88);
  color: rgba(60, 50, 39, 0.84);
  font-size: 0.68rem;
  padding: 0.18rem 0.45rem;
  cursor: pointer;
}
.obs-refresh-btn:hover {
  border-color: rgba(106, 87, 63, 0.52);
  color: #281f17;
}
.obs-metrics-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}
.obs-last-crash {
  font-size: 0.68rem;
  color: rgba(141, 55, 52, 0.9);
  margin-bottom: 0.45rem;
  line-height: 1.4;
}
.obs-section-title {
  font-size: 0.64rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(82, 69, 53, 0.62);
  margin-top: 0.45rem;
  margin-bottom: 0.25rem;
}
.obs-scroll {
  max-height: 5.5rem;
  overflow: auto;
  padding-right: 0.2rem;
}
.obs-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.4rem;
  align-items: start;
  margin-bottom: 0.28rem;
}
.obs-type {
  font-size: 0.61rem;
  border-radius: 9999px;
  padding: 0.05rem 0.4rem;
  line-height: 1.3;
  white-space: nowrap;
  border: 1px solid transparent;
}
.obs-type-event {
  color: rgba(167, 243, 208, 0.95);
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.12);
}
.obs-type-warn {
  color: rgba(254, 240, 138, 0.95);
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.12);
}
.obs-type-debug {
  color: rgba(147, 197, 253, 0.95);
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.12);
}
.obs-type-crash {
  color: rgba(254, 202, 202, 0.98);
  border-color: rgba(239, 68, 68, 0.58);
  background: rgba(239, 68, 68, 0.14);
}
.obs-detail {
  min-width: 0;
  color: rgba(56, 46, 35, 0.84);
  font-size: 0.67rem;
  line-height: 1.35;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.obs-time {
  font-size: 0.62rem;
  color: rgba(82, 69, 53, 0.58);
  white-space: nowrap;
  margin-top: 0.1rem;
}

/* Title edit input on dark card */
.title-input-dark {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(122, 105, 79, 0.26);
  border-radius: 0.375rem;
  padding: 0.25rem 0.5rem;
  color: #2f2922;
  font-size: 1.05rem;
  font-weight: 700;
  outline: none;
  width: 100%;
}
.title-input-dark:focus {
  border-color: #7b6a52;
  box-shadow: 0 0 0 2px rgba(123, 106, 82, 0.24);
}

/* Premium empty state */
.empty-state-icon {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  background: rgba(139, 118, 89, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

/* Header controls for the apps grid */
.apps-header-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.05rem 1rem 0;
}
.app-count-badge {
  font-size: 0.7rem;
  color: rgba(84, 70, 53, 0.75);
  padding: 0.2rem 0.6rem;
  background: rgba(255, 255, 255, 0.66);
  border-radius: 9999px;
  border: 1px solid rgba(122, 105, 79, 0.16);
}
.refresh-btn-dark {
  padding: 0.35rem;
  border-radius: 0.5rem;
  color: rgba(84, 70, 53, 0.68);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.refresh-btn-dark:hover {
  color: rgba(44, 36, 27, 0.9);
  background: rgba(255, 255, 255, 0.62);
}

/* Pattern card in dark modal */
.dark-pattern-card {
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(122, 105, 79, 0.16);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  color: inherit;
}
.dark-pattern-card:hover {
  border-color: rgba(106, 87, 63, 0.48);
  background: rgba(245, 236, 223, 0.86);
}

/* Dark creating spinner */
.dark-spinner-text { color: rgba(57, 47, 36, 0.9); }
.dark-spinner-sub { color: rgba(89, 74, 57, 0.72); }

/* ================================================================
   2026 Visual Refresh (Control Plane)
   ================================================================ */

:root {
  --cc-ui-font:
    "Avenir Next", "Segoe UI", "Neue Haas Grotesk Text Pro", "Helvetica Neue", Helvetica, Arial,
    sans-serif;
  --cc-display-font: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --cc-ink-900: #1f252d;
  --cc-ink-700: #3d4a59;
  --cc-ink-500: #667281;
  --cc-bg-page: #f3eee5;
  --cc-bg-soft: #f8f4ec;
  --cc-surface: #fffdf9;
  --cc-border: rgba(52, 62, 76, 0.16);
  --cc-border-strong: rgba(52, 62, 76, 0.26);
  --cc-accent: #b87633;
  --cc-accent-strong: #975a20;
  --cc-accent-soft: rgba(184, 118, 51, 0.16);
  --cc-shadow-sm: 0 10px 28px rgba(27, 23, 18, 0.08);
  --cc-shadow-md: 0 20px 44px rgba(27, 23, 18, 0.14);
  --cc-radius-md: 12px;
  --cc-radius-lg: 18px;
}

html,
body {
  font-family: var(--cc-ui-font);
}

body {
  color: var(--cc-ink-900);
  background:
    radial-gradient(circle at 8% 6%, rgba(255, 255, 255, 0.84), transparent 34%),
    radial-gradient(circle at 88% 92%, rgba(225, 212, 193, 0.54), transparent 36%),
    var(--cc-bg-page);
}

.bg-dark-page {
  background:
    radial-gradient(circle at 12% 9%, rgba(255, 255, 255, 0.84), transparent 37%),
    radial-gradient(circle at 88% 85%, rgba(224, 209, 185, 0.45), transparent 42%),
    linear-gradient(156deg, #f8f3e9, #efe6d8 58%, #e7dbca);
}

.navbar-dark {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(252, 248, 240, 0.9);
  border-bottom: 1px solid var(--cc-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 18px rgba(31, 37, 45, 0.06);
}

.topbar-shell {
  min-height: 4.3rem;
  gap: 1.35rem;
}

.topbar-brand {
  font-family: var(--cc-display-font);
  font-size: 1.28rem;
  letter-spacing: 0.01em;
  color: #20252c;
}

.topbar-links {
  gap: 0.45rem;
}

.topbar-link {
  border-radius: 999px;
  padding: 0.42rem 0.86rem;
  font-size: 0.8rem;
  color: var(--cc-ink-700);
}

.topbar-link:hover {
  border-color: var(--cc-border-strong);
  background: rgba(255, 255, 255, 0.92);
  color: #283342;
}

.topbar-link.is-active {
  border-color: rgba(184, 118, 51, 0.34);
  background: linear-gradient(130deg, rgba(184, 118, 51, 0.22), rgba(255, 255, 255, 0.9));
  color: #2f2114;
}

.topbar-org-select,
.topbar-logout,
.topbar-app-count,
.topbar-app-refresh {
  border-radius: 999px;
}

.topbar-org-select {
  font-size: 0.75rem;
  color: var(--cc-ink-700);
}

.topbar-user {
  color: var(--cc-ink-700);
}

.topbar-app-refresh:hover {
  border-color: rgba(184, 118, 51, 0.45);
  color: #26201a;
}

.orgs-page {
  gap: 1.15rem;
}

.orgs-grid {
  gap: 1rem;
}

.orgs-card {
  border-radius: var(--cc-radius-lg);
  border: 1px solid var(--cc-border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 253, 249, 0.95)),
    var(--cc-surface);
  box-shadow: var(--cc-shadow-sm);
  padding: 1.1rem 1.2rem;
}

.orgs-title {
  font-size: 1.25rem;
  font-family: var(--cc-display-font);
}

.orgs-subtitle {
  font-size: 0.87rem;
  color: var(--cc-ink-700);
}

.orgs-help {
  font-size: 0.82rem;
  color: var(--cc-ink-500);
}

.orgs-form-grid label {
  font-size: 0.77rem;
}

.orgs-form-grid input,
.orgs-form-grid select {
  border-radius: 10px;
  border-color: var(--cc-border);
  font-size: 0.84rem;
  padding: 0.5rem 0.6rem;
}

.orgs-btn {
  border-radius: 10px;
  min-height: 2rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.orgs-btn:not(.subtle) {
  background: linear-gradient(136deg, rgba(184, 118, 51, 0.22), rgba(255, 255, 255, 0.95));
  border-color: rgba(184, 118, 51, 0.33);
}

.orgs-table th,
.orgs-table td {
  font-size: 0.82rem;
  padding: 0.62rem 0.4rem;
}

.orgs-table th {
  font-size: 0.7rem;
}

.app-card-grid {
  gap: 1rem;
  padding: 1rem;
}

@media (max-width: 640px) {
  .app-card-grid {
    padding: 0.75rem;
    gap: 0.8rem;
  }
}

.app-card {
  border-radius: var(--cc-radius-lg);
  height: 336px;
  min-height: 336px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.app-card:hover {
  transform: translateY(-3px);
}

.app-card-face {
  border-radius: var(--cc-radius-lg);
  border-color: var(--cc-border);
  box-shadow: var(--cc-shadow-sm);
}

.card-front-content {
  border-radius: var(--cc-radius-md);
  border-color: rgba(52, 62, 76, 0.2);
  background: rgba(255, 253, 247, 0.9);
  padding: 0.45rem 0.6rem;
}

.card-front-content .card-title {
  font-size: 0.93rem;
}

.card-front-content .card-subtitle {
  font-size: 0.66rem;
}

.card-title {
  font-family: var(--cc-display-font);
  font-size: 1.2rem;
}

.card-subtitle,
.card-route {
  color: var(--cc-ink-700);
}

.card-subtitle {
  font-size: 0.76rem;
}

.card-route {
  font-size: 0.72rem;
}

.card-face-toggle,
.card-edit-trigger,
.card-running-indicator {
  border-radius: 10px;
}

.card-control-grid {
  gap: 0.5rem;
}

.card-control-btn {
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.44rem 0.66rem;
}

.card-control-btn:hover {
  box-shadow: 0 4px 14px rgba(31, 37, 45, 0.1);
}

.stat-pill {
  font-size: 0.71rem;
  color: var(--cc-ink-700);
  border-color: rgba(52, 62, 76, 0.16);
}

.new-app-card {
  border-radius: var(--cc-radius-lg);
  border-color: rgba(184, 118, 51, 0.34);
  background:
    linear-gradient(152deg, rgba(255, 255, 255, 0.86), rgba(250, 243, 229, 0.9));
  box-shadow: var(--cc-shadow-sm);
}

.new-app-card:hover {
  border-color: rgba(184, 118, 51, 0.52);
  transform: translateY(-2px);
}

.glass-backdrop {
  background: rgba(42, 36, 29, 0.24);
}

.glass-modal {
  border-radius: var(--cc-radius-lg);
  border-color: rgba(52, 62, 76, 0.2);
  box-shadow: var(--cc-shadow-md);
  max-width: 34rem;
}

.dark-option-card {
  border-radius: 12px;
}

.dark-input {
  border-radius: 10px;
  border-color: var(--cc-border);
  font-size: 0.9rem;
}

.dark-input:focus {
  border-color: rgba(184, 118, 51, 0.65);
  box-shadow: 0 0 0 3px rgba(184, 118, 51, 0.18);
}

.btn-gradient {
  border-radius: 10px;
  background: linear-gradient(136deg, #bd7c38, #a16227);
  box-shadow: 0 8px 18px rgba(151, 90, 32, 0.25);
}

.btn-gradient:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(151, 90, 32, 0.3);
}

.btn-gradient.purple {
  background: linear-gradient(136deg, #6d7f9a, #52657f);
  box-shadow: 0 8px 18px rgba(82, 101, 127, 0.24);
}

.btn-gradient.purple:hover {
  box-shadow: 0 12px 24px rgba(82, 101, 127, 0.28);
}

.btn-ghost-dark {
  border-radius: 10px;
}

/* Auth screens */
.auth-shell {
  min-height: calc(100vh - 5.5rem);
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.auth-card {
  width: min(30rem, 100%);
  border-radius: 20px;
  border: 1px solid var(--cc-border);
  background:
    radial-gradient(circle at top right, rgba(184, 118, 51, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 252, 246, 0.94));
  box-shadow: var(--cc-shadow-md);
  padding: 1.5rem 1.5rem 1.35rem;
}

.auth-title {
  margin: 0;
  font-family: var(--cc-display-font);
  font-size: 1.7rem;
  line-height: 1.1;
  color: #1e242b;
}

.auth-subtitle {
  margin: 0.45rem 0 1.2rem;
  color: var(--cc-ink-700);
  font-size: 0.9rem;
}

.auth-form {
  display: grid;
  gap: 0.78rem;
}

.auth-field {
  display: grid;
  gap: 0.32rem;
}

.auth-label {
  font-size: 0.79rem;
  color: var(--cc-ink-700);
  font-weight: 600;
}

.auth-input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--cc-border);
  background: #fff;
  color: #1f252d;
  font-size: 0.9rem;
  padding: 0.56rem 0.68rem;
}

.auth-input:focus {
  outline: none;
  border-color: rgba(184, 118, 51, 0.65);
  box-shadow: 0 0 0 3px rgba(184, 118, 51, 0.17);
}

.auth-hint {
  margin: 0;
  font-size: 0.74rem;
  color: var(--cc-ink-500);
}

.auth-submit {
  margin-top: 0.2rem;
  width: 100%;
  border: none;
  border-radius: 10px;
  background: linear-gradient(136deg, #bd7c38, #a16227);
  color: #fffdf9;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.62rem 0.9rem;
  cursor: pointer;
}

.auth-submit:hover {
  box-shadow: 0 10px 22px rgba(151, 90, 32, 0.28);
}

.auth-footer {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--cc-ink-500);
}

.auth-link {
  color: var(--cc-accent-strong);
  font-weight: 600;
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-alert {
  border-radius: 10px;
  padding: 0.62rem 0.72rem;
  font-size: 0.83rem;
  margin-bottom: 0.95rem;
  border: 1px solid transparent;
}

.auth-alert.error {
  color: #842a20;
  border-color: rgba(174, 62, 51, 0.35);
  background: rgba(254, 241, 237, 0.92);
}

.auth-error-list {
  margin: 0;
  padding-left: 1.1rem;
}

.auth-error-list li + li {
  margin-top: 0.18rem;
}

/* Bulk run status badges */
.bulk-status-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.42rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.3;
}

.bulk-status-running {
  color: #1e40af;
  background: rgba(219, 234, 254, 0.85);
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.bulk-status-completed,
.bulk-status-pass {
  color: #14532d;
  background: rgba(220, 252, 231, 0.85);
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.bulk-status-failed,
.bulk-status-fail {
  color: #7f1d1d;
  background: rgba(254, 226, 226, 0.85);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.bulk-status-timeout {
  color: #78350f;
  background: rgba(254, 243, 199, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.bulk-status-pending {
  color: #374151;
  background: rgba(243, 244, 246, 0.85);
  border: 1px solid rgba(156, 163, 175, 0.35);
}

/* ============================================================================
   Bulk Case Detail — Tabs, Conversation View, File Viewer
   ============================================================================ */

/* Tab bar */
.bulk-case-tabs {
  display: flex;
  gap: 0;
  margin-top: 1rem;
  border-bottom: 2px solid #e5e7eb;
}

.bulk-case-tab {
  padding: 0.5rem 1.2rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: #6b7280;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.bulk-case-tab:hover { color: #1f2937; }

.bulk-case-tab.is-active {
  color: #4f46e5;
  border-bottom-color: #4f46e5;
}

/* ============================================================================
   Conversation view — chat-like layout
   ============================================================================ */

.cc-conversation {
  max-height: 76vh;
  overflow-y: auto;
  background: #fff;
  font-size: 0.875rem;
  line-height: 1.6;
}

/* Turn row: label + content */
.cc-turn {
  display: flex;
  gap: 0;
  padding: 0.9rem 1.25rem;
}

.cc-turn + .cc-turn {
  border-top: 1px solid #f3f4f6;
}

.cc-turn-label {
  width: 4rem;
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #c4b9a9;
  padding-top: 0.15rem;
  user-select: none;
}

.cc-turn-user .cc-turn-label  { color: #60a5fa; }
.cc-turn-agent .cc-turn-label { color: #a78bfa; }

.cc-turn-content {
  flex: 1;
  min-width: 0;
}

/* Live system stream embedded in agent turn */
.cc-system-stream {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.8rem;
  padding: 0.6rem 0.65rem;
  border: 1px solid #dbe4ff;
  border-radius: 0.5rem;
  background: linear-gradient(180deg, #f9fbff, #f4f7ff);
}

.cc-system-stream-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.cc-system-stream-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #1f4ea9;
  letter-spacing: 0.01em;
}

.cc-system-stream-meta {
  font-size: 0.64rem;
  color: #64748b;
}

.cc-system-session {
  font-size: 0.62rem;
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

.cc-system-process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.35rem;
}

.cc-system-process-card {
  border: 1px solid #d1d5db;
  border-radius: 0.4rem;
  background: #fff;
  padding: 0.35rem 0.45rem;
}

.cc-system-process-label {
  font-size: 0.66rem;
  font-weight: 600;
  color: #1f2937;
}

.cc-system-process-meta {
  margin-top: 0.18rem;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  font-size: 0.56rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.cc-system-process-detail {
  margin-top: 0.2rem;
  font-size: 0.6rem;
  line-height: 1.3;
  color: #334155;
  white-space: pre-wrap;
}

.cc-system-events {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-height: 230px;
  overflow: auto;
  padding-right: 2px;
}

.cc-system-events-empty {
  font-size: 0.66rem;
  color: #6b7280;
}

.cc-system-event-row {
  border: 1px solid #e5e7eb;
  border-radius: 0.4rem;
  background: #fff;
  padding: 0.32rem 0.4rem;
}

.cc-system-event-topline {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.12rem;
  font-size: 0.54rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cc-system-event-title {
  font-size: 0.66rem;
  color: #1f2937;
  line-height: 1.25;
}

.cc-system-event-detail {
  margin-top: 0.14rem;
  padding: 0.2rem 0.28rem;
  border-radius: 0.3rem;
  background: rgba(148, 163, 184, 0.1);
  font-size: 0.58rem;
  line-height: 1.25;
  color: #475569;
  white-space: pre-wrap;
  word-break: break-word;
}

.cc-system-process-card.is-running,
.cc-system-event-row.is-running {
  border-color: rgba(59, 130, 246, 0.45);
}

.cc-system-process-card.is-success,
.cc-system-event-row.is-success {
  border-color: rgba(34, 197, 94, 0.45);
}

.cc-system-process-card.is-warning,
.cc-system-event-row.is-warning {
  border-color: rgba(245, 158, 11, 0.45);
}

.cc-system-process-card.is-error,
.cc-system-event-row.is-error {
  border-color: rgba(239, 68, 68, 0.45);
}

.cc-system-process-card.is-info,
.cc-system-event-row.is-info {
  border-color: rgba(148, 163, 184, 0.5);
}

/* User content */
.cc-user-content {
  color: #374151;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.85rem;
}

/* Prose blocks — assistant text */
.cc-prose {
  color: #1f2937;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.7;
  padding: 0.05rem 0;
}

/* Spacing between adjacent prose blocks */
.cc-prose + .cc-prose {
  margin-top: 0.5rem;
}

/* Tool call rows */
.cc-tool-row {
  border-radius: 0.25rem;
  margin: 0.15rem 0;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

.cc-tool-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.45rem;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  border-radius: 0.25rem;
  font-family: inherit;
  font-size: 0.78rem;
  color: #4b5563;
  transition: background 0.1s;
}

.cc-tool-header:hover {
  background: #f3f4f6;
}

.cc-tool-arrow {
  font-size: 0.6rem;
  color: #d1d5db;
  width: 0.65rem;
  flex-shrink: 0;
  transition: color 0.1s;
}

.cc-tool-header:hover .cc-tool-arrow {
  color: #9ca3af;
}

.cc-tool-name {
  font-weight: 600;
  color: #374151;
}

.cc-tool-status {
  margin-left: auto;
  font-size: 0.72rem;
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.cc-tool-ok      { color: #22c55e; }
.cc-tool-err     { color: #ef4444; }
.cc-tool-pending { color: #d1d5db; animation: cc-pulse 1.4s ease-in-out infinite; }

/* Expanded tool body */
.cc-tool-row.cc-tool-expanded {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  margin: 0.3rem 0;
}

.cc-tool-row.cc-tool-expanded .cc-tool-header {
  background: #f3f4f6;
  border-radius: 0.375rem 0.375rem 0 0;
  border-bottom: 1px solid #e5e7eb;
}

.cc-tool-body {
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cc-tool-section-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
  margin-bottom: 0.2rem;
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.cc-tool-code {
  background: #1e2433;
  color: #cbd5e1;
  padding: 0.55rem 0.75rem;
  border-radius: 0.25rem;
  font-size: 0.72rem;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  max-height: 320px;
  overflow-y: auto;
  line-height: 1.5;
}

.cc-tool-code-error {
  background: #1c0a0a;
  color: #fca5a5;
}

/* Streaming indicator */
.cc-streaming-indicator {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.45rem;
}

.cc-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d1d5db;
  animation: cc-bounce 1.3s ease-in-out infinite;
}

.cc-dot-d1 { animation-delay: 0.2s; }
.cc-dot-d2 { animation-delay: 0.4s; }

@keyframes cc-bounce {
  0%, 80%, 100% { transform: scale(0.65); opacity: 0.4; }
  40%           { transform: scale(1);    opacity: 1;   }
}

@keyframes cc-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.25; }
}

/* Done / error markers */
.cc-done-marker {
  font-size: 0.72rem;
  color: #22c55e;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  font-family: ui-monospace, monospace;
}

.cc-error-block {
  font-size: 0.82rem;
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.25rem;
  padding: 0.45rem 0.75rem;
  margin: 0.25rem 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.cc-empty {
  font-size: 0.85rem;
  color: #9ca3af;
  padding: 2rem;
  text-align: center;
}

/* Live stats bar */
.cc-live-stats {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  font-size: 0.75rem;
  color: #9ca3af;
  font-variant-numeric: tabular-nums;
}

.cc-stat-value {
  color: #6b7280;
  font-weight: 500;
}

/* Live progress mini items */
.cc-case-preview {
  font-size: 0.72rem;
  color: #6b7280;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-style: italic;
}

/* File viewer */
.bulk-files-layout {
  display: flex;
  gap: 0;
  min-height: 400px;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  overflow: hidden;
}

.bulk-files-sidebar {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid #e5e7eb;
  overflow-y: auto;
  background: #f9fafb;
}

.bulk-file-item {
  display: block;
  width: 100%;
  padding: 0.4rem 0.6rem;
  font-size: 0.75rem;
  text-align: left;
  border: none;
  border-bottom: 1px solid #f3f4f6;
  background: none;
  cursor: pointer;
  color: #374151;
}

.bulk-file-item:hover { background: #e5e7eb; }

.bulk-file-item.is-active {
  background: #fff;
  font-weight: 600;
  color: #4f46e5;
}

.bulk-file-path {
  display: block;
  font-size: 0.65rem;
  color: #9ca3af;
  font-weight: 400;
}

.bulk-files-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bulk-file-header {
  padding: 0.4rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #6b7280;
  background: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

.bulk-file-code {
  flex: 1;
  margin: 0;
  padding: 0.75rem;
  font-size: 0.72rem;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  line-height: 1.5;
  white-space: pre;
  overflow: auto;
  background: #fff;
  color: #1f2937;
}

/* ============================================================================
   Spinning Wheel Navigator
   ============================================================================ */

/* Layout */
.wheel-navigator {
  display: flex;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 9%, rgba(255,255,255,0.84), transparent 37%),
    radial-gradient(circle at 88% 85%, rgba(224,209,185,0.45), transparent 42%),
    var(--cc-bg-page);
}

/* Left panel */
.wheel-panel {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--cc-border);
  background: rgba(252,248,240,0.88);
  backdrop-filter: blur(12px);
  overflow: hidden;
}

/* Breadcrumb bar */
.wheel-breadcrumb {
  height: 3.2rem;
  padding: 0 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-bottom: 1px solid var(--cc-border);
  flex-shrink: 0;
}
.wheel-crumb-back {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--cc-ink-700);
  padding: 0.3rem;
  border-radius: 8px;
  transition: background 0.15s;
  display: flex;
  align-items: center;
}
.wheel-crumb-back:hover { background: rgba(0,0,0,0.06); }
.wheel-crumb-label {
  font-family: var(--cc-display-font);
  font-size: 1rem;
  font-weight: 700;
  color: var(--cc-ink-900);
}
.wheel-crumb-count {
  font-size: 0.72rem;
  color: var(--cc-ink-500);
  background: var(--cc-accent-soft);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

/* Wheel cylinder container */
.wheel-cylinder {
  flex: 1;
  position: relative;
  overflow: hidden;
  cursor: grab;
}
.wheel-cylinder:active { cursor: grabbing; }

/* Selected item highlight (follows the selected item) */
.wheel-item.is-selected {
  background: rgba(0,0,0,0.06);
  border-radius: var(--cc-radius-md);
}
.wheel-item.is-selected .wheel-item-arrow {
  opacity: 1;
}

/* Wheel items (positioned by JS) */
.wheel-item {
  position: absolute;
  left: 0.6rem;
  right: 0.6rem;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0.6rem;
  cursor: pointer;
  user-select: none;
  will-change: transform;
}
.wheel-item-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.wheel-item-label {
  font-family: var(--cc-display-font);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cc-ink-900);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wheel-item-status {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}
.wheel-item-status.running { background: #22c55e; box-shadow: 0 0 8px rgba(34,197,94,0.6); }
.wheel-item-status.stopped { background: #f59e0b; box-shadow: 0 0 8px rgba(245,158,11,0.5); }
.wheel-item-status.error   { background: #ef4444; box-shadow: 0 0 8px rgba(239,68,68,0.5); }
.wheel-item-status.inactive { background: #9ca3af; }
.wheel-item-status.page { background: #6366f1; box-shadow: 0 0 6px rgba(99,102,241,0.4); }

/* Depth enter arrow (visible on focal item at depth 0) */
.wheel-item-arrow {
  width: 0.5rem;
  height: 0.5rem;
  border-top: 2px solid var(--cc-accent);
  border-right: 2px solid var(--cc-accent);
  transform: rotate(45deg);
  opacity: 0;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
/* Controls bar */
.wheel-controls {
  min-height: 3.5rem;
  padding: 0.7rem 1.2rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-top: 1px solid var(--cc-border);
  background: rgba(252,248,240,0.92);
  flex-shrink: 0;
}
.wheel-ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.38rem 0.8rem;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid var(--cc-border);
  background: rgba(255,255,255,0.8);
  color: var(--cc-ink-900);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
}
.wheel-ctrl-btn:hover {
  border-color: var(--cc-border-strong);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.wheel-ctrl-success {
  color: #15803d;
  border-color: rgba(34,197,94,0.4);
  background: rgba(34,197,94,0.08);
}
.wheel-ctrl-danger {
  color: #b91c1c;
  border-color: rgba(239,68,68,0.3);
  background: rgba(239,68,68,0.06);
}
.wheel-ctrl-danger:hover {
  border-color: rgba(239,68,68,0.5);
  background: rgba(239,68,68,0.12);
}
.wheel-ctrl-active {
  color: var(--cc-accent-strong);
  border-color: var(--cc-accent);
  background: var(--cc-accent-soft);
}

/* Env panel inside wheel panel */
.wheel-env-panel {
  padding: 0.8rem 1.2rem;
  border-top: 1px solid var(--cc-border);
  max-height: 200px;
  overflow-y: auto;
  flex-shrink: 0;
}

/* Observability panel inside wheel panel */
.wheel-obs-panel {
  padding: 0.8rem 1.2rem;
  border-top: 1px solid var(--cc-border);
  max-height: 280px;
  overflow-y: auto;
  flex-shrink: 0;
}

/* Viewport (right panel) */
.wheel-viewport {
  flex: 1;
  position: relative;
  background: #f7f4ee;
  overflow: hidden;
}

.wheel-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: #f7f4ee;
  pointer-events: none;
  transition: opacity 300ms ease;
}
.wheel-frame.is-standby {
  opacity: 0;
  pointer-events: none;
}

.wheel-viewport.is-active .wheel-frame:not(.is-standby) {
  pointer-events: auto;
}

.viewport-hint {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  background: rgba(31,37,45,0.72);
  backdrop-filter: blur(8px);
  color: rgba(255,255,255,0.9);
  font-size: 0.78rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 300ms;
}
.wheel-viewport:hover .viewport-hint {
  opacity: 1;
}
.wheel-viewport.is-active .viewport-hint {
  display: none;
}

/* Depth transition animations */
@keyframes wheelDepthOut {
  0%   { transform: translateX(0) scale(1); opacity: 1; }
  100% { transform: translateX(-50%) scale(0.88); opacity: 0; }
}
@keyframes wheelDepthIn {
  0%   { transform: translateX(40%) scale(0.92); opacity: 0; }
  100% { transform: translateX(0) scale(1); opacity: 1; }
}
@keyframes wheelDepthOutReverse {
  0%   { transform: translateX(0) scale(1); opacity: 1; }
  100% { transform: translateX(40%) scale(0.88); opacity: 0; }
}
@keyframes wheelDepthInReverse {
  0%   { transform: translateX(-50%) scale(0.92); opacity: 0; }
  100% { transform: translateX(0) scale(1); opacity: 1; }
}
.wheel-item.depth-exit-forward  { animation: wheelDepthOut 200ms ease-in forwards; }
.wheel-item.depth-enter-forward { animation: wheelDepthIn 200ms ease-out 200ms forwards; opacity: 0; }
.wheel-item.depth-exit-back     { animation: wheelDepthOutReverse 200ms ease-in forwards; }
.wheel-item.depth-enter-back    { animation: wheelDepthInReverse 200ms ease-out 200ms forwards; opacity: 0; }
