/* Version: Latest Working | Stable Zoom & Drag-Resize | Fully Functional Icon-Only Buttons */

/* Register CSS custom properties as animatable colors.
   This allows transitioning them on :root (1 element) instead of
   using * selector (hundreds of elements) — identical smooth result,
   zero overhead on mobile. */
@property --bg-body { syntax: '<color>'; inherits: true; initial-value: #0f172a; }
@property --bg-main { syntax: '<color>'; inherits: true; initial-value: #0f172a; }
@property --bg-panel { syntax: '<color>'; inherits: true; initial-value: #1e293b; }
@property --bg-secondary { syntax: '<color>'; inherits: true; initial-value: #1e293b; }
@property --bg-tertiary { syntax: '<color>'; inherits: true; initial-value: #334155; }
@property --bg-workspace { syntax: '<color>'; inherits: true; initial-value: #0f172a; }
@property --bg-console { syntax: '<color>'; inherits: true; initial-value: #0f172a; }
@property --text-primary { syntax: '<color>'; inherits: true; initial-value: #f8fafc; }
@property --text-secondary { syntax: '<color>'; inherits: true; initial-value: #94a3b8; }
@property --text-muted { syntax: '<color>'; inherits: true; initial-value: #64748b; }
@property --accent-primary { syntax: '<color>'; inherits: true; initial-value: #38bdf8; }
@property --accent-hover { syntax: '<color>'; inherits: true; initial-value: #7dd3fc; }
@property --accent-green { syntax: '<color>'; inherits: true; initial-value: #10b981; }
@property --accent-red { syntax: '<color>'; inherits: true; initial-value: #ef4444; }
@property --accent-yellow { syntax: '<color>'; inherits: true; initial-value: #f59e0b; }
@property --border-main { syntax: '<color>'; inherits: true; initial-value: rgba(248, 250, 252, 0.12); }
@property --bg-input { syntax: '<color>'; inherits: true; initial-value: rgba(0, 0, 0, 0.25); }
@property --bg-input-focus { syntax: '<color>'; inherits: true; initial-value: rgba(255, 255, 255, 0.03); }
@property --accent-green-bg { syntax: '<color>'; inherits: true; initial-value: rgba(16, 185, 129, 0.15); }
@property --accent-red-bg { syntax: '<color>'; inherits: true; initial-value: rgba(239, 68, 68, 0.15); }
@property --accent-yellow-bg { syntax: '<color>'; inherits: true; initial-value: rgba(245, 158, 11, 0.15); }
@property --bg-nav-glass { syntax: '<color>'; inherits: true; initial-value: rgba(30, 41, 59, 0.5); }
@property --bg-card-glass { syntax: '<color>'; inherits: true; initial-value: rgba(30, 41, 59, 0.4); }

:root {
    --primary-blue: #58a6ff;
    --primary-purple: #9333ea;
}

/* Dark Theme (Deep Slate/Navy) */
:root[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-main: #0f172a;
    --bg-panel: #1e293b;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-workspace: #0f172a;
    --bg-console: #0f172a;
    --bg-panel-rgb: 30, 41, 59;
    --bg-nav-glass: rgba(30, 41, 59, 0.5);
    --bg-card-glass: rgba(30, 41, 59, 0.4);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-primary: #38bdf8;
    --accent-primary-rgb: 56, 189, 248;
    --accent-hover: #7dd3fc;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-yellow: #f59e0b;
    --accent-green-bg: rgba(16, 185, 129, 0.15);
    --accent-red-bg: rgba(239, 68, 68, 0.15);
    --accent-yellow-bg: rgba(245, 158, 11, 0.15);
    --border-main: rgba(248, 250, 252, 0.12);
    --bg-input: rgba(0, 0, 0, 0.25);
    --bg-input-focus: rgba(255, 255, 255, 0.03);
}

/* Eye Saver Theme */
:root[data-theme="eye-saver"] {
    --bg-body: #fdf6e3;
    --bg-main: #fdf6e3;
    --bg-panel: #eee8d5;
    --bg-secondary: #eee8d5;
    --bg-tertiary: #93a1a1;
    --bg-workspace: #fdf6e3;
    --bg-console: #eee8d5;
    --bg-panel-rgb: 238, 232, 213;
    --bg-nav-glass: rgba(238, 232, 213, 0.85);
    --bg-card-glass: rgba(238, 232, 213, 0.9);

    --text-primary: #586e75;
    --text-secondary: #657b83;
    --text-muted: #839496;
    --accent-primary: #d97706;
    --accent-primary-rgb: 217, 119, 6;
    --accent-hover: #f59e0b;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-yellow: #f59e0b;
    --accent-green-bg: rgba(16, 185, 129, 0.15);
    --accent-red-bg: rgba(239, 68, 68, 0.15);
    --accent-yellow-bg: rgba(245, 158, 11, 0.15);
    --border-main: rgba(88, 110, 117, 0.15);
    --bg-input: rgba(88, 110, 117, 0.08);
    --bg-input-focus: rgba(255, 255, 255, 0.4);
}

/* Light Theme */
:root[data-theme="light"] {
    --bg-body: #f1f5f9;
    --bg-main: #f1f5f9;
    --bg-panel: #ffffff;
    --bg-secondary: #ffffff;
    --bg-workspace: #ffffff;
    --bg-tertiary: #cbd5e1;
    --bg-console: #ffffff;
    --bg-panel-rgb: 255, 255, 255;
    --bg-nav-glass: rgba(255, 255, 255, 0.85);
    --bg-card-glass: rgba(255, 255, 255, 0.9);

    --text-primary: #334155;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --accent-primary: #2563eb;
    --accent-primary-rgb: 37, 99, 235;
    --accent-hover: #3b82f6;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-yellow: #f59e0b;
    --accent-green-bg: rgba(16, 185, 129, 0.15);
    --accent-red-bg: rgba(239, 68, 68, 0.15);
    --accent-yellow-bg: rgba(245, 158, 11, 0.15);
    --border-main: rgba(51, 65, 85, 0.12);
    --bg-input: rgba(51, 65, 85, 0.06);
    --bg-input-focus: rgba(255, 255, 255, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Prevent transitions on load */
.no-transitions *,
.no-transition * {
    transition: none !important;
}

/* Global theme transition — smoothly interpolates registered CSS custom properties
   on :root only (1 element). All descendants have transitions suppressed so they
   instantly reflect the current interpolated variable value — no per-element
   transition overhead, perfectly uniform on both desktop and mobile. */
:root[data-theme-transitioning] {
    transition:
        --bg-body 0.3s ease, --bg-main 0.3s ease, --bg-panel 0.3s ease,
        --bg-secondary 0.3s ease, --bg-tertiary 0.3s ease,
        --bg-workspace 0.3s ease, --bg-console 0.3s ease,
        --text-primary 0.3s ease, --text-secondary 0.3s ease, --text-muted 0.3s ease,
        --accent-primary 0.3s ease, --accent-hover 0.3s ease,
        --accent-green 0.3s ease, --accent-red 0.3s ease, --accent-yellow 0.3s ease,
        --border-main 0.3s ease, --bg-input 0.3s ease, --bg-input-focus 0.3s ease,
        --accent-green-bg 0.3s ease, --accent-red-bg 0.3s ease, --accent-yellow-bg 0.3s ease,
        --bg-nav-glass 0.3s ease, --bg-card-glass 0.3s ease;
}
/* Kill element-level transitions during switch so they don't fight
   with the :root variable interpolation (prevents staggering/lag) */
:root[data-theme-transitioning] *,
:root[data-theme-transitioning] *::before,
:root[data-theme-transitioning] *::after {
    transition: none !important;
}

/* Page Transition System */
.page-transitioning {
    pointer-events: none !important;
    user-select: none !important;
}

.fade-in {
    animation: page-fade-in 0.3s ease-out forwards;
}

.fade-out {
    animation: page-fade-out 0.2s ease-in forwards;
}

@keyframes page-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes page-fade-out {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

html {
    background-color: var(--bg-body) !important;
    overflow-x: hidden;
    scrollbar-gutter: stable;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow-y: auto;
    min-height: 100vh;
    background-color: var(--bg-body) !important;
    color: var(--text-primary);
}

/* touch-action: manipulation removed — it was for Monaco's double-tap-to-zoom
   delay fix. CM6 uses contenteditable natively and manipulation blocks iOS
   double-tap text selection. */

/* Default: Horizontal Layout (Console Below Editor) */
.grid-container {
    display: grid;
    grid-template-areas:
        "header header header header"
        "left-ad editor editor right-ad"
        "left-ad resizer resizer right-ad"
        "left-ad console console right-ad"
        "status-bar status-bar status-bar status-bar";
    grid-template-columns: 198px 1fr 1fr 198px;
    grid-template-rows: auto 65fr 6px 35fr auto;
    /* Middle 6px is resizer */
    height: 100vh;
    overflow: hidden;
    width: 100%;
}



/* Vertical Layout (Side-by-Side) */
.grid-container.vertical-layout {
    grid-template-areas:
        "header header header header header"
        "left-ad editor resizer console right-ad"
        "status-bar status-bar status-bar status-bar status-bar";
    grid-template-columns: 198px 65fr 6px minmax(440px, 35fr) 198px;
    /* Middle 6px is resizer */
    grid-template-rows: auto 1fr auto;
}


/* Resizer Styling */
.grid-resizer {
    grid-area: resizer;
    background: var(--bg-panel);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-resizer::after {
    content: '';
    display: block;
    background: var(--text-muted);
    opacity: 0.6;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.grid-resizer.active {
    background: rgba(var(--accent-primary-rgb, 56, 189, 248), 0.1);
}

.grid-resizer.active::after {
    background: var(--accent-primary);
    opacity: 1;
    box-shadow: 0 0 15px var(--accent-primary);
}

/* Horizontal Mode (Resizer is a horizontal bar) */
.grid-container:not(.vertical-layout) .grid-resizer {
    cursor: row-resize;
    height: 100%;
    width: 100%;
}

.grid-container:not(.vertical-layout) .grid-resizer::after {
    width: 64px;
    height: 4px;
    border-radius: 2px;
    /* Tactile 3-bar grip */
    background: repeating-linear-gradient(to right,
            var(--text-muted),
            var(--text-muted) 12px,
            transparent 12px,
            transparent 16px);
}

.grid-container:not(.vertical-layout) .grid-resizer:hover {
    background: rgba(255, 255, 255, 0.05);
}

.grid-container:not(.vertical-layout) .grid-resizer:hover::after {
    background: var(--accent-primary);
    opacity: 0.8;
    width: 80px;
}

/* Vertical Mode (Resizer is a vertical bar) */
.grid-container.vertical-layout .grid-resizer {
    cursor: col-resize;
    width: 100%;
    height: 100%;
}

.grid-container.vertical-layout .grid-resizer::after {
    width: 4px;
    height: 64px;
    border-radius: 2px;
    /* Tactile 3-bar grip */
    background: repeating-linear-gradient(to bottom,
            var(--text-muted),
            var(--text-muted) 12px,
            transparent 12px,
            transparent 16px);
}

.grid-container.vertical-layout .grid-resizer:hover {
    background: rgba(255, 255, 255, 0.05);
}

.grid-container.vertical-layout .grid-resizer:hover::after {
    background: var(--accent-primary);
    opacity: 0.8;
    height: 80px;
}

.tagline {
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

#brand-logo {
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25);
    transition: box-shadow 0.3s ease;
}

#brand-logo:hover {
    box-shadow: 0 4px 22px rgba(139, 92, 246, 0.4);
}

.grid-header {
    grid-area: header;
    border-bottom: 1px solid var(--border-main);
    background: var(--bg-secondary);
    transition: background 0.3s ease, border-color 0.3s ease;
    position: relative;
    z-index: 2;
}

.grid-left-ad {
    grid-area: left-ad;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-main);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, border-color 0.3s ease;
}


.grid-editor {
    grid-area: editor;
    background: transparent;
    overflow: hidden;
    min-width: 0;
    min-height: 0;
    contain: layout style;
}

.grid-editor .glass-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-main);
    border-bottom: none !important;
    border-radius: 0;
    height: 100%;
    min-height: 0;
    overflow: clip;
    container-type: inline-size;
    container-name: editor-panel;
}

/* Vertical layout: remove right border */
.grid-container.vertical-layout .grid-editor .glass-panel {
    border-right: none;
    border-bottom: 1px solid var(--border-main);
}

.grid-console {
    grid-area: console;
    background: transparent;
    overflow: hidden;
    min-width: 0;
    min-height: 0;
    contain: layout style;
}

.grid-console .glass-panel {
    background: var(--bg-console);
    border: 1px solid var(--border-main);
    border-radius: 0;
    height: 100%;
}

.grid-left-ad,
.grid-right-ad {
    min-width: 0;
}

.grid-right-ad {
    grid-area: right-ad;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-main);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, border-color 0.3s ease;
    min-width: 0;
}



.grid-status-bar {
    grid-area: status-bar;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    height: 48px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.footer-left,
.footer-right {
    flex: 1;
    display: flex;
    align-items: center;
}

.footer-right {
    justify-content: flex-end;
}

.footer-center {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Breadcrumb Names */
.breadcrumb-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.header-actions-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 12px;
}

.snapshot-btn {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-main);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: var(--text-secondary);
}

/* Standardize SVG appearance for all group icons */
.header-actions-group svg {
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: all 0.3s ease;
    stroke-width: 2.2px;
    /* Slightly bolder for clarity */
}

/* Theme-specific attractive colors for all group icons */
:root[data-theme="dark"] .snapshot-btn svg {
    color: #38bdf8;
}

:root[data-theme="light"] .snapshot-btn svg {
    color: #2563eb;
}

:root[data-theme="eye-saver"] .snapshot-btn svg {
    color: #d97706;
}

.snapshot-btn:hover {
    background: var(--bg-tertiary);
    transform: scale(1.1);
    border-color: var(--accent-primary);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.snapshot-btn:hover svg {
    filter: drop-shadow(0 0 8px var(--accent-primary));
}

.snapshot-btn:active {
    transform: scale(0.9);
}

/* Flash Effect */
.flash-effect {
    position: relative;
    overflow: hidden;
}

.flash-effect::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    animation: flash-anim 0.4s ease-out;
}

@keyframes flash-anim {
    0% {
        opacity: 0.8;
    }

    100% {
        opacity: 0;
    }
}

.sidebar-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Ad Space */
.ad-space-vertical {
    width: 100%;
    height: 100%;
    border: 2px dashed var(--border-main);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.02);
    position: relative;
    content-visibility: auto;
    contain-intrinsic-size: 198px 600px;
}

.ad-notice-bottom {
    position: absolute;
    top: 80%;
    left: 0;
    right: 0;
    text-align: center;
}

/* Trust Badge */
.trust-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-main);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.trust-badge svg {
    color: var(--accent-primary);
}

/* Python Version Pill (console header — mobile) */
.version-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    font-family: var(--font-mono, monospace);
    letter-spacing: 0.3px;
    white-space: nowrap;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.version-pill .version-dot,
.version-pill-dt .version-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
    flex-shrink: 0;
}

/* Desktop-only pill — hidden by default, shown on desktop */
.version-pill-dt {
    display: none;
}

@media (min-width: 1025px) {
    #python-version-pill {
        display: none !important;
    }
    .console-left-group {
        flex: none !important;
    }
    .version-pill-dt {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        font-size: 11px;
        font-weight: 500;
        color: var(--text-muted);
        font-family: var(--font-mono, monospace);
        letter-spacing: 0.3px;
        white-space: nowrap;
        flex: 1;
    }
}

/* Landscape pill — hidden by default, top-right in landscape */
.version-pill-landscape {
    display: none;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    font-family: var(--font-mono, monospace);
    letter-spacing: 0.3px;
    white-space: nowrap;
    position: absolute;
    top: 6px;
    right: 10px;
    z-index: 1000;
}

.version-pill-landscape .version-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
    flex-shrink: 0;
}

@media (max-width: 1024px) {
    .version-pill {
        position: static;
        transform: none;
        margin-left: auto !important;
    }
}

@media screen and (orientation: landscape) and (max-height: 500px) {
    /* Hide console header pill, show fixed top-right pill */
    #python-version-pill {
        display: none !important;
    }
    .version-pill-landscape {
        display: inline-flex !important;
        font-size: 10px;
    }
}

/* File Tabs */
.file-tabs-container {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-workspace);
    border-bottom: 1px solid var(--border-main);
    border-radius: 0;
    transition: background 0.3s ease, border-color 0.3s ease;
    flex-shrink: 0;
}

.file-tabs {
    display: flex;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
}

.file-tabs::-webkit-scrollbar {
    height: 4px;
}

.file-tabs::-webkit-scrollbar-thumb {
    background: var(--border-main);
    border-radius: 2px;
}

.file-tab {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid transparent;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid transparent;
    border-top: 2px solid transparent;
    user-select: none;
}

.file-tab:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.file-tab.active {
    background: var(--bg-secondary);
    border-bottom-color: var(--accent-primary);
    border-top-color: var(--accent-primary);
    color: var(--accent-primary);
    font-weight: 600;
}

.close-tab-btn {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-muted);
    transition: all 0.2s ease;
    font-size: 10px;
}

.close-tab-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.new-file-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border-main);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.new-file-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Unified 3D Button Style System */
.btn-3d {
    height: 40px;
    padding: 0 24px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    top: 0;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-3d:active {
    top: 3px;
    box-shadow: none !important;
    transform: scale(0.98);
}

/* Run Code Button - 3D with green gradient */
.btn-run {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 0 #047857, 0 8px 15px rgba(16, 185, 129, 0.3);
}

.btn-run:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 2px 0 #047857, 0 4px 10px rgba(16, 185, 129, 0.4);
}

.btn-upload {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 4px 0 #1e40af, 0 8px 15px rgba(59, 130, 246, 0.2);
}

.btn-upload:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 2px 0 #1e40af, 0 4px 10px rgba(59, 130, 246, 0.3);
}

.btn-download {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 0 #b45309, 0 8px 15px rgba(245, 158, 11, 0.2);
}

.btn-download:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    box-shadow: 0 2px 0 #b45309, 0 4px 10px rgba(245, 158, 11, 0.3);
}

.btn-tutorial-lab {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    box-shadow: 0 4px 0 #0e7490, 0 8px 15px rgba(6, 182, 212, 0.3);
    text-decoration: none;
}

.btn-tutorial-lab:hover {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    box-shadow: 0 2px 0 #0e7490, 0 4px 10px rgba(6, 182, 212, 0.4);
}

/* Academy Button - 3D with purple gradient */
.btn-academy {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    box-shadow: 0 4px 0 #6d28d9, 0 8px 15px rgba(139, 92, 246, 0.3);
    text-decoration: none;
}

.btn-academy:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    box-shadow: 0 2px 0 #6d28d9, 0 4px 10px rgba(139, 92, 246, 0.4);
}



.layout-toggle-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-main);
    border-radius: 10px;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.layout-toggle-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    transform: scale(1.1);
}

