#egzaminMergedWikiCard .markdown-body,
#egzaminMergedWikiContent {
    background: none !important;
    color: var(--text);
    font-size: 1.13em;
    font-family: var(--font), sans-serif;
    line-height: 1.85;
    box-shadow: none !important;
    border: none !important;
    padding: 0 0 18px 0 !important;
    margin: 0 !important;
    letter-spacing: 0.01em;
    transition: none !important;
}

#egzaminMergedWikiCard h1, #egzaminMergedWikiCard h2, #egzaminMergedWikiCard h3, #egzaminMergedWikiCard h4, #egzaminMergedWikiCard h5 {
    color: var(--accent2);
    margin-top: 2.1em;
    margin-bottom: 0.7em;
    font-weight: 800;
    letter-spacing: 0.01em;
}

#egzaminMergedWikiCard ul, #egzaminMergedWikiCard ol {
    margin-left: 2.2em;
    margin-bottom: 1.25em;
}

#egzaminMergedWikiCard table {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(91,79,207,0.06);
    margin-bottom: 2em;
}

#egzaminMergedWikiCard code, #egzaminMergedWikiCard pre {
    background: #f4f6fb;
    color: #2a1d6b;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 1em;
}
/* ===== CSS VARIABLES ===== */
:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface2: #f0f2f8;
    --border: #e2e6f0;
    --text: #1a1d2e;
    --text-muted: #6b7280;
    --accent: #5b4fcf;
    --accent2: #7c3aed;
    --accent-light: #ede9fe;
    --accent-glow: rgba(91, 79, 207, 0.15);
    --accent3: #06b6d4;
    --accent4: #f472b6;
    --hero-overlay: linear-gradient(135deg, rgba(13, 15, 26, 0.84) 0%, rgba(26, 16, 64, 0.78) 45%, rgba(13, 26, 46, 0.84) 100%);
    --hero-orb-1: rgba(91, 79, 207, 0.28);
    --hero-orb-2: rgba(6, 182, 212, 0.22);
    --hero-orb-3: rgba(244, 114, 182, 0.18);
    --code-bg: #1e1e2e;
    --nav-bg: #1a1d2e;
    --nav-text: #e2e8f0;
    --header-bg: #12142a;
    --green: #10b981;
    --amber: #f59e0b;
    --red: #ef4444;
    --sidebar-w: 300px;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
    --transition: 0.2s ease;
    --font: 'Outfit', sans-serif;
    --mono: 'JetBrains Mono', monospace;
    /* Obniżamy wysokość górnego paska o ~12.5% dla bardziej kompaktowego układu. */
    --header-h: 42px;
    --tabbar-h: 41px;
    --chrome-h: calc(var(--header-h) + var(--tabbar-h));
    /* Mniejsza bazowa czcionka dla artykułów renderowanych z plików Markdown. */
    --wiki-font-size: 11px;
    --wiki-font-scale: 0.9;
}

[data-theme="dark"] {
    --bg: #0d0f1a;
    --surface: #151827;
    --surface2: #1c1f33;
    --border: #2a2d42;
    --text: #e8eaf6;
    --text-muted: #8b93b0;
    --accent: #7c6df0;
    --accent2: #a78bfa;
    --accent-light: #1e1a3a;
    --accent-glow: rgba(124, 109, 240, 0.2);
    --header-bg: #0a0b14;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
}

/* Ocean — dark blue theme */
[data-theme="ocean"] {
    --bg: #071726;
    --surface: #0d2137;
    --surface2: #102840;
    --border: #1a3a55;
    --text: #d0eaff;
    --text-muted: #7aadcc;
    --accent: #0ea5e9;
    --accent2: #38bdf8;
    --accent-light: #0c2a3d;
    --accent-glow: rgba(14, 165, 233, 0.2);
    --code-bg: #071726;
    --header-bg: #040f1a;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
}

/* Forest — green theme */
[data-theme="forest"] {
    --bg: #f0fdf4;
    --surface: #ffffff;
    --surface2: #dcfce7;
    --border: #bbf7d0;
    --text: #14532d;
    --text-muted: #4b7a5f;
    --accent: #059669;
    --accent2: #10b981;
    --accent-light: #d1fae5;
    --accent-glow: rgba(5, 150, 105, 0.15);
    --code-bg: #0d2818;
    --header-bg: #052e16;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
}

/* Sunset — warm orange/red dark theme */
[data-theme="sunset"] {
    /* 60% — tło (ciemne, stabilne) */
    --bg: #1a0e08;
    --header-bg: #140904;
    --code-bg: #12080a;

    /* 30% — powierzchnie (lekko jaśniejsze, ale nadal neutralne) */
    --surface: #24130a;
    --surface2: #2e180c;
    --border: #3a1d0e;

    /* tekst (neutralny, bez akcentu) */
    --text: #fde8d0;
    --text-muted: #a87458;

    /* 10% — akcent (tylko interakcje / highlight) */
    --accent: #f97316;
    --accent2: #fb923c;

    /* ograniczenie „rozlewania się” akcentu */
    --accent-light: #2a1406;
    /* mniej nasycony */
    --accent-glow: rgba(249, 115, 22, 0.18);

    /* cienie (neutralne, nie pomarańczowe) */
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.55);
}

/* Rose — pink/magenta light theme */
[data-theme="rose"] {
    --bg: #fff0f6;
    --surface: #ffffff;
    --surface2: #ffe4ef;
    --border: #fbc8de;
    --text: #4a0628;
    --text-muted: #9d5070;
    --accent: #db2777;
    --accent2: #ec4899;
    --accent-light: #fce7f3;
    --accent-glow: rgba(219, 39, 119, 0.15);
    --code-bg: #2d0a1c;
    --header-bg: #3b0a21;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
}


/* Aurora — neon gradient theme */
[data-theme="aurora"] {
    /* 60% — tło (ciemne, chłodne) */
    --bg: #090b1f;
    --header-bg: #070a17;
    --code-bg: #0c1022;

    /* 30% — powierzchnie (umiarkowany kontrast) */
    --surface: #0f142b;
    --surface2: #151a36;
    --border: #1f2850;

    /* tekst */
    --text: #eff6ff;
    --text-muted: #9fb0cc;

    /* 10% — akcent główny (spójny) */
    --accent: #8b5cf6;

    /* akcenty wtórne — zdegradowane (rzadkie użycie) */
    --accent2: #22d3ee;
    --accent3: #84cc16;
    /* mniej jaskrawy niż wcześniej */
    --accent4: #e879f9;
    /* ograniczyć użycie */

    /* ograniczenie „rozlewania” akcentów */
    --accent-light: #141938;
    --accent-glow: rgba(139, 92, 246, 0.15);

    /* hero — mniej agresywny, bardziej tło niż akcent */
    --hero-overlay: linear-gradient(135deg,
            rgba(9, 11, 31, 0.92) 0%,
            rgba(40, 30, 80, 0.65) 50%,
            rgba(10, 40, 70, 0.75) 100%);

    /* orbsy — wyraźnie przygaszone (de facto dekoracja, nie akcent) */
    --hero-orb-1: rgba(139, 92, 246, 0.22);
    --hero-orb-2: rgba(34, 211, 238, 0.16);
    --hero-orb-3: rgba(132, 204, 22, 0.12);

    /* cienie neutralne */
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.55);
}

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 90%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.2;
    min-height: 80vh;
    transition: background var(--transition), color var(--transition);
}

body.startup-open {
    overflow: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent2);
}

/* ===== SCROLL PROGRESS ===== */
.exam-quiz-cta {
    margin: 24px 0 32px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: linear-gradient(135deg, var(--accent-light), var(--surface));
    box-shadow: var(--shadow);
}

