/* ============================================================
   Crew Checklist -- styles
   Screen: simple, sturdy, large type and tap targets (>= 48px), WCAG AA.
   Print: only the checklist sheet, black on white, Letter or A4.
   No external fonts, CDNs or trackers.
   ============================================================ */
:root {
  --ink: #16213a;
  --muted: #3f4757;
  --bg: #f6f4ef;
  --paper: #fff;
  --line: #c9c4b8;
  --header: #16213a;
  --accent: #c2410c;        /* white text on it: 5.2:1 */
  --accent-dark: #9a3412;
  --accent-soft: #fff1e6;
  --link: #1d4ed8;
  --danger: #9b1c1c;
  --focus: #f2a516;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Liberation Sans", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
/* --ts = site-wide text scale set by the Font size control (100/115/130/145%). */
html { --ts: 1; font-size: calc(112.5% * var(--ts)); -webkit-text-size-adjust: 100%; }
html.text-115 { --ts: 1.15; }
html.text-130 { --ts: 1.30; }
html.text-145 { --ts: 1.45; }
body { margin: 0; font-family: var(--font); font-size: 1rem; line-height: 1.55; color: var(--ink); background: var(--bg); overflow-wrap: break-word; }
.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 1rem; }
main.wrap { padding-top: 1rem; padding-bottom: 3rem; }
main:focus { outline: none; }
h1, h2, h3 { line-height: 1.2; font-weight: 800; }
h1 { font-size: clamp(1.75rem, 4.5vw, 2.5rem); margin: 0.3em 0 0.3em; }
h2 { font-size: clamp(1.3rem, 3vw, 1.6rem); margin: 1.8em 0 0.6em; }
p, li { max-width: 70ch; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { text-decoration-thickness: 3px; }
:focus-visible { outline: 4px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 6px #000; border-radius: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: #000; color: #fff; padding: 0.8rem 1.2rem; z-index: 100; }
.skip-link:focus { left: 0; }
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- header (compact: brand + font size on row 1, one-line nav on row 2) ---------- */
.site-header { background: var(--header); color: #fff; border-bottom: 5px solid var(--accent); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 1rem; padding-top: 0.35rem; padding-bottom: 0.2rem; }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 48px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-logo { height: 2.3rem; width: auto; display: block; }
.text-size { display: inline-flex; align-items: center; gap: 0.3rem; margin-left: auto; }
.text-size-label { font-weight: 700; font-size: 0.9rem; }
.text-size-btn { min-width: 46px; min-height: 46px; border-radius: 10px; border: 2px solid #fff; background: transparent; color: #fff; font-size: 1.35rem; font-weight: 800; line-height: 1; cursor: pointer; }
.text-size-btn:hover:not(:disabled) { background: #2a3858; }
.text-size-btn:disabled { opacity: 0.45; cursor: default; }
.text-size-value { min-width: 2.9em; text-align: center; font-weight: 800; font-size: 0.95rem; }
.site-header nav { flex: 1 1 100%; min-width: 0; margin-left: -0.6rem; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.2rem; overflow-x: auto; scrollbar-width: thin; }
.nav-list li { flex: none; }
.nav-list a { display: inline-flex; align-items: center; min-height: 46px; padding: 0.2rem 0.75rem; color: #fff; text-decoration: none; font-weight: 700; border-radius: 99px; border: 2px solid transparent; white-space: nowrap; }
.nav-list a:hover { border-color: rgba(255,255,255,.6); }
.nav-list a[aria-current] { background: #fff; color: var(--ink); }
@media (min-width: 1000px) { .site-header nav { flex: 0 1 auto; order: 2; margin-left: 0; } .text-size { order: 3; margin-left: 0; } .brand { margin-right: auto; } }

/* ---------- intro ---------- */
.intro-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.2rem; margin-bottom: 1rem; }
.lead { font-size: 1.1rem; margin: 0; flex: 1 1 22rem; }
.howto-jump { flex: none; }

/* ---------- buttons + fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 52px; padding: 0.55rem 1.15rem;
  border-radius: var(--radius); border: 2px solid var(--accent-dark); background: var(--accent); color: #fff; font: inherit; font-weight: 800;
  text-decoration: none; cursor: pointer; text-align: center; max-width: 100%; }
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn.secondary { background: var(--paper); color: var(--ink); border-color: var(--ink); }
.btn.secondary:hover { background: var(--accent-soft); color: var(--ink); }
.btn.small { min-height: 46px; padding: 0.35rem 0.9rem; font-size: 0.95rem; }
.btn.big { min-height: 58px; font-size: 1.1rem; padding: 0.6rem 1.5rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.8rem 0; }
.panel { background: var(--paper); border: 2px solid var(--ink); border-radius: 16px; padding: 0.4rem 1.2rem 1rem; }
.form-step { padding: 1rem 0 1.1rem; border-bottom: 2px dashed var(--line); }
.form-step:last-child { border-bottom: 0; }
.step-h { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin: 0 0 0.8rem; font-size: 1.3rem; }
.step-badge { display: inline-flex; align-items: center; min-height: 2.1rem; padding: 0.1rem 0.85rem; border-radius: 99px; background: var(--accent); color: #fff; font-size: 1rem; font-weight: 800; }
.step-note { font-weight: 600; font-size: 1rem; color: var(--muted); }
.field { margin: 0 0 0.75rem; min-width: 0; }
.field > label, .field > .label { display: block; font-weight: 700; margin-bottom: 0.2rem; }
input[type=text], input[type=tel], input[type=email], input[type=date], select {
  width: 100%; min-height: 50px; padding: 0.45rem 0.7rem; font: inherit; color: var(--ink); background: #fff;
  border: 2px solid #5b6476; border-radius: 10px; }
input:hover, select:hover { border-color: var(--ink); }
.field-tpl, .field-title { max-width: 32rem; }
fieldset { border: 2px solid var(--line); border-radius: var(--radius); padding: 0.6rem 1rem 0.4rem; margin: 0; min-width: 0; }
legend { font-weight: 800; padding: 0 0.4rem; font-size: 1.1rem; }
.details-grid { display: grid; gap: 1rem; }
@media (min-width: 820px) { .details-grid { grid-template-columns: 1fr 1fr; } }
.field-pair { display: grid; gap: 0 0.8rem; }
@media (min-width: 520px) { .field-pair { grid-template-columns: 1fr 1fr; } }
.hint { color: var(--muted); font-size: 0.95rem; margin: 0.2rem 0 0.6rem; }
.logo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.logo-row:focus-within .file-btn { outline: 4px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 6px #000; }
.logo-thumb { max-height: 52px; max-width: 140px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.choice { display: inline-flex; align-items: center; gap: 0.55rem; min-height: 50px; font-weight: 700; cursor: pointer; }
.choice input { width: 1.5rem; height: 1.5rem; accent-color: var(--accent); }
.options-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 1rem; }
.options-row .field { flex: 1 1 12rem; max-width: 20rem; }
.options-row .choice { margin-bottom: 0.75rem; }
.drafts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.drafts-open { display: flex; flex-wrap: wrap; gap: 0.6rem; flex: 1 1 18rem; min-width: 0; }
.drafts-open[hidden] { display: none; }
.drafts-open select { flex: 1 1 100%; width: 100%; min-width: 0; }
.confirm-box { background: var(--accent-soft); border: 2px solid var(--accent); border-left-width: 8px; border-radius: var(--radius); padding: 0.6rem 1rem; margin: 0.8rem 0; }
.confirm-box p { margin: 0.2rem 0 0; font-weight: 700; }
.confirm-box[hidden] { display: none; }
.status { min-height: 1.6em; margin: 0.6rem 0 0; font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.notice { background: var(--accent-soft); border: 2px solid var(--accent); border-radius: var(--radius); padding: 0.4rem 1rem; margin-bottom: 1rem; }

/* ---------- item editor ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.9rem; margin: 0.4rem 0 0.9rem; }
.sec-card { border: 2px solid var(--line); border-radius: var(--radius); padding: 0.6rem; background: #fbfaf7; }
.sec-head, .items li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.sec-head .sec-toggle { flex: 0 1 auto; min-width: 0; justify-content: flex-start; }
.chev { display: inline-block; width: 1em; }
.sec-body { margin-top: 0.5rem; }
.sec-head .sec-title { flex: 1 1 11rem; width: auto; min-width: 0; font-weight: 800; background: #eef0f4; }
.items { list-style: none; margin: 0 0 0.5rem; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.4rem; }
.items li { max-width: none; }
.items .item-text { flex: 1 1 11rem; width: auto; min-width: 0; }
.row-btns { display: flex; gap: 0.3rem; flex: none; margin-left: auto; }
.icon-btn { width: 48px; height: 48px; border-radius: 10px; border: 2px solid var(--ink); background: #fff; color: var(--ink); font-size: 1.35rem; font-weight: 800; line-height: 1; cursor: pointer; display: inline-grid; place-items: center; padding: 0; }
.icon-btn:hover:not(:disabled) { background: var(--accent-soft); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.icon-btn.danger { color: var(--danger); border-color: var(--danger); }

/* ---------- preview ---------- */
.preview { margin-top: 1.4rem; }
.preview-bar { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.2rem 1rem; }
.preview-bar h2 { margin: 0 0 0.5rem; }
.print-ready { margin: 0.35rem 0 0.6rem; outline: none; }
.print-ready:focus { outline: 3px solid var(--accent, #f2a516); outline-offset: 2px; }
.preview-actions { margin: 0.9rem 0 0.2rem; display: flex; flex-direction: column; align-items: stretch; gap: 0.55rem; }
.preview-actions .btn-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.preview-actions .btn.big { flex: 1 1 10rem; }
.edit-back { align-self: flex-start; font-weight: 700; font-size: 0.95rem; min-height: 44px; display: inline-flex; align-items: center; text-decoration: underline; }
#print-preview { scroll-margin-top: 0.5rem; }
#step-edit, #step-print { scroll-margin-top: 0.5rem; }
.print-btns-form { margin-top: 0.5rem; }
@media (max-width: 600px) {
  .preview-actions .btn-row { flex-direction: column; }
  .preview-actions .btn.big { width: 100%; flex: 1 1 auto; }
}
.page-est { color: var(--muted); font-weight: 700; }
.preview-frame { overflow: hidden; position: relative; }
.preview-scale { transform-origin: top left; width: max-content; }

/* ---------- after the output ---------- */
.next-step { margin-top: 1.6rem; background: var(--paper); border: 2px solid var(--ink); border-radius: 16px; padding: 0.4rem 1.2rem 1rem; }
.next-step h2 { margin-top: 0.7rem; }
.next-all { margin: 0.8rem 0 0; }
.next-all a { display: inline-flex; align-items: center; min-height: 48px; font-weight: 700; }
.tpl-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.tpl-cards li { max-width: none; }
.tpl-card { display: flex; align-items: center; gap: 0.7rem; min-height: 60px; height: 100%; padding: 0.5rem 0.8rem; border: 2px solid var(--ink); border-radius: var(--radius); background: #fff; color: var(--ink); font-weight: 800; text-decoration: none; }
.tpl-card:hover { background: var(--accent-soft); color: var(--ink); }
.tpl-ico { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); flex: none; font-size: 1.2rem; }
.referral { margin-top: 1rem; padding: 0.6rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; font-size: 0.95rem; }
.referral[hidden] { display: none; }
.referral-note { color: var(--muted); font-size: 0.85rem; margin: 0.2rem 0 0; }

/* ---------- how to + FAQ ---------- */
.howto { margin-top: 2rem; scroll-margin-top: 0.5rem; }
.howto-steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.howto-steps li { counter-increment: s; display: flex; align-items: center; gap: 0.8rem; max-width: 46rem; }
.howto-steps li::before { content: counter(s); flex: none; display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 800; }
.how-ico { display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; flex: none; border-radius: 10px; background: var(--accent-soft); color: var(--accent-dark); font-size: 1.3rem; }
.back-top a { display: inline-flex; align-items: center; min-height: 48px; font-weight: 700; }
.faq { border: 2px solid var(--line); border-radius: var(--radius); background: #fff; margin: 0 0 0.6rem; max-width: 50rem; }
.faq summary { min-height: 52px; padding: 0.7rem 1rem; font-weight: 800; cursor: pointer; display: list-item; }
.faq-a { padding: 0 1rem 0.4rem; }
.faq-a p { margin: 0 0 0.6rem; }
.page-info main p, .page-info main li { font-size: 1.05rem; }

/* ---------- footer ---------- */
.site-footer { background: var(--header); color: #fff; padding: 1.2rem 0 1.6rem; margin-top: 2rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 1.2rem; }
.footer-links a { color: #fff; display: inline-flex; align-items: center; min-height: 46px; font-weight: 600; }
.footer-templates { border-bottom: 1px solid #45506b; padding-bottom: 0.4rem; margin-bottom: 0.4rem; }
.site-footer p { margin: 0.6rem 0 0; font-size: 0.95rem; }

@media (max-width: 600px) {
  .wrap { padding: 0 0.75rem; }
  .panel, .next-step { padding-left: 0.75rem; padding-right: 0.75rem; }
  .sec-card { padding: 0.45rem; }
  .tg-verb { display: none; }
  .row-btns { gap: 0.25rem; }
  .icon-btn { width: 46px; height: 46px; }
  .sec-head .sec-title { flex-basis: 100%; }
  .brand-logo { height: 2rem; }
  .text-size-label { font-size: 0.85rem; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* ============================================================
   THE CHECKLIST SHEET (screen preview + print)
   Layout lives on .sheet; look lives in the PRINT DESIGNS section.
   Units are pt/in so the preview matches paper.
   ============================================================ */
.sheet {
  --fs: 10pt; --row: 17pt; --sh-gap: 7pt; --ln: 18pt; --sig: 24pt;
  width: 8.5in; min-height: 11in; padding: 0.4in; background: #fff; color: #000;
  font: var(--fs)/1.2 Arial, "Liberation Sans", Helvetica, sans-serif;
  box-shadow: 0 1px 4px rgba(0,0,0,.25); border: 1px solid #b9b4aa;
}
.sheet[data-paper="a4"] { width: 210mm; min-height: 297mm; }
.sheet[data-density="compact"] { --fs: 9.5pt; --row: 14pt; --sh-gap: 5pt; --ln: 15pt; --sig: 20pt; }
.sheet[data-density="tight"] { --fs: 8.5pt; --row: 12.5pt; --sh-gap: 4pt; --ln: 14pt; --sig: 18pt; }
.sh-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12pt; padding-bottom: 5pt; }
.sh-biz { display: flex; align-items: center; gap: 8pt; min-width: 0; }
.sh-logo { max-height: 0.55in; max-width: 1.7in; object-fit: contain; }
.sh-biz-name { font-size: 13pt; font-weight: 700; }
.sh-biz-meta { font-size: 8.5pt; margin-top: 1pt; }
.sh-biz-meta .nw { white-space: nowrap; }
.sh-title { font-size: 15pt; font-weight: 700; text-align: right; margin-left: auto; }
.sh-job { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3pt 12pt; margin: var(--sh-gap) 0; }
.sh-field { grid-column: span 4; display: flex; align-items: flex-end; gap: 4pt; min-height: 15pt; padding-bottom: 1pt; min-width: 0; }
.sh-c3 { grid-column: span 3; } .sh-c4 { grid-column: span 4; } .sh-c8 { grid-column: span 8; }
.sh-label { font-size: 7.5pt; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; white-space: nowrap; }
.sh-val { font-size: var(--fs); flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sh-field.sh-c3 { flex-direction: column; align-items: stretch; gap: 0; }
.sh-c3 .sh-val { min-height: 1.2em; }
.blank { display: inline-block; width: 0.45in; height: 0.9em; vertical-align: baseline; }
.sheet[data-design="classic"] .blank { border-bottom: 0.75pt solid #000; }
.sh-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.sh-table col.c-chk { width: 0.6in; }
.sh-table col.c-notes { width: 1.9in; }
.sh-table th, .sh-table td { padding: 1pt 4pt; vertical-align: middle; }
.sh-table thead th { font-size: 7.5pt; font-weight: 700; line-height: 1.05; text-align: center; padding: 2pt 2pt 3pt; }
.sh-table thead th.sh-item, .sh-table thead th.sh-notes { text-align: left; padding-left: 4pt; }
.sh-table td { height: var(--row); }
.sh-table td.sh-chk { text-align: center; padding: 0; }
.box { display: inline-block; width: 9pt; height: 9pt; vertical-align: middle; }
.sh-sec th { text-align: left; font-weight: 700; padding: 2.5pt 4pt; }
.sh-notesbox { margin-top: var(--sh-gap); }
.sh-notesbox .ln { display: block; height: var(--ln); }
.sh-sign { display: grid; grid-template-columns: 3fr 1.3fr 3fr 1.3fr; gap: 0 12pt; margin-top: calc(var(--sh-gap) + 2pt); }
.sh-sigline { display: block; height: var(--sig); }

/* ---------- PRINT DESIGNS ----------
   Each design is one block keyed on .sheet[data-design="<id>"] (ids listed in checklist-core.js DESIGNS).
   To add a premium design later: copy the classic block, change the variables/rules, add it to DESIGNS. */
.sheet[data-design="classic"] { --rule: #8a8a8a; --sec-bg: #e6e6e6; --strong: #000; }
.sheet[data-design="classic"] .sh-head { border-bottom: 2pt solid var(--strong); }
.sheet[data-design="classic"] .sh-field { border-bottom: 0.75pt solid var(--strong); }
.sheet[data-design="classic"] .sh-table thead th { border-bottom: 1.5pt solid var(--strong); }
.sheet[data-design="classic"] .sh-table td { border-bottom: 0.75pt solid var(--rule); }
.sheet[data-design="classic"] .sh-table td.sh-notes { border-left: 0.75pt solid var(--rule); }
.sheet[data-design="classic"] .sh-sec th { background: var(--sec-bg); border-top: 0.75pt solid var(--strong); }
.sheet[data-design="classic"] .box { border: 1.2pt solid var(--strong); border-radius: 1pt; }
.sheet[data-design="classic"] .sh-notesbox .ln { border-bottom: 0.75pt solid var(--rule); }
.sheet[data-design="classic"] .sh-sigline { border-bottom: 0.75pt solid var(--strong); }

/* ---------- print ---------- */
@page { size: letter; margin: 0.4in; }
@media print {
  html, html.text-115, html.text-130, html.text-145 { font-size: 12pt !important; --ts: 1; }
  body { background: #fff; }
  .site-header, .site-footer, .skip-link, .no-print, main > :not(.tool), .tool > :not(.preview) { display: none !important; }
  main.wrap { padding: 0; max-width: none; }
  .preview { margin: 0; }
  .preview-frame { height: auto !important; overflow: visible; }
  .preview-scale { transform: none !important; width: auto; }
  .sheet, .sheet[data-paper="a4"] { width: auto; min-height: 0; padding: 0; border: 0; box-shadow: none; }
  .sh-table tr, .sh-notesbox, .sh-sign { break-inside: avoid; }
  .sh-sign { break-before: avoid; }
  .sheet * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media screen and (max-width: 560px) { .nav-list .nav-wide { display: none; } }
.tpl-group { font-size: 1.15rem; margin: 1.2rem 0 0.5rem; scroll-margin-top: 0.5rem; }
