:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1d2330;
  --muted: #667085;
  --line: #e3e6eb;
  --accent: #1f6feb;
  --accent-text: #ffffff;
  --ok: #1a7f37;
  --warn: #b54708;
  --err: #c0262d;
  --radius: 8px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: var(--text);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); }
body { display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 600; margin-right: auto; }

.layout { flex: 1; display: flex; min-height: 0; }
.sidebar {
  width: 360px; flex-shrink: 0; overflow-y: auto;
  background: var(--panel); border-right: 1px solid var(--line); padding: 16px;
}
.views { flex: 1; position: relative; min-width: 0; display: flex; }
.map, .viewer3d { flex: 1; }
.viewer3d { position: relative; overflow: hidden; }
.viewer3d[hidden] { display: none; }

.layer-panel {
  position: absolute; top: 10px; right: 10px; z-index: 10;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; font-size: 13px;
}

.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.segmented button { border: 0; border-radius: 0; padding: 4px 14px; }
.segmented button.active { background: var(--accent); color: var(--accent-text); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px;
  border: 1px solid var(--line); border-radius: 14px; font-size: 13px; }

@media (max-width: 760px) {
  .layout { flex-direction: column-reverse; }
  .sidebar { width: auto; max-height: 50vh; border-right: 0; border-top: 1px solid var(--line); }
  .views { min-height: 50vh; }
}

h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 13px; margin: 20px 0 8px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.err { color: var(--err); }
.row { display: flex; align-items: center; gap: 8px; }
.row > .grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 8px; }

button, .btn {
  font: inherit; cursor: pointer; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  padding: 6px 12px;
}
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.danger { color: var(--err); }
button.link { border: 0; background: none; color: var(--accent); padding: 0; }
button.icon { border: 0; background: none; padding: 2px 6px; font-size: 14px; color: var(--muted); }
button.icon:hover:not(:disabled) { background: var(--bg); color: var(--text); }
button.icon.danger:hover:not(:disabled) { color: var(--err); }
button:disabled { opacity: .5; cursor: default; }

input[type=text], input[type=email], input[type=password] {
  font: inherit; width: 100%; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: var(--radius);
}

.list { list-style: none; margin: 0; padding: 0; }
.list li {
  padding: 10px; border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 8px; cursor: pointer;
}
.list li:hover { border-color: #c4cad3; }
.list li.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.badge { font-size: 11px; padding: 1px 6px; border-radius: 10px; background: var(--bg); color: var(--muted); }
.badge.ok { color: var(--ok); }
.badge.warn { color: var(--warn); }
.badge.err { color: var(--err); }

.stats { width: 100%; border-collapse: collapse; }
.stats td { padding: 3px 0; border-bottom: 1px solid var(--line); }
.stats td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.stats tr.main td { font-weight: 600; font-size: 15px; }

.edit-box { margin-top: 12px; padding: 12px; border: 1px solid var(--accent); border-radius: var(--radius); }

.report-img { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); margin-top: 8px; }

.upload { display: grid; grid-template-columns: 70px 1fr; gap: 6px 8px; align-items: center; }
.progress { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); width: 0; }

.poly-label {
  background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: 4px;
  font-size: 12px; padding: 1px 5px; box-shadow: none;
}

/* Impressum/Datenschutz-Links in der Kopfzeile und die beiden Rechtsseiten */
.legal-links { display: flex; gap: 12px; font-size: 12px; }
.legal-links a { color: var(--muted); text-decoration: none; }
.legal-links a:hover { text-decoration: underline; }

body.legal-page { display: block; height: auto; }
.legal {
  max-width: 760px; margin: 0 auto; padding: 32px 16px 64px;
  line-height: 1.6; font-size: 15px;
}
.legal h1 { font-size: 24px; margin: 0 0 24px; }
.legal h2 { font-size: 17px; margin: 28px 0 8px; }
.legal p, .legal ul { margin: 0 0 12px; }
.legal a { color: var(--accent); }
.legal .back { display: inline-block; margin-bottom: 24px; font-size: 13px; }
