:root {
  color-scheme: dark;
  --bg: #151216;
  --surface: #211b21;
  --raised: #2c242d;
  --line: #403541;
  --text: #fbf0f3;
  --muted: #c0aeb9;
  --accent: #f0a6bc;
  --action: #6f3046;
  --green: #91d7ac;
  --yellow: #f2d580;
  --orange: #f6ad7d;
  --red: #f795a4;
  --gray: #c3b6c2;
  --radius: 10px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; }
h1, h2, h3, p, dl, dd { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button, select { font: inherit; color: inherit; }
button, select, a { -webkit-tap-highlight-color: transparent; }
button, select { cursor: pointer; }
button:disabled, select:disabled { cursor: wait; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#karte, #preise { scroll-margin-top: 1rem; }

.sr-only, .icon-library, .drink-filter input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 8px;
  left: 12px;
  padding: .6rem .9rem;
  border-radius: var(--radius);
  background: var(--surface);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shell { width: min(100% - 2rem, 76rem); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); background: #191519; }
.header-inner, .site-header nav, .brand { display: flex; align-items: center; }
.header-inner { justify-content: space-between; min-height: 65px; gap: .5rem; }
.brand { gap: .65rem; color: var(--text); text-decoration: none; font-weight: 730; line-height: 1.2; }
.brand img { flex-shrink: 0; }
.brand small { display: block; margin-top: .15rem; color: var(--accent); font-size: .78rem; font-weight: 550; }
.site-header nav { gap: .2rem; }
.site-header nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: .4rem;
  padding: 0 .6rem;
  border-radius: 6px;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 650;
  text-decoration: none;
}
.site-header nav .nav-map { display: none; }
.site-header nav a:hover { background: var(--raised); color: var(--text); }

.section-intro { margin-block: 1.2rem .85rem; }
h1, h2, h3 { line-height: 1.2; }
h1 { font-size: clamp(1.48rem, 5.2vw, 2.3rem); letter-spacing: -.042em; }
h2 { font-size: clamp(1.4rem, 4.5vw, 1.85rem); letter-spacing: -.035em; }
h3 { font-size: 1.03rem; letter-spacing: -.015em; }
.section-intro p { margin-top: .32rem; color: var(--muted); font-size: .88rem; }
.section-intro p:empty { display: none; }

.filter-bar { display: grid; gap: .5rem; margin-bottom: .7rem; }
.drink-filter {
  display: grid;
  grid-template-columns: 1fr 1fr 1.6fr;
  min-width: 0;
  margin: 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.drink-filter label { min-width: 0; }
.drink-filter label > span {
  min-height: 44px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  padding: 0 .6rem;
  font-size: .88rem;
  font-weight: 670;
  color: var(--muted);
  cursor: pointer;
}
.drink-filter input:checked + span { background: var(--action); color: var(--text); }
.drink-filter input[disabled] + span { opacity: .55; cursor: not-allowed; }
.drink-filter input:focus-visible + span { outline: 2px solid var(--accent); }
.drink-filter input:not(:checked):not(:disabled) + span:hover { background: var(--raised); color: var(--text); }
select {
  width: 100%;
  min-height: 44px;
  max-width: 100%;
  padding: .45rem .65rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  font-size: .88rem;
}

.map-frame { border: 1px solid var(--line); border-radius: var(--radius); overflow: clip; background: var(--surface); }
.map-stage { position: relative; min-height: 320px; height: clamp(320px, 47svh, 545px); isolation: isolate; background: #201c24; }
#map { position: absolute; inset: 0; }
#map .maplibregl-canvas:focus-visible { outline-offset: -3px; }

.map-summary {
  position: absolute;
  z-index: 1;
  top: .7rem;
  left: .7rem;
  max-width: calc(100% - 78px);
  padding: .58rem .8rem .64rem;
  border: 1px solid #574353;
  border-radius: 8px;
  background: #211921;
  box-shadow: 0 4px 18px #0005;
  pointer-events: none;
}
.map-summary dt { color: var(--accent); font-size: .8rem; font-weight: 700; }
#map-average { margin-block: .06rem .18rem; font-size: clamp(1.78rem, 6.3vw, 2.55rem); line-height: 1.14; font-weight: 760; }
#map-count, #map-market { color: var(--muted); font-size: .79rem; }
#map-market { color: var(--text); font-weight: 650; }
#map-market:empty { display: none; }

.map-controls {
  position: absolute;
  z-index: 1;
  right: .7rem;
  bottom: .7rem;
  display: grid;
  gap: .4rem;
}
.map-controls button, .icon-button, .stand-route {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
}
.zoom-controls button:first-child { border-radius: 7px 7px 0 0; }
.zoom-controls button:last-child { border-top: 0; border-radius: 0 0 7px 7px; }
.map-controls button:focus-visible { outline-offset: -3px; }
.map-controls button:hover, .icon-button:hover, .stand-route:hover { background: var(--raised); color: var(--accent); }

.map-status {
  position: absolute;
  z-index: 1;
  bottom: .7rem;
  left: .7rem;
  max-width: calc(100% - 78px);
  border-radius: 6px;
  padding: .45rem .55rem;
  background: var(--surface);
  color: var(--text);
  font-size: .85rem;
  pointer-events: none;
}
.map-status:empty { padding: 0; }
.map-fallback {
  position: absolute;
  top: 58%;
  left: 50%;
  width: calc(100% - 2rem);
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--muted);
}
.map-fallback a { display: inline-flex; min-height: 44px; align-items: center; }

.map-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem 1rem; padding: .7rem .75rem; border-top: 1px solid var(--line); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .8rem; color: var(--muted); font-size: .77rem; }
.legend li { display: inline-flex; align-items: center; gap: .35rem; }
.legend b { width: .58rem; height: .58rem; background: var(--band); border-radius: 50%; }
.map-credit { align-self: center; color: var(--muted); font-size: .72rem; }
.map-credit a { color: inherit; text-underline-offset: 2px; }
[data-band="low"] { --band: var(--green); }
[data-band="mid"] { --band: var(--yellow); }
[data-band="high"] { --band: var(--orange); }
[data-band="top"] { --band: var(--red); }
[data-band="unknown"] { --band: var(--gray); }

.price-marker, .market-marker { pointer-events: auto; }
.price-marker {
  min-width: 53px;
  min-height: 44px;
  padding: 4px 7px;
  border: 2px solid var(--band);
  border-radius: 8px;
  background: #201720;
  color: var(--band);
  box-shadow: 0 2px 7px #000a;
  font-size: .82rem;
  font-weight: 780;
  line-height: 1.05;
  white-space: nowrap;
}
.price-marker small { display: block; margin-top: 3px; font-size: .65rem; font-weight: 650; }
.price-marker:hover, .price-marker.is-selected { z-index: 2; background: var(--band); color: #1d141c; }
.market-marker {
  display: inline-flex;
  max-width: 12rem;
  align-items: center;
  gap: .32rem;
  padding: .36rem .56rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: #512538;
  color: #ffe5ea;
  font-size: .8rem;
  font-weight: 700;
  box-shadow: 0 2px 9px #0008;
}
.market-marker .icon { width: 15px; height: 15px; }
.location-dot { width: 16px; height: 16px; border: 2px solid white; border-radius: 50%; background: #5aa5ff; box-shadow: 0 0 0 5px #5aa5ff55; }

.comparison { margin-block: 1.6rem 2rem; }
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.stats-grid > div, .panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stats-grid > div { padding: .68rem .7rem .72rem; }
.stats-grid dt { color: var(--muted); font-size: .79rem; font-weight: 560; }
.stats-grid dd { margin-top: .2rem; color: var(--band, var(--text)); font-weight: 740; font-size: clamp(1.25rem, 5.6vw, 1.875rem); line-height: 1.1; }
#map-average, .stats-grid dd, .stand-price, .detail-prices dd, .detail-total dd { font-variant-numeric: tabular-nums; }

.comparison-grid { display: grid; gap: .75rem; margin-top: .85rem; }
.panel { min-width: 0; }
.panel-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .45rem; padding: .65rem .75rem; }
.stand-panel .panel-heading { min-height: 62px; border-bottom: 1px solid var(--line); }
.panel-heading select { background: var(--raised); }
.panel-message, .distribution-caption { color: var(--muted); font-size: .88rem; }
.panel-message { padding: .75rem; }
.distribution-caption { padding: 0 .75rem; }
.distribution { display: grid; gap: .54rem; padding: .7rem .75rem; }
.distribution:empty { padding: 0; }
.distribution li { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) 2rem; gap: .45rem; align-items: center; font-size: .86rem; }
.distribution-count { text-align: right; }
.bar-track { height: .62rem; border-radius: 3px; background: var(--raised); }
.bar { display: block; height: 100%; border-radius: inherit; background: var(--band); }

.stand-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem; align-items: center; padding: .18rem .65rem .18rem .25rem; }
.stand-row + .stand-row { border-top: 1px solid var(--line); }
.stand-open {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .32rem;
  padding: .52rem .55rem;
  border: 0;
  border-radius: 6px;
  background: none;
  text-align: left;
}
.stand-open:hover { background: var(--raised); }
.stand-name, .stand-price { font-weight: 730; overflow-wrap: anywhere; }
.stand-row small { display: block; color: var(--muted); font-size: .76rem; }
.stand-row .status-text { margin-top: .16rem; }
.stand-amount { text-align: right; }
.stand-price { display: block; color: var(--band); white-space: nowrap; }
.stand-route { text-decoration: none; }
.demo-banner, .site-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem 1rem; color: var(--muted); font-size: .85rem; }
.demo-banner { margin-top: .8rem; gap: .15rem .5rem; padding: .15rem .7rem; border: 1px solid #764c44; border-radius: 7px; background: #30221f; color: #ffe1cd; }
.demo-banner a, .site-footer a { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: 3px; }
.site-footer { border-top: 1px solid var(--line); padding-block: .3rem .75rem; }

.stand-details {
  position: fixed;
  inset: auto 0 0;
  width: 100%;
  max-width: none;
  max-height: min(84svh, 36rem);
  margin: 0;
  padding: .95rem 1rem max(1rem, env(safe-area-inset-bottom));
  border: 1px solid #695164;
  border-radius: 14px 14px 0 0;
  background: var(--surface);
  color: var(--text);
  overflow: auto;
}
.stand-details::backdrop { background: #100a11a3; }
.detail-heading, .detail-prices > div, .detail-total > div { display: flex; align-items: start; justify-content: space-between; gap: .65rem; }
.detail-heading { margin-bottom: .65rem; }
.detail-heading p { font-size: .83rem; color: var(--accent); margin-bottom: .15rem; }
.detail-heading h2 { overflow-wrap: anywhere; }
.detail-prices > div, .detail-total > div { padding-block: .4rem; border-top: 1px solid var(--line); font-size: .9rem; }
.detail-prices > div.is-current { color: var(--accent); }
.detail-prices small { display: block; color: var(--muted); font-size: .75rem; }
.detail-total > div:last-child { font-weight: 750; }
.detail-prices dd, .detail-total dd { text-align: right; white-space: nowrap; }
.detail-footer p { margin-block: .45rem .65rem; color: var(--muted); font-size: .84rem; }
.route-button {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .45rem .8rem;
  border-radius: 7px;
  background: var(--action);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}
.route-button:hover { background: #853e55; }

@media (min-width: 580px) {
  .shell { width: min(100% - 3rem, 76rem); }
  .site-header nav .nav-map { display: inline-flex; }
  .filter-bar { grid-template-columns: minmax(18rem, 24rem) minmax(12rem, 18rem); align-items: center; }
  .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stats-grid > div { padding: .85rem 1rem; }
  .map-stage { height: clamp(365px, 54svh, 560px); }
  .map-summary { top: 1rem; left: 1rem; padding: .75rem .95rem .8rem; }
  .map-controls { right: 1rem; bottom: 1rem; }
  .stand-details { inset: 0 1.5rem 0 auto; margin: auto 0; width: min(400px, 100% - 3rem); border-radius: 12px; padding: 1rem; }
}
@media (min-width: 820px) {
  .comparison-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
  .header-inner { min-height: 70px; }
  .section-intro { margin-block: 1.5rem 1rem; }
  .comparison { margin-top: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
@media (prefers-reduced-motion: no-preference) {
  button, .site-header nav a, .route-button { transition: background-color .15s ease, color .15s ease; }
}
