:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --muted: #64748b;
    --primary: #0d7d74;
    --primary-dark: #0a635c;
    --accent: #f59e0b;
    --danger: #dc2626;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --shadow-lg: 0 10px 25px rgba(0,0,0,.10);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 480px; margin: 0 auto; padding: 0 20px; }

/* ---------- Navigation ---------- */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 500;
}
.navbar .container {
    display: flex; align-items: center; justify-content: space-between;
    height: 62px;
}
.brand { font-size: 1.35rem; font-weight: 800; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 18px; }
.nav-links .user { color: var(--muted); font-size: .95rem; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--primary); color: #fff;
    padding: 10px 18px; border-radius: var(--radius);
    border: none; cursor: pointer; font-size: .95rem; font-weight: 600;
    font-family: inherit; transition: background .15s, transform .05s;
    text-decoration: none;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-secondary { background: #eef2f5; color: var(--text); }
.btn-secondary:hover { background: #e2e8ee; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-accent { background: var(--accent); color: #422006; }
.btn-accent:hover { background: #d97706; }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Cards & layout ---------- */
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px; margin: 28px 0 20px;
}
.page-header h1 { margin: 0; font-size: 1.8rem; }

.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 22px; margin-bottom: 18px;
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

.journal-card { overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.journal-card .cover {
    height: 150px; background: linear-gradient(135deg, #0d7d74, #14b8a6);
    background-size: cover; background-position: center;
}
.journal-card .body { padding: 16px 18px; flex: 1; display: flex; flex-direction: column; }
.journal-card h3 { margin: 0 0 6px; font-size: 1.15rem; }
.journal-card p { color: var(--muted); font-size: .9rem; margin: 0 0 12px; flex: 1; }
.journal-card .meta { display: flex; align-items: center; justify-content: space-between; font-size: .82rem; color: var(--muted); }

.badge {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
}
.badge-public { background: #dcfce7; color: #166534; }
.badge-private { background: #f1f5f9; color: #64748b; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .92rem; }
.form-control {
    width: 100%; padding: 11px 13px; font-size: 1rem; font-family: inherit;
    border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,125,116,.12); }
textarea.form-control { min-height: 160px; resize: vertical; }
.form-hint { font-size: .82rem; color: var(--muted); margin-top: 5px; }
.form-row { display: flex; gap: 14px; }
.form-row .form-group { flex: 1; }

/* ---------- Flash ---------- */
.flash { padding: 13px 18px; border-radius: 10px; margin-bottom: 16px; font-size: .93rem; }
.flash-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.flash-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* ---------- Entries ---------- */
.entry { border-left: 3px solid var(--primary); padding-left: 18px; margin-bottom: 28px; }
.entry-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.entry-head h3 { margin: 0; font-size: 1.3rem; }
.entry-date { color: var(--muted); font-size: .88rem; }
.entry-location { color: var(--primary); font-size: .88rem; margin: 2px 0 10px; }
.entry-body { white-space: pre-wrap; margin: 10px 0; }
.drag-handle { cursor: grab; color: var(--muted); font-size: 1.1rem; user-select: none; margin-right: 4px; }
.drag-handle:active { cursor: grabbing; }
.entry-ghost { opacity: .4; background: #f0fdfa; border-radius: 8px; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 12px; }
.media-grid img, .media-grid video { width: 100%; border-radius: 10px; display: block; }
.media-item { position: relative; }
.embed-wrap { position: relative; padding-bottom: 56.25%; height: 0; border-radius: 10px; overflow: hidden; }
.embed-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Map ---------- */
#map, #route-map { height: 460px; border-radius: var(--radius); border: 1px solid var(--border); z-index: 1; }
#pick-map { height: 320px; border-radius: var(--radius); border: 1px solid var(--border); z-index: 1; }
.map-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.route-list { list-style: none; padding: 0; margin: 16px 0 0; }
.route-list li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; font-size: .9rem; }
.route-list li .num { background: var(--primary); color: #fff; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 700; flex-shrink: 0; }

/* ---------- Hero (landing) ---------- */
.hero { text-align: center; padding: 70px 20px 40px; }
.hero h1 { font-size: 2.6rem; margin: 0 0 14px; }
.hero p { font-size: 1.15rem; color: var(--muted); max-width: 560px; margin: 0 auto 28px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 20px; margin: 40px 0; }
.feature { text-align: center; padding: 24px; }
.feature .icon { font-size: 2rem; margin-bottom: 10px; }
.feature h3 { margin: 0 0 8px; }
.feature p { color: var(--muted); font-size: .92rem; margin: 0; }

/* ---------- Misc ---------- */
.inline-form { display: inline; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.text-muted { color: var(--muted); }
.mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }
.share-box { display: flex; gap: 8px; margin-top: 10px; }
.share-box input { flex: 1; font-family: monospace; font-size: .85rem; }

footer.site { text-align: center; color: var(--muted); font-size: .85rem; padding: 40px 20px; }

@media (max-width: 640px) {
    .form-row { flex-direction: column; }
    .hero h1 { font-size: 2rem; }
}

/* ============================================================
   Sidebar-Layout (eingeloggte Ansicht)
   ============================================================ */
body.app {
    margin: 0;
    display: block;
}

.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 250px;
    background: #0f2e2b;                 /* dunkles Petrol */
    color: #d9e6e4;
    display: flex;
    flex-direction: column;
    z-index: 900;
}
.sidebar-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 18px 10px;
}
.sidebar .brand { color: #fff; font-size: 1.25rem; }
.sidebar .brand:hover { text-decoration: none; opacity: .9; }

.side-nav { padding: 10px 12px; flex: 1; overflow-y: auto; }
.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 11px 14px; margin-bottom: 4px;
    color: #cfe0de; border-radius: 10px;
    font-weight: 600; font-size: .95rem;
    text-decoration: none; transition: background .15s, color .15s;
}
.nav-item .ic { font-size: 1.05rem; line-height: 1; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-section {
    padding: 16px 14px 6px; font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em; color: #7fa8a3;
}

.side-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.1); }
.side-user { font-size: .9rem; color: #eaf2f1; margin-bottom: 10px; }
.side-role { color: #7fa8a3; font-size: .8rem; }

.app-main {
    margin-left: 250px;
    min-height: 100vh;
    background: var(--bg);
}
.content {
    padding: 26px 34px 60px;
    max-width: none;                     /* Vollbreite für Listen & Kacheln */
    width: 100%;
}
.content .page-header { margin-top: 6px; }

/* Mobile-Topbar (nur auf kleinen Screens sichtbar) */
.topbar-mobile { display: none; }
.nav-toggle { position: absolute; }
.nav-open, .nav-close {
    cursor: pointer; font-size: 1.4rem; line-height: 1;
    background: none; border: none; color: inherit; user-select: none;
}
.nav-close { color: #cfe0de; display: none; }   /* nur auf Mobil sichtbar */

@media (max-width: 900px) {
    .nav-close { display: block; }
    .sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: 0 0 40px rgba(0,0,0,.4);
    }
    #nav-toggle:checked ~ .sidebar { transform: translateX(0); }
    .app-main { margin-left: 0; }
    .topbar-mobile {
        display: flex; align-items: center; gap: 14px;
        background: var(--surface); border-bottom: 1px solid var(--border);
        padding: 12px 16px; position: sticky; top: 0; z-index: 500;
    }
    .topbar-mobile .brand { font-size: 1.15rem; }
    .content { padding: 18px 16px 50px; }
}

/* Tabellen in Karten etwas luftiger */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 10px 10px; }
.data-table thead tr { border-bottom: 2px solid var(--border); text-align: left; }
.data-table tbody tr { border-bottom: 1px solid var(--border); }

/* Tagebuch-Meta (Zeitraum, Teilnehmer) */
.journal-meta .meta-line { padding: 4px 0; }
.journal-meta .meta-line + .meta-line { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; }
.journal-meta .meta-ic { margin-right: 6px; }
.participant-row input { flex: 1; }

/* Dashboard-Statistik-Kacheln */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; margin-bottom: 26px; }
.stat-tile {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 20px; text-align: center;
}
.stat-ic { font-size: 1.8rem; line-height: 1; margin-bottom: 8px; }
.stat-val { font-size: 2.1rem; font-weight: 800; color: var(--primary); line-height: 1.1; }
.stat-label { color: var(--muted); font-size: .9rem; margin-top: 4px; }

.latest-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; }
.latest-row + .latest-row { border-top: 1px solid var(--border); }

.journal-card .journal-dates { color: var(--primary); font-size: .82rem; margin: 0 0 8px; }

/* Balkendiagramm (Einträge je Tagebuch) */
.bar-chart { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 220px) 1fr auto; align-items: center; gap: 12px; }
.bar-label {
    font-size: .9rem; color: var(--text); font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track { background: #eef2f5; border-radius: 6px; height: 14px; overflow: hidden; }
.bar-fill {
    height: 100%; background: var(--primary);
    border-radius: 0 4px 4px 0; min-width: 3px;
    transition: width .3s ease;
}
.bar-value { font-size: .9rem; font-weight: 700; color: var(--muted); min-width: 1.5em; text-align: right; }
@media (max-width: 560px) {
    .bar-row { grid-template-columns: 96px 1fr auto; }
    .bar-label { font-size: .82rem; }
}

/* Routen-Editor: Wegpunkt-Zeilen mit Name + Koordinaten */
.route-list li.route-point { gap: 10px; }
.route-point .rp-name { flex: 1; min-width: 120px; padding: 7px 10px; font-size: .9rem; }
.route-point .rp-coords { font-family: monospace; font-size: .82rem; color: var(--muted); white-space: nowrap; }
@media (max-width: 560px) {
    .route-point { flex-wrap: wrap; }
    .route-point .rp-coords { width: 100%; padding-left: 34px; }
}

/* ---------- Einträge als Akkordeon ---------- */
.entry-acc {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    margin-bottom: 12px;
    overflow: hidden;
}
.entry-acc + .entry-acc { margin-top: 0; }
.entry-acc-summary {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; cursor: pointer; list-style: none;
    border-left: 3px solid var(--primary);
}
.entry-acc-summary::-webkit-details-marker { display: none; }   /* Safari/Chrome Standarddreieck aus */
.entry-acc-summary:hover { background: #f8fafc; }
.entry-acc-titles { flex: 1; min-width: 0; }
.entry-acc-title { display: block; font-size: 1.2rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.entry-acc-desc {
    display: block; font-size: .88rem; color: var(--muted); margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.entry-acc-date { color: var(--muted); font-size: .85rem; white-space: nowrap; flex-shrink: 0; }
.entry-acc-chevron { color: var(--muted); transition: transform .2s ease; flex-shrink: 0; }
.entry-acc[open] > .entry-acc-summary .entry-acc-chevron { transform: rotate(180deg); }
.entry-acc[open] > .entry-acc-summary .entry-acc-desc { display: none; }  /* aufgeklappt: Auszug ausblenden (voller Text steht darunter) */
.entry-acc-body { padding: 4px 16px 18px; border-left: 3px solid var(--primary); }
.entry-acc-body .entry-body { margin-top: 8px; }

/* Abschnitts-Kopfzeile (Überschrift + Aktion, z. B. Einträge + "+ Eintrag") */
.section-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin: 24px 0 12px;
}
.section-header h2 { margin: 0; }

/* Überschrift mit direktem Aktions-Piktogramm dahinter */
.heading-action { display: flex; align-items: center; gap: 10px; }
h2.heading-action { margin: 26px 0 12px; }

/* Rundes Piktogramm-Button (Icon ohne Text) */
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 50%;
    background: #eef2f5; color: var(--text);
    font-size: 1rem; line-height: 1; text-decoration: none;
    flex-shrink: 0; transition: background .15s, transform .05s;
}
.icon-btn:hover { background: #e2e8ee; text-decoration: none; }
.icon-btn:active { transform: translateY(1px); }

/* Menü-Baum: Tagebuch-Titel unter "Tagebücher" */
.nav-tree {
    list-style: none; margin: 2px 0 8px 22px; padding-left: 10px;
    border-left: 1px solid rgba(255,255,255,.14);
}
.nav-subitem {
    display: block; padding: 7px 10px; margin-bottom: 2px;
    color: #b7cdca; font-size: .87rem; border-radius: 8px; text-decoration: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-subitem:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.nav-subitem.active { background: var(--primary); color: #fff; }

/* ------------------- Einstellungen: Tabs ------------------- */
.settings-tabs { margin-top: 4px; }
.tab-bar {
    display: flex; flex-wrap: wrap; gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
}
.tab-btn {
    appearance: none; border: none; background: transparent;
    padding: 11px 18px; margin-bottom: -2px;
    font-size: .95rem; font-weight: 600; color: var(--muted, #64748b);
    cursor: pointer; border-radius: 10px 10px 0 0;
    border-bottom: 2px solid transparent;
    transition: color .15s, background .15s, border-color .15s;
}
.tab-btn:hover { color: var(--text); background: #eef2f5; }
.tab-btn.is-active {
    color: var(--primary); border-bottom-color: var(--primary);
    background: transparent;
}
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* ------------------- WYSIWYG-Editor (Bild-/Video-Beschreibung) ------------------- */
.rich-editor {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.rich-toolbar {
    display: flex; flex-wrap: wrap; gap: 2px;
    padding: 6px; background: #f6f8fa;
    border-bottom: 1px solid var(--border);
}
.rich-toolbar button {
    appearance: none; border: 1px solid transparent; background: transparent;
    min-width: 32px; height: 30px; padding: 0 8px;
    font-size: .9rem; line-height: 1; color: var(--text);
    border-radius: 7px; cursor: pointer;
}
.rich-toolbar button:hover { background: #e6ebf0; }
.rich-toolbar button.is-active { background: var(--primary); color: #fff; }
.rich-toolbar .sep { width: 1px; margin: 4px 4px; background: var(--border); }
.rich-area {
    min-height: 90px; max-height: 320px; overflow-y: auto;
    padding: 10px 12px; font-size: .95rem; line-height: 1.55; outline: none;
}
.rich-area:focus { box-shadow: inset 0 0 0 2px rgba(15,118,110,.25); }
.rich-area p { margin: 0 0 8px; }
.rich-area ul, .rich-area ol { margin: 6px 0 8px 22px; }
.rich-area:empty::before {
    content: attr(data-placeholder); color: var(--muted, #94a3b8);
}

/* Anzeige einer gespeicherten Beschreibung (bereinigtes HTML) */
.media-caption {
    margin-top: 6px; font-size: .9rem; line-height: 1.5; color: var(--text);
}
.media-caption p { margin: 0 0 6px; }
.media-caption ul, .media-caption ol { margin: 4px 0 6px 20px; }
.media-caption a { color: var(--primary, #0f766e); }

/* Beschreibungs-Formular je Medium im Bearbeiten-Modus */
.media-caption-form { margin-top: 8px; }
.media-caption-form .actions { margin-top: 6px; }

/* ------------------- Medien-Piktogrammleiste + Beschreibungs-Modal ------------------- */
.icon-btn-sm { width: 30px; height: 30px; font-size: .95rem; }
.icon-btn-danger:hover { background: #fde2e2; }

.media-toolbar {
    display: flex; gap: 6px; align-items: center;
    margin-top: 6px;
}
/* „Beschreibung vorhanden"-Markierung am 📝-Piktogramm */
.caption-edit { position: relative; }
.caption-edit.has-caption { background: #d7f0ec; }
.caption-edit.has-caption::after {
    content: ""; position: absolute; top: 3px; right: 3px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--primary); border: 1px solid #fff;
}

/* Modal */
.modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px; background: rgba(15, 23, 42, .55);
}
.modal-overlay[hidden] { display: none; }   /* wichtig: sonst überschreibt display:flex das hidden-Attribut */
body.modal-open { overflow: hidden; }
.modal {
    background: #fff; border-radius: 14px; width: 100%; max-width: 720px;
    max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid var(--border);
    position: sticky; top: 0; background: #fff; z-index: 1;
}
.modal-close {
    appearance: none; border: none; background: #eef2f5; cursor: pointer;
    width: 34px; height: 34px; border-radius: 50%; font-size: 1rem; color: var(--text);
}
.modal-close:hover { background: #e2e8ee; }
.modal-body { padding: 18px; }
.modal-media {
    display: flex; justify-content: center; margin-bottom: 16px;
    background: #0b0b0d; border-radius: 10px; overflow: hidden;
}
.modal-media img, .modal-media video {
    max-width: 100%; max-height: 42vh; display: block; object-fit: contain;
}
.modal-media iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; }

/* ------------------- Ort-Suche: Feld + Button nebeneinander ------------------- */
.input-with-btn { display: flex; gap: 8px; align-items: stretch; }
.input-with-btn .form-control { flex: 1; }
.input-with-btn .btn { white-space: nowrap; }

/* ------------------- Drag & Drop für Datei-Felder ------------------- */
.dropzone {
    border: 2px dashed var(--border); border-radius: 10px;
    padding: 12px; background: #fbfcfd;
    transition: border-color .15s, background .15s;
}
.dropzone .dropzone-hint {
    margin-top: 8px; font-size: .85rem; color: var(--muted, #94a3b8); text-align: center;
}
.dropzone.is-dragover {
    border-color: var(--primary); background: #e8f6f4;
}
.dropzone.is-dragover .dropzone-hint { color: var(--primary); }

/* ------------------- Tagebuch löschen (Gefahrenbereich) ------------------- */
.danger-zone {
    border: 1px solid #fecaca;
    background: #fff7f7;
    margin-top: 24px;
}

/* ------------------- Marke: Bildmarke + zweifarbige Textmarke ------------------- */
.brand-mark { width: 30px; height: 30px; flex-shrink: 0; display: block; }
.brand-word { font-weight: 800; letter-spacing: -.01em; line-height: 1; white-space: nowrap; }
.wm-a { color: #0d7d74; }   /* helle Flächen: Teal   */
.wm-b { color: #ee5b45; }   /* helle Flächen: Koralle */
/* dunkle Sidebar: hellere, fröhliche Töne für gute Lesbarkeit */
.sidebar .wm-a { color: #5eead4; }
.sidebar .wm-b { color: #ffb37a; }
.sidebar .brand-mark, .topbar-mobile .brand-mark { width: 28px; height: 28px; }

/* =========================== Dark Mode =========================== */
html[data-theme="dark"] {
    --bg: #0f172a;
    --surface: #1e293b;
    --border: #334155;
    --text: #e5e9f0;
    --muted: #9aa7b8;
    --shadow: 0 1px 3px rgba(0,0,0,.55), 0 1px 2px rgba(0,0,0,.4);
    --shadow-lg: 0 14px 34px rgba(0,0,0,.6);
    color-scheme: dark;
}
/* Teal als Text/Link auf dunklem Grund aufhellen (Buttons behalten --primary) */
html[data-theme="dark"] a,
html[data-theme="dark"] .stat-val,
html[data-theme="dark"] .entry-location,
html[data-theme="dark"] .journal-card .journal-dates,
html[data-theme="dark"] .media-caption a,
html[data-theme="dark"] .navbar .wm-a { color: #2dd4bf; }
html[data-theme="dark"] .tab-btn.is-active { color: #2dd4bf; border-bottom-color: #2dd4bf; }

/* Fest verdrahtete helle Farben nachziehen */
html[data-theme="dark"] .btn-secondary { background: #334155; color: var(--text); }
html[data-theme="dark"] .btn-secondary:hover { background: #3f4f66; }
html[data-theme="dark"] .form-control { background: #0f172a; color: var(--text); }
html[data-theme="dark"] .form-control::placeholder { color: #6b7a8d; }
html[data-theme="dark"] .icon-btn { background: #334155; color: var(--text); }
html[data-theme="dark"] .icon-btn:hover { background: #3f4f66; }
html[data-theme="dark"] .icon-btn-danger:hover { background: #4c1d1d; }
html[data-theme="dark"] .rich-editor { background: var(--surface); }
html[data-theme="dark"] .rich-toolbar { background: #0f172a; }
html[data-theme="dark"] .rich-toolbar button { color: var(--text); }
html[data-theme="dark"] .rich-toolbar button:hover { background: #334155; }
html[data-theme="dark"] .tab-btn:hover { background: #273244; }
html[data-theme="dark"] .modal { background: var(--surface); }
html[data-theme="dark"] .modal-head { background: var(--surface); }
html[data-theme="dark"] .modal-close { background: #334155; color: var(--text); }
html[data-theme="dark"] .modal-close:hover { background: #3f4f66; }
html[data-theme="dark"] .dropzone { background: #0f172a; }
html[data-theme="dark"] .dropzone.is-dragover { background: #0e3b37; }
html[data-theme="dark"] .entry-acc-summary:hover { background: #0f172a; }
html[data-theme="dark"] .route-list li { background: #0f172a; }
html[data-theme="dark"] .bar-track { background: #334155; }
html[data-theme="dark"] .badge-private { background: #334155; color: #cbd5e1; }
html[data-theme="dark"] .entry-ghost { background: #0e3b37; }
html[data-theme="dark"] .danger-zone { background: #3a2020; border-color: #7f1d1d; }
html[data-theme="dark"] .flash-success { background: #14321f; color: #86efac; border-color: #14532d; }
html[data-theme="dark"] .flash-error { background: #3a1a1a; color: #fca5a5; border-color: #7f1d1d; }

/* Umschalter (Sonne/Mond) */
.theme-toggle {
    appearance: none; border: none; cursor: pointer; background: transparent;
    font-size: 1.15rem; line-height: 1; padding: 6px 8px; border-radius: 8px;
    color: inherit; display: inline-flex; align-items: center; justify-content: center;
}
.theme-toggle:hover { background: rgba(0,0,0,.06); }
.sidebar .theme-toggle:hover { background: rgba(255,255,255,.12); }
html[data-theme="dark"] .theme-toggle:hover { background: rgba(255,255,255,.08); }
.head-actions { display: flex; align-items: center; gap: 4px; }

/* ------------------- Kachel-Aktionen (Präsentation / Export) ------------------- */
.journal-card-link { display: flex; flex-direction: column; flex: 1; color: inherit; text-decoration: none; }
.journal-card-link:hover { text-decoration: none; }
.journal-actions {
    display: flex; gap: 8px; padding: 10px 16px 14px;
    border-top: 1px solid var(--border);
}
