/* ========================================
   1. CSS CUSTOM PROPERTIES / THEMING
   ======================================== */
:root {
    /* Brand colors */
    --crc-green: #34C759;
    --crc-orange: #FF6B35;
    --crc-blue: #007AFF;
    --crc-red: #FF3B30;
    --crc-teal: #32ADE6;
    --crc-purple: #8B5CF6;

    /* Light theme (default) */
    --crc-bg-base: #f2f2f7;
    --crc-bg-primary: #ffffff;
    --crc-bg-secondary: #f2f2f7;
    --crc-bg-tertiary: #e5e5ea;
    --crc-text-primary: #1d1d1f;
    --crc-text-secondary: #6e6e73;
    --crc-text-tertiary: #aeaeb2;
    --crc-separator: rgba(60, 60, 67, 0.12);

    /* Glass */
    --crc-glass-bg: rgba(255, 255, 255, 0.78);
    --crc-glass-bg-thick: rgba(255, 255, 255, 0.92);
    --crc-glass-border: rgba(0, 0, 0, 0.06);
    --crc-glass-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);

    /* Component tokens */
    --crc-radius-sm: 8px;
    --crc-radius-md: 12px;
    --crc-radius-lg: 16px;
    --crc-radius-xl: 20px;
    --crc-radius-pill: 999px;
    --crc-transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/**
 * Community Run Calendar - Frontend Styles
 */

/* ========== AUTH MODAL ========== */
.crc-auth-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--crc-transition);
}

.crc-auth-modal-backdrop.visible {
    opacity: 1;
    visibility: visible;
}

.crc-auth-modal {
    background: var(--crc-glass-bg-thick);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border: 1px solid var(--crc-glass-border);
    border-radius: var(--crc-radius-xl);
    padding: 28px;
    max-width: 400px;
    width: 92%;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
    transform: scale(0.95) translateY(10px);
    transition: transform var(--crc-transition);
}

.crc-auth-modal-backdrop.visible .crc-auth-modal {
    transform: scale(1) translateY(0);
}

.crc-auth-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.crc-auth-modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--crc-text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.crc-auth-modal-title i { color: var(--crc-orange); }

.crc-auth-modal-close {
    color: var(--crc-text-tertiary);
    font-size: 1.2rem;
    padding: 4px;
    transition: color var(--crc-transition);
    cursor: pointer;
    background: none;
    border: none;
}
.crc-auth-modal-close:hover { color: var(--crc-text-primary); }

.crc-auth-modal-body { margin-bottom: 22px; }

.crc-auth-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--crc-separator);
    margin-bottom: 16px;
}

.crc-auth-tab {
    flex: 1;
    padding: 10px 0;
    text-align: center;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--crc-text-tertiary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all var(--crc-transition);
}

.crc-auth-tab:hover { color: var(--crc-text-secondary); }

.crc-auth-tab.active {
    color: var(--crc-blue);
    border-bottom-color: var(--crc-blue);
}

.crc-auth-field {
    margin-bottom: 14px;
    text-align: left;
}

.crc-auth-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--crc-text-secondary);
    margin-bottom: 5px;
}

.crc-auth-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--crc-separator);
    border-radius: var(--crc-radius-sm);
    background: var(--crc-bg-primary);
    color: var(--crc-text-primary);
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
    transition: border-color var(--crc-transition);
}

.crc-auth-field input:focus {
    border-color: var(--crc-blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

.crc-auth-error {
    display: none;
    color: var(--crc-red);
    font-size: 0.78rem;
    margin-bottom: 12px;
    padding: 8px 10px;
    background: rgba(255, 59, 48, 0.08);
    border-radius: var(--crc-radius-sm);
}

.crc-auth-submit {
    width: 100%;
    margin-top: 4px;
    margin-bottom: 12px;
    background: var(--crc-blue);
    color: white;
}

.crc-auth-switch {
    text-align: center;
    font-size: 0.78rem;
    color: var(--crc-text-tertiary);
    margin: 0;
}

.crc-auth-switch a {
    color: var(--crc-blue);
    text-decoration: none;
    font-weight: 500;
}

.crc-auth-switch a:hover {
    text-decoration: underline;
}

/* ========== Variables ========== */
:root {
    --crc-blue: #2563eb;
    --crc-green: #16a34a;
    --crc-orange: #ea580c;
    --crc-purple: #7c3aed;
    --crc-teal: #32ADE6;
    --crc-gold: #f59e0b;
    --crc-grey: #9ca3af;
    --crc-dark: #1f2937;
    --crc-light: #f9fafb;
    --crc-border: #e5e7eb;
    --crc-radius: 12px;
    --crc-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --crc-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

/* ========== App Container ========== */
.crc-app {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body.crc-calendar-intro-open {
    overflow: hidden;
}

.crc-calendar-intro-modal[hidden] {
    display: none;
}

.crc-calendar-intro-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.crc-calendar-intro-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.58);
}

.crc-calendar-intro-modal__panel {
    position: relative;
    width: min(560px, 100%);
    max-height: calc(100vh - 36px);
    overflow: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
    padding: 26px;
}

.crc-calendar-intro-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: var(--crc-light);
    color: var(--crc-grey);
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.crc-calendar-intro-modal__close:hover,
.crc-calendar-intro-modal__close:focus {
    color: var(--crc-dark);
    outline: none;
}

.crc-calendar-intro-modal__eyebrow {
    display: inline-flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 5px 10px;
    border-radius: var(--crc-radius-pill);
    background: rgba(0, 122, 255, 0.1);
    color: var(--crc-blue);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.crc-calendar-intro-modal h2 {
    margin: 0 42px 8px 0;
    color: var(--crc-dark);
    font-size: 28px;
    line-height: 1.15;
}

.crc-calendar-intro-modal p {
    margin: 0 0 18px;
    color: var(--crc-grey);
    font-size: 15px;
    line-height: 1.5;
}

.crc-calendar-intro-modal__list {
    display: grid;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.crc-calendar-intro-modal__list li {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 12px;
    border: 1px solid var(--crc-border);
    border-radius: 8px;
    background: #fff;
}

.crc-calendar-intro-modal__list strong {
    color: var(--crc-dark);
    font-size: 14px;
}

.crc-calendar-intro-modal__list span {
    color: var(--crc-grey);
    font-size: 14px;
    line-height: 1.4;
}

.crc-calendar-intro-modal__actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ========== Page Nav ========== */
.crc-page-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    margin-top: 12px;
}

.crc-view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: #fff;
    border: 1px solid var(--crc-border);
    border-radius: var(--crc-radius-pill);
    box-shadow: var(--crc-shadow);
}

.crc-view-toggle__button {
    appearance: none;
    border: 0;
    border-radius: var(--crc-radius-pill);
    background: transparent;
    color: var(--crc-text);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    padding: 9px 14px;
    transition: background var(--crc-transition), color var(--crc-transition), box-shadow var(--crc-transition);
}

.crc-view-toggle__button:hover {
    background: var(--crc-light);
}

.crc-view-toggle__button.is-active {
    background: var(--crc-blue);
    color: #fff;
    box-shadow: 0 3px 10px rgba(0, 122, 255, 0.22);
}

/* ========== Widget Footer Nav ========== */
.crc-widget-footer-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--crc-separator);
}

.crc-widget-footer-link {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--crc-blue);
    text-decoration: none;
    transition: opacity var(--crc-transition);
}

.crc-widget-footer-link:hover {
    opacity: 0.7;
}

/* ========== Filter Bar ========== */
.crc-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px;
    background: #fff;
    border-radius: var(--crc-radius);
    box-shadow: var(--crc-shadow);
    margin-top: 24px;
    margin-bottom: 24px;
    align-items: flex-end;
}

.crc-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 140px;
}

/* Type row — full width, forces a new line in the flex container */
.crc-filter-group--full {
    flex: 0 0 100%;
    border-top: 1px solid var(--crc-border);
    padding-top: 12px;
}

.crc-filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--crc-grey);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crc-filter {
    padding: 8px 12px;
    border: 1px solid var(--crc-border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--crc-light);
    transition: border-color 0.2s;
}

.crc-filter:focus {
    outline: none;
    border-color: var(--crc-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.crc-location-radius {
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid rgba(37, 99, 235, 0.16);
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.06);
}

.crc-location-radius[hidden] {
    display: none;
}

.crc-location-radius__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--crc-grey);
}

.crc-location-radius__header strong {
    color: var(--crc-blue);
    white-space: nowrap;
}

#crc-location-radius-input {
    width: 100%;
    accent-color: var(--crc-blue);
}

.crc-pin-search-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

#crc-set-radius-pin.is-active {
    border-color: var(--crc-blue);
    background: rgba(37, 99, 235, 0.1);
    color: var(--crc-blue);
}

.crc-map--pin-mode {
    cursor: crosshair;
}

.crc-saved-filter-panel {
    margin-top: 10px;
    display: grid;
    gap: 10px;
}

.crc-saved-filters {
    display: grid;
    gap: 8px;
}

