/* === Entdecker — Mobile-first Design === */
:root {
    --color-primary: #2d6a4f;
    --color-primary-light: #40916c;
    --color-primary-dark: #1b4332;
    --color-accent: #d4a373;
    --color-accent-light: #e9c89b;
    --color-bg: #fefae0;
    --color-bg-card: #ffffff;
    --color-text: #1a1a1a;
    --color-text-light: #555;
    --color-text-muted: #888;
    --color-border: #ddd;
    --color-danger: #c1121f;
    --color-success: #2d6a4f;
    --color-warning: #e9c46a;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --max-width: 1200px;
}

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

html, body {
    overflow-x: hidden;
}
body { width: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

/* === Navigation === */
.nav {
    background: var(--color-primary-dark);
    color: white;
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.nav-links a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: background 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(255,255,255,0.15);
    color: white;
}

/* Mobile-only Nav-Eintraege ("Info und Rechtliches" im Burger-Menue) */
/* Auf Desktop ausgeblendet — dort erscheinen die Links im Footer. */
.mobile-nav-only { display: none !important; }
.nav-rechtliches-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    color: rgba(255,255,255,0.75);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 0.75rem 0.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.15);
}
.nav-rechtliches-chevron {
    transition: transform 0.2s;
    display: inline-block;
    font-size: 0.9rem;
}
.nav-rechtliches-heading[aria-expanded="true"] .nav-rechtliches-chevron {
    transform: rotate(90deg);
}
.nav-rechtliches-group {
    display: none;
    flex-direction: column;
}
.nav-rechtliches-group.open { display: flex; }
.nav-rechtliches-group a {
    padding-left: 1.5rem !important;
    font-size: 0.95rem;
}

/* Profil-Sub-Navigation (immer sichtbar im offenen Burger-Menü) */
.nav-profil-sub {
    display: none;
    flex-direction: column;
}
.nav-profil-sub a {
    padding-left: 1.5rem !important;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.75);
    border-bottom: 1px solid rgba(255,255,255,0.07) !important;
}

/* Burger menu */
.burger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    flex-direction: column;
    gap: 4px;
}
.burger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}
.burger-btn.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger-btn.open span:nth-child(2) { opacity: 0; }
.burger-btn.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 768px) {
    .burger-btn { display: flex; }
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        padding-top: 0.5rem;
    }
    .nav-links.open { display: flex; }
    .nav-links a {
        padding: 0.6rem 0.75rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    .nav-inner { flex-wrap: wrap; }
    .mobile-nav-only { display: block !important; }
    .nav-profil-sub { display: flex !important; }
    .nav-rechtliches-group.mobile-nav-only { display: none !important; }
    .nav-rechtliches-group.mobile-nav-only.open { display: flex !important; }
    /* Rollen-Links im Burger ausblenden — erscheinen im Profil-Sub-Menü */
    #nav-redaktion, #nav-verwaltung, #nav-admin, #nav-hilfe-intern { display: none !important; }
    .site-footer { display: none; }
}

/* === Layout === */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
    color: var(--color-primary-dark);
}

.page-header p {
    color: var(--color-text-light);
    margin-top: 0.25rem;
}

/* === Markdown-Seiten (seite.html) === */
#md-content { line-height: 1.55; }
#md-content h1 { margin: 0 0 0.5rem; line-height: 1.2; }
#md-content h2 { margin: 0 0 1rem; line-height: 1.25; font-size: 1.45rem; }
#md-content h3 { margin: 1.5rem 0 0.5rem; line-height: 1.3; font-size: 1.15rem; }
#md-content p  { margin: 0 0 0.85rem; }
#md-content ul, #md-content ol { margin: 0 0 1rem; padding-left: 1.4rem; }
#md-content li { margin: 0.25rem 0; }
#md-content section { padding: 0; }
#md-content section > :first-child { margin-top: 0; }
#md-content section > :last-child  { margin-bottom: 0; }
#md-content .card > :first-child { margin-top: 0; }
#md-content .card > :last-child  { margin-bottom: 0; }
#md-content .card p { margin: 0 0 0.6rem; }
#md-content a:not(.btn) { color: var(--color-primary-dark); }
#md-content a.btn-primary { color: #fff; }
#md-content a.btn-outline { color: var(--color-primary); }
#md-content a.btn-outline:hover { color: #fff; }

