/* Worker phone screen: big targets, high contrast, few words. Light theme only (bright workshop). */
:root {
  --bg: #f3efe6;
  --card: #ffffff;
  --ink: #141414;
  --ink-2: #4a4a4a;
  --line: #d9d2c3;
  --brand: #1d3a2f;
  --brand-ink: #ffffff;
  --ok: #0f7a3d;
  --ok-dark: #0a5c2d;
  --ok-soft: #e1f3e7;
  --bad: #c62828;
  --bad-soft: #fde7e7;
  --brak: #c75a00;
  --brak-soft: #fff0e0;
  --muted-tile: #ebe6db;
  --radius: 18px;
  --shadow: 0 2px 0 rgba(0, 0, 0, .06), 0 6px 18px rgba(60, 45, 20, .08);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-size: 20px; line-height: 1.3; min-height: 100vh; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
.ic { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.app { max-width: 560px; margin: 0 auto; padding: 0 16px calc(120px + env(safe-area-inset-bottom)); }
.loading { padding: 40vh 0; text-align: center; color: var(--ink-2); }

/* top bar */
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; margin: 0 -16px 16px;
  padding: 12px 16px; background: var(--brand); color: var(--brand-ink); min-height: 68px; }
.bar h1 { font-size: 22px; margin: 0; flex: 1; line-height: 1.15; }
.bar .sub { display: block; font-size: 15px; font-weight: 500; opacity: .8; }
.bar-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 52px; height: 52px;
  border-radius: 14px; background: rgba(255, 255, 255, .14); font-size: 16px; font-weight: 600; padding: 0 12px; }
