/* ============================================
   RESUM8 STUDIO - ENGINEERED MASTERPIECE
   V.3.0 // MONOCHROME PRECISION SYSTEM
   ============================================ */

/* === ROOT VARIABLES === */
:root {
    /* Theme - Absolute Monochrome */
    --bg-void: #000000;
    --bg-panel: #050505;
    --bg-surface: #0a0a0a;
    --bg-hover: #161616;

    /* Borders - Precise */
    --border-dim: #1a1a1a;
    --border-mid: #2a2a2a;
    --border-bright: #444444;
    --border-active: #ffffff;

    /* Text */
    --text-primary: #ffffff;
    --text-sec: #888888;
    --text-dim: #555555;
    --text-inv: #000000;

    /* Accents - Minimal */
    --accent: #ffffff;
    --accent-dim: rgba(255, 255, 255, 0.2);
    --error: #ff3333;

    /* Typography */
    --font-display: 'Space Grotesk', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;

    /* Spacing & Layout */
    --rail-width: 64px;
    --panel-width: 420px;
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --radius-sm: 2px;
    --radius-md: 4px;

    /* Animation */
    --ease-tech: cubic-bezier(0.2, 0, 0, 1);
}

/* === RESET === */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
}

body {
    background-color: var(--bg-void);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
    height: 100vh;
    overflow: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* === LAYOUT GRID === */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    transition: transform 0.4s var(--ease-tech);
    /* Smooth layout shift */
}

.app-container.editor-expanded .panel-left {
    width: 0;
    opacity: 0;
    overflow: hidden;
}

.app-container.editor-expanded .sidebar-rail {
    transform: translateX(-100%);
}

/* === LEFT: SIDEBAR RAIL === */
.sidebar-rail {
    width: var(--rail-width);
    background: var(--bg-void);
    border-right: 1px solid var(--border-dim);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-md) 0;
    z-index: 50;
    flex-shrink: 0;
}

.rail-logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 40px;
    letter-spacing: -0.5px;
}

.rail-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    flex: 1;
}

.rail-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s var(--ease-tech);
}

.rail-btn svg {
    width: 20px;
    height: 20px;
    opacity: 0.7;
}

.rail-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.rail-btn.active {
    color: var(--text-inv);
    background: var(--text-primary);
    border-color: var(--text-primary);
}

.rail-btn.active svg {
    opacity: 1;
}

.rail-btn-small {
    color: var(--text-dim);
    transition: 0.2s;
    cursor: pointer;
}

.rail-btn-small:hover {
    color: var(--error);
}

/* === LEFT: PANEL BODY === */
.panel-left {
    display: flex;
    flex-shrink: 0;
}

.sidebar-body {
    width: var(--panel-width);
    background: var(--bg-panel);
    border-right: 1px solid var(--border-dim);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.panel-header {
    height: 60px;
    border-bottom: 1px solid var(--border-dim);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-lg);
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(10px);
}

.header-title {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--text-primary);
    font-weight: 600;
}

.header-meta {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
    border: 1px solid var(--border-dim);
    padding: 2px 6px;
    border-radius: 2px;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
    display: none;
    flex-direction: column;
    gap: 32px;
}

.panel-content.active {
    display: flex;
    animation: fadeUp 0.3s var(--ease-tech);
}

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

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

/* === NEURAL FLOW === */
.neural-flow {
    display: flex;
    justify-content: space-between;
    position: relative;
    padding: 10px 0;
    margin-bottom: 10px;
}

.neural-flow::after {
    content: '';
    position: absolute;
    top: 14px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-dim);
    z-index: 0;
}

.node {
    width: 8px;
    height: 8px;
    background: var(--bg-void);
    border: 1px solid var(--text-dim);
    position: relative;
    z-index: 1;
    transform: rotate(45deg);
    /* Diamond shape */
    transition: 0.3s var(--ease-tech);
}

.node.active {
    background: var(--text-primary);
    border-color: var(--text-primary);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.node-label {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%) rotate(-45deg);
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-dim);
    white-space: nowrap;
    margin-top: 4px;
}

.node.active .node-label {
    color: var(--text-primary);
}

/* === FORMS & INPUTS === */
.editor-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.editor-header {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-sec);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.code-editor,
.form-input,
.form-textarea {
    background: var(--bg-surface);
    border: 1px solid var(--border-dim);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    transition: 0.2s;
    width: 100%;
}

.code-editor {
    min-height: 120px;
    line-height: 1.6;
    resize: vertical;
}

.code-editor:focus,
.form-input:focus {
    border-color: var(--border-bright);
    background: var(--bg-hover);
}

.code-editor::placeholder {
    color: var(--border-mid);
    font-style: normal;
}

select {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-dim);
    color: var(--text-primary);
    padding: 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    appearance: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23555555' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

select:hover {
    border-color: var(--border-bright);
}

/* === BUTTONS === */
.run-btn {
    background: var(--text-primary);
    color: var(--text-inv);
    border: none;
    padding: 16px;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    width: 100%;
    margin-top: 20px;
    border-radius: var(--radius-sm);
    transition: 0.2s;
}

.run-btn:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

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

.run-btn.processing {
    background: var(--bg-hover);
    color: var(--text-dim);
    cursor: wait;
    position: relative;
    overflow: hidden;
}

.run-btn.processing::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: btn-loading 1.5s infinite;
}

.run-btn.success {
    background: #00FF9D;
    color: #000;
}

@keyframes btn-loading {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* === TOGGLE === */
.portfolio-toggle-container {
    border: 1px solid var(--border-dim);
    background: var(--bg-surface);
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: var(--radius-sm);
}

.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-info {
    display: flex;
    flex-direction: column;
}

.toggle-title {
    font-size: 12px;
    font-weight: 500;
}

.toggle-desc {
    font-size: 10px;
    color: var(--text-dim);
}

.toggle-label {
    width: 36px;
    height: 20px;
    background: var(--border-mid);
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: 0.2s;
}

.toggle-checkbox {
    display: none;
}

.toggle-slider {
    width: 16px;
    height: 16px;
    background: var(--text-primary);
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: 0.2s;
}

.toggle-checkbox:checked+.toggle-label {
    background: var(--text-primary);
}

.toggle-checkbox:checked+.toggle-label .toggle-slider {
    left: 18px;
    background: black;
}

/* === STATUS INDICATOR === */
.status-indicator {
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: var(--bg-hover);
    border-radius: 20px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: var(--text-primary);
    border-radius: 50%;
    animation: blink 2s infinite;
}

.status-indicator.hidden {
    display: none;
}

@keyframes blink {
    50% {
        opacity: 0.3;
    }
}

/* === SECTION LIST (EDIT) === */
.section-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-dim);
    padding: 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: grab;
    transition: 0.2s;
    border-radius: var(--radius-sm);
}

