:root { --blue: #345a8a; --ink: #1d2733; --muted: #6b7684; --line: #d9dee5; --bg: #f5f7fa; --red: #b3261e; --green: #1e6b3a; }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 Arial, Helvetica, sans-serif; color: var(--ink); background: var(--bg); }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 10px 20px; background: var(--blue); color: #fff; }
.bar a { color: #fff; text-decoration: none; }
.brand { font-weight: 700; font-size: 17px; margin-right: 12px; }
.bar nav { display: flex; gap: 14px; flex: 1; }
.who { font-size: 13px; }
main { max-width: 1100px; margin: 24px auto; padding: 0 16px; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px; }
h1 { font-size: 22px; color: var(--blue); margin: 0 0 12px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 20px 24px; }
.narrow { max-width: 460px; margin: 0 auto; }
label { display: block; margin: 0 0 12px; font-size: 14px; }
input, select { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
button, .button { display: inline-block; background: var(--blue); color: #fff; border: 0; border-radius: 6px; padding: 8px 16px; font: inherit; cursor: pointer; text-decoration: none; }
button.link { background: none; padding: 0 0 0 8px; color: #fff; text-decoration: underline; font-size: 13px; }
form.inline { display: inline; }
.error { background: #fdecea; color: var(--red); padding: 8px 12px; border-radius: 6px; }
.flash { background: #e6f4ea; color: var(--green); padding: 8px 12px; border-radius: 6px; }
.note { color: var(--muted); }
.head { display: flex; justify-content: space-between; align-items: center; }
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
th { background: #eef2f7; }
tr.muted td { color: var(--muted); }
td.detail { font-family: monospace; font-size: 12px; word-break: break-all; max-width: 320px; }
.filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.filters label { margin: 0; }
h2 { font-size: 16px; color: var(--blue); margin: 18px 0 8px; }
button.small { padding: 4px 10px; font-size: 13px; }
.inline-form { display: inline; }
textarea { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: #eef2f7; }
.tag.late, td.late { color: var(--red); }
.tag.late { background: #fdecea; }
.tag.soon { background: #fff4d6; color: #7a5300; }
.grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 800px) { .grid { grid-template-columns: 1fr; } }
.card + .card { margin-top: 16px; }
.card h2:first-child { margin-top: 0; }
details { margin-top: 8px; }
details summary { cursor: pointer; color: var(--blue); font-size: 14px; }
details form { margin-top: 8px; padding: 12px; background: var(--bg); border-radius: 6px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.row label { flex: 1; min-width: 140px; margin: 0; }
.removed td { color: var(--muted); text-decoration: line-through; }
.removed td.why { text-decoration: none; }
.notes p { margin: 0 0 4px; white-space: pre-wrap; }
.notes li { margin-bottom: 10px; }
.meta { color: var(--muted); font-size: 12px; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
.status { font-weight: 700; }
.status.closed { color: var(--muted); }
.standing-row { display: flex; flex-wrap: wrap; gap: 12px 32px; }
.standing-row > div { display: flex; flex-direction: column; gap: 2px; }
.standing { margin-bottom: 16px; }
ol.timeline { list-style: none; margin: 0 0 16px; padding: 0 0 0 18px; border-left: 3px solid var(--line); }
ol.timeline li { position: relative; padding: 0 0 14px 12px; }
ol.timeline li::before { content: ''; position: absolute; left: -27px; top: 4px; width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 3px solid var(--line); }
ol.timeline li.tl-start::before, ol.timeline li.tl-stage::before { border-color: var(--blue); background: var(--blue); }
ol.timeline li.tl-done::before { border-color: var(--green); }
ol.timeline li.tl-late::before, ol.timeline li.tl-extend::before { border-color: var(--red); }
ol.timeline li.tl-end::before { border-color: var(--ink); background: var(--ink); }
ol.timeline li.tl-email-in::before { border-color: var(--blue); }
ol.timeline li.tl-note::before { border-color: #9aa5b1; }
.tl-when { color: var(--muted); font-size: 12px; }
.tl-title { font-weight: 700; }
li.tl-stage .tl-title, li.tl-start .tl-title { color: var(--blue); }
li.tl-late .tl-title { color: var(--red); }
.tl-body { white-space: pre-wrap; font-size: 14px; }
.grid { grid-template-columns: 3fr 2fr; }
.standing-row .tag { align-self: flex-start; }
ul.plain { list-style: none; padding: 0; margin: 0 0 12px; }
ul.plain li { padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
ul.plain a.current { font-weight: 700; }
label.check { display: flex; gap: 8px; align-items: center; }
label.check input { width: auto; display: inline; margin: 0; }
a.button.small { padding: 5px 12px; font-size: 13px; }
.tl-email .tl-body { background: var(--bg); border-radius: 6px; padding: 8px 10px; margin-top: 6px; }
textarea { font-family: inherit; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
fieldset { border: 1px solid var(--line); border-radius: 6px; margin: 0 0 12px; padding: 8px 12px; }
legend { font-size: 14px; padding: 0 4px; }
.wide-form { max-width: 620px; }
.ref { font-size: 18px; }
.formlink { font-family: monospace; font-size: 12px; word-break: break-all; }
.email-body { margin-top: 12px; background: var(--bg); border-radius: 6px; padding: 12px; }
a.current { font-weight: 700; }
.bulk { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 12px; }
.bulk label { flex: 1; min-width: 260px; margin: 0; }
button.secondary { background: #fff; color: var(--accent, #2f5a8a); border: 1px solid currentColor; }

/* Step 4: significant events */
h3 { font-size: 15px; margin: 18px 0 6px; }
h3 .meta { font-weight: normal; }
ol.steps { display: flex; flex-wrap: wrap; gap: 6px 14px; list-style: none; padding: 0; margin: 0 0 8px; font-size: 14px; }
ol.steps li { display: flex; align-items: center; gap: 6px; color: var(--muted); }
ol.steps li span { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
ol.steps li.done { color: var(--green); }
ol.steps li.done span { border-color: var(--green); background: var(--green); color: #fff; }
ol.steps li.skipped span { border-color: var(--muted); }
.harm-moderate, .harm-severe, .harm-death { color: var(--red); }
.harm-good_practice { color: var(--green); }
form.step-form { padding: 12px; background: var(--bg); border-radius: 6px; }
label.check.top { align-items: flex-start; }
label.check.top input { margin-top: 4px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0 12px; }
/* Phones: one column, navigation wraps, wide tables scroll inside their card */
@media (max-width: 800px) {
  .grid { grid-template-columns: 1fr; }
  .bar nav { flex-wrap: wrap; gap: 6px 14px; }
  main { margin: 16px auto; }
  .card { padding: 16px; }
  .head { flex-wrap: wrap; gap: 8px; }
  .card table { display: block; overflow-x: auto; }
  dl.facts { grid-template-columns: 1fr; gap: 0; }
  dl.facts dd { margin-bottom: 6px; }
}
/* Step 4b: trends */
.big { font-size: 26px; }
strong.late { color: var(--red); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.grid2 .card + .card { margin-top: 0; }
.grid2 + .card, .card + .grid2 { margin-top: 16px; }
table.bars td:last-child { width: 45%; white-space: nowrap; }
svg.barsvg { display: inline-block; width: calc(100% - 34px); height: 12px; vertical-align: middle; fill: var(--blue); }
svg.harm-bar-moderate, svg.harm-bar-severe, svg.harm-bar-death { fill: var(--red); }
svg.harm-bar-good_practice { fill: var(--green); }
td.pre { white-space: pre-wrap; }
@media (max-width: 800px) { .grid2 { grid-template-columns: 1fr; } }
@media print { .noprint, header.bar { display: none; } body { background: #fff; } svg.barsvg { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
/* Step 5: risk register */
.rating-low { background: #dff1e3; color: #1e5b33; }
.rating-moderate { background: #fff1c2; color: #6b4e00; }
.rating-high { background: #ffd8b0; color: #7a3a00; }
.rating-extreme { background: #f7c6c2; color: #8a1c14; }
.rating-text-extreme { color: #b3261e; } .rating-text-high { color: #a04c00; } .rating-text-moderate { color: #8a6400; } .rating-text-low { color: var(--green); }
.scores { display: flex; gap: 12px; margin-bottom: 12px; }
.score { display: flex; flex-direction: column; align-items: center; padding: 8px 18px; border-radius: 8px; min-width: 96px; }
.score strong { font-size: 30px; line-height: 1.1; }
.score.target { opacity: .85; }
table.heat { width: auto; border: 0; }
table.heat td { width: 44px; height: 36px; text-align: center; font-weight: 700; border: 2px solid #fff; font-size: 15px; }
table.heat th { background: none; border: 0; font-size: 12px; white-space: nowrap; padding: 2px 6px; }
table.heat th.c { text-align: center; white-space: normal; width: 44px; }
.grid2.top { margin: 0 0 16px; }
.register { padding: 0; overflow-x: auto; }
.register table { border: 0; }
@media (max-width: 800px) { table.heat th .meta { display: none; } table.heat th.c .meta { display: none; } .register table { display: table; } }

.phone-only { display: none; }
@media (max-width: 600px) {
  .register th:nth-child(2), .register td:nth-child(2), .register th:nth-child(3), .register td:nth-child(3),
  .register th:nth-child(5), .register td:nth-child(5), .register th:nth-child(7), .register td:nth-child(7), .register th:nth-child(8), .register td:nth-child(8) { display: none; }
  .register .phone-only { display: block; }
}
/* Step 6: People */
.cell-ok { background: #dff1e3; color: #1e5b33; }
.cell-not_needed { background: #eef2f7; color: var(--muted); }
.cell-soon { background: #fff1c2; color: #6b4e00; }
.cell-expired, .cell-missing { background: #f7c6c2; color: #8a1c14; }
table.matrix { border: 0; font-size: 13px; }
table.matrix th, table.matrix td { padding: 4px; text-align: center; border: 1px solid #fff; }
table.matrix thead th { height: 74px; vertical-align: bottom; white-space: nowrap; }
table.matrix thead th span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); }
table.matrix tbody th { text-align: left; white-space: nowrap; background: #fff; position: sticky; left: 0; }
table.matrix td a { display: block; color: inherit; text-decoration: none; font-weight: 700; min-width: 18px; }
.grid-scroll { overflow-x: auto; }
.pad { padding: 0 16px; }
h2.pad { padding-top: 16px; }
.progress svg { width: 100%; height: 6px; fill: var(--green); background: #e6eaef; border-radius: 3px; }
ul.checks-list { list-style: none; padding: 0; margin: 0; }
ul.checks-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
ul.checks-list li .check-head { font-size: 14px; }
@media (max-width: 600px) { table.people-list th:nth-child(2), table.people-list td:nth-child(2), table.people-list th:nth-child(6), table.people-list td:nth-child(6) { display: none; } }
/* Step 6: People sections reuse the flush card without the risk register's phone column rules */
.flush { padding: 0; overflow-x: auto; }
.flush table { border: 0; }
table.matrix thead th:first-child { position: sticky; left: 0; background: #eef1f6; z-index: 1; }
@media (max-width: 600px) {
  table.matrix tbody th { white-space: normal; min-width: 96px; max-width: 120px; font-size: 13px; }
  table.matrix tbody th a { font-weight: 600; }
}
span.late, p .late { color: var(--red); font-weight: 600; }
/* Step 7: CQC evidence */
.tag.live { background: #e3ecf8; color: var(--blue); font-weight: 700; }
.tag.qs-outstanding { background: #d4ecd9; color: #1e5b33; }
.tag.qs-good { background: #dff1e3; color: #1e5b33; }
.tag.qs-requires_improvement { background: #fff1c2; color: #6b4e00; }
.tag.qs-inadequate { background: #f7c6c2; color: #8a1c14; }
.tag.rev-ok { background: #dff1e3; color: #1e5b33; }
.tag.rev-soon { background: #fff1c2; color: #6b4e00; }
.tag.rev-overdue { background: #f7c6c2; color: #8a1c14; }
.tag.rev-retired { background: #eef2f7; color: var(--muted); }
table.qs-table tr.gap td:first-child { border-left: 3px solid var(--red); }
table.qs-table td:nth-child(n+2) { white-space: nowrap; }
.kq + .kq { margin-top: 16px; }
ul.live-list li.live-bad strong { color: var(--red); }
ul.live-list li.live-warn strong { color: #7a5300; }
ul.live-list li.live-ok strong { color: var(--green); }
.clip { font-size: 13px; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pre { white-space: pre-wrap; }
fieldset.qs-pick { border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; margin: 0 0 12px; }
fieldset.qs-pick legend { font-size: 14px; padding: 0 4px; }
fieldset.qs-pick label.check { margin: 6px 0; }
button.secondary, .button.secondary { background: #fff; color: var(--blue); border: 1px solid var(--blue); }
@media (max-width: 600px) {
  table.qs-table th:nth-child(2), table.qs-table td:nth-child(2), table.qs-table th:nth-child(3), table.qs-table td:nth-child(3) { display: none; }
  table.qs-table .phone-only { display: block; }
  table.qs-table td:nth-child(4) { white-space: normal; }
}
/* Step 7a+: what to collect */
ul.guide-list li { display: flex; gap: 10px; align-items: flex-start; }
ul.guide-list .tick { font-weight: 700; width: 18px; flex: none; text-align: center; }
ul.guide-list li.g-app .tick, ul.guide-list li.g-done .tick { color: var(--green); }
ul.guide-list li.g-na { color: var(--muted); }
ul.guide-list li.g-todo .tick { color: var(--red); }
.guide-actions { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; margin-top: 6px; }
.guide-actions details.inline-d { margin: 0; }
.guide-actions details.inline-d summary { font-size: 13px; padding: 4px 0; }
/* Not applicable */
table.qs-table tr.na-row td { color: var(--muted); background: #fafbfc; }
table.qs-table tr.na-row a { color: var(--muted); }
details.applies { margin: 0 0 16px; }
fieldset.scope { border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; margin: 0 0 12px; }
fieldset.scope legend { font-size: 14px; padding: 0 4px; }
.scope-list { padding-left: 24px; }
.na-banner { margin: 0 0 16px; }
/* Step 7b: policies */
.to-sign { border-left: 4px solid var(--blue); }
.read-sign { margin-bottom: 16px; }
@media (max-width: 600px) { table.policy-list th:nth-child(2), table.policy-list td:nth-child(2) { display: none; } }
/* Step 7c: audits */
.tag.aud-planned { background: #eef2f7; }
.tag.aud-soon { background: #fff1c2; color: #6b4e00; }
.tag.aud-overdue { background: #f7c6c2; color: #8a1c14; }
.tag.aud-done { background: #dff1e3; color: #1e5b33; }
.tag.aud-retired { background: #eef2f7; color: var(--muted); }
.met { color: #1e5b33; }
.score-line .big { font-size: 28px; margin-right: 6px; }
ol.cycle { padding-left: 20px; margin: 0; }
ol.cycle li.here { font-weight: 700; }
.action-done { display: flex; gap: 6px; margin-top: 4px; }
.action-done input { flex: 1; }
input.inline-date { width: auto; display: inline-block; margin-left: 4px; }
/* Meetings (step 7d) */
.tag.mtg-planned { background: #eef2f7; }
.tag.mtg-draft { background: #fff1c2; color: #6b4e00; }
.tag.mtg-issued { background: #e3ecf8; color: var(--blue); }
.tag.mtg-approved { background: #dff1e3; color: #1e5b33; }
.tag.mtg-retired { background: #eef2f7; color: var(--muted); }
.attendees .attendee { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 4px 0; border-bottom: 1px solid #eef2f7; }
.attendees .attendee > span { flex: 1 1 140px; }
.minutes-text { white-space: pre-wrap; }
.upload-box { background: #f4f7fb; border: 1px dashed #9db3cf; border-radius: 8px; padding: 10px 12px; margin: 8px 0 12px; }
.upload-box input[type=file] { width: 100%; }
/* Daily email (step 8a) */
.inline-form { display: inline-block; margin: 0 6px 6px 0; }
ul.digest li { padding: 4px 0; }
pre.email-text { white-space: pre-wrap; font-size: 12px; background: #f4f7fb; padding: 10px; border-radius: 6px; overflow-wrap: anywhere; }