/* === Cards === */
.card {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.card-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-primary-dark);
    margin-bottom: 0.75rem;
}

/* === Grid === */
.grid {
    display: grid;
    gap: 1rem;
}

.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }

@media (min-width: 768px) {
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}
.btn-primary:hover { background: var(--color-primary-light); }

.btn-secondary {
    background: var(--color-accent);
    color: var(--color-primary-dark);
}
.btn-secondary:hover { background: var(--color-accent-light); }

.btn-danger {
    background: var(--color-danger);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}
.btn-outline:hover {
    background: var(--color-primary);
    color: white;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* === Forms === */

/* Global select styling — consistent look everywhere */
select {
    padding: 0.6rem 2.2rem 0.6rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--color-bg-card);
    color: var(--color-text);
    cursor: pointer;
    transition: border-color 0.2s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.15);
}

select:hover {
    border-color: var(--color-primary-light, #52b788);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.3rem;
    color: var(--color-text);
    font-size: 0.9rem;
}

.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group select {
    width: 100%;
}

.form-group input[type="checkbox"],
.form-group input[type="radio"] {
    width: auto;
    flex-shrink: 0;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Checkbox groups — override form-group defaults */
.checkbox-group {
    margin-bottom: 1rem;
}

.checkbox-group > span.checkbox-group-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--color-text);
    font-size: 0.9rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: normal;
    margin-bottom: 0.4rem;
}

.checkbox-group label input[type="checkbox"] {
    width: auto;
    flex-shrink: 0;
}

