/* ============================================================================
   RAISN Transcript Viewer - Noir Futurism Design System
   A premium dark-themed interface with layered glass, subtle glows, and depth
   ============================================================================ */

/* ============================================================================
   CSS Variables - Design Tokens
   ============================================================================ */
:root {
    /* Core Dark Palette */
    --void: #05050a;
    --abyss: #0a0a12;
    --deep: #0e0e18;
    --surface: #13131f;
    --elevated: #1a1a2a;
    --raised: #222236;
    --muted: #2a2a42;

    /* Accent Colors - Raisn Brand */
    --cyan: #78BE20;
    --cyan-dim: #6aaa1c;
    --cyan-glow: rgba(120, 190, 32, 0.15);
    --amber: #ffbe0a;
    --amber-dim: #e6a800;
    --amber-glow: rgba(255, 190, 10, 0.15);
    --magenta: #4f46e5;
    --magenta-dim: #4338ca;
    --violet: #6366f1;
    --emerald: #10b981;
    --rose: #f43f5e;
    --raisn-green: #78BE20;
    --raisn-indigo: #4f46e5;

    /* Neutrals */
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b85;
    --text-dim: #45455a;
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);
    --border-accent: rgba(120, 190, 32, 0.2);

    /* Glass Effects */
    --glass-bg: rgba(20, 20, 35, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shine: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);

    /* Typography */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Font Sizes */
    --text-xs: 0.7rem;
    --text-sm: 0.8125rem;
    --text-base: 0.9375rem;
    --text-lg: 1.0625rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 2rem;
    --text-4xl: 2.5rem;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-2xl: 28px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-glow-cyan: 0 0 20px rgba(120, 190, 32, 0.2), 0 0 40px rgba(120, 190, 32, 0.1);
    --shadow-glow-amber: 0 0 20px rgba(255, 190, 10, 0.2), 0 0 40px rgba(255, 190, 10, 0.1);
    --shadow-depth-1: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-depth-2: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-depth-3: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-depth-4: 0 16px 48px rgba(0, 0, 0, 0.6);
    --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.05);

    /* Transitions */
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --duration-fast: 150ms;
    --duration-base: 250ms;
    --duration-slow: 400ms;

    /* Z-index */
    --z-base: 1;
    --z-elevated: 10;
    --z-sticky: 100;
    --z-overlay: 500;
    --z-modal: 1000;
    --z-toast: 2000;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--void);
    overflow-x: hidden;
    min-height: 100vh;
}

::selection {
    background: var(--cyan);
    color: var(--void);
}

/* ============================================================================
   Ambient Background
   ============================================================================ */
.ambient-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.gradient-orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--raisn-green) 0%, transparent 70%);
    top: -200px;
    right: -100px;
    animation-delay: 0s;
}

.gradient-orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--raisn-indigo) 0%, transparent 70%);
    bottom: -150px;
    left: -100px;
    animation-delay: -7s;
}

.gradient-orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--violet) 0%, transparent 70%);
    top: 40%;
    left: 30%;
    animation-delay: -14s;
    opacity: 0.25;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(20px, 10px) scale(1.02); }
}

.noise-overlay {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.03;
    mix-blend-mode: overlay;
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 0%, transparent 70%);
}

/* ============================================================================
   Utility Classes
   ============================================================================ */
.hidden {
    display: none !important;
}

/* ============================================================================
   App Container
   ============================================================================ */