.layout-toggle-btn svg {
    transition: filter 0.3s ease;
}

.layout-toggle-btn:hover svg {
    filter: drop-shadow(0 0 8px var(--accent-primary));
}

.layout-toggle-btn:active {
    transform: scale(0.9);
}

/* Active state: vertical layout is on */
.grid-container.vertical-layout .layout-toggle-btn {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.grid-container.vertical-layout .layout-toggle-btn svg {
    filter: drop-shadow(0 0 5px var(--accent-primary));
}

/* Theme-specific gradient colors for layout icon */
:root[data-theme="dark"] #layout-icon rect,
:root[data-theme="dark"] #layout-icon line,
:root[data-theme="dark"] #layout-icon path {
    stroke: url(#layout-gradient-dark);
}

:root[data-theme="light"] #layout-icon rect,
:root[data-theme="light"] #layout-icon line,
:root[data-theme="light"] #layout-icon path {
    stroke: url(#layout-gradient-light);
}

:root[data-theme="eye-saver"] #layout-icon rect,
:root[data-theme="eye-saver"] #layout-icon line,
:root[data-theme="eye-saver"] #layout-icon path {
    stroke: url(#layout-gradient-eye);
}



/* Run Button — running state */
.btn-run.running {
    opacity: 0.7;
    pointer-events: none;
}

.btn-run.running svg {
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Run Button Override for disabled state */
.btn-run:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #64748b;
    box-shadow: none;
    top: 0;
}

/* Status Badge */
#status-badge {
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

/* Filename Pill Input */
.filename-pill {
    padding: 6px 16px;
    border-radius: 20px;
    background: var(--bg-input);
    border: 1px solid var(--border-main);
    color: var(--text-primary);
    font-size: 13px;
    width: 140px;
    transition: all 0.2s ease;
}

.filename-pill:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-input-focus);
}



/* Theme Toggle Buttons (main page header — icon style) */
.theme-toggle-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--border-main);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.theme-toggle-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* Glass Panel Effect */
.glass-panel {
    background: var(--bg-workspace);
    border: 1px solid var(--border-main);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Workspace panels are sharp */
.grid-editor .glass-panel,
.grid-console .glass-panel {
    border-radius: 0 !important;
    box-shadow: none !important;
}

body[data-theme="dark"] .glass-panel {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

body[data-theme="light"] .glass-panel,
body[data-theme="eye-saver"] .glass-panel {
    background: var(--bg-secondary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.glass-panel:hover {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
    border-color: rgba(99, 102, 241, 0.3);
}

body[data-theme="light"] .glass-panel:hover,
body[data-theme="eye-saver"] .glass-panel:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* CodeMirror Editor Container */
#editor-container {
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

#editor-container .cm-editor {
    height: 100%;
    font-family: 'Menlo', 'Consolas', 'Courier New', monospace;
    font-size: 14px;
}

#editor-container .cm-scroller {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

#editor-container .cm-content {
    padding: 10px 0;
}

#editor-container .cm-gutters {
    border-right: none;
}

#editor-container .cm-focused {
    outline: none;
}

/* ── Lint diagnostics ── */

/* Hover tooltip */
.cm-diagnostic-error {
    border-left: 3px solid var(--accent-red) !important;
    background: var(--accent-red-bg) !important;
    color: var(--text-primary) !important;
    padding: 6px 10px !important;
    font-size: 13px;
    border-radius: 4px;
}

.cm-diagnostic-warning {
    border-left: 3px solid var(--accent-yellow) !important;
    background: var(--accent-yellow-bg) !important;
    color: var(--text-primary) !important;
    padding: 6px 10px !important;
    font-size: 13px;
    border-radius: 4px;
}

.cm-tooltip-lint {
    background: var(--bg-panel) !important;
    border: 1px solid var(--border-main) !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
    overflow: hidden;
}

/* Wavy underline on error code */
.cm-lintRange-error {
    background-image: none !important;
    text-decoration: wavy underline var(--accent-red);
    text-underline-offset: 3px;
}

.cm-lintRange-warning {
    background-image: none !important;
    text-decoration: wavy underline var(--accent-yellow);
    text-underline-offset: 3px;
}

/* Blinking error line number — no dots, just the number */
.cm-lint-line-error {
    color: var(--accent-red) !important;
    font-weight: 700 !important;
    animation: lint-blink 1.2s ease-in-out infinite;
    cursor: help;
}

@keyframes lint-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}

/* Hide default lint gutter entirely (no dot column) */
.cm-gutter-lint {
    display: none !important;
}

.cm-panel-lint {
    background: var(--bg-panel) !important;
    border-top: 1px solid var(--border-main) !important;
}

/* ── Fold gutter ── */

/* Fold arrow — colored and visible */
.cm-foldGutter .cm-gutterElement span {
    color: var(--accent-primary) !important;
    font-size: 16px;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
}

.cm-foldGutter .cm-gutterElement span:hover {
    opacity: 1;
    transform: scale(1.2);
}

/* Fold placeholder (collapsed block indicator) */
.cm-foldPlaceholder {
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399 !important;
    padding: 1px 8px;
    border-radius: 6px;
    font-size: 11px;
    letter-spacing: 2px;
    cursor: pointer;
    margin: 0 4px;
    transition: background 0.2s, border-color 0.2s;
}

.cm-foldPlaceholder:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: #34d399;
}

:root[data-theme="light"] .cm-foldPlaceholder {
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.4);
    color: #1d4ed8;
}

:root[data-theme="light"] .cm-foldPlaceholder:hover {
    background: rgba(37, 99, 235, 0.22);
    border-color: #1d4ed8;
}

:root[data-theme="eye-saver"] .cm-foldPlaceholder {
    background: rgba(180, 83, 9, 0.12);
    border-color: rgba(180, 83, 9, 0.4);
    color: #92400e;
}

:root[data-theme="eye-saver"] .cm-foldPlaceholder:hover {
    background: rgba(180, 83, 9, 0.25);
    border-color: #92400e;
}

/* Smooth scrolling in editor */
#editor-container .cm-scroller {
    scroll-behavior: smooth;
}