.exam-quiz-cta-content {
    display: grid;
    gap: 12px;
}

.exam-quiz-cta h2 {
    margin: 0;
    font-size: 1.5rem;
}

.exam-quiz-cta p {
    margin: 0;
    color: var(--text-muted);
}

.exam-quiz-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(91, 79, 207, 0.12);
    color: var(--accent);
    font-weight: 700;
}

.exam-quiz-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    padding: 12px 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    font-weight: 700;
    box-shadow: var(--shadow);
}

.exam-quiz-button:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

/* Ustawia przyciski kompendium obok siebie i zawija je na mniejszych ekranach. */
.exam-links-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.grading-shortcut-card {
    margin: 16px 0 22px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, var(--accent-light), var(--surface));
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.grading-shortcut-copy strong {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.grading-shortcut-copy p {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 11px;
}

.grading-shortcut-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 11px;
    white-space: nowrap;
    box-shadow: var(--shadow);
}

.grading-shortcut-btn:hover {
    color: #fff;
    filter: brightness(1.05);
}

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent2), #06b6d4);
    z-index: 9999;
    width: 0;
    transition: width 0.1s linear;
}

/* ===== HEADER ===== */
header {
    background: var(--header-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 8px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: space-between;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
}

.header-logo {
    width: 38px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
    flex-shrink: 0;
}

.header-title {
    color: #fff;
}

.header-title strong {
    display: block;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.header-title span {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

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

.btn-icon {
    width: 36px;
    height: 38px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background var(--transition), color var(--transition),
        transform 0.18s ease, box-shadow 0.18s ease;
    transform: translateZ(0);
    will-change: transform;
}

.header-badge {
    background: linear-gradient(135deg, var(--accent), #06b6d4);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: background 0.2s ease;
}

.pwa-standalone .header-badge {
    cursor: default;
}

.header-badge[data-dev-active] {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}

.dev-only-tab {
    display: none !important;
}

/* ===== DEV MODE PANEL ===== */
#dev-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

#dev-overlay.dev-visible {
    opacity: 1;
}

#dev-panel {
    background: var(--nav-bg, #1e2535);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    border-radius: 16px;
    width: min(640px, 94vw);
    max-height: 75vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
    transform: translateY(12px);
    transition: transform 0.25s ease;
}

#dev-overlay.dev-visible #dev-panel {
    transform: translateY(0);
}

#dev-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    flex-shrink: 0;
}

#dev-panel-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent, #6c63ff);
    display: flex;
    align-items: center;
    gap: 8px;
}

#dev-panel-close {
    background: none;
    border: none;
    color: var(--text-muted, rgba(255, 255, 255, 0.5));
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}

#dev-panel-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text, #fff);
}

#dev-panel-banner {
    margin: 14px 20px 0;
    padding: 10px 14px;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.35);
    border-radius: 8px;
    color: #fbbf24;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

#dev-info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    overflow-y: auto;
    flex: 1;
}

#dev-panel>#dev-info-table {
    display: block;
    overflow-y: auto;
    padding: 14px 20px;
}

#dev-info-table tr {
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.07));
}

#dev-info-table tr:last-child {
    border-bottom: none;
}

#dev-info-table th {
    text-align: left;
    color: var(--text-muted, rgba(255, 255, 255, 0.5));
    font-weight: 600;
    padding: 7px 12px 7px 0;
    white-space: nowrap;
    vertical-align: top;
    width: 180px;
}

#dev-info-table td {
    color: var(--text, #e2e8f0);
    padding: 7px 0;
    word-break: break-all;
    vertical-align: top;
}

#dev-panel-footer {
    display: flex;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    flex-shrink: 0;
}

#dev-panel-refresh,
#dev-panel-deactivate {
    flex: 1;
    padding: 9px 14px;
    border-radius: 8px;
    border: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.18s, transform 0.12s;
}

#dev-panel-refresh {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text, #e2e8f0);
}

#dev-panel-refresh:hover {
    background: rgba(255, 255, 255, 0.14);
}

#dev-panel-deactivate {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
}

#dev-panel-deactivate:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* ===== THEME PICKER ===== */
.theme-picker {
    position: relative;
}

.theme-picker-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--nav-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 200;
    min-width: 160px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.theme-picker-dropdown.open {
    display: flex;
}

.theme-picker-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 2px 8px 6px;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 8px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    color: var(--nav-text);
    transition: all var(--transition);
    white-space: nowrap;
    width: 100%;
    text-align: left;
}

.theme-option:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.theme-option.active {
    background: var(--accent-light);
    color: var(--accent);
}

.theme-picker-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 2px;
}

.theme-swatch {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.theme-swatch.light {
    background: linear-gradient(135deg, #f4f6fb, #5b4fcf);
}

.theme-swatch.dark {
    background: linear-gradient(135deg, #0d0f1a, #7c6df0);
}

.theme-swatch.ocean {
    background: linear-gradient(135deg, #071726, #0ea5e9);
}

.theme-swatch.forest {
    background: linear-gradient(135deg, #f0fdf4, #059669);
}

.theme-swatch.sunset {
    background: linear-gradient(135deg, #1a0e08, #f97316);
}

.theme-swatch.rose {
    background: linear-gradient(135deg, #fff0f6, #db2777);
}

.theme-swatch.aurora {
    background: linear-gradient(135deg, #090b1f, #8b5cf6, #22d3ee);
}

/* ===== HERO ===== */
.hero {
    background: var(--hero-overlay), url('assets/background_4.jpg') center/cover no-repeat;
    padding: 14px 24px 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 18% 25%, var(--hero-orb-1) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 30%, var(--hero-orb-2) 0%, transparent 60%),
        radial-gradient(circle at 50% 85%, var(--hero-orb-3) 0%, transparent 45%);
    animation: heroFloat 18s ease-in-out infinite alternate;
}

.hero::after {
    content: '';
    position: absolute;
    inset: auto -15% -40% auto;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent 60%);
    filter: blur(10px);
    opacity: 0.35;
    animation: heroPulse 8s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

.hero-content {
    position: relative;
    max-width: 620px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(91, 79, 207, 0.2);
    border: 1px solid rgba(91, 79, 207, 0.4);
    color: #a78bfa;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.hero h1 {
    font-size: clamp(12px, 2.5vw, 18px);
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 4px;
}

.hero h1 span {
    background: linear-gradient(90deg, #7c6df0, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-sub {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.45);
    max-width: 420px;
    margin: 0 auto;
}

.startup-overlay {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(circle at top, rgba(34, 211, 238, 0.18), transparent 38%), rgba(5, 8, 21, 0.88);
    backdrop-filter: blur(18px);
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

.startup-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.startup-card {
    position: relative;
    width: min(980px, 100%);
    overflow: hidden;
    border-radius: 28px;
    padding: 38px;
    background: linear-gradient(135deg, rgba(17, 21, 45, 0.96), rgba(42, 19, 77, 0.9), rgba(9, 44, 88, 0.92));
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.4);
    color: #fff;
}

.startup-card::before,
.startup-card::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(10px);
    opacity: 0.8;
    pointer-events: none;
}

.startup-card::before {
    width: 240px;
    height: 240px;
    top: -90px;
    right: -60px;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.35), transparent 68%);
}

.startup-card::after {
    width: 220px;
    height: 220px;
    bottom: -100px;
    left: -70px;
    background: radial-gradient(circle, rgba(244, 114, 182, 0.28), transparent 68%);
}

.startup-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 26px;
    align-items: center;
}

.startup-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.startup-title {
    font-size: clamp(30px, 6vw, 56px);
    line-height: 1;
    margin-bottom: 16px;
}

.startup-title span {
    background: linear-gradient(90deg, #22d3ee, #8b5cf6, #f472b6, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 220% 220%;
    animation: hueShift 8s linear infinite;
}

.startup-copy {
    max-width: 560px;
    color: rgba(255, 255, 255, 0.74);
    font-size: 16px;
    margin-bottom: 26px;
}

.startup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.startup-btn {
    border: none;
    border-radius: 999px;
    padding: 13px 18px;
    font-family: var(--font);
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
    transform: translateZ(0);
    will-change: transform;
}

.startup-btn.primary {
    background: linear-gradient(90deg, #8b5cf6, #22d3ee, #f472b6);
    color: #fff;
    box-shadow: 0 12px 30px rgba(34, 211, 238, 0.25);
    background-size: 200% 200%;
    animation: hueShift 10s ease infinite;
}

.startup-btn.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.startup-stats,
.startup-features {
    display: grid;
    gap: 12px;
}

.startup-stat,
.startup-feature {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 16px;
    backdrop-filter: blur(10px);
}

.startup-stat strong {
    display: block;
    font-size: 24px;
}

.startup-stat span,
.startup-feature span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

.startup-feature strong {
    display: block;
    margin: 10px 0 4px;
    font-size: 14px;
}

.startup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
}

@keyframes heroFloat {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    50% {
        transform: translate3d(-2%, 3%, 0) scale(1.02);
    }

    100% {
        transform: translate3d(2%, -2%, 0) scale(1.05);
    }
}

@keyframes heroPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.25;
    }

    50% {
        transform: scale(1.12);
        opacity: 0.4;
    }
}

@keyframes hueShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ===== LAYOUT ===== */
.wiki-layout {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    gap: 0;
    min-height: calc(80vh - 200px);
}

/* ===== SIDEBAR ===== */
.wiki-sidebar {
    border-right: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: var(--chrome-h);
    height: calc(100vh - var(--chrome-h));
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.sidebar-inner {
    padding: 20px 16px;
}

.wiki-search {
    position: relative;
    margin-bottom: 20px;
}

.wiki-search input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface2);
    color: var(--text);
    font-family: var(--font);
    font-size: 13px;
    transition: all var(--transition);
    outline: none;
}

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

.wiki-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px;
}

.sidebar-section-title {
    font-size: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.0px;
    color: var(--text-muted);
    padding: 0 6px;
    margin-bottom: 10px;
}

.wiki-category {
    margin-bottom: 4px;
}

.cat-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all var(--transition);
}