.app-container {
    position: relative;
    z-index: var(--z-base);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================================================
   Header
   ============================================================================ */
.app-header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: linear-gradient(180deg, var(--abyss) 0%, rgba(10, 10, 18, 0.95) 100%);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-6);
    max-width: 2000px;
    margin: 0 auto;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.logo-mark {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-img {
    height: 46px;
    width: auto;
    filter: brightness(0) invert(1);
    transition: filter var(--duration-base) var(--ease-smooth);
}

.logo-mark::after {
    content: '';
    position: absolute;
    inset: -4px;
    background: radial-gradient(circle, rgba(120, 190, 32, 0.2), transparent 70%);
    opacity: 0.5;
    animation: pulse-soft 3s ease-in-out infinite;
}

@keyframes pulse-soft {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.app-title {
    font-family: var(--font-sans);
    font-size: var(--text-2xl);
    font-weight: 700;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--raisn-green) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.app-subtitle {
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* Connection Status */
.connection-status {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-4);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    backdrop-filter: blur(10px);
}

.status-ring {
    position: relative;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-ring::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--text-dim);
    opacity: 0.3;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all var(--duration-base) var(--ease-smooth);
}

.connection-status.connected .status-ring::before {
    border-color: var(--emerald);
    animation: ring-pulse 2s ease-out infinite;
}

.connection-status.connected .status-dot {
    background: var(--emerald);
    box-shadow: 0 0 12px var(--emerald);
}

.connection-status.connecting .status-dot {
    background: var(--amber);
    animation: blink 1s ease-in-out infinite;
}

.connection-status.disconnected .status-dot {
    background: var(--rose);
}

@keyframes ring-pulse {
    0% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.2); opacity: 0; }
    100% { transform: scale(1); opacity: 0.3; }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.status-text {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.connection-status.connected .status-text {
    color: var(--emerald);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* ============================================================================
   Glass Buttons
   ============================================================================ */
.btn-glass {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all var(--duration-base) var(--ease-smooth);
    position: relative;
    overflow: hidden;
}

.btn-glass::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--glass-shine);
    opacity: 0;
    transition: opacity var(--duration-base);
}

.btn-glass:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-glow-cyan), var(--shadow-depth-2);
    transform: translateY(-1px);
}

.btn-glass:hover::before {
    opacity: 1;
}

.btn-glass:active {
    transform: translateY(0);
}

.btn-glass.btn-icon {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn-glass svg {
    transition: transform var(--duration-base) var(--ease-smooth);
}

.btn-glass:hover svg {
    transform: scale(1.1);
}

/* ============================================================================
   Main Layout
   ============================================================================ */
.app-main {
    display: grid;
    grid-template-columns: 320px 1fr;
    flex: 1;
    max-width: 2000px;
    width: 100%;
    margin: 0 auto;
    gap: var(--space-5);
    padding: var(--space-5);
}

/* ============================================================================
   Sidebar
   ============================================================================ */
.sidebar {
    position: relative;
    height: calc(100vh - 100px);
    border-radius: var(--radius-xl);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    overflow: hidden;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--raisn-green), transparent);
    opacity: 0.3;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-header {
    padding: var(--space-5) var(--space-5) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-title-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-label {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 500;
    color: var(--text-primary);
}

.sidebar-decoration {
    margin-top: var(--space-3);
    height: 2px;
    background: linear-gradient(90deg, var(--cyan), transparent);
    border-radius: 1px;
    opacity: 0.5;
}

.session-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 var(--space-2);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--raisn-green);
    background: var(--cyan-glow);
    border: 1px solid rgba(120, 190, 32, 0.2);
    border-radius: var(--radius-full);
}

/* Search Box */
.search-container {
    padding: var(--space-4) var(--space-5);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    transition: all var(--duration-base) var(--ease-smooth);
}

.search-box:focus-within {
    border-color: rgba(120, 190, 32, 0.3);
    box-shadow: 0 0 0 3px var(--cyan-glow);
}

.search-icon {
    flex-shrink: 0;
    color: var(--text-dim);
    transition: color var(--duration-base);
}

.search-box:focus-within .search-icon {
    color: var(--cyan);
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.search-box input::placeholder {
    color: var(--text-dim);
}

.search-glow {
    position: absolute;
    inset: -1px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--raisn-green), var(--raisn-indigo));
    opacity: 0;
    z-index: -1;
    transition: opacity var(--duration-base);
    filter: blur(8px);
}

.search-box:focus-within .search-glow {
    opacity: 0.15;
}

/* Session List */
.session-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 var(--space-4) var(--space-5);
}

.session-list::-webkit-scrollbar {
    width: 6px;
}

.session-list::-webkit-scrollbar-track {
    background: transparent;
}

.session-list::-webkit-scrollbar-thumb {
    background: var(--muted);
    border-radius: var(--radius-full);
}

.session-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* Session Item */
.session-item {
    position: relative;
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    background: var(--elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--duration-base) var(--ease-smooth);
    overflow: hidden;
}

