:root {
  --bg: #f4f5f7; --card: #ffffff; --ink: #16181d; --soft: #5d6470; --line: #d9dde3;
  --blue: #1f5fa8; --blue-press: #174a84; --green: #1b6e3c; --red: #b3261e; --amber: #9a6700;
  --tint: #e8f0fa; --ok-tint: #e7f3ec; --warn-tint: #fdecea;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.4 Inter, "Segoe UI", system-ui, sans-serif; font-variant-numeric: tabular-nums; }
body { padding: 0 0 env(safe-area-inset-bottom); }
h1 { font-size: 22px; margin: 0; } h2 { font-size: 19px; margin: 0 0 4px; } h3 { font-size: 15px; margin: 0 0 6px; }
.soft { color: var(--soft); } .small { font-size: 13px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.green { color: var(--green); } .red { color: var(--red); } .amber { color: var(--amber); }

.top { position: sticky; top: 0; z-index: 5; background: var(--card); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; flex-wrap: wrap; }
.top .grow { flex: 1; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); display: inline-block; }
.dot.off { background: var(--red); } .dot.busy { background: var(--amber); }
.wrap { max-width: 980px; margin: 0 auto; padding: 16px; }

/* buttons: they answer the moment they are pressed */
button { font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 10px; padding: 11px 18px; min-height: 46px; cursor: pointer; touch-action: manipulation;
  transition: transform .04s ease, background-color .06s ease, box-shadow .06s ease; user-select: none; }
button:hover { background: #f0f2f5; }
button:active { transform: scale(.97); background: #e3e6eb; }
button.go { background: var(--blue); border-color: var(--blue); color: #fff; }
button.go:hover { background: #2569b8; } button.go:active { background: var(--blue-press); }
button.big { font-size: 19px; padding: 20px 26px; min-height: 68px; width: 100%; }
button.quiet { border-color: transparent; background: transparent; color: var(--blue); padding: 8px 10px; min-height: 0; }
button:disabled { opacity: .45; cursor: default; transform: none; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #8fb6e6; outline-offset: 1px; }

input, select, textarea { font: inherit; border: 1px solid #b9c0ca; border-radius: 8px; padding: 9px 10px; background: #fff; color: var(--ink); }
input.num { width: 6.2em; text-align: right; font-size: 19px; font-weight: 600; }
textarea { width: 100%; min-height: 70px; resize: vertical; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 0 0 12px; }
.job { display: flex; gap: 12px; align-items: center; cursor: pointer; transition: transform .04s ease, box-shadow .08s ease; }
.job:hover { box-shadow: 0 2px 8px rgba(20,30,50,.10); } .job:active { transform: scale(.99); }
.job .n { font-size: 20px; font-weight: 700; color: var(--soft); width: 1.6em; }
.job .grow { flex: 1; min-width: 0; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 600; background: #eceff3; color: var(--soft); }
.pill.ok { background: var(--ok-tint); color: var(--green); } .pill.warn { background: var(--warn-tint); color: var(--red); }
.pill.live { background: var(--tint); color: var(--blue); }
.bar { height: 6px; border-radius: 3px; background: #e3e6eb; overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--green); transition: width .15s ease; }

table.sheet { width: 100%; border-collapse: collapse; }
table.sheet th { font-size: 12px; font-weight: 600; color: var(--soft); text-align: right; padding: 4px 8px; white-space: nowrap; }
table.sheet th:nth-child(1), table.sheet th:nth-child(2) { text-align: left; }
table.sheet td { padding: 7px 8px; border-top: 1px solid var(--line); text-align: right; vertical-align: middle; }
table.sheet td.mat { text-align: left; font-size: 18px; font-weight: 700; }
table.sheet td.mark { text-align: left; width: 1.4em; font-size: 18px; font-weight: 700; padding-right: 0; }
table.sheet td.tgt { font-size: 18px; font-weight: 700; }
table.sheet td.msg { text-align: left; font-size: 13px; }
tr.ok td { color: var(--green); } tr.ok { background: var(--ok-tint); } tr.cur { background: var(--tint); }
tr.freerow td { border-top: 2px solid #b9c0ca; }
.banner { border-radius: 10px; padding: 10px 14px; margin: 10px 0; font-weight: 600; }
.banner.warn { background: var(--warn-tint); color: var(--red); } .banner.info { background: var(--tint); color: #173e6e; }
.banner.ok { background: var(--ok-tint); color: var(--green); }
.notes .n { padding: 6px 0; border-top: 1px solid var(--line); } .notes .n:first-child { border-top: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row .grow { flex: 1; }
.form label { display: block; font-size: 13px; color: var(--soft); margin-bottom: 3px; }
.form .f { margin-bottom: 10px; }
.scroll { overflow-x: auto; }
@media (max-width: 640px) {
  .wrap { padding: 10px; } table.sheet td.mat, table.sheet td.tgt { font-size: 16px; }
  input.num { width: 5.2em; font-size: 17px; } .hide-s { display: none; }
  table.sheet td, table.sheet th { padding: 6px 5px; }
}

tr.stephead td { text-align: left; background: #eef1f5; font-weight: 600; padding: 8px 10px; border-top: 2px solid #c7cdd6; }
.stepno { display: inline-block; background: var(--ink); color: #fff; border-radius: 6px; padding: 1px 9px; margin-right: 8px; font-size: 13px; }
tr.mixrow td { padding: 10px 8px; }
.timer { font-size: 20px; font-weight: 700; margin-right: 12px; font-variant-numeric: tabular-nums; }
.timer.up { color: var(--red); }

.hint { float: right; font-weight: 400; font-size: 12px; color: #8a909b; }
.mins { float: right; font-weight: 700; }
details.more { margin-top: 4px; } details.more summary { cursor: pointer; color: var(--soft); font-size: 13px; padding: 6px 0; }

/* each step has its own colour: strong on the heading, pale on its rows */
table.sheet tr.stephead td { font-weight: 700; font-size: 17px; border-top: 0; }
table.sheet tr.st1 td { background: #e6f0fc; } table.sheet tr.stephead.st1 td { background: #bcd6f7; }
table.sheet tr.st2 td { background: #fdf3da; } table.sheet tr.stephead.st2 td { background: #f7dc94; }
table.sheet tr.st3 td { background: #e4f4e8; } table.sheet tr.stephead.st3 td { background: #b5dfc0; }
table.sheet tr.st4 td { background: #eee8f9; } table.sheet tr.stephead.st4 td { background: #d2c3ef; }
table.sheet tr.st5 td { background: #fde8df; } table.sheet tr.stephead.st5 td { background: #f6c3ab; }
table.sheet tr.st6 td { background: #eef0f3; } table.sheet tr.stephead.st6 td { background: #d5dae1; }
table.sheet td { border-top-color: rgba(0,0,0,.08); }
h1, h2, h3, button, .banner, .timer, .pill, td.mat, td.tgt, input.num { font-weight: 700; }

/* understated: muted step colours, every letter black */
table.sheet tr.st1 td { background: #f3f5f8; } table.sheet tr.stephead.st1 td { background: #dfe5ec; }
table.sheet tr.st2 td { background: #f7f5ef; } table.sheet tr.stephead.st2 td { background: #e9e4d6; }
table.sheet tr.st3 td { background: #f2f5f2; } table.sheet tr.stephead.st3 td { background: #dde6df; }
table.sheet tr.st4 td { background: #f5f4f7; } table.sheet tr.stephead.st4 td { background: #e4e1ea; }
table.sheet tr.st5 td { background: #f7f3f1; } table.sheet tr.stephead.st5 td { background: #e9e0db; }
table.sheet tr.st6 td { background: #f4f4f5; } table.sheet tr.stephead.st6 td { background: #e3e4e6; }
*, *::before, *::after, input::placeholder { color: #000 !important; }
.stepno { background: transparent; border: 1px solid #000; }
button.go { background: #d9dee5; border-color: #aeb6c1; }
button.go:hover { background: #ccd3dc; } button.go:active { background: #bec6d1; }
button.quiet { text-decoration: underline; }
.banner.warn { background: #f3e6e3; } .banner.info { background: #e9edf2; } .banner.ok { background: #e6ede8; }
.pill.ok { background: #e6ede8; } .pill.warn { background: #f3e6e3; } .pill.live { background: #e9edf2; }
.bar > i { background: #8f9a94; }
.timer.up { text-decoration: underline; }
.batchhead { font-size: 22px; font-weight: 700; margin: 8px 0 6px; padding: 8px 12px; background: #eceef1; border-radius: 8px; }
@media (max-width: 640px) { .batchhead { font-size: 19px; } }

/* printed sheet: the work on paper, readings written into the boxes by hand */
@media print {
  @page { margin: 12mm; }
  html, body { background: #fff; }
  .top, button, .notes, #obs, details.more, a[href$="record.pdf"] { display: none !important; }
  .wrap { max-width: none; padding: 0; } .card { border: 0; padding: 0; margin-bottom: 10px; }
  table.sheet tr { break-inside: avoid; }
  table.sheet td, .batchhead, .stepno { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  input.num { border: 1px solid #000; }
}

/* two colours only: light green and grey, taking turns step by step */
table.sheet tr.st1 td, table.sheet tr.st3 td, table.sheet tr.st5 td { background: #f2f6f2; }
table.sheet tr.stephead.st1 td, table.sheet tr.stephead.st3 td, table.sheet tr.stephead.st5 td { background: #dce8de; }
table.sheet tr.st2 td, table.sheet tr.st4 td, table.sheet tr.st6 td { background: #f4f4f5; }
table.sheet tr.stephead.st2 td, table.sheet tr.stephead.st4 td, table.sheet tr.stephead.st6 td { background: #e2e3e5; }

/* green on the step headings only; the rows of each step alternate white and grey */
table.sheet tr.stephead.st1 td, table.sheet tr.stephead.st2 td, table.sheet tr.stephead.st3 td,
table.sheet tr.stephead.st4 td, table.sheet tr.stephead.st5 td, table.sheet tr.stephead.st6 td { background: #dce8de; }
table.sheet tr.st1:not(.stephead) td, table.sheet tr.st3:not(.stephead) td, table.sheet tr.st5:not(.stephead) td { background: #fff; }
table.sheet tr.st2:not(.stephead) td, table.sheet tr.st4:not(.stephead) td, table.sheet tr.st6:not(.stephead) td { background: #f1f2f3; }
svg.pic { width: 34px; height: 30px; vertical-align: middle; margin-right: 10px; flex: none; }
@media (max-width: 640px) { svg.pic { width: 26px; height: 23px; margin-right: 6px; } }

/* the designer's two tabs */
nav.tabs { display: flex; gap: 4px; margin-left: 12px; }
button.tab { min-height: 38px; padding: 6px 14px; border-color: transparent; background: transparent; }
button.tab.on { background: #dce8de; border-color: #b9cbbd; }
/* mix design tables: same look as the weigh sheet, rows alternate white and grey */
table.design td { text-align: right; }
table.design:not(.words) td:nth-child(3) { white-space: nowrap; }
table.design input.mixdo { min-width: 20em; }
table.design tr.z td { background: #f1f2f3; }
table.design tr:not(.z):not(.stephead) td { background: #fff; }
table.design tr.total td { font-weight: 700; border-top: 2px solid #000; background: #fff; }
table.design.words td:last-child { text-align: left; }
input.text { font: inherit; width: 100%; }
.pic-blank { display: inline-block; width: 34px; margin-right: 10px; }
@media (max-width: 640px) { .pic-blank { width: 26px; margin-right: 6px; } nav.tabs { margin-left: 0; } }
table.design tr.stephead td { text-align: left; }
table.design td.mat { white-space: nowrap; }
table.design input.num { width: 5.4em; }
table.design input.mixdo { min-width: 24em; }

/* picture sums under a step: what goes in, and what comes out */
tr.comborow td { padding: 8px 8px 10px; text-align: left; }
.combo { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.combo .ci { display: inline-flex; align-items: center; white-space: nowrap; }
.combo .ci .pic { margin-right: 6px; }
.combo .op { font-weight: 700; font-size: 20px; }

/* the workability liquid limit stands out in red; units in the column heads are easy to read */
td.maxcell, td.maxcell * { color: #b3261e !important; font-weight: 700; font-size: 18px; white-space: nowrap; }
table.sheet th { font-size: 14px; font-weight: 700; }
table.sheet tr.stephead.st7 td, table.sheet tr.stephead.st8 td, table.sheet tr.stephead.st9 td { background: #dce8de; }
table.sheet tr.st7:not(.stephead) td, table.sheet tr.st9:not(.stephead) td { background: #fff; }
table.sheet tr.st8:not(.stephead) td { background: #f1f2f3; }
.pn { display: inline-flex; align-items: center; }

/* the box on the right of a step: how to mix, and for how long */
.comboline { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.howbox { border: 1.5px solid #000; border-radius: 8px; background: #fff; padding: 6px 12px; font-weight: 700; text-align: right; max-width: 22em; }
.howbox .howmin { font-size: 20px; }
.howbox { margin-left: auto; text-align: left; }

/* read-only figures in the design tables (they follow another design) */
.ro { display: inline-block; min-width: 5.4em; text-align: right; padding: 9px 10px; }
select.pick { width: 100%; }

/* the spreadsheet tables */
.gridwrap { overflow: auto; max-height: 72vh; border: 1px solid #c9ced6; border-radius: 8px; background: #fff; }
table.grid { border-collapse: separate; border-spacing: 0; font-size: 14px; }
table.grid th, table.grid td { border-right: 1px solid #dfe2e7; border-bottom: 1px solid #dfe2e7; padding: 0; white-space: nowrap; }
table.grid thead th { position: sticky; top: 0; background: #eef0f3; font-weight: 700; padding: 6px 8px; text-align: left; z-index: 2; }
table.grid thead tr.grp th { top: 0; background: #dce8de; font-size: 12px; }
table.grid thead tr:not(.grp) th { top: 27px; }
table.grid td.st, table.grid th.st { position: sticky; left: 0; background: #fff; z-index: 1; padding: 4px 8px; min-width: 9em; }
table.grid td.idc, table.grid th.idc { position: sticky; left: 9em; background: #fff; z-index: 1; padding: 4px 8px; }
table.grid thead th.st, table.grid thead th.idc { z-index: 3; background: #eef0f3; }
table.grid td.calc { background: #f4f5f7; padding: 6px 8px; text-align: right; }
table.grid tr.draft td.st, table.grid tr.draft td.idc { background: #fdf3da; }
.cell { border: 0; border-radius: 0; width: 100%; min-width: 6em; padding: 6px 8px; font: inherit; font-size: 14px; background: transparent; }
input.cell.num { text-align: right; font-weight: 400; width: 6.5em; }
.cell:focus { outline: 2px solid #000; outline-offset: -2px; background: #fffbe6; }
button.mini { min-height: 0; padding: 3px 8px; font-size: 12px; border-radius: 6px; margin-top: 3px; }
.wrap:has(.gridwrap) { max-width: none; }

table.grid td input.cell.text { white-space: normal; }
textarea.cell.area { min-height: 0; resize: vertical; white-space: normal; line-height: 1.35; font-size: 13px; display: block; }
table.grid td { vertical-align: top; }
label.toggle { display: inline-flex; align-items: center; gap: 6px; margin-left: 14px; font-size: 14px; font-weight: 700; cursor: pointer; }
label.toggle input { width: 18px; height: 18px; }

.mixno { display: inline-block; border: 1.5px solid #000; border-radius: 6px; padding: 0 7px; margin-right: 8px; font-weight: 700; font-size: 0.85em; }

table.grid td.noc, table.grid th.noc { position: sticky; left: 9em; background: #fff; z-index: 1; padding: 4px 6px; text-align: center; font-size: 18px; min-width: 3.2em; }
table.grid thead th.noc { z-index: 3; background: #eef0f3; font-size: 14px; }
table.grid tr.draft td.noc { background: #fdf3da; }
input.cell.nocell { width: 3em; min-width: 0; text-align: center; font-size: 18px; font-weight: 700; }
table.grid:has(th.noc) td.idc, table.grid:has(th.noc) th.idc { left: 12.4em; }
table.sheet tr.off td { opacity: .45; }
input[type=date] { font: inherit; }
td.pno { font-size: 18px; font-weight: 700; text-align: center !important; }
#app table.design td { white-space: nowrap; }

.askwrap { position: fixed; inset: 0; background: rgba(20,24,30,.35); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.askbox { background: #fff; border-radius: 12px; padding: 18px 20px; max-width: 460px; width: 100%; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.askmsg { font-size: 17px; font-weight: 700; }

/* the days that have work */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
button.daychip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 0; padding: 8px 12px; border-radius: 10px; text-align: left; }
button.daychip span { font-size: 12px; font-weight: 400; }
button.daychip.on { background: #dce8de; border-color: #9fb9a5; }
button.daychip.late { border-color: #b3261e; }
input#pickday { min-height: 46px; }
table.grid td.tk, table.grid th.tk { text-align: center; padding: 4px 6px; }
table.grid td.tk input { width: 18px; height: 18px; }
input.p-move, input.p-moveday, #jobday { padding: 4px 6px; font-size: 14px; }
@media print { #jobday { display: none; } }

/* the paper: one job per page, boxes and lines to write in by hand */
section.page { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin: 0 0 18px; }
.pagehead { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 8px; }
.pageday { text-align: right; font-weight: 700; white-space: nowrap; }
span.writebox { display: inline-block; width: 7.5em; height: 34px; border: 1.5px solid #000; border-radius: 4px; vertical-align: middle; background: #fff; }
.fills { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px; margin: 18px 0 10px; }
.fill { display: flex; align-items: flex-end; gap: 8px; } .fill span { font-weight: 700; white-space: nowrap; } .fill i { flex: 1; border-bottom: 1.5px solid #000; height: 22px; }
.obsbox { border: 1.5px solid #000; border-radius: 6px; min-height: 120px; padding: 6px 10px; } .obsbox span { font-weight: 700; font-size: 14px; }
@media print {
  .noprint { display: none !important; }
  section.page { border: 0; border-radius: 0; padding: 0; margin: 0; break-after: page; page-break-after: always; }
  section.page:last-child { break-after: auto; page-break-after: auto; }
  span.writebox, .obsbox, .fill i { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .howbox, .mixno, .stepno { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* CMIG */
img.logo { height: 34px; width: auto; }
.brand { display: flex; align-items: center; gap: 14px; margin: 40px 0 16px; } .brand img { height: 64px; } .brand b { font-size: 14px; letter-spacing: .12em; color: #3d5a80 !important; }
.pagehead img.logo { height: 44px; }
@media print { img.logo { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.pagehead .grow { flex: 1; }
