body {
    margin: 0;
    overflow: hidden;
    background-color: #111;
    font-family: sans-serif;
}

:root {
    --menu-surface-bg: rgba(0, 0, 0, 0.28);
    --menu-surface-border: 1px solid rgba(76, 175, 80, 0.4);
    --menu-surface-radius: 2px;
    --menu-surface-shadow: none;
    /* Terminal menu: szuflada opisu pod banerem / sekcją (hover + focus-within) */
    --term-menu-hover-drawer-dur: 0.42s;
    --term-menu-hover-drawer-ease: ease-in-out;
    /* Fallback gdy JS jeszcze nie ustawił --term-menu-drawer-peak-h (pomiar scrollHeight wewnętrznej szuflady) */
    --term-menu-hover-drawer-max-h: min(78vh, 36rem);
    --menu-label-color: rgba(200, 255, 200, 0.82);
    --menu-text-color: rgba(210, 255, 210, 0.9);
    /* VAJBUJ / MYSEN: hide non-console UI */
    --music-ui-reveal-dur: 0.48s;
    --music-ui-reveal-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --music-ui-collapse-dur: 0.52s;
    --music-ui-collapse-ease: cubic-bezier(0.32, 0, 0.18, 1);
    /** Fixed width of #right-panel (terminal + HUD column); used with stacked layout canvas shrink. */
    --right-panel-terminal-width: 280px;
}

#canvas-container {
    width: 100vw;
    height: 100vh;
    background-color: #000;
}

#canvas-container > canvas {
    display: block;
    background-color: #000;
}

/** Stacked TOP/KEK (`?topkekLayout=stack`): narrower WebGL viewport — minus half of right terminal column width. */
body.stacked-topkek-layout:not(.mobile-landing-only):not(.showcase-live-preview-embed) #canvas-container {
    width: calc(100vw - (var(--right-panel-terminal-width) * 0.5));
    max-width: calc(100vw - (var(--right-panel-terminal-width) * 0.5));
}

/**
 * Stacked: gutter by the fixed right panel used to show `body` (#111 / #e8eaed) vs canvas port (#000 / #fff).
 * Match page root to the canvas port so the strip is not visible.
 */
body.stacked-topkek-layout:not(.mobile-landing-only):not(.showcase-live-preview-embed) {
    background-color: #000;
}

html:has(body.stacked-topkek-layout:not(.mobile-landing-only):not(.showcase-live-preview-embed)) {
    background-color: #000;
}

body.stacked-topkek-layout:not(.mobile-landing-only):not(.showcase-live-preview-embed).visual-mode-white {
    background-color: #fff;
}

html:has(body.stacked-topkek-layout:not(.mobile-landing-only):not(.showcase-live-preview-embed).visual-mode-white) {
    background-color: #fff;
}

.startup-selector {
    --startup-bg: #e8eaed;
    --startup-fg: rgba(26, 54, 38, 0.92);
    --startup-muted: rgba(14, 15, 16, 0.42);
    --startup-track: rgba(14, 15, 16, 0.12);
    --startup-thumb: #0e0f10;
    --startup-thumb-fg: #f3f3f1;
    position: fixed;
    inset: 0;
    z-index: 3200;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding-top: 82px;
    background: var(--startup-bg);
    color: var(--startup-fg);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    transition: background-color 320ms ease, color 320ms ease;
}

.startup-selector.startup-selector--dark {
    --startup-bg: #111;
    --startup-fg: #ffffff;
    --startup-muted: rgba(240, 242, 239, 0.42);
    --startup-track: rgba(240, 242, 239, 0.14);
    --startup-thumb: #f0f2ef;
    --startup-thumb-fg: #07080a;
}

.startup-selector[hidden] {
    display: none !important;
}

.startup-selector-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.startup-wordmark {
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--startup-fg);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    font-size: 2rem;
    letter-spacing: 10px;
    margin-bottom: 10px;
    white-space: nowrap;
    opacity: 0.15;
    user-select: none;
}

.startup-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.startup-toggle {
    position: relative;
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    background: var(--startup-track);
    border-radius: 999px;
    padding: 5px;
    isolation: isolate;
    opacity: 0;
    transform: translateY(6px);
    transition: background-color 320ms ease;
}

.startup-selector.startup-selector--visible .startup-toggle {
    animation: startup-fade-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.55s forwards;
}

.startup-toggle-thumb {
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 5px;
    width: calc(50% - 5px);
    background: var(--startup-thumb);
    border-radius: 999px;
    transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1), background-color 320ms ease;
    z-index: 0;
}

.startup-selector--dark .startup-toggle-thumb {
    transform: translateX(100%);
}

.startup-toggle-opt {
    position: relative;
    z-index: 1;
    appearance: none;
    background: transparent;
    border: 0;
    color: var(--startup-fg);
    padding: 12px 38px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.32em;
    cursor: pointer;
    transition: color 220ms ease;
    min-width: 5.5em;
}

.startup-toggle-opt[aria-pressed="true"] {
    color: var(--startup-thumb-fg);
}

.startup-toggle-opt:focus-visible {
    outline: 2px solid var(--startup-fg);
    outline-offset: 4px;
    border-radius: 999px;
}

.startup-enter {
    appearance: none;
    background: transparent;
    border: 1px solid var(--startup-fg);
    color: var(--startup-fg);
    padding: 14px 56px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.42em;
    cursor: pointer;
    border-radius: 2px;
    opacity: 0;
    transform: translateY(6px);
    transition: background-color 200ms ease, color 200ms ease, border-color 320ms ease;
}

.startup-selector.startup-selector--visible .startup-enter {
    animation: startup-fade-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.7s forwards;
}

.startup-enter:hover,
.startup-enter:focus-visible {
    background: var(--startup-fg);
    color: var(--startup-bg);
    outline: none;
}

@keyframes startup-fade-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .startup-selector.startup-selector--visible .startup-toggle,
    .startup-selector.startup-selector--visible .startup-enter {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

body.visual-mode-white #loader-container {
    background-color: #e8eaed;
}

body.visual-mode-white #loader-title,
body.visual-mode-white #loading-text {
    color: rgba(26, 54, 38, 0.92);
}

body.visual-mode-white #progress-percentage {
    color: rgba(46, 125, 50, 0.72);
}

.mobile-landing {
    display: none;
}

body.mobile-landing-only {
    overflow: auto;
    background:
        radial-gradient(circle at 15% 10%, rgba(76, 175, 80, 0.16), transparent 48%),
        radial-gradient(circle at 85% 90%, rgba(224, 64, 251, 0.12), transparent 46%),
        #070a07;
    color: #d4ffd8;
    font-family: 'Courier New', monospace;
}

body.mobile-landing-only > *:not(#mobile-landing) {
    display: none !important;
}

body.mobile-landing-only .mobile-landing {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 14px;
    padding: 28px 22px;
    box-sizing: border-box;
}

body.mobile-landing-only .mobile-landing-kicker {
    margin: 0;
    font-size: 12px;
    letter-spacing: 0.18em;
    color: rgba(200, 255, 200, 0.7);
    text-transform: uppercase;
}

body.mobile-landing-only .mobile-landing-title {
    margin: 0;
    font-size: clamp(1.55rem, 7vw, 2rem);
    line-height: 1.2;
    color: #e7ffe9;
    max-width: 18ch;
}

body.mobile-landing-only .mobile-landing-copy {
    margin: 0;
    max-width: 34ch;
    line-height: 1.55;
    font-size: 0.94rem;
    color: rgba(215, 255, 220, 0.85);
}

body.mobile-landing-only .mobile-landing-agents-btn {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid rgba(129, 199, 132, 0.66);
    background: rgba(76, 175, 80, 0.12);
    color: #c8ffd0;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.11em;
    font-size: 0.78rem;
}

body.mobile-landing-only .mobile-landing-agents-btn:focus-visible,
body.mobile-landing-only .mobile-landing-agents-btn:hover {
    border-color: rgba(165, 214, 167, 0.95);
    background: rgba(76, 175, 80, 0.23);
    color: #f0fff2;
    outline: none;
}

body.mobile-landing-only .mobile-landing-hint {
    margin: 6px 0 0;
    padding-left: 10px;
    border-left: 2px solid rgba(129, 199, 132, 0.45);
    font-size: 0.8rem;
    line-height: 1.5;
    color: rgba(200, 255, 200, 0.6);
    max-width: 34ch;
}

body.mobile-landing-only .mobile-landing-buttons {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

body.mobile-landing-only .mobile-landing-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid rgba(129, 199, 132, 0.66);
    background: rgba(76, 175, 80, 0.12);
    color: #c8ffd0;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.11em;
    font-size: 0.78rem;
}

body.mobile-landing-only .mobile-landing-btn:focus-visible,
body.mobile-landing-only .mobile-landing-btn:hover {
    border-color: rgba(165, 214, 167, 0.95);
    background: rgba(76, 175, 80, 0.23);
    color: #f0fff2;
    outline: none;
}

/* --- Mobile app: video hero + desktop-style terminal banners --- */
body.mobile-app-layout {
    overflow: hidden;
    background-color: #111;
}

body.mobile-app-layout #mobile-landing,
body.mobile-app-layout #canvas-container,
body.mobile-app-layout #camera-hud,
body.mobile-app-layout #topkek-terminal-shell,
body.mobile-app-layout #loader-container,
body.mobile-app-layout .prod-label,
body.mobile-app-layout .topkek-fx-dev-shell {
    display: none !important;
}

body.mobile-app-layout .mobile-app-shell {
    display: block;
    height: 100dvh;
    height: 100vh;
}

.mobile-app-shell {
    display: none;
    box-sizing: border-box;
}

.mobile-visual-mode-bar {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    z-index: 2;
    box-sizing: border-box;
    height: auto;
    padding: calc(10px + env(safe-area-inset-top, 0px)) var(--mobile-page-margin, 16px) 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #000;
    border-bottom: 0;
}

.mobile-desktop-hint {
    margin: 0;
    width: min(100%, 420px);
    max-width: 100%;
    font-family: 'Courier New', Courier, monospace;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.04em;
    line-height: 1.35;
    text-align: center;
    color: rgba(129, 199, 132, 0.72);
    pointer-events: none;
}

.mobile-visual-mode-row {
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.mobile-visual-mode-sep {
    font-family: 'Courier New', Courier, monospace;
    font-size: 10px;
    letter-spacing: 0.08em;
    color: rgba(129, 199, 132, 0.28);
    user-select: none;
    pointer-events: none;
    padding: 0 1px;
}

.mobile-visual-mode-opt {
    appearance: none;
    margin: 0;
    padding: 2px 6px;
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(129, 199, 132, 0.38);
    font-family: 'Courier New', Courier, monospace;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
    text-shadow: none;
    cursor: pointer;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.mobile-visual-mode-opt:hover {
    color: rgba(129, 199, 132, 0.72);
    text-decoration: none;
    background: transparent;
    box-shadow: none;
}

.mobile-visual-mode-opt:focus-visible {
    outline: 1px solid rgba(76, 175, 80, 0.55);
    outline-offset: 2px;
    color: rgba(168, 224, 172, 0.9);
}

.mobile-visual-mode-opt[aria-pressed="true"],
.mobile-visual-mode-opt.visual-white-mode-active {
    color: rgba(168, 224, 172, 0.82);
}

/* Drop former high-contrast Zen fill on mobile */
#mobile-term-visual-light-mode.visual-mode-zen-btn {
    color: rgba(129, 199, 132, 0.38);
    background-color: transparent;
    border-color: transparent;
}

#mobile-term-visual-light-mode.visual-mode-zen-btn:hover,
#mobile-term-visual-light-mode.visual-mode-zen-btn:focus-visible {
    color: rgba(129, 199, 132, 0.72);
    background-color: transparent;
    border-color: transparent;
    box-shadow: none;
    text-shadow: none;
    text-decoration: none;
}

#mobile-term-visual-light-mode.visual-mode-zen-btn[aria-pressed="true"],
#mobile-term-visual-light-mode.visual-mode-zen-btn.visual-white-mode-active {
    color: rgba(168, 224, 172, 0.82);
}

.inside-construction-label {
    margin: 6px 0 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--menu-label-color, rgba(129, 199, 132, 0.78));
    text-align: center;
    pointer-events: none;
    line-height: 1.2;
}

#camera-hud .inside-construction-label {
    margin-top: 6px;
}

#right-panel #terminal-menu .inside-construction-label,
#mobile-menu-section #terminal-menu .inside-construction-label {
    margin: 0 0 12px;
    text-align: left;
}

.inside-construction-label--mobile {
    margin: 0;
    width: min(100%, 320px);
    font-size: 9px;
    letter-spacing: 0.12em;
    color: rgba(129, 199, 132, 0.42);
    font-weight: 500;
}

body.visual-mode-white .inside-construction-label {
    color: rgba(46, 125, 50, 0.88);
}

body.visual-mode-white .inside-construction-label--mobile {
    color: rgba(46, 125, 50, 0.48);
}

.mobile-scroll-root {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-top: 0;
    background-color: var(--mobile-scroll-bg, #111111);
}

.mobile-hero {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    background: #000;
}

.mobile-hero-sticky-wrap {
    width: 100%;
    max-width: none;
    margin: 0;
}

.mobile-hero-mount {
    position: relative;
    width: 100%;
    aspect-ratio: var(--mobile-hero-aspect, 16 / 9);
    max-height: min(56dvh, 480px);
    overflow: hidden;
    background: #000;
    border: 0;
    border-radius: 0;
    box-sizing: border-box;
}

/* Black → page color fade under the full-bleed video (seamless with scroll bg). */
.mobile-hero::after {
    content: '';
    display: block;
    width: 100%;
    height: clamp(48px, 14vw, 96px);
    background: linear-gradient(
        to bottom,
        #000 0%,
        color-mix(in srgb, #000 55%, var(--mobile-scroll-bg, #111111)) 42%,
        var(--mobile-scroll-bg, #111111) 100%
    );
    pointer-events: none;
}

.mobile-home-hero-wrap {
    position: absolute;
    inset: 0;
}

.mobile-home-hero-video,
.mobile-home-hero-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border: 0;
    outline: none;
    background: #000;
}

.mobile-home-hero-poster {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 1;
}

.mobile-home-hero-poster.is-visible {
    opacity: 1;
}

.mobile-home-hero-video {
    opacity: 0;
    z-index: 2;
}

.mobile-home-hero-video.is-playing {
    opacity: 1;
}

body.mobile-app-layout #mobile-menu-section {
    position: relative;
    z-index: 10;
    margin-top: 0;
    padding: 0 var(--mobile-page-margin, 16px) 48px;
    box-sizing: border-box;
    -webkit-mask-image: none;
    mask-image: none;
}

body.mobile-app-layout #right-panel {
    position: static !important;
    display: flex !important;
    flex-direction: column;
    top: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 0;
    gap: 12px;
    z-index: auto;
    box-sizing: border-box;
}

body.mobile-app-layout #right-panel #ui-container {
    display: none !important;
}

body.mobile-app-layout #right-panel #terminal-menu {
    flex: none;
    min-height: 0;
    overflow: visible;
    width: 100%;
}

/* Keep drawer copy visible on mobile (no hover-only expand) */
body.mobile-app-layout #right-panel #terminal-menu .term-menu-banner-drawer,
body.mobile-app-layout #right-panel #terminal-menu .term-menu-section-drawer {
    max-height: none !important;
    overflow: visible;
}

body.mobile-app-layout #right-panel #terminal-menu .term-menu-banner-drawer-inner,
body.mobile-app-layout #right-panel #terminal-menu .term-menu-section-drawer-inner {
    transform: none !important;
    opacity: 1 !important;
}

body.mobile-app-layout #right-panel #terminal-menu .menu-section-toggle {
    display: none;
}

body.mobile-app-layout #right-panel #terminal-menu.menu-collapsible-section > .menu-section-content {
    overflow: visible;
    max-height: none;
}

.mobile-home-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    max-width: 420px;
    margin: 16px auto 0;
    box-sizing: border-box;
}

.mobile-home-nav[hidden] {
    display: none !important;
}

.mobile-home-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 12px;
    box-sizing: border-box;
    border: 1px solid rgba(76, 175, 80, 0.55);
    background: rgba(0, 0, 0, 0.35);
    color: #81c784;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    border-radius: 0;
}

.mobile-home-nav-link:hover,
.mobile-home-nav-link:focus-visible {
    color: #c8ffd0;
    border-color: rgba(129, 199, 132, 0.95);
    background: rgba(76, 175, 80, 0.16);
    text-shadow: 0 0 6px rgba(76, 175, 80, 0.35);
    outline: 1px solid rgba(76, 175, 80, 0.85);
    outline-offset: 2px;
}

body.mobile-app-layout.visual-mode-white .mobile-home-nav-link {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(76, 175, 80, 0.42);
    color: #2e7d32;
}

body.mobile-app-layout.visual-mode-white .mobile-home-nav-link:hover,
body.mobile-app-layout.visual-mode-white .mobile-home-nav-link:focus-visible {
    background: rgba(76, 175, 80, 0.12);
    border-color: rgba(46, 125, 50, 0.7);
    color: #1b5e20;
    text-shadow: none;
}

@media (max-width: 360px) {
    .mobile-home-nav {
        grid-template-columns: 1fr;
    }
}

body.mobile-app-layout:not(.visual-mode-white) {
    --mobile-scroll-bg: #111111;
}

body.mobile-app-layout.visual-mode-white {
    background-color: #f4f4f2;
    --mobile-scroll-bg: #f4f4f2;
}

body.mobile-app-layout.visual-mode-white .mobile-visual-mode-bar {
    background: #000;
    border-bottom: 0;
}

body.mobile-app-layout.visual-mode-white .mobile-desktop-hint {
    color: rgba(129, 199, 132, 0.72);
}

body.mobile-app-layout.visual-mode-white .mobile-visual-mode-sep {
    color: rgba(129, 199, 132, 0.28);
}

body.mobile-app-layout.visual-mode-white .mobile-visual-mode-opt {
    color: rgba(129, 199, 132, 0.38);
}

body.mobile-app-layout.visual-mode-white .mobile-visual-mode-opt:hover,
body.mobile-app-layout.visual-mode-white .mobile-visual-mode-opt:focus-visible {
    color: rgba(168, 224, 172, 0.9);
}

body.mobile-app-layout.visual-mode-white .mobile-visual-mode-opt[aria-pressed="true"],
body.mobile-app-layout.visual-mode-white .mobile-visual-mode-opt.visual-white-mode-active,
body.mobile-app-layout.visual-mode-white #mobile-term-visual-light-mode.visual-mode-zen-btn[aria-pressed="true"],
body.mobile-app-layout.visual-mode-white #mobile-term-visual-light-mode.visual-mode-zen-btn.visual-white-mode-active {
    color: rgba(168, 224, 172, 0.82);
}

body.mobile-app-layout.visual-mode-white #mobile-term-visual-light-mode.visual-mode-zen-btn {
    color: rgba(129, 199, 132, 0.38);
    background-color: transparent;
}

body.mobile-app-layout.visual-mode-white #mobile-term-visual-light-mode.visual-mode-zen-btn:hover,
body.mobile-app-layout.visual-mode-white #mobile-term-visual-light-mode.visual-mode-zen-btn:focus-visible {
    color: rgba(168, 224, 172, 0.9);
    background-color: transparent;
    box-shadow: none;
}

body.mobile-app-layout.visual-mode-white .inside-construction-label--mobile {
    color: rgba(129, 199, 132, 0.42);
}

body.mobile-app-layout.visual-mode-white .mobile-scroll-root {
    background-color: var(--mobile-scroll-bg, #f4f4f2);
    background-image:
        radial-gradient(circle at 20% 0%, rgba(76, 175, 80, 0.08), transparent 42%);
}

body.mobile-app-layout.visual-mode-white .mobile-hero {
    background: #000;
}

body.mobile-app-layout.visual-mode-white .mobile-hero-mount {
    border: 0;
    background: #000;
}

body.mobile-app-layout.visual-mode-white .mobile-hero::after {
    background: linear-gradient(
        to bottom,
        #000 0%,
        color-mix(in srgb, #000 45%, var(--mobile-scroll-bg, #f4f4f2)) 48%,
        var(--mobile-scroll-bg, #f4f4f2) 100%
    );
}

/* Iframe podglądu: showcase editor lub MYSEN Studio — tylko canvas, bez paneli */
body.showcase-live-preview-embed #right-panel,
body.showcase-live-preview-embed #camera-hud,
body.showcase-live-preview-embed .prod-label,
body.showcase-live-preview-embed #topkek-terminal-shell,
body.showcase-live-preview-embed #loader-container,
body.showcase-live-preview-embed .topkek-fx-dev-shell,
body.showcase-live-preview-embed #music-showcase-spotify-widget,
body.showcase-live-preview-embed #music-showcase-youtube-modal {
    display: none !important;
}

body.showcase-live-preview-embed.post-intro-ui-pending {
    overflow: hidden;
}

#canvas-container canvas:focus-visible {
    outline: 1px dashed rgba(76, 175, 80, 0.55);
    outline-offset: -1px;
}

#loader-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #111;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease-out;
}

#loader-container.hidden {
    opacity: 0;
    pointer-events: none;
}

#loader-content {
    text-align: center;
    width: 300px;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    /* Monospace for tech vibe */
}

