/* Courier screens: made for one hand, outdoors, on a small phone.
   Toga's paper, ink and terracotta; big targets; no web fonts to download. */
:root {
  --paper: #F6F1E9; --sheet: #FFFFFF; --ink: #171614; --muted: #68645D; --rule: #DED8CF;
  --accent: #A65233; --accent-ink: #FFFFFF;
  --good: #2F7D57; --good-bg: #DDEFE4; --bad: #9E2A2A; --bad-bg: #F6DEDA;
  --wait: #3F5A87; --wait-bg: #E1E8F3; --cash: #7A5A12; --cash-bg: #F3E9D2;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--accent); }
h1 { font-size: 24px; margin: 0 0 12px; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
p { margin: 0 0 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.bar {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px;
  background: var(--ink); color: var(--paper); padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top));
}
.brand { color: var(--paper); font-weight: 700; text-decoration: none; margin-right: auto; }
.who { font-size: 14px; opacity: .8; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline { display: inline; margin: 0; }
.link { background: none; border: 0; color: var(--paper); font: inherit; font-size: 14px; text-decoration: underline; padding: 8px 0; cursor: pointer; }

.wrap { max-width: 640px; margin: 0 auto; padding: 16px; }
.card { display: block; background: var(--sheet); border: 1px solid var(--rule); border-radius: 10px; padding: 16px; margin-bottom: 12px; color: inherit; text-decoration: none; }
.narrow { max-width: 420px; margin: 24px auto; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.small { font-size: 15px; margin-top: 8px; }
.muted { color: var(--muted); }
.big { font-size: 20px; font-weight: 600; }
.ref { font-variant-numeric: tabular-nums; }
.section { margin-top: 24px; }
.empty { background: var(--sheet); border: 1px dashed var(--rule); border-radius: 10px; padding: 24px; text-align: center; color: var(--muted); }

.list { list-style: none; margin: 0; padding: 0; }
.list.done .card { opacity: .7; }
.delivery .leg { display: block; margin-top: 6px; }
.delivery .leg .muted { display: inline-block; min-width: 72px; font-size: 14px; }
.cash { color: var(--cash); font-weight: 700; }

.chip { font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; background: var(--wait-bg); color: var(--wait); }
.chip.s-delivered { background: var(--good-bg); color: var(--good); }
.chip.s-failed { background: var(--bad-bg); color: var(--bad); }

.stack { display: flex; flex-direction: column; gap: 8px; }
label { font-weight: 600; font-size: 15px; margin-top: 6px; }
input[type=tel], input[type=password], input[type=text] {
  font: inherit; font-size: 18px; padding: 14px; border: 1px solid var(--rule); border-radius: 8px; background: var(--sheet); width: 100%;
}
.btn {
  display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 12px 16px;
  border: 1px solid var(--ink); border-radius: 10px; background: var(--sheet); color: var(--ink);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; text-align: center;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); margin-top: 12px; }
.actions { display: grid; gap: 8px; margin-top: 12px; }
.alert { background: var(--bad-bg); color: var(--bad); padding: 12px; border-radius: 8px; margin: 12px 0; }
.flag { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--bad); }
.back { display: inline-block; padding: 8px 0; font-weight: 600; text-decoration: none; }
.note { background: var(--paper); border-radius: 8px; padding: 10px; }

.money { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: 10px; padding: 16px; margin: 12px 0; }
.money.collect { background: var(--cash-bg); color: var(--cash); }
.money.collect strong { font-size: 28px; }
.money.paid { background: var(--good-bg); color: var(--good); }

.items { list-style: none; margin: 0; padding: 0; }
.items li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.items li:last-child { border-bottom: 0; }

.foot { padding: 16px 16px 32px; }
.langs { display: flex; justify-content: center; gap: 8px; margin: 0; }
.langs button { font: inherit; font-size: 14px; min-width: 52px; min-height: 44px; border: 1px solid var(--rule); border-radius: 999px; background: var(--sheet); color: var(--ink); cursor: pointer; }
.langs button[aria-current="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---- Stage 2: actions, team screens ---- */
.wrap.wide { max-width: 1180px; }
.notice { background: var(--good-bg); color: var(--good); padding: 12px; border-radius: 8px; margin: 12px 0; }
.offline { margin: 0; background: var(--cash-bg); color: var(--cash); text-align: center; padding: 8px 16px; font-weight: 600; }
.synced { text-align: center; font-size: 13px; margin: 8px 0 0; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { padding: 4px 0; }
.small { font-size: 14px; }
.btn.big { min-height: 60px; font-size: 19px; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.tiny { min-height: 36px; padding: 4px 10px; display: inline-flex; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.link.dark { color: var(--ink); }
.next-action { border: 2px solid var(--ink); }
.next-action form + form { margin-top: 8px; }
.more summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.more[open] summary { margin-bottom: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { width: 22px; height: 22px; flex: none; margin-top: 2px; }
input.code { font-size: 32px; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
select, textarea, input[type=date], input[type=time], input[type=number], input[type=search], input[type=file], input[inputmode=decimal] {
  font: inherit; font-size: 16px; padding: 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--sheet); max-width: 100%;
}
textarea { width: 100%; min-height: 80px; }
.timer { font-size: 18px; }
.timer .countdown { font-size: 28px; font-variant-numeric: tabular-nums; }
.timer.over .countdown { color: var(--bad); }
.leg.next { font-weight: 600; }
.summary { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--rule); background: var(--sheet); color: var(--ink); font: inherit; text-decoration: none; cursor: pointer; }
.pill.on { background: var(--good-bg); color: var(--good); border-color: var(--good); }
.pill.off { background: var(--paper); color: var(--muted); }
.cash-pill strong { color: var(--cash); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.facts dt { color: var(--muted); font-size: 14px; }
.facts dd { margin: 0; }
ul.facts { display: flex; gap: 16px; }
.chip.s-awaiting_store, .chip.s-new { background: var(--cash-bg); color: var(--cash); }
.chip.s-refused, .chip.s-cancelled { background: var(--bad-bg); color: var(--bad); }
.chip.r-verified { background: var(--good-bg); color: var(--good); }
.chip.r-rejected { background: var(--bad-bg); color: var(--bad); }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; background: var(--sheet); border-bottom: 1px solid var(--rule); padding: 6px 12px; }
.tabs a { padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 15px; }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.alerts { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.alert-count { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--wait-bg); color: var(--wait); }
.alert-count.a-overdue, .alert-count.a-incidents { background: var(--bad); color: #fff; }
.searchbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.searchbar input[type=search] { flex: 1 1 240px; }
.count { display: inline-block; min-width: 26px; text-align: center; font-size: 13px; padding: 2px 8px; border-radius: 999px; background: var(--rule); color: var(--ink); }
.count.bad { background: var(--bad); color: #fff; }
.table { width: 100%; border-collapse: collapse; background: var(--sheet); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; margin-bottom: 12px; font-size: 15px; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.table th { font-size: 13px; color: var(--muted); font-weight: 600; }
.table tr.overdue td { background: var(--bad-bg); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.inline-form input[type=text] { flex: 1 1 200px; padding: 10px; font-size: 16px; }
.inline-form .btn { min-height: 44px; }
.row-left { display: flex; gap: 8px; flex-wrap: wrap; }
.stops { margin: 0; padding-left: 22px; }
.stops li { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.grants { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 12px; }
.inactive { opacity: .6; }
.scroll { overflow-x: auto; }
.matrix input { width: 58px; padding: 6px; font-size: 14px; }
.matrix td.guess input { background: var(--cash-bg); }
.matrix .seen { display: block; font-size: 11px; color: var(--good); }
.secret { word-spacing: .3em; }
@media (max-width: 640px) {
  .table { font-size: 14px; }
  .table th, .table td { padding: 6px; }
  .tabs a { padding: 8px; font-size: 14px; }
}
.next-action .btn, .next-action form { width: 100%; }
.next-action .btn + .btn, .next-action form + form .btn { margin-top: 0; }
.incidents td { vertical-align: middle; }
.incidents .more summary { min-height: 36px; font-size: 14px; }