.section-item:hover {
    border-color: var(--border-mid);
    background: var(--bg-hover);
}

.drag-handle {
    color: var(--text-dim);
    font-size: 12px;
    letter-spacing: 2px;
}

.section-icon {
    opacity: 0.5;
    font-size: 14px;
}

.section-name {
    font-weight: 500;
    font-size: 12px;
    flex: 1;
}

.section-edit-btn {
    background: transparent;
    border: 1px solid var(--border-dim);
    color: var(--text-dim);
    font-size: 10px;
    padding: 4px 8px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 2px;
}

.section-edit-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* === PREVIEW CANVAS === */
.panel-right {
    flex: 1;
    background: #0e0e0e;
    /* Slightly lighter than void for contrast */
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Dot Grid Pattern */
    background-image: radial-gradient(var(--border-mid) 1px, transparent 1px);
    background-size: 24px 24px;
}


.preview-viewport {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    /* Center pages horizontally */
    position: relative;
    overflow-y: auto;
    /* ENABLE SCROLLING */
    padding: 60px 0;
    /* Vertical breathing room */
}

/* Page Container - Transparent Wrapper */
#resume-document {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    /* SPACE BETWEEN PAGES */
    width: 100%;
    padding-bottom: 100px;
    transform-origin: top center;
    transition: transform 0.2s;
}

#resume-document.hidden {
    display: none;
}

/* The Actual Pages (A4 Sheets) */
.cover-letter-page,
.resume-page {
    position: relative;
    background: white;
    color: #1a1a1a;
    width: 210mm;
    min-height: 297mm;
    /* A4 */
    padding: var(--print-padding, 25mm);
    box-shadow: 0 0 0 1px #333, 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    /* Clean edges */
    transition: box-shadow 0.3s;
}

/* Page Separation/Divider Indicator (Visual only, distinct from gap) */
.resume-page::before {
    content: "PAGE 1 · RESUME";
    position: absolute;
    top: -25px;
    left: 0;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 1px;
}

.cover-letter-page::before {
    content: "PAGE 0 · COVER LETTER";
    position: absolute;
    top: -25px;
    left: 0;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 1px;
}

/* High Contrast Selection on White Paper */
#resume-document *::selection {
    background: rgba(0, 0, 0, 0.15);
    /* Light Grey Selection */
    color: black;
}

/* Editable Hover Hints */
[data-editable] {
    transition: outline 0.2s;
    outline: 1px solid transparent;
    border-radius: 2px;
}

[data-editable]:hover {
    outline: 1px dashed rgba(0, 0, 0, 0.2);
    background: rgba(0, 0, 0, 0.02);
    cursor: text;
}


/* === RIGHT: MISSION CONTROL HUD === */
.artifact-controls {
    position: absolute;
    bottom: 40px;
    /* Lifted up slightly */
    background: #050505;
    /* Solid dark/void background */
    border: 1px solid var(--border-dim);
    padding: 12px 24px;
    /* More breathing room */
    border-radius: 100px;
    display: flex;
    gap: 40px;
    /* Increased primary gap */
    align-items: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
    z-index: 100;
}

.ctrl-group {
    display: flex;
    align-items: center;
    gap: 20px;
    /* Increased internal gap */
    position: relative;
}

/* Vertical Separators between groups */
.ctrl-group:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -20px;
    /* Halfway between the 40px gap */
    height: 24px;
    width: 1px;
    background: var(--border-dim);
}

.ctrl-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    /* Better label spacing */
}

.ctrl-label {
    font-size: 9px;
    font-family: var(--font-mono);
    color: var(--text-dim);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.ctrl-value {
    font-size: 12px;
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--text-primary);
}

.ctrl-btn-icon,
.ctrl-btn-text {
    background: transparent;
    border: 1px solid transparent;
    /* Prepare for border hover */
    color: var(--text-sec);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 6px 12px;
    /* Clickable areas */
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ctrl-btn-icon:hover,
.ctrl-btn-text:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-color: var(--border-dim);
}

/* Specific tweaks for icon-only buttons */
.ctrl-btn-icon {
    padding: 6px;
    width: 32px;
    height: 32px;
}

/* === DIAGRAM - HYPER-COMPLEX 3D STRUCTURE === */
.agent-diagram {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    perspective: 500px;
    /* Enhanced depth */
}

/* Primary Gimbal Frame */
.diagram-circle {
    width: 130px;
    height: 130px;
    margin-bottom: 24px;
    position: relative;
    transform-style: preserve-3d;
    border: 1px solid rgba(140, 140, 140, 0.1);
    border-radius: 50%;
    animation: gimbal-rotate-main 20s linear infinite;
}

/* Outer Orbital System (Multi-axis) */
.diagram-circle::before {
    content: '';
    position: absolute;
    inset: -15px;
    border-top: 1px solid rgba(160, 160, 160, 0.3);
    /* Bright arc */
    border-bottom: 1px solid rgba(160, 160, 160, 0.3);
    /* Bright arc */
    border-left: 1px dashed rgba(100, 100, 100, 0.1);
    /* Ghost side */
    border-right: 1px dashed rgba(100, 100, 100, 0.1);
    /* Ghost side */
    border-radius: 50%;
    transform-style: preserve-3d;
    animation: complex-orbit 12s linear infinite reverse;
}

/* Inner Geometric Core (Variable Geometry) */
.diagram-circle::after {
    content: '';
    position: absolute;
    inset: 20px;
    border: 1px solid rgba(120, 120, 120, 0.25);
    background: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.02) 50%, transparent 60%);
    transform-style: preserve-3d;
    animation:
        core-transform 15s ease-in-out infinite,
        core-spin 8s linear infinite;
}

