/* FeG-Frohnhausen-App – mobile-first, Markenfarben der FeG Frohnhausen */

:root {
    --brand-primary: #0093A1;
    --brand-primary-dark: #006D78;
    --brand-primary-light: #1CB0BE;
    --brand-accent: #00B8A9;
    --brand-text-dark: #1F3D42;
    --brand-text-muted: #5a7378;
    --brand-surface: #f4f9fa;
    --brand-border: #d6e7e9;
    --card-bg: #ffffff;
    --now-bg: #e3f6f4;
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(160deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--brand-text-dark);
    padding: 16px 12px calc(32px + env(safe-area-inset-bottom));
}

.app {
    max-width: 640px;
    margin: 0 auto;
}

/* ===== Kopfbereich ===== */
.app-header {
    position: relative;
    text-align: center;
    color: white;
    padding: 12px 0 20px;
}

/* Oben rechts: Aktualisieren-Button + Zahnrad mit Einstellungs-Menü */
.settings-wrap {
    position: absolute;
    top: 4px;
    right: 0;
    z-index: 20;
    display: flex;
    gap: 8px;
}

.settings-button {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    font-size: 1.25em;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.settings-button:active {
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(30deg);
}

.settings-button--refresh {
    color: white;
    font-weight: 700;
    font-size: 1.45em;
}

.settings-button--spinning {
    animation: refresh-spin 0.8s linear infinite;
}

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

.settings-menu {
    position: absolute;
    top: 48px;
    right: 0;
    min-width: 220px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 40, 45, 0.3);
    padding: 6px;
}

.settings-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 0.95em;
    font-weight: 600;
    color: var(--brand-text-dark);
    cursor: pointer;
}

.settings-menu-item:active {
    background: var(--brand-surface);
}

a.settings-menu-item {
    text-decoration: none;
    color: var(--brand-text-dark);
}

.app-header .brand-logo {
    display: block;
    width: 120px;
    margin: 0 auto 12px;
    background: white;
    border-radius: 16px;
    padding: 8px;
}

.app-header h1 {
    font-size: 1.5em;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.app-header p {
    opacity: 0.9;
    margin-top: 4px;
    font-size: 1em;
}

/* ===== Karten ===== */
.card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 40, 45, 0.18);
    padding: 18px 16px;
    margin-bottom: 16px;
}

.card h2 {
    font-size: 1.05em;
    margin-bottom: 8px;
}

.card p {
    font-size: 0.95em;
    line-height: 1.45;
    color: var(--brand-text-muted);
}

.card ol {
    margin: 8px 0 0 20px;
    font-size: 0.95em;
    line-height: 1.6;
    color: var(--brand-text-muted);
}

/* ===== "Jetzt läuft"-Karte ===== */
.now-card {
    background: linear-gradient(135deg, #ffffff 0%, var(--now-bg) 100%);
    border-left: 5px solid var(--brand-accent);
}

.now-card-label {
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--brand-primary-dark);
    margin-bottom: 5px;
}

.now-card-title {
    font-size: 1.2em;
    font-weight: 700;
    line-height: 1.3;
}

.now-card-meta {
    font-size: 0.9em;
    color: var(--brand-text-muted);
    margin-top: 4px;
}

.now-card-next {
    font-size: 0.9em;
    color: var(--brand-text-muted);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--brand-border);
}

/* ===== Push-Bereich ===== */
.push-status {
    font-size: 0.95em;
    line-height: 1.45;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 12px;
}

.push-status--neutral { background: var(--brand-surface); color: var(--brand-text-dark); }
.push-status--ok { background: #e5f7ee; color: #14663d; }
.push-status--warn { background: #fdf0e7; color: #9a4b12; }

.button {
    display: inline-block;
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 8px;
    transition: filter 0.15s ease, transform 0.05s ease;
}

.button:active { transform: scale(0.985); }

.button--primary {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    color: white;
}

.button--secondary {
    background: var(--brand-surface);
    color: var(--brand-primary-dark);
    border: 1px solid var(--brand-border);
}

.button--ghost {
    background: none;
    color: var(--brand-text-muted);
    font-weight: 500;
    padding: 10px;
    margin-bottom: 0;
}

/* ===== Tag-Tabs ===== */
.day-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.day-tab {
    flex: 1;
    border: none;
    border-radius: 12px;
    padding: 12px 4px;
    font-size: 0.95em;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.22);
    color: white;
    cursor: pointer;
}

.day-tab--active {
    background: white;
    color: var(--brand-primary-dark);
}

/* ===== Tagesübersicht (ab 3 Tagen) ===== */
.day-heading {
    font-size: 1.05em;
    font-weight: 700;
    color: var(--brand-primary-dark);
    padding-bottom: 10px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--brand-border);
}

