/* ==========================================================================
   FORCECRAVER RESUME STUDIO - MASTER STYLESHEET
   Universal Standard Template Generator with A4 WYSIWYG Renderer
   ========================================================================== */

:root {
    /* Color Palette - Dark Theme (Default) */
    --bg-primary: #0a0f1d;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.85);
    --bg-card-hover: rgba(31, 41, 55, 0.95);
    --bg-input: #1f2937;
    
    --border-color: #374151;
    --border-focus: #3b82f6;
    
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.25);
    
    --success-color: #10b981;
    --success-hover: #059669;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;

    /* A4 Paper Styles (Always Crisp White Document on Light & Dark UI) */
    --paper-bg: #ffffff;
    --paper-text: #111827;
    --paper-text-muted: #374151;
    --paper-border: #1e293b;
    --paper-accent: #0f172a;
    --paper-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
    
    /* Layout & Dimensions */
    --header-height: 70px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-card-hover: #f1f5f9;
    --bg-input: #f8fafc;
    
    --border-color: #e2e8f0;
    --border-focus: #2563eb;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --accent-color: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-glow: rgba(37, 99, 235, 0.15);
    
    --paper-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

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

html, body {
    min-height: 100vh;
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Background subtle ambient glows */
.glow-bg {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.12;
}

.bg-glow-1 {
    top: -10%;
    right: 10%;
    width: 600px;
    height: 600px;
    background: #3b82f6;
}

.bg-glow-2 {
    bottom: -10%;
    left: 10%;
    width: 600px;
    height: 600px;
    background: #8b5cf6;
}

/* Header */
.main-header {
    height: var(--header-height);
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1700px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo-img {
    height: 38px;
    width: auto;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 14px var(--accent-glow);
}

.logo-text h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.logo-text h1 span {
    color: var(--accent-color);
}

.app-tagline {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: var(--success-color);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success-color);
    box-shadow: 0 0 10px var(--success-color);
    animation: pulseAnimation 2s infinite;
}

@keyframes pulseAnimation {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.3); }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 0.82rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color), #2563eb);
    color: white;
    box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-input);
    border-color: var(--border-color);
    color: var(--text-primary);
}

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

.btn-outline {
    background: transparent;
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.btn-outline:hover {
    background: var(--accent-glow);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-icon:hover {
    background: var(--border-color);
}

.btn-icon-sm {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-icon-sm:hover {
    background: var(--border-color);
}

.btn-micro {
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--accent-color);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition-fast);
}

.btn-micro:hover {
    background: var(--accent-color);
    color: white;
}

.btn-micro-danger {
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger-color);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-micro-danger:hover {
    background: var(--danger-color);
    color: white;
}

/* Theme icon toggles */
[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* Main Content */
.main-content {
    flex: 1;
    height: calc(100vh - var(--header-height));
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

/* Upload Section */
.upload-section {
    max-width: 1000px;
    width: 100%;
    margin: 20px auto 40px;
    padding: 0 24px;
    text-align: center;
    flex-shrink: 0;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: var(--accent-color);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.2;
    margin-bottom: 16px;
}

.gradient-text {
    background: linear-gradient(135deg, #3b82f6, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 780px;
    margin: 0 auto 36px;
    line-height: 1.6;
}

.upload-box-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 48px 24px;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: rgba(31, 41, 55, 0.4);
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--accent-color);
    background: rgba(59, 130, 246, 0.08);
}

.upload-icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: var(--accent-color);
}

.drop-zone h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.drop-subtext {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.upload-btn-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.features-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 32px;
    padding-top: 28px;
    border-top: 1px solid var(--border-color);
    text-align: left;
}

.feature-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.feature-item i {
    color: var(--accent-color);
    flex-shrink: 0;
    margin-top: 2px;
}

.feature-item h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.feature-item p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Loader Section */
.loader-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
}

.loader-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px;
    max-width: 540px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.spinner-ring {
    width: 56px;
    height: 56px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

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

.loader-card h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.loader-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.progress-bar-container {
    height: 8px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 28px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), #a855f7);
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}

.loader-steps {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    text-align: left;
}

.step-badge {
    padding: 8px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.step-badge.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.step-badge.done {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--success-color);
    color: var(--success-color);
}

/* ==========================================================================
   WORKSPACE DUAL PANE LAYOUT
   ========================================================================== */

.workspace-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
}

.workspace-toolbar {
    height: 52px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
}

.toolbar-left, .toolbar-center, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-loaded-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    color: var(--text-secondary);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 3px 6px;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
}

#zoomLevelText {
    min-width: 44px;
    text-align: center;
}

.workspace-grid {
    flex: 1;
    display: flex;
    flex-direction: row;
    height: calc(100% - 52px);
    max-height: calc(100% - 52px);
    width: 100%;
    overflow: hidden;
}

/* Left Pane: Editor Form (Independent Window with Dedicated Scroller) */
.editor-pane {
    width: 500px;
    min-width: 440px;
    max-width: 560px;
    height: 100%;
    max-height: 100%;
    background: var(--bg-secondary);
    border-right: 2px solid #334155;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
}