.session-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--raisn-green), var(--raisn-indigo));
    transform: scaleY(0);
    transform-origin: top;
    transition: transform var(--duration-base) var(--ease-smooth);
}

.session-item:hover {
    border-color: var(--border-light);
    background: var(--raised);
    transform: translateX(4px);
}

.session-item:hover::before {
    transform: scaleY(1);
}

.session-item.active {
    border-color: var(--border-accent);
    background: linear-gradient(135deg, var(--elevated) 0%, rgba(120, 190, 32, 0.05) 100%);
}

.session-item.active::before {
    transform: scaleY(1);
}

.session-item.live {
    border-color: rgba(16, 185, 129, 0.3);
    background: linear-gradient(135deg, var(--elevated) 0%, rgba(16, 185, 129, 0.08) 100%);
}

.session-item.live::before {
    background: var(--emerald);
}

.session-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.session-id {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-all;
}

.session-time {
    font-size: var(--text-xs);
    color: var(--text-muted);
    white-space: nowrap;
}

.session-live-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 3px var(--space-2);
    background: var(--emerald);
    color: var(--void);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    animation: pulse-badge 2s ease-in-out infinite;
}

.session-live-badge .live-dot {
    width: 5px;
    height: 5px;
    background: var(--void);
    border-radius: 50%;
}

@keyframes pulse-badge {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

.session-stats {
    display: flex;
    gap: var(--space-4);
}

.session-stat {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.session-stat svg {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-12);
    gap: var(--space-5);
}

.spinner-container {
    position: relative;
    width: 48px;
    height: 48px;
}

.spinner {
    position: absolute;
    inset: 0;
    border: 2px solid var(--border-subtle);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-ring {
    position: absolute;
    inset: 4px;
    border: 2px solid transparent;
    border-top-color: var(--magenta);
    border-radius: 50%;
    animation: spin 1.5s linear infinite reverse;
}

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

.loading-text {
    font-size: var(--text-sm);
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

/* ============================================================================
   Content Area
   ============================================================================ */
.content-area {
    position: relative;
    height: calc(100vh - 100px);
    border-radius: var(--radius-xl);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.content-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--raisn-green), transparent);
    opacity: 0.3;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: var(--space-12);
    text-align: center;
    position: relative;
}

.empty-visual {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-8);
}

.empty-rings {
    position: absolute;
    inset: 0;
}

.ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    animation: ring-expand 4s ease-out infinite;
}

.ring-1 {
    inset: 0;
    animation-delay: 0s;
}

.ring-2 {
    inset: 30px;
    animation-delay: 1s;
}

.ring-3 {
    inset: 60px;
    animation-delay: 2s;
}

@keyframes ring-expand {
    0% { transform: scale(0.8); opacity: 0; }
    50% { opacity: 0.3; }
    100% { transform: scale(1.2); opacity: 0; }
}

.empty-icon {
    position: relative;
    z-index: 1;
    color: var(--cyan);
    opacity: 0.6;
    animation: float-gentle 3s ease-in-out infinite;
}

@keyframes float-gentle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.empty-content {
    position: relative;
    z-index: 1;
}

.empty-title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-3);
}

.empty-description {
    font-size: var(--text-base);
    color: var(--text-muted);
    max-width: 360px;
    line-height: 1.7;
}

.empty-decoration {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.deco-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--raisn-green), transparent);
    opacity: 0.1;
}

.deco-line-1 {
    top: 30%;
    left: 0;
    right: 0;
}

.deco-line-2 {
    bottom: 30%;
    left: 0;
    right: 0;
}

/* ============================================================================
   Split View
   ============================================================================ */
.split-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Session Header */
.session-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border-subtle);
    background: linear-gradient(180deg, var(--elevated) 0%, var(--surface) 100%);
    flex-shrink: 0;
}

.session-header-content {
    flex: 1;
}

.session-meta-block {
    margin-bottom: var(--space-3);
}

.meta-eyebrow {
    display: block;
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--cyan);
    margin-bottom: var(--space-1);
}

.session-header-title {
    font-family: var(--font-mono);
    font-size: var(--text-lg);
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-all;
}

.meta-tags {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.meta-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    background: var(--glass-bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-secondary);
}

