/* TFF Community Kalender - global styles (extracted from base.html) */
        @font-face {
            font-family: 'Roboto';
            font-style: normal;
            font-weight: 300;
            font-display: swap;
            src: url("../fonts/roboto-300.7fda4c62c1bd.woff2") format('woff2');
        }
        @font-face {
            font-family: 'Roboto';
            font-style: normal;
            font-weight: 400;
            font-display: swap;
            src: url("../fonts/roboto-400.8eff0b8045fd.woff2") format('woff2');
        }
        @font-face {
            font-family: 'Roboto';
            font-style: normal;
            font-weight: 500;
            font-display: swap;
            src: url("../fonts/roboto-500.115c2d84727b.woff2") format('woff2');
        }
        @font-face {
            font-family: 'Roboto';
            font-style: normal;
            font-weight: 700;
            font-display: swap;
            src: url("../fonts/roboto-700.c83e4437a53d.woff2") format('woff2');
        }

/* ===== Main layout & components ===== */
        :root {
            --primary: #cc0000;
            --primary-hover: #990000;
            --primary-light: #ffe5e5;
            --header-bg: #cc0000;
            --header-text: #ffffff;
            --bg: #f8f9fa;
            --surface: #ffffff;
            --text: #222222;
            --text-secondary: #646464;
            --border: #e9e9e9;
            --border-hover: #b0b0b0;
            --shadow: 0 1px 3px rgba(0,0,0,0.08);
            --shadow-hover: 0 2px 8px rgba(0,0,0,0.12);
            --radius: 4px;
            --radius-lg: 8px;
            --max-width: 1110px;
        }

        /* ===== Dark Mode ===== */
        html.dark {
            --primary: #e53935;
            --primary-hover: #ff5252;
            --primary-light: #3a1a1a;
            --header-bg: #a30000;
            --header-text: #ffffff;
            --bg: #141518;
            --surface: #1e1f23;
            --text: #e4e5e8;
            --text-secondary: #9a9ca3;
            --border: #33353b;
            --border-hover: #55575e;
            --shadow: 0 1px 3px rgba(0,0,0,0.4);
            --shadow-hover: 0 2px 8px rgba(0,0,0,0.6);
        }

        /* ===== Theme toggle button ===== */
        .theme-toggle {
            background: none;
            border: none;
            color: var(--header-text);
            font-size: 1.05rem;
            cursor: pointer;
            padding: 4px 8px;
            line-height: 1;
            opacity: 0.85;
        }
        .theme-toggle:hover { opacity: 1; }
        .theme-toggle-mobile { display: none; }

        /* ===== Dark mode overrides for hardcoded colors ===== */
        html.dark .btn-secondary {
            background: #2a2c31;
            color: var(--text);
            border-color: var(--border);
        }
        html.dark .btn-secondary:hover { background: #33353b; }
        html.dark .btn:disabled { background: #26272b; color: #6a6c73; }
        html.dark .alert-success { background: #16281a; border-left-color: #4caf50; color: #81c784; }
        html.dark .alert-error { background: #2d1416; border-left-color: #f44336; color: #ef9a9a; }
        html.dark .alert-warning { background: #2b2010; border-left-color: #ff9800; color: #ffcc80; }
        html.dark .alert-info { background: #12222e; border-left-color: #2196f3; color: #90caf9; }
        html.dark .checkbox-wrapper {
            background: var(--primary-light);
            border-color: #5a2b2b;
        }
        html.dark .form-control {
            background: #16171a;
            color: var(--text);
            border-color: var(--border);
        }
        html.dark .photo-card img,
        html.dark .current-photo img { background: #26272b; }

        * { box-sizing: border-box; margin: 0; padding: 0; }

        body {
            font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
            background: var(--bg);
            color: var(--text);
            line-height: 1.6;
            font-size: 15px;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }

        /* ===== Header / Navigation ===== */
        .d-header {
            background: var(--header-bg);
            color: var(--header-text);
            box-shadow: 0 2px 4px rgba(0,0,0,0.15);
            position: sticky;
            top: 0;
            z-index: 1000;
        }
        .d-header-inner {
            max-width: var(--max-width);
            margin: 0 auto;
            padding: 0 20px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 50px;
        }
        .d-header-brand {
            font-size: 1.15rem;
            font-weight: 700;
            color: var(--header-text);
            text-decoration: none;
            letter-spacing: -0.3px;
        }
        .d-header-brand:hover { opacity: 0.9; }
        .d-header-hamburger {
            display: none;
            background: none;
            border: none;
            color: var(--header-text);
            font-size: 1.4rem;
            cursor: pointer;
            padding: 4px 8px;
            line-height: 1;
        }
        .d-header-nav {
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .d-header-nav a {
            color: rgba(255,255,255,0.85);
            text-decoration: none;
            font-size: 0.9rem;
            padding: 6px 12px;
            border-radius: var(--radius);
            transition: background 0.15s;
        }
        .d-header-nav a:hover {
            background: rgba(255,255,255,0.15);
            color: #fff;
        }
        .d-header-nav a.active {
            background: rgba(255,255,255,0.2);
            color: #fff;
            font-weight: 500;
        }
        .d-header-user {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 0.85rem;
        }
        .d-header-user a {
            color: rgba(255,255,255,0.85);
            text-decoration: none;
        }
        .d-header-user a:hover { color: #fff; }
        .d-header-user .d-header-hamburger { display: none; }
        .user-badge {
            background: rgba(255,255,255,0.2);
            padding: 3px 10px;
            border-radius: 12px;
            font-size: 0.8rem;
            font-weight: 500;
        }

        /* ===== Main Layout ===== */
        #main-outlet {
            max-width: var(--max-width);
            margin: 0 auto;
            padding: 20px;
            min-height: calc(100vh - 50px);
            flex: 1;
        }

        /* ===== Topic / Card Style ===== */
        .topic-body {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            padding: 24px;
            margin-bottom: 16px;
            box-shadow: var(--shadow);
        }
        .topic-title {
            font-size: 1.5rem;
            font-weight: 700;
            margin-bottom: 16px;
            color: var(--text);
        }
        .topic-meta {
            font-size: 0.85rem;
            color: var(--text-secondary);
            margin-bottom: 12px;
        }

        /* ===== Messages ===== */
        .alert {
            padding: 12px 16px;
            border-radius: var(--radius);
            margin-bottom: 16px;
            border-left: 4px solid;
            font-size: 0.95rem;
        }
        .alert-success {
            background: #e8f5e9;
            border-left-color: #4caf50;
            color: #2e7d32;
        }
        .alert-error {
            background: #ffebee;
            border-left-color: #f44336;
            color: #c62828;
        }
        .alert-warning {
            background: #fff3e0;
            border-left-color: #ff9800;
            color: #ef6c00;
        }
        .alert-info {
            background: #e3f2fd;
            border-left-color: #2196f3;
            color: #1565c0;
        }

        /* ===== Buttons ===== */
        .btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 9px 18px;
            font-size: 0.95rem;
            font-weight: 500;
            border: none;
            border-radius: var(--radius);
            cursor: pointer;
            transition: all 0.15s;
            text-decoration: none;
            line-height: 1.4;
        }
        .btn-primary {
            background: var(--primary);
            color: #fff;
        }
        .btn-primary:hover {
            background: var(--primary-hover);
            box-shadow: 0 2px 6px rgba(204,0,0,0.3);
        }
        .btn-secondary {
            background: #f3f3f3;
            color: var(--text);
            border: 1px solid var(--border);
        }
        .btn-secondary:hover {
            background: #e5e5e5;
            border-color: var(--border-hover);
        }
        .btn-danger {
            background: #d32f2f;
            color: #fff;
        }
        .btn-danger:hover { background: #b71c1c; }
        .btn:disabled {
            background: #e0e0e0;
            color: #999;
            cursor: not-allowed;
        }

        /* ===== Forms ===== */
        .form-group {
            margin-bottom: 18px;
        }
        .form-group label {
            display: block;
            font-weight: 500;
            font-size: 0.9rem;
            margin-bottom: 6px;
            color: var(--text);
        }
        .form-group .help-text {
            font-size: 0.8rem;
            color: var(--text-secondary);
            margin-top: 4px;
        }
        .form-control {
            width: 100%;
            max-width: 420px;
            padding: 10px 12px;
            font-size: 0.95rem;
            border: 1px solid var(--border);
            border-radius: var(--radius);
            background: var(--surface);
            color: var(--text);
            transition: border-color 0.15s, box-shadow 0.15s;
        }
        .form-control:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(204,0,0,0.1);
        }
        input[type="file"].form-control {
            padding: 8px;
        }
        .form-error {
            color: #c62828;
            font-size: 0.85rem;
            margin-top: 4px;
        }
        .checkbox-wrapper {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            padding: 16px;
            background: var(--primary-light);
            border: 1px solid #ffcdd2;
            border-radius: var(--radius);
            margin: 16px 0;
        }
        .checkbox-wrapper input[type="checkbox"] {
            margin-top: 3px;
            accent-color: var(--primary);
        }
        .checkbox-wrapper label {
            font-weight: 500;
            cursor: pointer;
        }

        /* ===== Photo Grid ===== */
        .photo-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 16px;
        }
        .photo-card {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            overflow: hidden;
            transition: box-shadow 0.2s, transform 0.2s;
            display: flex;
            flex-direction: column;
        }
        .photo-card:hover {
            box-shadow: var(--shadow-hover);
            transform: translateY(-1px);
        }
        .photo-card--selected {
            border: 2px solid var(--primary);
            box-shadow: 0 0 0 4px rgba(204,0,0,0.15);
        }
        .photo-card img {
            width: 100%;
            height: 200px;
            object-fit: cover;
            display: block;
            background: #eee;
        }
        .photo-card-body {
            padding: 14px;
            flex: 1;
        }
        .photo-card-author {
            font-weight: 600;
            font-size: 0.95rem;
            color: var(--text);
            margin-bottom: 4px;
        }
        .photo-card-meta {
            font-size: 0.8rem;
            color: var(--text-secondary);
        }
        .photo-card-actions {
            padding: 0 14px 14px;
        }

        /* ===== Terms / Quote Box ===== */
        .quote-box {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            padding: 20px;
            margin: 20px 0;
        }
        .quote-box h3 {
            font-size: 1.1rem;
            margin-bottom: 12px;
            color: var(--text);
        }
        .quote-box ul {
            padding-left: 20px;
            margin-bottom: 12px;
        }
        .quote-box li {
            margin-bottom: 6px;
            font-size: 0.9rem;
            color: var(--text-secondary);
            line-height: 1.5;
        }

        /* ===== Vote ===== */
        .vote-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 12px;
            margin-bottom: 20px;
        }
        .vote-counter-box {
            background: var(--surface);
            border: 2px solid var(--primary);
            border-radius: var(--radius-lg);
            padding: 10px 18px;
            font-size: 1rem;
            font-weight: 600;
            color: var(--primary);
        }

        /* ===== Results ===== */
        .winner-badge {
            display: inline-block;
            background: var(--primary);
            color: #fff;
            font-size: 0.75rem;
            font-weight: 700;
            text-transform: uppercase;
            padding: 3px 10px;
            border-radius: 3px;
            margin-top: 6px;
        }
        .vote-count-text {
            font-size: 0.85rem;
            color: var(--text-secondary);
            margin-top: 4px;
        }

        /* ===== Login ===== */
        .login-grid {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin: 20px 0;
        }
        .login-grid .btn {
            min-width: 140px;
            justify-content: center;
        }

        /* ===== Current Photo Preview ===== */
        .current-photo {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            padding: 16px;
            margin-bottom: 20px;
            text-align: center;
        }
        .current-photo img {
            max-width: 100%;
            max-height: 400px;
            border-radius: var(--radius);
            box-shadow: var(--shadow);
        }
        .current-photo-meta {
            margin-top: 10px;
            font-size: 0.85rem;
            color: var(--text-secondary);
        }

        /* ===== Misc ===== */
        hr {
            border: none;
            border-top: 1px solid var(--border);
            margin: 24px 0;
        }
        a { color: var(--primary); }
        a:hover { color: var(--primary-hover); text-decoration: underline; }
        p { margin-bottom: 12px; }
        h1, h2, h3 { font-weight: 700; color: var(--text); }
        h1 { font-size: 1.6rem; margin-bottom: 16px; }
        h2 { font-size: 1.3rem; margin: 20px 0 12px; }
        h3 { font-size: 1.1rem; margin: 16px 0 10px; }

        /* ===== Footer ===== */
        .d-footer {
            text-align: center;
            padding: 24px 20px;
            font-size: 0.8rem;
            color: var(--text-secondary);
            border-top: 1px solid var(--border);
            margin-top: auto;
        }
        .d-footer a { color: var(--text-secondary); }
        .d-footer a:hover { color: var(--primary); }

        /* ===== Cookie Banner ===== */
        .cookie-banner {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: var(--surface);
            border-top: 2px solid var(--primary);
            padding: 16px 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 16px;
            flex-wrap: wrap;
            z-index: 2000;
            box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
            font-size: 0.9rem;
            transition: transform 0.3s ease;
        }
        .cookie-banner.hidden {
            transform: translateY(100%);
        }
        .cookie-banner p {
            margin: 0;
            max-width: 700px;
        }
        .cookie-banner .btn {
            padding: 6px 16px;
            font-size: 0.85rem;
            white-space: nowrap;
        }

        /* ===== Lightbox ===== */
        .lightbox-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.88);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 3000;
            cursor: zoom-out;
        }
        .lightbox-overlay.active {
            display: flex;
        }
        .lightbox-overlay img {
            max-width: 90vw;
            max-height: 90vh;
            object-fit: contain;
            border-radius: var(--radius-lg);
            box-shadow: 0 4px 24px rgba(0,0,0,0.5);
        }
        .lightbox-close {
            position: fixed;
            top: 20px; right: 24px;
            color: #fff;
            font-size: 2.2rem;
            line-height: 1;
            cursor: pointer;
            z-index: 3001;
            text-shadow: 0 2px 4px rgba(0,0,0,0.5);
            transition: opacity 0.15s;
        }
        .lightbox-close:hover {
            opacity: 0.7;
        }
        .lightbox-trigger {
            cursor: pointer;
            transition: opacity 0.15s;
        }
        .lightbox-trigger:hover {
            opacity: 0.85;
        }

        /* ===== Countdown ===== */
        .countdown-box {
            background: linear-gradient(135deg, var(--primary-light), var(--surface));
            border: 2px solid var(--primary);
            border-radius: var(--radius-lg);
            padding: 20px 24px;
            margin: 24px 0;
            text-align: center;
            box-shadow: var(--shadow-hover);
        }
        .countdown-label {
            font-size: 0.9rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 1.5px;
            color: var(--primary);
            margin-bottom: 10px;
        }
        .countdown-row {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }
        .countdown-cell {
            display: flex;
            flex-direction: column;
            align-items: center;
            min-width: 64px;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            padding: 8px 6px;
            box-shadow: var(--shadow);
        }
        .countdown-num {
            font-size: 1.8rem;
            font-weight: 700;
            font-variant-numeric: tabular-nums;
            color: var(--text);
            line-height: 1.1;
        }
        .countdown-unit {
            font-size: 0.7rem;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: var(--text-secondary);
        }
        .countdown-sep {
            font-size: 1.6rem;
            font-weight: 700;
            color: var(--primary);
        }
        .countdown-done {
            font-weight: 600;
            color: var(--text);
            margin-top: 4px;
        }
        @media (max-width: 480px) {
            .countdown-cell { min-width: 52px; }
            .countdown-num { font-size: 1.4rem; }
            .countdown-sep { font-size: 1.2rem; }
        }

        /* ===== Responsive ===== */
        @media (max-width: 768px) {
            .d-header-inner {
                height: auto;
                padding: 10px;
                flex-wrap: wrap;
            }
            .d-header-hamburger {
                display: block;
                order: 2;
            }
            .theme-toggle-mobile {
                display: block;
                order: 3;
            }
            .d-header-nav {
                display: none;
                order: 4;
                width: 100%;
                flex-direction: column;
                gap: 2px;
                margin-top: 8px;
                padding-top: 8px;
                border-top: 1px solid rgba(255,255,255,0.2);
            }
            .d-header-nav.open {
                display: flex;
            }
            .d-header-nav a {
                padding: 8px 12px;
                font-size: 0.95rem;
                text-align: center;
            }
            .d-header-user {
                display: none;
                order: 5;
                width: 100%;
                flex-direction: column;
                gap: 2px;
                padding-top: 4px;
                text-align: center;
                font-size: 0.95rem;
            }
            .d-header-user.open {
                display: flex;
            }
            .d-header-user .user-badge {
                margin: 0 auto;
            }
            .photo-grid {
                grid-template-columns: 1fr 1fr;
                gap: 10px;
            }
            .photo-card img {
                height: 150px;
            }
            .topic-body {
                padding: 16px;
            }
        }
        @media (max-width: 768px) {
            .login-page-grid {
                grid-template-columns: 1fr !important;
            }
            .login-page-grid > div[style*="1px"] {
                display: none !important;
            }
        }
        @media (max-width: 480px) {
            .photo-grid {
                grid-template-columns: 1fr;
            }
            .login-grid .btn {
                width: 100%;
            }
            .d-header-brand {
                font-size: 1rem;
            }
        }

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 24px 0;
}
.page-btn {
    display: inline-block;
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.15s;
}
.page-btn:hover {
    border-color: var(--primary);
    text-decoration: none;
}
.page-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Compact countdown variant (jury voting page) */
.countdown-box--compact {
    padding: 10px 16px;
    display: inline-block;
    margin: 12px 0;
}
.countdown-box--compact .countdown-label {
    font-size: 0.75rem;
    margin-bottom: 4px;
}
.countdown-box--compact .countdown-row {
    gap: 6px;
    display: inline-flex;
}
.countdown-box--compact .countdown-num {
    font-size: 1.1rem;
}
.countdown-box--compact .countdown-unit {
    font-size: 0.7rem;
    margin-right: 4px;
    align-self: flex-end;
}

/* ===== Winners calendar ===== */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.calendar-cell {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.calendar-cover {
    grid-column: 1 / -1;
}
.calendar-cover img {
    height: 420px !important;
}
.calendar-cell img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    background: #eee;
}
.calendar-label {
    padding: 10px 12px;
}

/* ===== Accessibility ===== */
:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    border-radius: 2px;
}
.d-header :focus-visible,
.theme-toggle:focus-visible,
.d-header-hamburger:focus-visible {
    outline-color: #fff;
}
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--surface);
    color: var(--text);
    padding: 10px 16px;
    z-index: 4000;
    border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus {
    left: 0;
}

/* ===== Admin dashboard ===== */
.stat-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    text-align: center;
    display: flex;
    flex-direction: column;
}
.stat-num { font-size: 1.8rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.8rem; color: var(--text-secondary); }
