        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        :root {
            --primary: #2563eb;
            --primary-light: #3b82f6;
            --primary-dark: #1d4ed8;
            --secondary: #64748b;
            --background: #fafbfc;
            --surface: rgba(250, 251, 252, 0.8);
            --surface-solid: #ffffff;
            --surface-elevated: #f8fafc;
            --text-primary: #0f172a;
            --text-secondary: #64748b;
            --text-muted: #94a3b8;
            --border: #e2e8f0;
            --border-light: #f1f5f9;
            --border-hover: #cbd5e1;
            --primary-border: #dbeafe;
            --surface-hover: #f1f5f9;
            --success: #059669;
            --warning: #d97706;
            --error: #dc2626;
            --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
            --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
            --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
            --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
            --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
            --transition: all 0.2s ease;
            --radius-sm: 6px;
            --radius-md: 8px;
            --radius-lg: 12px;
            --radius-xl: 16px;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            background-color: var(--background);
            color: var(--text-primary);
            line-height: 1.6;
            min-height: 100vh;
            overflow: auto; /* Default to auto for most pages */
        }
        
        /* Landing Page Navigation - Clean Transparent Style */
        .landing-nav {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            background: transparent;
            z-index: 100;
            padding: 20px 0;
        }
        
        .landing-nav-container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 24px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .landing-nav-logo {
            display: flex;
            align-items: center;
            gap: 10px;
            text-decoration: none;
            color: rgba(255, 255, 255, 0.95);
        }
        
        .landing-nav-logo img {
            height: 26px;
            width: auto;
        }
        
        .landing-nav-logo span {
            font-weight: 500;
            font-size: 16px;
            color: rgba(255, 255, 255, 0.95);
            letter-spacing: 0.3px;
        }
        
        .landing-nav-links {
            display: flex;
            align-items: center;
            gap: 32px;
        }
        
        .landing-nav-links a {
            color: rgba(255, 255, 255, 0.95);
            text-decoration: none;
            font-size: 14px;
            font-weight: 500;
            transition: all 0.2s ease;
            letter-spacing: 0.3px;
        }
        
        .landing-nav-links a:hover {
            color: white;
            text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
        }
        
        .landing-nav-links .sign-in-btn {
            color: rgba(255, 255, 255, 0.95);
            padding: 6px 20px;
            border: 1px solid rgba(255, 255, 255, 0.3);
            border-radius: 20px;
            transition: all 0.2s ease;
            margin-left: 12px;
            background: rgba(255, 255, 255, 0.05);
        }
        
        .landing-nav-links .sign-in-btn:hover {
            background: rgba(255, 255, 255, 0.15);
            border-color: rgba(255, 255, 255, 0.5);
            color: white;
        }
        
        /* Hide landing nav on mobile */
        @media (max-width: 768px) {
            .landing-nav {
                display: none;
            }
        }
        
        /* Hero section with absolute nav */
        .landing-page .hero-section {
            position: relative; /* For absolute nav positioning */
        }
        
        /* Landing Page Styles */
        .landing-page {
            width: 100%;
            background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
        }

        /* Hero Section */
        .hero-section {
            min-height: 100vh;
            padding: 120px 0 80px;
            background: linear-gradient(135deg, rgba(10, 10, 46, 0.7), rgba(10, 10, 46, 0.4)), /* Dark overlay for text readability */
                        url('/assets/images/hero-bg.png') center/cover no-repeat;
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow-x: hidden;
        }

        .hero-container {
            max-width: 1200px;
            margin: 0 auto;
            width: 100%;
            position: relative;
            padding: 0 20px;
        }

        .hero-grid {
            display: flex;
            align-items: center;
            min-height: 600px;
        }

        .hero-content {
            text-align: left;
            max-width: 600px;
            position: relative;
            z-index: 2;
            padding-left: 20px;
        }

        .hero-visual {
            position: absolute;
            right: 0;
            top: 48%;
            transform: translateY(-50%) translateX(40%);
            width: auto;
            height: 100%;
            max-height: 900px;
        }

        .hero-ui-image {
            height: 100%;
            width: auto;
            opacity: 0.95;
            animation: floatIn 1s ease-out;
        }

        @keyframes floatIn {
            from {
                opacity: 0;
                transform: translateY(30px) scale(0.95);
            }
            to {
                opacity: 0.95;
                transform: translateY(0) scale(1);
            }
        }

        .hero-eyebrow {
            margin-bottom: 24px;
        }

        .eyebrow-pill {
            display: inline-block;
            background: linear-gradient(90deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            color: rgba(255, 255, 255, 0.95);
            padding: 5px 12px;
            border-radius: 50px;
            font-size: 10px;
            font-weight: 600;
            letter-spacing: 0.4px;
            text-transform: uppercase;
            border: 1px solid rgba(255, 255, 255, 0.15);
        }

        .hero-headline {
            font-size: 64px;
            font-weight: 700;
            line-height: 1.1;
            color: white;
            margin-bottom: 24px;
            letter-spacing: -1.5px;
            text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
        }

        .hero-subheadline {
            font-size: 20px;
            color: rgba(255, 255, 255, 0.8);
            margin-bottom: 40px;
            line-height: 1.5;
            text-shadow: 0 1px 10px rgba(0, 0, 0, 0.2);
            max-width: 500px;
        }

        .hero-actions {
            display: flex;
            gap: 16px;
            margin-bottom: 24px;
            flex-wrap: wrap;
        }

        .btn-primary {
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            color: white;
            border: 1.5px solid rgba(255, 255, 255, 0.4);
            padding: 14px 36px;
            font-size: 17px;
            font-weight: 500;
            border-radius: 50px;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
            letter-spacing: 0.3px;
            position: relative;
        }

        .hero-actions .btn-primary::before {
            content: '';
            position: absolute;
            inset: -3px;
            border-radius: 50px;
            padding: 2px;
            background: conic-gradient(from var(--angle), transparent 0deg, rgba(255, 255, 255, 1) 15deg, rgba(255, 255, 255, 0.6) 30deg, transparent 50deg);
            -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
            -webkit-mask-composite: xor;
            mask-composite: exclude;
            animation: sparkRotate 4s linear infinite;
            pointer-events: none;
            filter: blur(0.5px);
        }

        @keyframes sparkRotate {
            from {
                --angle: 0deg;
            }
            to {
                --angle: 360deg;
            }
        }

        @property --angle {
            syntax: '<angle>';
            initial-value: 0deg;
            inherits: false;
        }

        .btn-primary:hover {
            background: rgba(255, 255, 255, 0.2);
            border-color: rgba(255, 255, 255, 0.6);
            transform: translateY(-2px);
            box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.25);
        }

        .cta-subtext {
            font-size: 14px;
            color: rgba(255, 255, 255, 0.7);
            margin-top: -8px;
        }

        .hero-actions .btn-signin {
            background: transparent;
            color: rgba(255, 255, 255, 0.9);
            border: 1px solid rgba(255, 255, 255, 0.3);
            padding: 14px 28px;
            font-size: 17px;
            font-weight: 500;
            border-radius: 50px;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .hero-actions .btn-signin:hover {
            background: rgba(255, 255, 255, 0.1);
            border-color: rgba(255, 255, 255, 0.5);
            color: white;
            transform: translateY(-1px);
        }
        .hero-hipaa {
            margin-top: 40px;
        }
        .hipaa-badge {
            width: 70px;
            height: auto;
            opacity: 0.7;
            filter: brightness(0) invert(1);
        }

        /* Testimonials Section */
        .testimonials-section {
            padding: 60px 0;
            background: linear-gradient(to bottom, #ffffff, #f8fafc);
            overflow: hidden;
            position: relative;
        }
        
        .testimonials-section .section-title {
            text-align: center;
            margin-bottom: 48px;
            padding: 0 20px;
        }

        .testimonials-container {
            width: 100%;
            overflow: hidden;
        }

        .testimonials-track {
            display: flex;
            gap: 32px;
            animation: scroll 80s linear infinite;
            width: max-content;
        }

        .testimonial-card {
            flex-shrink: 0;
            width: 420px;
            min-height: 120px;
            background: rgba(255, 255, 255, 0.8);
            border-radius: 24px;
            padding: 36px 32px 32px;
            border: 1px solid var(--primary-border);
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
        }

        .quote-icon {
            position: absolute;
            top: 16px;
            left: 20px;
            width: 22px;
            height: 22px;
            border: 1px solid var(--primary-border);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-muted);
            font-size: 8px;
            background: transparent;
        }

        .testimonial-card p {
            margin: 0;
            color: var(--text-secondary);
            font-size: 15px;
            line-height: 1.7;
            text-align: center;
            font-weight: 400;
            letter-spacing: 0.2px;
        }

        @keyframes scroll {
            0% {
                transform: translateX(0);
            }
            100% {
                transform: translateX(-50%);
            }
        }

        /* Responsive adjustments for testimonials */
        @media (max-width: 768px) {
            .testimonial-card {
                width: 320px;
                min-height: 100px;
                padding: 28px 24px 24px;
                border-radius: 20px;
            }
            
            .testimonial-card p {
                font-size: 14px;
                line-height: 1.6;
            }
            
            .testimonials-track {
                animation-duration: 60s;
                gap: 24px;
            }
            
            .quote-icon {
                width: 20px;
                height: 20px;
                top: 12px;
                left: 16px;
                font-size: 7px;
            }
        }

        /* Trust Section */
        .trust-section {
            padding: 60px 20px;
            background: white;
            border-top: 1px solid var(--border-light);
            border-bottom: 1px solid var(--border-light);
        }

        .trust-container {
            max-width: 1000px;
            margin: 0 auto;
            display: flex;
            justify-content: space-around;
            flex-wrap: wrap;
            gap: 40px;
        }

        .trust-item {
            display: flex;
            align-items: center;
            gap: 12px;
            flex: 0 1 280px;
        }

        .trust-icon {
            width: 48px;
            height: 48px;
            background: transparent;
            border: 1px solid rgba(59, 130, 246, 0.15);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .trust-icon i {
            font-size: 18px;
            color: #3b82f6;
        }

        .trust-item p {
            font-size: 14px;
            color: var(--text-secondary);
            font-weight: 400;
            margin: 0;
        }

        /* Workflow Section */
        .workflow-section {
            padding: 80px 20px;
            background: var(--surface-elevated);
        }

        .workflow-container {
            max-width: 1000px;
            margin: 0 auto;
        }

        .section-title {
            font-size: 32px;
            font-weight: 600;
            text-align: center;
            margin-bottom: 60px;
            color: var(--text-primary);
            letter-spacing: -0.02em;
        }

        .workflow-steps {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 40px;
        }

        .workflow-step {
            text-align: center;
            position: relative;
            padding: 30px;
            background: white;
            border-radius: 20px;
            border: 1px solid rgba(59, 130, 246, 0.15);
            transition: all 0.3s ease;
        }

        .workflow-step:hover {
            transform: translateY(-2px);
            border-color: rgba(59, 130, 246, 0.3);
            background: rgba(59, 130, 246, 0.02);
        }

        /* Replaced step numbers and icons with images */
        .step-image {
            width: 100%;
            height: 200px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 24px;
        }

        .step-image img {
            max-width: 100%;
            max-height: 100%;
            width: auto;
            height: auto;
            object-fit: contain;
        }

        .workflow-step h3 {
            font-size: 19px;
            font-weight: 500;
            margin-bottom: 12px;
            color: var(--text-primary);
            letter-spacing: -0.01em;
        }

        .workflow-step p {
            font-size: 14px;
            color: var(--text-secondary);
            line-height: 1.5;
            font-weight: 400;
        }

        /* Value Section */
        .value-section {
            padding: 80px 20px;
            background: white;
        }

        .value-container {
            max-width: 1100px;
            margin: 0 auto;
        }

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

        .value-item {
            padding: 30px;
            background: white;
            border-radius: 20px;
            border: 1px solid rgba(59, 130, 246, 0.12);
            transition: all 0.3s ease;
        }

        .value-item:hover {
            border-color: rgba(59, 130, 246, 0.25);
            background: rgba(59, 130, 246, 0.02);
            transform: translateY(-2px);
        }

        .value-icon {
            width: 56px;
            height: 56px;
            background: transparent;
            border: 1px solid rgba(59, 130, 246, 0.2);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 20px;
        }

        .value-icon i {
            font-size: 22px;
            color: #3b82f6;
        }

        .value-item h3 {
            font-size: 19px;
            font-weight: 500;
            margin-bottom: 12px;
            color: var(--text-primary);
            letter-spacing: -0.01em;
        }

        .value-item p {
            font-size: 14px;
            color: var(--text-secondary);
            line-height: 1.6;
            font-weight: 400;
        }

        /* Security Section */
        .security-section {
            padding: 40px 20px;
            background: var(--surface-elevated);
        }

        .security-container {
            max-width: 600px;
            margin: 0 auto;
        }

        .security-badges {
            display: flex;
            justify-content: center;
            gap: 40px;
            flex-wrap: wrap;
        }

        .security-badge {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 16px 24px;
            background: white;
            border-radius: 50px;
            border: 1px solid rgba(59, 130, 246, 0.12);
            transition: all 0.3s ease;
        }

        .security-badge:hover {
            border-color: rgba(59, 130, 246, 0.25);
            transform: translateY(-1px);
        }

        .security-badge i {
            font-size: 20px;
            color: #3b82f6;
        }

        .security-badge span {
            font-size: 14px;
            font-weight: 500;
            color: var(--text-primary);
            letter-spacing: -0.01em;
        }

        /* Data Safety Section */
        .data-safety-section {
            padding: 80px 20px;
            background: white;
        }

        .data-safety-container {
            max-width: 900px;
            margin: 0 auto;
            text-align: center;
        }

        .data-safety-text {
            font-size: 18px;
            line-height: 1.7;
            color: var(--text-secondary);
            max-width: 800px;
            margin: 0 auto;
        }

        /* Founder Section */
        .founder-section {
            padding: 80px 20px;
            background: #f8fafc;
        }

        .founder-container {
            max-width: 1000px;
            margin: 0 auto;
        }

        .founder-content-wrapper {
            display: flex;
            align-items: center;
            gap: 60px;
        }

        .founder-image-wrapper {
            flex-shrink: 0;
        }

        .founder-image {
            width: 200px;
            height: 200px;
            border-radius: 50%;
            object-fit: cover;
            border: 3px solid white;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        }

        .founder-text {
            flex: 1;
        }

        .founder-title {
            font-size: 32px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 24px;
            letter-spacing: -0.02em;
        }

        .founder-story {
            font-size: 16px;
            line-height: 1.6;
            color: var(--text-secondary);
            margin-bottom: 16px;
        }

        .founder-signature {
            font-size: 18px;
            font-weight: 500;
            color: var(--text-primary);
            margin-top: 24px;
            font-style: italic;
        }

        @media (max-width: 768px) {
            .founder-content-wrapper {
                flex-direction: column;
                text-align: center;
                gap: 40px;
            }

            .founder-image {
                width: 160px;
                height: 160px;
            }

            .founder-title {
                font-size: 28px;
            }

            .data-safety-text {
                font-size: 16px;
            }
        }

        /* Pricing Section */
        .pricing-section {
            padding: 80px 20px;
            background: linear-gradient(135deg, rgba(37, 99, 235, 0.03) 0%, rgba(139, 92, 246, 0.03) 100%);
        }

        .pricing-container {
            max-width: 500px;
            margin: 0 auto;
        }

        .pricing-card {
            background: white;
            border-radius: 24px;
            padding: 40px;
            border: 1px solid rgba(59, 130, 246, 0.15);
            position: relative;
        }

        .pricing-header {
            text-align: center;
            margin-bottom: 30px;
        }

        .pricing-header h3 {
            font-size: 22px;
            font-weight: 500;
            color: var(--text-primary);
            margin-bottom: 20px;
            letter-spacing: -0.02em;
        }

        .price {
            display: flex;
            align-items: baseline;
            justify-content: center;
            gap: 4px;
        }

        .currency {
            font-size: 22px;
            color: var(--text-secondary);
            font-weight: 400;
        }

        .amount {
            font-size: 44px;
            font-weight: 600;
            color: var(--text-primary);
            letter-spacing: -0.02em;
        }

        .period {
            font-size: 18px;
            color: var(--text-secondary);
            font-weight: 400;
        }

        .pricing-features {
            list-style: none;
            margin-bottom: 30px;
        }

        .pricing-features li {
            padding: 12px 0;
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 14px;
            color: var(--text-secondary);
            border-bottom: 1px solid rgba(59, 130, 246, 0.08);
            font-weight: 400;
        }

        .pricing-features li:last-child {
            border-bottom: none;
        }

        .pricing-features i {
            color: #3b82f6;
            font-size: 14px;
        }

        .pricing-badges-container {
            display: flex;
            gap: 12px;
            justify-content: center;
            flex-wrap: wrap;
            margin-bottom: 24px;
        }

        .pricing-badge {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: transparent;
            color: #3b82f6;
            padding: 8px 16px;
            border-radius: 50px;
            font-size: 13px;
            font-weight: 500;
            border: 1px solid rgba(59, 130, 246, 0.2);
        }

        .pricing-card .btn-primary {
            width: 100%;
            background: transparent;
            color: #3b82f6;
            border: 1.5px solid #3b82f6;
            padding: 14px 36px;
            font-size: 16px;
            font-weight: 500;
            border-radius: 50px;
            cursor: pointer;
            transition: all 0.3s ease;
            display: inline-block;
            text-align: center;
        }

        .pricing-card .btn-primary:hover {
            background: rgba(59, 130, 246, 0.08);
            border-color: #2563eb;
            transform: translateY(-1px);
        }

        /* Footer */
        .landing-footer {
            padding: 40px 20px;
            background: var(--text-primary);
            color: white;
        }

        .footer-container {
            max-width: 1000px;
            margin: 0 auto;
            text-align: center;
        }

        .footer-links {
            display: flex;
            justify-content: center;
            gap: 30px;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }

        .footer-links a {
            color: rgba(255, 255, 255, 0.8);
            text-decoration: none;
            font-size: 15px;
            transition: color 0.2s ease;
        }

        .footer-links a:hover {
            color: white;
        }

        .footer-copyright {
            font-size: 14px;
            color: rgba(255, 255, 255, 0.6);
        }

        /* Responsive Design */
        @media (max-width: 768px) {
            .hero-section {
                min-height: 100vh;
                padding: 80px 20px 60px;
            }

            .hero-container {
                padding: 0 20px;
            }

            .hero-grid {
                flex-direction: column;
                min-height: auto;
            }

            .hero-content {
                text-align: center;
                max-width: 100%;
                padding-left: 0;
            }

            .hero-visual {
                display: none;
            }

            .hero-headline {
                font-size: 38px;
                letter-spacing: -0.5px;
            }

            .hero-subheadline {
                font-size: 18px;
                max-width: 100%;
                margin-left: auto;
                margin-right: auto;
            }

            .hero-actions {
                justify-content: center;
            }

            .hero-eyebrow {
                text-align: center;
            }

            /* Sign in button handled in earlier mobile styles */

            .trust-container {
                flex-direction: column;
                gap: 24px;
            }
            
            .trust-section {
                padding: 40px 20px;
            }
            
            .trust-item {
                flex: 1 1 auto;
            }

            .workflow-steps {
                grid-template-columns: 1fr;
            }

            .value-grid {
                grid-template-columns: 1fr;
            }

            .section-title {
                font-size: 28px;
            }

            .pricing-card {
                padding: 30px 20px;
            }
        }

        /* Fixed Top Navigation */
        .top-nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 50px;
            background: #1e3a8a;
            z-index: 1000;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .nav-content {
            height: 100%;
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 20px;
        }

        .nav-left {
            display: flex;
            align-items: center;
            gap: 14px;
        }

        .nav-left .back-button {
            display: flex;
            align-items: center;
            gap: 8px;
            background: none;
            border: none;
            color: white;
            font-size: 14px;
            cursor: pointer;
            padding: 8px 12px;
            border-radius: var(--radius-sm);
            transition: var(--transition);
        }

        .nav-left .back-button:hover {
            background: rgba(255, 255, 255, 0.1);
        }

        .nav-left .logo {
            display: flex;
            align-items: center;
            gap: 12px;
            color: white;
            font-weight: 600;
            font-size: 16px;
            cursor: pointer;
            transition: opacity 0.2s ease;
        }

        .nav-left .logo:hover {
            opacity: 0.8;
        }

        .nav-left .logo-icon {
            width: 28px;
            height: 28px;
            background: white;
            color: #1e3a8a;
            border-radius: var(--radius-sm);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
        }

        /* Breadcrumb Navigation - Apple-inspired design */
        .nav-breadcrumb {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-left: 8px;
            animation: fadeIn 0.2s ease;
        }

        .breadcrumb-divider {
            width: 1px;
            height: 20px;
            background: rgba(255, 255, 255, 0.2);
            margin: 0 4px;
        }

        .breadcrumb-link {
            color: rgba(255, 255, 255, 0.7);
            text-decoration: none;
            font-size: 14px;
            font-weight: 500;
            transition: all 0.2s ease;
            padding: 4px 6px;
            border-radius: 4px;
        }

        .breadcrumb-link:hover {
            color: white;
            background: rgba(255, 255, 255, 0.1);
        }

        .breadcrumb-separator {
            color: rgba(255, 255, 255, 0.4);
            font-size: 14px;
            font-weight: 300;
        }

        .breadcrumb-current {
            color: rgba(255, 255, 255, 0.9);
            font-size: 14px;
            font-weight: 500;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateX(-10px); }
            to { opacity: 1; transform: translateX(0); }
        }

        /* Hide breadcrumb on mobile for space */
        @media (max-width: 768px) {
            .nav-breadcrumb {
                display: none !important;
            }
        }

        .nav-right {
            display: flex;
            align-items: center;
            gap: 14px;
        }

        #nav-trial-status {
            color: white;
            font-size: 14px;
            font-weight: 500;
        }

        .nav-button {
            background: none;
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: white;
            padding: 8px 16px;
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            transition: var(--transition);
        }

        .nav-button:hover {
            background: rgba(255, 255, 255, 0.1);
            border-color: rgba(255, 255, 255, 0.3);
        }

        .nav-button.subscribe-btn {
            background: transparent;
            border: 1px solid white;
            color: white;
        }

        .nav-button.subscribe-btn:hover {
            background: rgba(255, 255, 255, 0.1);
            border-color: white;
        }

        .nav-button.help-btn {
            width: 36px;
            height: 36px;
            padding: 0;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        #nav-user-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: var(--primary);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        #nav-user-avatar:hover {
            background: var(--primary-dark);
            transform: scale(1.05);
        }

        .user-avatar-container {
            position: relative;
        }

        .user-dropdown {
            position: absolute;
            top: 100%;
            right: 0;
            background: var(--surface-solid);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            box-shadow: var(--shadow-lg);
            min-width: 150px;
            z-index: 1000;
            margin-top: 4px;
        }
        
        .help-dropdown {
            position: absolute;
            top: 100%;
            right: 0;
            background: var(--surface-solid);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            box-shadow: var(--shadow-lg);
            min-width: 200px;
            z-index: 1000;
            margin-top: 4px;
        }
        
        .help-dropdown .dropdown-item {
            text-decoration: none;
            color: var(--text-primary);
            display: block;
        }

        .dropdown-item {
            padding: 12px 16px;
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            transition: background-color 0.2s ease;
            font-size: 14px;
            color: var(--text-primary);
        }

        .dropdown-item:hover {
            background: var(--surface-elevated);
        }

        .dropdown-item:first-child {
            border-radius: var(--radius-md) var(--radius-md) 0 0;
        }

        .dropdown-item:last-child {
            border-radius: 0 0 var(--radius-md) var(--radius-md);
        }

        .dropdown-item i {
            width: 16px;
            text-align: center;
            color: var(--text-secondary);
        }

        .container {
            margin-top: 50px; /* Account for fixed nav */
            height: calc(100vh - 50px);
            overflow: hidden;
        }
        
        .container.no-nav {
            margin-top: 0;
            height: 100vh;
        }
        
        /* Allow scrolling for profile view */
        #profile-view {
            height: 100%;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        }

        /* Scrollable container for views that need it */
        .container.scrollable {
            overflow-y: auto;
            height: calc(100vh - 50px);
        }

        /* Split Screen Layout */
