:root {
  --bg: #020807;
  --bg2: #041410;
  --panel: rgba(4, 22, 18, .88);
  --panel2: rgba(1, 10, 9, .95);
  --line: rgba(0, 255, 208, .28);
  --line-strong: rgba(0, 255, 208, .72);
  --text: #eafff9;
  --muted: #89bbb0;
  --cyan: #00ffd0;
  --green: #7dff7a;
  --red: #ff3f6c;
  --amber: #ffdc6c;
  --shadow: 0 0 28px rgba(0, 255, 208, .14);
  --radius: 22px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(0, 255, 208, .17), transparent 34rem),
    radial-gradient(circle at 85% 10%, rgba(125, 255, 122, .08), transparent 26rem),
    linear-gradient(180deg, #020908 0%, #000 100%);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}

button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }

.app-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 14px 12px calc(22px + var(--safe-bottom));
}

.hero-panel,
.panel {
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(5, 28, 24, .94), rgba(1, 6, 6, .94));
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 0 34px rgba(0, 255, 208, .04);
  overflow: hidden;
  position: relative;
}

.hero-panel { padding: 16px; margin-bottom: 12px; }
.hero-panel::after,
.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.055), transparent);
  transform: translateX(-120%);
  animation: sheen 8s infinite;
}
@keyframes sheen { 0%, 35% { transform: translateX(-120%); } 55%, 100% { transform: translateX(120%); } }
.hero-content, .panel > * { position: relative; z-index: 1; }

.brand-row { display: flex; gap: 14px; align-items: center; }
.jarvis-orb {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: radial-gradient(circle, rgba(183,255,241,.95), rgba(0,255,208,.2) 38%, rgba(0,0,0,.92) 68%);
  box-shadow: 0 0 28px rgba(0,255,208,.38), inset 0 0 16px rgba(0,255,208,.55);
  display: grid; place-items: center;
  flex: 0 0 auto;
}
.jarvis-orb span { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--cyan); box-shadow: 0 0 16px var(--cyan); }

.eyebrow { margin: 0 0 4px; color: var(--cyan); font-size: .75rem; letter-spacing: .18em; text-transform: uppercase; }
h1, h2 { margin: 0; letter-spacing: .02em; }
h1 { font-size: clamp(2rem, 8vw, 4.3rem); line-height: .95; text-shadow: 0 0 28px rgba(0,255,208,.35); }
h2 { font-size: clamp(1.15rem, 4vw, 1.5rem); }
.subline { margin: 6px 0 0; color: var(--muted); }

.scanner {
  height: 12px;
  margin: 16px 0;
  border-radius: 999px;
  border: 1px solid rgba(255,63,108,.38);
  background: rgba(255,63,108,.08);
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(255,63,108,.15);
}
.scanner span {
  display: block;
  width: 38%; height: 100%;
  background: linear-gradient(90deg, transparent, #ff3f6c, #fff, #ff3f6c, transparent);
  filter: blur(.2px);
  animation: scan 2.8s ease-in-out infinite;
}
@keyframes scan { 0% { transform: translateX(-100%); } 50% { transform: translateX(230%); } 100% { transform: translateX(-100%); } }

.status-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.status-card {
  padding: 10px;
  border: 1px solid rgba(0,255,208,.18);
  border-radius: 16px;
  background: rgba(0, 0, 0, .28);
  min-width: 0;
}
.status-card strong { display: block; color: var(--green); font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-card span { display: block; color: var(--muted); font-size: .72rem; margin-top: 2px; }

.quick-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 8px 0;
  backdrop-filter: blur(14px);
}
.quick-nav a {
  color: var(--text);
  text-decoration: none;
  text-align: center;
  border: 1px solid rgba(0,255,208,.25);
  background: rgba(0, 14, 12, .88);
  padding: 10px 4px;
  border-radius: 999px;
  font-size: .76rem;
  letter-spacing: .05em;
}
.quick-nav a:active { transform: translateY(1px); }

.layout-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.panel { padding: 14px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(0,255,208,.28);
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(0,0,0,.34);
  font-size: .75rem;
  white-space: nowrap;
}

.jarvis-display {
  min-height: 112px;
  padding: 14px;
  border: 1px solid rgba(125,255,122,.24);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(0,0,0,.5), rgba(0, 40, 33, .18));
  box-shadow: inset 0 0 22px rgba(0,255,208,.08);
}
.display-prefix { color: var(--green); letter-spacing: .2em; font-size: .72rem; }
.jarvis-display p { margin: 8px 0 0; line-height: 1.45; }