/* Rainbow bracket colorization — dark/eye-saver */
.rb-0 { color: #ffd700; }
.rb-1 { color: #da70d6; }
.rb-2 { color: #179fff; }
.rb-3 { color: #00d4aa; }
.rb-4 { color: #ff6b6b; }
.rb-5 { color: #98d8c8; }

/* Rainbow brackets — light theme (darker shades for contrast) */
:root[data-theme="light"] .rb-0 { color: #b8860b; }
:root[data-theme="light"] .rb-1 { color: #9b30a0; }
:root[data-theme="light"] .rb-2 { color: #0969c8; }
:root[data-theme="light"] .rb-3 { color: #008060; }
:root[data-theme="light"] .rb-4 { color: #d32f2f; }
:root[data-theme="light"] .rb-5 { color: #2e8b6e; }

/* Rainbow brackets — eye-saver theme (warm, legible on cream bg) */
:root[data-theme="eye-saver"] .rb-0 { color: #b45309; }
:root[data-theme="eye-saver"] .rb-1 { color: #7e22ce; }
:root[data-theme="eye-saver"] .rb-2 { color: #1d4ed8; }
:root[data-theme="eye-saver"] .rb-3 { color: #047857; }
:root[data-theme="eye-saver"] .rb-4 { color: #be123c; }
:root[data-theme="eye-saver"] .rb-5 { color: #0f766e; }

/* CodeMirror Search Panel — themed to match editor */
#editor-container .cm-panel.cm-search {
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-main);
    padding: 6px 10px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: var(--text-primary);
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    align-items: center;
}

#editor-container .cm-panel.cm-search input,
#editor-container .cm-panel.cm-search [type="checkbox"] + label {
    background: var(--bg-input, var(--bg-tertiary));
    color: var(--text-primary);
    border: 1px solid var(--border-main);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 13px;
    outline: none;
}

#editor-container .cm-panel.cm-search input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

#editor-container .cm-panel.cm-search button {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-main);
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s ease;
}

#editor-container .cm-panel.cm-search button:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

#editor-container .cm-panel.cm-search label {
    color: var(--text-secondary);
    font-size: 12px;
}

#editor-container .cm-panel.cm-search .cm-button {
    background-image: none;
}

#editor-container .cm-panel.cm-search br {
    display: none;
}

/* Search match highlight in editor */
#editor-container .cm-searchMatch {
    background: rgba(255, 213, 79, 0.25);
    outline: 1px solid rgba(255, 213, 79, 0.4);
    border-radius: 2px;
}

#editor-container .cm-searchMatch-selected {
    background: rgba(99, 102, 241, 0.35);
    outline: 1px solid rgba(99, 102, 241, 0.6);
}

/* Output Console */
#output-console {
    background: var(--bg-console);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

#clear-btn {
    color: var(--text-secondary);
    transition: color 0.3s ease, background-color 0.2s ease;
}

#clear-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary) !important;
}

/* ── Unified Scrollbars (Editor + Console) ── */

/* Firefox */
#editor-container .cm-scroller,
#output-console {
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.3) transparent;
}

body[data-theme="light"] #editor-container .cm-scroller,
body[data-theme="light"] #output-console {
    scrollbar-color: rgba(99, 102, 241, 0.25) transparent;
}

body[data-theme="eye-saver"] #editor-container .cm-scroller,
body[data-theme="eye-saver"] #output-console {
    scrollbar-color: rgba(180, 120, 40, 0.3) transparent;
}

/* Webkit (Chrome, Safari, Edge) — shared base */
#editor-container .cm-scroller::-webkit-scrollbar,
#output-console::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

#editor-container .cm-scroller::-webkit-scrollbar-track,
#output-console::-webkit-scrollbar-track {
    background: transparent;
}

#editor-container .cm-scroller::-webkit-scrollbar-thumb,
#output-console::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.25);
    border-radius: 10px;
    border: 1px solid transparent;
    background-clip: padding-box;
}

#editor-container .cm-scroller::-webkit-scrollbar-thumb:hover,
#output-console::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

#editor-container .cm-scroller::-webkit-scrollbar-corner,
#output-console::-webkit-scrollbar-corner {
    background: transparent;
}

/* Light theme scrollbars */
body[data-theme="light"] #editor-container .cm-scroller::-webkit-scrollbar-thumb,
body[data-theme="light"] #output-console::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.2);
}

body[data-theme="light"] #editor-container .cm-scroller::-webkit-scrollbar-thumb:hover,
body[data-theme="light"] #output-console::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.4);
}

/* Eye-saver theme scrollbars */
body[data-theme="eye-saver"] #editor-container .cm-scroller::-webkit-scrollbar-thumb,
body[data-theme="eye-saver"] #output-console::-webkit-scrollbar-thumb {
    background: rgba(180, 120, 40, 0.25);
}

body[data-theme="eye-saver"] #editor-container .cm-scroller::-webkit-scrollbar-thumb:hover,
body[data-theme="eye-saver"] #output-console::-webkit-scrollbar-thumb:hover {
    background: rgba(180, 120, 40, 0.5);
}

/* Output Styles */
.output-line {
    margin-bottom: 4px;
    white-space: pre-wrap;
    word-wrap: break-word;
    contain: inline-size;
}

.output-error {
    color: #ef4444;
    font-weight: 500;
}

.output-success {
    color: #10b981;
}

body[data-theme="eye-saver"] .output-success {
    color: #059669;
}

.output-timestamp {
    color: #6b7280;
    font-size: 0.75rem;
    margin-bottom: 8px;
    display: block;
}

body[data-theme="eye-saver"] .output-timestamp {
    color: var(--text-muted);
}

/* ── Plot Output Section (below IDE grid, centered) ── */
.plot-output-section {
    max-width: 960px;
    width: 90%;
    margin: 24px auto 40px;
    border-radius: 12px;
    background: #1c1c30;
    border: 1px solid rgba(99, 102, 241, 0.35);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 12px rgba(99, 102, 241, 0.08);
    overflow: hidden;
}

body[data-theme="light"] .plot-output-section {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

body[data-theme="eye-saver"] .plot-output-section {
    background: #1a1a2e;
    border: 1px solid rgba(245, 158, 11, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(245, 158, 11, 0.08);
}

.plot-output-content {
    display: flex;
    flex-direction: column;
}

/* ── Matplotlib figure root — force full-width block ── */
.plot-output-content > div {
    display: block !important;
    width: 100% !important;
}

/* ── Title bar ("Figure 1") ── */
.plot-output-content .ui-dialog-titlebar {
    background: #14142a;
    border-bottom: 1px solid rgba(99, 102, 241, 0.3);
    padding: 10px 0;
    margin: 0;
    border-top: none;
    border-left: none;
    border-right: none;
    border-radius: 0 !important;
}

body[data-theme="light"] .plot-output-content .ui-dialog-titlebar {
    background: #f5f5fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body[data-theme="eye-saver"] .plot-output-content .ui-dialog-titlebar {
    background: #111128;
    border-bottom: 1px solid rgba(245, 158, 11, 0.12);
}

.plot-output-content .ui-dialog-title {
    font-size: 13px;
    font-weight: 600;
    color: #c8c8f0;
    letter-spacing: 0.5px;
    text-align: center !important;
    padding: 0 !important;
    width: 100% !important;
}

body[data-theme="light"] .plot-output-content .ui-dialog-title {
    color: #333;
}

body[data-theme="eye-saver"] .plot-output-content .ui-dialog-title {
    color: #d4a053;
}

/* Kill any jQuery UI border-radius on titlebar */
.plot-output-content .ui-corner-all {
    border-radius: 0 !important;
}

/* ── Canvas container ── */
.plot-output-content [tabindex="0"] {
    width: 100% !important;
    border: none !important;
    resize: none !important;
    overflow: hidden !important;
    border-radius: 0 !important;
}

.plot-output-content canvas.mpl-canvas {
    width: 100% !important;
    height: auto !important;
}

/* ── Toolbar ── */
.plot-output-content .mpl-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    background: #14142a;
    border-top: 1px solid rgba(99, 102, 241, 0.3);
    box-sizing: border-box;
}

body[data-theme="light"] .plot-output-content .mpl-toolbar {
    background: #f5f5fa;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

body[data-theme="eye-saver"] .plot-output-content .mpl-toolbar {
    background: #111128;
    border-top: 1px solid rgba(245, 158, 11, 0.12);
}

.plot-output-content .mpl-button-group {
    display: inline-flex;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 4px 8px;
}

body[data-theme="light"] .plot-output-content .mpl-button-group {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.06);
}

body[data-theme="eye-saver"] .plot-output-content .mpl-button-group {
    background: rgba(0, 0, 0, 0.35);
    border-color: rgba(245, 158, 11, 0.15);
}

.plot-output-content .mpl-widget {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 8px 10px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: background 0.15s, border-color 0.15s;
}

.plot-output-content .mpl-widget:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
}

body[data-theme="eye-saver"] .plot-output-content .mpl-widget:hover {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.35);
}

.plot-output-content .mpl-widget[aria-pressed="true"],
.plot-output-content .mpl-widget.active {
    background: rgba(99, 102, 241, 0.25);
    border-color: var(--accent-primary);
}

/* Icons — invert for dark themes so they're visible */
.plot-output-content .mpl-widget img {
    width: 20px;
    height: 20px;
    display: block;
    filter: invert(0.85) hue-rotate(180deg);
    opacity: 0.85;
    transition: opacity 0.15s, filter 0.15s;
}

.plot-output-content .mpl-widget:hover img {
    opacity: 1;
    filter: invert(1) hue-rotate(180deg) brightness(1.4);
}

body[data-theme="light"] .plot-output-content .mpl-widget img {
    filter: none;
    opacity: 0.6;
}

body[data-theme="light"] .plot-output-content .mpl-widget:hover img {
    filter: none;
    opacity: 1;
}

body[data-theme="eye-saver"] .plot-output-content .mpl-widget img {
    filter: invert(1);
    opacity: 1;
}

body[data-theme="eye-saver"] .plot-output-content .mpl-widget:hover img {
    filter: invert(1) brightness(1.2) drop-shadow(0 0 3px rgba(245, 158, 11, 0.5));
}

/* Format dropdown */
.plot-output-content select.mpl-widget {
    padding: 5px 12px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #c8c8f0;
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 6px;
}

body[data-theme="light"] .plot-output-content select.mpl-widget {
    background: #fff;
    color: #333;
    border-color: rgba(0, 0, 0, 0.15);
}

body[data-theme="eye-saver"] .plot-output-content select.mpl-widget {
    background: rgba(245, 158, 11, 0.06);
    color: #d4a053;
    border-color: rgba(245, 158, 11, 0.2);
}

/* Hover status message text */
.plot-output-content .mpl-message {
    font-size: 12px;
    font-weight: 500;
    color: #a8a8d0;
    margin-left: auto;
    min-width: 0;
    transition: opacity 0.3s;
}

body[data-theme="light"] .plot-output-content .mpl-message {
    color: #333;
}

body[data-theme="eye-saver"] .plot-output-content .mpl-message {
    color: #d4a860;
}

/* Plot card (used in console output) */
.output-plot-container {
    white-space: normal;
    margin: 8px 0;
    border-radius: 8px;
    border: 1px solid var(--border-main);
    background: rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

body[data-theme="light"] .output-plot-container,
body[data-theme="eye-saver"] .output-plot-container {
    background: rgba(0, 0, 0, 0.04);
}

.output-plot-img {
    display: block;
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    background: #fff;
}

.output-plot-actions {
    display: flex;
    gap: 8px;
    padding: 8px 10px;
    border-top: 1px solid var(--border-main);
}

.plot-action-btn {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 6px;
    border: 1px solid var(--border-main);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
}

.plot-action-btn:hover {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
}

/* System notification (download, screenshot, etc.) */
.output-info {
    color: #7dd3fc;
    background: rgba(56, 189, 248, 0.07);
    border-left: 3px solid #38bdf8;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 0.8rem;
    margin: 4px 0;
}

body[data-theme="light"] .output-info {
    color: #0369a1;
    background: rgba(14, 165, 233, 0.08);
    border-left-color: #0ea5e9;
}

body[data-theme="eye-saver"] .output-info {
    color: #9a6700;
    background: rgba(180, 120, 0, 0.07);
    border-left-color: #b45309;
}

/* --- Dynamic Loading Screen --- */
#loading-overlay {
    background-color: #0f172a;
    background-size: 400% 400%;
    animation: bg-shift 15s ease-in-out infinite;
}

#loading-overlay.bg-morning {
    background: linear-gradient(-45deg, #ff9a9e, #fad0c4, #ffd1ff, #a1c4fd);
    background-size: 400% 400%;
}

#loading-overlay.bg-afternoon {
    background: linear-gradient(-45deg, #a1c4fd, #c2e9fb, #84fab0, #8fd3f4);
    background-size: 400% 400%;
}

#loading-overlay.bg-evening {
    background: linear-gradient(-45deg, #30cfd0, #330867, #5f2c82, #49a09d);
    background-size: 400% 400%;
}

#loading-overlay.bg-night {
    background: linear-gradient(-45deg, #09203f, #537895, #1e3c72, #2a5298);
    background-size: 400% 400%;
}

#loading-status {
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.5s ease, opacity 0.5s ease;
    color: #94a3b8;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Theme-based loading text colors */
.bg-morning #loading-status {
    background: linear-gradient(to right, #db2777, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
}

.bg-afternoon #loading-status {
    background: linear-gradient(to right, #0369a1, #0d9488);
    -webkit-background-clip: text;
    background-clip: text;
}

.bg-evening #loading-status {
    background: linear-gradient(to right, #f59e0b, #ef4444);
    -webkit-background-clip: text;
    background-clip: text;
}

.bg-night #loading-status {
    background: linear-gradient(to right, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
}

@keyframes bg-shift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

#loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}




/* Rain Effect */
.rain-drop {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.4);
    width: 2px;
    height: 15px;
    top: -20px;
    animation: rain-fall linear infinite;
}

@keyframes rain-fall {
    to {
        transform: translateY(100vh);
    }
}

/* Snow Effect */
.snow-flake {
    position: absolute;
    background-color: white;
    border-radius: 50%;
    top: -10px;
    animation: snow-fall linear infinite;
}

@keyframes snow-fall {
    to {
        transform: translateY(100vh) translateX(20px);
    }
}

/* Clouds Effect — Realistic Puffy */
.cloud-v6 {
    position: absolute;
    opacity: 0;
    animation: cloud-v6-drift linear infinite;
}

.cloud-v6-shape {
    position: relative;
    filter: blur(3px);
}

.cloud-v6-shape .puff {
    position: absolute;
    background: radial-gradient(ellipse at 50% 90%,
        rgba(255,255,255,0.45) 0%,
        rgba(255,255,255,0.25) 40%,
        rgba(255,255,255,0.08) 70%,
        transparent 100%
    );
    border-radius: 50%;
}

