/* 📝 Arbeitszettel – Apple-Stil, Magenta als Akzent */
:root {
  --brand: #e20074; --brand-d: #b8005e; --brand-soft: rgba(226,0,116,.09);
  --bg: #f2f2f7; --card: #fff; --text: #1d1d1f; --text-2: #6e6e73; --text-3: #aeaeb2; --sep: rgba(60,60,67,.12); --fill: rgba(118,118,128,.12);
  --green: #34c759; --red: #ff3b30; --orange: #ff9500; --r: 14px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --sab: env(safe-area-inset-bottom, 0px); --sat: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.35 var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
#app { max-width: 720px; margin: 0 auto; padding: calc(var(--sat) + 8px) 16px calc(var(--sab) + 110px); }
.brandbar { position: fixed; top: 0; left: 0; right: 0; height: 4px; background: var(--brand); z-index: 50; }

/* Kopfzeile */
.nav { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin: 4px -4px 0; }
.nav button { border: 0; background: none; color: var(--brand); font-size: 17px; padding: 8px 6px; display: flex; align-items: center; gap: 2px; }
.nav button:disabled { opacity: .3; }
.nav .t { font-weight: 600; font-size: 17px; }
.nav .ic { font-size: 22px; line-height: 1; }
h1.big { font-size: 34px; letter-spacing: -.02em; margin: 2px 0 14px; font-weight: 700; }
h1.big small { display: block; font-size: 15px; font-weight: 500; color: var(--text-2); letter-spacing: 0; margin-top: 2px; }
.label { margin: 22px 16px 7px; font-size: 13px; text-transform: uppercase; letter-spacing: .02em; color: var(--text-2); display: flex; justify-content: space-between; align-items: baseline; }
.label b { color: var(--brand); font-weight: 600; text-transform: none; letter-spacing: 0; font-size: 15px; }
.foot { margin: 7px 16px 0; font-size: 13px; color: var(--text-2); }

/* Gruppen (Apple-Listen) */
.group { background: var(--card); border-radius: var(--r); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; min-height: 48px; 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); }
.row.ind + .row::before, .row.ind::before { left: 60px; }
.row > .main { flex: 1; min-width: 0; }
.row > .main b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row > .main small { display: block; color: var(--text-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .chev { color: var(--text-3); font-size: 20px; }
.row .val { color: var(--text-2); }
button.row:active { background: #e5e5ea; }
.field { display: flex; align-items: center; gap: 12px; padding: 0 16px; min-height: 48px; position: relative; }
.field + .field::before, .field + .row::before, .row + .field::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--sep); }
.field span { width: 100px; flex: none; color: var(--text); }
.field input, .field select { flex: 1; min-width: 0; border: 0; outline: 0; background: none; padding: 12px 0; font-size: 17px; }
.field input::placeholder, textarea::placeholder { color: var(--text-3); }
textarea.area { display: block; width: 100%; border: 0; outline: 0; background: var(--card); padding: 12px 16px; font-size: 17px; resize: none; min-height: 90px; }
.badge { flex: none; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--fill); color: var(--text-2); }
.badge.laeuft { background: rgba(52,199,89,.15); color: #248a3d; } .badge.beendet { background: rgba(255,149,0,.15); color: #c93400; } .badge.unterschrieben { background: var(--brand-soft); color: var(--brand); } .badge.versendet { background: var(--fill); color: var(--text-2); }
.dot { width: 36px; height: 36px; border-radius: 10px; flex: none; display: grid; place-items: center; font-size: 18px; background: var(--brand-soft); color: var(--brand); }

/* Knöpfe */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border: 0; border-radius: var(--r); padding: 15px 18px; font-size: 17px; font-weight: 600; background: var(--card); color: var(--brand); transition: transform .12s, opacity .2s; }
.btn:active { transform: scale(.98); opacity: .85; }
.btn.pri { background: var(--brand); color: #fff; }
.btn.go { background: var(--green); color: #fff; } .btn.stop { background: var(--red); color: #fff; } .btn.dark { background: var(--text); color: #fff; }
.btn.sm { padding: 10px 14px; font-size: 15px; width: auto; }
.btn:disabled { opacity: .4; }
.btn + .btn { margin-top: 10px; }
.danger { color: var(--red) !important; }
.bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(var(--sab) + 12px); background: rgba(242,242,247,.86); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-top: .5px solid var(--sep); z-index: 20; }
.bar > div { max-width: 688px; margin: 0 auto; display: flex; gap: 10px; } .bar .btn + .btn { margin-top: 0; }

/* Timer */
.timer { background: var(--card); border-radius: 20px; padding: 18px 18px 16px; display: flex; align-items: center; gap: 14px; }
.timer .clock { font-size: 44px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.timer .meta { flex: 1; } .timer .meta small { display: block; color: var(--text-2); font-size: 14px; margin-top: 4px; }
.pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(52,199,89,.6); animation: pl 1.6s infinite; flex: none; } @keyframes pl { 70% { box-shadow: 0 0 0 10px rgba(52,199,89,0); } 100% { box-shadow: 0 0 0 0 rgba(52,199,89,0); } }
.pulse.off { background: var(--text-3); animation: none; }

/* Tätigkeiten */
.add { display: flex; gap: 8px; padding: 8px 8px 8px 16px; align-items: flex-end; }
.add textarea { flex: 1; border: 0; outline: 0; resize: none; font-size: 17px; padding: 8px 0; min-height: 40px; max-height: 160px; background: none; }
.add button { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; font-size: 22px; line-height: 1; }
.add button:disabled { background: var(--fill); color: var(--text-3); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 2px; scrollbar-width: none; margin: 0 -16px; padding-left: 16px; padding-right: 16px; } .chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 0; background: var(--card); border-radius: 99px; padding: 8px 13px; font-size: 14px; font-weight: 500; color: var(--text); box-shadow: 0 0 0 .5px var(--sep); }
.chip.on { background: var(--brand); color: #fff; }
.entry { display: flex; gap: 12px; padding: 12px 10px 12px 16px; position: relative; }
.entry + .entry::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--sep); }
.entry time { flex: none; width: 44px; color: var(--text-2); font-size: 14px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.entry p { flex: 1; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.x { flex: none; border: 0; background: none; color: var(--text-3); font-size: 18px; width: 32px; height: 28px; }

/* Fotos */
.cam { display: flex; align-items: center; gap: 14px; width: 100%; border: 0; border-radius: var(--r); padding: 16px; background: var(--brand); color: #fff; text-align: left; }
.cam .ic { width: 46px; height: 46px; border-radius: 12px; background: rgba(255,255,255,.2); display: grid; place-items: center; font-size: 24px; flex: none; }
.cam b { display: block; font-size: 17px; } .cam small { font-size: 14px; opacity: .85; }
.photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; }
.ph { background: var(--card); border-radius: var(--r); overflow: hidden; border: 0; padding: 0; text-align: left; position: relative; }
.ph img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #e5e5ea; }
.ph div { padding: 8px 10px 10px; } .ph b { display: block; font-size: 15px; } .ph small { display: block; color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph .up { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 3px 8px; border-radius: 99px; }

/* Sheets */
.sheet-root { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet-root .bd { position: absolute; inset: 0; background: rgba(0,0,0,.35); animation: fade .25s; }
.sheet-root .sh { position: relative; width: 100%; max-width: 720px; max-height: 92dvh; overflow: auto; background: var(--bg); border-radius: 14px 14px 0 0; padding: 8px 16px calc(var(--sab) + 18px); animation: up .32s cubic-bezier(.2,.9,.3,1); }
.sh .grab { width: 36px; height: 5px; border-radius: 3px; background: var(--text-3); margin: 0 auto 8px; }
.sh h2 { font-size: 20px; margin: 6px 0 4px; text-align: center; }
.sh .prev { width: 100%; border-radius: var(--r); display: block; margin: 8px 0; max-height: 46dvh; object-fit: contain; background: #000; }
@keyframes up { from { transform: translateY(100%); } } @keyframes fade { from { opacity: 0; } }

/* Unterschrift */
.sig-root { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: flex; flex-direction: column; padding: calc(var(--sat) + 10px) 16px calc(var(--sab) + 12px); }
.sig-root .top { display: flex; align-items: center; justify-content: space-between; } .sig-root .top button { border: 0; background: none; color: var(--brand); font-size: 17px; padding: 8px 4px; }
.sig-root .top b { font-size: 17px; }
.sig-root .info { color: var(--text-2); font-size: 15px; margin: 6px 2px 10px; }
.sig-pad { position: relative; flex: 1; min-height: 200px; background: #fff; border-radius: 18px; box-shadow: inset 0 0 0 1px var(--sep); overflow: hidden; touch-action: none; }
.sig-pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.sig-pad .line { position: absolute; left: 7%; right: 7%; bottom: 26%; border-bottom: 1.5px solid #d1d1d6; pointer-events: none; }
.sig-pad .x0 { position: absolute; left: 7%; bottom: calc(26% + 6px); color: var(--text-3); font-size: 22px; pointer-events: none; }
.sig-pad .hint { position: absolute; left: 0; right: 0; bottom: 12%; text-align: center; color: var(--text-3); font-size: 14px; pointer-events: none; }
.sig-root .name { margin-top: 10px; }
.sig-root .acts { display: flex; gap: 10px; margin-top: 10px; } .sig-root .acts .btn + .btn { margin-top: 0; }

/* Login */
.hero { text-align: center; padding: 10vh 8px 24px; }
.hero .logo { width: 84px; height: 84px; border-radius: 22px; margin: 0 auto 16px; background: var(--brand); display: grid; place-items: center; color: #fff; font-size: 40px; box-shadow: 0 10px 30px rgba(226,0,116,.3); }
.hero h1 { font-size: 30px; margin: 0 0 6px; letter-spacing: -.02em; } .hero p { color: var(--text-2); margin: 0; }
.empty { text-align: center; color: var(--text-2); padding: 36px 20px; } .empty div { font-size: 46px; margin-bottom: 6px; }
.seg { display: flex; background: var(--fill); border-radius: 9px; padding: 2px; margin: 0 0 12px; } .seg button { flex: 1; border: 0; background: none; border-radius: 7px; padding: 6px; font-size: 13px; font-weight: 600; }
.seg button.on { background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.12); }
.search { display: flex; align-items: center; gap: 6px; background: var(--fill); border-radius: 10px; padding: 0 10px; margin-bottom: 12px; } .search input { flex: 1; border: 0; background: none; outline: 0; padding: 9px 0; font-size: 17px; }
.logo-prev { max-height: 44px; max-width: 160px; border-radius: 6px; }
.sync { position: fixed; top: calc(var(--sat) + 10px); left: 50%; transform: translateX(-50%); z-index: 55; background: rgba(29,29,31,.85); color: #fff; font-size: 13px; padding: 6px 12px; border-radius: 99px; pointer-events: none; }
#toast { position: fixed; left: 50%; bottom: calc(var(--sab) + 96px); transform: translateX(-50%) translateY(20px); opacity: 0; transition: all .3s; background: rgba(29,29,31,.92); color: #fff; padding: 11px 18px; border-radius: 14px; font-size: 15px; z-index: 90; max-width: 90vw; text-align: center; pointer-events: none; }
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.done { text-align: center; padding: 6vh 10px 10px; } .done .ok { width: 78px; height: 78px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 40px; margin: 0 auto 14px; animation: pop .5s cubic-bezier(.2,1.6,.4,1); } @keyframes pop { from { transform: scale(.3); opacity: 0; } }
@media (prefers-color-scheme: dark) {
  :root { --bg: #000; --card: #1c1c1e; --text: #f5f5f7; --text-2: #98989d; --text-3: #636366; --sep: rgba(84,84,88,.6); --fill: rgba(118,118,128,.24); --brand-soft: rgba(226,0,116,.2); }
  button.row:active { background: #2c2c2e; } .seg button.on { background: #636366; } .bar { background: rgba(0,0,0,.8); }
  .sig-pad { background: #fff; }
}
