* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body { font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: #fff7f0; color: #2b2b2b; }
header { background: linear-gradient(135deg, #ff7a00, #ff9f1c); color: #fff; padding: calc(22px + env(safe-area-inset-top)) 20px 28px; text-align: center; border-radius: 0 0 28px 28px; box-shadow: 0 6px 18px rgba(255,122,0,.35); }
header h1 { font-size: 1.6rem; }
header img { width: 48px; height: auto; margin-top: 10px; }
header small { display: block; font-size: .8rem; opacity: .95; }
main { padding: 16px; max-width: 520px; margin: 0 auto; }
.nr { background: #fff; border: 2px dashed #ff7a00; border-radius: 16px; padding: 14px; text-align: center; margin-bottom: 16px; }
.nr span { display: block; font-size: .8rem; color: #888; }
.nr strong { font-size: 1.3rem; color: #d96500; letter-spacing: 1px; overflow-wrap: anywhere; }

.steps { display: flex; justify-content: space-between; margin: 8px 0 20px; position: relative; }
.steps::before, .steps::after { content: ""; position: absolute; top: 16px; left: 16.66%; height: 4px; }
.steps::before { right: 16.66%; background: #ffd9b3; }
.steps::after { width: 0; background: #ff7a00; transition: width .6s ease; }
.steps[data-status="2"]::after { width: 33.33%; }
.steps[data-status="3"]::after { width: 66.66%; }
.step { flex: 1; text-align: center; font-size: .75rem; position: relative; z-index: 1; color: #999; }
.step .dot { width: 36px; height: 36px; margin: 0 auto 6px; border-radius: 50%; background: #ffd9b3; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: bold; transition: background .3s, box-shadow .3s; }
.step.done { color: #d96500; font-weight: 600; }
.step.done .dot { background: #ff7a00; box-shadow: 0 0 0 4px rgba(255,122,0,.25); }

.status { background: #ff7a00; color: #fff; border-radius: 16px; padding: 16px; margin-bottom: 16px; transition: background .3s; }
.status--done { background: #2e9e44; }
.status h2 { font-size: 1.15rem; margin-bottom: 4px; }
.card { background: #fff; border-radius: 16px; padding: 16px; margin-bottom: 12px; box-shadow: 0 3px 12px rgba(0,0,0,.07); border-left: 6px solid #ff7a00; }
.card h3 { color: #d96500; font-size: 1rem; margin-bottom: 6px; }
.card p { font-size: .95rem; line-height: 1.5; overflow-wrap: anywhere; }
.card p[data-field] { white-space: pre-line; }
.sizes { display: flex; gap: 8px; }
.size { flex: 1; text-align: center; border: 2px solid #ffd9b3; border-radius: 12px; padding: 10px 4px; color: #999; font-size: .8rem; }
.size b { display: block; font-size: 1.4rem; }
.size.active { border-color: #ff7a00; background: #ff7a00; color: #fff; }
footer { text-align: center; font-size: .8rem; color: #999; padding: 20px 16px calc(84px + env(safe-area-inset-bottom)); }

/* Live-Standort */
.map { height: 260px; border-radius: 12px; overflow: hidden; margin: 6px 0 8px; background: #ffe9d4; z-index: 0; }
.live { display: flex; align-items: center; gap: 8px; color: #666; }
.live::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: #bbb; }
.live--on::before { background: #2e9e44; animation: pulse 1.6s ease-out infinite; }
.truck { font-size: 30px; line-height: 36px; text-align: center; filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(46,158,68,.6); }
  100% { box-shadow: 0 0 0 10px rgba(46,158,68,0); }
}

/* Fahrer-Login */
.fab { position: fixed; right: calc(14px + env(safe-area-inset-right)); bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 1000; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #fff; box-shadow: 0 3px 12px rgba(0,0,0,.2); font-size: 1.1rem; cursor: pointer; opacity: .75; }
.fab--sharing { opacity: 1; box-shadow: 0 0 0 4px rgba(46,158,68,.55), 0 3px 12px rgba(0,0,0,.2); }

.btn { font: inherit; font-weight: 600; min-height: 44px; padding: 10px 14px; border: 2px solid #ff7a00; border-radius: 12px; background: #ff7a00; color: #fff; cursor: pointer; }
.btn:disabled { opacity: .55; }
.btn--quiet { background: transparent; border-color: transparent; color: #d96500; }
.btn--small { min-height: 36px; padding: 6px 10px; font-size: .85rem; }
.btn--wide { width: 100%; }
.btn--choice { flex: 1; min-width: 0; padding: 8px 4px; font-size: .8rem; background: #fff; color: #d96500; border-color: #ffd9b3; }
.btn--choice.active { background: #ff7a00; border-color: #ff7a00; color: #fff; }
.btn--stop { background: #c0392b; border-color: #c0392b; }
.btn--outline { background: #fff; color: #d96500; }

.dialog { margin: auto; width: min(340px, calc(100vw - 32px)); border: 0; border-radius: 18px; padding: 20px; box-shadow: 0 10px 40px rgba(0,0,0,.3); color: inherit; }
.dialog::backdrop { background: rgba(0,0,0,.45); }
.dialog h3 { color: #d96500; margin-bottom: 12px; }
.dialog label { display: block; font-size: .85rem; color: #666; margin-bottom: 4px; }
.dialog input { width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border: 2px solid #ffd9b3; border-radius: 12px; }
.dialog input:focus, .dialog textarea:focus { outline: none; border-color: #ff7a00; }
.dialog textarea { width: 100%; font: inherit; font-size: 16px; line-height: 1.4; padding: 10px 12px; border: 2px solid #ffd9b3; border-radius: 12px; resize: vertical; }
/* Das Formular ist länger als ein Handy hoch ist: es rollt in sich, nicht die Seite dahinter. */
.dialog--form { width: min(460px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; }
.dialog--form label, .dialog--form legend { margin-top: 12px; }
.dialog--form h3 { margin-bottom: 0; }
.sizePick { border: 0; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.sizePick legend { width: 100%; font-size: .85rem; color: #666; margin: 0 0 4px; }
.sizePick label { flex: 1; margin: 0; position: relative; }
.sizePick input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.sizePick span { display: block; text-align: center; font-weight: 700; font-size: 1.1rem; color: #999; padding: 9px 4px; border: 2px solid #ffd9b3; border-radius: 12px; }
.sizePick input:checked + span { background: #ff7a00; border-color: #ff7a00; color: #fff; }
.sizePick input:focus-visible + span { box-shadow: 0 0 0 3px rgba(255,122,0,.35); }
.dialog--form .dialogButtons { position: sticky; bottom: -20px; margin: 16px -20px -20px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #ffe9d4; }
.dialogButtons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.error { color: #c0392b; font-size: .85rem; margin-top: 8px; }

.panel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1001; max-width: 520px; margin: 0 auto; background: #fff; border-radius: 20px 20px 0 0; box-shadow: 0 -6px 24px rgba(0,0,0,.22); padding: 14px 16px calc(12px + env(safe-area-inset-bottom)); }
.panelHead { display: flex; justify-content: space-between; align-items: center; color: #d96500; }
.panelLabel { font-size: .8rem; color: #888; margin: 10px 0 6px; }
.panelNote { font-size: .8rem; color: #666; margin-top: 8px; line-height: 1.4; }
.statusButtons { display: flex; gap: 6px; }
.panel #logout { display: block; margin: 8px auto 0; }
body.panelOpen footer { padding-bottom: 360px; }
