/* Safety reporting flow */
[hidden] {
  display: none !important;
}

.safety-form-container,
.checklist-form-container {
  width: min(100%, 980px);
}

.back-link {
  min-height: 34px;
  margin: -0.25rem 0 0.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #5c6a73;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.back-link::before {
  content: "<";
  color: var(--env-yellow-dark);
  font-size: 1rem;
  font-weight: 850;
}

.back-link:hover {
  color: var(--ink);
}

.page-head-accent {
  --page-accent: var(--dashboard);
  position: relative;
  padding-left: 1.1rem;
}

.page-head-accent::before {
  position: absolute;
  top: 0.2rem;
  bottom: 0.15rem;
  left: 0;
  width: 5px;
  border-radius: 5px;
  background: var(--page-accent);
  content: "";
}

.accent-incident {
  --page-accent: var(--incident);
}

.accent-hazard {
  --page-accent: var(--hazard);
}

.accent-checklist {
  --page-accent: var(--checklist);
}

.required {
  color: var(--red);
  font-weight: 800;
}

/* Form labels are flex columns, so a bare asterisk became its own line under the field
   name (UAT item 1). Wrapping the two in .field-label keeps them on one row. */
.field-label {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.factor-options {
  margin: 0.5rem 0 0.85rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.3rem 1rem;
}

.checkbox-option {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start;
  gap: 0.45rem;
  font-weight: 500 !important;
  line-height: 1.35;
}

.checkbox-option input {
  margin-top: 0.15rem;
  width: 1rem;
  height: 1rem;
  flex: none;
}

/* Emma's prompt between the 5 Whys and the factor checklists, kept visually distinct
   the way it is in the Donesafe form. */
.investigation-instruction {
  margin: 1rem 0;
  padding: 0.7rem 0.85rem;
  border-left: 3px solid var(--page-accent, var(--red));
  background: #fdf6f1;
  color: #6b4a35;
  font-size: 0.78rem;
  line-height: 1.5;
}

.alert {
  margin: 0 0 1rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #ffffff;
  color: #3f4b53;
  font-size: 0.86rem;
}

.alert-error {
  border-color: #e4aca4;
  background: var(--red-bg);
  color: #7e2e26;
}

.alert-error strong {
  color: var(--red);
}

/* Not an error, a caveat: the thing on screen is usable but its provenance is
   incomplete. Used by the training matrix while requirements are still only
   Focus's word for it. */
.alert-warn {
  border-color: #e0c489;
  background: var(--amber-bg);
  color: #6d4a06;
}

.alert-warn b {
  color: var(--amber);
}

.safety-report-form,
.investigation-form,
.checklist-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-section {
  margin: 0;
  padding: 1.35rem 1.45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.form-section > label {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.34rem;
  color: #53616b;
  font-size: 0.79rem;
  font-weight: 700;
}

.form-section-head {
  margin-bottom: 1.15rem;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.form-section-head h2 {
  margin: 0;
  font-size: 1.08rem;
}

.form-section-head p {
  margin: 0.2rem 0 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.step-number {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: var(--charcoal-900);
  color: var(--env-yellow);
  font-size: 0.78rem;
  font-weight: 850;
}

.nested-fields {
  margin: 0.2rem 0;
  padding: 1rem;
  border: 1px solid #e6eaec;
  border-radius: var(--radius);
  background: #f8fafb;
}

.reporter-summary {
  margin-top: 1rem;
  padding: 0.78rem 0.9rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  border: 1px solid #e4e8ea;
  border-radius: var(--radius);
  background: #f8fafb;
}

.reporter-summary .user-avatar {
  width: 36px;
  height: 36px;
  border-color: #d6dde1;
  background: var(--charcoal-900);
}

.reporter-summary > span:not(.user-avatar) {
  min-width: 130px;
  display: flex;
  flex-direction: column;
}

.reporter-summary small {
  color: var(--ink-soft);
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.reporter-summary strong {
  color: #29353d;
  font-size: 0.84rem;
}

.risk-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr) minmax(155px, 0.75fr);
  align-items: end;
  gap: 0.75rem;
}

.risk-controls > label {
  display: flex;
  flex-direction: column;
  gap: 0.34rem;
  color: #53616b;
  font-size: 0.79rem;
  font-weight: 700;
}

.risk-times {
  min-height: 44px;
  display: grid;
  place-items: center;
  color: #818c93;
  font-size: 1rem;
  font-weight: 800;
}

.risk-result {
  min-height: 66px;
  padding: 0.55rem 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f9fa;
}

.risk-result small {
  color: var(--ink-soft);
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.risk-result strong {
  color: #47555d;
  font-size: 0.96rem;
}

.risk-value {
  font-weight: 800;
}

.risk-value-ok {
  color: var(--ok) !important;
}

.risk-value-warn {
  color: var(--amber) !important;
}

.risk-value-high {
  color: #b85b26 !important;
}

.risk-value-crit {
  color: var(--red) !important;
}

.matrix-scroll {
  width: 100%;
  margin-top: 1rem;
  overflow-x: auto;
  border-radius: var(--radius);
  scrollbar-color: #b5c0c6 #edf0f2;
}

.matrix-grid {
  min-width: 610px;
  display: grid;
  grid-template-columns: repeat(5, minmax(112px, 1fr));
  gap: 6px;
}

.matrix-grid .risk-cell {
  min-height: 66px;
}

/* Risk matrix with Consequence and Likelihood headings, per HSE-TEM-004 and UAT item 7.
   A table rather than a bare grid so the axis labels are real headers for screen
   readers and stay attached to their row and column when the matrix scrolls. */
.risk-matrix {
  min-width: 680px;
  width: 100%;
  border-collapse: separate;
  border-spacing: 4px;
  font-size: 0.72rem;
}

.risk-matrix th,
.risk-matrix .matrix-corner {
  padding: 0.4rem 0.5rem;
  background: #172127;
  color: #ffffff;
  border-radius: var(--radius-sm);
  font-weight: 750;
  text-align: center;
  vertical-align: middle;
}

.risk-matrix .matrix-corner {
  font-size: 0.74rem;
}

.risk-matrix th[scope="row"] {
  min-width: 108px;
  text-align: right;
}

.risk-matrix .matrix-axis {
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.risk-matrix .matrix-axis-side {
  width: 2rem;
  padding: 0.3rem 0.15rem;
}

.risk-matrix .matrix-axis-side span {
  display: block;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
}

.risk-matrix td {
  padding: 0;
}

.risk-matrix .risk-cell {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.field-note {
  margin: 0.65rem 0 0;
  color: var(--ink-soft); /* #738089 was 4.0:1 on white */
  font-size: 0.78rem;
  line-height: 1.45;
}

.upload-drop {
  min-height: 142px;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.45rem;
  border: 2px dashed #bfc9ce;
  border-radius: var(--radius);
  background: #f8fafb;
  color: #56646d;
  text-align: center;
}

.upload-drop > svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: var(--brand-700);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.upload-drop label {
  width: min(100%, 460px);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  color: #34434b;
  font-size: 0.85rem;
  font-weight: 750;
}

.upload-drop input[type="file"] {
  background: #ffffff;
  font-size: 0.78rem;
}

.upload-drop small {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.sticky-form-actions {
  position: sticky;
  bottom: 12px;
  z-index: 15;
  margin-top: 0.15rem;
  padding: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.55rem;
  border: 1px solid rgba(210, 217, 221, 0.92);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 30px rgba(21, 29, 34, 0.14);
  backdrop-filter: blur(12px);
}

.btn-lg {
  min-height: 46px;
  padding-inline: 1.15rem;
}

/* Safety record details */
.record-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.record-stats .stat b {
  font-size: 1.03rem;
  line-height: 1.3;
  white-space: normal;
}

.record-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(250px, 0.82fr);
  align-items: start;
  gap: 1rem;
}

.record-main,
.record-side {
  min-width: 0;
}

.record-side {
  position: sticky;
  top: 128px;
}

.detail-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border: 1px solid #e6eaec;
  border-radius: var(--radius);
  overflow: hidden;
}

.detail-grid > div {
  min-width: 0;
  padding: 0.72rem 0.8rem;
  border-right: 1px solid #e9edef;
  border-bottom: 1px solid #e9edef;
}

.detail-grid > div:nth-child(2n) {
  border-right: 0;
}

.detail-grid > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.detail-grid .detail-wide {
  grid-column: 1 / -1;
  border-right: 0;
}

.detail-grid dt,
.side-kv dt,
.action-meta dt {
  color: var(--ink-soft);
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.detail-grid dd,
.side-kv dd,
.action-meta dd {
  min-width: 0;
  margin: 0.15rem 0 0;
  color: #2f3c44;
  font-size: 0.84rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.narrative-block {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #edf0f2;
}

.narrative-block h3 {
  margin: 0 0 0.35rem;
  color: #36444c;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.narrative-block p {
  margin: 0;
  color: #3d4a52;
  white-space: pre-wrap;
}

.side-kv {
  margin: 0;
}

.side-kv > div {
  padding: 0.55rem 0;
  border-bottom: 1px solid #edf0f2;
}

.side-kv > div:last-child {
  border-bottom: 0;
}

.empty-state {
  margin: 0;
  padding: 1.1rem;
  border: 1px dashed #cfd7db;
  border-radius: var(--radius);
  background: #fafbfb;
  color: var(--ink-soft);
  font-size: 0.82rem;
  text-align: center;
}

.create-panel {
  padding: 0;
  overflow: hidden;
}

.create-panel > summary {
  min-height: 70px;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  list-style: none;
}

.create-panel > summary::-webkit-details-marker,
.embedded-action > summary::-webkit-details-marker {
  display: none;
}

.create-panel > summary > span:first-child {
  display: flex;
  flex-direction: column;
}

.create-panel > summary > span:last-child {
  color: var(--brand-700);
  font-size: 0.76rem;
  font-weight: 750;
}

.create-panel[open] > summary {
  border-bottom: 1px solid var(--line);
  background: #fafbfb;
}

.create-panel > form {
  padding: 1.2rem;
}

.version-timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.version-timeline li {
  position: relative;
  min-height: 58px;
  padding: 0.55rem 0 0.65rem 2.65rem;
  border-bottom: 1px solid #edf0f2;
}

.version-timeline li:last-child {
  border-bottom: 0;
}

.version-number {
  position: absolute;
  top: 0.55rem;
  left: 0;
  min-width: 34px;
  padding: 0.18rem 0.35rem;
  border-radius: 999px;
  background: var(--charcoal-900);
  color: var(--env-yellow);
  font-size: 0.66rem;
  font-weight: 800;
  text-align: center;
}

.version-timeline li > div {
  display: flex;
  flex-direction: column;
}

.version-timeline time {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.version-timeline p {
  margin: 0.2rem 0 0;
  color: #4d5a62;
  font-size: 0.8rem;
}

/* Safety attachments and library */
.library-path {
  margin: 0 0 0.9rem;
  padding: 0.5rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: var(--radius-sm);
  background: #f3f6f8;
  color: #64727b;
  font-size: 0.74rem;
  overflow-wrap: anywhere;
}

.library-path svg,
.library-folder-head svg {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: var(--brand-700);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.attachment-grid {
  margin-bottom: 0.85rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 0.75rem;
}

.attachment-image {
  min-width: 0;
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: #48565e;
  font-size: 0.74rem;
  text-decoration: none;
}

.attachment-image:hover {
  border-color: #9eafb8;
  box-shadow: var(--shadow-sm);
}

.attachment-image img {
  width: 100%;
  height: 120px;
  display: block;
  border-radius: 6px;
  object-fit: cover;
  background: #eef1f3;
}

.attachment-image span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-list {
  display: flex;
  flex-direction: column;
}

.document-row {
  min-height: 58px;
  padding: 0.55rem 0.2rem;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  border-bottom: 1px solid #edf0f2;
  color: var(--ink);
  text-decoration: none;
}

.document-row:last-child {
  border-bottom: 0;
}

.document-row:hover {
  background: #fafbfb;
}

.document-row > svg {
  width: 26px;
  height: 26px;
  justify-self: center;
  fill: none;
  stroke: var(--brand-700);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.document-row > span:nth-child(2) {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.document-row strong {
  overflow: hidden;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-row small {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-row > span:last-child,
.document-row time {
  color: var(--brand-700);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.file-thumb {
  width: 34px;
  height: 34px;
  display: block;
  border: 1px solid var(--line);
  border-radius: 5px;
  object-fit: cover;
  background: #eef1f3;
}

.inline-upload {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  border-top: 1px solid var(--line);
}

.file-picker {
  position: relative;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: #27343c;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
}

.file-picker:hover {
  border-color: #8e9da6;
  background: #f9fafb;
}

.file-picker:focus-within {
  border-color: var(--amber);
  outline: 3px solid rgba(244, 169, 0, 0.28);
  outline-offset: 2px;
}

.file-picker input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  opacity: 0;
}

.file-picker span {
  padding: 0.55rem 0.9rem;
}

.library-groups {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.library-folder {
  margin-bottom: 0;
  padding: 0;
  overflow: hidden;
}

.library-folder-head {
  min-height: 72px;
  padding: 0.85rem 1rem;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  border-bottom: 1px solid var(--line);
  background: #fafbfb;
}

.library-folder-head > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.library-folder-head small {
  color: var(--ink-soft);
  font-size: 0.66rem;
}

.library-folder-head strong {
  overflow-wrap: anywhere;
  font-size: 0.84rem;
}

.library-folder-head > span {
  color: var(--ink-soft);
  font-size: 0.72rem;
  white-space: nowrap;
}

.library-folder .document-list {
  padding: 0 1rem;
}

.empty-page {
  min-height: 260px;
  padding: 2rem;
  display: grid;
  place-items: center;
  align-content: center;
  border: 1px dashed #c8d1d6;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-soft);
  text-align: center;
}

.empty-page > svg {
  width: 44px;
  height: 44px;
  margin-bottom: 0.5rem;
  fill: none;
  stroke: #81919b;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.empty-page h2 {
  margin-bottom: 0.25rem;
}

.empty-page p {
  max-width: 460px;
  margin: 0 0 1rem;
}

/* Investigation */
.status-badge {
  padding: 0.35rem 0.68rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #ffffff;
  color: #4e5c65;
  font-size: 0.73rem;
  font-weight: 750;
  white-space: nowrap;
}

.investigation-summary {
  margin-bottom: 1rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.investigation-summary > div {
  min-width: 0;
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
}

.investigation-summary > div:last-child {
  border-right: 0;
}

.investigation-summary small {
  color: var(--ink-soft);
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.investigation-summary strong {
  overflow: hidden;
  color: #2f3c44;
  font-size: 0.83rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.factor-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.factor-card {
  min-width: 0;
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafbfb;
}

.factor-card legend {
  padding: 0 0.4rem;
  color: #2f3c44;
  font-size: 0.85rem;
  font-weight: 800;
}

.factor-card > p {
  margin: 0 0 0.75rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.embedded-action {
  margin-top: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafbfb;
  overflow: hidden;
}

.embedded-action > summary {
  min-height: 48px;
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--brand-700);
  font-size: 0.82rem;
  font-weight: 750;
  list-style: none;
}

.embedded-action[open] > summary {
  border-bottom: 1px solid var(--line);
  background: #f4f7f8;
}

.embedded-action .form-grid {
  padding: 1rem;
}

.linked-actions {
  margin-bottom: 0.6rem;
}

/* Checklist completion */
.stop-work-alert {
  position: sticky;
  top: 122px;
  z-index: 25;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border: 2px solid #cf5145;
  border-radius: var(--radius);
  background: #fff2f0;
  box-shadow: 0 10px 28px rgba(133, 41, 32, 0.16);
  color: #7b2d26;
}

.stop-work-alert > svg {
  width: 28px;
  height: 28px;
  flex: none;
  fill: none;
  stroke: var(--red);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.stop-work-alert p {
  margin: 0.12rem 0 0;
  font-size: 0.8rem;
}

.stop-work-confirm {
  margin-top: 0.65rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  color: #61231e;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 750;
}

.stop-work-confirm input {
  width: 19px;
  height: 19px;
  min-height: 0;
  flex: none;
  accent-color: var(--red);
}

.checklist-context {
  border-left: 4px solid var(--checklist);
}

.checklist-form .checklist-section {
  margin-top: 0;
}

.question-list {
  display: flex;
  flex-direction: column;
}

.checklist-question {
  position: relative;
  min-width: 0;
  padding: 1rem 0;
  display: grid;
  grid-template-columns: minmax(220px, 0.95fr) minmax(260px, 1.05fr);
  align-items: start;
  gap: 1.2rem;
  border-bottom: 1px solid #e9edef;
}

.checklist-question:last-child {
  border-bottom: 0;
}

.question-copy {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
  gap: 0.6rem;
}

.question-number {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #edf1f3;
  color: #58666f;
  font-size: 0.68rem;
  font-weight: 800;
}

.question-copy label {
  align-self: center;
  color: #2d3a42;
  font-size: 0.84rem;
  font-weight: 700;
}

.question-copy small {
  grid-column: 2;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.question-control {
  min-width: 0;
}

.segmented-control {
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.segment {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.segment input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.segment span {
  min-height: 44px;
  padding: 0.5rem;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  color: #59666f;
  font-size: 0.78rem;
  font-weight: 750;
}

.segment:last-child span {
  border-right: 0;
}

.segment input:focus-visible + span {
  position: relative;
  z-index: 1;
  outline: 3px solid rgba(244, 169, 0, 0.55);
  outline-offset: -3px;
}

.segment input:checked + span {
  background: var(--charcoal-900);
  color: #ffffff;
}

.segment-no input:checked + span,
.segment-fail input:checked + span {
  background: var(--red);
}

.segment-pass input:checked + span,
.segment-yes input:checked + span {
  background: var(--ok);
}

.confirm-control {
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: #34424a;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
}

.confirm-control input {
  width: 20px;
  height: 20px;
  min-height: 0;
  accent-color: var(--ok);
}

.photo-control {
  position: relative;
  min-height: 82px;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.3rem;
  overflow: hidden;
  border: 2px dashed #bcc8cd;
  border-radius: var(--radius);
  background: #f8fafb;
  color: var(--brand-700);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 750;
}

.photo-control svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.photo-control input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  opacity: 0;
}

.photo-control:focus-within {
  border-color: var(--amber);
  outline: 3px solid rgba(244, 169, 0, 0.28);
  outline-offset: 2px;
}

/* A photo has been chosen: the label carries its file name, see app.js. */
.photo-control.has-file {
  border-style: solid;
  border-color: var(--brand-700);
  background: #eef6f3;
}

.signature-pad {
  padding: 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #f8fafb;
}

.signature-pad canvas {
  width: 100%;
  height: 156px;
  display: block;
  border: 1px solid #cbd4d9;
  border-radius: 6px;
  background:
    linear-gradient(to bottom, transparent calc(100% - 35px), #d8dee1 calc(100% - 34px), transparent calc(100% - 33px)),
    #ffffff;
  cursor: crosshair;
  touch-action: none;
}

.signature-pad canvas:focus-visible {
  outline: 3px solid rgba(244, 169, 0, 0.42);
  outline-offset: 2px;
}

.signature-pad.invalid,
.signon-sheet.invalid,
.signon-row.invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(181, 54, 43, 0.13);
}

.signature-pad > div {
  margin-top: 0.45rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.signature-pad small {
  color: var(--ink-soft);
  font-size: 0.69rem;
}

.typed-signature {
  margin-top: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  color: #53616b;
  font-size: 0.72rem;
  font-weight: 700;
}

.typed-signature input {
  min-height: 40px;
  background: #ffffff;
}

.signature-pad-small canvas {
  height: 94px;
}

.signon-sheet {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.signon-rows {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.signon-row {
  padding: 0.75rem;
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(240px, 1.3fr) auto;
  align-items: start;
  gap: 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafb;
}

.signon-row > label {
  display: flex;
  flex-direction: column;
  gap: 0.34rem;
  color: #53616b;
  font-size: 0.76rem;
  font-weight: 700;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #e4b1aa;
  border-radius: 50%;
  background: #ffffff;
  color: var(--red);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 800;
}

.icon-button:hover {
  background: var(--red-bg);
}

.critical-instruction {
  grid-column: 1 / -1;
  margin: -0.2rem 0 0;
  padding: 0.65rem 0.75rem;
  border-left: 4px solid var(--red);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--red-bg);
  color: #7b2d26;
  font-size: 0.79rem;
  font-weight: 700;
}

/* Checklist index and printable report */
.checklist-card-grid {
  margin-bottom: 1.25rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.checklist-card {
  --card-accent: var(--checklist);
  min-width: 0;
  padding: 1rem;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--card-accent);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.checklist-card.accent-amber {
  --card-accent: var(--incident);
}

.checklist-card.accent-purple {
  --card-accent: var(--hazard);
}

.checklist-card.accent-blue {
  --card-accent: var(--actions);
}

.checklist-card.accent-slate {
  --card-accent: var(--dashboard);
}

.checklist-card-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--card-accent) 12%, white);
  color: var(--card-accent);
}

.checklist-card-icon svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.checklist-card-copy {
  min-width: 0;
}

.checklist-card-copy h2 {
  margin: 0;
  font-size: 0.95rem;
}

.checklist-card-copy p {
  margin: 0.2rem 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.checklist-card-copy small {
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.checklist-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.checklist-report {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.report-section {
  break-inside: avoid;
}

.response-list {
  margin: 0;
}

.response-list > div {
  min-height: 50px;
  padding: 0.62rem 0;
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(0, 1.1fr);
  gap: 1rem;
  border-bottom: 1px solid #edf0f2;
}

.response-list > div:last-child {
  border-bottom: 0;
}

.response-list dt {
  color: #4e5c65;
  font-size: 0.8rem;
  font-weight: 700;
}

.response-list dd {
  min-width: 0;
  margin: 0;
  color: #26333b;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.response-critical {
  margin-inline: -0.55rem;
  padding-inline: 0.55rem !important;
  border-left: 4px solid var(--red);
  background: #fff7f5;
}

.report-signons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.65rem;
}

.report-signons > div {
  padding: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.report-signons img {
  width: 100%;
  height: 70px;
  display: block;
  object-fit: contain;
  border-radius: 4px;
  background: #ffffff;
}

.report-signons span {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.report-evidence-image {
  width: min(100%, 420px);
  max-height: 320px;
  display: block;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f5f7f8;
}

/* Corrective actions */
.filter-bar {
  margin-bottom: 1rem;
  padding: 0.75rem;
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.filter-bar label {
  min-width: 190px;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 750;
}

.action-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.action-card {
  margin: 0;
  scroll-margin-top: 135px;
  border-left: 4px solid var(--actions);
}

.action-card.action-overdue {
  border-left-color: var(--red);
}

.action-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.action-card-head h2 {
  margin-bottom: 0;
}

.action-description {
  margin: 0.75rem 0;
  color: #46545c;
  white-space: pre-wrap;
}

/* CA-0040: the answer recorded on the checklist, set apart from the typed note. */
.action-answer {
  margin: 0.75rem 0 0;
  padding: 0.4rem 0.6rem;
  border-left: 3px solid var(--ink-soft);
  background: rgba(0, 0, 0, 0.03);
}

.action-answer + .action-description {
  margin-top: 0.5rem;
}

.action-note-label {
  font-weight: 600;
}

.action-meta {
  margin: 0 0 0.9rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.action-meta > div {
  min-width: 0;
  padding: 0.62rem 0.7rem;
  border-radius: var(--radius-sm);
  background: #f5f7f8;
}

.action-meta .detail-wide {
  grid-column: 1 / -1;
}

.action-update {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  display: grid;
  grid-template-columns: minmax(150px, 0.55fr) repeat(2, minmax(210px, 1fr)) auto;
  align-items: end;
  gap: 0.75rem;
  border-top: 1px solid var(--line);
}

.action-update label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 750;
}

.action-update textarea {
  min-height: 76px;
}

.action-readonly {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
}

.action-readonly p {
  margin: 0;
  font-size: 0.78rem;
}

.pill-success {
  background: var(--ok-bg);
  color: var(--ok);
}

/* Register filters */
.filter-panel {
  margin-bottom: 1rem;
  padding: 1rem;
  display: grid;
  grid-template-columns: minmax(250px, 1.6fr) repeat(3, minmax(135px, 0.7fr));
  align-items: end;
  gap: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.filter-panel label {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 750;
}

.filter-search {
  grid-column: span 2;
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.register-table {
  min-width: 980px;
}

/* Two lines in one cell: a title with its context underneath.
   Targeted by class rather than by column position. It used to be nth-child(4), which
   silently stopped applying the moment the same pattern was used in the Investigations
   table where the title sits third, and the title ran into the location with no space
   (Emma, UAT 04.08.26 item 13). */
.register-table .cell-stacked {
  min-width: 210px;
}

.register-table .cell-stacked strong,
.register-table .cell-stacked small {
  display: block;
}

.register-table .cell-stacked small {
  margin-top: 0.15rem;
  color: var(--ink-soft);
  font-size: 0.7rem;
}

/* A date needs far less room than the header word suggests. */
.register-table .cell-date {
  width: 1%;
  white-space: nowrap;
}

/* A third line under a stacked cell, for the sentence that explains the row: what a
   requirement applies to, what ENV's last review said. Capped in width so a long
   note widens the cell rather than the whole row growing to a paragraph. */
.register-table .cell-stacked .cell-note {
  display: block;
  max-width: 44rem;
  margin-top: 0.25rem;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.35;
}

/* The one thing a row can be done to, folded until it is wanted. On 22 October the
   three October registers carried an open-looking form in every row, which Zak read as
   the page falling apart. The summary is a small button; the form opens under it and
   only that row grows. */
.register-table details.row-form {
  display: inline-block;
  text-align: left;
}

.register-table details.row-form > summary {
  list-style: none;
  cursor: pointer;
}

.register-table details.row-form > summary::-webkit-details-marker {
  display: none;
}

.register-table details.row-form > .row-form-panel {
  min-width: 18rem;
  max-width: 26rem;
  margin-top: 0.55rem;
  padding: 0.75rem 0.85rem;
  display: grid;
  gap: 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  white-space: normal;
}

.register-table details.row-form .field {
  display: grid;
  gap: 0.2rem;
}

.register-table details.row-form .field input {
  width: 100%;
}

.record-type {
  padding: 0.18rem 0.5rem;
  display: inline-block;
  border-radius: 999px;
  background: #edf1f3;
  color: #52616a;
  font-size: 0.68rem;
  font-weight: 750;
}

.record-type-incident {
  background: #fff0dd;
  color: #9a5d0d;
}

.record-type-hazard {
  background: #f3eaf7;
  color: #75418a;
}

