:root{
  color-scheme: light;   /* dark mode is only partly wired; force light so nothing renders broken (2026-08-01) */
  --green:#1f7a3d; --green-d:#155c2c;
  --ink:#16231b; --muted:#6b7d72; --line:#dbe5dd; --bg:#f3f7f3; --card:#fff;
  --pink:#e8736f; --purple:#9b59b6; --red:#c0392b;
  --pink-bg:#fdecec; --purple-bg:#f4ecf7; --red-bg:#fae9e7;
  /* semantic tier tokens (2026-08-01) — the ONE amber/blue/ok family; prefer these over raw hex */
  --warn:#b9760a; --warn-bg:#fff7e8; --info:#2f6fc0; --info-bg:#eaf1fb; --ok:#1f7a3d; --ok-bg:#eef7f0;
  --tap:64px;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{font:16px/1.4 system-ui,-apple-system,Segoe UI,Roboto,sans-serif;color:var(--ink);background:var(--bg);
  -webkit-text-size-adjust:100%}
.hidden{display:none!important}
.screen{min-height:100%;display:flex;flex-direction:column}

/* login */
.login-card{max-width:420px;margin:8vh auto;text-align:center}
/* ONE TITLE, ONE WEIGHT, ONE COLOUR (Lar, 2026-08-07). "Whirl" used to be green and heavier than
   the rest, which split the name into a logo plus a subtitle -- fine when the subtitle was "Count
   Entry", wrong now the system is called Whirl Store Systems. The span rule stays and matches, so
   the existing two-part markup needs no edit and cannot drift back apart. */
.brand{font-size:30px;margin:0 0 18px;color:var(--ink);font-weight:800;letter-spacing:-.5px}
.brand span{color:var(--ink);font-weight:800}
.card{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:20px;margin:14px}
#pick .card{max-width:600px;margin:14px auto}
#pick > .center{max-width:600px;margin:0 auto}
.fld{display:block;text-align:left;font-weight:600;color:var(--muted);margin:14px 0}
.fld select,.fld input{display:block;width:100%;margin-top:6px;padding:14px;font-size:20px;
  border:2px solid var(--line);border-radius:12px;background:#fff;color:var(--ink);min-height:var(--tap)}
button{font:inherit;cursor:pointer;border:none;border-radius:12px}
.primary{background:var(--green);color:#fff;font-weight:700;padding:14px 18px;min-height:var(--tap)}
.primary:active{background:var(--green-d)}
.primary.big{width:100%;font-size:20px;margin-top:10px}
.ghost{background:transparent;color:var(--green);font-weight:700;padding:10px 14px}
/* THE THREE CHOICES ON THE LOGIN SCREEN, ALL THE SAME SIZE AND ALL THE SAME STYLE. They are three
   ways into three systems, not one action with two afterthoughts. Before this, counting was a
   filled green button, onboarding was flat text and the Flex Log was a link -- a hierarchy nobody
   intended. Filling one of them still implied "this is the real one", so as of 2026-08-07 all
   three are green on white (Lar). Applied to <a> as well as <button>, hence the explicit
   box-sizing/display -- an anchor is not a button until it is told to be. */
/* FLEX, AND A FIXED MIN-HEIGHT, SO A LABEL THAT WRAPS DOES NOT MAKE ITS BUTTON TALLER. "Count and
   Review Inventory" takes two lines on a 375px phone while the other two take one, which made it
   84px against their 64 -- equal width but visibly unequal. The min-height is set to the two-line
   case so every button matches the tallest, and flex centres one-line labels inside it rather than
   leaving them sitting at the top. */
.hub-choice{display:flex;align-items:center;justify-content:center;width:100%;box-sizing:border-box;
  font-size:20px;font-weight:700;padding:14px 18px;min-height:84px;margin-top:10px;
  border-radius:10px;text-align:center;text-decoration:none;line-height:1.3}
a.hub-choice{color:var(--green)}
.hub-choice.outline{background:#fff;color:var(--green);border:2px solid var(--green)}
.hub-choice.outline:active{background:#eef5f1}
.hub-choice:disabled,.hub-choice.outline:disabled{background:#eeeeea;color:#9a9a92;border-color:#c9c9c2;cursor:not-allowed}
.err{color:var(--red);font-weight:600;min-height:1.2em;margin:10px 0 0}
.muted{color:var(--muted)}
.center{text-align:center}

/* topbar */
.topbar{position:sticky;top:0;z-index:5;display:flex;align-items:center;justify-content:space-between;
  gap:10px;padding:10px 14px;background:var(--green);color:#fff}
.topbar strong{font-size:18px}
.topbar-left{display:flex;align-items:center;gap:10px;min-width:0}
.topbar-right{display:flex;align-items:center;gap:10px}
.tag{background:rgba(255,255,255,.22);padding:3px 9px;border-radius:999px;font-size:13px;font-weight:700}
.topbar .primary{background:#fff;color:var(--green);padding:10px 14px;min-height:48px}
.topbar .ghost{color:#fff}
.savestate{font-size:13px;opacity:.9}
.savestate.saving{opacity:1}
.savestate.offline{color:#ffe08a;font-weight:700}

/* tabs */
.tabs{position:sticky;top:54px;z-index:4;display:flex;gap:6px;padding:8px 10px;background:var(--bg);
  overflow-x:auto;border-bottom:1px solid var(--line)}
.tab{white-space:nowrap;background:#e7efe8;color:var(--ink);border-radius:999px;padding:10px 16px;
  font-weight:700;min-height:48px}
.tab.active{background:var(--green);color:#fff}
.tab .badge{display:inline-block;margin-left:6px;font-size:12px;background:rgba(0,0,0,.12);border-radius:999px;
  padding:1px 7px}
.tab.active .badge{background:rgba(255,255,255,.25)}

/* search + progress */
.searchrow{display:flex;align-items:center;gap:10px;padding:8px 12px}
.searchrow input{flex:1;padding:12px;font-size:17px;border:2px solid var(--line);border-radius:12px;min-height:52px}
.progress{font-weight:700;color:var(--muted);white-space:nowrap}
/* #2 (Lar 2026-07-24): on a bridge order (period count filled most of it), make the leftover
   un-counted items impossible to miss -- amber banner + flagged tabs + greyed Send until done. */
.need-count{display:flex;align-items:center;gap:10px;justify-content:space-between;margin:8px 10px 0;
  background:#FAEEDA;border:1px solid #EF9F27;border-radius:12px;padding:10px 12px}
.need-count .nc-txt{font-size:14px;color:#633806;line-height:1.35}
.need-count .nc-go{flex-shrink:0;background:#EF9F27;color:#3a2500;font-weight:800;border-radius:10px;
  padding:9px 12px;font-size:13px;min-height:auto;white-space:nowrap}
.tab.hasleft{box-shadow:inset 0 0 0 2px #EF9F27}
.need-count-msg{margin-top:10px;background:#FAEEDA;border:1px solid #EF9F27;border-radius:10px;
  padding:9px 11px;color:#633806;font-size:14px}
.primary:disabled,.primary.disabled{background:#c9c9c2;cursor:not-allowed}

/* list */
.list{flex:1;padding:4px 10px 90px}
.item{display:flex;align-items:center;gap:12px;background:var(--card);border:1px solid var(--line);
  border-left:6px solid var(--line);border-radius:14px;padding:12px;margin:8px 0}
.item .info{flex:1;min-width:0}
.item .name{font-weight:700;font-size:18px;overflow-wrap:anywhere}
.item .pack{display:inline-block;font-size:13px;font-weight:700;color:var(--green-d);
  background:#e7efe8;border-radius:6px;padding:1px 7px;margin-top:3px}
.item .meta{color:var(--muted);font-size:14px;margin-top:3px}
.item .last{font-variant-numeric:tabular-nums}
.item input.qty{width:120px;text-align:center;font-size:24px;font-weight:800;padding:10px;
  border:2px solid var(--line);border-radius:12px;min-height:var(--tap)}
.item input.qty:focus{outline:none;border-color:var(--green)}
/* V4.10: bold "Count <UOM>" right above the entry box so GMs count in the right unit */
.item .count-col{display:flex;flex-direction:column;align-items:center;gap:3px;flex-shrink:0}
.item .count-uom{font-weight:800;font-size:12px;letter-spacing:.03em;color:var(--green);
  text-transform:uppercase;white-space:nowrap}
.item.filled{border-left-color:var(--green)}
.item.warn-pink{border-left-color:var(--pink);background:var(--pink-bg)}
.item.warn-purple{border-left-color:var(--purple);background:var(--purple-bg)}
.item.warn-red{border-left-color:var(--red);background:var(--red-bg)}
.swing{font-size:13px;font-weight:700;margin-top:3px}
.swing.pink{color:var(--pink)} .swing.purple{color:var(--purple)} .swing.red{color:var(--red)}

/* session picker */
.session-btn{display:flex;align-items:center;justify-content:space-between;width:100%;
  background:#fff;border:2px solid var(--line);border-radius:14px;padding:18px;margin:10px 0;
  min-height:72px;text-align:left}
.session-btn:active{border-color:var(--green)}
.session-btn.newbtn{border-style:dashed;justify-content:center}
.session-btn.newbtn .s-label{color:var(--green)}
.session-btn.coldbtn{cursor:not-allowed;background:#f6f6f2}
.session-btn.coldbtn .s-label{color:#9a9a93;font-weight:600}
/* Shared-Monday: period-card order-day banner + the "set up my order" button */
.s-orderday{margin-top:2px;background:#EAF3DE;color:#27500A;border-radius:8px;padding:7px 10px;
  font-size:13px;font-weight:600;line-height:1.35;text-align:left}
.session-btn.orderfromcount{border-style:solid;border-color:var(--green);background:#f2fbf4}
.session-btn.orderfromcount .s-label{color:var(--green-d);font-weight:800}
.s-wrap{width:100%;display:flex;flex-direction:column;gap:9px}
.s-toprow{display:flex;justify-content:space-between;align-items:flex-start;gap:14px}
.s-left{display:flex;flex-direction:column;gap:2px;text-align:left}
.s-titlerow{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.s-label{font-size:18px;font-weight:700;color:var(--ink)}
.s-prog{font-size:13px;font-weight:600;color:var(--muted)}
.s-right{text-align:right;font-size:13px;color:var(--muted);line-height:1.5;white-space:nowrap;flex-shrink:0}
.s-right b{color:var(--ink);font-weight:800}
.s-sub{font-size:13px;font-weight:600;color:var(--muted)}
.s-sub b{color:var(--ink);font-weight:800}
.s-chain{display:flex;align-items:center;flex-wrap:wrap;gap:5px;font-size:12px}
.s-chain .chip{border-radius:20px;padding:2px 9px;font-weight:700;white-space:nowrap}
.s-chain .chip.done{background:#e7f2da;color:#3B6D11}
.s-chain .chip.cur{background:#faeeda;color:#854F0B}
.s-chain .chip.pend{color:#9a9a93}
.s-chain .chsep{color:#c9c9c2;font-size:13px}
.s-status{font-size:13px;font-weight:700;color:#5f5e5a;background:#f0efe8;border-radius:20px;padding:3px 11px;white-space:nowrap;flex-shrink:0}
.s-status.submitted{color:#854F0B;background:#FAEEDA}
.s-status.committed{color:#3B6D11;background:#EAF3DE}
#toPick{font-size:26px;line-height:1;color:#fff;padding:4px 10px}

/* review */
#reviewSummary .big-n{font-size:34px;font-weight:800;color:var(--green)}
.warnlist{margin:10px 0;padding:10px;border:1px solid var(--red);background:var(--red-bg);border-radius:12px}
.warnlist h4{margin:0 0 6px;color:var(--red)}
.warnlist .row{display:flex;justify-content:space-between;gap:10px;padding:3px 0;font-size:14px}

/* done */
.bigcheck{width:84px;height:84px;border-radius:50%;background:var(--green);color:#fff;font-size:48px;
  display:flex;align-items:center;justify-content:center;margin:6px auto 12px}
.small{font-size:13px}
.finish-panel hr,.finished-note{margin-top:16px}
.finish-panel hr{border:none;border-top:1px solid var(--line);margin-bottom:14px}
.finish-btn{background:#0a7d2c}
.finish-warn{color:#9a5b00;background:#fff6e5;border:1px solid #f0c987;border-radius:12px;
  padding:10px;font-weight:600;margin:0 0 12px}
.finished-note{padding:12px;border:1px solid var(--green);background:#e9f6ee;border-radius:12px}
.finished-note p{margin:0 0 8px;color:var(--green-d)}
.s-status.finished{color:#3B6D11;background:#EAF3DE;font-weight:700}
/* a published-but-untouched week: neutral, not the amber of work in progress (2026-08-23) */
.s-status.pend{color:#6f6e6a;background:#f0efe8;font-weight:600}

/* SEVERE live count warning (Layer 1) — rare, severe-only, non-blocking */
.sev-overlay{position:fixed;inset:0;z-index:50;display:flex;align-items:center;justify-content:center;
  background:rgba(0,0,0,.55);padding:18px}
.sev-box{background:var(--card);border-radius:16px;border:3px solid var(--red);max-width:440px;width:100%;
  padding:18px;box-shadow:0 10px 40px rgba(0,0,0,.35)}
.sev-head{background:var(--red);color:#fff;font-weight:800;font-size:20px;letter-spacing:.3px;
  border-radius:10px;padding:12px 14px;text-align:center;margin:0 0 14px}
.sev-item{font-size:19px;font-weight:800;color:var(--ink);margin:0 0 10px}
.sev-line{font-size:17px;margin:6px 0;color:var(--ink)}
.sev-line b{color:var(--red)}
.sev-hint{font-size:14px;color:var(--muted);margin:10px 0}
.sev-ask{font-size:15px;font-weight:700;color:var(--ink);margin:12px 0 16px}
.sev-btns{display:flex;flex-direction:column;gap:10px}
.sev-btns button{min-height:var(--tap);border-radius:12px;font-size:17px;font-weight:800;border:none}
.sev-fix{background:var(--red);color:#fff}
.sev-ok{background:transparent;color:var(--muted);border:2px solid var(--line);font-weight:700}

/* The weekly SECOND COUNT (2026-09-01). Deliberately NOT red: this is a routine ask at the end of
   every count, not a warning that something is wrong. The red box means "you have probably made a
   mistake"; spending it here would make the routine ask look like an alarm and wear the colour out.
   No numbers appear in this box by design -- see showRecountModal. */
/* IT HAS TO SCROLL. Most stores get 3-5 items, but 532 produced 12 and 530 produced 17 on
   2026-08-31 -- and those are exactly the stores this matters most at. Without a bounded height
   the Done button falls off the bottom of the tablet and the count cannot be finished. The head
   and the button stay put; only the rows move. */
.rc-box{border-color:var(--green);display:flex;flex-direction:column;max-height:calc(100vh - 36px)}
.rc-box .sev-head{background:var(--green);flex:0 0 auto}
.rc-box .sev-line{flex:0 0 auto}
.rc-box .rc-scroll{flex:1 1 auto;overflow-y:auto;-webkit-overflow-scrolling:touch;min-height:0}
.rc-box .rc-err,.rc-box .sev-btns{flex:0 0 auto}
.rc-row{display:grid;grid-template-columns:1fr auto 92px;align-items:center;gap:10px;
  padding:9px 0;border-bottom:1px solid var(--line)}
.rc-item{font-size:16px;font-weight:700;color:var(--ink);line-height:1.25}
.rc-unit{font-size:13px;color:var(--muted);white-space:nowrap}
.rc-input{min-height:var(--tap);width:92px;border-radius:10px;border:2px solid var(--line);
  font-size:19px;font-weight:700;text-align:center;padding:6px}
.rc-input.rc-missing{border-color:var(--red);background:#fff5f5}
.rc-err{min-height:20px;font-size:15px;font-weight:700;color:var(--red);margin:10px 0 4px}
.rc-done{background:var(--green);color:#fff;border:none}
/* the second question after a recount (2026-10-05) */
.wh-item{padding:12px 0;border-top:1px solid var(--line)}
.wh-q{font-size:16px;font-weight:700;color:var(--ink);line-height:1.3;margin-bottom:8px}
.wh-item.wh-missing .wh-q{color:var(--red)}
.wh-opts{display:flex;flex-wrap:wrap;gap:8px}
.wh-opt{min-height:var(--tap);padding:8px 12px;border-radius:10px;border:2px solid var(--line);background:#fff;
  color:var(--ink);font-size:15px;text-align:left}
.wh-opt.on{border-color:var(--green);background:#eefaf1;font-weight:700}
.wh-more{display:grid;gap:8px;margin-top:10px}
.wh-more[hidden]{display:none}
.wh-lab{display:grid;gap:4px;font-size:13px;color:var(--muted)}
.wh-more input{min-height:var(--tap);border-radius:10px;border:2px solid var(--line);padding:6px 10px;font-size:16px}

/* THE SECOND COUNT (2026-09-01). Same shape as the weekly recount box and for the same reason:
   this is a routine step at the end of every period count, not a warning. Grouped by room, because
   the person counting walks room by room and a list that jumps between the freezer and the
   storeroom makes them walk twice. */
.secondcount{margin-top:14px}
.sc-card{max-width:620px}
/* order-first (2026-09-28): where the order stands, at the top of the second count */
.sc-ordernote{margin:6px 0 10px;padding:8px 10px;border-radius:8px;background:#fff6e0;color:#6b4b00}
.sc-ordernote.ok{background:#e7f6ec;color:#1d5c34}
.sc-loc{margin:16px 0 4px;font-size:13px;font-weight:800;letter-spacing:.4px;
  text-transform:uppercase;color:var(--muted);border-bottom:2px solid var(--line);padding-bottom:4px}
.sc-lines{max-height:60vh;overflow-y:auto;-webkit-overflow-scrolling:touch}
.sc-row{display:grid;grid-template-columns:1fr auto 92px;align-items:center;gap:10px;
  padding:9px 0;border-bottom:1px solid var(--line)}
.sc-item{font-size:16px;font-weight:700;color:var(--ink);line-height:1.25}
.sc-unit{font-size:13px;color:var(--muted);white-space:nowrap}
.sc-input{min-height:var(--tap);width:92px;border-radius:10px;border:2px solid var(--line);
  font-size:19px;font-weight:700;text-align:center;padding:6px}
.sc-input.sc-missing{border-color:var(--red);background:#fff5f5}

/* Count-by-exception (order guide): must-count items prominent, skip-eligible muted (book handles them) */
.item.must-count{border-left:6px solid var(--green)}
.item.book-skip{opacity:.6}
.mc-badge{display:inline-block;font-size:11px;font-weight:800;color:#fff;background:var(--green);
  border-radius:6px;padding:1px 7px;margin-left:6px;vertical-align:middle;letter-spacing:.4px}
.bk-badge{display:inline-block;font-size:11px;font-weight:700;color:var(--muted);background:#eef2ee;
  border-radius:6px;padding:1px 7px;margin-left:6px;vertical-align:middle}

/* "Did you run out?" -- the zero-count prompt. Deliberately NOT the red severe-warning
   styling: a zero is normal and this is a question, not an alarm. Amber, calm, one tap
   either way. See checkZero() in app.js. */
.zero-box{border-color:var(--amber,#b8860b)}
.zero-head{background:var(--amber,#b8860b)}
.zero-btns button{min-height:var(--tap)}
.zero-out{background:var(--amber,#b8860b);color:#fff}
.zero-ok{background:var(--card);color:var(--ink);border:2px solid var(--line,#ccc)}

/* Hub "Other" links -- ordering, variances, storage-space set-up (2026-08-02). */
.hublink { margin: 0 0 12px; line-height: 1.45; }
.hublink a { font-size: 17px; font-weight: 600; text-decoration: none; }
.hublink .muted { display: block; margin-top: 1px; }


/* THE HUB WHEN A STORE IS ALREADY SIGNED IN (2026-08-29). The store takes the place of the two
   credential boxes, so the card is the same shape either way and the four buttons do not move. */
.hubwho {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin: 2px 0 12px; font-size: 15px; font-weight: 600; color: #2f3a34;
}
.hubwho .ghost { font-size: 13px; font-weight: 600; padding: 6px 12px; }

/* "See what I entered" — the read-only review on the done screen (2026-09-07).
   Deliberately plain: it is a look, not a form. Nothing here is tappable, so nothing here should
   look tappable. Left-aligned inside a centred card, because a column of numbers is read down. */
#seeEnteredPanel { text-align: left; }
#seeEnteredBody { max-height: 55vh; overflow-y: auto; }
table.reviewtbl { width: 100%; border-collapse: collapse; margin: 4px 0 12px; }
table.reviewtbl td { padding: 5px 6px; border-bottom: 1px solid rgba(0,0,0,.08); font-size: 15px; }
table.reviewtbl td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600;
                         white-space: nowrap; }

/* A VALUE NO COMMIT CAN READ, refused where it is typed (2026-09-08).
   `.` and `1. 01` at store 1359 filed as empty shelves and ordered as if the stock were gone; the
   same lone `.` reached 256, 516, 530 and 532 the day before. It was logged and never seen. Loud
   on purpose -- this is the one keystroke that silently zeroes an item for a whole period. */
.card.bad-value { background: #fff5f5; box-shadow: inset 3px 0 0 #b3261e; }
.card.bad-value input.qty { border-color: #b3261e; background: #fff; color: #b3261e; font-weight: 700; }
.card .bad-msg { margin-top: 4px; color: #b3261e; font-size: 12px; font-weight: 600;
                 line-height: 1.3; max-width: 15em; text-align: right; }

/* THE HUB'S GROUP HEADINGS (2026-09-22). Nine buttons with no shape became three groups of three.
   Deliberately quiet: a signpost, not something to read. The first group's heading loses its top margin
   so the screen does not open with a gap. A group whose buttons are all hidden hides itself (index.html). */
.hub-group{margin-top:22px}
.hub-group:first-of-type{margin-top:8px}
.hub-head{font-size:13px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;
  color:#6b7480;margin:0 0 2px 2px}
.hub-group.hidden{display:none}
/* hub offline menu (module 9 piece (b)) */
a.hub-choice.needs-signal,a.hub-choice-rv.needs-signal,#sendOrderLink.needs-signal{background:#eeeeea;color:#9a9a92;border-color:#c9c9c2;cursor:not-allowed;pointer-events:auto}
.needs-signal-tag{font-size:.85em;font-weight:normal}