.input-label { display: block; margin: 12px 0 6px; color: var(--cyan); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.input-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.address-search-row { grid-template-columns: minmax(0, 1fr) 96px auto; }
.house-number-input { text-align: center; font-weight: 800; letter-spacing: .04em; }
.compact-hint { margin-top: 6px; font-size: .8rem; }
input, select {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(0,255,208,.24);
  border-radius: 14px;
  padding: 0 12px;
  background: rgba(0,0,0,.48);
  color: var(--text);
  outline: none;
}
input:focus, select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,255,208,.12); }
select option { background: #041410; color: var(--text); }
.hint { color: var(--muted); font-size: .88rem; line-height: 1.45; margin: 10px 0 0; }

.btn, .mode-btn {
  min-height: 46px;
  border: 1px solid rgba(0,255,208,.28);
  border-radius: 14px;
  padding: 0 12px;
  color: var(--text);
  background: linear-gradient(180deg, rgba(0, 255, 208, .1), rgba(0,0,0,.42));
  box-shadow: inset 0 0 14px rgba(0,255,208,.04);
}
.btn.primary, .mode-btn.active {
  border-color: rgba(125,255,122,.58);
  color: #03120f;
  font-weight: 800;
  background: linear-gradient(180deg, #b7fff1, #00ffd0 42%, #1ee67c);
  text-shadow: none;
}
.btn.danger { border-color: rgba(255,63,108,.45); color: #ffd6df; }
.btn:active, .mode-btn:active { transform: translateY(1px) scale(.99); }
.button-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 10px; }
.voice-buttons { margin: 12px 0; }

.results, .places-list, .directions {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.result-item, .place-item, .direction-item {
  border: 1px solid rgba(0,255,208,.18);
  background: rgba(0,0,0,.32);
  border-radius: 16px;
  padding: 10px;
}
.result-item button, .place-actions button { min-height: 38px; border-radius: 12px; }
.result-title, .place-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 800; }
.result-title small, .place-title small { color: var(--muted); font-weight: 600; }
.result-address, .place-meta { color: var(--muted); font-size: .86rem; margin-top: 4px; line-height: 1.35; }
.place-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.save-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 8px; }

.map-toolbar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.map {
  height: min(68vh, 560px);
  min-height: 380px;
  border-radius: 20px;
  border: 1px solid rgba(0,255,208,.32);
  overflow: hidden;
  background: #07130f;
  box-shadow: inset 0 0 22px rgba(0,255,208,.12), 0 0 25px rgba(0,255,208,.08);
}
.map-big .map { height: calc(100vh - 136px); }
.leaflet-container { background: #07130f; font: inherit; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: #03130f; color: var(--text); border: 1px solid rgba(0,255,208,.35); }
.leaflet-control-attribution { background: rgba(0,0,0,.55) !important; color: #d9fff5 !important; }
.leaflet-control-attribution a { color: var(--cyan) !important; }
.marker-save { margin-top: 10px; border: 1px solid rgba(255,220,108,.28); border-radius: 16px; padding: 10px; background: rgba(255, 220, 108, .06); }
.marker-save p { margin: 0 0 8px; color: #fff0bd; }

.mode-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.route-hud { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.route-hud div {
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(0,255,208,.18);
  background: rgba(0,0,0,.28);
  text-align: center;
}
.route-hud strong { display: block; color: var(--green); font-size: 1.1rem; }
.route-hud span { color: var(--muted); font-size: .78rem; }
.route-summary { margin-top: 10px; padding: 10px; border-radius: 16px; background: rgba(0,0,0,.32); color: var(--muted); border: 1px solid rgba(0,255,208,.16); line-height: 1.45; }
.directions { padding-left: 0; list-style: none; max-height: 360px; overflow: auto; }
.direction-item { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.direction-number { color: var(--cyan); font-weight: 800; }
.direction-text { line-height: 1.35; }
.direction-distance { color: var(--muted); font-size: .83rem; margin-top: 2px; }

.footer-note { color: var(--muted); text-align: center; font-size: .84rem; padding: 8px 10px 0; line-height: 1.4; }

.toast {
  position: fixed;
  left: 50%; bottom: calc(16px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 1000;
  width: min(92vw, 520px);
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(0,255,208,.32);
  color: var(--text);
  background: rgba(1, 12, 10, .95);
  box-shadow: 0 0 24px rgba(0,255,208,.18);
  animation: toastIn .18s ease-out;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

.user-marker, .target-marker, .place-marker, .draft-marker, .picked-marker {
  border-radius: 50%;
  border: 2px solid #00120d;
  box-shadow: 0 0 14px rgba(0,255,208,.45);
}
.user-marker { background: var(--green); }
.target-marker { background: var(--red); }
.place-marker { background: var(--cyan); }
.draft-marker { background: var(--amber); }
.picked-marker { background: #fff; border-color: var(--green); box-shadow: 0 0 18px rgba(125,255,122,.78); }
.picked-marker .picked-cross { position: absolute; inset: 4px; border: 2px solid var(--green); border-radius: 50%; }
.picked-marker .picked-cross::before, .picked-marker .picked-cross::after { content: ""; position: absolute; left: 50%; top: 50%; background: var(--green); transform: translate(-50%, -50%); }
.picked-marker .picked-cross::before { width: 2px; height: 14px; }
.picked-marker .picked-cross::after { width: 14px; height: 2px; }

@media (min-width: 860px) {
  .app-shell { padding: 22px 18px 32px; }
  .layout-grid { grid-template-columns: 1fr 1.25fr; align-items: start; }
  .map-panel { grid-row: span 2; }
  .places-panel { grid-column: 1 / 2; }
  .route-panel { grid-column: 2 / 3; }
  .button-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 640px) {
  .status-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-nav { gap: 4px; }
  .quick-nav a { font-size: .68rem; padding: 9px 2px; }
  .hero-panel { padding: 14px; }
  .panel { padding: 12px; border-radius: 18px; }
  .input-row.stacked-mobile { grid-template-columns: 1fr; }
  .address-search-row { grid-template-columns: 1fr; }
  .house-number-input { text-align: left; }
  .button-grid, .map-toolbar, .place-actions { grid-template-columns: repeat(2, 1fr); }
  .save-grid { grid-template-columns: 1fr; }
  .map { height: 54vh; min-height: 330px; border-radius: 17px; }
  .route-hud { grid-template-columns: 1fr; }
  .brand-row { align-items: flex-start; }
  .jarvis-orb { width: 50px; height: 50px; }
}

@media (max-width: 390px) {
  .app-shell { padding-left: 8px; padding-right: 8px; }
  .quick-nav a { font-size: .62rem; }
  .btn, .mode-btn, input, select { min-height: 48px; }
}

/* v1.3-v1.5 DB / Sync comfort strip */
.sync-strip {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(0, 255, 208, .28);
  border-radius: 14px;
  background: rgba(0, 255, 208, .055);
  color: #b8fff4;
  font-size: .76rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  box-shadow: inset 0 0 18px rgba(0, 255, 208, .05);
}
.mini-btn {
  border: 1px solid rgba(125, 255, 122, .44);
  border-radius: 999px;
  padding: 6px 10px;
  min-height: 34px;
  background: rgba(125, 255, 122, .12);
  color: #d8ffd8;
  font-weight: 800;
  letter-spacing: .08em;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(125, 255, 122, .12);
}
.mini-btn:active { transform: translateY(1px); }
@media (max-width: 520px) {
  .sync-strip { font-size: .68rem; padding: 8px; }
  .mini-btn { min-width: 78px; }
}

/* v1.5 Session / Guest comfort */
.status-grid { grid-template-columns: repeat(5, 1fr); }
.quick-nav { grid-template-columns: repeat(6, 1fr); }
.session-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(0,255,208,.22);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(0,255,208,.075), rgba(0,0,0,.24));
  box-shadow: inset 0 0 20px rgba(0,255,208,.05);
}
.session-box p { margin: 6px 0 0; color: var(--text); line-height: 1.4; }
.hint code {
  color: var(--green);
  background: rgba(0,255,208,.08);
  border: 1px solid rgba(0,255,208,.16);
  border-radius: 7px;
  padding: 1px 5px;
}
@media (max-width: 640px) {
  .status-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-nav { grid-template-columns: repeat(3, 1fr); }
  .session-box { grid-template-columns: 1fr; }
}

/* v1.8 Responsive Comfort Layout -------------------------------------------------
   Ziel: gleiche Funktionen, aber übersichtlicher auf Desktop, Tablet und Mobile. */
.layout-assist {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 0 10px;
}
.layout-chip {
  border: 1px solid rgba(0,255,208,.22);
  background: rgba(0,0,0,.34);
  color: #bffdf1;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.tablet-hint, .mobile-hint { display: none; }

.quick-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  font-weight: 800;
  text-transform: uppercase;
  box-shadow: 0 0 18px rgba(0,255,208,.05);
}
.quick-nav a:hover, .quick-nav a:focus-visible,
.btn:hover, .mode-btn:hover, .chip-btn:hover {
  border-color: rgba(125,255,122,.58);
  box-shadow: 0 0 20px rgba(0,255,208,.13);
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}
.chip-btn {
  min-height: 38px;
  border: 1px solid rgba(0,255,208,.22);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--text);
  background: rgba(0,0,0,.34);
  font-weight: 750;
}
.chip-btn.active {
  color: #03120f;
  border-color: rgba(125,255,122,.7);
  background: linear-gradient(180deg, #b7fff1, #00ffd0 45%, #1ee67c);
}

.compass-card {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 12px;
  align-items: center;
  margin: 12px 0 6px;
  padding: 12px;
  border: 1px solid rgba(0,255,208,.22);
  border-radius: 18px;
  background: radial-gradient(circle at 58px 58px, rgba(0,255,208,.12), transparent 70px), rgba(0,0,0,.28);
}
.compass-ring {
  position: relative;
  width: 106px;
  height: 106px;
  border-radius: 50%;
  border: 1px solid rgba(0,255,208,.42);
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(0,255,208,.18) 50%, transparent calc(50% + 1px)),
    linear-gradient(0deg, transparent calc(50% - 1px), rgba(0,255,208,.18) 50%, transparent calc(50% + 1px)),
    radial-gradient(circle, rgba(0,255,208,.08), rgba(0,0,0,.42));
  box-shadow: inset 0 0 18px rgba(0,255,208,.08), 0 0 18px rgba(0,255,208,.08);
}
.compass-ring span {
  position: absolute;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 900;
}
.compass-ring .north { top: 6px; left: 50%; transform: translateX(-50%); color: var(--green); }
.compass-ring .east { right: 8px; top: 50%; transform: translateY(-50%); }
.compass-ring .south { bottom: 6px; left: 50%; transform: translateX(-50%); }
.compass-ring .west { left: 8px; top: 50%; transform: translateY(-50%); }
.compass-arrow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 74px;
  transform: translate(-50%, -50%) rotate(0deg);
  transform-origin: center center;
  transition: transform .32s ease;
}
.compass-arrow::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-bottom: 42px solid var(--green);
  filter: drop-shadow(0 0 8px rgba(125,255,122,.7));
}
.compass-arrow::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 5px;
  height: 35px;
  border-radius: 999px;
  transform: translateX(-50%);
  background: rgba(255,63,108,.86);
  box-shadow: 0 0 10px rgba(255,63,108,.48);
}
.compass-info strong {
  display: block;
  margin-top: 6px;
  color: var(--green);
  font-size: 1.08rem;
}
.compass-info p { margin: 5px 0 0; color: var(--muted); line-height: 1.4; }

/* bessere Listen: weniger Sucherei, klare Aktionen */
.place-item, .result-item, .route-summary, .session-box, .jarvis-display {
  backdrop-filter: blur(8px);
}
.place-actions button { padding-inline: 6px; font-size: .76rem; }
.results:empty::before,
.places-list:empty::before,
.directions:empty::before {
  content: "Noch keine Einträge.";
  display: block;
  color: var(--muted);
  border: 1px dashed rgba(0,255,208,.18);
  border-radius: 14px;
  padding: 12px;
  text-align: center;
}

/* Desktop: Navigationssystem als Cockpit, Karte im Zentrum */
@media (min-width: 1180px) {
  .app-shell { width: min(1480px, 100%); }
  .hero-content {
    display: grid;
    grid-template-columns: minmax(360px, .9fr) minmax(360px, 1.1fr);
    gap: 16px;
    align-items: center;
  }
  .scanner { grid-column: 1 / -1; margin: 4px 0 0; }
  .status-grid { grid-template-columns: repeat(5, 1fr); }
  .layout-grid {
    display: grid;
    grid-template-columns: minmax(320px, 380px) minmax(520px, 1fr) minmax(330px, 390px);
    grid-template-areas:
      "voice map search"
      "user  map places"
      "route map places";
    gap: 14px;
    align-items: start;
  }
  .voice-panel { grid-area: voice; }
  .user-panel { grid-area: user; }
  .controls-panel { grid-area: search; }
  .map-panel { grid-area: map; position: sticky; top: 68px; }
  .places-panel { grid-area: places; }
  .route-panel { grid-area: route; }
  .map { height: calc(100vh - 250px); min-height: 620px; }
  .map-big .map-panel { grid-column: 1 / -1; grid-row: auto; position: relative; top: auto; }
  .map-big .map { height: calc(100vh - 170px); min-height: 760px; }
  .button-grid { grid-template-columns: repeat(2, 1fr); }
  .map-toolbar { grid-template-columns: repeat(4, 1fr); }
  .places-list { max-height: calc(100vh - 270px); overflow: auto; padding-right: 3px; }
  .directions { max-height: 240px; }
}

/* Tablet: zwei Spalten, Karte bleibt groß und Formulare bleiben gut erreichbar */
@media (min-width: 760px) and (max-width: 1179px) {
  .desktop-hint, .mobile-hint { display: none; }
  .tablet-hint { display: inline-flex; }
  .app-shell { width: min(980px, 100%); padding-inline: 14px; }
  .layout-grid {
    grid-template-columns: minmax(300px, .9fr) minmax(360px, 1.1fr);
    grid-template-areas:
      "voice map"
      "search map"
      "places route"
      "user user";
  }
  .voice-panel { grid-area: voice; }
  .user-panel { grid-area: user; }
  .controls-panel { grid-area: search; }
  .map-panel { grid-area: map; }
  .places-panel { grid-area: places; }
  .route-panel { grid-area: route; }
  .map { height: 66vh; min-height: 500px; }
  .places-list, .directions { max-height: 420px; overflow: auto; }
  .address-search-row { grid-template-columns: 1fr 82px; }
  .address-search-row .btn { grid-column: 1 / -1; }
}

/* Mobile: app-artige Bedienung mit unterer Schnellleiste */
@media (max-width: 759px) {
  .desktop-hint, .tablet-hint { display: none; }
  .mobile-hint { display: inline-flex; }
  .app-shell { padding-bottom: calc(76px + var(--safe-bottom)); }
  .hero-panel { margin-bottom: 8px; }
  h1 { font-size: clamp(2rem, 12vw, 3rem); }
  .subline { font-size: .9rem; }
  .status-grid { grid-template-columns: repeat(2, 1fr); }
  .status-card { padding: 8px; border-radius: 14px; }
  .status-card strong { font-size: .86rem; }
  .quick-nav {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(8px + var(--safe-bottom));
    top: auto;
    z-index: 950;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    padding: 7px;
    border: 1px solid rgba(0,255,208,.24);
    border-radius: 20px;
    background: rgba(1, 12, 10, .92);
    box-shadow: 0 0 25px rgba(0,0,0,.45), 0 0 24px rgba(0,255,208,.12);
  }
  .quick-nav a {
    min-height: 50px;
    border-radius: 15px;
    padding: 4px 2px;
    font-size: .58rem;
    flex-direction: column;
    gap: 1px;
    background: rgba(0, 22, 18, .82);
  }
  .quick-nav a span { font-size: 1rem; line-height: 1; }
  .layout-assist { margin-top: 8px; }
  .layout-chip { font-size: .64rem; padding: 6px 8px; }
  .panel { margin-bottom: 10px; }
  .panel-head { position: sticky; top: 0; z-index: 2; padding-top: 2px; background: linear-gradient(180deg, rgba(4, 22, 18, .96), rgba(4, 22, 18, .78)); backdrop-filter: blur(10px); border-radius: 14px; }
  .map { height: 58vh; min-height: 390px; }
  .map-big .map { height: calc(100vh - 154px); min-height: 520px; }
  .button-grid, .map-toolbar, .place-actions { grid-template-columns: repeat(2, 1fr); }
  .btn, .mode-btn, input, select { min-height: 50px; }
  .route-hud { grid-template-columns: repeat(3, 1fr); }
  .route-hud div { padding: 8px 4px; }
  .route-hud strong { font-size: .94rem; }
  .compass-card { grid-template-columns: 92px 1fr; padding: 10px; }
  .compass-ring { width: 84px; height: 84px; }
  .compass-arrow { height: 58px; }
  .compass-arrow::before { border-left-width: 9px; border-right-width: 9px; border-bottom-width: 32px; }
  .category-chips { display: grid; grid-template-columns: repeat(2, 1fr); }
  .chip-btn { min-height: 42px; }
}

@media (max-width: 420px) {
  .quick-nav a { font-size: .52rem; }
  .quick-nav a span { font-size: .95rem; }
  .brand-row { gap: 10px; }
  .status-grid { gap: 6px; }
  .route-hud { grid-template-columns: 1fr; }
  .compass-card { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .compass-info { width: 100%; }
  .place-actions { grid-template-columns: 1fr 1fr; }
}

/* v1.9 Live Cockpit / Beifahreransicht ------------------------------------ */
.camera-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 10px 0;
}
.follow-btn {
  min-height: 42px;
  border: 1px solid rgba(0,255,208,.26);
  border-radius: 14px;
  padding: 0 8px;
  color: var(--text);
  background: linear-gradient(180deg, rgba(0, 255, 208, .08), rgba(0,0,0,.38));
  font-weight: 800;
  font-size: .78rem;
}
.follow-btn.active {
  border-color: rgba(125,255,122,.72);
  color: #03120f;
  background: linear-gradient(180deg, #b7fff1, #00ffd0 45%, #1ee67c);
}
.live-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.live-strip > div {
  padding: 9px 10px;
  border: 1px solid rgba(0,255,208,.18);
  border-radius: 15px;
  background: rgba(0,0,0,.31);
  text-align: center;
}
.live-strip span {
  display: block;
  color: var(--muted);
  font-size: .7rem;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.live-strip strong {
  display: block;
  margin-top: 3px;
  color: var(--green);
  font-size: .86rem;
}
.map-toolbar { grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); }
.route-hud { grid-template-columns: repeat(4, 1fr); }
.user-marker {
  position: relative;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
.user-marker .user-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid #00120d;
  background: var(--green);
  box-shadow: 0 0 16px rgba(125,255,122,.72), 0 0 0 7px rgba(125,255,122,.13);
}
.user-marker .user-arrow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform: translate(-50%, -100%) rotate(var(--bearing, 0deg));
  transform-origin: 50% 100%;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 24px solid var(--green);
  filter: drop-shadow(0 0 8px rgba(125,255,122,.75));
}
body.map-big .live-strip { position: relative; z-index: 2; }
@media (max-width: 759px) {
  .camera-tabs { grid-template-columns: repeat(2, 1fr); }
  .live-strip { grid-template-columns: 1fr; }
  .route-hud { grid-template-columns: repeat(2, 1fr); }
  .map-toolbar { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .route-hud { grid-template-columns: 1fr; }
}

/* v2.0 Coordinates / Copy / Direct Target --------------------------------- */
.coord-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.coord-card {
  padding: 10px;
  border: 1px solid rgba(0,255,208,.2);
  border-radius: 16px;
  background: rgba(0,0,0,.32);
  min-width: 0;
}
.coord-card span {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.coord-card strong {
  display: block;
  margin-top: 4px;
  color: var(--green);
  font-size: .9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.coord-card-wide { border-color: rgba(125,255,122,.34); background: rgba(20, 50, 24, .24); }
.picked-coord-grid { margin-top: 8px; }
.map-pick-box {
  margin-top: 10px;
  border: 1px solid rgba(125,255,122,.34);
  border-radius: 16px;
  padding: 10px;
  background: linear-gradient(135deg, rgba(125,255,122,.12), rgba(0,255,208,.06));
  box-shadow: inset 0 0 20px rgba(125,255,122,.05);
}
.map-pick-box p { margin: 0; color: #d8ffd2; }

.coord-copy-grid { margin-top: 0; margin-bottom: 4px; }
.coords-panel input { letter-spacing: .02em; }
.live-strip { grid-template-columns: repeat(4, 1fr); }

@media (min-width: 1180px) {
  .layout-grid {
    grid-template-areas:
      "voice map search"
      "user  map coords"
      "route map places";
  }
  .coords-panel { grid-area: coords; }
}

@media (min-width: 760px) and (max-width: 1179px) {
  .layout-grid {
    grid-template-areas:
      "voice map"
      "search map"
      "coords route"
      "places route"
      "user user";
  }
  .coords-panel { grid-area: coords; }
}

@media (max-width: 1179px) and (min-width: 760px) {
  .coord-grid { grid-template-columns: repeat(2, 1fr); }
  .coord-card-wide { grid-column: 1 / -1; }
}

@media (max-width: 759px) {
  .quick-nav { grid-template-columns: repeat(7, 1fr); }
  .quick-nav a { font-size: .5rem; }
  .coord-grid { grid-template-columns: 1fr; }
  .live-strip { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 420px) {
  .quick-nav { overflow-x: auto; grid-template-columns: repeat(7, minmax(54px, 1fr)); }
  .quick-nav a { min-width: 54px; }
  .live-strip { grid-template-columns: 1fr; }
}
.quick-nav { grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); }
@media (max-width: 759px) {
  .quick-nav { grid-template-columns: repeat(7, 1fr); }
}
@media (max-width: 420px) {
  .quick-nav { overflow-x: auto; grid-template-columns: repeat(7, minmax(54px, 1fr)); }
}

/* v2.1 Cover / favicon / SEO layout */
.hero-cover {
  margin: 2px 0 14px;
  border: 1px solid rgba(0,255,208,.24);
  border-radius: 22px;
  overflow: hidden;
  background: rgba(0,0,0,.28);
  box-shadow: 0 0 24px rgba(0,255,208,.10), inset 0 0 18px rgba(0,255,208,.05);
}
.hero-cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
@media (min-width: 1180px) {
  .hero-cover {
    margin: 0;
    grid-column: 2 / 3;
    grid-row: 1 / span 3;
    align-self: stretch;
  }
  .brand-row,
  .status-grid,
  .sync-strip,
  .scanner {
    grid-column: 1 / 2;
  }
  .hero-cover img {
    height: 100%;
    min-height: 320px;
  }
}


.domain-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-top: .45rem;
  color: var(--cyan);
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  opacity: .9;
}

.domain-link:hover,
.domain-link:focus-visible {
  color: var(--green);
  text-shadow: 0 0 14px rgba(94,255,94,.55);
}


.voice-compat {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(0,255,208,.22);
  border-radius: 14px;
  background: rgba(0,255,208,.055);
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.35;
}
.voice-compat strong { color: var(--cyan); }
.voice-compat.ok { border-color: rgba(125,255,122,.45); background: rgba(125,255,122,.07); }
.voice-compat.warn { border-color: rgba(255,220,108,.5); background: rgba(255,220,108,.08); }
.voice-compat.bad { border-color: rgba(255,63,108,.5); background: rgba(255,63,108,.08); }

/* v2.8 Local STT echo guard */
.local-stt-box {
  margin: 10px 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 255, 180, 0.22);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(0, 255, 180, 0.06), rgba(0, 150, 255, 0.04));
  box-shadow: inset 0 0 18px rgba(0, 255, 180, 0.05);
}
.local-stt-box p {
  margin: 8px 0 0;
  font-size: 0.86rem;
  color: rgba(230, 255, 245, 0.86);
  line-height: 1.35;
}
.local-stt-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(0, 255, 180, 0.24);
  background: rgba(0, 0, 0, 0.35);
}
.local-stt-bar span {
  display: block;
  width: 12%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(0, 255, 150, 0.55), rgba(0, 245, 255, 0.95), rgba(0, 255, 150, 0.55));
  box-shadow: 0 0 16px rgba(0, 255, 210, 0.8);
  transition: width 0.3s ease;
}
.local-stt-box.loading .local-stt-bar span,
.local-stt-box.recording .local-stt-bar span,
.local-stt-box.transcribing .local-stt-bar span {
  animation: jarvisPulseStt 1.1s ease-in-out infinite;
}

.local-stt-box.ignored {
  border-color: rgba(255, 220, 108, 0.45);
  background: linear-gradient(135deg, rgba(255, 220, 108, 0.07), rgba(0, 255, 180, 0.035));
}
.local-stt-box.ignored .local-stt-bar span {
  background: linear-gradient(90deg, rgba(255, 220, 108, 0.65), rgba(0, 245, 255, 0.9));
}

.local-stt-box.error {
  border-color: rgba(255, 80, 80, 0.45);
  background: linear-gradient(135deg, rgba(255, 60, 60, 0.07), rgba(255, 180, 0, 0.04));
}
.local-stt-box.error .local-stt-bar span {
  background: linear-gradient(90deg, rgba(255, 70, 70, 0.7), rgba(255, 180, 0, 0.95));
}
@keyframes jarvisPulseStt {
  0%, 100% { filter: brightness(0.85); opacity: 0.75; }
  50% { filter: brightness(1.45); opacity: 1; }
}
@media (max-width: 640px) {
  .voice-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .local-stt-box p {
    font-size: 0.82rem;
  }
}


/* v3.0 Voice command accordion + STT persistence */
.secondary-voice-buttons {
  margin-top: .65rem;
}
.voice-command-accordion {
  margin-top: .9rem;
  border: 1px solid rgba(0, 255, 170, .22);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(0, 255, 170, .06), rgba(0, 180, 255, .035));
  box-shadow: inset 0 0 20px rgba(0, 255, 170, .04);
  overflow: hidden;
}
.voice-command-accordion summary {
  cursor: pointer;
  list-style: none;
  padding: .9rem 1rem;
  color: #baffee;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  user-select: none;
}
.voice-command-accordion summary::-webkit-details-marker { display: none; }
.voice-command-accordion summary::after {
  content: '+';
  float: right;
  color: #00ff9d;
  text-shadow: 0 0 12px rgba(0, 255, 157, .7);
}
.voice-command-accordion[open] summary::after { content: '−'; }
.voice-command-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem;
  padding: 0 1rem 1rem;
}
.voice-command-grid > div {
  border: 1px solid rgba(0, 255, 170, .14);
  border-radius: 14px;
  padding: .75rem;
  background: rgba(0, 10, 8, .38);
}
.voice-command-grid h3 {
  margin: 0 0 .45rem;
  color: #00ffc8;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.voice-command-grid p {
  margin: .28rem 0;
  color: rgba(235, 255, 250, .86);
  font-size: .83rem;
  line-height: 1.35;
}
@media (max-width: 720px) {
  .voice-command-grid { grid-template-columns: 1fr; }
  .voice-command-accordion summary { padding: .85rem; }
}


