/* Subtilitas. Plain CSS, no build step, cached by the service worker. */
:root {
  --ink: #14181f;
  --ink-soft: #4a5260;
  --line: #d5d9e0;
  --paper: #ffffff;
  --page: #f3f4f6;
  --brand: #1d2733;
  --brand-ink: #ffffff;
  --go: #ffc20e;       /* hi-vis yellow, primary action */
  --go-ink: #14181f;
  --ok: #1d7a46;
  --ok-soft: #e3f4ea;
  --warn: #b3261e;
  --warn-soft: #fdecea;
  --info-soft: #e8f0fb;
  --radius: 10px;
  --tap: 64px;          /* minimum target for gloved hands */
  font-size: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--page);
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}
a { color: #0b57d0; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 .6rem; }
h2 { font-size: 1.25rem; margin: 1.4rem 0 .6rem; }
h3 { font-size: 1.05rem; margin: 1rem 0 .4rem; }
p { margin: 0 0 .8rem; }
img, video { max-width: 100%; height: auto; display: block; }

.topbar {
  background: var(--brand); color: var(--brand-ink);
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding: .6rem 16px;
}
.topbar .brand { font-weight: 800; letter-spacing: .02em; color: var(--brand-ink); text-decoration: none; font-size: 1.1rem; }
.topbar .who { margin-left: auto; font-size: .85rem; opacity: .85; }
.nav { display: flex; gap: .25rem; flex-wrap: wrap; padding: .4rem 12px; background: #2a3644; }
.nav a { color: #fff; text-decoration: none; padding: .55rem .7rem; border-radius: 8px; font-size: .95rem; }
.nav a.on, .nav a:hover { background: rgba(255,255,255,.14); }
.nav form { margin: 0; }
.nav button.linklike { color: #fff; background: none; border: 0; font: inherit; font-size: .95rem; padding: .55rem .7rem; cursor: pointer; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 16px; }
.narrow { max-width: 560px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.muted { color: var(--ink-soft); }
.small { font-size: .85rem; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.row.spread { justify-content: space-between; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.stat { font-size: 1.8rem; font-weight: 800; }

.notice { border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; background: var(--info-soft); border: 1px solid #c4d6f2; }
.notice.ok { background: var(--ok-soft); border-color: #b5dec5; }
.notice.bad { background: var(--warn-soft); border-color: #f2c1bc; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 48px; padding: .55rem 1rem; border-radius: var(--radius);
  border: 2px solid var(--ink); background: var(--paper); color: var(--ink);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn.primary { background: var(--go); border-color: var(--go); color: var(--go-ink); }
.btn.dark { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.danger { border-color: var(--warn); color: var(--warn); }
.btn.big { min-height: var(--tap); font-size: 1.15rem; padding: .8rem 1.4rem; }
.btn.block { display: flex; width: 100%; }
.btn[disabled], .btn.off { opacity: .45; pointer-events: none; }
button.linklike { background: none; border: 0; color: #0b57d0; text-decoration: underline; font: inherit; cursor: pointer; padding: 0; }

form .field { margin-bottom: 14px; }
label { display: block; font-weight: 700; margin-bottom: 4px; }
.hint { font-size: .85rem; color: var(--ink-soft); margin-top: 3px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; font: inherit; padding: .7rem .75rem; border: 2px solid var(--line); border-radius: 8px; background: #fff; min-height: 52px;
}
textarea { min-height: 130px; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--go); border-color: var(--ink); }
.error { color: var(--warn); font-size: .9rem; margin-top: 4px; }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
.check input { width: 26px; height: 26px; }

table.list { width: 100%; border-collapse: collapse; background: #fff; }
table.list th, table.list td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { font-size: .85rem; color: var(--ink-soft); }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }

.pill { display: inline-block; font-size: .78rem; font-weight: 700; padding: .15rem .55rem; border-radius: 99px; background: #e6e8ec; }
.pill.live { background: var(--ok-soft); color: var(--ok); }
.pill.draft { background: #fff3cd; color: #7a5a00; }
.pill.warn { background: var(--warn-soft); color: var(--warn); }

.steps-list { list-style: none; margin: 0; padding: 0; }
.steps-list li { display: flex; gap: .75rem; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.steps-list .num { flex: 0 0 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; }
.steps-list .body { flex: 1; min-width: 0; }
.steps-list .tools { display: flex; gap: .3rem; flex-wrap: wrap; }
.steps-list .tools .btn { min-height: 44px; padding: .3rem .7rem; }

.warning-box { border: 3px solid var(--warn); background: var(--warn-soft); border-radius: var(--radius); padding: 12px 14px; font-weight: 700; margin-bottom: 14px; }
.warning-box::before { content: attr(data-label); display: block; text-transform: uppercase; font-size: .8rem; letter-spacing: .08em; color: var(--warn); margin-bottom: 2px; }

.footer-note { font-size: .8rem; color: var(--ink-soft); text-align: center; padding: 16px; }

/* Worker app */
.worker { min-height: 100vh; display: flex; flex-direction: column; }
.worker main { flex: 1; padding: 16px; max-width: 720px; width: 100%; margin: 0 auto; padding-bottom: 120px; }
.statusbar { font-size: .85rem; padding: 6px 16px; background: #2a3644; color: #fff; display: flex; gap: .75rem; flex-wrap: wrap; }
.statusbar .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #9aa3ad; margin-right: 4px; }
.statusbar .dot.on { background: #3ccf7a; }
.statusbar .dot.off { background: #ffc20e; }
.biglist { list-style: none; padding: 0; margin: 0; }
.biglist a, .biglist button {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem; width: 100%;
  min-height: var(--tap); padding: .8rem 1rem; margin-bottom: 10px;
  background: #fff; border: 2px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none; font: inherit; font-weight: 700; text-align: left; cursor: pointer;
}
.biglist .sub { display: block; font-weight: 400; font-size: .85rem; color: var(--ink-soft); }
.stepbar {
  position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 2px solid var(--line);
  display: grid; grid-template-columns: 1fr 2fr; gap: 10px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.stepbar .btn { min-height: 72px; font-size: 1.25rem; }
.progress { height: 10px; background: #e1e4e8; border-radius: 99px; overflow: hidden; margin: 6px 0 14px; }
.progress span { display: block; height: 100%; background: var(--go); }
.step-title { font-size: 1.5rem; margin: .2rem 0 .8rem; }
.step-body { font-size: 1.2rem; white-space: pre-wrap; }
.step-media { margin: 0 0 14px; border-radius: var(--radius); overflow: hidden; background: #000; }
.scanner video { width: 100%; border-radius: var(--radius); background: #000; }

@media print {
  .topbar, .nav, .noprint { display: none !important; }
  body { background: #fff; }
}
@media (min-width: 720px) {
  :root { font-size: 17px; }
}

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 420px; }
.keypad .btn { min-height: 80px; font-size: 1.6rem; padding: .4rem; }
.keypad .btn.word { font-size: 1rem; overflow-wrap: anywhere; }
.pin-dots { font-size: 2.2rem; letter-spacing: .3em; margin: .4rem 0; }
.footer-note p { margin: 0 0 8px; }
.lang-pick { display: inline-flex; gap: .5rem; align-items: center; justify-content: center; }
.lang-pick label { margin: 0; font-weight: 400; }
.lang-pick select { width: auto; min-height: 40px; }
.ai-working { display: flex; gap: 14px; align-items: center; }
.ai-working p { margin: 0 0 4px; }
.spinner { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; border: 4px solid #e1e4e8; border-top-color: var(--go); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
