:root {
  /* NEXUS-Designsystem V1.4 – alle Komponenten nutzen diese Variablen */
  --bg: #030b14;
  --bg2: #071b29;
  --panel: rgba(7, 27, 41, 0.78);
  --panel-solid: #071b29;
  --line: rgba(0, 229, 255, 0.26);
  --line-strong: rgba(0, 229, 255, 0.58);
  --cyan: #00e5ff;
  --teal: #00e5ff;
  --violet: #a855f7;
  --text: #eafbff;
  --muted: #8db4c6;
  --ok: #00e68a;
  --warn: #ffc233;
  --bad: #ff4d5e;
  --sim: #ffb020;
  --radius: 12px;
  --glow: 0 0 12px rgba(0, 229, 255, 0.32);
  --glow-violet: 0 0 12px rgba(168, 85, 247, 0.35);
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--cyan);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: radial-gradient(1200px 700px at 50% 0%, #0a2a40 0%, var(--bg) 60%);
  color: var(--text);
  font-size: 14px;
  overflow: hidden;
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr) 60px;
  gap: 10px;
  padding: 0 14px 12px;
}
.bg-grid {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .35;
  background-image: linear-gradient(rgba(25,227,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(25,227,255,.06) 1px, transparent 1px);
  background-size: 44px 44px;
}
.hidden { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.panel {
  position: relative; z-index: 1;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: inset 0 0 30px rgba(25,227,255,.05), 0 0 22px rgba(0,0,0,.45);
  backdrop-filter: blur(6px);
}
.panel::before, .panel::after {
  content: ""; position: absolute; width: 16px; height: 16px; pointer-events: none;
  border: 2px solid var(--cyan); filter: drop-shadow(0 0 4px var(--cyan));
}
.panel::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.panel::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }

/* ---- Top bar ---- */
.topbar { position: relative; z-index: 2; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--cyan); min-width: 250px; }
.brand-logo { width: 42px; height: 42px; filter: drop-shadow(0 0 6px var(--cyan)); }
.brand-name { font-size: 30px; font-weight: 300; letter-spacing: 4px; color: #eaffff; text-shadow: var(--glow); }
.brand-name small { font-size: 22px; letter-spacing: 3px; color: #9fdcf0; }
.topnav { display: flex; gap: 10px; flex: 1; justify-content: center; }
.chip {
  padding: 8px 20px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(4,20,36,.8); color: var(--text); font-size: 15px;
}
.chip.disabled { opacity: .55; cursor: default; }
.chip.active { border-color: var(--cyan); color: var(--teal); box-shadow: var(--glow), inset 0 0 12px rgba(25,227,255,.2); }
.top-right { display: flex; align-items: center; gap: 16px; }
.clock { font-variant-numeric: tabular-nums; font-size: 15px; }
.icon-btn {
  position: relative; background: none; border: 0; color: var(--cyan); width: 36px; height: 36px; border-radius: 8px;
  display: grid; place-items: center; font-size: 16px;
}
.icon-btn:hover { background: rgba(25,227,255,.12); }
.icon-btn svg { width: 24px; height: 24px; }
.badge { position: absolute; top: 4px; right: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 8px var(--bad); }

/* ---- Layout ---- */
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr) 340px; gap: 12px; min-height: 0; }
.sidebar { padding: 14px 12px; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.side-head { display: flex; gap: 12px; align-items: center; padding: 4px 4px 10px; }
.side-head strong { display: block; font-size: 17px; letter-spacing: .5px; }
.side-head span { font-size: 12px; color: var(--muted); }
.side-ico { width: 40px; height: 40px; padding: 8px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--cyan); background: rgba(25,227,255,.1); flex: none; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-item {
  display: flex; align-items: center; gap: 14px; padding: 11px 14px; border-radius: 8px;
  background: none; border: 1px solid transparent; text-align: left; font-size: 16px; color: var(--text);
}
.side-item svg { width: 22px; height: 22px; color: var(--cyan); flex: none; }
.side-item:hover:not(:disabled) { background: rgba(25,227,255,.08); }
.side-item.active { background: linear-gradient(90deg, rgba(20,241,217,.28), rgba(25,227,255,.08)); border-color: var(--line-strong); box-shadow: var(--glow); }
.side-item:disabled { opacity: .45; cursor: not-allowed; }
.globe { margin-top: auto; height: 170px; position: relative; display: grid; place-items: center; }
.globe-sphere {
  width: 130px; height: 130px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(120,235,255,.85), rgba(15,110,170,.55) 45%, rgba(3,30,60,.9) 75%);
  box-shadow: 0 0 40px rgba(25,227,255,.55), inset 0 0 25px rgba(0,0,0,.6);
  position: relative; overflow: hidden;
}
.globe-sphere::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 18px, rgba(190,250,255,.25) 18px 19px), repeating-linear-gradient(0deg, transparent 0 18px, rgba(190,250,255,.25) 18px 19px);
  border-radius: 50%; animation: spin 14s linear infinite; background-size: 38px 38px;
}
.globe-base { position: absolute; bottom: 6px; width: 150px; height: 26px; border-radius: 50%; border: 1px solid var(--cyan); box-shadow: 0 0 16px var(--cyan); opacity: .6; }
@keyframes spin { to { background-position: 38px 0, 0 0; } }
.service { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(4,30,40,.7); }
.service .dot { width: 26px; height: 26px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 14px var(--warn); }
.service.online .dot { background: var(--ok); box-shadow: 0 0 14px var(--ok); }
.service.offline .dot { background: var(--bad); box-shadow: 0 0 14px var(--bad); }
.service .lbl { display: block; font-size: 13px; }
.service strong { color: var(--ok); }
.service.offline strong { color: var(--bad); }

