/* The only static file this site serves.

   Deliberately one file and deliberately plain: no framework, no web font, no background
   image. style-src 'self' in the Content-Security-Policy exists for this file and nothing
   else, and img-src is data: only - so there is no URL in here that could fetch anything.

   The board is read on a phone at the dock and on a desktop in the office, so the table
   scrolls rather than reflowing into cards: a pallet's net weight in a column the owner can
   run his eye down is the whole point of the page. */

:root {
    --ink: #1b1b1b;
    --paper: #fbfbf9;
    --rule: #cfcfc8;
    --quiet: #6a6a63;
    --organic: #1f7a34;
    --wrong: #9a2520;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    color: var(--ink);
    background: var(--paper);
}

header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 1rem;
    border-bottom: 2px solid var(--ink);
}

header nav { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; }
header a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); }
header a:hover { border-bottom-color: var(--ink); }

main { padding: 1rem; max-width: 1400px; }
main.plain { max-width: 32rem; margin: 4rem auto; }

h1 { font-size: 1.3rem; margin: 0 0 1rem; }
h2 { font-size: 1.05rem; margin: 1.6rem 0 0.5rem; }

table { border-collapse: collapse; width: 100%; margin-bottom: 1.5rem; }
th, td { text-align: left; padding: 0.35rem 0.6rem; border-bottom: 1px solid var(--rule); }
th { font-weight: 600; border-bottom: 2px solid var(--ink); white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.quiet { color: var(--quiet); }

/* The plant-local timestamp and every weight, in a monospaced face. They are shown exactly
   as the station wrote them - never reformatted, never converted - and a fixed-width face is
   what makes a column of them readable and makes a reformatting mistake visible. */
td.asgiven { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

tr.voided td { text-decoration: line-through; color: var(--quiet); }
.organic { color: var(--organic); font-weight: 600; }

form.inline { display: inline; }

fieldset { border: 1px solid var(--rule); margin: 0 0 1.2rem; padding: 0.8rem 1rem 1rem; }
legend { font-weight: 600; padding: 0 0.3rem; }

label { display: block; margin: 0.7rem 0 0.2rem; font-weight: 600; }
input[type=text], input[type=email], input[type=password], select, textarea {
    font: inherit;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--quiet);
    background: #fff;
    width: 100%;
    max-width: 28rem;
}

button {
    font: inherit;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--ink);
    background: #fff;
    cursor: pointer;
}
button:hover { background: #f0f0ea; }

.notice { border-left: 4px solid var(--organic); padding: 0.5rem 0.8rem; background: #fff; }
.problem { border-left: 4px solid var(--wrong); padding: 0.5rem 0.8rem; background: #fff; }

/* The key, shown once. Big, monospaced and selectable, because it is being copied into a box
   on a weigh station by somebody reading it off this screen - and there is no second chance:
   the site stores only its hash. */
.secret {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 1.1rem;
    word-break: break-all;
    background: #fff;
    border: 2px solid var(--wrong);
    padding: 0.8rem;
    user-select: all;
}

.codes { columns: 2; font-family: ui-monospace, Menlo, Consolas, monospace; }
.qr { border: 1px solid var(--rule); background: #fff; padding: 0.5rem; }
