@import url("tokens.css");

/* ═══════════════════════════════════════════════════════════════════════════
   Grundlagen
   ═══════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gbl-blue-500); }

:focus-visible { outline: 2px solid var(--gbl-blue-500); outline-offset: 2px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; border: 2px solid var(--bg); }

.hidden { display: none !important; }
/* Basisgroesse fuer alle Inline-Icons – ohne sie skaliert das SVG auf Containerbreite. */
.ico { width: 18px; height: 18px; flex: none; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Anmeldung
   ═══════════════════════════════════════════════════════════════════════════ */
#login-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1100px 600px at 15% -10%, rgba(47, 66, 160, .28), transparent 60%),
    linear-gradient(160deg, var(--gbl-blue-900), var(--gbl-blue-700) 55%, var(--gbl-blue) 100%);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px 30px;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.login-title { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.login-sub { color: var(--text-muted); font-size: 13px; margin-bottom: 26px; }
.login-hint {
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-faint); line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Markenzeichen
   ═══════════════════════════════════════════════════════════════════════════ */
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 40px; height: 40px; flex: none;
  border-radius: 8px;
  background: var(--gbl-blue);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 15px; letter-spacing: .02em;
  position: relative; overflow: hidden;
}
.logo-mark::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 5px; background: var(--gbl-yellow);
}
.logo-mark.on-dark { background: #fff; color: var(--gbl-blue); }
.logo-text { line-height: 1.15; }
.logo-text b { display: block; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.logo-text span { display: block; font-size: 11px; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════════════════
   Grundgeruest
   ═══════════════════════════════════════════════════════════════════════════ */
#app { display: none; }
#app.ready { display: block; }

#nav {
  position: fixed; inset: 0 auto 0 0;
  width: var(--nav-w);
  background: var(--nav-bg);
  display: flex; flex-direction: column;
  z-index: 40;
}
.nav-head {
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.nav-head .logo-text b { color: #fff; }
.nav-head .logo-text span { color: var(--nav-text); }

.nav-scroll { flex: 1; overflow-y: auto; padding: 12px 10px; }
.nav-group-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .12em;
  color: rgba(255, 255, 255, .38); padding: 14px 10px 6px; font-weight: 700;
}
.nav-btn {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 11px; margin-bottom: 2px;
  background: none; border: 0; border-radius: var(--radius-sm);
  color: var(--nav-text); font-size: 13.5px; text-align: left;
  cursor: pointer; transition: background .12s, color .12s;
}
.nav-btn:hover { background: var(--nav-hover); color: #fff; }
.nav-btn.active { background: var(--gbl-blue-500); color: #fff; font-weight: 600; }
.nav-btn .ico { flex: none; width: 18px; height: 18px; opacity: .9; }
.nav-btn .badge-count {
  margin-left: auto; background: var(--gbl-yellow); color: var(--gbl-blue-900);
  font-size: 11px; font-weight: 700; border-radius: 20px; padding: 1px 7px; min-width: 20px; text-align: center;
}
.nav-foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .1); }
.nav-user { display: flex; align-items: center; gap: 10px; padding: 6px 4px 10px; }
.avatar {
  width: 32px; height: 32px; flex: none; border-radius: 50%;
  background: var(--gbl-blue-500); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.nav-user-info { min-width: 0; }
.nav-user-info b { display: block; color: #fff; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user-info span { display: block; color: var(--nav-text); font-size: 11px; }

#main { margin-left: var(--nav-w); min-height: 100dvh; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--header-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.topbar .sub { font-size: 12px; color: var(--text-muted); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.page { padding: 22px 24px 80px; max-width: 1440px; }

/* ═══════════════════════════════════════════════════════════════════════════
   Karten & Raster
   ═══════════════════════════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 18px; }
.card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.card-head h2 { font-size: 14px; font-weight: 700; }
.card-head .sub { font-size: 12px; color: var(--text-muted); font-weight: 400; }
.card-head-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack > * + * { margin-top: 14px; }

/* Kennzahlen */
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 17px;
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.kpi::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--gbl-blue);
}
.kpi.accent::before { background: var(--gbl-yellow); }
.kpi.good::before { background: var(--success); }
.kpi.warn::before { background: var(--warning); }
.kpi-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted); font-weight: 600; margin-bottom: 7px;
}
.kpi-value { font-size: 25px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 13px; font-weight: 500; color: var(--text-muted); margin-left: 3px; }
.kpi-foot { font-size: 12px; color: var(--text-muted); margin-top: 5px; }

/* ═══════════════════════════════════════════════════════════════════════════
   Schaltflaechen
   ═══════════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 15px; border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--gbl-blue); color: #fff;
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: background .12s, box-shadow .12s, opacity .12s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .ico { width: 16px; height: 16px; }

.btn-accent { background: var(--gbl-yellow); color: var(--gbl-blue-900); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-quiet { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }

/* Schwebeeffekte nur fuer Geraete, die wirklich schweben koennen. Auf dem
   iPhone bleibt :hover nach dem Antippen haengen – ein Knopf bekam dort den
   Hintergrund der Kopfzeile und war scheinbar verschwunden. */
@media (hover: hover) {
  .btn:hover { background: var(--gbl-blue-700); }
  .btn-accent:hover { background: var(--gbl-yellow-600); }
  .btn-ghost:hover { background: var(--surface-sunken); }
  .btn-quiet:hover { background: var(--surface-sunken); color: var(--text); }
  .btn-danger:hover { background: var(--danger-bg); }
}

.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { padding: 6px; width: 32px; height: 32px; }

.seg { display: inline-flex; background: var(--surface-sunken); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; color: var(--text-muted);
  padding: 5px 12px; border-radius: 4px; font-size: 12.5px; cursor: pointer; font-weight: 500;
}
.seg button.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }

/* ═══════════════════════════════════════════════════════════════════════════
   Formulare
   ═══════════════════════════════════════════════════════════════════════════ */
.field { margin-bottom: 14px; }
.field > label, .field-label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-muted); margin-bottom: 5px;
}
.field-label .req { color: var(--danger); }

.input, select.input, textarea.input {
  width: 100%; padding: 8px 11px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text);
  transition: border-color .12s, box-shadow .12s;
}
.input::placeholder { color: var(--text-faint); }
.input:focus { outline: none; border-color: var(--gbl-blue-500); box-shadow: var(--ring); }
.input:disabled { background: var(--surface-sunken); color: var(--text-muted); }
.input.err { border-color: var(--danger); }
textarea.input { resize: vertical; min-height: 68px; }
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235B6379' d='M6 8.5 1.5 4h9z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px;
}
.field-err { font-size: 12px; color: var(--danger); margin-top: 4px; }
.field-help { font-size: 12px; color: var(--text-faint); margin-top: 4px; }

.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.check input { width: 16px; height: 16px; accent-color: var(--gbl-blue); cursor: pointer; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }

/* Farbwahl Fahrzeuge */
.color-row { display: flex; gap: 8px; flex-wrap: wrap; }
.color-dot {
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  border: 3px solid transparent; transition: transform .1s;
}
.color-dot:hover { transform: scale(1.1); }
.color-dot[aria-pressed="true"] { border-color: var(--text); transform: scale(1.12); }

