/* ==========================================================================
   Rebus Fahrplan — Frontend Styles
   ========================================================================== */

.rebus-fahrplan {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    color: #333;
    max-width: 100%;
}

/* ─── Buchstaben-Navigation ─────────────────────────────── */
.rebus-letter-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 1.5em;
    padding: 0.5em 0;
}

.rebus-letter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 2px solid var(--color-custom-2);
    border-radius: 4px;
    color: var(--color-custom-2);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.15s ease;
}

.rebus-letter-btn:hover {
    background: var(--color-custom-2);
    color: #fff;
    text-decoration: none;
}

.rebus-letter-btn.active {
    background: var(--color-custom-2);
    color: #fff;
}

/* ─── Tabellen ──────────────────────────────────────────── */
.rebus-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    font-size: 0.95em;
}

.rebus-table th {
    background: var(--color-custom-2);
    color: #fff;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.rebus-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: middle;
}

.rebus-table tbody tr:hover {
    background: var(--color-custom-5);
}

.rebus-table-compact th,
.rebus-table-compact td {
    padding: 6px 10px;
}

/* ─── Linienbadge ───────────────────────────────────────── */
.rebus-line-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 24px;
    padding: 0 6px;
    background: var(--color-custom-2);
    color: #fff;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.85em;
    text-decoration: none;
    margin: 1px 2px;
}

.rebus-line-badge:hover {
    opacity: 0.85;
    text-decoration: none;
}

.rebus-line-badge-lg {
    min-width: 40px;
    height: 30px;
    font-size: 1em;
    padding: 0 8px;
}

.rebus-line-badge-xl {
    min-width: 52px;
    height: 38px;
    font-size: 1.2em;
    padding: 0 12px;
    border-radius: 6px;
}

.rebus-lines-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

/* ─── Zeiten ────────────────────────────────────────────── */
.rebus-time {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.rebus-time-cell {
    text-align: center;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    font-size: 0.9em;
}

.rebus-no-stop {
    color: #ccc;
}

/* ─── Fahrplantabelle (horizontal scrollbar) ────────────── */
.rebus-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1em 0;
}

.rebus-timetable {
    min-width: max-content;
}

.rebus-timetable .rebus-stop-col {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 1;
    min-width: 180px;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-right: 2px solid var(--color-custom-2);
}

.rebus-timetable thead .rebus-stop-col {
    background: var(--color-custom-2);
    z-index: 2;
}

.rebus-timetable .rebus-time-col {
    min-width: 60px;
    text-align: center;
    font-size: 0.85em;
}

.rebus-timetable tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.rebus-timetable tbody tr:nth-child(even) .rebus-stop-col {
    background: #f8f9fa;
}

/* ─── Richtungswähler ───────────────────────────────────── */
.rebus-direction-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 1em 0;
}

/* ─── Buttons ───────────────────────────────────────────── */
.rebus-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: #f0f0f0;
    color: #333;
    border: 2px solid #ccc;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.15s ease;
}

.rebus-btn:hover {
    background: #e0e0e0;
    text-decoration: none;
}

.rebus-btn.active {
    background: var(--color-custom-2);
    color: #fff;
    border-color: var(--color-custom-2);
}

/* ─── Hinweise / Icons ──────────────────────────────────── */
.rebus-icon {
    font-size: 1.1em;
    vertical-align: middle;
}

.rebus-hint-badge {
    display: inline-block;
    padding: 1px 6px;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: 500;
}

.rebus-note {
    display: inline-block;
    padding: 1px 4px;
    background: #e8f4fd;
    color: var(--color-custom-2);
    border-radius: 3px;
    font-size: 0.8em;
    cursor: help;
}

.rebus-on-demand td {
    background: #fff9e6;
}

/* ─── Überschriften ─────────────────────────────────────── */
.rebus-section-title {
    color: var(--color-custom-2);
    font-size: 1.2em;
    margin: 1em 0 0.5em;
    padding-bottom: 0.3em;
    border-bottom: 2px solid var(--color-custom-2);
}

