/* AI Governance Kit. Client colours arrive as --brand, --brand-ink and --link (set by build.js). */
:root {
  --brand: #1f4b6e; --brand-ink: #fff; --link: #1f4b6e; --accent: #0f766e;
  --ink: #1b2430; --muted: #55606e; --line: #d5dae1; --bg: #f5f7f9; --card: #fff;
  --low-bg: #e3f3e8; --low-ink: #14532d; --med-bg: #fdf0cf; --med-ink: #6b4000; --high-bg: #fde4e4; --high-ink: #8f1616;
  --info-bg: #e0ecfb; --info-ink: #123f73; --none-bg: #e9ecf0; --none-ink: #3a4450;
  --radius: 8px; --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 var(--font); color: var(--ink); background: var(--bg); }
h1, h2, h3, h4, h5 { line-height: 1.25; margin: 1.4em 0 .5em; }
h1 { font-size: 1.75rem; margin-top: .6em; } h2 { font-size: 1.3rem; } h3 { font-size: 1.1rem; } h4, h5 { font-size: 1rem; }
p, ul, ol, dl, table, blockquote { margin: 0 0 1em; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #0b57d0; outline-offset: 2px; border-radius: 3px; }
[tabindex="-1"]:focus { outline: none; }
small { display: block; color: var(--muted); font-size: .875rem; font-weight: 400; }
img { max-width: 100%; height: auto; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; color: var(--ink); padding: 10px 14px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }
.muted, .hint { color: var(--muted); } .hint { font-size: .9rem; margin: .3em 0 0; }
.lede { font-size: 1.08rem; color: var(--muted); max-width: 62ch; }
.opt { color: var(--muted); font-weight: 400; }

/* header and footer */
.site-header { background: var(--card); border-top: 4px solid var(--brand); border-bottom: 1px solid var(--line); }
.site-header .bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; min-height: 44px; }
.brand img { width: 36px; height: 36px; border-radius: 6px; }
.brand small { font-size: .8rem; }
.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 2px 4px; margin: 0; padding: 0; }
.site-nav a { display: block; padding: 10px 12px; border-radius: 6px; color: var(--ink); text-decoration: none; font-weight: 500; }
.site-nav a:hover { background: var(--bg); }
.site-nav a[aria-current="page"] { background: var(--brand); color: var(--brand-ink); }
.site-footer { margin-top: 56px; padding: 24px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; background: var(--card); }
.site-footer p { margin: 0 0 .5em; }
main { padding-top: 8px; padding-bottom: 24px; min-height: 60vh; }