/* ═══════════════════════════════════════════════════════════════════════════
   Tabellen
   ═══════════════════════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; padding: 9px 12px; white-space: nowrap;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); background: var(--surface-2);
  border-bottom: 1px solid var(--border); position: sticky; top: 0;
}
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tfoot td { font-weight: 700; background: var(--surface-2); border-top: 2px solid var(--border-strong); }
.tbl .clickable { cursor: pointer; }

/* ═══════════════════════════════════════════════════════════════════════════
   Chips, Badges, Punkte
   ═══════════════════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 20px;
  background: var(--surface-sunken); color: var(--text-muted); white-space: nowrap;
}
.badge-blue    { background: var(--info-bg);    color: var(--info-text); }
.badge-yellow  { background: var(--accent-bg);  color: var(--accent-text); }
.badge-green   { background: var(--success-bg); color: var(--success-text); }
.badge-orange  { background: var(--warning-bg); color: var(--warning-text); }
.badge-red     { background: var(--danger-bg);  color: var(--danger-text); }

.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.swatch { width: 4px; align-self: stretch; border-radius: 2px; flex: none; }

.note {
  display: flex; gap: 10px; padding: 11px 14px;
  border-radius: var(--radius-sm); font-size: 13px; line-height: 1.5;
  border: 1px solid transparent;
}
.note-info   { background: var(--info-bg);    color: var(--info-text);    border-color: color-mix(in srgb, var(--gbl-blue-500) 30%, transparent); }
.note-warn   { background: var(--warning-bg); color: var(--warning-text); border-color: color-mix(in srgb, var(--warning) 35%, transparent); }
.note-danger { background: var(--danger-bg);  color: var(--danger-text);  border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.note-good   { background: var(--success-bg); color: var(--success-text); border-color: color-mix(in srgb, var(--success) 35%, transparent); }
.note .ico { flex: none; width: 18px; height: 18px; margin-top: 1px; }

.empty { text-align: center; padding: 42px 20px; color: var(--text-muted); }
.empty .ico { width: 40px; height: 40px; margin: 0 auto 12px; color: var(--text-faint); }
.empty h3 { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.empty p { font-size: 13px; max-width: 380px; margin: 0 auto 16px; }

/* ═══════════════════════════════════════════════════════════════════════════
   Kalender
   ═══════════════════════════════════════════════════════════════════════════ */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.cal-dow {
  padding: 9px 0; text-align: center; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted);
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.cal-cell {
  min-height: 104px; padding: 6px;
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.out { background: var(--surface-sunken); }
.cal-cell.weekend { background: color-mix(in srgb, var(--surface-sunken) 45%, transparent); }
.cal-daynum {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px;
}
.cal-daynum.today { background: var(--gbl-blue); color: #fff; }
.cal-item {
  display: block; width: 100%; text-align: left;
  font-size: 11px; line-height: 1.35; padding: 3px 6px; margin-bottom: 3px;
  border-radius: 4px; border: 0; border-left: 3px solid; cursor: pointer;
  background: var(--surface-sunken); color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-item b { font-weight: 600; }
.cal-more { font-size: 11px; color: var(--text-muted); padding-left: 6px; }

/* ═══════════════════════════════════════════════════════════════════════════
   Dialoge
   ═══════════════════════════════════════════════════════════════════════════ */
#overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(13, 20, 53, .55);
  display: none; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(2px);
}
#overlay.open { display: flex; }
.modal {
  width: 100%; max-width: 560px; max-height: 92dvh;
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  animation: pop .16s ease-out;
}
.modal.wide { max-width: 780px; }
.modal.narrow { max-width: 420px; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.99); } }
.modal-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-head h2 { font-size: 15.5px; font-weight: 700; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot {
  display: flex; gap: 9px; justify-content: flex-end;
  padding: 14px 20px; border-top: 1px solid var(--border);
  background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Hinweise (Toasts) */
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 9px; max-width: 380px; }
.toast {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 15px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--gbl-blue);
  box-shadow: var(--shadow-lg); font-size: 13.5px;
  animation: slide .2s ease-out;
}
.toast.good { border-left-color: var(--success); }
.toast.warn { border-left-color: var(--warning); }
.toast.err  { border-left-color: var(--danger); }
.toast b { display: block; margin-bottom: 2px; }
@keyframes slide { from { opacity: 0; transform: translateX(20px); } }

/* ═══════════════════════════════════════════════════════════════════════════
   Belegerfassung
   ═══════════════════════════════════════════════════════════════════════════ */
.scan-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 28px 20px; text-align: center;
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2); cursor: pointer; color: var(--text-muted);
  transition: border-color .12s, background .12s;
}
.scan-drop:hover, .scan-drop.drag { border-color: var(--gbl-blue-500); background: var(--gbl-blue-050); color: var(--gbl-blue); }
.scan-drop .ico { width: 34px; height: 34px; }
.scan-drop b { color: var(--text); font-size: 14px; }