.cloud-v6-shape .puff-base {
    width: 100%;
    height: 45%;
    bottom: 0;
    left: 0;
    border-radius: 40%;
}

.cloud-v6-shape .puff-l {
    width: 45%;
    height: 65%;
    bottom: 15%;
    left: 5%;
}

.cloud-v6-shape .puff-c {
    width: 50%;
    height: 85%;
    bottom: 10%;
    left: 25%;
}

.cloud-v6-shape .puff-r {
    width: 40%;
    height: 55%;
    bottom: 15%;
    right: 8%;
}

.cloud-v6-shape .puff-t {
    width: 30%;
    height: 40%;
    bottom: 50%;
    left: 35%;
}

@keyframes cloud-v6-drift {
    0%   { transform: translateX(-300px) translateY(0); opacity: 0; }
    3%   { opacity: 1; }
    50%  { transform: translateX(50vw) translateY(-8px); }
    97%  { opacity: 1; }
    100% { transform: translateX(calc(100vw + 150px)) translateY(0); opacity: 0; }
}

/* Snow Crystal — SVG snowflakes */
.snow-crystal {
    position: absolute;
    top: -30px;
    opacity: 0;
    animation: snow-crystal-fall linear infinite;
}
.snow-crystal svg {
    stroke: white;
    fill: none;
    stroke-linecap: round;
    filter: drop-shadow(0 0 2px rgba(255,255,255,0.5));
}
@keyframes snow-crystal-fall {
    0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
    5%   { opacity: 0.7; }
    90%  { opacity: 0.5; }
    100% { transform: translateY(100vh) rotate(180deg); opacity: 0; }
}

/* Sunny/Clear — Sun glow, core, rays, birds, balloons */
.sun3-rays-wrap {
    position: absolute;
    top: -5px;
    right: 18px;
    width: 65px;
    height: 65px;
    pointer-events: none;
}
.sun3-ray {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    transform-origin: 0 0;
    filter: blur(8px);
    animation: sun3-ray-pulse 8s ease-in-out infinite;
}
@keyframes sun3-ray-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
.sun3-glow {
    position: absolute;
    top: -70px;
    right: -50px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(255,255,240,0.4) 0%,
        rgba(255,245,200,0.2) 25%,
        rgba(255,230,150,0.08) 45%,
        transparent 65%
    );
    filter: blur(8px);
    animation: sun3-breathe 7s ease-in-out infinite;
}
.sun3-core {
    position: absolute;
    top: -5px;
    right: 18px;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: radial-gradient(circle at 38% 36%,
        #ffffff 0%, #fffde8 12%, #ffefa0 30%,
        #ffe05a 55%, #f5c520 80%, #e8a810 100%
    );
    box-shadow:
        0 0 12px rgba(255,240,120,0.8),
        0 0 35px rgba(255,220,80,0.5),
        0 0 60px rgba(255,200,60,0.25),
        0 0 100px rgba(255,180,40,0.1);
    animation: sun3-breathe 5s ease-in-out infinite;
}
@keyframes sun3-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}
.cloud-bright .puff {
    background: radial-gradient(ellipse at 50% 85%,
        rgba(255,255,255,0.7) 0%,
        rgba(255,255,255,0.45) 35%,
        rgba(255,255,255,0.15) 65%,
        transparent 80%
    ) !important;
}
/* Birds */
.sky-bird-v3 {
    position: absolute;
    opacity: 0;
    animation: sky-bird-fly linear infinite;
}
.sky-bird-v3 svg { overflow: visible; }
.bv3-wl { animation: bv3-flap var(--f) ease-in-out infinite; transform-origin: 30px 18px; }
.bv3-wr { animation: bv3-flap-r var(--f) ease-in-out infinite; transform-origin: 30px 18px; }
@keyframes bv3-flap {
    0%, 100% { transform: rotate(0deg) scaleY(1); }
    30% { transform: rotate(18deg) scaleY(0.92); }
    50% { transform: rotate(22deg) scaleY(0.88); }
    70% { transform: rotate(12deg) scaleY(0.95); }
}
@keyframes bv3-flap-r {
    0%, 100% { transform: rotate(0deg) scaleY(1); }
    30% { transform: rotate(-18deg) scaleY(0.92); }
    50% { transform: rotate(-22deg) scaleY(0.88); }
    70% { transform: rotate(-12deg) scaleY(0.95); }
}
@keyframes sky-bird-fly {
    0%   { transform: translate(-50px, 0) rotate(0deg); opacity: 0; }
    3%   { opacity: var(--op); }
    12%  { transform: translate(12vw, var(--b1)) rotate(var(--r1, 0deg)); }
    28%  { transform: translate(28vw, var(--b2)) rotate(var(--r2, 0deg)); }
    42%  { transform: translate(42vw, var(--b3)) rotate(0deg); }
    58%  { transform: translate(58vw, var(--b4)) rotate(var(--r3, 0deg)); }
    75%  { transform: translate(75vw, var(--b5)) rotate(var(--r4, 0deg)); }
    90%  { transform: translate(90vw, var(--b6)) rotate(0deg); }
    97%  { opacity: calc(var(--op) * 0.6); }
    100% { transform: translate(calc(100vw + 50px), var(--b7, 0px)) rotate(0deg); opacity: 0; }
}
/* Hot air balloons */
.balloon {
    position: absolute;
    opacity: 0;
    animation: balloon-drift linear infinite;
}
@keyframes balloon-drift {
    0%   { transform: translate(-120px, 0px); opacity: 0; }
    2%   { opacity: var(--b-op, 0.85); }
    15%  { transform: translate(15vw, var(--bob1, -8px)); }
    30%  { transform: translate(30vw, var(--bob2, 4px)); }
    50%  { transform: translate(50vw, var(--bob3, -6px)); }
    70%  { transform: translate(70vw, var(--bob4, 3px)); }
    85%  { transform: translate(85vw, var(--bob5, -5px)); }
    97%  { opacity: var(--b-op, 0.85); }
    100% { transform: translate(calc(100vw + 120px), var(--bob6, -2px)); opacity: 0; }
}

/* ── Clear Night — Moon, stars, moonlight ── */
.moon-glow {
    position: absolute;
    top: -70px;
    right: -50px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(255,240,180,0.18) 0%,
        rgba(240,220,150,0.08) 25%,
        rgba(200,200,220,0.04) 45%,
        transparent 65%
    );
    filter: blur(10px);
    animation: moon-breathe 8s ease-in-out infinite;
}
.moon-emoji {
    position: absolute;
    top: -8px;
    right: 10px;
    font-size: 60px;
    line-height: 1;
    filter: drop-shadow(0 0 12px rgba(255,240,150,0.5)) drop-shadow(0 0 30px rgba(255,220,100,0.2));
    animation: moon-breathe 8s ease-in-out infinite;
}
@keyframes moon-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}
.moon-rays-wrap {
    position: absolute;
    top: 15px;
    right: 32px;
    width: 30px;
    height: 30px;
    pointer-events: none;
}
.moon-ray {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    transform-origin: 0 0;
    animation: moon-ray-pulse 10s ease-in-out infinite;
}
@keyframes moon-ray-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.night-star {
    position: absolute;
    border-radius: 50%;
    background: rgba(220,230,255,0.9);
    animation: star-twinkle ease-in-out infinite;
}
@keyframes star-twinkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    25% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 0.9; transform: scale(1.1); }
    75% { opacity: 0.4; transform: scale(0.85); }
}

/* ── Sunset (evening clear sky) ── */
.sunset-glow {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 200%;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(ellipse at 50% 100%,
        rgba(255,120,50,0.45) 0%,
        rgba(255,80,30,0.25) 25%,
        rgba(200,50,80,0.12) 45%,
        transparent 70%
    );
    filter: blur(10px);
    animation: sunset-pulse 6s ease-in-out infinite;
}
.sunset-core {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 40px;
    border-radius: 80px 80px 0 0;
    background: radial-gradient(ellipse at 50% 100%,
        rgba(255,200,100,0.9) 0%,
        rgba(255,160,60,0.6) 40%,
        rgba(255,100,40,0.3) 70%,
        transparent 100%
    );
    box-shadow:
        0 0 20px rgba(255,150,50,0.5),
        0 0 40px rgba(255,100,30,0.25);
    animation: sunset-pulse 5s ease-in-out infinite;
}
@keyframes sunset-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}
.sunset-rays-wrap {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
}
.sunset-ray {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 0;
    transform-origin: 0 100%;
    filter: blur(8px);
    animation: sun3-ray-pulse 8s ease-in-out infinite;
}
.cloud-sunset .puff {
    background: radial-gradient(ellipse at 50% 85%,
        rgba(255,180,120,0.55) 0%,
        rgba(255,140,80,0.35) 35%,
        rgba(255,100,60,0.12) 65%,
        transparent 80%
    ) !important;
}
.cloud-moonlit .puff {
    background: radial-gradient(ellipse at 50% 85%,
        rgba(200,210,230,0.35) 0%,
        rgba(180,195,220,0.2) 35%,
        rgba(160,175,200,0.08) 65%,
        transparent 80%
    ) !important;
}

/* Wind Effect */
.wind-streak { position: absolute; height: 1px; background: linear-gradient(to right, transparent, rgba(255,255,255,0.3), transparent); animation: wind-blow linear infinite; }
@keyframes wind-blow { from { transform: translateX(-100%); } to { transform: translateX(100vw); } }
.wind-dust { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: rgba(255,255,255,0.25); animation: wind-dust-fly linear infinite; }
@keyframes wind-dust-fly { 0% { transform: translate(-20px,0) scale(1); opacity:0; } 10% { opacity:0.5; } 90% { opacity:0.3; } 100% { transform: translate(100vw,-40px) scale(0.5); opacity:0; } }
.wind-leaf { position: absolute; animation: wind-leaf-tumble linear infinite; opacity: 0; }
@keyframes wind-leaf-tumble { 0% { transform: translate(-30px,0) rotate(0deg) scale(1); opacity:0; } 5% { opacity:0.8; } 25% { transform: translate(25vw,-20px) rotate(180deg) scale(0.9); } 50% { transform: translate(50vw,10px) rotate(400deg) scale(1.05); } 75% { transform: translate(75vw,-15px) rotate(580deg) scale(0.85); } 95% { opacity:0.6; } 100% { transform: translate(100vw,5px) rotate(750deg) scale(0.9); opacity:0; } }
.wind-leaf-alt { position: absolute; animation: wind-leaf-tumble-alt linear infinite; opacity: 0; }
@keyframes wind-leaf-tumble-alt { 0% { transform: translate(-20px,0) rotate(0deg); opacity:0; } 5% { opacity:0.7; } 30% { transform: translate(30vw,15px) rotate(-200deg); } 60% { transform: translate(60vw,-10px) rotate(-420deg); } 95% { opacity:0.5; } 100% { transform: translate(100vw,8px) rotate(-680deg); opacity:0; } }

/* Thunderstorm Effect */
.storm-flash { position: absolute; inset: 0; pointer-events: none; z-index: 5; opacity: 0; }
.storm-lightning { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 6; }
.bolt-path { fill: none; stroke: #fff; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 8px rgba(180,180,255,0.9)) drop-shadow(0 0 25px rgba(150,150,255,0.6)); }
.bolt-branch { fill: none; stroke: rgba(200,200,255,0.7); stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 5px rgba(180,180,255,0.6)); }

/* --- Initialization Animations --- */

#animation-container {
    perspective: 1000px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

#animation-container * {
    transition: none !important;
}

/* Loading animations are short-lived — browser auto-promotes to composite layers.
   will-change removed to avoid reserving GPU memory for 18+ elements unnecessarily. */

/* Global Animation Wrapper for Consistent Centering */
.loading-animation-wrapper {
    width: 160px;
    height: 160px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin: 0 auto;
}

/* 1. Skateboard - Smooth Riding Motion */
.anim-skateboard {
    width: 80px;
    height: 22px;
    background: linear-gradient(90deg, #6366f1, #a855f7);
    border-radius: 10px;
    position: relative;
    animation: skateboard-ride 1.8s ease-in-out infinite;
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.4);
}

.anim-skateboard::before,
.anim-skateboard::after {
    content: '';
    position: absolute;
    bottom: -8px;
    width: 14px;
    height: 14px;
    background: #333;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
    z-index: -1;
}

.anim-skateboard::before {
    left: 12px;
}

.anim-skateboard::after {
    right: 12px;
}

@keyframes skateboard-ride {

    0%,
    100% {
        transform: translateX(-40px) rotate(-8deg);
    }

    50% {
        transform: translateX(40px) rotate(8deg);
    }
}

/* 2. Ethereal Stars - Floating Constellation */
.anim-stars {
    display: flex;
    gap: 15px;
}

.anim-stars .star {
    font-size: 50px;
    animation: star-float-pro 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.4));
}

.anim-stars .star:nth-child(2) {
    animation-delay: 0.3s;
}

.anim-stars .star:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes star-float-pro {
    0%, 100% {
        transform: translateY(0) scale(1) rotate(0deg);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-30px) scale(1.3) rotate(15deg);
        opacity: 1;
    }
}