.backup-bar { background: var(--info-bg); color: var(--info-ink); border-bottom: 1px solid #b9cfee; }
.backup-bar.needs { background: var(--med-bg); color: var(--med-ink); border-color: #e6c877; }
.backup-bar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding-top: 8px; padding-bottom: 8px; }
.backup-bar p { margin: 0; flex: 1 1 280px; font-weight: 500; }
.banner { background: #2b3441; color: #fff; }
.banner .wrap { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding-top: 8px; padding-bottom: 8px; }
.banner p { margin: 0; flex: 1 1 280px; }
.banner.review { background: var(--high-bg); color: var(--high-ink); }
.banner .btn { border-color: #fff; }
.legal-note, .doc-note { background: #fff8e6; border-left: 4px solid #b7791f; padding: 10px 14px; border-radius: 4px; color: #4a3300; }

/* buttons and forms */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 16px; border: 1px solid #8b96a5; border-radius: 6px; background: #fff; color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: #eef1f4; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.12); }
.btn.danger { color: var(--high-ink); border-color: var(--high-ink); }
.btn.small { min-height: 36px; padding: 5px 11px; font-size: .9rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.file-btn { position: relative; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file-btn:focus-within { outline: 3px solid #0b57d0; outline-offset: 2px; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--link); text-decoration: underline; cursor: pointer; min-height: 24px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0; }
.toolbar.spread { justify-content: space-between; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px 6px; margin: 0 0 18px; background: var(--card); min-width: 0; }
legend { font-weight: 700; padding: 0 6px; }
.field { margin-bottom: 14px; min-width: 0; }
label { font-weight: 600; display: block; margin-bottom: 4px; }
input[type="text"], input[type="email"], input[type="url"], input[type="date"], input[type="number"], input:not([type]), select, textarea {
  width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid #7d8795; border-radius: 6px; font: inherit; color: var(--ink); background: #fff; }
input[type="file"] { max-width: 100%; font: inherit; }
textarea { resize: vertical; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 18px; }
.grid .wide { grid-column: 1 / -1; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; margin-bottom: 10px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-weight: 400; margin-bottom: 8px; cursor: pointer; }
.choices .choice { margin: 0; }
.choice input { margin: 3px 0 0; width: 20px; height: 20px; flex: none; accent-color: var(--brand); }
.choice:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.check-row { display: grid; grid-template-columns: 3fr 2fr; gap: 0 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.check-row:first-of-type { border-top: 0; }
.errors:empty { display: none; }
.errors { background: var(--high-bg); color: var(--high-ink); border-radius: 6px; padding: 12px 16px; margin-bottom: 14px; }
.errors p, .errors ul { margin: 0 0 .3em; }

/* panels, tables, badges */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin: 0 0 18px; }
.panel > :first-child { margin-top: 0; } .panel > :last-child { margin-bottom: 0; }
.panel.success { border-color: #7fbf93; background: var(--low-bg); }
.empty { text-align: center; padding: 40px 20px; background: var(--card); border: 1px dashed #9aa5b3; border-radius: var(--radius); }
details > summary { cursor: pointer; font-weight: 600; padding: 6px 0; min-height: 32px; }
details.panel > summary { margin: -6px 0; }
details[open].panel > summary { margin-bottom: 8px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
thead th { font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #eef1f4; }
tbody th { font-weight: 600; }
caption { text-align: left; font-weight: 700; padding: 8px 0; }
.actions { white-space: nowrap; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .85rem; font-weight: 700; white-space: nowrap; background: var(--none-bg); color: var(--none-ink); }
.risk-low, .status-approved { background: var(--low-bg); color: var(--low-ink); }
.risk-medium { background: var(--med-bg); color: var(--med-ink); }
.risk-high, .status-not-approved { background: var(--high-bg); color: var(--high-ink); }
.status-limited { background: var(--info-bg); color: var(--info-ink); }
.reasons { margin: 6px 0 0; padding-left: 18px; font-size: .92rem; }
.risk-preview h3 { margin-top: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { display: block; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-left: 6px solid #8b96a5; border-radius: var(--radius); padding: 12px 16px; text-decoration: none; }
.tile.risk-low, .tile.status-approved { border-left-color: #2f855a; } .tile.risk-medium { border-left-color: #b7791f; }
.tile.risk-high, .tile.status-not-approved { border-left-color: #c53030; } .tile.status-limited { border-left-color: #2b6cb0; }
.tile .num { display: block; font-size: 2rem; font-weight: 700; line-height: 1.1; } .tile .lbl { font-size: .92rem; }
h3.sub { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 1em 0 .5em; }
.progress { height: 12px; background: #dfe4ea; border-radius: 999px; overflow: hidden; margin: 10px 0; }
.progress span { display: block; height: 100%; background: var(--accent); }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); background: #1b2430; color: #fff; padding: 12px 18px; border-radius: 8px; max-width: min(92vw, 560px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 20; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* policy and documents */
.two-col { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 24px; align-items: start; }
.doc, .report { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 34px; }
.doc > :first-child, .report > :first-child { margin-top: 0; }
.doc section h2, .doc section h3, .doc section h4 { font-size: 1.1rem; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.doc-title { font-size: 1.6rem; }
.doc-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 20px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.doc-meta dt { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); } .doc-meta dd { margin: 0; font-weight: 600; }
.doc-source { color: var(--muted); font-size: .9rem; }
.doc-source a { overflow-wrap: anywhere; }
blockquote.answer { white-space: pre-wrap; overflow-wrap: anywhere; background: #f3f5f7; border-left: 4px solid #9aa5b3; padding: 10px 14px; margin-left: 0; font-size: .95rem; }
.task-report { border-top: 1px solid var(--line); padding-top: 6px; }
.scores { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); margin-bottom: 1em; } .scores dd { font-size: 1.25rem; }
.print-table { font-size: .92rem; margin-bottom: 20px; }
.print-table a { overflow-wrap: anywhere; }
.checklist { table-layout: fixed; } .checklist th:nth-child(1) { width: 44%; } .checklist th:nth-child(2) { width: 28%; }

/* evaluator */
.steps { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 20px 14px 40px; }
.task-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.task-head h3 { margin: 0 0 8px; }
.score-set { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; background: #fafbfc; }
.flags { background: #f3f5f7; border-radius: 6px; padding: 8px 14px; margin-bottom: 14px; }
.flags li { margin-bottom: 6px; overflow-wrap: anywhere; }
.suggestion { background: var(--info-bg); color: var(--info-ink); border-radius: 6px; padding: 12px 16px; }
.suggestion .hint { color: inherit; }
.suggestion > :last-child { margin-bottom: 0; }

/* evidence pack */
.pack-cover, .pack-section { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 30px; margin-bottom: 20px; }
.pack-section .doc, .pack-section .report { border: 0; padding: 0; }
.pack-section .report { border-top: 2px solid var(--ink); padding-top: 8px; margin-top: 24px; }
.cover-company { font-size: 1.3rem; font-weight: 700; }

/* staff course */
#stage:empty { min-height: 70vh; }
body.staff main { max-width: 760px; }
.modules { list-style: none; padding: 0; }
.module { display: flex; justify-content: space-between; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-left: 6px solid #8b96a5; border-radius: var(--radius); padding: 14px 18px; margin-bottom: 12px; }
.module.passed { border-left-color: #2f855a; }
.module h2 { font-size: 1.1rem; margin: 0 0 4px; } .module p { margin: 0 0 4px; }
.crumb, .step { color: var(--muted); font-size: .92rem; margin-bottom: .4em; }
.slide { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; font-size: 1.05rem; }
.slide h1 { font-size: 1.45rem; margin-top: 0; }
.slide li { margin-bottom: 6px; }
.example { background: var(--info-bg); color: var(--info-ink); padding: 12px 16px; border-radius: 6px; }
.question legend { font-weight: 600; float: left; width: 100%; padding: 0; margin-bottom: 10px; }
.question legend + * { clear: both; }
.review { padding-left: 22px; }
.review li { background: var(--card); border: 1px solid var(--line); border-left: 6px solid #2f855a; border-radius: 6px; padding: 10px 14px; margin-bottom: 10px; }
.review li.wrong { border-left-color: #c53030; }
.review p { margin: 0 0 4px; }
.welcome { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; }
.certificate { background: #fff; border: 3px double var(--brand); outline: 1px solid var(--line); outline-offset: 6px; padding: 36px 40px; margin: 16px 6px; text-align: center; border-radius: 4px; }
.certificate h1 { font-size: 2rem; margin: .3em 0 .6em; letter-spacing: .01em; }
.cert-company { font-weight: 700; font-size: 1.15rem; margin: 6px 0 0; }
.cert-name { font-size: 1.9rem; font-weight: 700; border-bottom: 1px solid var(--ink); display: inline-block; padding: 0 24px 4px; margin: 0 0 14px; overflow-wrap: anywhere; }
.cert-modules { list-style: none; padding: 0; max-width: 460px; margin: 0 auto 18px; text-align: left; font-size: .95rem; }
.cert-modules li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dotted #9aa5b3; padding: 4px 0; }
.cert-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 40px; margin-bottom: 14px; }
.cert-meta dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); } .cert-meta dd { margin: 0; font-weight: 700; }
.cert-small { font-size: .82rem; color: var(--muted); margin: 0; }

@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .check-row { grid-template-columns: 1fr; }
  table.cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.cards, table.cards tbody, table.cards tr, table.cards th, table.cards td { display: block; width: 100%; }
  table.cards { background: none; }
  table.cards tr { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; padding: 6px 4px; }
  table.cards th, table.cards td { border: 0; padding: 6px 12px; }
  table.cards td[data-label]::before { content: attr(data-label); display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
  .actions { white-space: normal; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  h1 { font-size: 1.5rem; }
  .doc, .report, .pack-cover, .pack-section { padding: 18px 16px; }
  .module { flex-direction: column; align-items: stretch; }
  .certificate { padding: 24px 16px; margin: 12px 2px; }
  .certificate h1 { font-size: 1.5rem; } .cert-name { font-size: 1.4rem; padding: 0 8px 4px; }
  .site-nav a { padding: 10px 9px; }
  .print-table { display: block; overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

@page { size: A4; margin: 16mm 15mm; }
@page certificate { size: A4 landscape; margin: 10mm; }
@media print {
  body { background: #fff; font-size: 10.5pt; }
  .site-header, .site-footer, .backup-bar, .banner, .toast, .no-print, .skip, .page-head { display: none !important; }
  main, .wrap { max-width: none !important; padding: 0 !important; margin: 0 !important; }
  .two-col { display: block; }
  .doc, .report, .pack-cover, .pack-section, .panel { border: 0; padding: 0; background: none; }
  .pack-section { break-before: page; }
  .pack-section .report { break-before: page; border-top: 0; }
  .pack-section .report:first-of-type { break-before: auto; }
  h1, h2, h3, h4, h5 { break-after: avoid; }
  tr, .task-report > p, li, .doc-meta { break-inside: avoid; }
  thead { display: table-header-group; }
  .print-table th, .print-table td { padding: 5px 8px; }
  .checklist { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  .doc-source a::after, .print-table a::after { content: ""; }
  .badge { border: 1px solid currentColor; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .legal-note, .doc-note { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  details.flags > *:not(summary) { display: block; }
  details.flags { background: none; padding: 0; }
  .doc-source a[href]::after { content: " (" attr(href) ")"; overflow-wrap: anywhere; }
  .certificate { page: certificate; margin: 0; outline: 0; border-width: 4px; min-height: 180mm; display: flex; flex-direction: column; justify-content: center; align-items: center; break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cert-modules { width: 460px; }
}

:root{--brand:#1f4b6e;--brand-ink:#ffffff;--link:#1f4b6e;--accent:#0f766e}