.scan-preview { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.scan-preview img { width: 100%; max-height: 260px; object-fit: contain; background: var(--surface-sunken); }

.ocr-panel { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.ocr-head { display: flex; align-items: center; gap: 9px; padding: 10px 14px; background: var(--gbl-blue-050); font-size: 13px; font-weight: 600; color: var(--gbl-blue); }
.ocr-body { padding: 12px 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.ocr-item { font-size: 12px; }
.ocr-item span { display: block; color: var(--text-muted); margin-bottom: 2px; }
.ocr-item b { font-size: 14px; font-weight: 600; }

.spinner {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
  border-top-color: currentColor; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Ladeskelett */
.skel { background: linear-gradient(90deg, var(--surface-sunken) 25%, var(--border) 50%, var(--surface-sunken) 75%);
        background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Fortschrittsbalken (Anteil geschaeftlich/privat) */
.bar { height: 8px; border-radius: 4px; background: var(--surface-sunken); overflow: hidden; display: flex; }
.bar > span { display: block; height: 100%; }

/* ═══════════════════════════════════════════════════════════════════════════
   Mobil
   ═══════════════════════════════════════════════════════════════════════════ */
#tabbar { display: none; }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  :root { --nav-w: 0px; }

  #nav {
    transform: translateX(-100%);
    transition: transform .22s ease;
    width: 260px;
    box-shadow: var(--shadow-lg);
  }
  #nav.open { transform: translateX(0); }
  #nav-scrim { position: fixed; inset: 0; background: rgba(13,20,53,.5); z-index: 35; display: none; }
  #nav-scrim.open { display: block; }

  #main { margin-left: 0; padding-bottom: 68px; }

  /* Kopfzeile: Untertitel weglassen, Titel darf abschneiden – sonst
     draengt der Untertitel die Ueberschrift aus dem Bild. */
  .topbar { padding: 0 12px; gap: 10px; }
  .topbar .sub { display: none; }
  .topbar > div:not(.topbar-actions) { min-width: 0; }
  .topbar h1 { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .btn { padding: 6px 10px; font-size: 12.5px; }
  .page { padding: 16px 14px 90px; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }

  .modal { max-width: none; max-height: 94dvh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; align-self: flex-end; }
  #overlay { padding: 0; align-items: flex-end; }
  .modal-foot { border-radius: 0; padding-bottom: max(14px, env(safe-area-inset-bottom)); }

  #toasts { left: 12px; right: 12px; bottom: 78px; max-width: none; }

  .cal-cell { min-height: 66px; padding: 3px; }
  .cal-item { font-size: 10px; padding: 2px 4px; }

  /* Tabellen werden zu Karten */
  .tbl.responsive thead { display: none; }
  .tbl.responsive tbody tr {
    display: block; padding: 11px 2px; border-bottom: 1px solid var(--border);
  }
  .tbl.responsive td {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 3px 0; border: 0; text-align: right;
  }
  .tbl.responsive td::before {
    content: attr(data-label); font-size: 12px; color: var(--text-muted);
    font-weight: 600; text-align: left; flex: none;
  }
  .tbl.responsive td[data-label=""]::before { content: none; }

  #tabbar {
    display: flex; position: fixed; inset: auto 0 0 0; z-index: 45;
    background: var(--surface); border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -2px 12px rgba(18, 27, 74, .08);
  }
  #tabbar button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 8px 2px 7px; background: none; border: 0; cursor: pointer;
    color: var(--text-muted); font-size: 10.5px; font-weight: 600;
  }
  #tabbar button.active { color: var(--gbl-blue); }
  #tabbar button .ico { width: 21px; height: 21px; }
  #tabbar button.primary .ico {
    background: var(--gbl-yellow); color: var(--gbl-blue-900);
    width: 40px; height: 40px; border-radius: 50%; padding: 9px;
    margin-top: -16px; box-shadow: var(--shadow);
  }
}

@media print {
  #nav, #tabbar, .topbar-actions, .no-print { display: none !important; }
  #main { margin: 0; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  body { background: #fff; font-size: 11pt; }
  .page { padding: 0; max-width: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Touch-Bedienung
   Groessere Ziele, mehr Luft, Fussleiste dauerhaft. Gilt unabhaengig von der
   Bildschirmbreite – ein Tablet im Querformat ist breit und trotzdem Touch.
   ═══════════════════════════════════════════════════════════════════════════ */
[data-input="touch"] {
  --radius-sm: 8px;
  --radius: 12px;
}

[data-input="touch"] body { font-size: 15px; }

/* Bedienflaechen auf mindestens 44 px – die uebliche Mindestgroesse fuer
   sichere Treffer mit dem Finger. */
[data-input="touch"] .btn { min-height: 44px; padding: 11px 18px; font-size: 15px; }
[data-input="touch"] .btn-sm { min-height: 44px; padding: 10px 15px; font-size: 14px; }
[data-input="touch"] .btn-icon { min-width: 44px; min-height: 44px; padding: 10px; }
[data-input="touch"] .btn-lg { min-height: 52px; font-size: 16px; }

[data-input="touch"] .input,
[data-input="touch"] select.input,
[data-input="touch"] textarea.input {
  min-height: 46px; padding: 11px 13px;
  font-size: 16px;               /* unter 16 px zoomt iOS beim Antippen hinein */
}
[data-input="touch"] .field { margin-bottom: 18px; }
[data-input="touch"] .field > label,
[data-input="touch"] .field-label { font-size: 13px; margin-bottom: 7px; }

[data-input="touch"] .check { min-height: 44px; }
[data-input="touch"] .check input { width: 22px; height: 22px; }

[data-input="touch"] .seg button { min-height: 42px; padding: 10px 16px; font-size: 14px; }
[data-input="touch"] .nav-btn { padding: 13px 12px; font-size: 15px; }
[data-input="touch"] .color-dot { width: 40px; height: 40px; }

[data-input="touch"] .tbl td { padding: 13px 12px; }
[data-input="touch"] .tbl th { padding: 11px 12px; }
[data-input="touch"] .cal-cell { min-height: 78px; }
[data-input="touch"] .cal-item { padding: 5px 7px; font-size: 11.5px; }
[data-input="touch"] .cal-daynum { width: 30px; height: 30px; font-size: 13px; }

/* Schwebehinweise ergeben ohne Zeiger keinen Sinn. Knoepfe stehen hier bewusst
   nicht mehr: "background: inherit" nahm ihnen die eigene Farbe. */
[data-input="touch"] .nav-btn:hover:not(.active) { background: none; }
[data-input="touch"] .tbl tbody tr:hover { background: none; }

/* Fussleiste und ausfahrbare Seitenleiste unabhaengig von der Breite */
[data-input="touch"] #tabbar { display: flex; }
[data-input="touch"] #main { padding-bottom: 76px; }
[data-input="touch"] #btn-menu { display: inline-flex !important; }
[data-input="touch"] #nav {
  transform: translateX(-100%);
  transition: transform .22s ease;
  width: 280px; box-shadow: var(--shadow-lg);
}
[data-input="touch"] #nav.open { transform: translateX(0); }
[data-input="touch"] #nav-scrim { position: fixed; inset: 0; background: rgba(13,20,53,.5); z-index: 35; display: none; }
[data-input="touch"] #nav-scrim.open { display: block; }
[data-input="touch"] #main { margin-left: 0; }
[data-input="touch"] .page { padding-left: 16px; padding-right: 16px; }

/* Dialoge von unten einfahren – der Daumen erreicht die Aktionen */
[data-input="touch"] #overlay { padding: 0; align-items: flex-end; }
[data-input="touch"] .modal {
  max-width: none; max-height: 94dvh;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
[data-input="touch"] .modal-foot {
  border-radius: 0; padding: 16px 20px max(16px, env(safe-area-inset-bottom));
}
[data-input="touch"] .modal-foot .btn { flex: 1; }

/* ═══════════════════════════════════════════════════════════════════════════
   Belegaufnahme: Kamera oder Mediathek
   ═══════════════════════════════════════════════════════════════════════════ */
.capture-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.capture-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 9px; padding: 26px 16px; cursor: pointer; text-align: center;
  background: var(--surface-2); color: var(--text);
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  font-size: 14px; font-weight: 600;
  transition: border-color .12s, background .12s;
  min-height: 128px;
}
.capture-btn:hover, .capture-btn:active {
  border-color: var(--gbl-blue-500); background: var(--gbl-blue-050); color: var(--gbl-blue);
}
.capture-btn .ico { width: 30px; height: 30px; }
.capture-btn > div { display: flex; flex-direction: column; gap: 3px; }
.capture-btn b { display: block; }
.capture-btn small { display: block; font-weight: 400; font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.capture-btn.primary {
  background: var(--gbl-yellow); border-color: var(--gbl-yellow-600); color: var(--gbl-blue-900);
  border-style: solid;
}
.capture-btn.primary small { color: color-mix(in srgb, var(--gbl-blue-900) 70%, transparent); }
.capture-btn.primary:hover, .capture-btn.primary:active {
  background: var(--gbl-yellow-600); color: var(--gbl-blue-900);
}
[data-input="touch"] .capture-choices { grid-template-columns: 1fr; }
[data-input="touch"] .capture-btn {
  min-height: 84px; font-size: 16px;
  flex-direction: row; justify-content: flex-start; text-align: left;
  gap: 16px; padding: 18px 20px;
}
[data-input="touch"] .capture-btn .ico { width: 34px; height: 34px; }
@media (max-width: 560px) {
  .capture-choices { grid-template-columns: 1fr; }
  .capture-btn { min-height: 96px; flex-direction: row; gap: 14px; justify-content: flex-start; text-align: left; padding: 18px; }
  .capture-btn > div { display: flex; flex-direction: column; gap: 3px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Handbuch: Missionsdialog, Quiz und Beispielbilder
   ═══════════════════════════════════════════════════════════════════════════ */
.modal.hb-modal { position: relative; overflow: hidden; }
.hb-steps { display: flex; gap: 6px; margin-bottom: 16px; }
.hb-steps span { flex: 1; height: 5px; border-radius: 3px; background: var(--surface-sunken); transition: background .25s; }
.hb-steps span.on { background: var(--gbl-yellow); }
.hb-step { animation: hb-in .25s ease-out; }
@keyframes hb-in { from { opacity: 0; transform: translateX(14px); } }
.hb-step-kicker { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--accent-text); margin-bottom: 4px; }
.hb-step h3 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 8px; }
.hb-step p { font-size: 14px; line-height: 1.65; color: var(--text-muted); }
.hb-step p b { color: var(--text); }
.hb-stage {
  display: flex; flex-direction: column; justify-content: center; gap: 10px; min-height: 130px;
  margin-bottom: 18px; padding: 18px; border-radius: var(--radius);
  background: var(--surface-sunken); border: 1px solid var(--border);
}
.hb-stage .note { margin: 0; }
.hb-tip {
  display: flex; gap: 10px; margin-top: 16px; padding: 11px 13px; border-radius: var(--radius-sm);
  background: var(--accent-bg); color: var(--accent-text); font-size: 13px; line-height: 1.5;
}
.hb-tip .ico { flex: none; width: 18px; height: 18px; margin-top: 1px; }

.hb-quiz-q { font-size: 16.5px; font-weight: 700; line-height: 1.4; margin-bottom: 14px; }
.hb-answers { display: grid; gap: 9px; }
.hb-answers.felder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hb-answer {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; text-align: left;
  background: var(--surface); color: var(--text); border: 2px solid var(--border); border-radius: var(--radius);
  font: inherit; font-size: 14px; cursor: pointer; transition: border-color .12s, background .12s;
}
.hb-answer:hover:not(:disabled) { border-color: var(--gbl-yellow); }
.hb-answer:disabled { cursor: default; }
.hb-answer-key {
  flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  font-size: 13px; font-weight: 800; background: var(--surface-sunken); color: var(--text-muted);
}
.hb-answers.felder .hb-answer { flex-direction: column; align-items: flex-start; gap: 2px; }
.hb-answers.felder .hb-answer small { font-size: 11.5px; color: var(--text-muted); }
.hb-answers.felder .hb-answer b { font-size: 17px; font-variant-numeric: tabular-nums; }
.hb-answer.right { border-color: var(--success); background: var(--success-bg); }
.hb-answer.right .hb-answer-key { background: var(--success); color: #fff; }
.hb-answer.wrong { border-color: var(--danger); background: var(--danger-bg); opacity: .8; animation: hb-shake .35s; }
.hb-answer.wrong .hb-answer-key { background: var(--danger); color: #fff; }
@keyframes hb-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.hb-feedback { margin-top: 14px; }
.hb-win { text-align: center; padding: 14px 0 2px; }
.hb-win h3 { font-size: 17px; margin-bottom: 4px; }
.hb-win p { font-size: 13.5px; color: var(--text-muted); }
.hb-win-badge {
  width: 76px; height: 76px; margin: 4px auto 12px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gbl-yellow); color: var(--gbl-blue-900);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--gbl-yellow) 25%, transparent);
  animation: hb-pop .5s cubic-bezier(.2, 1.6, .4, 1);
}
.hb-win-badge .ico { width: 36px; height: 36px; }
@keyframes hb-pop { from { transform: scale(.3); opacity: 0; } }
.hb-confetti { position: absolute; inset: 0; z-index: 5; overflow: hidden; pointer-events: none; }
.hb-confetti i { position: absolute; top: -14px; width: 8px; height: 13px; border-radius: 2px; animation: hb-fall 1.7s ease-in forwards; }
@keyframes hb-fall { to { transform: translate(var(--dx), 620px) rotate(var(--rot)); opacity: 0; } }

/* Beispielbilder – nachgebaute Oberflaechenteile, bewusst nicht bedienbar */
.hb-mock-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.hb-mock-kpi {
  flex: 1; min-width: 130px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border); font-size: 11.5px; color: var(--text-muted);
}
.hb-mock-kpi b { display: block; margin-top: 2px; font-size: 18px; color: var(--text); }
.hb-mock-kpi.warn { box-shadow: inset 3px 0 0 var(--warning); }
.hb-mock-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.hb-mock-form div, .hb-mock-km div { padding: 7px 10px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.hb-mock-form small, .hb-mock-km small { display: block; font-size: 11px; color: var(--text-muted); }
.hb-mock-form b, .hb-mock-km b { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }
.hb-mock-form b .ico { width: 15px; height: 15px; }
.hb-mock-km { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.hb-mock-km > .ico { width: 18px; height: 18px; color: var(--text-faint); }
.hb-mock-km b { font-size: 16px; font-variant-numeric: tabular-nums; }
.hb-mock-tabbar {
  display: flex; width: 100%; max-width: 360px; margin: 14px auto 0; padding: 8px 4px 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm);
}
.hb-mock-tabbar div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--text-muted); }
.hb-mock-tabbar .ico { width: 19px; height: 19px; }
.hb-mock-tabbar .primary .ico {
  width: 40px; height: 40px; padding: 9px; margin-top: -22px; border-radius: 50%;
  background: var(--gbl-yellow); color: var(--gbl-blue-900); box-shadow: var(--shadow);
  animation: hb-bounce 1.8s ease-in-out infinite;
}
@keyframes hb-bounce { 50% { transform: translateY(-4px); } }
.hb-mock-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.hb-mock-cal div { min-height: 58px; padding: 5px; display: flex; flex-direction: column; gap: 3px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); }
.hb-mock-cal small { font-size: 10.5px; color: var(--text-muted); }
.hb-mock-cal i { height: 7px; border-radius: 4px; }
.hb-mock-pop {
  display: flex; flex-direction: column; gap: 4px; width: 100%; max-width: 340px; margin: 0 auto; padding: 12px 14px;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.hb-mock-pop small { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.hb-mock-capture { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hb-mock-capture div {
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 16px 10px; text-align: center;
  font-size: 13px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
}
.hb-mock-capture div.primary { background: var(--gbl-yellow); border-color: var(--gbl-yellow); color: var(--gbl-blue-900); }
.hb-mock-capture .ico { width: 26px; height: 26px; }
.hb-mock-capture small { font-size: 11px; opacity: .75; }
.hb-receipt {
  position: relative; overflow: hidden; width: 210px; margin: 0 auto; padding: 14px 16px 16px; border-radius: 3px;
  background: #FFFDF5; color: #2B2B2B; box-shadow: var(--shadow);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 11.5px; line-height: 1.6;
}
.hb-receipt .c { text-align: center; font-weight: 700; }
.hb-receipt .r { display: flex; justify-content: space-between; }
.hb-receipt hr { margin: 6px 0; border: 0; border-top: 1px dashed #9A9A9A; }
.hb-receipt::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 28px;
  background: linear-gradient(180deg, transparent, rgba(254, 204, 0, .55), transparent);
  animation: hb-scan 2.6s ease-in-out infinite;
}
@keyframes hb-scan { from { transform: translateY(-30px); } to { transform: translateY(190px); } }
.hb-fields { display: grid; gap: 6px; }
.hb-field {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px;
  border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); font-size: 13px;
  transition: opacity .2s;
}
.hb-field > span:first-child { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.hb-field .ico { width: 15px; height: 15px; color: var(--text-faint); }
.hb-field.entfaellt { opacity: .45; }
.hb-field.entfaellt > span:first-child { text-decoration: line-through; }
.hb-seg { align-self: center; }
.hb-flow { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.hb-flow span { padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 12.5px; font-weight: 600; }
.hb-flow span:last-child { background: var(--gbl-yellow); border-color: var(--gbl-yellow); color: var(--gbl-blue-900); }
.hb-flow .ico { width: 16px; height: 16px; color: var(--text-faint); }
.hb-big-icon {
  align-self: center; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gbl-yellow); color: var(--gbl-blue-900);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--gbl-yellow) 22%, transparent);
}
.hb-big-icon .ico { width: 36px; height: 36px; }
.hb-bars { display: flex; align-items: flex-end; gap: 6px; height: 100px; }
.hb-bars i { flex: 1; border-radius: 4px 4px 0 0; background: var(--gbl-blue-500); }
.hb-bars i:nth-child(4n) { background: var(--gbl-yellow); }
.hb-formula { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; font-weight: 700; }
.hb-formula span { padding: 9px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.hb-formula i { font-style: normal; font-size: 22px; color: var(--accent-text); }

/* Verweise unter dem Anmeldeformular */
.login-links {
  display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border);
}
.linkbtn {
  background: none; border: 0; padding: 4px 0; cursor: pointer;
  color: var(--link); font-size: 13px; font-weight: 600;
  text-decoration: underline; text-decoration-color: var(--link-underline);
  text-decoration-thickness: 2px; text-underline-offset: 4px;
}
.linkbtn:hover {
  color: var(--link-hover);
  text-decoration-color: var(--gbl-yellow); text-decoration-thickness: 3px;
}
[data-input="touch"] .linkbtn { padding: 10px 0; font-size: 14.5px; }

/* ═══════════════════════════════════════════════════════════════════════════
   Handbuch
   ═══════════════════════════════════════════════════════════════════════════ */
.hb-hero {
  position: relative; overflow: hidden; color: #fff;
  border-radius: var(--radius-lg); padding: 26px 28px 22px; margin-bottom: 20px;
  background:
    radial-gradient(700px 300px at 100% 0%, rgba(254, 204, 0, .18), transparent 60%),
    linear-gradient(135deg, var(--gbl-blue-900), var(--gbl-blue) 70%, var(--gbl-blue-500));
  box-shadow: var(--shadow);
}
.hb-hero-top { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.hb-hero h2 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; }
.hb-hero p { color: #C9D0EE; font-size: 14px; max-width: 580px; line-height: 1.55; }
.hb-level { margin-left: auto; text-align: right; }
.hb-level-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #AEB7E3; }
.hb-level-name { font-size: 18px; font-weight: 800; color: var(--gbl-yellow); }
.hb-level-count { font-size: 12.5px; color: #C9D0EE; margin-top: 2px; }
.hb-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 18px; }

/* Strasse mit Auto als Fortschrittsanzeige */
.hb-road {
  --rand: 19px;
  position: relative; height: 34px; margin: 24px 0 4px; border-radius: 17px;
  background: #0A0F2B; box-shadow: inset 0 2px 6px rgba(0, 0, 0, .5);
}
.hb-road::before {
  content: ""; position: absolute; left: 18px; right: 18px; top: 50%; height: 2px; transform: translateY(-50%);
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .5) 0 14px, transparent 14px 26px);
}
.hb-road-fill {
  position: absolute; inset: 0 auto 0 0; border-radius: 17px;
  width: calc(var(--rand) + (100% - 2 * var(--rand)) * var(--p));
  background: linear-gradient(90deg, rgba(254, 204, 0, .15), rgba(254, 204, 0, .5));
  animation: hb-fill 1.1s cubic-bezier(.2, .8, .2, 1) both;
}
.hb-road-stop {
  position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: #2A3470; border: 2px solid #0A0F2B;
}
.hb-road-stop.done { background: var(--gbl-yellow); }
.hb-car {
  position: absolute; top: 50%; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%;
  left: calc(var(--rand) + (100% - 2 * var(--rand)) * var(--p));
  display: grid; place-items: center; background: var(--gbl-yellow); color: var(--gbl-blue-900);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
  animation: hb-drive 1.1s cubic-bezier(.2, .8, .2, 1) both;
}
.hb-car .ico { width: 21px; height: 21px; }
@keyframes hb-drive { from { left: var(--rand); } }
@keyframes hb-fill { from { width: var(--rand); } }

