@font-face {
  font-family: 'Rubik';
  src: url('/static/fonts/rubik-variable.woff2') format('woff2');
  font-weight: 300 900;
  font-display: swap;
}

:root {
  /* Design-Farben: überschreibbar unter Administration › Design */
  --plum: #4a3360;          /* Primär */
  --amber: #ffb804;         /* Sekundär / Akzent */
  --glow: #ff6e6b;          /* zweites Leuchten */
  --bg-top: #3b2650;        /* Hintergrund oben */
  --bg-bottom: #1e1528;     /* Hintergrund unten */
  --plum-deep: color-mix(in srgb, var(--plum) 62%, black);
  --plum-soft: color-mix(in srgb, var(--plum) 12%, white);
  --plum-light: color-mix(in srgb, var(--plum) 70%, white);
  --lavender: color-mix(in srgb, var(--plum) 5%, white);
  --amber-soft: color-mix(in srgb, var(--amber) 18%, white);
  --ink: #241b2c;
  --muted: #6f6478;
  --line: #e2d9ea;
  --white: #fff;
  --danger: #d9453f;
  --ok: #2f9a7a;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(46, 31, 61, .06), 0 8px 24px rgba(46, 31, 61, .08);
  --shadow-up: 0 2px 4px rgba(46, 31, 61, .08), 0 18px 40px rgba(46, 31, 61, .18);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--lavender);
  line-height: 1.5;
}
a { color: var(--plum); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
.muted { color: var(--muted); }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Buttons & Felder ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  font: inherit; font-weight: 500; color: var(--plum);
  background: var(--white); border: 1.5px solid var(--line); border-radius: 999px;
  padding: .65em 1.3em; cursor: pointer; text-decoration: none;
  transition: transform .12s, box-shadow .12s, background .12s;
}
.btn:hover { box-shadow: var(--shadow); }
.btn:active { transform: scale(.98); }
.btn .ico { width: 18px; height: 18px; }
.btn--primary { background: var(--plum); border-color: var(--plum); color: var(--white); }
.btn--primary:hover { background: var(--plum-deep); }
.btn--big { width: 100%; font-size: 1.1rem; padding: 1em; }
.btn--small { font-size: .9rem; padding: .4em .9em; }
.btn--danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, white); }

.field { display: flex; flex-direction: column; gap: .35rem; }
.field > span { font-weight: 500; }
input:not([type=radio]):not([type=checkbox]), textarea {
  font: inherit; font-size: 16px; /* kein Zoom auf iOS */
  color: var(--ink); background: var(--white);
  border: 1.5px solid var(--line); border-radius: 12px;
  padding: .75em .9em; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 5.5em; }
input:focus, textarea:focus { outline: none; border-color: var(--plum); box-shadow: 0 0 0 4px var(--plum-soft); }

.alert { background: #fde8e7; color: #8f2723; padding: .7em 1em; border-radius: 12px; margin: 0; }
.flash { background: #e3f4ee; color: #1d6a53; padding: .7em 1em; border-radius: 12px; }
.badge {
  display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  background: var(--amber-soft); color: #7a5600; padding: .2em .6em; border-radius: 999px;
}

/* =========================================================
   App-Bereich (Dashboard, Login, Auswertung, Admin)
   ========================================================= */
.app {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 15% -10%, color-mix(in srgb, var(--amber) 28%, transparent), transparent 60%),
    radial-gradient(900px 600px at 110% 10%, color-mix(in srgb, var(--glow) 22%, transparent), transparent 60%),
    linear-gradient(160deg, var(--bg-top) 0%, color-mix(in srgb, var(--bg-top), var(--bg-bottom)) 55%, var(--bg-bottom) 100%);
  background-attachment: fixed;
  color: var(--ink);
}
.app--center { display: grid; place-items: center; padding: 24px 16px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; color: var(--white);
}
.topbar a { color: var(--white); text-decoration: none; }
.topbar__brand, .topbar__back { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.topbar__brand img { height: 30px; }
.topbar__user { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: .9rem; opacity: .9; }
.iconbtn { background: rgba(255,255,255,.12); border: 0; color: var(--white); border-radius: 999px; width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer; }
.iconbtn:hover { background: rgba(255,255,255,.22); }
.iconbtn .ico { width: 18px; height: 18px; }

/* Dashboard */
.dash { max-width: 980px; margin: 0 auto; padding: 6vh 16px 64px; }
.dash__hello { color: var(--white); text-align: center; font-weight: 500; font-size: clamp(1.6rem, 4vw, 2.3rem); margin-bottom: 2.2rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 18px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: .2rem;
  min-height: 150px; padding: 20px;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-radius: 20px; box-shadow: var(--shadow);
  text-decoration: none; color: var(--ink);
  transition: transform .18s ease, box-shadow .18s ease;
}
a.card:hover, a.card:focus-visible { transform: translateY(-4px); box-shadow: var(--shadow-up); outline: none; }
a.card:hover .card__icon { background: var(--amber); color: var(--plum-deep); }
.card__icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--plum-soft); color: var(--plum); margin-bottom: auto; transition: background .18s, color .18s; }
.card__icon .ico { width: 24px; height: 24px; }
.card__eyebrow { margin-top: 1.2rem; font-size: .8rem; color: var(--muted); }
.card__title { font-size: 1.15rem; font-weight: 600; }
.card .badge { position: absolute; top: 18px; right: 18px; }
.card--soon { background: rgba(255, 255, 255, .72); cursor: default; }
.card--soon .card__icon { background: rgba(74, 51, 96, .08); color: var(--muted); }