/* ===== Programmliste ===== */
.program-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--brand-border);
}

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

.program-time {
    flex: 0 0 92px;
    font-size: 0.88em;
    font-weight: 600;
    color: var(--brand-primary-dark);
    padding-top: 2px;
}

.program-title {
    font-size: 0.98em;
    font-weight: 600;
    line-height: 1.35;
}

.program-who {
    font-size: 0.85em;
    color: var(--brand-text-muted);
    margin-top: 3px;
}

.program-room {
    font-size: 0.85em;
    color: var(--brand-text-muted);
    margin-top: 3px;
}

.program-audience {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--brand-primary-dark);
    margin-top: 3px;
}

.mine-badge {
    display: inline-block;
    font-size: 0.78em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 999px;
    padding: 1px 7px;
    margin-left: 3px;
    background: var(--brand-accent);
    color: white;
}

/* "Dein nächster Einsatz" – anklickbar, führt zum Termin */
.my-next-card {
    border-left-color: var(--brand-primary);
    cursor: pointer;
}

.program-andacht {
    font-size: 0.88em;
    line-height: 1.4;
    color: var(--brand-primary-dark);
    background: var(--now-bg);
    border-radius: 8px;
    padding: 6px 9px;
    margin-top: 6px;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.program-notes {
    font-size: 0.85em;
    line-height: 1.4;
    color: var(--brand-text-muted);
    margin-top: 4px;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.program-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.program-attachment {
    display: inline-block;
    font-size: 0.82em;
    font-weight: 600;
    color: var(--brand-primary-dark);
    background: var(--brand-surface);
    border: 1px solid var(--brand-border);
    border-radius: 999px;
    padding: 4px 10px;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.program-attachment:active { background: var(--now-bg); }

.program-item--past { opacity: 0.55; }

.program-item--now {
    background: var(--now-bg);
    border-radius: 12px;
    padding: 12px 10px;
    margin: 0 -10px;
    border-bottom: none;
    opacity: 1;
}

.live-badge,
.next-badge {
    display: inline-block;
    font-size: 0.72em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 999px;
    padding: 2px 8px;
    vertical-align: 2px;
    margin-left: 4px;
}

.live-badge { background: var(--brand-accent); color: white; }
.next-badge { background: var(--brand-surface); color: var(--brand-primary-dark); border: 1px solid var(--brand-border); }

.load-error {
    color: var(--brand-text-muted);
    text-align: center;
    padding: 20px 0;
}

/* ===== Begleitmaterial-Viewer ===== */
.viewer {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: #f2f4f5;
    display: flex;
    flex-direction: column;
}

.viewer-bar {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
    flex: 0 0 auto;
}

.viewer-back {
    display: block;
    width: 100%;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--brand-primary-dark);
    font: inherit;
    font-size: 1.05em;
    font-weight: 700;
    padding: 14px 16px;
    cursor: pointer;
}

.viewer-back:active { background: white; transform: scale(0.985); }

.viewer-title-row {
    flex: 0 0 auto;
    background: white;
    border-bottom: 1px solid var(--brand-border);
    padding: 8px 14px;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--brand-text-dark);
    overflow-wrap: anywhere;
}

.viewer-content {
    flex: 1 1 auto;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px;
}

.viewer-content canvas,
.viewer-content img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto 10px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 40, 45, 0.15);
}

.viewer-content audio,
.viewer-content video {
    display: block;
    width: 100%;
    margin-top: 12px;
}

.viewer-content pre {
    background: white;
    border-radius: 10px;
    padding: 14px;
    font-size: 0.95em;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-family: inherit;
}

.viewer-status {
    text-align: center;
    color: var(--brand-text-muted);
    padding: 32px 16px;
    font-size: 0.95em;
}

/* ===== Fußzeile ===== */
.app-footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85em;
    padding: 8px 0 4px;
}

[hidden] { display: none !important; }