#loader-title {
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 2rem;
    letter-spacing: 10px;
    margin-bottom: 10px;
    white-space: nowrap;
    opacity: 0.15;
}

#loading-text {
    color: white;
    font-size: 0.7rem;
    margin-bottom: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#progress-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
    position: relative;
}

#progress-fill {
    width: 0%;
    height: 100%;
    background: #ffffff;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    /* Glow effect */
}

#progress-percentage {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-weight: bold;
}

/*
 * Right panel: full viewport height on the right; stacks above canvas + left HUD.
 * Loader (#loader-container), startup selector, and modals (≈2000+) stay above via higher z-index.
 */
#right-panel {
    position: fixed;
    top: 0;
    right: 25px;
    bottom: 0;
    /* Cap width on narrow viewports so the column + padding never spills past the screen */
    width: min(var(--right-panel-terminal-width, 280px), calc(100vw - 50px));
    box-sizing: border-box;
    padding: 25px 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    z-index: 800;
    /* auto: flex gaps stay hit-testable so wheel does not fall through to #canvas-container */
    pointer-events: auto;
    transition: transform 0.26s ease, opacity 0.26s ease;
}

#right-panel > * {
    pointer-events: auto;
}

#right-panel #ui-container {
    flex-shrink: 0;
}

/* Camera HUD: top-left, live coords + Free / Dynamic / Reset */
#camera-hud {
    position: fixed;
    top: 25px;
    left: 25px;
    z-index: 100;
    pointer-events: auto;
    box-sizing: border-box;
    width: var(--right-panel-terminal-width, 280px);
    max-width: calc(100vw - 40px);
    padding: 0;
    font-family: 'Courier New', monospace;
    display: flex;
    flex-direction: column;
    gap: 8px;
    visibility: visible;
    filter: blur(0);
    transition:
        transform var(--music-ui-reveal-dur, 0.45s) var(--music-ui-reveal-ease, cubic-bezier(0.22, 1, 0.36, 1)),
        opacity var(--music-ui-reveal-dur, 0.45s) var(--music-ui-reveal-ease, cubic-bezier(0.22, 1, 0.36, 1)),
        filter 0.32s ease,
        visibility 0s linear;
    /* Same idea as #right-panel #terminal-menu: cap height, scroll inside HUD (wheel stays on UI, not canvas) */
    max-height: calc(100vh - 50px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    /* Reserve gutter so expanding Advanced Menu does not shrink content width when scrollbar appears */
    scrollbar-gutter: stable;
    /* Vertical scrollbar on the left; direct children reset to LTR for text/layout */
    direction: rtl;
    scrollbar-width: thin;
    scrollbar-color: rgba(76, 175, 80, 0.75) rgba(0, 0, 0, 0.45);
}

#camera-hud > * {
    direction: ltr;
}

#camera-hud::-webkit-scrollbar {
    width: 8px;
}

#camera-hud::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.45);
    border-radius: 999px;
}

#camera-hud::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(129, 199, 132, 0.95), rgba(76, 175, 80, 0.8));
    border: 1px solid rgba(129, 199, 132, 0.35);
    border-radius: 999px;
}

#camera-hud::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(165, 214, 167, 0.95), rgba(102, 187, 106, 0.85));
}

.menu-collapsible-section {
    position: relative;
}

.menu-section-toggle {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 16px;
    height: 16px;
    border: 1px solid rgba(76, 175, 80, 0.35);
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.4);
    color: rgba(129, 199, 132, 0.85);
    font-family: 'Courier New', monospace;
    font-size: 11px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
    z-index: 2;
}

.menu-collapsible-section:hover .menu-section-toggle,
.menu-collapsible-section.menu-section-collapsed .menu-section-toggle,
.menu-section-toggle:focus-visible {
    opacity: 1;
    pointer-events: auto;
}

.menu-section-toggle:hover {
    color: #9CCC65;
    border-color: rgba(129, 199, 132, 0.75);
    background: rgba(0, 0, 0, 0.62);
}

.menu-section-content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.menu-collapsible-section.menu-section-collapsed .menu-section-content {
    display: none;
}

#camera-hud.camera-hud-zen-global-collapsed .camera-hud-menu-block:not(.camera-hud-menu-block--zen-surface) {
    display: none;
}

#camera-hud.camera-hud-zen-global-collapsed .camera-hud-menu-block--perf-hud {
    display: none;
}

/* Docked console: hidden in zen-chill collapsed HUD and when Advanced Menu is expanded (solo "Konsola" opens centered). */
body.zen-global-advanced-collapsed:not(.topkek-console-solo):not(.music-showcase-ui-minimal) #topkek-terminal-shell {
    display: none;
}

body:not(.zen-global-advanced-collapsed):not(.music-showcase-ui-minimal):not(.topkek-console-solo) #topkek-terminal-shell {
    display: none;
}

/* --- Centered console-only (body.topkek-console-solo) --- */
body.topkek-console-solo::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 1340;
    background: rgba(0, 0, 0, 0.55);
    pointer-events: none;
}

body.visual-mode-white.topkek-console-solo::before {
    background: rgba(232, 234, 237, 0.72);
}

body.topkek-console-solo #topkek-terminal-shell {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    left: 50%;
    top: 50%;
    right: auto;
    bottom: auto;
    width: min(560px, calc(100vw - 32px));
    max-height: min(72vh, 640px);
    z-index: 1350;
    transform: translate3d(-50%, -50%, 0) !important;
    box-shadow:
        0 0 0 1px rgba(129, 199, 132, 0.28),
        0 18px 48px rgba(0, 0, 0, 0.55);
}

body.topkek-console-solo #topkek-terminal-shell.topkek-terminal-shell--maximized {
    width: min(900px, calc(100vw - 32px));
    max-height: min(72vh, 640px);
    right: auto;
    bottom: auto;
    left: 50%;
    top: 50%;
    transform: translate3d(-50%, -50%, 0) !important;
}

body.topkek-console-solo #camera-hud,
body.topkek-console-solo #perf-hud,
body.topkek-console-solo .prod-label,
body.topkek-console-solo #right-panel #ui-container,
body.topkek-console-solo #right-panel #terminal-menu,
body.topkek-console-solo .topkek-fx-dev-shell {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

body.topkek-console-solo #startup-selector:not(.hidden) {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

body.topkek-console-solo .topkek-terminal-shell-solo-exit {
    display: inline-flex !important;
}

#camera-hud .zen-console-solo-open-btn {
    margin-top: 2px;
    margin-bottom: 8px;
    width: 100%;
}

body:not(.topkek-console-solo) .topkek-terminal-shell-solo-exit {
    display: none !important;
}

/* Zen: scroll lives on `.menu-section-content` (collapsible wrapper); keep it reachable */
body.zen-global-advanced-collapsed #right-panel #terminal-menu.menu-collapsible-section > .menu-section-content {
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

#camera-hud .zen-global-menu-toggle {
    margin-top: 2px;
    margin-bottom: 8px;
    width: 100%;
}

.camera-hud-title {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

/* Camera HUD: 4×3 grid, label + value; value width = 4 digits + dot (tabular), cell grid; darker row rules */
#camera-hud .camera-hud-params {
    --camera-hud-value-ch: 6ch;
    margin-top: 6px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    align-items: stretch;
    border: 1px solid rgba(76, 175, 80, 0.35);
    background: rgba(0, 0, 0, 0.22);
}

#camera-hud .camera-hud-param-slot {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-width: 0;
    padding: 4px 6px;
    box-sizing: border-box;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    line-height: 1.2;
    border-right: 1px solid rgba(76, 175, 80, 0.26);
    border-bottom: 1px solid rgba(0, 0, 0, 0.42);
}

#camera-hud .camera-hud-param-slot:nth-child(3n) {
    border-right: none;
}

#camera-hud .camera-hud-param-slot:nth-child(n + 10) {
    border-bottom: none;
}

#camera-hud .camera-hud-param-label {
    flex: 0 0 auto;
    color: var(--menu-label-color);
    text-transform: none;
    letter-spacing: 0.02em;
    font-size: 10px;
    white-space: nowrap;
}

#camera-hud .camera-hud-param-value {
    flex: 0 0 var(--camera-hud-value-ch);
    width: var(--camera-hud-value-ch);
    min-width: var(--camera-hud-value-ch);
    max-width: var(--camera-hud-value-ch);
    box-sizing: border-box;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    color: #81C784;
    cursor: ns-resize;
    user-select: none;
    padding: 0;
    border: none;
    background: transparent;
    overflow: hidden;
    text-overflow: clip;
    transition: color 0.15s ease, text-shadow 0.15s ease, background 0.15s ease;
}

#camera-hud .camera-hud-param-value--readonly {
    cursor: default;
    color: rgba(129, 199, 132, 0.55);
}

#camera-hud .camera-hud-param-value:hover:not(.camera-hud-param-value--readonly) {
    color: #b8efba;
    text-shadow: 0 0 5px rgba(76, 175, 80, 0.45);
    background: rgba(76, 175, 80, 0.1);
}

#camera-hud .camera-hud-param-value:focus-visible {
    outline: 1px solid rgba(129, 199, 132, 0.85);
    outline-offset: 1px;
}

#camera-hud .camera-hud-param-input {
    flex: 0 0 var(--camera-hud-value-ch);
    width: var(--camera-hud-value-ch);
    min-width: var(--camera-hud-value-ch);
    max-width: var(--camera-hud-value-ch);
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #81C784;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    text-align: right;
    caret-color: #4CAF50;
}

#camera-hud .camera-hud-param-input:focus {
    outline: 1px solid rgba(129, 199, 132, 0.85);
    outline-offset: 0;
}

@media (prefers-reduced-motion: reduce) {
    #camera-hud .camera-hud-param-value {
        transition: none;
    }
}

#camera-hud .mode-btn,
#right-panel .mode-btn {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    padding: 0.05rem 0;
    margin: 0;
    text-align: left;
    width: 100%;
    min-width: 140px;
    box-sizing: border-box;
    background: none;
    border: none;
    border-radius: 0;
    color: #4CAF50;
    cursor: pointer;
    transition: color 0.2s, text-shadow 0.2s;
}

#camera-hud .mode-btn:hover,
#right-panel .mode-btn:hover {
    color: #81C784;
    text-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
    text-decoration: underline;
}

#camera-hud .mode-btn.active,
#right-panel .mode-btn.active {
    color: #000;
    background: rgba(76, 175, 80, 0.45);
    padding: 0.05rem 0.1rem;
    margin: 0 -0.1rem 0 0;
    text-decoration: none;
    animation: term-active-strobe 2.5s ease-in-out infinite;
}

.controls-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    border-radius: var(--menu-surface-radius);
    border: var(--menu-surface-border);
    background: var(--menu-surface-bg);
    box-shadow: var(--menu-surface-shadow);
}

#camera-hud .controls-section {
    margin-top: 0;
}

#camera-hud .camera-hud-menu-block {
    margin-bottom: 8px;
}

#camera-hud .camera-hud-menu-block:last-child {
    margin-bottom: 0;
}

#camera-hud .camera-hud-menu-block > .term-menu-category-heading {
    pointer-events: none;
    display: block;
    margin: 0 0 6px 0;
    min-height: 1.2em;
    font-size: 11px;
    color: var(--menu-label-color);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

#camera-hud .camera-hud-stack-layout-row {
    display: flex;
    width: 100%;
    margin-top: 6px;
}

#camera-hud .camera-hud-stack-layout-row .camera-hud-stack-scene-btn {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}

#camera-hud .camera-hud-stack-scene-btn:disabled {
    opacity: 0.78;
    cursor: default;
}

#camera-hud .controls-category-title,
#right-panel .controls-category-title,
.menu-section-title {
    margin-bottom: 2px;
    font-size: 11px;
    color: var(--menu-label-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

#camera-hud .camera-hud-control-label {
    display: block;
    margin: 4px 0 2px;
    font-size: 10px;
    color: var(--menu-label-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

#camera-hud .camera-hud-select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 3px 6px;
    margin: 0;
    border: 1px solid rgba(76, 175, 80, 0.45);
    border-radius: 0;
    background: rgba(0, 0, 0, 0.45);
    color: #81C784;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

#camera-hud .camera-hud-select:focus {
    outline: 1px solid rgba(129, 199, 132, 0.85);
    outline-offset: 0;
}

#camera-hud .camera-hud-bg-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

#camera-hud .camera-hud-bg-controls {
    flex: 1;
    min-width: 0;
}

#camera-hud .camera-hud-bg-select-row {
    display: flex;
    align-items: stretch;
    gap: 6px;
}

#camera-hud .camera-hud-bg-select-row .camera-hud-select {
    flex: 1;
    min-width: 0;
}

#camera-hud .camera-hud-bg-play-toggle {
    flex: 0 0 36px;
    box-sizing: border-box;
    margin: 0;
    padding: 0 4px;
    border: 1px solid rgba(76, 175, 80, 0.45);
    border-radius: 0;
    background: rgba(0, 0, 0, 0.45);
    color: #81C784;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    align-self: stretch;
}

#camera-hud .camera-hud-bg-play-toggle:hover {
    border-color: rgba(129, 199, 132, 0.85);
    background: rgba(76, 175, 80, 0.12);
}

#camera-hud .camera-hud-bg-play-toggle:focus {
    outline: 1px solid rgba(129, 199, 132, 0.85);
    outline-offset: 0;
}

#camera-hud .camera-hud-bg-play-toggle[aria-pressed="true"] {
    color: rgba(129, 199, 132, 0.95);
    border-color: rgba(129, 199, 132, 0.65);
}

#camera-hud .camera-hud-bpm-indicator-wrap {
    width: 66px;
    flex: 0 0 66px;
}

#camera-hud .camera-hud-bpm-indicator-label {
    text-align: center;
    margin-top: 4px;
}

#camera-hud .camera-hud-bpm-grid {
    width: 66px;
    height: 66px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 4px;
}

#camera-hud .camera-hud-bpm-segment {
    border: 1px solid rgba(76, 175, 80, 0.45);
    background: rgba(76, 175, 80, 0.08);
    box-sizing: border-box;
    transition: background 0.12s linear, box-shadow 0.12s linear, border-color 0.12s linear;
}

#camera-hud .camera-hud-bpm-segment.is-active {
    border-color: rgba(129, 199, 132, 0.95);
    background: rgba(129, 199, 132, 0.55);
    box-shadow: 0 0 10px rgba(129, 199, 132, 0.75);
    animation: camera-hud-bpm-glow 0.22s ease-out;
}

@keyframes camera-hud-bpm-glow {
    0% {
        transform: scale(0.93);
        box-shadow: 0 0 0 rgba(129, 199, 132, 0.2);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(129, 199, 132, 0.75);
    }
}

#camera-hud .inline-text-regen {
    margin-top: 2px;
}

/* Performance HUD: section inside Camera HUD, below BG options */
#perf-hud {
    width: 100%;
    margin-top: 0;
    padding: 8px 10px;
    border-radius: var(--menu-surface-radius);
    border: var(--menu-surface-border);
    background: var(--menu-surface-bg);
    box-sizing: border-box;
    font-family: 'Courier New', monospace;
    pointer-events: auto;
}

.perf-hud-title {
    margin: 0 0 4px;
    font-size: 11px;
    color: var(--menu-text-color);
    letter-spacing: 0.02em;
}

.perf-hud-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    font-size: 11px;
}

.perf-hud-fps,
.perf-hud-stat {
    color: var(--menu-text-color);
}

.perf-hud-graph {
    display: block;
    width: 100%;
    height: 54px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-sizing: border-box;
}

.perf-hud-presets-row {
    margin-bottom: 6px;
}

#camera-hud .perf-hud-preset-btn {
    text-align: center;
    padding: 0.2rem 0.15rem;
    min-width: 0;
    border: 1px solid rgba(76, 175, 80, 0.4);
    background: rgba(0, 0, 0, 0.32);
}

#camera-hud .perf-hud-preset-btn:hover {
    border-color: rgba(129, 199, 132, 0.85);
    background: rgba(76, 175, 80, 0.08);
    text-decoration: none;
}

#perf-hud.perf-hud--good {
    border-color: rgba(76, 175, 80, 0.55);
}

#perf-hud.perf-hud--good .perf-hud-fps {
    color: #00ff99;
}

#perf-hud.perf-hud--warn {
    border-color: rgba(255, 193, 7, 0.7);
}

#perf-hud.perf-hud--warn .perf-hud-fps {
    color: #ffcc00;
}

#perf-hud.perf-hud--bad {
    border-color: rgba(244, 67, 54, 0.75);
}

#perf-hud.perf-hud--bad .perf-hud-fps {
    color: #ff4d4d;
}

@media (max-width: 480px) {
    #camera-hud {
        width: min(260px, calc(100vw - 24px));
        top: 12px;
        left: 12px;
        padding: 8px 10px;
        max-height: calc(100vh - 24px);
    }

    #camera-hud .mode-btn {
        font-size: 11px;
    }

    #camera-hud .camera-hud-bpm-indicator-wrap {
        width: 52px;
        flex-basis: 52px;
    }

    #camera-hud .camera-hud-bpm-grid {
        width: 52px;
        height: 52px;
        gap: 3px;
    }

    #perf-hud { padding: 7px 8px; }

    .perf-hud-row {
        font-size: 10px;
    }

    .perf-hud-graph {
        height: 46px;
    }
}

/* --- Post-intro UI: hidden until camera fly-in ends, then staggered reveal --- */
:root {
    --post-intro-slide-x: 44px;
    --post-intro-menu-stagger: 52ms;
    --post-intro-menu-dur: 0.62s;
    --post-intro-ui-delay: 60ms;
    --post-intro-ui-dur: 0.52s;
    --post-intro-shell-delay: 380ms;
    --post-intro-shell-dur: 0.55s;
    --post-intro-hud-delay: 100ms;
    --post-intro-hud-dur: 0.58s;
    --post-intro-prod-delay: 240ms;
    --post-intro-prod-dur: 0.72s;
}

body.post-intro-ui-pending #camera-hud,
body.post-intro-ui-pending #perf-hud,
body.post-intro-ui-pending .prod-label,
body.post-intro-ui-pending #ui-container,
body.post-intro-ui-pending #terminal-menu,
body.post-intro-ui-pending #terminal-menu .term-line,
body.post-intro-ui-pending #topkek-terminal-shell {
    opacity: 0;
    pointer-events: none;
}

body.post-intro-ui-pending #camera-hud {
    transform: translate3d(0, calc(-1 * max(120%, 6rem)), 0);
}

body.post-intro-ui-pending .prod-label {
    transform: translate3d(0, calc(100% + 12px), 0);
}

body.post-intro-ui-pending #ui-container {
    transform: translate3d(var(--post-intro-slide-x), 0, 0);
}

body.post-intro-ui-pending #terminal-menu {
    overflow: hidden !important;
    transform: translate3d(var(--post-intro-slide-x), 0, 0);
}

body.post-intro-ui-pending #terminal-menu .term-line {
    transform: translate3d(var(--post-intro-slide-x), 0, 0);
    filter: blur(0.5px);
}

body.post-intro-ui-pending #topkek-terminal-shell {
    transform: translate3d(var(--post-intro-slide-x), 0, 0);
}

body.post-intro-ui-ready #camera-hud,
body.post-intro-ui-ready #perf-hud,
body.post-intro-ui-ready #ui-container,
body.post-intro-ui-ready #terminal-menu,
body.post-intro-ui-ready #terminal-menu .term-line,
body.post-intro-ui-ready #topkek-terminal-shell {
    pointer-events: auto;
}

