:root {
    /* Interview Lab Palette */
    --primary-color: #0A2540;
    /* Deep Royal Navy */
    --primary-light: #E3F2FD;
    /* Soft Blue for backgrounds/highlights */
    --accent-color: #20C997;
    /* Mint Teal */
    --alert-color: #FF6B6B;
    /* Warm Coral */

    --bg-color: #F8F9FA;
    /* Soft Lab White */
    --card-bg: #FFFFFF;
    /* Pure White */

    --text-main: #111827;
    /* Near Black - Headings */
    --text-color: #4B5563;
    /* Cool Gray - Body */

    --border-color: #E5E7EB;
    /* Light Gray */
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    /* Softer shadow */
}

/* Custom Scrollbar - Global Utility */
.custom-scroll::-webkit-scrollbar {
    width: 6px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 3px;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.app-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

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

header h1 {
    color: var(--primary-color);
    margin-bottom: 5px;
    font-weight: 800;
}

header p {
    color: #666;
}

/* Page Navigation (between Interview and Tools) */
.page-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.page-nav-link {
    padding: 8px 20px;
    background: #f0f0f0;
    color: #555;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.page-nav-link:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.page-nav-link.active {
    background: var(--primary-color);
    color: white;
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    color: #555;
}

.tab-btn:hover {
    color: var(--primary-color);
    background-color: var(--primary-light);
    border-radius: 5px 5px 0 0;
}

.tab-btn.active {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: bold;
}

/* Tab Content */
.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-pane.active {
    display: block;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    background: #fff;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.card h2 {
    margin-top: 0;
    color: #444;
}

/* Forms & Inputs */
textarea,
input[type="text"] {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-sizing: border-box;
    font-family: inherit;
}

/* App Layout - Sidebar & Main Content */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header {
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}

.sidebar-header h1 {
    font-size: 1.2rem;
    margin: 0;
    color: white;
    font-weight: 700;
}

.sidebar-section {
    padding: 0 15px;
    margin-bottom: 25px;
}

.sidebar-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #94a3b8;
    /* Muted text for headers */
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: 10px;
    padding-left: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 0.95rem;
}

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

