/* ==========================================================================
   JSWizard XP - Windows XP Professional ("Royale Noir / Luna" + Merlin 🧙)
   Symulator Skryptów JavaScript DOM & Kalkulatorów dla CKE INF.03
   Stylistyka: Szkolna pracownia z erą Windows XP, błyszczące belki Royale Noir,
   zielony przycisk Start, Internet Explorer 6 oraz Asystent Merlin.
   ========================================================================== */

:root {
    /* Paleta kolorów Windows XP Royale Noir & Luna */
    --xp-bg: #0b101e;
    --xp-surface: #131b2e;
    --xp-surface-elevated: #1c2742;
    --xp-border: #2c3e66;
    --xp-border-blue: #3b6ea5;
    --xp-frame-outer: #1d3975;

    /* Kultowe gradienty Windows XP Royale / Luna */
    --xp-titlebar-grad: linear-gradient(180deg, #3a66b8 0%, #1e3c78 48%, #122959 52%, #244a94 100%);
    --xp-taskbar-grad: linear-gradient(180deg, #1f3b73 0%, #112247 50%, #0b1733 100%);
    --xp-start-grad: linear-gradient(180deg, #52b848 0%, #348f2c 50%, #246e1d 100%);
    --xp-close-grad: linear-gradient(180deg, #f16c5d 0%, #d43828 50%, #b02214 100%);

    /* Akcenty Merlina i statusy CKE */
    --xp-gold: #f59e0b;
    --xp-gold-light: #fde047;
    --xp-gold-glow: rgba(245, 158, 11, 0.35);
    --xp-merlin-purple: #8b5cf6;
    --xp-blue: #2563eb;
    --xp-green: #16a34a;
    --xp-crimson: #dc2626;

    --xp-text: #f8fafc;
    --xp-text-muted: #94a3b8;
    --xp-text-dim: #64748b;

    /* Typografia Windows XP */
    --xp-font: "Tahoma", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
    --xp-font-mono: 'JetBrains Mono', 'Consolas', 'Lucida Console', monospace;

    --xp-radius-win: 6px 6px 2px 2px;
    --xp-transition: all 0.16s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ==========================================================================
   Reset i Baza Pulpitu Windows XP Royale Noir
   ========================================================================== */
body.theme-jswizard {
    background: radial-gradient(circle at 80% 15%, #16264c 0%, #0b101e 65%, #070a14 100%);
    color: var(--xp-text);
    font-family: var(--xp-font);
    margin: 0;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Paski przewijania w stylu Royale Noir */
.scroller::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.scroller::-webkit-scrollbar-track {
    background: #0f1626;
}
.scroller::-webkit-scrollbar-thumb {
    background: #2b4270;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.scroller::-webkit-scrollbar-thumb:hover {
    background: #3d5c99;
}

/* ==========================================================================
   Pasek Zadań Windows XP (Top Taskbar)
   ========================================================================== */
.top-navbar {
    height: 46px !important;
    padding: 0 10px !important;
    background: var(--xp-taskbar-grad) !important;
    border-bottom: 2px solid #3c68b8 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 3px 10px rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-sizing: border-box;
}

.navbar-brand-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.xp-portal-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: linear-gradient(180deg, #264278 0%, #15274a 100%);
    color: #dbeafe;
    border: 1px solid #3b62a8;
    border-radius: 4px;
    font-size: 0.76rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: var(--xp-transition);
}

.xp-portal-btn:hover {
    background: linear-gradient(180deg, #34589e 0%, #1e3769 100%);
    border-color: var(--xp-gold);
    color: #ffffff;
}

body.theme-jswizard.embed-mode .xp-portal-btn {
    display: none;
}

/* Kultowy zielony przycisk Start z Windows XP */
.brand.xp-start-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 14px 4px 10px;
    background: var(--xp-start-grad);
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 700;
    border-radius: 0 14px 14px 0;
    border: 1px solid #74d66a;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.55), 0 2px 6px rgba(0, 0, 0, 0.5);
    user-select: none;
    cursor: default;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

.brand-icon {
    font-size: 1.15rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

.brand-text {
    font-family: var(--xp-font);
    font-weight: 700;
    letter-spacing: 0.02em;
}

.brand-accent {
    color: #fde047;
    font-weight: 800;
}

.brand-badge {
    background: rgba(0, 0, 0, 0.45);
    color: #fde047;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(253, 224, 71, 0.35);
    letter-spacing: 0.04em;
}

/* Panel licznika LED w zasobniku XP */
.xp-led-panel {
    background: #080d1a;
    border: 1px solid #2c4778;
    border-radius: 4px;
    padding: 4px 10px;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.8);
    display: inline-flex;
    align-items: center;
}

.brand-progress-badge {
    font-family: var(--xp-font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    color: #fde047;
    letter-spacing: 0.04em;
    text-shadow: 0 0 6px rgba(253, 224, 71, 0.4);
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

/* Pasek 30 przycisków zadań 1..30 */
.levels-bar-container {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    overflow-x: auto;
    flex: 1;
    min-width: 0;
}

.level-pills {
    display: flex;
    align-items: center;
    gap: 3px;
}

.level-pill {
    width: 25px !important;
    height: 27px !important;
    font-family: var(--xp-font) !important;
    font-size: 0.71rem !important;
    font-weight: 700 !important;
    border-radius: 3px !important;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #27447e 0%, #172a52 100%) !important;
    color: #dbeafe !important;
    border: 1px solid #3c61a6 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: var(--xp-transition);
}

.level-pill:hover {
    background: linear-gradient(180deg, #355ba6 0%, #213c73 100%) !important;
    border-color: #93c5fd !important;
    color: #ffffff !important;
}

.level-pill.active {
    background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%) !important;
    color: #090d16 !important;
    border-color: #fef08a !important;
    box-shadow: 0 0 10px var(--xp-gold-glow) !important;
    font-weight: 900 !important;
    transform: none !important;
}

.level-pill.completed {
    background: linear-gradient(180deg, #22c55e 0%, #15803d 100%) !important;
    color: #ffffff !important;
    border-color: #86efac !important;
}

.level-pill.completed::after {
    display: none !important;
}

.level-pill.completed.active {
    border-color: #fef08a !important;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.75) !important;
}

.level-pill.locked {
    background: #10192b !important;
    color: #475569 !important;
    font-size: 0.56rem !important;
    border-color: #1e293b !important;
    box-shadow: none !important;
    cursor: not-allowed;
}

/* Przyciski systemowe po prawej (Tray XP) */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.btn-icon {
    width: 30px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px !important;
    background: linear-gradient(180deg, #264278 0%, #15274a 100%);
    border: 1px solid #3b62a8;
    color: #ffffff;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--xp-transition);
}

.btn-icon:hover {
    background: linear-gradient(180deg, #34589e 0%, #1e3769 100%);
    border-color: var(--xp-gold);
}

.btn-icon-danger:hover {
    background: var(--xp-close-grad);
    border-color: #fca5a5;
}

/* ==========================================================================
   Układ 4 Kwadrantów Pulpitu Windows XP (2x2)
   ========================================================================== */
.game-container {
    height: calc(100vh - 46px);
    width: 100vw;
    overflow: hidden;
}

.game-workspace {
    display: grid !important;
    grid-template-columns: 44% 56% !important;
    gap: 9px !important;
    height: 100% !important;
    width: 100% !important;
    padding: 8px !important;
    box-sizing: border-box !important;
    background: transparent !important;
}

.workspace-column {
    display: flex;
    flex-direction: column;
    gap: 9px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

/* Karta Okna Windows XP Royale */
.quadrant-card {
    background: var(--xp-surface);
    border: 2px solid #2b4c8c;
    border-radius: var(--xp-radius-win) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    min-height: 0;
    overflow: hidden;
}

/* Błyszcząca belka tytułowa okna Windows XP Royale Noir / Luna */
.xp-titlebar {
    background: var(--xp-titlebar-grad);
    border-bottom: 1px solid #0f2147;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38);
    color: #ffffff;
    padding: 5px 8px 5px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    user-select: none;
    flex-shrink: 0;
}

.xp-titlebar-left {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    overflow: hidden;
}

.xp-app-icon {
    font-size: 0.95rem;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

.xp-app-title {
    font-family: var(--xp-font);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.xp-controls {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

.xp-ctrl-btn {
    width: 20px;
    height: 19px;
    background: linear-gradient(180deg, #4b79c9 0%, #24478a 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 3px;
    font-family: var(--xp-font);
    font-size: 0.68rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.xp-ctrl-close {
    background: var(--xp-close-grad);
    border-color: #fca5a5;
    cursor: pointer;
}

.xp-ctrl-close:hover {
    filter: brightness(1.15);
}

/* ==========================================================================
   KWADRANT 1 (Góra-Lewo): Okno Arkusz_CKE.chm (Specyfikacja i Zadanie)
   ========================================================================== */
.quadrant-task {
    flex: 0 0 auto;
    max-height: 46%;
}

.task-window-body {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    overflow-y: auto;
    min-height: 0;
    background: #111829;
}

.task-top-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: wrap;
}

.level-header-tags {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    margin: 0 !important;
}

.tag-pill {
    font-family: var(--xp-font);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px !important;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tag-level {
    background: var(--xp-gold);
    color: #090d16;
    font-weight: 800;
}

.tag-phase {
    background: #1e2e4f;
    color: #93c5fd;
    border: 1px solid rgba(147, 197, 253, 0.28);
}

.tag-exam {
    background: #232b42;
    color: #e2e8f0;
    font-family: var(--xp-font-mono);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tag-points {
    background: var(--xp-green);
    color: #ffffff;
    font-family: var(--xp-font-mono);
    font-size: 0.7rem;
    font-weight: 800;
}

/* Dokument polecenia CKE */
.xp-doc-well {
    background: #0c1221;
    border: 1px solid #243559;
    border-left: 3px solid var(--xp-gold);
    border-radius: 3px;
    padding: 8px 11px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #e5e7eb;
}

.quadrant-task .level-title {
    font-size: 0.92rem !important;
    font-weight: 700;
    color: #ffffff;
    margin: 0 !important;
}

.quadrant-task .level-instruction {
    font-size: 0.81rem !important;
    line-height: 1.48;
    color: #cbd5e1;
    margin: 0 !important;
}

/* Zwijana lista wymagań CKE (Domyślnie zamknięta - Zasada Anty-Spoilera) */
details.cke-checklist-box {
    background: #090e1a;
    border: 1px solid #26385e;
    border-radius: 3px;
    padding: 0;
    margin-top: 2px;
    transition: var(--xp-transition);
}

details.cke-checklist-box[open] {
    border-color: var(--xp-gold);
    background: #0d1426;
}

summary.cke-checklist-header {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #cbd5e1;
    letter-spacing: 0.03em;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    list-style: none;
}

summary.cke-checklist-header::-webkit-details-marker {
    display: none;
}

summary.cke-checklist-header:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.cke-checklist-title {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cke-checklist-title::before {
    content: "▶";
    font-size: 0.6rem;
    color: var(--xp-gold);
    transition: transform 0.2s ease;
    display: inline-block;
}

details[open] .cke-checklist-title::before {
    transform: rotate(90deg);
}

.cke-checklist-badge {
    background: #1d2b4a;
    color: #fde047;
    font-family: var(--xp-font-mono);
    font-size: 0.67rem;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 3px;
    margin-left: auto;
    border: 1px solid rgba(253, 224, 71, 0.25);
}

.cke-checklist-badge.all-passed {
    background: var(--xp-green);
    color: #ffffff;
    border-color: #86efac;
}

.cke-checklist-toggle-hint {
    font-size: 0.64rem;
    color: #64748b;
    font-weight: 600;
    text-transform: lowercase;
}

details[open] .cke-checklist-toggle-hint {
    display: none;
}

.cke-checklist {
    list-style: none;
    padding: 4px 10px 8px 10px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.cke-checklist-item {
    font-size: 0.76rem;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 3px 6px;
    background: rgba(255, 255, 255, 0.02);
    border-left: 2px solid #475569;
    color: #94a3b8;
}

.cke-checklist-item.completed {
    background: rgba(22, 163, 74, 0.16);
    border-left-color: #22c55e;
    color: #dcfce7;
}

.cke-check-icon {
    font-weight: 900;
    font-size: 0.8rem;
    color: #64748b;
    flex-shrink: 0;
}

.cke-checklist-item.completed .cke-check-icon {
    color: #4ade80;
}

/* Dymek Asystenta Merlina (Pułapka CKE & Podpowiedzi) */
.cke-trap-box {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.16) 0%, rgba(245, 158, 11, 0.09) 100%);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-left: 3px solid var(--xp-merlin-purple);
    border-radius: 4px;
    padding: 7px 10px;
    margin: 6px 0 0 0 !important;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.78rem;
    color: #ede9fe;
    line-height: 1.45;
    animation: merlinFadeIn 0.2s ease-out;
}

@keyframes merlinFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cke-trap-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.cke-trap-badge {
    color: #fde047;
    font-weight: 800;
    font-size: 0.76rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.cke-trap-close-btn {
    background: transparent;
    border: none;
    color: #a78bfa;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 1px 5px;
    border-radius: 2px;
    line-height: 1;
    transition: all 0.15s ease;
}

.cke-trap-close-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

.cke-trap-desc {
    color: #e0e7ff;
    font-size: 0.77rem;
    line-height: 1.4;
}

.cke-hints-extra {
    border-top: 1px dashed rgba(139, 92, 246, 0.35);
    padding-top: 6px;
    margin-top: 2px;
}

.merlin-hints-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.merlin-hints-title {
    color: #fbbf24;
    font-weight: 700;
    font-size: 0.74rem;
    margin-bottom: 2px;
}

.merlin-hint-step {
    font-size: 0.75rem;
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.4);
    padding: 4px 7px;
    border-radius: 3px;
    border-left: 2px solid #38bdf8;
}

.hint-bullet {
    color: #38bdf8;
    font-weight: 700;
}

.btn-hint-active {
    background: linear-gradient(180deg, #6d28d9 0%, #4c1d95 100%) !important;
    border-color: #a78bfa !important;
    color: #ffffff !important;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.45);
}

/* Dolny pasek przycisków akcji Windows XP */
.task-bottom-bar {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 2px;
}

.workspace-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 !important;
}

.btn-primary {
    background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
    color: #090d16;
    border: 1px solid #fde047;
    padding: 5px 14px;
    border-radius: 4px !important;
    font-family: var(--xp-font);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 2px 6px rgba(0, 0, 0, 0.35);
    transition: var(--xp-transition);
}

.btn-primary:hover {
    background: linear-gradient(180deg, #fcd34d 0%, #f59e0b 100%);
    transform: none;
}

.btn-secondary {
    background: linear-gradient(180deg, #283c66 0%, #182644 100%);
    color: #f8fafc;
    border: 1px solid #3e5c99;
    padding: 5px 12px;
    border-radius: 4px !important;
    font-family: var(--xp-font);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--xp-transition);
}

.btn-secondary:hover {
    background: linear-gradient(180deg, #355087 0%, #21345e 100%);
    border-color: #93c5fd;
}

.btn-next-level {
    background: var(--xp-start-grad);
    color: #ffffff;
    border: 1px solid #86efac;
    border-radius: 4px;
    padding: 5px 14px;
    font-family: var(--xp-font);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.45);
}

.btn-next-level:hover {
    filter: brightness(1.1);
}

.feedback-box {
    display: none;
    padding: 6px 10px;
    font-size: 0.76rem;
    font-weight: 700;
    border-radius: 3px;
}

.feedback-box.visible {
    display: flex;
    align-items: center;
    gap: 6px;
}

.feedback-box.success {
    background: rgba(22, 163, 74, 0.22);
    border: 1px solid rgba(74, 222, 128, 0.4);
    border-left: 3px solid #22c55e;
    color: #bbf7d0;
}

.feedback-box.error {
    background: rgba(220, 38, 38, 0.18);
    border: 1px solid rgba(248, 113, 113, 0.35);
    border-left: 3px solid #ef4444;
    color: #fecaca;
}

/* ==========================================================================
   KWADRANT 2 (Góra-Prawo): Notepad_XP.exe (Podgląd/Edytor HTML + Edytor skrypt.js)
   ========================================================================== */
.quadrant-code {
    flex: 0 0 58%;
    max-height: 58%;
    min-height: 0;
}

.code-window-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    background: #0a0f1d;
}

.code-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.code-panel.html-panel {
    flex: 0 0 40%;
    border-bottom: 2px solid #243861;
}

.code-panel.js-panel {
    flex: 1 1 auto;
}

.code-window-body.hardcore-active .code-panel.html-panel {
    flex: 1 1 50%;
}

.code-window-body.hardcore-active .code-panel.js-panel {
    flex: 1 1 50%;
}

.code-panel-header {
    background: #131d36;
    padding: 4px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #23355c;
    flex-shrink: 0;
}

.code-header-left {
    display: flex;
    align-items: center;
    gap: 7px;
}

.code-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.code-lang-tag {
    font-size: 0.64rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 0.04em;
}

.html-lang-badge {
    background: #ea580c;
    color: #ffffff;
}

.js-lang-badge {
    background: #facc15;
    color: #090d16;
}

.code-panel-title {
    font-family: var(--xp-font-mono);
    font-size: 0.74rem;
    color: #ffffff;
    font-weight: 700;
}

.code-scope-pill {
    font-size: 0.66rem;
    color: #93c5fd;
    background: #1b2b4d;
    padding: 1px 6px;
    border-radius: 3px;
    border: 1px solid rgba(147, 197, 253, 0.2);
}

.code-scope-pill.hardcore-badge {
    background: #dc2626 !important;
    color: #ffffff !important;
    border-color: #fca5a5 !important;
    font-weight: 800;
}

.freeform-pill {
    background: var(--xp-gold) !important;
    color: #090d16 !important;
    font-weight: 800;
}

.code-hover-tip {
    font-size: 0.66rem;
    color: #64748b;
    font-style: italic;
}

.code-target-badge {
    background: rgba(245, 158, 11, 0.16);
    border: 1px solid var(--xp-gold);
    color: #fde047;
    font-family: var(--xp-font-mono);
    font-size: 0.67rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 3px;
}

/* Switch Trybu Hardcore w stylu Windows XP */
.xp-hardcore-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    background: #0d1526;
    padding: 2px 6px 2px 8px;
    border: 1px solid #2b4270;
    border-radius: 3px;
    transition: all 0.18s ease;
}

.xp-hardcore-toggle:hover {
    border-color: #ef4444;
}

.hardcore-label-title {
    font-size: 0.61rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #94a3b8;
}

.xp-hardcore-toggle input[type="checkbox"] {
    display: none;
}

.xp-switch-track {
    width: 40px;
    height: 17px;
    background: #16223b;
    border: 1px solid #475569;
    border-radius: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.xp-switch-status {
    font-size: 0.58rem;
    font-weight: 900;
    color: #64748b;
}

.xp-hardcore-toggle input[type="checkbox"]:checked + .xp-switch-track {
    background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
    border-color: #fca5a5;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.55);
}

.xp-hardcore-toggle input[type="checkbox"]:checked + .xp-switch-track .xp-switch-status {
    color: #ffffff;
}

.xp-hardcore-toggle.is-active .hardcore-label-title {
    color: #f87171;
}

/* Edytor HTML w Trybie Hardcore */
.html-editor-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    background: #090d19;
}

.html-editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 8px;
    background: #11192e;
    border-bottom: 1px solid #1e2d4f;
}

.html-editor-body-tag {
    font-family: var(--xp-font-mono);
    font-size: 0.69rem;
    font-weight: 700;
    color: #f97316;
}

.html-editor-hint {
    font-size: 0.62rem;
    color: #64748b;
    font-style: italic;
}

.html-editor-actions {
    display: flex;
    gap: 5px;
}

.xp-mini-btn {
    background: linear-gradient(180deg, #243861 0%, #172542 100%);
    color: #dbeafe;
    border: 1px solid #3b5998;
    border-radius: 3px;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 7px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.xp-mini-btn:hover {
    background: linear-gradient(180deg, #314d85 0%, #1f335c 100%);
    color: #ffffff;
    border-color: var(--xp-gold);
}

.html-editor-surface {
    flex: 1;
    min-height: 0;
    display: flex;
    background: #080c17;
    overflow-y: auto;
}

.html-input-row {
    flex: 1;
    display: flex;
    min-height: 100%;
}

.html-editor-textarea {
    width: 100%;
    height: 100%;
    min-height: 80px;
    background: transparent;
    color: #e2e8f0;
    font-family: var(--xp-font-mono);
    font-size: 0.78rem;
    line-height: 1.5;
    border: none;
    outline: none;
    resize: none;
    padding: 4px 8px;
    box-sizing: border-box;
}

.html-editor-footer {
    padding: 2px 8px;
    background: #11192e;
    border-top: 1px solid #1e2d4f;
}

.hardcore-empty-hint {
    padding: 20px 14px;
    text-align: center;
    color: #64748b;
    font-family: var(--xp-font-mono);
    font-size: 0.76rem;
    font-style: italic;
    border: 1px dashed #475569;
    margin: 10px;
    background: rgba(15, 23, 42, 0.1);
}

/* Wnętrze edytora HTML i JS */
.html-code-wrapper,
.editor-body {
    flex: 1;
    overflow-y: auto;
    padding: 7px 10px;
    font-family: var(--xp-font-mono);
    font-size: 0.77rem;
    line-height: 1.5;
    background: #080c17;
    min-height: 0;
}

.html-line {
    display: flex;
    align-items: flex-start;
    padding: 1px 3px;
    border-radius: 2px;
    transition: background 0.14s ease;
}

.html-line.html-body-line {
    opacity: 0.5;
}

.html-line:hover,
.html-line.dock-hover-highlight {
    background: rgba(59, 130, 246, 0.28) !important;
}

.html-line-target {
    background: rgba(245, 158, 11, 0.09);
}

.code-line-num {
    display: inline-block;
    width: 26px;
    color: #475569;
    user-select: none;
    flex-shrink: 0;
    text-align: right;
    margin-right: 10px;
}

.active-line-num {
    color: #64748b;
}

.html-line-code {
    flex: 1;
    word-break: break-all;
}

.html-bracket { color: #94a3b8; }
.html-tag { color: #60a5fa; font-weight: 700; }
.html-attr { color: #93c5fd; }
.html-val { color: #fbbf24; }
.html-text { color: #e2e8f0; }

.html-target-pill {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.5);
    color: #fde047;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 0 5px;
    border-radius: 3px;
    margin-left: 8px;
    flex-shrink: 0;
}

/* Edytor funkcji JS (Guided & Freeform) */
.css-editor-surface {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.css-rule-group {
    border-left: 2px solid #2b4270;
    padding-left: 6px;
    margin-bottom: 4px;
}

.css-rule-group:focus-within {
    border-left-color: var(--xp-gold);
}

.css-editor-line.locked {
    color: #93c5fd;
    display: flex;
    align-items: center;
}

.js-keyword-locked {
    color: #c084fc;
    font-weight: 700;
    margin-right: 6px;
}

.css-selector-locked {
    color: #fde047;
    font-weight: 700;
}

.css-brace-locked {
    color: #f8fafc;
    margin-left: 4px;
}

.css-locked-indent {
    margin-left: 14px;
    color: #94a3b8;
}

.css-editor-input-row {
    display: flex;
    align-items: flex-start;
}

.css-line-number-col {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.css-editor-input-col {
    flex: 1;
}

.css-editor-textarea {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: #f8fafc;
    font-family: var(--xp-font-mono);
    font-size: 0.78rem;
    line-height: 22px;
    resize: none;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    white-space: pre;
    overflow-x: auto;
}

.freeform-textarea {
    min-height: 165px;
    color: #f8fafc;
}

/* ==========================================================================
   KWADRANT 3 (Dół-Lewo): Wzorzec_CKE.exe (Rysunek 1 + Tabela Przypadków Testowych)
   ========================================================================== */
.quadrant-target {
    flex: 1 1 auto;
    min-height: 0;
}

.target-badge {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fde047;
    font-family: var(--xp-font-mono);
    font-size: 0.65rem;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 3px;
}

.target-badge.all-passed {
    background: var(--xp-green);
    color: #ffffff;
    border-color: #86efac;
}

.target-split-viewport {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    background: #101729;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* Część 1: Papierowy Rysunek 1 z arkusza CKE */
.target-blueprint-section {
    background: #ffffff;
    border: 1px solid #94a3b8;
    border-radius: 3px;
    padding: 7px 10px;
    color: #0f172a;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}

.blueprint-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px dashed #cbd5e1;
    padding-bottom: 4px;
    margin-bottom: 6px;
}

.blueprint-caption-title {
    font-size: 0.72rem;
    font-weight: 800;
    color: #1e293b;
    text-transform: uppercase;
}

.blueprint-sample-pill {
    background: #0f172a;
    color: #ffffff;
    font-family: var(--xp-font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 2px;
}

/* Część 2: Tabela Przypadków Testowych CKE */
.target-testcases-section {
    background: #0b1120;
    border: 1px solid #263961;
    border-radius: 3px;
    padding: 6px 8px;
}

.testcases-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.testcases-title {
    font-size: 0.72rem;
    font-weight: 800;
    color: #fde047;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.testcases-hint {
    font-size: 0.64rem;
    color: #94a3b8;
    font-style: italic;
}

.testcases-table-wrap {
    overflow-x: auto;
}

.cke-testcases-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.72rem;
}

.cke-testcases-table th {
    background: #16233d;
    color: #cbd5e1;
    font-weight: 700;
    text-align: left;
    padding: 4px 7px;
    border: 1px solid #283c66;
}

.cke-testcases-table td {
    padding: 4px 7px;
    border: 1px solid #1e2d4d;
    color: #e2e8f0;
    vertical-align: middle;
}

.cke-testcases-table tr.tc-row-passed td {
    background: rgba(22, 163, 74, 0.12);
}

.cke-testcases-table tr.tc-row-failed td {
    background: rgba(220, 38, 38, 0.1);
}

.tc-expected-code {
    font-family: var(--xp-font-mono);
    color: #fde047;
    font-weight: 600;
    font-size: 0.7rem;
}

.tc-actual-code {
    font-family: var(--xp-font-mono);
    font-size: 0.7rem;
    color: #94a3b8;
}

.tc-row-passed .tc-actual-code {
    color: #4ade80;
    font-weight: 700;
}

.tc-row-failed .tc-actual-code {
    color: #f87171;
}

.tc-actions-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    white-space: nowrap;
}

.tc-load-btn {
    background: #1e335c;
    color: #93c5fd;
    border: 1px solid #3b5998;
    border-radius: 3px;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 6px;
    cursor: pointer;
    transition: all 0.14s ease;
}

.tc-load-btn:hover {
    background: #2b4982;
    color: #ffffff;
    border-color: var(--xp-gold);
}

.tc-status-pill {
    font-family: var(--xp-font-mono);
    font-size: 0.64rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 3px;
}

.tc-status-pill.pass {
    background: rgba(22, 163, 74, 0.25);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.4);
}

.tc-status-pill.fail {
    background: rgba(220, 38, 38, 0.25);
    color: #fca5a5;
    border: 1px solid rgba(248, 113, 113, 0.4);
}

.tc-status-pill.pending {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

/* ==========================================================================
   KWADRANT 4: Internet_Explorer_6.exe (Żywa Strona + Pasek Stanu + Konsola)
   ========================================================================== */
.quadrant-live {
    flex: 1 1 auto;
    min-height: 0;
}

.live-pulse-badge {
    background: var(--xp-green);
    color: #ffffff;
    font-size: 0.63rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 3px;
}

.browser-topbar {
    background: #e2e8f0;
    color: #1e293b;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid #94a3b8;
    flex-shrink: 0;
}

.xp-addr-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #334155;
}

.browser-address-bar {
    flex: 1;
    background: #ffffff;
    border: 1px solid #64748b;
    border-radius: 2px;
    padding: 2px 7px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--xp-font-mono);
    font-size: 0.72rem;
}

.address-lock {
    background: #1d4ed8;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.6rem;
    padding: 1px 4px;
    border-radius: 2px;
}

.address-url {
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.xp-go-btn {
    background: linear-gradient(180deg, #4ade80 0%, #16a34a 100%);
    color: #ffffff;
    border: 1px solid #15803d;
    border-radius: 3px;
    padding: 2px 9px;
    font-family: var(--xp-font);
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.xp-go-btn:hover {
    filter: brightness(1.08);
}

.browser-viewport {
    background: #f8fafc;
    padding: 10px 12px;
    overflow: auto;
    flex: 1;
    min-height: 0;
    position: relative;
    color: #0f172a;
}

/* Pieczątka Zaliczenia CKE */
.dock-stamp-approved {
    display: none;
    position: absolute;
    top: 12px;
    right: 14px;
    transform: rotate(-3deg);
    background: rgba(22, 163, 74, 0.94);
    color: #ffffff;
    border: 2px solid #ffffff;
    border-radius: 4px;
    padding: 5px 12px;
    font-family: var(--xp-font);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    z-index: 90;
    pointer-events: none;
}

.dock-stamp-approved.visible {
    display: block;
    animation: stampPop 0.25s ease-out;
}

@keyframes stampPop {
    0% { transform: scale(0.7) rotate(8deg); opacity: 0; }
    100% { transform: scale(1) rotate(-3deg); opacity: 1; }
}

/* Szuflada konsoli diagnostycznej JS */
.ie6-console-drawer {
    background: #090d16;
    border-top: 2px solid #3b5998;
    max-height: 110px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.ie6-console-header {
    background: #131d36;
    padding: 3px 8px;
    font-size: 0.68rem;
    font-weight: 700;
    color: #93c5fd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #1e2d4f;
}

.ie6-console-logs {
    padding: 4px 8px;
    font-family: var(--xp-font-mono);
    font-size: 0.7rem;
    color: #e2e8f0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.console-log-entry {
    padding: 1px 4px;
    border-left: 2px solid #3b82f6;
}
.console-log-entry.warn {
    border-left-color: #f59e0b;
    color: #fde047;
}
.console-log-entry.error {
    border-left-color: #ef4444;
    color: #fca5a5;
}

/* Dolny pasek stanu IE6 (Windows XP Status Bar) */
.ie6-statusbar {
    background: #e2e8f0;
    border-top: 1px solid #94a3b8;
    color: #1e293b;
    padding: 3px 8px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
}

.ie6-status-left {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    flex: 1;
}

.ie6-status-icon {
    font-size: 0.78rem;
    flex-shrink: 0;
}

.ie6-status-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    color: #1e293b;
}

.ie6-status-text.is-error {
    color: #b91c1c;
    font-weight: 700;
}

.ie6-status-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.ie6-console-btn {
    background: #cbd5e1;
    border: 1px solid #64748b;
    border-radius: 3px;
    padding: 1px 6px;
    font-family: var(--xp-font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    color: #0f172a;
    cursor: pointer;
}

.ie6-console-btn:hover {
    background: #94a3b8;
}

.console-count-badge {
    background: #1e293b;
    color: #fde047;
    padding: 0 4px;
    border-radius: 2px;
    font-size: 0.6rem;
}

.ie6-zone-badge {
    font-size: 0.66rem;
    color: #475569;
    font-weight: 600;
    border-left: 1px solid #94a3b8;
    padding-left: 8px;
}

/* ==========================================================================
   Stylizacja Witryn i Formularzy CKE wewnątrz Kwadrantów 3 i 4
   ========================================================================== */
.cke-page-canvas {
    width: 100%;
    box-sizing: border-box;
    font-family: var(--xp-font);
    font-size: 0.8rem;
    color: #0f172a;
}

.cke-page-canvas header,
.cke-page-canvas #baner {
    background: #1e3a8a;
    color: #ffffff;
    padding: 6px 10px;
    font-weight: 700;
    border-radius: 3px;
    margin-bottom: 6px;
}

.wireframe-mode header,
.wireframe-mode #baner {
    background: #f1f5f9;
    color: #0f172a;
    border: 1px dashed #475569;
}

.cke-page-canvas main,
.cke-page-canvas section,
.cke-page-canvas .panel-kalkulatora {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wireframe-mode main,
.wireframe-mode section,
.wireframe-mode .panel-kalkulatora {
    border: 1px dashed #64748b;
    background: #fafafa;
}

.cke-page-canvas label {
    font-size: 0.76rem;
    font-weight: 700;
    color: #1e293b;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cke-page-canvas input[type="text"],
.cke-page-canvas input[type="number"],
.cke-page-canvas input[type="password"],
.cke-page-canvas select {
    padding: 4px 7px;
    border: 1px solid #64748b;
    border-radius: 3px;
    font-family: var(--xp-font);
    font-size: 0.78rem;
    background: #ffffff;
    color: #0f172a;
    max-width: 240px;
}

.cke-page-canvas button,
.cke-page-canvas input[type="button"] {
    padding: 4px 12px;
    background: linear-gradient(180deg, #f8fafc 0%, #cbd5e1 100%);
    border: 1px solid #475569;
    border-radius: 3px;
    color: #0f172a;
    font-weight: 700;
    font-size: 0.76rem;
    cursor: pointer;
    align-self: flex-start;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.cke-page-canvas button:hover {
    background: linear-gradient(180deg, #eff6ff 0%, #bfdbfe 100%);
    border-color: #2563eb;
}

.cke-page-canvas #wynik,
.cke-page-canvas #podglad,
.cke-page-canvas #komunikat,
.cke-page-canvas .wynik-box {
    margin-top: 4px;
    padding: 6px 10px;
    background: #eff6ff;
    border: 1px dashed #3b82f6;
    border-radius: 3px;
    font-weight: 700;
    color: #1e3a8a;
    min-height: 28px;
}

.wireframe-mode #wynik,
.wireframe-mode #podglad,
.wireframe-mode #komunikat {
    background: #fef9c3;
    border: 1px solid #ca8a04;
    color: #713f12;
}

/* Galeria i tabele w zadaniach CKE */
.cke-page-canvas .miniatury-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.cke-page-canvas img {
    max-height: 75px;
    border: 2px solid #94a3b8;
    border-radius: 3px;
    background: #e2e8f0;
    padding: 2px;
}

.cke-page-canvas table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    margin-top: 4px;
}

.cke-page-canvas th,
.cke-page-canvas td {
    border: 1px solid #94a3b8;
    padding: 3px 6px;
    text-align: left;
}

.cke-page-canvas .aktywna {
    background: #dcfce7 !important;
    border: 2px solid #16a34a !important;
    color: #14532d !important;
    font-weight: 800;
}

/* Podświetlenie skorelowanych kontrolek DOM przy najechaniu */
.dock-hover-highlight {
    outline: 3px solid var(--xp-gold) !important;
    outline-offset: 1px;
    box-shadow: 0 0 12px var(--xp-gold-glow) !important;
    z-index: 20;
}

/* ==========================================================================
   Okna Modalne (Styl Dialogu Systemowego Windows XP)
   ========================================================================== */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 22, 0.78);
    backdrop-filter: blur(3px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-backdrop.visible {
    display: flex;
}

.modal-content.xp-dialog {
    background: #131b2e;
    border: 2px solid #3a66b8;
    border-radius: var(--xp-radius-win);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.85);
    width: 90%;
    max-width: 580px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.xp-dialog-body {
    padding: 14px 16px;
    overflow-y: auto;
    color: #e2e8f0;
    font-size: 0.84rem;
    line-height: 1.55;
}

.btn-danger {
    background: var(--xp-close-grad);
    color: #ffffff;
    border: 1px solid #fca5a5;
    border-radius: 4px;
    padding: 5px 14px;
    font-weight: 700;
    cursor: pointer;
}

.inline-code-pill {
    background: #1e293b;
    color: #fde047;
    padding: 1px 5px;
    border-radius: 3px;
    font-family: var(--xp-font-mono);
    font-size: 0.84em;
    border: 1px solid rgba(253, 224, 71, 0.25);
}