.meta-tag svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.status-tag .tag-dot {
    width: 6px;
    height: 6px;
    background: var(--emerald);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--emerald);
}

.accent-tag {
    border-color: var(--border-accent);
    color: var(--cyan);
}

.session-header-actions {
    display: flex;
    gap: var(--space-2);
}

/* Split Content */
.split-content {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

/* Split Panels */
.split-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.transcript-panel {
    flex: 1;
    min-width: 300px;
    border-right: 1px solid var(--border-subtle);
}

.qa-panel {
    flex: 1;
    min-width: 300px;
}

/* Panel Headers */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    background: var(--surface);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.panel-title-group {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.panel-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--cyan);
}

.panel-icon.qa-icon {
    color: var(--amber);
}

.panel-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.panel-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    padding: 0 var(--space-2);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--raisn-green);
    background: var(--cyan-glow);
    border: 1px solid rgba(120, 190, 32, 0.2);
    border-radius: var(--radius-full);
}

.panel-badge.qa-badge {
    color: var(--amber);
    background: var(--amber-glow);
    border-color: rgba(255, 190, 10, 0.2);
}

/* Panel Content */
.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-5);
}

.panel-content::-webkit-scrollbar {
    width: 6px;
}

.panel-content::-webkit-scrollbar-track {
    background: transparent;
}

.panel-content::-webkit-scrollbar-thumb {
    background: var(--muted);
    border-radius: var(--radius-full);
}

.panel-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

.qa-content {
    background: linear-gradient(180deg, var(--deep) 0%, var(--abyss) 100%);
}

/* Resizer */
.split-resizer {
    width: 12px;
    background: var(--surface);
    cursor: col-resize;
    position: relative;
    flex-shrink: 0;
    transition: background var(--duration-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.split-resizer:hover {
    background: var(--elevated);
}

.resizer-handle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: var(--space-2);
}

.resizer-handle span {
    width: 3px;
    height: 3px;
    background: var(--text-dim);
    border-radius: 50%;
    transition: all var(--duration-base);
}

.split-resizer:hover .resizer-handle span {
    background: var(--cyan);
    box-shadow: 0 0 6px var(--cyan);
}

.split-resizer.resizing {
    background: var(--raised);
}

.split-resizer.resizing .resizer-handle span {
    background: var(--cyan);
    box-shadow: 0 0 10px var(--cyan);
}

/* ============================================================================
   Chat Messages (Transcript as Chat Interface)
   ============================================================================ */
.transcript-segments {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

/* Chat Message Container */
.chat-message {
    display: flex;
    gap: var(--space-3);
    align-items: flex-end;
    animation: chat-enter 0.4s var(--ease-out);
    max-width: 100%;
}

@keyframes chat-enter {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Left Alignment (Customer) */
.chat-message-left {
    justify-content: flex-start;
}

/* Right Alignment (Agent) */
.chat-message-right {
    justify-content: flex-end;
    flex-direction: row-reverse;
}

/* Chat Avatar */
.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: var(--text-xs);
    flex-shrink: 0;
    transition: transform var(--duration-base) var(--ease-bounce);
}

.chat-message:hover .chat-avatar {
    transform: scale(1.08);
}

/* Agent Avatar - Indigo gradient */
.chat-avatar.agent,
.chat-avatar.ag,
.chat-avatar.a {
    background: linear-gradient(135deg, var(--raisn-indigo) 0%, var(--violet) 100%);
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

/* Customer Avatar - Raisn Green gradient */
.chat-avatar.customer,
.chat-avatar.cu,
.chat-avatar.c {
    background: linear-gradient(135deg, var(--raisn-green) 0%, var(--emerald) 100%);
    color: var(--void);
    box-shadow: 0 4px 12px rgba(120, 190, 32, 0.25);
}

/* Bubble Wrapper - Controls max width */
.chat-bubble-wrapper {
    max-width: 75%;
    display: flex;
    flex-direction: column;
}

/* Chat Bubble */
.chat-bubble {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    position: relative;
    transition: all var(--duration-base) var(--ease-smooth);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Customer Bubble - Left side, accent background */
.chat-message-left .chat-bubble {
    background: linear-gradient(135deg, rgba(120, 190, 32, 0.12) 0%, rgba(16, 185, 129, 0.10) 100%);
    border: 1px solid rgba(120, 190, 32, 0.25);
    border-bottom-left-radius: var(--radius-sm);
}

.chat-message-left .chat-bubble:hover {
    border-color: rgba(120, 190, 32, 0.4);
    background: linear-gradient(135deg, rgba(120, 190, 32, 0.18) 0%, rgba(16, 185, 129, 0.16) 100%);
}

/* Agent Bubble - Right side, darker background */
.chat-message-right .chat-bubble {
    background: var(--elevated);
    border: 1px solid var(--border-subtle);
    border-bottom-right-radius: var(--radius-sm);
}

.chat-message-right .chat-bubble:hover {
    border-color: var(--border-light);
    background: var(--raised);
}

/* Bubble Text */
.chat-bubble-text {
    font-size: var(--text-base);
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: var(--space-2);
}

/* Chat Metadata (time, confidence, segment count) */
.chat-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.chat-time {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 0.02em;
}

.chat-segment-count {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-muted);
    padding: 2px var(--space-2);
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.chat-confidence {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--amber);
    padding: 2px var(--space-2);
    background: rgba(255, 190, 10, 0.08);
    border: 1px solid rgba(255, 190, 10, 0.3);
    border-radius: var(--radius-sm);
}

/* Responsive: Adjust max-width on smaller screens */
@media (max-width: 768px) {
    .chat-bubble-wrapper {
        max-width: 85%;
    }

    .chat-avatar {
        width: 32px;
        height: 32px;
    }
}

/* ============================================================================
   Q&A Items
   ============================================================================ */
.qa-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.qa-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    animation: qa-enter 0.5s var(--ease-out);
}

@keyframes qa-enter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Question Bubble */
.qa-question {
    align-self: flex-end;
    max-width: 85%;
    padding: var(--space-4) var(--space-5);
    background: linear-gradient(135deg, rgba(120, 190, 32, 0.12) 0%, rgba(79, 70, 229, 0.10) 100%);
    border: 1px solid rgba(120, 190, 32, 0.2);
    border-radius: var(--radius-xl);
    border-bottom-right-radius: var(--radius-sm);
    position: relative;
}

.qa-question::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--raisn-green), var(--raisn-indigo));
    opacity: 0;
    z-index: -1;
    transition: opacity var(--duration-base);
    filter: blur(12px);
}