.cat-header:hover {
    background: var(--surface2);
    color: var(--text);
}

.cat-header i:first-child {
    color: var(--accent);
    font-size: 10px;
}

.cat-header .toggle-icon {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.4s;
}

.cat-list {
    list-style: none;
    padding: 0 0 4px 16px;
}

.cat-list.collapsed {
    display: none;
}

.cat-list li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-muted);
    transition: all var(--transition);
}

.cat-list li a:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.cat-list li a.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
}

.article-icon {
    font-size: 10px;
    flex-shrink: 0;
    opacity: 0.7;
}

/* ===== MAIN CONTENT ===== */
.wiki-main {
    padding: 32px 40px;
    max-width: 900px;
    min-width: 0;
    overflow-x: hidden;
}

/* Breadcrumbs */
#breadcrumbs {
    display: none;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

#breadcrumbs i {
    color: var(--accent);
}

#breadcrumbs .sep {
    opacity: 0.4;
}

#currentArticle {
    color: var(--text);
    font-weight: 600;
}

/* ===== ARTICLE STYLES ===== */
#wikiArticle {
    max-width: 100%;
    overflow-x: hidden;
    font-size: var(--wiki-font-size);
}

#wikiArticle>* {
    font-size: inherit;
}

#wikiArticle img {
    max-width: 100%;
    height: auto;
}

#wikiArticle h1 {
    font-size: clamp(calc(1.025em * var(--wiki-font-scale)), 1.9vw, calc(1.275em * var(--wiki-font-scale)));
    font-weight: 800;
    line-height: 1.0;
    margin-bottom: 16px;
    color: var(--text);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 16px;
}

#wikiArticle h2 {
    font-size: calc(1.32em * var(--wiki-font-scale));
    font-weight: 700;
    margin: 20px 0 10px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

#wikiArticle h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 16px;
    background: linear-gradient(180deg, var(--accent), var(--accent2));
    border-radius: 2px;
    flex-shrink: 0;
}

#wikiArticle h3 {
    font-size: calc(1.12em * var(--wiki-font-scale));
    font-weight: 700;
    margin: 14px 0 8px;
    color: var(--text);
}

#wikiArticle p {
    font-size: 1em;
    margin-bottom: 0.7em;
    color: var(--text);
    line-height: 1.3;
}

#wikiArticle ul,
#wikiArticle ol {
    margin: 6px 0 10px 20px;
}

#wikiArticle li {
    margin-bottom: 2px;
    line-height: 1.3;
}

#wikiArticle strong {
    font-weight: 700;
    color: var(--text);
}

#wikiArticle em {
    font-style: italic;
}

/* Blockquote */
#wikiArticle blockquote {
    border-left: 4px solid var(--accent);
    background: var(--accent-light);
    padding: 14px 18px;
    border-radius: 0 8px 8px 0;
    margin: 16px 0;
    font-size: calc(0.98em * var(--wiki-font-scale));
    line-height: 1.35;
}

#wikiArticle blockquote strong {
    color: var(--accent);
}

/* Tables */
#wikiArticle .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 16px 0;
}

#wikiArticle table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 0.85em;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

#wikiArticle th {
    background: var(--accent);
    color: #fff;
    padding: 10px 14px;
    text-align: left;
    font-weight: 700;
}

#wikiArticle td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

#wikiArticle tr:last-child td {
    border-bottom: none;
}

#wikiArticle tr:hover td {
    background: var(--surface2);
}

/* Inline code */
#wikiArticle code:not(pre code) {
    font-family: var(--mono);
    background: var(--surface2);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: calc(0.82em * var(--wiki-font-scale));
    color: var(--accent2);
}

/* Code blocks */
.code-block-wrapper {
    position: relative;
    margin: 16px 0;
}

.code-block-wrapper pre {
    background: var(--code-bg) !important;
    border-radius: var(--radius);
    padding: 20px;
    overflow-x: auto;
    font-family: var(--mono);
    font-size: calc(0.82em * var(--wiki-font-scale));
    line-height: 1.25;
    box-shadow: var(--shadow-lg);
    color: #e6edf7;
}

.code-block-wrapper pre code,
.code-block-wrapper pre code * {
    color: inherit;
}

.copy-code-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    font-family: var(--font);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
}

.copy-code-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.copy-code-btn.copied {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border-color: #10b981;
}

/* Reading time */
.reading-time {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface2);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: calc(0.82em * var(--wiki-font-scale));
    color: var(--text-muted);
    margin-bottom: 20px;
}

.reading-time i {
    color: var(--accent);
}

/* Topics collapse toggle */
.topics-collapse-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-light);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 7px 16px;
    border-radius: 20px;
    font-size: calc(0.85em * var(--wiki-font-scale));
    font-family: var(--font);
    font-weight: 600;
    cursor: pointer;
    margin: 10px 0 16px;
    transition: background 0.2s;
}

.topics-collapse-toggle:hover {
    background: var(--accent);
    color: #fff;
}

/* Table of contents */
.article-toc {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 18px 20px;
    margin: 20px 0 28px;
}