@keyframes post-intro-slide-from-top {
    from {
        opacity: 0;
        transform: translate3d(0, calc(-1 * max(120%, 6rem)), 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes post-intro-slide-from-bottom {
    from {
        opacity: 0;
        transform: translate3d(0, calc(100% + 12px), 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes post-intro-slide-from-right {
    from {
        opacity: 0;
        transform: translate3d(var(--post-intro-slide-x), 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
        filter: blur(0);
    }
}

/* Terminal lines: slide from right + short chromatic “glitch” on entry */
@keyframes post-intro-menu-line-glitch {
    0% {
        opacity: 0;
        transform: translate3d(var(--post-intro-slide-x), 0, 0);
        text-shadow:
            3px 0 rgba(255, 0, 255, 0.55),
            -3px 0 rgba(0, 255, 255, 0.5);
        filter: blur(1px);
    }
    12% {
        opacity: 0.95;
        transform: translate3d(-3px, 0, 0);
        text-shadow:
            -2px 0 rgba(255, 0, 255, 0.45),
            2px 0 rgba(0, 255, 255, 0.4);
        filter: blur(0.3px);
    }
    26% {
        transform: translate3d(2px, 0, 0);
        text-shadow:
            2px 0 rgba(0, 255, 170, 0.35),
            -1px 0 rgba(255, 100, 200, 0.3);
    }
    42% {
        transform: translate3d(-1px, 0, 0);
        text-shadow: 1px 0 rgba(76, 175, 80, 0.4);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
        text-shadow: none;
        filter: none;
    }
}

body.post-intro-ui-ready #camera-hud {
    animation: post-intro-slide-from-top var(--post-intro-hud-dur) cubic-bezier(0.22, 1, 0.36, 1) var(--post-intro-hud-delay) both;
    will-change: transform, opacity;
}

body.post-intro-ui-ready .prod-label {
    animation: post-intro-slide-from-bottom var(--post-intro-prod-dur) cubic-bezier(0.22, 1, 0.36, 1) var(--post-intro-prod-delay) both;
    will-change: transform, opacity;
}

body.post-intro-ui-ready #ui-container {
    animation: post-intro-slide-from-right var(--post-intro-ui-dur) cubic-bezier(0.22, 1, 0.36, 1) var(--post-intro-ui-delay) both;
    will-change: transform, opacity;
}

body.post-intro-ui-ready #terminal-menu {
    animation: post-intro-slide-from-right var(--post-intro-ui-dur) cubic-bezier(0.22, 1, 0.36, 1) var(--post-intro-ui-delay) both;
    will-change: transform, opacity;
}

body.post-intro-ui-ready #topkek-terminal-shell {
    animation: post-intro-slide-from-right var(--post-intro-shell-dur) cubic-bezier(0.22, 1, 0.36, 1) var(--post-intro-shell-delay) both;
    will-change: transform, opacity;
}

body.post-intro-ui-ready #terminal-menu .term-line {
    animation: post-intro-menu-line-glitch var(--post-intro-menu-dur) cubic-bezier(0.33, 1, 0.48, 1) calc(var(--post-intro-line-index, 0) * var(--post-intro-menu-stagger)) both;
    will-change: transform, opacity, filter;
}

/* User skipped intro: final layout without staggered entrance */
body.post-intro-ui-ready.post-intro-ui-instant #camera-hud,
body.post-intro-ui-ready.post-intro-ui-instant #perf-hud,
body.post-intro-ui-ready.post-intro-ui-instant .prod-label,
body.post-intro-ui-ready.post-intro-ui-instant #ui-container,
body.post-intro-ui-ready.post-intro-ui-instant #terminal-menu,
body.post-intro-ui-ready.post-intro-ui-instant #terminal-menu .term-line,
body.post-intro-ui-ready.post-intro-ui-instant #topkek-terminal-shell {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    will-change: auto;
}

/* VAJBUJ / MYSEN: fade + slide + collapse; console stays visible (and eases up slightly) */
body.music-showcase-ui-minimal #right-panel #terminal-menu,
body.music-showcase-ui-minimal #ui-container {
    overflow: hidden !important;
    max-height: 0 !important;
    opacity: 0;
    transform: translate3d(18px, -4px, 0) scale(0.985);
    filter: blur(2px);
    pointer-events: none !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    visibility: hidden;
    transition:
        max-height var(--music-ui-collapse-dur) var(--music-ui-collapse-ease),
        opacity calc(var(--music-ui-reveal-dur) * 0.85) var(--music-ui-reveal-ease),
        transform var(--music-ui-reveal-dur) var(--music-ui-reveal-ease),
        filter 0.28s ease,
        margin 0.42s var(--music-ui-reveal-ease),
        visibility 0s linear var(--music-ui-reveal-dur);
}

body.music-showcase-ui-minimal #camera-hud {
    opacity: 0;
    transform: translate3d(-40px, -6px, 0) scale(0.98);
    filter: blur(2px);
    pointer-events: none;
    visibility: hidden;
    transition:
        transform var(--music-ui-reveal-dur) var(--music-ui-reveal-ease),
        opacity var(--music-ui-reveal-dur) var(--music-ui-reveal-ease),
        filter 0.28s ease,
        visibility 0s linear var(--music-ui-reveal-dur);
}

body.music-showcase-ui-minimal .prod-label {
    opacity: 0;
    transform: translate3d(0, 14px, 0) scale(0.98);
    filter: blur(1px);
    visibility: hidden;
    transition:
        opacity var(--music-ui-reveal-dur) var(--music-ui-reveal-ease),
        transform var(--music-ui-reveal-dur) var(--music-ui-reveal-ease),
        filter 0.28s ease,
        visibility 0s linear var(--music-ui-reveal-dur);
}

body.music-showcase-ui-minimal .topkek-fx-dev-shell {
    opacity: 0;
    transform: translate3d(-50%, -18px, 0) scale(0.96);
    filter: blur(2px);
    pointer-events: none;
    visibility: hidden;
    transition:
        opacity var(--music-ui-reveal-dur) var(--music-ui-reveal-ease),
        transform var(--music-ui-reveal-dur) var(--music-ui-reveal-ease),
        filter 0.28s ease,
        visibility 0s linear var(--music-ui-reveal-dur);
}

body.music-showcase-ui-minimal #topkek-terminal-shell {
    transform: translate3d(0, -12px, 0);
    box-shadow:
        0 0 0 1px rgba(129, 199, 132, 0.22),
        0 10px 28px rgba(0, 0, 0, 0.45),
        0 0 22px rgba(76, 175, 80, 0.14);
    transition:
        transform var(--music-ui-collapse-dur) var(--music-ui-collapse-ease),
        box-shadow var(--music-ui-collapse-dur) var(--music-ui-reveal-ease);
}

@media (prefers-reduced-motion: reduce) {
    body.music-showcase-ui-minimal #right-panel #terminal-menu,
    body.music-showcase-ui-minimal #ui-container,
    body.music-showcase-ui-minimal #camera-hud,
    body.music-showcase-ui-minimal .prod-label,
    body.music-showcase-ui-minimal .topkek-fx-dev-shell,
    body.music-showcase-ui-minimal #topkek-terminal-shell {
        filter: none !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
    }
}

#ui-container {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
    font-family: 'Courier New', monospace;
    max-height: 800px;
    overflow: hidden;
    visibility: visible;
    transform-origin: 50% 0%;
    filter: blur(0);
    transition:
        max-height var(--music-ui-collapse-dur, 0.52s) var(--music-ui-collapse-ease, cubic-bezier(0.32, 0, 0.18, 1)),
        opacity calc(var(--music-ui-reveal-dur, 0.48s) * 0.92) var(--music-ui-reveal-ease, cubic-bezier(0.22, 1, 0.36, 1)),
        transform var(--music-ui-reveal-dur, 0.48s) var(--music-ui-reveal-ease, cubic-bezier(0.22, 1, 0.36, 1)),
        filter 0.32s ease,
        margin 0.4s var(--music-ui-reveal-ease, cubic-bezier(0.22, 1, 0.36, 1)),
        visibility 0s linear;
}

.controls-category-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#camera-hud .visual-mode-switch-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

#camera-hud .camera-hud-three-btn-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

#camera-hud .camera-hud-camera-mode-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) max-content;
    gap: 6px;
    align-items: stretch;
}

#camera-hud .visual-mode-switch-btn {
    min-width: 0;
    text-align: center;
    padding: 0.25rem 0.2rem;
    border: 1px solid rgba(76, 175, 80, 0.4);
    background: rgba(0, 0, 0, 0.32);
}

#camera-hud .visual-mode-switch-btn:hover {
    border-color: rgba(129, 199, 132, 0.85);
    background: rgba(76, 175, 80, 0.08);
    text-decoration: none;
}

/* Zen Mode — stałe białe tło (camera HUD) */
#camera-hud #term-visual-light-mode.visual-mode-zen-btn {
    color: #0a0a0a;
    background-color: #fff;
    border-color: rgba(255, 255, 255, 0.98);
}

#camera-hud #term-visual-light-mode.visual-mode-zen-btn:hover,
#camera-hud #term-visual-light-mode.visual-mode-zen-btn:focus-visible {
    color: #1b5e20;
    background-color: #f5f5f5;
    border-color: rgba(76, 175, 80, 0.85);
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.25);
    text-shadow: none;
    text-decoration: none;
}

#camera-hud .camera-hud-camera-mode-row .visual-mode-switch-btn:not(.camera-reset-icon-btn) {
    white-space: nowrap;
}

#camera-hud .camera-reset-icon-btn {
    box-sizing: border-box;
    min-width: 0;
    width: 1.75rem;
    max-width: 1.75rem;
    padding: 0.25rem 0;
    flex: none;
    text-align: center;
    font-size: 14px;
    line-height: 1;
}

#camera-hud .effects-toggle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
    gap: 6px;
}

#camera-hud .effects-toggle-btn {
    min-width: 0;
    text-align: center;
    padding: 0.2rem 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
}

@keyframes term-active-strobe {
    0%, 100% { background-color: rgba(76, 175, 80, 0.38); }
    50%      { background-color: rgba(76, 175, 80, 0.55); }
}

.mode-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    cursor: pointer;
    font-family: sans-serif;
    font-size: 14px;
    transition: all 0.3s;
    border-radius: 4px;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mode-btn.active {
    background: rgba(255, 255, 255, 0.8);
    color: black;
    border-color: white;
}

.mobile-info {
    position: absolute;
    bottom: 5px;
    width: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    pointer-events: none;
    z-index: 99;
}

#mobile-letters-container {
    position: absolute;
    bottom: 80px;
    /* Above the mode buttons */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 100;
}

.letter-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-family: sans-serif;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.letter-btn:active,
.letter-btn:hover {
    background: rgba(255, 255, 255, 0.8);
    color: black;
    border-color: white;
}

/* Production Label */
.prod-label {
    position: absolute;
    bottom: 25px;
    left: 25px;
    /* Position to the left */
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Courier New', monospace;
    font-size: 13px;
    letter-spacing: 1px;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 10px;
    border-radius: 4px;
    visibility: visible;
    filter: blur(0);
    transition:
        opacity var(--music-ui-reveal-dur, 0.48s) var(--music-ui-reveal-ease, cubic-bezier(0.22, 1, 0.36, 1)),
        transform var(--music-ui-reveal-dur, 0.48s) var(--music-ui-reveal-ease, cubic-bezier(0.22, 1, 0.36, 1)),
        filter 0.3s ease,
        visibility 0s linear;
}

/* APPSTAIN Modal – tło tlo.jpg */
#appstain-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

#appstain-modal.hidden {
    display: none;
}

/* Pojawianie się modalu */
#appstain-modal:not(.hidden) {
    animation: appstain-modal-fadeIn 0.35s ease-out forwards;
}

#appstain-modal.appstain-modal-closing {
    animation: appstain-modal-fadeOut 0.25s ease-in forwards;
}

@keyframes appstain-modal-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes appstain-modal-fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

#appstain-backdrop {
    position: absolute;
    inset: 0;
    background: url('ASSETS/APPSTAIN/tlo.jpg') center / cover no-repeat;
}

#appstain-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    pointer-events: none;
}

#appstain-content {
    position: relative;
    z-index: 1;
    background: rgba(20, 22, 30, 0.95);
    padding: 28px 32px 32px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.7);
    width: 58.5%;
    max-width: 598px;
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.6) rgba(255, 255, 255, 0.06);
}

#appstain-content::-webkit-scrollbar {
    width: 6px;
}

#appstain-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 3px;
}

#appstain-content::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.55);
    border-radius: 3px;
}

#appstain-content::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.85);
}

#appstain-content .close-btn {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 18px;
}

#appstain-content .close-btn:hover {
    color: white;
}

/* Logo & banners */
.appstain-logo {
    display: block;
    max-width: 80%;
    height: auto;
    margin: 0 auto 12px;
}

.appstain-banners {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 20px;
    margin-bottom: 20px;
}

.appstain-banner {
    max-width: 100%;
    height: auto;
    max-height: 48px;
    object-fit: contain;
}

/* Generic card box */
.appstain-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 14px 16px;
}

/* Section wrapper with heading + card interior */
.appstain-section-box {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 16px;
    text-align: left;
    background: rgba(255, 255, 255, 0.03);
}

.appstain-section-title {
    color: rgba(212, 175, 55, 0.95);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin: 0 0 14px;
    text-align: left;
}

/* Trump head above intro card – centered, slightly larger */
#appstain-content .appstain-trump-widget.topkek-character-container {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    margin: 0 auto 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100px;
    overflow: visible;
}

#appstain-content .appstain-trump-widget .topkek-character-head {
    width: 100px;
    height: 100px;
}

/* Speech bubble directly below head, centered, floats over modal content */
#appstain-content .appstain-trump-widget .topkek-speech-bubble {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    width: 260px;
    z-index: 50;
    animation: appstain-bubbleAppear 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes appstain-bubbleAppear {
    from {
        opacity: 0;
        transform: scale(0.7) translateX(-50%);
    }
    to {
        opacity: 1;
        transform: scale(1) translateX(-50%);
    }
}

.appstain-intro-card {
    margin-bottom: 16px;
    text-align: center;
}

.appstain-intro {
    color: rgba(255, 255, 255, 0.88);
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
}

/* Tutorial: one-line info + two quest thumbnails */
.appstain-quest-intro {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 12px;
}

.appstain-quest-thumbs {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.appstain-quest-thumbs .appstain-quest-img {
    flex-shrink: 0;
    width: 160px;
    max-width: 160px;
    height: auto;
    border-radius: 8px;
    display: block;
    object-fit: cover;
}

/* Video */
.appstain-video-wrap {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.appstain-video {
    flex-shrink: 0;
    width: 55%;
    max-width: 440px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: block;
}

.appstain-caption-card {
    flex: 1;
    min-width: 0;
}

.appstain-video-caption {
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    font-style: italic;
    margin: 0;
    line-height: 1.5;
}

/* Audio – custom player (native audio hidden) */
#appstain-audio-el {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.appstain-audio-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.appstain-audio-player {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.appstain-audio-btn {
    flex-shrink: 0;
    background: rgba(212, 175, 55, 0.25);
    border: 1px solid rgba(212, 175, 55, 0.5);
    color: rgba(255, 255, 255, 0.95);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.appstain-audio-btn:hover {
    background: rgba(212, 175, 55, 0.4);
    border-color: rgba(212, 175, 55, 0.7);
}

.appstain-audio-btn.playing {
    background: rgba(212, 175, 55, 0.35);
}

.appstain-audio-progress-wrap {
    flex: 1;
    min-width: 120px;
    position: relative;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.appstain-audio-seek {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.appstain-audio-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    background: rgba(212, 175, 55, 0.7);
    border-radius: 3px;
    pointer-events: none;
}

.appstain-audio-time {
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-family: monospace;
}

.appstain-audio-caption {
    color: rgba(255, 255, 255, 0.65);
    font-size: 12px;
    margin: 0;
}

/* Range input styling for Firefox (thumb visible when used) */
.appstain-audio-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.9);
    cursor: pointer;
}
.appstain-audio-seek::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.9);
    border: none;
    cursor: pointer;
}

/* Screenshots grid */
.appstain-screenshots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.appstain-screenshot {
    width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: block;
    cursor: pointer;
    transition: border-color 0.15s;
}

.appstain-screenshot:hover {
    border-color: rgba(212, 175, 55, 0.6);
}

/* Alpha / version card */
.appstain-alpha-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    background: rgba(212, 175, 55, 0.08);
    border-color: rgba(212, 175, 55, 0.3);
}

.appstain-alpha-badge {
    color: rgba(212, 175, 55, 0.95);
    font-size: 13px;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
}

.appstain-alpha-detail {
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    margin: 0;
    line-height: 1.4;
}

/* Riddle / password section */
.appstain-riddle {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.appstain-riddle-question {
    color: rgba(255, 255, 255, 0.95);
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 12px;
}

#appstain-content #appstain-password {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 14px;
    width: 100%;
    max-width: 260px;
    margin-bottom: 12px;
    border-radius: 6px;
    font-family: monospace;
    text-align: center;
    box-sizing: border-box;
}

#appstain-content #appstain-password:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
}

#appstain-content #appstain-submit {
    margin-bottom: 8px;
}

.appstain-error {
    color: #e57373;
    font-size: 13px;
    margin: 0;
    display: none;
}

.appstain-error.visible {
    display: block;
}

@media (max-width: 640px) {
    .appstain-quest-thumbs {
        flex-direction: column;
        align-items: center;
    }
    .appstain-quest-thumbs .appstain-quest-img {
        max-width: 100%;
        width: 100%;
    }
    .appstain-section-title {
        text-align: center;
    }
    .appstain-video-wrap {
        flex-direction: column;
    }
    .appstain-video {
        width: 100%;
        max-width: 100%;
    }
    .appstain-audio-player {
        flex-wrap: wrap;
    }
    .appstain-alpha-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .appstain-screenshots {
        grid-template-columns: repeat(2, 1fr);
    }
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 16px;
}


/* Terminal menu: fills remaining #right-panel height; real scroll is on .menu-section-content (after makeSectionCollapsible) */
#right-panel #terminal-menu {
    position: static;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: var(--menu-text-color);
    text-align: left;
    z-index: 100;
    pointer-events: auto;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
    flex: 1 1 0%;
    min-height: 0;
    overflow: hidden;
    visibility: visible;
    transform-origin: 50% 0%;
    filter: blur(0);
    transition:
        opacity calc(var(--music-ui-reveal-dur, 0.48s) * 0.92) var(--music-ui-reveal-ease, cubic-bezier(0.22, 1, 0.36, 1)),
        transform var(--music-ui-reveal-dur, 0.48s) var(--music-ui-reveal-ease, cubic-bezier(0.22, 1, 0.36, 1)),
        filter 0.32s ease,
        margin 0.4s var(--music-ui-reveal-ease, cubic-bezier(0.22, 1, 0.36, 1)),
        visibility 0s linear;
}

#right-panel #terminal-menu.menu-collapsible-section > .menu-section-content {
    position: relative;
    isolation: isolate;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    flex: 1 1 0%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    /* Breath inset from panel edges while scrolling */
    padding-top: 8px;
    padding-left: 12px;
    padding-right: 12px;
    /* Console overlaps the column — extra scroll room so GAMES / MEDIA clear the shell */
    padding-bottom: calc(var(--topkek-terminal-shell-h, 220px) + 16px);
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(76, 175, 80, 0.75) rgba(0, 0, 0, 0.45);
}

#right-panel #terminal-menu.menu-collapsible-section > .menu-section-content::-webkit-scrollbar {
    width: 8px;
}

#right-panel #terminal-menu.menu-collapsible-section > .menu-section-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.45);
    border-radius: 999px;
}

#right-panel #terminal-menu.menu-collapsible-section > .menu-section-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(129, 199, 132, 0.95), rgba(76, 175, 80, 0.8));
    border: 1px solid rgba(129, 199, 132, 0.35);
    border-radius: 999px;
}

#right-panel #terminal-menu.menu-collapsible-section > .menu-section-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(165, 214, 167, 0.95), rgba(102, 187, 106, 0.85));
}

.term-line {
    margin-bottom: 2px;
    pointer-events: auto;
}

#right-panel #terminal-menu .term-menu-category-heading {
    pointer-events: none;
    display: block;
    margin: 0 0 10px 0;
    min-height: 1.2em;
    font-size: 11px;
    color: var(--menu-label-color);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

#right-panel #terminal-menu .term-menu-category-spacer {
    pointer-events: none;
    min-height: 1em;
    margin-bottom: 2px;
}

/* Media player — inside #terminal-menu .menu-section-content, below GAMES */
#right-panel #terminal-menu #term-media-player {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 14px 0 0;
    padding: 0;
    box-sizing: border-box;
    pointer-events: auto;
}

#right-panel #terminal-menu #term-media-player .term-media-player-heading {
    margin: 0 0 8px;
}

#right-panel #terminal-menu #term-media-player .term-media-player-surface {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    border: var(--menu-surface-border);
    border-radius: var(--menu-surface-radius);
    background: var(--menu-surface-bg);
    box-shadow: var(--menu-surface-shadow);
    box-sizing: border-box;
    overflow: hidden;
}

#right-panel #terminal-menu #term-media-player .term-media-player-toolbar {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
    box-sizing: border-box;
}

#right-panel #terminal-menu #term-media-player .term-media-player-stage {
    position: relative;
    width: calc(100% + 24px);
    margin-left: -12px;
    margin-right: -12px;
    aspect-ratio: 1 / 1;
    padding: 0;
    background: #000;
    border: none;
    border-top: 1px solid rgba(76, 175, 80, 0.35);
    border-bottom: 1px solid rgba(76, 175, 80, 0.35);
    border-radius: 0;
    box-sizing: border-box;
    overflow: hidden;
}

#right-panel #terminal-menu #term-media-player .term-media-player-cover,
#right-panel #terminal-menu #term-media-player .term-media-player-video {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

#right-panel #terminal-menu #term-media-player .term-media-player-video {
    display: none;
}

#right-panel #terminal-menu #term-media-player.term-media-player--video .term-media-player-cover {
    display: none;
}

#right-panel #terminal-menu #term-media-player.term-media-player--video .term-media-player-video {
    display: block;
}

#right-panel #terminal-menu #term-media-player .term-media-player-kind-badge {
    position: absolute;
    right: 6px;
    bottom: 6px;
    z-index: 2;
    padding: 2px 6px;
    font-size: 9px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #111;
    background: rgba(129, 199, 132, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

#right-panel #terminal-menu #term-media-player .term-media-player-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    padding: 8px 10px 10px;
    border-top: 1px solid rgba(76, 175, 80, 0.22);
    box-sizing: border-box;
}

#right-panel #terminal-menu #term-media-player .term-media-player-title {
    font-size: 12px;
    line-height: 1.25;
    color: #b8efba;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#right-panel #terminal-menu #term-media-player .term-media-player-artist {
    font-size: 11px;
    line-height: 1.25;
    color: #81c784;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#right-panel #terminal-menu #term-media-player .term-media-player-album-line {
    font-size: 10px;
    line-height: 1.3;
    color: rgba(129, 199, 132, 0.72);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#right-panel #terminal-menu #term-media-player .term-media-player-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}

