 /* --- XY83R7!UX --- */
 /* --- Styling & Reset --- */
        :root {
            /* Status Colors */
            --color-unchecked: #f87171; /* Red */
            --color-checked: #34d399;   /* Green */
            --color-issue: #fbbf24;     /* Yellow */

            /* Palette */
            --color-bg: #f8fafc; /* Very light gray, almost white */
            --color-surface: #ffffff;
            --color-surface-variant: #f1f5f9; /* For cards/panels */
            --color-text-primary: #0f172a;
            --color-text-secondary: #475569;
            --color-text-on-primary: #ffffff;

            /* Gradients */
            --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            --gradient-surface: linear-gradient(145deg, #ffffff, #f3f4f6);

            /* Shadows */
            --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
            --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
            --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
            --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

            /* Font Family */
            --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
        }

        /* Dark Mode Styles */
        body.dark-mode {
            --color-bg: #1a202c;
            --color-surface: #2d3748;
            --color-surface-variant: #4a5568;
            --color-text-primary: #f7fafc;
            --color-text-secondary: #cbd5e0;
            --gradient-surface: linear-gradient(145deg, #2d3748, #1a202c);
        }

        body {
            font-family: var(--font-family);
            background: var(--color-bg);
            color: var(--color-text-primary);
            margin: 0;
            display: flex;
            flex-direction: column;
            height: 100vh;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            transition: background-color 0.3s ease, color 0.3s ease;
        }

        /* --- Header with Gradient --- */
        .header {
            background: var(--gradient-primary);
            color: var(--color-text-on-primary);
            padding: 1.5rem 1rem;
            text-align: center;
            box-shadow: var(--shadow-md);
            position: relative;
        }

        .header h1 {
            margin: 0;
            font-size: 1.5rem;
            font-weight: 700;
            letter-spacing: -0.025em;
        }
        
        .header h2 {
            margin: 0;
            font-size: 0.8rem;
            font-weight: 700;
            letter-spacing: -0.025em;
        }
        
        .footer {
            background: var(--gradient-primary);
            color: var(--color-text-on-primary);
            padding: 0.5rem 0.5rem;
            text-align: center;
            box-shadow: var(--shadow-md);
            position: relative;
        }
        
        .footer h1 {
            margin: 0;
            font-size: 1rem;
            font-weight: 700;
            letter-spacing: -0.025em;
        }

        /* Dark Mode Toggle */
        .theme-toggle {
            position: absolute;
            top: 1.5rem;
            right: 1rem;
            background: rgba(255, 255, 255, 0.2);
            border: none;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: background-color 0.2s;
            font-size: 1.2rem;
        }

        .theme-toggle:hover {
            background: rgba(255, 255, 255, 0.3);
        }

        /* --- Tab Navigation --- */
        .main-tab-nav {
            display: flex;
            padding: 1rem;
            gap: 0.5rem;
            background: var(--color-surface);
            border-bottom: 2px solid #e2e8f0;
            box-shadow: var(--shadow-md);
        }

        body.dark-mode .main-tab-nav {
            background: var(--color-surface-variant);
            border-bottom-color: #4a5568;
        }

        .main-tab-button {
            background-color: var(--color-surface-variant);
            border: 1px solid rgba(102, 126, 234, 0.2);
            outline: none;
            cursor: pointer;
            padding: 0.5rem 1rem;
            font-size: 0.875rem;
            font-weight: 500;
            color: var(--color-text-secondary);
            border-radius: 0.5rem;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: hidden;
        }

        .main-tab-button::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
            transition: left 0.5s;
        }

        .main-tab-button:hover::before {
            left: 100%;
        }

        .main-tab-button:hover {
            background-color: var(--color-surface);
            color: var(--color-text-primary);
            transform: translateY(-1px);
            box-shadow: var(--shadow-md);
            border-color: rgba(102, 126, 234, 0.4);
        }

        body.dark-mode .main-tab-button:hover {
            background-color: var(--color-surface);
            border-color: rgba(102, 126, 234, 0.6);
        }

        .main-tab-button.active {
            background: var(--gradient-primary);
            color: var(--color-text-on-primary);
            box-shadow: var(--shadow-md);
            font-weight: 600;
            transform: translateY(-1px);
            border-color: transparent;
        }

        .main-tab-button.active::after {
            content: '';
            position: absolute;
            bottom: -2px;
            left: 50%;
            transform: translateX(-50%);
            width: 60%;
            height: 3px;
            background: var(--gradient-primary);
            border-radius: 2px 2px 0 0;
        }

        /* --- Content Area --- */
        .content {
            flex-grow: 1;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
        }

        .tab-content {
            display: none;
            flex-direction: column;
            flex-grow: 1;
        }

        .tab-content.active {
            display: flex;
        }

        /* --- Manual Styles --- */
        .manual-container {
            padding: 2rem;
            max-width: 1000px;
            margin: 0 auto;
        }

        .manual-header {
            text-align: center;
            margin-bottom: 2rem;
        }

        .manual-section {
            background: var(--color-surface);
            border-radius: 0.75rem;
            padding: 1.5rem;
            margin-bottom: 1.5rem;
            box-shadow: var(--shadow-md);
            border: 1px solid #e2e8f0;
        }

        body.dark-mode .manual-section {
            border-color: #4a5568;
        }

        .manual-section h2 {
            margin-top: 0;
            color: var(--color-text-primary);
            font-size: 1.5rem;
            border-bottom: 2px solid var(--gradient-primary);
            padding-bottom: 0.5rem;
            margin-bottom: 1rem;
        }

        .manual-section h3 {
            color: var(--color-text-primary);
            margin-top: 1.5rem;
            margin-bottom: 0.75rem;
        }

        .manual-section p {
            line-height: 1.6;
            margin-bottom: 1rem;
            color: var(--color-text-secondary);
        }

        .manual-section ul {
            padding-left: 1.5rem;
            margin-bottom: 1rem;
        }

        .manual-section li {
            margin-bottom: 0.5rem;
            color: var(--color-text-secondary);
        }

        .manual-tip {
            background-color: rgba(102, 126, 234, 0.1);
            border-left: 4px solid #667eea;
            padding: 1rem;
            margin: 1rem 0;
            border-radius: 0.25rem;
        }

        body.dark-mode .manual-tip {
            background-color: rgba(102, 126, 234, 0.2);
        }

        .manual-image {
            max-width: 100%;
            border-radius: 0.5rem;
            margin: 1rem 0;
            box-shadow: var(--shadow-md);
        }

        .manual-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1rem;
            margin: 1rem 0;
        }

        .manual-grid-item {
            background: var(--color-surface-variant);
            padding: 1rem;
            border-radius: 0.5rem;
            text-align: center;
        }

        .manual-icon {
            font-size: 2rem;
            margin-bottom: 0.5rem;
        }

        .manual-code {
            background: var(--color-surface-variant);
            padding: 0.25rem 0.5rem;
            border-radius: 0.25rem;
            font-family: monospace;
            font-size: 0.9rem;
        }

        .manual-shortcut {
            display: inline-block;
            background: var(--color-surface-variant);
            padding: 0.25rem 0.5rem;
            border-radius: 0.25rem;
            font-weight: 600;
            margin: 0 0.25rem;
            box-shadow: var(--shadow-sm);
        }

        /* --- Room Overview Section --- */
        .room-overview {
            padding: 1.5rem;
            background-color: var(--color-surface);
            border-bottom: 1px solid #e2e8f0;
        }
        
        body.dark-mode .room-overview {
            border-bottom-color: #4a5568;
        }
        
        .overview-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
        }

        .overview-header h2 {
            margin: 0;
            font-size: 1.5rem;
            font-weight: 600;
            color: var(--color-text-primary);
        }

        .reset-button, .check-all-button {
            color: white;
            border: none;
            padding: 0.625rem 1.25rem;
            border-radius: 0.5rem;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.2s ease;
            box-shadow: var(--shadow-sm);
        }

        .reset-button {
            background-color: #ef4444;
        }
        .reset-button:hover {
            background-color: #dc2626;
            transform: translateY(-1px);
            box-shadow: var(--shadow-md);
        }
        
        .check-all-button {
            background-color: #3b82f6; /* A nice blue */
        }
        .check-all-button:hover {
            background-color: #2563eb;
            transform: translateY(-1px);
            box-shadow: var(--shadow-md);
        }
        
        .image-map-container {
            text-align: center;
            margin-bottom: 1rem;
            position: relative;
            display: inline-block;
            border-radius: 1rem;
            overflow: hidden;
            box-shadow: var(--shadow-lg);
        }

        .image-map-container img {
            max-width: 100%;
            height: auto;
            display: block;
        }
        
        .clickable-overlay {
            position: absolute;
            cursor: pointer;
            border: 2px solid transparent;
            box-sizing: border-box;
            border-radius: 0.5rem;
            transition: background-color 0.2s, border-color 0.2s;
        }
        
        .clickable-overlay.debug-mode {
            background-color: rgba(34, 197, 94, 0.3);
            border-color: #22c55e;
        }
        
        /* --- Checkmark overlay styling --- */
        .clickable-overlay.checked-overlay::after {
            content: '✔';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: min(4rem, 30vw); /* Responsive: smaller of 4rem or 30% of viewport width */
            color: rgba(34, 197, 94, 0.7); /* Semi-transparent green */
            text-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
            z-index: 5; /* Mała poprawka */
        }
        
        /* Highlight button styles */
        .highlight-button {
            background-color: rgba(0, 0, 0, 0.6);
            color: white;
            border: none;
            padding: 0.5rem 1rem;
            border-radius: 0.5rem;
            cursor: pointer;
            font-weight: 500;
            margin-top: 0.5rem;
            transition: background-color 0.2s;
        }
        
        .highlight-button:hover {
            background-color: rgba(0, 0, 0, 0.8);
        }

        /* --- Progress Details Section --- */
        .progress-details-section {
            padding: 1rem 1.5rem;
            background-color: var(--color-surface-variant);
            border-top: 1px solid #e2e8f0;
            flex-shrink: 0; /* Prevent this section from growing */
            max-width: 100%; /* Constrain width */
            order: 2; /* Force this section to appear after the grid */
        }
        
        body.dark-mode .progress-details-section {
            border-top-color: #4a5568;
        }
        
        .progress-details-section h3 {
            margin: 0 0 1rem 0;
            font-size: 1rem;
            text-align: center;
            color: var(--color-text-secondary);
            font-weight: 500;
        }

        .overview-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1rem;
        }

        .summary-card {
            background: var(--color-surface);
            border-radius: 0.75rem;
            padding: 1.25rem;
            box-shadow: var(--shadow-md);
            border: 1px solid #e2e8f0;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
            cursor: pointer;
        }

        body.dark-mode .summary-card {
            border-color: #4a5568;
        }

        .summary-card:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-lg);
        }

        .summary-card h3 {
            margin-top: 0;
            margin-bottom: 0.75rem;
            font-size: 1rem;
            font-weight: 600;
            color: var(--color-text-primary);
        }
        .summary-card p {
            margin: 0.5rem 0;
            font-size: 0.875rem;
            color: var(--color-text-secondary);
        }

        /* --- PROGRESS BAR STYLING --- */
        .progress-bar-container {
            background-color: #e2e8f0;
            border-radius: 9999px;
            height: 12px;
            margin-top: 0.75rem;
            overflow: hidden;
        }

        body.dark-mode .progress-bar-container {
            background-color: #4a5568;
        }

        .progress-bar {
            background: var(--gradient-primary);
            height: 100%;
            border-radius: 9999px;
            width: 0%;
            transition: width 0.5s ease;
            box-shadow: var(--shadow-sm);
            
            color: white;
            font-size: 0.7rem;
            font-weight: 600;
            text-align: center;
            line-height: 12px;
        }
        
        /* --- Section Grid Container --- */
        .island-grid-container {
            flex-grow: 1;
            padding: 1.5rem;
            overflow-y: auto;
            display: none;
            background-color: var(--color-surface-variant);
        }

        .island-grid-container.active {
            display: flex;
            flex-direction: column;
            flex-grow: 1;
            min-height: 0; /* Allow container to shrink */
        }
        
        .island-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
        }

        /* --- Locker Grid --- */
        .locker-grid {
            display: grid;
            gap: 1rem;
            grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
            justify-items: center;
            margin-bottom: 1.5rem; /* Space between grid and progress section */
        }

        .locker-wrapper {
            position: relative;
            width: 100%;
            padding-bottom: 100%; /* Square aspect ratio */
        }

        .locker {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border-radius: 1rem;
            cursor: pointer;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            color: white;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: var(--shadow-md);
            user-select: none;
            font-size: 1.5rem;
            overflow: hidden;
        }
        
        .locker .issue-type {
            font-size: 1rem;
            font-weight: 500;
            margin-top: 2px;
            text-align: center;
            line-height: 1;
        }

        .locker::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);
            opacity: 0;
            transition: opacity 0.2s;
        }

        .locker:hover {
            transform: translateY(-4px) scale(1.05);
            box-shadow: var(--shadow-xl);
        }
        
        .locker:hover::before {
            opacity: 1;
        }

        .locker.status-unchecked { background-color: var(--color-unchecked); }
        .locker.status-checked { background-color: var(--color-checked); }
        .locker.status-issue { background-color: var(--color-issue); }

        /* --- Issue Reporting Modal --- */
        .modal {
            display: none; 
            position: fixed; 
            z-index: 1000; 
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            overflow: auto; 
            background-color: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(5px);
            -webkit-backdrop-filter: blur(5px);
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .modal.show {
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 1;
        }

        .modal-content {
            background: rgba(255, 255, 255, 0.9);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            padding: 2rem;
            width: 90%;
            max-width: 450px;
            border-radius: 1rem;
            box-shadow: var(--shadow-xl);
            border: 1px solid rgba(255, 255, 255, 0.3);
            transform: scale(0.9);
            transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }
        
        body.dark-mode .modal-content {
            background: rgba(45, 55, 72, 0.9);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }
        
        .modal.show .modal-content {
            transform: scale(1);
        }

        .modal-header h2 {
            margin-top: 0;
            font-weight: 600;
            color: var(--color-text-primary);
        }

        .issue-options button {
            display: block;
            width: 100%;
            padding: 0.875rem 1rem;
            margin-bottom: 0.75rem;
            border: 1px solid #e2e8f0;
            background-color: var(--color-surface);
            cursor: pointer;
            border-radius: 0.5rem;
            text-align: left;
            font-size: 1rem;
            transition: all 0.2s ease;
            box-shadow: var(--shadow-sm);
            color: var(--color-text-primary);
        }
        
        body.dark-mode .issue-options button {
            border-color: #4a5568;
        }
        
        .issue-options button:hover {
            background-color: var(--color-surface-variant);
            transform: translateX(4px);
            box-shadow: var(--shadow-md);
        }

        .modal-footer {
            text-align: right;
            margin-top: 1.5rem;
        }
        .modal-footer button {
            padding: 0.75rem 1.5rem;
            border: none;
            cursor: pointer;
            border-radius: 0.5rem;
            font-weight: 600;
            transition: all 0.2s ease;
        }
        .modal-footer .cancel-btn { 
            background-color: var(--color-surface-variant); 
            color: var(--color-text-secondary);
        }
        .modal-footer .cancel-btn:hover {
            background-color: #e2e8f0;
        }
        .modal-footer .submit-btn { 
            background: var(--gradient-primary); 
            color: white;
            box-shadow: var(--shadow-md);
        }
        .modal-footer .submit-btn:hover {
            box-shadow: var(--shadow-lg);
        }

        /* --- Responsive Design --- */
        @media (max-width: 1200px) {
            .clickable-overlay.checked-overlay::after {
                font-size: min(3.5rem, 28vw);
            }
        }

        @media (max-width: 768px) {
            .locker-grid {
                grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
                gap: 0.75rem;
            }
            
            .locker {
                font-size: 1.2rem;
            }
            
            .locker .issue-type {
                font-size: 0.8rem;
                margin-top: 1px;
            }
            
            .clickable-overlay.checked-overlay::after {
                font-size: min(2.5rem, 25vw);
            }
        }

        @media (max-width: 480px) {
            .locker-grid {
                grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
                gap: 0.5rem;
            }
            
            .locker {
                font-size: 1rem;
            }
            
            .locker .issue-type {
                font-size: 0.7rem;
                margin-top: 1px;
            }
            
            .clickable-overlay.checked-overlay::after {
                font-size: min(1.8rem, 22vw);
            }
        }

        @media (max-width: 380px) {
            .clickable-overlay.checked-overlay::after {
                font-size: min(1.5rem, 20vw);
            }
        }

        @media (max-width: 320px) {
            .clickable-overlay.checked-overlay::after {
                font-size: min(1.2rem, 18vw);
            }
        }