.article-toc h3 {
    font-size: calc(0.48em * var(--wiki-font-scale));
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-toc ul {
    list-style: none;
    padding: 0;
}

.article-toc li {
    margin: 5px 0;
}

.article-toc a {
    font-size: calc(0.47em * var(--wiki-font-scale));
    color: var(--text-muted);
    transition: color var(--transition);
}

.article-toc a:hover {
    color: var(--accent);
}

/* Welcome screen */
.wiki-welcome {
    padding: 6px 0;
}

.wiki-welcome h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wiki-welcome h2 i {
    color: var(--accent);
}

.welcome-text {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 18px;
}

.notice-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 28px;
}

.notice-box h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
}

.notice-box ul {
    margin: 0;
    padding-left: 18px;
}

.notice-box li {
    color: var(--text-muted);
    margin-bottom: 6px;
}

.quick-start h3 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.quick-link-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 14px 16px;
    border-radius: var(--radius);
    transition: all var(--transition);
}

.quick-link-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    transform: translateY(-2px);
}

.quick-link-icon {
    width: 36px;
    height: 36px;
    background: var(--accent-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 16px;
    flex-shrink: 0;
}

.quick-link-content strong {
    display: block;
    font-size: 12px;
    font-weight: 700;
}

.quick-link-content span {
    font-size: 11px;
    color: var(--text-muted);
}

.info-box {
    margin-top: 32px;
    background: var(--accent-light);
    border: 1px solid rgba(91, 79, 207, 0.3);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    font-size: 12px;
}

.info-box i {
    color: var(--accent);
    font-size: 14px;
    margin-top: 2px;
    flex-shrink: 0;
}

.info-box strong {
    display: block;
    margin-bottom: 4px;
}

/* Loading */
.wiki-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-bottom: 16px;
}

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

/* Error */
.wiki-error {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.wiki-error i {
    font-size: 40px;
    color: var(--amber);
    margin-bottom: 16px;
    display: block;
}

.wiki-error h3 {
    font-size: 18px;
    color: var(--text);
    margin-bottom: 8px;
}

/* ===== PAGE TAB BAR ===== */
.page-tab-bar {
    background: var(--surface);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: var(--header-h);
    z-index: 90;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.tab-bar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

.tab-bar-inner::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color var(--transition), background var(--transition),
        transform 0.18s ease, border-color var(--transition),
        box-shadow 0.18s ease;
    white-space: nowrap;
    transform: translateZ(0);
    will-change: transform;
}

.tab-btn i {
    font-size: 13px;
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-btn .tab-badge {
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    line-height: 1.2;
}

/* ===== TAB PANELS ===== */
.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ===== PROJEKT / EGZAMIN PANEL ===== */
.info-panel {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 40px 60px;
}

.info-panel-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 36px;
}

.info-panel-icon {
    width: 56px;
    height: 52px;
    border-radius: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
}

.info-panel-icon.green {
    background: linear-gradient(135deg, #10b981, #059669);
}

.info-panel-icon.purple {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
}

.info-panel-header h2 {
    font-size: 24px;
    font-weight: 800;
}

.info-panel-header p {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
    margin-top: 4px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.info-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    transition: all var(--transition);
}

.info-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    transform: translateY(-1px);
}

.info-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.info-card-header i {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-card-header strong {
    font-size: 14px;
    font-weight: 700;
}

.info-card p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 0;
}

.info-card ul {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 6px 0 0 16px;
}

.info-card ul li {
    margin-bottom: 4px;
}

.milestone-list {
    list-style: none;
    padding: 0;
    margin: 0 0 40px;
}

.milestone-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.milestone-item:last-child {
    border-bottom: none;
}

.milestone-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.milestone-info strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 2px;
}

.milestone-info span {
    display: block;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-muted);
}

.score-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 32px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.score-table th {
    background: var(--accent);
    color: #fff;
    padding: 10px 16px;
    text-align: left;
    font-size: 12px;
}

.score-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    font-size: 13px;
}

.score-table tr:last-child td {
    border-bottom: none;
}

.score-table tr:hover td {
    background: var(--surface2);
}

.score-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
}

.score-badge.high {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.score-badge.mid {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.score-badge.low {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    margin: 32px 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: linear-gradient(180deg, var(--accent), var(--accent2));
    border-radius: 2px;
}

.tool-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent2), var(--accent3));
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(91, 79, 207, 0.10);
    padding: 32px 28px 24px 28px;
    font-size: 1.18em;
    font-weight: 600;
    margin-bottom: 8px;
    border: 2px solid var(--accent3);
    transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
}

.tool-card:hover {
    background: linear-gradient(135deg, var(--accent3), var(--accent2));
    transform: translateY(-2px) scale(1.025);
    box-shadow: 0 8px 32px rgba(91, 79, 207, 0.18);
    border-color: var(--accent2);
}

.tool-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    padding: 14px 28px;
    background: #fff;
    color: var(--accent3);
    border-radius: 12px;
    font-size: 1.08em;
    font-weight: 800;
    align-self: flex-start;
    box-shadow: 0 2px 10px rgba(91, 79, 207, 0.08);
    border: none;
    letter-spacing: 0.02em;
    transition: background var(--transition), color var(--transition), box-shadow 0.15s;
}

.tool-card:hover .tool-card-btn {
    background: var(--accent3);
    color: #fff;
    box-shadow: 0 4px 18px rgba(91, 79, 207, 0.16);
}
#projektMergedWikiCard .markdown-body,
#projektMergedWikiContent {
    background: none !important;
    color: var(--text);
    font-size: 1.13em;
    font-family: var(--font), sans-serif;
    line-height: 1.85;
    box-shadow: none !important;
    border: none !important;
    padding: 0 0 18px 0 !important;
    margin: 0 !important;
    letter-spacing: 0.01em;
    transition: none !important;
}

#projektMergedWikiCard h1, #projektMergedWikiCard h2, #projektMergedWikiCard h3, #projektMergedWikiCard h4, #projektMergedWikiCard h5 {
    color: var(--accent2);
    margin-top: 2.1em;
    margin-bottom: 0.7em;
    font-weight: 800;
    letter-spacing: 0.01em;
}

#projektMergedWikiCard ul, #projektMergedWikiCard ol {
    margin-left: 2.2em;
    margin-bottom: 1.25em;
}

#projektMergedWikiCard table {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(91,79,207,0.06);
    margin-bottom: 2em;
}

#projektMergedWikiCard code, #projektMergedWikiCard pre {
    background: #f4f6fb;
    color: #2a1d6b;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 1em;
}

.tool-card:hover .tool-card-btn {
    background: var(--accent);
    color: #fff;
}

.scoring-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
    align-items: start;
}

.scoring-grid .score-table {
    margin-bottom: 0;
}

.lecturer-grading-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 28px;
}

.lecturer-grading-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.lecturer-grading-header h4 {
    font-size: 15px;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lecturer-grading-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.4;
}

.grading-reset-btn,
.grading-copy-btn {
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--transition), background var(--transition);
}

.grading-reset-btn:hover,
.grading-copy-btn:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
}

.grading-criteria-list {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.grading-row {
    display: grid;
    grid-template-columns: minmax(210px, 1.3fr) 1fr 84px;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface2);
}

.grading-row-title strong {
    display: block;
    font-size: 13px;
    margin-bottom: 3px;
}

.grading-row-title span {
    font-size: 11px;
    color: var(--text-muted);
}

.grading-range {
    width: 100%;
    accent-color: var(--accent);
}

.grading-number {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    font-weight: 700;
    background: var(--surface);
    color: var(--text);
}

.grading-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.grading-summary-stat {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    background: var(--surface2);
}

.grading-summary-stat span {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.grading-summary-stat strong {
    font-size: 17px;
}

.grading-status.pass {
    color: #10b981;
}

.grading-status.fail {
    color: #ef4444;
}

.grading-feedback-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
}