.crc-saved-filters-empty {
    margin: 0;
    font-size: 13px;
    color: var(--crc-grey);
}

.crc-saved-filter {
    display: grid;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--crc-border);
    border-radius: 8px;
    background: var(--crc-light);
}

.crc-saved-filter__main {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.crc-saved-filter__main strong {
    font-size: 14px;
    color: var(--crc-text-primary);
}

.crc-saved-filter__main span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: var(--crc-grey);
}

.crc-saved-filter__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.crc-saved-filter__actions a,
.crc-saved-filter__actions button {
    border: 1px solid var(--crc-border);
    border-radius: 6px;
    padding: 5px 8px;
    background: #fff;
    color: var(--crc-text-primary);
    font-size: 12px;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}

.crc-saved-filter__actions a:hover,
.crc-saved-filter__actions button:hover {
    border-color: var(--crc-blue);
    color: var(--crc-blue);
}

/* ========== Distance Range Slider (dual-handle) ========== */
.crc-filter-group--distance {
    flex: 0 0 100%;
    min-width: 0;
}

.crc-distance-slider-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

/* Animated badge showing current range / zone */
.crc-distance-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--crc-blue);
    background: rgba(0, 122, 255, 0.08);
    padding: 4px 12px;
    border-radius: var(--crc-radius-pill);
    transition: color var(--crc-transition), background var(--crc-transition);
    white-space: nowrap;
}

.crc-distance-label.zone-hm {
    color: var(--crc-orange);
    background: rgba(255, 107, 53, 0.1);
}

.crc-distance-label.zone-m {
    color: var(--crc-green);
    background: rgba(52, 199, 89, 0.1);
}

/* Outer rail container — positions track, fill, and both thumbs */
.crc-range-slider {
    position: relative;
    height: 24px;           /* thumb diameter + breathing room  */
    display: flex;
    align-items: center;
    margin-bottom: 28px;    /* space below for tick labels       */
    --crc-thumb-color: var(--crc-blue);
}

/* ── Track & fill ─────────────────────────────────────────── */

.crc-range-track,
.crc-range-fill {
    position: absolute;
    height: 5px;
    border-radius: var(--crc-radius-pill);
    left: 0;
    right: 0;
    pointer-events: none;
}

.crc-range-track {
    background: var(--crc-bg-tertiary);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.crc-range-fill {
    background: var(--crc-blue);
    width: 100%;
    transition: background var(--crc-transition);
}

/* ── Range inputs (stacked) ───────────────────────────────── */

.crc-range-input {
    position: absolute;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;   /* only the thumb is interactive     */
    outline: none;
    z-index: 3;
}

/* ── Webkit thumb ─────────────────────────────────────────── */

.crc-range-input::-webkit-slider-runnable-track { background: transparent; }

.crc-range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    pointer-events: all;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--crc-bg-primary);
    border: 2.5px solid var(--crc-thumb-color);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14),
                0 0 0 0px rgba(0, 122, 255, 0.12);
    cursor: grab;
    transition: border-color var(--crc-transition),
                transform 0.14s ease,
                box-shadow 0.14s ease;
}

.crc-range-input::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16),
                0 0 0 6px rgba(0, 122, 255, 0.1);
}

.crc-range-input:active::-webkit-slider-thumb {
    cursor: grabbing;
    transform: scale(1.2);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18),
                0 0 0 8px rgba(0, 122, 255, 0.14);
}

/* ── Firefox thumb ────────────────────────────────────────── */

.crc-range-input::-moz-range-track  { background: transparent; }
.crc-range-input::-moz-range-thumb {
    pointer-events: all;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--crc-bg-primary);
    border: 2.5px solid var(--crc-thumb-color);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
    cursor: grab;
    transition: border-color var(--crc-transition);
}

/* ── Tick marks ───────────────────────────────────────────── */

.crc-slider-ticks {
    position: absolute;
    bottom: -24px;
    left: 0;
    right: 0;
    pointer-events: none;
}

.crc-slider-tick {
    position: absolute;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
    opacity: 0.75;
}

.crc-slider-tick::before {
    content: '';
    display: block;
    width: 2px;
    height: 5px;
    background: currentColor;
    border-radius: 2px;
}

.crc-slider-tick--hm { color: var(--crc-orange); }
.crc-slider-tick--m  { color: var(--crc-green);  }

/* ========== Map ========== */
.crc-map {
    height: 550px;
    border-radius: var(--crc-radius);
    box-shadow: var(--crc-shadow);
    z-index: 1;
}

.crc-app--list-view .crc-map {
    display: none;
}

.crc-app--list-view .crc-filter-bar {
    margin-top: 0;
}

/* ========== Event Card Grid ========== */
.crc-event-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.crc-app--list-view .crc-event-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.crc-app--list-view .crc-card {
    display: grid;
    grid-template-columns: 56px minmax(220px, 1.35fr) minmax(150px, 0.75fr) minmax(170px, 1fr) minmax(120px, 0.65fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 0;
    padding: 8px 10px;
    border: 1px solid var(--crc-border);
    border-radius: 8px;
    box-shadow: none;
    overflow: visible;
}

.crc-app--list-view .crc-card:hover {
    box-shadow: var(--crc-shadow);
    transform: none;
}

.crc-app--list-view .crc-card-image {
    width: 56px;
    height: 44px;
    min-height: 0;
    border-radius: 6px;
}

.crc-app--list-view .crc-card-body {
    display: contents;
    min-width: 0;
    padding: 0;
}

.crc-app--list-view .crc-card-title {
    margin: 0;
    min-width: 0;
    font-size: 14px;
    line-height: 1.2;
}

.crc-app--list-view .crc-card-title a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crc-app--list-view .crc-card-meta {
    display: grid;
    grid-column: 3 / 6;
    grid-template-columns: minmax(132px, 0.8fr) minmax(150px, 1fr) minmax(120px, 0.9fr);
    gap: 10px;
    margin: 0;
    min-width: 0;
}

.crc-app--list-view .crc-card-meta-item {
    min-width: 0;
    font-size: 12px;
}

.crc-app--list-view .crc-card-meta-item span,
.crc-app--list-view .crc-card-distance-tags {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crc-app--list-view .crc-card-distance-tags {
    flex-wrap: nowrap;
    margin: 0;
}

.crc-app--list-view .crc-card-footer {
    justify-content: flex-end;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
}

.crc-app--list-view .crc-card-footer .crc-btn {
    padding: 7px 12px;
    white-space: nowrap;
}

.crc-app--list-view .crc-badges-container,
.crc-app--list-view .crc-today-chip {
    display: none;
}

.crc-app--list-view .crc-strong-arm {
    position: static;
    width: 30px;
    height: 30px;
    background: var(--crc-light);
}

.crc-app--list-view .crc-card-image-placeholder {
    height: 100%;
    font-size: 18px;
}

.crc-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px;
    color: var(--crc-grey);
    font-size: 16px;
}

.crc-no-events {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px;
    color: var(--crc-grey);
}

.crc-load-more-wrap {
    display: flex;
    justify-content: center;
    padding: 28px 0 6px;
}

.crc-load-more-wrap[hidden],
.crc-load-more-wrap button[hidden] {
    display: none;
}

.crc-load-more-wrap .crc-btn {
    min-width: 150px;
    justify-content: center;
}

.crc-featured-rail {
    grid-column: 1 / -1;
    margin: 0 0 22px;
    padding: 18px;
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 12px;
    background: linear-gradient(180deg, #fffaf0 0%, #fff 100%);
    box-shadow: var(--crc-shadow);
}

.crc-featured-rail__header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.crc-featured-rail__header span {
    display: block;
    margin-bottom: 2px;
    color: #b45309;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.crc-featured-rail__header strong {
    display: block;
    color: var(--crc-dark);
    font-size: 18px;
    line-height: 1.2;
}

.crc-featured-rail__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.crc-featured-rail-card {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 12px;
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(245, 158, 11, 0.24);
    border-radius: 10px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.crc-featured-rail-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(146, 64, 14, 0.12);
}

.crc-featured-rail-card__image {
    position: relative;
    min-width: 0;
    height: 76px;
    overflow: hidden;
    border-radius: 8px;
    background: var(--crc-light);
}

.crc-featured-rail-card__image img,
.crc-featured-rail__placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.crc-featured-rail__placeholder {
    display: grid;
    place-items: center;
    color: var(--crc-grey);
    font-size: 24px;
}

.crc-featured-rail-card__image .crc-featured-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    max-width: calc(100% - 12px);
    font-size: 9px;
}

.crc-featured-rail-card__body {
    display: grid;
    gap: 4px;
    min-width: 0;
    align-content: center;
}

.crc-featured-rail-card__body strong {
    overflow: hidden;
    color: var(--crc-dark);
    font-size: 14px;
    line-height: 1.25;
    text-overflow: ellipsis;
}

.crc-featured-rail-card__body > span {
    overflow: hidden;
    color: var(--crc-grey);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crc-featured-rail-card .crc-featured-promo {
    margin: 2px 0 0;
    padding: 5px 7px;
}

/* ========== Event Card ========== */
.crc-card {
    background: #fff;
    border-radius: var(--crc-radius);
    box-shadow: var(--crc-shadow);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

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

/* ── Today's event highlight ───────────────────────────────── */
.crc-card.is-today {
    border: 2px solid var(--crc-green);
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0),
                0 4px 20px rgba(52, 199, 89, 0.18);
}

.crc-card.is-today:hover {
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0),
                0 8px 28px rgba(52, 199, 89, 0.25);
    transform: translateY(-3px);
}

.crc-card.is-featured,
.crc-widget-item.is-featured {
    border: 1px solid rgba(245, 158, 11, 0.42);
    box-shadow: 0 8px 24px rgba(146, 64, 14, 0.12), var(--crc-shadow);
}

.crc-card.is-featured:hover {
    box-shadow: 0 12px 32px rgba(146, 64, 14, 0.18), var(--crc-shadow-lg);
}

.crc-card.is-paid,
.crc-widget-item.is-paid {
    border-color: rgba(37, 99, 235, 0.34);
}

/* "I DAG" chip — positioned in the top-right of the card image */
.crc-today-chip {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    background: var(--crc-green);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: var(--crc-radius-pill);
    box-shadow: 0 2px 8px rgba(52, 199, 89, 0.45);
    animation: crc-pulse-glow 2.4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes crc-pulse-glow {
    0%, 100% { box-shadow: 0 2px 8px  rgba(52, 199, 89, 0.45); }
    50%       { box-shadow: 0 2px 18px rgba(52, 199, 89, 0.75); }
}

/* Date row turns green on today's card */
.crc-card.is-today .is-today-date svg { color: var(--crc-green); }
.crc-card.is-today .is-today-date span {
    color: var(--crc-green);
    font-weight: 700;
}

.crc-card-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--crc-light);
}