#right-panel #terminal-menu #term-media-player .term-media-player-tag {
    display: inline-block;
    padding: 1px 5px;
    font-size: 9px;
    letter-spacing: 0.04em;
    text-transform: lowercase;
    color: rgba(184, 239, 186, 0.95);
    border: 1px solid rgba(76, 175, 80, 0.35);
    background: rgba(0, 0, 0, 0.35);
}

#right-panel #terminal-menu #term-media-player .term-media-player-transport {
    display: flex;
    align-items: center;
    gap: 8px;
    width: calc(100% + 24px);
    margin-left: -12px;
    margin-right: -12px;
    padding: 8px 0;
    border: none;
    background: rgba(0, 0, 0, 0.28);
    box-sizing: border-box;
}

#right-panel #terminal-menu #term-media-player .term-media-player-time {
    padding: 0 10px 8px;
    font-size: 10px;
    color: rgba(129, 199, 132, 0.9);
    font-variant-numeric: tabular-nums;
    text-align: right;
    box-sizing: border-box;
}

#right-panel #terminal-menu #term-media-player #term-media-player-audio {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

#right-panel #terminal-menu #term-media-player .term-media-player-track-label {
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--menu-label-color);
}

#right-panel #terminal-menu #term-media-player .term-media-player-track-select {
    width: 100%;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(76, 175, 80, 0.45);
    border-radius: 0;
    color: #81c784;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    padding: 5px 6px;
}

#right-panel #terminal-menu #term-media-player .term-media-player-track-select:focus {
    outline: 1px solid #4caf50;
    outline-offset: 1px;
}

#right-panel #terminal-menu #term-media-player .term-media-player-btn {
    flex-shrink: 0;
    padding: 0;
    background: transparent;
    border: none;
    color: #81c784;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

#right-panel #terminal-menu #term-media-player .term-media-player-btn--icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-left: 6px;
    font-size: 14px;
    line-height: 1;
    border: 1px solid rgba(76, 175, 80, 0.45);
    background: rgba(0, 0, 0, 0.45);
}

#right-panel #terminal-menu #term-media-player .term-media-player-btn-glyph {
    display: block;
    transform: translateX(1px);
}

#right-panel #terminal-menu #term-media-player .term-media-player-btn.is-playing .term-media-player-btn-glyph {
    transform: none;
    font-size: 12px;
}

#right-panel #terminal-menu #term-media-player .term-media-player-btn:hover {
    color: #b8efba;
    border-color: rgba(129, 199, 132, 0.85);
    background: rgba(76, 175, 80, 0.12);
}

#right-panel #terminal-menu #term-media-player .term-media-player-btn.is-playing {
    color: #111;
    background: rgba(129, 199, 132, 0.92);
    border-color: rgba(129, 199, 132, 0.95);
}

#right-panel #terminal-menu #term-media-player .term-media-player-btn:focus-visible {
    outline: 1px solid #4caf50;
    outline-offset: 2px;
}

#right-panel #terminal-menu #term-media-player .term-media-player-progress-wrap {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    height: 18px;
    margin-right: 6px;
    display: flex;
    align-items: center;
}

#right-panel #terminal-menu #term-media-player .term-media-player-seek {
    position: relative;
    z-index: 2;
    width: 100%;
    margin: 0;
    height: 4px;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

#right-panel #terminal-menu #term-media-player .term-media-player-progress-fill {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    width: 0;
    background: linear-gradient(90deg, rgba(76, 175, 80, 0.95), rgba(129, 199, 132, 0.95));
    pointer-events: none;
    border-radius: 999px;
}

#right-panel #terminal-menu #term-media-player .term-media-player-seek::-webkit-slider-runnable-track {
    height: 4px;
    background: rgba(76, 175, 80, 0.22);
    border-radius: 999px;
}

#right-panel #terminal-menu #term-media-player .term-media-player-seek::-webkit-slider-thumb {
    appearance: none;
    width: 10px;
    height: 10px;
    margin-top: -3px;
    border-radius: 50%;
    background: #81c784;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

#right-panel #terminal-menu #term-media-player .term-media-player-seek::-moz-range-track {
    height: 4px;
    background: rgba(76, 175, 80, 0.22);
    border-radius: 999px;
}

#right-panel #terminal-menu #term-media-player .term-media-player-seek::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #81c784;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

body.visual-mode-white #right-panel #terminal-menu #term-media-player .term-media-player-surface {
    background: rgba(255, 255, 255, 0.92);
}

body.visual-mode-white #right-panel #terminal-menu #term-media-player .term-media-player-transport {
    background: rgba(255, 255, 255, 0.55);
}

body.visual-mode-white #right-panel #terminal-menu #term-media-player .term-media-player-btn {
    background: rgba(255, 255, 255, 0.85);
    color: #2e7d32;
}

body.visual-mode-white #right-panel #terminal-menu #term-media-player .term-media-player-btn.is-playing {
    color: #fff;
    background: #43a047;
}

body.visual-mode-white #right-panel #terminal-menu #term-media-player .term-media-player-title {
    color: #1b5e20;
}

body.visual-mode-white #right-panel #terminal-menu #term-media-player .term-media-player-artist {
    color: #2e7d32;
}

body.visual-mode-white #right-panel #terminal-menu #term-media-player .term-media-player-tag {
    color: #1b5e20;
    background: rgba(255, 255, 255, 0.75);
}

/* Terminal menu banners: video strip + drawer (text slides out below, pushes menu down)
   z-index above .term-menu-section-hover-block (1 / 3 on hover) so drawer/bg/box-shadow/filter
   on GAMES/SOFTWARE never paints over banner strips above */
#right-panel #terminal-menu .term-menu-banner-block {
    pointer-events: auto;
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
    margin-bottom: 8px;
    border-radius: var(--menu-surface-radius);
    border: var(--menu-surface-border);
    background: var(--menu-surface-bg);
    box-shadow: var(--menu-surface-shadow);
    overflow: hidden;
}

/* Author `display: flex` above beats the UA `[hidden]` rule; keep hidden banners out of layout. */
#right-panel #terminal-menu .term-menu-banner-block[hidden] {
    display: none !important;
}

#right-panel #terminal-menu .term-menu-banner-block:hover,
#right-panel #terminal-menu .term-menu-banner-block:focus-within {
    z-index: 6;
}

@media (prefers-reduced-motion: reduce) {
    #right-panel #terminal-menu .term-menu-banner-drawer {
        transition: none;
    }

    #right-panel #terminal-menu .term-menu-banner-drawer-inner {
        transform: none;
        opacity: 1;
        transition: none;
    }
}

/* Both menu banners: 3/4 height of VAJBUJ source frame (926×324 → effective 926×243) */
#right-panel #terminal-menu .term-menu-banner-wrap {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 926 / 243;
    line-height: 0;
    overflow: hidden;
    cursor: pointer;
    outline: none;
}

#right-panel #terminal-menu .term-menu-banner-wrap:focus-visible {
    box-shadow: inset 0 0 0 1px rgba(76, 175, 80, 0.85);
}

/* Two-step banner launch: English CTA on hover/focus; stays visible when armed until second click */
#right-panel #terminal-menu .term-menu-banner-armed-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.5rem 0.45rem;
    pointer-events: none;
    background: transparent;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0s linear 0.22s;
}

#right-panel #terminal-menu .term-menu-banner-block:hover .term-menu-banner-armed-overlay,
#right-panel #terminal-menu .term-menu-banner-block:focus-within .term-menu-banner-armed-overlay,
#right-panel #terminal-menu .term-menu-banner-block--armed .term-menu-banner-armed-overlay {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.22s ease, visibility 0s linear 0s;
}

#right-panel #terminal-menu .term-menu-banner-armed-text {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: clamp(0.62rem, 2.4vw, 0.78rem);
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #b8ffc8;
    text-shadow: 0 0 6px rgba(76, 255, 120, 0.85);
}

#right-panel #terminal-menu .term-menu-banner-block--armed {
    box-shadow: var(--menu-surface-shadow), 0 0 0 1px rgba(129, 199, 132, 0.45);
}

@media (prefers-reduced-motion: reduce) {
    #right-panel #terminal-menu .term-menu-banner-armed-overlay,
    #right-panel #terminal-menu .term-menu-banner-block:hover .term-menu-banner-armed-overlay,
    #right-panel #terminal-menu .term-menu-banner-block:focus-within .term-menu-banner-armed-overlay,
    #right-panel #terminal-menu .term-menu-banner-block--armed .term-menu-banner-armed-overlay {
        transition-duration: 0.01ms;
    }
}

#right-panel #terminal-menu .term-menu-banner-drawer {
    flex: none;
    min-height: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--term-menu-hover-drawer-dur) var(--term-menu-hover-drawer-ease);
}

#right-panel #terminal-menu .term-menu-banner-block:hover .term-menu-banner-drawer,
#right-panel #terminal-menu .term-menu-banner-block:focus-within .term-menu-banner-drawer {
    /* peak = dokładna wysokość treści → max-height animuje się przez pełne 2s jak translateY/opacity */
    max-height: var(--term-menu-drawer-peak-h, var(--term-menu-hover-drawer-max-h));
}

#right-panel #terminal-menu .term-menu-banner-drawer-inner {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 3px;
    min-width: 0;
    box-sizing: border-box;
    padding: 8px 10px 10px;
    line-height: normal;
    pointer-events: none;
    border-top: 1px solid rgba(76, 175, 80, 0.22);
    background: rgba(0, 16, 10, 0.97);
    transform: translateY(-100%);
    opacity: 0;
    transition:
        transform var(--term-menu-hover-drawer-dur) var(--term-menu-hover-drawer-ease),
        opacity var(--term-menu-hover-drawer-dur) var(--term-menu-hover-drawer-ease);
}

#right-panel #terminal-menu .term-menu-banner-block:hover .term-menu-banner-drawer-inner,
#right-panel #terminal-menu .term-menu-banner-block:focus-within .term-menu-banner-drawer-inner {
    transform: translateY(0);
    opacity: 1;
}

#right-panel #terminal-menu .term-menu-banner-drawer-title {
    margin: 0;
    color: rgba(230, 245, 230, 0.96);
}

#right-panel #terminal-menu .term-menu-banner-hint {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    color: rgba(200, 230, 200, 0.96);
    white-space: normal;
    word-break: break-word;
}

#right-panel #terminal-menu .term-newskin-return-btn {
    display: none;
    margin: 0 0 8px;
    width: 100%;
    padding: 4px 6px;
    border: 1px solid rgba(129, 199, 132, 0.5);
    border-radius: 0;
    background: rgba(4, 22, 14, 0.95);
    color: #81c784;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    pointer-events: auto;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

#right-panel #terminal-menu.term-newskin-active .term-newskin-return-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#right-panel #terminal-menu .term-newskin-return-btn:hover,
#right-panel #terminal-menu .term-newskin-return-btn:focus-visible {
    border-color: rgba(184, 239, 186, 0.9);
    color: #d8ffc8;
    background: rgba(10, 38, 24, 0.98);
    outline: 1px solid rgba(184, 239, 186, 0.45);
    outline-offset: 0;
}

#right-panel #terminal-menu .term-menu-banner-block:has(#term-vajbuj.vajbuj-active) .term-menu-banner-drawer-inner {
    border-top-color: rgba(129, 199, 132, 0.45);
    background: rgba(12, 44, 24, 0.98);
}

#right-panel #terminal-menu .term-menu-banner-block:has(#term-vajbuj.vajbuj-active) .term-menu-banner-hint {
    color: #e8f5e9;
}

#right-panel #terminal-menu .term-menu-banner-block:has(#term-vajbuj.vajbuj-active) .term-menu-drawer-display-title {
    color: #d8ffc8;
    filter: saturate(1.85) brightness(1.18);
}

#right-panel #terminal-menu .term-menu-banner-block:has(#term-mysen-banner-hint.mysen-active) .term-menu-banner-drawer-inner {
    border-top-color: rgba(129, 199, 132, 0.45);
    background: rgba(12, 44, 24, 0.98);
}

#right-panel #terminal-menu .term-menu-banner-block:has(#term-mysen-banner-hint.mysen-active) .term-menu-banner-hint {
    color: #e8f5e9;
}

#right-panel #terminal-menu .term-menu-banner-block:has(#term-mysen-banner-hint.mysen-active) .term-menu-drawer-display-title {
    color: #d8ffc8;
    filter: saturate(1.85) brightness(1.18);
}

#right-panel #terminal-menu .term-menu-banner-block:has(#term-newskin-banner-hint.newskin-active) .term-menu-banner-drawer-inner {
    border-top-color: rgba(129, 199, 132, 0.45);
    background: rgba(12, 44, 24, 0.98);
}

#right-panel #terminal-menu .term-menu-banner-block:has(#term-newskin-banner-hint.newskin-active) .term-menu-banner-hint {
    color: #e8f5e9;
}

#right-panel #terminal-menu .term-menu-banner-block:has(#term-newskin-banner-hint.newskin-active) .term-menu-drawer-display-title {
    color: #d8ffc8;
    filter: saturate(1.85) brightness(1.18);
}

/* Shared neon Orbitron headline: banner drawers + section hover drawers */
#right-panel #terminal-menu .term-menu-drawer-display-title {
    display: block;
    margin: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    padding: 0 0.08em 2px 0;
    font-family: 'Orbitron', system-ui, sans-serif;
    font-weight: 400;
    font-size: clamp(0.6rem, 3.6vw, 1rem);
    line-height: 1.05;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #c8ff9a;
    filter: saturate(1.65) brightness(1.3);

}

@media (prefers-reduced-motion: no-preference) {
    @keyframes term-menu-drawer-display-title-pulse {
        0%,
        100% {
            filter: saturate(1.65) brightness(1.12);
        }
        50% {
            filter: saturate(1.85) brightness(1.2);
        }
    }

    #right-panel #terminal-menu .term-menu-drawer-display-title {
        animation: term-menu-drawer-display-title-pulse 2.8s ease-in-out infinite;
    }

    #right-panel #terminal-menu .term-menu-banner-block:has(#term-newskin-banner-hint.newskin-active) .term-menu-drawer-display-title {
        animation-duration: 2.2s;
    }
}

@media (prefers-reduced-motion: reduce) {
    #right-panel #terminal-menu .term-menu-drawer-display-title {
        animation: none;
    }
}

#right-panel #terminal-menu .term-menu-banner-drawer-inner.newskin-menu-banner-drawer-hint {
    justify-content: flex-start;
    padding: 0;
    gap: 0;
}

#right-panel #terminal-menu .term-menu-banner-drawer-inner.newskin-menu-banner-drawer-hint .term-menu-drawer-display-title {
    padding: 8px 10px 4px;
    margin: 0;
}

#right-panel #terminal-menu .term-menu-banner-drawer-inner.newskin-menu-banner-drawer-hint .term-menu-banner-hint {
    padding: 0 10px 10px;
    margin: 0;
}

/* MYSEN menu banner: poster covers video until hover/focus; overlay copy only on hover */
#right-panel #terminal-menu .term-menu-banner-media {
    position: absolute;
    inset: 0;
    line-height: 0;
    overflow: hidden;
}

#right-panel #terminal-menu .term-menu-banner-poster {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
    /* Match VAJBUJ banner idle: poster sits on top of video, so dim poster (not only the hidden clip) */
    filter: brightness(calc(1 / 3));
    transition: opacity 0.26s ease, filter 0.28s ease;
}

#right-panel #terminal-menu .term-menu-banner-block:has(.term-menu-banner-mysen-wrap):hover .term-menu-banner-poster,
#right-panel #terminal-menu .term-menu-banner-block:has(.term-menu-banner-mysen-wrap):focus-within .term-menu-banner-poster {
    opacity: 0;
}

#right-panel #terminal-menu .term-menu-banner-hint--deco {
    line-height: 1;
    font-size: 14px;
    letter-spacing: 0.02em;
}

@media (prefers-reduced-motion: reduce) {
    #right-panel #terminal-menu .term-menu-banner-poster {
        transition: none;
    }
}

#right-panel #terminal-menu .term-menu-banner-video {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: brightness(calc(1 / 3));
    transition: filter 0.28s ease;
}

#right-panel #terminal-menu .term-menu-banner-block:hover .term-menu-banner-wrap:not(.term-menu-banner-wrap--newskin) .term-menu-banner-video,
#right-panel #terminal-menu .term-menu-banner-block:focus-within .term-menu-banner-wrap:not(.term-menu-banner-wrap--newskin) .term-menu-banner-video {
    filter: brightness(1);
}

/* NEWSKIN hero strip: full-frame; brighter when strip hovered */
#right-panel #terminal-menu video#newskin-menu-banner-video {
    z-index: 1;
    object-position: 50% 50%;
    filter: brightness(1.22) contrast(1.08) saturate(1.38);
    transition: filter 0.28s ease;
}

#right-panel #terminal-menu .term-menu-banner-wrap--newskin:hover video#newskin-menu-banner-video,
#right-panel #terminal-menu .term-menu-banner-wrap--newskin:focus-within video#newskin-menu-banner-video {
    filter: brightness(1.28) contrast(1.06) saturate(1.48);
}

@media (prefers-reduced-motion: reduce) {
    #right-panel #terminal-menu video#newskin-menu-banner-video {
        transition: none;
    }
}

/* Lower terminal blocks: same hover drawer pattern as video banners */
#right-panel #terminal-menu .term-menu-section-hover-block {
    pointer-events: auto;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
    border-radius: var(--menu-surface-radius);
    border: var(--menu-surface-border);
    background: var(--menu-surface-bg);
    box-shadow: var(--menu-surface-shadow);
    overflow: hidden;
    outline: none;
}

#right-panel #terminal-menu .term-menu-section-hover-block:hover,
#right-panel #terminal-menu .term-menu-section-hover-block:focus-within {
    z-index: 3;
}

#right-panel #terminal-menu .term-menu-section-hover-block:focus-visible {
    box-shadow: var(--menu-surface-shadow), inset 0 0 0 1px rgba(76, 175, 80, 0.85);
}

@media (prefers-reduced-motion: reduce) {
    #right-panel #terminal-menu .term-menu-section-drawer {
        transition: none;
    }

    #right-panel #terminal-menu .term-menu-section-drawer-inner {
        transform: none;
        opacity: 1;
        transition: none;
    }
}

#right-panel #terminal-menu .term-menu-section-hover-block:last-child {
    margin-bottom: 0;
}

#right-panel #terminal-menu .term-menu-section-hover-block .menu-section {
    margin-bottom: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

#right-panel #terminal-menu .term-menu-section-drawer {
    flex: none;
    min-height: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--term-menu-hover-drawer-dur) var(--term-menu-hover-drawer-ease);
}

#right-panel #terminal-menu .term-menu-section-hover-block:hover .term-menu-section-drawer,
#right-panel #terminal-menu .term-menu-section-hover-block:focus-within .term-menu-section-drawer {
    max-height: var(--term-menu-drawer-peak-h, var(--term-menu-hover-drawer-max-h));
}

#right-panel #terminal-menu .term-menu-section-drawer-inner {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 3px;
    padding: 8px 10px 10px;
    line-height: normal;
    pointer-events: none;
    border-top: 1px solid rgba(76, 175, 80, 0.22);
    background: rgba(0, 16, 10, 0.97);
    transform: translateY(-100%);
    opacity: 0;
    transition:
        transform var(--term-menu-hover-drawer-dur) var(--term-menu-hover-drawer-ease),
        opacity var(--term-menu-hover-drawer-dur) var(--term-menu-hover-drawer-ease);
}

#right-panel #terminal-menu .term-menu-section-hover-block:hover .term-menu-section-drawer-inner,
#right-panel #terminal-menu .term-menu-section-hover-block:focus-within .term-menu-section-drawer-inner {
    transform: translateY(0);
    opacity: 1;
}

#right-panel #terminal-menu .term-menu-section-drawer-hint {
    white-space: pre-line;
}

#right-panel #terminal-menu .menu-section {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border-radius: var(--menu-surface-radius);
    border: var(--menu-surface-border);
    background: var(--menu-surface-bg);
    box-shadow: var(--menu-surface-shadow);
    margin-bottom: 8px;
}

#right-panel #terminal-menu .menu-section:last-child {
    margin-bottom: 0;
}

.interactive-term-line {
    color: #4CAF50;
    /* Terminal Green */
    cursor: pointer;
    transition: color 0.2s, text-shadow 0.2s;
}

.interactive-term-line:hover {
    color: #81C784;
    text-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
    text-decoration: underline;
}

#term-anim-portfolio.portfolio-active,
#term-mysen.term-menu-banner-mysen-wrap.mysen-active {
    box-shadow: inset 0 0 0 1px rgba(76, 175, 80, 0.5);
    border-radius: var(--menu-surface-radius);
}

/* Shared: Glitch Lab & GENIMG modals */
.portfolio-modal-box {
    position: relative;
    z-index: 1;
    background: #111;
    border: 1px solid #4CAF50;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.2);
    border-radius: 6px;
}

.portfolio-modal-title {
    margin: 0 0 20px 0;
    font-size: 22px;
    color: #4CAF50;
    border-bottom: 1px solid rgba(76, 175, 80, 0.3);
    padding-bottom: 8px;
}

/* Glitch Lab Modal */
#glitch-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    font-family: 'Courier New', monospace;
}

#glitch-modal.hidden {
    display: none;
}

#glitch-backdrop {
    position: absolute;
    inset: 0;
    cursor: pointer;
}