.grading-feedback {
    width: 100%;
    min-height: 80px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    resize: vertical;
    font-family: var(--font);
    background: var(--surface);
    color: var(--text);
    margin-bottom: 10px;
    line-height: 1.45;
}

.topic-accordion {
    margin-bottom: 40px;
}

.topic-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    overflow: hidden;
}

.topic-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    cursor: pointer;
    user-select: none;
    background: var(--surface);
    transition: background var(--transition);
}

.topic-header:hover {
    background: var(--surface2);
}

.topic-header i.cat-icon {
    color: var(--accent);
    width: 20px;
    text-align: center;
}

.topic-header span {
    font-size: 13px;
    font-weight: 600;
    flex: 1;
}

.topic-header .chev {
    margin-left: auto;
    color: var(--text-muted);
    transition: transform 0.3s;
}

.topic-body {
    padding: 0 18px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    background: var(--surface2);
}

.topic-body.open {
    max-height: 600px;
    padding: 14px 18px;
}

.topic-body ul {
    list-style: disc;
    margin: 0 0 0 16px;
}

.topic-body li {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 5px;
    line-height: 1.2;
}

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

.exam-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}

.exam-stat i {
    color: var(--accent);
    font-size: 20px;
    margin-bottom: 8px;
    display: block;
}

.exam-stat strong {
    display: block;
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 4px;
}

.exam-stat span {
    font-size: 11px;
    color: var(--text-muted);
}

.hint-box {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-left: 4px solid #10b981;
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 13px;
    line-height: 1.5;
}

.hint-box i {
    color: #10b981;
    font-size: 14px;
    margin-top: 2px;
    flex-shrink: 0;
}

.hint-box strong {
    display: block;
    margin-bottom: 4px;
}

/* ===== FOOTER ===== */
footer {
    background: var(--header-bg);
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    padding: 14px 24px;
    font-size: 11px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

footer strong {
    color: rgba(255, 255, 255, 0.8);
}

/* ===== MOBILE SIDEBAR TOGGLE ===== */
.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 24px;
    left: 16px;
    width: 52px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 24px rgba(91, 79, 207, 0.4);
    z-index: 50;
    transition: transform var(--transition);
}

.sidebar-toggle:hover {
    transform: scale(1.1);
}

/* ===== BACK TO TOP ===== */
.back-to-top {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 24px rgba(91, 79, 207, 0.4);
    z-index: 49;
    opacity: 0;
    translate: 0 16px;
    pointer-events: none;
    transition: opacity var(--transition), translate var(--transition), scale var(--transition);
}

.back-to-top.visible {
    opacity: 1;
    translate: 0 0;
    pointer-events: auto;
}

.back-to-top:hover {
    translate: 0 -2px;
    scale: 1.1;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .wiki-layout {
        grid-template-columns: 1fr;
    }

    .wiki-sidebar {
        position: fixed;
        left: -320px;
        top: var(--chrome-h);
        width: 300px;
        height: calc(80vh - var(--chrome-h));
        z-index: 40;
        transition: left 0.3s ease;
        box-shadow: var(--shadow-lg);
    }

    .wiki-sidebar.open {
        left: 0;
    }

    .wiki-main {
        padding: 20px 16px 60px;
        max-width: 100%;
        width: 100%;
    }

    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .back-to-top {
        bottom: 84px;
        right: 24px;
    }

    .info-panel {
        padding: 24px 18px 40px;
    }

    .info-panel-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .scoring-grid {
        grid-template-columns: 1fr;
    }

    .grading-row {
        grid-template-columns: 1fr;
    }

    .grading-summary {
        grid-template-columns: 1fr;
    }

    .exam-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 10px 12px 8px;
    }

    .hero-stats {
        gap: 16px;
    }

    .quick-links-grid {
        grid-template-columns: 1fr;
    }

    .exam-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .header-title span {
        display: none;
    }

    .header-badge {
        display: none;
    }

    .theme-picker-dropdown {
        right: 0;
        left: auto;
    }

    .grading-shortcut-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .grading-shortcut-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===== MATERIAŁY PANEL ===== */
.materials-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 20px;
}

.materials-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    transition: all var(--transition);
}

.materials-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.materials-card .info-panel-header {
    margin-bottom: 22px;
}

.files-section {
    margin-bottom: 40px;
}

.files-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
    color: var(--text);
}

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

.file-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    text-decoration: none;
    color: var(--text);
    transition: all var(--transition);
}

.file-item:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    transform: translateY(-2px);
}

.file-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    color: #fff;
}