/* ===== Startseite: Projektliste ===== */
.project-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    border: none;
    background: none;
    font: inherit;
    color: var(--brand-text-dark);
    cursor: pointer;
    padding: 14px 2px;
    border-bottom: 1px solid var(--brand-border);
}

.project-link:last-child { border-bottom: none; }

.project-link:active { background: var(--brand-surface); }

.project-link-body {
    flex: 1 1 auto;
    display: block;
    min-width: 0;
}

.project-link-title {
    display: block;
    font-size: 1.02em;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.project-link-subtitle {
    display: block;
    font-size: 0.88em;
    color: var(--brand-text-muted);
    margin-top: 2px;
}

.project-link-dates {
    display: block;
    font-size: 0.82em;
    font-weight: 600;
    color: var(--brand-primary-dark);
    margin-top: 4px;
}

.project-link-chevron {
    flex: 0 0 auto;
    font-size: 1.5em;
    color: var(--brand-primary);
}

/* ===== Projektansicht: Zurück zur Übersicht ===== */
.back-home {
    display: inline-block;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    color: white;
    font: inherit;
    font-size: 0.92em;
    font-weight: 600;
    padding: 8px 16px;
    margin-bottom: 14px;
    cursor: pointer;
}

.back-home:active { background: rgba(255, 255, 255, 0.4); }

/* ===== Formulare (Login, Konto, Buchung) ===== */
.admin-input,
.admin-textarea {
    display: block;
    width: 100%;
    border: 1px solid var(--brand-border);
    border-radius: 10px;
    background: var(--brand-surface);
    color: var(--brand-text-dark);
    font: inherit;
    font-size: 1em;
    padding: 10px 12px;
    margin-bottom: 8px;
}

.admin-input:focus,
.admin-textarea:focus {
    outline: 2px solid var(--brand-primary);
    outline-offset: -1px;
    background: white;
}

.admin-label {
    display: block;
    font-size: 0.78em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--brand-text-muted);
    margin: 10px 0 4px;
}

.icon-button {
    border: 1px solid var(--brand-border);
    background: var(--brand-surface);
    color: var(--brand-text-dark);
    border-radius: 8px;
    min-width: 38px;
    height: 34px;
    padding: 0 8px;
    font: inherit;
    font-size: 0.9em;
    cursor: pointer;
}

.icon-button--danger { color: #a33; }

/* ===== Raumbuchung ===== */
.room-description {
    color: var(--brand-text-muted);
    font-size: 0.92em;
    margin-bottom: 10px;
}

.booking-list { margin-bottom: 10px; }

.booking-empty {
    color: var(--brand-text-muted);
    font-size: 0.9em;
    padding: 4px 0 8px;
}

.booking-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border: 1px solid var(--brand-border);
    border-radius: 10px;
    background: var(--brand-surface);
    margin-bottom: 6px;
}

.booking-row--own {
    background: var(--now-bg);
    border-color: var(--brand-accent);
}

/* Archiv: vergangene Buchungen gedämpft darstellen. */
.booking-row--past {
    opacity: 0.7;
}

.booking-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.booking-time {
    font-size: 0.9em;
    font-weight: 700;
    color: var(--brand-primary-dark);
}

.booking-title {
    font-size: 0.92em;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.booking-user {
    font-size: 0.83em;
    color: var(--brand-text-muted);
}

.booking-cancel { flex: 0 0 auto; }

.booking-form {
    border-top: 1px solid var(--brand-border);
    padding-top: 10px;
    margin-top: 4px;
}

/* ===== MFA-Einrichtung ===== */
.mfa-qr {
    display: flex;
    justify-content: center;
    padding: 14px;
    background: white;
    border: 1px solid var(--brand-border);
    border-radius: 12px;
    margin: 10px 0;
}

.mfa-qr img, .mfa-qr canvas { display: block; }

.mfa-secret {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.85em;
    text-align: center;
    letter-spacing: 0.06em;
    overflow-wrap: anywhere;
    background: var(--brand-surface);
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 10px;
}

/* Native Datums-/Zeitfelder (Buchungsformular) nie über den Rand laufen lassen –
   iOS Safari ignoriert min-width und lässt sie über den Kartenrand laufen,
   solange das Standard-Aussehen aktiv ist. */
input[type="date"].admin-input,
input[type="time"].admin-input,
input[type="datetime-local"].admin-input {
    -webkit-appearance: none;
    appearance: none;
    -webkit-min-logical-width: 0;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    min-height: 44px;
}
/* Ohne Standard-Aussehen fällt der Wert auf iOS sonst in sich zusammen */
input[type="date"].admin-input::-webkit-date-and-time-value,
input[type="time"].admin-input::-webkit-date-and-time-value,
input[type="datetime-local"].admin-input::-webkit-date-and-time-value {
    text-align: left;
    min-height: 1.3em;
}

.icon-button { white-space: nowrap; }

/* ===== „Farbe bekennen“: Textabschnitte im Programm + Karten-Overlay ===== */
.program-sections {
    margin-top: 8px;
    font-size: 0.88em;
}

.program-sections-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 10px;
    color: var(--brand-primary-dark);
    margin-bottom: 2px;
}

