:root{
  --bg: #0b0b0c;
  --panel: #151518;
  --text: #f1f1f1;
  --text-dark: #000000;
  --muted: #b8b8bf;
  --accent: #9DC0DE;
  --accent-700: #72ACDE;
  --border: #2a2a30;

  --radius: 16px;
  --shadow: 0 6px 20px rgba(0,0,0,.25);

  --header-h: 88px;
  --tabbar-h: 56px;
}

* { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Apple Color Emoji","Segoe UI Emoji";
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-header{
  height: var(--header-h);
  display: grid;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #101014, #0c0c10);
}
.app-header h1{ margin: 0; font-size: 1.25rem; letter-spacing: 0.2px; }
.app-header .tagline{ margin: 2px 0 0; font-size: .9rem; color: var(--muted); }

/* Hauptbereich: Fallback + moderne Viewport-Einheiten */
main{
  position: relative;
  min-height: calc(100vh - var(--header-h) - var(--tabbar-h));
  min-height: calc(100svh - var(--header-h) - var(--tabbar-h));
  padding-bottom: var(--tabbar-h);
}

.view{ display: none; }
.view.active{ display: block; }

#map{
  position: relative; z-index: 0;
  height: calc(100vh - var(--header-h) - var(--tabbar-h));
  height: calc(100svh - var(--header-h) - var(--tabbar-h));
  min-height: 320px;
  border-radius: 0;
}
.leaflet-container{ background: #0f0f13; outline: none; }

/* Routing-Box verbergen (nur Route auf Karte) */
.leaflet-routing-container{ display: none !important; }

/* Map floating controls */
.map-actions{
  position: absolute;
  top: 12px; right: 12px;
  display: flex; gap: 8px;
  z-index: 500;
}
.btn{
  background: var(--accent); color: #081a18;
  border: 1px solid transparent;
  padding: 8px 10px; border-radius: 999px;
  font-weight: 600; cursor: pointer; box-shadow: var(--shadow);
}
.btn[aria-pressed="true"]{ background: var(--accent-700); color: #eafffb; }
.btn.btn-ghost{ background: white; color: var(--text-dark); border-color: var(--border); box-shadow: none; }

.notice{
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  background: rgba(0,0,0,.65); color: var(--text);
  border: 1px solid var(--border); padding: 10px 12px; border-radius: 10px;
  backdrop-filter: blur(6px); max-width: min(92vw, 680px); box-shadow: var(--shadow);
}

/* Tabbar sicher über der Leaflet-Karte halten */
.tabbar{
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--tabbar-h);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  border-top: 1px solid var(--border);
  background: #0e0e12; padding: 6px; gap: 6px;
  z-index: 10000;
}
.tab{
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
  border-radius: 999px; font-weight: 600; cursor: pointer;
}
.tab.active{ border-color: transparent; background: var(--accent); color: #081a18; }

/* Cards */
.cards{ display: grid; gap: 16px; padding: 16px; }
@media (min-width: 880px){
  .cards{ grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 20px; gap: 20px; }
}
.card{
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: clip; box-shadow: var(--shadow);
  display: grid; grid-template-columns: 140px 1fr;
  grid-template-areas:
    "logo title"
    "photo photo"
    "desc desc"
    "contact contact";
}
.card .logo{ grid-area: logo; display: grid; place-items: center; padding: 12px; border-right: 1px solid var(--border); }
.card .logo img{ max-width: 120px; max-height: 72px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,.25)); background: #fff; border-radius: 10px; padding: 6px; }
.card .title{ grid-area: title; padding: 12px; display: flex; align-items: center; font-size: 1.05rem; font-weight: 700; }
.card .photo{ grid-area: photo; width: 100%; height: 420px; object-fit: cover; background: #222; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.card .desc{ grid-area: desc; padding: 12px 12px 0 12px; color: var(--text); }
.card .contact{ grid-area: contact; padding: 12px; display: grid; gap: 8px; }
.contact .contact-row{ display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.contact .chip{
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.06); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 10px;
}
.contact .chip button{ all: unset; cursor: pointer; font-weight: 600; color: var(--accent); }
.contact .actions{ display: flex; gap: 8px; }
.contact .btn-link{
  all: unset; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px;
  cursor: pointer; background: rgba(255,255,255,.06);
}
.contact .btn-link:hover{ border-color: var(--accent); }

/* Benutzer-Standort auf der Karte */
.user-dot{
  width: 14px; height: 14px; background: var(--accent);
  border: 2px solid #052c27; border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(65,211,189,.25);
}

/* Hilfsklassen */
.sr-only{
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