/* Aufbau: Route links, Fuehrerschein und Schnellhilfe rechts */
.hb-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.hb-section-title {
  display: flex; align-items: center; gap: 8px; margin: 4px 0 12px;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted);
}
.hb-section-title .ico { width: 15px; height: 15px; }

.hb-route { position: relative; display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.hb-route::before {
  content: ""; position: absolute; left: 21px; top: 24px; bottom: 24px; width: 3px; border-radius: 2px;
  background: repeating-linear-gradient(180deg, var(--border-strong) 0 8px, transparent 8px 14px);
}
.hb-stop {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 0; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.hb-stop-dot {
  position: relative; z-index: 1; flex: none; width: 45px; height: 45px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
  background: var(--surface); color: var(--text-muted); border: 3px solid var(--border-strong);
  transition: transform .15s;
}
.hb-stop-dot .ico { width: 20px; height: 20px; stroke-width: 2.6; }
.hb-stop.done .hb-stop-dot { background: var(--gbl-yellow); border-color: var(--gbl-yellow); color: var(--gbl-blue-900); }
.hb-stop.next .hb-stop-dot { border-color: var(--gbl-yellow); color: var(--text); animation: hb-pulse 2s ease-in-out infinite; }
@keyframes hb-pulse {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--gbl-yellow) 30%, transparent); }
  50%      { box-shadow: 0 0 0 10px color-mix(in srgb, var(--gbl-yellow) 0%, transparent); }
}
.hb-stop-card {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); transition: border-color .15s, transform .15s, box-shadow .15s;
}
.hb-stop:hover .hb-stop-card { border-color: var(--gbl-yellow); transform: translateX(3px); box-shadow: var(--shadow); }
.hb-stop:hover .hb-stop-dot { transform: scale(1.07); }
.hb-stop:focus-visible { outline: none; }
.hb-stop:focus-visible .hb-stop-card { box-shadow: var(--ring); border-color: var(--gbl-blue-500); }
.hb-stop-icon {
  flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: var(--gbl-blue-050); color: var(--info-text);
}
.hb-stop-icon .ico { width: 21px; height: 21px; }
.hb-stop-text { flex: 1; min-width: 0; }
.hb-stop-text b { display: block; font-size: 14.5px; }
.hb-stop-text span { display: block; font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.hb-stop-meta { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; font-size: 11.5px; color: var(--text-faint); }

/* Fuhrpark-Fuehrerschein */
.hb-license {
  position: relative; overflow: hidden; margin-bottom: 18px; border-radius: 14px; color: var(--gbl-blue-900);
  box-shadow: var(--shadow);
}
/* Hintergrund am inneren Teil, damit der Graufilter im gesperrten Zustand ihn
   mit erfasst – das Schloss-Etikett darueber bleibt farbig. */
.hb-license-inner { padding: 18px 20px 14px; background: linear-gradient(135deg, #FFF3B8, #FECC00 55%, #F2B900); }
.hb-license::after {
  content: ""; position: absolute; inset: -40%; pointer-events: none;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, .6) 50%, transparent 58%);
  animation: hb-shine 5s ease-in-out infinite;
}
@keyframes hb-shine { 0%, 65% { transform: translateX(-60%); } 100% { transform: translateX(60%); } }
.hb-license-head { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 800; letter-spacing: .04em; }
.hb-license-mark {
  width: 34px; height: 34px; border-radius: 6px; display: grid; place-items: center;
  background: var(--gbl-blue); color: var(--gbl-yellow); font-size: 11px; font-weight: 800;
}
.hb-license-body { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.hb-license-photo {
  width: 64px; height: 78px; border-radius: 6px; display: grid; place-items: center;
  background: rgba(30, 46, 121, .12); border: 1px solid rgba(30, 46, 121, .22);
  font-size: 22px; font-weight: 800; color: var(--gbl-blue);
}
.hb-license dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 10px; font-size: 12.5px; align-content: start; }
.hb-license dt { color: rgba(13, 20, 53, .6); font-variant-numeric: tabular-nums; }
.hb-license dd { font-weight: 700; overflow-wrap: anywhere; }
.hb-license-foot { margin-top: 10px; font-size: 11.5px; color: rgba(13, 20, 53, .7); }
.hb-license.locked .hb-license-inner { filter: grayscale(1); opacity: .5; }
.hb-license.locked::after { display: none; }
.hb-license-lock { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; }
.hb-license-lock span {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: var(--gbl-blue-900); color: #fff; font-size: 12.5px; font-weight: 600; box-shadow: var(--shadow);
}
.hb-license-lock .ico { width: 15px; height: 15px; }
.hb-license.hb-wiggle { animation: hb-wiggle .6s ease-in-out; }
@keyframes hb-wiggle { 25% { transform: rotate(-2deg); } 75% { transform: rotate(2deg); } }

/* Schnellhilfe */
.hb-faq-search { position: relative; }
.hb-faq-search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-faint); pointer-events: none; }
.hb-faq-search .input { padding-left: 34px; }
.hb-faq { border-top: 1px solid var(--border); }
.hb-faq summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; font-weight: 600; font-size: 13.5px;
}
.hb-faq summary::-webkit-details-marker { display: none; }
.hb-faq summary:hover { background: var(--surface-2); }
.hb-faq summary .ico { flex: none; width: 16px; height: 16px; margin-left: auto; color: var(--text-faint); transition: transform .2s; }
.hb-faq[open] summary .ico { transform: rotate(180deg); }
.hb-faq-a { padding: 0 18px 14px; font-size: 13.5px; line-height: 1.6; color: var(--text-muted); }
.hb-faq-a b { color: var(--text); }
.hb-faq-leer { padding: 14px 18px 18px; font-size: 13px; color: var(--text-muted); }
.hb-reset { text-align: center; margin-top: 14px; }