/* Einstieg in die Auswertung (nur Projekt-Admins) */
.program-section-eval {
    font: inherit;
    font-size: 0.85em;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    border: none;
    border-radius: 999px;
    padding: 5px 12px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.program-section-eval:active { filter: brightness(0.92); }

/* Overlay-Inhalt in App-Breite (wie .app), zentriert */
.reaction-inner {
    max-width: 640px;
    margin: 0 auto;
}

.program-section {
    display: block;
    width: 100%;
    text-align: left;
    font: inherit;
    color: var(--brand-text-dark);
    background: var(--brand-surface);
    border: 1px solid var(--brand-border);
    border-radius: 10px;
    padding: 8px 10px;
    margin-top: 6px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.program-section:active { background: var(--now-bg); }

.program-section-num {
    font-size: 0.8em;
    font-weight: 700;
    color: var(--brand-primary-dark);
}

.program-section-text {
    display: block;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.45;
    margin: 2px 0 6px;
}

.program-section-badge {
    display: inline-block;
    font-size: 0.82em;
    font-weight: 600;
    color: var(--brand-primary-dark);
    background: white;
    border: 1px solid var(--brand-border);
    border-radius: 999px;
    padding: 3px 10px;
}

.program-section-badge--mine {
    background: var(--brand-accent);
    border-color: var(--brand-accent);
    color: white;
}

.reaction-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.reaction-nav .button {
    width: auto;
    flex: 0 0 auto;
    margin: 0;
    padding: 10px 12px;
    font-size: 0.9em;
}

.reaction-nav .button:disabled { opacity: 0.4; cursor: default; }

.reaction-pos {
    flex: 1;
    text-align: center;
    font-size: 0.9em;
    color: var(--brand-text-muted);
}

.reaction-text {
    background: white;
    border-radius: 12px;
    padding: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    box-shadow: 0 4px 14px rgba(0, 40, 45, 0.08);
    margin-bottom: 12px;
}

.reaction-modes {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.reaction-modes .button { margin: 0; }

.reaction-counter {
    font-size: 0.9em;
    color: var(--brand-text-muted);
    text-align: center;
    margin-bottom: 10px;
}

.react-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding-bottom: 24px;
}

.react-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2px;
    font: inherit;
    color: var(--brand-text-dark);
    background: white;
    border: 2px solid var(--brand-border);
    border-radius: 14px;
    padding: 12px 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 40, 45, 0.08);
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.05s ease;
}

.react-card:active { transform: scale(0.97); }

.react-card--selected {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    border-color: var(--brand-primary-dark);
    color: white;
}

.react-card-emoji { font-size: 1.6em; line-height: 1.2; }
.react-card-label { font-weight: 700; }

.react-card-hint {
    font-size: 0.78em;
    line-height: 1.3;
    color: var(--brand-text-muted);
}

.react-card--selected .react-card-hint { color: rgba(255, 255, 255, 0.85); }

.reaction-group {
    background: white;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0, 40, 45, 0.06);
}

.reaction-group-head { font-weight: 700; margin-bottom: 4px; }

.reaction-names {
    font-size: 0.92em;
    line-height: 1.4;
    color: var(--brand-text-muted);
}

@media (min-width: 600px) {
    .react-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Auswertung nach Personen + Admin-Notiz */
.program-section-badge--note { margin-left: 4px; }

.reaction-totals {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 10px;
}

.reaction-total {
    font-size: 0.82em;
    font-weight: 600;
    color: var(--brand-primary-dark);
    background: white;
    border: 1px solid var(--brand-border);
    border-radius: 999px;
    padding: 3px 9px;
}

.reaction-user {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    background: white;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0, 40, 45, 0.06);
}