/* Text Enhancements */
.agent-diagram span {
    letter-spacing: 4px;
    opacity: 0.3;
    font-weight: 300;
    transition: all 0.5s ease;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.agent-diagram:hover span {
    opacity: 0.7;
    letter-spacing: 6px;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

/* 3D Animations */

/* Main frame rotates on distorted axes */
@keyframes gimbal-rotate-main {
    0% {
        transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
    }

    100% {
        transform: rotateX(360deg) rotateY(180deg) rotateZ(360deg);
    }
}

/* Complex orbit with wobble */
@keyframes complex-orbit {
    0% {
        transform: rotateX(60deg) rotateY(0deg) rotateZ(0deg);
    }

    100% {
        transform: rotateX(60deg) rotateY(360deg) rotateZ(360deg);
    }
}

/* Core shape shifting */
@keyframes core-transform {

    0%,
    100% {
        border-radius: 50%;
    }

    /* Sphere */
    25% {
        border-radius: 5%;
    }

    /* Cube-ish */
    50% {
        border-radius: 50% 50% 5% 5%;
    }

    /* Cylinder-ish */
    75% {
        border-radius: 5% 50% 50% 5%;
    }

    /* Cone-ish */
}

/* Rapid core spin */
@keyframes core-spin {
    0% {
        transform: rotateX(0deg) rotateZ(0deg);
    }

    100% {
        transform: rotateX(-360deg) rotateZ(180deg);
    }
}

/* === AGENT CONSOLE WRAPPER === */
/* === AGENT CONSOLE WRAPPER === */
.console-section {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    background: var(--bg-surface);
    border-left: 1px solid var(--border-dim);
    border-bottom: 1px solid var(--border-dim);
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 10px;
    z-index: 90;
    transition: max-height 0.3s var(--ease-tech);
    max-height: 200px;
    /* Expanded Height */
    overflow: hidden;
}

.console-section.collapsed {
    max-height: 38px;
    /* Header Height Only */
}

/* Arrow Logic: Default (Expanded) -> Point Up (180deg) */
.console-expand-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    transition: transform 0.3s;
    transform: rotate(180deg);
}

/* Arrow Logic: Collapsed -> Point Down (0deg) */
.console-section.collapsed .console-expand-btn {
    transform: rotate(0deg);
}

.console-section.collapsed .console-window {
    opacity: 0;
    pointer-events: none;
}

.console-section.collapsed .console-expand-btn {
    transform: rotate(180deg);
}

.console-header {
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-dim);
    background: var(--bg-void);
}

.console-window {
    height: 150px;
    overflow-y: auto;
    padding: 12px;
}

.log-entry {
    margin-bottom: 4px;
    display: block;
}

.log-time {
    color: var(--text-dim);
    margin-right: 8px;
}

.log-msg.error {
    color: var(--error);
}

.log-msg.success {
    color: var(--text-primary);
}

.log-msg.process {
    color: var(--text-sec);
}

/* === MODAL === */
.section-editor-modal {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.section-editor-modal.hidden {
    display: none;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-dim);
    background: var(--bg-surface);
    display: flex;
    justify-content: space-between;
}

.modal-content {
    flex: 1;
    padding: 40px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    overflow-y: auto;
}

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

.apply-btn {
    background: var(--text-primary);
    color: black;
    padding: 10px 24px;
    border: none;
    font-family: var(--font-mono);
    font-weight: 600;
    cursor: pointer;
}

/* === INNER COMPONENT STYLES (RESTORED & MONOCHROME) === */

/* --- Quick Actions --- */
.quick-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid var(--border-dim);
}

.quick-action-btn {
    background: transparent;
    border: 1px dashed var(--border-mid);
    color: var(--text-dim);
    padding: 8px 12px;
    font-family: var(--font-mono);
    font-size: 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: 0.2s;
}

.quick-action-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
    border-style: solid;
    background: var(--bg-hover);
}

/* --- AI Tools --- */
.ai-tools-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.ai-tool-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-dim);
    color: var(--text-sec);
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    cursor: pointer;
    transition: 0.2s;
    border-radius: var(--radius-sm);
}

.ai-tool-btn svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.ai-tool-btn:hover {
    border-color: var(--border-bright);
    color: var(--text-primary);
    background: var(--bg-hover);
}

.tone-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: var(--text-dim);
    border: 1px solid var(--border-dim);
    padding: 8px;
    border-radius: var(--radius-sm);
}

/* --- Action Verbs --- */
.verbs-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-verbs-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.verb-tag {
    background: var(--bg-hover);
    color: var(--text-sec);
    padding: 4px 8px;
    font-size: 10px;
    font-family: var(--font-mono);
    border-radius: 2px;
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid transparent;
}

.verb-tag:hover {
    color: var(--text-inv);
    background: var(--text-primary);
}

.refresh-verbs-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 10px;
    cursor: pointer;
    text-align: left;
    margin-top: 4px;
}

.refresh-verbs-btn:hover {
    color: var(--text-primary);
}

/* --- Style Panel: Templates --- */
.style-section {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.section-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-sec);
    letter-spacing: 1px;
}

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

.template-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-dim);
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: 0.2s;
    border-radius: var(--radius-sm);
}

.template-card:hover {
    border-color: var(--border-mid);
}

.template-card.active {
    border-color: var(--text-primary);
    background: var(--bg-hover);
}

.template-preview {
    width: 60px;
    height: 80px;
    background: var(--border-dim);
    position: relative;
    opacity: 0.5;
}

.template-preview::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 5px;
    right: 5px;
    height: 4px;
    background: var(--text-dim);
}

.template-card span {
    font-size: 11px;
    color: var(--text-dim);
}

.template-card.active span {
    color: var(--text-primary);
}

/* --- Style Panel: Colors --- */
.color-grid {
    display: flex;
    gap: 8px;
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: 0.2s;
}

.color-swatch.active {
    border-color: var(--text-primary);
    transform: scale(1.1);
}

/* --- Style Panel: Typography & Spacing --- */
.typography-controls,
.spacing-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.control-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-row label {
    font-size: 10px;
    color: var(--text-dim);
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    /* Standard property */
    width: 100%;
    height: 2px;
    background: var(--border-mid);
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* --- Analysis: ATS --- */
.analysis-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-dim);
    padding: 16px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ats-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 2px 6px;
    background: var(--bg-hover);
}

.ats-score-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.score-ring {
    width: 80px;
    height: 80px;
    position: relative;
}

.score-ring svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.ring-bg,
.ring-progress {
    fill: none;
    stroke-width: 8;
}

.ring-bg {
    stroke: var(--border-dim);
}

.ring-progress {
    stroke: var(--text-primary);
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: 1s;
}

.score-value {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#ats-score-number {
    font-size: 18px;
    font-weight: 700;
}

.score-label {
    font-size: 8px;
    color: var(--text-dim);
}

.ats-breakdown {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.breakdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
}

.breakdown-label {
    width: 80px;
    color: var(--text-dim);
}

.breakdown-bar {
    flex: 1;
    height: 4px;
    background: var(--border-dim);
    border-radius: 2px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--text-sec);
    width: 0;
    transition: 1s;
}

.breakdown-value {
    width: 30px;
    text-align: right;
    font-family: var(--font-mono);
}

.analysis-btn {
    width: 100%;
    padding: 10px;
    background: var(--bg-hover);
    border: 1px solid var(--border-dim);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 11px;
    cursor: pointer;
}

