/* DeadheadDesk Operator. Paper forms, phone first. No gradients, no images. */
:root {
  --paper: #F5EFE2;
  --ink: #2B1D10;
  --muted: #6B5A48;
  --rule: #D9CDB8;
  --orange: #D64500;
  --green: #1E4D3B;
  --red: #9E2B25;
  --amber: #9A6B00;
  --paper-2: #EFE7D6;
  --sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --head: "Oswald", "Arial Narrow", Impact, sans-serif;
  --tap: 48px;
}
* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.4;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
  overflow-x: hidden;
}
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--head); font-weight: 600; margin: 0; line-height: 1.1; letter-spacing: 0.01em; }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0 0 12px; }
a { color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }

/* Strip and form line */
.strip {
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  border-bottom: 1px solid var(--ink);
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; font-weight: 500;
}
.strip-net { color: var(--red); letter-spacing: 0.04em; }
.formline {
  padding: 6px 16px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  color: var(--muted); border-bottom: 1px solid var(--rule);
}
.view { padding: 16px 16px 120px; max-width: 640px; margin: 0 auto; overflow-wrap: break-word; }
.ref { overflow-wrap: anywhere; word-break: break-all; min-width: 0; flex: 1; }

/* Type helpers */
.big { font-family: var(--head); font-weight: 700; font-size: 40px; line-height: 1; letter-spacing: -0.01em; }
.huge { font-family: var(--head); font-weight: 700; font-size: 64px; line-height: 0.95; letter-spacing: -0.02em; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12px; }
.good { color: var(--green); }
.bad { color: var(--red); }
.warn { color: var(--amber); }
.act { color: var(--orange); }
.q { font-family: var(--head); font-weight: 600; font-size: 26px; line-height: 1.15; margin: 8px 0 16px; }
.progress { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 6px; }

/* Buttons and taps */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px; border: 1px solid var(--ink); border-radius: 4px;
  background: var(--paper); color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: none;
  box-shadow: 0 1px 0 var(--rule); -webkit-tap-highlight-color: transparent; width: 100%;
}
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #FFF; }
.btn.ghost { border-color: var(--rule); background: transparent; box-shadow: none; }
.btn.danger { border-color: var(--red); color: var(--red); }
.btn.inline { width: auto; }
.btn.sm { min-height: var(--tap); padding: 0 12px; font-size: 14px; }
.btn:disabled { opacity: 0.5; cursor: default; }
.row { display: flex; gap: 10px; align-items: center; }
.row > .btn { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.tap { min-height: var(--tap); }

/* Fields */
.field { margin: 0 0 14px; }
.field label { display: block; font-size: 14px; font-weight: 500; color: var(--muted); margin-bottom: 4px; }
.field .unit { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-left: 6px; }
.field input, .field select, .field textarea {
  width: 100%; min-height: var(--tap); padding: 10px 12px; border: 1px solid var(--ink); border-radius: 4px;
  background: #FFFDF8; font-family: var(--mono); font-size: 20px; font-weight: 500;
}
.field select { font-family: var(--sans); font-size: 16px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--orange); outline-offset: 1px; }
.field .err { color: var(--red); font-size: 14px; margin-top: 4px; }
.money-in { position: relative; }
.money-in::before { content: "$"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: 20px; color: var(--muted); }
.money-in input { padding-left: 28px; }
.chip {
  display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 6px 14px; border: 1px solid var(--rule);
  border-radius: 999px; background: var(--paper-2); font-size: 14px; color: var(--muted); cursor: pointer; margin: 2px 6px 2px 0; min-width: 72px;
}
.chip.on { border-color: var(--ink); color: var(--ink); }
.chip.grade { font-family: var(--head); font-weight: 600; font-size: 17px; letter-spacing: 0.05em; min-width: var(--tap); }
.chip.grade.A { border-color: var(--green); color: var(--green); }
.chip.grade.B { border-color: var(--green); color: var(--green); }
.chip.grade.C { border-color: var(--amber); color: var(--amber); }
.chip.grade.X { border-color: var(--red); color: var(--red); }
.choice { display: flex; gap: 8px; margin-bottom: 14px; }
.choice .btn { flex: 1; }
.choice .btn.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.warnings { margin: 10px 0 0; padding: 0; list-style: none; }
.warnings li { color: var(--amber); font-size: 14px; padding: 4px 0; border-top: 1px solid var(--rule); }
.errbox { border-left: 4px solid var(--red); padding: 8px 12px; color: var(--red); margin: 12px 0; background: var(--paper-2); }
.note { border-left: 4px solid var(--rule); padding: 8px 12px; margin: 12px 0; background: var(--paper-2); font-size: 14px; }

/* Footer (onboarding break-even) */
.footer {
  position: fixed; left: 0; right: 0; bottom: 0; background: var(--paper); border-top: 1px solid var(--ink);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto;
}
.footer .be { font-family: var(--mono); font-size: 14px; }
.footer .be b { font-family: var(--head); font-size: 22px; font-weight: 600; margin-left: 6px; }
.footer .nav { display: flex; gap: 10px; margin-top: 8px; }
.footer .nav .btn { flex: 1; }