.reaction-user-name {
    flex: 1 1 150px;
    font-weight: 700;
}

.reaction-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.reaction-chip {
    font-size: 0.85em;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    border-radius: 999px;
    padding: 4px 10px;
}

.reaction-note {
    background: white;
    border-radius: 12px;
    padding: 12px;
    margin: 2px 0 12px;
    box-shadow: 0 4px 12px rgba(0, 40, 45, 0.06);
}

.reaction-note-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.78em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--brand-text-muted);
    margin-bottom: 6px;
}

.reaction-note .admin-textarea {
    min-height: 72px;
    resize: vertical;
    margin-bottom: 6px;
}

.reaction-note-meta {
    font-size: 0.82em;
    color: var(--brand-text-muted);
}

.reaction-note-meta--warn { color: #9a4b12; }

/* Entwurf, der nicht gespeichert werden konnte */
.reaction-note--failed .reaction-note-view {
    border-left: 3px solid #9a4b12;
    padding-left: 10px;
}

/* Notizkachel: formatierter Text (Markdown) statt Dauer-Editor */
.reaction-note-view {
    line-height: 1.5;
    color: var(--brand-text-dark);
    overflow-wrap: anywhere;
    margin-bottom: 10px;
}
.reaction-note-view--empty {
    color: var(--brand-text-muted);
    font-style: italic;
}
.reaction-note-view p,
.reaction-note-view ul,
.reaction-note-view ol,
.reaction-note-view blockquote { margin: 0 0 8px; }
.reaction-note-view > :last-child { margin-bottom: 0; }
.reaction-note-view .md-h {
    margin: 12px 0 4px;
    line-height: 1.3;
    font-weight: 700;
    color: var(--brand-primary-dark);
}
.reaction-note-view .md-h:first-child { margin-top: 0; }
.reaction-note-view .md-h1 { font-size: 1.2em; }
.reaction-note-view .md-h2 { font-size: 1.08em; }
.reaction-note-view .md-h3 { font-size: 1em; }
.reaction-note-view ul,
.reaction-note-view ol { padding-left: 1.4em; }
.reaction-note-view li { margin: 2px 0; }
.reaction-note-view blockquote {
    padding: 4px 10px;
    border-left: 3px solid var(--brand-primary);
    color: var(--brand-text-muted);
}
.reaction-note-view code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.92em;
    background: var(--brand-surface);
    border-radius: 4px;
    padding: 1px 4px;
}
.reaction-note-view hr {
    border: 0;
    border-top: 1px solid var(--brand-border);
    margin: 8px 0;
}
.reaction-note-view a { color: var(--brand-primary-dark); }

.reaction-note-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}
.reaction-note-actions .button {
    width: auto;
    padding: 8px 14px;
    font-size: 0.9em;
    margin-bottom: 0;
}
.reaction-note-hint {
    font-size: 0.78em;
    color: var(--brand-text-muted);
    margin: -2px 0 8px;
}

/* Overlays (Anhang-Viewer, Karten) in App-Breite: Kopfleiste, Titelzeile
   und Inhalt laufen in derselben 640-px-Spalte wie die App. */
.viewer .viewer-back {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.viewer .viewer-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-left: max(14px, calc((100% - 640px) / 2));
    padding-right: max(14px, calc((100% - 640px) / 2));
}

.viewer .viewer-content {
    padding-left: max(10px, calc((100% - 640px) / 2));
    padding-right: max(10px, calc((100% - 640px) / 2));
}

/* Kleiner Speichern-/Teilen-Knopf in der Titelzeile des Viewers */
.viewer .viewer-title-row > span {
    flex: 1 1 auto;
    min-width: 0;
}

