/* Truck door theme: a white door panel, black vinyl block lettering, the door-jamb rating plate, the inspection decal.
   All colours, type and spacing come from these custom properties. A theme only needs to change this block. */
:root {
  --bg: #e4e6e3; --surface: #ffffff; --fg: #15181b; --muted: #57616a; --line: #c9ced2;
  --accent: #15181b; --accent-fg: #ffffff; --accent-soft: #eef0f1; --link: #0a3f7d;
  --plate-hi: #eceff1; --plate-lo: #cdd3d8; --plate-edge: #87919a; --rivet: #7a848c;
  --ok: #1a6b36; --ok-bg: #e4f3e8; --warn: #6b5600; --warn-bg: #fff6bf; --bad: #c2410c; --bad-bg: #ffeedd;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --font-mono: ui-monospace, Menlo, Consolas, monospace;
  --font-block: "Anton", Impact, Haettenschweiler, "Arial Narrow Bold", "Roboto Condensed", sans-serif-condensed, "Helvetica Neue", Arial, sans-serif;
  --radius: 10px; --gap: 1rem; --max: 46rem; --text: 1rem; --text-lg: 1.25rem; --text-xl: 1.9rem; --tap: 2.75rem;
}
/* Anton (SIL Open Font License), the block lettering. */
@font-face { font-family: "Anton"; src: url("/anton-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
* { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: var(--text)/1.5 var(--font); }
a { color: var(--link); }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }

/* vinyl block lettering */
.lettering, h1, .bar .brand { font-family: var(--font-block); font-weight: 400; text-transform: uppercase; letter-spacing: .03em; line-height: 1.05; }

/* top bar: the top edge of the door, closed by a dark panel seam */
header.top { background: var(--surface); border-bottom: 3px solid var(--fg); }
.bar { max-width: var(--max); margin: 0 auto; padding: .6rem var(--gap); display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: center; }
.bar .brand { font-size: 1.6rem; color: var(--fg); text-decoration: none; margin-right: auto; }
.bar nav { display: flex; flex-wrap: wrap; gap: .25rem .9rem; }
.bar nav a, .bar nav button { color: var(--fg); text-decoration: none; padding: .35rem 0; font: inherit; font-weight: 400; background: none; border: 0; border-radius: 0; min-height: 0; cursor: pointer; }
.bar nav a[aria-current="page"] { font-weight: 700; border-bottom: 3px solid var(--fg); }
main { max-width: var(--max); margin: 0 auto; padding: var(--gap); }
footer { max-width: var(--max); margin: 0 auto; padding: var(--gap); color: var(--muted); font-size: .875rem; }
h1 { font-size: var(--text-xl); margin: .75rem 0 1rem; overflow-wrap: anywhere; }
h2 { font-size: var(--text-lg); margin: 1.75rem 0 .5rem; }
h3 { font-size: 1.05rem; margin: 1rem 0 .25rem; }
p { margin: .5rem 0; }
.muted { color: var(--muted); } .small { font-size: .875rem; }

/* a card is a door panel */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--gap); margin: var(--gap) 0; box-shadow: 0 1px 0 #fff inset, 0 1px 2px rgba(0, 0, 0, .06); }
.card > :first-child { margin-top: 0; } .card > :last-child { margin-bottom: 0; }
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }

/* the door-jamb rating plate: stamped metal, a rivet in each corner */
.plate, .stat {
  color: var(--fg); border: 1px solid var(--plate-edge); border-radius: 4px; padding: .9rem 1.1rem; font-family: var(--font-mono);
  background:
    radial-gradient(circle at 9px 9px, var(--rivet) 0 2.5px, transparent 3.5px),
    radial-gradient(circle at calc(100% - 9px) 9px, var(--rivet) 0 2.5px, transparent 3.5px),
    radial-gradient(circle at 9px calc(100% - 9px), var(--rivet) 0 2.5px, transparent 3.5px),
    radial-gradient(circle at calc(100% - 9px) calc(100% - 9px), var(--rivet) 0 2.5px, transparent 3.5px),
    linear-gradient(var(--plate-hi), var(--plate-lo));
}
.stat { text-align: center; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.stat b { display: block; font-size: 2rem; line-height: 1.1; letter-spacing: 0; }
.plate { margin: var(--gap) 0; }
.plate table { font-size: .95rem; } .plate th, .plate td { border-top: 1px solid var(--plate-edge); }
.plate tr:first-child th, .plate tr:first-child td { border-top: 0; }
.plate th { color: var(--fg); font-weight: 400; text-transform: uppercase; letter-spacing: .05em; font-size: .78rem; width: 55%; }

/* the door itself: a company's record */
.door { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 22px 22px var(--radius) var(--radius); padding: 2.25rem 1.25rem 1.5rem; margin: var(--gap) 0; box-shadow: 0 1px 0 #fff inset, 0 2px 6px rgba(0, 0, 0, .1); }
.door::before { content: ""; position: absolute; top: 1rem; right: 1.25rem; width: 3.4rem; height: .8rem; border-radius: .4rem; background: linear-gradient(#3a4046, #15181b); box-shadow: 0 1px 0 rgba(255, 255, 255, .6); }
.door .lettering { margin: 0; }
.door .l1 { font-size: clamp(2rem, 9vw, 3.4rem); margin: .5rem 0 .35rem; }
.door .l2 { font-size: clamp(1.2rem, 5vw, 1.7rem); color: var(--fg); }
.door .l3 { font-size: 1.05rem; color: var(--muted); margin-top: .2rem; }

label { display: block; font-weight: 600; margin: .75rem 0 .2rem; }
.hint { font-weight: 400; color: var(--muted); font-size: .875rem; display: block; }
input, select, textarea { width: 100%; min-height: var(--tap); padding: .5rem .65rem; font: inherit; color: inherit; background: var(--surface); border: 1px solid #98a1a8; border-radius: 6px; }
input[type="checkbox"], input[type="radio"] { width: 1.25rem; min-height: 0; height: 1.25rem; vertical-align: middle; margin-right: .4rem; accent-color: var(--fg); }
label.check { font-weight: 400; display: flex; align-items: center; gap: .4rem; min-height: var(--tap); }
.row { display: grid; gap: 0 var(--gap); grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
button, .btn { display: inline-block; min-height: var(--tap); padding: .55rem 1.1rem; font: inherit; font-weight: 700; color: var(--accent-fg); background: var(--accent); border: 2px solid var(--accent); border-radius: 6px; cursor: pointer; text-decoration: none; text-align: center; }
button.secondary, .btn.secondary { color: var(--accent); background: var(--surface); }
button.danger { color: var(--bad); background: var(--surface); border-color: var(--bad); }
button.link { background: none; border: 0; color: var(--link); padding: 0; min-height: 0; font-weight: 400; text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
form.inline { display: inline; }
.notice { border-radius: var(--radius); padding: .75rem 1rem; margin: var(--gap) 0; border: 1px solid var(--line); border-left-width: 6px; background: var(--surface); }
.notice.warn { background: var(--warn-bg); border-color: var(--warn); color: var(--fg); }
.notice.bad { background: var(--bad-bg); border-color: var(--bad); }
.notice.ok { background: var(--ok-bg); border-color: var(--ok); }

/* status badges are small decals: squared corners, stamped caps */
.badge { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: .15rem .45rem; border-radius: 3px; border: 1.5px solid currentColor; white-space: nowrap; vertical-align: .1em; }
.s-ok { color: var(--ok); background: var(--ok-bg); } .s-due { color: var(--warn); background: var(--warn-bg); }
.s-overdue, .s-missing { color: var(--bad); background: var(--bad-bg); } .oos { color: #fff; background: var(--bad); border-color: var(--bad); }
.unver { color: var(--muted); background: var(--bg); font-weight: 400; text-transform: none; letter-spacing: 0; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain > li { padding: .6rem 0; border-top: 1px solid var(--line); } ul.plain > li:first-child { border-top: 0; }
ol.todo { padding-left: 1.25rem; margin: 0; } ol.todo > li { padding: .45rem 0; }
.cite { color: var(--muted); font-size: .8rem; }
.viol { border-left: 4px solid var(--line); padding: .25rem 0 .25rem .75rem; margin: .6rem 0; }
.viol.is-oos { border-left-color: var(--bad); }
table { width: 100%; border-collapse: collapse; } th, td { text-align: left; padding: .5rem .35rem; border-top: 1px solid var(--line); vertical-align: top; } th { font-size: .85rem; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.big { font-size: 1.6rem; font-weight: 700; } .center { text-align: center; }

/* roadside page */
.road main { max-width: 34rem; } .road .tile { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: .75rem 0; }
.road .tile h2 { margin: 0 0 .25rem; font-size: .85rem; font-family: var(--font-mono); font-weight: 400; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.road .tile .big { margin: 0; } .road .btn { display: block; margin-top: .6rem; }

/* QR sticker */
.actions.tight { margin-top: 0; } .s-name { margin: 0; font-size: 1.4rem; } .s-line { margin: .2rem 0; } .s-url { word-break: break-all; }
.sticker { width: 4in; margin: 1rem auto; padding: .25in; border: 2px solid #000; text-align: center; background: #fff; color: #000; }
.sticker svg { width: 3in; height: 3in; }

/* the yearly inspection decal, printed at 4 x 4 inches. Black on white so it prints on any label stock. */
.decal { width: 4in; min-height: 4in; margin: 1rem auto; background: #fff; color: #000; border: 3px solid #000; border-radius: .18in; overflow: hidden; display: flex; flex-direction: column; font-size: 10pt; line-height: 1.25; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.decal .d-head { background: #000; color: #fff; text-align: center; padding: .09in .1in; font-family: var(--font-block); font-size: 17pt; letter-spacing: .04em; text-transform: uppercase; line-height: 1; }
.decal .d-date { text-align: center; padding: .1in .1in .06in; border-bottom: 2px solid #000; }
.decal .d-date b { display: block; font-family: var(--font-block); font-weight: 400; font-size: 30pt; line-height: 1; letter-spacing: .03em; text-transform: uppercase; }
.decal .d-body { display: flex; gap: .1in; padding: .08in .12in; flex: 1; }
.decal .d-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.decal .d-qr { flex: 0 0 1.05in; text-align: center; font-size: 6.5pt; }
.decal .d-qr svg { width: 1.05in; height: 1.05in; display: block; }
.decal dl { margin: 0; } .decal dt { font-size: 6.5pt; text-transform: uppercase; letter-spacing: .06em; margin-top: .05in; }
.decal dd { margin: 0; font-weight: 700; }
.decal .d-cert { border-top: 2px solid #000; padding: .07in .12in; font-size: 8.5pt; font-weight: 700; text-align: center; }

@media print {
  header.top, footer, .noprint, .notice { display: none !important; }
  body { background: #fff; } main { padding: 0; max-width: none; }
  .sticker, .decal { margin: 0 auto; page-break-inside: avoid; break-inside: avoid; }
}
