/* Mittagstisch München – Designsystem
   Leitidee: eine gedruckte Mittagskarte liegt auf einem Stadtplan. Papierton, Dunkelgrün, Ocker. */
@import url("../fonts/fonts.css");

:root {
  --bg: #f3ecdc;
  --surface: #fbf8f1;
  --surface-2: #f0e9da;
  --line: #e4dfd0;
  --line-strong: #c9c1ac;
  --text: #1e3a2c;
  --muted: #4c5f53;
  --faint: #7c8778;
  --ink: #1e3a2c;
  --ink-text: #fbf8f1;
  --sun: #e0a458;
  --sun-soft: #f6e7cd;
  --accent: #a8321f;
  --open: #17693f;
  --open-soft: #dfeadb;
  --soon: #7d5200;
  --soon-soft: #f6e7cd;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(30, 58, 44, 0.06), 0 6px 20px rgba(30, 58, 44, 0.08);
  --shadow-lg: 0 20px 56px rgba(30, 58, 44, 0.22);
  --font-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Newsreader", Georgia, serif;
  --topbar: 72px;
  --sidebar: 520px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body.app {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--ink-text);
}

.skip-link:focus {
  top: 10px;
}

/* ---------- Topbar ---------- */
.topbar {
  height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: relative;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: auto;
}

.brand-mark {
  display: block;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.brand-name {
  font: 500 19px/1 var(--font-head);
  letter-spacing: -0.01em;
}

.brand-city {
  font-weight: 400;
  color: var(--muted);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-right: 8px;
}

.topnav a {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
}

.topnav a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.topnav a[aria-current="page"] {
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--sun);
  border-radius: 0;
}

.topnav .nav-minor {
  display: none;
}

.icon-btn.menu-btn {
  display: none;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-primary {
  background: var(--ink);
  color: var(--ink-text);
}

.btn-primary:hover {
  background: #2d5140;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: progress;
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--ink);
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.btn-danger {
  background: var(--surface);
  border-color: #e3bdb2;
  color: var(--accent);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  flex-shrink: 0;
}

.icon-btn:hover {
  border-color: var(--ink);
}

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 13px;
  white-space: nowrap;
}

.link-btn:hover {
  color: var(--text);
}

/* ---------- App-Layout: Desktop ---------- */
.layout {
  height: calc(100dvh - var(--topbar));
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas:
    "controls map"
    "results map";
}