.qa-question:hover::before {
    opacity: 0.2;
}

.qa-question-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-2);
}

.qa-question-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--raisn-green);
    letter-spacing: 0.05em;
}

.qa-question-label svg {
    display: none;
}

.qa-question-text {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: var(--space-3);
}

.qa-question-meta {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.qa-time {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
}

.qa-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px var(--space-2);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
}

.qa-badge svg {
    width: 10px;
    height: 10px;
}

.qa-badge-confidence {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--emerald);
}

.qa-badge-category {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
    color: var(--violet);
}

.qa-badge-followup {
    background: var(--amber-glow);
    border-color: rgba(255, 190, 10, 0.3);
    color: var(--amber);
}

/* Answer Bubble */
.qa-answer {
    align-self: flex-start;
    max-width: 85%;
    padding: var(--space-4) var(--space-5);
    background: var(--elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    border-bottom-left-radius: var(--radius-sm);
    transition: all var(--duration-base);
}

.qa-answer:hover {
    border-color: var(--border-light);
}

.qa-answer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
}

.qa-answer-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--amber);
    letter-spacing: 0.05em;
}

.qa-answer-label svg {
    display: none;
}

.qa-answer-text {
    font-size: var(--text-base);
    color: var(--text-primary);
    line-height: 1.7;
    margin-bottom: var(--space-4);
}

.qa-answer-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}