.analysis-btn:hover {
    border-color: var(--text-primary);
}

/* --- Analysis: Keywords --- */
.keyword-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.keyword-title {
    font-size: 10px;
    font-weight: 600;
    display: block;
    margin-bottom: 6px;
}

.keyword-title.found {
    color: var(--text-primary);
}

.keyword-title.missing {
    color: var(--text-dim);
}

.keyword-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.keyword-tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 2px;
    font-family: var(--font-mono);
}

.keyword-tag.found {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-mid);
}

.keyword-tag.missing {
    background: rgba(255, 50, 50, 0.1);
    color: var(--error);
    border: 1px solid rgba(255, 50, 50, 0.2);
}

/* --- Stats --- */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.stat-item {
    background: var(--bg-void);
    padding: 8px;
    border: 1px solid var(--border-dim);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-mono);
}

.stat-label {
    font-size: 9px;
    color: var(--text-dim);
    margin-top: 2px;
}

/* --- Inline Toolbar --- */
.inline-toolbar {
    position: absolute;
    z-index: 1000;
    background: var(--bg-surface);
    border: 1px solid var(--border-dim);
    padding: 6px;
    border-radius: 4px;
    display: flex;
    gap: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    transform: translateX(-50%);
}

.inline-toolbar.hidden {
    display: none;
}

.inline-toolbar button {
    background: transparent;
    border: none;
    color: var(--text-sec);
    width: 24px;
    height: 24px;
    cursor: pointer;
    border-radius: 2px;
}

.inline-toolbar button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.toolbar-divider {
    width: 1px;
    background: var(--border-dim);
    margin: 0 4px;
}

.ai-inline-btn {
    color: var(--text-primary) !important;
    font-weight: 600;
    width: auto !important;
    padding: 0 8px;
}

/* === AI INTELLIGENCE POPUP === */
.ai-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 360px;
    background: #000000;
    border: 1px solid var(--border-bright);
    z-index: 2000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-md);
    overflow: hidden;
    animation: popupIn 0.2s var(--ease-tech);
}

@keyframes popupIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.ai-popup.hidden {
    display: none;
}

.ai-popup-header {
    padding: 12px 16px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-dim);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 1px;
    font-weight: 600;
    color: var(--text-primary);
}

.close-popup-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 16px;
}

.close-popup-btn:hover {
    color: var(--text-primary);
}

.ai-popup-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.original-text p,
.rewritten-text p {
    font-size: 12px;
    color: var(--text-sec);
    line-height: 1.5;
    background: var(--bg-surface);
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-dim);
    margin-top: 4px;
}

.popup-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ai-option-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-dim);
    padding: 10px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 11px;
    font-family: var(--font-mono);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.ai-option-btn:hover {
    border-color: var(--text-primary);
    background: var(--bg-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* === PAGE HOVER STATES === */
[data-editable] {
    position: relative;
    transition: all 0.2s ease;
}

[data-editable]::after {
    content: "EDIT";
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--text-primary);
    color: black;
    font-size: 8px;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 2px;
    opacity: 0;
    transform: translateY(4px);
    transition: 0.2s;
    pointer-events: none;
    font-family: var(--font-mono);
    z-index: 10;
}

[data-editable]:hover {
    box-shadow: 0 0 0 1px var(--text-primary) inset;
    background: rgba(0, 0, 0, 0.03);
    cursor: text;
}

[data-editable]:hover::after {
    opacity: 1;
    transform: translateY(0);
}


.mini-btn {
    font-size: 9px;
    padding: 2px 6px;
    background: transparent;
    border: 1px solid var(--border-dim);
    color: var(--text-dim);
    cursor: pointer;
}

.mini-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

/* === MISSING COMPONENTS (PATCH V.3.1) === */

/* --- Generate Panel Controls --- */
.controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* --- Edit Panel Headers --- */
.edit-tools-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.edit-actions {
    display: flex;
    gap: 4px;
}

.tool-btn {
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}

.tool-btn:not(:disabled):hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.tool-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* --- Save/Load Section --- */
.save-load-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.version-name-input input {
    width: 100%;
    background: var(--bg-void);
    border: 1px solid var(--border-dim);
    color: var(--text-primary);
    padding: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    border-radius: var(--radius-sm);
}

.version-name-input input:focus {
    border-color: var(--text-primary);
}

.save-load-btns {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.save-btn,
.load-btn,
.export-btn {
    padding: 8px;
    font-size: 10px;
    font-family: var(--font-mono);
    cursor: pointer;
    background: var(--bg-hover);
    border: 1px solid var(--border-dim);
    color: var(--text-dim);
}

.save-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.load-btn:hover {
    border-color: var(--border-bright);
    color: var(--text-primary);
}

.export-btn:hover {
    border-color: var(--border-bright);
    color: var(--text-primary);
}

/* --- HUD Overlay & Scanner --- */
.hud-overlay {
    position: absolute;
    inset: 20px;
    pointer-events: none;
    z-index: 50;
}

.hud-corner {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-dim);
    transition: 0.5s;
}

.hud-corner.top-left {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
}

.hud-corner.top-right {
    top: 0;
    right: 0;
    border-left: none;
    border-bottom: none;
}

.hud-corner.bottom-left {
    bottom: 0;
    left: 0;
    border-right: none;
    border-top: none;
}

.hud-corner.bottom-right {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
}

.scan-beam {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--text-primary);
    box-shadow: 0 0 15px var(--text-primary);
    opacity: 0;
    pointer-events: none;
    z-index: 60;
}

@keyframes scan {
    0% {
        top: 0%;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        top: 100%;
        opacity: 0;
    }
}

.scanning .scan-beam {
    animation: scan 2s linear;
}

/* --- Zoom Cluster --- */
.zoom-cluster {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 2px;
}

#zoom-level {
    font-family: var(--font-mono);
    font-size: 10px;
    min-width: 40px;
    text-align: center;
}

/* === MISSING UTILITIES & COMPONENTS (PATCH V.3.2) === */

/* --- Loading States --- */
.ai-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    color: var(--text-dim);
    font-size: 11px;
    font-family: var(--font-mono);
}

.ai-loading.hidden {
    display: none;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-dim);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* --- Rail Footer --- */
.rail-footer {
    padding: 20px 0;
    border-top: 1px solid var(--border-dim);
    display: flex;
    justify-content: center;
    width: 100%;
}

/* --- Saved Versions List --- */
.saved-versions-list {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.version-item {
    padding: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-dim);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: 0.2s;
}

.version-item:hover {
    border-color: var(--text-primary);
}

