/* Otto TarifPilot – Designsystem (Apple-orientiert, Hell/Dunkel, iPhone/iPad/Desktop) */
:root {
  --bg: #f2f2f7; --bg2: #ffffff; --card: #ffffff; --card2: #f7f7fa; --fill: rgba(118,118,128,.12); --fill2: rgba(118,118,128,.08);
  --text: #1c1c1e; --text2: #3a3a3c; --muted: #8e8e93; --sep: rgba(60,60,67,.14);
  --accent: #0a84ff; --accent-t: rgba(10,132,255,.12); --green: #30a14e; --green-t: rgba(48,161,78,.12);
  --red: #e5383b; --red-t: rgba(229,56,59,.12); --orange: #f08c00; --orange-t: rgba(240,140,0,.14);
  --indigo: #5856d6; --indigo-t: rgba(88,86,214,.12); --teal: #0b9aa6; --teal-t: rgba(11,154,166,.12); --purple: #9c36b5; --purple-t: rgba(156,54,181,.12);
  --gray-t: rgba(142,142,147,.16);
  --radius: 14px; --radius-lg: 20px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.05);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --tabbar-h: 56px; --sidebar-w: 248px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --bg2: #1c1c1e; --card: #1c1c1e; --card2: #2c2c2e; --fill: rgba(118,118,128,.24); --fill2: rgba(118,118,128,.16);
    --text: #f2f2f7; --text2: #d1d1d6; --muted: #98989f; --sep: rgba(84,84,88,.5);
    --accent: #0a84ff; --accent-t: rgba(10,132,255,.22); --green: #32d74b; --green-t: rgba(50,215,75,.18);
    --red: #ff453a; --red-t: rgba(255,69,58,.2); --orange: #ff9f0a; --orange-t: rgba(255,159,10,.2);
    --indigo: #7d7aff; --indigo-t: rgba(125,122,255,.2); --teal: #40c8e0; --teal-t: rgba(64,200,224,.18); --purple: #da8fff; --purple-t: rgba(218,143,255,.2);
    --shadow: none;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 16px; line-height: 1.4; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
/* Standardgröße für Symbole im Fließtext; Komponenten überschreiben sie gezielt */
svg.i { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: 0 0 auto; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Layout ---------- */
#app { min-height: 100%; }
.shell { display: flex; min-height: 100vh; }
.sidebar { display: none; }
.main { flex: 1; min-width: 0; padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); }
.page { max-width: 1100px; margin: 0 auto; padding: calc(var(--safe-t) + 12px) 16px 24px; animation: fade .18s ease-out; }
.page.narrow { max-width: 760px; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--bg2) 82%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-top: .5px solid var(--sep); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10.5px; font-weight: 500; color: var(--muted); }
.tabbar a svg { width: 25px; height: 25px; }
.tabbar a.active { color: var(--accent); }
.tabbar .fab { flex: 0 0 auto; width: 64px; }
.tabbar .fab span.plus { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 14px rgba(10,132,255,.35); }
.tabbar .fab span.plus svg { width: 24px; height: 24px; }

@media (min-width: 900px) {
  .tabbar { display: none; }
  .main { padding-bottom: 24px; }
  .sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); padding: 18px 12px; background: var(--bg2); border-right: .5px solid var(--sep); overflow-y: auto; }
  .sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; font-weight: 700; font-size: 17px; }
  .sidebar .brand img { width: 34px; height: 34px; border-radius: 9px; }
  .sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--text); font-weight: 500; font-size: 15px; }
  .sidebar nav a svg { width: 21px; height: 21px; color: var(--accent); }
  .sidebar nav a.active { background: var(--accent); color: #fff; }
  .sidebar nav a.active svg { color: #fff; }
  .sidebar nav .sep { height: 1px; background: var(--sep); margin: 10px 12px; }
  .sidebar .new-btn { margin: 0 4px 14px; }
  .sidebar .foot { margin-top: auto; padding: 12px; font-size: 12.5px; color: var(--muted); }
  .page { padding: 28px 32px 32px; }
}

/* ---------- Kopfzeilen ---------- */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 0 16px; flex-wrap: wrap; }
.head h1 { font-size: 32px; line-height: 1.1; letter-spacing: -.02em; margin: 0; font-weight: 750; }
.head .sub { color: var(--muted); font-size: 15px; margin-top: 4px; }
.head .actions { display: flex; gap: 8px; align-items: center; }
.back { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-size: 16px; margin: 4px 0 2px -6px; padding: 4px 6px; background: none; border: 0; cursor: pointer; }
.back svg { width: 22px; height: 22px; }
h2.section { font-size: 20px; font-weight: 700; letter-spacing: -.01em; margin: 26px 0 10px; display: flex; align-items: center; justify-content: space-between; }
h2.section a, h2.section button { font-size: 15px; font-weight: 500; }
.caption { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; margin: 20px 16px 6px; font-weight: 500; }
.hint { font-size: 13px; color: var(--muted); margin: 6px 16px 0; }