.viewer-download {
    flex: 0 0 auto;
    font: inherit;
    font-size: 0.82em;
    font-weight: 700;
    color: var(--brand-primary-dark);
    background: var(--brand-surface);
    border: 1px solid var(--brand-border);
    border-radius: 999px;
    padding: 9px 14px;
    min-height: 40px;
    cursor: pointer;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.viewer-download:active { background: var(--now-bg); }

/* „Jetzt läuft“-Karte springt zum Termin */
.now-card { cursor: pointer; }
.now-card-next { cursor: pointer; }

@keyframes program-item-flash {
    0% { background: var(--brand-accent); }
    100% { background: transparent; }
}

.program-item--flash {
    animation: program-item-flash 1.6s ease-out;
    border-radius: 12px;
}

.program-item--now.program-item--flash {
    animation: none;
}

/* Admin-Notizen ausblenden (Beamer) */
.reaction-notes-toggle {
    font: inherit;
    font-size: 0.82em;
    font-weight: 600;
    color: var(--brand-text-muted);
    background: none;
    border: 1px solid var(--brand-border);
    border-radius: 999px;
    padding: 3px 10px;
    cursor: pointer;
    text-transform: none;
    letter-spacing: normal;
}

.reaction-inner > .reaction-notes-toggle {
    display: block;
    margin: 0 auto 10px;
}

/* Kalender-Export (.ics) */
.program-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.program-ics,
.duty-ics,
.duty-swap {
    font: inherit;
    font-size: 0.82em;
    font-weight: 600;
    color: var(--brand-primary-dark);
    background: var(--brand-surface);
    border: 1px solid var(--brand-border);
    border-radius: 999px;
    padding: 4px 10px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.program-ics:active,
.duty-ics:active,
.duty-swap:active { background: var(--now-bg); }

.ics-all { margin: 0 0 16px; }

/* Archiv: vergangene Tage/Projekte (nur Admins) */
.past-days-toggle {
    display: block;
    width: 100%;
    color: white;
    opacity: 0.85;
    margin-bottom: 10px;
}

#archiveList { margin-top: 10px; }

/* Geschützter Anhang (nur Projekt-Admins) */
.program-attachment--private {
    font: inherit;
    font-size: 0.82em;
    font-weight: 600;
    cursor: pointer;
    border-style: dashed;
}

/* Geburtstage der laufenden Woche auf der Startseite: Datum links,
   Name rechts; der heutige Tag wird hervorgehoben. */
.birthday-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--brand-border);
    border-radius: 10px;
    background: var(--brand-surface);
    margin-bottom: 6px;
}

.birthday-row:last-child {
    margin-bottom: 0;
}

.birthday-row--today {
    background: var(--now-bg);
    border-color: var(--brand-accent);
}

.birthday-date {
    flex: 0 0 auto;
    min-width: 72px;
    font-size: 0.85em;
    font-weight: 600;
    color: var(--brand-text-muted);
}

.birthday-row--today .birthday-date {
    color: var(--brand-primary-dark);
}

.birthday-name {
    font-size: 0.95em;
    color: var(--brand-text-dark);
    overflow-wrap: anywhere;
}

/* ===== ⛪ Gottesdienste & 🎵 Liederbuch ===== */
.home-links {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.home-links .button {
    width: auto;
    flex: 1 1 0;
    padding: 12px 8px;
    font-size: 0.95em;
}

.count-badge {
    font-size: 0.8em;
    font-weight: 500;
    color: var(--brand-text-muted);
}

.involved-badge {
    display: inline-block;
    font-size: 0.68em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--brand-accent);
    color: white;
    border-radius: 8px;
    padding: 2px 7px;
    margin-left: 6px;
    vertical-align: middle;
}

.project-link--past { opacity: 0.6; }

.service-date {
    font-weight: 600;
    color: var(--brand-primary-dark) !important;
}

.service-info { margin-top: 4px; }

/* Beteiligte: Rolle | Name */
.role-list {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 14px;
    font-size: 0.95em;
    color: var(--brand-text-dark);
}

.role-list span:nth-child(odd) {
    font-weight: 600;
    color: var(--brand-text-muted);
}

.role-name--open {
    font-style: italic;
    color: var(--brand-text-muted);
}

/* Ablauf */
.plan-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--brand-border);
}

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

.plan-time {
    flex: 0 0 60px;
    font-size: 0.9em;
    font-weight: 700;
    color: var(--brand-primary-dark);
    padding-top: 2px;
}

.plan-dur {
    display: block;
    font-size: 0.82em;
    font-weight: 500;
    color: var(--brand-text-muted);
}

.plan-body {
    flex: 1 1 auto;
    min-width: 0;
}

.plan-title { font-weight: 600; }

.plan-song {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: var(--brand-primary-dark);
    text-align: left;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}

.plan-meta {
    font-size: 0.88em;
    color: var(--brand-text-muted);
    margin-top: 2px;
    white-space: pre-wrap;
}