.file-icon.pdf {
    background: linear-gradient(135deg, #e53e3e, #c53030);
}

.file-icon.pptx {
    background: linear-gradient(135deg, #dd6b20, #c05621);
}

.file-meta {
    flex: 1;
    min-width: 0;
}

.file-meta strong {
    display: block;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta span {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.file-download-icon {
    color: var(--text-muted);
    font-size: 14px;
    flex-shrink: 0;
    transition: color var(--transition);
}

.file-item:hover .file-download-icon {
    color: var(--accent);
}

@media (max-width: 480px) {
    .materials-layout {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .materials-card {
        padding: 16px;
    }

    .file-list {
        grid-template-columns: 1fr;
    }
}

/* ===== PWA STANDALONE & SAFE AREA ===== */
@media all and (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
    }
}

/* ===== MOBILE BOTTOM NAV ===== */
.bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--surface);
        border-top: 1px solid var(--border);
        z-index: 100;
        padding: 4px 0 calc(4px + env(safe-area-inset-bottom));
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.10);
        justify-content: space-around;
        align-items: stretch;
    }

    .bottom-nav-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 6px 2px 4px;
        background: none;
        border: none;
        cursor: pointer;
        font-family: var(--font);
        color: var(--text-muted);
        transition: color var(--transition);
        min-height: 42px;
        -webkit-tap-highlight-color: transparent;
    }

    .bottom-nav-btn i {
        font-size: 18px;
        line-height: 1;
    }

    .bottom-nav-btn span {
        font-size: 9px;
        font-weight: 600;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 64px;
    }

    .bottom-nav-btn.active {
        color: var(--accent);
    }

    .bottom-nav-btn.active i {
        transform: scale(1.1);
    }

    /* hide top tab bar on mobile, use bottom nav */
    .page-tab-bar {
        display: none;
    }

    /* adjust body for bottom nav */
    body {
        padding-bottom: calc(56px + env(safe-area-inset-bottom));
        overflow-x: hidden;
    }

    /* hero compact on mobile */
    .hero {
        padding: 8px 16px 6px;
    }

    .hero h1 {
        font-size: clamp(11px, 2.2vw, 16px);
    }

    .hero-badge {
        font-size: 9px;
        padding: 3px 8px;
        margin-bottom: 4px;
    }

    .hero-sub {
        font-size: 10px;
    }

    .startup-overlay {
        padding: 14px;
    }

    .startup-title {
        font-size: clamp(26px, 10vw, 40px);
    }

    .startup-copy {
        font-size: 14px;
    }

    /* header compact */
    header {
        padding: 6px 0;
    }

    .header-inner {
        padding: 0 12px;
    }

    .header-logo {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .header-title strong {
        font-size: 15px;
    }

    /* improve touch targets */
    .btn-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .cat-header {
        padding: 12px 10px;
        font-size: 12px;
        min-height: 40px;
    }

    .cat-list li a {
        padding: 8px 10px;
        font-size: 12px;
        min-height: 44px;
    }

    .quick-link-card {
        padding: 16px;
        min-height: 52px;
    }

    .topic-header {
        padding: 16px 18px;
        min-height: 48px;
    }

    .topic-header span {
        font-size: 12px;
    }

    /* larger text on mobile for readability — use CSS variable so font-size setting works */
    #wikiArticle p {
        font-size: calc(14px * var(--wiki-font-scale));
        line-height: 1.4;
    }

    #wikiArticle li {
        font-size: calc(13px * var(--wiki-font-scale));
        line-height: 1.3;
    }

    #wikiArticle h2 {
        font-size: calc(17px * var(--wiki-font-scale));
    }

    #wikiArticle h3 {
        font-size: calc(15px * var(--wiki-font-scale));
    }

    #wikiArticle table {
        font-size: calc(12px * var(--wiki-font-scale));
    }

    #wikiArticle th {
        font-size: calc(12px * var(--wiki-font-scale));
    }

    .info-card p,
    .info-card ul {
        font-size: 12px;
    }

    .info-card-header strong {
        font-size: 13px;
    }

    /* back-to-top and sidebar toggle above bottom nav */
    .back-to-top {
        bottom: calc(72px + env(safe-area-inset-bottom));
    }

    .sidebar-toggle {
        bottom: calc(72px + env(safe-area-inset-bottom));
    }

    /* wiki main with bottom padding for bottom nav */
    .wiki-main {
        padding-bottom: calc(60px + env(safe-area-inset-bottom));
    }

    /* info panel mobile */
    .info-panel {
        padding: 20px 16px calc(72px + env(safe-area-inset-bottom));
    }

    .info-panel-header h2 {
        font-size: 18px;
    }

    /* Nowe komponenty z interfejsu webowego dostają mobilne odstępy i układ przyjazny dla kciuka. */
    .section-title {
        align-items: flex-start;
        font-size: 15px;
        line-height: 1.25;
        margin: 24px 0 12px;
    }

    .milestone-item {
        gap: 12px;
        padding: 14px 0;
    }

    .milestone-dot {
        width: 32px;
        height: 32px;
    }

    .tool-card {
        border-width: 1px;
        border-radius: 16px;
        padding: 20px 18px;
        font-size: 1em;
    }

    .tool-card .info-card-header {
        align-items: flex-start;
    }

    .tool-card-btn {
        width: 100%;
        justify-content: center;
        margin-top: 14px;
        padding: 12px 14px;
        font-size: 0.95em;
    }

    .grading-shortcut-card,
    .lecturer-grading-card {
        border-radius: 14px;
        padding: 16px;
        margin-bottom: 22px;
    }

    .lecturer-grading-header {
        flex-direction: column;
        align-items: stretch;
    }

    .grading-reset-btn,
    .grading-copy-btn {
        width: 100%;
        min-height: 44px;
    }

    .grading-row {
        gap: 8px;
        padding: 12px;
    }

    .grading-range {
        min-height: 32px;
    }

    .grading-number {
        min-height: 44px;
        font-size: 16px;
    }

    .grading-feedback {
        min-height: 120px;
        font-size: 13px;
    }

    /* Tabele z nowych kart webowych przewijają się poziomo zamiast rozszerzać viewport telefonu. */
    .score-table,
    #projektMergedWikiCard table,
    #egzaminMergedWikiCard table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .score-table th,
    .score-table td {
        white-space: nowrap;
        padding: 9px 12px;
    }

    #projektMergedWikiCard,
    #egzaminMergedWikiCard {
        overflow: hidden;
    }

    #projektMergedWikiCard .markdown-body,
    #projektMergedWikiContent,
    #egzaminMergedWikiCard .markdown-body,
    #egzaminMergedWikiContent {
        font-size: var(--wiki-font-size);
        line-height: 1.6;
    }

    #projektMergedWikiCard ul,
    #projektMergedWikiCard ol,
    #egzaminMergedWikiCard ul,
    #egzaminMergedWikiCard ol {
        margin-left: 1.4em;
    }

    .materials-layout {
        gap: 16px;
    }

    .materials-card {
        padding: 16px;
    }

    body .presentation-controls {
        gap: 8px;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .presentation-btn {
        flex: 0 0 auto;
        min-height: 40px;
        padding: 8px 12px;
    }

    body #presentation-preview {
        min-height: 260px;
        max-height: 62vh;
        border-radius: 10px;
    }

    .file-item {
        min-height: 64px;
        padding: 12px 14px;
    }

    .file-meta strong {
        white-space: normal;
        line-height: 1.25;
    }

    /* wiki sidebar in mobile adjustments */
    .wiki-sidebar {
        top: var(--header-h);
        height: calc(80vh - var(--header-h));
    }

    .wiki-search input {
        padding: 12px 14px 12px 40px;
        font-size: 16px;
    }

    /* tab panel transitions */
    .tab-panel {
        animation: none;
    }

    .tab-panel.active {
        animation: fadeIn 0.2s ease;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ===== ENHANCED ANIMATIONS ===== */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.wiki-welcome {
    animation: slideInUp 0.3s ease;
}

.info-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.info-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.quick-link-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background var(--transition);
}

.quick-link-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.bottom-nav-btn:active {
    transform: scale(0.90);
}

/* ===== PULL-DOWN PANEL (mobile) ===== */
.pull-panel-overlay {
    display: none;
}

.pull-panel {
    display: none;
}

@media (hover: hover) and (pointer: fine) {
    .btn-icon:hover {
        background: rgba(255, 255, 255, 0.15);
        color: #fff;
        transform: translateY(-1px);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
    }

    .tab-btn:hover {
        color: var(--accent);
        background: var(--accent-light);
        transform: translateY(-1px);
    }

    .startup-btn:hover {
        transform: translateY(-2px) scale(1.01);
    }

    .pull-shortcut:hover {
        color: var(--accent);
        border-color: rgba(91, 79, 207, 0.28);
        transform: translateY(-1px);
    }
}

/* ===== TOC & SETTINGS FABs (hidden on desktop) ===== */
.toc-fab,
.toc-radial-overlay,
.toc-radial-menu,
.settings-fab,
.settings-panel-overlay,
.settings-panel {
    display: none;
}