.editor-header {
    height: 60px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.editor-header h3 {
    font-size: 1.02rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.editor-header p {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.editor-form-scrollable {
    flex: 1;
    height: calc(100% - 60px);
    max-height: calc(100% - 60px);
    overflow-y: scroll !important; /* Force Permanent Left Scroller */
    overflow-x: hidden;
    padding: 16px 14px 60px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #6366f1 #111827;
    scroll-behavior: smooth;
}

/* Custom Visible Scroller for Left Editor Window */
.editor-form-scrollable::-webkit-scrollbar {
    width: 10px !important;
    display: block !important;
}

.editor-form-scrollable::-webkit-scrollbar-track {
    background: #111827 !important;
    border-left: 1px solid #1f2937 !important;
}

.editor-form-scrollable::-webkit-scrollbar-thumb {
    background: #6366f1 !important;
    border-radius: 6px !important;
    border: 2px solid #111827 !important;
}

.editor-form-scrollable::-webkit-scrollbar-thumb:hover {
    background: #6366f1 !important;
}

/* Form Accordion Cards */
.form-card {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0 !important; /* CRITICAL: Never squish cards flat */
}

.form-card-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    background: rgba(255, 255, 255, 0.02);
    transition: background var(--transition-fast);
}

.form-card-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-title i {
    color: var(--accent-color);
}

.header-title h4 {
    font-size: 0.92rem;
    font-weight: 700;
}

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

.accordion-icon {
    transition: transform var(--transition-normal);
}

.form-card.collapsed .accordion-icon {
    transform: rotate(-90deg);
}

.form-card.collapsed .form-card-body {
    display: none;
}

.form-card-body {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input, .form-textarea {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus, .form-textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-textarea {
    resize: vertical;
    line-height: 1.5;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Dynamic Item Cards (Experience & Projects) */
.dynamic-item-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    flex-shrink: 0 !important; /* CRITICAL: Never squish inner cards */
}

.item-card-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.item-card-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-color);
}

.bullet-textarea {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
}

/* ==========================================================================
   RIGHT PANE: LIVE WYSIWYG A4 DOCUMENT SHEET (Independent Window)
   ========================================================================== */

.preview-pane {
    flex: 1;
    height: 100%;
    max-height: 100%;
    background: #0b0f19;
    overflow-y: scroll !important; /* Force Permanent Right Scroller */
    overflow-x: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 30px 20px 80px;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #06b6d4 #0f172a;
    scroll-behavior: smooth;
}

/* Custom Visible Scroller for Right Preview Window */
.preview-pane::-webkit-scrollbar {
    width: 12px !important;
    height: 12px !important;
    display: block !important;
}

.preview-pane::-webkit-scrollbar-track {
    background: #0a0e1a !important;
    border-left: 1px solid #1e293b !important;
}

.preview-pane::-webkit-scrollbar-thumb {
    background: #06b6d4 !important;
    border-radius: 6px !important;
    border: 2px solid #0a0e1a !important;
}

.preview-pane::-webkit-scrollbar-thumb:hover {
    background: #22d3ee !important;
}

.preview-stage {
    transform-origin: top center;
    transition: transform var(--transition-fast);
}

/* Standard A4 Physical Dimension & Layout */
.resume-sheet {
    width: 210mm;
    min-height: 297mm;
    background: var(--paper-bg);
    color: var(--paper-text);
    padding: 20mm 20mm 20mm 20mm;
    box-shadow: var(--paper-shadow);
    border-radius: 2px;
    position: relative;
    font-family: 'Inter', sans-serif;
    font-size: 9.5pt;
    line-height: 1.45;
    text-align: left;
    overflow: visible;
}

/* Background Watermark Styling (Repeats on EVERY A4 Page) */
.resume-watermark-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    user-select: none;
    overflow: hidden;
}

.resume-watermark-container.hidden {
    display: none !important;
}

.page-watermark-wrapper {
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 580px;
    max-width: 88%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resume-watermark-img {
    width: 100%;
    height: auto;
    object-fit: contain;
    opacity: 0.28;
    filter: contrast(1.1) brightness(1.05);
    transform: rotate(-15deg);
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* Document Header (Clean ATS-Friendly, No Private Contact) */
.res-header {
    position: relative;
    z-index: 1;
    text-align: center;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 2px solid var(--paper-border);
}

.res-name {
    font-family: 'Outfit', sans-serif;
    font-size: 20pt;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: #0f172a;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.res-title {
    font-size: 11pt;
    font-weight: 600;
    color: #334155;
    margin-bottom: 3px;
}

.res-experience-badge {
    font-size: 9.5pt;
    font-weight: 600;
    color: #475569;
}

/* Document Sections */
.res-section {
    position: relative;
    z-index: 1;
    margin-bottom: 14px;
}

.res-section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 10.5pt;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #0f172a;
    text-transform: uppercase;
    border-bottom: 1.5px solid var(--paper-border);
    padding-bottom: 3px;
    margin-bottom: 8px;
    page-break-after: avoid !important;
    break-after: avoid !important;
}

/* Summary Text */
.res-summary-text {
    font-size: 9.2pt;
    color: #1e293b;
    text-align: justify;
    line-height: 1.5;
}

/* Skills Category Table */
.res-skills-table {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.res-skill-row {
    font-size: 9.2pt;
    display: grid;
    grid-template-columns: minmax(130px, auto) 10px 1fr;
    align-items: baseline;
    line-height: 1.4;
}

.res-skill-label {
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    padding-right: 4px;
}

.res-skill-sep {
    color: #64748b;
    text-align: center;
}

.res-skill-val {
    color: #1e293b;
}

/* Dynamic Skills Container in Left Editor */
.dynamic-skills-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dynamic-skill-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dynamic-skill-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* Certifications & Education */
.res-certs-container, .res-edu-container {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.res-bullet-list {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.res-bullet-list li {
    font-size: 9.2pt;
    color: #1e293b;
    line-height: 1.4;
    position: relative;
    padding-left: 16px;
}

.res-bullet-list li::before {
    content: "•";
    position: absolute;
    left: 2px;
    top: 0;
    color: #0f172a;
    font-weight: 700;
}

/* Experience List */
.res-experience-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.res-exp-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    page-break-inside: auto;
    break-inside: auto;
}

.res-exp-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    page-break-after: avoid;
    break-after: avoid;
}

.res-exp-company {
    font-size: 10pt;
    font-weight: 700;
    color: #0f172a;
}

.res-exp-role {
    font-size: 9.5pt;
    font-weight: 600;
    color: #334155;
}

.res-exp-date {
    font-size: 9pt;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

.res-exp-bullets {
    padding-left: 18px;
    margin-top: 3px;
}

.res-exp-bullets li {
    font-size: 9.0pt;
    color: #1e293b;
    margin-bottom: 2px;
    line-height: 1.4;
}

/* Projects List */
.res-projects-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.res-proj-card {
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 9px 12px;
    background: rgba(248, 250, 252, 0.75);
    page-break-inside: auto;
    break-inside: auto;
    margin-bottom: 8px;
}

.res-proj-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 4px;
    margin-bottom: 6px;
    page-break-after: avoid;
    break-after: avoid;
}

.res-proj-name {
    font-size: 10pt;
    font-weight: 800;
    color: #0f172a;
    text-transform: uppercase;
}

.res-proj-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
    font-size: 8.8pt;
    margin-bottom: 6px;
}

.res-proj-meta-item {
    display: flex;
    gap: 6px;
}

.res-proj-meta-label {
    font-weight: 700;
    color: #334155;
    min-width: 80px;
}

.res-proj-meta-val {
    color: #0f172a;
}

.res-proj-env {
    grid-column: span 2;
}

.res-proj-desc {
    font-size: 8.9pt;
    color: #334155;
    margin-bottom: 6px;
    font-style: italic;
}

.res-proj-bullets {
    padding-left: 18px;
}

.res-proj-bullets li {
    font-size: 8.9pt;
    color: #0f172a;
    margin-bottom: 3px;
    line-height: 1.38;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

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

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    background: var(--bg-input);
}

.modal-info-box {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.status-msg {
    font-size: 0.8rem;
    margin-top: 6px;
}

.status-msg.success { color: var(--success-color); }
.status-msg.error { color: var(--danger-color); }

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--accent-color);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* Print Optimization (Watermark on EVERY A4 page center & Multi-page support) */
@media print {
    @page {
        size: A4 portrait;
        margin: 12mm 15mm;
    }

    *, *:before, *:after {
        box-shadow: none !important;
        text-shadow: none !important;
    }

    html, body {
        width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        background: #ffffff !important;
        color: #000000 !important;
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    .main-header,
    .workspace-toolbar,
    .editor-pane,
    .modal-overlay,
    .toast,
    .glow-bg,
    .header-actions {
        display: none !important;
    }

    .main-content, 
    .workspace-section, 
    .workspace-grid, 
    .preview-pane,
    .preview-stage {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        transform: none !important;
    }

    .resume-sheet {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
    }

    /* Fixed Watermark: Automatically repeated in center of EVERY printed A4 page */
    .resume-watermark-container {
        display: flex !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        align-items: center !important;
        justify-content: center !important;
        pointer-events: none !important;
        z-index: 0 !important;
        transform: none !important;
    }

    .resume-watermark-container.hidden {
        display: none !important;
    }

    .resume-watermark-img {
        width: 155mm !important;
        max-width: 80% !important;
        height: auto !important;
        opacity: 0.25 !important;
        filter: contrast(1.1) brightness(1.05) !important;
        transform: rotate(-15deg) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .res-section {
        page-break-inside: auto !important;
        break-inside: auto !important;
    }

    .res-proj-card, .res-exp-item, .dynamic-item-card {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
}

/* Responsive adjustments */
@media (max-width: 960px) {
    .workspace-grid {
        grid-template-columns: 380px 1fr;
    }
}