.nav-item.active {
    background-color: var(--accent-color);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.nav-icon {
    margin-right: 12px;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    /* Width of sidebar */
    padding: 30px;
    background-color: var(--bg-color);
}

/* Responsive Sidebar */
@media (max-width: 768px) {
    .sidebar {
        width: 260px;
        background-color: var(--primary-color);
        color: white;
        display: flex;
        flex-direction: column;
        position: fixed;
        height: 100vh;
        overflow-y: auto;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
    }

    .sidebar-header {
        padding: 20px;
        background-color: rgba(0, 0, 0, 0.2);
        margin-bottom: 20px;
    }

    .sidebar-header h1 {
        font-size: 1.2rem;
        margin: 0;
        color: white;
        font-weight: 700;
    }

    .sidebar-section {
        padding: 0 15px;
        margin-bottom: 25px;
    }

    .sidebar-section-title {
        font-size: 0.75rem;
        text-transform: uppercase;
        color: #94a3b8;
        /* Muted text for headers */
        letter-spacing: 1px;
        font-weight: 700;
        margin-bottom: 10px;
        padding-left: 10px;
    }

    .nav-item {
        display: flex;
        align-items: center;
        padding: 10px 15px;
        color: rgba(255, 255, 255, 0.7);
        text-decoration: none;
        border-radius: 8px;
        margin-bottom: 5px;
        transition: all 0.2s ease;
        cursor: pointer;
        font-size: 0.95rem;
    }

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

    .nav-item.active {
        background-color: var(--accent-color);
        color: white;
        font-weight: 600;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .nav-icon {
        margin-right: 12px;
        font-size: 1.1rem;
        width: 20px;
        text-align: center;
    }

    .main-content {
        flex: 1;
        margin-left: 260px;
        /* Width of sidebar */
        padding: 30px;
        background-color: var(--bg-color);
    }

    /* Responsive Sidebar */
    @media (max-width: 768px) {
        .sidebar {
            width: 100%;
            height: auto;
            position: relative;
        }

        .main-content {
            margin-left: 0;
        }

        .app-layout {
            flex-direction: column;
        }
    }

    textarea {
        min-height: 150px;
        resize: vertical;
    }

    .action-btn {
        background-color: var(--primary-color);
        color: white;
        border: none;
        padding: 12px 24px;
        border-radius: 6px;
        cursor: pointer;
        font-size: 16px;
        transition: background 0.3s;
        display: block;
        width: 100%;
        font-weight: 600;
    }

    .success-btn {
        background-color: var(--success);
        color: white;
        border: none;
        padding: 12px 24px;
        border-radius: 6px;
        cursor: pointer;
        font-size: 16px;
        transition: background 0.3s;
        display: block;
        width: 100%;
        font-weight: 600;
    }

    .success-btn:hover {
        background-color: #1aa179;
        /* Darker Teal */
    }

    .action-btn:hover {
        background-color: #0056b3;
    }

    .result-area {
        margin-top: 20px;
        padding: 15px;
        background: var(--primary-light);
        border-radius: 6px;
        border-left: 4px solid var(--primary-color);
        min-height: 50px;
        white-space: pre-wrap;
    }

    .result-area:empty {
        display: none;
    }

    /* Resume Analysis Sections */
    .analysis-section {
        padding: 15px 20px;
        margin: 15px 0;
        border-radius: 8px;
        background: #fff;
    }

    .analysis-section h3 {
        margin: 0 0 10px 0;
        font-size: 1.2rem;
        font-weight: 600;
    }

    .analysis-section.strengths {
        border-left: 5px solid #28a745;
        background: linear-gradient(to right, #e8f5e9, #fff);
    }

    .analysis-section.strengths h3 {
        color: #28a745;
    }

    .analysis-section.improvements {
        border-left: 5px solid #007bff;
        background: linear-gradient(to right, #e3f2fd, #fff);
    }

    .analysis-section.improvements h3 {
        color: #007bff;
    }

    /* Chat Interface */
    .chat-window {
        height: 300px;
        border: 1px solid var(--border-color);
        border-radius: 6px;
        padding: 15px;
        overflow-y: auto;
        background: #fafafa;
        margin-bottom: 15px;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .message {
        padding: 10px;
        border-radius: 8px;
        max-width: 80%;
    }

    .message.system {
        background: #e9ecef;
        align-self: flex-start;
        color: #333;
    }

    .message.user {
        background: var(--primary-color);
        color: white;
        align-self: flex-end;
    }

    .chat-input-area {
        display: flex;
        gap: 10px;
    }

    .chat-input-area input {
        flex: 1;
        margin: 0;
    }

    .chat-input-area button {
        width: auto;
        margin: 0;
    }



    /* Resume Builder Styles */
    .resume-builder-container {
        display: flex;
        gap: 20px;
        align-items: flex-start;
    }

    .resume-form {
        flex: 1;
        background: #f9f9f9;
        padding: 20px;
        border-radius: 8px;
        border: 1px solid #eee;
        max-height: 800px;
        overflow-y: auto;
    }

    .resume-preview-section {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 10px;
        position: sticky;
        top: 20px;
    }

    .template-selector {
        display: flex;
        gap: 5px;
        flex-wrap: wrap;
        margin-bottom: 10px;
    }

    .template-btn {
        padding: 5px 10px;
        border: 1px solid #ccc;
        background: #fff;
        cursor: pointer;
        border-radius: 4px;
        font-size: 14px;
    }

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

    .resume-preview {
        background: white;
        border: 1px solid #ccc;
        min-height: 600px;
        padding: 40px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        font-size: 14px;
        overflow-y: auto;
        max-height: 800px;
    }

    .placeholder-text {
        color: #999;
        text-align: center;
        margin-top: 200px;
    }

    /* Common Resume Elements */
    .resume-preview h1 {
        margin: 0 0 5px 0;
    }

    .resume-preview .contact-info {
        margin-bottom: 20px;
        font-size: 0.9em;
    }

    .resume-preview h2 {
        border-bottom: 1px solid #ccc;
        padding-bottom: 5px;
        margin-top: 20px;
        font-size: 1.2em;
    }

    .resume-preview .job-item,
    .resume-preview .edu-item {
        margin-bottom: 15px;
    }

    .resume-preview .job-header,
    .resume-preview .edu-header {
        display: flex;
        justify-content: space-between;
        font-weight: bold;
    }

    .resume-preview ul {
        margin: 5px 0 0 20px;
        padding: 0;
    }

    /* Template 1: Modern (Blue accents, clean sans-serif) */
    .resume-preview.modern {
        font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
        color: #333;
    }

    .resume-preview.modern h1 {
        color: #2c3e50;
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    .resume-preview.modern h2 {
        color: #3498db;
        border-bottom: 2px solid #3498db;
    }

    .resume-preview.modern .contact-info {
        color: #7f8c8d;
    }

    /* Template 2: Classic (Serif, traditional) */
    .resume-preview.classic {
        font-family: 'Georgia', serif;
        color: #000;
    }

    .resume-preview.classic h1 {
        text-align: center;
        font-size: 2em;
    }

    .resume-preview.classic .contact-info {
        text-align: center;
        border-bottom: 1px solid #000;
        padding-bottom: 10px;
        margin-bottom: 20px;
    }

    .resume-preview.classic h2 {
        text-transform: uppercase;
        font-size: 1em;
        border-bottom: 1px solid #000;
    }

    /* Template 3: Creative (Sidebar look, distinct header) */
    .resume-preview.creative {
        font-family: 'Futura', 'Trebuchet MS', sans-serif;
        background: #fff;
    }

    .resume-preview.creative h1 {
        color: #e74c3c;
        font-size: 2.5em;
    }

    .resume-preview.creative h2 {
        background: #ecf0f1;
        padding: 5px 10px;
        border-left: 5px solid #e74c3c;
        border-bottom: none;
    }

    /* Template 4: Minimal (Monospace-ish, lots of whitespace) */
    .resume-preview.minimal {
        font-family: 'Courier New', Courier, monospace;
        color: #444;
    }

    .resume-preview.minimal h1 {
        font-weight: normal;
        border-bottom: 1px solid #ddd;
        padding-bottom: 20px;
    }

    .resume-preview.minimal h2 {
        font-weight: bold;
        text-transform: lowercase;
        color: #000;
        border: none;
        margin-bottom: 10px;
    }

    /* Template 5: Executive (Serif headers, sans-serif body, elegant) */
    .resume-preview.executive {
        font-family: 'Calibri', 'Arial', sans-serif;
    }

    .resume-preview.executive h1 {
        font-family: 'Times New Roman', serif;
        color: #2c3e50;
        font-size: 2.2em;
    }

    .resume-preview.executive h2 {
        font-family: 'Times New Roman', serif;
        color: #2c3e50;
        border-bottom: 2px solid #2c3e50;
    }

    .resume-preview.executive .job-header {
        font-style: italic;
    }

    /* Template 6: Condensed (Compact, bullet points, similar to reference) */
    .resume-preview.condensed {
        font-family: 'Calibri', 'Arial', sans-serif;
        color: #000;
        line-height: 1.4;
        padding: 30px;
    }

    .resume-preview.condensed h1 {
        text-align: center;
        font-size: 1.8em;
        font-weight: bold;
        margin-bottom: 5px;
        text-transform: uppercase;
    }

    .resume-preview.condensed .contact-info {
        text-align: center;
        font-size: 0.9em;
        margin-bottom: 15px;
        border-bottom: 1px solid #000;
        padding-bottom: 10px;
    }

    .resume-preview.condensed h2 {
        font-size: 1.1em;
        font-weight: bold;
        text-transform: uppercase;
        border-bottom: 1px solid #000;
        margin-top: 15px;
        margin-bottom: 10px;
        padding-bottom: 2px;
    }

    .resume-preview.condensed .job-item,
    .resume-preview.condensed .edu-item {
        margin-bottom: 10px;
    }

    .resume-preview.condensed .job-header {
        display: flex;
        justify-content: space-between;
        font-weight: bold;
        margin-bottom: 2px;
    }

    .resume-preview.condensed .job-header span:first-child {
        /* Role */
        font-size: 1em;
    }

    .resume-preview.condensed .job-header span:nth-child(2) {
        /* Company */
        font-style: italic;
    }

    .resume-preview.condensed ul {
        margin: 2px 0 0 18px;
        padding: 0;
    }

    .resume-preview.condensed li {
        margin-bottom: 2px;
        font-size: 0.95em;
    }

    .primary-btn {
        background-color: var(--primary-color);
        color: white;
        border: none;
        padding: 10px 20px;
        border-radius: 5px;
        cursor: pointer;
    }

    .secondary-btn {
        background-color: var(--card-bg);
        color: var(--primary-color);
        border: 2px solid var(--primary-color);
        padding: 8px 16px;
        border-radius: 5px;
        cursor: pointer;
        font-weight: 600;
        transition: all 0.2s ease;
    }

    .secondary-btn:hover {
        background-color: var(--primary-light);
    }

    /* Cover Letter Styling */
    .cl-preview {
        background: white;
        padding: 30px;
        border: 1px solid #ddd;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        margin-top: 20px;
        font-family: 'Georgia', serif;
        /* Professional serif font */
        color: #333;
        line-height: 1.4;
    }

    .cl-header {
        text-align: center;
        margin-bottom: 10px;
    }

    .cl-header h1 {
        font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
        font-size: 24px;
        text-transform: uppercase;
        letter-spacing: 2px;
        color: #2c3e50;
        margin-bottom: 5px;
    }

    .cl-contact {
        font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
        font-size: 0.85em;
        color: #666;
    }

    .cl-divider {
        border: 0;
        border-top: 1px solid #eee;
        margin: 10px 0;
    }

    .cl-body {
        font-size: 10.5pt;
        text-align: left;
    }

    .cl-body p {
        margin-bottom: 3.75px;
    }

    @media print {
        @page {
            margin: 0;
            size: auto;
        }

        html,
        body {
            height: 0 !important;
            min-height: 0 !important;
            overflow: visible !important;
            margin: 0 !important;
            padding: 0 !important;
            background: white !important;
        }

        /* Hide all direct children of body */
        body>* {
            display: none !important;
        }

        /* Show only the print area */
        body>#print-area {
            display: block !important;
            position: absolute !important;
            top: 0 !important;
            left: 0 !important;
            width: 100% !important;
            height: auto !important;
            padding: 0.5in;
            box-sizing: border-box;
            background: white !important;
            /* Allow colors for resumes, but cover letter overrides will handle B&W */
            -webkit-print-color-adjust: exact !important;
            print-color-adjust: exact !important;
        }

        /* Ensure contents of print area are visible */
        #print-area * {
            display: block;
            /* Default to block, but let specific elements override */
            visibility: visible;
            box-shadow: none !important;
        }

        /* Restore specific display types for inner elements */
        #print-area span,
        #print-area strong,
        #print-area em,
        #print-area b,
        #print-area i,
        #print-area a {
            display: inline;
        }

        #print-area .job-header,
        #print-area .edu-header,
        #print-area .cl-contact {
            display: flex;
            justify-content: space-between;
        }

        #print-area .cl-contact {
            justify-content: center;
            gap: 10px;
        }

        #print-area li {
            display: list-item;
        }

        /* Reset styles for the container */
        #print-area .resume-preview,
        #print-area .cl-preview {
            box-shadow: none;
            border: none;
            margin: 0;
            padding: 0;
            width: 100%;
            max-width: 100%;
        }

        /* Specific overrides for Cover Letter to ensure B&W */
        #print-area .cl-preview,
        #print-area .cl-preview * {
            color: black !important;
            background: transparent !important;
        }
    }

    /* Career Plan Layout */
    .career-plan-container {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 20px;
        margin-top: 20px;
    }

    .plan-card {
        background: var(--card-bg);
        padding: 20px;
        border-radius: 12px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        border: 1px solid var(--border-color);
    }

    .plan-card h3 {
        color: var(--primary-color);
        margin-top: 0;
        margin-bottom: 15px;
        font-size: 1.2rem;
        border-bottom: 2px solid var(--primary-color);
        padding-bottom: 10px;
    }

    .plan-card ul {
        list-style-type: none;
        padding: 0;
        margin: 0;
    }

    .plan-card li {
        margin-bottom: 10px;
        padding-left: 20px;
        position: relative;
        line-height: 1.5;
    }

    .plan-card li::before {
        content: "•";
        color: var(--primary-color);
        font-weight: bold;
        position: absolute;
        left: 0;
    }

    /* ========================================
   INTERVIEW RESULTS & UPSELL
   ======================================== */

    .interview-results-container {
        max-width: 100%;
        margin: 20px 0;
    }

    .results-section,
    .upsell-section {
        background: #fff;
        border-radius: 12px;
        padding: 25px;
        margin-bottom: 20px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    .results-header,
    .upsell-header {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 2px solid #e0e0e0;
    }

    .results-header h3,
    .upsell-header h3 {
        margin: 0;
        font-size: 1.3rem;
        color: #333;
    }

    .results-icon,
    .upsell-icon {
        font-size: 1.5rem;
    }

    .overall-score {
        display: flex;
        align-items: center;
        gap: 15px;
        margin-bottom: 25px;
        padding: 20px;
        background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
        border-radius: 10px;
    }

    .score-label {
        font-size: 1.2rem;
        color: #555;
    }

    .score-value {
        font-size: 2.5rem;
        font-weight: bold;
        color: var(--primary-color);
    }

    .question-breakdown {
        margin-bottom: 20px;
    }

    .question-breakdown h4 {
        margin-bottom: 15px;
        color: #333;
    }

    .result-question-item {
        padding: 10px 15px;
        margin-bottom: 8px;
        background: #f8f9fa;
        border-radius: 6px;
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .strengths-section,
    .improvements-section {
        margin-bottom: 20px;
    }

    .strengths-section h4 {
        color: #28a745;
    }

    .improvements-section h4 {
        color: #007bff;
    }

    .strengths-section ul,
    .improvements-section ul {
        padding-left: 20px;
        margin: 10px 0;
    }

    .strengths-section li,
    .improvements-section li {
        margin-bottom: 8px;
        line-height: 1.5;
    }

    /* Upsell Section */
    .upsell-motivation {
        font-size: 1.1rem;
        color: #444;
        margin-bottom: 15px;
        line-height: 1.6;
    }

    .score-comparison {
        display: flex;
        gap: 30px;
        margin-bottom: 15px;
        padding: 15px;
        background: #f8f9fa;
        border-radius: 8px;
    }

    .upsell-cta-text {
        color: #666;
        margin-bottom: 25px;
    }

    .upsell-cards {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
        margin-bottom: 25px;
    }

    .upsell-card {
        background: #fff;
        border: 2px solid #e0e0e0;
        border-radius: 12px;
        padding: 25px;
        text-align: center;
        position: relative;
        transition: transform 0.2s, box-shadow 0.2s;
    }

    .upsell-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    }

    .upsell-card.featured {
        border-color: var(--primary-color);
        background: linear-gradient(to bottom, #e3f2fd, #fff);
    }

    .best-value-badge {
        position: absolute;
        top: -12px;
        left: 50%;
        transform: translateX(-50%);
        background: var(--primary-color);
        color: white;
        padding: 5px 15px;
        border-radius: 15px;
        font-size: 0.8rem;
        font-weight: bold;
    }

    .upsell-card .card-icon {
        font-size: 2.5rem;
        margin-bottom: 15px;
    }

    .upsell-card h4 {
        margin: 0 0 10px 0;
        font-size: 1.1rem;
        color: #333;
    }

    .upsell-card .price {
        font-size: 1.3rem;
        font-weight: bold;
        color: var(--primary-color);
        margin-bottom: 15px;
    }

    .upsell-card .features {
        text-align: left;
        padding-left: 20px;
        margin: 15px 0 20px;
        list-style: disc;
    }

    .upsell-card .features li {
        margin-bottom: 8px;
        font-size: 0.9rem;
        color: #555;
    }

    .upsell-btn {
        width: 100%;
        padding: 15px 20px;
        background: #28a745;
        color: white;
        border: none;
        border-radius: 8px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.2s;
    }

    .upsell-btn:hover {
        background: #218838;
    }

    .upsell-btn.featured {
        background: var(--primary-color);
    }

    .upsell-btn.featured:hover {
        background: #0056b3;
    }

    .return-link {
        display: block;
        text-align: center;
        color: #666;
        text-decoration: none;
        padding: 10px;
        font-size: 0.95rem;
    }

    .return-link:hover {
        color: var(--primary-color);
    }

    /* ========================================
   RESPONSIVE DESIGN - Media Queries
   ======================================== */

    /* Tablet Breakpoint */
    @media (max-width: 992px) {
        .app-container {
            margin: 20px 15px;
            padding: 15px;
        }

        .resume-builder-container {
            flex-direction: column;
        }

        .resume-form,
        .resume-preview-section {
            flex: none;
            width: 100%;
            max-height: none;
        }

        .resume-preview-section {
            position: static;
        }

        .resume-preview {
            min-height: 400px;
            max-height: none;
        }

        .career-plan-container {
            grid-template-columns: 1fr;
        }
    }

    /* Mobile Breakpoint */
    @media (max-width: 768px) {
        .app-container {
            margin: 10px;
            padding: 15px;
            border-radius: 8px;
        }

        header h1 {
            font-size: 1.5rem;
        }

        header p {
            font-size: 0.9rem;
        }

        /* Tabs - Horizontal Scrollable */
        .tabs {
            flex-wrap: nowrap;
            overflow-x: auto;
            justify-content: flex-start;
            gap: 5px;
            padding-bottom: 10px;
            margin-bottom: 20px;
            -webkit-overflow-scrolling: touch;
        }

        .tab-btn {
            flex-shrink: 0;
            padding: 10px 15px;
            font-size: 14px;
            white-space: nowrap;
            min-height: 44px;
            /* Touch target */
        }

        /* Cards */
        .card {
            padding: 15px;
        }

        .card h2 {
            font-size: 1.3rem;
        }

        /* Forms - Larger Touch Targets */
        textarea,
        input[type="text"],
        select {
            padding: 14px;
            font-size: 16px;
            /* Prevents iOS zoom */
            min-height: 44px;
        }

        textarea {
            min-height: 120px;
        }

        .action-btn,
        .primary-btn,
        .secondary-btn {
            padding: 14px 20px;
            font-size: 16px;
            min-height: 48px;
        }

        /* Chat Interface */
        .chat-window {
            height: 250px;
            padding: 10px;
        }

        .message {
            max-width: 90%;
            padding: 12px;
            font-size: 15px;
        }

        .chat-input-area {
            flex-wrap: wrap;
            gap: 8px;
        }

        .chat-input-area input {
            flex: 1 1 100%;
            order: 1;
        }

        .chat-input-area button {
            flex: 1;
            order: 2;
            min-height: 48px;
        }

        #record-btn {
            flex: 0 0 auto;
            width: 60px !important;
        }

        /* Resume Builder */
        .resume-form {
            padding: 15px;
            max-height: none;
        }

        .resume-preview {
            padding: 20px;
            min-height: 300px;
        }

        .template-selector {
            gap: 5px;
        }

        .template-btn {
            padding: 8px 12px;
            font-size: 12px;
            min-height: 40px;
        }

        /* Preview Actions */
        .preview-actions {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .preview-actions button {
            margin-left: 0 !important;
            width: 100%;
        }

        /* Cover Letter */
        .cl-preview {
            padding: 20px;
        }

        .cl-header h1 {
            font-size: 20px;
        }

        .cl-contact {
            font-size: 0.8em;
        }

        /* LinkedIn Results */
        #linkedin-results-area {
            margin-top: 15px;
        }

        .recommendations-box,
        .refined-sample-box {
            padding: 12px;
        }

        /* Result Areas */
        .result-area {
            padding: 12px;
            font-size: 14px;
        }

        /* Plan Cards */
        .plan-card {
            padding: 15px;
        }

        .plan-card h3 {
            font-size: 1.1rem;
        }

        /* Form Groups */
        .form-group {
            margin-bottom: 15px;
        }

        .input-group input,
        .input-group textarea {
            margin-bottom: 10px;
        }

        /* Experience/Education Items */
        .experience-item,
        .education-item {
            padding: 10px;
            margin-bottom: 15px;
            background: #f9f9f9;
            border-radius: 8px;
        }

        /* Voice Select Row */
        #interview .form-group[style*="display: flex"] {
            flex-direction: column !important;
        }

        #interview .form-group[style*="display: flex"]>div {
            width: 100% !important;
        }
    }

    /* Small Mobile Breakpoint */
    @media (max-width: 480px) {
        .app-container {
            margin: 5px;
            padding: 10px;
        }

        header h1 {
            font-size: 1.3rem;
        }

        .tab-btn {
            padding: 8px 12px;
            font-size: 13px;
        }

        .card h2 {
            font-size: 1.2rem;
        }

        /* Chat */
        .chat-window {
            height: 200px;
        }

        .message {
            max-width: 95%;
            font-size: 14px;
        }

        /* Resume Preview */
        .resume-preview {
            padding: 15px;
            font-size: 12px;
        }

        .resume-preview h1 {
            font-size: 1.3em;
        }

        .resume-preview h2 {
            font-size: 1em;
        }

        /* Template Buttons - Two Rows */
        .template-selector {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 5px;
        }

        .template-btn {
            padding: 6px 8px;
            font-size: 11px;
        }

        /* Cover Letter */
        .cl-header h1 {
            font-size: 18px;
            letter-spacing: 1px;
        }

        .cl-body {
            font-size: 10pt;
        }

        /* Plan Cards */
        .career-plan-container {
            gap: 15px;
        }

        .plan-card li {
            font-size: 0.9rem;
            padding-left: 15px;
        }

        /* Buttons Stack Fully */
        .preview-actions button,
        .action-btn,
        .primary-btn,
        .secondary-btn {
            font-size: 15px;
        }
    }

    /* Touch Device Improvements */
    @media (hover: none) and (pointer: coarse) {

        .tab-btn:hover,
        .action-btn:hover,
        .template-btn:hover,
        .step-card:hover,
        .feature-card:hover {
            transform: none;
        }

        /* Ensure all interactive elements have good tap targets */
        button,
        .btn,
        a.action-btn,
        input[type="submit"] {
            min-height: 44px;
            min-width: 44px;
        }
    }

    /* ========================================
   RESUME ANALYSIS REPORT UI
   ======================================== */

    .resume-report {
        font-family: 'Segoe UI', system-ui, sans-serif;
        color: #333;
    }

    .report-header {
        display: flex;
        align-items: center;
        gap: 30px;
        margin-bottom: 30px;
        padding: 30px;
        background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
        border-radius: 12px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
        border: 1px solid #eee;
    }

    .score-container {
        flex-shrink: 0;
    }

    .score-circle {
        width: 120px;
        height: 120px;
        border-radius: 50%;
        background: #fff;
        border: 8px solid var(--primary-color);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 10px rgba(0, 123, 255, 0.2);
    }

    .score-circle span {
        font-size: 2.5rem;
        font-weight: 800;
        color: var(--primary-color);
        line-height: 1;
    }

    .score-circle .calc-text {
        font-size: 0.9rem;
        color: #888;
        font-weight: 500;
    }

    .summary-container h3 {
        margin: 0 0 10px 0;
        color: #2c3e50;
        font-size: 1.5rem;
    }

    .summary-container p {
        margin: 0 0 15px 0;
        line-height: 1.6;
        color: #555;
    }

    .benchmark-pill {
        display: inline-block;
        padding: 6px 15px;
        background: #e3f2fd;
        color: #0d47a1;
        border-radius: 20px;
        font-weight: 600;
        font-size: 0.9rem;
    }

    /* Sections */
    .report-section {
        margin-bottom: 30px;
        padding: 25px;
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        border: 1px solid #eee;
    }

    .report-section h4 {
        margin: 0 0 20px 0;
        color: #2c3e50;
        font-size: 1.2rem;
        padding-bottom: 10px;
        border-bottom: 2px solid #f0f0f0;
    }

    /* Grids */
    .grid-3 {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
    }

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

    /* Cards */
    .card-item {
        background: #f8f9fa;
        padding: 15px;
        border-radius: 8px;
        border-left: 4px solid #28a745;
    }

    .card-item h5 {
        margin: 0 0 8px 0;
        color: #28a745;
        font-size: 1rem;
    }

    .card-item p {
        margin: 0;
        font-size: 0.9rem;
        color: #555;
    }

    /* List Items (Improvements) */
    .list-cards {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .list-item {
        display: flex;
        align-items: flex-start;
        gap: 15px;
        padding: 15px;
        background: #fff;
        border: 1px solid #eee;
        border-radius: 8px;
        transition: transform 0.2s;
    }

    .list-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    }

    .badge {
        padding: 4px 10px;
        border-radius: 4px;
        color: white;
        font-size: 0.75rem;
        font-weight: 700;
        text-transform: uppercase;
        min-width: 60px;
        text-align: center;
    }

    /* Keywords */
    .section-advice {
        font-style: italic;
        color: #666;
        margin-bottom: 15px;
    }

    .keyword-cloud {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .tag {
        padding: 6px 12px;
        border-radius: 20px;
        font-size: 0.9rem;
        font-weight: 500;
    }

    .tag.high {
        background: #ffebee;
        color: #c62828;
        border: 1px solid #ffcdd2;
    }

    .tag.med {
        background: #fff3e0;
        color: #ef6c00;
        border: 1px solid #ffe0b2;
    }

    /* Action Plan */
    .action-group {
        margin-bottom: 20px;
    }

    .action-group h5 {
        margin: 0 0 10px 0;
        color: var(--primary-color);
    }

    .action-group ul {
        list-style: none;
        padding: 0;
    }

    .action-group li {
        padding: 8px 0;
        border-bottom: 1px solid #f0f0f0;
        display: flex;
        gap: 10px;
        align-items: center;
    }

    .action-group input[type="checkbox"] {
        width: 18px;
        height: 18px;
        margin: 0;
        cursor: pointer;
    }

    /* Upsell */
    .upsell-container {
        text-align: center;
        padding: 40px;
        background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
        color: white;
        border-radius: 16px;
        margin-top: 40px;
    }

    .upsell-container p {
        font-size: 1.2rem;
        margin-bottom: 25px;
        opacity: 0.9;
    }

    .upsell-buttons {
        display: flex;
        justify-content: center;
        gap: 20px;
        flex-wrap: wrap;
    }

    .premium-btn {
        padding: 14px 28px;
        background: #ffc107;
        color: #333;
        border: none;
        border-radius: 30px;
        font-weight: 700;
        font-size: 1rem;
        cursor: pointer;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        transition: transform 0.2s;
    }

    .premium-btn:hover {
        transform: scale(1.05);
        background: #ffca2c;
    }

    .premium-btn.outline {
        background: transparent;
        border: 2px solid rgba(255, 255, 255, 0.8);
        color: white;
        box-shadow: none;
    }

    .premium-btn.outline:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    @media print {
        body {
            background: white;
        }

        .upsell-container,
        .action-btn {
            display: none !important;
        }

        .resume-report {
            box-shadow: none;
            border: none;
        }

        .score-circle {
            border: 4px solid #007bff;
        }
    }

    /* ========================================
   RESUME ANALYSIS REPORT - PHASE 2 UPGRADES
   ======================================== */

    .benchmark-section {
        background: linear-gradient(to right, #ffffff, #f0f8ff);
    }

    .benchmark-grid {
        display: flex;
        align-items: center;
        gap: 40px;
        flex-wrap: wrap;
    }

    .score-circle-large {
        width: 140px;
        height: 140px;
        border-radius: 50%;
        background: #fff;
        border: 10px solid var(--primary-color);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 15px rgba(0, 123, 255, 0.25);
    }

    .score-circle-large span {
        font-size: 3rem;
        font-weight: 800;
        color: var(--primary-color);
        line-height: 1;
    }

    .score-circle-large label {
        font-size: 0.9rem;
        color: #666;
        margin-top: 5px;
    }

    .benchmark-bars {
        flex: 1;
        min-width: 300px;
    }

    .bar-group {
        margin-bottom: 15px;
    }

    .bar-label {
        display: flex;
        justify-content: space-between;
        font-size: 0.9rem;
        color: #555;
        margin-bottom: 5px;
    }

    .progress-bar {
        height: 12px;
        background: #e9ecef;
        border-radius: 6px;
        overflow: hidden;
    }

    .progress-bar .fill {
        height: 100%;
        border-radius: 6px;
    }

    .progress-bar .fill.avg {
        background: #6c757d;
    }

    .progress-bar .fill.top {
        background: #28a745;
    }

    .benchmark-text {
        margin-top: 15px;
        font-size: 0.95rem;
        padding: 10px;
        background: rgba(255, 255, 255, 0.6);
        border-radius: 6px;
        border: 1px solid #e0e0e0;
    }

    /* Detailed Improvements */
    .list-item.detailed {
        display: block;
        /* Override flex */
        padding: 20px;
    }

    .list-header {
        display: flex;
        align-items: center;
        gap: 15px;
        margin-bottom: 15px;
        font-size: 1.1rem;
    }

    .list-body {
        padding-left: 0;
    }

    .example-box {
        margin: 15px 0;
        padding: 15px;
        background: #f8f9fa;
        border-radius: 6px;
        border-left: 3px solid #6c757d;
    }

    .ex-row {
        font-family: 'Segoe UI', Tahoma, sans-serif;
        color: #495057;
        margin-bottom: 5px;
    }

    .ex-row.better {
        color: #155724;
        background: #d4edda;
        padding: 10px;
        border-radius: 4px;
        margin-top: 5px;
    }

    .ex-arrow {
        font-size: 0.8rem;
        color: #28a745;
        margin: 5px 0;
        font-weight: bold;
        text-transform: uppercase;
    }

    .why-box {
        font-size: 0.9rem;
        color: #666;
        font-style: italic;
    }

    /* Quick Rewrites */
    .rewrite-card {
        background: #fff;
        border: 1px solid #e0e0e0;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
        border-radius: 8px;
        padding: 20px;
        margin-bottom: 20px;
    }

    .rewrite-card h5 {
        margin: 0 0 15px 0;
        color: #007bff;
        border-bottom: 1px solid #eee;
        padding-bottom: 10px;
    }

    .rewrite-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .rewrite-col h6 {
        margin: 0 0 5px 0;
        font-size: 0.85rem;
        text-transform: uppercase;
        color: #888;
    }

    .rewrite-col.old p {
        color: #dc3545;
        background: #fff5f5;
        padding: 10px;
        border-radius: 4px;
        border-left: 3px solid #dc3545;
        font-size: 0.9rem;
    }

    .rewrite-col.new p {
        color: #155724;
        background: #effaf3;
        padding: 10px;
        border-radius: 4px;
        border-left: 3px solid #155724;
        font-size: 0.9rem;
        font-weight: 500;
    }

    .explanation {
        margin-top: 15px;
        font-size: 0.9rem;
        color: #555;
        padding-top: 10px;
        border-top: 1px dashed #eee;
    }

    /* Keyword Grids */
    .keyword-grids {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
    }

    .k-col h5 {
        margin: 0 0 10px 0;
        border-bottom: 2px solid #eee;
        padding-bottom: 5px;
    }

    .k-list {
        list-style: none;
        padding: 0;
        margin: 0;
        font-size: 0.9rem;
    }

    .k-list li {
        margin-bottom: 8px;
        padding-bottom: 8px;
        border-bottom: 1px solid #f8f8f8;
    }

    .k-list.good li {
        color: #28a745;
    }

    .k-list.missing li {
        color: #dc3545;
    }

    .k-list.overused li {
        color: #856404;
    }

    .k-list .tip,
    .k-list .alts {
        display: block;
        font-size: 0.8rem;
        color: #999;
    }

    /* Role Gaps */
    .role-gaps {
        margin-top: 25px;
        padding: 15px;
        background: #fff;
        border: 1px solid #eee;
        border-radius: 8px;
    }

    .gap-item {
        margin-bottom: 10px;
        font-size: 0.95rem;
    }

    /* Interview Tip */
    .interview-tip {
        background: #fff3cd;
        border: 1px solid #ffeeba;
    }

    .interview-tip h4 {
        color: #856404;
        border-bottom-color: #ffeeba;
    }

    .interview-tip a {
        color: #856404;
        font-weight: bold;
        text-decoration: underline;
    }

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

        .benchmark-grid {
            flex-direction: column;
            align-items: flex-start;
        }
    }


    /* ========================================
   RESUME ANALYSIS REPORT - PHASE 3 (RED FLAGS)
   ======================================== */

    .red-flags {
        background: #fff5f5;
        border-left: 5px solid #dc3545;
        border-radius: 8px;
        padding: 20px;
    }

    .red-flags h4 {
        color: #dc3545;
        border-bottom: 2px solid #ffcdd2;
    }

    .flag-list {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .flag-item {
        background: #fff;
        padding: 15px;
        border: 1px solid #ffcdd2;
        border-radius: 6px;
    }

    .flag-item h5 {
        color: #c62828;
        margin: 0 0 5px 0;
        font-size: 1rem;
        font-weight: 700;
    }

    .flag-item p {
        margin: 0 0 10px 0;
        font-size: 0.95rem;
        color: #555;
    }

    .flag-fix {
        font-size: 0.9rem;
        color: #155724;
        background: #d4edda;
        padding: 8px;
        border-radius: 4px;
    }

    /* Enhanced Role Gaps */
    .gap-item {
        margin-bottom: 15px;
        padding: 10px;
        background: #f8f9fa;
        border-radius: 6px;
        border-left: 3px solid #ffc107;
    }

    .gap-role {
        font-weight: 700;
        color: #333;
        margin-bottom: 5px;
    }

    .gap-missing {
        margin-bottom: 5px;
    }

    .gap-advice {
        font-size: 0.85rem;
        font-style: italic;
        color: #666;
        margin-top: 5px;
    }

    /* ========================================
   RESUME ANALYSIS REPORT - PHASE 4 (POLISH)
   ======================================== */

    /* Metric Highlights */
    .highlight-metric {
        background: #fff3cd;
        color: #856404;
        padding: 0 4px;
        border-radius: 3px;
        border-bottom: 2px solid #ffeeba;
        font-weight: bold;
    }

    .place {
        color: #007bff;
        font-weight: bold;
        text-transform: uppercase;
        font-size: 0.85em;
    }

    /* Metric Prompt */
    .metric-prompt {
        margin-top: 10px;
        padding: 10px;
        background: #e2e3e5;
        border-radius: 6px;
        color: #383d41;
        font-size: 0.9rem;
        border-left: 3px solid #6c757d;
    }

    /* Flag Examples */
    .flag-examples {
        margin: 10px 0;
        padding: 10px;
        background: #fff;
        border: 1px dashed #dc3545;
        border-radius: 4px;
    }

    .flag-examples ul {
        margin: 5px 0 0 20px;
        color: #dc3545;
        font-family: monospace;
        font-size: 0.9em;
    }

    /* Enhanced Gap Fixes */
    .gap-fix-box {
        margin-top: 10px;
        background: #fff;
        padding: 10px;
        border: 1px solid #ddd;
        border-radius: 6px;
    }

    .gap-row {
        margin-bottom: 5px;
        font-size: 0.9rem;
    }

    .gap-row.old {
        color: #666;
        font-style: italic;
    }

    .gap-row.new {
        color: #155724;
        font-weight: 500;
    }

    .gap-reason {
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px dashed #eee;
        font-size: 0.85rem;
        color: #555;
    }

    /* ========================================
   PRINT OPTIMIZATION (PHASE 5)
   ======================================== */
    @media print {
        @page {
            margin: 0.5in;
            size: auto;
        }

        /* General Reset for Print */
        body {
            background: white !important;
            font-size: 11pt;
            color: black;
        }

        /* Hide Navigation & non-essentials */
        header,
        .nav-tabs,
        .upsell-container,
        .action-btn,
        .chat-input-area,
        .sidebar,
        #record-btn,
        .version-display,
        .upsell-buttons {
            display: none !important;
        }

        /* Ensure Report is nice and wide */
        main {
            width: 100%;
            max-width: 100%;
            margin: 0;
            padding: 0;
        }

        .container {
            width: 100%;
            max-width: 100%;
            padding: 0;
            margin: 0;
        }

        .resume-report {
            width: 100%;
            border: none;
            box-shadow: none;
            padding: 0;
        }

        /* --- PAGE 1: OVERVIEW (Score + Flags + Strengths) --- */
        /* Force break after strengths to ensure Page 1 is Overview */
        .report-section.strengths {
            page-break-after: always;
            break-after: page;
        }

        /* --- PAGE 2: IMPACT IMPROVEMENTS --- */
        .report-section.improvements {
            page-break-after: always;
            break-after: page;
        }

        /* --- PAGE 3: REWRITES --- */
        .report-section.rewrites {
            page-break-after: always;
            break-after: page;
        }

        /* --- SECTION CONDENSING --- */
        .report-section {
            margin-bottom: 20px;
            padding: 10px;
            border: 1px solid #eee;
            /* Light border for separation */
            page-break-inside: avoid;
            /* Try to keep headers with content */
        }

        h4 {
            margin-bottom: 15px;
            border-bottom: 2px solid #333;
            padding-bottom: 5px;
        }

        /* Remove heavy backgrounds for ink saving */
        .benchmark-section,
        .score-circle-large,
        .rewrite-card,
        .list-item,
        .flag-item {
            background: white !important;
            box-shadow: none !important;
            border: 1px solid #ddd !important;
        }

        .score-circle-large {
            border: 6px solid #000;
            color: #000;
        }

        .score-circle-large span {
            color: #000;
        }

        /* Prevent breaking inside cards */
        .card-item,
        .list-item,
        .rewrite-card,
        .flag-item,
        .gap-item {
            page-break-inside: avoid;
            break-inside: avoid;
        }

        /* Adjust Grid Layouts for Print */
        .grid-3,
        .grid-2 {
            display: block;
            /* Stack grids to prevent weird width issues */
        }

        .card-item {
            margin-bottom: 10px;
        }

        /* Benchmarks */
        .benchmark-grid {
            flex-direction: row;
            flex-wrap: nowrap;
            gap: 20px;
        }

        .progress-bar {
            border: 1px solid #999;
        }

        .progress-bar .fill {
            -webkit-print-color-adjust: exact;
            print-color-adjust: exact;
        }

        /* Force color print for bars */

        /* Typography adjustments */
        p,
        li {
            line-height: 1.4;
        }

        /* Links */
        a {
            text-decoration: none;
            color: black;
        }

        a::after {
            content: " (" attr(href) ")";
            font-size: 0.8em;
            color: #666;
        }

        a[href^="#"]::after {
            content: "";
        }

        /* Don't show links for internal tab jumps */
    }

    /* ========================================
   UPSELL OVERHAUL (PHASE 6)
   ======================================== */

    .upsell-section-new {
        margin-top: 40px;
        margin-bottom: 40px;
        padding-top: 30px;
        border-top: 1px solid #e5e7eb;
        text-align: center;
        page-break-inside: avoid;
    }

    .upsell-header-large {
        font-size: 1.5rem;
        font-weight: 800;
        color: #1f2937;
        margin-bottom: 5px;
        text-transform: uppercase;
    }

    .upsell-subheader {
        font-size: 1rem;
        color: #6b7280;
        margin-bottom: 25px;
        font-weight: 400;
    }

    /* Blue Box */
    .upsell-blue-box {
        background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
        border: 2px solid #3b82f6;
        border-radius: 12px;
        padding: 24px;
        margin-bottom: 20px;
        text-align: left;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }

    .blue-box-title {
        color: #2563eb;
        font-size: 1.25rem;
        font-weight: 700;
        margin-bottom: 15px;
        display: block;
    }

    .blue-box-desc {
        color: #374151;
        font-size: 1rem;
        margin-bottom: 15px;
    }

    .blue-box-list {
        list-style: none;
        padding: 0;
        margin: 0 0 20px 0;
    }

    .blue-box-list li {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 15px;
        color: #374151;
        margin-bottom: 8px;
    }

    .check-icon {
        color: #059669;
        font-weight: bold;
        font-size: 1.1rem;
    }

    .blue-box-footer {
        font-size: 0.9rem;
        color: #6b7280;
        font-style: italic;
        margin-bottom: 20px;
        display: block;
    }

    /* Action Button */
    .upsell-action-btn {
        display: block;
        width: 100%;
        padding: 14px 24px;
        background: linear-gradient(to right, #3b82f6, #2563eb);
        color: white;
        font-size: 16px;
        font-weight: bold;
        text-align: center;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
        transition: all 0.2s ease;
    }

    .upsell-action-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 12px rgba(37, 99, 235, 0.3);
    }

    /* Yellow Disclaimer */
    .upsell-disclaimer-box {
        background: #fef3c7;
        border-left: 4px solid #f59e0b;
        border-radius: 6px;
        padding: 12px 16px;
        text-align: left;
        color: #92400e;
        font-size: 13px;
        margin-top: 20px;
    }

    @media print {
        .upsell-section-new {
            display: none !important;
        }
    }

    /* ========================================
   VISUAL REFINEMENT (PHASE 8)
   Minimize White Space & Layout Tweaks
   ======================================== */

    .report-section {
        padding: 15px !important;
        /* Reduce from 20px */
        margin-bottom: 20px !important;
        /* Reduce gap between sections */
    }

    h4 {
        margin-bottom: 10px !important;
    }

    /* Tighter Lists */
    .k-list li,
    .action-group li {
        padding: 4px 0 !important;
    }

    /* Tighter Cards */
    .card-item,
    .rewrite-card,
    .flag-item,
    .gap-item,
    .list-item.detailed {
        padding: 15px !important;
        margin-bottom: 15px !important;
    }

    /* Minimize open space in example boxes */
    .example-box,
    .gap-fix-box {
        margin: 10px 0 !important;
        padding: 10px !important;
    }

    .ex-arrow {
        margin: 2px 0 !important;
    }

    .ex-row {
        margin-bottom: 2px !important;
    }

    /* Score Circle Adjustment */
    .score-circle-large {
        width: 100px !important;
        height: 100px !important;
        border-width: 6px !important;
    }

    .score-circle-large span {
        font-size: 2rem !important;
    }

    /* Disclaimer Top Styling */
    .upsell-disclaimer-box {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    /* Final Steps Wrapper (Page Break optimized) */
    @media print {
        .final-steps-wrapper {
            page-break-before: always;
            break-before: page;
            display: block;
        }

        /* Ensure ATS/Formatting stay side-by-side or stacked cleanly */
        .grid-2 {
            gap: 10px;
            margin-bottom: 10px;
        }
    }

    /* Further Grid Condensing */
    .grid-2,
    .grid-3 {
        gap: 10px !important;
    }

    .list-cards {
        gap: 10px !important;
    }

    /* Tighter headers */
    h3,
    h4,
    h5 {
        margin-top: 0 !important;
    }

    /* ========================================
   PRINT LOGIC REFINEMENT (PHASE 9)
   Prevent Partial Page Cuts
   ======================================== */

    @media print {

        /* Force sections to stay together */
        .report-section,
        .upsell-section-new,
        .benchmark-section,
        .red-flags,
        .strengths,
        .improvements,
        .rewrites,
        .keywords-detailed,
        .ats,
        .formatting,
        .action-plan,
        .interview-tip {
            page-break-inside: avoid !important;
            break-inside: avoid !important;
            display: block;
            /* Ensure block formatting context */
            position: relative;
        }

        /* Prevent headers from being stranded at bottom of page */
        h1,
        h2,
        h3,
        h4,
        h5,
        h6 {
            page-break-after: avoid !important;
            break-after: avoid !important;
        }

        /* Ensure specific grid items don't split weirdly */
        .card-item,
        .list-item,
        .rewrite-card,
        .flag-item,
        .gap-item,
        .gap-fix-box,
        .example-box {
            page-break-inside: avoid !important;
            break-inside: avoid !important;
        }

        /* Allow lists to break between items, but not inside items */
        ul,
        ol {
            page-break-inside: auto;
        }

        li {
            page-break-inside: avoid;
            break-inside: avoid;
        }

        /* Ensure the wrapper for ATS/Formatting respects page breaks */
        .final-steps-wrapper {
            page-break-inside: auto;
        }
    }

    /* =========================================
   PREMIUM STRATEGY LAB UI UPGRADES
   ========================================= */

    /* Global Background Override */
    body.strategy-lab-theme {
        background-color: #f9fafb !important;
    }

    /* Premium Card Utilities */
    .rounded-xl {
        border-radius: 0.75rem !important;
    }

    .shadow-sm {
        box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    }

    .p-6 {
        padding: 1.5rem !important;
    }

    .bg-white {
        background-color: #ffffff !important;
    }

    /* Enhanced Input Styling */
    .form-control {
        border: 1px solid #e5e7eb;
        transition: all 0.2s;
    }

    .form-control:focus {
        outline: none;
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        /* Ring-2-blue-500 feel */
    }

    /* Helper Text */
    .helper-text {
        font-size: 0.85rem;
        color: #6b7280;
        margin-top: 0.25rem;
    }

    /* Empty State Styling (Dashed Border) */
    .empty-state-container {
        border: 2px dashed #e5e7eb;
        border-radius: 0.75rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        height: 100%;
        min-height: 400px;
        /* Canvas feel */
        background-color: #f9fafb;
    }

    .empty-state-icon {
        font-size: 3rem;
        color: #d1d5db;
        margin-bottom: 1rem;
    }

    .empty-state-text {
        color: #374151;
        font-weight: 600;
    }

    .empty-state-subtext {
        color: #6b7280;
        font-size: 0.9rem;
    }

    /* Filled State Transition */
    .markdown-content {
        animation: fadeIn 0.5s ease-out;
    }

    /* Sidebar Active Tab Polish */
    .nav-item.active-strategy {
        background-color: #eff6ff;
        /* Light Blue 50 */
        color: #1d4ed8;
        /* Blue 700 */
        border-left: 4px solid #3b82f6;
    }

    /* =========================================
   STRATEGY LAB PREMIUM UTILITIES
   ========================================= */

    /* Premium Background */
    .bg-premium-gray {
        background-color: #f9fafb !important;
    }

    /* Premium Card Wrapper */
    .strategy-card {
        background-color: #ffffff;
        border-radius: 1.5rem !important;
        /* rounded-2xl */
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
        /* shadow-lg */
        padding: 2rem !important;
        /* p-8 */
        border: 1px solid #f3f4f6;
        /* border-gray-100 */
        height: 100%;
    }

    /* Premium Container */
    .premium-container {
        max-width: 72rem;
        /* max-w-6xl */
        margin: 0 auto;
        display: grid;
        gap: 2rem;
        /* gap-8 */
        grid-template-columns: 1fr 1fr;
        min-height: calc(100vh - 100px);
        padding: 1.5rem;
    }

    /* Typography Overrides */
    .premium-title {
        font-size: 1.875rem !important;
        /* text-3xl */
        font-weight: 700 !important;
        /* font-bold */
        color: #111827;
        /* gray-900 */
        line-height: 2.25rem;
    }

    .premium-subtitle {
        margin-top: 0.5rem;
        color: #6b7280;
        /* gray-500 */
        font-size: 1rem;
    }


    /* Input Styling Upgrade */
    .input-premium {
        border-radius: 0.75rem !important;
        /* rounded-xl */
        border: 1px solid #e5e7eb;
        /* border-gray-200 */
        padding: 0.75rem 1rem;
        width: 100%;
        transition: all 0.2s;
    }

    .input-premium:focus {
        outline: none;
        border-color: #3b82f6;
        /* blue-500 */
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
        /* ring-2 */
    }

    /* Empty State Premium */
    .empty-state-premium {
        height: 100%;
        min-height: 400px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border: 2px dashed #e5e7eb;
        /* border-gray-200 */
        border-radius: 0.75rem;
        /* rounded-xl */
        background-color: #f9fafb;
        /* gray-50 */
        text-align: center;
        padding: 2rem;
    }

    .empty-state-icon {
        font-size: 3rem;
        color: #9ca3af;
        /* gray-400 */
        margin-bottom: 1rem;
    }

    .empty-state-text {
        font-weight: 500;
        color: #374151;
        /* gray-700 */
        margin-bottom: 0.5rem;
    }

    /* Button Upgrades */
    .btn-premium-action {
        width: 100%;
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
        /* py-4 */
        font-size: 1.125rem !important;
        /* text-lg */
        font-weight: 600 !important;
        border-radius: 0.75rem !important;
        /* rounded-xl */
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
        /* shadow-md */
        transition: transform 0.1s;
    }

    .btn-premium-action:active {
        transform: scale(0.98);
    }

    @media (max-width: 1024px) {
        .premium-container {
            grid-template-columns: 1fr;
        }
    }