@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url(../../assets/fonts/_Xms-HUzqDCFdgfMm4S9DaRvzig.woff2) format('woff2');
}

:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --card: #f6f5f1;
  --field: #ffffff;
  --line: #e2dfd5;
  --line-strong: #c9c5b8;
  --text: #2f2d29;
  --muted: #6b6963;
  --accent: #2f2d29;
  --accent-strong: #1c1b18;
  --on-accent: #ffffff;
  --focus: rgba(47, 45, 41, 0.18);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 8px 24px rgba(0, 0, 0, 0.07);
  --radius: 14px;
  --warn-bg: #fbf3e6;
  --warn-text: #7a4b00;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #080805;
  --panel: #0c0c09;
  --card: #15150f;
  --field: #15150f;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #ffffff;
  --muted: #a4a49b;
  --accent: #6b765d;
  --accent-strong: #7d8a6d;
  --on-accent: #ffffff;
  --focus: rgba(125, 138, 109, 0.35);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 30px rgba(0, 0, 0, 0.45);
  --warn-bg: rgba(255, 170, 60, 0.10);
  --warn-text: #f3c98b;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }

/* ---------- Finder layout ---------- */
.finder {
  display: grid;
  grid-template-columns: minmax(340px, 430px) 1fr;
  height: 100vh;
}
.panel {
  background: var(--panel);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.panel-inner { padding: 36px 32px 40px; }
.wordmark { height: 22px; width: auto; display: block; margin-bottom: 30px; opacity: 0.95; }
[data-brand="startrac"] .wordmark { height: 30px; }
h1 { font-size: 30px; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; }
.lead { color: var(--muted); margin: 10px 0 24px; font-size: 15px; }

.search { display: grid; grid-template-columns: 1fr 104px; gap: 10px; }
.search .btn-primary { grid-column: 1 / -1; }
.field { position: relative; }
.field input, .field select {
  width: 100%;
  height: 52px;
  border: 1px solid var(--line-strong);
  background: var(--field);
  border-radius: 12px;
  padding: 0 16px;
  font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}
.field input::placeholder { color: var(--muted); }
.field input:focus, .field select:focus { outline: none; border-color: var(--accent-strong); box-shadow: 0 0 0 4px var(--focus); }
.field.select::after {
  content: '';
  position: absolute; right: 16px; top: 50%;
  width: 8px; height: 8px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.field select { padding-right: 34px; cursor: pointer; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 22px;
  border-radius: 12px;
  font-weight: 700; font-size: 16px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, transform .1s, border-color .15s, opacity .15s;
}
.btn:active { transform: scale(0.985); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not([disabled]) { background: var(--accent-strong); }
.btn-outline { background: transparent; border-color: var(--line-strong); color: var(--text); width: 100%; margin-top: 10px; font-weight: 600; }
.btn-outline:hover { border-color: var(--accent-strong); }
.btn-locate svg { width: 18px; height: 18px; }

.search.pulse .field input { animation: pulse 1.1s ease 2; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--focus); }
  50% { box-shadow: 0 0 0 8px var(--focus); border-color: var(--accent-strong); }
}

/* ---------- Autocomplete ---------- */
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  z-index: 20;
  list-style: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
  max-height: 300px; overflow-y: auto;
}
.suggest li {
  display: flex; gap: 10px; align-items: baseline;
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
}
.suggest li b { font-weight: 700; min-width: 48px; font-variant-numeric: tabular-nums; }
.suggest li span { color: var(--muted); margin-left: auto; font-size: 12px; font-weight: 600; letter-spacing: .04em; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--card); }

/* ---------- Status & results ---------- */
.status:empty { display: none; }
.status { margin-top: 26px; font-size: 14px; color: var(--muted); }
.status strong { color: var(--text); }
.notice {
  margin-top: 22px; padding: 16px 18px;
  border-radius: 12px;
  background: var(--warn-bg); color: var(--warn-text);
  font-size: 14px; line-height: 1.55;
}
.notice a { font-weight: 700; }
.results { margin-top: 14px; display: grid; gap: 14px; }

