/* Layout: Seitenleiste mit Filter und Liste links, Karte rechts, Detail als Fläche über der Karte. Handy: Karte oben, Leiste darunter. */
:root {
  --bg: #eef5ef; --surface: #fbfdfa; --fg: #22352d; --muted: #5b7066; --line: #d2e2d6;
  --accent: #1b8a8f; --accent-soft: #d9efef;
  --c-flat: #2f9d6a; --c-mid: #e2a41d; --c-steep: #e0694d; --c-long: #5b70c9; --c-bad: #c0392b;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0f1619; --surface: #172125; --fg: #e6eef0; --muted: #93a7ad; --line: #2a393e; --accent: #6cc0dc; --accent-soft: #1b3038;
    --c-flat: #45c29a; --c-mid: #e8b341; --c-steep: #ef7a62; --c-long: #8e9cf0; --c-bad: #ef7a62; color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/1.45 var(--font); }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.app { display: grid; grid-template-columns: 400px minmax(0, 1fr); height: 100%; }
.side { overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--bg); border-right: 1px solid var(--line); min-width: 0; }
h1 { font-size: 1.7rem; line-height: 1.1; margin: 0 0 6px; text-wrap: balance; }
.sub { margin: 0 0 10px; color: var(--muted); }
#q { width: 100%; padding: 9px 11px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; }
.flt { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); padding: 0 12px; }
.flt > summary { cursor: pointer; padding: 10px 0; font-weight: 700; list-style: none; }
.flt > summary::-webkit-details-marker { display: none; }
.flt > summary::before { content: "▸ "; } .flt[open] > summary::before { content: "▾ "; }
#fltn { font-weight: 500; color: var(--accent); margin-left: 6px; }
.fgroup { display: grid; gap: 6px; margin-bottom: 12px; }
.lbl { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 600; }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="false"] { opacity: .5; }
.chip[data-only][aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); opacity: 1; }
.sw { width: 11px; height: 11px; background: var(--sw); flex: none; border-radius: 50%; }
.sw.sq { border-radius: 2px; } .sw.dia { border-radius: 0; clip-path: polygon(50% 0,100% 50%,50% 100%,0 50%); width: 14px; height: 14px; }
.sw.hex { border-radius: 0; clip-path: polygon(25% 4%,75% 4%,100% 50%,75% 96%,25% 96%,0 50%); width: 13px; height: 13px; }
.ef { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.ef input[type=number], .ef select, #dlg input, #dlg select { padding: 6px 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; }
.ef input[type=number] { width: 70px; }
.chk { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.btn { padding: 8px 14px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; cursor: pointer; font-weight: 700; }
.btn:hover { border-color: var(--accent); } .btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
#imp input[type=file] { margin-bottom: 12px; max-width: 100%; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.item { display: grid; grid-template-columns: 30px 1fr; gap: 10px; width: 100%; text-align: left; padding: 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; cursor: pointer; }
.item:hover, .item[aria-current="true"] { border-color: var(--accent); background: var(--accent-soft); }
.item .num { width: 30px; height: 30px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; background: var(--sw); }
.num.circ { border-radius: 50%; } .num.sq { border-radius: 5px; } .num.dia { transform: rotate(45deg); border-radius: 4px; } .num.dia b { transform: rotate(-45deg); font-weight: 700; } .num.hex { clip-path: polygon(25% 3%,75% 3%,100% 50%,75% 97%,25% 97%,0 50%); }
.item .t { font-weight: 700; display: block; } .item .m, .item .r, .item .g { display: block; font-size: 13px; color: var(--muted); }
.item .g { color: var(--accent); font-weight: 600; }
.foot { color: var(--muted); font-size: 12px; padding-bottom: 12px; }
.mapwrap { position: relative; min-width: 0; }
#map { position: absolute; inset: 0; }
.maptools { position: absolute; top: 10px; left: 10px; right: 56px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 8px 10px; background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line); border-radius: 8px; width: fit-content; max-width: calc(100% - 66px); z-index: 2; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { padding: 6px 10px; border: 0; background: transparent; cursor: pointer; font-size: 13px; font-weight: 600; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; } .seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.sidetoggle { display: none; }
.detail { position: absolute; z-index: 3; left: 10px; bottom: 28px; width: min(400px, calc(100% - 20px)); max-height: 62%; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; box-shadow: 0 6px 24px rgba(20,40,30,.2); }
.detail h2 { margin: 0 28px 2px 0; font-size: 1.25rem; line-height: 1.15; }
.detail .close { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border: 0; background: transparent; font-size: 22px; cursor: pointer; border-radius: 50%; }
.detail .close:hover { background: var(--accent-soft); }
.detail .rg { color: var(--muted); margin: 0 0 8px; }
.stats { display: flex; gap: 18px; margin: 8px 0; } .stats div { display: grid; } .stats dt { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); } .stats dd { margin: 0; font-weight: 700; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; } .tag { font-size: 12px; font-weight: 600; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; }
.facts { padding-left: 18px; margin: 8px 0; display: grid; gap: 4px; }
.prof { width: 100%; height: auto; } .prof .pa { fill: var(--accent); opacity: .22; } .prof .pl { fill: none; stroke: var(--accent); stroke-width: 2; } .prof .pax { stroke: var(--line); } .prof text { font-size: 10px; fill: var(--muted); }
.box { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 8px; } .box h3 { font-size: .95rem; margin: 0 0 4px; } .box h3 span { font-weight: 400; color: var(--muted); font-size: 12px; }
.box ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; } .rt { font-weight: 700; color: var(--rc); } .rm { display: block; font-size: 13px; color: var(--muted); }
.pbar { display: block; position: relative; height: 6px; background: var(--line); border-radius: 3px; margin: 3px 0; } .pbar i { display: block; height: 100%; border-radius: 3px; } .pbar u { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--fg); }
.none { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; align-items: center; } .links .btn { padding: 6px 12px; }
.msg { font-size: 13px; color: var(--muted); }
dialog { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--fg); max-width: 420px; width: calc(100% - 32px); } dialog::backdrop { background: rgba(0,0,0,.4); }
dialog label { display: grid; gap: 4px; margin-bottom: 10px; font-weight: 600; } dialog .row { display: flex; gap: 8px; justify-content: flex-end; }
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: 48vh minmax(0, 1fr); }
  .mapwrap { order: -1; } .side { border-right: 0; border-top: 1px solid var(--line); }
  .detail { position: fixed; left: 0; right: 0; bottom: 0; width: auto; max-height: 46%; border-radius: 12px 12px 0 0; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
}
