/* ContinuityLog — "the audit document, stamped."
   Steel above (hero = blued plate), certificate paper below (the paperwork).
   Signature element: inspection-stamp statuses. Everything else stays quiet. */
:root {
  --plate-900: #1a222b;   /* blued steel plate (hero, header) */
  --plate-800: #232d38;
  --paper: #f4f6f5;       /* cool certificate paper — page ground */
  --paper-raised: #fdfefd;/* panel surface */
  --ink: #1c2429;         /* document ink */
  --ink-soft: #55636e;    /* steel-gray secondary ink */
  --line: #c9d2d6;        /* hairline rules */
  --line-strong: #9fadb5;
  --safety: #e45a12;      /* high-vis orange: CTA + focus only */
  --safety-dark: #c34a0b;
  --stamp-green: #22714b;
  --stamp-amber: #9a6700;
  --stamp-red: #bf3226;
  --radius: 3px;          /* documents have corners, not pills */
  --max: 68rem;
  --display: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --body: "Barlow", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  font-size: 1rem;
}
img { max-width: 100%; }
a { color: var(--safety-dark); }
a:hover { color: var(--safety); }
h1, h2, h3 {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.035em;
  line-height: 1.12;
  color: var(--ink);
}
h1 { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 700; margin: 0 0 0.6rem; }
h2 { font-size: clamp(1.35rem, 3vw, 1.85rem); font-weight: 600; margin: 2.2rem 0 0.7rem; }
h3 { font-size: 1.2rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
p { margin: 0.6rem 0; }
code {
  font-family: var(--mono);
  background: #e8ecea;
  padding: 0.08em 0.35em;
  border-radius: 2px;
  font-size: 0.88em;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1rem; }

/* Header / nav — steel plate */
.site-head { background: var(--plate-900); color: #fff; border-bottom: 3px solid var(--safety); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 0.7rem; padding-bottom: 0.7rem; flex-wrap: wrap; }
.brand {
  color: #fff; text-decoration: none;
  font-family: var(--display); font-weight: 700; font-size: 1.35rem;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.brand .tick { color: var(--safety); }
.site-head nav { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.site-head nav a {
  color: #cdd7de; text-decoration: none;
  font-family: var(--display); text-transform: uppercase;
  letter-spacing: 0.07em; font-size: 0.95rem;
}
.site-head nav a:hover { color: var(--safety); }

/* Hero — the steel plate the paperwork sits on */
.hero {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 72px),
    linear-gradient(180deg, var(--plate-900), var(--plate-800));
  background-size: 100% 72px, 100% 100%;
  color: #fff;
  padding: 3rem 0 2.6rem;
  border-bottom: 1px solid var(--line-strong);
}
.hero h1 { color: #fff; max-width: 46rem; }
.hero p.sub { color: #c2cdd6; font-size: 1.08rem; max-width: 42rem; margin-top: 0.5rem; }
.hero .points { display: flex; gap: 0.6rem 1.6rem; flex-wrap: wrap; margin-top: 1.3rem; padding: 0; list-style: none; }
.hero .points li {
  color: #dbe3e9; font-family: var(--mono); font-size: 0.82rem;
  padding-left: 1.1rem; position: relative;
}
.hero .points li::before { content: "\25A0"; color: var(--safety); position: absolute; left: 0; font-size: 0.6rem; top: 0.3rem; }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--safety); color: #fff;
  border: none; border-radius: var(--radius);
  padding: 0.6rem 1.2rem; font-size: 0.98rem;
  font-family: var(--display); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--safety-dark); color: #fff; }
.btn.secondary { background: var(--plate-800); }
.btn.secondary:hover { background: var(--plate-900); }
.btn.small { padding: 0.3rem 0.7rem; font-size: 0.82rem; }
.btn.ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--line); font-weight: 600; }
.btn.ghost:hover { border-color: var(--line-strong); color: var(--ink); background: #eef1f0; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--safety); outline-offset: 2px;
}

/* Panels — sheets of the document */
.panel {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-top: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  margin: 1.4rem 0;
}
.panel h2:first-child, .panel h3:first-child { margin-top: 0.2rem; }

/* Forms */
label {
  display: block;
  font-family: var(--mono); font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-soft); margin-bottom: 0.25rem;
}
input[type="text"], input[type="date"], input[type="email"], select {
  width: 100%; padding: 0.5rem 0.6rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  font-size: 1rem; font-family: var(--body); background: #fff; color: var(--ink);
}
input[type="date"] { font-family: var(--mono); font-size: 0.92rem; }
input:focus, select:focus { outline: 2px solid var(--safety); outline-offset: 1px; }
.form-row { display: flex; gap: 0.8rem; flex-wrap: wrap; align-items: flex-end; }
.form-row > div { flex: 1 1 10rem; }
.form-row > .actions { flex: 0 0 auto; }