/* Login */
.login {
  width: 100%; max-width: 380px; background: var(--white); border-radius: 24px; box-shadow: var(--shadow-up);
  padding: 32px 24px; display: flex; flex-direction: column; gap: 1rem; text-align: center;
}
.login__logo { height: 56px; margin: 0 auto; }
.login .stack { display: flex; flex-direction: column; gap: .9rem; text-align: left; margin-top: .4rem; }
.login p { margin: 0; }

/* Inhaltsseiten */
.wrap { max-width: 980px; margin: 0 auto; padding: 8px 16px 64px; }
.wrap > h1 { color: var(--white); font-weight: 500; font-size: clamp(1.4rem, 3.5vw, 2rem); margin: .6rem 0 1rem; }
.panel { background: var(--white); border-radius: 20px; box-shadow: var(--shadow); padding: 20px; margin-top: 16px; }
.panel > h2 { font-size: 1.1rem; margin-bottom: .8rem; color: var(--plum); }
.panel > p { margin-top: 0; }
.empty { background: rgba(255,255,255,.9); border-radius: 20px; padding: 32px; text-align: center; color: var(--muted); }

.share { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; background: rgba(255,255,255,.12); color: var(--white); border-radius: 16px; padding: 12px 14px; }
.share__label { font-size: .85rem; opacity: .8; }
.share code { font-size: .95rem; background: rgba(0,0,0,.25); padding: .3em .6em; border-radius: 8px; word-break: break-all; }