.rebus-stop-title {
    /* Theme-Typo greift voll: keine eigene Farbe/Schriftgröße */
}

.rebus-line-title {
    display: flex;
    align-items: center;
    gap: 12px;
    /* Theme-Typo: keine eigene Farbe/Schriftgröße */
    margin-bottom: 0.5em;
}

/* Linien-Badge im H1-Titel: Nummer kleiner skalieren, damit sie nicht
   über den farbigen Hintergrund hinausragt. Maße passen sich der
   Theme-H1-Höhe an. */
.rebus-line-title .rebus-line-badge-xl {
    font-size: 0.65em;
    line-height: 1;
    height: auto;
    min-width: 0;
    padding: 0.25em 0.55em;
    border-radius: 0.25em;
}

.rebus-departure-group {
    margin: 1.5em 0;
}

.rebus-departure-group h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
    font-size: 1.05em;
    margin: 0 0 0.5em;
}

.rebus-arrival-group {
    margin-top: 2em;
    padding-top: 1em;
    border-top: 2px dashed #ccc;
}

/* ─── Suche ─────────────────────────────────────────────── */
.rebus-search-form label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: 600;
    color: #333;
}

.rebus-search-row {
    display: flex;
    gap: 8px;
    max-width: 400px;
}

.rebus-search-row input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
}

.rebus-search-row input[type="text"]:focus {
    border-color: var(--color-custom-2);
    outline: none;
}

.rebus-search-results {
    list-style: none;
    padding: 0;
    margin: 1em 0;
}

.rebus-search-results li {
    padding: 0;
    margin: 0;
}

.rebus-search-results a {
    display: block;
    padding: 8px 12px;
    color: var(--color-custom-2);
    text-decoration: none;
    border-bottom: 1px solid #eee;
}

.rebus-search-results a:hover {
    background: var(--color-custom-5);
}

/* ─── Stop-Link ─────────────────────────────────────────── */
.rebus-stop-link {
    color: var(--color-custom-2);
    text-decoration: none;
}

.rebus-stop-link:hover {
    text-decoration: underline;
}

/* ─── Legende ───────────────────────────────────────────── */
.rebus-legend {
    margin: 1em 0;
    padding: 0.8em 1em;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.9em;
    color: #666;
}

/* ─── Fehlermeldungen ───────────────────────────────────── */
.rebus-error {
    color: #dc3545;
    padding: 1em;
    background: #fff5f5;
    border-left: 4px solid #dc3545;
    border-radius: 4px;
}

.rebus-no-results {
    color: #666;
    font-style: italic;
    padding: 1em;
}

.rebus-hint {
    color: #666;
    padding: 1em;
    background: #f8f9fa;
    border-radius: 4px;
}

/* ─── Autocomplete Dropdown ─────────────────────────────── */
.rebus-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: #fff;
    border: 2px solid var(--color-custom-2);
    border-top: none;
    border-radius: 0 0 4px 4px;
    list-style: none;
    padding: 0;
    margin: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.rebus-autocomplete-dropdown li {
    margin: 0;
    padding: 0;
}

.rebus-autocomplete-dropdown a {
    display: block;
    padding: 8px 12px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}

.rebus-autocomplete-dropdown a:hover {
    background: var(--color-custom-5);
    color: var(--color-custom-2);
}

/* ─── Umsteigehaltestellen ──────────────────────────────── */
.rebus-transfer-icon {
    display: inline-block;
    font-size: 1em;
    color: var(--color-custom-2);
    vertical-align: middle;
    margin-left: 4px;
    font-style: normal;
}

.rebus-transfer-row {
    background: var(--color-custom-5) !important;
}

.rebus-transfer-row .rebus-stop-col {
    background: var(--color-custom-5) !important;
    font-weight: 600;
}