.crc-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.crc-card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--crc-light) 0%, var(--crc-border) 100%);
    color: var(--crc-grey);
    font-size: 48px;
}

/* ========== Dynamic Badges ========== */
.crc-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Badges container for multiple badges in event cards */
.crc-card-image .crc-badges-container {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: calc(100% - 60px); /* Leave room for favorite button */
}

.crc-card-image .crc-badges-container .crc-badge {
    position: static;
}

.crc-featured-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f59e0b;
    color: #111827;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.4px;
    line-height: 1.2;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.28);
}

.crc-featured-badge.is-paid {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.24);
}

.crc-featured-promo,
.crc-widget-promo {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin: 0 0 12px;
    padding: 8px 10px;
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 8px;
    background: #fffbeb;
    color: #78350f;
    font-size: 12px;
    line-height: 1.35;
}

.crc-featured-promo strong,
.crc-widget-promo strong {
    padding: 2px 7px;
    border-radius: 6px;
    background: #fff;
    color: #92400e;
    font-weight: 800;
}

.crc-featured-promo small {
    color: #a16207;
}

.crc-single-featured {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.crc-single-featured .crc-featured-promo {
    margin-bottom: 0;
}

.crc-footer-featured-label {
    display: inline-flex;
    width: fit-content;
    margin-top: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.crc-footer-event-item.is-paid .crc-footer-featured-label {
    background: rgba(96, 165, 250, 0.18);
    color: #93c5fd;
}

.badge-gadelob {
    background: var(--crc-blue);
}

.badge-ocr {
    background: var(--crc-orange);
}

.badge-trail {
    background: var(--crc-green);
}

.badge-ultra {
    background: var(--crc-purple);
}

.badge-lob {
    background: var(--crc-teal);
}

/* Inline badges (not absolutely positioned) */
.crc-badge-inline {
    position: static;
    display: inline-block;
    margin-right: 6px;
    margin-bottom: 6px;
}

/* ========== Distance Tag Input ========== */
.crc-distance-tag-input {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 42px;
    padding: 6px 10px;
    border: 1px solid var(--crc-separator);
    border-radius: var(--crc-radius-sm);
    background: var(--crc-bg-primary);
    cursor: text;
    width: 100%;
    box-sizing: border-box;
    transition: border-color var(--crc-transition), box-shadow var(--crc-transition);
}

.crc-distance-tag-input:focus-within {
    border-color: var(--crc-blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
    outline: none;
}

.crc-distance-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.crc-distance-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 6px 3px 10px;
    background: var(--crc-blue);
    color: #fff;
    border-radius: var(--crc-radius-pill);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.crc-distance-tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    width: 16px;
    height: 16px;
    padding: 0;
    transition: background var(--crc-transition);
}

.crc-distance-tag-remove:hover {
    background: rgba(255, 255, 255, 0.45);
}

.crc-distance-text-input {
    border: none !important;
    outline: none !important;
    background: transparent;
    min-width: 180px;
    flex: 1;
    font-size: 14px;
    padding: 2px 0;
    box-shadow: none !important;
    color: var(--crc-text-primary);
}

.crc-distance-text-input::placeholder {
    color: var(--crc-text-tertiary);
}

/* Distance tags displayed on cards and widgets */
.crc-card-distance-tags,
.crc-widget-distance-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex-basis: 100%; /* always sits on its own row inside .crc-widget-item-meta */
    margin-top: 4px;
}

.crc-dist-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--crc-radius-pill);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    background: rgba(0, 122, 255, 0.1);
    color: var(--crc-blue);
}

.crc-dist-pill.dist-half-marathon {
    background: rgba(50, 173, 230, 0.12);
    color: var(--crc-teal);
}

.crc-dist-pill.dist-marathon {
    background: rgba(255, 107, 53, 0.12);
    color: var(--crc-orange);
}

.crc-dist-pill.dist-ultra {
    background: rgba(175, 82, 222, 0.12);
    color: var(--crc-purple);
}

/* ========== Strong Arm (Favorite) ========== */
.crc-strong-arm {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    padding: 0;
}

.crc-strong-arm:hover {
    transform: scale(1.15);
    background: #fff;
}

.crc-strong-arm svg {
    width: 20px;
    height: 20px;
    fill: var(--crc-grey);
    transition: fill 0.2s;
}

.crc-strong-arm.is-favorited svg {
    fill: var(--crc-gold);
}

.crc-card-favorite-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--crc-text-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.crc-card-favorite-count svg {
    width: 14px;
    height: 14px;
    fill: var(--crc-gold);
}

.crc-sidebar-utility-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin: 0 0 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--crc-border);
}

.crc-sidebar-utility {
    appearance: none;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 0 1 auto;
    height: 32px;
    margin: 0;
    padding: 6px 10px;
    border: 1px solid rgba(52, 199, 89, 0.22);
    border-radius: 999px;
    background: rgba(52, 199, 89, 0.08);
    color: #237a3b;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 1.25;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.crc-sidebar-utility-actions .crc-btn-map,
.crc-sidebar-utility-actions .crc-single-favorite {
    margin: 0;
}

.crc-sidebar-utility:hover {
    border-color: rgba(52, 199, 89, 0.4);
    background: rgba(52, 199, 89, 0.13);
    color: #146c2e;
    text-decoration: none;
}

.crc-sidebar-utility .crc-btn-icon {
    width: 14px;
    height: 14px;
    opacity: 0.86;
}

.crc-single-favorite .crc-btn-icon {
    fill: currentColor;
    stroke: none;
}

.crc-single-favorite.is-favorited {
    border-color: rgba(255, 204, 0, 0.32);
    background: rgba(255, 204, 0, 0.12);
    color: #8a6d1d;
}

.crc-single-favorite-count {
    margin: 0 0 10px;
    color: var(--crc-text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
}

.crc-training-coach-box {
    display: grid;
    gap: 10px;
    margin: 14px 0;
    padding: 14px;
    border: 1px solid rgba(252, 76, 2, 0.22);
    border-radius: 10px;
    background: linear-gradient(180deg, #fff7f1, #ffffff);
    box-shadow: 0 12px 28px rgba(17, 24, 39, 0.06);
}

.crc-training-coach-box strong,
.crc-training-coach-box span {
    display: block;
}

.crc-training-coach-box strong {
    color: var(--crc-text);
    font-size: 0.98rem;
    font-weight: 850;
}

.crc-training-coach-box > span {
    color: var(--crc-text-muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.crc-training-coach-form {
    display: grid;
    gap: 10px;
}

.crc-training-distance-picker {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.crc-training-distance-picker label {
    position: relative;
    min-width: 0;
}

.crc-training-distance-picker input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.crc-training-distance-picker label span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px;
    border: 1px solid rgba(31, 41, 55, 0.12);
    border-radius: 8px;
    background: #fff;
    color: var(--crc-text);
    font-size: 0.84rem;
    font-weight: 800;
    text-align: center;
    transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.crc-training-distance-picker input:checked + span {
    border-color: #fc4c02;
    background: #fff1eb;
    color: #b83600;
    box-shadow: 0 0 0 3px rgba(252, 76, 2, 0.12);
}

.crc-training-coach-btn {
    margin-top: 2px;
}

.crc-favorite-prompt {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.crc-favorite-prompt__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.36);
}

.crc-favorite-prompt__panel {
    position: relative;
    width: min(100%, 390px);
    padding: 24px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
    text-align: center;
}

.crc-favorite-prompt__close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: 0;
    background: transparent;
    color: var(--crc-text-muted);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.crc-favorite-prompt__icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    border-radius: 50%;
    background: rgba(255, 204, 0, 0.18);
    color: #8a6d1d;
    font-size: 1.35rem;
}

.crc-favorite-prompt__panel h3 {
    margin: 0 0 8px;
    color: var(--crc-text-primary);
    font-size: 1.1rem;
}

.crc-favorite-prompt__panel p {
    margin: 0 0 18px;
    color: var(--crc-text-secondary);
    font-size: 0.92rem;
    line-height: 1.45;
}

.crc-favorite-prompt__actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ========== Card Body ========== */
.crc-card-body {
    padding: 16px;
}

.crc-card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--crc-dark);
    margin: 0 0 8px;
    line-height: 1.3;
}

.crc-card-title a {
    color: inherit;
    text-decoration: none;
}

.crc-card-title a:hover {
    color: var(--crc-blue);
}

.crc-card-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.crc-card-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6b7280;
}

.crc-card-meta-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    fill: currentColor;
}