.tabs { display: flex; gap: 6px; margin-top: 16px; overflow-x: auto; }
.tab { color: rgba(255,255,255,.85); text-decoration: none; padding: .55em 1em; border-radius: 999px; white-space: nowrap; font-weight: 500; }
.tab:hover { background: rgba(255,255,255,.12); }
.tab.is-active { background: var(--white); color: var(--plum); }
.tab--right { margin-left: auto; }
.count { font-size: .8em; opacity: .7; }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.kpi { background: var(--white); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.kpi b { font-size: 1.5rem; font-weight: 600; color: var(--plum); line-height: 1.2; }
.kpi span { font-size: .85rem; color: var(--muted); }
@media (max-width: 520px) { .kpi b { font-size: 1.05rem; } }

.ev { padding: 14px 0; border-top: 1px solid var(--line); }
.ev:first-of-type { border-top: 0; padding-top: 0; }
.ev h3 { font-size: .98rem; font-weight: 500; margin-bottom: .6rem; }
.ev h3 .muted { font-weight: 400; font-size: .85rem; margin-left: .3rem; }
.bar { display: grid; grid-template-columns: minmax(110px, 34%) 1fr 72px; align-items: center; gap: 10px; font-size: .9rem; padding: 3px 0; }
.bar__track { height: 10px; background: var(--plum-soft); border-radius: 99px; overflow: hidden; }
.bar__track span { display: block; height: 100%; background: linear-gradient(90deg, var(--plum), var(--plum-light)); border-radius: 99px; }
.bar__val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.bar__val small { font-weight: 400; color: var(--muted); margin-left: .35em; }
.ev--text summary { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; cursor: pointer; list-style: none; }
.ev--text summary::-webkit-details-marker { display: none; }
.ev--text summary h3 { margin: 0; }
.ev--text summary::after { content: '▾'; color: var(--muted); }
.ev--text[open] summary::after { content: '▴'; }
.answers { list-style: none; margin: .8rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.answers li { background: var(--lavender); border-radius: 12px; padding: 10px 12px; display: flex; gap: 10px; justify-content: space-between; }
.answers p { margin: 0; white-space: pre-wrap; }
.answers a { font-size: .8rem; color: var(--muted); flex-shrink: 0; }

.tablewrap { overflow-x: auto; border-radius: 16px; background: var(--white); box-shadow: var(--shadow); margin-top: 16px; }
.panel .tablewrap { box-shadow: none; margin: 0 0 1rem; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { font-weight: 500; color: var(--muted); font-size: .82rem; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: var(--lavender); }
.table .num, .table .chk { text-align: center; }
.chk input { width: 20px; height: 20px; accent-color: var(--plum); }

.detailhead { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1rem; color: var(--white); margin: .6rem 0 0; }
.detailhead h1 { font-weight: 500; }
.detailhead .muted { color: rgba(255,255,255,.75); }
.pager { margin-left: auto; display: flex; gap: 6px; }
.dl { margin: 0; }
.dl__row { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); }
.dl__row:first-child { border-top: 0; }
.dl dt { color: var(--muted); font-size: .88rem; }
.dl dd { margin: 0; white-space: pre-wrap; }
@media (min-width: 700px) { .dl__row:not(.dl__row--text) { grid-template-columns: 1fr 1fr; gap: 16px; } }
.danger-zone { margin-top: 24px; text-align: right; }
.inline { display: flex; gap: 8px; flex-wrap: wrap; }
.inline input { flex: 1 1 200px; width: auto; }

/* =========================================================
   Öffentlicher Fragebogen (mobile first)
   ========================================================= */
.form { background: var(--lavender); }
.progress { position: fixed; inset: 0 0 auto; height: 4px; z-index: 10; background: transparent; }
.progress span { display: block; height: 100%; width: 0; background: var(--amber); transition: width .15s; }

.hero {
  background:
    radial-gradient(500px 240px at 90% 0%, color-mix(in srgb, var(--amber) 35%, transparent), transparent 70%),
    linear-gradient(160deg, color-mix(in srgb, var(--plum) 85%, white), var(--plum) 45%, var(--plum-deep));
  color: var(--white); text-align: center;
  padding: calc(28px + env(safe-area-inset-top)) 16px 64px;
}
.hero__logo { height: 64px; display: block; margin: 0 auto 10px; }
.hero__kicker { margin: 0; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; opacity: .8; }
.hero h1 { font-size: clamp(1.6rem, 7vw, 2.4rem); font-weight: 600; margin-top: .2rem; }
.hero--small { padding-bottom: 56px; }

.sheet { max-width: 680px; margin: -40px auto 0; padding: 0 12px calc(40px + env(safe-area-inset-bottom)); position: relative; }
.sec { background: var(--white); border-radius: 20px; box-shadow: var(--shadow); padding: 20px 16px; margin-bottom: 14px; }
.sec--intro h2 { font-size: 1.3rem; color: var(--plum); margin-bottom: .6rem; }
.sec--intro p { margin: 0 0 .7rem; color: #3d3346; }
.sec--intro p:last-child { margin: 0; }
.sec__title { display: flex; align-items: center; gap: .6rem; font-size: 1.15rem; color: var(--plum); margin-bottom: .4rem; }
.sec__no { width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; background: var(--plum-soft); display: grid; place-items: center; font-size: .9rem; font-weight: 600; }
.sec__intro { color: var(--muted); margin: 0 0 .4rem; font-size: .95rem; }

.q { border: 0; margin: 0; padding: 16px 0 0; min-width: 0; }
.q legend, .q__label { font-weight: 500; padding: 0; margin-bottom: .6rem; display: block; float: left; width: 100%; }
.q legend + * { clear: both; }
.q__hint { display: block; color: var(--muted); font-size: .92rem; margin: -.4rem 0 .5rem; }
.q.field { gap: 0; }
.opt { font-weight: 400; color: var(--muted); }
.q--small .q__label { font-size: .92rem; color: var(--muted); }
.q--small textarea { min-height: 3.2em; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span {
  display: inline-flex; align-items: center; min-height: 44px; padding: .5em 1em;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--white);
  font-size: .95rem; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: background .12s, border-color .12s, color .12s, transform .08s;
}
.pill span:active { transform: scale(.97); }
.pill input:checked + span { background: var(--plum); border-color: var(--plum); color: var(--white); }
.pill input:focus-visible + span { box-shadow: 0 0 0 4px var(--plum-soft); }
.q--multi .pill input:checked + span::before { content: '✓'; margin-right: .4em; font-weight: 700; }
@media (hover: hover) { .pill span:hover { border-color: var(--plum); } }

.q--compact { padding-top: 14px; border-top: 1px solid var(--line); margin-top: 14px; }
.sec__intro + .q--compact { border-top: 0; margin-top: 0; }
.q--compact .pill span { min-height: 38px; font-size: .88rem; padding: .35em .85em; }

.submit { margin-top: 18px; }
.sec--thanks { text-align: center; padding: 36px 20px; }
.sec--thanks h2 { color: var(--plum); font-size: 1.25rem; margin: .4rem 0 .6rem; }
.sec--thanks p { margin: 0; color: var(--muted); }
.heart { font-size: 2.4rem; color: var(--amber); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (min-width: 600px) {
  .sec { padding: 26px 28px; }
  .sheet { padding-left: 16px; padding-right: 16px; }
}

/* =========================================================
   Einkaufslisten, Fahrten, Administration
   ========================================================= */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.small { font-size: .88rem; }
.h1-sub { font-size: .9rem; font-weight: 400; opacity: .7; margin-left: .4rem; }
.wrap--wide { max-width: 1180px; }
.badge--count { background: var(--amber); color: var(--plum-deep); text-transform: none; letter-spacing: 0; }
.badge--type { background: var(--plum-soft); color: var(--plum); }
.btn--ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, white); }
.iconbtn--light { background: var(--lavender); color: var(--muted); }
.iconbtn--light:hover { background: #fde8e7; color: var(--danger); }
select {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--white);
  border: 1.5px solid var(--line); border-radius: 12px; padding: .7em .8em; width: 100%;
}
.panel h2 .count { font-size: .85rem; font-weight: 400; color: var(--muted); }
.panel > .alert, .wrap > .alert { margin-top: 16px; }
.wrap > .flash, .wrap > .alert { margin: 16px 0 0; }
.alert.small { padding: .5em .8em; }

/* Artikel-Formular */
.itemform { display: grid; grid-template-columns: 1fr 96px; gap: 10px; align-items: end; }
.itemform__desc, .itemform .btn { grid-column: 1 / -1; }
@media (min-width: 760px) {
  .itemform { grid-template-columns: 2fr 90px 2fr auto; }
  .itemform__desc, .itemform .btn { grid-column: auto; }
  .itemform .btn { height: 48px; }
}

/* Listen-Einträge */
.items, .rides, .reqs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: start;
  background: var(--lavender); border-radius: 14px; padding: 10px 12px; position: relative;
}
.item--req { background: var(--amber-soft); }
.item__qty { font-weight: 600; color: var(--plum); min-width: 2.4em; padding-top: 2px; font-variant-numeric: tabular-nums; }
.item__main { display: flex; flex-direction: column; min-width: 0; }
.item__main b { font-weight: 500; overflow-wrap: anywhere; }
.item__desc { color: #4a4053; font-size: .92rem; overflow-wrap: anywhere; }
.item__meta { color: var(--muted); font-size: .78rem; margin-top: 2px; }
.item__actions { display: flex; gap: 6px; align-items: center; }
.item__actions form { margin: 0; }
.item__edit { grid-column: 2 / -1; }
.item__edit > summary {
  display: inline-flex; align-items: center; gap: 4px; list-style: none; cursor: pointer;
  font-size: .8rem; color: var(--muted); padding: 2px 0;
}
.item__edit > summary::-webkit-details-marker { display: none; }
.item__edit > summary .ico { width: 14px; height: 14px; }
.item__edit > summary .sr { position: static; width: auto; height: auto; clip: auto; }
.item__edit > summary:hover, .item__edit[open] > summary { color: var(--plum); }
.item__edit[open] form { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }

/* Fahrten */
.daynav { display: flex; align-items: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.daynav form { margin: 0; }
.daynav input[type=date] { width: auto; padding: .45em .7em; }
.dayhead { color: var(--white); font-weight: 500; font-size: 1.15rem; margin: 14px 0 0; }
.vehicle { padding: 14px 0; border-top: 1px solid var(--line); }
.vehicle:first-child { border-top: 0; padding-top: 0; }
.vehicle__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 10px; }
.tl { margin-bottom: 10px; }
.tl__track {
  position: relative; height: 26px; border-radius: 8px; background:
    repeating-linear-gradient(90deg, transparent 0 calc(100% / 24 - 1px), var(--line) calc(100% / 24 - 1px) calc(100% / 24)),
    var(--lavender);
}
.tl__block { position: absolute; top: 3px; bottom: 3px; border-radius: 6px; background: linear-gradient(90deg, var(--plum), var(--plum-light)); }
.tl__block:hover { background: var(--amber); }
.tl__ticks { position: relative; height: 16px; font-size: .7rem; color: var(--muted); }
.tl__ticks span { position: absolute; transform: translateX(-50%); }
.tl__ticks span:first-child { transform: none; }
.tl__ticks span:last-child { transform: translateX(-100%); }
.ride {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; position: relative;
  background: var(--lavender); border-radius: 12px; padding: 8px 12px; scroll-margin-top: 80px;
}
.ride:target { box-shadow: 0 0 0 2px var(--amber); }
.ride__time { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--plum); }
.ride__main { min-width: 0; overflow-wrap: anywhere; }

.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.grid-form .field:first-of-type:not(.grid-form__wide) { grid-column: 1 / -1; }
.grid-form__wide { grid-column: 1 / -1; }
.grid-form .q { padding-top: 0; }
@media (min-width: 760px) {
  .grid-form { grid-template-columns: repeat(4, 1fr); }
  .grid-form .field:first-of-type:not(.grid-form__wide) { grid-column: auto; }
}

.req { background: var(--lavender); border-radius: 14px; padding: 12px 14px; }
.req--offen { background: var(--amber-soft); }
.req__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.req__meta { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }
.req__answer { margin: 6px 0 0; display: flex; align-items: center; gap: 6px; color: var(--ok); font-size: .92rem; }
.req__answer--no { color: var(--danger); }
.req__answer .ico { width: 16px; height: 16px; }
.req__actions { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.req__actions .inline select { flex: 0 1 180px; width: auto; }
.status { margin-left: auto; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.status--offen { color: #7a5600; }
.status--bestaetigt { color: var(--ok); }
.status--abgelehnt { color: var(--danger); }

/* Administration */
.filter { margin: 0 0 12px; max-width: 320px; }
.table--rights td { vertical-align: middle; }
.table--rights tbody tr { cursor: default; }
.table--rights select { min-width: 150px; padding: .45em .6em; font-size: .9rem; }
.table--rights small { font-size: .78rem; }

/* Hintergrund auch unterhalb langer Seiten dunkel (iOS ignoriert background-attachment: fixed) */
html:has(body.app) { background: var(--bg-bottom); }
.table--rights select { min-width: 132px; }
.f-day, .f-driver { grid-column: 1 / -1; }
@media (min-width: 760px) { .f-day, .f-driver { grid-column: auto; } }

/* Superadmin-Werkzeug */
.topbar__right { display: flex; align-items: center; gap: 8px; }
.tools { position: relative; }
.tools > summary { list-style: none; }
.tools > summary::-webkit-details-marker { display: none; }
.iconbtn--active { background: var(--amber); color: var(--plum-deep); }
.iconbtn--active:hover { background: #ffc837; }
.tools__panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20;
  width: min(340px, calc(100vw - 32px)); max-height: calc(100vh - 90px); overflow-y: auto;
  background: var(--white); color: var(--ink); border-radius: 18px; box-shadow: var(--shadow-up);
  padding: 16px; display: flex; flex-direction: column; gap: 14px;
}
.tools__panel h3 { font-size: 1rem; color: var(--plum); }
.tools__panel .stack { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.tools__panel .stack + .stack { border-top: 1px solid var(--line); padding-top: 14px; }
.tools__panel select { padding: .5em .7em; font-size: .95rem; }
.tools__panel .field > span { font-size: .85rem; font-weight: 500; }
.tools__label { margin: 0; font-weight: 600; font-size: .9rem; }
.tools__row { display: flex; gap: 8px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: .92rem; }
.check input { width: 18px; height: 18px; accent-color: var(--plum); }
.toolsbar {
  display: flex; align-items: center; gap: 10px; margin: 0; padding: 8px 16px;
  background: var(--amber); color: var(--plum-deep); font-size: .92rem;
}
.toolsbar .ico { width: 18px; height: 18px; flex-shrink: 0; }
.toolsbar span { flex: 1; }
.toolsbar .btn { background: var(--plum-deep); color: var(--white); border-color: var(--plum-deep); }
.who { display: inline-flex; align-items: center; gap: 10px; }
.who .iconbtn { width: 32px; height: 32px; flex-shrink: 0; }
.who .iconbtn .ico { width: 17px; height: 17px; }
.who .iconbtn:hover { background: var(--plum-soft); color: var(--plum); }
@media (max-width: 560px) {
  .tools__panel { position: fixed; left: 16px; right: 16px; top: 64px; width: auto; }
  .topbar { padding: 12px 16px; gap: 8px; }
  .topbar__user span { display: none; }
  .topbar__brand img { height: 26px; }
}

/* Benutzermenü + Werkzeug unter dem Namen */
.topbar__right { position: relative; flex-direction: column; align-items: flex-end; gap: 4px; }
.usermenu { position: relative; }
.usermenu__btn {
  list-style: none; cursor: pointer; display: flex; flex-direction: column; align-items: flex-end;
  padding: 6px 12px; border-radius: 14px; background: rgba(255,255,255,.1); color: var(--white); line-height: 1.2;
}
.usermenu__btn::-webkit-details-marker { display: none; }
.usermenu__btn:hover, .usermenu[open] .usermenu__btn { background: rgba(255,255,255,.2); }
.usermenu__name { font-weight: 500; font-size: .92rem; }
.usermenu__team { font-size: .75rem; opacity: .75; }
.usermenu__panel, .tools__panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30;
  width: min(320px, calc(100vw - 32px)); background: var(--white); color: var(--ink);
  border-radius: 18px; box-shadow: var(--shadow-up); padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.usermenu__panel .stack { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.usermenu__panel form { margin: 0; }
.btn--block { width: 100%; }
.tools > summary.toolsbtn {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
  font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: var(--amber); color: var(--plum-deep); box-shadow: 0 0 12px color-mix(in srgb, var(--amber) 60%, transparent);
}
.tools > summary.toolsbtn::-webkit-details-marker { display: none; }
.tools > summary.toolsbtn .ico { width: 14px; height: 14px; }
.tools[open] > summary.toolsbtn, .tools > summary.toolsbtn:hover { background: color-mix(in srgb, var(--amber) 80%, white); }
@media (max-width: 560px) {
  .usermenu__panel, .tools__panel { position: fixed; left: 16px; right: 16px; top: 70px; width: auto; max-height: calc(100vh - 90px); overflow-y: auto; }
  .usermenu__team { display: none; }
}

/* Teams */
.teamchip {
  display: inline-block; font-size: .74rem; font-weight: 600; padding: .15em .6em; border-radius: 999px;
  background: #e6f3ee; color: #1d6a53; align-self: flex-start;
}
.teamfield__hint { font-size: .8rem; color: var(--muted); min-height: 1em; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--plum); font-weight: 600; text-decoration: underline; cursor: pointer; }
.itemform__team { grid-column: 1 / -1; }
@media (min-width: 760px) { .itemform__team { grid-column: 1 / -1; max-width: 360px; } }

/* Zeitleiste: Balken mit Tooltip, Details im Dialog */
.tl__help { margin: 0 0 6px; }
.tl__track { height: 34px; }
.tl__block {
  border: 0; padding: 0 6px; cursor: pointer; color: var(--white); font: inherit; font-size: .72rem; font-weight: 600;
  overflow: visible; display: flex; align-items: center; min-width: 8px;
}
.tl__block span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tl__block[data-tip]:hover::after, .tl__block[data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--plum-deep); color: var(--white); font-weight: 400; font-size: .8rem; white-space: nowrap;
  padding: 6px 10px; border-radius: 8px; z-index: 5; pointer-events: none; box-shadow: var(--shadow);
}
.vehicle__count { margin-left: auto; }
.dlg { border: 0; border-radius: 20px; padding: 20px; width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow-up); }
.dlg::backdrop { background: rgba(30, 21, 40, .55); }
.dlg h3 { color: var(--plum); margin: 0 40px 10px 0; }
.dlg__close { position: absolute; top: 14px; right: 14px; margin: 0; }
.dlg__edit { margin: 12px 0; }
.dlg__edit > summary { list-style: none; }
.dlg__edit > summary::-webkit-details-marker { display: none; }
.dlg__edit[open] > summary { display: none; }
.dlg form[data-confirm] { margin-top: 10px; }

/* Administration */
.cards--admin { margin-top: 8px; }
.table--static tbody tr { cursor: default; }
.checks--col { flex-direction: column; gap: 4px; }
.checks--col .check { font-size: .82rem; white-space: nowrap; }
@media (max-width: 560px) {
  .item { grid-template-columns: auto 1fr; }
  .item__actions { grid-column: 2; justify-content: flex-start; flex-wrap: wrap; }
}

/* Design */
.logos { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.logo { background: var(--bg-bottom); color: var(--white); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 4px; border: 2px solid transparent; }
.logo--active { border-color: var(--amber); }
.logo img { height: 56px; object-fit: contain; object-position: left; margin-bottom: 6px; }
.logo__name { font-weight: 500; }
.logo .muted { color: rgba(255,255,255,.6); }
.logo__actions { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.logo__actions form { margin: 0; }
.logo-upload input[type=file] { flex: 1 1 200px; font-size: .9rem; }
.colors { display: flex; flex-direction: column; gap: 10px; }
.colorfield { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 8px; border-radius: 14px; background: var(--lavender); }
.colorfield input[type=color] { width: 52px; height: 40px; border: 0; padding: 0; background: none; cursor: pointer; }
.colorfield span { display: flex; flex-direction: column; }
.colorfield small { color: var(--muted); font-size: .8rem; }
.colorfield code { font-size: .85rem; color: var(--muted); }

/* Feedback-Vorlagen */
.formrows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.formrow { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: center; background: var(--lavender); border-radius: 14px; padding: 12px 14px; }
.formrow__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.formrow__main small { overflow-wrap: anywhere; }
.formrow__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.formrow .status { margin-left: 0; }
.formstate { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.formstate .status { margin: 0 6px 0 0; }
.tools__row--wrap { flex-wrap: wrap; margin: 0; }
.warnbox { border: 2px solid var(--danger); }
.warnbox h2 { color: var(--danger); display: flex; align-items: center; gap: 6px; }
.warnbox ul { margin: 0 0 8px; padding-left: 1.2em; }
.warnbox li { margin: 4px 0; }
.check--warn { font-weight: 600; color: var(--danger); }
.danger h2 { color: var(--danger); }
.slugfield { display: flex; align-items: center; gap: 4px; }
.slugfield small { color: var(--muted); white-space: nowrap; }
.builder { display: flex; flex-direction: column; gap: 0; }
.builder > .btn { align-self: flex-start; margin-top: 16px; }
.builder__save { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; padding: 12px 16px; background: var(--white); border-radius: 18px; box-shadow: var(--shadow-up); }
.bsec__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bsec__title { font-weight: 600; font-size: 1.05rem !important; }
.bitems { list-style: none; margin: 12px 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bitem { background: var(--lavender); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.bitem__head { display: flex; align-items: center; gap: 8px; }
.bitem__head select { flex: 1; padding: .45em .6em; font-size: .92rem; }
.bitem__no { font-weight: 700; color: var(--plum); min-width: 1.4em; }
.bitem__tools { display: flex; gap: 4px; margin-left: auto; }
.bitem__tools .iconbtn { width: 32px; height: 32px; font-size: .9rem; }
.bitem__del:hover { background: #fde8e7; color: var(--danger); }
.bitem .field > span { font-size: .85rem; }
.evalhead { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: .6rem 0 1rem; }
.evalhead h1 { color: var(--white); font-weight: 500; font-size: clamp(1.4rem, 3.5vw, 2rem); }
.formpick { margin: 0 0 0 auto; }
.formpick select { width: auto; max-width: 100%; padding: .45em .7em; }

/* Öffentlicher Fragebogen: neue Feldtypen */
.toolsbar--static { position: sticky; top: 0; z-index: 20; }
.toolsbar--static .btn { background: var(--plum-deep); color: var(--white); border-color: var(--plum-deep); }
.q select { margin-top: 0; }
.q--check { display: flex; gap: 10px; align-items: flex-start; padding-top: 16px; cursor: pointer; }
.q--check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--plum); flex-shrink: 0; }
.q--check small { display: block; color: var(--muted); }