/* 3. Pulsing Heart - Rhythmic Beat */
.anim-heart {
    font-size: 85px;
    animation: heart-pro-pulse 1s ease-in-out infinite;
    filter: drop-shadow(0 0 25px rgba(239, 68, 68, 0.5));
}

@keyframes heart-pro-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.3);
        opacity: 1;
    }
}

/* 4. Playful Monkey - Swinging */
.anim-monkey {
    font-size: 90px;
    animation: monkey-wiggle-float 1.2s ease-in-out infinite;
    transform-origin: center top;
}

@keyframes monkey-wiggle-float {

    0%,
    100% {
        transform: rotate(-20deg) translateY(0);
    }

    50% {
        transform: rotate(20deg) translateY(-20px);
    }
}

/* 5. Glowing Orbs - Orbiting System */
.anim-orbs {
    width: 90px;
    height: 90px;
    background: rgba(99, 102, 241, 0.1);
    border: 3px solid rgba(99, 102, 241, 0.3);
    border-radius: 50%;
    position: relative;
    animation: orb-spin-new 2s linear infinite;
}

.orb-inner {
    width: 25px;
    height: 25px;
    background: #6366f1;
    border-radius: 50%;
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 20px #6366f1;
}

@keyframes orb-spin-new {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* 6. Snap Pixels - Kinetic Bounce */
.anim-pixels {
    display: flex;
    gap: 12px;
}

.anim-pixels .pxl {
    width: 24px;
    height: 24px;
    background: #6366f1;
    border-radius: 6px;
    animation: pixel-kinetic 1s ease-in-out infinite;
}

.anim-pixels .pxl:nth-child(2) {
    animation-delay: 0.15s;
    background: #8b5cf6;
}

.anim-pixels .pxl:nth-child(3) {
    animation-delay: 0.3s;
    background: #ec4899;
}

@keyframes pixel-kinetic {

    0%,
    100% {
        transform: translateY(0) scale(1);
        border-radius: 6px;
    }

    50% {
        transform: translateY(-40px) scale(1.2);
        border-radius: 50%;
    }
}

/* 7. Quantum Atom - 3D Orbit */
.anim-atom {
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transform-style: preserve-3d;
}

.atom-core {
    width: 35px;
    height: 35px;
    background: #6366f1;
    border-radius: 50%;
    box-shadow: 0 0 30px #6366f1;
    animation: core-pulse 1s ease-in-out infinite;
    z-index: 2;
}

.anim-atom::before,
.anim-atom::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 40%;
    border: 3px solid rgba(99, 102, 241, 0.7);
    border-radius: 50%;
}

.anim-atom::before {
    animation: orbit-1-new 2s linear infinite;
}

.anim-atom::after {
    animation: orbit-2-new 2.5s linear infinite;
}

@keyframes core-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(0.8);
    }
}

@keyframes orbit-1-new {
    0% {
        transform: rotateX(65deg) rotateZ(0deg);
    }

    100% {
        transform: rotateX(65deg) rotateZ(360deg);
    }
}

@keyframes orbit-2-new {
    0% {
        transform: rotateX(-65deg) rotateZ(0deg);
    }

    100% {
        transform: rotateX(-65deg) rotateZ(360deg);
    }
}

/* 8. Stealth Python - Peeking */
.anim-peek {
    width: 150px;
    height: 150px;
    overflow: hidden;
    position: relative;
}

.peek-snake {
    font-size: 80px;
    position: absolute;
    top: 150px;
    left: 50%;
    transform: translateX(-50%);
    animation: peek-pro 2.5s ease-in-out infinite;
    line-height: 1;
}

@keyframes peek-pro {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    30%,
    70% {
        transform: translateX(-50%) translateY(-120px);
    }
}

/* 9. Dreamy Cloud - Sparkling Float */
.anim-cloud {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cloud-main {
    font-size: 85px;
    animation: cloud-float-pro 3s ease-in-out infinite;
}

.anim-cloud::after {
    content: '✨';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 30px;
    animation: sparkle-pro-new 1.5s ease-in-out infinite;
}

@keyframes cloud-float-pro {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(20px, -20px);
    }
}

@keyframes sparkle-pro-new {

    0%,
    100% {
        transform: scale(0) rotate(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 1;
    }
}

/* 10. Mystic Wand - Magic Lift */
.anim-wand {
    font-size: 85px;
    animation: wand-magic 2s ease-in-out infinite;
}

@keyframes wand-magic {
    0%, 100% {
        transform: rotate(-15deg) translateY(0);
        opacity: 0.85;
    }
    50% {
        transform: rotate(25deg) translateY(-20px);
        opacity: 1;
    }
}

/* 11. Rocket - Lift Off */
.anim-rocket {
    font-size: 85px;
    animation: rocket-lift 1.2s ease-in-out infinite;
}

@keyframes rocket-lift {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-25px);
    }
}

/* 12. Ghost - Hovering */
.anim-ghost {
    font-size: 85px;
    animation: ghost-hover 2s ease-in-out infinite;
}

@keyframes ghost-hover {

    0%,
    100% {
        transform: translateY(0) translateX(0);
        opacity: 0.7;
    }

    25% {
        transform: translateY(-15px) translateX(10px);
        opacity: 1;
    }

    75% {
        transform: translateY(15px) translateX(-10px);
        opacity: 0.7;
    }
}

/* 13. Robot - Mechanical Bounce */
.anim-robot {
    font-size: 85px;
    animation: robot-bounce 0.8s ease-in-out infinite;
}

@keyframes robot-bounce {

    0%,
    100% {
        transform: scaleY(1) translateY(0);
    }

    50% {
        transform: scaleY(0.8) translateY(10px);
    }
}

/* 14. Pizza - Spinning Slice */
.anim-pizza {
    font-size: 85px;
    animation: pizza-spin 1.5s ease-in-out infinite;
}

@keyframes pizza-spin {
    0% {
        transform: rotate(0deg) scale(1);
    }

    50% {
        transform: rotate(180deg) scale(1.2);
    }

    100% {
        transform: rotate(360deg) scale(1);
    }
}

/* 15. Sparkles - Double Twinkle */
.anim-sparkles {
    font-size: 85px;
    animation: sparkle-twinkle 1s ease-in-out infinite;
}

@keyframes sparkle-twinkle {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.6;
        filter: none;
    }

    50% {
        transform: scale(1.4);
        opacity: 1;
        filter: drop-shadow(0 0 30px #ffdf00);
    }
}


/* 3D Button Effect */
.btn-3d {
    transition: all 0.1s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-3d:active {
    transform: translateY(4px) !important;
    box-shadow: none !important;
}

/* Specific Shadow Colors for 3D Effect */

/* Download Button Re-styling */
.download-btn-3d {
    background: linear-gradient(90deg, #10b981, #059669);
    /* Emerald Gradient */
    color: white;
    border: none;
    box-shadow: 0 4px 0 #047857;
    /* darker emerald */
    margin-bottom: 4px;
}

.download-btn-3d:hover {
    background: linear-gradient(90deg, #059669, #047857);
}

/* Responsive Design consolidated at end of file */

/* Smooth Transitions */
button {
    transition: all 0.2s ease;
}

/* Focus Styles */
button:focus {
    outline: 2px solid rgba(99, 102, 241, 0.5);
    outline-offset: 2px;
}

/* Status Badge Animation — opacity-based (no box-shadow repaints) */
@keyframes pulse-glow {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

#status-badge {
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.6);
    animation: pulse-glow 2s ease-in-out infinite;
}

footer {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 10px 0;
    border-top: 1px solid var(--border-main);
    position: relative;
}

.footer-content {
    display: flex;
    gap: 15px;
}

.footer-contact {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.contact-label {
    color: var(--text-primary);
    opacity: 0.8;
}

.contact-link {
    color: var(--accent-primary);
    /* Uses your blue or amber accent */
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.contact-link:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* Package Bar Styling (Integrated into Breadcrumb) */
.pkg-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    background: transparent;
    padding: 0;
    border-bottom: none;
}

/* Custom Theme-Aware Dropdown */
.pkg-custom-select {
    position: relative;
    width: 140px;
    font-family: 'JetBrains Mono', monospace;
    user-select: none;
}

.select-trigger {
    background: var(--bg-input);
    border: 1px solid var(--border-main);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.select-trigger:hover {
    border-color: rgba(var(--accent-primary-rgb), 0.4);
    background: var(--bg-input-focus);
}

.select-trigger:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(var(--accent-primary-rgb), 0.2);
}

.chevron-icon {
    opacity: 0.6;
    transition: transform 0.3s ease;
}

.pkg-custom-select.active .chevron-icon {
    transform: rotate(180deg);
}

.select-options {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-panel);
    border: 1px solid var(--border-main);
    border-radius: 10px;
    padding: 6px;
    z-index: 1000;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    animation: dropdownSlideIn 0.2s ease-out;
    max-height: 45vh;
    overflow-y: auto;
}

.select-options.hidden {
    display: none;
}

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.option {
    padding: 8px 10px;
    font-size: 13px;
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

/* Subtle Highlighter - Matches Theme Accent */
.option:hover {
    background: rgba(var(--accent-primary-rgb), 0.12);
    color: var(--accent-primary);
}

.option.selected {
    background: rgba(var(--accent-primary-rgb), 0.18);
    color: var(--accent-primary);
    font-weight: 600;
}

#custom-pkg {
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-input);
    border: 1px solid var(--border-main);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#custom-pkg:hover {
    border-color: rgba(var(--accent-primary-rgb), 0.4);
    background: var(--bg-input-focus);
}

#custom-pkg:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 2px rgba(var(--accent-primary-rgb), 0.2);
}

#custom-pkg:-webkit-autofill,
#custom-pkg:-webkit-autofill:hover,
#custom-pkg:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-input) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    border: 1px solid var(--border-main) !important;
    caret-color: var(--text-primary);
}

#custom-pkg::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.pkg-dropdown:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-input-focus);
}

.btn-install {
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    cursor: pointer;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-install:hover {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 0 12px rgba(var(--accent-primary-rgb), 0.4);
}

.seaborn-tip {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: var(--bg-panel);
    border: 1px solid var(--accent-primary);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 100;
    width: max-content;
    max-width: 320px;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.seaborn-tip.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.seaborn-tip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 20px;
    border: 6px solid transparent;
    border-bottom-color: var(--accent-primary);
}

.seaborn-tip code {
    background: var(--bg-input);
    color: var(--accent-primary);
    padding: 2px 4px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
}

#install-msg {
    font-size: 12px;
    font-weight: 500;
}

.hidden {
    display: none;
}

/* Premium Snapshot Styles */
#snapshot-renderer {
    position: fixed;
    top: -9999px;
    left: -9999px;
    width: 1000px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px;
    z-index: -1000;
}

.snapshot-card {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-primary) 0%, #7c3aed 100%);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.snapshot-window {
    background: var(--bg-panel);
    border: 1px solid var(--border-main);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
}

.snapshot-titlebar {
    background: rgba(0, 0, 0, 0.1);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-main);
}

.titlebar-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red {
    background: #ff5f56;
}

.dot.yellow {
    background: #ffbd2e;
}

.dot.green {
    background: #27c93f;
}

.snapshot-filename {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
}

.snapshot-content {
    padding: 24px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre;
    word-break: break-all;
    background: transparent;
}

.snapshot-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.snapshot-watermark {
    font-size: 14px;
    font-weight: 700;
    color: white;
    opacity: 0.8;
    letter-spacing: 0.5px;
}

/* --- Responsive Zoom/Height Handling --- */
/* Short viewports (laptops, zoomed): keep definite height so fr units
   and the drag-resizer work. Use minmax for minimum panel sizes;
   each panel scrolls internally (cm-scroller / #output-console). */
@media (max-height: 800px) {
    .grid-container {
        height: 100dvh;
        overflow: hidden;
        grid-template-rows: auto minmax(200px, 65fr) 6px minmax(100px, 35fr) auto;
    }
}

/* Smart Toolbar Responsiveness consolidated at end of file */

/* Special fix for side-by-side min-width preservation */
.grid-editor,
.grid-console {
    min-width: 0;
}

/* --- Production Parity Styles --- */

/* 3D Button Style (Production Spec) */
.btn-3d {
    height: 40px;
    padding: 0px 24px;
    font-size: 14px;
    font-weight: 600;
    transition: 0.1s;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    top: 0px;
    color: white !important;
    text-shadow: rgba(0, 0, 0, 0.2) 0px 1px 2px;
}

.btn-3d:active {
    top: 3px;
    transform: translateY(4px);
    box-shadow: none !important;
}

.btn-download {
    background: linear-gradient(135deg, rgb(245, 158, 11) 0%, rgb(217, 119, 6) 100%) !important;
    box-shadow: rgb(180, 83, 9) 0px 4px 0px, rgba(245, 158, 11, 0.2) 0px 8px 15px !important;
}

.btn-download:hover {
    background: linear-gradient(135deg, rgb(217, 119, 6) 0%, rgb(180, 83, 9) 100%) !important;
    box-shadow: rgb(180, 83, 9) 0px 2px 0px, rgba(245, 158, 11, 0.3) 0px 4px 10px !important;
}


/* --- Smart How-to-Use Drawer --- */
#smart-how-to-drawer {
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