.crc-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--crc-border);
}

.crc-app--list-view .crc-featured-promo {
    display: none;
}

.crc-card-views {
    font-size: 12px;
    color: var(--crc-grey);
}

/* ========== Buttons ========== */
.crc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}

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

.crc-btn-primary {
    background: var(--crc-blue);
    color: #fff;
}

.crc-btn-primary:hover {
    background: #1d4ed8;
    color: #fff;
}

.crc-btn-outline {
    background: transparent;
    border: 1.5px solid var(--crc-blue);
    color: var(--crc-blue);
}

.crc-btn-outline:hover {
    background: var(--crc-blue);
    color: #fff;
}

/* ========== Submission Form ========== */
.crc-submit-form {
    max-width: 720px;
    margin: 0 auto;
    background: #fff;
    padding: 32px;
    border-radius: var(--crc-radius);
    box-shadow: var(--crc-shadow);
}

.crc-form-field {
    margin-bottom: 20px;
}

.crc-form-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--crc-dark);
    font-size: 14px;
}

.crc-form-field input[type="text"],
.crc-form-field input[type="url"],
.crc-form-field input[type="date"],
.crc-form-field select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--crc-border);
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}

.crc-form-field input:focus,
.crc-form-field select:focus {
    outline: none;
    border-color: var(--crc-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.crc-form-row {
    display: flex;
    gap: 16px;
}

.crc-form-half {
    flex: 1;
}

.crc-field-hint {
    font-size: 12px;
    color: var(--crc-grey);
    margin-top: 4px;
}

.crc-form-message .crc-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.crc-form-message .crc-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.crc-notice {
    text-align: center;
    padding: 32px;
    background: var(--crc-light);
    border-radius: var(--crc-radius);
    color: #6b7280;
}

/* ========== Leaflet Popup ========== */
.crc-popup {
    font-size: 13px;
    line-height: 1.4;
}

.crc-popup strong {
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
}

.crc-popup a {
    color: var(--crc-blue);
    text-decoration: none;
    font-weight: 600;
}

/* ========== Widgets ========== */
.crc-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    color: #1d1d1f;
}

.crc-widget--vertical {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.crc-widget--horizontal {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

/* Vertical item: row layout (image left, content right) */
.crc-widget-item--v {
    display: flex;
    gap: 14px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid rgba(60, 60, 67, 0.08);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.crc-widget-item--v:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
}

.crc-widget-item--v .crc-widget-item-image {
    position: relative;
    width: 100px;
    height: 80px;
    flex-shrink: 0;
    overflow: hidden;
}

.crc-widget-item--v .crc-widget-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.crc-widget-item--v .crc-widget-item-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10px 14px 10px 0;
    flex: 1;
    min-width: 0;
}

/* Horizontal item: card layout (image top, content bottom) */
.crc-widget-item--h {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    border: 1px solid rgba(60, 60, 67, 0.08);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.crc-widget-item--h:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
}

.crc-widget-item--h .crc-widget-item-image {
    position: relative;
    width: 100%;
    height: 130px;
    overflow: hidden;
}

.crc-widget-item--h .crc-widget-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.crc-widget-item--h .crc-widget-item-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 10px 12px;
}

.crc-widget-item--h .crc-widget-item-footer {
    margin-top: auto;
}

/* Shared widget item parts */
.crc-widget-item-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f2f2f7;
    color: #aeaeb2;
    font-size: 32px;
}

/* Widget header — matches .rrw-header / .rrw-title from Ruteplanner */
.crc-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}

.crc-widget-header-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: #1d1d1f;
}

.crc-widget-header-title i {
    margin-right: 6px;
    color: #e63946;
}

/* Card title — base style */
.crc-widget-item-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1d1d1f;
    text-decoration: none;
    line-height: 1.3;
    margin-bottom: 5px;
    display: block;
}

.crc-widget-item-title:hover {
    color: var(--crc-blue);
}

/* Marquee wrapper — clips overflow so animation is clean */
.crc-widget-item-title-wrap {
    overflow: hidden;
    position: relative;
    margin-bottom: 5px;
}

/* The inner span that slides when text overflows */
.crc-widget-item-title-text {
    display: inline-block;
    white-space: nowrap;
}

.crc-widget-item-title-text.crc-marquee {
    animation: crc-title-marquee var(--crc-marquee-duration, 6s) ease-in-out infinite;
}

@keyframes crc-title-marquee {
    0%,
    20%  { transform: translateX(0); }
    80%,
    100% { transform: translateX(var(--crc-marquee-offset, 0px)); }
}

.crc-widget-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    font-size: 0.75rem;
    color: #6e6e73;
    margin-bottom: 10px;
}

.crc-widget-meta-date::before,
.crc-widget-meta-loc::before,
.crc-widget-meta-dist::before {
    margin-right: 4px;
    font-size: 0.7rem;
    color: #aeaeb2;
}

.crc-widget-meta-date::before {
    content: "📅";
}

.crc-widget-meta-loc::before {
    content: "📍";
}

.crc-widget-meta-dist::before {
    content: "📏";
}

.crc-widget-item-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.crc-btn-sm {
    padding: 5px 14px;
    font-size: 0.78rem;
    border-radius: var(--crc-radius-pill);
}

.crc-widget-empty {
    text-align: center;
    padding: 24px 16px;
    color: #6e6e73;
    font-size: 0.88rem;
    background: #f2f2f7;
    border-radius: 12px;
}

.crc-widget-item-image .crc-widget-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: calc(100% - 20px);
}

.crc-widget-item-image .crc-widget-badges .crc-badge {
    position: static;
    font-size: 10px;
    padding: 3px 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ========== Checkbox Filter Pills ========== */
.crc-filter-group--checkboxes {
    min-width: 200px;
}

.crc-filter-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.crc-checkbox-label {
    display: inline-flex;
    cursor: pointer;
    margin: 0;
}

.crc-checkbox-label input[type="checkbox"] {
    display: none;
}

.crc-checkbox-pill {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: var(--crc-light);
    border: 1.5px solid var(--crc-border);
    color: #6b7280;
    transition: all 0.2s;
    user-select: none;
}

.crc-checkbox-label input:checked + .crc-checkbox-pill {
    color: #fff;
    border-color: transparent;
}

.badge-gadelob-label input:checked + .crc-checkbox-pill {
    background: var(--crc-blue);
}

.badge-ocr-label input:checked + .crc-checkbox-pill {
    background: var(--crc-orange);
}

.badge-trail-label input:checked + .crc-checkbox-pill {
    background: var(--crc-green);
}

.badge-ultra-label input:checked + .crc-checkbox-pill {
    background: var(--crc-purple);
}

.badge-lob-label input:checked + .crc-checkbox-pill {
    background: var(--crc-teal);
}

/* ========== Single Event Page ========== */
.crc-single {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 32px;
    max-width: 1200px;
    margin: 32px auto;
    padding: 0 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.crc-single-content {
    min-width: 0;
}

.crc-single-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--crc-dark);
    margin: 0 0 24px;
    line-height: 1.2;
}

/* Single event prose-card og relaterede-links styling håndteres af
   theme plugin-overrides.css (med !important) for at sikre korrekt
   hierarki pga. theme's globale heading-regler. */
.crc-single-body {
    font-size: 16px;
    line-height: 1.7;
    color: #374151;
}

.crc-single-body p {
    margin-bottom: 16px;
}

.crc-single-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Event location map */
.crc-event-map-wrap {
    margin-top: 32px;
}

#crc-event-map {
    width: 100%;
    height: 340px;
    border-radius: var(--crc-radius-md);
    overflow: hidden;
    border: 1px solid var(--crc-separator);
}

