/* The Labels app's plain look: white background, black text, thin grey borders, no colour for normal work.
   The only colour is red, for a message that something must be fixed. */

* { box-sizing: border-box; }

:root { --screen-font: "Segoe UI", Helvetica, Arial, sans-serif; }

/* Something hidden stays hidden, whatever its own style says. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: #ffffff;
  color: #000000;
  font-family: var(--screen-font);
  font-size: 1rem;
  line-height: 1.5;
}

.topbar {
  border-bottom: 1px solid #d0d7de;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 24px;
}
.logo { font-weight: 700; font-size: 1.125rem; }

/* One top bar, same on every screen. The current screen is bold and underlined. */
.nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.nav a { color: #000000; text-decoration: none; }
.nav a:hover { text-decoration: underline; }
.nav a[aria-current="page"] { font-weight: 700; text-decoration: underline; }

.container { max-width: 720px; margin: 24px auto; padding: 0 16px; }
.container.wide { max-width: 1440px; }

/* ---- The QC Inspection Form on screen (inspection-form.html): its 19 columns scroll inside their own box, with the
   header kept in view, so the page itself never scrolls sideways. */
.form-table-wrap { overflow: auto; max-height: 75vh; margin-top: 12px; border: 1px solid #000000; }
table.form-table { border-collapse: separate; border-spacing: 0; font-size: 0.8125rem; }
table.form-table th, table.form-table td { padding: 4px 8px; border-right: 1px solid #d0d7de; border-bottom: 1px solid #d0d7de; text-align: center; white-space: nowrap; }
table.form-table thead th { position: sticky; top: 0; z-index: 1; background: #ffffff; white-space: pre-line; vertical-align: bottom; border-bottom: 2px solid #000000; }
table.form-table td.comments { text-align: left; white-space: normal; min-width: 180px; }
table.form-table .lot-text { white-space: pre; overflow-wrap: normal; }
/* Rows found by "Find in the form": highlighted; the one shown now darker, with a black line above and below. A search
   mark, not a judgement: the app never colours a result. */
table.form-table tr.found td { background: #fff3a8; }
table.form-table tr.current td { background: #ffd84d; border-top: 2px solid #000000; border-bottom: 2px solid #000000; }
.find-steps { margin-top: 8px; }
.find-steps button.small { margin-top: 0; }

h1 { font-size: 1.5rem; margin: 0 0 16px; overflow-wrap: anywhere; }
h2 { font-size: 1.125rem; margin: 0 0 8px; }

a { color: #000000; }

label { display: block; font-weight: 600; margin-bottom: 4px; }
label.spaced { margin-top: 20px; }
.optional { font-weight: 400; font-size: 0.875rem; color: #555555; margin-left: 6px; }

input[type="text"],
input[type="search"],
input[type="password"],
select,
textarea {
  width: 100%;
  font: inherit;
  font-size: 1.125rem;
  padding: 10px 12px;
  border: 1px solid #8c959f;
  border-radius: 0;
  color: #000000;
  background: #ffffff;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #000000; outline-offset: 1px; }

/* Boxes for short values: dates and the number of strips. */
input.short { max-width: 240px; }

/* A lot number, in letters where 0 and O, 1 and l look different. Spaces inside it are shown as typed. */
.lot-text { font-family: Consolas, "Courier New", monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
input.lot-input { font-family: Consolas, "Courier New", monospace; font-size: 1.25rem; max-width: 360px; }

/* Small helper text under a field: the only grey text. */
.help { color: #555555; font-size: 0.875rem; margin: 6px 0 0; }

/* Something to fix, under its field: the only place colour is used. */
.error { color: #b00020; font-weight: 600; margin: 6px 0 0; }
.error:empty { display: none; }

/* "Lot saved." and similar: what just happened, in a plain box. */
.message { border: 2px solid #000000; padding: 10px 14px; margin: 0 0 20px; font-weight: 600; }

/* The one main button: black, white text, large and bold. A link can look like it too ("Add a lot"). */
button.primary, a.primary {
  display: inline-block;
  margin-top: 24px;
  padding: 12px 28px;
  font: inherit;
  font-size: 1.125rem;
  font-weight: 700;
  color: #ffffff;
  background: #000000;
  border: 2px solid #000000;
  border-radius: 0;
  text-decoration: none;
  cursor: pointer;
}
button.primary:disabled { background: #555555; border-color: #555555; cursor: wait; }
a.primary:focus, button:focus { outline: 3px solid #000000; outline-offset: 3px; }

/* Every other button: white, with a thick black border. */
button.secondary {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 26px;
  font: inherit;
  font-size: 1.125rem;
  font-weight: 700;
  color: #000000;
  background: #ffffff;
  border: 3px solid #000000;
  border-radius: 0;
  cursor: pointer;
}
button.secondary:hover, a.secondary:hover { background: #f6f8fa; }

/* A link that looks like a white button ("Change these details"). */
a.secondary {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 22px;
  font-weight: 700;
  color: #000000;
  background: #ffffff;
  border: 3px solid #000000;
  text-decoration: none;
}
a.secondary:focus { outline: 3px solid #000000; outline-offset: 3px; }
.add-new-lot { margin: 0 0 8px; }
.add-new-lot a.secondary { margin-top: 0; }
button.secondary:disabled { color: #555555; border-color: #555555; cursor: wait; }
/* Backups, at the bottom of Lots. */
.backup { margin-top: 12px; border-top: 1px solid #d0d7de; }
.backup-line { margin: 6px 0 0; }
.backup button.secondary { margin-top: 12px; }

.button-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.button-row button.secondary { margin-top: 0; }

/* A title with the screen's main button beside it (Lots: Add a lot). */
.title-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.title-row h1 { margin: 0; }
.title-row a.primary { margin-top: 0; }

.back-link { margin: 0 0 12px; }

/* Lots: the search box, then the two filters side by side. */
.find { margin-bottom: 20px; }
.find input[type="search"] { font-size: 1.25rem; border: 2px solid #000000; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-top: 16px; }
.count { font-weight: 600; margin: 0 0 8px; }

/* Lots: one row per lot, newest first. The lot number opens the lot. */
.lot-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid #d0d7de; }
.lot-list li { padding: 12px 0; border-bottom: 1px solid #d0d7de; }
.lot-list a { font-size: 1.25rem; font-weight: 700; }
.lot-list p { margin: 2px 0 0; overflow-wrap: anywhere; }

/* A lot's details. */
.details { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; }
.details dt { font-weight: 600; }
.details dd { margin: 0; overflow-wrap: anywhere; }
.details .note-text { white-space: pre-wrap; }

/* A lot's changes: one block per "Save changes", newest first, each value before → after. */
.changes { margin-top: 32px; }
.change-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid #d0d7de; }
.change-list > li { padding: 10px 0; border-bottom: 1px solid #d0d7de; }
.change-list .change-who { margin: 0; font-weight: 600; }
.change-list ul { margin: 4px 0 0; padding-left: 20px; }
.change-list li li { overflow-wrap: anywhere; }

/* Delete, at the bottom of a lot's page, asks first on the page (no pop-up). */
.lot-actions { margin-top: 48px; padding-top: 8px; border-top: 1px solid #d0d7de; }
.confirm { border: 2px solid #000000; padding: 16px; margin-top: 16px; }
.confirm p { margin: 0; font-weight: 600; }

/* ---- Test record form (record.html): the paper sheet as a screen. */
.row-fields { display: flex; flex-wrap: wrap; gap: 0 28px; }
.row-fields > div { min-width: 0; }
.row-fields label.spaced { margin-top: 20px; }
input.short-sm { max-width: 190px; }
input.tiny { max-width: 90px; }
input.compare-input { max-width: 240px; }
input:disabled { background: #f6f8fa; color: #555555; border-style: dashed; }
fieldset.strengths { border: 0; margin: 20px 0 0; padding: 0; }
fieldset.strengths legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.strength-boxes { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.strength-boxes label { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; font-size: 1.125rem; }
.strength-boxes input { width: 20px; height: 20px; margin: 0; }
h2.section { margin: 36px 0 4px; }

/* The grid: one group per strength; each strip a row with its Control line and Test line boxes. */
.grid { margin-top: 12px; }
.grid-head, .strip-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 110px; gap: 6px 12px; align-items: center; }
.grid-head { font-weight: 600; font-size: 0.875rem; padding-bottom: 6px; border-bottom: 2px solid #000000; }
.strength-group { padding: 8px 0 10px; border-bottom: 1px solid #d0d7de; }
.strength-name { font-weight: 700; margin-bottom: 4px; }
.strip-row { padding: 2px 0; }
.strip-name { overflow-wrap: anywhere; }
.strip-pos { color: #555555; }
.tag { display: inline-block; margin-left: 8px; padding: 0 7px; border: 1px solid #000000; font-family: var(--screen-font); font-size: 0.75rem; font-weight: 600; vertical-align: 2px; }
input.reading { width: 100%; font: inherit; font-size: 1.125rem; padding: 6px 8px; text-align: center; border: 1px solid #8c959f; border-radius: 0; }
input.reading.invalid { border: 2px solid #b00020; }

/* Photos: a drop place, and the photos as small pictures with their names. */
.drop { border: 2px dashed #8c959f; padding: 14px 16px; margin-top: 8px; }
.drop.over { border-color: #000000; background: #f6f8fa; }
.drop .help { margin-top: 8px; }
.photo-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px; }
.photo-list li { width: 170px; }
.photo-list img { display: block; width: 170px; height: 128px; object-fit: cover; border: 1px solid #d0d7de; background: #f6f8fa; }
.photo-list .removing img { opacity: 0.35; }
.photo-name { margin: 4px 0 0; font-size: 0.875rem; overflow-wrap: anywhere; }
button.small, a.small { margin-top: 6px; padding: 4px 12px; font-size: 0.875rem; border-width: 2px; }

/* ---- Test records on the lot's page. */
.records { margin-top: 40px; }
.records .title-row { margin-bottom: 4px; }
.record { border: 1px solid #8c959f; padding: 16px; margin-top: 16px; }
.record h3 { font-size: 1.25rem; margin: 0 0 2px; }
.record h4 { font-size: 1rem; margin: 20px 0 6px; }
.record-who { margin: 0; overflow-wrap: anywhere; }
.record .details { margin-top: 12px; }

/* ---- The supplier's certificate and test sheets on the lot's page: each file a row, its picture (or "PDF") on the
   left, its name and who added it on the right. */
.supplier { margin-top: 40px; }
.supplier h3 { font-size: 1rem; margin: 24px 0 6px; }
.supplier .message { margin: 12px 0 0; }
.supplier-list { list-style: none; margin: 12px 0 0; padding: 0; }
.supplier-list > li { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 12px 0; border-top: 1px solid #d0d7de; }
.supplier-list > li:last-child { border-bottom: 1px solid #d0d7de; }
.supplier-list .file-link { display: block; flex: none; color: #000000; text-decoration: none; }
.supplier-list img, .supplier-list .pdf-tile { display: block; width: 170px; height: 128px; object-fit: cover; border: 1px solid #d0d7de; background: #f6f8fa; }
.supplier-list .pdf-tile { display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 700; }
.supplier-list .file-text { flex: 1 1 200px; min-width: 0; }
.supplier-list .photo-name { margin: 0; font-size: 1rem; font-weight: 600; }
.supplier-list .file-text .help { margin: 4px 0 0; }
.supplier-list .confirm { flex: 1 1 100%; margin-top: 4px; }
.supplier-list .confirm label { margin-top: 10px; }
.supplier .add-photo { margin-top: 14px; }
#supplier-add > div > button.secondary { margin-top: 14px; }
.table-wrap { overflow-x: auto; margin: 12px 0; }
table.readings { border-collapse: collapse; font-size: 1rem; }
table.readings caption { text-align: left; font-size: 0.875rem; color: #555555; padding-bottom: 4px; }
table.readings th, table.readings td { border: 1px solid #d0d7de; padding: 4px 12px; text-align: center; white-space: nowrap; }
table.readings thead th { font-size: 0.875rem; }
table.readings tbody th { text-align: right; }

/* The first screen: six big job buttons, three in a row (two on a phone), as in the Labels app (Natalia, 19 November
   2026: "add icon on the first screen too (like a label app)"). */
.home-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 16px 0 24px; }
.big-button { display: flex; align-items: center; justify-content: center; min-height: 96px; padding: 16px;
  font-size: 1.25rem; font-weight: 700; text-align: center; color: #000000; background: #ffffff; border: 3px solid #000000;
  text-decoration: none; overflow-wrap: anywhere; }
.big-button:hover { background: #f6f8fa; }
.big-button:focus { outline: 3px solid #000000; outline-offset: 3px; }
h2.lots-title { margin-top: 24px; }

@media (max-width: 600px) {
  .home-buttons { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .big-button { min-height: 80px; font-size: 1.0625rem; }
  .grid-head, .strip-row { grid-template-columns: minmax(0, 1fr) 76px 76px; gap: 6px 8px; }
  .filters { grid-template-columns: 1fr; }
  .details { grid-template-columns: 1fr; gap: 0; }
  .details dd { margin-bottom: 10px; }
}

@media (max-width: 480px) {
  button.primary, button.secondary, a.primary { display: block; width: 100%; text-align: center; }
  .title-row a.primary { width: auto; }
}

/* ---- The printed test sheet (print-sheet.html). Drawn in inches on Letter paper, like the paper sheets in use. */
.title-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.title-actions a.secondary, .title-actions a.primary { margin-top: 0; }
.rows-help { margin-top: 16px; }
p.label { font-weight: 600; margin: 0 0 4px; }
p.label.spaced { margin-top: 20px; }
.qc-shown { font-size: 1.375rem; font-weight: 700; margin: 0; }
.printed-links a.secondary { margin-top: 0; }
.sheet-list { list-style: none; margin: 0; padding: 0; }
.sheet-list li { padding: 10px 0; border-bottom: 1px solid #d0d7de; }
.sheet-line { margin: 0; }
.sheet-list .button-row { margin-top: 6px; }
.sheet-list .button-row a.small, .sheet-list .button-row button.small { margin-top: 0; }
/* "Waiting" on the Lots page: what is not filled in yet, in a plain box. */
.waiting { border: 1px solid #000000; padding: 4px 16px 12px; margin: 16px 0 8px; }
.waiting h2 { margin: 8px 0 0; font-size: 1.125rem; }
/* Each part of the Waiting list is a headline with an arrow (Natalia, 23 November 2026), like the lots. */
.waiting-parts { margin-top: 8px; }
.waiting-parts .archive-headline { font-size: 1.0625rem; }
.waiting-list { margin: 0; padding-left: 20px; }
.waiting-list li { margin: 4px 0; overflow-wrap: anywhere; }
/* A lot's old tests in the Archive: one line each. */
.old-tests { margin-top: 40px; }
.old-list { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px solid #d0d7de; }
.old-list li { padding: 10px 0; border-bottom: 1px solid #d0d7de; overflow-wrap: anywhere; }
.sheet-frame { margin: 12px 0 32px; overflow: hidden; border: 1px solid #d0d7de; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15); }
.sheet {
  width: 8.5in; height: 11in; box-sizing: border-box; padding: 0.3in 0.3in 0.2in;
  background: #ffffff; color: #000000; transform-origin: top left;
  font-family: Arial, Helvetica, sans-serif; --row: 0.55in;
}
.sheet-table { border-collapse: collapse; table-layout: fixed; width: 6.22in; }
.sheet-table thead th { height: 0.5in; padding: 0 0 4px; border: 0; font-size: 17pt; font-weight: 700; text-align: center; vertical-align: bottom; white-space: nowrap; }
.sheet-table thead tr.sheet-labels th { height: auto; padding: 0 0 3px; font-size: 8.5pt; font-weight: 400; }
.sheet-table tbody td { height: var(--row); padding: 0 4px; border: 1px solid #000000; line-height: 1.1; }
.sheet-lot { text-align: center; font-size: 11pt; line-height: 1.2; overflow: hidden; }
.sheet-lot .lot-text { display: block; font-family: Arial, Helvetica, sans-serif; white-space: nowrap; }
.sheet-exp { display: block; font-size: 9.5pt; }
.sheet.tight .sheet-lot { font-size: 9.5pt; line-height: 1.1; }
.sheet.tight .sheet-exp { font-size: 8pt; }
.sheet-strength { padding: 0 !important; text-align: center; }
.sheet-strength span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11pt; white-space: nowrap; }
.sheet-result { text-align: center; font-size: 20pt; line-height: 1 !important; color: #6e7781; }
.sheet.tight .sheet-result { font-size: 15pt; }

@media print {
  .no-print, .topbar { display: none !important; }
  body { margin: 0; background: #ffffff; }
  .container { max-width: none; margin: 0; padding: 0; }
  .sheet-frame { margin: 0; border: 0; box-shadow: none; overflow: visible; width: auto !important; height: auto !important; }
  .sheet { transform: none !important; height: 10.9in; }
}

/* ---- The archive (archive.html): old tests with their sheet photos. */
.archive-about { margin: 0 0 16px; }
label.check { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-weight: 400; }
label.check input { width: 20px; height: 20px; margin: 0; }
.archive-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid #d0d7de; }
.archive-list > li { padding: 0; border-bottom: 1px solid #d0d7de; }
.archive-list p { margin: 2px 0 0; overflow-wrap: anywhere; }
/* The Archive as headlines (Natalia, 19 November 2026): one line per test, an arrow at the side; a click opens it. */
.archive-item > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 12px 36px 12px 4px;
  cursor: pointer; list-style: none; position: relative; }
.archive-item > summary::-webkit-details-marker { display: none; }
.archive-item > summary::after { content: '\25B8'; position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 1.4rem; line-height: 1; }
.archive-item[open] > summary::after { content: '\25BE'; }
.archive-item > summary:hover { background: #f6f8fa; }
.archive-item > summary:focus-visible { outline: 3px solid #000000; outline-offset: -3px; }
.archive-headline { font-size: 1.125rem; font-weight: 700; }
.archive-headline-more { color: #555555; font-size: 0.875rem; }
.archive-body { padding: 0 4px 16px; }
/* The list of lots uses the same headlines (Natalia, 19 November 2026); the lot number as big as before. */
.lots .archive-headline { font-size: 1.25rem; }
.lots .archive-body > a.small { display: inline-block; margin-top: 10px; }
h2.archive-title { margin: 0 0 4px; font-size: 1.25rem; }
.archive-note { font-weight: 600; }
.archive-photos { margin-top: 10px; }
.archive-photos li { width: 190px; }
.archive-photos img { width: 190px; height: 250px; object-fit: contain; }

/* ---- Products & suppliers (products.html). */
.list-name { font-weight: 700; font-size: 1.125rem; }
.add-box { margin-top: 16px; padding: 4px 16px 16px; border: 2px solid #000000; }
.add-box h3 { margin: 12px 0 8px; }
.archive-summary { margin: 8px 0 0; padding-left: 20px; }
.archive-summary li { margin: 2px 0; }
.archive-reading { margin: 12px 0 16px; }
.archive-supplier { margin-top: 16px; padding-top: 8px; border-top: 1px dashed #d0d7de; }
.archive-supplier h3 { font-size: 1rem; margin: 4px 0; }
.archive-coas { margin: 4px 0; padding-left: 20px; }
.archive-compare-title { margin: 10px 0 0; font-weight: 600; }
.archive-reading > .help:first-child { margin-top: 0; }
.add-photo { margin-top: 10px; padding: 4px 14px 12px; border: 2px solid #000000; max-width: 420px; }
.add-photo label { margin-top: 8px; }