/* Trigger Icon - Shimmering Shady Wave Effect */
.how-to-trigger {
    width: 90px;
    height: 20px;
    /* Shimmering Metallic Gradient */
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.05) 0%,
            var(--accent-primary) 30%,
            var(--bg-tertiary) 100%);
    background-size: 200% 100%;
    clip-path: path('M 0 0 C 12 0 25 20 45 20 C 65 20 78 0 90 0 Z');
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), inset 0 -2px 5px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
    z-index: 60;
    overflow: hidden;
}

/* Eye Saver Override for Wave */
:root[data-theme="eye-saver"] .how-to-trigger {
    background: linear-gradient(135deg,
            #fef3c7 0%,
            #d97706 40%,
            #b45309 100%);
}

.how-to-trigger::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
    transform: skewX(-25deg);
    animation: wave-shimmer 4s infinite;
}

@keyframes wave-shimmer {
    0% {
        left: -100%;
    }

    20% {
        left: 150%;
    }

    100% {
        left: 150%;
    }
}

.trigger-icon {
    width: 14px !important;
    /* Slightly smaller for elegance */
    height: 14px !important;
    color: white !important;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.8));
    animation: trigger-float 4s ease-in-out infinite;
    transition: all 0.3s ease;
}

@keyframes trigger-float {

    0%,
    100% {
        transform: translateY(0) rotate(0);
    }

    50% {
        transform: translateY(-2px) rotate(3deg);
    }
}

.how-to-trigger:hover .trigger-icon {
    transform: scale(1.25) rotate(15deg);
    filter: drop-shadow(0 0 10px white);
}

.how-to-trigger:hover {
    height: 28px;
    background: linear-gradient(135deg,
            var(--accent-primary) 0%,
            var(--accent-hover) 40%,
            var(--primary-purple) 100%);
    transform: scaleX(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    animation: wobble-curve 1.2s ease-in-out infinite;
    will-change: transform;
}

/* Eye Saver Override for Hover */
:root[data-theme="eye-saver"] .how-to-trigger:hover {
    background: linear-gradient(135deg, #fbbf24, #d97706, #92400e);
}

.how-to-drawer-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
    color: var(--text-primary);
    background: linear-gradient(to right, var(--accent-primary), #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Eye Saver Theme Harmony */
:root[data-theme="eye-saver"] .how-to-drawer-title {
    background: linear-gradient(to right, #d97706, #ea580c);
    -webkit-background-clip: text;
    background-clip: text;
}



/* Content Window - Fluid Wobble Effect */
.how-to-content {
    margin-top: -10px;
    /* Slight overlap with trigger */
    padding-top: 15px;
    /* Compensate for overlap */
    width: 380px;
    max-width: 95vw;
    max-height: 80dvh;
    overflow-y: auto;
    padding-left: 24px;
    padding-right: 24px;
    padding-bottom: 24px;

    background: var(--bg-panel);
    border: 1px solid var(--border-main);

    /* Origin at the trigger for expansion */
    transform-origin: top center;
    transform: scaleY(0) scaleX(0.8);
    opacity: 0;

    pointer-events: none;
    border-radius: 20px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3) !important;

    /* Smooth clip for initial state */
    clip-path: circle(0% at 50% 0%);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);

    /* Custom scrollbar for drawer */
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) transparent;
}

.how-to-content::-webkit-scrollbar {
    width: 4px;
}

.how-to-content::-webkit-scrollbar-thumb {
    background-color: var(--accent-primary);
    border-radius: 4px;
}

/* Active State - Jelly Expansion */
#smart-how-to-drawer.active .how-to-content {
    opacity: 1;
    transform: scaleY(1) scaleX(1);
    clip-path: circle(150% at 50% 0%);
    /* Expand circle mask */
    pointer-events: auto;
    animation: jelly-open 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

#smart-how-to-drawer.active .how-to-trigger {
    color: var(--accent-primary);
    filter: drop-shadow(0 0 5px var(--accent-primary));
    box-shadow: none;
    border-radius: 0;
    width: 90px;
    height: 28px;
    margin-bottom: 5px;
}

@keyframes jelly-open {
    0% {
        transform: scale(0.3, 0.3);
        opacity: 0;
    }

    30% {
        transform: scale(1.1, 0.7);
        /* Stretch horizontal */
    }

    50% {
        transform: scale(0.8, 1.1);
        /* Stretch vertical */
    }

    70% {
        transform: scale(1.05, 0.95);
    }

    100% {
        transform: scale(1, 1);
        opacity: 1;
    }
}

#smart-how-to-drawer.active {
    pointer-events: auto;
}

/* Drawer Content Styling */
.how-to-drawer-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    text-align: center;
    border-bottom: 1px solid var(--border-main);
    padding-bottom: 8px;
}

.how-to-drawer-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.drawer-step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.drawer-step-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: var(--bg-tertiary);
    color: var(--accent-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    border: 1px solid var(--border-main);
    transition: all 0.3s ease;
}

.drawer-step:hover .drawer-step-icon {
    background: var(--accent-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.drawer-step-icon svg {
    width: 100%;
    height: 100%;
}

.drawer-step-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.drawer-step-text strong {
    color: var(--text-primary);
    display: block;
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.drawer-step-text kbd {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-main);
    border-radius: 4px;
    padding: 1px 4px;
    font-family: inherit;
    font-size: 0.75rem;
    color: var(--text-primary);
}

.features-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed var(--border-main);
}

.features-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 700;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.feature-chip {
    padding: 6px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-main);
    border-radius: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.2s ease;
    cursor: default;
}

.feature-chip:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: scale(1.02);
    background: rgba(var(--accent-primary-rgb, 56, 189, 248), 0.05);
}

:root[data-theme="light"] .feature-chip:hover {
    background: rgba(37, 99, 235, 0.05);
}

.drawer-trust-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 16px;
    padding: 10px 14px;
    background: rgba(var(--accent-primary-rgb, 56, 189, 248), 0.07);
    border: 1px solid rgba(var(--accent-primary-rgb, 56, 189, 248), 0.18);
    border-radius: 12px;
}

.drawer-trust-item {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent-primary);
    letter-spacing: 0.01em;
}

.drawer-trust-sep {
    font-size: 0.82rem;
    color: var(--text-muted);
    opacity: 0.5;
}

/* Blink / Ping Animation for First Time User */
.ping-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 0 0 50% 50%;
    background: var(--accent-primary);
    opacity: 0;
    z-index: -1;
}

.blinking .ping-effect {
    animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {

    75%,
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }

    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }
}

/* Fluid Wobble Animation for Bell Curve — transform-based (no clip-path reflow) */
@keyframes wobble-curve {
    0%, 100% { transform: scaleX(1.1) scaleY(1); }
    25% { transform: scaleX(1.15) scaleY(0.95); }
    50% { transform: scaleX(1.05) scaleY(1.05); }
    75% { transform: scaleX(1.12) scaleY(0.97); }
}

@keyframes stretch-curve {

    0%,
    100% {
        transform: scaleX(1) scaleY(1);
    }

    25% {
        transform: scaleX(1.03) scaleY(0.98);
    }

    50% {
        transform: scaleX(0.98) scaleY(1.04);
    }

    75% {
        transform: scaleX(1.02) scaleY(0.99);
    }
}

.academy-btn {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white !important;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.academy-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
    filter: brightness(1.1);
}

.academy-sparkle {
    font-size: 1rem;
    animation: sparkle-pulse 2s infinite;
}

@keyframes sparkle-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

[data-theme="light"] .academy-btn {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* Time Travel Button overrides if needed - now sharing snapshot-btn base */
#time-travel-btn {
    font-size: 18px;
}



/* History Dropdown */
.history-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    width: 240px;
    background: var(--bg-panel);
    border: 1px solid var(--border-main);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 100;
    overflow: hidden;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.history-item {
    padding: 8px 12px;
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.15s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.history-item .timestamp {
    font-weight: 500;
}

.history-item .time-ago {
    font-size: 10px;
    opacity: 0.7;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
}

.toast-notification {
    background: var(--bg-panel);
    border: 1px solid var(--accent-primary);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(5px);
}

.toast-notification.hide {
    animation: slideOut 0.3s ease-in forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
}

/* Break Reminder Toast */
.break-reminder {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--bg-panel);
    border: 1px solid var(--accent-primary);
    color: var(--text-primary);
    padding: 16px 18px;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    font-size: 13px;
    max-width: 370px;
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(10px);
    position: relative;
}

.break-reminder.hide {
    animation: slideOut 0.3s ease-in forwards;
}

.break-reminder-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.break-reminder-body {
    flex: 1;
    min-width: 0;
}

.break-reminder-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--accent-primary);
}

.break-reminder-text {
    line-height: 1.5;
    color: var(--text-secondary);
}

.break-reminder-dismiss {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 0 0 0 4px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s;
}

.break-reminder-dismiss:hover {
    color: var(--text-primary);
}

/* ── Idle Screensaver ─────────────────────────────────────── */
.idle-screensaver {
    position: fixed;
    inset: 0;
    z-index: 1999;
    background-color: #0f172a;
    background-size: 400% 400%;
    animation: bg-shift 15s ease-in-out infinite;
    opacity: 0;
    transition: opacity 0.7s ease, background 0.8s ease;
    pointer-events: none;
    overflow: hidden;
}

.idle-screensaver.visible {
    opacity: 1;
    pointer-events: auto;
}

.idle-screensaver.fading {
    opacity: 0;
    pointer-events: none;
}

.idle-screensaver.bg-morning {
    background: linear-gradient(-45deg, #ff9a9e, #fad0c4, #ffd1ff, #a1c4fd);
    background-size: 400% 400%;
}

.idle-screensaver.bg-afternoon {
    background: linear-gradient(-45deg, #a1c4fd, #c2e9fb, #84fab0, #8fd3f4);
    background-size: 400% 400%;
}

.idle-screensaver.bg-evening {
    background: linear-gradient(-45deg, #30cfd0, #330867, #5f2c82, #49a09d);
    background-size: 400% 400%;
}

.idle-screensaver.bg-night {
    background: linear-gradient(-45deg, #09203f, #537895, #1e3c72, #2a5298);
    background-size: 400% 400%;
}

.idle-screensaver-weather {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.idle-screensaver-weather.active {
    opacity: 1;
}

/* Share Dropdown Styling */
.share-dropdown {
    position: absolute;
    top: 120%;
    left: 0;
    width: 260px;
    background: rgba(15, 23, 42, 0.95);
    /* Deep slate */
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    z-index: 100;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
    transform-origin: top left;
    animation: dropdownSlide 0.2s ease-out;
}

@keyframes dropdownSlide {
    0% {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Ensure input looks good */
#share-url-input {
    outline: none;
    font-family: 'JetBrains Mono', monospace;
}

/* Social Icon Hover Effects */
.social-icon svg {
    transition: all 0.2s ease;
}

/* --- Feedback System Styles --- */
.footer-right {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-right: 20px;
}

/* Assuming there is a .footer-left for contact details, adding it here if not present or ensuring it has spacing */
.footer-left {
    margin-left: 20px;
    /* Pull towards right */
}

.feedback-trigger-inline {
    background: var(--accent-primary);
    color: white;
    padding: 6px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2), 0 8px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(0);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.feedback-trigger-inline:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.2), 0 12px 20px rgba(0, 0, 0, 0.15);
}

.feedback-trigger-inline:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2), 0 4px 10px rgba(0, 0, 0, 0.1);
}

.feedback-trigger-inline .feedback-icon {
    font-size: 16px;
}

.feedback-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: none;
    padding: 16px;
}

.feedback-modal.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.feedback-modal.closing {
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.feedback-glass-card {
    background: rgba(30, 41, 59, 0.7);
    /* Deep Slate */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--accent-primary);
    border-radius: 20px;
    width: 100%;
    max-width: 450px;
    padding: 2.5rem;
    position: relative;
    margin: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: jelly-open 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transition: transform 0.25s ease, opacity 0.25s ease;
    touch-action: pan-y;
    overscroll-behavior: contain;
}

@media (max-height: 600px) {
    .feedback-glass-card {
        padding: 1.25rem 1.5rem;
        border-radius: 14px;
    }

    .feedback-field {
        margin-bottom: 0.75rem;
    }

    .feedback-field textarea {
        height: 70px;
    }

    .feedback-title {
        font-size: 1.2rem;
        margin-bottom: 0.25rem;
    }

    .feedback-subtitle {
        margin-bottom: 1rem;
    }
}

.feedback-modal.closing .feedback-glass-card {
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.feedback-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.feedback-close-btn:hover {
    color: var(--text-primary);
}

.feedback-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.feedback-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

#feedback-form-container.submitting {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.feedback-field {
    margin-bottom: 1.25rem;
}

.feedback-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.feedback-field input,
.feedback-field select,
.feedback-field textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    outline: none;
}

.feedback-field input:focus,
.feedback-field select:focus,
.feedback-field textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
    background: rgba(0, 0, 0, 0.3);
}

.feedback-field input::placeholder,
.feedback-field textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.feedback-field input:focus::placeholder,
.feedback-field textarea:focus::placeholder {
    opacity: 0.4;
}

.feedback-field textarea {
    height: 100px;
    resize: none;
}

.feedback-field .required {
    color: #ef4444;
}

.feedback-submit-btn {
    width: 100%;
    margin-top: 1rem;
    padding: 12px !important;
    background: var(--accent-primary) !important;
}

.feedback-error-msg {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.85rem;
    margin-top: 0.75rem;
    line-height: 1.5;
}

