:root {
    --braun: #6b4f3a;
    --gruen: #2e8b3e;
    --gelb: #d4a017;
    --rot: #c0392b;
    --grau: #8a8a8a;
    --bg: #faf8f5;
    --text: #1a1a1a;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: var(--braun);
    color: #fff;
    flex-wrap: wrap;
}

.topbar h1 {
    font-size: 1.05rem;
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.topbar-sub {
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.85;
}

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

.btn {
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-family: inherit;
}

.btn-ghost {
    background: rgba(255,255,255,0.15);
    color: #fff;
}
.btn-ghost:hover { background: rgba(255,255,255,0.28); }

.btn-primary {
    background: var(--braun);
    color: #fff;
    width: 100%;
    padding: 12px;
    font-weight: 600;
}
.btn-primary:hover { opacity: 0.9; }

#map {
    position: absolute;
    top: 54px;
    bottom: 0;
    left: 0;
    right: 0;
}

.legend {
    position: absolute;
    bottom: 16px;
    left: 16px;
    z-index: 500;
    background: #fff;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.78rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    line-height: 1.6;
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}
.dot-green  { background: var(--gruen); }
.dot-red    { background: var(--rot); }
.dot-yellow { background: var(--gelb); }
.dot-gray   { background: var(--grau); }

.status-bar {
    position: absolute;
    top: 62px;
    right: 16px;
    z-index: 500;
    background: rgba(255,255,255,0.92);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.75rem;
    color: #555;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ── Marker ── */
.site-marker { position: relative; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,0.4); }
.site-marker-green  { background: var(--gruen); }
.site-marker-red    { background: var(--rot); }
.site-marker-yellow { background: var(--gelb); }
.site-marker-gray   { background: var(--grau); }
.site-marker-badge {
    position: absolute;
    top: -9px;
    right: -9px;
    font-size: 11px;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.6));
}

.popup-body { font-size: 0.85rem; }
.popup-body h3 { margin: 0 0 4px; font-size: 0.95rem; }
.popup-meta { color: #666; margin: 4px 0; }
.popup-classic-badge { color: var(--braun); font-weight: 600; margin: 4px 0; }
.popup-website-link { color: var(--braun); text-decoration: underline; }
.popup-actions { display: flex; gap: 8px; margin-top: 8px; }
.popup-route-link,
.popup-report-btn {
    flex: 1;
    text-align: center;
    border: none;
    border-radius: 6px;
    padding: 8px;
    font-size: 0.82rem;
    cursor: pointer;
    text-decoration: none;
}
.popup-report-btn { background: var(--braun); color: #fff; }
.popup-report-btn:hover { opacity: 0.9; }
.popup-route-link { background: var(--grau-1, #f0ede8); color: var(--braun); border: 1px solid var(--braun); }
.popup-route-link:hover { background: #fff; }

.report-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    margin-bottom: 12px;
    cursor: pointer;
}
.report-checkbox input { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-overlay.hidden { display: none; }

.modal {
    background: #fff;
    border-radius: 14px;
    padding: 22px;
    width: 100%;
    max-width: 380px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    border: none;
    background: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: #888;
    line-height: 1;
}

.modal h2 { margin: 0 0 4px; font-size: 1.1rem; }
.report-site-name { color: #666; font-size: 0.85rem; margin: 0 0 14px; }

.status-choice {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.status-btn {
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
    text-align: left;
}
.status-btn-green  { background: var(--gruen); }
.status-btn-yellow { background: var(--gelb); }
.status-btn-red    { background: var(--rot); }
.status-btn.selected { outline: 3px solid #333; }

#report-note {
    width: 100%;
    min-height: 60px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px;
    font-family: inherit;
    font-size: 0.85rem;
    resize: vertical;
    margin-bottom: 12px;
}

#passphrase-field { margin-bottom: 14px; }
#passphrase-field label { display: block; font-size: 0.78rem; color: #666; margin-bottom: 4px; }
#passphrase-field input {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 9px;
    font-size: 0.9rem;
}

.report-feedback {
    margin: 10px 0 0;
    font-size: 0.82rem;
    min-height: 1.2em;
}
.report-feedback.error   { color: var(--rot); }
.report-feedback.success { color: var(--gruen); }

@media (max-width: 480px) {
    .topbar h1 { font-size: 0.95rem; }
    .legend { font-size: 0.72rem; padding: 8px 10px; }
}
