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

body {
    font-family: Helvetica, Arial, sans-serif;
    background: #eaeaea;
    color: #002652;
}

/* ==================== HEADER MED NAVIGASJON ==================== */
.pf-header {
    background-color: #002652;
    height: 50px;
    width: 100%;
}

.pf-header-container {
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 20px;
}

.pf-logo-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.pf-header img {
    height: 30px;
    width: auto;
}

/* ============================================
   ANNONSE
   ============================================ */
.ad-wrapper {
    background: #eaeaea;
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #d0d5dc;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ad-container {
    position: relative;
}

.ad-label {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: #999;
    background: #eaeaea;
    padding: 0 8px;
    text-transform: uppercase;
}

.desktop-ad { display: block; }
.mobile-ad { display: none; }

@media (max-width: 768px) {
    .desktop-ad { display: none; }
    .mobile-ad { display: block; }
}

/* ============================================
   TAB-BAR UNDER HEADER
   ============================================ */
.pf-tabs {
    background: #e8ecf0;
    padding: 10px 0;
    border-bottom: 1px solid #d0d5dc;
}

.pf-tabs-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 6px;
}

.pf-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    color: #002652;
    background: transparent;
    transition: all 0.2s;
}

.pf-tab:hover {
    background: rgba(0, 38, 82, 0.08);
}

.pf-tab.active {
    background: #002652;
    color: white;
}

.pf-tab .tab-icon {
    font-size: 15px;
}

@media (max-width: 768px) {
    .pf-header-container {
        padding: 0 12px;
        gap: 10px;
    }

    .pf-header img {
        height: 24px;
    }

    .pf-tabs-container {
        padding: 0 12px;
        gap: 4px;
    }

    .pf-tab {
        padding: 8px 10px;
        font-size: 12px;
        gap: 4px;
    }
}

/* ==================== SESAMY LOGIN I HEADER ==================== */
.pf-nav-login {
    display: flex;
    align-items: center;
    margin-left: auto;
    height: 100%;
}

.pf-nav-login sesamy-login {
    --sesamy-font-family: Helvetica, Arial, sans-serif;
    --sesamy-font-size: 14px;
    --sesamy-color: rgba(255, 255, 255, 0.7);
    --sesamy-color-hover: white;
}

/* Login-knapp styling */
.pf-nav-login sesamy-login::part(button) {
    background: white;
    border: 1px solid white;
    border-radius: 4px;
    color: #002652;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 16px;
    transition: all 0.2s;
}

.pf-nav-login sesamy-login::part(button):hover {
    background: rgba(255, 255, 255, 0.9);
}

.btn-calendar,
.calendar-banner,
.btn-compare,
.compare-banner {
    display: none;
}

/* Vises når bruker har tilgang */
body.sesamy-access .btn-calendar,
body.sesamy-access .btn-compare {
    display: block;
}

body.sesamy-access .calendar-banner {
    display: flex;
}

@media (max-width: 768px) {
    .pf-nav-login {
        padding: 0 10px;
        margin-left: 4px;
    }
    
    .pf-nav-login sesamy-login {
        --sesamy-font-size: 13px;
    }
}

/* ==================== CONTAINER ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    color: #002652;
    margin-bottom: 30px;
    font-size: 32px;
    font-weight: 300;
}

/* Filters */
.filters {
    background: white;
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.filter-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 120px;
    max-width: 200px;
}

.filter-group label {
    font-size: 12px;
    margin-bottom: 4px;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.filter-group select {
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    color: #002652;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 14px;
}

.filter-group select:focus {
    outline: none;
    border-color: #002652;
    box-shadow: 0 0 0 2px rgba(0, 38, 82, 0.1);
}

.filter-actions {
    flex: 0 0 auto;
    min-width: auto;
    max-width: none;
}

.filter-buttons {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: stretch;
}

.filter-buttons [slot="content"] {
    display: flex;
    flex-direction: row;
    gap: 6px;
}

.filter-buttons .btn {
    white-space: nowrap;
    font-size: 13px;
    padding: 9px 10px;
}

.btn {
    padding: 9px 16px;
    background: #002652;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 14px;
    transition: background 0.2s;
}

.btn:hover {
    background: #003d7a;
}

.btn-secondary {
    background: #6b7280;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-calendar {
    background: #0066cc;
}

.btn-calendar:hover {
    background: #0055aa;
}

.btn-compare {
    background: #059669;
}

.btn-compare:hover {
    background: #047857;
}

/* Calendar banner for mobile */
.calendar-banner {
    display: none;
    background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
    color: white;
    padding: 14px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    cursor: pointer;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.calendar-banner:active {
    transform: scale(0.98);
}

.calendar-banner-icon {
    font-size: 18px;
    margin-right: 10px;
}

.calendar-banner-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.calendar-banner-arrow {
    font-size: 16px;
    opacity: 0.8;
}

/* Utility classes */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

/* Two-column layout */
.main-layout {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 30px;
}

.events-column {
    min-width: 0;
}

.sidebar {
    min-width: 0;
}

/* Month navigation */
.month-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #002652;
    color: white;
    padding: 12px 15px;
    border-radius: 4px 4px 0 0;
}

.month-nav-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background 0.2s;
}

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