.split-screen-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Landing Side Styles */
.landing-side {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.gradient-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.curve-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    filter: blur(40px);
}

.curve-1 {
    width: 600px;
    height: 600px;
    top: -300px;
    left: -200px;
    background: rgba(255, 255, 255, 0.1);
}

.curve-2 {
    width: 400px;
    height: 400px;
    bottom: -200px;
    right: -100px;
    background: rgba(37, 99, 235, 0.2);
}

.curve-3 {
    width: 300px;
    height: 300px;
    top: 50%;
    left: 30%;
    background: rgba(255, 255, 255, 0.05);
}

.landing-content {
    position: relative;
    z-index: 1;
    color: white;
    max-width: 500px;
}

.landing-content .logo {
    color: white;
    font-size: 28px;
}

.landing-content .logo-icon {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.landing-title {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.landing-subtitle {
    font-size: 18px;
    line-height: 1.6;
    opacity: 0.9;
    margin-bottom: 48px;
}

.feature-list {
    margin-bottom: 48px;
}

.feature-item {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    align-items: start;
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-icon i {
    font-size: 20px;
}

.feature-text h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.feature-text p {
    font-size: 14px;
    opacity: 0.85;
    line-height: 1.5;
}

.time-saved-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 12px 24px;
    border-radius: 24px;
    font-weight: 600;
    font-size: 16px;
}

/* Login Side Styles */
.login-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
    padding: 60px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

.forgot-password-link {
    display: block;
    text-align: right;
    margin-top: 8px;
    font-size: 14px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.forgot-password-link:hover {
    text-decoration: underline;
}

.login-button {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 24px;
}

.login-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
}

.divider span {
    background: var(--background);
    padding: 0 16px;
    position: relative;
    color: var(--text-muted);
    font-size: 14px;
}

.google-login-button {
    width: 100%;
    padding: 14px;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-primary);
}

.google-login-button:hover {
    background: var(--surface-elevated);
    border-color: var(--primary);
}

.apple-login-button {
    width: 100%;
    padding: 14px;
    background: #000000;
    border: 1px solid #000000;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #ffffff;
}

.apple-login-button:hover {
    background: #1a1a1a;
    border-color: #1a1a1a;
}

.apple-login-button i {
    font-size: 20px;
}

.signup-prompt {
    text-align: center;
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.signup-prompt p {
    color: var(--text-secondary);
    font-size: 14px;
}

.signup-prompt a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.signup-prompt a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1024px) {
    /* Allow body scrolling on mobile */
    body.landing-active,
    body.signup-active {
        overflow: auto !important;
        overflow-y: scroll !important;
    }
    
    #login-view {
        overflow-y: visible;
        height: auto;
        min-height: 100vh;
    }
    
    .split-screen-container {
        flex-direction: column;
        min-height: auto;
        overflow-y: visible;
    }
    
    .login-header {
        margin-bottom: 32px;
    }
    
    .login-header h2 {
        font-size: 28px;
    }
    
    /* Show logo on mobile */
    .login-header::before {
        content: '';
        display: block;
        margin-bottom: 24px;
    }
}

@media (max-width: 480px) {
    .login-container {
        max-width: 100%;
    }
    
    /* Adjust mobile content for smaller screens */
    .mobile-title {
        font-size: 28px;
    }
    
    .mobile-subtitle {
        font-size: 15px;
    }
    
    .mobile-cta-primary,
    .mobile-cta-secondary {
        font-size: 15px;
        padding: 14px 20px;
    }
    
    .mobile-feature {
        font-size: 14px;
        padding: 10px 14px;
    }
    
}