/* Success State Styles */
#feedback-success {
    text-align: center;
    padding: 1.5rem 0;
}

.celebration-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feedback-success-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--accent-primary);
}

.success-message-text {
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.6;
    opacity: 0.9;
}

.feedback-success-close-btn {
    margin-top: 1.5rem;
    padding: 8px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-main);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feedback-success-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Celebration Animations */
.icon-floating {
    animation: icon-float 3s ease-in-out infinite;
}

.icon-pulsing {
    animation: icon-pulse 2s ease-in-out infinite;
}

.icon-twinkling {
    animation: icon-twinkle 1.5s ease-in-out infinite;
    display: inline-block;
}

@keyframes icon-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes icon-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

@keyframes icon-twinkle {

    0%,
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }

    50% {
        opacity: 0.6;
        transform: scale(0.8) rotate(15deg);
    }
}

/* Theme Adaptations */
:root[data-theme="light"] .feedback-glass-card {
    background: rgba(255, 255, 255, 0.8);
    border-color: var(--accent-primary);
}

:root[data-theme="eye-saver"] .feedback-glass-card {
    background: rgba(254, 252, 232, 0.8);
}

/* Info Links & Modals */
.footer-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-link {
    font-size: 13px;
    color: var(--text-secondary);
    opacity: 0.7;
    transition: all 0.2s ease;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.info-link:hover,
.footer-nav-link:hover {
    color: var(--accent-primary);
    opacity: 1;
    transform: translateY(-1px);
}

.footer-nav-link {
    font-size: 13px;
    color: var(--text-secondary);
    opacity: 0.7;
    transition: all 0.2s ease;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
}

.footer-links .separator {
    color: var(--border-main);
    font-size: 10px;
}

.info-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    touch-action: none;
    padding: 20px;
}

.info-modal.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.info-glass-card {
    background: rgba(15, 23, 42, 0.85);
    /* Deep Slate Transparent */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-main);
    border-radius: 24px;
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    padding: 3rem;
    position: relative;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.6);
    animation: jelly-open 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    touch-action: pan-y;
    overscroll-behavior: contain;
}

.info-close-btn {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 28px;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.info-close-btn:hover {
    color: var(--text-primary);
    transform: rotate(90deg);
}

.info-content-scroll {
    overflow-y: auto;
    padding-right: 15px;
}

/* Improvised Section Styling */
.section-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
    background: linear-gradient(to right, var(--accent-primary), #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: left;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.section-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.code-pill {
    background: rgba(var(--accent-primary-rgb), 0.15);
    color: var(--accent-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
}

.section-list {
    margin-bottom: 1.5rem;
    list-style: none;
    padding: 0;
}

.section-list-item {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.section-list-item::before {
    content: '\2192';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
    font-weight: bold;
}

.highlight-box {
    background: rgba(var(--accent-primary-rgb, 56, 189, 248), 0.1);
    border-left: 4px solid var(--accent-primary);
    padding: 1rem;
    border-radius: 0 12px 12px 0;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-primary);
}

.trust-badge-large {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-tertiary);
    padding: 12px 20px;
    border-radius: 50px;
    border: 1px solid var(--border-main);
    margin-top: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Theme Adaptations */
:root[data-theme="light"] .info-glass-card {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.1);
}

:root[data-theme="light"] .info-glass-card .section-subtitle,
:root[data-theme="light"] .info-glass-card .section-text,
:root[data-theme="light"] .info-glass-card .section-list-item,
:root[data-theme="light"] .info-glass-card .highlight-box,
:root[data-theme="light"] .info-glass-card .trust-badge-large {
    color: #1e293b;
    /* Explicit dark slate for contrast */
}

:root[data-theme="light"] .info-glass-card .trust-badge-large {
    background: #f1f5f9;
}

:root[data-theme="eye-saver"] .info-glass-card {
    background: rgba(254, 252, 232, 0.95);
    border-color: rgba(133, 77, 14, 0.2);
}

:root[data-theme="eye-saver"] .info-glass-card .section-subtitle,
:root[data-theme="eye-saver"] .info-glass-card .section-text,
:root[data-theme="eye-saver"] .info-glass-card .section-list-item,
:root[data-theme="eye-saver"] .info-glass-card .highlight-box,
:root[data-theme="eye-saver"] .info-glass-card .trust-badge-large {
    color: #43392b;
    /* Explicit warm dark for contrast */
}

:root[data-theme="eye-saver"] .info-glass-card .trust-badge-large {
    background: #fef3c7;
}

/* Ensure accent colors remain visible but adjusted for light backgrounds if needed */
:root[data-theme="light"] .header-vibe,
:root[data-theme="eye-saver"] .header-vibe {
    background: rgba(var(--accent-primary-rgb, 37, 99, 235), 0.1);
    color: var(--accent-primary);
    border: 1px solid rgba(var(--accent-primary-rgb, 37, 99, 235), 0.2);
}

/* --- Recipe Library --- */
.recipes-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.75rem;
    width: 320px;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.75rem;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transform-origin: top left;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.recipes-dropdown.hidden {
    display: none;
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
}

.recipe-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.recipe-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.recipe-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.recipe-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.recipe-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Badge System */
.badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    display: inline-block;
}