.month-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.current-month {
    font-weight: 500;
    font-size: 16px;
}

/* Events table */
.events-table {
    background: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.events-table-container {
    border-radius: 0 0 4px 4px;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

thead {
    background: #002652;
    color: white;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 500;
    font-size: 14px;
}

/* Faste kolonnebredder desktop */
th:nth-child(1),
td:nth-child(1) {
    width: 140px;
}

th:nth-child(2),
td:nth-child(2) {
    width: auto;
}

th:nth-child(3),
td:nth-child(3) {
    width: 180px;
}

td {
    padding: 15px;
    border-bottom: 1px solid #eaeaea;
    font-size: 14px;
}

.date-cell {
    white-space: nowrap;
    color: #666;
    cursor: pointer;
}

.country-flag {
    cursor: pointer;
    display: inline-block;
}

.country-flag:hover {
    opacity: 0.7;
}

.event-name {
    font-weight: 500;
    color: #002652;
    line-height: 1.4;
}

.format-icon {
    font-size: 12px;
}

.circuit-subtext {
    font-size: 12px;
    color: #999;
    margin-top: 3px;
    line-height: 1.3;
    cursor: pointer;
}

/* Passerte arrangementer */
tr.past-event {
    display: none;
    opacity: 0.45;
}

tr.past-event td {
    text-decoration: line-through;
    text-decoration-color: #ccc;
}

tr.past-event .mobile-series-info,
tr.past-event .circuit-subtext,
tr.past-event .category-subtext,
tr.past-event .support-series {
    text-decoration: none;
}

.show-past-events tr.past-event {
    display: table-row;
}

.past-events-toggle {
    padding: 8px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #eaeaea;
    font-size: 13px;
    color: #666;
}

.past-events-toggle label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.past-events-toggle input[type="checkbox"] {
    cursor: pointer;
}

/* Avlyste arrangementer */
tr.cancelled .event-name {
    text-decoration: line-through;
    text-decoration-color: #c0392b;
    color: #c0392b;
}

tr.cancelled .circuit-subtext {
    text-decoration: line-through;
    text-decoration-color: #c0392b;
    color: #c0392b;
    opacity: 0.7;
}

tr.cancelled .mobile-series-info {
    opacity: 0.7;
}

/* Avlyste sessions i programmodal */
.pm-session-cancelled {
    opacity: 0.7;
}

.pm-session-cancelled .pm-session-name,
.pm-session-cancelled .pm-session-time {
    text-decoration: line-through;
    text-decoration-color: #c0392b;
    color: #c0392b;
}

.series-name {
    font-weight: 500;
    color: #002652;
    line-height: 1.4;
    cursor: pointer;
}

.category-subtext {
    font-size: 12px;
    color: #999;
    margin-top: 3px;
    line-height: 1.3;
    cursor: pointer;
}

/* Support series styling */
/* Variant C: Hierarkisk - under hverandre med mindre font */
.support-series {
    font-size: 12px;
    color: #888;
    margin-top: 1px;
    line-height: 1.4;
    cursor: pointer;
}

.support-series:hover {
    color: #002652;
    text-decoration: underline;
}

/* Variant B: Inline med middot */
.support-series-inline {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
    line-height: 1.4;
}

.support-series-link {
    cursor: pointer;
}

.support-series-link:hover {
    color: #002652;
    text-decoration: underline;
}

/* Mobil: Support series */
.mobile-support-series {
    font-size: 11px;
    color: #999;
    margin-top: 1px;
    line-height: 1.4;
    cursor: pointer;
}

.mobile-support-series:hover {
    text-decoration: underline;
}

.mobile-support-series-inline {
    margin-top: 3px;
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.support-series-badge {
    display: inline-block;
    font-size: 9px;
    color: #999;
    background: #f0f0f0;
    padding: 1px 5px;
    border-radius: 2px;
    cursor: pointer;
}

.support-series-badge:hover {
    background: #e0e0e0;
}

.clickable {
    cursor: pointer;
}

.clickable:hover {
    text-decoration: underline;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Mobile series info (hidden on desktop) */
.mobile-series-info {
    display: none;
}

/* Sidebar / Helgeplanlegger styles */
.sidebar-box {
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.sidebar-header {
    background: #002652;
    color: white;
    padding: 15px;
    font-weight: 500;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.accordion-toggle {
    display: none;
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.accordion-toggle:hover {
    background: rgba(255,255,255,0.2);
}

.accordion-icon {
    transition: transform 0.3s;
}

.accordion-icon.collapsed {
    transform: rotate(180deg);
}

.weekend-content {
    padding: 0;
    max-height: 600px;
    overflow-y: auto;
}

.weekend-content.collapsed {
    display: none;
}

.weekend-day {
    border-bottom: 1px solid #eaeaea;
}

.weekend-day:last-child {
    border-bottom: none;
}

.weekend-day-header {
    background: #f5f5f5;
    padding: 10px 15px;
    font-weight: 500;
    font-size: 13px;
    color: #002652;
}

.weekend-session {
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
    gap: 2px;
}

.weekend-session:last-child {
    border-bottom: none;
}

.session-time {
    color: #666;
    font-size: 12px;
}

.session-series {
    font-size: 12px;
    color: #666;
    text-align: right;
}

.session-name {
    font-weight: 500;
    color: #002652;
}

.session-stream {
    text-align: right;
    align-self: center;
}

.session-stream a {
    font-size: 14px;
    text-decoration: none;
}

.session-event {
    grid-column: 1 / -1;
    font-size: 12px;
    color: #666;
}

.session-drivers {
    grid-column: 1 / -1;
    font-size: 11px;
    color: #0066cc;
    cursor: help;
}

.nor-flag {
    font-size: 12px;
}

.no-sessions {
    padding: 30px 15px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

/* Week navigation for helgeplanlegger */
.week-navigation {
    display: flex;
    gap: 5px;
}

.week-nav-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 5px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

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

/* Navigasjon mellom sider */
.page-nav {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.page-nav-link {
    flex: 1;
    padding: 12px 20px;
    text-align: center;
    text-decoration: none;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.page-nav-link:hover {
    background: #f5f5f5;
    color: #002652;
}

.page-nav-link.active {
    color: #002652;
    border-bottom-color: #002652;
    background: #f8f9fa;
}

@media (max-width: 768px) {
    .page-nav {
        margin: 0 0 0 0;
        border-radius: 0;
    }
    
    .page-nav-link {
        padding: 10px 15px;
        font-size: 13px;
    }
}

/* ==========================================
   KALENDERABONNEMENT MODAL
   ========================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 38, 82, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(2px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 540px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: #002652;
    color: white;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 17px;
    font-weight: 500;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.modal-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-intro {
    color: #666;
    font-size: 14px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.modal-notice {
    font-size: 13px;
    color: #92400e;
    background: #fef3c7;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    line-height: 1.4;
}

/* Radio options */
.calendar-option {
    margin-bottom: 10px;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 14px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.radio-option:hover {
    background: #f0f1f3;
}

.radio-option:has(input:checked) {
    border-color: #0066cc;
    background: #f0f7ff;
}

.radio-option input[type="radio"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    accent-color: #0066cc;
}

.radio-option input[type="radio"]:checked + .radio-label {
    font-weight: 500;
    color: #002652;
}

.radio-label {
    font-size: 15px;
    color: #333;
}

/* Series selector */
.series-selector {
    margin-top: 15px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.series-selector.hidden {
    display: none;
}

/* Category accordion */
.category-accordion {
    border-bottom: 1px solid #e5e7eb;
}

.category-accordion:last-child {
    border-bottom: none;
}

.category-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.2s;
}

.category-header:hover {
    background: #f0f1f3;
}

.category-name {
    font-weight: 500;
    color: #002652;
    font-size: 14px;
}

.category-count {
    font-size: 12px;
    color: #9ca3af;
    margin-left: auto;
    margin-right: 12px;
}

.accordion-arrow {
    font-size: 10px;
    color: #9ca3af;
    transition: transform 0.3s;
}

.category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: white;
}

.category-content.open {
    max-height: 500px;
}

.category-actions {
    padding: 10px 16px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    gap: 16px;
}

.btn-link {
    background: none;
    border: none;
    color: #0066cc;
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.btn-link:hover {
    text-decoration: underline;
}

/* Series checkboxes */
.series-checkbox {
    display: flex;
    align-items: center;
    padding: 11px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s;
}

.series-checkbox:last-child {
    border-bottom: none;
}

.series-checkbox:hover {
    background: #fafafa;
}

.series-checkbox input[type="checkbox"] {
    margin-right: 12px;
    width: 16px;
    height: 16px;
    accent-color: #0066cc;
}

.checkbox-label {
    font-size: 14px;
    color: #374151;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
}

.event-count {
    font-size: 12px;
    color: #9ca3af;
}

/* Subscribe section */
.subscribe-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.btn-subscribe {
    background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.2s;
    width: 100%;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

.btn-subscribe:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.4);
}

.btn-subscribe:active {
    transform: translateY(0);
}

.btn-subscribe:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.subscribe-hint {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 10px;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: -1;
    }
    
    /* Accordion toggle visible on mobile */
    .accordion-toggle {
        display: flex;
        align-items: center;
        gap: 5px;
    }
    
    /* Weekend content collapsed by default on mobile */
    .weekend-content.mobile-collapsed {
        display: none;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    
    /* Compact filters on mobile */
    .filters {
        padding: 12px;
        gap: 10px;
        margin-bottom: 12px;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    
    .filter-group {
        min-width: 0;
        max-width: none;
    }

    .filter-group label {
        font-size: 11px;
        margin-bottom: 3px;
    }
    
    .filter-group select {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .filter-actions {
        grid-column: 1 / -1;
    }
    
    .filter-buttons {
        width: 100%;
    }
    
    .filter-buttons .btn {
        flex: 1;
        padding: 10px;
    }
    
    /* Show calendar banner, hide calendar button */
    .mobile-only {
        display: flex;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 10px 8px;
    }
    
    /* Faste kolonnebredder mobil */
    th:nth-child(1),
    td:nth-child(1) {
        width: 100px;
    }
    
    th:nth-child(2),
    td:nth-child(2) {
        width: auto;
    }
    
    /* Hide Serie column on mobile */
    .serie-column {
        display: none;
    }
    
    th.serie-column {
        display: none;
    }
    
    /* Show mobile series info */
    .mobile-series-info {
        display: block;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px dotted #ddd;
    }
    
    /* Vertikal stiplet linje mellom kolonnene */
    td:first-child {
        border-right: 1px dotted #ddd;
    }
    
    .mobile-series-name {
        font-weight: 500;
        color: #002652;
        font-size: 12px;
        line-height: 1.4;
        cursor: pointer;
    }
    
    .mobile-category-name {
        font-size: 10px;
        color: #999;
        margin-top: 1px;
        line-height: 1.4;
        cursor: pointer;
    }
    
    /* Adjust date cell for mobile */
    .date-cell {
        vertical-align: top;
    }
    
    /* Month navigation on mobile */
    .month-navigation {
        padding: 10px 12px;
    }
    
    .month-nav-btn {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .current-month {
        font-size: 14px;
    }
    
    /* Modal on mobile */
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h2 {
        font-size: 16px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .radio-option {
        padding: 10px 12px;
    }
    
    .category-header {
        padding: 12px;
    }
    
    .series-checkbox {
        padding: 8px 12px;
    }
}

/* =====================================================
   CSS for sessions som krysser midnatt
   Legg til i din CSS-fil eller <style>-tag
   ===================================================== */

/* Session som fortsetter fra forrige dag (starter med ←) */
.timeline-session.is-continuation {
    border-left: 3px solid rgba(255,255,255,0.6);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Session som fortsetter til neste dag (ender med →) */
.timeline-session.is-truncated {
    border-right: 3px solid rgba(255,255,255,0.6);
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Session som både er continuation OG truncated (midtdel av et langt løp) */
.timeline-session.is-continuation.is-truncated {
    border-left: 3px solid rgba(255,255,255,0.6);
    border-right: 3px solid rgba(255,255,255,0.6);
    border-radius: 0;
}

/* Kort som fortsetter fra forrige dag */
.session-card.is-continuation {
    border-left: 4px solid #3b82f6;
}

/* Kort som fortsetter til neste dag */
.session-card.is-truncated {
    border-right: 4px solid #3b82f6;
}

/* Kort som både er continuation OG truncated */
.session-card.is-continuation.is-truncated {
    border-left: 4px solid #3b82f6;
    border-right: 4px solid #3b82f6;
}

/* ==========================================
   TERMINLISTESAMMENLIGNER
   ========================================== */

/* Serie-farger for sammenligning */
:root {
    --compare-color-1: #3b82f6;
    --compare-color-2: #ef4444;
    --compare-color-3: #22c55e;
    --compare-color-4: #f59e0b;
    --compare-color-5: #8b5cf6;
    --compare-color-6: #ec4899;
    --compare-color-7: #14b8a6;
    --compare-color-8: #64748b;
}

/* Compare banner for mobile */
.compare-banner {
    display: none;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    padding: 14px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    cursor: pointer;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.compare-banner:active {
    transform: scale(0.98);
}

.compare-banner-icon {
    font-size: 18px;
    margin-right: 10px;
}

.compare-banner-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.compare-banner-arrow {
    font-size: 16px;
    opacity: 0.8;
}

/* Sammenligner-modal spesifikke stiler */
#compareModal .modal-content {
    max-width: 700px;
}

#compareModal .modal-header {
    background: #059669;
}

/* Steg-visning i modal */
.compare-steps {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.compare-step {
    flex: 1;
    text-align: center;
    padding: 10px;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 13px;
    color: #6b7280;
}

.compare-step.active {
    background: #d1fae5;
    color: #059669;
    font-weight: 500;
}

.compare-step-number {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    margin-bottom: 2px;
}

/* Valg-seksjon */
.compare-selection {
    margin-bottom: 20px;
}

.compare-selection-hint {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 12px;
}

.compare-selected-count {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #166534;
}

.compare-selected-count.warning {
    background: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
}

/* Resultat-seksjon */
.compare-results {
    display: none;
}

.compare-results.visible {
    display: block;
}

.compare-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.compare-results-title {
    font-size: 15px;
    font-weight: 600;
    color: #002652;
}

.compare-back-btn {
    background: none;
    border: none;
    color: #059669;
    cursor: pointer;
    font-size: 13px;
    padding: 0;
}

.compare-back-btn:hover {
    text-decoration: underline;
}

/* Serie-legende */
.compare-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
}

.compare-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #374151;
}

.compare-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* Kollisjon-oversikt */
.compare-collision-summary {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #991b1b;
}

.compare-collision-summary.no-collisions {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

/* Event-liste */
.compare-event-list {
    max-height: 400px;
    overflow-y: auto;
}

.compare-date-group {
    margin-bottom: 16px;
}

.compare-date-header {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 8px;
    position: sticky;
    top: 0;
    background: white;
}

.compare-event {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 6px;
    background: #f9fafb;
    transition: background 0.2s;
}

.compare-event:hover {
    background: #f3f4f6;
}

.compare-event.has-collision {
    background: #fef2f2;
    border-left: 3px solid #ef4444;
}

.compare-series-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
}

.compare-series-tag.color-1 { background: var(--compare-color-1); }
.compare-series-tag.color-2 { background: var(--compare-color-2); }
.compare-series-tag.color-3 { background: var(--compare-color-3); }
.compare-series-tag.color-4 { background: var(--compare-color-4); }
.compare-series-tag.color-5 { background: var(--compare-color-5); }
.compare-series-tag.color-6 { background: var(--compare-color-6); }
.compare-series-tag.color-7 { background: var(--compare-color-7); }
.compare-series-tag.color-8 { background: var(--compare-color-8); }

.compare-event-info {
    flex: 1;
    min-width: 0;
}

.compare-event-name {
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 2px;
}

.compare-event-details {
    font-size: 12px;
    color: #6b7280;
}

.compare-event-dates {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
}

.collision-indicator {
    color: #ef4444;
    font-weight: 600;
    margin-left: 4px;
}

/* Loading state */
.compare-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #6b7280;
}

.compare-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: #059669;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

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

/* Søkefelt med autocomplete for sammenligner */
.compare-search-container {
    position: relative;
    margin-bottom: 16px;
}

.compare-search-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.compare-search-input:focus {
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.compare-search-input::placeholder {
    color: #9ca3af;
}

.compare-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-top: 4px;
}

.compare-autocomplete.visible {
    display: block;
}

.compare-autocomplete-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}

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

.compare-autocomplete-item:hover,
.compare-autocomplete-item.highlighted {
    background: #f0fdf4;
}

.compare-autocomplete-name {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 2px;
}

.compare-autocomplete-meta {
    font-size: 12px;
    color: #6b7280;
}

.compare-no-results {
    padding: 12px 14px;
    color: #6b7280;
    font-size: 13px;
    text-align: center;
}

/* Valgte serier som tags */
.compare-selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    min-height: 0;
}

.compare-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #d1fae5;
    color: #065f46;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.compare-tag-remove {
    background: none;
    border: none;
    color: #065f46;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin-left: 2px;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.compare-tag-remove:hover {
    opacity: 1;
}

/* Mobil-responsivitet for sammenligner */
@media (max-width: 768px) {
    body.sesamy-access .compare-banner {
        display: flex;
    }

    #compareModal .modal-content {
        max-width: 100%;
        max-height: 90vh;
    }

    .compare-steps {
        flex-direction: column;
        gap: 4px;
    }

    .compare-step {
        padding: 8px;
    }

    .compare-legend {
        flex-direction: column;
        gap: 6px;
    }

    .compare-event {
        flex-direction: column;
        gap: 6px;
    }

    .compare-event-dates {
        margin-top: 4px;
    }
}

/* ==================== PROGRAMMODAL (helge-sessions) ==================== */

/* Serie-kolonne inner wrapper for klokke-ikon */
.serie-column-inner {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.serie-column-text {
    flex: 1;
    min-width: 0;
}

.program-icon {
    cursor: pointer;
    font-size: 14px;
    opacity: 0.5;
    transition: opacity 0.2s;
    flex-shrink: 0;
    line-height: 1.4;
}

.program-icon:hover {
    opacity: 1;
}

.mobile-program-icon {
    margin-left: 6px;
    font-size: 12px;
}

/* Modal overlay */
#eventProgramModal.modal {
    z-index: 1001;
}

/* Modal content */
.pm-modal-content {
    background: white;
    border-radius: 2px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: pmSlideIn 0.3s ease;
}

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

.pm-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    z-index: 1;
    line-height: 1;
    padding: 5px;
}

.pm-close:hover {
    color: white;
}

/* Header med gradient */
.pm-header {
    background: linear-gradient(135deg, #002652 0%, #003d7a 100%);
    padding: 20px;
    color: white;
}

.pm-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.3;
}

.pm-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pm-meta-series {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 6px;
}

.pm-meta-circuit {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Førere */
.pm-drivers {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.pm-drivers h4 {
    font-size: 14px;
    color: #002652;
    margin-bottom: 15px;
}

.pm-drivers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.pm-driver-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 10px 15px;
    border-radius: 2px;
    text-decoration: none;
    color: #002652;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.pm-driver-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.pm-driver-card img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.pm-driver-name {
    font-weight: 500;
    font-size: 14px;
}

/* Sessions / Program */
.pm-sessions {
    padding: 20px;
}

.pm-sessions h4 {
    font-size: 14px;
    color: #002652;
    margin-bottom: 15px;
}

.pm-sessions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pm-session-row {
    display: grid;
    grid-template-columns: 80px 100px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 2px;
    font-size: 13px;
}

.pm-session-date {
    color: #666;
    font-size: 12px;
}

.pm-session-time {
    color: #002652;
    font-weight: 500;
}

.pm-session-name {
    color: #333;
}

.pm-session-series {
    display: block;
    font-size: 11px;
    color: #888;
    margin-top: 1px;
}

.pm-session-icons {
    display: flex;
    gap: 8px;
    font-size: 14px;
    align-items: center;
}

.pm-session-icons a {
    text-decoration: none;
}

.pm-stream-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: transform 0.15s;
}

.pm-stream-link:hover {
    transform: scale(1.1);
}

.pm-stream-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* Responsive */
@media (max-width: 768px) {
    .pm-modal-content {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 0;
    }

    .pm-header {
        padding: 16px;
    }

    .pm-title {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .pm-meta-series {
        font-size: 13px;
    }

    .pm-meta-circuit {
        font-size: 12px;
    }

    .pm-session-row {
        grid-template-columns: 55px 85px 1fr auto;
        gap: 6px;
        padding: 8px 10px;
        font-size: 12px;
    }

    .pm-session-date {
        font-size: 11px;
    }

    .pm-session-time {
        font-size: 12px;
    }

    .pm-session-name {
        font-size: 12px;
    }
}

