/* Shared styling for the blank form pack.
   ---------------------------------------------------------------
   These are meant to be PRINTED, on a clipboard, in the sun, and
   filled in with a pen that may be running out. Everything here
   serves that: black on white, no shading behind anything anyone
   has to write in, ruled lines rather than boxes-with-hints, and
   type large enough to read at arm's length on a tailgate.

   An external stylesheet rather than inlined per file because
   there are six pages that must stay visually identical. It is
   same-origin, so it loads under the site's CSP posture with no
   CDN involved.

   Print target is US Letter. Set browser margins to Default and
   turn OFF "Headers and footers" - a browser-injected URL across
   the top of a signed quality record looks unserious.
*/

:root{
  --ink:#000;
  --rule:#555;
  --faint:#888;
  --accent:#0f766e;
}

*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }
body{
  background:#525659;                 /* the grey around the "paper" on screen */
  color:var(--ink);
  font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;
  font-size:11px;
  -webkit-print-color-adjust:exact;
  print-color-adjust:exact;
}

/* ---- On-screen toolbar. Never printed. ---- */
.toolbar{
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  flex-wrap:wrap;
  padding:12px 20px; background:#1a2126; color:#e8ebed;
  font-size:13px;
}
.toolbar a{ color:#2FB5A4; text-decoration:none; }
.toolbar a:hover{ text-decoration:underline; }
.toolbar .tb-actions{ display:flex; gap:10px; align-items:center; }
.toolbar button{
  background:#2FB5A4; color:#06231f; border:none; border-radius:2px;
  padding:8px 16px; font-size:12px; font-weight:600; letter-spacing:.4px;
  text-transform:uppercase; cursor:pointer; font-family:inherit;
}
.toolbar .tb-hint{ color:#8f9aa3; font-size:11.5px; }

/* ---- The sheet ---- */
.sheet{
  background:#fff;
  width:8.5in; min-height:11in;
  margin:22px auto; padding:0.45in 0.5in;
  box-shadow:0 2px 14px rgba(0,0,0,.4);
}
.sheet.landscape{ width:11in; min-height:8.5in; }
.sheet.tabloid{ width:17in; min-height:11in; }

/* Isometric drawing area (11x17 iso sheet only).
   Three line sets - 30deg, 150deg, vertical - as stacked repeating
   gradients. print-color-adjust keeps the print pipeline from discarding
   them as background decoration, which is exactly what it does by default
   and would leave a blank box on paper. */
.draw-area{ border:1px solid var(--ink); height:5.4in; margin-bottom:9px; }
.draw-area.grid{
  background-image:
    repeating-linear-gradient(30deg,  rgba(0,0,0,.17) 0 .5px, transparent .5px 0.25in),
    repeating-linear-gradient(150deg, rgba(0,0,0,.17) 0 .5px, transparent .5px 0.25in),
    /* Verticals must land on the 30/150 intersections or the grid reads as
       two unrelated patterns. For perpendicular spacing d, those columns are
       exactly d apart: dc = d/cos30, and x-spacing = dc/(2*tan30) = d. */
    repeating-linear-gradient(90deg,  rgba(0,0,0,.13) 0 .5px, transparent .5px 0.25in);
  -webkit-print-color-adjust:exact; print-color-adjust:exact;
}

/* ---- Masthead ---- */
.mast{ display:flex; justify-content:space-between; align-items:flex-start;
       border-bottom:2px solid var(--ink); padding-bottom:7px; margin-bottom:10px; }
.mast h1{ font-size:19px; margin:0 0 2px; letter-spacing:.5px; text-transform:uppercase; }
.mast .sub{ font-size:10px; color:#444; }
.mast .brandbox{ text-align:right; font-size:9.5px; line-height:1.5; color:#333; }
.mast .brandbox b{ font-size:13px; letter-spacing:1.5px; display:block; color:#000; }
/* The shop's own logo (step 39), set above its name when it has one. */
.mast .brandbox .brand-logo{ display:block; max-height:12mm; max-width:46mm; margin:0 0 3px auto; object-fit:contain; }

/* ---- Project header strip ---- */
.hdr{ display:grid; grid-template-columns:repeat(4,1fr); gap:0;
      border:1px solid var(--ink); margin-bottom:10px; }
.hdr > div{ border-right:1px solid var(--rule); padding:4px 6px 3px; min-height:34px; }
.hdr > div:last-child{ border-right:none; }
.hdr .k{ font-size:8px; text-transform:uppercase; letter-spacing:.6px; color:#444; display:block; }
/* Injected by the app's Blank Forms tab when a stack is stamped with the job.
   Absent on the public blanks, which stay empty by design. */
.hdr .hv{ font-size:11.5px; padding-top:3px; line-height:1.25; }

/* ---- Generic labelled write-on lines ---- */
.grid{ display:grid; gap:0 14px; margin-bottom:9px; }
.g2{ grid-template-columns:1fr 1fr; }
.g3{ grid-template-columns:1fr 1fr 1fr; }
.g4{ grid-template-columns:repeat(4,1fr); }
.g5{ grid-template-columns:repeat(5,1fr); }
.f{ margin-bottom:9px; }
.f label{ display:block; font-size:8.5px; text-transform:uppercase; letter-spacing:.6px; color:#333; margin-bottom:1px; }
.f .line{ border-bottom:1px solid var(--ink); height:17px; }
.f .line.tall{ height:26px; }

/* ---- Checkbox option rows ---- */
.opts{ display:flex; flex-wrap:wrap; gap:3px 14px; padding-top:2px; }
.opt{ display:flex; align-items:center; gap:5px; font-size:10px; }
.box{ width:11px; height:11px; border:1px solid var(--ink); flex:none; display:inline-block; }

/* ---- Free-text blocks ---- */
.block{ border:1px solid var(--ink); margin-bottom:9px; }
.block .bh{ font-size:8.5px; text-transform:uppercase; letter-spacing:.6px;
            padding:3px 6px; border-bottom:1px solid var(--rule); background:#f2f2f2; }
.block .lines{ padding:0 6px; }
.block .lines div{ border-bottom:1px solid #bbb; height:18px; }
.block .lines div:last-child{ border-bottom:none; }

/* ---- Log tables ---- */
table.log{ width:100%; border-collapse:collapse; margin-bottom:9px; }
table.log th{
  border:1px solid var(--ink); padding:4px 3px; font-size:8px;
  text-transform:uppercase; letter-spacing:.4px; background:#f2f2f2; text-align:left;
}
table.log td{ border:1px solid var(--rule); height:23px; padding:2px 3px; }
table.log tr{ page-break-inside:avoid; }
table.log .num{ width:26px; text-align:center; font-size:9px; color:#666; }

/* ---- Signature blocks ---- */
.sigs{ display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-top:14px; }
.sig .sigline{ border-bottom:1px solid var(--ink); height:30px; }
.sig .siglabel{ font-size:8px; text-transform:uppercase; letter-spacing:.6px; color:#333; padding-top:2px; }

/* ---- Footer ---- */
.foot{ margin-top:14px; padding-top:5px; border-top:1px solid var(--rule);
       display:flex; justify-content:space-between; font-size:8px; color:#555; }
.foot .credit{ color:#666; }
.foot .credit b{ color:#000; letter-spacing:1px; }

.note{ font-size:8.5px; color:#555; font-style:italic; margin:-4px 0 9px; }

/* =========================================================
   PRINT
   ========================================================= */
@page{ size:Letter portrait; margin:0.45in; }
@page landscape{ size:Letter landscape; }

@media print{
  body{ background:#fff; font-size:10.5px; }
  .toolbar{ display:none !important; }
  .no-print{ display:none !important; }
  /* The variants must be listed explicitly. `.sheet{min-height:0}` is one
     class; `.sheet.landscape{min-height:8.5in}` is two, so the floor wins on
     specificity and the box stays 8.5in tall inside a 7.7in printable area -
     which pushes a blank second page out of every landscape sheet.
     weld-map, punch-list and iso-sheet all shipped with that fault. It is
     invisible on screen and invisible to any check that measures content
     rather than the box, which is exactly how it survived. */
  .sheet,
  .sheet.landscape,
  .sheet.tabloid{
    width:auto; min-height:0; margin:0; padding:0;
    box-shadow:none; background:#fff;
  }
  /* Headings and table headers repeat sensibly if a log runs long. */
  table.log thead{ display:table-header-group; }
  .sigs, .block, .hdr{ page-break-inside:avoid; }
  a{ text-decoration:none; color:#000; }
}

/* ---- Sign-off rows (added 2026-10-06) ----
   One line per role: print name, signature, date. Where the sigs block above
   is three loose signatures for a sheet, this is a stack of named roles - the
   release stages on an exchanger closure carry five of them in a row. */
.sigrows{ margin-bottom:3px; }
.sigrow{ display:grid; grid-template-columns:118px 1fr 1.3fr 92px; gap:0 10px; align-items:end; margin-bottom:2px; }
.sigrow .role{ font-size:9px; color:#000; padding-bottom:1px; white-space:nowrap; }
.sigrow .sigcell{ border-bottom:1px solid var(--ink); height:15px; position:relative; }
.sigrow .sigcell.sigimgcell{ height:19px; }
.sigrow .sigcap{ font-size:6.5px; text-transform:uppercase; letter-spacing:.5px; color:#555; grid-column:2 / span 3;
  display:grid; grid-template-columns:1fr 1.3fr 92px; gap:0 10px; margin-top:-2px; margin-bottom:1px; }
.sigrow .sigcell img{ position:absolute; left:2px; bottom:0; max-height:19px; max-width:100%; }
.sigrow .sigcell .fv{ font-size:9.5px; line-height:17px; }
.sh{ font-size:9px; font-weight:700; text-transform:uppercase; letter-spacing:.6px; color:#000;
     border-bottom:1px solid var(--ink); padding:3px 0 1px; margin:3px 0 3px; }
table.log.comp td{ height:17px; padding:1px 3px; font-size:9px; }
table.log.comp th{ padding:2px 3px; font-size:7.5px; text-align:center; }
table.log.comp td .box{ width:9px; height:9px; }
table.log.comp td .opts{ gap:2px 6px; padding-top:0; justify-content:center; }
table.log.comp td .opt{ font-size:8px; gap:2px; }
table.log.comp .rowlabel{ font-size:9px; text-align:left; width:92px; }

/* ---- Fill the sheet (added 2026-10-06) ----
   A form that stops two-thirds of the way down a Letter page and leaves the
   bottom third white looks unfinished on a clipboard, and wastes the room a
   crew could be writing in. Every sheet is now a column that is exactly one
   printable page tall: the footer sits on the bottom edge, and the parts
   that can usefully be taller - log tables, ruled blocks, sign-off rows,
   write-on lines - share the spare height between them. Nothing here changes
   what is on a sheet, only how far down the page it reaches.

   Weights: a table or a ruled block takes the lion's share, a sign-off stack
   next, and plain write-on lines a little, so a sheet that is mostly fields
   gets lines a pen can actually use rather than one enormous comments box. */
.sheet{ display:flex; flex-direction:column; }
.sheet > *{ flex:0 0 auto; }
.sheet > .foot{ margin-top:auto !important; }  /* beats a per-form pagecss margin */
.sheet > table.log, .sheet > .block, .sheet > .draw-area{ flex:1 1 auto; }
.sheet > .sigrows{ flex:0.8 1 auto; display:flex; flex-direction:column; justify-content:space-evenly; }
.sheet > .sigrows .sigrow{ flex:1 0 auto; }
.sheet > .grid, .sheet > .f{ flex:0.4 1 auto; }
.sheet > .sigs{ flex:0.3 1 auto; }
.sheet > .sigs .sig{ display:flex; flex-direction:column; }
.sheet > .sigs .sig .sigline{ flex:1 0 auto; max-height:44px; }
.sheet .block{ display:flex; flex-direction:column; }
.sheet .block .lines{ flex:1 1 auto; display:flex; flex-direction:column; }
.sheet .block .lines div{ flex:1 0 auto; }
.sheet .grid{ align-items:stretch; }
.sheet .grid > .f, .sheet > .f{ display:flex; flex-direction:column; }
.sheet .grid > .f .line, .sheet > .f .line{ flex:1 0 auto; max-height:30px; }
.sheet .grid > .f .line.tall, .sheet > .f .line.tall{ max-height:40px; }
.sheet .grid > .f .opts, .sheet > .f .opts{ flex:0 0 auto; }
/* Two sheets in one document - a form with a back, or a record with a
   continuation - are two pages, never one and a bit. */
.sheet + .sheet{ page-break-before:always; break-before:page; }

@media print{
  /* Exactly the printable area of Letter inside the @page margins above. A
     fixed height, not min-height: the footer has to know where the bottom is.
     The landscape variant is listed on its own so its height beats the
     portrait one on specificity - see the note above about min-height. */
  .sheet{ height:10.1in; }
  .sheet.landscape{ height:7.7in; }
  .sheet.tabloid{ height:10.2in; }
}