/* ─── Schulbus ──────────────────────────────────────────── */
.rebus-schulbus {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #4caf50;
}

.rebus-schulbus-col {
    background: #e8f5e9 !important;
    border-bottom: 2px solid #4caf50;
}

/* ─── Kleinbus ─────────────────────────────────────────── */
.rebus-kleinbus {
    background: #fff3e0;
    color: #e65100;
    border-color: #ff9800;
}

.rebus-kleinbus-col {
    background: #fff3e0 !important;
    border-bottom: 2px solid #ff9800;
}

/* ─── Navigationslinks ─────────────────────────────────── */
.rebus-nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 1.5em 0 0.5em;
    padding-top: 1em;
    border-top: 1px solid #e0e0e0;
}

.rebus-btn-sm {
    padding: 6px 12px;
    font-size: 0.85em;
}

.rebus-btn-secondary {
    background: transparent;
    color: #666;
    border-color: #ccc;
}

.rebus-btn-secondary:hover {
    background: #f0f0f0;
    color: #333;
}

/* ─── Abfahrtsmonitor ──────────────────────────────────── */
.rebus-monitor {
    background: #1a1a2e;
    color: #e0e0e0;
    border-radius: 8px;
    padding: 1.5em;
    overflow: hidden;
}

.rebus-monitor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1em;
    padding-bottom: 0.8em;
    border-bottom: 2px solid var(--color-custom-2);
}

.rebus-monitor-title {
    color: #fff;
    font-size: 1.3em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rebus-monitor-icon {
    font-size: 1.3em;
}

.rebus-monitor-icon-sm {
    font-size: 1em;
}

.rebus-monitor-clock {
    font-size: 1.5em;
    font-weight: 700;
    color: #ffcc00;
    font-variant-numeric: tabular-nums;
}

.rebus-monitor-time {
    text-align: right;
}

.rebus-monitor-search-inline {
    margin-bottom: 1em;
}

.rebus-monitor-search-inline .rebus-search-row {
    max-width: 100%;
}

.rebus-monitor-search-inline input[type="text"] {
    background: #16213e;
    color: #e0e0e0;
    border-color: var(--color-custom-2);
}

.rebus-monitor-search-inline input[type="text"]::placeholder {
    color: #888;
}

.rebus-monitor-search-inline .rebus-btn {
    background: var(--color-custom-2);
    color: #fff;
    border-color: var(--color-custom-2);
}

/* Monitor-Tabelle */
.rebus-monitor-table {
    margin: 0;
    border: none;
}

.rebus-monitor-table th {
    background: #16213e;
    color: #aaa;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px;
    border-bottom: 1px solid #333;
}

.rebus-monitor-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #2a2a4a;
    color: #e0e0e0;
}

.rebus-monitor-table tbody tr:hover {
    background: #16213e;
}

.rebus-monitor-next {
    background: #0a3d6b !important;
}

.rebus-monitor-next td {
    color: #fff;
    font-weight: 600;
    border-bottom-color: var(--color-custom-2);
}

.rebus-monitor-next .rebus-time {
    color: #ffcc00;
    font-size: 1.1em;
}

.rebus-monitor-tomorrow td {
    opacity: 0.5;
}

.rebus-tomorrow-badge {
    display: inline-block;
    padding: 0 4px;
    background: #555;
    color: #ccc;
    border-radius: 3px;
    font-size: 0.7em;
    font-weight: 600;
    vertical-align: middle;
    margin-left: 4px;
}

.rebus-monitor-table .rebus-line-badge {
    background: var(--color-custom-2);
}

.rebus-monitor-col-line { width: 70px; }
.rebus-monitor-col-time { width: 80px; white-space: nowrap; }
.rebus-monitor-col-platform { width: 60px; }

.rebus-monitor-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 1em;
    padding-top: 0.8em;
    border-top: 1px solid #333;
}

