:root {
  --bg: #ffffff;
  --surface: #f5f7f9;
  --text: #1b1f24;
  --muted: #5b6672;
  --border: #d9dee4;
  --accent: #0e7c66;
  --accent-text: #ffffff;
  --ok: #1a7f37;
  --err: #c62828;
  --radius: 10px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1419;
    --surface: #182029;
    --text: #e6edf3;
    --muted: #9aa7b4;
    --border: #2d3742;
    --accent: #3fbf9f;
    --accent-text: #0f1419;
    --ok: #3fb950;
    --err: #ff6b6b;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: 820px; margin: 0 auto; padding: 0 16px; }
.site-header { border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: 16px; min-height: 56px; padding-top: 6px; padding-bottom: 6px; }
.brand { font-weight: 700; font-size: 19px; text-decoration: none; color: var(--text); }
.site-header nav { display: flex; flex-wrap: wrap; column-gap: 16px; }
.site-header nav a { display: inline-block; padding: 6px 0; text-decoration: none; color: var(--muted); }
.site-footer { border-top: 1px solid var(--border); margin-top: 64px; color: var(--muted); font-size: 15px; }
.site-footer .wrap { padding-top: 16px; padding-bottom: 32px; }
h1 { font-size: 34px; line-height: 1.2; margin: 24px 0 8px; }
/* Long single words (e.g. German "Datenschutzerklärung") must not push the page wider than a phone */
h1, h2, h3 { overflow-wrap: break-word; hyphens: auto; }
h2 { font-size: 24px; margin: 40px 0 8px; }
h3 { font-size: 19px; margin: 24px 0 4px; }
.lead { font-size: 19px; color: var(--muted); margin-top: 0; }
.lead.answer { font-size: 17px; }
.breadcrumbs { font-size: 14px; color: var(--muted); margin-top: 16px; }
.breadcrumbs a { color: var(--muted); }

/* Guides */
.updated { color: var(--muted); font-size: 14px; margin-top: -8px; }
.guide-toc ol { padding-left: 20px; }
.guide pre { background: var(--surface); border-radius: 6px; padding: 12px; overflow-x: auto; font-size: 13px; line-height: 1.5; white-space: pre; max-width: 100%; }
.guide-list li { margin-bottom: 14px; }
.guide-list span { color: var(--muted); font-size: 15px; }

/* ---------- GeoDrafter: full-screen map with a tool panel (mobile first) ---------- */
.site-header.wide .wrap, .site-footer.wide .wrap { max-width: none; }
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand svg { flex: none; }
.tool-app { display: flex; flex-direction: column; }
.tool-app .map { position: relative; width: 100%; height: 58svh; min-height: 300px; background: #e8eef2; }
.tool-app .panel { padding: 12px 16px 4px; background: var(--bg); }
.panel h1 { font-size: 26px; margin: 8px 0 6px; }
.panel .breadcrumbs { margin-top: 0; }
.panel .lead.answer { font-size: 15px; line-height: 1.5; }
.panel .status { font-size: 15px; }
.controls { display: grid; gap: 10px; margin: 12px 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.row .field { margin: 0; flex: 1 1 120px; min-width: 0; }
.field input, .field select { width: 100%; max-width: none; padding: 8px 10px; font: inherit; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); }
.field label, .field .label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 3px; }
.field small { display: block; color: var(--muted); font-size: 13px; }
.field.check label { font-weight: 400; display: flex; gap: 6px; align-items: center; }
.field.check input { width: auto; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.btn { display: inline-block; padding: 9px 14px; border: 0; border-radius: 8px; cursor: pointer; background: var(--accent); color: var(--accent-text); font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn-quiet { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.hint { color: var(--muted); font-size: 14px; margin: 6px 0; }
.status { min-height: 1.4em; margin: 8px 0 0; }
.status.error { color: var(--err); }
.status.ok { color: var(--ok); }
.shape-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.shape-list li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 14px; }
.shape-list .swatch { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.shape-list .name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.icon-btn { flex: none; width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; cursor: pointer; line-height: 1; }
.search { position: relative; }
.search ul { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; margin: 2px 0 0; padding: 4px 0; list-style: none; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.15); max-height: 280px; overflow: auto; }
.search li { padding: 6px 10px; cursor: pointer; font-size: 15px; }
.search li small { color: var(--muted); }
.search li[aria-selected="true"], .search li:hover { background: var(--surface); }
.result { font-variant-numeric: tabular-nums; }
.result dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 6px 0; font-size: 15px; }
.result dt { color: var(--muted); }
.result dd { margin: 0; overflow-wrap: anywhere; }
.map-attr { font-size: 13px; color: var(--muted); margin: 6px 0 10px; }
.map-attr a { color: var(--muted); }
.report-problem { margin: 8px 0 12px; font-size: 13px; color: var(--muted); }
.tool-app .maplibregl-ctrl-attrib a { color: #222; text-decoration: underline; }
.content { padding-top: 8px; }
.ad-slot { min-height: 280px; margin: 32px 0; }
@media (min-width: 900px) {
  .tool-app { position: relative; height: calc(100svh - 57px); min-height: 520px; }
  .tool-app .map { position: absolute; inset: 0; height: auto; }
  .tool-app .panel { position: absolute; z-index: 2; top: 12px; left: 12px; bottom: 12px; width: 380px; overflow-y: auto;
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0,0,0,.18); }
}
.shape-list li { cursor: pointer; }
.shape-list li.active { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.handle { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid #0e7c66; box-shadow: 0 1px 4px rgba(0,0,0,.35); cursor: grab; }
.handle-centre { width: 16px; height: 16px; background: #0e7c66; border-color: #fff; }
.handle:active { cursor: grabbing; }
@media (max-width: 899px) {
  /* The answer stays in the page (search engines, screen readers) but takes three lines until tapped */
  .panel .lead.answer:not(.open) { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
  .panel .lead.answer:not(.open)::after { content: ""; }
}
.handle-point { width: 22px; height: 22px; border-width: 2px; font: 700 11px/18px system-ui, sans-serif; text-align: center; color: #0e7c66; }
.status.warn { color: #b35c00; }
main p, main li { overflow-wrap: break-word; }
.source p, .source li { overflow-wrap: anywhere; }
.field textarea { width: 100%; padding: 8px 10px; font: 15px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); resize: vertical; }
.coord-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.coord-table th, .coord-table td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
.coord-table th { color: var(--muted); font-weight: 600; width: 34%; }
.coord-table .err { color: var(--err); }
.copy { margin-left: 6px; padding: 0 6px; font: inherit; font-size: 12px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text); cursor: pointer; }
.point-block { margin: 0 0 10px; }
.point-block h3 { font-size: 15px; margin: 8px 0 2px; }
/* lat/long finder */
.field .inline { display: flex; gap: 8px; }
.field .inline input { flex: 1 1 auto; min-width: 0; }
.field .inline .btn { flex: none; }
#pointer { font-variant-numeric: tabular-nums; }
@media (hover: none) { #pointer { display: none; } }
