:root {
  --bg: #f4f5f2; --card: #fff; --text: #1d2019; --muted: #6b7063; --line: #e3e5de;
  --accent: #c9d22f; --accent-on: #1d2019; --dark: #1f2a1a;
  --go: #16a34a; --stop: #dc2626; --pause: #f59e0b; --blue: #2563eb;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: var(--blue); text-decoration: none; }
h1 { font-size: 22px; margin: 4px 0 12px; }
h2 { font-size: 17px; margin: 0 0 8px; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top, 0px) + 10px) 14px 10px; background: #fff; color: var(--text); border-bottom: 1px solid var(--line); }
.top img { height: 30px; }
.top #title { font-weight: 700; }
.grow { flex: 1; }
.icon { background: none; border: 0; color: inherit; font-size: 22px; padding: 4px 6px; }
.pill { background: var(--accent); color: var(--accent-on); font-weight: 700; border-radius: 99px; padding: 3px 10px; font-size: 14px; font-variant-numeric: tabular-nums; }
main { padding: 12px 12px calc(84px + var(--safe-b)); max-width: 640px; margin: 0 auto; }
.card { background: var(--card); border-radius: 14px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 8px; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 9px; color: var(--muted); font-size: 12px; font-weight: 600; }
.tabs a span { font-size: 21px; line-height: 1; filter: grayscale(1); opacity: .7; }
.tabs a.on { color: var(--text); }
.tabs a.on span { filter: none; opacity: 1; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 12px; padding: 11px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.btn.block { display: flex; width: 100%; }
.btn.big { font-size: 20px; padding: 18px; border-radius: 16px; border: 0; flex-direction: column; gap: 2px; }
.btn .sub { font-size: 14px; font-weight: 600; opacity: .9; }
.btn.go { background: var(--go); color: #fff; border-color: var(--go); }
.btn.stop { background: var(--stop); color: #fff; border-color: var(--stop); }
.btn.pause { background: var(--pause); color: #fff; border-color: var(--pause); }
.btn.primary { background: var(--accent); color: var(--accent-on); border-color: var(--accent); }
.btn.sm { padding: 7px 10px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: .5; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input, select, textarea { width: 100%; font: inherit; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); }
textarea { min-height: 90px; }
label.f { display: block; margin-bottom: 10px; }
label.f > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
/* Stempeluhr */
.clock { text-align: center; padding: 18px 14px; }
.clock .state { font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.clock .big { font-size: 46px; font-weight: 800; font-variant-numeric: tabular-nums; margin: 4px 0; }
.clock.in { background: #ecfdf3; } .clock.in .state { color: var(--go); }
.clock.paused { background: #fff7e6; } .clock.paused .state { color: #b45309; }
.where { font-size: 18px; font-weight: 700; }
.choice { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; font: inherit; color: inherit; }
.choice.sel { border-color: var(--go); background: #f0fdf4; }
.choice .t { font-weight: 700; }
.choice .s { font-size: 13px; color: var(--muted); }
.choice .tick { margin-left: auto; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); flex-shrink: 0; }
.choice.sel .tick { background: var(--go); border-color: var(--go); box-shadow: inset 0 0 0 4px #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 2px solid var(--line); background: #fff; border-radius: 99px; padding: 8px 14px; font: inherit; font-weight: 600; font-size: 14px; color: inherit; }
.chip.sel { border-color: var(--go); background: #f0fdf4; }
.warn { background: #fff7e6; border: 1px solid #fcd34d; color: #92400e; border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; font-size: 14px; }
.err { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; font-size: 14px; }
.ok { background: #ecfdf3; border: 1px solid #a7f3d0; color: #065f46; border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; font-size: 14px; }
.line { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: #eef0ea; color: var(--muted); }
.tag.today { background: var(--accent); color: var(--accent-on); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.empty { text-align: center; color: var(--muted); padding: 24px 10px; }
/* Bottom-Sheet */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 14px 14px calc(18px + var(--safe-b)); }
.sheet-head { display: flex; align-items: center; margin-bottom: 10px; }
.sheet-head h2 { margin: 0; flex: 1; }
#toast { position: fixed; left: 12px; right: 12px; bottom: calc(80px + var(--safe-b)); z-index: 30; background: var(--dark); color: #fff; padding: 12px 14px; border-radius: 12px; text-align: center; font-weight: 600; }
#toast.bad { background: var(--stop); }
/* Material */
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 20px; font-weight: 700; }
.qty input { width: 64px; text-align: center; padding: 8px 4px; }
.scanbox { position: relative; background: #000; border-radius: 14px; overflow: hidden; aspect-ratio: 4/3; margin-bottom: 10px; }
.scanbox video { width: 100%; height: 100%; object-fit: cover; }
.scanbox::after { content: ""; position: absolute; left: 12%; right: 12%; top: 45%; height: 2px; background: #ef4444; box-shadow: 0 0 8px #ef4444; }
.badge-off { background: #fde68a; color: #78350f; font-size: 13px; font-weight: 700; text-align: center; padding: 6px; }
.ins-wrap { padding: 0; }