.controls {
  grid-area: controls;
  padding: 16px 20px 14px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.results {
  grid-area: results;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.map-wrap {
  grid-area: map;
  position: relative;
  min-width: 0;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--muted);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

.search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  min-width: 0;
}

.search input::placeholder {
  color: var(--muted);
}

/* ---------- Filter ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s;
}

.chip:hover {
  border-color: var(--ink);
}

.chip.is-active,
.chip[aria-expanded="true"] {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.chip-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--ink-text);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}

.caret {
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: 0.65;
}

.chip-toggle .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
}


#reset-filters {
  margin-left: 4px;
}

/* ---------- Popover ---------- */
.popover {
  position: fixed;
  z-index: 50;
  min-width: 240px;
  max-width: 320px;
  max-height: 380px;
  overflow: auto;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.popover-title {
  display: none;
}

.popover-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.popover-option:hover {
  background: var(--surface-2);
}

.popover-option input {
  accent-color: var(--ink);
  width: 16px;
  height: 16px;
  margin: 0;
}

.opt-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.popover-foot {
  position: sticky;
  bottom: -6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  margin: 4px -6px -6px;
  background: var(--surface);
}

/* ---------- Ergebniskopf ---------- */
.results-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.count {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.count b {
  font: 500 19px/1.2 var(--font-head);
  color: var(--text);
}

.count strong {
  color: var(--open);
  font-weight: 600;
}

.sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  flex-shrink: 0;
}

.sort select {
  border: 0;
  background: transparent;
  font-weight: 600;
  color: var(--text);
  padding: 2px 0;
  cursor: pointer;
  max-width: 150px;
}

.sheet-grip {
  display: none;
}

/* ---------- Liste im Speisekarten-Stil ---------- */
.list-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.list {
  flex: 1 0 auto;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  display: flex;
  gap: 14px;
  width: 100%;
  padding: 14px 20px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  transition: background 0.12s;
}

.card:hover,
.card.is-hover {
  background: var(--bg);
}

.card.is-selected {
  background: var(--sun-soft);
}

.card:focus-visible {
  outline-offset: -2px;
}

.thumb {
  flex: 0 0 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
}

.thumb img,
.hero img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  flex: 1;
  min-width: 0;
  display: block;
}

.card-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.card-title {
  font: 500 16px/1.3 var(--font-head);
  letter-spacing: -0.005em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader {
  flex: 1;
  min-width: 16px;
  border-bottom: 1.5px dotted var(--line-strong);
  transform: translateY(-3px);
}

.card-price {
  flex-shrink: 0;
  font-weight: 600;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.card-price small {
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
}

.card-offer {
  display: block;
  margin-top: 3px;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 8px;
  row-gap: 2px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}

.status-open {
  color: var(--open);
}

.status-open::before {
  background: var(--open);
}

.status-soon {
  color: var(--soon);
}

.status-soon::before {
  background: var(--soon);
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.empty {
  margin: 40px 20px;
  text-align: center;
  color: var(--muted);
  list-style: none;
}

.empty h2 {
  margin: 0 0 4px;
  font: 500 19px/1.3 var(--font-head);
  color: var(--text);
}

.empty p {
  margin: 0 0 14px;
}

/* ---------- Detail ---------- */
.detail {
  position: absolute;
  inset: 0;
  z-index: 5;
  overflow-y: auto;
  background: var(--surface);
  padding: 0 20px 24px;
  animation: slide-in 0.18s ease-out;
}

@keyframes slide-in {
  from {
    transform: translateX(-10px);
    opacity: 0;
  }
}

.detail-top {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 -20px 12px;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  border: 0;
  background: none;
  padding: 0;
  font-weight: 600;
  font-size: 14px;
}

.back-btn:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hero {
  display: block;
  aspect-ratio: 16 / 9;
  margin: 4px 0 16px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
}

.detail h2 {
  margin: 8px 0 0;
  font: 500 28px/1.15 var(--font-head);
  letter-spacing: -0.02em;
}

.detail-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 10px;
  margin: 6px 0 0;
  color: var(--muted);
}

.offer-box {
  margin-top: 18px;
  padding: 14px 0;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--line);
}

.offer-box .card-line {
  gap: 8px;
}

.offer-box .offer {
  font-weight: 600;
  min-width: 0;
}

.offer-box .card-price {
  font: 500 22px/1.2 var(--font-head);
}

.offer-box .card-price small {
  font-family: var(--font-body);
}

.offer-box .note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.info-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.info-list li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.info-list svg {
  margin-top: 3px;
  color: var(--muted);
}

.info-list .muted {
  color: var(--muted);
  font-size: 13px;
}

.detail-desc {
  margin: 16px 0 0;
  line-height: 1.6;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 20px;
}

.detail-actions .span-2 {
  grid-column: 1 / -1;
}

.detail-foot {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-source {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Karte ---------- */
#map {
  position: absolute;
  inset: 0;
  background: #f3e9d2;
}

/* Äußeres Element gehört MapLibre (transform = Position) – hier keine transition/transform setzen */
.marker {
  cursor: pointer;
}

.marker:hover,
.marker.is-hover,
.marker.is-selected {
  z-index: 3;
}

.marker-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  margin-bottom: 5px;
  padding: 0 8px;
  border-radius: 6px;
  border: 0;
  background: var(--surface);
  color: var(--muted);
  font: 600 12px/1 var(--font-body);
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 1px var(--line-strong), 0 2px 6px rgba(30, 58, 44, 0.16);
  white-space: nowrap;
  transition: transform 0.12s, background 0.12s;
  transform-origin: center bottom;
  cursor: pointer;
}

/* kleine Spitze, die auf den genauen Ort zeigt */
.marker-pill::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  background: inherit;
  transform: rotate(45deg);
  box-shadow: 1px 1px 0 var(--line-strong);
  border-radius: 0 0 2px 0;
}

.marker.is-michelin .marker-pill {
  box-shadow: 0 0 0 1.5px var(--accent), 0 2px 6px rgba(30, 58, 44, 0.16);
}

.marker.is-michelin .marker-pill::after {
  box-shadow: 1.5px 1.5px 0 var(--accent);
}

.m-michelin {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.cluster-pill .m-michelin {
  color: var(--sun);
}

.michelin-badge {
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

.marker .m-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}

.marker.is-open .marker-pill,
.marker.is-soon .marker-pill {
  color: var(--text);
}

.marker.is-open .m-dot {
  background: var(--open);
}

.marker.is-soon .m-dot {
  background: var(--soon);
}

.marker:hover .marker-pill,
.marker.is-hover .marker-pill {
  transform: scale(1.1);
  color: var(--text);
}

.marker.is-selected .marker-pill {
  background: var(--sun);
  color: var(--ink);
  transform: scale(1.14);
  box-shadow: 0 0 0 1.5px var(--ink), 0 4px 12px rgba(30, 58, 44, 0.3);
}

.marker.is-selected .marker-pill::after {
  box-shadow: 1.5px 1.5px 0 var(--ink);
}

.marker.is-selected .m-dot {
  background: var(--ink);
}

/* Marker-Gruppe beim Rauszoomen: Anzahl plus günstigster Preis */
.cluster-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 11px 0 4px;
  border: 0;
  border-radius: 16px;
  background: var(--ink);
  color: var(--ink-text);
  font: 600 12px/1 var(--font-body);
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 8px rgba(30, 58, 44, 0.35);
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.12s;
}

.cluster-pill:hover {
  transform: scale(1.08);
}

.cluster-count {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 5px;
  border-radius: 12px;
  background: var(--sun);
  color: var(--ink);
  font-size: 13px;
}

.user-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #2563c9;
  border: 3px solid #fff;
  box-shadow: 0 0 0 6px rgba(37, 99, 201, 0.2);
}