/* Mobile Notice Banner */
.mobile-notice {
    display: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 12px 20px;
    text-align: center;
    font-size: 14px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.mobile-notice-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.mobile-notice-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-left: 10px;
}

.mobile-notice-close:hover {
    background: rgba(255,255,255,0.3);
}

/* iOS App Banner */
.ios-app-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #f7f7f7;
    border-bottom: 1px solid #ddd;
    padding: 8px 15px;
    z-index: 9999;
    display: none;
}

.ios-app-content {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 100%;
}

.app-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
}

.app-info {
    flex: 1;
}

.app-title {
    font-weight: 600;
    font-size: 15px;
    color: #333;
}

.app-subtitle {
    font-size: 13px;
    color: #666;
}

.app-download-btn {
    padding: 6px 16px;
    background: #007AFF;
    color: white;
    text-decoration: none;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 500;
}

/* Mobile Login Container */
.mobile-login-container {
    display: none;
    background: var(--background);
    min-height: 100vh;
    padding: 20px;
}

.mobile-login-header {
    padding: 20px 0;
    margin-bottom: 20px;
}

.mobile-back-btn {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.mobile-login-content {
    max-width: 400px;
    margin: 0 auto;
}

@media (max-width: 1024px) {
    .mobile-login-container {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 100;
        overflow-y: auto;
    }
}

@media (max-width: 1024px) {
    .mobile-notice {
        display: block;
    }
    
    /* Hide only the landing side on mobile, keep login form visible */
    .landing-side {
        display: none !important;
    }
    
    .login-side {
        flex: unset;
        width: 100%;
        padding: 40px 20px;
        min-height: 100vh;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    
}

/* Add entrance animations */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.landing-content > * {
    animation: slideInLeft 0.6s ease-out forwards;
    opacity: 0;
}

.landing-content > *:nth-child(1) { animation-delay: 0.1s; }
.landing-content > *:nth-child(2) { animation-delay: 0.2s; }
.landing-content > *:nth-child(3) { animation-delay: 0.3s; }
.landing-content > *:nth-child(4) { animation-delay: 0.4s; }
.landing-content > *:nth-child(5) { animation-delay: 0.5s; }

.login-container > * {
    animation: slideInRight 0.6s ease-out forwards;
    opacity: 0;
}

.login-container > *:nth-child(1) { animation-delay: 0.1s; }
.login-container > *:nth-child(2) { animation-delay: 0.2s; }
.login-container > *:nth-child(3) { animation-delay: 0.3s; }
.login-container > *:nth-child(4) { animation-delay: 0.4s; }

        /* Header */
        .header {
            background: var(--surface-solid);
            border-bottom: 1px solid var(--border);
            padding: 16px 0;
            margin-bottom: 32px;
            position: sticky;
            top: 0;
            z-index: 100;
            box-shadow: var(--shadow-sm);
        }

        .header-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 20px;
        }

        .logo {
            font-size: 24px;
            font-weight: 700;
            color: var(--primary);
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .logo-icon {
            width: 40px;
            height: 40px;
            background: var(--primary);
            border-radius: var(--radius-md);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 18px;
        }

        .user-info {
            display: flex;
            align-items: center;
            gap: 12px;
            color: var(--text-secondary);
            font-weight: 500;
            background: var(--surface-elevated);
            padding: 8px 16px;
            border-radius: 24px;
            border: 1px solid var(--border-light);
        }

        .user-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: var(--primary);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: 600;
            font-size: 14px;
        }

        /* Search Bar */
        .search-container {
            position: relative;
            flex: 1;
            max-width: 300px;
        }

        .search-input {
            width: 100%;
            padding: 10px 16px 10px 40px;
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            font-size: 14px;
            background: var(--surface-solid);
            transition: var(--transition);
        }

        .search-input:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }

        .search-icon {
            position: absolute;
            left: 16px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-muted);
        }

        /* Loading State */
        .loading {
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            height: 200px;
            color: var(--text-secondary);
            gap: 16px;
        }

        .loading-spinner {
            border: 3px solid var(--border);
            border-top: 3px solid var(--primary);
            border-radius: 50%;
            width: 40px;
            height: 40px;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* Error State */
        .error-message {
            background: #fef2f2;
            border: 1px solid #fecaca;
            color: var(--error);
            padding: 16px;
            border-radius: var(--radius-md);
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .error-message i {
            font-size: 18px;
        }

        /* Main Content */
        .main-content {
            min-height: calc(100vh - 100px);
            animation: fadeIn 0.3s ease;
        }

        .main-content:not([style*="block"]) {
    position: absolute;
    left: -9999px;
}

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

        .page-title {
            font-size: 32px;
            font-weight: 700;
            margin-bottom: 8px;
            color: var(--text-primary);
            letter-spacing: -0.025em;
        }

        .page-subtitle {
            font-size: 16px;
            color: var(--text-secondary);
            margin-bottom: 32px;
            font-weight: 400;
        }

        /* Dashboard Layout */
        #dashboard {
            padding: 16px 20px;
        }

        /* Dashboard-specific scrolling fix */
        #dashboard.main-content {
            max-height: calc(100vh - 50px);
            overflow-y: auto;
        }

        /* Payment setup scrolling fix */
        #payment-setup.main-content {
            max-height: calc(100vh - 50px);
            overflow-y: auto;
            -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        }
        
        /* Referral dashboard scrolling fix */
        #referral-dashboard-view.main-content {
            max-height: calc(100vh - 50px);
            overflow-y: auto;
            -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        }

        /* Larger screens get more padding */
        @media (min-width: 1200px) {
            #dashboard {
                padding: 20px 40px;
            }
        }

        .dashboard-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 20px;
            gap: 32px;
        }

        .dashboard-info {
            flex: 0 0 auto;
            min-width: 300px;
        }

        .dashboard-controls {
            flex: 1;
            display: flex;
            align-items: center;
            gap: 16px;
            justify-content: flex-end;
            margin-top: 8px;
        }

        /* Patient Table View */
        .patients-table {
            margin-top: 16px;
            margin-bottom: 32px;
        }

        /* Table Header */
        .patients-header {
            display: flex;
            align-items: center;
            padding: 16px 24px;
            background: var(--surface-elevated);
            border-radius: var(--radius-lg) var(--radius-lg) 0 0;
            border: 1px solid var(--border);
            border-bottom: none;
            font-size: 13px;
            font-weight: 600;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .header-cell {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .header-name { flex: 2.5; min-width: 200px; }
        .header-age { flex: 0.8; min-width: 80px; }
        .header-condition { flex: 2; min-width: 150px; }
        .header-sessions { 
            flex: 1; 
            min-width: 100px; 
            text-align: center; 
            justify-content: center; 
            display: flex;
        }
        .header-last-session { flex: 1.2; min-width: 120px; }
        .header-notes { flex: 2; min-width: 150px; }

        /* Patient Row */
        .patient-row {
            display: flex;
            align-items: center;
            padding: 20px 24px;
            background: var(--surface-solid);
            border: 1px solid var(--border);
            border-top: none;
            cursor: pointer;
            transition: all 0.15s ease;
            position: relative;
            isolation: isolate;
        }

        .patient-row:hover {
            background: var(--surface-elevated);
            transform: translateX(4px);
        }

        .patient-row:active {
            transform: translateX(2px);
        }

        .patient-row:last-child {
            border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        }

        /* Hover accent */
        .patient-row::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            width: 3px;
            height: 100%;
            background: var(--primary);
            opacity: 0;
            transition: opacity 0.15s ease;
        }

        .patient-row:hover::before {
            opacity: 1;
        }

        /* Cell Styles */
        .patient-cell {
            display: flex;
            align-items: center;
            color: var(--text-primary);
            font-size: 14px;
        }

        .cell-name { 
            flex: 2.5; 
            min-width: 200px;
            font-weight: 600;
            color: var(--text-primary);
        }

        .cell-age { 
            flex: 0.8; 
            min-width: 80px;
            color: var(--text-secondary);
        }

        .cell-condition { 
            flex: 2; 
            min-width: 150px;
        }

        .condition-badge {
            display: inline-block;
            padding: 4px 12px;
            background: var(--surface-elevated);
            color: var(--primary);
            border-radius: 16px;
            font-size: 12px;
            font-weight: 600;
            border: 1px solid var(--border-light);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 100%;
        }

        .cell-sessions { 
            flex: 1; 
            min-width: 100px;
            display: flex;
            justify-content: center;
            align-items: center;
            font-weight: 600;
            color: var(--primary);
        }

        .cell-last-session { 
            flex: 1.2; 
            min-width: 120px;
            color: var(--text-secondary);
            font-size: 13px;
        }

        .cell-notes { 
            flex: 2; 
            min-width: 150px;
            color: var(--text-secondary);
            font-size: 13px;
            font-style: italic;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        /* Empty row for spacing */
        .patient-row + .patient-row {
            border-top: 1px solid var(--border-light);
        }

        /* Patient Menu Button */
        .patient-menu-btn {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            padding: 8px;
            border-radius: var(--radius-sm);
            transition: all 0.15s ease;
            font-size: 18px;
            line-height: 1;
            margin-left: auto;
            margin-right: -8px;
            position: relative;
        }

        .patient-menu-btn:hover {
            background: var(--surface-elevated);
            color: var(--text-primary);
        }

        .patient-menu-btn.active {
            opacity: 1;
            background: var(--surface-elevated);
            color: var(--primary);
        }

        /* Patient Menu Dropdown */
        .patient-menu-dropdown {
            background: var(--surface-solid);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            box-shadow: var(--shadow-lg);
            min-width: 160px;
            overflow: hidden;
            z-index: 9999;
        }

        .patient-menu-item {
            padding: 12px 16px;
            cursor: pointer;
            transition: var(--transition);
            font-size: 14px;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 12px;
            border: none;
            background: none;
            width: 100%;
            text-align: left;
        }

        .patient-menu-item:hover {
            background: var(--surface-elevated);
        }

        .patient-menu-item.delete {
            color: var(--error);
        }

        .patient-menu-item i {
            width: 16px;
            font-size: 14px;
        }

        /* Sort Controls - removed as no longer needed */

        .sort-dropdown {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 16px;
            background: var(--surface-solid);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            font-size: 14px;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.15s ease;
            white-space: nowrap;
            position: relative;
        }

        .sort-dropdown:hover {
            border-color: var(--primary);
            color: var(--primary);
        }

        .sort-dropdown i {
            font-size: 12px;
        }

        /* Sort button in header */
        .sort-button {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            padding: 4px;
            border-radius: 4px;
            transition: all 0.15s ease;
            font-size: 12px;
        }

        .sort-button:hover {
            color: var(--primary);
            background: var(--surface-solid);
        }

        .sort-button.active {
            color: var(--primary);
        }

        .sort-button i {
            transition: transform 0.2s ease;
        }

        .sort-button.desc i {
            transform: rotate(180deg);
        }

        /* Responsive Patient Table */
        @media (max-width: 1200px) {
            .header-notes, .cell-notes {
                display: none;
            }
            
            .dashboard-controls {
                flex-wrap: wrap;
            }
        }
        
        @media (max-width: 992px) {
            .dashboard-header {
                flex-direction: column;
                gap: 16px;
            }

            .dashboard-controls {
                justify-content: flex-start;
                margin-top: 0;
            }
        }

        @media (max-width: 768px) {
            .dashboard-header {
                flex-direction: column;
                gap: 16px;
            }

            .dashboard-controls {
                flex-direction: column;
                width: 100%;
                gap: 12px;
                margin-top: 0;
            }

            .search-container {
                max-width: 100%;
            }

            .sort-dropdown {
                width: 100%;
                justify-content: center;
            }

            .patients-header {
                display: none;
            }

            .patient-row {
                flex-direction: column;
                align-items: flex-start;
                padding: 16px;
                gap: 12px;
            }

            .patient-row:hover {
                transform: none;
                background: var(--surface-elevated);
            }

            .patient-cell {
                width: 100%;
            }

            .cell-name {
                font-size: 16px;
                margin-bottom: 4px;
            }

            .cell-age::before {
                content: 'Age: ';
                color: var(--text-muted);
                font-weight: normal;
            }

            .cell-condition {
                margin-top: 8px;
            }

            .cell-sessions::before {
                content: 'Sessions: ';
                color: var(--text-muted);
                font-weight: normal;
            }

            .cell-last-session::before {
                content: 'Last visit: ';
                color: var(--text-muted);
                font-weight: normal;
            }

            .cell-notes {
                display: block;
                margin-top: 8px;
                white-space: normal;
                line-height: 1.4;
            }

            .cell-notes::before {
                content: 'Notes: ';
                color: var(--text-muted);
                font-weight: normal;
            }
        }

        /* New Patient Card Layout */
        .patient-card-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 16px;
        }

        .patient-basic-info {
            flex: 1;
        }

        .patient-menu {
            margin-left: 12px;
        }

        .patient-edit-btn {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            padding: 8px;
            border-radius: var(--radius-sm);
            transition: var(--transition);
            font-size: 14px;
        }

        .patient-edit-btn:hover {
            background: var(--surface-elevated);
            color: var(--primary);
        }

        .patient-details {
            /* Spacing handled by individual .patient-field margin-bottom */
        }

        .patient-field {
            margin-bottom: 12px;
        }

        .field-label {
            font-size: 12px;
            color: var(--text-muted);
            margin-bottom: 4px;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .field-value {
            font-size: 14px;
            color: var(--text-primary);
            line-height: 1.4;
        }

        .patient-notes {
            font-style: italic;
            color: var(--text-secondary);
        }

        .patient-stats-row {
            display: flex;
            gap: 24px;
            margin: 12px 0;
        }

        .patient-stat {
            flex: 1;
        }

        /* Patient Menu Dropdown */
        .patient-menu-dropdown {
            background: var(--surface-solid);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            box-shadow: var(--shadow-lg);
            min-width: 150px;
            overflow: hidden;
        }

        .menu-item {
            padding: 12px 16px;
            cursor: pointer;
            transition: var(--transition);
            font-size: 14px;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .menu-item:hover {
            background: var(--surface-elevated);
        }

        .menu-item i {
            width: 16px;
            color: var(--text-secondary);
        }

        .patient-header {
            display: flex;
            justify-content: space-between;
            align-items: start;
            margin-bottom: 20px;
        }

        .patient-name {
            font-size: 20px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 4px;
        }

        .patient-age {
            font-size: 14px;
            color: var(--text-secondary);
            font-weight: 500;
        }

        .patient-condition {
            display: inline-block;
            padding: 4px 12px;
            background: var(--surface-elevated);
            color: var(--primary);
            border-radius: 16px;
            font-size: 12px;
            font-weight: 600;
            border: 1px solid var(--border-light);
        }

        .patient-stats {
            display: flex;
            gap: 24px;
            margin-top: 20px;
            padding-top: 20px;
            border-top: 1px solid var(--border-light);
        }

        .stat {
            flex: 1;
        }

        .stat-label {
            font-size: 12px;
            color: var(--text-muted);
            margin-bottom: 4px;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .stat-value {
            font-size: 18px;
            font-weight: 600;
            color: var(--text-primary);
        }

        /* Goal Progress Indicators */
        .goal-progress {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-top: 8px;
        }

        .goal-indicator {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: #E5E7EB;
            transition: all 0.2s ease;
        }

        .goal-indicator.completed {
            background: #10B981;
        }

        .goal-indicator.current {
            background: #3B82F6;
            box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
        }

        .activity-indicator {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 12px;
            color: var(--text-muted);
        }

        .activity-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
        }

        .activity-dot.recent {
            background: var(--success);
        }

        .activity-dot.moderate {
            background: var(--warning);
        }

        .activity-dot.inactive {
            background: var(--border);
        }

        .activity-dot.high {
            background: var(--success);
        }

        .activity-dot.medium {
            background: var(--warning);
        }

        .activity-dot.low {
            background: var(--border);
        }

        /* Progress Bar */
        .progress-bar {
            width: 100%;
            height: 4px;
            background: var(--border-light);
            border-radius: 2px;
            overflow: hidden;
            margin-top: 8px;
        }

        .progress-fill {
            height: 100%;
            background: var(--primary);
            border-radius: 2px;
            transition: width 0.3s ease;
        }

        /* Patient Actions */
        .patient-actions {
            display: flex;
            gap: 8px;
            margin-top: 20px;
            padding-top: 20px;
            border-top: 1px solid var(--border-light);
        }

        .action-btn {
            flex: 1;
            padding: 10px 16px;
            border: 1px solid var(--border);
            background: var(--surface-solid);
            color: var(--text-secondary);
            border-radius: var(--radius-md);
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }

        .action-btn:hover {
            background: var(--surface-elevated);
            color: var(--text-primary);
            transform: translateY(-1px);
        }

        .action-btn.primary {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
        }

        .action-btn.primary:hover {
            background: var(--primary-dark);
            border-color: var(--primary-dark);
        }

        .next-appointment {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-top: 20px;
            padding-top: 20px;
            border-top: 1px solid var(--border-light);
            font-size: 14px;
            font-weight: 500;
            color: var(--text-secondary);
        }

        .appointment-icon {
            color: var(--primary);
            font-size: 16px;
        }

        /* Patient View - New Two Panel Layout */
        .patient-view {
            display: none;
            height: calc(100vh - 60px);
            overflow: hidden;
            animation: fadeIn 0.3s ease;
        }
        
        /* When patient view is active, prevent body scrolling */
        body.patient-view-active {
            overflow: hidden !important;
        }

        .two-panel-container {
            display: flex;
            height: 100%;
            width: 100%;
        }

        /* ==================== REFERRAL DASHBOARD STYLES ==================== */
        
        .referral-container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 40px 20px;
        }

        .referral-header {
            text-align: center;
            margin-bottom: 40px;
        }

        .referral-title {
            font-size: 32px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 10px;
        }

        .referral-subtitle {
            font-size: 16px;
            color: var(--text-secondary);
        }

        /* Registration Card */
        .referral-card {
            background: white;
            border: 1.5px solid var(--border-light);
            border-radius: 20px;
            padding: 40px;
            text-align: center;
            max-width: 500px;
            margin: 0 auto;
        }

        .referral-card-icon {
            width: 80px;
            height: 80px;
            background: rgba(59, 130, 246, 0.1);
            border: 1.5px solid var(--primary);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 20px;
            font-size: 32px;
            color: var(--primary);
        }

        .referral-card h2 {
            font-size: 24px;
            font-weight: 600;
            margin-bottom: 10px;
            color: var(--text-primary);
        }

        .referral-card p {
            color: var(--text-secondary);
            margin-bottom: 30px;
        }

        .referral-register-btn {
            background: var(--primary);
            color: white;
            border: none;
            padding: 12px 30px;
            border-radius: 25px;
            font-size: 16px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .referral-register-btn:hover {
            background: #2563eb;
            transform: translateY(-2px);
        }

        /* Referral Stats */
        .referral-stats-container {
            max-width: 1000px;
            margin: 0 auto;
        }

        .referral-link-card {
            background: white;
            border: 1.5px solid var(--border-light);
            border-radius: 20px;
            padding: 30px;
            margin-bottom: 30px;
        }

        .referral-link-card h3 {
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 15px;
            color: var(--text-primary);
        }

        .referral-link-box {
            display: flex;
            gap: 10px;
            margin-bottom: 10px;
        }

        .referral-link-input {
            flex: 1;
            padding: 12px;
            border: 1.5px solid var(--border-light);
            border-radius: 12px;
            font-size: 14px;
            background: #f9fafb;
        }

        .copy-link-btn {
            background: white;
            color: var(--primary);
            border: 1.5px solid var(--primary);
            padding: 12px 20px;
            border-radius: 12px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .copy-link-btn:hover {
            background: var(--primary);
            color: white;
        }

        .referral-code-text {
            font-size: 14px;
            color: var(--text-secondary);
        }

        .referral-code-text span {
            font-weight: 600;
            color: var(--primary);
        }

        /* Stats Grid */
        .referral-stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }

        .stat-card {
            background: white;
            border: 1.5px solid var(--border-light);
            border-radius: 20px;
            padding: 25px;
            text-align: center;
        }

        .stat-icon {
            width: 50px;
            height: 50px;
            background: rgba(59, 130, 246, 0.1);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 15px;
            font-size: 20px;
            color: var(--primary);
        }

        .stat-value {
            font-size: 28px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 5px;
        }

        .stat-label {
            font-size: 14px;
            color: var(--text-secondary);
        }

        /* Templates */
        .referral-templates {
            background: white;
            border: 1.5px solid var(--border-light);
            border-radius: 20px;
            padding: 30px;
            margin-bottom: 30px;
        }

        .referral-templates h3 {
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 20px;
            color: var(--text-primary);
        }

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

        .template-card {
            border: 1.5px solid var(--border-light);
            border-radius: 15px;
            padding: 20px;
        }

        .template-card h4 {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 10px;
            color: var(--text-primary);
        }

        .template-text {
            font-size: 14px;
            line-height: 1.6;
            color: var(--text-secondary);
            margin-bottom: 15px;
            white-space: pre-line;
        }

        .copy-template-btn {
            background: white;
            color: var(--primary);
            border: 1.5px solid var(--primary);
            padding: 8px 16px;
            border-radius: 10px;
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .copy-template-btn:hover {
            background: var(--primary);
            color: white;
        }

        /* Payment Info */
        .referral-payment-info {
            background: white;
            border: 1.5px solid var(--border-light);
            border-radius: 20px;
            padding: 30px;
            margin-bottom: 30px;
        }

        .referral-payment-info h3 {
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 20px;
            color: var(--text-primary);
        }

        .payment-info-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
        }

        .payment-step {
            text-align: center;
        }

        .step-number {
            width: 40px;
            height: 40px;
            background: var(--primary);
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 10px;
            font-size: 18px;
            font-weight: 600;
        }

        .payment-step p {
            font-size: 14px;
            color: var(--text-secondary);
            line-height: 1.4;
        }

        /* Left Sidebar */
        .left-sidebar {
            width: 355px;
            background: var(--surface-solid);
            border-right: 1px solid var(--border);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .sidebar-header {
            padding: 16px;
            border-bottom: 1px solid var(--border);
            background: var(--background);
        }

        .start-visit-btn {
            width: 100%;
            padding: 12px;
            background: transparent;
            color: var(--primary);
            border: 2px solid var(--primary);
            border-radius: var(--radius-md);
            font-weight: 600;
            font-size: 14px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            margin-bottom: 12px;
            transition: var(--transition);
        }

        .start-visit-btn:hover {
            background: rgba(37, 99, 235, 0.08);
            border-color: var(--primary-dark);
            color: var(--primary-dark);
        }

        .sidebar-header .search-container {
            position: relative;
        }

        .sidebar-header .search-input {
            width: 100%;
            padding: 8px 12px 8px 36px;
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            font-size: 14px;
            background: var(--background);
        }

        .sidebar-header .search-icon {
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-muted);
            font-size: 14px;
        }

        .session-list {
            flex: 1;
            overflow-y: auto;
            padding: 8px;
        }

        .session-item {
            margin-bottom: 8px;
            cursor: pointer;
        }

        .session-card {
            padding: 12px;
            background: var(--background);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            transition: var(--transition);
        }

        .session-card:hover {
            background: var(--surface-elevated);
            border-color: var(--primary);
        }

        .session-item.selected .session-card {
            background: rgba(37, 99, 235, 0.1);
            border-color: var(--primary);
            box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
        }

        .session-item.selected .session-card:hover {
            background: rgba(37, 99, 235, 0.15);
        }

        .session-title {
            font-weight: 600;
            font-size: 14px;
            color: var(--text-primary);
            margin-bottom: 4px;
        }

        .session-date-row {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 6px;
        }

        .session-date {
            font-size: 12px;
            color: var(--text-secondary);
        }

        .session-duration {
            font-size: 11px;
            color: var(--text-muted);
            background: var(--surface-elevated);
            padding: 2px 8px;
            border-radius: 12px;
            font-weight: 500;
        }

        .session-cue-count {
            font-size: 11px;
            color: var(--primary);
            background: rgba(37, 99, 235, 0.1);
            padding: 2px 8px;
            border-radius: 12px;
            font-weight: 500;
            margin-left: 4px;
        }

        .session-summary {
            font-size: 12px;
            color: var(--text-muted);
            line-height: 1.4;
        }

        .loading-session .session-card {
            background: var(--surface-elevated);
            border-color: var(--primary);
            position: relative;
            overflow: hidden;
        }

        .loading-session .session-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
            animation: shimmer 1.5s infinite;
        }

        @keyframes shimmer {
            0% { left: -100%; }
            100% { left: 100%; }
        }

        .loading-session .session-title {
            color: var(--primary);
        }

        .loading-session .session-date {
            color: var(--text-secondary);
        }

        .loading-session .session-summary {
            color: var(--text-muted);
        }

        /* Main Content Area */
        .main-content-area {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            background: var(--background);
        }

        .patient-info-bar {
            padding: 16px 24px;
            background: var(--surface-solid);
            border-bottom: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .patient-header-content {
            display: flex;
            align-items: center;
            gap: 16px;
        }

        /* Template Picker Styles */
        .template-picker-container {
            position: relative;
        }

        .template-picker-button {
            display: flex;
            align-items: center;
            padding: 5px 10px;
            min-width: 120px;
            background: transparent;
            border: 1px solid rgba(0, 0, 0, 0.12);
            border-radius: 6px;
            color: var(--text-muted);
            font-size: 13px;
            font-weight: 400;
            cursor: pointer;
            transition: all 0.15s ease;
        }

        .template-picker-button:hover {
            background: rgba(0, 0, 0, 0.03);
            border-color: rgba(0, 0, 0, 0.2);
            color: var(--text-color);
        }

        .template-picker-label {
            margin-right: 6px;  
            font-weight: 400;
            font-size: 13px;
            letter-spacing: 0;
            line-height: 1.4;
            flex: 1;
        }

        .template-picker-arrow {
            font-size: 11px;
            transition: transform 0.2s ease;
            opacity: 0.5;
            color: var(--text-muted);
        }

        .template-picker-button.open .template-picker-arrow {
            transform: rotate(180deg);
        }

        .template-picker-dropdown {
            position: absolute;
            top: calc(100% + 8px);
            right: 0;
            min-width: 280px;
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 12px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
            z-index: 1000;
            overflow: hidden;
            animation: templateDropdownSlide 0.2s ease;
        }

        @keyframes templateDropdownSlide {
            from {
                opacity: 0;
                transform: translateY(-8px) scale(0.95);
            }
            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        .template-option {
            padding: 12px 16px;
            cursor: pointer;
            transition: all 0.15s ease;
            border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        }

        .template-option:last-child {
            border-bottom: none;
        }

        .template-option:hover {
            background: rgba(59, 130, 246, 0.08);
        }

        .template-option.selected {
            background: rgba(59, 130, 246, 0.12);
            border-left: 3px solid var(--primary-color);
        }

        .template-name {
            font-weight: 600;
            font-size: 14px;
            color: var(--text-color);
            margin-bottom: 2px;
        }

        .template-description {
            font-size: 12px;
            color: var(--text-muted);
            line-height: 1.3;
        }

        /* Template Regeneration Loading */
        .regenerating-loading {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 60px 20px;
            color: var(--text-muted);
        }

        .regenerating-loading .loading-spinner {
            width: 32px;
            height: 32px;
            border: 3px solid rgba(59, 130, 246, 0.2);
            border-top: 3px solid var(--primary-color);
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-bottom: 16px;
        }

        .regenerating-loading .loading-text {
            text-align: center;
        }

        .regenerating-loading .loading-text > div:first-child {
            font-weight: 600;
            font-size: 16px;
            color: var(--text-color);
            margin-bottom: 8px;
        }

        .regenerating-loading .loading-subtext {
            font-size: 14px;
            color: var(--text-muted);
        }

        .patient-info {
            display: flex;
            align-items: center;
            gap: 16px;
        }

        /* Cue Tracking Styles */
        .cue-tracking {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 14px;
            color: var(--text-secondary);
            margin-top: 2px;
        }

        .cue-tracking i {
            font-size: 12px;
            color: var(--primary);
            opacity: 0.7;
        }

        .cue-summary {
            font-weight: 500;
            cursor: pointer;
            transition: color 0.2s ease;
            text-decoration: underline;
            text-decoration-style: dotted;
            text-underline-offset: 2px;
        }

        .cue-summary:hover {
            color: var(--primary);
        }

        .cue-breakdown {
            font-size: 13px;
            color: var(--text-muted);
            opacity: 0;
            transition: opacity 0.2s ease;
        }

        .patient-info-bar:hover .cue-breakdown {
            opacity: 1;
        }

        /* Session action buttons - Apple-inspired design */
        .session-actions {
            display: flex;
            gap: 8px;
            align-items: center;
            flex-shrink: 0;
        }
        
        /* Target buttons more specifically */
        #session-actions button.action-btn {
            flex: 0 0 auto !important;
            width: auto !important;
            min-width: 0 !important;
        }

        .session-actions .action-btn {
            padding: 6px 8px !important;
            background: transparent !important;
            color: var(--text-secondary);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            font-size: 13px !important;
            font-weight: 500;
            cursor: pointer;
            display: inline-flex !important;
            align-items: center;
            gap: 6px;
            transition: all 0.15s ease;
            white-space: nowrap;
            height: auto !important;
            line-height: 1.4;
            flex: 0 0 auto !important;
            width: auto !important;
            min-width: auto !important;
            max-width: none !important;
        }

        .session-actions .action-btn:hover {
            background: rgba(0, 0, 0, 0.03) !important;
            border-color: var(--text-secondary);
            color: var(--text-primary);
        }

        .session-actions .action-btn.magic-edit-btn {
            color: var(--primary);
            border-color: var(--primary);
        }

        .session-actions .action-btn.magic-edit-btn:hover {
            background: rgba(37, 99, 235, 0.06) !important;
            border-color: var(--primary-dark);
            color: var(--primary-dark);
        }

        .session-actions .action-btn i {
            font-size: 13px;
        }

        /* Inline recording controls in patient bar */
        .recording-controls-inline {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .recording-timer {
            font-family: 'SF Mono', 'Monaco', monospace;
            font-size: 16px;
            font-weight: 600;
            color: var(--text);
            min-width: 60px;
            text-align: center;
        }
        
        .audio-meter {
            display: inline-flex;
            gap: 2px;
            align-items: center;
            height: 20px;
            margin: 0 12px;
        }
        
        .audio-bar {
            width: 4px;
            min-height: 6px;
            height: 6px;
            background: rgba(16, 185, 129, 0.4);
            border-radius: 1px;
            transition: height 0.12s cubic-bezier(0.4, 0, 0.2, 1), background 0.12s ease;
            transform-origin: bottom;
            border: 1px solid rgba(16, 185, 129, 0.2);
        }
        
        .audio-bar.active {
            height: 20px;
            background: #10b981;
            border-color: #10b981;
        }

        .control-btn-inline {
            padding: 6px 16px;
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            background: white;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .control-btn-inline:hover {
            background: var(--surface);
            border-color: var(--primary);
        }

        .control-btn-inline.pause {
            color: var(--text);
        }

        .control-btn-inline.resume {
            color: var(--primary);
        }

        .control-btn-inline.end-visit {
            background: var(--error);
            color: white;
            border-color: var(--error);
        }

        .control-btn-inline.end-visit:hover {
            background: #dc2626;
            border-color: #dc2626;
            transform: translateY(-1px);
            box-shadow: var(--shadow-md);
        }

        .patient-info span:first-child {
            font-size: 20px;
            font-weight: 600;
            color: var(--text-primary);
        }

        .patient-meta {
            font-size: 14px;
            color: var(--text-secondary);
        }

        .content-container {
            flex: 1;
            overflow: hidden;
            position: relative;
        }

        .content-state {
            height: 100%;
            overflow-y: auto;
            padding: 24px 64px; /* More margin like Freed */
        }

        /* State 1: Past Session View */
        .session-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
        }

        .session-header h2 {
            font-size: 24px;
            font-weight: 600;
            color: var(--text-primary);
        }

        .copy-all-btn {
            padding: 8px 16px;
            background: var(--surface-elevated);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            color: var(--text-primary);
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: var(--transition);
        }

        .copy-all-btn:hover {
            background: var(--surface-solid);
            border-color: var(--primary);
        }

        .soap-sections {
            display: flex;
            flex-direction: column;
            gap: 16px;
            max-width: 900px; /* Limit width like Freed */
            margin: 0 auto;
        }

        .soap-section {
            background: var(--surface-solid);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            overflow: hidden;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        }

        .soap-section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 24px;
            background: var(--surface-elevated);
            border-bottom: 1px solid var(--border-light);
            cursor: pointer;
            transition: var(--transition);
        }

        .soap-section-header:hover {
            background: var(--surface-solid);
        }

        .soap-section-header h3 {
            font-size: 18px;
            font-weight: 700;
            color: var(--text-primary);
            margin: 0;
            letter-spacing: -0.02em;
        }

        .section-controls {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .copy-btn {
            padding: 6px 12px;
            background: var(--background);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            color: var(--text-secondary);
            font-size: 12px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 6px;
            transition: var(--transition);
        }

        .copy-btn:hover {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
        }

        .transcript-toggle-btn {
            padding: 6px 12px;
            background: var(--surface-elevated);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            color: var(--text-secondary);
            font-size: 12px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 6px;
            transition: var(--transition);
            margin-right: 8px;
        }

        .transcript-toggle-btn:hover {
            background: var(--secondary);
            color: white;
            border-color: var(--secondary);
        }

        .section-arrow {
            color: var(--text-muted);
            font-size: 14px;
            transition: transform 0.2s ease;
        }

        .soap-content-wrapper {
            overflow: hidden;
            transition: max-height 0.3s ease;
            max-height: 0;
        }

        .soap-content-wrapper.expanded {
            max-height: 1000px; /* Large enough for any content */
        }

        .soap-content {
            padding: 24px;
            color: var(--text-primary);
            line-height: 1.65;
            font-size: 15px;
            font-weight: 400;
            border: none;
            outline: none;
            background: transparent;
            width: 100%;
            min-height: 80px;
        }

        .soap-content.editable {
            border-radius: var(--radius-sm);
            transition: var(--transition);
        }

        .soap-content.editable:hover {
            background: var(--surface-elevated);
        }

        .soap-content.editable:focus {
            background: var(--background);
            box-shadow: inset 0 0 0 2px var(--primary);
        }

        /* State 2: New Visit View */
        .new-visit-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
        }

        .new-visit-header h2 {
            font-size: 24px;
            font-weight: 600;
            color: var(--text-primary);
        }

        .capture-btn {
            padding: 12px 20px;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: var(--radius-md);
            font-weight: 600;
            font-size: 14px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: var(--transition);
        }

        .capture-btn:hover {
            background: var(--primary-dark);
        }

        .new-visit-content {
            display: flex;
            align-items: center;
            justify-content: center;
            height: calc(100% - 80px);
        }

        .empty-state {
            text-align: center;
            color: var(--text-secondary);
        }

        .empty-state h3 {
            margin: 16px 0 8px;
            color: var(--text-primary);
        }

        /* State 3: Recording View */
        .recording-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
        }

        .recording-header h2 {
            font-size: 24px;
            font-weight: 600;
            color: var(--text-primary);
        }

        .recording-controls {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .control-btn {
            padding: 8px 16px;
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: var(--transition);
        }

        .control-btn.end-visit {
            background: var(--error);
            color: white;
            border-color: var(--error);
        }

        .control-btn.pause,
        .control-btn.resume {
            background: var(--surface-elevated);
            color: var(--text-primary);
        }

        .control-btn.mic-btn {
            background: var(--surface-elevated);
            color: var(--text-primary);
        }

        .control-btn:hover {
            opacity: 0.9;
        }

        .recording-status {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 16px;
            padding: 12px;
            background: var(--surface-elevated);
            border-radius: var(--radius-md);
        }

        .recording-indicator {
            width: 12px;
            height: 12px;
            background: var(--error);
            border-radius: 50%;
            animation: pulse 1.5s infinite;
        }

        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }

        /* Recording Complete Options */
        .recording-complete-options {
            text-align: center;
            padding: 40px 20px;
        }

        .recording-complete-header h3 {
            color: var(--text-primary);
            font-size: 20px;
            margin-bottom: 8px;
        }

        .recording-complete-header p {
            color: var(--text-secondary);
            margin-bottom: 32px;
        }

        .recording-complete-actions {
            display: flex;
            gap: 16px;
            justify-content: center;
            flex-wrap: wrap;
        }

        .action-btn {
            display: flex;
            align-items: center;
            gap: 16px;
            padding: 16px 20px;
            border-radius: var(--radius-md);
            border: 1px solid var(--border);
            background: var(--surface-solid);
            cursor: pointer;
            transition: var(--transition);
            text-align: left;
            min-width: 200px;
        }

        .action-btn.primary {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
        }

        .action-btn.primary:hover {
            background: var(--primary-dark);
        }

        .action-btn.secondary:hover {
            background: var(--surface-elevated);
            border-color: var(--primary);
        }

        .action-btn i {
            font-size: 20px;
            flex-shrink: 0;
        }

        .action-title {
            font-weight: 600;
            font-size: 14px;
            margin-bottom: 4px;
        }

        .action-subtitle {
            font-size: 12px;
            opacity: 0.8;
        }

        .action-btn.secondary .action-title,
        .action-btn.secondary .action-subtitle {
            color: var(--text-primary);
        }

        /* AI Assistant Panel (Collapsible) */
        .ai-assistant-container {
            position: fixed;
            top: 60px;
            right: 0;
            height: calc(100vh - 60px);
            z-index: 100;
            pointer-events: none;
        }

        .ai-assistant-tab {
            position: absolute;
            top: 50%;
            right: 0;
            transform: translateY(-50%);
            width: 30px;
            height: 60px;
            background: var(--primary);
            color: white;
            border-radius: var(--radius-md) 0 0 var(--radius-md);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            pointer-events: all;
            font-size: 16px;
            transition: var(--transition);
            box-shadow: var(--shadow-md);
            z-index: 10;
        }

        .ai-assistant-tab:hover {
            background: var(--primary-dark);
        }

        .ai-assistant-panel {
            position: absolute;
            top: 0;
            right: 0;
            width: 750px;
            height: 100%;
            background: var(--surface-solid);
            border-left: 1px solid var(--border);
            transform: translateX(100%);
            transition: transform 0.3s ease;
            pointer-events: all;
            display: flex;
            flex-direction: column;
            box-shadow: var(--shadow-lg);
        }

        .ai-assistant-panel.open {
            transform: translateX(0);
        }

        .ai-assistant-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 16px;
            border-bottom: 1px solid var(--border);
            background: var(--surface-elevated);
        }

        .ai-assistant-title {
            display: flex;
            align-items: center;
            gap: 8px;
            font-weight: 600;
            color: var(--text-primary);
        }

        .ai-assistant-actions {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .close-assistant-btn,
        .clear-chat-btn {
            background: none;
            border: none;
            color: var(--text-secondary);
            cursor: pointer;
            padding: 8px;
            border-radius: var(--radius-sm);
            transition: var(--transition);
        }

        .close-assistant-btn:hover,
        .clear-chat-btn:hover {
            background: var(--surface-solid);
            color: var(--text-primary);
        }

        .clear-chat-btn {
            font-size: 14px;
        }

        /* Custom Confirmation Modal */
        .confirmation-modal {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: 10000;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .confirmation-modal-backdrop {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
        }

        .confirmation-modal-content {
            position: relative;
            background: var(--background);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-xl);
            max-width: 400px;
            width: 90%;
            padding: 24px;
            z-index: 1;
        }

        .confirmation-modal-header {
            margin-bottom: 16px;
        }

        .confirmation-modal-header h3 {
            margin: 0;
            font-size: 18px;
            font-weight: 600;
            color: var(--text-primary);
        }

        .confirmation-modal-body {
            margin-bottom: 24px;
        }

        .confirmation-modal-body p {
            margin: 0;
            color: var(--text-secondary);
            line-height: 1.5;
        }

        .confirmation-modal-actions {
            display: flex;
            gap: 12px;
            justify-content: flex-end;
        }

        .confirmation-modal-actions button {
            padding: 8px 16px;
            border-radius: var(--radius-md);
            font-weight: 500;
            transition: var(--transition);
        }

        .confirmation-modal-actions .btn-secondary {
            background: var(--surface-solid);
            border: 1px solid var(--border);
            color: var(--text-secondary);
        }

        .confirmation-modal-actions .btn-secondary:hover {
            background: var(--surface-elevated);
            color: var(--text-primary);
        }

        .confirmation-modal-actions .btn-primary {
            background: var(--primary);
            border: none;
            color: white;
        }

        .confirmation-modal-actions .btn-primary:hover {
            background: var(--primary-hover);
        }
        
        .split-timeline-container {
            display: flex;
            height: calc(100vh - 160px);
            gap: 24px;
            margin-top: 16px;
        }
        
        .timeline-panel {
            flex: 2;
            display: flex;
            flex-direction: column;
            background: var(--surface-solid);
            border-radius: var(--radius-lg);
            border: 1px solid var(--border);
            overflow: hidden;
            box-shadow: var(--shadow-md);
        }
        
        .timeline-panel-header {
            padding: 20px 24px;
            border-bottom: 1px solid var(--border);
            background: var(--surface-elevated);
        }
        
        .timeline-panel-title {
            font-size: 18px;
            font-weight: 600;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .timeline-content-area {
            flex: 1;
            overflow-y: auto;
            padding: 0;
        }
        
        /* AI Assistant Panel - Complete Redesign */
        .ai-assistant-panel {
            flex: 0 0 750px;
            display: flex;
            flex-direction: column;
            background: var(--background);
            border-radius: var(--radius-lg);
            border: 1px solid var(--border);
            overflow: hidden;
            box-shadow: var(--shadow-sm);
            position: relative;
        }
        
        /* Header Section */
        .ai-assistant-header {
            padding: 20px 24px;
            border-bottom: 1px solid var(--border);
            background: var(--surface-solid);
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-shrink: 0;
        }
        
        .ai-assistant-title {
            font-size: 16px;
            font-weight: 600;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .ai-assistant-title i {
            color: var(--primary);
            font-size: 16px;
        }
        
        .clear-chat-btn {
            background: transparent;
            border: 1px solid var(--border);
            color: var(--text-secondary);
            cursor: pointer;
            padding: 6px 12px;
            border-radius: var(--radius-sm);
            font-size: 12px;
            transition: var(--transition);
            font-weight: 500;
        }
        
        .clear-chat-btn:hover {
            background: var(--error);
            color: white;
            border-color: var(--error);
        }
        
        /* Chat Container */
        .chat-container {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            position: relative;
        }
        
        /* Messages Area */
        .chat-messages {
            flex: 1;
            overflow-y: auto;
            padding: 24px;
            background: var(--background);
            display: flex;
            flex-direction: column;
            gap: 20px;
            scroll-behavior: smooth;
        }
        
        .chat-messages::-webkit-scrollbar {
            width: 6px;
        }
        
        .chat-messages::-webkit-scrollbar-track {
            background: var(--surface-solid);
        }
        
        .chat-messages::-webkit-scrollbar-thumb {
            background: var(--border);
            border-radius: 3px;
        }
        
        /* Message Styling */
        .chat-message {
            display: flex;
            gap: 12px;
            align-items: flex-start;
            animation: fadeIn 0.3s ease-in;
        }
        
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        .chat-message.user {
            flex-direction: row-reverse;
        }
        
        .chat-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            font-weight: 600;
            flex-shrink: 0;
        }
        
        .chat-avatar.ai {
            background: linear-gradient(135deg, var(--primary), var(--primary-dark));
            color: white;
            box-shadow: 0 2px 8px rgba(43, 100, 245, 0.3);
        }
        
        .chat-avatar.user {
            background: var(--surface-elevated);
            color: var(--text-primary);
            border: 2px solid var(--border);
        }
        
        .chat-bubble {
            max-width: 75%;
            padding: 14px 18px;
            border-radius: 18px;
            font-size: 14px;
            line-height: 1.6;
            word-wrap: break-word;
        }
        
        .chat-bubble.ai {
            background: var(--surface-solid);
            border: 1px solid var(--border);
            color: var(--text-primary);
            border-top-left-radius: 4px;
            max-width: 90%;
            position: relative;
        }
        
        .chat-bubble.user {
            background: var(--primary);
            color: white;
            border-top-right-radius: 4px;
            box-shadow: 0 2px 8px rgba(43, 100, 245, 0.2);
        }
        
        /* Chat message content formatting */
        .chat-bubble h3,
        .chat-bubble h4,
        .chat-bubble h5 {
            margin: 0 0 8px 0;
            font-weight: 600;
            line-height: 1.3;
        }
        
        .chat-bubble h3 {
            font-size: 16px;
        }
        
        .chat-bubble h4 {
            font-size: 15px;
        }
        
        .chat-bubble h5 {
            font-size: 14px;
        }
        
        .chat-bubble ul {
            margin: 8px 0;
            padding-left: 20px;
            list-style-type: disc;
        }
        
        .chat-bubble li {
            margin: 2px 0;
            line-height: 1.5;
        }
        
        .chat-bubble strong {
            font-weight: 600;
            color: var(--text-primary);
        }
        
        /* Copy button for AI messages */
        .chat-message.ai {
            position: relative;
        }
        
        .copy-button {
            position: absolute;
            top: 8px;
            right: 8px;
            background: var(--surface-elevated);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            padding: 4px 8px;
            font-size: 12px;
            color: var(--text-secondary);
            cursor: pointer;
            opacity: 0;
            transition: opacity 0.2s ease, background 0.2s ease;
            display: flex;
            align-items: center;
            gap: 4px;
        }
        
        .chat-message.ai:hover .copy-button {
            opacity: 1;
        }
        
        .copy-button:hover {
            background: var(--surface-solid);
            color: var(--text-primary);
        }
        
        .copy-button.copied {
            color: var(--success);
        }
        
        .copy-button i {
            font-size: 10px;
        }
        
        /* Input Section */
        .chat-input-section {
            border-top: 1px solid var(--border);
            background: var(--surface-solid);
            padding: 20px;
            flex-shrink: 0;
        }
        
        /* Quick Prompts */
        .quick-prompts {
            display: flex;
            gap: 8px;
            margin-bottom: 12px;
            flex-wrap: wrap;
        }
        
        .quick-prompt {
            padding: 8px 14px;
            background: var(--background);
            border: 1px solid var(--border);
            border-radius: 20px;
            font-size: 12px;
            cursor: pointer;
            transition: var(--transition);
            color: var(--text-secondary);
            font-weight: 500;
            white-space: nowrap;
        }
        
        .quick-prompt:hover {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
            transform: translateY(-1px);
        }
        
        /* Input Wrapper */
        .chat-input-wrapper {
            display: flex;
            gap: 12px;
            align-items: flex-end;
        }
        
        .chat-input {
            flex: 1;
            min-height: 44px;
            max-height: 120px;
            padding: 12px 16px;
            border: 2px solid var(--border);
            border-radius: 22px;
            font-size: 14px;
            font-family: inherit;
            resize: none;
            background: var(--background);
            transition: var(--transition);
            line-height: 1.5;
            overflow-y: auto;
        }
        
        .chat-input:focus {
            outline: none;
            border-color: var(--primary);
            background: white;
        }
        
        .chat-input::placeholder {
            color: var(--text-muted);
        }
        
        .chat-send-btn {
            width: 44px;
            height: 44px;
            padding: 0;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 50%;
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            box-shadow: 0 2px 8px rgba(43, 100, 245, 0.3);
        }
        
        .chat-send-btn:hover:not(:disabled) {
            background: var(--primary-dark);
            transform: scale(1.05);
            box-shadow: 0 4px 12px rgba(43, 100, 245, 0.4);
        }
        
        .chat-send-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            box-shadow: none;
        }
        
        .chat-send-btn i {
            font-size: 18px;
        }
        
        /* Welcome Message */
        .chat-welcome {
            padding: 40px 24px;
            text-align: center;
            color: var(--text-muted);
        }
        
        .chat-welcome h3 {
            font-size: 18px;
            margin-bottom: 12px;
            color: var(--text-primary);
            font-weight: 600;
        }
        
        .chat-welcome p {
            font-size: 14px;
            line-height: 1.6;
            max-width: 280px;
            margin: 0 auto;
        }
        
        /* Terms Acceptance Styling */
        .checkbox-container:hover {
            border-color: var(--primary) !important;
            background: var(--hover) !important;
        }
        
        #accept-policies {
            accent-color: var(--primary);
        }
        
        #accept-policies:checked {
            background-color: var(--primary);
        }
        
        #continue-signup-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        
        #continue-signup-btn:not(:disabled):hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
        }
        
        /* AI Response Formatting */
        .chat-bubble.ai h3 {
            font-size: 15px;
            font-weight: 600;
            margin: 0 0 8px 0;
            color: var(--text-primary);
        }
        
        .chat-bubble.ai ul, .chat-bubble.ai ol {
            margin: 8px 0;
            padding-left: 20px;
        }
        
        .chat-bubble.ai li {
            margin: 4px 0;
        }
        
        .chat-bubble.ai p {
            margin: 8px 0;
        }
        
        .chat-bubble.ai p:last-child {
            margin-bottom: 0;
        }
        
        /* Loading State */
        .chat-loading {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 12px 16px;
            color: var(--text-muted);
            font-size: 14px;
        }
        
        .chat-loading i {
            animation: spin 1s linear infinite;
        }
        
        @keyframes spin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }
        
        /* Typing Indicator */
        .typing-dots {
            display: flex;
            gap: 4px;
            padding: 2px 0;
        }
        
        .typing-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--text-muted);
            animation: typingDot 1.4s infinite;
        }
        
        .typing-dot:nth-child(2) { animation-delay: 0.2s; }
        .typing-dot:nth-child(3) { animation-delay: 0.4s; }
        
        @keyframes typingDot {
            0%, 60%, 100% { 
                opacity: 0.3;
                transform: scale(0.8);
            }
            30% { 
                opacity: 1;
                transform: scale(1);
            }
        }
        
        /* Responsive Design */
        @media (max-width: 1024px) {
            .split-timeline-container {
                flex-direction: column;
                height: auto;
            }
            
            .timeline-panel {
                flex: none;
                height: 400px;
            }
            
            .ai-assistant-panel {
                flex: 1;
                min-width: auto;
                max-width: none;
                height: 500px;
            }
        }

        .back-button {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 8px 16px;
            background: var(--surface-solid);
            border: 1px solid var(--border);
            border-radius: 24px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            color: var(--text-secondary);
            margin-bottom: 24px;
            transition: var(--transition);
            text-decoration: none;
        }

        .back-button:hover {
            background: var(--surface-elevated);
            color: var(--text-primary);
            transform: translateX(-2px);
        }

        .patient-detail-header {
            background: var(--surface-solid);
            border-radius: var(--radius-md);
            padding: 16px 20px;
            margin-bottom: 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border: 1px solid var(--border);
            box-shadow: var(--shadow-sm);
        }

        .patient-detail-info h2 {
            font-size: 20px;
            margin-bottom: 4px;
            font-weight: 600;
            letter-spacing: -0.025em;
        }

        .patient-detail-meta {
            display: flex;
            gap: 12px;
            color: var(--text-secondary);
            margin-top: 4px;
            font-weight: 500;
            font-size: 13px;
        }

        .record-button {
            padding: 12px 24px;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: var(--radius-md);
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: var(--transition);
            box-shadow: var(--shadow-sm);
        }

        .record-button:hover {
            background: var(--primary-dark);
            transform: translateY(-1px);
            box-shadow: var(--shadow-md);
        }

        .record-button.recording {
            background: var(--error);
            animation: pulse 2s infinite;
        }

        .record-button.paused {
            background: var(--warning);
        }

        @keyframes pulse {
            0% { opacity: 1; }
            50% { opacity: 0.8; }
            100% { opacity: 1; }
        }

        /* Live Recording Interface */
        .recording-interface {
            display: none;
            background: var(--surface-solid);
            border-radius: var(--radius-lg);
            border: 1px solid var(--border);
            box-shadow: var(--shadow-sm);
            margin-bottom: 32px;
            overflow: hidden;
            animation: slideIn 0.3s ease;
        }

        .recording-interface.active {
            display: block;
        }

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

        .recording-header {
            padding: 20px 24px;
            border-bottom: 1px solid var(--border-light);
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: var(--surface-elevated);
        }

        .recording-status {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .recording-indicator {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--error);
            animation: pulse 2s infinite;
        }

        .recording-indicator.paused {
            background: var(--warning);
            animation: none;
        }

        .recording-time {
            font-size: 16px;
            font-weight: 600;
            color: var(--text-primary);
            font-variant-numeric: tabular-nums;
        }

        .recording-controls {
            display: flex;
            gap: 8px;
        }

        .control-button {
            padding: 6px 12px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 4px;
            background: var(--surface-solid);
        }

        .control-button.pause {
            color: var(--warning);
            border-color: var(--warning);
        }

        .control-button.resume {
            color: var(--success);
            border-color: var(--success);
        }

        .control-button.stop {
            color: var(--error);
            border-color: var(--error);
        }

        .control-button:hover {
            transform: translateY(-1px);
            box-shadow: var(--shadow-sm);
        }

        /* Live Transcript */
        .transcript-container {
            height: 400px;
            overflow-y: auto;
            padding: 24px;
            background: var(--background);
        }

        .transcript-message {
            margin-bottom: 12px;
            display: flex;
            justify-content: flex-start;
            animation: messageSlideIn 0.2s ease;
        }

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

        .message-bubble {
            max-width: 90%;
            padding: 12px 16px;
            border-radius: var(--radius-lg);
            font-size: 14px;
            line-height: 1.5;
            background: var(--surface-elevated);
            border: 1px solid var(--border-light);
            color: var(--text-primary);
        }

        .message-timestamp {
            font-size: 11px;
            color: var(--text-muted);
            margin-top: 4px;
            text-align: right;
        }

        .typing-indicator {
            display: none;
            padding: 12px 16px;
            background: var(--surface-elevated);
            border-radius: var(--radius-lg);
            border: 1px solid var(--border-light);
            max-width: 60px;
            margin-bottom: 12px;
        }

        .typing-indicator.active {
            display: block;
            animation: messageSlideIn 0.2s ease;
        }

        .typing-dots {
            display: flex;
            gap: 3px;
        }

        .typing-dot {
            width: 4px;
            height: 4px;
            border-radius: 50%;
            background: var(--text-muted);
            animation: typingDot 1.4s infinite;
        }

        .typing-dot:nth-child(2) { animation-delay: 0.2s; }
        .typing-dot:nth-child(3) { animation-delay: 0.4s; }

        @keyframes typingDot {
            0%, 60%, 100% { opacity: 0.3; }
            30% { opacity: 1; }
        }

        .transcript-empty {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100%;
            color: var(--text-muted);
            text-align: center;
        }

        .transcript-empty i {
            font-size: 32px;
            margin-bottom: 16px;
            opacity: 0.5;
        }

        /* Microphone Permission Alert */
        .permission-alert {
            background: #fef3c7;
            border: 1px solid #fbbf24;
            color: #92400e;
            padding: 16px;
            border-radius: var(--radius-md);
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .permission-alert i {
            font-size: 18px;
        }

        .permission-alert button {
            margin-left: auto;
            padding: 6px 12px;
            background: var(--warning);
            color: white;
            border: none;
            border-radius: var(--radius-sm);
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
        }

        /* Generate SOAP Button */
        .generate-soap-container {
            padding: 20px 24px;
            border-top: 1px solid var(--border-light);
            background: var(--surface-elevated);
            display: flex;
            justify-content: center;
        }

        .generate-soap-button {
            padding: 12px 24px;
            background: var(--success);
            color: white;
            border: none;
            border-radius: var(--radius-md);
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 8px;
            box-shadow: var(--shadow-sm);
        }

        .generate-soap-button:hover {
            background: #047857;
            transform: translateY(-1px);
            box-shadow: var(--shadow-md);
        }

        .generate-soap-button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none;
        }

        /* Timeline */
        .timeline {
            position: relative;
            padding: 20px 32px;
        }

        .timeline::before {
            content: '';
            position: absolute;
            left: 12px;
            top: 0;
            bottom: 0;
            width: 2px;
            background: var(--border);
        }

        .timeline-item {
            position: relative;
            background: var(--surface-solid);
            border-radius: var(--radius-lg);
            padding: 0;
            margin-bottom: 24px;
            border: 1px solid var(--border);
            box-shadow: var(--shadow-sm);
            transition: var(--transition);
            overflow: hidden;
        }

        .timeline-item:hover {
            box-shadow: var(--shadow-md);
        }

        .timeline-item::before {
            content: '';
            position: absolute;
            left: -26px;
            top: 32px;
            width: 8px;
            height: 8px;
            background: var(--primary);
            border-radius: 50%;
            border: 2px solid var(--background);
        }

        .timeline-header {
            padding: 20px 24px;
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid var(--border-light);
            background: var(--surface-elevated);
        }

        .timeline-header:hover {
            background: #f1f5f9;
        }

        .timeline-header-info {
            flex: 1;
        }

        .timeline-date {
            font-size: 12px;
            color: var(--text-muted);
            margin-bottom: 4px;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 6px;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .timeline-title {
            font-size: 18px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 4px;
        }

        .timeline-summary {
            font-size: 14px;
            color: var(--text-secondary);
            line-height: 1.4;
        }

        .timeline-toggle {
            color: var(--text-muted);
            font-size: 16px;
            transition: var(--transition);
            padding: 8px;
            border-radius: var(--radius-sm);
        }

        .timeline-toggle:hover {
            background: var(--border-light);
            color: var(--text-primary);
        }

        .timeline-content {
            padding: 24px;
            display: none;
            border-top: 1px solid var(--border-light);
        }

        .timeline-content.expanded {
            display: block;
            animation: expandContent 0.3s ease;
        }

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

        .session-transcript {
            background: var(--surface-elevated);
            border-radius: var(--radius-md);
            padding: 16px;
            margin-bottom: 20px;
            border: 1px solid var(--border-light);
        }

        .session-transcript h4 {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .session-transcript h4 i {
            color: var(--primary);
        }

        .transcript-text {
            font-size: 14px;
            color: var(--text-secondary);
            line-height: 1.6;
            max-height: 120px;
            overflow-y: auto;
        }

        /* Speaker Diarization Styles */
        .speaker-line {
            margin-bottom: 12px;
            padding: 8px 12px;
            border-radius: var(--radius-sm);
            background: var(--background);
            border-left: 3px solid var(--border);
        }

        .therapist-line {
            border-left-color: var(--primary);
            background: rgba(37, 99, 235, 0.05);
        }

        .patient-line {
            border-left-color: var(--success);
            background: rgba(5, 150, 105, 0.05);
        }

        .speaker-label {
            font-weight: 600;
            font-size: 13px;
            margin-right: 8px;
            display: inline-block;
            min-width: 70px;
        }

        .therapist-label {
            color: var(--primary);
        }

        .patient-label {
            color: var(--success);
        }

        .speaker-text {
            color: var(--text-primary);
            font-size: 14px;
            line-height: 1.5;
        }

        /* Transcript Content Specific Styling */
        .transcript-content {
            max-height: 300px;
            overflow-y: auto;
            padding: 16px;
            background: var(--surface-elevated);
            border-radius: var(--radius-md);
            border: 1px solid var(--border-light);
        }

        .transcript-content .speaker-line {
            margin-bottom: 8px;
            padding: 6px 10px;
        }

        /* Cues Used Section Styles */
        .cues-content {
            padding: 24px;
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .cue-type-group {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .cue-type-header {
            font-weight: 600;
            font-size: 14px;
            display: flex;
            align-items: center;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            opacity: 0.9;
        }

        .cue-examples {
            display: flex;
            flex-direction: column;
            gap: 8px;
            padding-left: 20px;
        }

        .cue-example {
            font-size: 14px;
            color: var(--text-secondary);
            line-height: 1.5;
            padding: 8px 12px;
            background: var(--surface-elevated);
            border-radius: var(--radius);
            border-left: 3px solid currentColor;
            opacity: 0.85;
            transition: opacity 0.2s ease;
        }

        .cue-example:hover {
            opacity: 1;
            background: var(--surface-solid);
        }

        /* Recording Status Display */
        .recording-status {
            text-align: center;
            padding: 40px 20px;
            color: var(--text-secondary);
        }

        .recording-status .recording-pulse {
            font-size: 48px;
            color: var(--primary);
            animation: pulse 2s infinite;
            margin-bottom: 16px;
        }

        .recording-status h3 {
            margin: 0 0 8px 0;
            color: var(--text-primary);
        }

        .recording-status p {
            margin: 0;
            font-size: 14px;
        }

        @keyframes pulse {
            0% { opacity: 1; transform: scale(1); }
            50% { opacity: 0.7; transform: scale(1.1); }
            100% { opacity: 1; transform: scale(1); }
        }

        /* Diarization Note in Recording Interface */
        .diarization-note {
            margin-top: 16px;
            padding: 8px 12px;
            background: rgba(37, 99, 235, 0.1);
            border: 1px solid rgba(37, 99, 235, 0.2);
            border-radius: var(--radius-sm);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .diarization-note i {
            color: var(--primary);
            font-size: 12px;
        }

        .diarization-note small {
            color: var(--text-secondary);
            font-size: 12px;
            line-height: 1.4;
        }

        .soap-note {
            background: var(--surface-elevated);
            border-radius: var(--radius-md);
            padding: 20px;
            border: 1px solid var(--border-light);
        }

        .soap-note-header {
            display: flex;
            justify-content: between;
            align-items: center;
            margin-bottom: 16px;
        }

        .soap-note h4 {
            font-size: 16px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 16px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .soap-note h4 i {
            color: var(--primary);
        }

        .soap-section {
            margin-bottom: 16px;
        }

        .soap-section:last-child {
            margin-bottom: 0;
        }

        .soap-section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 8px;
        }

        .soap-section strong {
            color: var(--primary);
            font-weight: 600;
            font-size: 12px;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .edit-button {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            padding: 4px;
            border-radius: var(--radius-sm);
            transition: var(--transition);
            font-size: 12px;
        }

        .edit-button:hover {
            background: var(--border-light);
            color: var(--primary);
        }

        .soap-text {
            font-size: 14px;
            color: var(--text-secondary);
            line-height: 1.6;
        }

        .soap-textarea {
            width: 100%;
            min-height: 60px;
            padding: 8px 12px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            font-size: 14px;
            font-family: inherit;
            line-height: 1.6;
            resize: vertical;
            background: var(--surface-solid);
        }

        .soap-textarea:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }

        .edit-actions {
            display: flex;
            gap: 8px;
            margin-top: 8px;
        }

        .edit-action-btn {
            padding: 4px 8px;
            border: none;
            border-radius: var(--radius-sm);
            font-size: 12px;
            font-weight: 500;
            cursor: pointer;
            transition: var(--transition);
        }

        .edit-action-btn.save {
            background: var(--success);
            color: white;
        }

        .edit-action-btn.cancel {
            background: var(--border-light);
            color: var(--text-secondary);
        }

        .edit-action-btn:hover {
            transform: translateY(-1px);
        }

        /* Modal Styles */
        .modal {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            opacity: 0;
            transition: opacity 0.2s ease;
        }

        .modal.active {
            display: flex;
            opacity: 1;
        }

        .modal-content {
            background: var(--surface-solid);
            border-radius: var(--radius-lg);
            padding: 32px;
            max-width: 700px;
            width: 90%;
            max-height: 80vh;
            overflow-y: auto;
            animation: modalSlideIn 0.3s ease;
            border: 1px solid var(--border);
            box-shadow: var(--shadow-xl);
            position: relative;
        }

        @keyframes modalSlideIn {
            from { transform: translateY(20px) scale(0.95); opacity: 0; }
            to { transform: translateY(0) scale(1); opacity: 1; }
        }

        .modal-title {
            font-size: 24px;
            font-weight: 700;
            margin-bottom: 24px;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .modal-title i {
            color: var(--primary);
        }

        .soap-preview {
            background: var(--surface-elevated);
            border-radius: var(--radius-md);
            padding: 20px;
            margin-bottom: 24px;
            border: 1px solid var(--border-light);
        }

        .soap-preview h3 {
            font-size: 16px;
            margin-bottom: 12px;
            color: var(--text-primary);
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .soap-preview h3 i {
            color: var(--primary);
            font-size: 14px;
        }

        .modal-actions {
            display: flex;
            gap: 12px;
            justify-content: flex-end;
        }

        .modal-button {
            padding: 10px 20px;
            border: none;
            border-radius: var(--radius-md);
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .modal-button.primary {
            background: var(--primary);
            color: white;
            box-shadow: var(--shadow-sm);
        }

        .modal-button.primary:hover {
            background: var(--primary-dark);
            transform: translateY(-1px);
            box-shadow: var(--shadow-md);
        }

        .modal-button.secondary {
            background: var(--surface-elevated);
            color: var(--text-primary);
            border: 1px solid var(--border);
        }

        .modal-button.secondary:hover {
            background: var(--border-light);
            transform: translateY(-1px);
        }

        /* Processing State */
        .processing-overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(255, 255, 255, 0.95);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            border-radius: var(--radius-lg);
            z-index: 10;
        }

        .processing-text {
            margin-top: 16px;
            color: var(--text-secondary);
            font-size: 16px;
            font-weight: 500;
        }

        /* Add Patient Button */
        .add-patient-btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 10px 20px;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: var(--radius-md);
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            box-shadow: var(--shadow-sm);
            white-space: nowrap;
        }

        .add-patient-btn:hover {
            background: var(--primary-dark);
            transform: translateY(-1px);
            box-shadow: var(--shadow-md);
        }

        /* Form Styles */
        .form-group {
            margin-bottom: 20px;
        }

        .form-label {
            display: block;
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 8px;
        }

        .form-input, .form-select {
            width: 100%;
            padding: 12px 16px;
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            font-size: 14px;
            font-family: inherit;
            transition: var(--transition);
            background: var(--surface-solid);
        }

        .form-input:focus, .form-select:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }

        .empty-state {
            text-align: center;
            padding: 60px 20px;
            color: var(--text-secondary);
            background: var(--surface-solid);
            border-radius: var(--radius-lg);
            border: 1px solid var(--border);
            box-shadow: var(--shadow-sm);
        }

        .empty-state h3 {
            font-size: 20px;
            color: var(--text-primary);
            margin-bottom: 12px;
            font-weight: 600;
        }

        .empty-state p {
            margin-bottom: 24px;
            font-size: 14px;
            max-width: 400px;
            margin-left: auto;
            margin-right: auto;
        }

        .empty-state-icon {
            font-size: 32px;
            color: var(--text-muted);
            margin-bottom: 16px;
            opacity: 0.6;
        }

        /* Toast */
        .toast {
            position: fixed;
            bottom: 24px;
            right: 24px;
            padding: 12px 20px;
            background: var(--surface-solid);
            border-radius: var(--radius-md);
            border: 1px solid var(--border);
            box-shadow: var(--shadow-lg);
            color: var(--text-primary);
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 8px;
            transform: translateY(100px);
            opacity: 0;
            transition: all 0.3s ease;
            z-index: 2000;
            font-size: 14px;
        }

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

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

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

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

        .toast.warning {
            border-left: 4px solid var(--warning);
        }

        .toast.warning i {
            color: var(--warning);
        }

        .toast.show {
            transform: translateY(0);
            opacity: 1;
        }

        /* Trial Banner Styles */
        .trial-banner {
            background: linear-gradient(135deg, #fef3c7 0%, #fbbf24 100%);
            border: 1px solid #f59e0b;
            margin: 0 20px 20px 20px;
            border-radius: var(--radius-lg);
            padding: 16px 20px;
            box-shadow: var(--shadow-sm);
        }

        .trial-banner-content {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 20px;
        }

        .trial-info {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .trial-icon {
            font-size: 20px;
            color: #92400e;
        }

        .trial-text {
            display: flex;
            flex-direction: column;
        }

        .trial-status {
            font-weight: 600;
            color: #92400e;
            font-size: 16px;
        }

        .trial-days {
            font-size: 14px;
            color: #a16207;
        }

        .trial-actions {
            display: flex;
            gap: 12px;
        }

        .trial-button {
            padding: 8px 16px;
            border: none;
            border-radius: var(--radius-md);
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .trial-button.secondary {
            background: rgba(255, 255, 255, 0.9);
            color: #92400e;
            border: 1px solid rgba(146, 64, 14, 0.2);
        }

        .trial-button.secondary:hover {
            background: white;
            transform: translateY(-1px);
        }

        .trial-button.primary {
            background: #92400e;
            color: white;
        }

        .trial-button.primary:hover {
            background: #78350f;
            transform: translateY(-1px);
        }

        /* Responsive Design */
        @media (max-width: 768px) {
            .header-content {
                flex-direction: column;
                gap: 12px;
                text-align: center;
            }

            .dashboard-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 16px;
            }

            .patients-grid {
                grid-template-columns: 1fr;
            }

            .patient-detail-header {
                flex-direction: column;
                gap: 20px;
                text-align: center;
            }

            .patient-detail-meta {
                justify-content: center;
            }

            .modal-content {
                width: 95%;
                padding: 24px;
            }

            .modal-actions {
                flex-direction: column;
            }

            .timeline {
                padding-left: 24px;
            }

            .timeline-item::before {
                left: -20px;
            }

            .recording-header {
                flex-direction: column;
                gap: 16px;
                text-align: center;
            }

            .recording-controls {
                justify-content: center;
            }

            .message-bubble {
                max-width: 95%;
            }

            .timeline-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 8px;
            }

            .timeline-toggle {
                align-self: flex-end;
            }
        }

        /* Full-Screen SOAP Editor */
        .soap-editor-modal {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.8);
            display: none;
            z-index: 2000;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .soap-editor-modal.active {
            display: flex;
            opacity: 1;
        }

        .soap-editor-content {
            background: var(--surface-solid);
            width: 95%;
            height: 95%;
            margin: auto;
            border-radius: var(--radius-lg);
            display: flex;
            flex-direction: column;
            box-shadow: var(--shadow-xl);
            animation: editorSlideIn 0.3s ease;
            overflow: hidden;
        }

        @keyframes editorSlideIn {
            from { transform: scale(0.9); opacity: 0; }
            to { transform: scale(1); opacity: 1; }
        }

        .soap-editor-header {
            padding: 24px 32px;
            border-bottom: 1px solid var(--border);
            background: var(--surface-elevated);
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-shrink: 0;
        }

        .soap-editor-title {
            font-size: 24px;
            font-weight: 700;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .soap-editor-title i {
            color: var(--primary);
        }

        .soap-editor-actions {
            display: flex;
            gap: 12px;
        }

        .soap-editor-body {
            flex: 1;
            padding: 32px;
            overflow-y: auto;
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 32px;
        }

        .soap-editor-section {
            background: var(--surface-elevated);
            border-radius: var(--radius-lg);
            padding: 24px;
            border: 1px solid var(--border);
            display: flex;
            flex-direction: column;
            height: fit-content;
        }

        .soap-editor-section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 16px;
        }

        .soap-editor-section-title {
            font-size: 18px;
            font-weight: 600;
            color: var(--primary);
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .soap-editor-textarea {
            width: 100%;
            min-height: 200px;
            max-height: 400px;
            padding: 16px;
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            font-size: 14px;
            font-family: inherit;
            line-height: 1.6;
            resize: vertical;
            background: var(--surface-solid);
            color: var(--text-primary);
            transition: var(--transition);
        }

        .soap-editor-textarea:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }

        .soap-editor-footer {
            padding: 24px 32px;
            border-top: 1px solid var(--border);
            background: var(--surface-elevated);
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-shrink: 0;
        }

        .soap-editor-info {
            color: var(--text-secondary);
            font-size: 14px;
        }

        .soap-editor-buttons {
            display: flex;
            gap: 12px;
        }

        .soap-editor-button {
            padding: 12px 24px;
            border: none;
            border-radius: var(--radius-md);
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .soap-editor-button.primary {
            background: var(--primary);
            color: white;
            box-shadow: var(--shadow-sm);
        }

        .soap-editor-button.primary:hover {
            background: var(--primary-dark);
            transform: translateY(-1px);
            box-shadow: var(--shadow-md);
        }

        .soap-editor-button.secondary {
            background: var(--surface-solid);
            color: var(--text-primary);
            border: 1px solid var(--border);
        }

        .soap-editor-button.secondary:hover {
            background: var(--border-light);
            transform: translateY(-1px);
        }

        .soap-editor-button.danger {
            background: var(--error);
            color: white;
        }

        .soap-editor-button.danger:hover {
            background: #b91c1c;
            transform: translateY(-1px);
        }

        .close-editor-button {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            padding: 8px;
            border-radius: var(--radius-sm);
            transition: var(--transition);
            font-size: 20px;
        }

        .close-editor-button:hover {
            background: var(--border-light);
            color: var(--text-primary);
        }

        /* Character count */
        .char-count {
            font-size: 12px;
            color: var(--text-muted);
            margin-top: 8px;
            text-align: right;
        }

        /* Responsive adjustments */
        @media (max-width: 1024px) {
            .soap-editor-body {
                grid-template-columns: 1fr;
                gap: 24px;
            }

            .soap-editor-content {
                width: 98%;
                height: 98%;
            }
        }

        @media (max-width: 768px) {
            .soap-editor-header {
                padding: 16px 20px;
                flex-direction: column;
                gap: 16px;
            }

            .soap-editor-body {
                padding: 20px;
            }

            .soap-editor-footer {
                padding: 16px 20px;
                flex-direction: column;
                gap: 16px;
            }

            .soap-editor-buttons {
                width: 100%;
                justify-content: center;
            }
        }

        .recording-indicator.stopped {
            background: var(--secondary);
            animation: none;
        }

        .control-button.resume-from-stop {
            color: var(--primary);
            border-color: var(--primary);
            font-weight: 600;
        }

        .control-button.resume-from-stop:hover {
            background: var(--primary);
            color: white;
        }

/* Magic Edit Modal */
.magic-edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.magic-edit-content {
    background: var(--surface-solid);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 500px;
    animation: scaleIn 0.2s ease;
}

@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.magic-edit-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.magic-edit-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.magic-edit-header .close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.magic-edit-header .close-btn:hover {
    background: var(--surface-elevated);
    color: var(--text-primary);
}

.magic-edit-body {
    padding: 24px;
}

.magic-edit-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0 0 20px 0;
}

.quick-edit-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.quick-edit-btn {
    padding: 12px 16px;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}

.quick-edit-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
}

.quick-edit-btn i {
    font-size: 14px;
}

.custom-edit-section {
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.custom-edit-section label {
    display: block;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.custom-edit-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--background);
    resize: vertical;
    min-height: 80px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}

.custom-edit-input:focus {
    outline: none;
    border-color: var(--primary);
}

.apply-custom-btn {
    width: 100%;
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.apply-custom-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.apply-custom-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Persistent Processing Indicator */
.processing-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-width: 320px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.processing-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--primary);
}

.processing-header i {
    font-size: 18px;
}

.processing-jobs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.processing-job {
    padding: 8px 12px;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.job-patient {
    font-weight: 500;
    margin-bottom: 4px;
}

.job-status {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Ensure indicator stays above other elements */
.processing-indicator {
    z-index: 9999;
}

/* Apple-Inspired Profile Page Styles */
.profile-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 20px;
}

.profile-header {
    text-align: center;
    margin-bottom: 60px;
}

.profile-title {
    font-size: 48px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.profile-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    font-weight: 400;
}

.profile-card {
    background: var(--surface-solid);
    border-radius: var(--radius-xl);
    padding: 40px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.3s ease;
}

.profile-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.profile-section-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-section-title i {
    font-size: 20px;
    color: var(--text-secondary);
}

.profile-field {
    margin-bottom: 24px;
}

.profile-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.profile-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 1px solid transparent;
    background: var(--surface-elevated);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    font-family: inherit;
}

.profile-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface-solid);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.profile-input[readonly] {
    background: var(--surface-elevated);
    color: var(--text-muted);
    cursor: not-allowed;
}

.profile-input-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.profile-input-group .profile-input {
    flex: 1;
}

.profile-save-btn {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.profile-save-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.profile-save-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.profile-reset-btn {
    padding: 10px 20px;
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-reset-btn:hover {
    background: var(--surface-elevated);
    border-color: var(--primary);
}

/* Subscription Status Styles */
.subscription-status {
    background: var(--surface-elevated);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-light);
}

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

.subscription-plan {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.subscription-badge {
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.subscription-badge.active {
    background: rgba(5, 150, 105, 0.1);
    color: var(--success);
}

.subscription-badge.trial {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.subscription-badge.expired {
    background: rgba(220, 38, 38, 0.1);
    color: var(--error);
}

.subscription-details {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.subscription-action-btn {
    width: 100%;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.subscription-action-btn.primary {
    background: var(--primary);
    color: white;
}

.subscription-action-btn.primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.subscription-action-btn.secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.subscription-action-btn.secondary:hover {
    background: var(--surface-elevated);
    border-color: var(--border-hover);
}

.subscription-help-text {
    margin-top: 12px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.profile-back-btn {
    margin-top: 40px;
    padding: 12px 24px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-back-btn:hover {
    color: var(--text-primary);
    background: var(--surface-elevated);
}

/* Portal Setup Instructions */
.portal-setup-notice {
    background: rgba(217, 119, 6, 0.1);
    border: 1px solid rgba(217, 119, 6, 0.2);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 16px;
}

.portal-setup-notice h4 {
    color: var(--warning);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.portal-setup-notice p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
}

.portal-setup-notice a {
    color: var(--warning);
    text-decoration: none;
    font-weight: 500;
}

.portal-setup-notice a:hover {
    text-decoration: underline;
}

/* Trial Expired Modal - Minimalist Blue Design */
.trial-expired-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.trial-expired-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
}

.trial-expired-content {
    position: relative;
    background: white;
    border-radius: 24px;
    padding: 48px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    border: 1.5px solid rgba(59, 130, 246, 0.2);
    animation: slideUp 0.3s ease;
}

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

.trial-expired-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 24px;
    border-radius: 50%;
    border: 1.5px solid #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #3b82f6;
    font-size: 32px;
}

.trial-expired-title {
    font-size: 24px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 12px 0;
    letter-spacing: -0.02em;
}

.trial-expired-message {
    font-size: 15px;
    font-weight: 400;
    color: #6b7280;
    margin: 0 0 32px 0;
    line-height: 1.5;
}

.trial-expired-features {
    margin: 0 0 32px 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.trial-expired-features .feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #374151;
}

.trial-expired-features .feature-item i {
    color: #3b82f6;
    font-size: 16px;
    flex-shrink: 0;
}

.trial-expired-subscribe-btn {
    width: 100%;
    padding: 12px 24px;
    background: #3b82f6;
    color: white;
    border: 1.5px solid #3b82f6;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}

.trial-expired-subscribe-btn:hover {
    background: #2563eb;
    border-color: #2563eb;
    transform: translateY(-2px);
}

.trial-expired-logout-btn {
    width: 100%;
    padding: 12px 24px;
    background: transparent;
    color: #6b7280;
    border: 1.5px solid #e5e7eb;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
}

.trial-expired-logout-btn:hover {
    border-color: #d1d5db;
    background: rgba(0, 0, 0, 0.02);
}

/* File Upload Feature Styles */
.session-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.upload-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    color: #9ca3af;
    border: 1.5px solid #e5e7eb;
    border-radius: 50px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.upload-btn:hover {
    color: #3b82f6;
    border-color: #3b82f6;
    transform: translateY(-2px);
}

/* Upload Modal */
.upload-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.upload-modal-content {
    position: relative;
    background: white;
    border-radius: 30px;
    width: 90%;
    max-width: 500px;
    border: 1.5px solid #e5e7eb;
    overflow: hidden;
}

.upload-modal-header {
    padding: 24px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.upload-modal-header h3 {
    font-size: 20px;
    font-weight: 500;
    color: #111827;
}

.upload-modal-close {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.upload-modal-close:hover {
    background: #f3f4f6;
    color: #6b7280;
}

.upload-modal-body {
    padding: 24px;
}

.upload-dropzone {
    border: 2px dashed #e5e7eb;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-dropzone:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.02);
}

.upload-dropzone.drag-over {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.upload-dropzone i {
    font-size: 48px;
    color: #9ca3af;
    margin-bottom: 16px;
}

.upload-text {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 16px;
    font-weight: 400;
}

.upload-formats {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.format-badge {
    padding: 4px 12px;
    background: #f3f4f6;
    border-radius: 50px;
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.upload-file-preview {
    border: 1.5px solid #e5e7eb;
    border-radius: 20px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.upload-file-preview i {
    font-size: 20px;
    color: #3b82f6;
}

.upload-file-preview span {
    flex: 1;
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

.upload-remove-file {
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.upload-remove-file:hover {
    background: #fee2e2;
    color: #ef4444;
}

.upload-template-section {
    margin-top: 20px;
}

.upload-template-section label {
    display: block;
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 500;
}

.upload-template-select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 50px;
    font-size: 14px;
    color: #374151;
    background: white;
    cursor: pointer;
    font-weight: 400;
    transition: all 0.2s ease;
}

.upload-template-select:hover {
    border-color: #d1d5db;
}

.upload-template-select:focus {
    outline: none;
    border-color: #3b82f6;
}

.upload-modal-footer {
    padding: 20px 24px;
    background: #f9fafb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.upload-cancel-btn {
    padding: 10px 24px;
    background: white;
    color: #6b7280;
    border: 1.5px solid #e5e7eb;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-cancel-btn:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.upload-generate-btn {
    padding: 10px 24px;
    background: #3b82f6;
    color: white;
    border: 1.5px solid #3b82f6;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-generate-btn:hover:not(:disabled) {
    background: #2563eb;
    border-color: #2563eb;
    transform: translateY(-2px);
}

.upload-generate-btn:disabled {
    background: #e5e7eb;
    border-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}