.crc-event-map-popup {
    font-size: 13px;
    line-height: 1.5;
}

.crc-event-map-popup strong {
    display: block;
    margin-bottom: 2px;
}

/* Sidebar Panel */
.crc-sidebar-panel {
    background: #fff;
    border-radius: var(--crc-radius);
    box-shadow: var(--crc-shadow);
    overflow: hidden;
    position: sticky;
    top: 32px;
}

.crc-sidebar-image {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.crc-sidebar-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.crc-sidebar-image .crc-badge {
    top: 12px;
    left: 12px;
}

.crc-sidebar-image .crc-badges-container {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.crc-sidebar-image .crc-badges-container .crc-badge {
    position: static;
}

.crc-sidebar-details {
    padding: 20px;
}

.crc-sidebar-heading {
    font-size: 16px;
    font-weight: 700;
    color: var(--crc-dark);
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--crc-border);
}

.crc-sidebar-dl {
    margin: 0 0 20px;
}

.crc-sidebar-dl dt {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--crc-grey);
    margin-bottom: 2px;
}

.crc-sidebar-dl dd {
    font-size: 15px;
    font-weight: 600;
    color: var(--crc-dark);
    margin: 0 0 14px 0;
}

.crc-event-disclaimer {
    margin: 0 0 14px;
    padding: 10px 12px;
    border: 1px solid rgba(60, 60, 67, 0.10);
    border-radius: var(--crc-radius-sm);
    background: rgba(60, 60, 67, 0.035);
    color: var(--crc-text-secondary);
    font-size: 12px;
    line-height: 1.45;
}

.crc-btn-full {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px 20px;
    font-size: 16px;
    box-sizing: border-box;
}

.crc-btn-map {
    justify-content: center;
    margin-bottom: 10px;
}

.crc-btn-icon {
    flex: 0 0 auto;
}


/* ========== Responsive ========== */
@media (max-width: 899px) {
    .crc-widget--horizontal {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .crc-widget-item--h .crc-widget-item-image {
        height: 110px;
    }
}

@media (max-width: 768px) {
    .crc-single {
        grid-template-columns: 1fr;
    }

    /* Mobil-styling for single event (titel/body/related) håndteres
       af theme plugin-overrides.css med !important. */
    .crc-training-distance-picker {
        grid-template-columns: 1fr;
    }

    .crc-sidebar-panel {
        position: static;
    }
    .crc-filter-bar {
        flex-direction: column;
    }

    .crc-filter-group {
        min-width: 100%;
    }

    .crc-page-nav {
        align-items: stretch;
        flex-direction: column;
    }

    .crc-view-toggle {
        align-self: flex-start;
    }

    .crc-calendar-intro-modal__panel {
        padding: 22px;
    }

    .crc-calendar-intro-modal h2 {
        font-size: 23px;
    }

    .crc-calendar-intro-modal__list li {
        grid-template-columns: 1fr;
        gap: 4px;
    }

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

    .crc-featured-rail {
        padding: 14px;
    }

    .crc-featured-rail__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .crc-app--list-view .crc-card {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) auto;
        gap: 8px;
        min-height: 0;
        padding: 8px;
    }

    .crc-app--list-view .crc-card-image {
        width: 44px;
        height: 40px;
        min-height: 0;
    }

    .crc-app--list-view .crc-card-body {
        display: contents;
    }

    .crc-app--list-view .crc-card-title {
        grid-column: 2;
    }

    .crc-app--list-view .crc-card-meta {
        grid-column: 2 / 4;
        grid-template-columns: 1fr;
        gap: 4px;
        margin-top: -2px;
    }

    .crc-app--list-view .crc-card-footer {
        grid-column: 3;
        grid-row: 1;
    }

    .crc-app--list-view .crc-card-footer .crc-card-views {
        display: none;
    }

    .crc-app--list-view .crc-card-footer .crc-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .crc-map {
        height: 300px;
    }

    .crc-form-row {
        flex-direction: column;
        gap: 0;
    }

    .crc-submit-form {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .crc-featured-rail {
        margin-bottom: 16px;
        padding: 10px;
        border-radius: 10px;
    }

    .crc-featured-rail__header {
        margin-bottom: 10px;
    }

    .crc-featured-rail__header span {
        font-size: 10px;
        letter-spacing: 0.4px;
    }

    .crc-featured-rail__header strong {
        font-size: 14px;
    }

    .crc-featured-rail__grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .crc-featured-rail-card {
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 9px;
        padding: 8px;
    }

    .crc-featured-rail-card__image {
        height: 64px;
    }

    .crc-featured-rail-card__body {
        gap: 3px;
        align-content: start;
    }

    .crc-featured-rail-card__body strong {
        font-size: 13px;
    }

    .crc-featured-rail-card__body > span {
        font-size: 11px;
    }

    .crc-featured-rail-card .crc-featured-promo {
        gap: 4px;
        margin-top: 1px;
        padding: 4px 6px;
        font-size: 10px;
    }

    .crc-featured-rail-card .crc-featured-promo > * {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .crc-featured-rail-card .crc-featured-promo strong {
        padding: 1px 5px;
        border-radius: 5px;
    }

    .crc-widget--horizontal {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .crc-widget-item--h {
        border-radius: 8px;
    }

    .crc-widget-item--h .crc-widget-item-image {
        height: 85px;
    }

    .crc-widget-item--h .crc-widget-item-body {
        padding: 7px 9px;
    }

    .crc-widget--horizontal .crc-widget-item-title {
        font-size: 0.77rem;
        margin-bottom: 3px;
    }

    .crc-widget--horizontal .crc-widget-item-meta {
        font-size: 0.68rem;
        gap: 2px 6px;
        margin-bottom: 6px;
    }

    .crc-widget--horizontal .crc-btn-sm {
        padding: 4px 10px;
        font-size: 0.7rem;
    }

    .crc-widget--horizontal .crc-widget-item-image .crc-badge {
        font-size: 9px;
        padding: 2px 7px;
    }

    .crc-widget-footer-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

@media (max-width: 640px) {
    .crc-featured-rail__grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 360px) {
    .crc-featured-rail-card {
        grid-template-columns: 1fr;
    }

    .crc-featured-rail-card__image {
        aspect-ratio: 16 / 7;
        height: auto;
    }
}


/* =====================================================================
 * Admin Floating Button & Modal
 * ===================================================================== */

/* Floating Button */
.crc-admin-float-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #2271b1;
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 9998;
}

.crc-admin-float-btn:hover {
    background: #135e96;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

.crc-admin-float-btn:focus {
    outline: 3px solid #135e96;
    outline-offset: 2px;
}

.crc-admin-float-btn svg {
    width: 24px;
    height: 24px;
}

/* Modal Overlay */
.crc-admin-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.crc-admin-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

/* Modal Content */
.crc-admin-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Modal Header */
.crc-admin-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.crc-admin-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1d2327;
}

.crc-admin-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.crc-admin-modal-close:hover,
.crc-admin-modal-close:focus {
    background: #f0f0f0;
    color: #000;
}

.crc-admin-modal-close:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Tabs */
.crc-admin-modal-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    background: #f6f7f7;
}

.crc-admin-modal-tab {
    flex: 1;
    padding: 12px 16px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s ease;
}

.crc-admin-modal-tab:hover {
    color: #2271b1;
    background: #fff;
}

.crc-admin-modal-tab.active {
    color: #2271b1;
    background: #fff;
    border-bottom-color: #2271b1;
}

.crc-admin-modal-tab:focus {
    outline: 2px solid #2271b1;
    outline-offset: -2px;
}

/* Modal Body */
.crc-admin-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.crc-admin-tab-content {
    display: none;
}

.crc-admin-tab-content.active {
    display: block;
}

/* Form Styles */
.crc-admin-form-group {
    margin-bottom: 20px;
}

.crc-admin-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #1d2327;
    font-size: 14px;
}

.crc-admin-input,
.crc-admin-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: border-color 0.2s ease;
}

.crc-admin-input:focus,
.crc-admin-textarea:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.crc-admin-textarea {
    resize: vertical;
}

/* Input with inline action button */
.crc-input-with-btn {
    display: flex;
    align-items: stretch;
    gap: 0;
}
.crc-input-with-btn .crc-admin-input {
    flex: 1;
    border-radius: 4px 0 0 4px;
}
.crc-input-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    background: #f6f7f7;
    border: 1px solid #8c8f94;
    border-left: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    color: #50575e;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.crc-input-action-btn:hover {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

/* Messages */
.crc-admin-messages {
    margin-bottom: 16px;
}

.crc-admin-error,
.crc-admin-success {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 14px;
}

.crc-admin-error {
    background: #fcf0f1;
    border-left: 4px solid #d63638;
    color: #50575e;
}

.crc-admin-success {
    background: #edfaef;
    border-left: 4px solid #00a32a;
    color: #1d2327;
}

/* Buttons */
.crc-admin-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.crc-admin-btn-primary {
    background: #2271b1;
    color: #fff;
}

