/* 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:#c2410c;
}

*{ 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:#f2a73b; text-decoration:none; }
.toolbar a:hover{ text-decoration:underline; }
.toolbar .tb-actions{ display:flex; gap:10px; align-items:center; }
.toolbar button{
  background:#f2a73b; color:#161006; 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; }

/* ---- 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; }
}