/* Board */
.hdr { border-bottom: 1px solid var(--ink); padding-bottom: 10px; margin-bottom: 10px; }
.hdr .loc { font-family: var(--head); font-size: 22px; font-weight: 600; }
.hdr .loc button { border: 0; background: none; padding: 0; font: inherit; text-align: left; text-decoration: underline; text-decoration-color: var(--rule); min-height: var(--tap); }
.source { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--muted); margin: 6px 0; }
.logo-slot { width: 20px; height: 20px; border: 1px dashed var(--rule); flex: none; }
.counts { font-size: 15px; margin: 8px 0; }
.counts button { border: 0; background: none; padding: 0; font: inherit; text-decoration: underline; color: var(--ink); min-height: var(--tap); }
.banner { border: 1px solid var(--orange); border-left-width: 4px; padding: 10px 12px; margin: 10px 0; background: var(--paper-2); }
.banner .btn { margin-top: 8px; }

.card {
  border-top: 1px solid var(--rule); border-left: 4px solid var(--rule); padding: 12px 12px 14px; margin: 0 0 10px;
  background: var(--paper);
}
.card.b-clears_floor { border-left-color: var(--green); }
.card.b-marginal { border-left-color: var(--amber); }
.card.b-below_floor { border-left-color: var(--red); }
.card.b-rate_not_posted { border-left-color: var(--muted); }
.card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.net { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.card .net .big { font-size: 40px; }
.card .net .per { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.card .rank { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0.1em; }
.card .l2 { font-size: 14px; margin: 2px 0 8px; }
.card .lane { font-family: var(--head); font-size: 20px; font-weight: 500; margin: 2px 0; }
.card .meta { font-size: 14px; color: var(--muted); }
.card .meta .mono { color: var(--ink); }
.card .why { margin: 8px 0; font-size: 15px; }
.card .chips { display: flex; flex-wrap: wrap; align-items: center; margin: 4px 0 8px; }
.card .reasons { margin: 0 0 8px; padding-left: 18px; font-size: 14px; color: var(--muted); }
.card .acts { display: flex; gap: 10px; margin-top: 6px; }
.card .acts .btn { flex: 1; }
.card .acts .btn.take { flex: 1.4; }
.card.decided { padding: 8px 12px; border-left-color: var(--rule); }
.decided-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.decided-line .btn { width: auto; }
.hidden-card { border-top: 1px solid var(--rule); padding: 8px 12px; font-size: 14px; color: var(--muted); }
.hidden-card .lane { color: var(--ink); font-weight: 500; }
.tolink { display: block; color: var(--muted); font-size: 13px; text-decoration: underline; min-height: var(--tap); line-height: var(--tap); }

/* Ledger */
.ledger { font-family: var(--mono); font-size: 15px; border-top: 1px solid var(--ink); margin: 12px 0; }
.ledger .ln { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); min-height: var(--tap); align-items: center; }
.ledger .ln.tappable { cursor: pointer; }
.ledger .ln .k { }
.ledger .ln .v { text-align: right; font-weight: 500; }
.ledger .ln .src { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.ledger .ln .src.override { color: var(--orange); }
.ledger .tot { border-top: 2px solid var(--ink); border-bottom: 0; }
.ledger .tot .v { font-family: var(--head); font-size: 28px; font-weight: 700; }
.ov { padding: 8px 0 12px; border-bottom: 1px solid var(--rule); }
.ov .row .btn { flex: 0 0 auto; width: auto; }
.assume { padding-left: 18px; margin: 8px 0; font-size: 14px; }
.blk { border-top: 1px solid var(--rule); padding: 10px 0; }
.blk .lbl { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 4px; }

/* Call sheet */
.sheet-num { display: flex; gap: 16px; margin: 12px 0; }
.sheet-num > div { flex: 1; }
.sheet-num .lbl { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--muted); }
.tel { font-family: var(--head); font-size: 28px; font-weight: 600; text-decoration: none; display: block; min-height: var(--tap); }
.confirm { padding-left: 0; list-style: none; margin: 8px 0; }
.confirm li { padding: 10px 0; border-top: 1px solid var(--rule); font-size: 16px; display: flex; gap: 10px; }
.confirm li::before { content: "[ ]"; font-family: var(--mono); color: var(--muted); flex: none; white-space: nowrap; }
.copybox { font-family: var(--mono); font-size: 14px; background: var(--paper-2); padding: 10px 12px; border: 1px solid var(--rule); margin: 8px 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Bottom sheet */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(43, 29, 16, 0.35); z-index: 20; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; background: var(--paper); border-top: 2px solid var(--ink);
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; max-height: 85vh; overflow: auto;
}
.sheet .btn { margin-bottom: 8px; justify-content: flex-start; }
.sheet .btn.center { justify-content: center; }

/* Toast */
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 30;
  background: var(--ink); color: var(--paper); padding: 12px 14px; border-radius: 4px; font-size: 15px; box-shadow: 0 1px 0 var(--rule);
}
.toast.bad { background: var(--red); }

/* Lists and settings */
.list { border-top: 1px solid var(--ink); }
.list .it { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 56px; padding: 8px 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
.list .it .sub { font-size: 13px; color: var(--muted); }
.list .it .btn { width: auto; }
.versions { font-family: var(--mono); font-size: 13px; }
.versions .it { min-height: var(--tap); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-family: var(--mono); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th, table.tbl td { text-align: left; padding: 8px 4px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.tbl th { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--muted); font-weight: 500; }
.scroll { overflow-x: auto; }
.noscript { padding: 16px; }
.center { text-align: center; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.hr { border: 0; border-top: 1px solid var(--rule); margin: 16px 0; }
.sr { position: absolute; left: -9999px; }

/* Ledger screen: the one place the hours caveat is shown. */
.hos-note { margin-top: 20px; padding-top: 10px; border-top: 1px solid var(--rule); }
