:root {
  --ink: #13202E;
  --muted: #4A5565;
  --ground: #EEF1F4;
  --surface: #FFFFFF;
  --line: #D5DCE4;
  --line-soft: #E4E9EF;
  --field: #B8C2CE;
  --primary: #1C3F8C;
  --primary-dark: #132C63;
  --primary-soft: #DCE5F5;
  --ok: #0F6B4A;
  --ok-ink: #0B5238;
  --ok-soft: #E1F1E8;
  --warn: #8A4B00;
  --warn-ink: #7A4100;
  --warn-soft: #FFEFD6;
  --bad: #A8231B;
  --bad-ink: #7D1A14;
  --bad-soft: #FBE3E0;
  --grey-soft: #E4E9EF;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--sans); -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; min-height: 100dvh; }
button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }

/* ---------- staff app shell ---------- */
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.screen { flex: 1; display: flex; flex-direction: column; gap: 22px; padding: calc(env(safe-area-inset-top) + 40px) 22px calc(env(safe-area-inset-bottom) + 28px); }
.screen.tight { gap: 16px; padding-top: calc(env(safe-area-inset-top) + 28px); }
.with-nav { padding-bottom: 20px; }
.push { margin-top: auto; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
h1 { margin: 0; font-size: 26px; line-height: 1.25; font-weight: 700; }
.lead { margin: 0; font-size: 16px; line-height: 1.55; color: var(--muted); }
.small { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.tiny { font-size: 13px; color: var(--muted); }
.eyebrow { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
strong.ink { color: var(--ink); }

.badge-icon { width: 72px; height: 72px; border-radius: 36px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.badge-icon.big { width: 96px; height: 96px; border-radius: 48px; }
.tone-blue { background: var(--primary-soft); color: var(--primary); }
.tone-ok { background: var(--ok-soft); color: var(--ok); }
.tone-warn { background: var(--warn-soft); color: var(--warn); }
.tone-bad { background: var(--bad-soft); color: var(--bad); }
.tone-grey { background: var(--grey-soft); color: #33404F; }
.solid-ok { background: var(--ok); color: #fff; }
.solid-ink { background: var(--ink); color: #fff; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.card.pad { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; font-size: 15px; border-bottom: 1px solid var(--line-soft); }
.kv:last-child { border-bottom: 0; }
.kv > span:first-child { color: var(--muted); }
.kv > span:last-child { font-weight: 600; text-align: right; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok-ink); }
.chip.warn { background: var(--warn-soft); color: var(--warn-ink); }
.chip.bad { background: var(--bad-soft); color: var(--bad-ink); }
.chip.grey { background: var(--grey-soft); color: #33404F; }
.chip.blue { background: var(--primary-soft); color: var(--primary-dark); }

.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; font-size: 14px; line-height: 1.45; }
.note svg { flex-shrink: 0; margin-top: 1px; }

.btn { height: 54px; border: 0; border-radius: 12px; background: var(--primary); color: #fff; font-size: 17px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; width: 100%; text-decoration: none; padding: 0 16px; }
.btn:hover { background: var(--primary-dark); color: #fff; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.big { height: 64px; border-radius: 14px; font-size: 18px; }
.btn.dark { background: var(--ink); }
.btn.dark:hover { background: #0B141E; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--field); font-weight: 500; font-size: 16px; height: 50px; }
.btn.ghost:hover { background: #F6F8FA; color: var(--ink); }
.btn.danger { background: var(--bad); }
.linkbtn { background: none; border: 0; padding: 10px 4px; min-height: 44px; color: var(--primary); font-weight: 600; font-size: 15px; cursor: pointer; }
.iconbtn { width: 44px; height: 44px; border: 0; border-radius: 22px; background: none; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: inherit; }
.iconbtn:hover { background: rgba(0,0,0,.06); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.input { height: 52px; border: 1px solid var(--field); border-radius: 10px; padding: 0 14px; font-size: 17px; background: var(--surface); width: 100%; }
.input.mono { font-family: var(--mono); letter-spacing: .04em; }
.input:focus, select:focus, .btn:focus-visible, .linkbtn:focus-visible, .iconbtn:focus-visible { outline: 3px solid #5B8DEF; outline-offset: 2px; }
.error-text { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--bad-soft); color: var(--bad-ink); font-size: 14px; line-height: 1.45; }
.ok-text { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--ok-soft); color: var(--ok-ink); font-size: 14px; line-height: 1.45; }

.steps { display: flex; flex-direction: column; }
.steps > div { display: flex; gap: 12px; padding: 15px 16px; border-bottom: 1px solid var(--line-soft); font-size: 15px; line-height: 1.5; }
.steps > div:last-child { border-bottom: 0; }
.steps > div > b { font-family: var(--mono); color: var(--primary); }

.status-dot { width: 10px; height: 10px; border-radius: 5px; flex-shrink: 0; }

.timer-card { display: flex; flex-direction: column; gap: 6px; align-items: center; background: var(--ok); color: #fff; border-radius: 16px; padding: 24px 18px; }
.timer-card .t { font-family: var(--mono); font-size: 46px; font-weight: 600; letter-spacing: -.02em; }
.timer-card .s { font-size: 14px; color: #CDEBDD; }

.bignum { font-family: var(--mono); font-size: 44px; font-weight: 600; letter-spacing: -.02em; margin: -6px 0 0; }
.center { align-items: center; text-align: center; }

.tabs { display: flex; border-top: 1px solid var(--line); background: var(--surface); padding-bottom: env(safe-area-inset-bottom); position: sticky; bottom: 0; }
.tabs button { flex: 1; height: 64px; border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 500; cursor: pointer; }
.tabs button.on { color: var(--primary); font-weight: 600; }

.list-row { display: flex; justify-content: space-between; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--line-soft); gap: 10px; }
.list-row:last-child { border-bottom: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.stat span:first-child { font-size: 12px; color: var(--muted); }
.stat span:last-child { font-family: var(--mono); font-size: 20px; font-weight: 600; }

/* scanner */
.scanner { position: fixed; inset: 0; background: #0B1118; color: #fff; display: flex; flex-direction: column; align-items: center; padding: calc(env(safe-area-inset-top) + 16px) 20px calc(env(safe-area-inset-bottom) + 24px); gap: 20px; z-index: 10; }
.scanner .top { align-self: stretch; display: flex; justify-content: space-between; align-items: center; max-width: 480px; width: 100%; margin: 0 auto; }
.scanner .top .iconbtn { background: #1E2935; color: #fff; }
.scanner .frame { position: relative; width: min(78vw, 320px); aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #16202B; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner .corner { position: absolute; width: 44px; height: 44px; border: 4px solid #fff; }
.scanner .c1 { left: 0; top: 0; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.scanner .c2 { right: 0; top: 0; border-left: 0; border-bottom: 0; border-radius: 0 10px 0 0; }
.scanner .c3 { left: 0; bottom: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 10px; }
.scanner .c4 { right: 0; bottom: 0; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.scanner .hint { margin: 12px 0 0; font-size: 17px; line-height: 1.5; text-align: center; color: #D6DEE8; }
.scanner .bar { margin-top: auto; width: 100%; max-width: 440px; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-radius: 12px; background: #16202B; font-size: 14px; }
.scanner .bar span:last-child { color: #B5C1CF; }
.busy { position: fixed; inset: 0; background: rgba(11,17,24,.82); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; z-index: 20; font-size: 17px; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid rgba(255,255,255,.25); border-top-color: #fff; animation: spin 0.9s linear infinite; }
.spinner.dark { border-color: rgba(19,32,46,.15); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

.loading { flex: 1; display: flex; align-items: center; justify-content: center; }

/* ---------- Bakreme Hub additions ---------- */
textarea.input { height: auto; min-height: 96px; padding: 12px 14px; line-height: 1.45; resize: vertical; }
select.input { appearance: auto; }
.tabs button { font-size: 11px; }
.task { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.task:last-child { border-bottom: 0; }
.task .tick { width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; border: 2px solid var(--field); background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #fff; margin-top: -4px; }
.task .tick.on { background: var(--ok); border-color: var(--ok); }
.task .tick:disabled { opacity: .6; }
.task .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.task .t { font-size: 16px; font-weight: 600; line-height: 1.35; }
.task.done .t { color: var(--muted); text-decoration: line-through; }
.task .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 14px; line-height: 1.45; cursor: pointer; border: 0; text-align: left; width: 100%; font-family: inherit; }
.progress { height: 8px; border-radius: 4px; background: var(--grey-soft); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--ok); border-radius: 4px; }
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 84px); transform: translateX(-50%); z-index: 40; padding: 12px 16px; border-radius: 12px; font-size: 15px; font-weight: 500; box-shadow: 0 8px 24px rgba(19,32,46,.22); max-width: calc(100vw - 32px); width: max-content; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.team-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--line-soft); }
.team-row:last-child { border-bottom: 0; }