/* Tables — certificate grid: hairlines, mono headings, no heavy fills */
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; background: var(--paper-raised); }
th, td { border: 1px solid var(--line); padding: 0.5rem 0.65rem; text-align: left; vertical-align: middle; }
td { font-variant-numeric: tabular-nums; }
td:nth-child(2), td:nth-child(4), td:nth-child(5) { font-family: var(--mono); font-size: 0.86rem; }
thead th {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono); font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  border-bottom: 2px solid var(--ink);
  white-space: nowrap;
}
tbody tr:nth-child(even) { background: #f8faf9; }

/* SIGNATURE: status as inspection stamps */
.chip {
  display: inline-block;
  font-family: var(--mono); font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.09em;
  padding: 0.14rem 0.5rem;
  border: 2px solid currentColor; border-radius: 2px;
  background: transparent;
  white-space: nowrap;
  animation: stamp-press 160ms ease-out;
}
.chip.ok { color: var(--stamp-green); }
.chip.warn { color: var(--stamp-amber); transform: rotate(-1deg); }
.chip.bad { color: var(--stamp-red); transform: rotate(-2.5deg); box-shadow: 0 0 0 1px rgba(191,50,38,0.15); }
@keyframes stamp-press {
  from { transform: scale(1.5) rotate(-4deg); opacity: 0; }
  to   { transform: scale(1) rotate(-2.5deg); opacity: 1; }
}
.chip.ok   { animation-name: stamp-press-flat; }
.chip.warn { animation-name: stamp-press-warn; }
@keyframes stamp-press-flat { from { transform: scale(1.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes stamp-press-warn { from { transform: scale(1.5) rotate(-3deg); opacity: 0; } to { transform: scale(1) rotate(-1deg); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .chip { animation: none; }
}

/* CTA card — a hazard tag on the document */
.cta-card {
  background: var(--plate-900); color: #fff;
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.6rem; margin: 2.2rem 0;
  border-left: 6px solid var(--safety);
}
.cta-card h2 { color: #fff; margin-top: 0; }
.cta-card p { color: #c2cdd6; }
.cta-card form { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 0.9rem; }
.cta-card input[type="email"] { flex: 1 1 16rem; border: none; }
.cta-card .fine { font-size: 0.82rem; color: #93a3b0; margin-top: 0.7rem; }

/* Content pages */
.content { max-width: 46rem; margin-inline: auto; }
.content ul, .content ol { padding-left: 1.3rem; }
.content li { margin: 0.3rem 0; }
.callout {
  border: 2px solid var(--ink);
  background: var(--paper-raised);
  border-radius: 2px;
  padding: 0.9rem 1.1rem; margin: 1.4rem 0;
}
.callout > strong:first-child {
  display: block;
  font-family: var(--mono); font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--ink-soft); margin-bottom: 0.3rem;
}
.disclaimer-box {
  background: #e8ecea; border-radius: var(--radius);
  padding: 0.8rem 1.1rem; font-size: 0.88rem;
  color: var(--ink-soft); margin: 1.5rem 0;
}

/* FAQ */
.faq details { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius); margin: 0.6rem 0; padding: 0.7rem 1rem; }
.faq summary { font-weight: 600; cursor: pointer; color: var(--ink); }
.faq details[open] summary { margin-bottom: 0.4rem; }

/* Toolbar over dashboard */
.toolbar { display: flex; gap: 0.7rem; flex-wrap: wrap; align-items: center; margin: 0.8rem 0; }
.toolbar .spacer { flex: 1; }
.muted { color: var(--ink-soft); font-size: 0.9rem; }
.empty-state {
  text-align: center; color: var(--ink-soft);
  padding: 2rem 1rem; background: var(--paper-raised);
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
}

/* Footer — back to the plate */
.site-foot { background: var(--plate-900); color: #96a5b1; margin-top: 3rem; padding: 1.8rem 0 2.2rem; font-size: 0.88rem; }
.site-foot a { color: #c2cdd6; }
.site-foot nav { display: flex; gap: 1.2rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.site-foot p { margin: 0.4rem 0; }

/* Print: audit report view — the document, finally on paper */
.print-only { display: none; }
@media print {
  body { background: #fff; color: #000; font-size: 11pt; font-family: var(--body); }
  .site-head, .hero, .no-print, .cta-card, .site-foot, .toolbar, form, .entry-panel { display: none !important; }
  .print-only { display: block; }
  .panel { border: none; padding: 0; margin: 0; }
  table { font-size: 10pt; }
  thead th { background: #eee !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  th, td { border: 1px solid #999; }
  .chip { border: 1.5pt solid #000; background: #fff !important; color: #000 !important; transform: none; animation: none; }
  a { color: #000; text-decoration: none; }
  .table-scroll { overflow: visible; }
  .print-head h1 { font-size: 16pt; margin-bottom: 0.2rem; }
  .print-head p { margin: 0 0 0.8rem; font-size: 10pt; color: #333; }
}

@media (max-width: 600px) {
  .hero { padding: 2.2rem 0; }
  .cta-card form { flex-direction: column; }
  .cta-card .btn { width: 100%; }
}

/* Hero specimen — the stamped card, shown before it's explained */
.hero .wrap { position: relative; }
.spec {
  position: absolute; right: 1rem; top: 50%;
  transform: translateY(-50%) rotate(1.6deg);
  width: 21.5rem;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-top: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}
.spec-head {
  font-family: var(--mono); font-size: 0.62rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.45rem; margin-bottom: 0.35rem;
}
.spec-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.8rem; padding: 0.34rem 0;
  font-family: var(--mono); font-size: 0.72rem; color: var(--ink);
}
.spec-row + .spec-row { border-top: 1px solid var(--paper); }
.spec .chip { animation: none; }
@media (max-width: 1060px) { .spec { display: none; } }
@media (min-width: 1061px) { .hero .points { max-width: 34rem; } }

/* Report settings */
.report-settings { margin: 0.4rem 0 1rem; }
.report-settings summary {
  cursor: pointer; font-family: var(--mono); font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft);
}
.report-settings[open] summary { color: var(--ink); }
.report-settings .muted { font-size: 0.8rem; margin-bottom: 0.2rem; }

/* Printed sign-off block */
.signoff { display: none; }
@media print {
  .signoff { display: flex; gap: 3rem; margin-top: 2.8rem; break-inside: avoid; }
  .signoff .sig { flex: 1; border-top: 1pt solid #000; padding-top: 0.35rem; font-size: 9pt; color: #000; }
  .print-head #print-shop2 { margin: 0 0 0.2rem; font-size: 10pt; color: #333; }
  .print-head #print-summary { font-size: 10pt; margin-top: 0.4rem; }
}

/* Content-page head band — the plate carries every page */
.page-head {
  background: linear-gradient(180deg, var(--plate-900), var(--plate-800));
  color: #fff;
  padding: 2.2rem 0 2rem;
  border-bottom: 1px solid var(--line-strong);
}
.page-head h1 {
  color: #fff; max-width: 50rem;
  margin: 0.35rem 0 0;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
}
.page-head .eyebrow {
  font-family: var(--mono); font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.09em;
  color: #c2cdd6; margin: 0;
}
.page-head + .wrap { padding-top: 1.6rem; }

/* Narrow screens: keep the stamp visible without scrolling */
@media (max-width: 480px) {
  #dash-table th:nth-child(2), #dash-table td:nth-child(2),
  #dash-table th:nth-child(5), #dash-table td:nth-child(5) { display: none; }
}