.rebus-monitor-footer .rebus-btn {
    background: transparent;
    color: #fff;
    border-color: #fff;
}

.rebus-monitor-footer .rebus-btn:hover {
    background: #fff;
    color: var(--color-custom-2);
    border-color: #fff;
}

/* ─── Meldungs-Akkordeon (Abfahrtsmonitor) ─── */
.rebus-meldung-card-collapsible {
    background: #fff;
    border-radius: 4px;
    color: #333;
    padding: 0;
}

.rebus-meldung-card-collapsible > .rebus-meldung-summary {
    list-style: none;
    cursor: pointer;
    padding: 10px 14px;
    display: block;
    position: relative;
    padding-right: 36px;
}

/* Standard-Pfeil ausblenden, eigenen einsetzen */
.rebus-meldung-card-collapsible > .rebus-meldung-summary::-webkit-details-marker { display: none; }
.rebus-meldung-card-collapsible > .rebus-meldung-summary::marker { content: ''; }

.rebus-meldung-card-collapsible > .rebus-meldung-summary::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid #6b7280;
    border-bottom: 2px solid #6b7280;
    transform: translateY(-70%) rotate(45deg);
    transition: transform 0.15s ease;
}

.rebus-meldung-card-collapsible[open] > .rebus-meldung-summary::after {
    transform: translateY(-30%) rotate(-135deg);
}

.rebus-meldung-card-collapsible > .rebus-meldung-summary .rebus-meldung-title {
    margin: 4px 0 0;
}

.rebus-meldung-card-collapsible > .rebus-meldung-body {
    padding: 0 14px 12px;
    border-top: 1px solid #e5e7eb;
    padding-top: 10px;
}

.rebus-meldung-card-collapsible > .rebus-meldung-summary:hover {
    background: #f9fafb;
}

/* Monitor-Sucheseite */
.rebus-monitor-search-page .rebus-search-form label {
    color: #e0e0e0;
}

.rebus-monitor-search-page .rebus-search-row input[type="text"] {
    background: #16213e;
    color: #e0e0e0;
    border-color: var(--color-custom-2);
}

.rebus-monitor-search-page .rebus-search-row input[type="text"]::placeholder {
    color: #888;
}

.rebus-monitor-search-page .rebus-btn {
    background: var(--color-custom-2);
    color: #fff;
    border-color: var(--color-custom-2);
}

.rebus-monitor-search-page .rebus-search-results a {
    color: #e0e0e0;
    border-bottom-color: #2a2a4a;
}

.rebus-monitor-search-page .rebus-search-results a:hover {
    background: #16213e;
    color: #ffcc00;
}

.rebus-monitor-search-page .rebus-no-results {
    color: #888;
}

/* Monitor Bedarfshalt */
.rebus-monitor .rebus-on-demand td {
    background: rgba(255, 243, 205, 0.1);
}

.rebus-monitor .rebus-hint-badge {
    background: rgba(255, 193, 7, 0.2);
    color: #ffcc00;
    border-color: rgba(255, 193, 7, 0.4);
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
    .rebus-letter-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8em;
    }

    .rebus-table {
        font-size: 0.85em;
    }

    .rebus-table th,
    .rebus-table td {
        padding: 6px 8px;
    }

    .rebus-timetable .rebus-stop-col {
        min-width: 140px;
        max-width: 160px;
        font-size: 0.85em;
    }

    .rebus-direction-nav {
        flex-direction: column;
    }

    .rebus-departure-group h4 {
        flex-wrap: wrap;
    }

    .rebus-search-row {
        max-width: 100%;
    }

    .rebus-monitor {
        padding: 1em;
    }

    .rebus-monitor-header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .rebus-monitor-time {
        text-align: center;
    }

    .rebus-monitor-col-platform,
    .rebus-monitor-col-hints {
        display: none;
    }
}