#glitch-content {
    width: 90vw;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    scrollbar-width: thin;
    scrollbar-color: #4CAF50 #111;
}

#glitch-content .close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
}

.glitch-lang-row {
    padding: 0 0 12px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(76, 175, 80, 0.3);
}

#lang-toggle {
    color: white;
    font-weight: bold;
    cursor: default;
}

.lang-opt {
    color: #555;
    cursor: pointer;
    transition: color 0.3s;
}

.lang-opt.active {
    color: #4CAF50;
}

.lang-opt:hover {
    color: white;
}

#glitch-body {
    padding: 0;
}

#glitch-img-container {
    width: 100%;
    max-height: 320px;
    overflow: hidden;
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 4px;
    background: #000;
    margin-bottom: 24px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#glitch-img-container:hover {
    border-color: #4CAF50;
    box-shadow: 0 0 12px rgba(76, 175, 80, 0.3);
}

.glitch-hero-img {
    width: 100%;
    height: 100%;
    max-height: 320px;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s;
}

#glitch-img-container:hover .glitch-hero-img {
    opacity: 0.92;
}

#glitch-content::-webkit-scrollbar {
    width: 10px;
}

#glitch-content::-webkit-scrollbar-track {
    background: #111;
}

#glitch-content::-webkit-scrollbar-thumb {
    background: #4CAF50;
    border: 1px solid #111;
}

#glitch-content::-webkit-scrollbar-thumb:hover {
    background: #66BB6A;
}

/* lyricBlow Modal */
#lyricblow-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    font-family: 'Courier New', monospace;
}

#lyricblow-modal.hidden {
    display: none;
}

#lyricblow-backdrop {
    position: absolute;
    inset: 0;
    cursor: pointer;
}

#lyricblow-content {
    width: 90vw;
    max-width: 980px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    scrollbar-width: thin;
    scrollbar-color: #4CAF50 #111;
}

#lyricblow-content .close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
}

#lyricblow-lang-toggle {
    color: white;
    font-weight: bold;
    cursor: default;
}

#lyricblow-body {
    padding: 0;
}

.lyricblow-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(76, 175, 80, 0.3);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.lyricblow-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid #2e7d32;
    background: rgba(20, 44, 20, 0.72);
    color: #a5d6a7;
    text-decoration: none;
    font-size: 12px;
    letter-spacing: 0.04em;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.lyricblow-cta-btn:hover {
    background: rgba(45, 93, 48, 0.8);
    border-color: #66bb6a;
    color: #e8f5e9;
}

#lyricblow-content::-webkit-scrollbar {
    width: 10px;
}

#lyricblow-content::-webkit-scrollbar-track {
    background: #111;
}

#lyricblow-content::-webkit-scrollbar-thumb {
    background: #4CAF50;
    border: 1px solid #111;
}

#lyricblow-content::-webkit-scrollbar-thumb:hover {
    background: #66BB6A;
}

/* Image Viewer (Lightbox) */
#image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    cursor: zoom-out;
}

#image-viewer.hidden {
    display: none;
}

#image-viewer img {
    max-width: 95%;
    max-height: 95%;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
}

/* Floating Spotify player after natural end of VAJBUJ / MYSEN */
.music-showcase-spotify-widget {
    position: fixed;
    right: 12px;
    bottom: 12px;
    z-index: 2850;
    font-family: 'Courier New', monospace;
    max-width: calc(100vw - 24px);
    pointer-events: auto;
}

.music-showcase-spotify-widget.hidden {
    display: none;
}

.music-showcase-spotify-widget-panel {
    position: relative;
    width: min(360px, calc(100vw - 24px));
    padding: 10px 12px 12px;
    background: rgba(10, 14, 10, 0.94);
    border: var(--menu-surface-border);
    border-radius: 8px;
    box-shadow: var(--menu-surface-shadow), 0 12px 40px rgba(0, 0, 0, 0.55);
}

.music-showcase-spotify-widget-title {
    margin: 0 32px 8px 0;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #81c784;
    line-height: 1.25;
}

.music-showcase-spotify-widget-panel .close-btn {
    position: absolute;
    top: 6px;
    right: 8px;
    z-index: 1;
}

.music-showcase-spotify-iframe-wrap {
    border-radius: 8px;
    overflow: hidden;
    line-height: 0;
}

.music-showcase-spotify-iframe-wrap iframe {
    display: block;
    width: 100%;
    height: 152px;
    border: 0;
}

@media (max-width: 480px) {
    .music-showcase-spotify-widget {
        right: 8px;
        bottom: 8px;
        left: 8px;
        max-width: none;
    }

    .music-showcase-spotify-widget-panel {
        width: auto;
    }
}

/* Fullscreen YouTube modal after natural end of VAJBUJ / MYSEN */
.music-showcase-youtube-modal {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2860;
    font-family: 'Courier New', monospace;
    pointer-events: auto;
}

.music-showcase-youtube-modal.hidden {
    display: none;
}

.music-showcase-youtube-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    cursor: pointer;
}

.music-showcase-youtube-content {
    position: relative;
    z-index: 1;
    width: min(92vw, 880px);
    max-height: 92vh;
    overflow: auto;
    padding: 18px 18px 22px;
    background: rgba(10, 14, 10, 0.96);
    border: var(--menu-surface-border);
    border-radius: 8px;
    box-shadow: var(--menu-surface-shadow), 0 16px 48px rgba(0, 0, 0, 0.6);
}

.music-showcase-youtube-content .close-btn {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 2;
}

.music-showcase-youtube-modal-title {
    margin: 0 40px 10px 0;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #81c784;
    line-height: 1.3;
}

.music-showcase-youtube-attribution {
    margin: 0 0 14px;
    font-size: 0.8rem;
    line-height: 1.5;
    color: rgba(220, 230, 220, 0.92);
    max-width: 62ch;
}

.music-showcase-youtube-aspect {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid rgba(76, 175, 80, 0.25);
}

.music-showcase-youtube-aspect iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 480px) {
    .music-showcase-youtube-content {
        width: calc(100vw - 16px);
        padding: 14px 12px 16px;
    }

    .music-showcase-youtube-attribution {
        font-size: 0.75rem;
    }
}

#glitch-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(76, 175, 80, 0.25);
    text-align: center;
}

#glitch-repo-btn {
    background: transparent;
    border: 1px solid #4CAF50;
    color: #4CAF50;
    padding: 10px 20px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-block;
}

#glitch-repo-btn:hover {
    background: rgba(76, 175, 80, 0.1);
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
    color: white;
}

/* GENIMG Modal */
#genimg-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    font-family: 'Courier New', monospace;
}

#genimg-modal.hidden {
    display: none;
}

#genimg-backdrop {
    position: absolute;
    inset: 0;
    cursor: pointer;
}

#genimg-content {
    width: 90vw;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    scrollbar-width: thin;
    scrollbar-color: #4CAF50 #111;
}

#genimg-content .close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
}

.genimg-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.genimg-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.genimg-thumb:hover {
    border-color: #4CAF50;
    box-shadow: 0 0 12px rgba(76, 175, 80, 0.3);
}

.genimg-md {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    line-height: 1.6;
}

.genimg-md h1 {
    color: #4CAF50;
    font-size: 20px;
    margin: 0 0 16px 0;
    border-bottom: 1px solid rgba(76, 175, 80, 0.3);
    padding-bottom: 8px;
}

.genimg-md h2 {
    color: #81C784;
    font-size: 17px;
    margin: 18px 0 10px 0;
}

.genimg-md h3 {
    color: #4CAF50;
    font-size: 18px;
    margin: 0 0 12px 0;
    border-bottom: 1px solid rgba(76, 175, 80, 0.3);
    padding-bottom: 8px;
}

.genimg-md h4 {
    color: #81C784;
    font-size: 15px;
    margin: 16px 0 8px 0;
}

.genimg-md p {
    margin: 0 0 10px 0;
}

.genimg-md ul {
    margin: 0 0 12px 0;
    padding-left: 22px;
}

.genimg-md li {
    margin-bottom: 6px;
}

.genimg-md code {
    background: rgba(76, 175, 80, 0.15);
    color: #81C784;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
}

/* Portfolio Vimeo Modal */
#portfolio-vimeo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2200;
    font-family: 'Courier New', monospace;
}

#portfolio-vimeo-modal.hidden {
    display: none;
}

#portfolio-vimeo-backdrop {
    position: absolute;
    inset: 0;
    cursor: pointer;
}

#portfolio-vimeo-content {
    position: relative;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.25);
    width: 90vw;
    max-width: 960px;
    max-height: 90vh;
    padding: 18px 18px 24px;
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.6);
    border-radius: 8px;
}

#portfolio-vimeo-content .close-btn {
    position: absolute;
    top: 10px;
    right: 12px;
}

.portfolio-vimeo-aspect {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    overflow: hidden;
    border-radius: 4px;
}

.portfolio-vimeo-aspect iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* /newskin + Pushka Studio — jak sekcja terminal menu (#right-panel .menu-section), wyśrodkowana; WebGL widać przez scrim */
#newskin-modal,
#pushka-modal {
    position: fixed;
    inset: 0;
    z-index: 2250;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    color: var(--menu-text-color);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 25px;
}

#newskin-modal.hidden,
#pushka-modal.hidden {
    display: none;
}

#newskin-modal.newskin-modal--minimized,
#pushka-modal.newskin-modal--minimized {
    align-items: flex-start;
}

.newskin-modal-scrim {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.28) 0%, rgba(0, 0, 0, 0.62) 100%);
    pointer-events: auto;
    cursor: pointer;
}

#newskin-modal.newskin-modal--minimized .newskin-modal-scrim,
#pushka-modal.newskin-modal--minimized .newskin-modal-scrim {
    opacity: 0;
    pointer-events: none;
    cursor: default;
}

/* Ta sama skórka co #right-panel #terminal-menu .menu-section */
.newskin-modal-menu-section {
    position: relative;
    z-index: 2;
    width: 280px;
    max-width: calc(100vw - 40px);
    max-height: min(78vh, 1200px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
    margin: 0;
    border-radius: var(--menu-surface-radius);
    border: var(--menu-surface-border);
    background: var(--menu-surface-bg);
    box-shadow: var(--menu-surface-shadow);
    pointer-events: auto;
}

/* /newskin + Pushka: wide panel (16∶9 scales with width). */
#newskin-modal .newskin-modal-menu-section,
#pushka-modal .newskin-modal-menu-section {
    width: min(960px, calc(100vw - 48px));
    max-width: min(960px, calc(100vw - 48px));
}

.newskin-modal-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 22px;
}

.newskin-modal-title-text {
    margin: 0;
    flex: 1;
    min-width: 0;
    letter-spacing: 0.04em;
}

.newskin-modal-header-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.newskin-modal-icon-btn {
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid rgba(76, 175, 80, 0.35);
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.4);
    color: rgba(129, 199, 132, 0.9);
    font-family: 'Courier New', monospace;
    font-size: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.newskin-modal-icon-btn:hover {
    color: #9CCC65;
    border-color: rgba(129, 199, 132, 0.75);
    background: rgba(0, 0, 0, 0.62);
}

.newskin-modal-icon {
    display: block;
    transition: transform 0.2s ease;
}

#newskin-modal.newskin-modal--minimized #newskin-modal-minimize .newskin-modal-icon,
#pushka-modal.newskin-modal--minimized #pushka-modal-minimize .newskin-modal-icon {
    transform: rotate(180deg);
}

.newskin-modal-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: auto;
    min-height: 0;
}

#newskin-modal.newskin-modal--minimized .newskin-modal-body,
#pushka-modal.newskin-modal--minimized .newskin-modal-body {
    display: none;
}

.newskin-modal-caption {
    margin: 0;
    text-align: center;
    line-height: 1.45;
    white-space: pre-line;
}

body.newskin-modal-open,
body.pushka-modal-open {
    overflow: hidden;
}

@media (max-width: 400px) {
    .newskin-modal-menu-section {
        width: min(280px, calc(100vw - 24px));
    }

    #newskin-modal .newskin-modal-menu-section,
    #pushka-modal .newskin-modal-menu-section {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
    }
}

/* Portfolio Detail Modal (per-animation) */
.portfolio-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2150;
    font-family: 'Courier New', monospace;
}

.portfolio-detail-modal.hidden {
    display: none;
}

.portfolio-detail-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    cursor: pointer;
}

.portfolio-detail-content {
    position: relative;
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 90vw;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px 24px 32px;
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.6);
    border-radius: 8px;
}

.portfolio-detail-title {
    margin: 0 0 12px 0;
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.95);
}

.portfolio-detail-description {
    margin: 0 0 20px 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
}

.portfolio-detail-gallery {
    margin-bottom: 20px;
}

.portfolio-detail-typography {
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.portfolio-detail-content .close-btn {
    position: absolute;
    top: 10px;
    right: 12px;
}

.portfolio-detail-content .button-primary {
    margin-top: 8px;
}

.genimg-md hr {
    border: none;
    border-top: 1px solid rgba(76, 175, 80, 0.25);
    margin: 20px 0;
}

#genimg-content::-webkit-scrollbar {
    width: 10px;
}

#genimg-content::-webkit-scrollbar-track {
    background: #111;
}

#genimg-content::-webkit-scrollbar-thumb {
    background: #4CAF50;
    border: 1px solid #111;
}

#genimg-content::-webkit-scrollbar-thumb:hover {
    background: #66BB6A;
}

/* SCNDBREJN Modal */
#scndbrejn-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    font-family: 'Courier New', monospace;
}

#scndbrejn-modal.hidden {
    display: none;
}

#scndbrejn-backdrop {
    position: absolute;
    inset: 0;
    cursor: pointer;
}

#scndbrejn-content {
    width: 90vw;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    scrollbar-width: thin;
    scrollbar-color: #4CAF50 #111;
}

#scndbrejn-content .close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
}

#scndbrejn-content::-webkit-scrollbar {
    width: 10px;
}

#scndbrejn-content::-webkit-scrollbar-track {
    background: #111;
}

#scndbrejn-content::-webkit-scrollbar-thumb {
    background: #4CAF50;
    border: 1px solid #111;
}

#scndbrejn-content::-webkit-scrollbar-thumb:hover {
    background: #66BB6A;
}

/* TTShub Modal — mirrors Glitch Lab / SCNDBREJN modal chrome */
#ttshub-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    font-family: 'Courier New', monospace;
}

#ttshub-modal.hidden {
    display: none;
}

#ttshub-backdrop {
    position: absolute;
    inset: 0;
    cursor: pointer;
}

#ttshub-content {
    width: 90vw;
    max-width: 760px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    scrollbar-width: thin;
    scrollbar-color: #4CAF50 #111;
}

#ttshub-content .close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
}

#ttshub-img-container {
    width: 100%;
    max-height: 360px;
    overflow: hidden;
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 4px;
    background: #0a0a12;
    margin-bottom: 20px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#ttshub-img-container:hover {
    border-color: #4CAF50;
    box-shadow: 0 0 12px rgba(76, 175, 80, 0.3);
}

.ttshub-hero-img {
    width: 100%;
    max-height: 360px;
    object-fit: contain;
    display: block;
    transition: opacity 0.2s;
}

#ttshub-img-container:hover .ttshub-hero-img {
    opacity: 0.92;
}

.ttshub-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(76, 175, 80, 0.3);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ttshub-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid #2e7d32;
    background: rgba(20, 44, 20, 0.72);
    color: #a5d6a7;
    text-decoration: none;
    font-size: 12px;
    letter-spacing: 0.04em;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ttshub-cta-btn:hover,
.ttshub-cta-btn:focus-visible {
    background: rgba(45, 93, 48, 0.8);
    border-color: #66bb6a;
    color: #e8f5e9;
    outline: 1px solid rgba(76, 175, 80, 0.85);
}

#ttshub-content::-webkit-scrollbar {
    width: 10px;
}

#ttshub-content::-webkit-scrollbar-track {
    background: #111;
}

#ttshub-content::-webkit-scrollbar-thumb {
    background: #4CAF50;
    border: 1px solid #111;
}

#ttshub-content::-webkit-scrollbar-thumb:hover {
    background: #66BB6A;
}

/* Inline custom text controls */
.inline-text-regen {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.inline-text-regen-input {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    text-transform: uppercase;
    box-sizing: border-box;
    caret-color: #4CAF50;
}

.inline-text-regen-input:focus {
    outline: none;
    border: none;
    box-shadow: none;
}

.inline-text-regen-input.is-invalid {
    color: #ff8f8f;
    caret-color: #ff8f8f;
}

.inline-text-regen-btn {
    width: auto !important;
    margin-top: 0 !important;
    padding-inline: 12px;
}

/* TOPKEK command console (bottom of #right-panel) */
.topkek-terminal-shell {
    position: fixed;
    right: 25px;
    bottom: 25px;
    width: 560px;
    box-sizing: border-box;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--menu-text-color);
    background: var(--menu-surface-bg);
    border: var(--menu-surface-border);
    border-radius: var(--menu-surface-radius);
    padding: 8px;
    box-shadow: var(--menu-surface-shadow);
    /* Same stacking band as #right-panel so the console stays above the 3D view */
    z-index: 800;
    pointer-events: auto;
    transform: translate3d(0, 0, 0);
    transition:
        width 0.25s ease,
        max-height 0.25s ease,
        transform 0.25s ease,
        right 0.25s ease,
        bottom 0.25s ease,
        box-shadow 0.45s var(--music-ui-reveal-ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.topkek-terminal-shell-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--menu-label-color);
    margin-bottom: 6px;
}

.topkek-terminal-shell-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.topkek-terminal-shell-title-text {
    display: inline-block;
}

.topkek-terminal-shell-controls {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    gap: 4px;
}

.topkek-terminal-shell-control-btn {
    font-family: inherit;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #81C784;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(76, 175, 80, 0.45);
    border-radius: 2px;
    padding: 2px 6px;
    cursor: pointer;
}

.topkek-terminal-shell-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    min-height: 26px;
    padding: 4px;
    text-transform: none;
    letter-spacing: normal;
}

.topkek-terminal-shell-icon-btn .topkek-terminal-icon {
    display: block;
    flex-shrink: 0;
}

.topkek-terminal-shell-body {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 0;
}

.topkek-terminal-shell.topkek-terminal-shell--collapsed .topkek-terminal-shell-body {
    display: none;
}

/* FX dev — menubar + [ Active | editor ], top overlay */
.topkek-fx-dev-shell {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 125;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    box-sizing: border-box;
    max-width: min(920px, calc(100vw - 16px));
    max-height: min(58vh, 480px);
    pointer-events: auto;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    line-height: 1.3;
    color: var(--menu-text-color);
    visibility: visible;
    transform-origin: 50% 0%;
    filter: blur(0);
    transition:
        opacity var(--music-ui-reveal-dur, 0.48s) var(--music-ui-reveal-ease, cubic-bezier(0.22, 1, 0.36, 1)),
        transform var(--music-ui-reveal-dur, 0.48s) var(--music-ui-reveal-ease, cubic-bezier(0.22, 1, 0.36, 1)),
        filter 0.32s ease,
        visibility 0s linear;
}

.topkek-fx-dev-shell--minimized {
    max-height: none;
}

.topkek-fx-dev-shell--minimized .topkek-fx-dev-body {
    display: none;
}

.topkek-fx-dev-shell[hidden] {
    display: none !important;
}

.topkek-fx-dev-menubar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px 8px;
    padding: 4px 8px;
    margin-bottom: 6px;
    border-radius: var(--menu-surface-radius);
    border: var(--menu-surface-border);
    background: var(--menu-surface-bg);
    box-shadow: var(--menu-surface-shadow);
}

.topkek-fx-dev-menubar-title {
    flex: 1 1 auto;
    min-width: 4rem;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--menu-label-color);
}

.topkek-fx-dev-menubar-btn {
    font-family: inherit;
    font-size: 10px;
    line-height: 1.2;
    padding: 3px 8px;
    color: #81c784;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(76, 175, 80, 0.45);
    border-radius: var(--menu-surface-radius);
    cursor: pointer;
}

.topkek-fx-dev-menubar-btn:hover {
    color: #b8efba;
    border-color: rgba(129, 199, 132, 0.85);
}

.topkek-fx-dev-body {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 6px;
    flex: 1;
    min-height: 0;
}

.topkek-fx-dev-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(129, 199, 132, 0.65) rgba(0, 0, 0, 0.35);
}

.topkek-fx-dev-scroll::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.topkek-fx-dev-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 4px;
}

.topkek-fx-dev-scroll::-webkit-scrollbar-thumb {
    background: rgba(76, 175, 80, 0.55);
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.25);
}

.topkek-fx-dev-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(129, 199, 132, 0.75);
}

@media (max-width: 640px) {
    .topkek-fx-dev-body {
        flex-direction: column;
    }

    .topkek-fx-dev-shell {
        max-height: min(85vh, 640px);
        overflow-y: auto;
    }

    .topkek-fx-dev-active {
        flex: 0 0 auto;
        max-height: 40vh;
    }

    .topkek-fx-dev-param-line {
        grid-template-columns: 1fr;
    }
}

.topkek-fx-dev-active {
    flex: 0 0 min(200px, 28vw);
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 8px;
    border-radius: var(--menu-surface-radius);
    border: var(--menu-surface-border);
    background: var(--menu-surface-bg);
    box-shadow: var(--menu-surface-shadow);
    overflow: hidden;
}