.version-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.version-name {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-primary);
}

.version-date {
    font-size: 9px;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

.delete-version {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
}

.delete-version:hover {
    color: var(--error);
}

/* --- Global Scrollbars (Webkit) --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-void);
}

::-webkit-scrollbar-thumb {
    background: var(--border-mid);
    border-radius: 3px;
}

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

/* --- Text Selection --- */
::selection {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* --- Form Elements Extra --- */
input[type="checkbox"] {
    accent-color: var(--text-primary);
}

/* --- Controls Grid Fix --- */
.controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

/* === MISSING EXPORT BUTTON (PATCH V.3.3) === */

.action-btn {
    background: var(--text-primary);
    color: var(--text-inv);
    border: 1px solid var(--text-primary);
    padding: 6px 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: 0.2s;
}

.action-btn:hover {
    background: transparent;
    color: var(--text-primary);
}

/* Placeholder State specifically for Export PDF */
.action-btn.placeholder {
    background: transparent;
    border: 1px dashed var(--text-dim);
    color: var(--text-dim);
    cursor: not-allowed;
}

.action-btn.placeholder:hover {
    border-color: var(--text-dim);
    color: var(--text-dim);
    background: transparent;
}

.coming-soon-badge {
    background: var(--bg-hover);
    color: var(--text-sec);
    font-size: 8px;
    padding: 2px 4px;
    border-radius: 2px;
    border: 1px solid var(--border-dim);
}

/* === COVER LETTER SPACING (ORIGINAL) === */
.cover-paragraph {
    margin-bottom: 24px;
    line-height: 1.8;
    color: #333;
}

/* Ensure the wrapper doesn't capture hovers anymore */
.cover-letter-page[data-editable] {
    pointer-events: none;
    /* Just in case legacy attr remains */
}

.cover-letter-page[data-editable]>* {
    pointer-events: auto;
}

/* Specific Hover adjustments for Cover Letter Sections */
[data-editable="cover-body"] {
    padding: 10px;
    margin: -10px;
    /* Expand hit area slightly */
}

/* === COVER LETTER V2 STYLES (ORIGINAL) === */

/* Modern Header Layout */
.cover-header-modern {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 20px;
}

.header-left .cover-sender-name {
    font-size: 24px;
    font-weight: 700;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

.header-left .cover-sender-title {
    font-size: 14px;
    color: #555;
    margin-top: 4px;
    font-weight: 500;
}

.header-right {
    text-align: right;
    font-size: 10px;
    color: #666;
    font-family: var(--font-mono);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cover-divider {
    height: 1px;
    background: #eee;
    margin-bottom: 30px;
}

/* Recipient Block */
.cover-recipient-block {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.cover-recipient-label,
.subject-label {
    font-size: 10px;
    color: #999;
    font-weight: 600;
    width: 60px;
    padding-top: 4px;
}

.cover-recipient-name {
    font-weight: 700;
    font-size: 12px;
}

.cover-recipient-role {
    font-size: 12px;
    color: #555;
}

/* Subject Block */
.cover-subject-block {
    display: flex;
    gap: 16px;
    margin-bottom: 40px;
    align-items: center;
}

.subject-text {
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
}

/* Signature Block */
.signature-block {
    margin-top: 40px;
}

.handwritten-signature {
    font-family: 'Newsreader', serif;
    /* Using imported font for script-like feel */
    font-style: italic;
    font-size: 32px;
    color: #000;
    margin-bottom: 8px;
    position: relative;
    display: inline-block;
}

/* Simulate pen pressure/flow */
.handwritten-signature::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(-2deg);
}

.printed-name {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    border-top: 1px solid #ddd;
    padding-top: 8px;
    display: inline-block;
    min-width: 200px;
}

/* Closing Text adjustment */
.closing-text {
    margin-bottom: 24px;
}


/* === UNIFIED DOCUMENT DESIGN SYSTEM === */
/* Both Resume and Cover Letter share these base styles */

/* --- Shared Document Base --- */
.resume-page,
.cover-letter-page {
    box-sizing: border-box;
    color: #333;
    font-family: var(--res-font-body, 'Inter', sans-serif);
    font-size: 11px;
    line-height: var(--res-line-height, 1.5);
}

/* --- Shared Header (Compact) --- */
.res-header,
.cover-header-modern {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: calc(12px * var(--res-header-scale, 1));
    margin-bottom: 0;
}

.res-header .header-left,
.cover-header-modern .header-left {
    flex: 1;
}

.res-name,
.cover-sender-name {
    font-size: 24px;
    font-weight: 700;
    font-family: var(--res-font-header, 'Outfit', sans-serif);
    text-transform: uppercase;
    letter-spacing: -0.5px;
    line-height: 1;
    margin-bottom: 4px;
    color: #000;
}

.res-title,
.cover-sender-title {
    font-size: 14px;
    color: #555;
    font-weight: 500;
    margin-top: 4px;
}

.res-header .header-right,
.cover-header-modern .header-right {
    text-align: right;
    font-size: 10px;
    color: #666;
    font-family: var(--font-mono, monospace);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* --- Shared Divider (Compact) --- */
.res-divider,
.cover-divider {
    height: 1px;
    background: #eee;
    margin-bottom: calc(16px * var(--res-header-scale, 1));
}

/* --- Resume Sections (Compact) --- */
.res-section {
    margin-bottom: calc(14px * var(--res-gap-scale, 1));
}

.res-section-title {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    margin-bottom: 8px;
    display: block;
}

/* --- Summary (Match Cover Letter: 12px, 1.8) --- */
.res-summary {
    font-size: 12px;
    color: #333;
    line-height: 1.8;
}

/* --- Experience Block (Match Cover Letter: 20px) --- */
.res-job {
    display: flex;
    flex-direction: column;
    margin-bottom: calc(12px * var(--res-gap-scale, 1));
    page-break-inside: avoid;
}

.res-job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.res-job-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.res-company {
    font-size: 12px;
    font-weight: 700;
    color: #000;
    line-height: 1.2;
}

.res-role {
    font-size: 12px;
    font-weight: 500;
    color: #555;
    line-height: 1.2;
}

.res-date {
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    font-weight: 500;
    color: #888;
    white-space: nowrap;
    flex-shrink: 0;
}

.res-job ul {
    margin-top: calc(8px * var(--res-bullet-scale, 1));
    margin-bottom: 0;
    margin-left: 0;
    margin-right: 0;
    padding-left: 16px;
}

.res-job li {
    font-size: 10px;
    margin-bottom: calc(2px * var(--res-bullet-scale, 1));
    color: #333;
    line-height: 1.5;
}

.res-job li::marker {
    color: #999;
}

/* --- Skills Grid --- */
.res-skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.res-skill-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.res-skill-cat {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    line-height: 1.2;
}

.res-skill-list {
    font-size: 11px;
    line-height: 1.5;
    color: #333;
}

/* --- Education & Projects --- */
.edu-description {
    font-size: 11px;
    color: #555;
    margin-top: 4px;
    line-height: 1.5;
}

/* --- Key Highlights --- */
.res-highlights-list {
    margin: 0;
    padding-left: 16px;
}

.res-highlights-list li {
    font-size: 10px;
    color: #333;
    line-height: 1.4;
    margin-bottom: 2px;
}

.res-highlights-list li::marker {
    color: #999;
}

.res-highlights-list strong {
    color: #000;
    font-weight: 600;
}

/* === AESTHETICS LAB: TEMPLATE SYSTEM === */

/* Base Variables Defaults */
:root {
    --res-title-size: 36px;
    --res-border-width: 3px;
    --res-header-scale: 1;
    --res-gap-scale: 1;
    --res-bullet-scale: 1;
    --res-line-height: 1.5;
    --res-header-align: flex-start;
    --res-font-header: 'Outfit', sans-serif;
    --res-font-body: 'Inter', sans-serif;
}

/* Apply spacing variables to resume elements */
.resume-page,
.cover-letter-page {
    line-height: var(--res-line-height, 1.6);
}

.resume-page li,
.resume-page p,
.res-summary,
.cover-letter-page p {
    line-height: var(--res-line-height, 1.6);
}

/* Bullet spacing controlled by variable */
.res-job li {
    margin-bottom: calc(var(--res-bullet-scale, 1) * 4px);
}

/* --- Font System Grid --- */
.font-system-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

.font-system-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 8px 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.font-system-btn:hover {
    border-color: var(--text-sec);
    color: var(--text-primary);
}

.font-system-btn.active {
    border-color: var(--text-primary);
    background: var(--bg-hover);
    color: var(--text-primary);
}

.fs-name {
    font-size: 10px;
    font-weight: 600;
}

.fs-preview {
    font-size: 8px;
    opacity: 0.6;
    font-family: var(--font-mono);
}

/* Manual Font Controls */
.manual-font-controls {
    padding: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    margin-top: 8px;
}

.manual-font-controls .control-row {
    margin-bottom: 8px;
}

.manual-font-controls .control-row:last-child {
    margin-bottom: 0;
}

/* --- Edit Mode Feedback --- */
.ctrl-value.editing {
    color: #00FF9D;
    animation: pulse-edit 1.5s ease-in-out infinite;
}

@keyframes pulse-edit {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.ctrl-btn-text.active {
    background: var(--text-primary) !important;
    color: var(--text-inv) !important;
    border-color: var(--text-primary) !important;
}

/* Edit mode indicator on viewport */
.preview-viewport.edit-mode-active {
    box-shadow: inset 0 0 0 2px rgba(0, 255, 157, 0.3);
}

.preview-viewport.edit-mode-active::before {
    content: '✏️ EDITING MODE';
    position: absolute;
    top: 8px;
    right: 8px;
    background: #00FF9D;
    color: #000;
    font-size: 9px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 2px;
    z-index: 100;
    font-family: var(--font-mono);
}

/* Resume document editing state */
#resume-document.editing .resume-page,
#resume-document.editing .cover-letter-page {
    box-shadow: 0 0 0 2px rgba(0, 255, 157, 0.2);
}

#resume-document.editing [data-editable]:hover {
    background: rgba(0, 255, 157, 0.05);
    box-shadow: 0 0 0 1px rgba(0, 255, 157, 0.3) inset;
}

/* --- Spacing Handles (Drag to Resize - Top & Bottom) --- */
.spacing-handle {
    position: absolute;
    left: 0;
    right: 0;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: ns-resize;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
    z-index: 100;
    user-select: none;
}

.spacing-handle::before {
    content: '';
    position: absolute;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00FF9D, transparent);
    opacity: 0.5;
}

.spacing-handle::after {
    content: '⋮⋮⋮';
    font-size: 8px;
    color: #00FF9D;
    letter-spacing: 2px;
    transform: rotate(90deg);
}

.spacing-handle-top {
    top: -8px;
}

.spacing-handle-bottom {
    bottom: -8px;
}

.spacing-handle:hover {
    opacity: 1 !important;
    background: linear-gradient(to bottom, transparent, rgba(0, 255, 157, 0.15), transparent);
}

.spacing-handle:hover::before {
    opacity: 1;
    height: 3px;
}

.spacing-handle.active {
    opacity: 1 !important;
    background: rgba(0, 255, 157, 0.2);
}

/* Show handles on parent hover in edit mode */
#resume-document.editing .res-section:hover>.spacing-handle,
#resume-document.editing .res-header:hover>.spacing-handle {
    opacity: 0.6;
}

/* Spacing tooltip */
.spacing-tooltip {
    position: fixed;
    background: #000;
    color: #00FF9D;
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    pointer-events: none;
    z-index: 10000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 255, 157, 0.3);
}

/* --- Quick Presets Grid --- */
.quick-presets-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.preset-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 10px;
}