/* Lied */
.song-meta {
    font-size: 0.9em;
}

.transpose-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0 4px;
}

.transpose-bar .button {
    width: auto;
    padding: 8px 14px;
    margin: 0;
}

.transpose-key {
    flex: 1 1 auto;
    text-align: center;
    font-weight: 700;
    color: var(--brand-primary-dark);
}

.song-lyrics {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 0.92em;
    line-height: 1.4;
    overflow-x: auto;
    padding: 8px 0;
    color: var(--brand-text-dark);
}

.song-line { white-space: pre; }

.song-chords {
    color: var(--brand-primary-dark);
    font-weight: 700;
    white-space: pre;
}

.song-text { white-space: pre-wrap; }

.song-section {
    font-weight: 700;
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brand-text-muted);
    margin-top: 10px;
}

.song-gap { height: 12px; }

.song-attachments { margin-top: 10px; }

/* ===== Druckansicht (Ablaufplan mit Logo) ===== */
body.print-mode { background: white; }
.print-mode .app-header { display: none; }
.print-mode .app { max-width: 820px; }

.print-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 12px 0;
}

.print-toolbar .button {
    width: auto;
    margin: 0;
}

.print-toolbar .check-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 auto 0 0;
    font-weight: 600;
    font-size: 0.95em;
    color: var(--brand-text-dark);
}

.print-toolbar .check-row input { width: 20px; height: 20px; accent-color: var(--brand-primary); }

.print-page {
    background: white;
    color: #111;
    padding: 12px 8px 24px;
    font-size: 15px;
    line-height: 1.4;
}

.print-head {
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 3px solid var(--brand-primary);
    padding-bottom: 12px;
    margin-bottom: 14px;
}

.print-head img {
    width: 96px;
    flex: 0 0 auto;
}

.print-org {
    font-size: 0.8em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand-primary-dark);
}

.print-head h1 {
    font-size: 1.45em;
    margin: 2px 0 4px;
}

.print-meta { color: #444; }

.print-roles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 4px 18px;
    margin: 8px 0 14px;
}

.print-roles div {
    border-bottom: 1px dotted #bbb;
    padding: 3px 0;
}

.print-roles span { color: #666; }

.print-notes {
    background: #f4f9fa;
    border-left: 4px solid var(--brand-primary);
    padding: 8px 10px;
    margin-bottom: 14px;
    white-space: pre-wrap;
}

.print-table {
    width: 100%;
    border-collapse: collapse;
}

.print-table th {
    text-align: left;
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #555;
    border-bottom: 2px solid #333;
    padding: 6px;
}

.print-table td {
    border-bottom: 1px solid #ccc;
    padding: 7px 6px;
    vertical-align: top;
}

.print-table td.print-time { white-space: nowrap; font-weight: 700; }
.print-table td.print-dur { white-space: nowrap; color: #555; }
.print-table tr.print-song td.print-item { color: var(--brand-primary-dark); font-weight: 600; }

.print-table small {
    display: block;
    font-size: 0.85em;
    font-weight: 400;
    color: #555;
    white-space: pre-wrap;
}

.print-foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    font-size: 0.85em;
    color: #666;
}

.print-lyrics {
    break-before: page;
    page-break-before: always;
    margin-top: 24px;
}

.print-lyrics h2 { margin-bottom: 2px; }
.print-lyrics .song-lyrics { font-size: 13px; }

@media print {
    @page { margin: 14mm 12mm; }
    body { background: white !important; }
    .no-print, .app-header, .settings-wrap { display: none !important; }
    .app { max-width: none; }
    .print-page { padding: 0; font-size: 12pt; }
    #viewer, #reactions { display: none !important; }
}

/* ===== 🧹 Dienstpläne ===== */
.plan-item--mine {
    background: var(--now-bg);
    border-radius: 10px;
    padding: 10px 8px;
    margin: 0 -8px;
}

.print-duties { margin-top: -6px; }

.plan-time--icon { flex-basis: 34px; font-size: 1.1em; }

/* Dienste tauschen: Anfrage-Block (Startseite + Plan), Inline-Formular, Hinweis */
.swap-request {
    border: 1px solid var(--brand-accent);
    border-radius: 12px;
    padding: 10px 12px;
    margin: 0 0 10px;
    line-height: 1.4;
}

.swap-request p { margin: 0 0 6px; }
.swap-request .push-status { margin: 0 0 8px; }
.swap-message { color: var(--brand-text-muted); }

.swap-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 640px;
    margin-top: 8px;
    padding: 10px 12px;
    background: var(--card-bg);
    border: 1px solid var(--brand-border);
    border-radius: 12px;
}