.crc-admin-btn-primary:hover {
    background: #135e96;
}

.crc-admin-btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .crc-admin-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .crc-admin-modal-body {
        padding: 16px;
    }

    .crc-admin-float-btn {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
    }
}

/* =====================================================================
 * User Request Change Floating Button & Modal
 * ===================================================================== */

.crc-request-change-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    height: 44px;
    padding: 0 16px;
    border-radius: 22px;
    background: #34C759;
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
    z-index: 9998;
}

.crc-request-change-btn:hover {
    background: #28a745;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    transform: scale(1.03);
}

.crc-request-change-btn:focus {
    outline: 3px solid #28a745;
    outline-offset: 2px;
}

.crc-request-change-btn svg {
    flex-shrink: 0;
}

.crc-request-modal-intro {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0 0 16px;
}

@media (max-width: 600px) {
    .crc-request-change-btn span {
        display: none;
    }
    .crc-request-change-btn {
        width: 48px;
        height: 48px;
        padding: 0;
        border-radius: 50%;
        justify-content: center;
        bottom: 16px;
        left: 16px;
    }
}

/* Admin modal: multi-column form rows */
.crc-admin-form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.crc-admin-form-row .crc-admin-form-group {
    margin-bottom: 0;
    min-width: 0;
}

.crc-admin-form-group--grow {
    flex: 1;
    min-width: 140px;
}

/* Admin modal: featured image section */
.crc-admin-image-section {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 12px;
    background: #f6f7f7;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    flex-wrap: wrap;
}

.crc-admin-image-preview-wrap {
    width: 120px;
    min-height: 80px;
    background: #e0e0e0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

#crc-admin-img-preview {
    width: 120px;
    height: 90px;
    object-fit: cover;
    display: block;
    border-radius: 4px;
}

#crc-admin-no-image {
    font-size: 12px;
    color: #787c82;
    text-align: center;
    padding: 8px;
}

.crc-admin-image-controls {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.crc-admin-image-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.crc-admin-file-label {
    cursor: pointer;
    display: inline-block;
}

.crc-admin-image-url-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.crc-admin-image-url-row .crc-admin-input {
    flex: 1;
    padding: 8px 10px;
    font-size: 13px;
}

/* Admin modal: map picker */
.crc-admin-map-picker {
    width: 100%;
    height: 260px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    margin-top: 6px;
}

.crc-map-picker-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.crc-map-picker-toolbar .button,
.crc-map-picker-toolbar button {
    font-size: 12px;
    padding: 4px 10px;
    height: auto;
    line-height: 1.5;
}

.crc-geocode-status {
    font-size: 12px;
    color: #666;
}

.crc-map-coords-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 6px;
    font-size: 12px;
    color: #555;
}

.crc-map-coords-row input[type="number"] {
    width: 130px;
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    display: inline-block;
    vertical-align: middle;
}

/* Address autocomplete dropdown */
.crc-address-autocomplete-wrap {
    position: relative;
    width: 100%;
}
.crc-address-autocomplete-wrap input {
    width: 100%;
    box-sizing: border-box;
}
.crc-address-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100001;
    background: #fff;
    border: 1px solid #d0d0d0;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
    margin: 0;
    padding: 0;
    list-style: none;
    max-height: 220px;
    overflow-y: auto;
}
.crc-address-dropdown-item {
    padding: 9px 12px;
    font-size: 13px;
    color: #1d1d1f;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    line-height: 1.4;
}
.crc-address-dropdown-item:last-child {
    border-bottom: none;
}
.crc-address-dropdown-item:hover,
.crc-address-dropdown-item.is-focused {
    background: #f0f6fc;
    color: #007AFF;
}

/* Admin modal: form footer (Save + Delete) */
.crc-admin-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
    margin-top: 8px;
    gap: 12px;
}

.crc-admin-btn-danger {
    background: #d63638;
    color: #fff;
}

.crc-admin-btn-danger:hover {
    background: #b32d2e;
}

.crc-admin-btn-danger:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Admin modal: distance tag input */
#crc-admin-edit-form .crc-distance-tag-input {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: text;
    min-height: 40px;
    transition: border-color 0.2s ease;
}

#crc-admin-edit-form .crc-distance-tag-input:focus-within {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

#crc-admin-edit-form .crc-distance-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

#crc-admin-edit-form .crc-distance-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #2271b1;
    color: #fff;
    padding: 2px 8px 2px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

#crc-admin-edit-form .crc-distance-tag-remove {
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
}

#crc-admin-edit-form .crc-distance-tag-remove:hover {
    color: #fff;
}

#crc-admin-edit-form .crc-distance-text-input {
    border: none;
    outline: none;
    font-size: 14px;
    min-width: 80px;
    flex: 1;
    padding: 2px 0;
    background: transparent;
}

/* Admin modal: WordPress WYSIWYG editor */
#crc-admin-edit-form .wp-editor-wrap {
    max-width: 100%;
}

#crc-admin-edit-form .wp-editor-container {
    border: 1px solid #ddd;
    border-radius: 0 0 4px 4px;
}

#crc-admin-edit-form .wp-editor-area {
    min-height: 160px;
    font-size: 14px;
}

/* ========== FAQ Modal ========== */
.crc-form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.crc-modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.crc-modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 24px 32px;
    border: 1px solid #888;
    width: 80%;
    max-width: 720px;
    border-radius: var(--crc-radius);
    position: relative;
    box-shadow: var(--crc-shadow-lg);
    max-height: 80vh;
    overflow-y: auto;
}

.crc-modal-close {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
}

.crc-modal-close:hover,
.crc-modal-close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.crc-modal-content h1 {
    font-size: 24px;
    margin-top: 0;
    color: var(--crc-dark);
}

.crc-modal-content h2 {
    font-size: 20px;
    border-bottom: 1px solid var(--crc-border);
    padding-bottom: 8px;
    margin-top: 24px;
    color: var(--crc-dark);
}

.crc-modal-content p, .crc-modal-content li {
    font-size: 15px;
    line-height: 1.6;
    color: #374151;
}

/* ========== Registration Modal ========== */
.crc-register-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9990;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crc-register-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.crc-register-modal {
    position: relative;
    z-index: 9991;
    background: #fff;
    padding: 32px 40px;
    border-radius: var(--crc-radius);
    box-shadow: var(--crc-shadow-lg);
    width: 90%;
    max-width: 420px;
    text-align: center;
}

.crc-register-modal h3 {
    font-size: 22px;
    color: var(--crc-dark);
    margin: 0 0 8px;
}

.crc-register-modal p {
    color: #6b7280;
    font-size: 15px;
    margin: 0 0 24px;
}

#crc-register-form {
    text-align: left;
}

#crc-register-form .crc-form-field {
    margin-bottom: 16px;
}

.crc-register-login-link {
    margin-top: 20px !important;
    font-size: 14px !important;
}

.crc-register-login-link a {
    color: var(--crc-blue);
    font-weight: 600;
    text-decoration: none;
}
.crc-register-login-link a:hover {
    text-decoration: underline;
}

/* =====================================================================
 * Date-range picker (Flatpickr)
 * ===================================================================== */

.crc-filter-group--date-range {
    min-width: 220px;
}

.crc-date-range-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.crc-date-range-input {
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--crc-border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--crc-light);
    cursor: pointer;
    width: 100%;
    min-width: 190px;
    color: var(--crc-dark);
    transition: border-color 0.2s;
}

