/* Karte (MapLibre) und Routenplanung – gehört zu assets/js/nav/*.js.
   Nur Farben und Formen der App (Variablen aus app.css), damit Karte und Seite einheitlich bleiben. */

/* ---------- Karte ---------- */
.k1nav { position: relative; width: 100%; height: 100%; min-height: 320px; border-radius: var(--r); overflow: hidden;
  border: 1px solid var(--line); background: #cfe3f2; box-shadow: var(--shadow); }
.k1nav-map { position: absolute; inset: 0; }
.k1nav .maplibregl-ctrl-group { border-radius: 12px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.k1nav .maplibregl-ctrl-group button { width: 38px; height: 38px; }
.k1nav .maplibregl-ctrl-attrib { font-size: .7rem; }
.k1nav .maplibregl-ctrl-attrib a { color: var(--primary); }
.k1nav-ui { display: flex; flex-direction: column; gap: 6px; clear: both; }
.k1nav-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: inherit; font-size: 1.15rem; line-height: 1; cursor: pointer; box-shadow: var(--shadow); }
.k1nav-btn:hover, .k1nav-btn[aria-expanded="true"] { background: var(--info-bg); color: var(--primary); }
.k1nav-btn:focus-visible { outline: 3px solid #ffbf00; outline-offset: 1px; }
.k1nav-layers { position: absolute; right: 60px; top: 10px; z-index: 3; width: min(260px, calc(100% - 76px)); max-height: calc(100% - 110px); overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; gap: 6px; }
.k1nav-layers[hidden] { display: none; }
.k1nav-h { margin: 4px 0 0; font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.k1nav-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--bg); border-radius: 10px; padding: 3px; }
.k1nav-seg button { border: 0; background: transparent; border-radius: 8px; padding: 8px 4px; font: inherit; font-size: .82rem; font-weight: 600;
  color: var(--ink); cursor: pointer; min-height: 38px; }
.k1nav-seg button[aria-checked="true"] { background: var(--primary); color: #fff; }
.k1nav-chk { display: flex; gap: 8px; align-items: center; justify-content: flex-start; font-size: .9rem; min-height: 32px; cursor: pointer; }
.k1nav-chk input { width: 18px; height: 18px; min-height: 0; flex: none; margin: 0; }
.k1nav-note { margin: 4px 0 0; font-size: .74rem; color: var(--muted); }
.k1nav-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: .76rem; color: var(--muted); margin-top: 4px; }
.k1nav-legend span { display: inline-flex; align-items: center; gap: 6px; }
.k1nav-legend i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); flex: none; }
.br-high { background: #1d9e57; } .br-mid { background: #e8b71d; } .br-low { background: #c8352f; }
.br-movable { background: #2b6cb0; } .br-unknown { background: #8a97a3; } .br-risk { background: #e8590c; } .k1nav-legend i.lk { background: #6b3fa0; }
.k1nav-pop { z-index: 4; }
.k1nav-pop .k1map-match { position: static; align-self: flex-start; }
.k1nav-me { width: 22px; height: 22px; border-radius: 50%; background: rgba(0,168,232,.22); display: grid; place-items: center; }
.k1nav-me i { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.2); }
.k1nav-me.dir::before { content: ''; position: absolute; top: -10px; left: 6px; border: 5px solid transparent; border-bottom: 9px solid var(--accent); }

/* Kartenseiten der App */
.map-shell > .k1nav { height: 100%; }
.map-shell-sm { height: 300px; }

/* ---------- Routenplanung ---------- */
.nv-page { display: grid; gap: 12px; grid-template-columns: 1fr; }
.nv-mapwrap { height: clamp(360px, 58vh, 720px); min-width: 0; }
@media (min-width: 1000px) {
  .nv-page { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
  .nv-mapwrap { height: calc(100vh - 190px); min-height: 520px; position: sticky; top: 76px; }
  .nv-panel { max-height: none; }
}
.nv-panel { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.nv-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-xs); padding: 14px; }
.nv-card h2 { font-size: 1rem; margin: 0 0 8px; }
.nv-search { position: relative; }
.nv-search form { display: flex; gap: 8px; }
.nv-search input { flex: 1; min-width: 0; }
.nv-results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; list-style: none; margin: 0; padding: 4px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-md); max-height: 340px; overflow: auto; }
.nv-results[hidden] { display: none; }
.nv-results button { display: flex; gap: 10px; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px;
  font: inherit; color: var(--ink); cursor: pointer; align-items: flex-start; min-height: var(--tap); }