/* v3.0 Real Navi Guidance */
.guidance-panel {
  display: grid;
  grid-template-columns: 1.3fr .8fr .9fr;
  gap: .72rem;
  margin: .85rem 0 1rem;
}
.guidance-card {
  border: 1px solid rgba(0, 255, 170, .22);
  border-radius: 18px;
  padding: .85rem;
  background: linear-gradient(145deg, rgba(0, 255, 170, .075), rgba(0, 185, 255, .045));
  box-shadow: inset 0 0 22px rgba(0, 255, 170, .045), 0 0 18px rgba(0, 255, 170, .045);
  min-height: 88px;
}
.guidance-card span {
  display: block;
  color: rgba(190, 255, 234, .72);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: .35rem;
}
.guidance-card strong {
  display: block;
  color: #eafff9;
  font-size: .96rem;
  line-height: 1.25;
  text-shadow: 0 0 14px rgba(0, 255, 200, .35);
}
.guidance-card-main strong {
  color: #00ffc8;
  font-size: 1.05rem;
}
.guidance-card em {
  display: block;
  margin-top: .35rem;
  color: #ffdc6c;
  font-style: normal;
  font-weight: 800;
}
.direction-item.active-step {
  border-color: rgba(0, 255, 170, .5);
  background: linear-gradient(135deg, rgba(0, 255, 170, .13), rgba(0, 195, 255, .065));
  box-shadow: 0 0 18px rgba(0, 255, 170, .10);
}
.direction-item.active-step .direction-number {
  background: #00ff9d;
  color: #00110c;
  box-shadow: 0 0 16px rgba(0, 255, 157, .55);
}
.status-card strong#statusGpsQuality,
.status-card strong#statusVersion {
  color: #00ffc8;
}
.leaflet-interactive {
  transition: stroke .25s ease, fill .25s ease;
}
@media (max-width: 980px) {
  .guidance-panel { grid-template-columns: 1fr; }
  .guidance-card { min-height: auto; }
}
@media (max-width: 640px) {
  .guidance-card { padding: .75rem; border-radius: 15px; }
  .guidance-card-main strong { font-size: .98rem; }
}