.topkek-fx-dev-active-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--menu-label-color);
    flex-shrink: 0;
}

.topkek-fx-dev-active-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.topkek-fx-dev-active-empty {
    opacity: 0.5;
    padding: 4px 0;
}

.topkek-fx-dev-active-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 6px;
    border: 1px solid rgba(76, 175, 80, 0.35);
    border-radius: var(--menu-surface-radius);
    background: rgba(0, 0, 0, 0.25);
}

.topkek-fx-dev-active-meta {
    font-size: 9px;
    color: #81c784;
    word-break: break-all;
    line-height: 1.2;
}

.topkek-fx-dev-active-sub {
    font-size: 8px;
    color: var(--menu-label-color);
    opacity: 0.9;
}

.topkek-fx-dev-active-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.topkek-fx-dev-active-params-toggle {
    min-width: 24px;
    padding: 2px 4px;
}

.topkek-fx-dev-active-reorder {
    min-width: 22px;
    padding: 2px 4px;
}

.topkek-fx-dev-mini-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.topkek-fx-dev-mini-btn:disabled:hover {
    color: #81c784;
    border-color: rgba(76, 175, 80, 0.45);
}

.topkek-fx-dev-active-params {
    margin-top: 4px;
    padding: 4px 6px;
    border-radius: var(--menu-surface-radius);
    border: 1px solid rgba(76, 175, 80, 0.25);
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 9rem;
    overflow-y: auto;
}

/* Author `display: flex` wins over UA [hidden]; force collapse when toggled. */
.topkek-fx-dev-active-params[hidden] {
    display: none !important;
}

.topkek-fx-dev-active-params-empty {
    font-size: 8px;
    color: var(--menu-label-color);
    opacity: 0.75;
    font-style: italic;
}

.topkek-fx-dev-active-param-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 4px 6px;
    align-items: baseline;
    font-size: 8px;
    line-height: 1.25;
}

.topkek-fx-dev-active-param-key {
    color: var(--menu-label-color);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    word-break: break-word;
}

.topkek-fx-dev-active-param-val {
    color: #a5d6a7;
    word-break: break-word;
    font-family: 'Courier New', monospace;
}

.topkek-fx-dev-mini-btn {
    font-family: inherit;
    font-size: 10px;
    line-height: 1;
    min-width: 22px;
    padding: 2px 6px;
    color: #81c784;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(76, 175, 80, 0.45);
    border-radius: var(--menu-surface-radius);
    cursor: pointer;
}

.topkek-fx-dev-mini-btn:hover {
    color: #b8efba;
    border-color: rgba(129, 199, 132, 0.85);
}

.topkek-fx-dev-add {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 4px;
    border-top: 1px solid rgba(76, 175, 80, 0.2);
}

.topkek-fx-dev-add-label {
    font-size: 9px;
    text-transform: uppercase;
    color: var(--menu-label-color);
}

.topkek-fx-dev-select {
    width: 100%;
    font-size: 10px;
    padding: 2px 4px;
}

.topkek-fx-dev-add-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
}

.topkek-fx-dev-add-row .topkek-fx-dev-select {
    flex: 1 1 min(7rem, 42%);
    min-width: 0;
}

.topkek-fx-dev-active .topkek-fx-dev-add-loop.mode-btn {
    flex: 0 0 auto;
    font-size: 10px;
    padding: 0.12rem 0.4rem;
}

.topkek-fx-dev-panel {
    flex: 1 1 0;
    min-width: 0;
    box-sizing: border-box;
    padding: 6px 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-radius: var(--menu-surface-radius);
    border: var(--menu-surface-border);
    background: var(--menu-surface-bg);
    box-shadow: var(--menu-surface-shadow);
    color: var(--menu-text-color);
    font-family: 'Courier New', monospace;
    font-size: 10px;
    line-height: 1.3;
}

.topkek-fx-dev-close {
    flex-shrink: 0;
    margin-left: auto;
    font-family: inherit;
    font-size: 16px;
    line-height: 1;
    width: 26px;
    height: 26px;
    padding: 0;
    color: #81c784;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(76, 175, 80, 0.45);
    border-radius: var(--menu-surface-radius);
    cursor: pointer;
}

.topkek-fx-dev-close:hover {
    color: #b8efba;
    border-color: rgba(129, 199, 132, 0.85);
}

.topkek-fx-dev-close.topkek-fx-dev-close--armed {
    color: #ffcdd2;
    background: rgba(183, 28, 28, 0.45);
    border-color: rgba(239, 83, 80, 0.9);
}

.topkek-fx-dev-close.topkek-fx-dev-close--armed:hover {
    color: #ffebee;
    border-color: #ef5350;
}

.topkek-fx-dev-global {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.topkek-fx-dev-label-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 10px;
    color: var(--menu-label-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.topkek-fx-dev-presets-compact {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 4px 6px;
    align-items: start;
    flex-shrink: 0;
}

.topkek-fx-dev-file-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    min-width: 0;
}

.topkek-fx-dev-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.topkek-fx-dev-choose-file {
    flex: none;
    width: 100%;
    max-width: 7.5rem;
}

.topkek-fx-dev-paste {
    width: 100%;
    box-sizing: border-box;
    min-height: 2.5em;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    padding: 3px 6px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(76, 175, 80, 0.45);
    border-radius: var(--menu-surface-radius);
    color: #81C784;
    resize: vertical;
}

.topkek-fx-dev-effects {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

.topkek-fx-dev-effect {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    border-radius: var(--menu-surface-radius);
    border: var(--menu-surface-border);
    background: rgba(0, 0, 0, 0.18);
    box-shadow: none;
}

.topkek-fx-dev-effect-title {
    margin: 0 0 2px;
    font-size: 11px;
    font-weight: 600;
    color: var(--menu-label-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.topkek-fx-dev-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 4px;
}

.topkek-fx-dev-export-preset {
    align-self: flex-start;
    margin-top: 2px;
    flex: 0 0 auto;
}

.topkek-fx-dev-param-slot .topkek-fx-dev-input {
    min-width: 0;
    width: 100%;
}

/* Przyciski jak w prawym panelu (#right-panel .mode-btn), bez zmiany globalnego .mode-btn */
.topkek-fx-dev-panel .topkek-fx-dev-btn.mode-btn {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    padding: 0.15rem 0.45rem;
    margin: 0;
    text-align: center;
    width: auto;
    min-width: 0;
    flex: 1 1 30%;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(76, 175, 80, 0.45);
    border-radius: var(--menu-surface-radius);
    color: #4CAF50;
    cursor: pointer;
    transition: color 0.2s, text-shadow 0.2s, border-color 0.2s;
    text-transform: none;
    letter-spacing: normal;
}

.topkek-fx-dev-panel .topkek-fx-dev-btn.mode-btn:hover {
    color: #81C784;
    text-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
    border-color: rgba(129, 199, 132, 0.85);
}

.topkek-fx-dev-params {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.topkek-fx-dev-param-line {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px 6px;
    align-items: stretch;
}

.topkek-fx-dev-param-slot {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr) minmax(2.5rem, 0.95fr);
    gap: 3px 4px;
    align-items: center;
    min-width: 0;
}

.topkek-fx-dev-param-slot--empty {
    visibility: hidden;
    pointer-events: none;
    min-height: 0;
}

.topkek-fx-dev-field-label {
    font-size: 10px;
    color: var(--menu-label-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    word-break: break-word;
    line-height: 1.15;
    margin: 0;
}

.topkek-fx-dev-hint {
    font-size: 9px;
    line-height: 1.2;
    color: var(--menu-label-color);
    opacity: 0.9;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.topkek-fx-dev-input {
    width: 100%;
    box-sizing: border-box;
    font-family: 'Courier New', monospace;
    font-size: 9px;
    padding: 2px 4px;
    min-height: 1.35rem;
    margin: 0;
    border: 1px solid rgba(76, 175, 80, 0.45);
    border-radius: var(--menu-surface-radius);
    background: rgba(0, 0, 0, 0.45);
    color: #81C784;
}

.topkek-fx-dev-input:focus {
    outline: none;
    border-color: rgba(129, 199, 132, 0.85);
}

.topkek-fx-dev-global .topkek-fx-dev-input-num {
    width: 3.75rem;
}

.topkek-terminal-shell-control-btn:hover:not(:disabled) {
    color: #b8efba;
    border-color: rgba(129, 199, 132, 0.85);
}

.topkek-terminal-shell-control-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.topkek-terminal-log {
    max-height: 140px;
    overflow-y: auto;
    margin-bottom: 6px;
    padding: 4px 2px;
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.45);
    line-height: 1.35;
    word-break: break-word;
    scrollbar-width: thin;
    scrollbar-color: rgba(76, 175, 80, 0.75) rgba(0, 0, 0, 0.45);
}

.topkek-terminal-log::-webkit-scrollbar {
    width: 8px;
}

.topkek-terminal-log::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.45);
    border-radius: 999px;
}

.topkek-terminal-log::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(129, 199, 132, 0.95), rgba(76, 175, 80, 0.8));
    border: 1px solid rgba(129, 199, 132, 0.35);
    border-radius: 999px;
}

.topkek-terminal-log::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(165, 214, 167, 0.95), rgba(102, 187, 106, 0.85));
}

.topkek-terminal-log-line {
    margin: 0 0 4px 0;
    white-space: pre-wrap;
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 5px 8px 5px 10px;
    border-radius: 4px;
    border: 1px solid transparent;
    box-sizing: border-box;
}

.topkek-terminal-help-block {
    margin: 0 0 8px 0;
    padding: 6px 8px 8px;
    border: 1px solid rgba(129, 199, 132, 0.4);
    border-radius: 4px;
    background: transparent;
    max-height: min(55vh, 28rem);
    overflow-y: auto;
    overflow-x: hidden;
}

.topkek-terminal-help-block .topkek-terminal-log-line {
    margin-bottom: 2px;
}

.topkek-terminal-help-block .topkek-terminal-log-line:last-child {
    margin-bottom: 0;
}

/* Plain lines inside help block: no per-line chip */
.topkek-terminal-log-line.topkek-terminal-line-plain {
    background: transparent !important;
    border: none !important;
    border-left: none !important;
    padding: 2px 2px 2px 0;
    box-shadow: none;
}

.topkek-terminal-log-line.topkek-terminal-line-plain .topkek-terminal-log-text {
    color: rgba(200, 255, 210, 0.9);
}

.topkek-terminal-log-line.topkek-terminal-line-command {
    background: rgba(142, 36, 170, 0.28);
    border-color: rgba(213, 0, 249, 0.55);
    border-left: 3px solid #e040fb;
}

.topkek-terminal-log-line.topkek-terminal-line-command .topkek-terminal-log-ts {
    color: rgba(206, 147, 216, 0.85);
}

.topkek-terminal-log-line.topkek-terminal-line-command .topkek-terminal-log-text {
    color: #f3e5f5;
    filter: saturate(1.35);
}

.topkek-terminal-log-line.topkek-terminal-line-response {
    background: rgba(46, 125, 50, 0.12);
    border-color: rgba(76, 175, 80, 0.22);
    border-left: 3px solid rgba(165, 214, 167, 0.5);
}

.topkek-terminal-log-line.topkek-terminal-line-info {
    background: rgba(27, 94, 32, 0.2);
    border-color: rgba(76, 175, 80, 0.28);
    border-left: 3px solid rgba(129, 199, 132, 0.75);
}

.topkek-terminal-log-line.topkek-terminal-line-error,
.topkek-terminal-log-line.topkek-terminal-err {
    background: rgba(183, 28, 28, 0.18);
    border-color: rgba(239, 83, 80, 0.35);
    border-left: 3px solid rgba(255, 138, 128, 0.95);
}

.topkek-terminal-log-line.topkek-terminal-welcome .topkek-terminal-log-text {
    color: rgba(165, 214, 167, 0.95);
}

.topkek-terminal-log-line.topkek-terminal-err .topkek-terminal-log-text {
    color: #ffab91;
}

.topkek-terminal-log-ts {
    flex: 0 0 auto;
    min-width: 74px;
    color: rgba(160, 180, 160, 0.72);
    font-size: 11px;
    letter-spacing: 0.01em;
}

.topkek-terminal-log-text {
    flex: 1 1 auto;
    min-width: 0;
}

.topkek-terminal-log-line.topkek-terminal-line-response .topkek-terminal-log-text {
    color: rgba(200, 255, 200, 0.92);
}

.topkek-terminal-log-line.topkek-terminal-line-info .topkek-terminal-log-text {
    color: #a5d6a7;
}

.topkek-terminal-log-line.topkek-terminal-line-error .topkek-terminal-log-text {
    color: #ffccbc;
}

.topkek-terminal-log-line.topkek-terminal-line-buuch {
    background: rgba(0, 200, 140, 0.1);
    border-color: rgba(0, 255, 153, 0.28);
    border-left: 3px solid rgba(0, 255, 153, 0.85);
    opacity: 0.98;
}

.topkek-terminal-log-line.topkek-terminal-line-buuch .topkek-terminal-log-text {
    color: #6effc8;
}

.topkek-terminal-log-line.topkek-terminal-line-buuch .topkek-terminal-log-ts {
    color: rgba(100, 200, 160, 0.6);
}

.topkek-terminal-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.topkek-terminal-prompt {
    color: #ea80fc;
    flex-shrink: 0;
    user-select: none;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.topkek-terminal-input {
    flex: 1;
    min-width: 0;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(76, 175, 80, 0.4);
    border-radius: 2px;
    padding: 4px 6px;
    outline: none;
}

.topkek-terminal-input:focus {
    border-color: rgba(224, 64, 251, 0.65);
    box-shadow: 0 0 8px rgba(186, 104, 255, 0.22);
}

.topkek-terminal-shell.topkek-terminal-shell--maximized {
    right: 25px;
    bottom: 25px;
    transform: none;
    width: min(900px, calc(100vw - 36px));
    max-height: min(72vh, 640px);
    z-index: 1200;
}

.topkek-terminal-shell.topkek-terminal-shell--maximized .topkek-terminal-log {
    max-height: min(54vh, 500px);
}

@media (max-height: 860px) {
    #right-panel {
        right: 14px;
        padding: 14px 0;
        gap: 8px;
    }

    #ui-container {
        max-height: min(40vh, 320px);
        overflow-y: auto;
        overflow-x: hidden;
    }

    #right-panel #terminal-menu {
        flex: 1 1 0%;
        min-height: 0;
    }

    .topkek-terminal-shell {
        right: 14px;
        bottom: 14px;
        width: min(560px, calc(100vw - 28px));
    }

    .topkek-terminal-log {
        max-height: min(28vh, 220px);
    }
}

@media (max-height: 740px) {
    #ui-container {
        max-height: min(34vh, 250px);
    }

    #right-panel #terminal-menu {
        flex: 1 1 0%;
        min-height: 0;
    }

    .topkek-terminal-shell {
        padding: 6px;
    }

    .topkek-terminal-log {
        max-height: min(22vh, 170px);
    }

    .topkek-terminal-shell.topkek-terminal-shell--maximized {
        max-height: min(66vh, 520px);
    }

    .topkek-terminal-shell.topkek-terminal-shell--maximized .topkek-terminal-log {
        max-height: min(46vh, 360px);
    }
}

/* --- Jasny tryb wizualny (Cloud light) — klasa na body ustawiana z script.js --- */
body.visual-mode-white {
    background-color: #e8eaed;
    --menu-surface-bg: rgba(255, 255, 255, 0.9);
    --menu-surface-border: 1px solid rgba(46, 125, 50, 0.38);
    --menu-surface-shadow: none;
    --menu-label-color: rgba(25, 55, 35, 0.88);
    --menu-text-color: rgba(22, 48, 32, 0.92);
}

body.visual-mode-white #right-panel #terminal-menu.menu-collapsible-section > .menu-section-content {
    scrollbar-color: rgba(46, 125, 50, 0.85) rgba(232, 234, 237, 0.9);
}

body.visual-mode-white #right-panel #terminal-menu.menu-collapsible-section > .menu-section-content::-webkit-scrollbar-track {
    background: rgba(232, 234, 237, 0.9);
}

body.visual-mode-white #right-panel #terminal-menu.menu-collapsible-section > .menu-section-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(46, 125, 50, 0.95), rgba(27, 94, 32, 0.85));
    border: 1px solid rgba(27, 94, 32, 0.35);
}

body.visual-mode-white #canvas-container,
body.visual-mode-white #canvas-container > canvas {
    background-color: #fff;
}

body.visual-mode-white #canvas-container canvas:focus-visible {
    outline: 1px dashed rgba(27, 94, 32, 0.55);
    outline-offset: -1px;
}

body.visual-mode-white .camera-hud-title {
    color: rgba(30, 45, 38, 0.92);
}

body.visual-mode-white #camera-hud .camera-hud-params {
    border-color: rgba(46, 125, 50, 0.35);
    background: rgba(255, 255, 255, 0.45);
}

body.visual-mode-white #camera-hud .camera-hud-param-slot {
    border-right-color: rgba(46, 125, 50, 0.24);
    border-bottom-color: rgba(0, 0, 0, 0.2);
}

body.visual-mode-white #camera-hud .camera-hud-param-label {
    color: rgba(25, 55, 35, 0.82);
}

body.visual-mode-white #camera-hud .camera-hud-param-value {
    color: #2e7d32;
    border: none;
    background: transparent;
}

body.visual-mode-white #camera-hud .camera-hud-param-value:hover:not(.camera-hud-param-value--readonly) {
    color: #1b5e20;
    text-shadow: 0 0 4px rgba(46, 125, 50, 0.35);
    background: rgba(129, 199, 132, 0.2);
}

body.visual-mode-white #camera-hud .camera-hud-param-value--readonly {
    color: rgba(46, 125, 50, 0.5);
}

body.visual-mode-white #camera-hud .camera-hud-param-input {
    border: none;
    background: transparent;
    color: #1b5e20;
}

body.visual-mode-white .perf-hud-graph {
    border-color: rgba(0, 0, 0, 0.12);
}

body.visual-mode-white #camera-hud .mode-btn,
body.visual-mode-white #right-panel .mode-btn {
    color: #2e7d32;
}

body.visual-mode-white #camera-hud #term-visual-light-mode.visual-mode-zen-btn {
    background-color: #fff;
    border-color: rgba(46, 125, 50, 0.45);
}

body.visual-mode-white #camera-hud .mode-btn:hover,
body.visual-mode-white #right-panel .mode-btn:hover {
    color: #1b5e20;
    text-shadow: 0 0 4px rgba(46, 125, 50, 0.35);
}

body.visual-mode-white #camera-hud .mode-btn.active,
body.visual-mode-white #right-panel .mode-btn.active {
    color: #0d1f12;
    background: rgba(129, 199, 132, 0.5);
}

body.visual-mode-white .menu-section-toggle {
    border-color: rgba(46, 125, 50, 0.45);
    background: rgba(255, 255, 255, 0.55);
    color: rgba(27, 94, 32, 0.9);
}

body.visual-mode-white .menu-section-toggle:hover {
    background: rgba(200, 230, 201, 0.65);
    border-color: rgba(27, 94, 32, 0.55);
}

body.visual-mode-white .prod-label {
    color: rgba(20, 40, 30, 0.82);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(46, 125, 50, 0.22);
}

body.visual-mode-white .interactive-term-line {
    color: rgba(55, 55, 55, 0.96);
}

body.visual-mode-white .interactive-term-line:hover {
    color: rgba(32, 32, 32, 0.98);
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.12);
}

body.visual-mode-white #term-visual-light-mode.visual-white-mode-active,
body:not(.visual-mode-white) #term-visual-dark-mode.visual-white-mode-active {
    font-weight: bold;
    text-shadow: 0 0 6px rgba(46, 125, 50, 0.45);
}

body.visual-mode-white .topkek-terminal-shell {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(46, 125, 50, 0.35);
    color: rgba(46, 46, 46, 0.96);
}

body.visual-mode-white .topkek-terminal-log {
    background: rgba(248, 250, 248, 0.98);
    border-color: rgba(0, 0, 0, 0.08);
    color: rgba(26, 26, 26, 0.98);
}

body.visual-mode-white .topkek-terminal-input {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(46, 125, 50, 0.4);
    color: rgba(18, 18, 18, 0.98);
}

body.visual-mode-white .topkek-terminal-log-line .topkek-terminal-log-text {
    color: rgba(22, 22, 22, 0.98);
}

body.visual-mode-white .topkek-terminal-log-ts {
    color: rgba(55, 55, 55, 0.82);
}

body.visual-mode-white .topkek-terminal-prompt {
    color: #4a148c;
}

body.visual-mode-white .topkek-terminal-log-line.topkek-terminal-line-command .topkek-terminal-log-text {
    color: #24123a;
    filter: none;
}

body.visual-mode-white .topkek-terminal-log-line.topkek-terminal-line-response .topkek-terminal-log-text {
    color: #14351c;
}

body.visual-mode-white .topkek-terminal-log-line.topkek-terminal-line-info .topkek-terminal-log-text {
    color: #1b3f24;
}

body.visual-mode-white .topkek-terminal-log-line.topkek-terminal-line-error .topkek-terminal-log-text,
body.visual-mode-white .topkek-terminal-log-line.topkek-terminal-err .topkek-terminal-log-text {
    color: #6b1b13;
}

body.visual-mode-white .topkek-terminal-log-line.topkek-terminal-line-buuch .topkek-terminal-log-text {
    color: #0f4530;
}