/* Anpassungen fuer schmale Bildschirme, Touch und reduzierte Bewegung */
@media (max-width: 1100px) {
  .hb-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .hb-hero { padding: 20px 18px 18px; }
  .hb-hero h2 { font-size: 19px; }
  .hb-level { margin-left: 0; text-align: left; }
  .hb-hero-actions .btn { width: 100%; }
  .hb-stop-icon { display: none; }
  .hb-answers.felder { grid-template-columns: minmax(0, 1fr); }
  .hb-mock-form { grid-template-columns: minmax(0, 1fr); }
}
[data-input="touch"] .hb-stop-card { padding: 16px; }
[data-input="touch"] .hb-answer { min-height: 54px; font-size: 15.5px; }
[data-input="touch"] .hb-faq summary { padding: 15px 18px; font-size: 15px; }
[data-input="touch"] .hb-seg button { padding: 10px 14px; font-size: 14px; }
@media (prefers-reduced-motion: reduce) {
  .hb-car, .hb-road-fill, .hb-stop.next .hb-stop-dot, .hb-license::after,
  .hb-receipt::after, .hb-mock-tabbar .primary .ico, .hb-step, .hb-win-badge { animation: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Weniger auf einmal: aufklappbare Karten, Reiter, "Weitere Angaben"
   ═══════════════════════════════════════════════════════════════════════════ */
.fold > summary { list-style: none; cursor: pointer; user-select: none; border-radius: var(--radius) var(--radius) 0 0; }
.fold > summary::-webkit-details-marker { display: none; }
.fold:not([open]) > summary { border-bottom-color: transparent; border-radius: var(--radius); }
.fold > summary:focus-visible { outline: none; box-shadow: var(--ring); }
.fold-meta { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; }
.fold-chevron { flex: none; width: 18px; height: 18px; color: var(--text-faint); transition: transform .2s; }
.fold[open] > summary .fold-chevron { transform: rotate(180deg); }

.tabs-bar {
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--border); margin-bottom: 14px;
}
.tabs-bar::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  padding: 10px 14px; margin-bottom: -1px; white-space: nowrap;
  background: none; border: 0; border-bottom: 3px solid transparent;
  color: var(--text-muted); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.tab .ico { width: 16px; height: 16px; }
.tab.active { color: var(--text); border-bottom-color: var(--gbl-yellow); }
.tab:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.tab-count {
  min-width: 20px; padding: 1px 7px; border-radius: 999px; text-align: center;
  background: var(--surface-sunken); color: var(--text-muted); font-size: 11.5px;
}
.tab.active .tab-count { background: var(--gbl-yellow); color: var(--gbl-blue-900); }
.chart-box { position: relative; }

.form-more { margin: 2px 0 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.form-more > summary {
  list-style: none; display: flex; align-items: center; gap: 8px; padding: 11px 14px;
  cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--text);
}
.form-more > summary::-webkit-details-marker { display: none; }
.form-more > summary small { margin-left: auto; font-weight: 400; color: var(--text-faint); font-size: 12px; text-align: right; }
.form-more-chevron { flex: none; width: 16px; height: 16px; color: var(--text-muted); transition: transform .2s; }
.form-more[open] > summary .form-more-chevron { transform: rotate(90deg); }
.form-more-body { padding: 14px 14px 0; border-top: 1px solid var(--border); }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }

/* Startseite */
.dash-hello { margin: 0 0 14px; }
.dash-hello h2 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.dash-hello p { color: var(--text-muted); font-size: 13.5px; margin-top: 2px; }

.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.quick-btn {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-width: 0; text-align: left;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); font: inherit; cursor: pointer; transition: border-color .12s, box-shadow .12s;
}
.quick-btn:active { transform: translateY(1px); }
.quick-ico {
  flex: none; width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  background: var(--gbl-blue-050); color: var(--info-text);
}
.quick-ico .ico { width: 22px; height: 22px; }
.quick-btn.primary .quick-ico { background: var(--gbl-yellow); color: var(--gbl-blue-900); }
.quick-btn b { display: block; font-size: 14px; }
.quick-btn small { display: block; font-size: 12px; color: var(--text-muted); margin-top: 1px; }

.todo { border-top: 1px solid var(--border); }
.card-head + .todo { border-top: 0; }
.todo > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 13px 18px; cursor: pointer; }
.todo > summary::-webkit-details-marker { display: none; }
.todo[open] > summary .fold-chevron { transform: rotate(180deg); }
.todo-ico { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; }
.todo-ico .ico { width: 18px; height: 18px; }
.todo-ico.warn   { background: var(--warning-bg); color: var(--warning-text); }
.todo-ico.danger { background: var(--danger-bg);  color: var(--danger-text); }
.todo-ico.info   { background: var(--info-bg);    color: var(--info-text); }
.todo-text { flex: 1; min-width: 0; }
.todo-text b { display: block; font-size: 14px; }
.todo-text span { display: block; font-size: 12.5px; color: var(--text-muted); margin-top: 1px; }
.todo-count {
  flex: none; min-width: 26px; padding: 2px 8px; border-radius: 999px; text-align: center;
  font-size: 12.5px; font-weight: 700; background: var(--surface-sunken);
}
.todo-body { padding: 0 18px 14px 64px; }
.todo-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  padding: 8px 0; border: 0; border-bottom: 1px solid var(--border); background: none;
  color: inherit; font: inherit; font-size: 13.5px; text-align: left;
}
.todo-row > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-right { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.todo-right .ico { width: 14px; height: 14px; }
button.todo-row { cursor: pointer; }
.todo-action { margin-top: 10px; }

/* Berichte */
.modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; margin-bottom: 14px; }
.mode {
  display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 12px 14px; text-align: left;
  background: var(--surface); color: var(--text); border: 2px solid var(--border); border-radius: var(--radius);
  font: inherit; cursor: pointer; transition: border-color .12s, box-shadow .12s;
}
.mode .ico { width: 20px; height: 20px; color: var(--info-text); }
.mode b { font-size: 14px; }
.mode small { font-size: 12px; color: var(--text-muted); line-height: 1.35; }
.mode.active { border-color: var(--gbl-yellow); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gbl-yellow) 22%, transparent); }
.mode.active .ico { color: var(--accent-text); }
.report-doc h3 { font-size: 14px; font-weight: 700; margin: 24px 0 10px; }
.report-doc > h3:first-child { margin-top: 0; }
.report-stat { background: var(--surface-sunken); border-radius: var(--radius); padding: 14px 16px; }
.report-stat .l { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); font-weight: 600; margin-bottom: 6px; }
.report-stat .v { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; }
.report-stat .f { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* Sicherung */
.backup-list { display: grid; gap: 6px; max-height: 280px; overflow-y: auto; margin: 12px 0; }
.backup-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; font-size: 13px;
  border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border);
}
.backup-row .grow { min-width: 0; }

@media (hover: hover) {
  .fold > summary:hover, .todo > summary:hover { background: var(--surface-2); }
  .tab:hover { color: var(--text); }
  .quick-btn:hover, .mode:hover { border-color: var(--gbl-yellow); box-shadow: var(--shadow); }
  button.todo-row:hover b { text-decoration: underline; }
}
@media (max-width: 1100px) {
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-grid .kpi { padding: 12px 13px; }
  .kpi-grid .kpi-value { font-size: 20px; }
  .form-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .todo-body { padding-left: 18px; }
}
@media (max-width: 560px) {
  .quick { gap: 10px; }
  .quick-btn { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
  .quick-btn small { display: none; }
  .modes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mode small { display: none; }
}
[data-input="touch"] .tab { padding: 13px 16px; font-size: 15px; }
[data-input="touch"] .form-more > summary { min-height: 50px; font-size: 15px; }
[data-input="touch"] .todo > summary { padding: 15px 18px; }
[data-input="touch"] .todo-row { min-height: 48px; font-size: 14.5px; }
[data-input="touch"] .fold > summary { min-height: 52px; }
@media print {
  .modes, .report-filter { display: none !important; }
  details.fold:not([open]) { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Zwei Bereiche: Fahreransicht der Leitung
   ═══════════════════════════════════════════════════════════════════════════ */
.nav-ansicht { border: 1px dashed rgba(255, 255, 255, .22); margin-bottom: 4px; }
.ansicht-hinweis {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 12px 24px 0; padding: 8px 10px 8px 14px; max-width: 1392px;
  border-radius: var(--radius); background: var(--info-bg); color: var(--info-text);
  border: 1px solid color-mix(in srgb, var(--gbl-blue-500) 25%, transparent); font-size: 13px;
}
.ansicht-hinweis > .ico { width: 18px; height: 18px; }
.ansicht-hinweis > span { flex: 1; min-width: 190px; }

/* ═══════════════════════════════════════════════════════════════════════════
   Listen im App-Stil – Fahrtenbuch, Tanken, Buchungen
   ═══════════════════════════════════════════════════════════════════════════ */
.list-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.list-toolbar > [data-act="filter"] { margin-left: auto; }
.month-nav { display: flex; align-items: center; gap: 6px; }
.month-nav b { min-width: 132px; text-align: center; font-size: 15px; font-weight: 700; white-space: nowrap; }
.filter-panel { margin-bottom: 12px; }
.filter-panel[hidden] { display: none; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.filter-grid .filter-wide { grid-column: 1 / -1; }
.filter-foot { display: flex; justify-content: flex-end; margin-top: 10px; }

.list-sum { margin-bottom: 12px; }
.list-sum-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.list-sum-value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.list-sum-parts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 13px; color: var(--text-muted); }
.list-sum-parts b { color: var(--text); }
.sum-part { display: inline-flex; align-items: center; gap: 6px; }

.entry-list { overflow: hidden; }
.entry-day {
  display: flex; justify-content: space-between; gap: 12px; padding: 8px 16px;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted);
}
.entry + .entry-day { border-top: 1px solid var(--border); }
.entry, .entry-body { display: flex; align-items: center; gap: 14px; min-width: 0; }
.entry {
  position: relative; width: 100%; padding: 12px 16px 12px 20px;
  border: 0; border-bottom: 1px solid var(--border); background: var(--surface);
  color: inherit; font: inherit; text-align: left;
}
.entry:last-child { border-bottom: 0; }
.entry::before {
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px;
  border-radius: 0 3px 3px 0; background: var(--akzent, var(--gbl-blue));
}
.entry-body { flex: 1; padding: 0; margin: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
button.entry { cursor: pointer; }
button.entry:focus-visible, .entry-body:focus-visible { outline: 2px solid var(--gbl-blue-500); outline-offset: -2px; }
.entry-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.entry-title, .entry-sub {
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere;
}
.entry-title { font-size: 14.5px; font-weight: 700; color: var(--text); line-height: 1.3; }
.entry-sub { font-size: 13px; color: var(--text-muted); line-height: 1.35; }
.entry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-top: 2px; font-size: 12px; color: var(--text-faint); }
.entry-meta i { font-style: normal; opacity: .7; }
.entry-meta .dot { width: 8px; height: 8px; }
.entry-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.entry-value { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.entry-hint { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.entry-tags { display: flex; align-items: center; gap: 4px; }
.entry-tags .badge { white-space: nowrap; }
.entry-actions { flex: none; display: flex; align-items: center; gap: 2px; }
.badge > .ico { width: 13px; height: 13px; }

/* ═══════════════════════════════════════════════════════════════════════════
   Fahrerbereich: mein Fahrzeug
   ═══════════════════════════════════════════════════════════════════════════ */
.kpi-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.my-cars { display: grid; gap: 10px; margin-bottom: 14px; }
.my-car {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; align-items: center;
  width: 100%; padding: 14px 16px 14px 22px; overflow: hidden; text-align: left; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); cursor: pointer;
}
.my-car::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--farbe, var(--gbl-blue)); }
.my-car > :not(.my-car-go) { grid-column: 1; }
.my-car-top { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; }
.my-car-top b { font-size: 16px; }
.my-car-top .mono { color: var(--text-muted); font-size: 12.5px; }
.my-car-go { grid-column: 2; grid-row: 1 / span 3; width: 20px; height: 20px; color: var(--text-faint); }
.my-car-facts { display: flex; flex-wrap: wrap; gap: 6px 26px; }
.my-car-facts small, .fact small {
  display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted);
}
.my-car-facts b { font-size: 14px; font-variant-numeric: tabular-nums; }
.my-car-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.my-car-empty { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 14px; }
.my-car-empty b { display: block; }
.my-car-empty small { display: block; font-size: 12.5px; color: var(--text-muted); margin-top: 1px; }