.bar-btn .ic { font-size: 26px; }
.stage-dot { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; color: #fff; flex: 0 0 auto;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); }

/* who are you */
.who-title { font-size: 26px; font-weight: 800; margin: 8px 0 14px; }
.people { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.person { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 12px; min-height: 150px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; border: 2px solid transparent; }
.person:active { transform: scale(.98); }
.person .stage-dot { width: 64px; height: 64px; font-size: 34px; box-shadow: none; }
.person b { font-size: 21px; }
.person span { font-size: 16px; color: var(--ink-2); font-weight: 600; }
.person.boss { background: var(--brand); color: #fff; grid-column: 1 / -1; min-height: 96px; flex-direction: row; gap: 14px; }
.person.boss span { color: rgba(255, 255, 255, .8); }
.person.boss .stage-dot { background: rgba(255, 255, 255, .15); width: 56px; height: 56px; }

/* pin */
.pin-box { text-align: center; padding-top: 6px; }
.pin-box .stage-dot { margin: 0 auto 10px; width: 72px; height: 72px; font-size: 38px; box-shadow: none; }
.pin-box h2 { margin: 0 0 4px; font-size: 26px; }
.pin-hint { color: var(--ink-2); font-size: 18px; margin: 0 0 18px; }
.dots { display: flex; justify-content: center; gap: 18px; margin: 0 0 20px; }
.dots i { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--ink); }
.dots i.on { background: var(--ink); }
.dots.shake { animation: shake .35s; }
.dots.shake i { border-color: var(--bad); }
@keyframes shake { 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }
.pin-err { color: var(--bad); font-weight: 700; min-height: 28px; margin-bottom: 8px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.key { height: 74px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); font-size: 32px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; }
.key:active { background: var(--muted-tile); }
.key.soft { background: transparent; box-shadow: none; font-size: 20px; color: var(--ink-2); }
.key .ic { font-size: 32px; }

/* home */
.sum { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.sum-l { font-size: 18px; font-weight: 700; color: var(--ink-2); }
.sum-big { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sum-big b { font-size: 64px; line-height: 1; font-weight: 800; letter-spacing: -1px; }
.sum-big .u { font-size: 24px; font-weight: 700; }
.sum-pay { font-size: 26px; font-weight: 800; color: var(--ok-dark); margin-top: 6px; }
.sum-week { display: flex; justify-content: space-between; gap: 8px; border-top: 2px dashed var(--line); margin-top: 14px; padding-top: 12px;
  font-size: 18px; font-weight: 700; color: var(--ink-2); flex-wrap: wrap; }
.sum-week b { color: var(--ink); }
.given { display: flex; align-items: center; gap: 12px; background: #e9f0ff; color: #12306b; border-radius: 14px; padding: 12px 16px; margin-bottom: 14px;
  font-size: 19px; font-weight: 700; }
.given .ic { font-size: 28px; }
.given b { font-size: 26px; }
.big-btn { width: 100%; min-height: 84px; border-radius: 20px; background: var(--ok); color: #fff; font-size: 28px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; gap: 12px; box-shadow: 0 4px 0 var(--ok-dark); margin-bottom: 18px; }
.big-btn .ic { font-size: 36px; stroke-width: 2.6; }
.big-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ok-dark); }
.h2 { font-size: 20px; font-weight: 800; margin: 18px 0 10px; color: var(--ink-2); }
.list { display: flex; flex-direction: column; gap: 8px; }
.row { background: var(--card); border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; border-left: 6px solid var(--ok); }
.row .t { font-size: 16px; color: var(--ink-2); font-weight: 700; min-width: 46px; }
.row .l { flex: 1; font-size: 18px; font-weight: 600; min-width: 0; }
.row .l small { display: block; font-size: 15px; color: var(--ink-2); font-weight: 600; }
.row .q { font-size: 24px; font-weight: 800; white-space: nowrap; }
.row.brak { border-left-color: var(--brak); }
.row.rad { border-left-color: var(--bad); background: var(--bad-soft); }
.row.void { opacity: .55; border-left-color: #999; }
.row.void .q { text-decoration: line-through; }
.undo { display: inline-flex; align-items: center; gap: 6px; height: 48px; padding: 0 12px; border-radius: 12px; background: var(--muted-tile); font-size: 16px; font-weight: 700; }
.undo .ic { font-size: 22px; }
.empty { color: var(--ink-2); text-align: center; padding: 18px; font-size: 18px; }

/* wizard */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 14px; }
.chip { display: inline-flex; align-items: center; gap: 8px; background: var(--card); border-radius: 999px; padding: 6px 14px 6px 8px; font-size: 18px; font-weight: 700;
  border: 2px solid var(--line); }
.chip .sw, .chip .ci { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; }
.q-title { font-size: 28px; font-weight: 800; margin: 4px 0 14px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { position: relative; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); min-height: 150px; padding: 14px 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 3px solid transparent; text-align: center; }
.tile:active { border-color: var(--ok); }
.tile .ic { font-size: 64px; stroke-width: 1.6; color: var(--brand); }
.tile b { font-size: 24px; }
.tile.wide { grid-column: 1 / -1; min-height: 92px; flex-direction: row; }
.tile.wide b { font-size: 28px; }
.tile .sw { width: 72px; height: 72px; border-radius: 50%; border: 3px solid rgba(0, 0, 0, .15); }
.badge { font-size: 17px; font-weight: 800; padding: 4px 12px; border-radius: 999px; background: var(--ok-soft); color: var(--ok-dark); }
.badge.zero { background: var(--muted-tile); color: #6b6b6b; }
.tile.zero { background: #f7f5ef; box-shadow: none; border-color: var(--line); }
.tile.zero .ic, .tile.zero .sw { opacity: .45; }

/* quantity */
.qty-box { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.qbtn { width: 84px; height: 96px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; flex: 0 0 auto; }
.qbtn .ic { font-size: 44px; stroke-width: 3; }
.qbtn:active { background: var(--muted-tile); }
.qty { flex: 1; height: 96px; border-radius: 18px; background: var(--card); border: 3px solid var(--ink); display: flex; align-items: center; justify-content: center;
  gap: 8px; font-size: 64px; font-weight: 800; }
.qty .u { font-size: 24px; font-weight: 700; color: var(--ink-2); }
.qty.over { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); }
.info { font-size: 20px; font-weight: 700; padding: 12px 14px; border-radius: 14px; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.info .ic { font-size: 28px; }
.info.ok { background: #e9f0ff; color: #12306b; }
.info.bad { background: var(--bad); color: #fff; font-size: 22px; }
.brak-tg { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 3px solid var(--line);
  font-size: 20px; font-weight: 700; margin: 12px 0 0; text-align: left; }
.brak-tg .box { width: 34px; height: 34px; border-radius: 8px; border: 3px solid var(--ink-2); display: grid; place-items: center; font-size: 26px; flex: 0 0 auto; }
.brak-tg.on { border-color: var(--brak); background: var(--brak-soft); color: #7a3700; }
.brak-tg.on .box { background: var(--brak); border-color: var(--brak); color: #fff; }
.save-wrap { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); z-index: 6; }
.save { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; max-width: 528px; margin: 0 auto; min-height: 84px; border-radius: 20px;
  background: var(--ok); color: #fff; font-size: 30px; font-weight: 800; box-shadow: 0 4px 0 var(--ok-dark); }
.save .ic { font-size: 38px; stroke-width: 3; }
.save.brak { background: var(--brak); box-shadow: 0 4px 0 #8f4100; }
.save.over { background: #8d8d8d; box-shadow: 0 4px 0 #616161; }
.save:disabled { opacity: .5; }

/* overlays */
.overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 24px; background: rgba(0, 0, 0, .55); }
.pop { width: 100%; max-width: 440px; border-radius: 24px; background: var(--card); padding: 28px 22px 22px; text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.pop .big-ic { width: 104px; height: 104px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center; font-size: 64px; color: #fff; }
.pop .big-ic .ic { stroke-width: 3; }
.pop.ok .big-ic { background: var(--ok); }
.pop.bad .big-ic { background: var(--bad); }
.pop h2 { margin: 0 0 8px; font-size: 32px; }
.pop p { margin: 0 0 18px; font-size: 22px; font-weight: 700; color: var(--ink-2); }
.pop.bad h2 { color: var(--bad); }
.pop .pop-btn { width: 100%; min-height: 72px; border-radius: 18px; background: var(--ink); color: #fff; font-size: 26px; font-weight: 800; }
.net { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); background: var(--bad); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 17px; font-weight: 700; z-index: 30; }
.overlay[hidden] { display: none; }