.maplibregl-ctrl-group {
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow) !important;
  border: 1px solid var(--line-strong);
}

.maplibregl-ctrl-attrib {
  background: rgba(251, 248, 241, 0.9) !important;
  font-size: 11px;
}

/* ---------- Footer ---------- */
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot-links a {
  color: inherit;
  text-underline-offset: 3px;
}

.foot-note {
  margin: 8px 0 0;
}

.foot-note a {
  text-underline-offset: 2px;
}

.list-foot {
  flex-shrink: 0;
  padding: 16px 20px 20px;
  background: var(--bg);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.site-foot {
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
}

.site-foot-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 20px 32px;
}

/* ---------- Inhaltsseiten ---------- */
body.page {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.page-main {
  flex: 1;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 48px 20px 72px;
}

.prose {
  max-width: 680px;
  font-size: 16px;
  line-height: 1.65;
}

.prose h1 {
  margin: 0 0 12px;
  font: 500 clamp(32px, 5vw, 44px)/1.1 var(--font-head);
  letter-spacing: -0.022em;
}

.prose .lead {
  margin: 0 0 32px;
  font-size: 19px;
  line-height: 1.5;
  color: var(--muted);
}

.prose h2 {
  margin: 40px 0 8px;
  font: 500 23px/1.25 var(--font-head);
  letter-spacing: -0.012em;
}

.prose h3 {
  margin: 24px 0 4px;
  font-size: 16px;
  font-weight: 600;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 14px;
}

.prose li {
  margin-bottom: 6px;
}

.prose a {
  text-underline-offset: 3px;
}

.prose address {
  font-style: normal;
}

.draft-note {
  margin: 0 0 32px;
  padding: 14px 16px;
  background: var(--sun-soft);
  border-radius: var(--radius-sm);
  font-size: 15px;
  line-height: 1.5;
}

mark.todo {
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--sun);
  color: var(--ink);
  font-weight: 600;
}

.steps {
  counter-reset: step;
  padding: 0;
  list-style: none;
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 8px 48px;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--sun);
  font: 500 16px/1 var(--font-head);
}

.steps h2 {
  margin: 0 0 4px;
  padding-top: 3px;
  font-size: 19px;
}

.legend {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.legend li {
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.legend .status {
  display: flex;
  font-size: 15px;
}

.form-panel {
  margin: 16px 0 24px;
  padding: 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 15px;
  line-height: 1.5;
}

.form-panel-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.form-success {
  margin: 16px 0 24px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--open-soft);
  color: var(--open);
  font-weight: 500;
}

/* ---------- Modal ---------- */
.modal {
  width: min(620px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.modal::backdrop {
  background: rgba(30, 58, 44, 0.5);
}

.modal form {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 48px);
}

.modal-head {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font: 500 22px/1.2 var(--font-head);
  letter-spacing: -0.012em;
}

.modal-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.modal-body {
  overflow-y: auto;
  padding: 20px 24px;
}

.modal-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
}

.form-error {
  margin: 0 auto 0 0;
  color: var(--accent);
  font-size: 13px;
}

.modal-success {
  padding: 40px 32px;
  text-align: center;
}

.modal-success h2 {
  margin: 16px 0 6px;
  font: 500 26px/1.2 var(--font-head);
}

.modal-success p {
  margin: 0 0 24px;
  color: var(--muted);
}

.success-icon {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--open-soft);
  color: var(--open);
}