.my-vehicle { position: relative; overflow: hidden; margin-bottom: 14px; }
.my-vehicle::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--farbe, var(--gbl-blue)); }
.my-vehicle-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 18px 4px; }
.my-vehicle-head h2 { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.my-vehicle-head p { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 14px 20px; padding: 14px 18px; }
.fact small { margin-bottom: 3px; }
.fact b { font-size: 15px; font-variant-numeric: tabular-nums; }
.tone-warn { color: var(--warning-text); }
.tone-danger { color: var(--danger-text); }
.my-vehicle-damages { margin: 0 18px 14px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--warning-bg); }
.my-vehicle-damages > b { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--warning-text); }
.my-vehicle-damages > b .ico { width: 16px; height: 16px; }
.damage-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 7px 0 2px; font-size: 13.5px; }
.damage-row + .damage-row { border-top: 1px solid color-mix(in srgb, var(--warning-text) 18%, transparent); }
.damage-row small { flex: none; color: var(--text-muted); font-size: 12px; }
.my-vehicle-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); }

@media (hover: hover) {
  button.entry:hover, .entry:has(> .entry-body:hover) { background: var(--surface-2); }
  .my-car:hover { border-color: var(--gbl-yellow); box-shadow: var(--shadow); }
}
@media (max-width: 860px) {
  .ansicht-hinweis { margin: 10px 14px 0; }
  .kpi-grid.kpi-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
}
@media (max-width: 560px) {
  .month-nav b { min-width: 0; font-size: 14px; }
  .entry { padding: 11px 12px 11px 16px; gap: 10px; flex-wrap: wrap; }
  .entry-body { gap: 10px; }
  .entry-value { font-size: 14px; }
  .entry-actions { flex-basis: 100%; justify-content: flex-end; margin: -6px -6px -4px 0; }
  .entry-day { padding: 8px 12px; }
  .kpi-3 .kpi { padding: 10px; }
  .kpi-3 .kpi-value { font-size: 17px; }
  .kpi-3 .kpi-value small { font-size: 11px; }
  .kpi-3 .kpi-label { font-size: 9.5px; letter-spacing: .03em; }
  .kpi-3 .kpi-foot { font-size: 11px; }
  .my-car-facts { gap: 6px 18px; }
  .my-vehicle-actions .btn { flex: 1 1 calc(50% - 8px); }
  .modal-foot #tf-del { padding-left: 10px; padding-right: 10px; }
}
[data-input="touch"] .entry { padding-top: 14px; padding-bottom: 14px; }
[data-input="touch"] .entry-title { font-size: 15.5px; }
[data-input="touch"] .entry-sub { font-size: 14px; }
[data-input="touch"] .month-nav .btn-icon { width: 44px; height: 44px; }
@media print {
  .list-toolbar, .filter-panel, .ansicht-hinweis { display: none !important; }
  .entry { break-inside: avoid; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Schnittstellen
   ═══════════════════════════════════════════════════════════════════════════ */
.sub-h { display: flex; align-items: center; gap: 8px; margin: 24px 0 10px; font-size: 13.5px; font-weight: 700; }
.fold-body > .sub-h:first-child { margin-top: 0; }
.sub-h .ico { width: 16px; height: 16px; color: var(--text-muted); }
pre.code {
  margin: 8px 0 12px; padding: 10px 12px; overflow-x: auto; white-space: pre;
  border-radius: var(--radius-sm); background: var(--surface-sunken); font-family: var(--font-mono); font-size: 12px;
}
.iface-list { padding-left: 18px; font-size: 13.5px; line-height: 1.65; }
.iface-list li + li { margin-top: 6px; }
.iface-anleitung { padding-bottom: 12px; font-size: 13.5px; line-height: 1.6; }
.iface-anleitung p + p { margin-top: 8px; }
.abo-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--border); }
.abo-row .grow { min-width: 0; }
.mail-vorschau { overflow-x: auto; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; color: #16192A; }

/* ═══════════════════════════════════════════════════════════════════════════
   Fahrzeugfotos
   ═══════════════════════════════════════════════════════════════════════════ */
.car-photo { position: relative; display: grid; place-items: center; overflow: hidden; background: var(--surface-sunken); }
.car-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.car-photo.leer {
  color: var(--text-faint);
  background: linear-gradient(135deg, color-mix(in srgb, var(--farbe, var(--gbl-blue)) 16%, var(--surface-sunken)), var(--surface-sunken));
}
.car-photo.leer .ico { width: 40px; height: 40px; opacity: .55; }
.car-photo-card { aspect-ratio: 16 / 9; }
.car-hero { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); overflow: hidden; margin-bottom: 16px; }
.car-photo-hero { aspect-ratio: 16 / 10; min-height: 190px; }
.car-hero-info { display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 18px 22px; }
.car-hero-name { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.car-hero-name h2 { font-size: 21px; font-weight: 800; letter-spacing: -.01em; }
.car-hero-assign { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 6px; font-size: 13.5px; }
.car-hero-assign .ico { width: 16px; height: 16px; color: var(--text-muted); }
.my-vehicle-photo, .card-photo-wide { overflow: hidden; background: var(--surface-sunken); }
.my-vehicle-photo { aspect-ratio: 16 / 7; }
.card-photo-wide { max-height: 320px; margin-bottom: 14px; border-radius: var(--radius); }
.my-vehicle-photo img, .card-photo-wide img { display: block; width: 100%; height: 100%; object-fit: cover; }
.my-car.mit-foto { grid-template-columns: 96px minmax(0, 1fr) auto; }
.my-car.mit-foto > :not(.my-car-go):not(.my-car-foto) { grid-column: 2; }
.my-car.mit-foto .my-car-go { grid-column: 3; }
.my-car-foto { grid-column: 1; grid-row: 1 / span 3; width: 96px; height: 72px; object-fit: cover; border-radius: 8px; align-self: center; }
@media (max-width: 860px) {
  .car-hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .my-car.mit-foto { grid-template-columns: 64px minmax(0, 1fr) auto; }
  .my-car-foto { width: 64px; height: 52px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Glocke, Fristen, Tankkarten
   ═══════════════════════════════════════════════════════════════════════════ */
.glocke { position: relative; margin-left: 4px; flex: none; }
.glocke-zahl {
  position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center;
}
.glocke-liste { display: grid; gap: 6px; }
.glocke-eintrag {
  display: grid; gap: 2px; width: 100%; padding: 10px 12px; text-align: left; font: inherit; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
}
.glocke-eintrag.neu { border-left: 4px solid var(--gbl-yellow); background: var(--surface); }
.glocke-eintrag b { font-size: 14px; }
.glocke-eintrag span { font-size: 13px; color: var(--text-muted); }
.glocke-eintrag small { font-size: 11.5px; color: var(--text-faint); }

.frist-kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.frist-kachel {
  display: flex; align-items: baseline; gap: 8px; padding: 12px 14px; text-align: left; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
button.frist-kachel { cursor: pointer; }
.frist-kachel b { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.frist-kachel span { font-size: 13px; color: var(--text-muted); }
.frist-kachel.ueber.aktiv { border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: var(--danger-bg); }
.frist-kachel.ueber.aktiv b { color: var(--danger-text); }
.frist-kachel.bald.aktiv { border-color: color-mix(in srgb, var(--warning) 45%, transparent); background: var(--warning-bg); }
.frist-kachel.bald.aktiv b { color: var(--warning-text); }

.themen-liste { display: grid; gap: 8px; }
.anbieter-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.anbieter-zeile { padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.anbieter-zeile.an { border-color: var(--gbl-yellow); background: var(--surface); }
.anbieter-zeile small { font-weight: 400; }
.anbieter-felder { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.anbieter-felder[hidden] { display: none; }
.anbieter-felder .input { padding: 6px 9px; font-size: 13px; }
.abr-haken { flex: none; align-self: center; margin-right: -4px; }
.abr-aktionen { padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }

.karten-zeile { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 18px 14px; }
.karte-chip {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; padding: 7px 11px; font-size: 13px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
}
.karte-chip .ico { width: 16px; height: 16px; color: var(--text-muted); }
.karte-chip small { color: var(--text-muted); }
.karte-chip.aus { opacity: .7; }
@media (max-width: 560px) {
  .anbieter-felder { grid-template-columns: 1fr; }
  .frist-kachel b { font-size: 20px; }
}
[data-input="touch"] .glocke-eintrag { padding: 13px 14px; }

/* ═══════════════════════════════════════════════════════════════════════════
   Statistik (Filter, Vergleich) und Diagramme in Berichten
   ═══════════════════════════════════════════════════════════════════════════ */
.auswertung-filter { margin-bottom: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 6px 12px; font: inherit; font-size: 13px; color: var(--text-muted); cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.aktiv { background: var(--gbl-blue-500); border-color: transparent; color: #fff; font-weight: 600; }
.chip:focus-visible { outline: 2px solid var(--gbl-yellow); outline-offset: 2px; }
.kpi-reihe { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; }
.delta { font-weight: 700; font-size: 11.5px; padding: 1px 6px; border-radius: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta.gut { color: var(--success-text); background: var(--success-bg); }
.delta.schlecht { color: var(--danger-text); background: var(--danger-bg); }
.delta.neutral { color: var(--text-muted); background: var(--surface-sunken); }
.balken-zeile { position: relative; display: flex; justify-content: space-between; gap: 10px; padding: 7px 0 9px; font-size: 13.5px; }
.balken-zeile + .balken-zeile { border-top: 1px solid var(--border); }
.balken-zeile i { position: absolute; left: 0; bottom: 3px; height: 3px; border-radius: 2px; background: var(--gbl-yellow); }
.mini-balken { height: 3px; margin-top: 5px; max-width: 160px; background: var(--surface-sunken); border-radius: 2px; overflow: hidden; }
.mini-balken i { display: block; height: 100%; }
.sortierbar th[data-sort] { cursor: pointer; user-select: none; }
.sortierbar th[data-richtung="ab"]::after { content: ' ▼'; font-size: 9px; }
.sortierbar th[data-richtung="auf"]::after { content: ' ▲'; font-size: 9px; }
.bericht-diagramme { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-bottom: 20px; }
.bericht-diagramm { margin: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); break-inside: avoid; }
.bericht-diagramm figcaption { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
@media (max-width: 560px) {
  .kpi-reihe { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi-reihe .kpi { padding: 12px 13px; }
  .kpi-reihe .kpi-value { font-size: 20px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .chip { flex: none; }
}
[data-input="touch"] .chip { padding: 9px 14px; }

/* Benachrichtigungen: Stufe je Thema */
.thema-zeile { display: grid; grid-template-columns: 1fr minmax(150px, 190px); align-items: center; gap: 10px; }
.thema-zeile label { font-size: 13.5px; }
.thema-zeile .input { padding: 6px 9px; font-size: 13px; }
@media (max-width: 420px) { .thema-zeile { grid-template-columns: 1fr; gap: 4px; } }

/* Als App installieren */
.inst-kopf { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.inst-kopf img { border-radius: 14px; box-shadow: var(--shadow-sm); flex: none; }
.inst-kopf b { display: block; font-size: 15px; }
.inst-kopf span { display: block; font-size: 12.5px; }
.inst-vorteile { list-style: none; display: grid; gap: 6px; margin: 0 0 12px; padding: 0; font-size: 13.5px; }
.inst-vorteile li { display: flex; align-items: flex-start; gap: 8px; }
.inst-vorteile .ico { width: 16px; height: 16px; color: var(--success); flex: none; margin-top: 2px; }
.inst-schritte { list-style: none; display: grid; gap: 10px; margin: 0; padding: 0; }
.inst-schritt { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; }
.inst-nr {
  flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gbl-yellow); color: var(--gbl-blue-900); font-weight: 800; font-size: 12.5px;
}
.inst-symbol { display: inline-grid; place-items: center; width: 22px; height: 22px; vertical-align: -5px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); }
.inst-symbol .ico { width: 14px; height: 14px; color: var(--link, var(--gbl-blue-500)); }
.app-qr { flex: none; width: 116px; height: 116px; padding: 6px; background: #fff; border-radius: var(--radius-sm); display: grid; place-items: center; }
.app-qr svg { width: 100%; height: 100%; }
.app-qr-zeile { align-items: flex-start; }
.app-qr-adresse { font-size: 11.5px; color: var(--text-faint); margin-top: 6px; word-break: break-all; }

/* Hinweise zur Flotte (Statistik) */
.hinweise { margin-bottom: 18px; }
.hinweise .card-head h2 { display: flex; align-items: center; gap: 8px; }
.hinweise .card-head h2 .ico { width: 18px; height: 18px; color: var(--gbl-yellow-600, var(--gbl-yellow)); }
.hinweis-liste { display: grid; }
.hinweis { display: flex; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--border); }
.hinweis-ico { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--info-bg); color: var(--info-text); }
.hinweis-ico .ico { width: 17px; height: 17px; }
.hinweis.warnung .hinweis-ico { background: var(--danger-bg); color: var(--danger-text); }
.hinweis.tipp .hinweis-ico { background: var(--warning-bg); color: var(--warning-text); }
.hinweis-inhalt { min-width: 0; flex: 1; }
.hinweis-inhalt b { display: block; font-size: 14.5px; }
.hinweis-inhalt p { margin: 3px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--text-muted); max-width: 75ch; }
.hinweis-aktionen { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.hinweis-balken { display: grid; gap: 5px; margin-top: 10px; max-width: 520px; }
.hb-zeile { display: grid; grid-template-columns: minmax(110px, 180px) 1fr 80px; align-items: center; gap: 10px; font-size: 12.5px; }
.hb-zeile i { display: block; height: 8px; border-radius: 4px; background: var(--surface-sunken); overflow: hidden; }
.hb-zeile i b { display: block; height: 100%; border-radius: 4px; }
.hb-zeile .mono { text-align: right; }
.hinweis-fuss { padding: 10px 18px 14px; border-top: 1px solid var(--border); font-size: 12px; line-height: 1.5; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--link, var(--gbl-blue-500)); cursor: pointer; text-decoration: underline; }
@media (max-width: 560px) { .hb-zeile { grid-template-columns: 90px 1fr 64px; } .hinweis { padding: 12px 14px; } }
.hinweis-aktionen a.btn { text-decoration: none; }