.preset-btn:hover {
    border-color: var(--text-sec);
    color: var(--text-primary);
}

.preset-btn.active {
    border-color: var(--text-primary);
    background: var(--bg-hover);
    color: var(--text-primary);
}

.preset-icon {
    font-size: 8px;
    letter-spacing: 1px;
    opacity: 0.6;
}

/* --- Custom Color Controls --- */
.color-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.custom-color-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    color: var(--text-dim);
}

.custom-color-row label {
    min-width: 50px;
}

.custom-color-row input[type="color"] {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-dim);
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
    background: transparent;
}

.custom-color-row input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.custom-color-row input[type="color"]::-webkit-color-swatch {
    border-radius: 2px;
    border: none;
}

#color-hex-display {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-sec);
}

/* --- Reset Section --- */
.reset-section {
    padding-top: 16px;
    border-top: 1px solid var(--border-dim);
    margin-top: 8px;
}

.reset-btn {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--border-dim);
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 10px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.reset-btn:hover {
    border-color: var(--error);
    color: var(--error);
}

/* --- EXECUTIVE (Default - Clean Professional) --- */
.resume-page.template-executive .res-divider {
    background: #000;
    height: 2px;
}

.resume-page.template-executive .res-section-title {
    color: #000;
    font-weight: 700;
}