/* ---------- Karten & Listen ---------- */
.card { background: var(--card); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.card.tight { padding: 0; overflow: hidden; }
.grid { display: grid; gap: 12px; }
.grid.k2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .grid.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .grid.k2-lg { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 699px) { .grid.k3, .grid.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; } }

.list { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 50px; position: relative; background: var(--card); width: 100%; border: 0; text-align: left; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--sep); }
a.row, button.row { cursor: pointer; color: inherit; }
a.row:active, button.row:active { background: var(--fill2); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .end { text-align: right; flex: 0 0 auto; }
.row .chev { color: var(--muted); width: 18px; height: 18px; flex: 0 0 auto; opacity: .6; }
.row .ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: var(--accent); }
.row .ico svg { width: 18px; height: 18px; }
.row .label { color: var(--muted); flex: 0 0 38%; font-size: 15px; }
.row .value { flex: 1; text-align: right; word-break: break-word; }
.empty { text-align: center; color: var(--muted); padding: 32px 16px; }
.empty svg { width: 44px; height: 44px; opacity: .5; display: block; margin: 0 auto 8px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #8e9aaf, #5c677d); color: #fff; display: grid; place-items: center; font-weight: 650; font-size: 15px; flex: 0 0 auto; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }

/* ---------- Pills, Badges ---------- */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--gray-t); color: var(--text2); }
.pill.blue { background: var(--accent-t); color: var(--accent); } .pill.green { background: var(--green-t); color: var(--green); }
.pill.red { background: var(--red-t); color: var(--red); } .pill.orange { background: var(--orange-t); color: var(--orange); }
.pill.indigo { background: var(--indigo-t); color: var(--indigo); } .pill.teal { background: var(--teal-t); color: var(--teal); } .pill.purple { background: var(--purple-t); color: var(--purple); }
.pill svg { width: 13px; height: 13px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.demo-badge { background: var(--orange-t); color: var(--orange); font-weight: 700; font-size: 12px; padding: 4px 10px; border-radius: 999px; letter-spacing: .03em; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 12px; padding: 11px 18px; font-weight: 600; font-size: 16px; cursor: pointer; background: var(--accent); color: #fff; min-height: 44px; transition: transform .08s, opacity .15s; text-align: center; }
.btn:active { transform: scale(.98); }
.btn:disabled, .btn.busy { opacity: .5; pointer-events: none; }
.btn svg { width: 19px; height: 19px; flex: 0 0 auto; }
.btn.tinted { background: var(--accent-t); color: var(--accent); }
.btn.gray { background: var(--fill); color: var(--text); }
.btn.plain { background: none; color: var(--accent); padding: 8px 10px; min-height: 36px; }
.btn.danger { background: var(--red-t); color: var(--red); }
.btn.green { background: var(--green); color: #fff; }
.btn.block { width: 100%; }
.btn.lg { min-height: 52px; font-size: 17px; border-radius: 14px; }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn.icon { padding: 0; width: 44px; min-width: 44px; }
.btn.icon.sm { width: 34px; min-width: 34px; }
.btn.busy::after { content: ""; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1 1 auto; }

/* ---------- Segmented Control ---------- */
.seg { display: flex; background: var(--fill); border-radius: 10px; padding: 2px; gap: 2px; }
.seg button { flex: 1; border: 0; background: none; padding: 7px 10px; border-radius: 8px; font-size: 14.5px; font-weight: 550; cursor: pointer; color: var(--text); white-space: nowrap; min-height: 34px; }
.seg button.on { background: var(--bg2); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
@media (prefers-color-scheme: dark) { .seg button.on { background: #636366; } }
.seg button:disabled { opacity: .4; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 0; background: var(--fill); color: var(--text); padding: 7px 13px; border-radius: 999px; font-size: 14.5px; font-weight: 550; white-space: nowrap; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; }
.chip.on { background: var(--accent); color: #fff; }
.chip svg { width: 16px; height: 16px; }
.chip .count { background: rgba(0,0,0,.12); border-radius: 999px; padding: 0 7px; font-size: 12px; }

/* ---------- Formulare ---------- */
.form-list { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.field { display: flex; align-items: center; gap: 10px; padding: 0 16px; min-height: 50px; position: relative; }
.field + .field::before, .field + .field-block::before, .field-block + .field::before, .field-block + .field-block::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--sep); }
.field > label { flex: 0 0 38%; max-width: 170px; color: var(--text); font-size: 15.5px; }
.field > label .req { color: var(--red); margin-left: 2px; }
.field input, .field select, .field textarea { flex: 1; min-width: 0; border: 0; background: none; padding: 14px 0; outline: none; font-size: 16px; text-align: right; }
.field select { appearance: none; -webkit-appearance: none; cursor: pointer; text-align-last: right; padding-right: 18px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.4'%3E%3Cpath d='M8 9l4-4 4 4M8 15l4 4 4-4'/%3E%3C/svg%3E") no-repeat right center / 14px; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: .8; }
.field input[type=date] { min-height: 22px; -webkit-appearance: none; }
.field input[type=date]::-webkit-date-and-time-value { text-align: right; }
.field .addon { color: var(--muted); font-size: 15px; flex: 0 0 auto; }
.field .tool { flex: 0 0 auto; }
.field.stack { flex-direction: column; align-items: stretch; gap: 4px; padding: 10px 16px; }
.field.stack > label { max-width: none; font-size: 13.5px; color: var(--muted); }
.field.stack input, .field.stack textarea, .field.stack select { text-align: left; padding: 4px 0; }
.field textarea { text-align: left; min-height: 84px; resize: vertical; padding: 12px 0; }
.field-block { padding: 12px 16px; position: relative; }
.field.err > label, .field-block.err > label { color: var(--red); }
.field .err-msg, .field-block .err-msg { display: none; }
.err-text { color: var(--red); font-size: 13px; padding: 0 16px 10px; margin-top: -6px; }
.toggle { position: relative; width: 51px; height: 31px; flex: 0 0 auto; }
.toggle input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.toggle span { position: absolute; inset: 0; background: var(--fill); border-radius: 999px; transition: background .2s; }
.toggle span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.22); transition: transform .2s; }
.toggle input:checked + span { background: var(--green); }
.toggle input:checked + span::after { transform: translateX(20px); }
.check-row { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; cursor: pointer; }
.check-row input { width: 22px; height: 22px; accent-color: var(--accent); margin: 1px 0 0; flex: 0 0 auto; }
.input-box { width: 100%; border: 0; background: var(--fill2); border-radius: 12px; padding: 12px 14px; font-size: 16px; outline: none; }
.input-box:focus { box-shadow: 0 0 0 3px var(--accent-t); }
.search { display: flex; align-items: center; gap: 8px; background: var(--fill); border-radius: 11px; padding: 0 10px; height: 38px; }
.search svg { width: 17px; height: 17px; color: var(--muted); flex: 0 0 auto; }
.search input { flex: 1; border: 0; background: none; outline: none; font-size: 16px; min-width: 0; }

/* Straßen-/Kundensuche */
.suggest { border-top: .5px solid var(--sep); max-height: 280px; overflow-y: auto; }
.suggest button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 12px 16px; font-size: 16px; cursor: pointer; border-bottom: .5px solid var(--sep); }
.suggest button:last-child { border-bottom: 0; }
.suggest button:active, .suggest button.hl { background: var(--accent-t); }
.suggest mark { background: none; color: var(--accent); font-weight: 650; }

/* ---------- Dashboard ---------- */
.hero { background: linear-gradient(135deg, #0a84ff 0%, #5e5ce6 100%); color: #fff; border-radius: 22px; padding: 20px; position: relative; overflow: hidden; }
.hero .lbl { opacity: .85; font-size: 14px; font-weight: 550; }
.hero .big { font-size: 40px; font-weight: 760; letter-spacing: -.02em; margin: 2px 0 10px; font-variant-numeric: tabular-nums; }
.hero .split { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hero .split div { background: rgba(255,255,255,.14); border-radius: 12px; padding: 9px 10px; }
.hero .split b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.hero .split small { opacity: .85; font-size: 12px; }
.hero .period { margin-top: 12px; font-size: 13.5px; opacity: .92; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kpi { background: var(--card); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); display: block; color: var(--text); }
.kpi .k-lbl { font-size: 13.5px; color: var(--muted); font-weight: 550; display: flex; align-items: center; gap: 6px; }
.kpi .k-lbl svg { width: 16px; height: 16px; }
.kpi .k-val { font-size: 28px; font-weight: 740; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 12.5px; color: var(--muted); }
.kpi.alert .k-val { color: var(--red); }
.progress { height: 8px; background: var(--fill); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, #c08457, #e0a96d); border-radius: 999px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; }
.todo { display: flex; gap: 12px; align-items: flex-start; }
.todo .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: 0 0 auto; background: var(--accent); }
.todo .dot.warn { background: var(--orange); } .todo .dot.danger { background: var(--red); }

/* ---------- Tarife ---------- */
.calc { display: grid; gap: 12px; }
/* Grid-Kinder dürfen schrumpfen (sonst sprengen horizontale Chip-Leisten die Seitenbreite) */
.grid > *, .cols > *, .calc > *, .tariff > *, .main { min-width: 0; }
html, body { overflow-x: hidden; }
.plz-row { display: flex; gap: 8px; align-items: stretch; }
.plz-row .input-box { font-size: 20px; font-weight: 600; letter-spacing: .06em; flex: 1; min-width: 0; }
.place-line { font-size: 14px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-height: 22px; }
.tariff { background: var(--card); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); display: grid; gap: 10px; }
.tariff .top { display: flex; gap: 12px; align-items: flex-start; }
.tariff .rank { width: 30px; height: 30px; border-radius: 9px; background: var(--fill); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: 0 0 auto; }
.tariff .prov { font-size: 13.5px; color: var(--muted); }
.tariff .tname { font-weight: 680; font-size: 17px; }
.tariff .price { text-align: right; margin-left: auto; flex: 0 0 auto; }
.tariff .price b { font-size: 22px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tariff .price small { display: block; color: var(--muted); font-size: 12.5px; }
.tariff .facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.tariff .facts div { background: var(--card2); border-radius: 11px; padding: 8px 10px; }
.tariff .facts small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 550; text-transform: uppercase; letter-spacing: .02em; }
.tariff .facts b { font-size: 15px; font-variant-numeric: tabular-nums; }
.tariff .commission { background: var(--green-t); color: var(--green); }
.tariff .commission small { color: var(--green); opacity: .85; }
.tariff .saving b { color: var(--green); }
.tariff .actions { display: flex; gap: 8px; }
.tariff .actions .btn { flex: 1; }
.tariff.recommended { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.notes { display: grid; gap: 8px; }
.note { display: flex; gap: 8px; font-size: 14.5px; align-items: flex-start; }
.note svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }
.note.warn svg { color: var(--orange); } .note.ok svg { color: var(--green); } .note.info svg { color: var(--accent); }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 18px 0 10px; }
.toolbar .count { font-weight: 650; margin-right: auto; }
.select-box { appearance: none; -webkit-appearance: none; border: 0; background: var(--fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.4'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 14px; border-radius: 10px; padding: 8px 32px 8px 12px; font-size: 14.5px; font-weight: 550; min-height: 36px; cursor: pointer; }

/* ---------- Assistent (Auftragserfassung) ---------- */
.steps { display: flex; gap: 6px; margin: 4px 0 14px; }
.steps span { flex: 1; height: 4px; border-radius: 99px; background: var(--fill); }
.steps span.done { background: var(--accent); }
.steps span.cur { background: linear-gradient(90deg, var(--accent) 50%, var(--fill) 50%); }
.step-title { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.wizard-bar { position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-b)); z-index: 20; display: flex; gap: 10px; padding: 12px 0; margin-top: 18px;
  background: linear-gradient(transparent, var(--bg) 30%); }
@media (min-width: 900px) { .wizard-bar { bottom: 0; } }
.wizard-bar .btn { flex: 1; }
.tariff-mini { display: flex; gap: 12px; align-items: center; }
.tariff-mini .grow { flex: 1; min-width: 0; }
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.doc-slot { background: var(--card); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); display: grid; gap: 8px; align-content: start; }
.doc-slot .dtitle { font-weight: 650; font-size: 14.5px; display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.doc-slot .dbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.doc-slot .dbtns label { cursor: pointer; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.thumb { position: relative; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: var(--fill); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--muted); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 13px; line-height: 20px; padding: 0; cursor: pointer; }
.thumb .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); }
.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.file-tile { background: var(--card2); border-radius: 12px; overflow: hidden; display: grid; color: var(--text); font-size: 12px; }
.file-tile .prev { aspect-ratio: 1; background: var(--fill2); display: grid; place-items: center; font-weight: 700; color: var(--muted); }
.file-tile .prev img { width: 100%; height: 100%; object-fit: cover; }
.file-tile .cap { padding: 6px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sig-pad { width: 100%; height: 180px; background: var(--card2); border-radius: 14px; touch-action: none; display: block; border: 1.5px dashed var(--sep); }
.success { text-align: center; padding: 28px 8px; }
.success .check { width: 76px; height: 76px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; margin: 0 auto 14px; animation: pop .35s cubic-bezier(.2,1.4,.4,1); }
.success .check svg { width: 42px; height: 42px; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Auftragsdetail ---------- */
.timeline { display: grid; gap: 0; }
.tl-item { display: grid; grid-template-columns: 14px 1fr; gap: 12px; padding: 10px 16px; }
.tl-item .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-top: 6px; box-shadow: 0 0 0 3px var(--accent-t); }
.tl-item small { color: var(--muted); }

/* ---------- Webseite ---------- */
.mode-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); cursor: pointer; border: 2px solid transparent; }
.mode-card.on { border-color: var(--accent); }
.mode-card input { margin-top: 4px; width: 20px; height: 20px; accent-color: var(--accent); }
.mode-card b { display: block; }
.mode-card small { color: var(--muted); }
.link-box { display: flex; gap: 8px; align-items: center; background: var(--fill2); border-radius: 12px; padding: 10px 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; word-break: break-all; }
.color-dots { display: flex; gap: 10px; flex-wrap: wrap; padding: 10px 16px; }
.color-dots button { width: 32px; height: 32px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.color-dots button.on { border-color: var(--text); }

/* ---------- Overlays ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.38); z-index: 80; animation: fadein .2s; }
@keyframes fadein { from { opacity: 0; } }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 81; background: var(--bg); border-radius: 18px 18px 0 0; max-height: 92vh; display: flex; flex-direction: column; animation: up .26s cubic-bezier(.2,.9,.3,1); padding-bottom: var(--safe-b); }
@keyframes up { from { transform: translateY(100%); } }
.sheet .grab { width: 38px; height: 5px; border-radius: 99px; background: var(--fill); margin: 7px auto 0; }
.sheet header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 16px 10px; }
.sheet header h3 { margin: 0; font-size: 17px; font-weight: 680; flex: 1; text-align: center; }
.sheet header .btn { min-width: 70px; }
.sheet .body { overflow-y: auto; padding: 4px 16px 20px; -webkit-overflow-scrolling: touch; }
@media (min-width: 700px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%); width: min(620px, 92vw); border-radius: 20px; max-height: 86vh; animation: zoom .2s ease-out; }
  @keyframes zoom { from { transform: translate(-50%, -48%) scale(.97); opacity: 0; } }
  .sheet .grab { display: none; }
}
.toast-wrap { position: fixed; left: 0; right: 0; top: calc(var(--safe-t) + 10px); z-index: 100; display: grid; justify-items: center; gap: 8px; pointer-events: none; }
.toast { background: rgba(30,30,32,.94); color: #fff; padding: 11px 16px; border-radius: 14px; font-size: 15px; font-weight: 550; max-width: min(92vw, 460px); box-shadow: 0 8px 28px rgba(0,0,0,.25); animation: drop .25s ease-out; pointer-events: auto; display: flex; gap: 8px; align-items: center; }
.toast.ok { background: #1e7b3c; } .toast.err { background: #b42318; }
@keyframes drop { from { transform: translateY(-14px); opacity: 0; } }
.offline-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 90; background: var(--orange); color: #fff; text-align: center; font-size: 13px; font-weight: 600; padding: calc(var(--safe-t) + 4px) 8px 4px; }
.skeleton { background: linear-gradient(90deg, var(--fill2), var(--fill), var(--fill2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 14px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- Anmeldung ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth .box { width: min(420px, 100%); }
.auth .logo { width: 76px; height: 76px; border-radius: 18px; display: block; margin: 0 auto 14px; box-shadow: 0 8px 24px rgba(10,132,255,.3); }
.auth h1 { text-align: center; font-size: 28px; margin: 0 0 4px; letter-spacing: -.02em; }
.auth p.lead { text-align: center; color: var(--muted); margin: 0 0 22px; }
.muted { color: var(--muted); } .small { font-size: 13.5px; } .center { text-align: center; } .right { text-align: right; }
.num { font-variant-numeric: tabular-nums; } .strong { font-weight: 650; } .green { color: var(--green); } .red { color: var(--red); } .orange { color: var(--orange); }
.mt { margin-top: 12px; } .mt2 { margin-top: 20px; } .mb { margin-bottom: 12px; } .gap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
pre.portal { white-space: pre-wrap; font-size: 13.5px; background: var(--card2); border-radius: 12px; padding: 12px; margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; user-select: text; }