/* v3.1 Mobile GPS Share Routing */
.mobile-menu-toggle {
  display: none;
  width: 100%;
  min-height: 48px;
  margin: 0 0 8px;
  border: 1px solid rgba(125,255,122,.48);
  border-radius: 16px;
  color: #03120f;
  font-weight: 900;
  letter-spacing: .08em;
  background: linear-gradient(180deg, #b7fff1, #00ffd0 42%, #1ee67c);
}
.share-box {
  display: grid;
  gap: 8px;
}
.route-preference-box {
  margin: 10px 0;
  padding: 10px;
  border: 1px solid rgba(0,255,208,.18);
  border-radius: 16px;
  background: rgba(0,0,0,.2);
}
.gps-poor, .gps-filtered {
  border-color: rgba(255, 220, 108, .55) !important;
  box-shadow: 0 0 0 2px rgba(255,220,108,.12), var(--shadow) !important;
}

@media (max-width: 759px) {
  .app-shell { padding: 8px 8px calc(82px + var(--safe-bottom)); }
  .hero-panel { padding: 10px; margin-bottom: 8px; }
  .hero-cover { display: none; }
  .brand-row { align-items: flex-start; }
  .jarvis-orb { width: 42px; height: 42px; }
  h1 { font-size: clamp(1.9rem, 12vw, 3rem); }
  .subline, .domain-link, .layout-assist { font-size: .78rem; }
  .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .status-card { padding: 8px; border-radius: 12px; }
  .status-card strong { font-size: .78rem; }
  .mobile-menu-toggle { display: block; position: sticky; top: 0; z-index: 30; }
  .quick-nav {
    display: none;
    position: sticky;
    top: 54px;
    z-index: 29;
    grid-template-columns: repeat(2, 1fr) !important;
    padding: 8px;
    border: 1px solid rgba(0,255,208,.18);
    border-radius: 18px;
    background: rgba(0,10,9,.96);
    box-shadow: 0 18px 40px rgba(0,0,0,.45);
  }
  body.mobile-menu-open .quick-nav { display: grid; }
  .quick-nav a { min-width: 0 !important; font-size: .8rem !important; padding: 12px 8px; }
  .layout-grid { display: flex; flex-direction: column; gap: 10px; }
  .map-panel { order: 1; }
  .route-panel { order: 2; }
  .controls-panel { order: 3; }
  .coords-panel { order: 4; }
  .places-panel { order: 5; }
  .share-panel { order: 6; }
  .voice-panel { order: 7; }
  .user-panel { order: 8; }
  .panel { padding: 10px; border-radius: 18px; }
  .panel-head { margin-bottom: 8px; }
  .map { height: min(62vh, 520px) !important; min-height: 360px; }
  .map-toolbar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .map-toolbar .btn { min-height: 42px; padding: 0 6px; font-size: .72rem; }
  .live-strip { grid-template-columns: repeat(2, 1fr) !important; gap: 6px; }
  .button-grid, .coord-copy-grid, .picked-coord-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
  .address-search-row { grid-template-columns: 1fr 76px; }
  .address-search-row .btn { grid-column: 1 / -1; }
  .route-hud, .guidance-panel { grid-template-columns: repeat(2, 1fr) !important; }
  .guidance-card-main { grid-column: 1 / -1; }
  .jarvis-display { min-height: auto; padding: 10px; }
  .voice-panel .button-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-note { font-size: .76rem; }
}