/* --- MODERN (Color Accents) --- */
.resume-page.template-modern .res-divider {
    background: var(--resume-accent, #3b82f6);
    height: 2px;
}

.resume-page.template-modern .res-name {
    color: var(--resume-accent, #3b82f6);
}

.resume-page.template-modern .res-section-title {
    color: var(--resume-accent, #3b82f6);
}

.resume-page.template-modern .res-skill-cat {
    color: var(--resume-accent, #3b82f6);
}

/* --- MINIMAL (Pure Whitespace, Subtle) --- */
.resume-page.template-minimal .res-divider {
    display: none;
}

.resume-page.template-minimal .res-header {
    margin-bottom: 30px;
}

.resume-page.template-minimal .res-section-title {
    font-size: 9px;
    letter-spacing: 2px;
    color: #888;
}

.resume-page.template-minimal .res-company {
    font-weight: 600;
}

.resume-page.template-minimal .res-skills-grid {
    grid-template-columns: repeat(4, 1fr);
}

/* --- CREATIVE (Centered, Statement) --- */
.resume-page.template-creative .res-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.resume-page.template-creative .header-left {
    text-align: center;
}

.resume-page.template-creative .header-right {
    text-align: center;
    margin-top: 12px;
}

.resume-page.template-creative .res-divider {
    width: 60px;
    margin: 0 auto 24px;
    height: 2px;
    background: #000;
}

.resume-page.template-creative .res-name {
    font-size: 32px;
    font-weight: 300;
    letter-spacing: 4px;
}

.resume-page.template-creative .res-section-title {
    text-align: center;
}

.resume-page.template-creative .res-skills-grid {
    grid-template-columns: repeat(2, 1fr);
    text-align: center;
}

.resume-page.template-creative .res-skill-row {
    align-items: center;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 4px;
}

/* === PROFESSIONAL MOBILE EXPERIENCE === */

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 200;
    width: 44px;
    height: 44px;
    background: var(--bg-surface);
    border: 1px solid var(--border-mid);
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.mobile-menu-toggle svg {
    width: 20px;
    height: 20px;
}

.mobile-menu-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--text-primary);
}

/* Drawer Backdrop */
.drawer-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 150;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
    pointer-events: none;
}

.drawer-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* Tablet Breakpoint */
@media screen and (max-width: 1024px) {

    /* Enable body scroll on mobile */
    body {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .drawer-backdrop {
        display: block;
    }

    .app-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    /* Slide-out Drawer Navigation */
    .sidebar-rail {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 72px;
        height: 100vh;
        flex-direction: column;
        padding: 80px 12px 24px;
        border-right: 1px solid var(--border-mid);
        border-bottom: none;
        z-index: 160;
        background: var(--bg-void);
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar-rail.open {
        transform: translateX(0);
    }

    .rail-logo {
        display: none;
    }

    .rail-nav {
        flex-direction: column;
        flex: 1;
        justify-content: flex-start;
        gap: 12px;
    }

    .rail-btn {
        width: 48px;
        height: 48px;
        border-radius: 10px;
        background: var(--bg-surface);
        border: 1px solid var(--border-dim);
    }

    .rail-btn svg {
        width: 22px;
        height: 22px;
    }

    .rail-btn.active {
        background: var(--bg-hover);
        border-color: var(--text-primary);
        color: var(--text-primary);
    }

    .rail-bottom {
        display: none;
    }

    /* FULL-PAGE SCROLLABLE LAYOUT */
    .panel-left {
        width: 100%;
        max-width: none;
        height: auto;
        min-height: auto;
        border-right: none;
        border-bottom: none;
        overflow: visible;
        padding-top: 60px;
        /* Space for menu toggle */
    }

    .panel-header {
        position: sticky;
        top: 0;
        background: linear-gradient(to bottom, var(--bg-panel) 80%, transparent);
        z-index: 10;
        padding: 16px 20px;
        margin-bottom: 8px;
    }

    .panel-title {
        font-size: 11px;
        letter-spacing: 1.5px;
    }

    .sidebar-body {
        padding: 0 16px 24px;
    }

    /* Enhanced Form Elements */
    .input-group {
        margin-bottom: 16px;
    }

    .input-group label {
        font-size: 11px;
        margin-bottom: 8px;
        color: var(--text-sec);
    }

    .input-group textarea {
        min-height: 120px;
        font-size: 15px;
        padding: 14px;
        border-radius: 8px;
        background: var(--bg-surface);
        border: 1px solid var(--border-dim);
        line-height: 1.6;
    }

    .input-group textarea:focus {
        border-color: var(--text-primary);
        outline: none;
    }

    .run-btn {
        padding: 16px 20px;
        font-size: 14px;
        margin-top: 20px;
        border-radius: 10px;
        font-weight: 600;
        letter-spacing: 0.5px;
    }

    /* PREVIEW SECTION - Full Width */
    .panel-right {
        width: 100%;
        min-height: 100vh;
        height: auto;
        overflow: visible;
        padding: 32px 16px 60px;
        display: block;
        background: #0a0a0a;
        border-top: 1px solid var(--border-dim);
    }

    .preview-viewport {
        width: 100%;
        overflow-x: auto;
        overflow-y: visible;
        padding: 0;
        display: flex;
        justify-content: center;
    }

    /* Resume Document - Scrollable with proper scale */
    #resume-document {
        transform: scale(0.48);
        transform-origin: top center;
        margin: 0 auto 200px;
    }

    /* Hide Console */
    .console-section {
        display: none !important;
    }

    /* Agent Diagram */
    .agent-diagram {
        transform: translate(-50%, -50%) scale(0.7);
    }

    /* Controls Grid - Single Column */
    .controls-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .ai-tools-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .ai-tool-btn {
        padding: 14px;
        font-size: 12px;
        border-radius: 8px;
    }

    /* Status Bar */
    .panel-status {
        padding: 12px 16px;
        font-size: 11px;
        background: var(--bg-surface);
        border-radius: 8px;
        margin-top: 16px;
    }

    /* Section Rows - Touch Optimized */
    .section-row {
        padding: 14px 16px;
        min-height: 52px;
        border-radius: 8px;
        margin-bottom: 8px;
    }

    /* Control Rows */
    .ctrl-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px 0;
    }

    .ctrl-row select {
        width: 100%;
        padding: 12px;
        font-size: 14px;
        border-radius: 8px;
    }

    .ctrl-row input[type="range"] {
        width: 100%;
        height: 6px;
    }

    /* Quick Actions */
    .quick-actions {
        flex-direction: column;
        gap: 10px;
    }

    .quick-action-btn {
        padding: 14px;
        font-size: 12px;
        border-radius: 8px;
        text-align: center;
        justify-content: center;
    }

    /* Export Controls */
    .export-dropdown {
        width: 100%;
    }

    .export-btn {
        width: 100%;
        justify-content: center;
        padding: 14px;
        border-radius: 8px;
    }
}

/* Mobile Phone Breakpoint */
@media screen and (max-width: 640px) {
    .app-container {
        min-height: 100dvh;
    }

    .mobile-menu-toggle {
        top: 10px;
        left: 10px;
        width: 40px;
        height: 40px;
    }

    .panel-left {
        padding-top: 56px;
    }

    .panel-header {
        padding: 14px 16px;
    }

    .sidebar-body {
        padding: 0 14px 20px;
    }

    .input-group textarea {
        min-height: 100px;
        font-size: 14px;
        padding: 12px;
    }

    .run-btn {
        padding: 14px 16px;
        font-size: 13px;
    }

    .panel-right {
        padding: 24px 12px 80px;
    }

    #resume-document {
        transform: scale(0.38);
        margin-bottom: 300px;
    }

    .agent-diagram {
        transform: translate(-50%, -50%) scale(0.6);
    }

    /* Quick Presets */
    .quick-presets-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .preset-btn {
        padding: 12px 8px;
        font-size: 9px;
    }
}