.crc-date-range-input:focus {
    outline: none;
    border-color: var(--crc-blue, #007AFF);
    box-shadow: 0 0 0 3px rgba(0,122,255,0.12);
}

.crc-date-range-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: var(--crc-gray, #6b7280);
    padding: 0 2px;
    display: none;
    transition: color 0.15s;
}

.crc-date-range-clear.is-visible {
    display: block;
}

.crc-date-range-clear:hover {
    color: var(--crc-dark, #111827);
}

/* ── Flatpickr – moderne tema ───────────────────────────────────────── */

.flatpickr-calendar {
    border: none !important;
    border-radius: 20px !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18), 0 4px 16px rgba(0,0,0,0.08) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    padding: 0 0 12px !important;
    overflow: hidden !important;
    background: #fff !important;
    width: 320px !important;
}

/* Header — månedsnavn + navigationspilar */
.flatpickr-months {
    background: linear-gradient(135deg, #007AFF 0%, #0055cc 100%) !important;
    padding: 16px 12px 14px !important;
    border-radius: 0 !important;
}

.flatpickr-months .flatpickr-month {
    background: transparent !important;
    color: #fff !important;
    fill: #fff !important;
    height: 36px !important;
}

.flatpickr-current-month {
    font-size: 16px !important;
    font-weight: 700 !important;
    letter-spacing: -0.3px !important;
    padding-top: 4px !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
    color: #fff !important;
    font-weight: 700 !important;
    font-size: 16px !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months:hover,
.flatpickr-current-month input.cur-year:hover {
    background: rgba(255,255,255,0.15) !important;
    border-radius: 6px !important;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    color: rgba(255,255,255,0.85) !important;
    fill: rgba(255,255,255,0.85) !important;
    top: 16px !important;
    padding: 6px !important;
    border-radius: 8px !important;
    transition: background 0.15s !important;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
    background: rgba(255,255,255,0.2) !important;
    color: #fff !important;
    fill: #fff !important;
}

/* Ugedage-header */
.flatpickr-weekdays {
    background: #f5f7fa !important;
    padding: 8px 10px 4px !important;
    border-bottom: 1px solid #eef0f4 !important;
    box-sizing: border-box !important;
}

span.flatpickr-weekday {
    background: transparent !important;
    color: #9ca3af !important;
    fill: #9ca3af !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* Dag-grid */
.flatpickr-days {
    padding: 8px 10px 0 !important;
    border: none !important;
    width: 320px !important;
}

.dayContainer {
    width: 300px !important;
    min-width: 300px !important;
    max-width: 300px !important;
}

.flatpickr-day {
    flex: 0 0 calc(100% / 7) !important;
    width: calc(100% / 7) !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #1d1d1f !important;
    border: none !important;
    height: 36px !important;
    line-height: 36px !important;
    max-width: none !important;
    transition: background 0.15s, color 0.15s, transform 0.1s !important;
}

.flatpickr-day:hover:not(.flatpickr-disabled):not(.startRange):not(.endRange):not(.selected) {
    background: #f0f5ff !important;
    color: #007AFF !important;
    transform: scale(1.08) !important;
}

/* Dage udenfor måneden */
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: #d1d5db !important;
}

/* Deaktiverede dage */
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    color: #e5e7eb !important;
}

/* Interval-highlight */
.flatpickr-day.inRange {
    background: #dbeafe !important;
    border-color: transparent !important;
    border-radius: 0 !important;
    box-shadow: -5px 0 0 #dbeafe, 5px 0 0 #dbeafe !important;
    color: #1e40af !important;
}

/* Start- og slutdato */
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
    background: #007AFF !important;
    border-color: #007AFF !important;
    border-radius: 10px !important;
    color: #fff !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 12px rgba(0,122,255,0.4) !important;
    transform: scale(1.05) !important;
}

.flatpickr-day.startRange.inRange,
.flatpickr-day.endRange.inRange {
    box-shadow: none !important;
}

/* Forbind inRange-bjælken til start/slut */
.flatpickr-day.startRange {
    border-radius: 10px 0 0 10px !important;
}
.flatpickr-day.endRange {
    border-radius: 0 10px 10px 0 !important;
}
.flatpickr-day.startRange.endRange {
    border-radius: 10px !important;
}

/* I dag */
.flatpickr-day.today {
    border: 2px solid #007AFF !important;
    color: #007AFF !important;
    font-weight: 700 !important;
}
.flatpickr-day.today:hover {
    background: #007AFF !important;
    color: #fff !important;
}
.flatpickr-day.today.inRange {
    border-color: transparent !important;
}

/* Enkelt valgt dato */
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: #007AFF !important;
    border-color: #007AFF !important;
    border-radius: 10px !important;
    color: #fff !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 12px rgba(0,122,255,0.4) !important;
}

/* =====================================================================
 * Custom map pin markers
 * ===================================================================== */

/*
 * .crc-pin-fan  – zero-size anchor element placed at the lat/lng point.
 * .crc-pin      – one pin per race-type, rotated around its own tip.
 * .crc-pin-body – coloured rectangular label showing the date.
 * .crc-pin-tip  – CSS triangle that forms the pointy bottom of the pin.
 *
 * Dimensions:
 *   body:  ~22 px tall  (font 10 px + padding 3+3 + border 1+1 + line-height gap)
 *   tip:   10 px tall
 *   total: ~32 px
 *   width: 52 px
 *
 * The pin element is offset so that its tip sits exactly at (0,0) of the
 * fan container, which Leaflet places at the event's coordinates.
 *   top:              -32px  → moves tip to y=0
 *   left:             -26px  → centres the 52 px body on x=0
 *   transform-origin: 26px 32px  → rotation axis is the tip
 */

.crc-pin-fan {
    position: relative;
    width: 0;
    height: 0;
}

.crc-pin {
    position: absolute;
    top: -32px;
    left: -26px;
    width: 52px;
    transform-origin: 26px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: filter 0.15s;
}

.crc-pin:hover {
    filter: brightness(1.15) drop-shadow(0 3px 6px rgba(0,0,0,0.35));
    z-index: 9999 !important;
}

.crc-pin-body {
    background: var(--pin-color, #007AFF);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    padding: 3px 5px;
    border-radius: 5px;
    white-space: nowrap;
    text-align: center;
    min-width: 40px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.28);
    border: 1px solid rgba(255,255,255,0.35);
}

.crc-pin-tip {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 10px solid var(--pin-color, #007AFF);
}

/* Reset absolute badge positioning inside the popup */
.crc-popup .crc-badge {
    position: static;
}

/* Popup layout */
.crc-popup-date {
    font-size: 12px;
    color: #6b7280;
    margin: 2px 0 6px;
}

.crc-popup-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 8px;
    margin: 4px 0 6px;
}

.crc-popup-distance {
    font-size: 12px;
    color: #374151;
}