@media (max-width: 480px) {
    .rebus-letter-btn {
        width: 28px;
        height: 28px;
        font-size: 0.75em;
    }

    .rebus-timetable .rebus-stop-col {
        min-width: 110px;
        max-width: 130px;
    }
}

/* ==========================================================================
   Verkehrsmeldungen — Bar-Widget + Inline-Karten
   ========================================================================== */

/* ─── Schmale Leiste über der Seite ─── */
.rebus-meldungen-bar {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    background: transparent;
    color: inherit;
    line-height: 1;
}

.rebus-meldungen-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    /* CSS Grid mit 3 Spalten: Label | scrollbare Linien | Alle-Button
       minmax(0, 1fr) auf der mittleren Spalte ist der Schlüssel —
       erlaubt der Spalte unter ihren min-content zu schrumpfen,
       sodass overflow-x auf der UL wirklich scrollen kann. */
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px 12px;
    min-height: 100%;
    box-sizing: border-box;
}

.rebus-meldungen-label {
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
    flex-shrink: 0;          /* Label nicht schrumpfen */
    white-space: nowrap;
}

.rebus-meldungen-icon {
    font-size: 16px;
    color: #c87800;
    line-height: 1;
}

.rebus-meldungen-lines {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: nowrap;       /* alle Buttons in einer Zeile */
    align-items: center;
    gap: 4px;
    overflow-x: auto;        /* scrollbar wenn nicht genug Platz */
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    touch-action: pan-x;     /* iOS/Android: horizontale Swipes nutzen */
}
.rebus-meldungen-lines::-webkit-scrollbar { display: none; }

.rebus-meldungen-lines li {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    flex-shrink: 0;          /* einzelne Linien-Buttons nicht schrumpfen */
}

.rebus-meldung-line-btn {
    appearance: none;
    background: #ffffff;             /* überschrieben per inline style mit Linienfarbe */
    border: 1px solid #d1d5db;
    color: #1f2937;
    font: inherit;
    font-weight: 600;
    font-size: 13px;
    line-height: 1;
    padding: 3px 8px;
    border-radius: 3px;
    cursor: pointer;
    transition: opacity .15s, box-shadow .15s;
    display: inline-flex;
    align-items: center;
}

.rebus-meldung-line-btn:hover,
.rebus-meldung-line-btn:focus {
    opacity: 0.85;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.15);
}

/* Aktiv (Panel offen für diese Linie) — Linienfarbe bleibt erhalten,
   nur ein dezenter Ring zeigt den aktiven Zustand an. */
.rebus-meldung-line-btn.is-active {
    box-shadow: 0 0 0 2px rgba(33, 41, 114, 0.6);
}

.rebus-meldung-all-btn {
    /* keine Linienfarbe; neutraler Look */
    background: transparent !important;
    color: inherit !important;
    border: 1px solid currentColor !important;
    font-style: italic;
    font-weight: 500;
    flex-shrink: 0;          /* "Alle" bleibt immer voll sichtbar (nicht im Scroll-Bereich) */
    white-space: nowrap;
    margin-left: 4px;
}

/* ─── Aufklapp-Panel mit Karten ─── */
.rebus-meldungen-panel {
    position: relative;
    border-top: 0;
    background: #212972;
    padding: 18px 16px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Portal-Variante: per JS in <body> umgehängt, fixed unter der Leiste.
   Verhindert Clipping durch Header-Container mit overflow:hidden. */
.rebus-meldungen-panel--portal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    max-width: none;
    margin: 0;
    z-index: 999999;
    max-height: 80vh;
    overflow-y: auto;
    background: #212972;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.30);
}

/* Schließen-X im Panel (oben rechts) */
.rebus-meldungen-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: transparent;
    border: 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 3px;
    z-index: 2;
    transition: background .15s, color .15s;
}

.rebus-meldungen-close:hover,
.rebus-meldungen-close:focus {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    outline: none;
}

.rebus-meldungen-panel--portal .rebus-meldungen-cards {
    max-width: 1200px;
    margin: 0 auto;
}