.qa-detail {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.qa-detail-label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.qa-detail-value {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.qa-sql-query {
    margin-top: var(--space-4);
    padding: var(--space-4);
    background: var(--void);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow-x: auto;
    max-height: 150px;
    overflow-y: auto;
}

.qa-sql-query code {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--emerald);
    line-height: 1.5;
    white-space: pre-wrap;
}

/* ============================================================================
   Toast Notifications
   ============================================================================ */
.toast-container {
    position: fixed;
    top: var(--space-8);
    right: var(--space-8);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(20px);
    min-width: 320px;
    max-width: 480px;
    pointer-events: auto;
    animation: toast-enter 0.4s var(--ease-out);
    box-shadow: var(--shadow-depth-3);
}

@keyframes toast-enter {
    from {
        transform: translateX(100%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.toast-message {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.toast.success {
    border-left: 3px solid var(--emerald);
}

.toast.success .toast-icon {
    color: var(--emerald);
}

.toast.error {
    border-left: 3px solid var(--rose);
}

.toast.error .toast-icon {
    color: var(--rose);
}

.toast.info {
    border-left: 3px solid var(--raisn-green);
}

.toast.info .toast-icon {
    color: var(--raisn-green);
}

/* ============================================================================
   Responsive Design
   ============================================================================ */
@media (max-width: 1024px) {
    .app-main {
        grid-template-columns: 280px 1fr;
        gap: var(--space-4);
        padding: var(--space-4);
    }

    .header-center {
        display: none;
    }

    .split-content {
        flex-direction: column;
    }

    .transcript-panel,
    .qa-panel {
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
        flex: 1 !important;
        max-height: 50%;
    }

    .split-resizer {
        display: none;
    }
}

@media (max-width: 768px) {
    .app-main {
        grid-template-columns: 1fr;
    }

    .sidebar {
        height: auto;
        max-height: 280px;
    }

    .content-area {
        height: auto;
        min-height: 400px;
    }

    .qa-answer-details {
        grid-template-columns: 1fr;
    }

    .session-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-4);
    }

    .qa-question,
    .qa-answer {
        max-width: 95%;
    }
}

/* ============================================================================
   Inline Checklist (in Intelligence panel)
   ============================================================================ */
.checklist-inline {
    padding: var(--space-4) var(--space-5);
    background: var(--surface);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.checklist-inline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
}

.checklist-inline-title {
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.checklist-progress-text {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--emerald);
}

.checklist-inline-items {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.checklist-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
    transition: all var(--duration-base) var(--ease-smooth);
}

.checklist-chip .chip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-dim);
    transition: all var(--duration-base) var(--ease-smooth);
}

.checklist-chip .chip-label {
    transition: color var(--duration-base);
}

/* Signal: POSITIVE (green/emerald) */
.checklist-chip.signal-positive {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.1);
}

.checklist-chip.signal-positive .chip-dot {
    background: var(--emerald);
    box-shadow: 0 0 8px var(--emerald);
}

.checklist-chip.signal-positive .chip-label {
    color: var(--emerald);
}

/* Signal: NEGATIVE (red/rose) */
.checklist-chip.signal-negative {
    border-color: rgba(244, 63, 94, 0.4);
    background: rgba(244, 63, 94, 0.1);
}

.checklist-chip.signal-negative .chip-dot {
    background: var(--rose);
    box-shadow: 0 0 8px var(--rose);
}

.checklist-chip.signal-negative .chip-label {
    color: var(--rose);
}

/* Signal: NEUTRAL (amber/yellow) */
.checklist-chip.signal-neutral {
    border-color: rgba(255, 190, 10, 0.4);
    background: rgba(255, 190, 10, 0.1);
}

.checklist-chip.signal-neutral .chip-dot {
    background: var(--amber);
    box-shadow: 0 0 8px var(--amber);
}

.checklist-chip.signal-neutral .chip-label {
    color: var(--amber);
}

/* Backwards compat: .checked maps to positive */
.checklist-chip.checked {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.1);
}

.checklist-chip.checked .chip-dot {
    background: var(--emerald);
    box-shadow: 0 0 8px var(--emerald);
}

.checklist-chip.checked .chip-label {
    color: var(--emerald);
}

/* ============================================================================
   Print Styles
   ============================================================================ */
@media print {
    .app-header,
    .sidebar,
    .session-header-actions,
    .ambient-bg,
    .checklist-inline {
        display: none;
    }

    .app-main {
        grid-template-columns: 1fr;
    }

    .content-area {
        box-shadow: none;
        border: 1px solid #ccc;
        background: white;
    }

    .split-content {
        flex-direction: column;
    }

    .split-resizer {
        display: none;
    }

    body {
        background: white;
        color: black;
    }
}