.badge-beginner {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-data {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-logic {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

/* Theme adaptations for Recipes */
[data-theme="light"] .recipes-dropdown {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .recipe-item:hover {
    background: rgba(0, 0, 100, 0.03);
}

[data-theme="eye-saver"] .recipes-dropdown {
    background: rgba(255, 248, 230, 0.9);
    border: 1px solid rgba(139, 69, 19, 0.1);
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.learn-more-link {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    margin-top: 6px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
    opacity: 0.8;
}

.learn-more-link:hover {
    opacity: 1;
    text-decoration: underline;
    transform: translateX(2px);
}

/* Tutorial Content Polish inside Info Modal */
.info-content-scroll .section-title {
    margin-top: 0.5rem;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.info-content-scroll .section-subtitle {
    color: var(--accent-primary);
    margin-top: 1.25rem;
    font-size: 1.1rem;
}

.info-content-scroll .section-text {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.info-content-scroll code {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 5px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
    color: var(--accent-primary);
}

.info-content-scroll .section-list {
    margin: 1rem 0;
    padding-left: 1.25rem;
}

.info-content-scroll .section-list-item {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    position: relative;
    list-style: disc;
}

/* === CONSOLIDATED RESPONSIVE SYSTEM === */



/* Large Screens */
@media (max-width: 1600px) {
    .grid-container {
        grid-template-columns: 178px 1fr 1fr 178px;
    }

    .grid-container.vertical-layout {
        grid-template-columns: 178px 7fr 3fr 178px;
    }
}

/* Large Tablets / Laptops */
@media (max-width: 1280px) {
    .grid-container {
        grid-template-areas:
            "header header header header"
            "icon-sidebar editor console right-ad"
            "how-to-use how-to-use how-to-use how-to-use"
            "status-bar status-bar status-bar status-bar";
        grid-template-columns: 60px 1fr 350px 250px;
    }

    .grid-left-ad {
        display: none;
    }
}


/* Medium Tablets */
@media (max-width: 1024px) {
    .grid-container {
        grid-template-areas:
            "header header header"
            "icon-sidebar editor console"
            "how-to-use how-to-use how-to-use"
            "status-bar status-bar status-bar";
        grid-template-columns: 60px 1fr 300px;
    }

    .grid-left-ad,
    .grid-right-ad {
        display: none;
    }

    .how-to-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Hide Sidebar elements */
@media (max-width: 1000px) {

    .header-subtitle,
    .header-tagline,
    .trust-badge {
        display: none !important;
    }

    .grid-left-ad,
    .grid-right-ad {
        display: none !important;
    }

    .grid-container {
        grid-template-columns: 0 7fr 3fr 0 !important;
    }
}

/* Small Tablets / High Zoom */
@media (max-width: 850px) {
    .px-4.py-3.border-b {
        flex-wrap: wrap !important;
        row-gap: 8px !important;
        height: auto !important;
    }

    .pkg-bar {
        width: 100%;
        justify-content: center;
        padding-top: 4px;
        border-top: 1px solid var(--border-main);
    }
}

/* MOBILE TRANSITION PHASE */
@media (max-width: 768px) {

    html {
        height: auto !important;
    }

    body {
        overflow-y: auto !important;
        height: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .grid-container {
        grid-template-areas:
            "header"
            "editor"
            "console"
            "status-bar" !important;
        grid-template-columns: 100% !important;
        grid-template-rows: auto auto auto auto !important;
        height: auto !important;
        overflow-y: visible !important;
        display: block !important;
        margin-top: 0 !important;
    }

    /* Enforce Absolute for mobile (width-based) to ensure it scrolls away
       even if pointer-type detection is not active (desktop resize) */

    /* How-to drawer: flow with the page so it's visible at top and scrolls away */
    #smart-how-to-drawer {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        width: 100% !important;
        align-items: center !important;
        /* Fixed height so layout never shifts when active state changes trigger size */
        height: 20px !important;
        overflow: visible !important;
        margin: 0 0 -20px 0 !important;
        /* overlap trigger into header */
        padding: 0 !important;
        /* Must be above sticky header (z-index: 1000) so active overlay appears on top */
        z-index: 1100 !important;
    }

    /* Prevent active trigger from growing and shifting layout */
    #smart-how-to-drawer.active .how-to-trigger {
        height: 20px !important;
        margin-bottom: 0 !important;
    }

    .how-to-content {
        max-height: 70dvh !important;
        overflow-y: auto !important;
    }

    /* Always absolutely positioned in portrait — never in page flow, no layout shift ever.
       Centred via left:0/right:0/margin:auto so the original jelly-open animation works
       without any translateX — identical to desktop behaviour. */
    #smart-how-to-drawer .how-to-content {
        position: absolute !important;
        top: 22px !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 auto !important;
        width: 92vw !important;
        max-width: 380px !important;
        z-index: 200 !important;
        transform-origin: top center !important;
    }

    /* Portrait header: hide only trust-badge; tagline + status badge are shown */
    .grid-header .trust-badge {
        display: none !important;
    }

    /* Outer header div: switch to column layout */
    .grid-header>div {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 10px 14px 8px !important;
        gap: 0 !important;
    }

    /* Left group (logo + title + badges): row, title left / badge right */
    .grid-header>div>div:first-child {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
    }

    /* Override Tailwind space-x-4 margin-left */
    .grid-header>div>div:first-child>*+* {
        margin-left: 0 !important;
    }

    /* Hide the logo icon box */
    .grid-header>div>div:first-child>div:first-child {
        display: none !important;
    }

    /* Keep title on one line */
    .grid-header h1 {
        white-space: nowrap !important;
    }

    /* Show tagline — smaller so it fits on one line */
    .grid-header .tagline {
        display: block !important;
        margin-top: 2px !important;
        font-size: 0.78rem !important;
    }

    /* Status badge: inline next to title, no top margin */
    .grid-header>div>div:first-child>div:last-child {
        width: auto !important;
        justify-content: flex-end !important;
        margin-top: 0 !important;
    }

    #status-badge {
        display: inline-flex !important;
    }

    /* Hide layout toggle — not useful on portrait mobile */
    .grid-header #toggle-console-position {
        display: none !important;
    }

    /* Actions group: 2-column grid so buttons are always side by side */
    .grid-header .header-actions-group {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        width: 100% !important;
        gap: 8px !important;
        margin-top: 10px !important;
        padding-bottom: 4px !important;
    }

    /* Tutorial Lab + Academy: fill their grid cell, centred */
    .grid-header .btn-tutorial-lab,
    .grid-header .btn-academy {
        width: 100% !important;
        justify-content: center !important;
        font-size: 13px !important;
        padding: 8px 12px !important;
        margin-left: 0 !important;
    }

    /* Theme toggles: span both columns, centred */
    .grid-header .header-theme-toggles {
        grid-column: 1 / -1 !important;
        display: flex !important;
        justify-content: center !important;
        gap: 8px !important;
    }

    .grid-header {
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .grid-editor {
        padding: 5px 0;
        height: 500px;
        flex-shrink: 0;
        overflow: hidden;
    }

    .grid-editor .glass-panel {
        height: 100%;
    }

    .grid-console {
        padding: 5px 0;
        height: 350px;
        flex-shrink: 0;
        overflow: hidden;
    }

    .grid-console .glass-panel {
        height: 100%;
    }

    .output-console {
        -webkit-overflow-scrolling: touch;
    }

    .grid-status-bar {
        flex-shrink: 0;
    }

    .grid-resizer,
    .grid-left-ad,
    .grid-right-ad,
    .grid-icon-sidebar {
        display: none !important;
    }

    .grid-editor .glass-panel,
    .grid-console .glass-panel {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    /* Vertical layout override on mobile */
    .grid-container.vertical-layout {
        display: block;
        height: auto;
    }
}

/* ULTRA-MOBILE */
@media (max-width: 600px) {

    .grid-header,
    .grid-status-bar {
        display: block !important;
    }

    .grid-header .flex {
        padding: 8px 12px !important;
        flex-direction: column !important;
    }

    .grid-status-bar {
        flex-direction: column !important;
        height: auto !important;
        padding: 10px !important;
        gap: 10px;
    }

    .footer-left,
    .footer-center,
    .footer-right {
        width: 100%;
        justify-content: center !important;
        text-align: center;
    }

    .glass-panel {
        border-top: none !important;
        border-radius: 0 !important;
    }

    .px-4.py-3.border-b {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .header-actions-group {
        justify-content: center;
        margin-top: 5px;
    }

    .pkg-dropdown {
        max-width: 120px;
    }
}

/* DYNAMIC SPACE DETECTION SYSTEM */
/* When the editor panel gets "clumsy" (narrow), switch to icons */
@container editor-panel (max-width: 1050px) {

    .btn-3d .btn-text,
    .btn-install .btn-text {
        display: none !important;
    }

    .btn-3d,
    .btn-install {
        padding: 8px !important;
        width: 38px !important;
        min-width: 38px !important;
        justify-content: center !important;
        gap: 0 !important;
    }

    .btn-3d svg,
    .btn-install svg {
        margin: 0 !important;
        width: 20px !important;
        height: 20px !important;
    }
}

/* Stage 2: Very Cramped (Shrink Breadcrumb and Packages) */
@container editor-panel (max-width: 650px) {
    .pkg-bar {
        gap: 4px !important;
    }

    .pkg-dropdown {
        max-width: 100px !important;
    }

    .breadcrumb-name {
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Toolbar Safety: Ensure wrapping doesn't overlap content */
.editor-header-container {
    flex-wrap: wrap !important;
    height: auto !important;
    min-height: 64px !important;
    gap: 8px 16px !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    overflow: visible !important;
    flex-shrink: 0;
}

/* Landscape console nav — hidden by default, shown only in landscape */
.landscape-console-nav {
    display: none;
}

/* Landscape tab nav — hidden by default, shown only in landscape */
.landscape-tab-nav {
    display: none;
}

/* Landscape theme toggles — hidden by default, shown only in landscape */
.landscape-theme-toggles {
    display: none;
}

#editor-container {
    position: relative;
    min-height: 200px;
    flex-grow: 1;
    overflow: hidden;
}



/* Package Install Button */
.btn-install {
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    cursor: pointer;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}

.btn-install:hover {
    background: var(--accent-primary);
    color: #fff;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.btn-install svg {
    width: 16px;
    height: 16px;
}



/* Academy Button Styling */
.btn-academy {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa) !important;
    border-color: #8b5cf6 !important;
}

.btn-academy:hover {
    background: linear-gradient(135deg, #7c3aed, #8b5cf6) !important;
    border-color: #7c3aed !important;
    box-shadow: 0 8px 16px rgba(139, 92, 246, 0.3) !important;
}

/* Modal Scroll Lock Utility — works on iOS Safari + all browsers */
html.modal-lock,
body.modal-lock {
    overflow: hidden !important;
}

body.modal-lock {
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

.overscroll-contain {
    overscroll-behavior: contain !important;
}

/* Suppress background elements that could overlap modals */
body.modal-lock .lab-header,
body.modal-lock .lab-nav,
body.modal-lock .academy-header,
body.modal-lock .header-top,
body.modal-lock .hero-section,
body.modal-lock .search-container,
body.modal-lock .paths-container {
    z-index: 1 !important;
    pointer-events: none !important;
    opacity: 0.4;
    /* Visual cue that they are disabled */
}

/* Mobile Copy Mode — native textarea overlay for select & copy */
.copy-mode {
    position: absolute;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    background: var(--bg-editor);
}

.copy-mode-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.copy-mode-done {
    background: var(--accent-primary);
    color: #fff;
    border: none;
    padding: 5px 16px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
}

.copy-mode-textarea {
    flex: 1;
    width: 100%;
    border: none;
    resize: none;
    outline: none;
    font-family: 'Menlo', 'Consolas', 'Courier New', monospace;
    font-size: 14px;
    line-height: 19px;
    padding: 10px;
    background: var(--bg-editor);
    color: var(--text-primary);
    -webkit-overflow-scrolling: touch;
    white-space: pre;
    overflow-x: auto;
}

/* CodeMirror autocomplete tooltip — theme-aware styling */
:root[data-theme="light"] .cm-tooltip-autocomplete {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-radius: 8px;
}

:root[data-theme="light"] .cm-tooltip-autocomplete ul li[aria-selected] {
    background: #2563eb;
    color: #ffffff;
}

:root[data-theme="eye-saver"] .cm-tooltip-autocomplete {
    background: #eee8d5;
    border: 1px solid #d4d0c0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

:root[data-theme="eye-saver"] .cm-tooltip-autocomplete ul li[aria-selected] {
    background: #d97706;
    color: #ffffff;
}

:root[data-theme="dark"] .cm-tooltip-autocomplete {
    background: #1e293b;
    border: 1px solid rgba(248, 250, 252, 0.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

:root[data-theme="dark"] .cm-tooltip-autocomplete ul li[aria-selected] {
    background: #38bdf8;
    color: #0f172a;
}

/* Mobile/tablet: ensure native text selection works on iOS Safari.
   -webkit-user-select: text  → enables selection handles + loupe
   -webkit-touch-callout: default → enables the Copy/Paste callout menu */
@media screen and (max-width: 1024px) {
    body {
        -webkit-user-select: text;
        user-select: text;
    }

    #output-console {
        -webkit-overflow-scrolling: touch;
        -webkit-user-select: text;
        user-select: text;
        -webkit-touch-callout: default;
    }

    #editor-container .cm-editor,
    #editor-container .cm-content {
        -webkit-user-select: text;
        user-select: text;
        -webkit-touch-callout: default;
    }

    .grid-editor,
    .grid-console {
        contain: none;
    }
}

/* Second mobile block removed — merged into first @media (max-width: 768px) above */

/* ============================================================
   MOBILE LANDSCAPE LAYOUT
   Switches to side-by-side editor/console so both panes are
   visible without scrolling on short landscape viewports.
   ============================================================ */
@media screen and (orientation: landscape) and (max-height: 500px) {

    /* Hide header in landscape to maximise coding area */
    .grid-header {
        display: none !important;
    }

    .grid-left-ad,
    .grid-right-ad,
    .grid-resizer {
        display: none !important;
    }

    /* Side-by-side layout: editor left, console right, footer below — scrollable */
    .grid-container {
        display: grid !important;
        grid-template-areas:
            "editor console"
            "status-bar status-bar" !important;
        grid-template-columns: 60% 40% !important;
        grid-template-rows: 100vh auto !important;
        grid-template-rows: 100dvh auto !important;
        overflow: auto !important;
        width: 100% !important;
        height: auto !important;
    }

    /* Footer: sits below the fold, visible on scroll */
    .grid-status-bar {
        grid-area: status-bar !important;
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        padding: 10px 12px !important;
        gap: 6px;
        text-align: center;
    }

    .grid-status-bar .footer-left,
    .grid-status-bar .footer-center,
    .grid-status-bar .footer-right {
        width: 100%;
        justify-content: center !important;
        text-align: center;
    }

    .grid-editor {
        grid-area: editor !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .grid-console {
        grid-area: console !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    /* Console output: enable touch scroll in landscape */
    #output-console {
        -webkit-overflow-scrolling: touch;
    }

    /* Hide tab-row nav — console nav is used instead */
    .landscape-tab-nav {
        display: none !important;
    }

    /* Show Tutorial Lab + Academy + theme toggles at the top of the output console */
    .landscape-console-nav {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 5px 8px;
        border-bottom: 1px solid var(--border-main);
        flex-shrink: 0;
    }

    .btn-landscape-nav {
        font-size: 11px !important;
        padding: 5px 10px !important;
        flex: 1 !important;
        justify-content: center !important;
    }

    .btn-landscape-nav svg {
        width: 13px !important;
        height: 13px !important;
    }

    /* Theme toggles in landscape nav: compact size */
    .landscape-theme-toggles {
        display: flex !important;
        gap: 4px !important;
    }

    .landscape-theme-toggles .theme-toggle-btn {
        width: 28px !important;
        height: 28px !important;
    }

    /* Compact the editor toolbar: 2 clean rows using Grid
       Row 1: breadcrumb + icon buttons (full width)
       Row 2: pkg-bar (left) | upload + download + run (right) — guaranteed same line */
    .editor-header-container {
        display: grid !important;
        grid-template-columns: 1fr auto !important;
        grid-template-rows: auto auto !important;
        grid-template-areas:
            "leftgroup leftgroup"
            "pkgbar    rightbtns" !important;
        min-height: auto !important;
        padding: 4px 8px !important;
        gap: 3px 6px !important;
        align-items: center !important;
    }

    .editor-header-container>div:first-child {
        grid-area: leftgroup !important;
    }

    .editor-header-container .pkg-bar {
        grid-area: pkgbar !important;
    }

    /* Upload + Download + Run on the right of row 2 */
    .editor-header-container>div:last-child {
        grid-area: rightbtns !important;
        display: flex !important;
        align-items: center !important;
        gap: 5px !important;
        justify-content: flex-end !important;
    }

    /* Override Tailwind space-x-4 margins */
    .editor-header-container>div:last-child>*+* {
        margin-left: 0 !important;
    }

    /* Remove min-height from both pane headers */
    .grid-editor .glass-panel>div:first-child,
    .grid-console .glass-panel>div:nth-child(2) {
        min-height: auto !important;
        padding-top: 5px !important;
        padding-bottom: 5px !important;
    }

    /* Icons only — hide button text labels to save space */
    .btn-run .btn-text,
    .btn-upload .btn-text,
    .btn-download .btn-text,
    .btn-install .btn-text {
        display: none !important;
    }

    /* Compact action button padding */
    .btn-run,
    .btn-upload,
    .btn-download {
        padding: 6px 8px !important;
    }

    .btn-install {
        padding: 5px 8px !important;
    }

    /* Compact package select */
    .pkg-dropdown {
        max-width: 82px !important;
        font-size: 11px !important;
    }

    .pkg-bar {
        gap: 4px !important;
    }

    /* Compact icon-only snapshot buttons */
    .snapshot-btn {
        padding: 4px !important;
    }

    /* How-to drawer: flow with page so it sits above the editor/console
       and scrolls away naturally — never overlaps the coding area */
    #smart-how-to-drawer {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        width: 100% !important;
        height: 20px !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        z-index: 1100 !important;
    }

    #smart-how-to-drawer.active .how-to-trigger {
        height: 20px !important;
        margin-bottom: 0 !important;
    }

    #smart-how-to-drawer .how-to-content {
        position: absolute !important;
        top: 22px !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 auto !important;
        width: 92vw !important;
        max-width: 380px !important;
        max-height: 55dvh !important;
        overflow-y: auto !important;
        z-index: 200 !important;
        transform-origin: top center !important;
    }
}

/* ── Unified Site Footer (academy, tutorial-lab, privacy, terms) ── */
.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 10px 12px;
    min-height: 48px;
    border-top: 1px solid var(--border-main);
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 0.8rem;
    gap: 8px 12px;
}

@media (max-width: 600px) {
    .site-footer {
        flex-direction: column;
        text-align: center;
        gap: 6px;
        padding: 12px;
    }

    .site-footer .footer-left,
    .site-footer .footer-center,
    .site-footer .footer-right {
        width: 100%;
        justify-content: center !important;
        text-align: center;
    }
}

.site-footer-copy {
    opacity: 0.7;
}

.site-footer-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-footer-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.site-footer-link:hover {
    color: var(--accent-primary);
}

.site-footer-sep {
    opacity: 0.4;
}

/* ── Header Theme Toggles (privacy, terms nav) ── */
.header-theme-toggles {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Scoped to header-theme-toggles so it doesn't override academy/tutorial-lab page-specific .theme-btn */
.header-theme-toggles .theme-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border-main);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-theme-toggles .theme-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.header-theme-toggles .theme-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* ─── SEO Content Section ─────────────────────────────────────────────────── */
.seo-section {
    background: var(--bg-body);
    border-top: 1px solid var(--border-main);
    padding: 4rem 2rem 5rem;
    color: var(--text-secondary);
}

.seo-inner {
    max-width: 1060px;
    margin: 0 auto;
}

.seo-section h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    line-height: 1.4;
    text-align: center;
    letter-spacing: -0.02em;
}

.seo-section > .seo-inner > p {
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 3rem;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    color: var(--text-muted);
}

.seo-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.seo-col {
    background: rgba(var(--accent-primary-rgb), 0.04);
    border: 1px solid rgba(var(--accent-primary-rgb), 0.1);
    border-radius: 12px;
    padding: 2rem;
}

.seo-col h3 {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 1.25rem;
    padding-bottom: 0;
    border-bottom: none;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.seo-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.seo-col ul li {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.85rem;
    font-size: 0.875rem;
    line-height: 1.7;
}

.seo-col ul li:last-child {
    margin-bottom: 0;
}

.seo-col ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-primary);
    opacity: 0.7;
}

.seo-col ul li strong {
    color: var(--text-primary);
}

.seo-faq {
    margin: 0;
}

.seo-faq dt {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1.25rem;
    margin-bottom: 0.35rem;
}

.seo-faq dt:first-child {
    margin-top: 0;
}

.seo-faq dd {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.7;
    color: var(--text-muted);
}

@media (max-width: 680px) {
    .seo-cols {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .seo-section {
        padding: 2.5rem 1.25rem 3rem;
    }

    .seo-section h2 {
        font-size: 1.2rem;
    }

    .seo-col {
        padding: 1.5rem;
    }
}