@media (max-width: 768px) {
    .pull-panel-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 85;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .pull-panel-overlay.open {
        opacity: 1;
        pointer-events: auto;
    }

    body.pull-panel-open .bottom-nav {
        z-index: 84;
    }

    .pull-panel {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 90;
        background: var(--surface);
        border-radius: 0 0 24px 24px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        padding-top: var(--header-h);
        transform: translateY(calc(-100% + var(--header-h) + 24px));
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
            box-shadow 0.35s ease;
        will-change: transform;
        max-height: 80vh;
    }

    .pull-panel.open {
        transform: translateY(0);
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    }

    .pull-handle {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 10px 20px;
        cursor: pointer;
        touch-action: pan-y;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

    .pull-pill {
        width: 40px;
        height: 4px;
        border-radius: 2px;
        background: var(--border);
        transition: background 0.25s, width 0.25s;
    }

    .pull-panel.open .pull-pill {
        background: var(--accent);
        width: 32px;
    }

    .pull-panel-body {
        padding: 4px 20px 24px;
        overflow-y: auto;
        max-height: calc(80vh - var(--header-h) - 44px);
    }

    .pull-panel-title {
        font-size: 11px;
        font-weight: 700;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.8px;
        margin-bottom: 14px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

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

    .pull-search-wrap {
        position: relative;
        margin-bottom: 16px;
    }

    .pull-search-wrap>i {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-muted);
        font-size: 13px;
        pointer-events: none;
    }

    .pull-search-wrap input {
        width: 100%;
        padding: 10px 14px 10px 36px;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        background: var(--surface2);
        color: var(--text);
        font-family: var(--font);
        font-size: 14px;
        outline: none;
        transition: border-color var(--transition);
    }

    .pull-search-wrap input:focus {
        border-color: var(--accent);
    }

    .pull-shortcuts {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }

    .pull-shortcut {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
        padding: 12px 4px;
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: 12px;
        cursor: pointer;
        font-family: var(--font);
        color: var(--text-muted);
        transition: background var(--transition), color var(--transition),
            transform 0.15s ease, border-color var(--transition);
        -webkit-tap-highlight-color: transparent;
        transform: translateZ(0);
        will-change: transform;
    }

    .pull-shortcut i {
        font-size: 18px;
    }

    .pull-shortcut span {
        font-size: 9px;
        font-weight: 600;
        white-space: nowrap;
    }

    .pull-shortcut.active {
        background: var(--accent-light);
        color: var(--accent);
        border-color: var(--accent);
    }

    .pull-shortcut:active {
        transform: scale(0.93);
    }

    /* ===== CODE BLOCKS on mobile ===== */
    .code-block-wrapper pre {
        font-size: calc(10.5px * var(--wiki-font-scale));
        padding: 14px 12px;
        line-height: 1.4;
    }

    /* ===== ARTICLE TOC compact ===== */
    .article-toc {
        padding: 12px 14px;
        margin: 12px 0 18px;
    }

    .article-toc li {
        margin: 2px 0;
    }

    .article-toc a {
        font-size: calc(6px * var(--wiki-font-scale));
        line-height: 1.6;
    }

    .article-toc h3 {
        font-size: calc(5.5px * var(--wiki-font-scale));
        margin-bottom: 8px;
    }

    /* ===== RADIAL TOC MENU (mobile, wiki tab) ===== */
    .toc-fab {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: calc(72px + env(safe-area-inset-bottom));
        left: 20px;
        width: 52px;
        height: 52px;
        background: linear-gradient(135deg, var(--accent), var(--accent2));
        border: none;
        border-radius: 50%;
        color: #fff;
        font-size: 18px;
        cursor: pointer;
        box-shadow: 0 4px 20px rgba(91, 79, 207, 0.4);
        z-index: 60;
        overflow: visible;
        isolation: isolate;
        transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease, left 0.25s ease, right 0.25s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .toc-fab::before,
    .toc-fab::after {
        content: '';
        position: absolute;
        inset: -6px;
        border-radius: inherit;
        pointer-events: none;
        opacity: 0;
    }

    .toc-fab::before {
        background: radial-gradient(circle, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 70%);
        animation: tocFabPulse 2.8s ease-out infinite;
    }

    .toc-fab::after {
        border: 1px solid rgba(255, 255, 255, 0.32);
        transform: scale(0.88);
        transition: opacity 0.25s ease, transform 0.25s ease;
    }

    .toc-fab i {
        position: relative;
        z-index: 1;
        transition: transform 0.25s ease;
    }

    .toc-fab:active {
        transform: scale(0.92);
    }

    .toc-fab:hover {
        box-shadow: 0 8px 28px rgba(91, 79, 207, 0.45);
        filter: saturate(1.08);
    }

    .toc-fab.open {
        transform: rotate(45deg) scale(1.04);
        box-shadow: 0 6px 30px rgba(91, 79, 207, 0.55);
    }

    .toc-fab.open::after {
        opacity: 1;
        transform: scale(1.08);
    }

    .toc-fab.open i {
        transform: rotate(-45deg) scale(1.08);
    }

    .toc-fab.bump {
        animation: tocFabBump 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    body.pwa-standalone.body-wiki-tab .toc-fab {
        left: auto;
        right: 20px;
    }

    body.pwa-standalone.body-wiki-tab .toc-radial-menu {
        left: auto;
        right: 20px;
        transform-origin: bottom right;
    }

    @keyframes tocFabPulse {
        0% {
            opacity: 0;
            transform: scale(0.88);
        }

        18% {
            opacity: 0.45;
        }

        55% {
            opacity: 0;
            transform: scale(1.22);
        }

        100% {
            opacity: 0;
            transform: scale(1.22);
        }
    }

    @keyframes tocFabBump {
        0% {
            transform: scale(1);
        }

        30% {
            transform: scale(1.14);
        }

        100% {
            transform: scale(1);
        }
    }

    .toc-radial-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 59;
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }

    .toc-radial-overlay.open {
        opacity: 1;
        pointer-events: auto;
    }

    .toc-radial-menu {
        display: none;
        position: fixed;
        bottom: calc(132px + env(safe-area-inset-bottom));
        left: 20px;
        width: calc(100vw - 40px);
        max-width: 360px;
        max-height: 50vh;
        background: var(--surface);
        border-radius: 20px;
        border: 1px solid var(--border);
        box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
        z-index: 61;
        overflow: hidden;
        transform: scale(0.85) translateY(20px);
        opacity: 0;
        transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
        transform-origin: bottom left;
    }

    .toc-radial-menu.open {
        transform: scale(1) translateY(0);
        opacity: 1;
    }

    .toc-radial-header {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 14px 16px 10px;
        border-bottom: 1px solid var(--border);
        font-size: 11px;
        font-weight: 700;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.8px;
    }

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

    .toc-radial-list {
        list-style: none;
        overflow-y: auto;
        max-height: calc(50vh - 50px);
        padding: 8px 0;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .toc-radial-list li {
        margin: 0;
    }

    .toc-radial-list li a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 11px 16px;
        font-size: 13px;
        color: var(--text);
        text-decoration: none;
        transition: background 0.15s ease, color 0.15s ease;
        border-left: 3px solid transparent;
    }

    .toc-radial-list li a:hover,
    .toc-radial-list li a:active {
        background: var(--accent-light);
        color: var(--accent);
    }

    .toc-radial-list li a.active-heading {
        border-left-color: var(--accent);
        background: var(--accent-light);
        color: var(--accent);
        font-weight: 600;
    }

    .toc-radial-list li a .toc-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--accent);
        flex-shrink: 0;
        opacity: 0.5;
    }

    .toc-radial-list li a.active-heading .toc-dot {
        opacity: 1;
        width: 8px;
        height: 8px;
    }

    .toc-radial-list li.toc-h3 a {
        padding-left: 32px;
        font-size: 12px;
        color: var(--text-muted);
    }

    .toc-radial-empty {
        padding: 24px 16px;
        text-align: center;
        color: var(--text-muted);
        font-size: 13px;
    }

    .toc-radial-empty i {
        display: block;
        font-size: 28px;
        margin-bottom: 8px;
        opacity: 0.4;
    }

    /* ===== SETTINGS FAB (mobile) ===== */
    .settings-fab {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: calc(132px + env(safe-area-inset-bottom));
        right: 20px;
        width: 44px;
        height: 44px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 50%;
        color: var(--text-muted);
        font-size: 16px;
        cursor: pointer;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
        z-index: 60;
        transition: transform 0.25s ease, background 0.2s ease, color 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .settings-fab:active {
        transform: scale(0.92);
    }

    .settings-fab.open {
        background: var(--accent);
        color: #fff;
        border-color: var(--accent);
    }

    /* ===== SETTINGS PANEL (mobile) ===== */
    .settings-panel-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 89;
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }

    .settings-panel-overlay.open {
        opacity: 1;
        pointer-events: auto;
    }

    .settings-panel {
        display: none;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--surface);
        border-radius: 24px 24px 0 0;
        box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.2);
        z-index: 91;
        transform: translateY(100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        max-height: 80vh;
        overflow: hidden;
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }

    .settings-panel.open {
        transform: translateY(0);
    }

    .settings-panel-handle {
        display: flex;
        justify-content: center;
        padding: 12px 0 4px;
    }

    .settings-panel-handle .pill {
        width: 36px;
        height: 4px;
        border-radius: 2px;
        background: var(--border);
    }

    .settings-panel-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 8px 20px 12px;
        border-bottom: 1px solid var(--border);
    }

    .settings-panel-header h3 {
        font-size: 16px;
        font-weight: 700;
        display: flex;
        align-items: center;
        gap: 8px;
        color: var(--text);
    }

    .settings-panel-header h3 i {
        color: var(--accent);
    }

    .settings-close {
        width: 36px;
        height: 36px;
        border: none;
        background: var(--surface2);
        border-radius: 50%;
        color: var(--text-muted);
        font-size: 14px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.2s ease;
    }

    .settings-close:active {
        background: var(--border);
    }

    .settings-body {
        padding: 16px 20px;
        overflow-y: auto;
        max-height: calc(80vh - 100px);
    }

    .settings-section {
        margin-bottom: 20px;
    }

    .settings-section-title {
        font-size: 10px;
        font-weight: 700;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.8px;
        margin-bottom: 10px;
    }

    .settings-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 0;
        border-bottom: 1px solid var(--border);
    }

    .settings-row:last-child {
        border-bottom: none;
    }

    .settings-row-label {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 14px;
        color: var(--text);
    }

    .settings-row-label i {
        color: var(--accent);
        font-size: 16px;
        width: 20px;
        text-align: center;
    }

    /* Toggle Switch */
    .toggle-switch {
        position: relative;
        width: 48px;
        height: 28px;
        background: var(--border);
        border-radius: 14px;
        cursor: pointer;
        transition: background 0.25s ease;
        flex-shrink: 0;
        border: none;
        padding: 0;
        -webkit-tap-highlight-color: transparent;
    }

    .toggle-switch::after {
        content: '';
        position: absolute;
        top: 3px;
        left: 3px;
        width: 22px;
        height: 22px;
        background: #fff;
        border-radius: 50%;
        transition: transform 0.25s ease;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    }

    .toggle-switch.active {
        background: var(--accent);
    }

    .toggle-switch.active::after {
        transform: translateX(20px);
    }

    /* Font Size Selector */
    .font-size-btns {
        display: flex;
        gap: 6px;
    }

    .font-size-btn {
        padding: 6px 14px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--surface2);
        color: var(--text);
        font-family: var(--font);
        font-size: 12px;
        cursor: pointer;
        transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .font-size-btn.active {
        background: var(--accent-light);
        border-color: var(--accent);
        color: var(--accent);
        font-weight: 600;
    }


    /* Notification permission status */
    .notif-perm-status {
        font-size: 11px;
        margin: 6px 0 0;
        color: var(--text-muted);
        min-height: 16px;
        transition: color 0.2s;
    }

    .toggle-switch:disabled {
        opacity: 0.4;
        cursor: default;
    }

    /* Dev mode trigger in settings panel */
    .settings-row-version {
        cursor: pointer;
        user-select: none;
        -webkit-user-select: none;
        position: relative;
        -webkit-tap-highlight-color: transparent;
    }

    .settings-row-version:active {
        background: var(--surface2);
        border-radius: 8px;
    }

    .dev-version-badge {
        font-size: 12px;
        font-weight: 600;
        color: var(--text-muted);
        background: var(--surface2);
        padding: 3px 10px;
        border-radius: 12px;
        transition: background 0.2s ease, color 0.2s ease;
        white-space: nowrap;
    }

    .settings-row-version[data-dev-active] .dev-version-badge {
        background: rgba(220, 38, 38, 0.15);
        color: #ef4444;
    }

    .settings-row-version[data-dev-active] .settings-row-label i {
        color: #ef4444;
    }

    .settings-row-version[data-taps-left] .dev-version-badge {
        background: var(--accent-light);
        color: var(--accent);
    }

    .settings-row-version[data-taps-left] {
        background: var(--surface2);
        border-radius: 8px;
    }

    /* ===== PULL-DOWN PANEL: CATEGORIES ===== */
    .pull-categories {
        margin-top: 14px;
        border-top: 1px solid var(--border);
        padding-top: 12px;
    }

    .pull-categories-title {
        font-size: 10px;
        font-weight: 700;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.8px;
        margin-bottom: 10px;
        display: flex;
        align-items: center;
        gap: 6px;
    }

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

    .pull-cat-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .pull-cat-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 10px 4px;
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: 10px;
        cursor: pointer;
        font-family: var(--font);
        color: var(--text-muted);
        transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .pull-cat-btn i {
        font-size: 16px;
    }

    .pull-cat-btn span {
        font-size: 8px;
        font-weight: 600;
        text-align: center;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .pull-cat-btn:active {
        transform: scale(0.94);
    }

    .pull-cat-btn.active {
        background: var(--accent-light);
        color: var(--accent);
        border-color: var(--accent);
    }

    .pull-options-row {
        margin-top: 12px;
        border-top: 1px solid var(--border);
        padding-top: 12px;
    }

    .pull-options-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        padding: 10px 14px;
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: 10px;
        cursor: pointer;
        font-family: var(--font);
        color: var(--text-muted);
        font-size: 13px;
        font-weight: 600;
        transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .pull-options-btn:active {
        transform: scale(0.97);
    }
}

