/* ==========================================================================
   1. DYNAMIC STYLING ENGINE (CSS VARIABLES & FONTS)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Merriweather:wght@400;700;900&family=JetBrains+Mono:wght@400;500&family=Roboto:wght@400;500;700&family=Playfair+Display:wght@600;700&family=Open+Sans:wght@400;600;700&family=Montserrat:wght@600;800&family=Space+Grotesk:wght@500;700&display=swap');

:root {
    /* Theme Colors */
    --slide-bg: #ffffff;
    --text-main: #334155;
    --text-heading: #0f172a; 
    --text-muted: #64748b;
    --text-inverted: #ffffff; 
    --accent-color: #001a47; 
    --kicker-color: #be123c; 
    --border-color: #e2e8f0;
    --surface-color: #f8fafc;
    
    /* Typography */
    --font-body: 'Inter', sans-serif;
    --font-heading: 'Inter', sans-serif; 
    --font-code: 'JetBrains Mono', monospace;
    
    /* Status Colors */
    --rag-red: #ef4444;
    --rag-amber: #f59e0b;
    --rag-green: #10b981;
}

/* ==========================================================================
   2. GLOBAL WORKSPACE & UI STYLES
   ========================================================================== */
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Inter', sans-serif; display: flex; flex-direction: column; height: 100vh; overflow: hidden; background: #09090b; color: #f4f4f5; }