/* === Map === */
.map-container {
    width: 100%;
    height: 60vh;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

@media (min-width: 768px) {
    .map-container { height: 70vh; }
}

/* === Badges === */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success { background: #d8f3dc; color: var(--color-primary-dark); }
.badge-warning { background: var(--color-warning, #ffeaa7); color: #6d4c00; }
.badge-danger { background: #ffd7d7; color: var(--color-danger); }
.badge-info { background: var(--color-info-bg, #dbeafe); color: var(--color-info, #1e40af); }
.badge-verwaltung { background: #ede9fe; color: #5b21b6; }

/* === Routentyp-Filter-Chips (Karten-Übersicht) === */
.rtyp-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    border: 2px solid var(--color-border, #ddd);
    background: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.1s, border-color 0.15s, background 0.15s, filter 0.2s;
    line-height: 1;
    padding: 0;
}
.rtyp-chip:hover {
    transform: scale(1.08);
    border-color: var(--color-primary, #2d6a4f);
}
.rtyp-chip.active {
    background: #fff;
    border-color: var(--color-primary, #2d6a4f);
    box-shadow: 0 0 0 1px var(--color-primary, #2d6a4f) inset;
}
.rtyp-chip:not(.active) {
    filter: grayscale(80%) opacity(0.55);
}

/* === Eignungs-Chips (Routen-Detail/Liste) === */
.eignung-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.55rem;
    border-radius: 99px;
    background: var(--color-bg, #f4f4f4);
    border: 1px solid var(--color-border, #ddd);
    font-size: 0.8rem;
    color: var(--color-text, #333);
}
.eignung-chip.primary {
    background: var(--color-primary, #2d6a4f);
    color: #fff;
    border-color: var(--color-primary-dark, #1b4332);
    font-weight: 600;
}

/* === Foto-Edit: Chip-Listen + GPS-Vorschlaege === */
.foto-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.4rem; }
.foto-chip {
    display: inline-flex; align-items: center; gap: 0.3rem;
    background: var(--color-accent-light, #e9c89b);
    color: var(--color-primary-dark, #1b4332);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.85rem;
}
.foto-chip button {
    background: none; border: none; cursor: pointer;
    font-size: 1.1rem; line-height: 1; padding: 0;
    color: inherit;
}
.foto-gps-vorschlag-row { margin: 0.25rem 0; }
.foto-vorschlag-chip {
    display: inline-flex; align-items: center; gap: 0.2rem;
    background: #fff;
    border: 1px dashed var(--color-primary, #2d6a4f);
    color: var(--color-primary-dark, #1b4332);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.8rem;
    cursor: pointer;
}
.foto-vorschlag-chip:hover {
    background: var(--color-accent-light, #e9c89b);
    border-style: solid;
}
.foto-vorschlag-chip small { color: #888; margin-left: 0.2rem; }

/* === Aktive Track-Chips === */
.aktive-track-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.5rem;
    background: var(--color-primary, #2d6a4f);
    color: #fff;
    border-radius: 99px;
    font-size: 0.75rem;
}
.aktive-track-chip button {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
}

/* === Tabs === */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 1rem;
    /* Wenn die Tabs nicht in eine Zeile passen, schaltet adjustTabs() (in
       app-nav.js) auf das Dropdown um — daher hier weder Wrap noch Scroll. */
    overflow: hidden;
}

.tab {
    padding: 0.6rem 1.2rem;
    border: none;
    background: none;
    font-size: 0.95rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    color: var(--color-text-light);
}

.tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    font-weight: 600;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Mobile: Dropdown statt Tab-Leiste */
.tab-dropdown {
    display: none;
    width: 100%;
    border-width: 2px;
    border-color: var(--color-primary);
    color: var(--color-primary-dark);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%232d6a4f' stroke-width='2' fill='none'/%3E%3C/svg%3E");
}

@media (max-width: 768px) {
    .tabs { display: none; }
    .tab-dropdown { display: block; }
}

/* === Route Card === */
.route-card {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s;
    cursor: pointer;
}

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

.route-card-body {
    padding: 1rem;
}

.route-card-body h3 {
    color: var(--color-primary-dark);
    margin-bottom: 0.25rem;
}

.route-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* === Criteria Tags (route list) === */
.crit-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.78rem;
    color: var(--color-text-muted);
    background: var(--color-bg, #f8f8f4);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    border: 1px solid var(--color-border, #e0e0e0);
    white-space: nowrap;
}

.crit-tag.crit-ko {
    color: var(--color-danger, #d32f2f);
    border-color: var(--color-danger, #d32f2f);
    background: #fff5f5;
    font-weight: 600;
}

/* === Atom Display === */
.atom {
    border-left: 4px solid var(--color-primary);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    background: var(--color-bg-card);
    border-radius: 0 var(--radius) var(--radius) 0;
    box-shadow: var(--shadow);
}

.atom-anker {
    font-style: italic;
    color: var(--color-text);
    margin-bottom: 1rem;
    font-size: 1.05rem;
    line-height: 1.7;
}

.atom-verschiebung {
    color: var(--color-text-light);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.atom-oeffnung {
    color: var(--color-primary-dark);
    font-weight: 500;
    font-style: italic;
    line-height: 1.7;
}

/* === Feedback buttons === */
.feedback-bar {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.feedback-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--color-border);
    border-radius: 99px;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.feedback-btn:hover {
    border-color: var(--color-primary);
    background: #d8f3dc;
}

.feedback-btn.selected {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: white;
}

/* === Audio Recorder === */
.audio-recorder {
    text-align: center;
    padding: 2rem;
}

.record-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid var(--color-danger);
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.record-btn.recording {
    background: var(--color-danger);
    animation: pulse 1s infinite;
}

.record-btn .dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-danger);
}

.record-btn.recording .dot {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: white;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(193, 18, 31, 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(193, 18, 31, 0); }
}

.record-timer {
    margin-top: 0.75rem;
    font-size: 1.5rem;
    font-variant-numeric: tabular-nums;
    color: var(--color-text-muted);
}

/* === GPS Status === */
.gps-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    background: #f0f0f0;
}

.gps-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
}

.gps-dot.active { background: var(--color-success); }
.gps-dot.error { background: var(--color-danger); }

/* === Info Button / Tooltip === */
.info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 50%;
    background: var(--color-primary-light);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    font-style: italic;
    border: none;
    cursor: pointer;
    vertical-align: middle;
    margin-left: 0.3rem;
    line-height: 1;
    flex-shrink: 0;
}
.info-btn:hover { background: var(--color-primary-dark); }

.info-flyout {
    display: none;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: var(--color-text-light);
    box-shadow: var(--shadow);
    margin-top: 0.5rem;
    line-height: 1.5;
}
.info-flyout.open { display: block; }

/* === KI Assistant === */
.ki-chat {
    max-width: 600px;
    margin: 0 auto;
}

.ki-message {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.ki-message.bot {
    background: #d8f3dc;
    border: 1px solid #b7e4c7;
}

.ki-message.user {
    background: #e3e3e3;
    text-align: right;
}

/* === Table === */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

th {
    background: var(--color-primary-dark);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
}

tr:hover {
    background: rgba(45, 106, 79, 0.05);
}

/* === Alerts === */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-success { background: #d8f3dc; color: var(--color-primary-dark); border: 1px solid #b7e4c7; }
.alert-error { background: #ffd7d7; color: var(--color-danger); border: 1px solid #ffb3b3; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* === Utility === */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* === Responsive === */
@media (min-width: 768px) {
    .container { padding: 1.5rem; }
    .page-header h1 { font-size: 2rem; }
    .nav-inner { flex-wrap: nowrap; }
}

/* Home CTA: Berate mich */
.home-cta-berater {
    margin-bottom: 1rem;
}
.home-cta-btn {
    width: 100%;
    justify-content: flex-start;
    padding: 0.9rem 1.1rem;
    gap: 0.9rem;
    font-size: 1rem;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(45,106,79,0.25);
}
.home-cta-btn:hover {
    box-shadow: 0 4px 10px rgba(45,106,79,0.35);
}
.home-cta-icon {
    font-size: 1.6rem;
    line-height: 1;
}
.home-cta-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    line-height: 1.2;
}
.home-cta-text strong {
    font-size: 1.05rem;
}
.home-cta-sub {
    font-size: 0.8rem;
    font-weight: 400;
    opacity: 0.85;
}

/* Footer */
.site-footer {
    margin-top: 3rem;
    padding: 1.5rem 0;
    border-top: 1px solid #ddd;
    text-align: center;
    font-size: 0.85rem;
}
.footer-inner {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}
.footer-inner a {
    color: var(--color-text-muted, #888);
    text-decoration: none;
}
.footer-inner a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

/* Mobile text/icon toggle */
.show-mobile-only { display: none; }
@media (max-width: 600px) {
    .hide-mobile { display: none !important; }
    .show-mobile-only { display: inline !important; }
}

/* Edit text button (pencil icon for redaktion/admin) */
.edit-text-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--color-accent-light, #e9c89b);
    color: var(--color-text, #1a1a1a);
    border: 1px solid var(--color-accent, #d4a373);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}
.edit-text-btn:hover {
    background: var(--color-accent, #d4a373);
}

/* =========================================================
   App-Navigation (Back-Bar oben + Bottom-Tabs unten)
   Quelle: js/app-nav.js
   ========================================================= */

/* Back-Bar direkt unter der Hauptnavigation */
.app-backbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: #f4efe6;
    border-bottom: 1px solid #e5dccd;
    color: var(--color-primary-dark);
    font-size: 0.9rem;
    position: sticky;
    top: 0;
    z-index: 90;
}
.app-back-btn {
    background: transparent;
    border: none;
    color: var(--color-primary-dark);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.app-back-btn:hover,
.app-back-btn:focus-visible {
    background: rgba(27, 67, 50, 0.08);
    outline: none;
}
.app-breadcrumb {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.app-breadcrumb a.app-breadcrumb-parent {
    color: var(--color-primary-dark);
    text-decoration: none;
    font-weight: 500;
}
.app-breadcrumb a.app-breadcrumb-parent:hover {
    text-decoration: underline;
}
.app-breadcrumb-current {
    color: #6b7280;
}

/* Bottom-Tab-Bar: nur Mobile */
.app-bottom-tabs { display: none; }

@media (max-width: 768px) {
    .app-bottom-tabs {
        display: flex;
        gap: 0.4rem;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        /* Muss ueber Leaflet liegen: Panes bis 700, Controls 1000 */
        z-index: 1100;
        background: #ffffff;
        border-top: 1px solid #e5dccd;
        padding: 0.4rem 0.5rem calc(0.4rem + env(safe-area-inset-bottom, 0));
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
    }
    .app-bottom-tab {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 0.35rem 0.25rem;
        text-decoration: none;
        font-size: 0.7rem;
        font-weight: 500;
        line-height: 1.1;
        min-height: 52px;
        border-radius: 6px;
        border: none;
        color: var(--color-primary);
        background: transparent;
        transition: background 0.15s, color 0.15s;
        text-align: center;
    }
    .app-bottom-tab-icon {
        width: 26px;
        height: 26px;
        display: block;
        background-color: currentColor;
        -webkit-mask: var(--tab-icon) no-repeat center / contain;
                mask: var(--tab-icon) no-repeat center / contain;
    }
    .app-bottom-tab-label {
        display: block;
    }
    .app-bottom-tab:hover,
    .app-bottom-tab:focus-visible {
        background: rgba(45, 106, 79, 0.08);
        color: var(--color-primary-dark, #1b4332);
        outline: none;
    }
    .app-bottom-tab.active {
        background: var(--color-primary);
        color: #fff;
    }
    /* Sticky-Footer-Pattern: Footer auf kurzen Seiten direkt ueber die Bottom-Bar */
    body.has-bottom-tabs {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        padding-bottom: calc(58px + env(safe-area-inset-bottom, 0));
    }
    body.has-bottom-tabs > .container,
    body.has-bottom-tabs > main {
        flex: 1 0 auto;
    }
    body.has-bottom-tabs .site-footer {
        flex-shrink: 0;
        margin-top: auto;
    }
    /* Leaflet-Attribution nach oben schieben, damit sie nicht hinter der Bar steckt */
    body.has-bottom-tabs .leaflet-bottom {
        bottom: calc(58px + env(safe-area-inset-bottom, 0));
    }
}

/* ========== Datenpool (Foto-Kuratierung) ========== */
.datenpool-stats {
    margin-bottom: 0.5rem;
}

.datenpool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

/* Fotos-Kachel-Ansicht: passt sich flexibel an die Browserbreite an */
.fotos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.datenpool-card {
    position: relative;
    border: 1px solid var(--color-border, #e0e0e0);
    border-radius: 8px;
    overflow: hidden;
    background: var(--color-surface, #fff);
    transition: box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
}

.datenpool-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.datenpool-card--deleted {
    opacity: 0.55;
}

.datenpool-card__check {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 4px;
    padding: 2px 4px;
    cursor: pointer;
}

.datenpool-card__img {
    width: 100%;
    aspect-ratio: 4 / 3;
    background-size: cover;
    background-position: center;
    background-color: #333;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.datenpool-card__img-el {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.datenpool-card__img--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.datenpool-card__body {
    padding: 0.5rem 0.6rem;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.datenpool-card__meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
}

.datenpool-card__assign {
    font-weight: 500;
    line-height: 1.25;
}

.datenpool-card__sub {
    color: var(--color-text-muted, #666);
    font-size: 0.72rem;
}

/* ==================================================================
   GPS-Einzelfeld (Parser fuer DD / DMS / Google-Maps-Copy)
   ================================================================== */
.gps-field {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}
.gps-field input.gps-combined-input {
    flex: 1 1 220px;
    min-width: 220px;
    padding: 0.5rem 0.65rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.92rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
}
.gps-field input.gps-valid {
    border-color: #2e7d32;
    background: #f2faf3;
}
.gps-field input.gps-invalid {
    border-color: #c62828;
    background: #fff6f6;
}
.gps-field .gps-info-btn {
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    border: 1px solid #999;
    background: #f5f5f5;
    color: #333;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.95rem;
    line-height: 1;
    padding: 0;
    flex: 0 0 auto;
}
.gps-field .gps-info-btn:hover {
    background: #eaeaea;
}
.gps-field .gps-info-popup {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 20;
    max-width: 360px;
    background: #fffef5;
    border: 1px solid #d4c97a;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
    padding: 0.7rem 0.9rem;
    border-radius: 6px;
    font-size: 0.8rem;
    line-height: 1.45;
}
.gps-field .gps-info-popup ul {
    margin: 0.35rem 0 0.4rem;
    padding-left: 1rem;
}
.gps-field .gps-info-popup code {
    background: #ececec;
    padding: 0 0.25rem;
    border-radius: 2px;
    font-size: 0.85em;
}
.gps-field .gps-parse-status {
    flex-basis: 100%;
    font-size: 0.78rem;
    min-height: 1em;
}
.gps-field .gps-parse-status.ok  { color: #2e7d32; }
.gps-field .gps-parse-status.err { color: #c62828; }

/* ==================================================================
   Beitragende-Anzeige (Link zu "Beitraege von ...")
   ================================================================== */
.beigetragen-link {
    color: #1565c0;
    cursor: pointer;
    text-decoration: underline dotted;
    font-weight: 500;
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
}
.beigetragen-link:hover {
    color: #0d3c75;
    text-decoration: underline;
}
.beigetragen-info {
    font-size: 0.82rem;
    color: #555;
    margin-top: 0.15rem;
}
.beigetragen-dialog {
    max-width: 720px;
    width: 100%;
}
.beigetragen-dialog section {
    margin-bottom: 1rem;
}
.beigetragen-dialog h4 {
    margin: 0.5rem 0 0.35rem;
    font-size: 0.95rem;
}
.beigetragen-dialog .empty {
    color: #888;
    font-style: italic;
    font-size: 0.85rem;
}
.beigetragen-dialog ul {
    margin: 0;
    padding-left: 1.15rem;
}

/* ==================================================================
   Datenart-Chip (Tabelle/Kacheln)
   ================================================================== */
.datenart-chip {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.5;
    background: #e3e3e3;
    color: #333;
    white-space: nowrap;
}
.datenart-chip.datenart-foto  { background: #d7e7ff; color: #174b91; }
.datenart-chip.datenart-poi   { background: #ffe7c2; color: #8a4b00; }
.datenart-chip.datenart-punkt { background: #d6f0d6; color: #2b5b2b; }
.datenart-chip.datenart-route { background: #f0dcff; color: #5d247d; }
.datenart-chip.datenart-text  { background: #ececec; color: #555; }

.datenpool-thumb {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 4px;
    background: #eee;
    display: inline-block;
    vertical-align: middle;
}
.datenpool-thumb-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 4px;
    background: #f0f0f0;
    color: #aaa;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    vertical-align: middle;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 0.75rem 0 0.25rem;
    font-size: 0.88rem;
}
.pagination-bar button {
    padding: 0.3rem 0.7rem;
    border: 1px solid #bbb;
    background: #f5f5f5;
    border-radius: 4px;
    cursor: pointer;
}
.pagination-bar button:disabled {
    opacity: 0.45;
    cursor: default;
}

/* Premium-Marker (Leaflet divIcon) — kein weisser Hintergrund, kein Rahmen */
.entdecker-marker, .route-start-marker {
    background: transparent !important;
    border: none !important;
}
.entdecker-marker svg, .route-start-marker svg {
    display: block;
    overflow: visible;
}

/* Disclaimer-Popup ─────────────────────────────────────────── */
.disclaimer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 30, 45, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: disclaimer-fade-in 180ms ease-out;
}
.disclaimer-modal {
    background: var(--color-bg-card, #ffffff);
    color: var(--color-text, #1a1a1a);
    border-radius: 14px;
    border-top: 4px solid var(--color-info, var(--color-primary));
    padding: 1.75rem 1.5rem 1.5rem;
    max-width: 460px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    text-align: center;
    animation: disclaimer-pop-in 220ms cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
.disclaimer-icon {
    font-size: 2.4rem;
    line-height: 1;
    margin-bottom: 0.5rem;
}
.disclaimer-title {
    font-size: 1.25rem;
    margin: 0 0 0.75rem;
    color: var(--color-primary-dark, var(--color-primary));
}
.disclaimer-body {
    text-align: left;
    font-size: 0.97rem;
    line-height: 1.55;
    margin-bottom: 1.25rem;
    color: var(--color-text);
}
.disclaimer-body p:first-child { margin-top: 0; }
.disclaimer-body p:last-child { margin-bottom: 0; }
.disclaimer-body a {
    color: var(--color-primary);
    text-decoration: underline;
}
.disclaimer-close {
    min-width: 140px;
}
@keyframes disclaimer-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes disclaimer-pop-in {
    from { opacity: 0; transform: translateY(8px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Blog-Kachel-Grid ────────────────────────────────────────────────────── */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    margin: 0 0 2rem;
}
@media (max-width: 860px) {
    .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
}
@media (max-width: 540px) {
    .blog-grid { grid-template-columns: 1fr; gap: 1rem; }
}

/* Kachel — als <div> mit Cover-Link (nested <a> inside <a> ist invalid HTML) */
.blog-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--color-bg-card, #fff);
    border: 1px solid var(--color-border, #e0e0e0);
    border-radius: 10px;
    overflow: hidden;
    color: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
}
.blog-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.12); }
/* Cover-Link macht die ganze Kachel klickbar */
.blog-card-link {
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: 10px;
}
/* Tags über dem Cover-Link */
.blog-card-tag {
    position: relative;
    z-index: 1;
}

/* Bild */
.blog-card-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}
.blog-card-img-empty {
    width: 100%;
    aspect-ratio: 16 / 9;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    background: linear-gradient(135deg, #e8f5e9, #d4edda);
    color: #2d6a4f;
}

/* Text-Bereich */
.blog-card-body {
    padding: 1rem 1.1rem 1.1rem;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.blog-card-meta {
    font-size: 0.75rem;
    color: var(--color-text-muted, #777);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.blog-card-cat {
    background: #e8f5e9;
    color: #1b4332;
    font-weight: 600;
    padding: 0.1rem 0.5rem;
    border-radius: 20px;
    font-size: 0.7rem;
    white-space: nowrap;
}
.blog-card-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--color-primary-dark, #1b4332);
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.blog-card-excerpt {
    font-size: 0.84rem;
    color: var(--color-text-light, #555);
    line-height: 1.5;
    margin: 0;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.blog-card-tags {
    margin-top: auto;
    padding-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.blog-card-tag {
    font-size: 0.7rem;
    color: var(--color-text-muted, #888);
    text-decoration: none;
    padding: 0.1rem 0.4rem;
    border: 1px solid var(--color-border, #ddd);
    border-radius: 20px;
}
.blog-card-tag:hover { border-color: #1b4332; color: #1b4332; }

/* Pagination */
.blog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin: 1rem 0 3rem;
}
.blog-pagination button,
.blog-pagination .page-info {
    background: transparent;
    border: 1px solid var(--color-border, #d0d0d0);
    border-radius: 6px;
    padding: 0.45rem 0.85rem;
    font: inherit;
    cursor: pointer;
    color: inherit;
}
.blog-pagination button:hover:not(:disabled) {
    border-color: var(--color-primary-dark, #1b4332);
    color: var(--color-primary-dark, #1b4332);
}
.blog-pagination button[aria-current="page"] {
    background: var(--color-primary-dark, #1b4332);
    color: #fff;
    border-color: var(--color-primary-dark, #1b4332);
}
.blog-pagination button:disabled { opacity: 0.4; cursor: default; }
.blog-pagination .page-info { border: 0; cursor: default; padding: 0.45rem 0.5rem; color: var(--color-text-muted, #666); }

/* Sortierbare Tabellenkoepfe (Verwaltung-Benutzerliste) */
.sortable-th {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.sortable-th:hover {
    background: var(--color-bg, #f5f5f5);
}
.sortable-th .sort-arrow {
    font-size: 0.75em;
    margin-left: 0.15em;
}

/* ===== Blog-Beitraege: Typografie für Markdown-gerenderte Inhalte ===== */
.blog-body {
    line-height: 1.7;
    font-size: 1rem;
    color: var(--color-text);
}

/* Absaetze: spuerbarer Abstand zwischen Bloecken */
.blog-body p {
    margin: 0 0 1.1rem;
}
.blog-body p:last-child { margin-bottom: 0; }

/* Ueberschriften */
.blog-body h2 {
    margin: 2rem 0 0.75rem;
    line-height: 1.25;
    font-size: 1.4rem;
    color: var(--color-primary-dark);
}
.blog-body h3 {
    margin: 1.6rem 0 0.5rem;
    line-height: 1.3;
    font-size: 1.15rem;
    color: var(--color-primary-dark);
}
.blog-body h4 {
    margin: 1.3rem 0 0.4rem;
    line-height: 1.3;
    font-size: 1rem;
    color: var(--color-primary-dark);
}
.blog-body h2:first-child,
.blog-body h3:first-child,
.blog-body h4:first-child { margin-top: 0; }

/* Listen — sichtbar eingerueckt, mit Abstand zwischen Punkten */
.blog-body ul,
.blog-body ol {
    margin: 0 0 1.1rem;
    padding-left: 1.6rem;
}
.blog-body li {
    margin: 0.4rem 0;
}
.blog-body li > p {
    margin: 0 0 0.4rem;
}
.blog-body li > ul,
.blog-body li > ol {
    margin: 0.4rem 0 0.4rem;
}

/* Blockquote als deutlich abgesetzter Zitat-Block */
.blog-body blockquote {
    margin: 1.25rem 0;
    padding: 0.4rem 1rem;
    border-left: 4px solid var(--color-accent, #d4a373);
    background: rgba(0, 0, 0, 0.02);
    color: var(--color-text-light, #555);
    font-style: italic;
}
.blog-body blockquote p { margin: 0.5rem 0; }

/* Inline-Code + Code-Bloecke */
.blog-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.92em;
    background: rgba(0, 0, 0, 0.06);
    padding: 0.1em 0.35em;
    border-radius: 4px;
}
.blog-body pre {
    margin: 1.1rem 0;
    padding: 0.85rem 1rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    overflow-x: auto;
    line-height: 1.5;
}
.blog-body pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: 0.9em;
}

/* Inline-Bilder */
.blog-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
    display: block;
}

/* Tabellen */
.blog-body table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.25rem 0;
    font-size: 0.95rem;
}
.blog-body th,
.blog-body td {
    border: 1px solid var(--color-border);
    padding: 0.5rem 0.75rem;
    text-align: left;
}
.blog-body th {
    background: rgba(0, 0, 0, 0.04);
    font-weight: 600;
}

/* Trennlinien */
.blog-body hr {
    margin: 2rem 0;
    border: none;
    border-top: 1px solid var(--color-border);
}

/* Links */
.blog-body a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 0.15em;
    text-decoration-thickness: 1px;
}
.blog-body a:hover {
    text-decoration-thickness: 2px;
}

/* Hervorhebungen */
.blog-body strong { font-weight: 600; }
.blog-body em { font-style: italic; }

/* Sehr kurze Absaetze ohne grossen Folgenabstand (z. B. einzelne Zeile zwischen Absaetzen) */
.blog-body br + br { line-height: 0.5; }

/* Auf Mobile etwas kleinere Ueberschriften */
@media (max-width: 600px) {
    .blog-body h2 { font-size: 1.25rem; margin-top: 1.5rem; }
    .blog-body h3 { font-size: 1.05rem; margin-top: 1.25rem; }
}