body.visual-mode-white .topkek-terminal-shell-control-btn {
    color: rgba(44, 44, 44, 0.95);
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(46, 125, 50, 0.42);
}

body.visual-mode-white .topkek-terminal-shell-icon-btn {
    color: rgba(44, 44, 44, 0.95);
    border-color: rgba(46, 125, 50, 0.35);
}

/* Light mode: terminal menu banners + hover drawers */
body.visual-mode-white #right-panel #terminal-menu .term-menu-banner-video {
    filter: brightness(1.08) contrast(1.03) saturate(1.08);
}

body.visual-mode-white #right-panel #terminal-menu video#newskin-menu-banner-video {
    filter: brightness(1.05) contrast(1.03) saturate(1.1);
}

body.visual-mode-white #right-panel #terminal-menu .term-menu-banner-wrap--newskin:hover video#newskin-menu-banner-video,
body.visual-mode-white #right-panel #terminal-menu .term-menu-banner-wrap--newskin:focus-within video#newskin-menu-banner-video {
    filter: brightness(1.12) contrast(1.04) saturate(1.12);
}

body.visual-mode-white #right-panel #terminal-menu .term-menu-banner-poster {
    filter: brightness(1.06) contrast(1.02) saturate(1.04);
}

body.visual-mode-white #right-panel #terminal-menu .term-menu-banner-block:hover .term-menu-banner-wrap:not(.term-menu-banner-wrap--newskin) .term-menu-banner-video,
body.visual-mode-white #right-panel #terminal-menu .term-menu-banner-block:focus-within .term-menu-banner-wrap:not(.term-menu-banner-wrap--newskin) .term-menu-banner-video {
    filter: brightness(1.14) contrast(1.05) saturate(1.12);
}

body.visual-mode-white #right-panel #terminal-menu .term-menu-banner-drawer-inner,
body.visual-mode-white #right-panel #terminal-menu .term-menu-section-drawer-inner {
    border-top-color: rgba(46, 125, 50, 0.3);
    background: rgba(252, 255, 252, 0.97);
}

body.visual-mode-white #right-panel #terminal-menu .term-menu-banner-hint,
body.visual-mode-white #right-panel #terminal-menu .term-menu-section-drawer-hint {
    color: rgba(30, 58, 38, 0.9);
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.35);
}

body.visual-mode-white #right-panel #terminal-menu .term-menu-drawer-display-title {
    color: #2e7d32;
    filter: saturate(1.15) brightness(1.02);
    text-shadow: 0 0 3px rgba(46, 125, 50, 0.16);
}

body.visual-mode-white #right-panel #terminal-menu .term-menu-banner-block:has(#term-vajbuj.vajbuj-active) .term-menu-banner-drawer-inner,
body.visual-mode-white #right-panel #terminal-menu .term-menu-banner-block:has(#term-mysen-banner-hint.mysen-active) .term-menu-banner-drawer-inner,
body.visual-mode-white #right-panel #terminal-menu .term-menu-banner-block:has(#term-newskin-banner-hint.newskin-active) .term-menu-banner-drawer-inner {
    border-top-color: rgba(46, 125, 50, 0.45);
    background: rgba(240, 248, 240, 0.98);
}

body.visual-mode-white #right-panel #terminal-menu .term-menu-banner-block:has(#term-vajbuj.vajbuj-active) .term-menu-banner-hint,
body.visual-mode-white #right-panel #terminal-menu .term-menu-banner-block:has(#term-mysen-banner-hint.mysen-active) .term-menu-banner-hint,
body.visual-mode-white #right-panel #terminal-menu .term-menu-banner-block:has(#term-newskin-banner-hint.newskin-active) .term-menu-banner-hint {
    color: rgba(22, 52, 30, 0.94);
}

body.visual-mode-white #right-panel #terminal-menu .term-menu-banner-block:has(#term-vajbuj.vajbuj-active) .term-menu-drawer-display-title,
body.visual-mode-white #right-panel #terminal-menu .term-menu-banner-block:has(#term-mysen-banner-hint.mysen-active) .term-menu-drawer-display-title,
body.visual-mode-white #right-panel #terminal-menu .term-menu-banner-block:has(#term-newskin-banner-hint.newskin-active) .term-menu-drawer-display-title {
    color: #1b5e20;
    filter: saturate(1.2) brightness(0.98);
}

/* ===== CV subpage (cv.html) — infographic panel ===== */

html.site-theme-wb,
html:has(body.cv-subpage) {
    background-color: #0d0d10;
    color-scheme: dark;
}

html.site-theme-bw,
html:has(body.cv-subpage.site-theme-bw) {
    background-color: #ffffff;
    color-scheme: light;
}

html.site-theme-topkek,
html:has(body.cv-subpage.site-theme-topkek) {
    background-color: #0a0f0a;
    color-scheme: dark;
}

/* --- Default theme: white on black --- */
#cv-content {
    --cv-bg: #111111;
    --cv-surface: rgba(255, 255, 255, 0.03);
    --cv-border: rgba(255, 255, 255, 0.09);
    --cv-border-strong: rgba(255, 255, 255, 0.2);
    --cv-shadow: 0 0 48px rgba(0, 0, 0, 0.7);
    --cv-text: rgba(255, 255, 255, 0.88);
    --cv-text-muted: rgba(255, 255, 255, 0.68);
    --cv-text-dim: rgba(255, 255, 255, 0.58);
    --cv-accent: rgba(255, 255, 255, 0.9);
    --cv-accent-sub: rgba(255, 255, 255, 0.5);
    --cv-bar-a: rgba(255, 255, 255, 0.76);
    --cv-bar-b: rgba(255, 255, 255, 0.88);
    --cv-bar-track: rgba(255, 255, 255, 0.07);
    --cv-tag-bg: rgba(255, 255, 255, 0.055);
    --cv-tag-border: rgba(255, 255, 255, 0.1);
    --cv-tag-text: rgba(255, 255, 255, 0.46);
    --cv-scrollbar: rgba(255, 255, 255, 0.22);
    --cv-header-border: rgba(255, 255, 255, 0.11);
    --cv-timeline-line: rgba(255, 255, 255, 0.16);
    --cv-timeline-line-fade: rgba(255, 255, 255, 0.03);
    --cv-dot-bg: #111111;
    --cv-dot-border: rgba(255, 255, 255, 0.7);
    --cv-dot-glow: transparent;
    --cv-domain-border: rgba(255, 255, 255, 0.08);
    --cv-btn-border: rgba(255, 255, 255, 0.18);
    --cv-btn-border-active: rgba(255, 255, 255, 0.82);
    --cv-close-color: rgba(255, 255, 255, 0.45);
    --cv-close-hover: rgba(255, 255, 255, 0.9);
    --cv-type-caption: 0.7rem;
    --cv-type-body: 0.8rem;
    --cv-type-subhead: 0.9rem;
    --cv-type-heading: 1.1rem;
}

/* --- Theme: black on white (high-contrast text for readability) --- */
#cv-content.cv-theme-bw {
    --cv-bg: #ffffff;
    --cv-surface: rgba(0, 0, 0, 0.022);
    --cv-border: rgba(0, 0, 0, 0.12);
    --cv-border-strong: rgba(0, 0, 0, 0.22);
    --cv-shadow: 0 4px 48px rgba(0, 0, 0, 0.13);
    --cv-text: #000000;
    --cv-text-muted: #1a1a1a;
    --cv-text-dim: #333333;
    --cv-accent: #000000;
    --cv-accent-sub: #262626;
    --cv-bar-a: #000000;
    --cv-bar-b: #000000;
    --cv-bar-track: rgba(0, 0, 0, 0.08);
    --cv-tag-bg: rgba(0, 0, 0, 0.05);
    --cv-tag-border: rgba(0, 0, 0, 0.18);
    --cv-tag-text: #1a1a1a;
    --cv-scrollbar: rgba(0, 0, 0, 0.35);
    --cv-header-border: rgba(0, 0, 0, 0.14);
    --cv-timeline-line: rgba(0, 0, 0, 0.2);
    --cv-timeline-line-fade: rgba(0, 0, 0, 0.04);
    --cv-dot-bg: #ffffff;
    --cv-dot-border: #000000;
    --cv-dot-glow: transparent;
    --cv-domain-border: rgba(0, 0, 0, 0.12);
    --cv-btn-border: rgba(0, 0, 0, 0.28);
    --cv-btn-border-active: #000000;
    --cv-close-color: #333333;
    --cv-close-hover: #000000;
}

/* --- Theme: TOPKEK green --- */
#cv-content.cv-theme-topkek {
    --cv-bg: #0a0f0a;
    --cv-surface: rgba(76, 175, 80, 0.035);
    --cv-border: rgba(76, 175, 80, 0.1);
    --cv-border-strong: #4CAF50;
    --cv-shadow: 0 0 15px rgba(76, 175, 80, 0.2);
    --cv-text: rgba(210, 255, 210, 0.9);
    --cv-text-muted: rgba(165, 214, 167, 0.74);
    --cv-text-dim: rgba(165, 214, 167, 0.62);
    --cv-accent: #4CAF50;
    --cv-accent-sub: #81c784;
    --cv-bar-a: #4CAF50;
    --cv-bar-b: #81c784;
    --cv-bar-track: rgba(76, 175, 80, 0.08);
    --cv-tag-bg: rgba(76, 175, 80, 0.07);
    --cv-tag-border: rgba(76, 175, 80, 0.18);
    --cv-tag-text: rgba(165, 214, 167, 0.65);
    --cv-scrollbar: #4CAF50;
    --cv-header-border: rgba(76, 175, 80, 0.22);
    --cv-timeline-line: rgba(76, 175, 80, 0.35);
    --cv-timeline-line-fade: rgba(76, 175, 80, 0.06);
    --cv-dot-bg: #0a0f0a;
    --cv-dot-border: #4CAF50;
    --cv-dot-glow: rgba(76, 175, 80, 0.3);
    --cv-domain-border: rgba(76, 175, 80, 0.12);
    --cv-btn-border: rgba(76, 175, 80, 0.28);
    --cv-btn-border-active: #4CAF50;
    --cv-close-color: rgba(210, 255, 210, 0.45);
    --cv-close-hover: #81c784;
}

body.cv-subpage {
    margin: 0;
    min-height: 100vh;
    /* Override global body { overflow: hidden } so long CV can scroll */
    overflow-x: hidden;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    background-color: #0d0d10;
    color-scheme: dark;
    /* Default W/B backdrop until / besides `body.site-theme-*` from site-nav.js */
    background:
        radial-gradient(circle at 18% 12%, rgba(52, 56, 64, 0.55), transparent 50%),
        radial-gradient(circle at 82% 88%, rgba(8, 8, 12, 0.92), transparent 46%),
        #0d0d10;
}

/* CV: explicit W/B (same as default above) once SiteNav has mounted */
body.cv-subpage.site-theme-wb {
    background:
        radial-gradient(circle at 18% 12%, rgba(52, 56, 64, 0.55), transparent 50%),
        radial-gradient(circle at 82% 88%, rgba(8, 8, 12, 0.92), transparent 46%),
        #0d0d10;
}

body.cv-subpage.site-theme-bw {
    background-color: #ffffff;
    color-scheme: light;
    background:
        radial-gradient(circle at 16% 10%, rgba(255, 255, 255, 0.78), transparent 44%),
        radial-gradient(circle at 84% 90%, rgba(248, 248, 247, 0.98), transparent 48%),
        #ffffff;
}

body.cv-subpage.site-theme-topkek {
    background-color: #0a0f0a;
    color-scheme: dark;
    background:
        radial-gradient(circle at 12% 8%, rgb(12, 5, 41), transparent 44%),
        radial-gradient(circle at 86% 85%, rgb(0, 0, 0), transparent 40%),
        #0a0f0a;
}

.cv-page-wrap {
    padding: 3vh 16px 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cv-page-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px 18px;
    flex-wrap: wrap;
    width: 90vw;
    max-width: 960px;
    margin-bottom: 14px;
}

.cv-top-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cv-top-nav-link {
    display: inline-block;
    color: #a5d6a7;
    text-decoration: none;
    border: 1px solid rgba(76, 175, 80, 0.45);
    background: rgba(0, 0, 0, 0.34);
    padding: 7px 12px;
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}

.cv-top-nav-link:hover,
.cv-top-nav-link:focus-visible {
    border-color: rgba(129, 199, 132, 0.92);
    color: #dcffdf;
    background: rgba(76, 175, 80, 0.12);
    outline: none;
}

.cv-top-nav-link--active {
    border-color: rgba(129, 199, 132, 0.92);
    color: #dcffdf;
    background: rgba(76, 175, 80, 0.16);
}

/* --- CV header actions: pinned to the top-right corner --- */

.cv-page-header {
    position: relative;
}

.cv-page-actions {
    position: absolute;
    top: 0;
    right: 0;
    width: auto;
    margin: 0;
    z-index: 2;
}

.cv-action-btn {
    gap: 7px;
}

.cv-action-icon {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
}

/* Print = informational blue accent */
.cv-action-btn--print {
    color: #6cc5ff;
    border-color: rgba(108, 197, 255, 0.55);
    background: rgba(108, 197, 255, 0.12);
}

.cv-action-btn--print:hover,
.cv-action-btn--print:focus-visible {
    color: #cdebff;
    border-color: rgba(108, 197, 255, 0.95);
    background: rgba(108, 197, 255, 0.22);
}

/* Download = primary green, filled */
.cv-action-btn--download {
    color: #0a160a;
    border-color: #6abf69;
    background: #66bb6a;
}

.cv-action-btn--download:hover,
.cv-action-btn--download:focus-visible {
    color: #06120a;
    border-color: #9ccc65;
    background: #81c784;
}

@media (max-width: 860px) {
    .cv-page-actions {
        position: static;
        width: 100%;
        margin: 0;
        justify-content: center;
    }
}

/* --- Main panel (overrides portfolio-modal-box hardcoded colours) --- */

#cv-content {
    position: relative;
    z-index: 1;
    width: 90vw;
    max-width: 960px;
    max-height: none;
    overflow-y: visible;
    padding: 36px 40px;
    background: var(--cv-bg) !important;
    border-color: var(--cv-border-strong) !important;
    box-shadow: var(--cv-shadow) !important;
    border-radius: 6px;
    scrollbar-width: thin;
    scrollbar-color: var(--cv-scrollbar) transparent;
}

/* --- Entrance animation --- */

@keyframes cv-fadeSlideIn {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

body.cv-subpage #cv-content {
    animation: cv-fadeSlideIn 0.38s ease-out forwards;
}

/* --- Toolbar (language + theme, top of panel) --- */

.cv-toolbar {
    margin: 0 0 22px;
    padding: 0 0 14px;
    border-bottom: 1px solid var(--cv-header-border);
}

.cv-toolbar-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
}

.cv-lang-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cv-lang-btn {
    font: inherit;
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 5px 12px;
    min-height: 34px;
    min-width: 36px;
    background: transparent;
    border: 1px solid var(--cv-btn-border);
    color: var(--cv-text-muted);
    cursor: pointer;
    border-radius: 2px;
    transition: border-color 0.18s ease, color 0.18s ease;
}

.cv-lang-btn:hover,
.cv-lang-btn:focus-visible {
    border-color: var(--cv-accent);
    color: var(--cv-text);
    outline: none;
}

.cv-lang-btn--active {
    border-color: var(--cv-btn-border-active);
    color: var(--cv-accent);
}

.cv-toolbar .cv-theme-switcher {
    justify-content: flex-end;
}

@media (max-width: 480px) {
    .cv-toolbar-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .cv-lang-switcher,
    .cv-toolbar .cv-theme-switcher {
        justify-content: center;
    }
}

/* --- Header --- */

.cv-header {
    text-align: center;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--cv-header-border);
    margin-bottom: 30px;
}

.cv-name {
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    color: var(--cv-accent);
    margin: 0 0 6px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.cv-age-under-name {
    margin: 0 0 8px;
    font-size: var(--cv-type-caption);
    color: var(--cv-text-muted);
    letter-spacing: 0.08em;
}

.cv-avatar {
    display: block;
    width: clamp(108px, 18vw, 148px);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    margin: 2px auto 12px;
    border-radius: 50%;
    border: 1px solid var(--cv-btn-border-active);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.16);
}

#cv-content.cv-theme-topkek .cv-avatar {
    cursor: pointer;
}

.cv-tagline {
    color: var(--cv-accent-sub);
    font-size: clamp(var(--cv-type-body), 1.4vw, 0.9rem);
    margin: 0 0 12px;
    letter-spacing: 0.07em;
}

.cv-tagline-degree {
    display: block;
    margin-top: 3px;
}

.cv-contact-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px 10px;
    font-size: var(--cv-type-caption);
    color: var(--cv-text-muted);
    margin-bottom: 14px;
}

.cv-contact-link {
    color: var(--cv-text-muted);
    text-decoration: none;
    transition: color 0.18s ease;
}

.cv-contact-link:hover,
.cv-contact-link:focus-visible {
    color: var(--cv-accent);
}

.cv-contact-divider {
    opacity: 0.25;
}

.cv-summary {
    text-align: left;
    max-width: none;
    margin: 0 0 18px;
    padding: 0;
}

.cv-summary-heading {
    font-size: var(--cv-type-subhead);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--cv-accent);
    margin: 0 0 10px;
    font-weight: normal;
}

.cv-summary-text {
    font-size: var(--cv-type-body);
    line-height: 1.58;
    color: var(--cv-text-muted);
    text-align: justify;
    margin: 0 0 10px;
}

.cv-summary-text:last-of-type {
    margin-bottom: 0;
}

.cv-lede {
    font-size: var(--cv-type-body);
    line-height: 1.55;
    color: var(--cv-text-muted);
    margin: 0;
}

.cv-lede-sub {
    font-size: var(--cv-type-caption);
    color: var(--cv-text-dim);
    margin: 8px 0 0;
    line-height: 1.45;
}

.cv-sectors-line {
    font-size: var(--cv-type-subhead);
    letter-spacing: 0.04em;
    color: var(--cv-text);
}

.cv-inline-link {
    color: var(--cv-accent-sub);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cv-inline-link:hover,
.cv-inline-link:focus-visible {
    color: var(--cv-accent);
    outline: none;
}

.cv-skill-inline-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 7px;
}

.cv-skill-inline-row .cv-skill-label {
    flex: 1;
    text-align: left;
    font-size: var(--cv-type-body);
    color: var(--cv-text-muted);
    white-space: nowrap;
}

.cv-skill-inline-row .cv-skill-level-tag {
    flex: 0 0 auto;
    text-align: right;
}

.cv-skill-domain--compact {
    padding-bottom: 12px;
}

.cv-prior-text {
    margin: 0;
    font-size: var(--cv-type-caption);
    line-height: 1.55;
    color: var(--cv-text-muted);
}

.cv-prior-text[data-i18n="skillOwnSoftwareHeading"] {
    margin-top: 8px;
}

.cv-section--sidebar-contact {
    margin-top: 22px;
    padding-top: 4px;
    border-top: 1px solid var(--cv-domain-border);
}

.cv-contact-row--sidebar {
    justify-content: flex-start;
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
    font-size: var(--cv-type-body);
}

.cv-contact-row--sidebar .cv-contact-divider {
    display: none;
}

.cv-contact-phone {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cv-contact-icon-link {
    display: inline-flex;
    align-items: center;
    color: var(--cv-text-muted);
    transition: color 0.18s ease;
}

.cv-contact-icon-link:hover,
.cv-contact-icon-link:focus-visible {
    color: var(--cv-accent);
    outline: none;
}

.cv-contact-icon {
    width: 13px;
    height: 13px;
    display: block;
}

.cv-footer-note {
    text-align: center;
    font-size: var(--cv-type-caption);
    color: var(--cv-text-dim);
    letter-spacing: 0.04em;
    margin: 8px 0 0;
    padding-top: 20px;
    border-top: 1px solid var(--cv-domain-border);
}

.cv-footer-note-sep {
    opacity: 0.45;
}

.cv-consent {
    text-align: left;
    font-size: 0.65rem;
    line-height: 1.45;
    color: var(--cv-text-dim);
    margin: 16px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--cv-domain-border);
}

.cv-consent:empty {
    display: none;
}

/* --- Theme switcher --- */

.cv-theme-switcher {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.cv-theme-btn {
    font: inherit;
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 5px 12px;
    min-height: 34px;
    background: transparent;
    border: 1px solid var(--cv-btn-border);
    color: var(--cv-text-muted);
    cursor: pointer;
    border-radius: 2px;
    transition: border-color 0.18s ease, color 0.18s ease;
}

.cv-theme-btn:hover,
.cv-theme-btn:focus-visible {
    border-color: var(--cv-accent);
    color: var(--cv-text);
    outline: none;
}

.cv-theme-btn--active {
    border-color: var(--cv-btn-border-active);
    color: var(--cv-accent);
}

/* --- Body layout --- */

.cv-body {
    display: grid;
    grid-template-columns: 195px 1fr;
    gap: 36px;
}

.cv-section {
    margin-bottom: 28px;
}

.cv-section-heading {
    color: var(--cv-accent);
    font-size: var(--cv-type-subhead);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 16px;
    padding-left: 11px;
    border-left: 2px solid var(--cv-accent);
}

/* --- Sidebar: languages --- */

.cv-lang-item {
    margin-bottom: 12px;
}

.cv-lang-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.cv-lang-name {
    font-size: var(--cv-type-body);
    color: var(--cv-text);
}

.cv-lang-badge {
    font-size: var(--cv-type-caption);
    color: var(--cv-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* --- Sidebar: personal info --- */

.cv-info-list {
    margin: 0;
    font-size: 0.73rem;
    color: var(--cv-text-muted);
    line-height: 1.5;
}

.cv-info-list dt {
    color: var(--cv-accent);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 10px;
}

.cv-info-list dt:first-of-type {
    margin-top: 0;
}

.cv-info-list dd {
    margin: 2px 0 0 0;
}

/* --- Shared: bar track & fill --- */

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

.cv-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cv-bar-a), var(--cv-bar-b));
    border-radius: 2px;
    width: 0;
    transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Skills: domain groups --- */

.cv-skill-domain {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--cv-domain-border);
}