/* ---------- Formular ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field > span,
.field > legend {
  font-size: 13px;
  font-weight: 600;
  padding: 0;
}

.span-2 {
  grid-column: span 2;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  outline: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field textarea {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.form-note a {
  text-underline-offset: 2px;
}

.report-target {
  margin: 0;
  font: 500 18px/1.3 var(--font-head);
}

.day-picker,
.tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.day-chip,
.tag-chip {
  position: relative;
}

.day-chip input,
.tag-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.day-chip span,
.tag-chip span {
  display: inline-grid;
  place-items: center;
  height: 34px;
  min-width: 44px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.day-chip input:checked + span,
.tag-chip input:checked + span {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--ink-text);
}

.day-chip input:focus-visible + span,
.tag-chip input:focus-visible + span {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.hp {
  position: absolute;
  left: -9999px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--ink-text);
  box-shadow: var(--shadow-lg);
  font-weight: 500;
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  :root {
    --sidebar: 440px;
  }

  .brand-city {
    display: none;
  }
}

@media (max-width: 860px) {
  :root {
    --topbar: 56px;
    --sheet-h: 50%;
  }

  .topbar {
    padding: 0 12px;
    gap: 6px;
  }

  .brand-city {
    display: inline;
  }

  .topbar #open-submit {
    width: 38px;
    height: 38px;
    padding: 0;
  }

  .topbar .btn span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  /* Navigation klappt auf dem Handy aus dem Menü-Button auf */
  .icon-btn.menu-btn {
    display: grid;
  }

  .topnav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    padding: 6px 12px 12px;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }

  .topnav.is-open {
    display: flex;
  }

  .topnav a {
    padding: 12px;
    font-size: 16px;
  }

  .topnav a[aria-current="page"] {
    }

  .topnav .nav-minor {
    display: block;
  }

  /* Karte füllt den Bildschirm, die Mittagskarte ist ein ziehbares Blatt */
  .layout {
    display: block;
    position: relative;
    overflow: hidden;
  }

  .map-wrap {
    position: absolute;
    inset: 0;
  }

  body.app .panel {
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 8;
    height: var(--sheet-h);
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -6px 22px rgba(30, 58, 44, 0.22);
    transition: height 0.22s cubic-bezier(0.2, 0.8, 0.3, 1);
    overflow: hidden;
  }

  body.app .panel.is-dragging {
    transition: none;
  }

  .controls {
    padding: 0 16px;
  }

  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
    scrollbar-width: none;
  }

  .filters::-webkit-scrollbar {
    display: none;
  }

  .chip {
    flex-shrink: 0;
    height: 44px;
  }

  #reset-filters {
    flex-shrink: 0;
  }

  .sheet-grip {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 100%;
    height: 24px;
    padding: 0;
    border: 0;
    background: var(--surface);
    touch-action: none;
    cursor: grab;
  }

  .sheet-grip span {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--line-strong);
  }

  .results-head {
    padding: 8px 16px;
    touch-action: none;
  }

  .count-sep {
    display: none;
  }

  .count strong {
    display: block;
    font-size: 13px;
  }

  .card {
    padding: 13px 16px;
  }

  .list-foot {
    padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
  }

  .detail {
    top: 24px;
    padding: 0 16px calc(24px + env(safe-area-inset-bottom));
  }

  .detail-top {
    margin: 0 -16px 12px;
    padding: 2px 16px 8px;
  }

  .detail h2 {
    font-size: 25px;
  }

  .maplibregl-ctrl-bottom-right,
  .maplibregl-ctrl-bottom-left {
    bottom: var(--sheet-h);
    transition: bottom 0.22s cubic-bezier(0.2, 0.8, 0.3, 1);
  }

  .maplibregl-ctrl-attrib {
    font-size: 10px;
  }

  /* Auf dem kleinen Bildschirm reicht die Anzahl, sonst überdecken sich die Gruppen */
  .cluster-pill {
    padding: 0 4px;
  }

  .cluster-price {
    display: none;
  }

  /* Filter öffnen als Blatt von unten */
  .popover {
    left: 0 !important;
    right: 0;
    top: auto !important;
    bottom: 0;
    z-index: 60;
    max-width: none;
    max-height: 70dvh;
    padding: 8px 12px calc(12px + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 0 0 100vmax rgba(30, 58, 44, 0.45);
  }

  .popover-title {
    display: block;
    padding: 10px 10px 8px;
    font: 500 19px/1.2 var(--font-head);
  }

  .popover-option {
    padding: 12px 10px;
    font-size: 16px;
  }

  .popover-foot {
    bottom: calc(-12px - env(safe-area-inset-bottom));
    margin: 4px -12px -12px;
    padding: 10px 22px calc(10px + env(safe-area-inset-bottom));
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  /* iOS zoomt sonst beim Fokus in Felder unter 16 px */
  .search input,
  .field input,
  .field select,
  .field textarea {
    font-size: 16px;
  }

  .modal {
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  .modal form {
    max-height: 100dvh;
    height: 100%;
  }

  .modal-body {
    flex: 1;
  }

  .modal-head,
  .modal-body,
  .modal-foot {
    padding-left: 16px;
    padding-right: 16px;
  }

  .form-error {
    flex-basis: 100%;
  }

  .page-main {
    padding: 28px 16px 56px;
  }

  .prose .lead {
    font-size: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Angebote ohne veröffentlichten Preis */
.card-price-none {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

/* Restaurantsuche im Einreichen-Formular */
.place-search {
  position: relative;
}

.place-search > label {
  font-size: 13px;
  font-weight: 600;
}

.place-list {
  position: absolute;
  top: 68px;
  left: 0;
  right: 0;
  z-index: 5;
  max-height: 260px;
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.place-option {
  display: grid;
  gap: 1px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.place-option span {
  color: var(--muted);
  font-size: 13px;
}

.place-option:hover,
.place-option[aria-selected="true"] {
  background: var(--surface-2);
}

.place-empty {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 13px;
}

.place-result {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--open);
  font-weight: 500;
}

.place-manual {
  justify-self: start;
  align-self: flex-start;
}

/* Schnellfilter */

.count-next {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}


/* ---------- Mittagskarte auf dem Stadtplan ---------- */
::selection {
  background: var(--sun);
  color: var(--ink);
}

html {
  scrollbar-color: var(--line-strong) transparent;
}

.btn {
  border-radius: 999px;
}

.brand-name {
  margin: 0;
  font: 500 26px/1 var(--font-head);
  letter-spacing: -0.015em;
}

.brand-city {
  font-weight: inherit;
  color: inherit;
}

body.app .panel {
  position: absolute;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.controls,
.results {
  background: transparent;
  border-right: 0;
}

.results {
  position: static;
  flex: 1;
}

.search {
  background: #fffdf8;
}

/* Filter wie die Rubriken einer Karte; der aktive ist gefüllt */
.filters {
  gap: 2px;
  margin-top: 10px;
  padding-top: 5px;
  padding-bottom: 5px;
  border-top: 1px solid var(--ink);
}

.filters-more {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.chip {
  height: 36px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  font-weight: 600;
  font-size: 14px;
}

.chip:hover {
  background: var(--surface-2);
}

.chip.is-active,
.chip[aria-expanded="true"] {
  background: var(--surface-2);
  box-shadow: none;
}

.chip[aria-pressed="true"] {
  background: var(--ink);
  color: var(--ink-text);
}

.chip-toggle .dot {
  background: var(--open);
}

.chip-toggle[aria-pressed="true"] .dot {
  background: var(--sun);
}

.results-head {
  align-items: center;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
}

.count {
  font: italic 400 17px/1.3 var(--font-head);
}

.count b {
  font: inherit;
  color: var(--text);
}

.count strong {
  font-weight: 500;
}

.count-next {
  display: inline;
  font: inherit;
}

.count-next::before {
  content: " · ";
}

.card {
  align-items: flex-start;
  gap: 12px;
}

.card:hover,
.card.is-hover {
  background: var(--surface-2);
}

.card-title {
  font: 500 21px/1.25 var(--font-head);
  letter-spacing: 0;
}

.leader {
  border-bottom: 1px dotted var(--faint);
  transform: translateY(-4px);
}

.card-price {
  font: 500 20px/1.25 var(--font-head);
  font-variant-numeric: lining-nums tabular-nums;
}

.card-price small {
  font: 400 13px var(--font-body);
}

.card-price-none {
  font: 500 13px var(--font-body);
}

.detail h2 {
  font-size: 34px;
  font-weight: 400;
}

.offer-box .card-price {
  font-size: 24px;
}

/* Marker: Nummer aus der Liste plus Preis */
.marker-pill {
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border: 1.5px solid var(--ink);
  border-radius: 15px;
  background: var(--surface);
  color: var(--text);
  font: 500 15px/1 var(--font-head);
  font-variant-numeric: lining-nums tabular-nums;
  box-shadow: 0 2px 6px rgba(30, 58, 44, 0.3);
}

.marker-pill::after {
  display: none;
}

.marker.is-selected .marker-pill {
  background: var(--sun);
  box-shadow: 0 4px 12px rgba(30, 58, 44, 0.35);
}

.cluster-count {
  background: var(--ink-text);
  font-variant-numeric: lining-nums;
}

.user-dot {
  background: #1f5f9e;
  border-color: var(--surface);
}

/* Desktop: Das Blatt liegt auf dem Stadtplan, die Kopfzeile schwebt darüber */
@media (min-width: 861px) {
  body.app .topbar {
    position: absolute;
    top: 24px;
    left: 24px;
    right: 24px;
    height: 44px;
    padding: 0;
    border: 0;
    background: none;
    pointer-events: none;
  }

  body.app .topbar > * {
    pointer-events: auto;
  }

  /* Logo und Name stehen groß oben auf dem Blatt */
  body.app .brand {
    position: absolute;
    left: 28px;
    top: 16px;
    gap: 14px;
  }

  body.app .brand-mark {
    width: 96px;
    height: 96px;
  }

  body.app .brand-name {
    font-size: 40px;
  }

  body.app .brand-city {
    display: block;
  }

  body.app .topnav {
    padding: 2px 6px;
    margin-left: auto;
    margin-right: 6px;
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  body.app .topnav a {
    border-radius: 999px;
  }

  body.app #open-submit {
    height: 44px;
    box-shadow: var(--shadow);
  }

  body.app .layout {
    display: block;
    position: relative;
    height: 100dvh;
  }

  .map-wrap {
    position: absolute;
    inset: 0;
  }

  body.app .panel {
    top: 24px;
    left: 24px;
    bottom: 24px;
    z-index: 5;
    width: var(--sidebar);
    box-shadow: 0 12px 34px rgba(30, 58, 44, 0.3);
  }

  .controls {
    padding: 128px 32px 0;
  }

  .results-head {
    padding: 10px 32px;
  }

  .card {
    padding: 14px 32px;
  }

  .list-foot {
    padding: 16px 32px 20px;
  }

  .detail {
    top: 120px;
    padding: 0 32px 24px;
  }

  .detail-top {
    margin: 0 -32px 12px;
    padding: 10px 32px;
  }

  .maplibregl-ctrl-top-right {
    top: 72px;
    right: 14px;
  }
}

/* Schmale Fenster: Einreichen nur als Symbol, damit die Navigation Platz hat */
@media (min-width: 861px) and (max-width: 1040px) {
  body.app #open-submit {
    width: 44px;
    padding: 0;
  }

  body.app #open-submit span {
    display: none;
  }
}

@media (max-width: 860px) {
  .count strong {
    display: inline;
    font-size: inherit;
  }

  :root {
    --topbar: 68px;
  }

  .topbar {
    box-shadow: 0 2px 8px rgba(30, 58, 44, 0.18);
    border-bottom: 0;
  }

  .brand {
    min-width: 0;
    flex-shrink: 1;
    gap: 8px;
  }

  .brand-mark {
    width: 52px;
    height: 52px;
  }

  .brand-name {
    font-size: 23px;
  }

  .brand-city {
    display: block;
  }

  .topbar #open-submit,
  .icon-btn.menu-btn {
    width: 44px;
    height: 44px;
  }

  .topbar #open-submit {
    border-radius: 50%;
  }

  .marker-pill {
    height: 28px;
    font-size: 14px;
  }
}

.topbar {
  flex-shrink: 0;
}

@media (min-width: 861px) {
  .brand-mark {
    width: 56px;
    height: 56px;
  }
}