/* ---- Map ---- */
.map-wrap { overflow: hidden; padding: 0; min-height: 0; }
#map { position: absolute; inset: 0; border-radius: 10px; background: #031122; z-index: 0; }
.map-wrap::after { z-index: 600; }
.map-wrap::before { z-index: 600; }
.map-tools { position: absolute; top: 14px; right: 14px; display: flex; gap: 10px; z-index: 700; }
.map-zoom { position: absolute; right: 14px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 700; }
.tool {
  width: 42px; height: 42px; display: grid; place-items: center; font-size: 24px; line-height: 1;
  background: rgba(4,20,36,.88); border: 1px solid var(--line-strong); border-radius: 8px; color: var(--cyan); box-shadow: var(--glow);
}
.tool svg { width: 22px; height: 22px; }
.tool:hover { background: rgba(25,227,255,.2); }
.tool.on { background: rgba(25,227,255,.3); }
.sim-banner {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 700;
  padding: 6px 18px; border: 1px solid var(--sim); color: var(--sim); background: rgba(40,24,0,.82);
  border-radius: 999px; letter-spacing: 1.5px; font-size: 12px; font-weight: 600; box-shadow: 0 0 14px rgba(255,176,32,.4);
}

.maplibregl-canvas { outline: none; }
.maplibregl-ctrl-attrib { background: rgba(2,10,20,.75) !important; color: var(--muted) !important; font-size: 10px; border-radius: 6px; }
.maplibregl-ctrl-attrib a { color: var(--cyan) !important; }
.maplibregl-ctrl-attrib-button { filter: invert(1); }
.map-status {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 700; max-width: 80%;
  padding: 8px 18px; border: 1px solid var(--bad); color: #ffd7db; background: rgba(40,4,10,.9); border-radius: 8px; font-size: 13px;
}
.layer-pop { position: absolute; top: 66px; right: 14px; z-index: 700; width: 210px; padding: 12px 14px; background: rgba(4,18,34,.95); }
.layer-pop h4 { margin: 4px 0 6px; font-size: 13px; color: var(--cyan); font-weight: 600; }
.layer-pop h4:not(:first-child) { margin-top: 12px; }
.layer-pop label { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; font-size: 13.5px; }
.layer-pop input { accent-color: var(--cyan); }
.wt-marker { width: 0; height: 0; cursor: pointer; }
.wt-marker .dot { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px; border-radius: 50%; background: var(--c); border: 2px solid #fff; box-shadow: 0 0 12px var(--c), 0 0 24px var(--c); }
.wt-marker .ring { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px; border-radius: 50%; border: 2px solid var(--c); animation: pulse 2s ease-out infinite; }
.wt-marker.online { --c: var(--cyan); }
.wt-marker.stale { --c: var(--warn); }
.wt-marker.stale .ring, .wt-marker.offline .ring { animation: none; opacity: .35; }
.wt-marker.offline { --c: #7a8a96; }
.wt-marker.sim { --c: var(--sim); }
.wt-marker.sim.stale, .wt-marker.sim.offline { --c: #8d7a52; }
@keyframes pulse { 0% { transform: scale(.35); opacity: 1; } 100% { transform: scale(1.1); opacity: 0; } }
.wt-tip {
  position: absolute; left: 26px; top: 0; transform: translateY(-50%); white-space: nowrap; pointer-events: none;
  background: rgba(3,16,30,.92); border: 1px solid var(--line-strong); color: var(--text);
  border-radius: 8px; padding: 8px 12px; box-shadow: var(--glow);
}
.wt-marker.sim .wt-tip .sub { color: var(--sim); }
.wt-tip strong { display: block; font-size: 15px; }
.wt-tip .sub { color: var(--teal); font-size: 12.5px; }
.wt-tip.sim .sub { color: var(--sim); }
.wt-tip .coords { font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* ---- Right column ---- */
.right { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.device-card { padding: 16px; }
.empty { color: var(--muted); padding: 30px 0; text-align: center; }
.device-head { display: grid; grid-template-columns: 62px 1fr; gap: 14px; align-items: start; }
.phone-img { width: 62px; height: 108px; border-radius: 12px; border: 2px solid #3a4a8a; background: linear-gradient(160deg, #1a2a6a, #6a2fc4 60%, #1a2a6a); box-shadow: 0 0 14px rgba(120,80,255,.5); position: relative; }
.phone-img i { position: absolute; left: 50%; top: 5px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: #000; }
.device-title h2 { margin: 0 0 6px; font-size: 21px; font-weight: 600; }
.status-line { display: flex; align-items: center; gap: 8px; font-size: 14px; flex-wrap: wrap; }
.status-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 8px currentColor; color: var(--bad); }
.status-dot.ONLINE { background: var(--ok); color: var(--ok); }
.status-dot.VERALTET { background: var(--warn); color: var(--warn); }
#d-status.ONLINE { color: var(--ok); } #d-status.VERALTET { color: var(--warn); } #d-status.OFFLINE { color: var(--bad); }
.sim-tag { padding: 1px 8px; border: 1px solid var(--sim); color: var(--sim); border-radius: 999px; font-size: 11px; letter-spacing: 1px; }
.battery { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); }
.bat { width: 40px; height: 16px; border: 2px solid var(--ok); border-radius: 4px; padding: 1px; display: block; }
.bat i { display: block; height: 100%; background: var(--ok); width: 50%; box-shadow: 0 0 6px var(--ok); }
#device-select { grid-column: 1 / -1; margin-top: 12px; background: rgba(4,20,36,.9); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; margin: 16px 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.btn-row { display: flex; gap: 10px; }
.btn {
  flex: 1; padding: 11px 14px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: rgba(25,227,255,.12); color: #eaffff; font-weight: 600; font-size: 15px; box-shadow: var(--glow);
}
.btn:hover:not(:disabled) { background: rgba(25,227,255,.28); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: linear-gradient(90deg, rgba(20,241,217,.4), rgba(25,227,255,.2)); }
.btn.danger { border-color: rgba(255,77,94,.7); background: rgba(255,77,94,.15); box-shadow: 0 0 12px rgba(255,77,94,.3); }
.btn.on { background: rgba(25,227,255,.4); }
.btn.small { flex: none; padding: 6px 12px; font-size: 13px; }

.history-card { padding: 14px 16px; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.history-card header { display: flex; justify-content: space-between; align-items: baseline; }
.history-card h3, .modal h3 { margin: 0; font-size: 17px; font-weight: 600; }
.link-btn { background: none; border: 0; color: var(--cyan); font-size: 13px; text-decoration: underline; }
#mini-trail { width: 100%; height: 120px; margin: 10px 0; background: rgba(2,12,24,.7); border: 1px solid var(--line); border-radius: 8px; flex: none; }
#mini-trail text { stroke: none; }
.trail-line { fill: none; stroke: var(--cyan); stroke-width: 2; filter: drop-shadow(0 0 3px var(--cyan)); }
.trail-pt { fill: var(--teal); }
.trail-end { fill: var(--bad); stroke: #fff; stroke-width: 1.5; }
.mini-list { list-style: none; margin: 0; padding: 0; overflow: auto; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--muted); }
.mini-list li { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid rgba(25,227,255,.1); }
.mini-list li span:first-child { color: var(--text); }

/* ---- Navigation ---- */
.nav-card { padding: 14px 16px; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.nav-card header { display: flex; justify-content: space-between; align-items: center; }
.nav-card h3 { margin: 0; font-size: 17px; font-weight: 600; }
.nav-card h3 small { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }
.nav-points { display: flex; flex-direction: column; gap: 8px; }
.nav-point { display: flex; flex-direction: column; gap: 7px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(2,12,24,.6); }
.nav-point.picking { border-color: #3d86ff; box-shadow: 0 0 12px rgba(61,134,255,.45); }
.nav-point:focus-within { border-color: var(--line-strong); }
.nav-point-head { display: flex; align-items: center; gap: 8px; }
.nav-point-head label { flex: 1; color: var(--muted); font-size: 12.5px; letter-spacing: .5px; text-transform: uppercase; }
.nav-search { position: relative; }
.nav-search input {
  width: 100%; padding: 9px 34px 9px 34px; font: inherit; font-size: 14px; color: var(--text);
  background: rgba(2,12,24,.9); border: 1px solid var(--line-strong); border-radius: 8px; outline: none;
}
.nav-search input::placeholder { color: #5f8397; }
.nav-search input:focus { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan), var(--glow); }
.nav-search-ico { position: absolute; left: 9px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--cyan); pointer-events: none; }
.nav-spin { position: absolute; right: 10px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; border: 2px solid rgba(25,227,255,.25); border-top-color: var(--cyan); animation: spin-ring .8s linear infinite; }
@keyframes spin-ring { to { transform: rotate(360deg); } }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 50; margin: 0; padding: 4px; list-style: none;
  max-height: min(300px, 45vh); overflow-y: auto; overscroll-behavior: contain;
  background: rgba(3,16,30,.98); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: var(--glow), 0 10px 24px rgba(0,0,0,.6);
}
.suggest-item { display: block; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.suggest-item.active, .suggest-item:hover { background: rgba(25,227,255,.16); }
.suggest-title { display: block; font-size: 14px; color: #eaffff; overflow-wrap: anywhere; }
.suggest-sub { display: block; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.suggest-item.outside .suggest-title { color: #9bb3c0; }
.suggest-tag { display: inline-block; margin-top: 3px; padding: 0 7px; border: 1px solid var(--warn); color: var(--warn); border-radius: 999px; font-size: 10.5px; }
.suggest-msg { padding: 10px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.suggest-msg.error { color: #ffd7db; }
.nav-hint { margin: 0; color: var(--muted); font-size: 12.5px; }
.nav-error { margin: 0; padding: 8px 10px; border: 1px solid var(--bad); border-radius: 8px; background: rgba(60,6,14,.6); color: #ffd7db; font-size: 13px; }
.nav-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.nav-summary div { padding: 8px 12px; border: 1px solid rgba(61,134,255,.55); border-radius: 8px; background: rgba(20,60,140,.28); }
.nav-summary small { display: block; color: var(--muted); font-size: 11.5px; }
.nav-summary strong { font-size: 21px; font-weight: 500; color: #cfe4ff; }
.nav-steps { list-style: none; margin: 0; padding: 0; overflow: auto; min-height: 0; flex: 1; }
.nav-step { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; padding: 7px 4px; border-bottom: 1px solid rgba(25,227,255,.1); cursor: pointer; font-size: 13px; }
.nav-step:hover { background: rgba(61,134,255,.14); }
.nav-step .ico { color: #6aa8ff; font-size: 17px; text-align: center; }
.nav-step .dist { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nav-step.arrive .txt { color: var(--ok); }
.nav-pin { display: inline-grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; border: 2px solid #fff; font-size: 12px; font-weight: 700; color: #fff; }
.nav-pin.start { background: #1f9d6a; box-shadow: 0 0 10px #1f9d6a; }
.nav-pin.target { background: #d93a4c; box-shadow: 0 0 10px #d93a4c; }
.nav-pin-label { pointer-events: none; }
.maplibregl-marker.nav-pin { width: 30px; height: 30px; font-size: 13px; z-index: 3; }

/* ---- POI Explorer ---- */
.nav-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: rgba(2,12,24,.6); }
.nav-tab { padding: 8px 6px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--muted); font-size: 13.5px; font-weight: 600; letter-spacing: .3px; transition: background .15s, color .15s; }
.nav-tab:hover { color: var(--text); }
.nav-tab.active { color: #eaffff; border-color: var(--line-strong); background: linear-gradient(90deg, rgba(20,241,217,.26), rgba(25,227,255,.08)); box-shadow: var(--glow); }
.nav-pane { display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 0; }
.poi-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.poi-title strong { font-size: 13px; letter-spacing: 2px; color: var(--cyan); text-shadow: var(--glow); }
.poi-title small { color: var(--muted); font-size: 12px; }
.poi-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.poi-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(2,12,24,.7); color: var(--text); font-size: 12.5px; transition: background .15s, border-color .15s;
}
.poi-chip svg { stroke: var(--c); }
.poi-chip:hover { border-color: var(--c); }
.poi-chip.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 22%, transparent); box-shadow: 0 0 10px color-mix(in srgb, var(--c) 40%, transparent); color: #fff; }
.poi-opts { display: grid; grid-template-columns: 1.6fr 1fr; gap: 8px; }
.poi-opts label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 11.5px; letter-spacing: .4px; text-transform: uppercase; min-width: 0; }
.poi-opts select { width: 100%; padding: 8px 9px; font: inherit; font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--text); background: rgba(2,12,24,.9); border: 1px solid var(--line-strong); border-radius: 8px; }
.poi-opts select:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan); }
#poi-search.busy { position: relative; opacity: .8; }
#poi-search.busy::after { content: ""; display: inline-block; width: 12px; height: 12px; margin-left: 8px; vertical-align: -1px; border-radius: 50%; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; animation: spin-ring .8s linear infinite; }
.poi-status { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.poi-status.error { color: #ffd7db; padding: 7px 9px; border: 1px solid var(--bad); border-radius: 8px; background: rgba(60,6,14,.6); }
.poi-status.warn { color: var(--warn); }
.poi-status.loading { color: var(--cyan); }
.poi-list { list-style: none; margin: 0; padding: 0; overflow: auto; min-height: 0; flex: 1; }
.poi-item { display: grid; grid-template-columns: 34px 1fr auto; gap: 4px 10px; align-items: center; padding: 9px 6px; border-bottom: 1px solid rgba(25,227,255,.1); border-left: 3px solid transparent; }
.poi-item.selected { border-left-color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.poi-ico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--c); color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.poi-ico svg { stroke: var(--c); }
.poi-body { min-width: 0; }
.poi-name { display: block; font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.poi-sub { display: block; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.poi-warn { display: inline-block; margin-top: 2px; padding: 0 7px; border: 1px solid var(--warn); border-radius: 999px; color: var(--warn); font-size: 10.5px; }
.poi-dist { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--cyan); white-space: nowrap; }
.poi-actions { grid-column: 2 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.poi-actions .btn.small { padding: 5px 10px; font-size: 12px; }

/* ---- Live-Navigation (V1.3) ---- */
.nav-tabs { grid-template-columns: repeat(3, 1fr); }
.nav-pane#nav-pane-live { overflow-y: auto; padding-right: 2px; }
.live-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.live-head strong { font-size: 13px; letter-spacing: 2px; color: var(--cyan); text-shadow: var(--glow); }
.live-state { padding: 2px 10px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 12px; color: var(--muted); }
.live-state[data-state="active"] { color: var(--ok); border-color: var(--ok); }
.live-state[data-state="rerouting"] { color: var(--warn); border-color: var(--warn); }
.live-state[data-state="arrived"] { color: #fff; border-color: var(--cyan); background: rgba(25,227,255,.2); }
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 225deg, var(--cyan) calc(var(--pct) * 2.7deg), rgba(25,227,255,.14) 0 270deg, transparent 0);
  -webkit-mask: radial-gradient(circle, transparent 0 62%, #000 63%); mask: radial-gradient(circle, transparent 0 62%, #000 63%);
  filter: drop-shadow(0 0 5px rgba(25,227,255,.5));
}
.man-ico { flex: none; width: 40px; height: 40px; display: grid; place-items: center; font-size: 26px; color: var(--cyan); border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(25,227,255,.1); }
.live-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.live-stats div { padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: rgba(2,12,24,.6); }
.live-stats small { display: block; color: var(--muted); font-size: 11px; }
.live-stats strong { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.live-gps { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 12.5px; }
.live-gps dt { color: var(--muted); }
.live-gps dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.gps-dot { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; background: var(--muted); }
.gps-dot[data-state="ok"] { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.gps-dot[data-state="poor"] { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.gps-dot[data-state="stale"] { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.live-source { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 11.5px; letter-spacing: .4px; text-transform: uppercase; }
.live-source select, .live-sim select {
  width: 100%; padding: 8px 9px; font: inherit; font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--text);
  background: rgba(2,12,24,.9); border: 1px solid var(--line-strong); border-radius: 8px;
}
.live-note { margin: 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
.live-msg { margin: 0; padding: 7px 9px; font-size: 12.5px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text); }
.live-msg.warn { border-color: var(--warn); color: var(--warn); }
.btn.toggle { flex: 1; opacity: .8; }
.btn.toggle.on { opacity: 1; background: rgba(25,227,255,.3); border-color: var(--cyan); }
.live-voice-line { margin: 0; font-size: 12px; color: var(--muted); }
.sim-row { display: flex; justify-content: space-between; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); gap: 4px; }
.sim-row output { color: var(--text); font-variant-numeric: tabular-nums; }
.sim-row input[type=range] { width: 100%; accent-color: var(--cyan); }
.sim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sim-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--muted); }

/* HUD über der Karte */
.live-hud {
  position: absolute; left: 14px; bottom: 44px; z-index: 700; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  max-width: calc(100% - 84px); padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: rgba(3,16,30,.92); box-shadow: var(--glow);
}
.hud-speed { text-align: center; min-width: 54px; }
.hud-speed strong { display: block; font-size: 28px; line-height: 1; color: #eaffff; font-variant-numeric: tabular-nums; }
.hud-speed small, .hud-eta small, .hud-man small { color: var(--muted); font-size: 11.5px; }
.hud-man { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hud-man strong { display: block; font-size: 14.5px; }
.hud-eta strong { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.live-hud .sim-tag { margin-left: auto; }

/* Fahrzeugmarker */
.wt-vehicle { width: 0; height: 0; z-index: 4; }
.wt-vehicle-halo { position: absolute; left: -22px; top: -22px; width: 44px; height: 44px; border-radius: 50%; background: rgba(61,134,255,.22); border: 1px solid rgba(61,134,255,.6); }
.wt-vehicle-arrow { position: absolute; left: -13px; top: -13px; width: 26px; height: 26px; transition: none; }
.wt-vehicle-arrow::before { content: ""; position: absolute; inset: 0; background: #2f7bff; clip-path: polygon(50% 0, 92% 92%, 50% 72%, 8% 92%); filter: drop-shadow(0 0 4px #fff); }
.wt-vehicle.sim .wt-vehicle-halo { background: rgba(255,176,32,.2); border-color: rgba(255,176,32,.7); }
.wt-vehicle.sim .wt-vehicle-arrow::before { background: var(--sim); }

/* Karten-Popup eines POI */
.wt-popup { z-index: 10; } /* über Geräte-, Start- und Zielmarkern, damit „Route hierher“ klickbar bleibt */
.wt-popup .maplibregl-popup-content { padding: 12px 14px 12px; background: rgba(3,16,30,.97); color: var(--text); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--glow), 0 8px 22px rgba(0,0,0,.6); font-family: inherit; }
.wt-popup.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: var(--line-strong); }
.wt-popup.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: var(--line-strong); }
.wt-popup.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--line-strong); }
.wt-popup.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--line-strong); }
.wt-popup .maplibregl-popup-close-button { color: var(--cyan); font-size: 20px; width: 30px; height: 30px; }
.wt-popup .maplibregl-popup-close-button:hover { background: rgba(25,227,255,.15); }
.poi-pop { display: flex; flex-direction: column; gap: 4px; min-width: 180px; padding-right: 14px; }
.poi-pop-head { display: flex; align-items: center; gap: 6px; font-size: 11.5px; letter-spacing: .8px; text-transform: uppercase; color: var(--c); }
.poi-pop-head svg { stroke: var(--c); }
.poi-pop-name { font-size: 15px; overflow-wrap: anywhere; }
.poi-pop-addr { font-size: 12.5px; color: var(--muted); }
.poi-pop-dist { font-size: 12.5px; color: var(--cyan); font-variant-numeric: tabular-nums; }
.poi-pop-warn { font-size: 11.5px; color: var(--warn); }
.poi-pop .btn { margin-top: 6px; }

@media (min-width: 1101px) {
  /* Im Navigationsmodus bekommt die Routenliste den Platz der Geräte-Details. */
  .right.nav-mode .device-card { display: none; }
}

/* ---- Status bar ---- */
.statbar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; position: relative; z-index: 1; }
.statbar .stat { display: flex; flex-direction: column; justify-content: center; padding: 0 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.stat .lbl { color: var(--muted); font-size: 13px; }
.stat strong { font-size: 26px; font-weight: 500; }
.stat.ok strong { color: var(--ok); } .stat.warn strong { color: var(--warn); } .stat.bad strong { color: var(--bad); }

/* ---- Modal ---- */
.modal-backdrop { position: fixed; inset: 0; z-index: 2000; background: rgba(0,6,14,.7); display: grid; place-items: center; }
.modal { width: min(640px, 94vw); max-height: 86vh; overflow: auto; padding: 20px; background: rgba(4,18,34,.96); }
.modal header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal p { color: var(--muted); line-height: 1.5; }
.modal input[type=text], .login input[type=password] {
  width: 100%; padding: 10px 12px; background: rgba(2,12,24,.9); color: var(--text); border: 1px solid var(--line-strong); border-radius: 8px; font: inherit;
}
.row { display: flex; gap: 8px; margin: 10px 0; align-items: center; }
.dev-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.dev-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.dev-item .meta { flex: 1; min-width: 0; }
.dev-item .meta small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.pair-box { margin-top: 14px; padding: 12px; border: 1px dashed var(--sim); border-radius: 8px; }
.pair-box code { display: block; margin: 8px 0; padding: 8px; background: rgba(0,0,0,.4); border-radius: 6px; overflow-wrap: anywhere; font-size: 12.5px; user-select: all; }
.hist-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 13px; }
.hist-table th, .hist-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid rgba(25,227,255,.12); }
.hist-table th { color: var(--muted); font-weight: 500; }
.switch { display: flex; align-items: center; gap: 12px; }

/* ---- Login & Toasts ---- */
.login { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; background: radial-gradient(900px 600px at 50% 20%, #07264a, var(--bg)); }
.login-box { width: min(380px, 92vw); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.login-box h1, .phone h1 { margin: 0; font-weight: 300; letter-spacing: 4px; font-size: 30px; color: #eaffff; text-shadow: var(--glow); }
.login-box h1 small, .phone h1 small { font-size: 22px; color: #9fdcf0; }
.login-box p, .phone .sub { margin: 0; color: var(--muted); }
.login-box label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
.error { color: var(--bad); min-height: 1.2em; }
.toasts { position: fixed; right: 18px; bottom: 90px; z-index: 4000; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 10px 16px; border: 1px solid var(--line-strong); background: rgba(3,16,30,.95); border-radius: 8px; box-shadow: var(--glow); animation: fade .3s; }
.toast.warn { border-color: var(--warn); } .toast.bad { border-color: var(--bad); }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }

/* ---- Phone page ---- */
.phone-body { display: block; overflow: auto; padding: 18px; }
.phone { max-width: 460px; margin: 6vh auto; padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.phone .notice { color: var(--muted); font-size: 13.5px; line-height: 1.5; margin: 0; }
.phone .facts { margin: 6px 0; }

@media (max-width: 1100px) {
  html, body { height: auto; min-height: 100%; }
  body { overflow-x: hidden; overflow-y: auto; grid-template-rows: auto auto auto; padding: 0 10px 12px; }
  .layout { grid-template-columns: minmax(0, 1fr); min-height: auto; }
  .right { min-width: 0; }
  .right { min-height: auto; }
  .map-wrap { height: 60vh; }
  .nav-card { flex: none; order: -1; }
  .nav-search input { font-size: 16px; } /* verhindert das Auto-Zoomen der Eingabe auf iOS */
  .suggest-item { padding: 11px 10px; }
  .suggest { max-height: 38vh; }
  .nav-steps { max-height: 40vh; flex: none; }
  .nav-pane { flex: none; }
  .live-hud { bottom: 84px; left: 10px; max-width: calc(100% - 74px); gap: 10px; padding: 6px 10px; } /* rechts bleiben die Zoom-Tasten frei */
  .hud-speed strong { font-size: 22px; }
  .live-source select, .live-sim select { font-size: 16px; }
  .poi-list { max-height: 55vh; flex: none; }
  .poi-opts select { font-size: 16px; }
  .poi-chip { padding: 7px 11px; }
  .poi-actions .btn.small { padding: 8px 12px; }
  .wt-popup .maplibregl-popup-close-button { width: 36px; height: 36px; }
  .history-card { flex: none; }
  .topbar { gap: 10px; min-height: 56px; }
  .brand { min-width: 0; }
  .brand-name { font-size: 22px; letter-spacing: 2px; }
  .brand-name small { font-size: 16px; }
  .brand-logo { width: 34px; height: 34px; }
  .top-right { margin-left: auto; gap: 6px; }
  .clock { display: none; }
  .map-tools { gap: 8px; right: 10px; }
  .tool { width: 40px; height: 40px; }
  .sim-banner { top: auto; bottom: 46px; left: 10px; transform: none; max-width: calc(100% - 76px); font-size: 11px; letter-spacing: .5px; padding: 5px 12px; }
  .layer-pop { right: 10px; }
  .sidebar { display: none; }
  .topnav { display: none; }
  .statbar { grid-template-columns: repeat(2, 1fr); }
}

/* ================= NEXUS Cockpit V1.4 ================= */
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.sr-only { position: absolute; left: 0; top: 0; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.panel { border-radius: var(--radius); }

/* ---- Titel + Statusband ---- */
.cockpit-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.cockpit-title strong { font-size: 22px; font-weight: 600; letter-spacing: 2px; color: var(--cyan); text-shadow: var(--glow); white-space: nowrap; }
.cockpit-title em { font-style: normal; color: var(--text); }
.cockpit-title span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svc-strip { list-style: none; margin: 0 0 0 auto; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.svc {
  --c: var(--muted); display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center;
  padding: 4px 12px 4px 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(7,27,41,.8); min-width: 112px;
}
.svc-dot { grid-row: 1 / 3; width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.svc-name { font-size: 13px; font-weight: 600; line-height: 1.1; }
.svc-state { grid-column: 2; font-size: 11.5px; color: var(--c); line-height: 1.1; }
.svc-ms { position: absolute; }
.svc[data-state="online"] { --c: var(--ok); border-color: rgba(0,230,138,.45); }
.svc[data-state="error"], .svc[data-state="timeout"] { --c: var(--warn); }
.svc[data-state="offline"] { --c: var(--bad); }
.svc[data-state="unconfigured"], .svc[data-state="unknown"] { --c: var(--muted); }
.svc { position: relative; }
.svc-ms { right: 10px; top: 5px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.svc[data-state="unknown"] .svc-dot { box-shadow: none; opacity: .6; }
.top-right { margin-left: 0; }

/* ---- Navigation / Kompass ---- */
.side-item .soon { margin-left: auto; font-size: 10.5px; letter-spacing: .6px; padding: 1px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.side-item.active { border-color: var(--cyan); }
.compass {
  position: absolute; left: 14px; top: 14px; z-index: 700; width: 46px; height: 46px; padding: 0; display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 50%; background: rgba(3,11,20,.88); color: var(--cyan); box-shadow: var(--glow);
}
.compass svg { width: 36px; height: 36px; grid-area: 1 / 1; }
.compass b { grid-area: 1 / 1; font-size: 10px; align-self: start; margin-top: 1px; color: var(--text); }
.compass #compass-needle { transform-origin: 20px 20px; }
.compass .cn { fill: var(--cyan); stroke: none; } .compass .cs { fill: var(--muted); stroke: none; opacity: .7; }
.compass:hover { background: rgba(0,229,255,.18); }

/* ---- Cockpit-Karten ---- */
.cp-card { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(3,11,20,.55); }
.cp-h { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase; color: var(--cyan); }
.live-man { border-color: var(--line-strong); box-shadow: inset 0 0 18px rgba(0,229,255,.07); }
.live-man-row { display: flex; gap: 12px; align-items: center; min-height: 56px; }
.live-man-row strong { display: block; font-size: 19px; line-height: 1.2; }
.live-man-row small { color: var(--muted); font-size: 13px; }
.live-man .man-ico { width: 52px; height: 52px; font-size: 32px; }
.live-stats strong { font-size: 17px; }
.live-stats div { background: rgba(3,11,20,.55); }

/* ---- Tacho ---- */
.speedo-card { padding: 6px 12px 10px; }
.speedo { --pct: 0; position: relative; width: 100%; max-width: 320px; margin: 0 auto; }
.speedo-svg { display: block; width: 100%; height: auto; overflow: visible; }
.speedo-track, .speedo-arc { fill: none; stroke-width: 11; stroke-linecap: round; }
.speedo-track { stroke: rgba(0,229,255,.13); }
.speedo-arc { stroke: url(#speedo-grad); stroke-dasharray: calc(var(--pct) * 1) 100; transition: stroke-dasharray .55s ease-out; filter: drop-shadow(0 0 4px rgba(0,229,255,.55)); }
.speedo .tick { stroke: rgba(234,251,255,.55); stroke-width: 1.5; }
.speedo .tick.hot { stroke: var(--violet); }
.speedo .tick-label { fill: var(--muted); font-size: 9.5px; text-anchor: middle; stroke: none; }
.speedo .tick-label.hot { fill: #c9a0f7; }
.speedo-read { position: absolute; left: 0; right: 0; bottom: 2px; text-align: center; line-height: 1; }
.speedo-read strong { display: block; font-size: 54px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; text-shadow: 0 0 14px rgba(0,229,255,.4); }
.speedo-read small { font-size: 14px; color: var(--muted); }

/* ---- Fahrübersicht ---- */
.trip-dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0 0 8px; font-size: 13px; }
.trip-dl dt { color: var(--muted); }
.trip-dl dd { margin: 0; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.trip-progress { height: 9px; border-radius: 999px; background: rgba(0,229,255,.12); overflow: hidden; }
.trip-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--violet)); transition: width .5s ease-out; }
.trip-note { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); }

/* ---- Sprache + Bedienung ---- */
.voice-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.voice-toggle { min-height: 44px; font-size: 14px; }
.voice-toggle.on { border-color: var(--ok); background: rgba(0,230,138,.2); color: var(--text); }
.live-voice-line { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(3,11,20,.55); font-size: 12.5px; overflow-wrap: anywhere; }
.btn { min-height: 36px; }
.btn.primary { border-color: var(--cyan); }

/* ---- Einklappbare Bereiche ---- */
.fold { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(3,11,20,.45); padding: 0 12px; }
.fold > summary { cursor: pointer; padding: 10px 0; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: .6px; color: var(--cyan); list-style: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: "▾"; color: var(--muted); margin-left: 8px; transition: transform .2s; }
.fold:not([open]) > summary::after { transform: rotate(-90deg); }
.fold[open] { padding-bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.fold > summary .gps-sum { margin-left: auto; font-weight: 400; color: var(--text); font-size: 12.5px; }
.live-sim { border-color: rgba(255,176,32,.55); border-style: dashed; }
.live-sim > summary { color: var(--sim); }
.sim-source { margin: 0; font-size: 12.5px; color: var(--muted); }
.sim-source strong { color: var(--text); font-weight: 500; }
.live-sim .btn-row .btn { flex: 1; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; width: 100%; }
.seg button { min-height: 40px; border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(3,11,20,.8); color: var(--text); font-weight: 600; }
.seg button[aria-checked="true"] { background: rgba(0,229,255,.28); border-color: var(--cyan); box-shadow: var(--glow); }
.sim-acc { flex-direction: row; align-items: center; }
.sim-acc select { width: auto; min-width: 100px; }
.soon-note { margin: 0; font-size: 11.5px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 8px; }

/* ---- Desktop: breiteres Cockpit rechts, solange die Navigation offen ist ---- */
@media (max-width: 1500px) { .cockpit-title span { display: none; } .svc { min-width: 0; } }
@media (max-width: 1250px) { .brand-name small { display: none; } .brand { min-width: 0; } }

/* ---- Tablet / Smartphone ---- */
@media (max-width: 1100px) {
  .topbar { flex-wrap: wrap; row-gap: 6px; padding-top: 6px; }
  .cockpit-title strong { font-size: 16px; letter-spacing: 1px; }
  .svc-strip { order: 5; flex-basis: 100%; margin: 0; justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; }
  .svc { flex: none; }
  .map-wrap { height: 52vh; }
  .speedo { max-width: 280px; }
  .live-man-row strong { font-size: 18px; }
}
@media (max-width: 700px) {
  .brand-name { display: none; }
  .svc-strip { gap: 6px; }
  .svc { padding: 3px 8px; }
  .svc-ms { display: none; }
  .map-wrap { height: 48vh; }
  .compass { width: 40px; height: 40px; left: 10px; top: 10px; }
  .compass svg { width: 30px; height: 30px; }
  .btn, .seg button, .fold > summary { min-height: 44px; }
  .speedo-read strong { font-size: 46px; }
}

/* ---- Bewegung reduzieren ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
/* Feinschliff V1.4 */
.svc { grid-template-columns: auto 1fr auto; }
.svc-name { grid-column: 2; grid-row: 1; }
.svc-ms { position: static; grid-column: 3; grid-row: 1; margin-left: 8px; justify-self: end; }
.svc-state { grid-column: 2 / 4; grid-row: 2; }
.cp-row { display: grid; grid-template-columns: 1fr; gap: 10px; }

/* ================= NEXUS Cockpit V1.4.1 – Referenzlayout ================= */
.layout {
  grid-template-columns: clamp(200px, 14vw, 236px) minmax(0, 1fr) clamp(340px, 24vw, 390px);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: "side map right";
}
.sidebar { grid-area: side; overflow: auto; }
.map-wrap { grid-area: map; }
.right { grid-area: right; min-width: 0; }
.cockpit-band, .cockpit-tabs { display: none; }
/* Cockpit-Modus (Navigation geöffnet): Karte, Band darunter, rechts das Navigationspanel, unten die Tab-Leiste */
.layout.cockpit {
  grid-template-rows: minmax(190px, 1fr) auto auto;
  grid-template-areas: "side map right" "side band right" "side tabs tabs";
}
.layout.cockpit .cockpit-band {
  display: grid; grid-area: band; min-height: 0; height: clamp(170px, 24vh, 225px);
  grid-template-columns: minmax(230px, .95fr) minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px;
}
.layout.cockpit .cockpit-tabs { display: grid; grid-area: tabs; grid-template-columns: 3fr 1fr 1fr; gap: 10px; }

.band-card { padding: 10px 14px; min-height: 0; min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
.band-card .cp-h { flex: none; }
.band-card.speedo-card { padding: 8px 10px 6px; justify-content: center; }
.band-card .speedo { width: 100%; height: 100%; max-width: none; margin: 0; min-height: 0; }
.band-card .speedo-svg { width: 100%; height: 100%; }
.band-card .speedo-read { bottom: 3%; }
.band-card .speedo-read strong { font-size: clamp(34px, 6vh, 58px); }
.band-card .speedo-read small { font-size: 13px; }
.band-card .speedo .tick-label { font-size: 10px; }
.trip-dl { grid-template-columns: auto minmax(0, 1fr); }
.trip-dl dd { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trip .trip-dl { font-size: 14px; gap: 5px 14px; }
.trip .trip-dl dd { color: var(--text); }
.trip-dl #trip-state, #trip-state { color: var(--ok); }
.progress-big { display: flex; align-items: baseline; gap: 4px; line-height: 1; margin-bottom: 8px; }
.progress-big strong { font-size: clamp(30px, 5vh, 46px); font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; text-shadow: 0 0 12px rgba(0,229,255,.35); }
.progress-big small { font-size: 16px; color: var(--muted); }
.progress-card .trip-progress { height: 12px; margin-bottom: 8px; box-shadow: inset 0 0 0 1px var(--line); }
.progress-card .trip-dl { margin-bottom: 0; }
.progress-card .trip-note { margin-top: auto; }

/* Tab-Leiste */
.cockpit-tabs .nav-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0; border: 0; background: none; }
.cockpit-tabs .nav-tab {
  min-height: 52px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  color: var(--text); font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.cockpit-tabs .nav-tab:hover:not(:disabled) { border-color: var(--line-strong); background: rgba(0,229,255,.1); }
.cockpit-tabs .nav-tab.active { border-color: var(--cyan); color: #fff; background: linear-gradient(180deg, rgba(0,229,255,.28), rgba(0,229,255,.08)); box-shadow: var(--glow), inset 0 0 14px rgba(0,229,255,.18); }
.cockpit-tabs .nav-tab:disabled { opacity: .5; cursor: not-allowed; }
.cockpit-tabs .soon { font-size: 10.5px; padding: 1px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.side-item .soon.on { color: var(--cyan); border-color: var(--cyan); }

/* Kartenansicht-Umschalter */
.view-toggle { position: absolute; left: 70px; top: 14px; z-index: 700; display: flex; padding: 3px; gap: 3px; border: 1px solid var(--line-strong); border-radius: 12px; background: rgba(3,11,20,.88); box-shadow: var(--glow); }
.view-toggle button { min-height: 38px; padding: 0 14px; border: 1px solid transparent; border-radius: 9px; background: none; color: var(--text); font-size: 13px; font-weight: 600; }
.view-toggle button[aria-pressed="true"] { background: rgba(0,229,255,.28); border-color: var(--cyan); }
.view-toggle button:disabled { opacity: .45; cursor: not-allowed; }

/* Systemstatus: Chip oben, Karte links */
.sys-chip { min-width: 0; grid-template-columns: auto 1fr; }
.sys-chip .svc-state { grid-column: 2; }
.sys-card { margin-top: auto; padding: 10px 10px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(3,11,20,.55); }
.sys-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sys-row { --c: var(--muted); display: grid; grid-template-columns: 14px 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.sys-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 7px var(--c); }
.sys-row strong { font-weight: 500; color: var(--c); font-size: 12.5px; }
.sys-row[data-state="ok"] { --c: var(--ok); }
.sys-row[data-state="ready"] { --c: var(--cyan); }
.sys-row[data-state="warn"] { --c: var(--warn); }
.sys-row[data-state="off"], .sys-row[data-state="unknown"] { --c: var(--muted); }
.sys-row[data-state="off"] .sys-dot, .sys-row[data-state="unknown"] .sys-dot { box-shadow: none; opacity: .7; }
.sys-row[data-state="bad"] { --c: var(--bad); }

/* Rechtes Panel kompakter */
.nav-card { padding: 12px 14px; gap: 8px; }
.live-run { margin: 0; }
.fold-inner { border-top: 1px dashed var(--line); padding-top: 6px; }
.fold-inner > summary { cursor: pointer; min-height: 32px; font-size: 12.5px; color: var(--muted); }
.live-sim .sim-row { margin: 0; }
.live-sim .btn-row .btn { min-height: 40px; }

/* ---- Tablet / Smartphone ---- */
@media (max-width: 1100px) {
  .layout, .layout.cockpit { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: none; }
  .map-wrap { order: 1; grid-area: auto; }
  .layout.cockpit .cockpit-tabs { order: 2; grid-area: auto; grid-template-columns: 1fr 1fr; }
  .layout.cockpit .cockpit-tabs .nav-tabs { grid-column: 1 / -1; }
  .right { order: 3; grid-area: auto; }
  .layout.cockpit .cockpit-band { order: 4; grid-area: auto; height: auto; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
  .band-card.speedo-card { min-height: 170px; }
  .band-card .speedo { max-width: 300px; margin: 0 auto; height: auto; }
  .band-card .speedo-svg { height: auto; }
  .nav-card { flex: none; order: -1; }
  .view-toggle { left: 10px; top: 58px; }
  .view-toggle button { min-height: 44px; }
  .sidebar { display: none; }
}
@media (max-width: 700px) {
  .cockpit-tabs .soon { display: none; }
  .cockpit-tabs .nav-tab { font-size: 14px; }
  .sys-chip { display: none; }
}
/* Kompaktes rechtes Panel: Simulator bleibt ohne Scrollen erreichbar */
.nav-card > header { gap: 10px; }
.nav-card > header h3 { flex: 1; }
.nav-card .live-state { margin-right: 2px; }
.live-man { padding: 8px 12px; }
.live-man .cp-h { margin-bottom: 2px; }
.live-man-row { min-height: 46px; }
.live-man .man-ico { width: 44px; height: 44px; font-size: 28px; filter: drop-shadow(0 0 5px rgba(0,229,255,.5)); }
.live-man-row strong { font-size: 18px; }
.live-stats div { padding: 5px 8px; }
.live-source select { padding: 7px 9px; }
.live-source { gap: 0; }
.btn { min-height: 34px; padding-top: 7px; padding-bottom: 7px; }
.voice-toggle { min-height: 36px; font-size: 14px; }
.live-voice-line { padding: 4px 10px; }
.fold > summary { min-height: 38px; padding: 6px 0; }
.fold[open] { padding-bottom: 8px; gap: 8px; }
.live-sim .btn-row .btn { min-height: 36px; }
.seg button { min-height: 34px; }
.sim-row { font-size: 12.5px; }
.sim-source { font-size: 12px; }
@media (max-width: 1100px) {
  .btn, .voice-toggle, .seg button, .live-sim .btn-row .btn { min-height: 44px; }
  .fold > summary { min-height: 44px; }
}