.cv-skill-domain:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.cv-skill-domain-label {
    font-size: var(--cv-type-subhead);
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.04em;
    color: var(--cv-text);
    margin: 0 0 10px;
}

.cv-skill-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 7px;
}

.cv-skill-label {
    flex: 0 0 148px;
    font-size: var(--cv-type-body);
    color: var(--cv-text-muted);
    text-align: right;
}

.cv-skill-level-tag {
    flex: 0 0 auto;
    font-size: var(--cv-type-caption);
    color: var(--cv-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: right;
    border: 1px solid var(--cv-tag-border);
    border-radius: 2px;
    background: var(--cv-tag-bg);
    padding: 2px 7px;
}

/* --- Skills: basic-level tags/pills --- */

.cv-skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 9px;
    padding-left: 2px;
}

.cv-skill-tag {
    font-size: var(--cv-type-caption);
    color: var(--cv-tag-text);
    background: var(--cv-tag-bg);
    border: 1px solid var(--cv-tag-border);
    padding: 2px 9px;
    border-radius: 2px;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

/* --- Timeline --- */

.cv-timeline {
    position: relative;
    padding-left: 26px;
}

.cv-timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 4px;
    bottom: 4px;
    width: 1px;
    background: linear-gradient(180deg, var(--cv-timeline-line), var(--cv-timeline-line-fade));
}

.cv-timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.cv-timeline-item:last-child {
    margin-bottom: 0;
}

.cv-timeline-dot {
    position: absolute;
    left: -23px;
    top: 4px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--cv-dot-bg);
    border: 1px solid var(--cv-dot-border);
    box-shadow: 0 0 5px var(--cv-dot-glow);
}

.cv-timeline-date {
    font-size: var(--cv-type-caption);
    color: var(--cv-text-muted);
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
    margin-bottom: 5px;
}

.cv-timeline-card {
    background: var(--cv-surface);
    border: 1px solid var(--cv-border);
    border-radius: 3px;
    padding: 11px 15px;
}

.cv-timeline-role {
    color: var(--cv-text);
    font-size: var(--cv-type-subhead);
    font-weight: normal;
    margin: 0 0 3px;
}

.cv-timeline-company {
    color: var(--cv-accent-sub);
    font-size: var(--cv-type-body);
    margin: 0 0 7px;
}

.cv-timeline-tasks {
    margin: 0;
    padding-left: 15px;
    font-size: var(--cv-type-body);
    color: var(--cv-text-muted);
    line-height: 1.55;
}

.cv-timeline-tasks li {
    margin-bottom: 3px;
}

.cv-timeline-tasks li:last-child {
    margin-bottom: 0;
}

.cv-timeline-detail {
    font-size: var(--cv-type-caption);
    color: var(--cv-text-dim);
    margin: 4px 0 0;
    font-style: italic;
}

/* --- Responsive --- */

@media (max-width: 720px) {
    .cv-page-wrap {
        padding: 10px 0 34px;
    }

    .cv-page-header,
    #cv-content {
        width: calc(100vw - 24px);
        max-width: none;
    }

    .cv-page-header {
        justify-content: center;
        padding: 14px 16px 0;
        margin-bottom: 10px;
    }

    #cv-content {
        padding: 22px 16px;
        border-radius: 6px;
    }

    .cv-body {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .cv-main {
        order: 1;
    }

    .cv-sidebar {
        order: 2;
    }

    .cv-lang-btn,
    .cv-theme-btn {
        min-height: 38px;
        min-width: 44px;
    }

    .cv-skill-bar-row .cv-skill-label {
        flex: 0 0 112px;
        font-size: 0.66rem;
    }

    .cv-skill-bar-row .cv-skill-level-tag {
        display: none;
    }

    .cv-skill-inline-row .cv-skill-label {
        font-size: 0.66rem;
    }

    .cv-contact-row {
        flex-direction: column;
        gap: 3px;
    }

    .cv-contact-row--sidebar {
        gap: 5px;
    }

    .cv-contact-divider {
        display: none;
    }

    .cv-avatar {
        width: clamp(82px, 24vw, 104px);
        margin-bottom: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.cv-subpage #cv-content {
        animation: none;
    }

    .cv-bar-fill {
        transition: none;
    }
}

/* --- CV print / PDF export (2 readable A4 pages) --- */

@media print {
    @page {
        size: A4 portrait;
        margin: 9mm 12mm 12mm;

        @bottom-right {
            content: counter(page) ' / ' counter(pages);
            font-family: 'Courier New', monospace;
            font-size: 8pt;
            color: #555555;
        }
    }

    html:has(body.cv-subpage),
    body.cv-subpage {
        background: #ffffff !important;
        color: #000000 !important;
        color-scheme: light;
        font-size: 9.5pt;
        line-height: 1.45;
        overflow: visible !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.cv-subpage .cv-page-wrap {
        padding: 0;
        display: block;
        width: 100%;
    }

    body.cv-subpage .cv-page-header,
    body.cv-subpage .site-nav,
    body.cv-subpage .cv-page-actions {
        display: none !important;
    }

    body.cv-subpage #cv-content {
        --cv-type-caption: 0.72rem;
        --cv-type-body: 0.82rem;
        --cv-type-subhead: 0.92rem;
        --cv-type-heading: 1.05rem;
        --cv-bg: #ffffff;
        --cv-surface: transparent;
        --cv-border: rgba(0, 0, 0, 0.1);
        --cv-border-strong: rgba(0, 0, 0, 0.18);
        --cv-shadow: none;
        --cv-text: #000000;
        --cv-text-muted: #1a1a1a;
        --cv-text-dim: #333333;
        --cv-accent: #000000;
        --cv-accent-sub: #262626;
        --cv-tag-bg: rgba(0, 0, 0, 0.04);
        --cv-tag-border: rgba(0, 0, 0, 0.14);
        --cv-tag-text: #1a1a1a;
        --cv-header-border: rgba(0, 0, 0, 0.12);
        --cv-timeline-line: rgba(0, 0, 0, 0.16);
        --cv-timeline-line-fade: rgba(0, 0, 0, 0.03);
        --cv-dot-bg: #ffffff;
        --cv-dot-border: #000000;
        --cv-domain-border: rgba(0, 0, 0, 0.1);

        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
        visibility: visible !important;
        overflow: visible !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Header band: small avatar + name/tagline + profile */
    body.cv-subpage .cv-header {
        display: grid;
        grid-template-columns: 56px 1fr;
        column-gap: 14px;
        row-gap: 4px;
        padding-bottom: 6px;
        margin-bottom: 6px;
        border-bottom: 1px solid var(--cv-header-border);
        text-align: left;
    }

    body.cv-subpage .cv-avatar {
        display: block !important;
        grid-row: 1 / span 2;
        width: 56px;
        height: 56px;
        margin: 0;
        box-shadow: none;
        border-radius: 50%;
        border: 1px solid rgba(0, 0, 0, 0.2);
        object-fit: cover;
    }

    body.cv-subpage .cv-name {
        grid-column: 2;
        font-size: 1.35rem;
        margin: 0;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    body.cv-subpage .cv-tagline {
        grid-column: 2;
        font-size: var(--cv-type-body);
        margin: 0;
        letter-spacing: 0.03em;
    }

    body.cv-subpage .cv-tagline-degree {
        display: inline;
        margin-top: 0;
    }

    body.cv-subpage .cv-tagline-degree::before {
        content: ' · ';
    }

    body.cv-subpage .cv-summary {
        grid-column: 1 / -1;
        margin: 4px 0 0;
    }

    body.cv-subpage .cv-summary-heading {
        font-size: var(--cv-type-subhead);
        margin: 0 0 2px;
        text-transform: uppercase;
        letter-spacing: 0.06em;
    }

    body.cv-subpage .cv-summary-text {
        font-size: var(--cv-type-body);
        line-height: 1.45;
        margin: 0;
    }

    /* Page 1: sidebar floated left, skills wraps into the right column.
       Block flow (no grid) so page breaks paginate reliably. */
    body.cv-subpage .cv-body {
        display: block;
    }

    body.cv-subpage .cv-sidebar {
        float: left;
        width: 186px;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        gap: 0;
        margin: 0 18px 8px 0;
        padding: 9px 11px;
        border: 1px solid rgba(0, 0, 0, 0.4);
        border-radius: 3px;
    }

    body.cv-subpage .cv-sidebar .cv-section {
        margin-bottom: 10px;
    }

    body.cv-subpage .cv-sidebar .cv-section-heading {
        margin-bottom: 5px;
        font-size: 0.88rem;
    }

    body.cv-subpage .cv-sidebar .cv-section:last-child {
        margin-bottom: 0;
    }

    body.cv-subpage .cv-sidebar .cv-section--sidebar-contact {
        margin-top: 7px;
        padding-top: 7px;
    }

    body.cv-subpage .cv-sidebar .cv-prior-text,
    body.cv-subpage .cv-sidebar .cv-lang-name,
    body.cv-subpage .cv-sidebar .cv-contact-row--sidebar {
        font-size: 0.94em;
    }

    body.cv-subpage .cv-section {
        margin-bottom: 10px;
    }

    body.cv-subpage .cv-main {
        display: block;
    }

    body.cv-subpage .cv-main > .cv-section[aria-labelledby='cv-skills-heading'] {
        margin-bottom: 8px;
        font-size: 0.94em;
        /* BFC: keep skill-domain dividers within the right column,
           so no horizontal rule runs under the floated sidebar. */
        overflow: hidden;
    }

    body.cv-subpage .cv-section[aria-labelledby='cv-skills-heading'] .cv-section-heading {
        margin-bottom: 6px;
    }

    body.cv-subpage .cv-section[aria-labelledby='cv-skills-heading'] .cv-skill-domain {
        break-inside: avoid;
        page-break-inside: avoid;
        margin-bottom: 5px;
        padding-bottom: 4px;
    }

    /* Experience: clears the floated sidebar, full width below the top row */
    body.cv-subpage .cv-section[aria-labelledby='cv-experience-heading'] {
        clear: left;
        margin-top: 6px;
        margin-bottom: 0;
    }

    body.cv-subpage .cv-section[aria-labelledby='cv-experience-heading'] .cv-timeline-item {
        margin-bottom: 3px;
    }

    body.cv-subpage .cv-section[aria-labelledby='cv-experience-heading'] .cv-timeline-card {
        padding: 3px 9px;
    }

    body.cv-subpage .cv-section[aria-labelledby='cv-experience-heading'] .cv-timeline-tasks {
        margin-top: 2px;
    }

    body.cv-subpage .cv-section[aria-labelledby='cv-experience-heading'] .cv-timeline-tasks li {
        margin-bottom: 0;
        line-height: 1.32;
    }

    /* Page 2 starts at the highlights group */
    body.cv-subpage .cv-print-page-break {
        break-before: page;
        page-break-before: always;
        margin-top: 0;
        padding-top: 0;
    }

    /* Highlights: 2x2 grid (sectors | recognition / festivals) */
    body.cv-subpage .cv-highlights-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 20px;
        row-gap: 8px;
        align-items: start;
        margin-bottom: 8px;
    }

    body.cv-subpage .cv-highlights-group .cv-section {
        margin-bottom: 0;
    }

    /* Density: keep experience + highlights + education within 2 pages */
    body.cv-subpage .cv-section .cv-section-heading {
        margin-bottom: 5px;
    }

    body.cv-subpage .cv-section .cv-timeline-item {
        margin-bottom: 5px;
    }

    body.cv-subpage .cv-section[aria-labelledby='cv-education-heading'] {
        margin-top: 8px;
    }

    body.cv-subpage .cv-section[aria-labelledby='cv-education-heading'] .cv-timeline-card {
        padding: 4px 9px;
    }

    body.cv-subpage .cv-section[aria-labelledby='cv-education-heading'] .cv-timeline-detail {
        margin: 0 0 1px;
    }

    body.cv-subpage .cv-section[aria-labelledby='cv-skills-heading'] .cv-skill-domain-label {
        margin-bottom: 3px;
        font-size: 0.92em;
    }

    body.cv-subpage .cv-section[aria-labelledby='cv-skills-heading'] .cv-skill-inline-row {
        margin-bottom: 1px;
    }

    body.cv-subpage .cv-section[aria-labelledby='cv-skills-heading'] .cv-skill-inline-row .cv-skill-label {
        flex: 1 1 auto;
        font-size: 0.94em;
        white-space: nowrap;
    }

    body.cv-subpage .cv-section[aria-labelledby='cv-skills-heading'] .cv-skill-tags {
        gap: 2px 3px;
        margin-top: 2px;
    }

    body.cv-subpage .cv-section[aria-labelledby='cv-skills-heading'] .cv-skill-tag {
        font-size: 0.68rem;
        padding: 1px 5px;
    }

    body.cv-subpage .cv-section[aria-labelledby='cv-skills-heading'] .cv-timeline-tasks {
        margin-top: 3px;
        font-size: 0.94em;
    }

    body.cv-subpage .cv-section[aria-labelledby='cv-skills-heading'] .cv-timeline-tasks li {
        margin-bottom: 0;
    }

    body.cv-subpage .cv-section-heading {
        font-size: var(--cv-type-subhead);
        margin: 0 0 8px;
        padding-left: 9px;
    }

    body.cv-subpage .cv-lang-item {
        margin-bottom: 6px;
    }

    body.cv-subpage .cv-prior-text,
    body.cv-subpage .cv-lede,
    body.cv-subpage .cv-lede-sub {
        font-size: var(--cv-type-body);
        line-height: 1.42;
        margin: 0 0 5px;
    }

    body.cv-subpage .cv-contact-row--sidebar {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
        font-size: var(--cv-type-caption);
        margin-bottom: 0;
    }

    body.cv-subpage .cv-contact-divider {
        display: none;
    }

    body.cv-subpage .cv-contact-link {
        color: #000000;
        text-decoration: none;
    }

    /* Skills */
    body.cv-subpage .cv-skill-domain {
        margin-bottom: 10px;
        padding-bottom: 8px;
    }

    body.cv-subpage .cv-skill-domain:last-child {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
    }

    body.cv-subpage .cv-skill-domain-label {
        font-size: var(--cv-type-body);
        font-weight: 600;
        margin: 0 0 5px;
    }

    body.cv-subpage .cv-skill-inline-row {
        margin-bottom: 3px;
    }

    body.cv-subpage .cv-skill-inline-row .cv-skill-label {
        font-size: var(--cv-type-body);
        flex: 1 1 auto;
        white-space: nowrap;
    }

    body.cv-subpage .cv-skill-level-tag {
        font-size: var(--cv-type-caption);
        padding: 1px 6px;
    }

    body.cv-subpage .cv-skill-tags {
        gap: 4px;
        margin-top: 5px;
    }

    body.cv-subpage .cv-skill-tag {
        font-size: var(--cv-type-caption);
        padding: 2px 7px;
    }

    /* Page 2 — experience onward (break after skills section) */

    /* Timeline */
    body.cv-subpage .cv-timeline {
        padding-left: 20px;
    }

    body.cv-subpage .cv-timeline-item {
        margin-bottom: 8px;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    body.cv-subpage .cv-timeline-dot {
        left: -19px;
        width: 7px;
        height: 7px;
        top: 4px;
    }

    body.cv-subpage .cv-timeline-date {
        font-size: var(--cv-type-caption);
        margin-bottom: 3px;
    }

    body.cv-subpage .cv-timeline-card {
        padding: 5px 9px;
        border-radius: 2px;
    }

    body.cv-subpage .cv-timeline-role {
        font-size: var(--cv-type-body);
        font-weight: 600;
        margin: 0 0 2px;
    }

    body.cv-subpage .cv-timeline-company {
        font-size: var(--cv-type-body);
        margin: 0 0 3px;
    }

    body.cv-subpage .cv-timeline-tasks {
        font-size: var(--cv-type-body);
        line-height: 1.3;
        padding-left: 14px;
    }

    body.cv-subpage .cv-timeline-tasks li {
        margin-bottom: 1px;
    }

    body.cv-subpage .cv-timeline-detail {
        font-size: var(--cv-type-body);
        line-height: 1.42;
        margin: 0 0 3px;
    }

    body.cv-subpage .cv-footer-note {
        font-size: var(--cv-type-caption);
        margin: 5px 0 0;
        padding-top: 5px;
        border-top: 1px solid var(--cv-domain-border);
        text-align: left;
    }

    body.cv-subpage .cv-consent {
        font-size: 0.6rem;
        line-height: 1.3;
        color: #333333;
        margin: 4px 0 0;
        padding-top: 0;
        border-top: none;
    }

    body.cv-subpage a[href^='http']::after,
    body.cv-subpage a[href^='mailto:']::after,
    body.cv-subpage a[href^='tel:']::after {
        content: none;
    }
}

/* Highlights wrapper: transparent on screen (website layout unchanged) */
.cv-highlights-group {
    display: contents;
}

/* Screen preview of print layout (?print=1) */
body.cv-subpage.cv-print-preview {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 10pt;
    line-height: 1.45;
}

body.cv-subpage.cv-print-preview .cv-page-header,
body.cv-subpage.cv-print-preview .site-nav,
body.cv-subpage.cv-print-preview .cv-page-actions {
    display: none !important;
}

body.cv-subpage.cv-print-preview .cv-page-wrap {
    padding: 12mm 14mm;
    max-width: 210mm;
    margin: 0 auto;
    background: #ffffff;
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.12);
}

body.cv-subpage.cv-print-preview #cv-content {
    --cv-type-caption: 0.72rem;
    --cv-type-body: 0.82rem;
    --cv-type-subhead: 0.92rem;
    --cv-text: #000000;
    --cv-text-muted: #1a1a1a;
    --cv-text-dim: #333333;
    --cv-accent: #000000;
    --cv-accent-sub: #262626;
    --cv-bg: #ffffff;
    --cv-border: rgba(0, 0, 0, 0.1);
    --cv-header-border: rgba(0, 0, 0, 0.12);
    --cv-domain-border: rgba(0, 0, 0, 0.1);
    --cv-tag-bg: rgba(0, 0, 0, 0.04);
    --cv-tag-border: rgba(0, 0, 0, 0.14);
    --cv-tag-text: #1a1a1a;
    width: 100% !important;
    max-width: none !important;
    background: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
    animation: none !important;
}

body.cv-subpage.cv-print-preview .cv-header {
    display: grid;
    grid-template-columns: 56px 1fr;
    column-gap: 14px;
    row-gap: 4px;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--cv-header-border);
    text-align: left;
}

body.cv-subpage.cv-print-preview .cv-avatar {
    display: block !important;
    grid-row: 1 / span 2;
    width: 56px;
    height: 56px;
    margin: 0;
    border-radius: 50%;
    object-fit: cover;
}

body.cv-subpage.cv-print-preview .cv-summary {
    grid-column: 1 / -1;
    margin: 4px 0 0;
}

body.cv-subpage.cv-print-preview .cv-tagline-degree {
    display: inline;
    margin-top: 0;
}

body.cv-subpage.cv-print-preview .cv-tagline-degree::before {
    content: ' · ';
}

body.cv-subpage.cv-print-preview .cv-body {
    display: block;
}

body.cv-subpage.cv-print-preview .cv-sidebar {
    float: left;
    width: 186px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0 18px 8px 0;
    padding: 9px 11px;
    border: 1px solid rgba(0, 0, 0, 0.4);
    border-radius: 3px;
}

body.cv-subpage.cv-print-preview .cv-sidebar .cv-section {
    margin-bottom: 14px;
}

body.cv-subpage.cv-print-preview .cv-sidebar .cv-section:last-child {
    margin-bottom: 0;
}

body.cv-subpage.cv-print-preview .cv-sidebar .cv-section--sidebar-contact {
    margin-top: 10px;
    padding-top: 8px;
}

body.cv-subpage.cv-print-preview .cv-main {
    display: block;
}

/* BFC: skill-domain dividers stay within the right column (no line under sidebar) */
body.cv-subpage.cv-print-preview .cv-main > .cv-section[aria-labelledby='cv-skills-heading'] {
    overflow: hidden;
}

body.cv-subpage.cv-print-preview .cv-section[aria-labelledby='cv-experience-heading'] {
    clear: left;
}

body.cv-subpage.cv-print-preview .cv-highlights-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 20px;
    row-gap: 8px;
    align-items: start;
}

body.cv-subpage.cv-print-preview .cv-highlights-group .cv-section {
    margin-bottom: 0;
}

body.cv-subpage.cv-print-preview .cv-print-page-break {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 2px dashed rgba(0, 0, 0, 0.15);
}