body.is-exporting .poster-text,
body.is-exporting .image-caption,
body.is-exporting .zoom-controls { background: rgba(15, 23, 42, 1) !important; backdrop-filter: none !important; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3f3f46; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #52525b; }

/* Navigation & Controls */
.header { background: #18181b; border-bottom: 1px solid #27272a; padding: 0 24px; display: flex; justify-content: space-between; align-items: center; height: 64px; flex-shrink: 0;}
.header-brand { display: flex; align-items: center; gap: 12px; }
.header h1 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: 0.5px; color: #f4f4f5;}
.version-tag { background: #0ea5e9; color: white; font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 800; letter-spacing: 1px;}

.header-controls { display: flex; gap: 12px; align-items: center; }
.btn { background: #27272a; color: #e4e4e7; border: 1px solid #3f3f46; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; transition: all 0.2s ease; display: flex; align-items: center; gap: 8px;}
.btn:hover { background: #3f3f46; border-color: #52525b; color: #ffffff; }
.btn-primary { background: #0ea5e9; border-color: #0ea5e9; color: white; }
.btn-primary:hover { background: #0284c7; border-color: #0284c7; box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3); color: white;}
.hidden-file-input { display: none; }

/* Workspace Setup */
.workspace { display: flex; flex: 1; overflow: hidden; }
.sidebar { width: 50%; background: #18181b; display: flex; flex-direction: column; border-right: 1px solid #27272a; z-index: 10; flex-shrink: 0; overflow: hidden;}

/* Sidebar Tabs */
.sidebar-tabs { display: flex; border-bottom: 1px solid #27272a; background: #18181b; flex-shrink: 0; }
.tab-btn { flex: 1; padding: 14px 0; background: transparent; border: none; border-bottom: 2px solid transparent; color: #a1a1aa; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s; outline: none; }
.tab-btn:hover { color: #f4f4f5; background: rgba(255,255,255,0.02); }
.tab-btn.active { color: #0ea5e9; border-bottom-color: #0ea5e9; background: rgba(14, 165, 233, 0.05); }

.tab-panel { display: none; flex-direction: column; flex: 1; overflow-y: auto; }
.tab-panel.active { display: flex; }
#tab-editor.tab-panel { overflow: hidden; }

/* Theme Settings UI */
.theme-panel { padding: 20px 24px; border-bottom: 1px solid #27272a; background: #09090b; }
.panel-title { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: #a1a1aa; font-weight: 700; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center;}
.preset-group { display: flex; gap: 8px; margin-bottom: 20px; }
.preset-btn { flex: 1; background: #18181b; border: 1px solid #3f3f46; color: #a1a1aa; padding: 8px 0; border-radius: 4px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.2s; text-align: center;}
.preset-btn:hover, .preset-btn.active { background: #27272a; color: #fff; border-color: #0ea5e9; }

.controls-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px;}
.input-group { display: flex; flex-direction: column; gap: 8px; }
.input-group label { font-size: 12px; color: #d4d4d8; font-weight: 500;}

.color-picker { display: flex; align-items: center; gap: 8px; background: #27272a; padding: 6px 10px; border-radius: 6px; border: 1px solid #3f3f46; transition: border-color 0.2s; }
.color-picker:focus-within { border-color: #0ea5e9; }
.color-picker input[type="color"] { border: none; width: 22px; height: 22px; padding: 0; cursor: pointer; background: transparent; }
.color-picker input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-picker input[type="color"]::-webkit-color-swatch { border: 1px solid #52525b; border-radius: 4px; }
.color-picker span { font-size: 12px; color: #a1a1aa; font-family: var(--font-code); }

select.style-select { background: #27272a; color: #e4e4e7; border: 1px solid #3f3f46; padding: 10px; border-radius: 6px; font-size: 13px; outline: none; width: 100%; cursor: pointer; font-family: var(--font-body); transition: border-color 0.2s;}
select.style-select:focus { border-color: #0ea5e9; }

/* Editor & Drag/Drop UI */
.editor-container { display: flex; flex-direction: column; position: relative; background: #09090b; height: 100%; border-top: 1px solid #27272a;}
.editor-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; background: #18181b; border-bottom: 1px solid #27272a;}
.editor-header .panel-title { margin: 0; }
.error-banner { display: none; background: rgba(220, 38, 38, 0.15); color: #fca5a5; padding: 12px 24px; font-size: 13px; font-weight: 500; border-bottom: 1px solid rgba(220, 38, 38, 0.3); font-family: var(--font-code); flex-shrink: 0;}

.editor-wrapper { flex: 1; position: relative; display: flex; min-height: 0; overflow: hidden; }
textarea#json-editor { flex: 1; background: #09090b; color: #38bdf8; font-family: var(--font-code); font-size: 13px; line-height: 1.6; padding: 24px; border: none; resize: none; outline: none; white-space: pre; tab-size: 4;}

.resizer { width: 6px; background: #18181b; border-left: 1px solid #27272a; border-right: 1px solid #27272a; cursor: col-resize; flex-shrink: 0; z-index: 20; transition: background 0.2s ease; }
.resizer:hover, .resizer.resizing { background: #0ea5e9; border-color: #0ea5e9; }

.CodeMirror { position: absolute; top: 0; left: 0; right: 0; bottom: 0; width: 100%; height: 100% !important; font-family: var(--font-code); font-size: 13px; background: #09090b !important; }

.reorder-panel { padding: 16px 24px; border-bottom: 1px solid #27272a; }
.slide-list { list-style: none; padding: 0; margin: 0; flex: 1; overflow-y: auto; }
.slide-list-item { padding: 5px 12px; background: #27272a; margin: 5px 10px; border-radius: 4px; font-size: 12px; color: #d4d4d8; cursor: grab; display: flex; align-items: center; gap: 8px; border: 1px solid transparent; justify-content: space-between;}
.slide-list-item:active { cursor: grabbing; border-color: #0ea5e9; }
.slide-list-item.drag-over { border-top: 2px solid #0ea5e9; }
.slide-actions { display: flex; gap: 4px; flex-shrink: 0;}
.slide-actions button { background: transparent; border: none; cursor: pointer; opacity: 0.5; font-size: 14px; transition: opacity 0.2s, transform 0.1s; padding: 2px 4px; display: flex; align-items: center; justify-content: center; color: #a1a1aa;}
.slide-actions button:hover { opacity: 1; transform: scale(1.1); color: #fff;}

/* ==========================================================================
   3. THE SLIDE ENGINE & CANVAS (16:9 NATIVE RESOLUTION)
   ========================================================================== */
.preview-container { flex: 1; position: relative; display: flex; background: #09090b; overflow: hidden; }
.preview-panel { flex: 1; overflow-y: auto; padding: 40px; display: flex; flex-direction: column; gap: 60px; }

/* Present Mode Settings */
.preview-panel.is-fullscreen { padding: 0; gap: 0; background: #000; justify-content: center; align-items: center; overflow: hidden; display: flex; flex-direction: row; }
.preview-panel.is-fullscreen .slide-wrapper { display: none; height: 100vh !important; width: 100vw !important; align-items: center; justify-content: center; }
.preview-panel.is-fullscreen .slide-wrapper.active-slide { display: flex; }
.preview-panel.is-fullscreen .slide { transform-origin: center center !important; margin: auto; }
.preview-panel.is-fullscreen .viewer-actions { display: none !important; }

.zoom-controls { position: absolute; bottom: 24px; right: 24px; display: flex; gap: 8px; align-items: center; background: rgba(24, 24, 27, 0.9); backdrop-filter: blur(8px); padding: 8px 12px; border-radius: 8px; border: 1px solid #27272a; box-shadow: 0 4px 12px rgba(0,0,0,0.5); z-index: 100; }

.slide-wrapper { width: 100%; display: flex; justify-content: center; position: relative; margin: 0 auto; transition: filter 0.2s ease, margin-top 0.2s ease; cursor: pointer; }
.slide-wrapper:hover { margin-top: -4px; filter: brightness(1.05); }
.slide-wrapper.selected-for-edit .slide { outline: 4px solid #0ea5e9; outline-offset: 4px; box-shadow: 0 0 25px rgba(14, 165, 233, 0.3); }

/* The Slide Object */
.slide {
    width: 1600px; height: 900px; /* Strict Native 16:9 High-Def */
    background-color: var(--slide-bg); color: var(--text-main);
    position: relative; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 4px rgba(0, 0, 0, 0.3);
    padding: 60px 80px 80px 80px; display: flex; flex-direction: column;
    flex-shrink: 0; transform-origin: top center !important;
    border-radius: 8px; transition: background 0.3s, color 0.3s;
}

/* Background Patterns */
.slide[data-pattern="dots"] { background-image: radial-gradient(var(--border-color) 2px, transparent 2px); background-size: 30px 30px; }
.slide[data-pattern="grid"] { background-image: linear-gradient(var(--border-color) 1px, transparent 1px), linear-gradient(90deg, var(--border-color) 1px, transparent 1px); background-size: 50px 50px; }
.slide[data-pattern="diagonal"] { background-image: repeating-linear-gradient(45deg, var(--border-color) 0, var(--border-color) 1px, transparent 1px, transparent 20px); }
.slide[data-pattern="blueprint"] { background-image: linear-gradient(var(--border-color) 1px, transparent 1px), linear-gradient(90deg, var(--border-color) 1px, transparent 1px); background-size: 80px 80px; }

/* Structural Slide Areas */
.slide-header { margin-bottom: 40px; border-bottom: 3px solid var(--accent-color); padding-bottom: 24px; }
.kicker { font-size: 20px; font-weight: 800; text-transform: uppercase; color: var(--kicker-color); letter-spacing: 1.5px; margin-bottom: 16px; font-family: var(--font-body);}
.title { font-size: 46px; font-weight: 700; color: var(--text-heading); margin: 0; font-family: var(--font-heading); line-height: 1.2; letter-spacing: -0.5px;}
.subtitle { font-size: 26px; color: var(--text-muted); margin-top: 14px; font-weight: 400; line-height: 1.4; font-family: var(--font-body);}

.slide-body { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; font-family: var(--font-body); overflow: hidden; position: relative; }

.slide-footer { 
    position: absolute; bottom: 30px; left: 80px; right: 80px; 
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; 
    font-size: 14px; font-weight: 600; color: var(--text-muted); 
    border-top: 1px solid var(--border-color); padding-top: 16px; font-family: var(--font-body);
}
.slide-footer .tracker { justify-self: start; }
.slide-footer .page-num { justify-self: end; }
.footer-logo { justify-self: center; font-size: 14px; font-weight: 700; color: var(--text-heading); letter-spacing: 0.5px; text-transform: uppercase; }

.slide[data-logo="bottom-right"] .page-num { position: absolute; top: -810px; right: -40px; justify-self: end; }
.global-logo { position: absolute; max-height: 50px; max-width: 250px; object-fit: contain; z-index: 50; }
.logo-top-right { top: 40px; right: 40px; }
.logo-bottom-right { bottom: 30px; right: 30px; }

/* Universal Markdown Links & Code */
.slide a { color: var(--accent-color); text-decoration: none; border-bottom: 1px dashed var(--accent-color); transition: opacity 0.2s ease; }
.slide a:hover { opacity: 0.7; border-bottom-style: solid; }
.gantt-bar a, .chevron.active a, .poster-text a, .image-caption a, .slide-layout-divider a { color: var(--text-inverted); border-bottom-color: var(--text-inverted); }
.slide code { font-family: var(--font-code); font-size: 0.9em; background: var(--surface-color); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border-color); color: var(--kicker-color); }
.slide pre code { background: transparent !important; padding: 0 !important; border: none !important; color: inherit !important; }

/* ==========================================================================
   4. THE UNIFIED LAYOUT ENGINE (Grids, Zones & Alignment)
   ========================================================================== */

/* 4A. Parent Grid Structures */
.layout-multi-col { display: flex; flex-direction: row; gap: 60px; flex: 1 1 0%; min-height: 0; min-width: 0; width: 100%; }
.layout-multi-row { display: flex; flex-direction: column; gap: 32px; flex: 1 1 0%; min-height: 0; min-width: 0; width: 100%; align-content: flex-start; }
.layout-dynamic-grid { display: grid; grid-template-columns: var(--grid-cols, repeat(auto-fit, minmax(min(100%, 450px), 1fr))); gap: 40px; height: 100%; align-content: start; }
.layout-split-30-70 { display: grid; grid-template-columns: 3fr 7fr; gap: 60px; height: 100%; }
.layout-split-70-30 { display: grid; grid-template-columns: 7fr 3fr; gap: 60px; height: 100%; }

/* 4B. The Core Container Zone */
.layout-zone, .multi-col-column {
    display: flex; 
    flex-direction: column; 
    gap: 32px; 
    justify-content: flex-start;
    flex: 1 1 0%; 
    min-height: 0;
    min-width: 0; 
    position: relative; 
}
.layout-zone:empty, .multi-col-column:empty { display: none; }

/* ==========================================================================
   5. STANDARD COMPONENT BEHAVIORS (THE OPTIMIZATION)
   ========================================================================== */

/* 5A. FLEX FILLERS: Structural components that stretch fully inside their zones */
.chart-container, .data-table-container, .gantt-container, 
.heatmap-wrapper, .image-container, .raw-html-container, 
.matrix-wrapper, .funnel-container, .timeline-container, .logic-tree {
    width: 100%;
    flex: 1 1 0%;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* 5B. CONTENT FITTERS: Text/UI elements that strictly wrap their content */
.markdown-content, .quote-block, .toc-list, .comparison-list, 
.kpi-group, .kpi-container, .rag-container, .chevron-container, .icon-block {
    width: 100%;
    flex: 0 1 auto;
    min-height: 0;
    min-width: 0;
    container-type: inline-size;
}

/* 5C. LONE WOLF CENTERING: Automatic graceful centering when alone */
.layout-zone > *:only-child {
    margin-top: auto;
    margin-bottom: auto;
}

/* EXCEPT Fillers must explicitly fill 100% height instead of just vertically centering */
:is(.chart-container, .data-table-container, .gantt-container, .heatmap-wrapper, .matrix-wrapper, .image-container, .raw-html-container):only-child {
    margin-top: 0;
    margin-bottom: 0;
    height: 100%;
}

/* ==========================================================================
   6. COMPONENT AESTHETICS (Visual Styling & Internal Layouts)
   ========================================================================== */

/* Markdown Typography */
.markdown-content { font-size: 22px; line-height: 1.4; color: var(--text-main); overflow-wrap: break-word; word-break: break-word; }
.markdown-content :is(h1, h2, h3, h4, h5, h6) { color: var(--text-heading); margin-top: 0; font-family: var(--font-heading); }
.markdown-content h1, .markdown-content h2, .markdown-content h3 { margin-bottom: 16px; font-weight: 700; letter-spacing: -0.5px;}
.markdown-content h3 { font-size: 28px; border-bottom: 2px solid var(--border-color); padding-bottom: 8px;}
.markdown-content h4 { font-size: 22px; margin-bottom: 12px; font-weight: 600; }
.markdown-content h5 { font-size: 18px; margin-bottom: 12px; font-weight: 600; }
.markdown-content h6 { font-size: 16px; margin-bottom: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.markdown-content p { margin-top: 0; margin-bottom: 16px; }
.markdown-content ul, .markdown-content ol { padding-left: 28px; margin-top: 0; }
.markdown-content img { max-width: 100%; height: auto; border-radius: 8px; display: block; margin: 16px 0; }
.markdown-content li { margin-bottom: 14px; padding-left: 8px; line-height: 1.4; }
.markdown-content li::marker { color: var(--accent-color); font-weight: bold; }
.markdown-content strong { color: var(--text-heading); font-weight: 700; }

/* Markdown Tables */
.markdown-content table { display: block; width: 100%; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin-bottom: 16px; font-size: 18px; table-layout: fixed; word-wrap: break-word; overflow-wrap: break-word; }
.markdown-content th, .markdown-content td { border: 1px solid var(--border-color); padding: 10px 14px; text-align: left; overflow-wrap: break-word; word-break: break-word; }
.markdown-content th { background: var(--surface-color); color: var(--text-heading); font-weight: 700; }
.markdown-content th[align="center"], .markdown-content td[align="center"] { text-align: center; }
.markdown-content th[align="right"], .markdown-content td[align="right"] { text-align: right; }
.markdown-content blockquote { border-left: 4px solid var(--accent-color); padding-left: 16px; margin-left: 0; color: var(--text-muted); font-style: italic; }
.slide pre { background: var(--surface-color); padding: 16px; border-radius: 6px; overflow-x: auto; border: 1px solid var(--border-color); font-family: var(--font-code); font-size: 16px; margin: 16px 0; }

/* Lists & Quotes */
.toc-list { max-width: 1000px; margin: 0 auto; }
.toc-list ol { list-style: none; counter-reset: toc-counter; padding: 0; }
.toc-list li { counter-increment: toc-counter; padding: 24px 0; font-size: 32px; font-weight: 600; border-bottom: 2px solid var(--border-color); display: flex; align-items: center; gap: 32px; color: var(--text-heading); }
.toc-list li::before { content: counter(toc-counter, decimal-leading-zero); color: var(--accent-color); font-weight: 800; font-size: 24px; letter-spacing: 2px;}

.comparison-list { display: flex; flex-direction: column; gap: 12px; }
.comparison-list-item { padding: 16px 20px; background: var(--surface-color); border: 1px solid var(--border-color); border-radius: 8px; font-weight: 500; font-size: 19px; display: flex; align-items: flex-start; gap: 16px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); line-height: 1.4; color: var(--text-main); }
.comparison-list-item.positive { border-left: 5px solid var(--accent-color); }
.comparison-list-item.positive::before { content: '✓'; color: var(--rag-green); font-weight: 900; font-size: 20px; line-height: 1.2; }
.comparison-list-item.negative::before { content: '✕'; color: var(--rag-red); font-weight: 900; font-size: 20px; line-height: 1.2; }

.quote-block { font-size: 24px; font-weight: 500; font-style: italic; color: var(--text-heading); padding: 32px; background: var(--surface-color); border-left: 6px solid var(--accent-color); border-radius: 0 8px 8px 0; line-height: 1.5; justify-content: center; }
.quote-block::before { content: '"'; font-size: 80px; position: absolute; top: 10px; left: 20px; color: var(--border-color); opacity: 0.5; font-family: serif; line-height: 1;}

/* Posters & Headings in Custom Blocks */
.poster-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(15, 23, 42, 0.85); color: #f8fafc; padding: 60px 80px; border-radius: 16px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); z-index: 100; text-align: center; border: 1px solid rgba(255, 255, 255, 0.15); box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.6); max-width: 85%; }
.poster-text :is(h1, h2, h3) { color: #ffffff; margin-top: 0; margin-bottom: 16px; font-family: var(--font-heading); font-weight: 900; font-size: 80px; line-height: 1.1; letter-spacing: -2px; }
.poster-text p { font-size: 32px; margin: 0 0 16px 0; color: rgba(248, 250, 252, 0.9); font-weight: 400; line-height: 1.4; }
.poster-text p:last-child { margin-bottom: 0; }

:is(.quote-block, .timeline-desc, .logic-tree-desc) :is(h1, h2, h3, h4, h5, h6) { color: var(--text-heading); font-family: var(--font-heading); font-weight: 700; margin-top: 16px; margin-bottom: 8px; line-height: 1.2; }
:is(.quote-block, .timeline-desc, .logic-tree-desc) :is(h1, h2, h3):first-child { margin-top: 0; }
:is(.quote-block, .timeline-desc, .logic-tree-desc) p { margin-top: 0; margin-bottom: 12px; }
:is(.quote-block, .timeline-desc, .logic-tree-desc) p:last-child { margin-bottom: 0; }
:is(.quote-block, .poster-text, .timeline-desc, .logic-tree-desc) img { max-width: 100%; height: auto; border-radius: 8px; display: block; margin: 12px 0; }
:is(.quote-block, .poster-text, .timeline-desc, .logic-tree-desc) :is(ul, ol) { padding-left: 24px; margin-top: 0; margin-bottom: 12px; }
:is(.quote-block, .poster-text, .timeline-desc, .logic-tree-desc) li { margin-bottom: 6px; line-height: 1.4; padding-left: 4px; }

/* Indicators & KPIs */
.kpi-group { 
    display: flex; 
    flex-direction: row; 
    flex-wrap: wrap; 
    gap: 24px; 
    width: 100%; 
}
.kpi-container { 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    flex: 1 1 calc(20% - 24px); 
}
.kpi-value { font-size: clamp(16px, calc(15cqi + 5cqh), 80px); font-weight: 800; color: var(--text-heading); font-family: var(--font-heading); line-height: 1; letter-spacing: -1px; }
.kpi-label { font-size: clamp(14px, min(14px + 2cqi, 10cqh), 36px); color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.kpi-trend { font-size: clamp(12px, min(12px + 2cqi, 8cqh), 24px); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.trend-up { color: var(--rag-green); }
.trend-down { color: var(--rag-red); }

.rag-container { display: flex; align-items: center; gap: 16px; font-size: 24px; font-weight: 600; color: var(--text-heading); transition: all 0.3s ease; }
.rag-lights { display: flex; gap: clamp(10px, 2.5cqi, 32px); background: var(--surface-color); padding: clamp(10px, 2.5cqi, 32px) clamp(16px, 4cqi, 48px); border-radius: clamp(40px, 10cqi, 120px); border: clamp(1px, 0.5cqi, 4px) solid var(--border-color); transition: all 0.3s ease; }
.rag-circle { width: clamp(22px, 6cqi, 100px); height: clamp(22px, 6cqi, 100px); border-radius: 50%; background: var(--border-color); transition: all 0.3s ease; box-shadow: inset 0 clamp(2px, 0.5cqi, 8px) clamp(4px, 1cqi, 16px) rgba(0,0,0,0.1); }
.rag-circle.red.active { background: var(--rag-red); box-shadow: 0 0 clamp(16px, 4cqi, 48px) rgba(239, 68, 68, 0.5), inset 0 clamp(2px, 0.5cqi, 8px) clamp(4px, 1cqi, 16px) rgba(255,255,255,0.4); }
.rag-circle.amber.active { background: var(--rag-amber); box-shadow: 0 0 clamp(16px, 4cqi, 48px) rgba(245, 158, 11, 0.5), inset 0 clamp(2px, 0.5cqi, 8px) clamp(4px, 1cqi, 16px) rgba(255,255,255,0.4); }
.rag-circle.green.active { background: var(--rag-green); box-shadow: 0 0 clamp(16px, 4cqi, 48px) rgba(16, 185, 129, 0.5), inset 0 clamp(2px, 0.5cqi, 8px) clamp(4px, 1cqi, 16px) rgba(255,255,255,0.4); }

.harvey-ball-row { display: flex; align-items: center; font-size: 22px; font-weight: 500; color: var(--text-heading); }
.harvey-ball-svg { width: 32px; height: 32px; margin-right: 20px; flex-shrink: 0;}

/* Structural Blocks */
.chevron-container { display: flex; gap: 6px; align-items: stretch; padding: 4px; transition: all 0.3s ease; }
.chevron-wrapper { flex: 1 1 0%; min-width: 0; display: flex; filter: drop-shadow(0px 1px 0px var(--border-color)) drop-shadow(0px -1px 0px var(--border-color)) drop-shadow(1px 0px 0px var(--border-color)) drop-shadow(-1px 0px 0px var(--border-color)); }
.chevron { width: 100%; background: var(--surface-color); color: var(--text-heading); padding: 12px 10px 12px 26px; clip-path: polygon(0% 0%, 92% 0%, 100% 50%, 92% 100%, 0% 100%, 8% 50%); display: flex; align-items: center; justify-content: center; text-align: center; font-weight: 700; font-size: 18px; line-height: 1.3; transition: all 0.3s ease; word-wrap: break-word; overflow-wrap: break-word; hyphens: auto; }
.chevron.active { background: var(--accent-color); color: var(--text-inverted); }
.chevron-wrapper:first-child .chevron { clip-path: polygon(0% 0%, 92% 0%, 100% 50%, 92% 100%, 0% 100%); padding-left: 10px; }

.timeline-container { justify-content: center; }
.timeline-container::before { content: ''; position: absolute; left: 11px; top: 10px; bottom: 20px; width: 3px; background: var(--border-color); }
.timeline-item { display: flex; gap: 24px; padding-bottom: 40px; position: relative; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-marker { width: 26px; height: 26px; border-radius: 50%; background: var(--slide-bg); border: 5px solid var(--accent-color); position: relative; z-index: 2; flex-shrink: 0; box-shadow: 0 0 0 4px var(--slide-bg);}
.timeline-content { display: flex; flex-direction: column; gap: 6px; margin-top: -4px;}
.timeline-date { font-weight: 800; color: var(--accent-color); font-size: 15px; text-transform: uppercase; letter-spacing: 1px;}
.timeline-title { font-weight: 700; color: var(--text-heading); font-size: 22px; margin-bottom: 4px; }
.timeline-desc { font-size: 18px; color: var(--text-muted); line-height: 1.5; }

.logic-tree { font-size: 20px; justify-content: center; }
.logic-tree-node { padding-left: 40px; border-left: 3px solid var(--border-color); position: relative; margin-bottom: 24px; margin-top: 24px;}
.logic-tree-node::before { content: ''; position: absolute; left: 0; top: 22px; width: 30px; height: 3px; background: var(--border-color); }
.logic-tree-title { font-weight: 700; color: var(--text-heading); background: var(--surface-color); display: inline-block; padding: 12px 24px; border-radius: 6px; border: 1px solid var(--border-color); box-shadow: 0 2px 4px rgba(0,0,0,0.05); font-size: 18px;}
.logic-tree-desc { display: block; font-size: 18px; color: var(--text-main); margin-top: 12px; padding-left: 12px; line-height: 1.6;}

/* Charts & Grids */
.chart-container { background: var(--slide-bg); border: 1px solid var(--border-color); border-radius: 8px; padding: 24px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.chart-title { font-size: 22px; font-weight: 700; margin-bottom: 16px; text-align: center; color: var(--text-heading); font-family: var(--font-heading); flex: 0 0 auto; }
.chart-svg-wrapper { flex: 1 1 0%; width: 100%; position: relative; display: flex; justify-content: center; align-items: center; min-height: 0; overflow: hidden; }
.chart-svg-wrapper svg { width: 100%; height: 100%; max-height: 100%; display: block; }
.d3-tooltip { position: absolute; text-align: center; padding: 10px 14px; font-size: 15px; background: var(--text-heading); color: var(--slide-bg); border-radius: 6px; pointer-events: none; opacity: 0; transition: opacity 0.2s, transform 0.1s; z-index: 100; font-weight: 600; box-shadow: 0 4px 12px rgba(0,0,0,0.15);}
.funnel-container { align-items: center; justify-content: stretch; gap: 4px; padding: 10px 0; }
.funnel-stage-val { font-size: 24px; color: var(--accent-color); font-weight: 800; font-family: var(--font-code); }

.matrix-wrapper { container-type: size; margin: auto; align-items: center; justify-content: center; padding-left: clamp(20px, 6cqw, 40px); padding-bottom: clamp(15px, 5cqw, 30px); box-sizing: border-box; }
.matrix-container { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 4px; background: var(--border-color); width: 100%; max-width: calc(2 * 100cqh); height: 100%; max-height: 100%; border: 4px solid var(--border-color); margin: 0 auto; }
.matrix-quadrant { background: var(--slide-bg); padding: clamp(8px, 3cqw, 24px) clamp(6px, 2cqw, 16px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; overflow: hidden; }
.matrix-quadrant h4 { margin: 0 0 12px 0; color: var(--text-heading); font-size: clamp(12px, 3.5cqw, 20px); text-transform: uppercase; letter-spacing: 1.5px; }
.matrix-item { padding: clamp(4px, 1.5cqw, 12px) clamp(6px, 2cqw, 16px); margin: 4px 0; border-radius: 6px; font-size: clamp(10px, 2.5cqw, 16px); width: 100%; font-weight: 600; border: 1px solid var(--accent-color); box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.matrix-y-axis { position: absolute; left: 0; top: 0; bottom: clamp(15px, 5cqw, 30px); display: flex; align-items: center; justify-content: center; writing-mode: vertical-lr; transform: rotate(180deg); font-weight: 800; font-size: clamp(11px, 3cqw, 16px); color: var(--text-heading); text-transform: uppercase; letter-spacing: 2px; }
.matrix-x-axis { position: absolute; bottom: 0; left: clamp(20px, 6cqw, 40px); right: 0; text-align: center; font-weight: 800; font-size: clamp(11px, 3cqw, 16px); color: var(--text-heading); text-transform: uppercase; letter-spacing: 2px; }

.heatmap-wrapper { border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; font-family: var(--font-body); }
.heatmap-row { display: flex; width: 100%; flex: 1 1 0%; }
.heatmap-cell, .heatmap-label { flex: 1; padding: 12px 8px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 14px; font-weight: 600; }
.heatmap-label { background: var(--surface-color); color: var(--text-heading); border-bottom: 1px solid var(--border-color); border-right: 1px solid var(--border-color); }
.heatmap-cell { color: var(--text-heading); border-right: 1px solid rgba(0,0,0,0.05); border-bottom: 1px solid rgba(0,0,0,0.05); }
.heatmap-row:last-child .heatmap-cell { border-bottom: none; }

.data-table-container { border-radius: 8px; border: 1px solid var(--border-color); background: var(--slide-bg); box-shadow: 0 4px 6px rgba(0,0,0,0.02); overflow: auto; }
.consulting-table { width: 100%; flex: 1 1 auto; border-collapse: separate; border-spacing: 0; font-size: 18px; font-family: var(--font-body); table-layout: fixed; margin: 0; }
.consulting-table th { position: sticky; top: 0; z-index: 10; background: var(--surface-color); color: var(--text-heading); font-weight: 700; text-align: left; padding: 16px 24px; border-bottom: 2px solid var(--border-color); text-transform: uppercase; font-size: 14px; letter-spacing: 0.5px; }
.consulting-table td { padding: 16px 24px; border-bottom: 1px solid var(--border-color); color: var(--text-main); font-weight: 500; word-wrap: break-word; overflow-wrap: break-word; word-break: break-word; hyphens: auto; }
.consulting-table tbody tr:last-child td { border-bottom: none; }
.consulting-table tbody tr:hover td { background: rgba(0,0,0,0.02); }
.consulting-table th.numeric, .consulting-table td.numeric { text-align: center; font-family: var(--font-code); }
.consulting-table td p, .consulting-table td ul, .consulting-table td ol, .consulting-table td blockquote { margin-top: 0; margin-bottom: 8px; }
.consulting-table td p:last-child, .consulting-table td ul:last-child, .consulting-table td ol:last-child, .consulting-table td blockquote:last-child { margin-bottom: 0; }
.consulting-table td ul, .consulting-table td ol { padding-left: 20px; }

.gantt-container { overflow-y: auto; background: var(--slide-bg); border: 1px solid var(--border-color); border-radius: 8px; padding: 12px; display: block; }
.gantt-header { position: sticky; top: -24px; z-index: 10; background: var(--slide-bg); display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 16px; align-items: center; font-weight: 700; color: var(--text-heading); border-bottom: 2px solid var(--border-color); padding-bottom: 12px; padding-top: 24px; text-transform: uppercase; font-size: 14px; letter-spacing: 0.5px; margin-bottom: 12px; }
.gantt-timeline-grid { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; gap: 0px; }
.gantt-tick { text-align: center; color: var(--text-muted); border-left: 1px dashed var(--border-color); padding-left: 4px; font-size: 13px; }
.gantt-row { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 16px; align-items: center; padding: 8px 0; margin-bottom: 12px; }
.gantt-row:last-child { margin-bottom: 0; }
.gantt-task-name { font-weight: 600; font-size: 16px; color: var(--text-heading); word-wrap: break-word; overflow-wrap: break-word; hyphens: auto; }
.gantt-track { background: var(--surface-color); border-radius: 4px; height: 48px; position: relative; overflow: hidden; }
.gantt-bar { position: absolute; height: 100%; border-radius: 4px; background: var(--accent-color); display: flex; align-items: center; justify-content: flex-start; padding: 4px 12px; color: var(--text-inverted); font-size: 13px; font-weight: 700; box-shadow: 0 2px 4px rgba(0,0,0,0.1); white-space: normal; overflow: hidden; overflow-wrap: break-word; line-height: 1.25; text-align: left; }
.gantt-bar.status-delayed { background: var(--rag-red); }
.gantt-bar.status-progress { background: var(--rag-amber); }
.gantt-bar.status-done { background: var(--rag-green); }

.image-container { align-items: center; justify-content: center; overflow: hidden; }
.image-container img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.layout-canvas .image-caption { position: absolute; bottom: 60px; left: 50%; transform: translateX(-50%); background: rgba(15, 23, 42, 0.75); color: #f8fafc; padding: 16px 32px; border-radius: 8px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); z-index: 1; font-size: 20px; letter-spacing: 0.5px; box-shadow: 0 20px 40px rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.15); max-width: 80%; text-align: center; }

/* Media Blocks */
.profile-card { display: flex; align-items: center; gap: 24px; padding: 20px 24px; background: var(--surface-color); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: 0 4px 6px rgba(0,0,0,0.02); }
.profile-img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid var(--slide-bg); box-shadow: 0 0 0 2px var(--border-color); flex-shrink: 0; }
.profile-info { display: flex; flex-direction: column; }
.profile-name { font-size: 22px; font-weight: 700; color: var(--text-heading); font-family: var(--font-heading); margin-bottom: 4px; }
.profile-role { font-size: 14px; font-weight: 600; text-transform: uppercase; color: var(--accent-color); letter-spacing: 1px; margin-bottom: 8px; }
.profile-bio { font-size: 15px; color: var(--text-muted); line-height: 1.5; }
.profile-bio p { margin: 0 0 8px 0; }
.profile-bio p:last-child { margin-bottom: 0; }

.icon-block { display: flex; align-items: center; gap: clamp(16px, 4cqi, 32px); transition: all 0.3s ease; }
.icon-wrapper { width: clamp(48px, 25cqi, 200px); height: clamp(48px, 25cqi, 200px); flex-shrink: 0; background: var(--surface-color); border-radius: clamp(8px, 4cqi, 40px); display: flex; align-items: center; justify-content: center; border: clamp(1px, 0.5cqi, 4px) solid var(--border-color); color: var(--accent-color); transition: all 0.3s ease; }
.icon-wrapper svg { width: 55% !important; height: 55% !important; stroke-width: 1.5px; transition: all 0.3s ease; }
.icon-content { display: flex; flex-direction: column; transition: all 0.3s ease; justify-content: center; }
.icon-title { font-size: clamp(20px, 5cqi, 48px); font-weight: 700; color: var(--text-heading); margin-bottom: clamp(4px, 1.5cqi, 12px); transition: font-size 0.3s ease; line-height: 1.2; }
.icon-desc { font-size: clamp(15px, 3.5cqi, 28px); color: var(--text-muted); line-height: 1.5; transition: font-size 0.3s ease; }

@container (min-width: 350px) {
    .icon-block { flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 16px 0; }
    .icon-content { align-items: flex-start; }
}

/* ==========================================================================
   7. CINEMATIC STATES (Hero Logic & :only-child Container Adjustments)
   ========================================================================== */

@container (min-height: 300px) {
    .kpi-group > .kpi-container { flex: 1 1 100% !important; }
    .kpi-group > .kpi-container .kpi-value { font-size: clamp(16px, 16px + 10cqi, 80px); }
    .kpi-group > .kpi-container:only-child .kpi-value { font-size: 120px; }
}

.kpi-group:only-child { height: 100%; max-height: 100%; }
.kpi-group:only-child .kpi-container { flex: 1 1 100%; align-items: center; text-align: center; gap: 12px; }
.kpi-container:only-child { flex: 1 1 100%; align-items: center; text-align: center; gap: 12px; }

.rag-container:only-child { flex-direction: column; justify-content: center; text-align: center; height: 100%; max-height: 100%; }

.chevron-container:only-child { flex-direction: column; flex: 1 1 100%; height: 100%; gap: 12px; }
.chevron-container:only-child .chevron { clip-path: polygon(0% 0%, 50% 12%, 100% 0%, 100% 88%, 50% 100%, 0% 88%); padding: clamp(24px, 5cqi, 48px) 16px clamp(32px, 6cqi, 64px) 16px; font-size: clamp(20px, 4cqi, 36px); }
.chevron-container:only-child .chevron-wrapper:first-child .chevron { clip-path: polygon(0% 0%, 100% 0%, 100% 88%, 50% 100%, 0% 88%); padding: clamp(16px, 3cqi, 32px) 16px clamp(32px, 6cqi, 64px) 16px; }

.matrix-wrapper:only-child { flex: 1 1 100%; max-width: 800px; }

/* Special Hero Layout Block */
.slide-layout-hero { padding: 0 !important; background: linear-gradient(135deg, var(--slide-bg) 30%, var(--surface-color) 100%) !important; border: none; border-left: 20px solid var(--accent-color); border-right: 20px solid var(--accent-color); }
.layout-hero { display: flex; flex: 1; height: 100%; width: 100%; justify-content: center; align-items: center; padding: 80px 120px; position: relative; }
.layout-hero::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: radial-gradient(circle at 80% 20%, var(--accent-color) 0%, transparent 40%); opacity: 0.1; pointer-events: none; }
.layout-hero .layout-zone { justify-content: center; height: 100%; width: 100%; }
.layout-hero .quote-block { background: rgba(0, 0, 0, 0.02); backdrop-filter: blur(12px); border: 1px solid var(--border-color); border-left: 8px solid var(--accent-color); padding: 70px 80px; font-size: 40px; font-weight: 300; line-height: 1.3; text-align: center; border-radius: 16px; color: var(--text-heading); box-shadow: 0 20px 40px rgba(0,0,0,0.06); position: relative; }
.layout-hero .quote-block::before { content: '"'; position: absolute; top: -50px; left: 50%; transform: translateX(-50%); font-size: 160px; color: var(--accent-color); opacity: 0.15; background: transparent; padding: 0; line-height: 1; font-family: serif; }

/* Special Title Block */
.slide-layout-title { justify-content: center; text-align: left; padding-left: 140px; }
.slide-layout-title::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 32px; background: var(--accent-color); }
.slide-layout-title .slide-header { margin: 0; border: none; padding: 0; display: flex; flex-direction: column; }
.slide-layout-title .slide-body { display: none; }
.slide-layout-title .kicker { align-self: flex-start; background: rgba(190, 18, 60, 0.08); color: var(--kicker-color); font-size: 18px; font-weight: 800; padding: 10px 20px; border-radius: 4px; margin-bottom: 40px; letter-spacing: 2px; border-left: 4px solid var(--kicker-color); }
.slide-layout-title .title { font-size: 104px; font-weight: 900; color: var(--text-heading); margin-bottom: 16px; line-height: 1.05; letter-spacing: -2px; }
.slide-layout-title .subtitle { font-size: 32px; font-weight: 500; color: var(--text-muted); border-left: 6px solid var(--accent-color); padding-left: 24px; margin-top: 32px; max-width: 85%; line-height: 1.4; }
.slide-layout-title .slide-footer { border-top: none; left: 140px; right: 140px; bottom: 50px; }
.slide-layout-title .page-num { display: none; }

/* Special Divider Block */
.slide-layout-divider { justify-content: center; align-items: center; background: var(--accent-color) !important; text-align: center; }
.slide-layout-divider .slide-body { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.slide-layout-divider .title { color: var(--text-inverted); font-size: 80px; font-weight: 900; letter-spacing: -1px; margin: 0 0 24px 0; }
.slide-layout-divider .subtitle { color: var(--text-inverted); opacity: 0.9; font-size: 32px; margin: 0; border: none; padding: 0; }

.slide-layout-canvas { padding: 0 !important; }
.layout-canvas { height: 100%; width: 100%; position: relative; }

/* ==========================================================================
   8. RESPONSIVE / TIGHT COLUMN EXCEPTIONS
   ========================================================================== */

/* Automatically shrink typography and chart paddings in narrow split layouts */
:is(.layout-split-30-70 .layout-zone:first-child, .layout-split-70-30 .layout-zone:last-child) .chart-container { padding: 12px; }
:is(.layout-split-30-70 .layout-zone:first-child, .layout-split-70-30 .layout-zone:last-child) .chart-title { font-size: 16px; margin-bottom: 8px; }

:is(.layout-split-30-70 .layout-zone:first-child, .layout-split-70-30 .layout-zone:last-child, .layout-multi-col[style*="--grid-cols: repeat(3"], .layout-multi-col[style*="--grid-cols: repeat(4"]) .consulting-table :is(th, td) {
    padding: 4px 6px;
    font-size: 13px;
    letter-spacing: 0;
}

:is(.layout-split-30-70 .layout-zone:first-child, .layout-split-70-30 .layout-zone:last-child) .markdown-content { font-size: 17px; }
:is(.layout-split-30-70 .layout-zone:first-child, .layout-split-70-30 .layout-zone:last-child) .markdown-content h3 { font-size: 22px; }

:is(.layout-split-30-70 .layout-zone:first-child, .layout-split-70-30 .layout-zone:last-child) .gantt-header,
:is(.layout-split-30-70 .layout-zone:first-child, .layout-split-70-30 .layout-zone:last-child) .gantt-row { grid-template-columns: 1fr; gap: 4px; }
:is(.layout-split-30-70 .layout-zone:first-child, .layout-split-70-30 .layout-zone:last-child) .gantt-header div:first-child { display: none; }

/* ==========================================================================
   9. VIEWER ACTIONS & PDF PRINT MEDIA QUERY
   ========================================================================== */
.viewer-actions { position: absolute; top: 6px; right: 6px; display: flex; gap: 8px; opacity: 0; transform: translateY(-5px); transition: opacity 0.2s ease, transform 0.2s ease; z-index: 100; }
.slide-wrapper:hover .viewer-actions { opacity: 1; transform: translateY(0); }
.viewer-actions button { background: rgba(24, 24, 27, 0.95); border: 1px solid #3f3f46; color: #e4e4e7; padding: 8px 10px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; box-shadow: 0 4px 12px rgba(0,0,0,0.5); }
.viewer-actions button:hover { background: #0ea5e9; border-color: #0ea5e9; color: #fff; }

@media print {
    @page { size: A4 landscape; margin: 0; }
    body, html { background: white !important; width: 100% !important; height: 100% !important; display: block !important; margin: 0 !important; padding: 0 !important; }
    .header, .sidebar, .error-banner, #d3-tooltip, .zoom-controls, .viewer-actions { display: none !important; }
    .workspace, .preview-container, .preview-panel { display: block !important; width: 100% !important; height: auto !important; margin: 0 !important; padding: 0 !important; background: transparent !important; overflow: visible !important; }
    .slide-wrapper { display: flex !important; justify-content: center !important; align-items: center !important; width: 100vw !important; height: 100vh !important; page-break-after: always; overflow: hidden !important; }
    .slide { width: 1600px !important; height: 900px !important; position: relative !important; transform: scale(0.65) !important; transform-origin: center center !important; box-shadow: none !important; border: none !important; margin: 0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ==========================================================================
   10. MODALS & MOBILE TABLET WIZARD OVERRIDES
   ========================================================================== */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.modal-box { background: #18181b; border: 1px solid #27272a; padding: 24px; border-radius: 12px; width: 420px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5); color: #f4f4f5; font-family: var(--font-body); display: flex; flex-direction: column; gap: 16px; animation: modalFadeIn 0.2s ease-out; }
@keyframes modalFadeIn { from { opacity: 0; transform: translateY(15px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-box h3 { margin: 0; font-size: 20px; color: #fff; font-weight: 700; font-family: var(--font-heading);}
.modal-box p { margin: 0; font-size: 14px; color: #a1a1aa; line-height: 1.6; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 8px; }

.mobile-wizard-overlay { display: none; position: fixed; inset: 0; background: #09090b; z-index: 99999; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.mobile-wizard-overlay h2 { font-size: 28px; color: #f4f4f5; margin-bottom: 16px; font-family: var(--font-heading); }
.mobile-wizard-overlay p { font-size: 16px; color: #a1a1aa; margin-bottom: 32px; max-width: 400px; line-height: 1.5; }
.mobile-wizard-overlay .btn-group { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 320px; }
.mobile-wizard-overlay .btn { justify-content: center; padding: 14px; font-size: 16px; }

.floating-action-btn { display: none; position: fixed; bottom: 24px; z-index: 1000; background: #0ea5e9; color: white; border: none; padding: 14px 24px; border-radius: 50px; font-size: 15px; font-weight: 700; box-shadow: 0 10px 25px rgba(14, 165, 233, 0.4); cursor: pointer; align-items: center; gap: 8px; transition: transform 0.2s; }
.floating-action-btn:active { transform: scale(0.95); }
.floating-action-btn.fab-right { right: 24px; }
.floating-action-btn.fab-left { left: 24px; background: #27272a; color: #f4f4f5; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); border: 1px solid #3f3f46; }

@media (max-width: 1024px) {
    .header-controls { display: none !important; }
    .resizer { display: none !important; }
    .zoom-controls { display: none !important; }
    body.mobile-step-1 .workspace, body.mobile-step-2 .workspace { display: none !important; }
    body.mobile-step-2 #mobile-paste-view { display: flex !important; }
    body.mobile-step-2 #fab-view-slides { display: none !important; }
    body.mobile-step-3 .workspace { flex-direction: column; display: flex !important; }
    body.mobile-step-3 .sidebar { display: none !important; }
    body.mobile-step-3 .preview-container { width: 100% !important; display: flex; flex: 1; padding-bottom: 80px; }
    body.mobile-step-3 .preview-panel { padding: 16px; gap: 24px; }
    body.mobile-step-3 #fab-export-pdf { display: flex !important; bottom: 24px; right: 24px; z-index: 999999; }
    body.mobile-step-3 #fab-back-edit { display: flex !important; bottom: 24px; left: 24px; z-index: 999999; }
}