.card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  animation: rise .35s cubic-bezier(.2,.7,.3,1) both;
}
.card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.card.is-active { border-color: var(--accent-strong); box-shadow: 0 0 0 3px var(--focus); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--accent); color: var(--on-accent);
}
.card-logo {
  flex: 0 0 auto;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.14);
}
[data-brand="stahlhoff"] .card-logo { background: #ffffff; }
.card-logo img { width: 22px; height: 22px; object-fit: contain; }
.card-name { font-weight: 700; font-size: 15.5px; line-height: 1.3; flex: 1; min-width: 0; }
.card-badge { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .8; margin-bottom: 2px; }
.card-dist { flex: 0 0 auto; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; opacity: .95; }
.card-head { cursor: pointer; }
.card-body { padding: 14px 16px 16px; font-size: 14.5px; }
.card-addr { line-height: 1.55; }
.card-actions { display: flex; gap: 8px; margin-top: 14px; align-items: center; }

.btn-route {
  flex: 1; min-width: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 46px; padding: 0 16px; border-radius: 12px;
  background: var(--accent); color: var(--on-accent);
  font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap;
  transition: background .15s, transform .1s;
}
[data-theme="dark"] .btn-route { background: #ffffff; color: #080805; }
.btn-route:hover { background: var(--accent-strong); }
[data-theme="dark"] .btn-route:hover { background: #e9ebe4; }
.btn-route:active { transform: scale(.985); }
.btn-route svg { width: 17px; height: 17px; flex-shrink: 0; }

.tool {
  flex: 0 0 auto;
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong); background: transparent; color: var(--text);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.tool svg { width: 19px; height: 19px; }
.tool:hover { border-color: var(--accent-strong); }
.tool:active { transform: scale(.95); }
.tool[aria-expanded="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.drawer { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s cubic-bezier(.2,.7,.3,1); }
.drawer.is-open { grid-template-rows: 1fr; }
.drawer > * { min-height: 0; overflow: hidden; }
.drawer.is-open .drawer-panel:not([hidden]) { margin-top: 10px; }
.drawer-panel {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 12px 12px 14px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  animation: rise .25s ease both;
}
.drawer-panel[hidden] { display: none; }
.drawer-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.drawer-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.drawer-value { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: all; }
.drawer-actions { display: flex; gap: 6px; flex-shrink: 0; }
.drawer-copy {
  width: 38px; height: 38px; border-radius: 10px; border: 0; cursor: pointer;
  display: grid; place-items: center;
  background: var(--card); color: var(--muted);
  transition: color .15s, background .15s;
}
.drawer-copy:hover { color: var(--text); }
.drawer-copy.is-done { color: #34c759; }
.drawer-copy svg { width: 17px; height: 17px; }
.drawer-cta {
  display: inline-flex; align-items: center; height: 38px; padding: 0 14px;
  border-radius: 10px; background: var(--accent); color: var(--on-accent);
  font-weight: 700; font-size: 13.5px; text-decoration: none; white-space: nowrap;
}
.drawer-cta:hover { background: var(--accent-strong); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 13px; font-weight: 600; text-decoration: none;
  transition: border-color .15s, background .15s;
}
.chip:hover { border-color: var(--accent-strong); background: var(--panel); }
.chip svg { width: 14px; height: 14px; }

.more { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.more .chip { cursor: pointer; background: transparent; }
.reset { margin-top: 18px; background: none; border: 0; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Map ---------- */
.mapwrap { position: relative; min-height: 0; }
.map { position: absolute; inset: 0; }
.map-hint {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line);
  padding: 12px 18px; border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 14px; font-weight: 600;
  white-space: nowrap;
  animation: rise .25s ease both;
}
.maplibregl-ctrl-attrib { font-size: 10px; }
[data-theme="dark"] .maplibregl-ctrl-attrib { background: rgba(0,0,0,.55); color: #aaa; }
[data-theme="dark"] .maplibregl-ctrl-attrib a { color: #ccc; }
[data-theme="dark"] .maplibregl-ctrl-group { background: #15150f; }
[data-theme="dark"] .maplibregl-ctrl-group button + button { border-top-color: rgba(255,255,255,.1); }
[data-theme="dark"] .maplibregl-ctrl-icon { filter: invert(1); }
.maplibregl-canvas { outline: none; }

/* ---------- Teaser ---------- */
.teaser { position: fixed; inset: 0; cursor: pointer; overflow: hidden; }
.teaser .map { cursor: pointer; }
.teaser .map canvas { cursor: pointer !important; }
.teaser::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 38%;
  background: linear-gradient(to top, color-mix(in srgb, var(--bg) 70%, transparent), transparent);
  pointer-events: none;
}
.teaser-cta {
  position: absolute; left: 20px; bottom: 20px; z-index: 5;
  display: inline-flex; align-items: center; gap: 12px;
  padding: 14px 16px 14px 20px;
  border-radius: 999px; border: 0;
  background: var(--accent); color: var(--on-accent);
  font-weight: 700; font-size: 15px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .15s, background .15s;
}
.teaser-cta svg { width: 20px; height: 20px; }
.teaser:hover .teaser-cta { transform: translateY(-2px); background: var(--accent-strong); }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .finder { display: flex; flex-direction: column; height: auto; min-height: 100vh; }
  .panel { border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .panel-inner { padding: 24px 18px 26px; }
  .wordmark { margin-bottom: 20px; }
  h1 { font-size: 25px; }
  .mapwrap { order: -1; height: 46vh; min-height: 280px; flex: 0 0 auto; }
  .map-hint { bottom: 16px; white-space: normal; text-align: center; width: max-content; max-width: 88%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Footer im Such-Panel + Datenschutz ---------- */
.panel { display: flex; flex-direction: column; }
.panel-inner { flex: 1 0 auto; }
.panel-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px;
  padding: 14px 32px 18px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted);
}
.panel-foot a, .panel-foot .linkish { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.panel-foot a:hover, .panel-foot .linkish:hover { color: var(--text); }
.linkish { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.pf-by { margin-left: auto; opacity: .7; }

dialog.privacy {
  border: 0; padding: 0; margin: auto;
  width: min(680px, calc(100% - 32px)); max-height: min(86vh, 900px);
  border-radius: 18px; background: var(--panel); color: var(--text);
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
}
dialog.privacy::backdrop { background: rgba(0,0,0,.45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.privacy-inner { position: relative; max-height: min(86vh, 900px); overflow-y: auto; padding: 34px 34px 30px; }
.privacy-close {
  position: sticky; top: 0; float: right; margin: -14px -14px 0 12px;
  width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--card); color: var(--text);
}
.privacy-close svg { width: 16px; height: 16px; }
.privacy-body h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.015em; margin-bottom: 10px; }
.privacy-body h3 { font-size: 14.5px; font-weight: 700; margin: 20px 0 6px; }
.privacy-body p { font-size: 14px; line-height: 1.6; color: var(--muted); }
.privacy-body p strong { color: var(--text); font-weight: 600; }
.privacy-body .pv-lead { font-size: 15px; color: var(--text); }
.privacy-body .pv-more { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); }
.privacy-body a { color: var(--text); }
@media (max-width: 760px) {
  .panel-foot { padding: 14px 18px 20px; }
  .pf-by { margin-left: 0; width: 100%; }
  .privacy-inner { padding: 26px 20px 24px; }
}