/* Sekcja materiałów jest dwukolumnowa, a podgląd rozciąga się horyzontalnie pod dwoma kartami. */
.materials-layout {
    grid-template-columns: repeat(2, minmax(320px, 1fr));
}

.materials-preview-card {
    grid-column: 1 / -1;
}

/* Kontener przycisków ułatwia szybkie przełączanie podglądu prezentacji live. */
.presentation-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

/* Każdy przycisk reprezentuje jedną prezentację i pokazuje aktywny wybór. */
.presentation-btn {
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition);
}

.presentation-btn:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.presentation-btn.active {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent2);
    font-weight: 700;
}

/* Iframe ma spójny wygląd, pełną szerokość karty i proporcję 16:9 dla prezentacji. */
#presentation-preview {
    border: 1px solid var(--border);
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 560px;
    border-radius: 12px;
    background: #fff;
    display: block;
    margin-top: 10px;
}

@media (max-width: 900px) {
    .materials-layout {
        grid-template-columns: 1fr;
    }
}

/* Interaktywne animacje kart reagujące na pozycję kursora. */
@media (hover: hover) and (pointer: fine) {
    .quick-link-card,
    .info-card,
    .tool-card,
    .materials-card,
    .file-item {
        position: relative;
        overflow: hidden;
        transform-style: preserve-3d;
        transition: transform 0.16s ease, box-shadow 0.18s ease, background 0.2s ease;
    }

    .quick-link-card::after,
    .info-card::after,
    .tool-card::after,
    .materials-card::after,
    .file-item::after {
        content: '';
        position: absolute;
        inset: 0;
        pointer-events: none;
        border-radius: inherit;
        background: radial-gradient(
            260px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
            rgba(255, 255, 255, 0.16) 0%,
            rgba(255, 255, 255, 0) 60%
        );
        opacity: 0;
        transition: opacity 0.2s ease;
    }

    .quick-link-card.mouse-reactive-active,
    .info-card.mouse-reactive-active,
    .tool-card.mouse-reactive-active,
    .materials-card.mouse-reactive-active,
    .file-item.mouse-reactive-active {
        transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) translateY(-2px);
    }

    .quick-link-card.mouse-reactive-active::after,
    .info-card.mouse-reactive-active::after,
    .tool-card.mouse-reactive-active::after,
    .materials-card.mouse-reactive-active::after,
    .file-item.mouse-reactive-active::after {
        opacity: 1;
    }
}
