/* Solugen Außendienst – Oberfläche in der Grammatik von Salesforce Lightning, Farbwelt von solugen.de (Petrol/Oliv) */
:root {
  --ink: #131a1e;
  --muted: #5a666d;
  --petrol: #3e5a68;
  --petrol-dark: #263d48;
  --petrol-deep: #16242c;
  --petrol-light: #5d7783;
  --link: #2a6c8a;
  --link-dark: #1f566f;
  --olive: #afaa00;
  --olive-dark: #8d8900;
  --olive-ink: #666300;
  --olive-bg: #f3f2d2;
  --bg: #e9eeee;
  --card: #ffffff;
  --soft: #f3f6f6;
  --hover: #eef3f4;
  --line: #d3dbde;
  --line-strong: #b4c0c5;
  --ok: #2e7d4f;
  --ok-bg: #e3f2e8;
  --err: #b0432c;
  --err-bg: #fbe9e4;
  --r: 4px;
  --shadow: 0 2px 2px rgba(22, 36, 44, .10);
  --gh-h: calc(48px + env(safe-area-inset-top, 0px));
  --nb-h: 44px;
  --bn-h: 60px;
  --font: "Satoshi", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overscroll-behavior-y: none; scrollbar-color: var(--line-strong) transparent; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 14px/1.45 var(--font);
  -webkit-tap-highlight-color: transparent;
  caret-color: var(--link);
  accent-color: var(--link);
}
::selection { background: var(--olive-bg); color: var(--ink); }
a { color: var(--link); text-decoration: none; text-underline-offset: 2px; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.25; letter-spacing: -.005em; text-wrap: balance; }
p { margin: 0 0 .75rem; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 2px; }
button { font: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

.icon { width: 18px; height: 18px; flex-shrink: 0; vertical-align: middle; }
.icon--sm { width: 14px; height: 14px; }
.icon--favorite { color: var(--olive-dark); }

/* ---------- Objekt-Kacheln ---------- */
.obj { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r); background: var(--petrol); color: #fff; flex-shrink: 0; }
.obj .icon { width: 18px; height: 18px; }
.obj--lg { width: 44px; height: 44px; }
.obj--lg .icon { width: 26px; height: 26px; }
.obj--sm { width: 24px; height: 24px; }
.obj--sm .icon { width: 15px; height: 15px; }
.obj--chance { background: var(--olive-dark); }
.obj--besuch { background: #3f7a4f; }
.obj--kontakt { background: var(--petrol-light); }
.obj--route { background: #9a5d2b; }
.obj--einstellungen { background: var(--petrol-light); }
.obj--notiz { background: #7b6a3c; }
.obj--beschwerde { background: var(--err); }

/* ---------- Global Header ---------- */
.gh {
  position: sticky; top: 0; z-index: 40; height: var(--gh-h);
  display: flex; align-items: center; gap: 12px; padding: env(safe-area-inset-top, 0px) 12px 0;
  background: var(--petrol-deep); color: #fff;
}
.gh__brand { font-weight: 700; font-size: 19px; letter-spacing: -.01em; color: #fff; }
.gh__brand:hover { text-decoration: none; }
.gh__brand b { color: var(--olive); font-weight: 700; }
.gh__title { font-weight: 700; font-size: 16px; display: none; }
.gh__search { position: relative; flex: 1; max-width: 560px; margin: 0 auto; }
.gh__search input {
  width: 100%; height: 32px; border: 1px solid transparent; border-radius: var(--r);
  background: rgba(255, 255, 255, .14); color: #fff; padding: 0 12px 0 34px; font: inherit; font-size: 13px;
}
.gh__search input::placeholder { color: rgba(255, 255, 255, .7); }
.gh__search input:focus { background: #fff; color: var(--ink); outline: 2px solid var(--olive); outline-offset: 0; }
.gh__search input:focus::placeholder { color: var(--muted); }
.gh__search .icon { position: absolute; left: 10px; top: 7px; width: 18px; height: 18px; color: rgba(255,255,255,.85); pointer-events: none; }
.gh__search input:focus ~ .icon { color: var(--muted); }
.gh__actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.gh__btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r);
  color: #fff; background: transparent; border: 0; cursor: pointer;
}
.gh__btn:hover { background: rgba(255, 255, 255, .14); text-decoration: none; }
.gh__btn--plus { background: var(--olive); color: var(--ink); }
.gh__btn--plus:hover { background: #c4bf1a; }
.av { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #fff; color: var(--petrol-dark); font-weight: 700; font-size: 12px; }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; border-radius: 50%; display: grid; place-items: center; width: 32px; height: 32px; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover { background: rgba(255,255,255,.14); }
.menu__panel {
  position: absolute; right: 0; top: 40px; width: 240px; z-index: 60;
  background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 4px 12px rgba(22,36,44,.2);
}
.menu__who { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.menu__who strong { display: block; }
.menu__panel a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: var(--ink); }
.menu__panel a:hover { background: var(--hover); text-decoration: none; }

/* ---------- Navigationsleiste ---------- */
.nb { display: none; position: sticky; top: var(--gh-h); z-index: 39; height: var(--nb-h); background: #fff; border-bottom: 1px solid var(--line); padding: 0 12px; align-items: stretch; }
.nb__app { display: flex; align-items: center; gap: 10px; padding-right: 18px; margin-right: 6px; border-right: 1px solid var(--line); font-weight: 700; font-size: 16px; color: var(--ink); }
.nb__app .obj { width: 28px; height: 28px; }
.nb__tabs { display: flex; align-items: stretch; margin: 0; padding: 0; list-style: none; }
.nb__tabs li { display: flex; }
.nb__tabs a { position: relative; display: flex; align-items: center; gap: 8px; padding: 0 16px; color: var(--ink); font-weight: 500; }
.nb__tabs a:hover { background: var(--hover); text-decoration: none; }
.nb__tabs a.active { font-weight: 700; }
.nb__tabs a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--olive); }

/* ---------- Seite ---------- */
.page { max-width: 1480px; margin: 0 auto; padding: 12px 12px calc(var(--bn-h) + env(safe-area-inset-bottom, 0px) + 24px); }
.page--narrow { max-width: 860px; }
.stack > * + * { margin-top: 12px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card__h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; }
.card__h h2 { font-size: 15px; display: flex; align-items: center; gap: 10px; }
.card__b { padding: 4px 16px 16px; }
.card__b--flush { padding: 0; }
.card__f { padding: 10px 16px; border-top: 1px solid var(--line); text-align: center; font-size: 13px; }
.grid2 { display: grid; gap: 12px; grid-template-columns: 1fr; }

/* Listen-/Seitenkopf */
.ph { display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
.ph__t { min-width: 0; flex: 1 1 0; }
.ph__t h1 { font-size: 20px; }
.ph__t p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.ph__a { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--r); background: #fff; color: var(--link);
  font: 500 13px/1 var(--font); cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--hover); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--brand { background: var(--link); border-color: var(--link); color: #fff; }
.btn--brand:hover { background: var(--link-dark); }
.btn--danger { color: var(--err); }
.btn--sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn--icon { width: 32px; padding: 0; }
.btn--block { display: flex; width: 100%; }
.btn-group { display: inline-flex; }
.btn-group > .btn, .btn-group > form > .btn { border-radius: 0; margin-left: -1px; }
.btn-group > .btn:first-child, .btn-group > form:first-child > .btn { border-radius: var(--r) 0 0 var(--r); margin-left: 0; }
.btn-group > .btn:last-child, .btn-group > form:last-child > .btn { border-radius: 0 var(--r) var(--r) 0; }
.iconbtn { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 0; background: transparent; color: var(--muted); border-radius: var(--r); cursor: pointer; }
.iconbtn:hover { background: var(--hover); color: var(--ink); }
.iconbtn--danger:hover { color: var(--err); }
.iconbtn--done { color: var(--ok); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 10px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--soft); color: var(--muted); }
.badge--interessent, .badge--interessiert, .badge--angebot { background: var(--olive-bg); color: var(--olive-ink); }
.badge--kunde, .badge--gewonnen { background: var(--ok-bg); color: var(--ok); }
.badge--inaktiv { background: #e8ecee; color: var(--muted); }
.badge--verhandlung { background: #dcebf1; color: var(--link-dark); }
.badge--verloren { background: var(--err-bg); color: var(--err); }
.badge--overdue { background: var(--err-bg); color: var(--err); }
.badge--offen { background: var(--olive-bg); color: var(--olive-ink); }
.badge--in_bearbeitung { background: #dcebf1; color: var(--link-dark); }
.badge--eskaliert, .badge--prio-kritisch { background: var(--err-bg); color: var(--err); }
.badge--geloest { background: var(--ok-bg); color: var(--ok); }
.badge--prio-hoch { background: var(--olive-bg); color: var(--olive-ink); }

/* ---------- Formulare ---------- */
.fg { display: grid; grid-template-columns: 1fr; gap: 12px 24px; }
.fg .full { grid-column: 1 / -1; }
.fld { min-width: 0; }
.fld label, .fld .fld__l { display: block; margin-bottom: 4px; font-size: 12px; color: var(--muted); }
.fld .req { color: var(--err); }
.in, .fld input, .fld select, .fld textarea, .toolbar input, .toolbar select {
  width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r);
  background: #fff; color: var(--ink); font: inherit;
}
.fld textarea { height: auto; min-height: 84px; padding: 8px 12px; resize: vertical; }
.fld input:focus, .fld select:focus, .fld textarea:focus, .toolbar input:focus, .toolbar select:focus {
  outline: 0; border-color: var(--link); box-shadow: 0 0 0 1px var(--link), 0 0 3px 1px rgba(42, 108, 138, .35);
}
.fld input[type="checkbox"] { width: auto; height: auto; }
.help { font-size: 12px; color: var(--muted); margin-top: 4px; display: block; }
.err { font-size: 12px; color: var(--err); margin-top: 4px; }
.form-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; background: var(--soft); border-top: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r); }

/* ---------- Sektions-Header (aufklappbar) ---------- */
.sec { margin: 0; }
.sec > summary {
  display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer;
  padding: 8px 12px; background: var(--soft); border-radius: var(--r); font-weight: 700; font-size: 14px;
}
.sec > summary::-webkit-details-marker { display: none; }
.sec > summary .icon { transition: transform .18s cubic-bezier(.22, 1, .36, 1); color: var(--muted); }
.sec[open] > summary .icon { transform: rotate(90deg); }
.sec__b { padding: 10px 4px 4px; }
.sec + .sec { margin-top: 12px; }

/* ---------- Feldraster (Label über Wert) ---------- */
.fields { display: grid; grid-template-columns: 1fr; gap: 0 32px; }
.f { position: relative; min-height: 52px; padding: 8px 28px 6px 0; border-bottom: 1px solid var(--line); }
.f--full { grid-column: 1 / -1; }
.f__l { font-size: 12px; color: var(--muted); }
.f__v { min-height: 20px; overflow-wrap: anywhere; }
.f__e { position: absolute; right: 0; top: 24px; opacity: 0; color: var(--muted); }
.f:hover .f__e, .f:focus-within .f__e { opacity: 1; }
@media (pointer: coarse) { .f__e { display: none; } }

/* ---------- Highlights-Panel ---------- */
.hl { padding: 14px 16px 12px; }
.hl__top { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.hl__id { display: flex; gap: 12px; align-items: center; min-width: 0; flex: 1 1 260px; }
.hl__id h1 { font-size: 21px; overflow-wrap: anywhere; }
.hl__id p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.hl__acts { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.hl__facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.hl__facts dt { font-size: 12px; color: var(--muted); }
.hl__facts dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }

/* ---------- Path ---------- */
.path { display: flex; gap: 0; margin: 0; padding: 8px 12px; list-style: none; }
.path li { flex: 1; min-width: 0; }
.path form { display: contents; }
.path button {
  width: 100%; height: 34px; border: 0; cursor: pointer; padding: 0 18px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: #e1e8ea; color: var(--muted); font-size: 13px; font-weight: 700;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%);
  margin-left: -8px;
}
.path li:first-child button { margin-left: 0; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); border-radius: var(--r) 0 0 var(--r); }
.path li:last-child button { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 12px 50%); }
.path button:hover { background: #d3dde0; }
.path .done button { background: var(--olive-bg); color: var(--olive-ink); }
.path .cur button { background: var(--petrol-dark); color: #fff; }
.path .cur button:hover { background: var(--petrol-deep); }

/* ---------- Tabs ---------- */
.tabs { display: none; border-bottom: 1px solid var(--line); padding: 0 8px; position: sticky; top: var(--gh-h); background: #fff; z-index: 5; border-radius: var(--r) var(--r) 0 0; }
.js .tabs { display: flex; }
.tab { position: relative; padding: 11px 14px; border: 0; background: none; color: var(--muted); font-weight: 500; font-size: 14px; cursor: pointer; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); font-weight: 700; }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 3px; background: var(--link); }
.pane[hidden] { display: none; }

/* ---------- Record-Layout ---------- */
.rec { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.rec__side > * + * { margin-top: 12px; }
.pane__b { padding: 14px 16px 18px; }

/* ---------- Aktivität ---------- */
.composer { border: 1px solid var(--line); border-radius: var(--r); background: var(--soft); padding: 12px; margin-bottom: 18px; }
.composer h3 { font-size: 14px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.composer .fld input, .composer .fld select, .composer .fld textarea { background: #fff; }
.composer .btn-row { display: flex; justify-content: flex-end; margin-top: 12px; }
.sub-h { font-size: 14px; margin: 18px 0 8px; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tl li:last-child { border-bottom: 0; }
.tl__t { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.tl__t strong { overflow-wrap: anywhere; }
.tl__d { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tl__x { margin-top: 2px; overflow-wrap: anywhere; }
.tl__wv { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; font-size: 13px; }
.todo { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.todo:last-child { border-bottom: 0; }

/* ---------- Related-Listen ---------- */
.rl__row { display: block; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--ink); }
.rl__row:first-of-type { border-top: 1px solid var(--line); }
a.rl__row:hover { background: var(--hover); text-decoration: none; }
.rl__row strong { display: block; color: var(--link); }
.rl__meta { font-size: 12px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.note-row { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.note-row p { margin: 0; overflow-wrap: anywhere; }
.rl__empty { padding: 12px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.rl__add { border-top: 1px solid var(--line); }
.rl__add summary { list-style: none; cursor: pointer; padding: 10px 16px; text-align: center; color: var(--link); font-weight: 500; font-size: 13px; }
.rl__add summary::-webkit-details-marker { display: none; }
.rl__add summary:hover { background: var(--hover); }
.rl__add .in-form { padding: 4px 16px 16px; }

/* ---------- Tabellen / Listenansicht ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; align-items: center; }
.toolbar .grow { flex: 1 1 220px; position: relative; }
.toolbar .grow input { padding-left: 34px; }
.toolbar .grow .icon { position: absolute; left: 10px; top: 9px; color: var(--muted); pointer-events: none; }
.toolbar select { width: auto; max-width: 200px; }
.seg { display: inline-flex; }
.seg a { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border: 1px solid var(--line-strong); margin-left: -1px; color: var(--ink); font-size: 13px; background: #fff; white-space: nowrap; }
.seg a:first-child { border-radius: var(--r) 0 0 var(--r); margin-left: 0; }
.seg a:last-child { border-radius: 0 var(--r) var(--r) 0; }
.seg a:hover { background: var(--hover); text-decoration: none; }
.seg a.on { background: var(--petrol-dark); border-color: var(--petrol-dark); color: #fff; font-weight: 700; position: relative; z-index: 1; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.tbl th { position: sticky; top: 0; text-align: left; padding: 8px 12px; background: var(--soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.tbl th a { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.tbl th a:hover { color: var(--ink); text-decoration: none; }
.tbl th.sorted { color: var(--ink); }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:hover { background: var(--hover); }
.tbl .c-name a { font-weight: 700; }
.tbl .c-fav { width: 28px; padding-right: 0; }
.sub-m { display: none; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.due { white-space: nowrap; }
.due--late { color: var(--err); font-weight: 700; }

/* ---------- Kanban ---------- */
.kb { display: flex; gap: 10px; overflow-x: auto; align-items: flex-start; margin-top: 12px; padding-bottom: 12px; scroll-snap-type: x proximity; }
.kb__col { flex: 0 0 min(82vw, 290px); background: #dde5e8; border-radius: var(--r); scroll-snap-align: start; }
.kb__h { padding: 10px 12px 8px; }
.kb__h strong { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.kb__h .dot { width: 8px; height: 8px; border-radius: 2px; background: var(--petrol-light); }
.kb__sum { font-size: 12px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.kb__body { padding: 0 8px 8px; min-height: 64px; display: flex; flex-direction: column; gap: 8px; }
.kb__col.over { outline: 2px dashed var(--link); outline-offset: -2px; }
.kc { background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 10px 12px; cursor: grab; }
.kc.drag { opacity: .45; }
.kc a.kc__t { font-weight: 700; display: block; overflow-wrap: anywhere; }
.kc__m { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kc__v { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12px; font-variant-numeric: tabular-nums; }
.kc__v strong { font-size: 13px; }

/* ---------- Dashboard ---------- */
.kv { margin: 0; }
.kv > div { display: flex; justify-content: space-between; align-items: center; padding: 9px 16px; border-top: 1px solid var(--line); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.pipe { padding: 0 16px 14px; }
.pipe__row { display: grid; grid-template-columns: 96px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.pipe__track { height: 10px; background: #e1e8ea; border-radius: 2px; overflow: hidden; }
.pipe__fill { height: 100%; background: var(--petrol-light); border-radius: 2px; }
.pipe__row--angebot .pipe__fill { background: var(--olive); }
.pipe__row--verhandlung .pipe__fill { background: var(--petrol-dark); }
.pipe__row--gewonnen .pipe__fill { background: var(--ok); }
.pipe__v { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 64px; text-align: right; }
.hello { padding: 14px 16px; display: flex; align-items: center; gap: 14px; }
.hello h1 { font-size: 20px; }
.hello p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.hello .av { width: 44px; height: 44px; font-size: 16px; background: var(--olive); color: var(--ink); }

/* ---------- Route ---------- */
.routegrid { display: grid; gap: 12px; grid-template-columns: 1fr; }

#map { width: 100%; height: 260px; border-radius: var(--r); overflow: hidden; position: relative; border: 1px solid var(--line); }
.stop { display: grid; grid-template-columns: 30px 28px 1fr auto; gap: 8px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line); }
.stop.is-done .stop__n { background: var(--ok); }
.stop.is-done .stop__name { text-decoration: line-through; color: var(--muted); }
.stop__n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--petrol); color: #fff; font-size: 12px; font-weight: 700; }
.stop__name { font-weight: 700; display: block; overflow-wrap: anywhere; }
.stop__acts { display: flex; align-items: center; }
.stop__acts form { display: inline-flex; }

/* ---------- Toast ---------- */
.toasts { position: fixed; top: calc(var(--gh-h) + 8px); left: 50%; transform: translateX(-50%); z-index: 70; display: grid; gap: 8px; width: min(560px, calc(100vw - 24px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--r); background: var(--ok); color: #fff; font-weight: 500; box-shadow: 0 4px 14px rgba(22,36,44,.3); animation: toast-in .35s cubic-bezier(.22, 1, .36, 1); }
.toast--error { background: var(--err); }
.toast span { flex: 1; }
.toast button { background: none; border: 0; color: #fff; cursor: pointer; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 3px; }
.toast button:hover { background: rgba(255,255,255,.2); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } .sec > summary .icon { transition: none; } }

/* ---------- Leerzustand ---------- */
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty .icon { width: 34px; height: 34px; color: var(--line-strong); margin-bottom: 6px; }
.empty p { margin-bottom: 12px; }

/* ---------- Login ---------- */
.login-body { background: var(--petrol-deep); min-height: 100vh; display: grid; place-items: center; padding: 24px 12px; }
.login { width: min(400px, 100%); }
.login__brand { text-align: center; color: #fff; font-weight: 700; font-size: 30px; letter-spacing: -.01em; margin-bottom: 4px; }
.login__brand b { color: var(--olive); }
.login__sub { text-align: center; color: rgba(255,255,255,.75); margin-bottom: 18px; font-size: 13px; }
.login .card { padding: 22px 22px 24px; }
.login h1 { font-size: 18px; margin-bottom: 4px; }
.login .lead { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.login .fld + .fld { margin-top: 12px; }
.login .btn { margin-top: 18px; height: 40px; }
.alert { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--r); background: var(--err-bg); color: var(--err); margin-bottom: 14px; font-size: 13px; }

/* ---------- Bottom-Navigation (Smartphone) ---------- */
.bn { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: flex; height: calc(var(--bn-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -2px 8px rgba(22,36,44,.08); }
.bn a { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--petrol-light); font-size: 11px; font-weight: 700; }
.bn a:hover { text-decoration: none; }
.bn a .icon { width: 22px; height: 22px; }
.bn a.active { color: var(--petrol-dark); }
.bn a.active::before { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; background: var(--olive); }
.bn__fab span { display: grid; place-items: center; width: 46px; height: 46px; margin-top: -22px; border-radius: 50%; background: var(--olive); color: var(--ink); box-shadow: 0 3px 8px rgba(22,36,44,.3); }

::placeholder { color: var(--muted); opacity: 1; }
.path button:focus-visible { outline: 0; box-shadow: inset 0 0 0 2px var(--link); }

/* ---------- App installieren ---------- */
.install { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; }
.install[hidden] { display: none; }
.install__t { flex: 1; min-width: 0; }
.install__t h2 { font-size: 15px; }
.install__t p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.install__t ol { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }
.install__t li + li { margin-top: 4px; }
.install__act { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.install img { width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0; }
.js-only[hidden] { display: none; }

/* ---------- Leaflet ---------- */
.leaflet-container { font-family: var(--font); }

/* ---------- Breakpoints ---------- */
@media (max-width: 899px) {
  .gh__title { display: block; }
  .gh__brand, .gh__search, .gh__btn--plus, .gh__waffle { display: none; }
  .gh__search-m { display: inline-grid; }
  .ph .ph__a .btn span { display: none; }
  .hl__acts { width: 100%; margin-left: 0; }
  .tbl thead { display: none; }
  .tbl tbody tr { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .tbl td { border: 0; padding: 0; }
  .tbl td.c-name { flex: 1; min-width: 0; }
  .c-hide-m { display: none !important; }
  .sub-m { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
  .hl__acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .hl__acts > * { min-width: 0; }
  .hl__acts form, .hl__acts .btn-group { display: flex; }
  .hl__acts .btn { flex: 1; width: 100%; }
  .hl__acts .btn-group .btn--icon { flex: 0 0 44px; width: 44px; }
  .toolbar select { max-width: none; flex: 1 1 42%; }
  .toolbar .grow { flex: 1 1 0; }
  .toolbar .seg { width: 100%; }
  .toolbar .seg a { flex: 1; justify-content: center; padding: 0 6px; }
}
@media (min-width: 900px) {
  .gh__search-m, .bn, .only-m { display: none !important; }
  .nb { display: flex; }
  .page { padding-bottom: 32px; padding-left: 16px; padding-right: 16px; }
  .fg { grid-template-columns: 1fr 1fr; }
  .fields { grid-template-columns: 1fr 1fr; }
  .hl__facts { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .tabs { top: calc(var(--gh-h) + var(--nb-h)); }
  .tbl td:not(.c-name) { white-space: nowrap; }
  .tbl .c-name { width: 36%; }
  .grid2 { grid-template-columns: 1fr 1fr; }
  .grid2--home { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
  .routegrid { grid-template-columns: 420px minmax(0, 1fr); }
  .routegrid.routegrid--solo { grid-template-columns: minmax(0, 1fr); }
  .routegrid--solo > .stack { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px; align-items: start; }
  .routegrid--solo > .stack > * { margin-top: 0; }
  .routegrid--solo > .stack > :first-child { grid-row: span 2; }
  #map { height: 520px; position: sticky; top: calc(var(--gh-h) + var(--nb-h) + 12px); }
  .kb__col { flex: 1 1 230px; min-width: 230px; }
}
@media (min-width: 1100px) {
  .rec { grid-template-columns: minmax(0, 1fr) 380px; }
  .tab[data-tab="verknuepft"] { display: none; }
  .rec__side[hidden] { display: block; }
}
@media (pointer: coarse) {
  .btn { height: 40px; }
  .btn--sm { height: 36px; }
  .btn--icon { width: 40px; }
  .in, .fld input, .fld select, .fld textarea, .toolbar input, .toolbar select { height: 44px; font-size: 16px; }
  .fld textarea { height: auto; }
  .gh__btn, .menu > summary { width: 40px; height: 40px; }
  .iconbtn { width: 40px; height: 40px; }
  .seg a { height: 40px; }
  .path button { height: 40px; }
  .tab { padding: 13px 16px; }
}
@media (min-width: 900px) and (pointer: coarse) { .gh__search input { height: 40px; } .gh__search .icon { top: 11px; } }

/* ---------- Einstellungen (Setup-Rahmen, Hub) ---------- */
.setup { display: block; }
.setup__nav { display: none; }
.setup__main > * + * { margin-top: 12px; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; font-size: 13px; color: var(--muted); padding: 0 2px; }
.crumbs .icon { width: 14px; height: 14px; }
.crumbs [aria-current] { color: var(--ink); font-weight: 700; }
.hub { display: grid; gap: 12px; grid-template-columns: 1fr; }
.hub__c { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); color: var(--ink); }
.hub__c:hover { background: var(--hover); text-decoration: none; }
.hub__t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.hub__t strong { font-size: 15px; }
.hub__t span { font-size: 13px; color: var(--muted); }
.hub__go { color: var(--muted); flex: none; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; background: var(--olive-bg); border: 1px solid #e0dd9a; border-radius: var(--r); color: var(--olive-ink); }
.notice .icon { flex: none; margin-top: 2px; }
.notice a { color: inherit; font-weight: 700; text-decoration: underline; }
.usr { display: inline-flex; align-items: center; gap: 10px; color: inherit; }
.usr:hover { text-decoration: none; }
.usr > span:last-child { display: block; font-weight: 700; color: var(--link); }
.tbl tr.is-off td { opacity: .6; }
.pwrow { display: flex; gap: 8px; }
.pwrow input { flex: 1; min-width: 0; }
.kv { margin: 0; padding: 0 16px 12px; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.danger-zone { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.danger-zone:first-of-type { border-top: 0; padding-top: 4px; }
.danger-zone p { margin: 2px 0 0; font-size: 13px; }
.chk { display: inline-flex !important; align-items: center; gap: 8px; margin: 0 !important; font-size: 14px !important; color: var(--ink) !important; cursor: pointer; }
.opts { display: flex; flex-direction: column; gap: 10px; }
.radios { border: 0; padding: 0; margin: 0; min-width: 0; }
.radios legend { padding: 0; margin-bottom: 6px; font-size: 12px; color: var(--muted); }
.radio { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; font-size: 14px !important; color: var(--ink) !important; margin: 0 0 8px !important; }
.radio:has(input:checked) { border-color: var(--link); background: #f1f7f9; }
.radio input { margin-top: 3px; width: auto !important; height: auto !important; }
.radio > span { display: flex; flex-direction: column; min-width: 0; }

/* ---------- Felder-Manager ---------- */
.sec--plain > summary { background: transparent; padding: 12px 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 0; }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; background: var(--soft); border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.lay__h, .lay__gh { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 10px 16px; background: var(--soft); border-bottom: 1px solid var(--line); border-radius: var(--r) var(--r) 0 0; }
.lay__h h2 { font-size: 15px; display: block; min-width: 0; overflow-wrap: anywhere; }
.lay__h h2 .icon, .lay__gh h3 .icon { vertical-align: -3px; margin-right: 6px; color: var(--muted); }
.lay__h h2 .muted, .lay__gh h3 .muted { font-size: 11px; font-weight: 400; text-transform: uppercase; letter-spacing: .04em; }
.lay__a { display: flex; align-items: center; gap: 2px; flex: none; }
.lay__a form { display: inline-flex; }
.lay__g { margin: 8px 12px 0 28px; border: 1px solid var(--line); border-radius: var(--r); }
.lay__gh { border-radius: var(--r) var(--r) 0 0; padding: 6px 8px 6px 12px; }
.lay__gh h3 { font-size: 13px; }
.lay__add { display: flex; align-items: center; gap: 16px; padding: 8px 16px; font-size: 13px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.lay__add a, .inl--add > summary { display: inline-flex; align-items: center; gap: 4px; color: var(--link); cursor: pointer; font-weight: 500; }
.lay__g .lay__add { border-top: 1px solid var(--line); }
.lay > .lay__add:last-child { border-radius: 0 0 var(--r) var(--r); }
.frow { display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 16px; border-top: 1px solid var(--line); }
.lay__h + .frow, .lay__gh + .frow { border-top: 0; }
.frow__t { flex: 1; min-width: 0; color: var(--ink); }
.frow__t strong { display: block; color: var(--link); }
.frow__t:hover { text-decoration: none; background: transparent; }
.frow.is-off { opacity: .6; }
.mv { display: inline-flex; flex: none; }
.mv form { display: inline-flex; }
.mv .iconbtn { width: 28px; height: 28px; }
.mv .iconbtn:disabled { opacity: .25; cursor: default; }
.inl { display: inline-block; position: relative; }
.inl > summary { list-style: none; cursor: pointer; }
.inl > summary::-webkit-details-marker { display: none; }
.inl > summary.iconbtn { display: inline-grid; width: 28px; height: 28px; }
.inl__f { display: flex; gap: 8px; align-items: center; padding: 8px 0 4px; }
.inl[open] { flex-basis: 100%; }
.inl[open] > .inl__f { position: absolute; right: 0; top: 100%; z-index: 20; background: #fff; border: 1px solid var(--line-strong); border-radius: var(--r); padding: 8px; box-shadow: 0 4px 12px rgba(22, 36, 44, .18); min-width: min(320px, 80vw); }
.inl--add[open] > .inl__f { right: auto; left: 0; }
.inl__f input { flex: 1; min-width: 0; height: 32px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r); font: inherit; }
.inl__f--row { align-items: flex-end; flex-wrap: wrap; }
.inl__f--row .fld { flex: 1 1 260px; }
.inl__f--row input { height: 36px; width: 100%; }
.fgroup { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px 12px; }
.fgroup__t { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 8px; font-weight: 700; }
.fields .fgroup__t { margin: 14px 0 0; }
.cfline { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 12px; margin-top: 4px; }
.fg--cf { margin-top: 12px; }
.esk p { margin-bottom: 10px; }

/* Suchfeld für Verknüpfungen */
input[data-lookup]:valid { background-image: none; }

@media (min-width: 900px) {
  .setup { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
  .setup__nav { display: block; position: sticky; top: calc(var(--gh-h) + var(--nb-h) + 12px); background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 6px 0; }
  .setup__home { display: flex; align-items: center; gap: 8px; padding: 10px 16px; font-weight: 700; color: var(--ink); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
  .setup__nav ul { list-style: none; margin: 0; padding: 0; }
  .setup__nav li a { display: flex; align-items: center; gap: 10px; padding: 9px 16px; color: var(--ink); border-left: 3px solid transparent; }
  .setup__nav li a:hover { background: var(--hover); text-decoration: none; }
  .setup__nav li a.active { border-left-color: var(--olive); background: var(--soft); font-weight: 700; }
  .hub { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 899px) {
  .danger-zone { flex-direction: column; align-items: stretch; }
  .inl[open] > .inl__f { right: auto; left: -200px; }
  .lay__g { margin-left: 12px; }
}