.crc-popup-types {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* =====================================================================
 * Creators: blocked notice, my-events, promo section, author edit,
 * admin creators page toggles, change-log.
 * ===================================================================== */

/* Blocked-creator notice (submission form) */
.crc-blocked-notice {
    max-width: 520px;
    margin: 40px auto;
    text-align: center;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--crc-radius);
    padding: 32px 24px;
    color: #991b1b;
}
.crc-blocked-notice svg { color: #dc2626; margin-bottom: 8px; }
.crc-blocked-notice h2 { margin: 8px 0 4px; font-size: 1.1rem; }
.crc-blocked-notice p  { margin: 0; color: #b91c1c; font-size: 0.9rem; }

/* Map picker on submission form */
.crc-sub-map-picker {
    width: 100%;
    height: 260px;
    border: 1px solid var(--crc-border);
    border-radius: var(--crc-radius-md);
    margin-top: 6px;
}
.crc-map-picker-toolbar { margin-bottom: 8px; }
.crc-btn-sm { font-size: 12px; padding: 5px 12px; }
.crc-map-coords-row {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-top: 8px;
    font-size: 13px;
    color: #555;
}
.crc-map-coords-row input[type="number"] {
    width: 130px;
    padding: 4px 8px;
    border: 1px solid var(--crc-border);
    border-radius: 6px;
    font-size: 13px;
}

/* DAWA address autocomplete dropdown (submission form) */
.crc-address-dropdown {
    position: absolute;
    z-index: 9999;
    left: 0; right: 0;
    background: #fff;
    border: 1px solid #d0d0d0;
    border-top: none;
    max-height: 220px;
    overflow-y: auto;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 6px 14px rgba(0,0,0,0.08);
}
.crc-address-dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
}
.crc-address-dropdown-item:hover,
.crc-address-dropdown-item.is-focused { background: #f0f7ff; }

/* Promo section on submission form */
.crc-promo-section {
    margin: 24px 0 20px;
    padding: 18px 20px;
    background: #f8fafc;
    border: 1px solid var(--crc-border);
    border-radius: var(--crc-radius);
}
.crc-section-title { margin: 0 0 4px; font-size: 1rem; color: var(--crc-dark); }
.crc-section-intro { margin: 0 0 14px; font-size: 0.82rem; color: #6b7280; }

/* "Mine begivenheder" list on submission page */
/* =====================================================================
 * "Mine begivenheder" collapsible box + list + owner actions
 * ===================================================================== */
.crc-my-events-box {
    max-width: 720px;
    margin: 0 auto 24px;
    background: #fff;
    border: 1px solid var(--crc-border);
    border-radius: var(--crc-radius);
    box-shadow: var(--crc-shadow);
    overflow: hidden;
}
.crc-my-events-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background 0.15s;
}
.crc-my-events-summary::-webkit-details-marker { display: none; }
.crc-my-events-summary:hover { background: #f8fafc; }
.crc-my-events-summary-text {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--crc-dark);
}
.crc-my-events-summary-text svg { color: var(--crc-blue); }
.crc-my-events-count {
    font-weight: 500;
    color: var(--crc-grey);
    font-size: 0.78rem;
    background: #f1f5f9;
    padding: 2px 10px;
    border-radius: 12px;
}
.crc-my-events-chevron {
    color: #94a3b8;
    transition: transform 0.25s ease;
}
.crc-my-events-box[open] .crc-my-events-chevron { transform: rotate(180deg); }

.crc-my-events-list {
    list-style: none;
    margin: 0;
    padding: 0 16px 12px;
    max-height: 440px;
    overflow-y: auto;
}
.crc-my-events-empty {
    margin: 0;
    padding: 4px 16px 16px;
    color: var(--crc-grey);
    font-size: 0.82rem;
}
.crc-my-events-item {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #eef0f2;
    padding: 6px 4px;
}
.crc-my-events-item:last-child { border-bottom: none; }
.crc-my-events-link {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    padding: 6px 8px;
    text-decoration: none;
    color: var(--crc-dark);
    border-radius: 6px;
    transition: background 0.15s;
    min-width: 0;
    overflow: hidden;
}
.crc-my-events-link:hover { background: #f6f8fb; color: var(--crc-blue); }
.crc-my-events-name {
    font-weight: 600;
    font-size: 0.85rem;
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 260px;
}
.crc-my-events-date {
    font-size: 0.74rem;
    color: #6b7280;
    white-space: nowrap;
    margin-left: auto;
}
.crc-my-events-city { font-size: 0.74rem; color: #6b7280; white-space: nowrap; }
.crc-my-events-status {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0;
}
.crc-my-status-publish .crc-my-events-status { background: #dcfce7; color: #166534; }
.crc-my-status-pending  .crc-my-events-status { background: #fef3c7; color: #92400e; }
.crc-my-status-draft    .crc-my-events-status { background: #e5e7eb; color: #374151; }

/* Actions row (Rediger / Inviter / Forlad) — compact, aligned */
.crc-my-events-actions {
    display: inline-flex;
    gap: 4px;
    flex-shrink: 0;
    align-items: center;
}
.crc-my-events-edit-btn,
.crc-invite-coowner-btn,
.crc-leave-owner-btn {
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 14px;
    line-height: 1.4;
    white-space: nowrap;
}
.crc-my-events-edit-btn svg,
.crc-invite-coowner-btn svg { width: 11px; height: 11px; }
.crc-btn-ghost {
    background: transparent;
    border: 1px solid #e5e7eb;
    color: #6b7280;
}
.crc-btn-ghost:hover { color: #b91c1c; border-color: #fecaca; }

/* On narrow screens, hide button labels and show icon only */
@media (max-width: 640px) {
    .crc-my-events-name { max-width: 160px; }
    .crc-my-events-edit-btn .crc-btn-label,
    .crc-invite-coowner-btn .crc-btn-label { display: none; }
    .crc-leave-owner-btn { display: none; }
    .crc-my-events-edit-btn,
    .crc-invite-coowner-btn { padding: 5px 8px; }
    .crc-my-events-edit-btn svg,
    .crc-invite-coowner-btn svg { width: 13px; height: 13px; }
}

/* Author edit: inline link near title */
.crc-author-edit-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0 18px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--crc-blue);
    text-decoration: none;
    background: #eff6ff;
    padding: 7px 14px;
    border-radius: 20px;
    border: 1px solid #bfdbfe;
    transition: background 0.15s;
}
.crc-author-edit-inline:hover { background: var(--crc-blue); color: #fff; }

/* Author edit floating button (bottom-left, like request-change) */
.crc-author-edit-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    height: 44px;
    padding: 0 16px;
    border-radius: 22px;
    background: var(--crc-blue);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 9998;
    transition: all 0.3s ease;
}
.crc-author-edit-btn:hover {
    background: #1d4ed8;
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    transform: scale(1.03);
}
@media (max-width: 600px) {
    .crc-author-edit-btn span { display: none; }
    .crc-author-edit-btn { width: 48px; height: 48px; padding: 0; border-radius: 50%; justify-content: center; bottom: 16px; left: 16px; }
}

/* Author blocked notice (in modal placeholder) */
.crc-author-blocked-notice {
    max-width: 480px;
    margin: 40px auto;
    text-align: center;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--crc-radius);
    padding: 24px;
    color: #991b1b;
}

/* ===== Admin Creators page: toggle switches ===== */
.crc-toggle {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
    cursor: pointer;
}
.crc-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.crc-toggle-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 22px;
    transition: background 0.2s;
}
.crc-toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.crc-toggle input:checked + .crc-toggle-slider { background: #22c55e; }
.crc-toggle-danger input:checked + .crc-toggle-slider { background: #ef4444; }
.crc-toggle input:checked + .crc-toggle-slider::before { transform: translateX(20px); }
.crc-creator-blocked-row { background: #fef2f2 !important; }

/* ===== Admin metabox: creator note + change-log ===== */
.crc-creator-note-row th,
.crc-edit-log-row th { background: #f9fafb; }

.crc-creator-note {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 10px 12px;
    color: #92400e;
    font-size: 13px;
    line-height: 1.5;
}
.crc-creator-note .dashicons { color: #f59e0b; margin-top: 2px; }

.crc-edit-log {
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}
.crc-edit-log-entry {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
}
.crc-edit-log-entry:last-child { border-bottom: none; }
.crc-edit-log-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 13px;
}
.crc-edit-log-time { color: #6b7280; font-size: 12px; }
.crc-edit-log-fields { margin: 0; padding-left: 18px; font-size: 12px; color: #374151; }
.crc-edit-log-field { font-weight: 600; color: #111827; }
.crc-edit-log-old { color: #9ca3af; text-decoration: line-through; }
.crc-edit-log-arrow { color: #6b7280; margin: 0 4px; }
.crc-edit-log-new { color: #065f46; }

.crc-field-optional {
    font-weight: 400;
    color: #9ca3af;
    font-size: 0.8em;
}

/* ===================================================================
 * Owner invitations: invite modal + search results + toast banner
 * =================================================================== */

/* ── Invite co-owner modal ── */
#crc-invite-modal.crc-admin-modal { z-index: 100000; }
#crc-invite-modal .crc-admin-modal-content {
    max-width: 480px;
    border-radius: 12px;
}
#crc-invite-modal .crc-admin-modal-header { padding: 16px 20px; }
#crc-invite-modal .crc-admin-modal-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
}
#crc-invite-modal .crc-admin-modal-body { padding: 16px 20px; }
#crc-invite-modal .crc-request-modal-intro {
    font-size: 0.78rem;
    color: #6b7280;
    margin: 0 0 14px;
    line-height: 1.5;
}
#crc-invite-modal .crc-admin-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}
#crc-invite-modal .crc-admin-modal-footer .button {
    font-size: 0.82rem;
    padding: 6px 16px;
    border-radius: 6px;
}
#crc-invite-modal #crc-invite-spinner.is-active {
    display: inline-block;
    margin-right: 4px;
    float: none;
    visibility: visible;
    opacity: 1;
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='8' fill='none' stroke='%23ccc' stroke-width='2' stroke-dasharray='40' stroke-dashoffset='10'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    animation: crc-spin 0.8s linear infinite;
}
@keyframes crc-spin { to { transform: rotate(360deg); } }

/* Search input */
.crc-invite-search-row { margin-bottom: 8px; }
#crc-invite-search-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
#crc-invite-search-input:focus {
    outline: none;
    border-color: var(--crc-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Search results dropdown */
.crc-invite-search-results {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    max-height: 240px;
    overflow-y: auto;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
    margin-top: 4px;
}
.crc-invite-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.12s;
}
.crc-invite-search-item:last-child { border-bottom: none; }
.crc-invite-search-item:hover { background: #f9fafb; }
.crc-invite-search-avatar { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; }
.crc-invite-search-name { font-weight: 600; font-size: 0.82rem; }
.crc-invite-search-login { color: #6b7280; font-size: 0.72rem; margin-left: auto; }
.crc-invite-search-item .crc-invite-send-btn {
    font-size: 0.7rem;
    padding: 4px 12px;
    border-radius: 12px;
    margin-left: 4px;
}

/* ── Toast banner (site-wide, persistent) ── */
.crc-invite-toast {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 99999;
    max-width: 420px;
    min-width: 300px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-left: 4px solid #2563eb;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,.18);
    padding: 14px 16px;
}
.crc-invite-toast__inner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.crc-invite-toast__icon { flex-shrink: 0; color: #2563eb; margin-top: 2px; }
.crc-invite-toast__body { flex: 1; min-width: 0; }
.crc-invite-toast__close {
    background: transparent;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 0 4px;
}
.crc-invite-toast__close:hover { color: #111827; }
.crc-invite-toast__title {
    margin: 0 0 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #111827;
}
.crc-invite-toast__list { display: flex; flex-direction: column; gap: 8px; }
.crc-invite-toast__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    background: #f9fafb;
    border-radius: 6px;
}
.crc-invite-toast__item-text { display: flex; flex-direction: column; min-width: 0; }
.crc-invite-toast__event {
    font-weight: 600;
    font-size: 0.8rem;
    color: #111827;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}
.crc-invite-toast__event:hover { color: #2563eb; text-decoration: underline; }
.crc-invite-toast__by { font-size: 0.7rem; color: #6b7280; margin-top: 2px; }
.crc-invite-toast__actions { display: flex; gap: 6px; flex-shrink: 0; }
.crc-invite-toast__actions .crc-btn { font-size: 0.68rem; padding: 4px 10px; }

@media (max-width: 600px) {
    .crc-invite-toast {
        top: 8px; right: 8px; left: 8px;
        max-width: none;
    }
}