.swap-form .admin-input,
.swap-form .push-status { margin: 0; }

.swap-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.swap-actions .button {
    width: auto;
    margin: 0;
    padding: 10px 14px;
}

.swap-actions .button:disabled { opacity: 0.5; cursor: default; }

.swap-note {
    display: block;
    font-size: 0.85em;
    color: var(--brand-text-muted);
    margin-top: 2px;
}

.program-actions .swap-note { align-self: center; margin: 0; }

/* Vergangen-Kennzeichen (Gottesdienst noch 3 Tage sichtbar) */
.past-badge {
    display: inline-block;
    font-size: 0.68em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--brand-border);
    color: var(--brand-text-muted);
    border-radius: 8px;
    padding: 2px 7px;
    margin-left: 6px;
    vertical-align: middle;
}

.home-links--wrap { flex-wrap: wrap; }
.home-links--wrap .button { flex: 1 1 45%; }

/* 💡 Vorschläge zum Gottesdienst (App und Verwaltung): Formular, Einträge */
.proposal-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 12px;
}

.proposal-form .admin-textarea,
.proposal-form .push-status { margin: 0; }

.proposal {
    border: 1px solid var(--brand-border);
    border-radius: 12px;
    padding: 10px 12px;
    margin: 0 0 10px;
    line-height: 1.4;
}

.proposal p { margin: 0 0 6px; }
.proposal .push-status { margin: 0 0 8px; }

.proposal-meta {
    font-size: 0.85em;
    color: var(--brand-text-muted);
}

.proposal-text { white-space: pre-wrap; overflow-wrap: anywhere; }

.proposal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.proposal-actions .button {
    width: auto;
    margin: 0;
    padding: 10px 14px;
}

.proposal-actions .button:disabled { opacity: 0.5; cursor: default; }

/* Status: offen = .mine-badge, erledigt/abgelehnt = .past-badge-Optik */
.proposal-badge--done { background: #e5f7ee; color: #14663d; }

/* Startseite „Aktuell“: Unterblöcke (Gottesdienste, Dienste) und laufender Punkt */
.home-block { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--brand-border); }
.home-subhead { font-size: 0.95em; margin: 0 0 4px; color: var(--brand-text-muted); }
/* Ein einzelnes Programm als Kachel, damit die Karte nicht leer wirkt */
.project-link--single {
    background: var(--brand-surface);
    border: 1px solid var(--brand-border);
    border-radius: 12px;
    padding: 14px 12px;
}
.project-link--single .project-link-title { font-size: 1.1em; }
#publicProjectList { margin-top: 10px; }

/* Kalender-Abos auf der Konto-Seite */
.feed-row {
    border-top: 1px solid var(--brand-border);
    padding: 10px 0;
}

.feed-label {
    display: block;
    font-weight: 700;
}

.feed-hint {
    display: block;
    font-size: 0.85em;
    color: var(--brand-text-muted);
    margin: 2px 0 8px;
}

.feed-actions {
    display: flex;
    gap: 8px;
}

.feed-actions .button {
    width: auto;
    flex: 1 1 0;
    padding: 10px 8px;
    font-size: 0.92em;
    margin: 0;
}

.feed-row .admin-input { margin-top: 8px; }

/* Konto: „Push auf diesem Gerät“ – Schalter-Zeilen: Label mit Beschreibung
   links, Checkbox rechts; die ganze Zeile ist Tippfläche */
.switch-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    cursor: pointer;
}

.switch-row + .switch-row { border-top: 1px solid var(--brand-border); }

.switch-text {
    flex: 1 1 auto;
    min-width: 0;
}

.switch-label {
    display: block;
    font-weight: 700;
}

.switch-hint {
    display: block;
    font-size: 0.85em;
    line-height: 1.35;
    color: var(--brand-text-muted);
    margin-top: 2px;
}

.switch-row input {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin: 0;
    accent-color: var(--brand-primary);
}

.switch-row input:disabled { opacity: 0.45; cursor: default; }

.switch-note {
    font-size: 0.85em;
    margin-top: 6px;
}