/* Leer-Zustand: kein Hintergrund, dezent */
.rebus-meldungen-empty {
    background: transparent;
    color: rgb(192, 204, 236);
    font-size: 0.6rem;
    padding: 4px 16px;
    line-height: 1.2;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

.rebus-meldungen-cards {
    display: grid;
    gap: 14px;
}

/* ─── Inline-Variante (innerhalb Linienfahrplan / Haltestelle) ─── */
.rebus-meldungen-inline {
    margin: 0 0 1.5em;
    padding: 12px 14px;
    background: #fff8e1;
    border-radius: 3px;
}

.rebus-meldungen-inline-title {
    margin: 0 0 10px;
    font-size: 15px;
    color: #5a4500;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ─── Karte einer einzelnen Meldung ─── */
.rebus-meldung-card {
    background: #fff;
    border: 0;
    border-radius: 4px;
    padding: 12px 14px;
    color: #333;
}

.rebus-meldung-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 12px;
}

/* Kategorie-Tag bewusst neutral (keine Farbe), damit es nicht mit den
   farbigen Linien-Tags verwechselt wird. */
.rebus-meldung-badge {
    display: inline-block;
    background: transparent;
    color: #4b5563;
    border: 1px solid #d1d5db;
    padding: 1px 7px;
    border-radius: 2px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.rebus-meldung-line-tag {
    display: inline-block;
    background: #f3f4f6;
    color: #1f2937;
    padding: 2px 7px;
    border-radius: 2px;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
}

.rebus-meldung-line-tag:hover {
    opacity: 0.85;
    text-decoration: none;
}

.rebus-meldung-published {
    color: #6b7280;
    margin-left: auto;
}

.rebus-meldung-title {
    margin: 4px 0 6px;
    font-size: 17px;
    line-height: 1.3;
    color: #111;
}

.rebus-meldung-zeitraum {
    margin: 0 0 8px;
    font-size: 13px;
    color: #4b5563;
}

.rebus-meldung-text {
    font-size: 14px;
    line-height: 1.5;
}

.rebus-meldung-text p:first-child { margin-top: 0; }
.rebus-meldung-text p:last-child  { margin-bottom: 0; }

.rebus-meldung-docs {
    list-style: none;
    margin: 10px 0 0;
    padding: 10px 0 0;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rebus-meldung-doc {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rebus-meldung-doc-title {
    font-weight: 600;
    font-size: 13px;
    color: #111827;
}

.rebus-meldung-doc-link {
    text-decoration: none;
    font-size: 13px;
    /* color bewusst nicht gesetzt — Theme-Linkfarbe (Impreza/WP Bakery) greift */
}

.rebus-meldung-doc-link:hover {
    text-decoration: underline;
}

/* ─── Mobile: kleinere Anpassungen für Touch ─── */
@media (max-width: 640px) {
    .rebus-meldungen-bar-inner {
        padding: 6px 8px;
        gap: 6px;
    }
    .rebus-meldungen-label {
        font-size: 12px;
    }
    .rebus-meldung-published {
        margin-left: 0;
        width: 100%;
    }
}

/* ─── Listenansicht [rebus_meldungen_liste] ───────────────
   Bewusst minimal: Typografie, Farben, Spacing kommen vom Theme.
   Nur funktionale Elemente (Linien-Tags, Kategorie-Badge, Dokument-Liste)
   behalten ihre plugin-spezifische Optik. */
.rebus-meldungen-liste {
    /* keine eigene font-family / color — Theme entscheidet */
}

.rebus-meldungen-liste .rebus-meldung-list-item {
    /* kein Hintergrund, kein Border-Radius, kein Padding — Theme entscheidet */
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0 0 2.5em;
}

.rebus-meldungen-liste .rebus-meldung-list-item + .rebus-meldung-list-item {
    border-top: 1px solid #e5e7eb;
    padding-top: 1.5em;
}

.rebus-meldungen-liste .rebus-meldung-title {
    /* h2 erbt vollständig vom Theme — wir überschreiben unsere Card-Defaults */
    margin: 0 0 0.4em;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

.rebus-meldungen-liste .rebus-meldung-head {
    margin: 0 0 0.6em;
}

.rebus-meldungen-liste .rebus-meldung-zeitraum {
    margin: 0 0 0.8em;
    font-size: inherit;
    color: inherit;
}

.rebus-meldungen-liste .rebus-meldung-text {
    font-size: inherit;
    line-height: inherit;
}

/* Dokumente in der Listenansicht: gesammelte Box in Theme-Optik.
   var(--site-border-radius) + var(--color-custom-5) kommen aus dem Theme.
   Schrift/Linkfarbe erben vom Theme. */
.rebus-meldungen-liste .rebus-meldung-docs {
    background: var(--color-custom-5);
    border-radius: var(--site-border-radius);
    border-top: 0;
    margin: 1em 0 0;
    padding: 1em 1.25em;
    gap: 0.6em;
}

.rebus-meldungen-liste .rebus-meldung-doc-title {
    font-size: inherit;
    color: inherit;
    /* font-weight bleibt 600 (Hierarchie zum Link) */
}

.rebus-meldungen-liste .rebus-meldung-doc-link {
    font-size: inherit;
    /* color bleibt ungesetzt → Theme-Link */
}

.rebus-meldungen-liste-empty {
    padding: 1em 0;
    color: inherit;
    font-style: italic;
    opacity: 0.7;
}

/* ==========================================================================
   Vorschau-Banner (kommender Fahrplan)
   ========================================================================== */
.rebus-preview-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    padding: 10px 16px;
    margin: 0 0 1.2em;
    border-radius: var(--site-border-radius, 4px);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14px;
}

.rebus-preview-banner.is-preview-offer {
    background: #fff8e1;
    color: #5a4500;
    border: 1px solid #f0d97a;
}

.rebus-preview-banner.is-preview-active {
    background: #212972;
    color: #ffffff;
    border: 1px solid #212972;
}

.rebus-preview-toggle {
    background: rgba(0, 0, 0, 0.15);
    color: inherit;
    padding: 4px 12px;
    border-radius: 3px;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}

.rebus-preview-banner.is-preview-active .rebus-preview-toggle {
    background: rgba(255, 255, 255, 0.2);
}

.rebus-preview-toggle:hover {
    background: rgba(0, 0, 0, 0.25);
    text-decoration: none;
}

.rebus-preview-banner.is-preview-active .rebus-preview-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Notice wenn kein Fahrplan aktiv */
.rebus-no-schedule {
    padding: 1.5em;
    text-align: center;
    color: #6b7280;
    font-style: italic;
}

/* Schultag-Badge im Linienfahrplan */
.rebus-school-badge {
    display: inline-block;
    background: var(--color-custom-2);
    color: #fff;
    padding: 1px 6px;
    border-radius: 2px;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
    margin-left: 2px;
}

/* ALF (Anruf-Linien-Fahrzeug) Badge */
.rebus-alf-badge {
    display: inline-block;
    background: #d97706;
    color: #fff;
    padding: 1px 6px;
    border-radius: 2px;
    font-size: 0.7em;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
    margin-left: 2px;
    letter-spacing: 0.03em;
}

/* Wochentag-Label im Linienfahrplan-Spaltenheader */
.rebus-weekday-label {
    display: block;
    font-size: 0.7em;
    font-weight: 600;
    opacity: 0.85;
    margin-bottom: 2px;
    letter-spacing: 0.02em;
}

/* Wochentag-Umschalter unter dem Richtungswähler */
.rebus-weekday-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0.5em 0 1em;
}
.rebus-weekday-nav .rebus-btn {
    padding: 4px 12px;
    font-size: 0.85em;
}
