:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #f0eee8;
  --text: #1d1c1a;
  --muted: #6a675f;
  --line: #e0ddd4;
  --accent: #1f5f8b;
  --accent-ink: #ffffff;
  --hi: #c2410c;
  --hi-bg: #fdeee3;
  --no: #1f5f8b;
  --no-bg: #e6f0f7;
  --lo: #6b6b66;
  --lo-bg: #ececE8;
  --good: #2f7d4f;
  --warn-bg: #fff6dd;
  --warn-line: #ecd98f;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161715;
    --surface: #202220;
    --surface-2: #2a2c29;
    --text: #ecebe6;
    --muted: #a09d94;
    --line: #34362f;
    --accent: #6db3e0;
    --accent-ink: #0f1a22;
    --hi: #ff9a62;
    --hi-bg: #3a2418;
    --no: #6db3e0;
    --no-bg: #1b2a35;
    --lo: #a3a39d;
    --lo-bg: #2c2d2a;
    --good: #6fcf97;
    --warn-bg: #352f18;
    --warn-line: #5b5020;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { color-scheme: light dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
h1, h2, h3 { margin: 0; line-height: 1.2; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Kopf */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-inner { position: relative; max-width: 1280px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.brand { min-width: 0; }
.brand h1 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.sub b { color: var(--text); font-weight: 600; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.banner { max-width: 1280px; margin: 0 auto; padding: 8px 16px; font-size: 13px; background: var(--warn-bg); border-top: 1px solid var(--warn-line); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.banner[hidden] { display: none; }

/* Buttons */
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 14px; cursor: pointer; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: default; }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font-size: 13px; text-decoration: underline; }

/* Layout */
.layout { max-width: 1280px; margin: 0 auto; padding: 16px; display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; }
.filters-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.filters h2 { font-size: 15px; }
.field { display: block; border: 0; padding: 0; margin: 0 0 12px; min-width: 0; }
.field > span, .field > legend, .facet > summary { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; padding: 0; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 7px 9px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; margin: 4px 0; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 4px 11px; cursor: pointer; font-size: 13px; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.facet { border-top: 1px solid var(--line); padding: 8px 0 2px; }
.facet > summary { cursor: pointer; margin-bottom: 6px; }
.facet .opts { max-height: 180px; overflow: auto; padding-bottom: 6px; }
.facet .on-badge { color: var(--accent); }

/* Werkzeugleiste */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 3px; border-radius: 10px; margin-right: auto; }
.tabs button { border: 0; background: none; padding: 7px 12px; border-radius: 8px; cursor: pointer; color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 600; }
.count { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 2px; }
.sortbox { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.sortbox select { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 8px; }
.show-mobile { display: none; }
.result-line { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 13px; margin: 0 2px 8px; min-height: 28px; }
.bulk { position: relative; }
.bulk summary { cursor: pointer; color: var(--accent); }
.bulk-menu { position: absolute; right: 0; top: 24px; z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 4px; display: grid; min-width: 220px; box-shadow: 0 6px 20px rgb(0 0 0 / 0.15); }
.bulk-menu button { text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.bulk-menu button:hover { background: var(--surface-2); }

/* Liste */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 14px; box-shadow: var(--shadow); }
.card[data-prio="hi"] { border-left-color: var(--hi); }
.card[data-prio="no"] { border-left-color: var(--no); }
.card[data-prio="lo"] { border-left-color: var(--lo); }
.thumb { width: 84px; height: 84px; border-radius: 8px; background: var(--surface-2); object-fit: cover; display: block; }
.thumb.ph { display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.card h3 { font-size: 16px; }
.card h3 .tag { font-size: 11px; font-weight: 600; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); vertical-align: middle; }
.pub { color: var(--muted); font-size: 13px; margin: 1px 0 6px; }
.facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; }
.facts span { white-space: nowrap; }
.facts .k { color: var(--muted); }
.loc a { text-decoration: none; border-bottom: 1px dotted var(--accent); }
.card details { margin-top: 8px; font-size: 13px; }
.card details summary { cursor: pointer; color: var(--accent); width: fit-content; }
.card .desc { white-space: pre-line; margin: 8px 0 6px; color: var(--text); max-width: 70ch; }
.card .meta { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; color: var(--muted); }
.card .meta b { font-weight: 600; color: var(--muted); }
.card .meta span { color: var(--text); }
.side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; min-width: 150px; }
.bgg { text-align: right; font-size: 12px; color: var(--muted); }
.bgg .score { display: inline-block; min-width: 46px; text-align: center; font-weight: 700; font-size: 16px; padding: 3px 8px; border-radius: 8px; color: #fff; background: var(--s, #888); text-decoration: none; }
.bgg .score.none { background: var(--surface-2); color: var(--muted); font-weight: 400; font-size: 13px; }
.bgg .votes { display: block; margin-top: 2px; }
.bgg .fuzzy { cursor: help; border-bottom: 1px dotted currentColor; }
.prio { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.prio button { border: 0; background: var(--surface); padding: 6px 9px; cursor: pointer; font-size: 13px; border-left: 1px solid var(--line); }
.prio button:first-child { border-left: 0; }
.prio button:hover { background: var(--surface-2); }
.prio button[aria-pressed="true"][data-p="hi"] { background: var(--hi-bg); color: var(--hi); font-weight: 600; }
.prio button[aria-pressed="true"][data-p="no"] { background: var(--no-bg); color: var(--no); font-weight: 600; }
.prio button[aria-pressed="true"][data-p="lo"] { background: var(--lo-bg); color: var(--lo); font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.more { display: block; margin: 16px auto; }
.foot { max-width: 1280px; margin: 0 auto; padding: 8px 16px 32px; color: var(--muted); font-size: 12px; }

/* Dialoge */
dialog { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); }
dialog::backdrop { background: rgb(0 0 0 / 0.45); }
.dlg { padding: 18px; display: grid; gap: 12px; }
.dlg h2 { font-size: 18px; }
.hint { margin: 0; color: var(--muted); font-size: 13px; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 22px 12px; text-align: center; display: grid; gap: 4px; cursor: pointer; background: var(--bg); }
.drop span { color: var(--muted); font-size: 13px; }
.drop.over, .drop:focus-visible { border-color: var(--accent); background: var(--no-bg); }
.status { margin: 0; font-size: 13px; min-height: 18px; }
.status.ok { color: var(--good); }
.status.err { color: var(--hi); }
.dlg-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.qr-wrap { display: grid; place-items: center; background: #fff; border-radius: 10px; padding: 8px; }
.qr-wrap canvas { width: min(100%, 440px); height: auto; image-rendering: pixelated; }
.raw summary { cursor: pointer; font-size: 13px; color: var(--accent); }
.raw textarea { margin-top: 6px; font: 12px ui-monospace, monospace; width: 100%; }

/* Schmale Bildschirme */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; padding: 12px; }
  .filters { display: none; position: static; max-height: none; }
  .filters.open { display: block; }
  .show-mobile { display: inline-block; }
  .card { grid-template-columns: 64px minmax(0, 1fr); }
  .thumb { width: 64px; height: 64px; }
  .side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .top-inner { padding: 8px 12px; }
  .brand h1 { font-size: 16px; }
  .sub { font-size: 12px; }
}

/* ---------- Gruppe ---------- */
.muted { color: var(--muted); font-size: 12px; }
.me { font-size: 13px; color: var(--muted); align-self: center; }
.checkin-banner { background: var(--no-bg); border-top-color: var(--no); justify-content: space-between; }
.fh { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 14px 0 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.field select { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 7px 9px; }

.gbadge { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12px; }
.gavg { font-weight: 600; color: var(--accent); }
.here { color: var(--good); font-weight: 600; }

.checkin { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13px; margin-top: 8px; }
.checkin.on { color: var(--good); }
.checkin .others { color: var(--muted); }

.group { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 8px; }
.group > summary { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.gsum { color: var(--muted); font-weight: 400; }
.gbody { display: grid; gap: 14px; margin-top: 10px; }
.gmine { display: grid; gap: 8px; background: var(--surface-2); border-radius: 10px; padding: 10px; }
.glabel { font-weight: 600; font-size: 12px; color: var(--muted); }
.gmine textarea { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 9px; resize: vertical; }
.rate { display: flex; flex-wrap: wrap; gap: 4px; }
.rate button { min-width: 34px; height: 34px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; cursor: pointer; }
.rate button:hover { background: var(--bg); }
.rate button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.flags { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.pickup { display: grid; gap: 6px; border-top: 1px dashed var(--line); padding-top: 8px; }
.share { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.gothers { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 10px; }
.ghead { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.chip-r { font-weight: 600; color: var(--accent); }
.gcomment { margin: 2px 0 0; white-space: pre-wrap; max-width: 70ch; }
.gpickup { margin: 2px 0 0; background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 8px; padding: 4px 8px; white-space: pre-wrap; }

.who { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.who-actions { display: flex; gap: 14px; font-size: 13px; }
.history { display: grid; gap: 4px; max-height: 55vh; overflow: auto; }
.hday { font-size: 13px; color: var(--muted); margin: 10px 0 2px; }
.hrow { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); }
.hmain { display: grid; }
.hact { display: flex; gap: 10px; align-items: center; }
.hedit { grid-column: 1 / -1; display: flex; gap: 12px; flex-wrap: wrap; }
.hedit input { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 6px; }
.htime { font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { .hrow { grid-template-columns: 1fr auto; } .htime { grid-column: 1 / -1; } }

/* Leiste „gekauft“ / „reserviert“ oben auf der Karte */
:root { --buy: #2f7d4f; --res: #b45309; }
.flagbar { grid-column: 1 / -1; margin: -12px -12px 2px -8px; border-radius: 6px 9px 0 0; overflow: hidden; }
.flagrow { padding: 7px 14px; color: #fff; font-size: 14px; line-height: 1.35; }
.flagrow b { letter-spacing: 0.05em; font-weight: 800; }
.flagrow.buy { background: var(--buy); }
.flagrow.res { background: var(--res); }
.flagrow .pu { white-space: pre-line; font-weight: 600; }
.flagrow .hidden-info { opacity: 0.85; font-style: italic; }

/* Burger-Menü */
.btn.icon { padding: 0; width: 40px; height: 36px; display: grid; place-items: center; }
.top-actions .btn.small { white-space: nowrap; }
.menu { position: absolute; right: 12px; top: calc(100% + 4px); z-index: 30; width: min(320px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: 0 10px 30px rgb(0 0 0 / 0.2); display: grid; gap: 2px; }
.menu[hidden] { display: none; }
.menu-user { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 8px 10px; }
.menu-user:empty, .menu-user:not(:has(:not([hidden]))) { display: none; }
.menu-user .me { color: var(--text); font-size: 14px; }
.menu-item { text-align: left; background: none; border: 0; border-radius: 8px; padding: 12px 10px; font-size: 15px; cursor: pointer; width: 100%; }
.menu-user .menu-item { width: auto; padding: 4px 8px; }
.menu-item:hover { background: var(--surface-2); }
.menu-item[hidden] { display: none; }
.menu-bgg { border-top: 1px solid var(--line); margin-top: 4px; padding: 10px; display: grid; gap: 6px; justify-items: start; }
.menu-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.menu-note { margin: 0; font-size: 13px; color: var(--muted); }