/* Very Small Phones */
@media screen and (max-width: 380px) {
    .mobile-menu-toggle {
        width: 36px;
        height: 36px;
    }

    .panel-left {
        padding-top: 50px;
    }

    #resume-document {
        transform: scale(0.32);
        margin-bottom: 400px;
    }

    .run-btn {
        padding: 12px;
        font-size: 12px;
    }

    .input-group textarea {
        min-height: 80px;
        font-size: 13px;
    }

    .section-row {
        padding: 12px;
        min-height: 48px;
    }
}

/* Landscape Mobile */
@media screen and (max-width: 900px) and (orientation: landscape) {
    .app-container {
        flex-direction: row;
        height: 100vh;
        overflow: hidden;
    }

    .sidebar-rail {
        position: relative;
        transform: none;
        width: 60px;
        height: 100vh;
        padding: 12px 8px;
        border-right: 1px solid var(--border-dim);
    }

    .sidebar-rail.open {
        transform: none;
    }

    .mobile-menu-toggle {
        display: none;
    }

    .drawer-backdrop {
        display: none;
    }

    .rail-nav {
        flex-direction: column;
        gap: 8px;
    }

    .rail-btn {
        width: 40px;
        height: 40px;
    }

    .panel-left {
        width: 50%;
        height: 100vh;
        padding-top: 0;
        overflow-y: auto;
        border-right: 1px solid var(--border-mid);
    }

    .panel-right {
        flex: 1;
        height: 100vh;
        overflow: auto;
        padding: 20px;
        border-top: none;
    }

    #resume-document {
        transform: scale(0.45);
        margin-bottom: 100px;
    }
}

/* Very Small Phones */
@media screen and (max-width: 380px) {
    .sidebar-rail {
        height: 46px;
    }

    .rail-logo {
        display: none;
    }

    .panel-left {
        height: 60vh;
    }

    #resume-document {
        transform: scale(0.32);
    }

    .run-btn {
        padding: 10px;
        font-size: 11px;
    }

    .input-group textarea {
        min-height: 60px;
    }
}

/* Landscape Mobile */
@media screen and (max-width: 900px) and (orientation: landscape) {
    .app-container {
        flex-direction: row;
    }

    .sidebar-rail {
        flex-direction: column;
        width: 50px;
        height: 100vh;
        padding: 8px 0;
        border-bottom: none;
        border-right: 1px solid var(--border-dim);
    }

    .rail-nav {
        flex-direction: column;
    }

    .panel-left {
        width: 45%;
        height: 100%;
        max-height: none;
        border-bottom: none;
        border-right: 1px solid var(--border-mid);
    }

    .panel-right {
        flex: 1;
        height: 100%;
    }

    #resume-document {
        transform: scale(0.5);
    }
}

/* === PROFESSIONAL EXPORT DROPDOWN === */
.export-dropdown {
    position: relative;
}

.export-btn {
    display: flex;
    align-items: center;
    gap: 2px;
}

.export-btn svg:last-child {
    transition: transform 0.2s ease;
}

.export-dropdown.open .export-btn svg:last-child {
    transform: rotate(180deg);
}

.export-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.6);
    padding: 8px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
}

.export-dropdown.open .export-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.export-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary, #999);
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.export-option:hover {
    background: rgba(0, 255, 157, 0.1);
    color: #00FF9D;
}

.export-option:hover svg {
    stroke: #00FF9D;
}

.export-option span:first-of-type {
    flex: 1;
}

.export-badge {
    font-size: 8px;
    padding: 2px 6px;
    background: #00FF9D;
    color: #000;
    border-radius: 3px;
    font-weight: 700;
    text-transform: uppercase;
}

.export-divider {
    height: 1px;
    background: var(--border-dim, #222);
    margin: 8px 0;
}

/* Export Button Active State */
.export-btn.active,
.export-dropdown.open .export-btn {
    background: var(--bg-element, #1a1a1a);
    color: #00FF9D;
}

/* Loading State for Export */
.export-option.loading {
    pointer-events: none;
    opacity: 0.5;
}

.export-option.loading::after {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top-color: #00FF9D;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Export Success Animation */
.export-option.success {
    background: rgba(0, 255, 157, 0.15);
    color: #00FF9D;
}

.export-option.success svg {
    stroke: #00FF9D;
}

/* === PDF EXPORT CONTAINER STYLES === */
#pdf-export-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

#pdf-export-container .resume-page,
#pdf-export-container .cover-letter-page {
    width: 210mm !important;
    min-height: 297mm !important;
    padding: 20mm !important;
    background: white !important;
    color: #000 !important;
    box-shadow: none !important;
    margin: 0 !important;
    font-size: 11pt !important;
}

#pdf-export-container * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
}

/* === PRINT MEDIA QUERY === */
@media print {
    body * {
        visibility: hidden;
    }

    #resume-document,
    #resume-document * {
        visibility: visible;
    }

    #resume-document {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    .resume-page,
    .cover-letter-page {
        width: 210mm !important;
        min-height: 297mm !important;
        padding: 20mm !important;
        margin: 0 !important;
        background: white !important;
        box-shadow: none !important;
        page-break-after: always;
    }

    .resume-page:last-child,
    .cover-letter-page:last-child {
        page-break-after: avoid;
    }

    /* Hide UI elements */
    .spacing-handle,
    .console-section,
    .hud-overlay {
        display: none !important;
    }

    /* Ensure colors print */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}