.nv-results button:hover, .nv-results button:focus-visible { background: var(--info-bg); }
.nv-results button > span:last-child { display: flex; flex-direction: column; }
.nv-results .nv-empty { padding: 8px 10px; }
.nv-results .nv-more button { color: var(--primary); font-weight: 700; justify-content: center; }
.nv-ti { width: 22px; text-align: center; flex: none; color: var(--primary); font-weight: 700; }

.nv-points { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.nv-pt { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; background: var(--bg); min-height: var(--tap); }
.nv-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .8rem; color: #fff; background: var(--muted); flex: none; }
.nv-from .nv-dot { background: var(--good); } .nv-to .nv-dot { background: var(--bad); } .nv-via .nv-dot { background: var(--primary); }
.nv-pn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.nv-pt .icon-btn { width: 34px; height: 34px; min-height: 34px; }
.nv-row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.nv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.nv-grid .field { margin: 0; }
.nv-grid [data-full] { grid-column: 1 / -1; }
.nv-grid label { font-size: .82rem; }
.nv-hint { font-size: .8rem; color: var(--muted); margin: 6px 0 0; }
#nv-calc.busy { opacity: .7; cursor: progress; }
.nv-status { min-height: 1.2em; font-size: .88rem; color: var(--primary); margin: 6px 0 0; }

.nv-marker { width: 28px; height: 34px; display: grid; place-items: center; padding-bottom: 6px; color: #fff; font-weight: 800; font-size: .8rem;
  background: var(--primary); clip-path: path('M14 34 C14 34 0 20 0 13 A14 13 0 1 1 28 13 C28 20 14 34 14 34 Z'); }
.nv-marker.m-from { background: var(--good); } .nv-marker.m-to { background: var(--bad); }

.nv-sum { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.nv-kpi { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: var(--bg); display: flex; flex-direction: column; }
.nv-kpi b { font-size: 1.15rem; color: var(--primary); }
.nv-kpi span { font-size: .78rem; color: var(--muted); }
.nv-kpi em { font-style: normal; font-weight: 700; }
.nv-warn { margin-top: 10px; border-left: 4px solid var(--warn-line); background: var(--warn-bg); border-radius: 8px; padding: 8px 10px; font-size: .86rem; }
.nv-warn ul { margin: 0; padding-left: 18px; }
.nv-warn .bad { color: var(--bad); }
.nv-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 12px 0 8px; padding-bottom: 4px; scrollbar-width: thin; }
.nv-tabs button { flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .84rem; font-weight: 600;
  color: var(--ink); cursor: pointer; min-height: 38px; display: inline-flex; gap: 6px; align-items: center; }
.nv-tabs button[aria-selected="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.nv-tabs i { font-style: normal; font-size: .74rem; background: rgba(0,0,0,.08); border-radius: 999px; padding: 1px 7px; }
.nv-tabs button[aria-selected="true"] i { background: rgba(255,255,255,.25); }
.nv-tab { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 420px; overflow: auto; }
.nv-tab[hidden] { display: none; }
.nv-row { display: flex; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line-light); }
.nv-row[data-fly] { cursor: pointer; }
.nv-row[data-fly]:hover { background: var(--bg); }
.nv-when { flex: none; width: 70px; font-size: .8rem; font-weight: 700; color: var(--primary-dark); }
.nv-what { flex: 1; min-width: 0; font-size: .9rem; }
.nv-closed { background: var(--bad-bg); border-radius: 8px; }
.nv-br { display: inline-block; border-radius: 999px; padding: 1px 8px; font-size: .78rem; font-weight: 700; color: #fff; background: #8a97a3; }
.nv-br.nv-high { background: #1d9e57; } .nv-br.nv-mid { background: #e8b71d; color: #3a2c00; } .nv-br.nv-low { background: #c8352f; }
.nv-br.nv-movable { background: #2b6cb0; } .nv-br.nv-risk { background: #e8590c; }
.nv-warn li.bad { color: var(--bad); }
.nv-rep-line { margin: 8px 0 0; }
.nv-dims-diff { display: inline-block; margin: 0 4px; padding: 0 8px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); font-weight: 700; }
.nv-dims-diff[hidden] { display: none; }
.nv-rep { margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--card); }
.nv-rep h3 { font-size: 1rem; margin: 0 0 8px; }
.nv-gv b { color: var(--primary); }
.nv-flash { animation: nvflash 1.2s ease; }
@keyframes nvflash { from { background: var(--wave-light); } to { background: transparent; } }
.nv-live { font-size: .74rem; font-weight: 700; color: var(--good); }
.nv-live::before { content: '●'; margin-right: 4px; }
.nv-spark { width: 100%; height: 58px; }
.nv-spark path { fill: none; stroke: var(--accent); stroke-width: 2; }
.nv-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.nv-actions .btn { flex: 1 1 140px; justify-content: center; }
.nv-save { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 10px; }
.nv-foot { font-size: .76rem; color: var(--muted); margin: 8px 0 0; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; text-decoration: underline; text-align: left; }
.nv-saved { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .9rem; }

/* Live-Navigation („Radaransicht“) */
.nv-hud { position: fixed; left: 0; right: 0; bottom: calc(var(--bn-h) + var(--safe-b)); z-index: 60; background: var(--ocean); color: #fff; padding: 10px 14px;
  display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 8px; align-items: center; box-shadow: 0 -4px 20px rgba(0,0,0,.25); }
.nv-hud[hidden] { display: none; }
.nv-hud.warn { background: var(--bad); }
.nv-hud div { display: flex; flex-direction: column; }
.nv-hud b { font-size: 1.25rem; }
.nv-hud span { font-size: .72rem; opacity: .8; }
.nv-hud-line { grid-column: 1 / -1; font-size: .9rem; display: flex; justify-content: space-between; gap: 10px; }
.nv-hud .btn { background: #fff; color: var(--ocean); }
body.nv-navigating .nv-mapwrap { height: calc(100vh - 230px); }
body.nv-navigating .nv-plan { display: none; }          /* während der Fahrt nur Karte + Anzeige unten (06.10.2026) */
.nv-go-gross { width: 100%; justify-content: center; }

/* Anker-Wache */
.nv-anchor-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nv-anchor-card h2 { margin: 0 0 2px; }
.nv-anchor-card .nv-hint { margin: 0; }
.nv-anchor-card .btn { flex: 0 0 auto; }
.nv-dialog { position: fixed; inset: auto 12px calc(var(--bn-h) + var(--safe-b) + 12px) 12px; z-index: 70; max-width: 420px; margin: 0 auto;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 16px; }
.nv-dialog[hidden] { display: none; }
.nv-dialog h2 { margin: 0 0 6px; font-size: 1.05rem; }
.nv-alarm-btn { position: fixed; inset: 30% 12px auto 12px; z-index: 90; max-width: 420px; margin: 0 auto; padding: 22px; border-radius: var(--r);
  border: 0; background: var(--bad); color: #fff; font: inherit; font-size: 1.2rem; font-weight: 800; cursor: pointer; box-shadow: var(--shadow-lg); }
.nv-alarm-btn[hidden] { display: none; }
.nv-anchor-badge { position: fixed; right: 14px; bottom: calc(var(--bn-h) + var(--safe-b) + 84px); z-index: 55; border-radius: 999px; border: 0;
  background: var(--primary); color: #fff; padding: 10px 14px; font: inherit; font-weight: 700; box-shadow: var(--shadow-md); cursor: pointer; }
.nv-anchor-badge[hidden] { display: none; }
body.nv-alarm .nv-anchor-badge, body.nv-drift .nv-anchor-badge { background: var(--bad); }

@media (max-width: 700px) {
  .nv-grid { grid-template-columns: 1fr 1fr; }
}
.nv-mt { margin: 10px 0 0; }
.nv-nfbtext { margin-top: 6px; }
.nv-nfbtab { margin: 4px 0; font-size: .78rem; overflow-wrap: anywhere; }
.nv-nfbtab dt { color: var(--muted); margin-top: 4px; }
.nv-nfbtab dd { margin: 0 0 2px; }
.nv-nfbtab .nv-nfbzeile { border-top: 1px solid var(--line-light); padding-top: 3px; margin-top: 3px; }
.k1nav-pop .nv-nfbtext { max-height: 220px; overflow: auto; }

/* ---------- Routenplanung 06.10.2026: Start/Ziel in der Karte, Routenvorschläge, Handy entzerrt ---------- */
.nv-mapwrap { scroll-margin-top: 76px; }   /* unter der festen Kopfleiste */
@media (max-width: 999px) { .nv-mapwrap { position: relative; } }   /* Rahmen für den Eingabekasten; am Rechner ist sie „sticky“ (auch ein Rahmen) */
.nv-plan { position: absolute; top: 10px; left: 10px; z-index: 3; width: min(360px, calc(100% - 72px));
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-md); padding: 8px; }
.nv-plan .nv-points { margin: 0 0 6px; gap: 4px; max-height: 38vh; overflow: auto; }
.nv-plan .nv-pt { gap: 6px; padding: 2px 4px 2px 6px; min-height: 44px; background: var(--bg); }
.nv-plan .nv-dot { width: 24px; height: 24px; }
.nv-plan .nv-pin { flex: 1; min-width: 0; width: auto; border: 0; background: transparent; box-shadow: none; font: inherit; font-weight: 600;
  color: var(--ink); padding: 6px 4px; min-height: 38px; margin: 0; border-radius: 6px; }
.nv-plan .nv-pin::placeholder { color: var(--muted); font-weight: 500; }
.nv-plan .nv-pin::-webkit-search-cancel-button { display: none; }   /* eigenes × entfernt den Punkt */
.nv-plan .nv-pin:focus { outline: 2px solid var(--primary); outline-offset: 0; background: var(--card); }
.nv-plan .nv-pt .icon-btn { width: 34px; height: 34px; min-height: 34px; flex: none; }
.nv-pick { color: var(--primary); }
.nv-pick.on { background: var(--primary); color: #fff; }
.nv-plan-btns { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.nv-plan-btns .btn { min-height: 38px; }
.nv-ib { min-width: 40px; padding-left: 8px; padding-right: 8px; justify-content: center; font-size: 1.05rem; }
.nv-pickhint { margin: 6px 2px 0; font-size: .84rem; background: var(--info-bg); color: var(--primary-dark); border-radius: 8px; padding: 6px 8px; }
.nv-pickhint[hidden] { display: none; }
.nv-plan .nv-status { margin: 6px 2px 0; }
.nv-plan .nv-status:empty { display: none; }
.nv-plan .nv-results { left: 8px; right: 8px; top: 56px; }

/* Routenvorschläge */
.nv-alt-list { display: flex; flex-direction: column; gap: 6px; }
.nv-alt { display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg); padding: 9px 11px; font: inherit; color: var(--ink); cursor: pointer; min-height: var(--tap); }
.nv-alt:hover { border-color: var(--primary); }
.nv-alt.on { border-color: var(--primary); box-shadow: inset 0 0 0 2px var(--primary); background: var(--info-bg); }
.nv-alt:focus-visible { outline: 3px solid #ffbf00; outline-offset: 1px; }
.nv-alt-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nv-alt-kpi { font-size: .9rem; }
.nv-alt-kpi b { color: var(--primary); }

/* Boot/Einstellungen und Hafen-Filter als aufklappbare Kästen */
.nv-settings > summary, .nv-filterbox > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline;
  min-height: 32px; padding-right: 22px; position: relative; }
.nv-settings > summary::-webkit-details-marker, .nv-filterbox > summary::-webkit-details-marker { display: none; }
.nv-settings > summary::after, .nv-filterbox > summary::after { content: '▾'; position: absolute; right: 2px; top: 2px; color: var(--muted); transition: transform .15s; }
.nv-settings[open] > summary::after, .nv-filterbox[open] > summary::after { transform: rotate(180deg); }
.nv-settings[open] > summary, .nv-filterbox[open] > summary { margin-bottom: 10px; }
.nv-set-h { font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
.nv-set-sum { font-size: .82rem; color: var(--muted); }
.nv-filterbox .filters { border: 0; box-shadow: none; padding: 0; margin: 0; background: transparent; }

@media (max-width: 999px) {
  .nv-mapwrap { height: clamp(440px, 72vh, 760px); }
}
@media (max-width: 700px) {
  .nv-head .nv-lead { display: none; }
  .nv-head h1 { margin-bottom: 0; }
  .nv-plan { top: 8px; left: 8px; width: calc(100% - 64px); padding: 6px; }
  .nv-plan-btns { gap: 4px; flex-wrap: nowrap; }
  .nv-plan-btns .btn { padding-left: 8px; padding-right: 8px; font-size: .88rem; }
  .nv-plan-btns .nv-ib { min-width: 36px; padding-left: 4px; padding-right: 4px; }
  #nv-add-via { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
.nv-suche::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%;
  border: 2px solid var(--primary); border-right-color: transparent; animation: nvdreh .8s linear infinite; vertical-align: -1px; }
@keyframes nvdreh { to { transform: rotate(360deg); } }
