﻿:root {
  --green: #1a8f20;
  --green-dark: #111827;
  --red: #e30613;
  --ink: #111827;
  --muted: #5f6b76;
  --line: #dde5df;
  --bg: #f7f9f7;
  --panel: #ffffff;
  --amber: #b7791f;
}

/* SafetyCulture-inspired workspace polish */
.app-header {
  border-radius: 18px;
}

.tabs {
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.tab {
  border-radius: 999px;
  min-height: 34px;
}

.page-title.workspace-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(31, 45, 55, 0.08);
}

.eyebrow {
  display: block;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.workspace-view .dashboard-folder-content {
  display: grid;
  gap: 16px;
  margin-bottom: 0;
  padding: 18px;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(31, 45, 55, 0.08);
}

.metrics {
  align-items: stretch;
}

.dashboard-folder {
  position: relative;
  display: grid;
  align-content: space-between;
  gap: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbf9 100%);
  box-shadow: 0 10px 24px rgba(31, 45, 55, 0.07);
}

.dashboard-folder::after {
  content: "Open page";
  justify-self: start;
  color: #fff;
  background: var(--green);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 800;
}

.contractor-stats div,
.analytics-card {
  border-radius: 14px;
}

.contractor-table th,
.contractor-table td,
table th,
table td {
  vertical-align: top;
}

@media (max-width: 720px) {
  .app-header {
    width: calc(100% - 24px);
    padding: 14px;
    border-radius: 16px;
  }

  .tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tab {
    width: 100%;
    padding: 9px 6px;
    text-align: center;
    white-space: normal;
  }

  main {
    padding: 18px 12px 40px;
  }

  .page-title h1 {
    font-size: 26px;
    line-height: 1.08;
  }

  .page-title.workspace-title {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .metrics,
  .contractor-stats,
  .contractor-form {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 92px;
    padding: 15px;
  }

  .workspace-view .dashboard-folder-content {
    padding: 14px;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

.app-header {
  position: static;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 14px;
  width: calc(100% - 48px);
  max-width: 1320px;
  margin: 12px auto 0;
  padding: 20px 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 14px 38px rgba(31, 45, 55, 0.10);
  min-width: 0;
}

.header-logo-frame {
  display: flex;
  width: 440px;
  height: 176px;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
}

.header-logo-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: right center;
}

.brand {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 440px;
  align-items: center;
  gap: clamp(32px, 8vw, 170px);
  width: 100%;
  min-width: 0;
}

.brand-meta {
  display: grid;
  gap: 4px;
  font-size: 12px;
  line-height: 1.35;
  justify-self: start;
  width: min(100%, 460px);
}

.header-logo-frame {
  order: 2;
}

.brand-meta {
  order: 1;
}

.brand-meta strong {
  color: var(--green-dark);
  font-size: 14px;
}

.brand-meta span {
  color: var(--muted);
}

a {
  color: var(--green);
  font-weight: 800;
  text-decoration: none;
}

a:hover {
  color: var(--red);
  text-decoration: underline;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.contact-links a {
  color: var(--green);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
}

.tab {
  font-size: 12px;
  padding: 8px 10px;
  line-height: 1.15;
}

button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  border-color: var(--green);
}

.password-wrap {
  position: relative;
  display: block;
}

.password-wrap input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 28px;
  min-height: 0;
  padding: 0;
  display: grid;
  place-items: center;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.password-toggle:hover {
  background: #e8f3ed;
  color: var(--green-dark);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-help-box {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #f7faf8;
}

.login-help-box p {
  margin: 6px 0 12px;
  color: var(--muted);
}

.tab.active,
.primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.secondary {
  background: #fff;
  color: var(--green-dark);
}

.header-actions {
  display: flex;
  gap: 8px;
}

main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 26px 24px 46px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.page-title {
  margin-bottom: 22px;
}

.page-title h1 {
  margin: 0 0 6px;
  font-size: 30px;
}

.page-title p {
  margin: 0;
  color: var(--muted);
}

.save-status {
  display: inline-block;
  margin-top: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 700;
}

.trial-notice {
  margin: 0 0 14px;
  border: 1px solid rgba(227, 6, 19, 0.22);
  background: #fff6f6;
  color: var(--ink);
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 800;
  border-radius: 6px;
}

.login-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.login-action-row .form-grid,
.login-action-row .login-help-box {
  margin-top: 0;
}

.login-action-row .settings-actions {
  margin-top: 10px;
}

@media (max-width: 900px) {
  .login-action-row {
    grid-template-columns: 1fr;
  }
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.35;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin: 0;
}

.trial-acceptance {
  align-self: center;
}

.save-in-audit {
  margin-top: 12px;
}

.audit-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.bottom-toolbar {
  margin-top: 16px;
  margin-bottom: 16px;
}

.compact h1 {
  font-size: 24px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric,
.panel,
.report-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.metric {
  padding: 18px;
  min-height: 106px;
  border-radius: 24px;
}

.dashboard-folder {
  text-align: left;
  cursor: pointer;
}

.dashboard-folder.active,
.dashboard-folder:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 122, 58, 0.12);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}

.metric strong {
  font-size: 23px;
  line-height: 1.2;
  color: var(--green);
}

.folder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dashboard-folder-content {
  margin-bottom: 18px;
}

.contractor-management-panel {
  display: grid;
  gap: 14px;
}

.contractor-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.contractor-stats div {
  border: 1px solid var(--line);
  background: #f8fbf9;
  padding: 12px;
}

.contractor-stats strong {
  display: block;
  color: var(--green-dark);
  font-size: 18px;
  line-height: 1.2;
}

.contractor-stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.contractor-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.contractor-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.contractor-form input,
.contractor-form select,
.contractor-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.contractor-notes {
  grid-column: span 2;
}

.contractor-notes textarea {
  min-height: 44px;
  resize: vertical;
}

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

.status-pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: #eef1ef;
  color: var(--muted);
}

.status-pill.approved {
  background: #e7f6ec;
  color: var(--green-dark);
}

.status-pill.conditional,
.status-pill.pending {
  background: #fff5d6;
  color: #8a6100;
}

.status-pill.not-approved {
  background: #fde8e8;
  color: #a92727;
}

.panel-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
  align-items: stretch;
}

.panel {
  padding: 18px;
}

.panel-grid > .panel {
  border-radius: 22px;
  height: 100%;
}

.panel h2,
.report-panel h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.report-intro {
  padding: 18px;
  margin-bottom: 16px;
  line-height: 1.6;
}

.report-intro p {
  margin: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.wide {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 10px;
  font: inherit;
}

textarea {
  min-height: 78px;
  resize: vertical;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.analytics-card {
  border: 1px solid var(--line);
  background: #f9fbfa;
  padding: 12px;
  border-radius: 18px;
}

.analytics-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
}

.analytics-card strong {
  color: var(--green-dark);
  font-size: 17px;
  line-height: 1.2;
}

.chart-row {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 16px;
  align-items: center;
  margin-top: 14px;
}

.donut-chart {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--green) var(--closed), #e8eeee 0deg);
  position: relative;
}

.donut-chart::after {
  content: "";
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
}

.donut-chart span {
  position: relative;
  z-index: 1;
  color: var(--green-dark);
  font-weight: 900;
}

.chart-bars {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.bar-line {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) 1.2fr 32px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}

.bar-line span {
  color: var(--muted);
  font-weight: 800;
}

.bar-line div {
  height: 10px;
  background: #e8eeee;
  overflow: hidden;
}

.bar-line i {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--green);
}

#barCritical {
  background: var(--red);
}

#barObservations {
  background: var(--amber);
}

.bar-line strong {
  text-align: right;
}

.signature-box {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.signature-box h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.sap-logo-box {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 18px;
  border-top: 1px solid var(--line);
  background: #fff;
  max-width: 100%;
  overflow: hidden;
}

.sap-logo-box span {
  color: var(--red);
  font-size: 18px;
  font-weight: 900;
  font-style: italic;
}

.sap-logo-box img {
  display: block;
  width: 100%;
  max-width: 520px;
  height: auto;
  object-fit: contain;
}

#signaturePad,
#auditSignaturePad {
  width: 100%;
  max-width: 520px;
  height: 150px;
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  touch-action: none;
}

.audit-signature-panel {
  margin-top: 16px;
}

.audit-details-inline {
  margin-bottom: 16px;
}

.report-details-editor {
  margin-bottom: 18px;
  text-align: left;
}

.report-cover-details {
  margin-top: 12px;
}

.report-cover-details p {
  margin: 0 0 10px;
}

.audit-introduction {
  margin-bottom: 0;
  line-height: 1.6;
  position: relative;
  overflow: hidden;
  border-color: rgba(36, 139, 69, 0.35);
  border-left: 6px solid var(--green);
  background: #fff;
}

.audit-introduction h2,
.audit-introduction p,
.intro-logo-row {
  position: relative;
  z-index: 1;
}

.audit-introduction p {
  margin: 0;
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(217, 225, 223, 0.8);
  padding: 12px;
}

.intro-logo-row {
  display: block;
  margin-bottom: 14px;
}

.intro-logo-row img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: fill;
  border: 1px solid rgba(36, 139, 69, 0.22);
  background: #fff;
  box-shadow: 0 8px 20px rgba(30, 41, 48, 0.08);
}

.signature-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.signature-upload-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 800;
}

.signature-upload-inline input {
  max-width: 180px;
}

.report-signature-actions {
  margin-top: 10px;
}

.report-signature-actions.approval {
  align-items: flex-start;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.report-signature-actions.approval .signature-upload-inline,
.report-signature-actions.approval button {
  width: 100%;
  max-width: 260px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: start center;
  padding: clamp(10px, 3vh, 24px);
  background: rgba(12, 20, 16, 0.54);
  overflow: auto;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(760px, 100%);
  max-height: calc(100vh - clamp(20px, 6vh, 48px));
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
  overscroll-behavior: contain;
}

.modal-header {
  position: sticky;
  top: -20px;
  z-index: 2;
  background: #fff;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: -20px -20px 10px;
  padding: 20px 20px 10px;
  border-bottom: 1px solid transparent;
}

.modal-header h2 {
  margin: 0;
  color: var(--green-dark);
}

.modal p {
  margin: 0 0 16px;
  color: var(--muted);
}

.scope-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.scope-options button {
  min-height: 64px;
  text-align: left;
  border-color: var(--line);
  border-left: 5px solid var(--green);
}

.scope-options button:hover {
  background: #f3f8f5;
}

.category {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 14px;
  overflow: hidden;
}

.review-letter {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 6px;
  margin-bottom: 14px;
  padding: 14px 16px;
  line-height: 1.35;
}

.review-letter-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.review-letter-logo img {
  width: 180px;
  max-height: 92px;
  object-fit: contain;
}

.review-letter-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  color: var(--green-dark);
  font-weight: 900;
}

.review-letter p {
  margin: 0 0 5px;
}

.review-letter-actions {
  background: #f3f8f5;
  border: 1px solid var(--line);
  padding: 10px;
  margin: 8px 0;
}

.review-letter-actions ul {
  margin: 5px 0 0 18px;
  padding: 0;
}

.safety-file-approval-box {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  background: #f8fbf9;
  border: 1px solid var(--line);
  margin-top: 10px;
  padding: 10px;
}

.safety-file-approval-box strong {
  flex: 1 1 100%;
  color: var(--green-dark);
}

.safety-file-approval-box label,
.approval-tick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-weight: 800;
}

.safety-file-approval-box input {
  width: auto;
}

.approval-tick.selected {
  color: var(--green-dark);
}

.safety-file-approval-box em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.section-a-editor {
  min-height: 190px;
  line-height: 1.5;
}

.section-a-print p {
  margin: 0 0 5px;
}

.compact-section-text p {
  margin: 0 0 6px;
}

.section-a-print .paragraph-gap {
  height: 6px;
}

.safety-file-report-item {
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  margin-bottom: 8px !important;
}

.safety-file-section-b {
  margin-top: 16px;
}

.safety-file-section-b-heading {
  color: var(--green-dark);
  font-size: 18px;
  font-weight: 900;
  margin: 0 0 14px;
}

.score-card-report-section {
  border: 1px solid var(--line);
  background: #fff;
  margin: 0 0 14px;
  padding: 12px;
  break-inside: avoid;
}

.score-card-parent-section {
  border: 1px solid var(--green);
  background: #eef5f1;
  margin: 18px 0 10px;
  padding: 12px;
  break-inside: avoid;
}

.score-card-parent-section h3 {
  color: var(--green-dark);
  font-size: 14px;
  margin: 0;
  text-transform: uppercase;
}

.score-card-parent-heading {
  background: #eef5f1;
  border-left: 4px solid var(--green);
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 900;
  margin: 0 0 12px;
  padding: 8px 10px;
  text-transform: uppercase;
}

.score-card-report-section h3 {
  color: var(--green-dark);
  font-size: 13px;
  margin: 0 0 10px;
}

.score-card-report-question {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 10px;
  break-inside: avoid;
}

.score-card-report-question:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.score-card-report-question p {
  margin: 0;
}

.score-card-section-total {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.score-card-section-total.score-poor {
  background: #e60000;
  border-color: #b50000;
  color: #111;
}

.score-card-section-total.score-improve {
  background: #f2b600;
  border-color: #d79a00;
  color: #111;
}

.score-card-section-total.score-good {
  background: #00a51d;
  border-color: #008717;
  color: #111;
}

.status-negative {
  display: inline-block;
  background: #fde8e8;
  border: 1px solid #e49a9a;
  color: var(--red);
  font-weight: 900;
  padding: 1px 5px;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: #eef5f1;
  border-bottom: 1px solid var(--line);
}

.category-header h2 {
  margin: 0;
  font-size: 18px;
}

.category-score {
  font-weight: 800;
  color: var(--green-dark);
}

.category-tools,
.question-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.category-tools button,
.question-tools button {
  padding: 6px 8px;
  font-size: 11px;
}

.question-tools {
  margin-top: 10px;
}

.question {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 230px) minmax(150px, 180px);
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.question label,
.question input,
.question select,
.question textarea {
  min-width: 0;
}

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

.question-title {
  font-weight: 800;
  margin-bottom: 7px;
}

.question-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.legal-ref {
  display: inline-block;
  margin-top: 8px;
  border-left: 3px solid var(--green);
  padding: 5px 8px;
  background: #f3f8f5;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.risk {
  font-weight: 800;
}

.risk.high {
  color: var(--red);
}

.risk.medium {
  color: var(--amber);
}

.risk.low {
  color: var(--green-dark);
}

.high-risk-check {
  grid-column: 1 / -1;
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  border: 1px solid #f0c7c7;
  background: #fff7f7;
  color: var(--red);
  padding: 8px 10px;
}

.high-risk-check input {
  width: auto;
}

.comment-row {
  grid-column: 1 / -1;
}

.contact-field {
  grid-column: span 2;
}

.evidence-row {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}

.evidence-upload {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.evidence-upload input {
  max-width: 360px;
}

.evidence-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.immediate-action {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.danger {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  white-space: normal;
  max-width: 220px;
  line-height: 1.25;
  text-align: center;
}

.danger[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.action-note {
  flex: 1 1 240px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.evidence-card {
  width: 132px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 6px;
}

.evidence-card img {
  width: 100%;
  height: 82px;
  object-fit: cover;
  display: block;
  border: 1px solid #eef1ef;
}

.evidence-card button {
  width: 100%;
  margin-top: 6px;
  padding: 6px;
  border-color: #f0c7c7;
  color: var(--red);
  font-size: 12px;
}

.report-evidence {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.report-evidence figure {
  margin: 0;
  border: 1px solid var(--line);
  background: #fff;
  padding: 6px;
  break-inside: avoid;
}

.report-evidence img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.report-evidence figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.report-summary-body {
  text-align: left;
  line-height: 1.35;
}

.report-summary-body h2,
.report-summary-body p {
  margin-left: 0;
}

.picture-report-body {
  margin-top: 16px;
  text-align: left;
  line-height: 1.35;
}

.picture-report-body h2,
.picture-report-body p {
  margin-left: 0;
}

.report-label {
  color: var(--red);
  font-weight: 900;
  letter-spacing: 0.04em;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.picture-report-details,
.picture-report-purpose,
.picture-report-register {
  margin-bottom: 18px;
}

.report-narrative-sections {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.report-narrative-section {
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px;
  break-inside: avoid;
  line-height: 1.35;
}

.report-narrative-section h2 {
  color: var(--green-dark);
  font-size: 16px;
  margin: 0 0 8px;
}

.report-narrative-section textarea {
  min-height: 120px;
}

.controls-approval {
  border: 1px solid var(--line);
  background: #fff;
  margin: 0 0 18px;
  padding: 14px;
  break-inside: avoid;
}

.controls-approval h2 {
  margin: 0 0 8px;
  color: var(--green-dark);
}

.controls-approval p {
  margin: 0 0 14px;
}

.approval-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.approval-grid > div {
  display: grid;
  gap: 4px;
}

.approval-line {
  border-bottom: 1px solid var(--ink);
  height: 34px;
  margin-bottom: 4px;
}

.approval-signature {
  display: block;
  max-width: 220px;
  max-height: 70px;
  object-fit: contain;
  border-bottom: 1px solid var(--ink);
  margin-bottom: 4px;
}

.picture-report-editor {
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  background: #f8fbf9;
  margin-bottom: 18px;
  padding: 14px;
}

.picture-editor-heading,
.picture-finding-topline {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.picture-editor-heading h2,
.picture-editor-heading p {
  margin: 0 0 6px;
}

.picture-finding-editor {
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px;
  margin-top: 12px;
}

.picture-finding-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.picture-finding-editor label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.picture-finding-editor input,
.picture-finding-editor select,
.picture-finding-editor textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.picture-finding-editor textarea {
  min-height: 78px;
  resize: vertical;
}

.picture-finding-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  background: #f8fbf9;
}

.picture-finding-preview img {
  width: 110px;
  height: 80px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.section-photo-editor {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.section-photo-editor label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.section-photo-output {
  margin-top: 10px;
  break-inside: avoid;
}

.section-photo-output img {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 360px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #fff;
  display: block;
}

.section-photo-output p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.score-card-graph {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fff;
  break-inside: avoid;
}

.score-card-graph-section {
  margin: 18px 0;
}

.score-graph-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.score-graph-heading h3 {
  margin: 0;
  color: var(--green-dark);
  font-size: 16px;
}

.score-graph-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.score-graph-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.score-graph-kpis div {
  border: 1px solid var(--line);
  background: #f8fbf9;
  padding: 10px;
}

.score-graph-kpis strong {
  display: block;
  color: var(--green-dark);
  font-size: 22px;
}

.score-graph-kpis span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.score-graph-bars {
  display: grid;
  gap: 8px;
}

.score-graph-bar {
  display: grid;
  grid-template-columns: minmax(160px, 1.5fr) 3fr 52px;
  gap: 10px;
  align-items: center;
}

.score-graph-bar span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.score-graph-bar div {
  height: 14px;
  border: 1px solid var(--line);
  background: #eef1ef;
}

.score-graph-bar i {
  display: block;
  height: 100%;
  background: var(--green);
}

.score-graph-bar.score-poor i {
  background: #e60000;
}

.score-graph-bar.score-improve i {
  background: #f2b600;
}

.score-graph-bar.score-good i {
  background: #00a51d;
}

.score-graph-bar strong {
  color: var(--green-dark);
  font-size: 12px;
  text-align: right;
}

.additional-site-section {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.additional-site-section label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-top: 10px;
}

.additional-site-section input,
.additional-site-section textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px;
  font: inherit;
  color: var(--ink);
}

.additional-site-section textarea {
  min-height: 90px;
  resize: vertical;
}

.additional-site-section-actions,
.report-bottom-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.additional-site-section-print {
  margin-top: 14px;
  break-inside: avoid;
}

.audit-reference-block {
  margin-top: 14px;
}

.audit-reference-block h3 {
  color: var(--green-dark);
  font-size: 18px;
  margin: 0 0 8px;
}

.audit-reference-block table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.audit-reference-block th,
.audit-reference-block td {
  border: 1px solid #8d9994;
  padding: 10px;
  vertical-align: top;
}

.audit-reference-block th {
  background: #f2f5f4;
  color: var(--ink);
  font-weight: 900;
  text-align: center;
}

.audit-reference-block textarea {
  width: 100%;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px;
  font: inherit;
}

.monthly-evidence-graph {
  margin-top: 8px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 10px;
}

.monthly-evidence-graph h3 {
  margin: 0 0 4px;
  color: var(--green-dark);
  font-size: 13px;
}

.monthly-evidence-graph svg {
  width: 100%;
  height: 96px;
  display: block;
}

.monthly-evidence-graph line {
  stroke: #cfd8d4;
  stroke-width: 1;
}

.monthly-evidence-graph polyline {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
}

.monthly-evidence-graph circle {
  fill: #00a51d;
  stroke: #e60000;
  stroke-width: 1.5;
}

.monthly-evidence-graph text {
  fill: var(--ink);
  font-size: 10px;
  font-weight: 700;
}

.compliance-methodology {
  margin-top: 8px;
  break-inside: avoid;
}

.compliance-methodology p {
  margin: 0 0 8px;
  font-size: 15px;
}

.method-row {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  border: 1px solid #8d9994;
  border-bottom: 0;
  color: #111;
  font-weight: 900;
}

.method-row:last-child {
  border-bottom: 1px solid #8d9994;
}

.method-row strong,
.method-row span {
  padding: 8px 10px;
  border-right: 1px solid #8d9994;
}

.method-row span {
  border-right: 0;
}

.method-red {
  background: #e60000;
}

.method-amber {
  background: #f2b600;
}

.method-green {
  background: #00a51d;
}

.dual-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.dual-photo-slot {
  min-width: 0;
}

.dual-photo-slot.section-photo-editor {
  border: 1px dashed var(--green);
  border-radius: 6px;
  padding: 12px;
  background: #f8fbf9;
}

.dual-photo-slot label strong {
  display: inline-flex;
  width: fit-content;
  border-radius: 4px;
  background: var(--green);
  color: #fff;
  padding: 8px 12px;
}

.dual-photo-slot label input[type="file"] {
  display: none;
}

.finding-category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
  border: 1px solid #8d9994;
  background: #fff;
}

.finding-category-cell {
  min-height: 170px;
  border-right: 1px solid #8d9994;
  padding: 10px;
}

.finding-category-cell:last-child {
  border-right: 0;
}

.finding-category-cell h3 {
  margin: 0 0 10px;
  text-align: center;
  color: var(--ink);
  font-size: 14px;
}

.finding-category-cell input,
.finding-category-cell textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px;
  font: inherit;
}

.finding-category-cell input {
  margin-bottom: 8px;
  font-weight: 900;
  text-align: center;
}

.finding-category-cell textarea {
  min-height: 130px;
  resize: vertical;
}

.categorization-ncr-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 4px solid var(--green);
  background: #f8fbf9;
  line-height: 1.4;
}

.categorization-ncr-note p {
  margin: 0;
}

.environmental-table-block {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.environmental-table-block h3 {
  margin: 0;
  color: var(--green-dark);
  font-size: 15px;
}

.environmental-table-row {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  background: #f8fbf9;
  break-inside: avoid;
}

.environmental-table-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.environmental-table-row input,
.environmental-table-row select,
.environmental-table-row textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.environmental-table-row textarea {
  min-height: 80px;
  resize: vertical;
}

.picture-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: #fff;
}

.picture-detail-grid div {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.picture-detail-grid .detail-full-row {
  grid-column: 1 / -1;
}

.picture-detail-grid strong {
  color: var(--green-dark);
  font-size: 12px;
  text-transform: uppercase;
}

.picture-detail-grid span {
  color: var(--ink);
  font-size: 14px;
}

.picture-report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.picture-report-item {
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px;
  break-inside: avoid;
}

.picture-report-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid #eef1ef;
  display: block;
  margin-bottom: 8px;
}

.picture-report-item h3 {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--green-dark);
}

.picture-report-item p {
  margin: 4px 0;
  font-size: 13px;
}

.appendix-photo-block {
  margin-bottom: 16px;
  padding: 0;
}

.appendix-photo-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background: #eef5f1;
  border-bottom: 1px solid var(--line);
  color: var(--green-dark);
  padding: 10px 12px;
}

.appendix-photo-layout {
  display: grid;
  grid-template-columns: minmax(260px, 42%) 1fr;
  gap: 12px;
  padding: 12px;
}

.appendix-photo-layout img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  margin: 0;
}

.photo-placeholder {
  display: grid;
  place-items: center;
  min-height: 260px;
  border: 1px dashed var(--line);
  background: #f8fbf9;
  color: var(--muted);
  font-weight: 700;
}

.appendix-photo-notes {
  display: grid;
  align-content: start;
  gap: 8px;
}

.appendix-photo-notes p {
  margin: 0;
  border-bottom: 1px solid #eef1ef;
  padding-bottom: 6px;
}

.report-signature {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  align-items: end;
}

.report-signature img {
  max-width: 220px;
  max-height: 90px;
  border-bottom: 1px solid var(--ink);
}

.picture-report-signature {
  display: block;
  margin-left: 0;
}

.report-summary-signature {
  display: block;
  margin-left: 0;
  margin-top: 8px;
}

.picture-report-signature img {
  display: block;
  margin-bottom: 8px;
}

.report-summary-signature img {
  display: block;
  margin-bottom: 8px;
}

.report-meta-footer {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 10px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.report-meta-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.report-toc {
  border: 1px solid var(--line);
  background: #fff;
  margin: 0 0 18px;
  padding: 14px;
  break-inside: avoid;
}

.report-toc-approval-page {
  margin: 18px 0;
}

.report-executive-summary {
  border: 1px solid var(--line);
  background: #fff;
  margin: 0 0 18px;
  padding: 14px;
  line-height: 1.45;
}

.report-executive-summary h2 {
  color: var(--green-dark);
  margin: 0 0 10px;
}

.report-executive-summary p {
  margin: 0;
}

.report-toc h2 {
  color: var(--green-dark);
  margin: 0 0 10px;
}

.report-toc ol {
  margin: 0;
  padding-left: 22px;
}

.report-toc li {
  margin: 0 0 5px;
  font-weight: 700;
}

.report-meta-footer span {
  min-width: 0;
}

.report-powered-by {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
}

.report-powered-by img {
  width: 122px;
  max-height: 40px;
  object-fit: contain;
}

.report-meta-footer em {
  color: var(--ink);
  font-style: normal;
  font-weight: 700;
}

.picture-report-body .empty {
  padding: 8px 0 0;
}

.print-only {
  display: none;
}

.table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 850px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #eef5f1;
  color: var(--green-dark);
}

.report-panel {
  padding: 22px;
}

.saved-reports-panel {
  margin-top: 16px;
  padding: 22px;
}

.report-start-row {
  display: flex;
  justify-content: flex-end;
  max-width: 100%;
  margin-bottom: 12px;
}

.saved-reports-list {
  display: grid;
  gap: 10px;
}

.panel-note,
.form-help {
  color: var(--muted);
  font-size: 13px;
}

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

.photo-finding-panel {
  display: grid;
  gap: 14px;
}

.photo-finding-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(260px, 1.2fr);
  gap: 14px;
  align-items: start;
}

.photo-finding-grid input,
.photo-finding-grid textarea {
  width: 100%;
}

.photo-finding-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.photo-finding-result {
  border: 1px solid var(--line);
  background: #f8fbf9;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.photo-finding-result.empty {
  color: var(--muted);
}

.photo-finding-result strong {
  color: var(--green-dark);
}

.photo-finding-result p {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.photo-finding-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.photo-finding-meta span {
  border: 1px solid var(--green);
  background: #eef8f1;
  color: var(--green-dark);
  font-weight: 800;
  padding: 5px 8px;
  border-radius: 999px;
}

.settings-panel {
  width: 100%;
  max-width: none;
}

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-heading-row h2 {
  margin: 0;
}

.settings-invite {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 16px;
}

.settings-invite h3 {
  margin: 0 0 12px;
  color: var(--green-dark);
}

.settings-signature {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 16px;
}

.settings-signature h3 {
  margin: 0 0 12px;
  color: var(--green-dark);
}

.settings-branding {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 16px;
}

.settings-branding h3 {
  margin: 0 0 12px;
  color: var(--green-dark);
}

.signature-upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.default-signature-preview {
  margin-top: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  min-height: 82px;
  padding: 10px;
  display: flex;
  align-items: center;
}

.company-logo-preview {
  margin-top: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  min-height: 92px;
  padding: 10px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.company-logo-preview img {
  max-width: 260px;
  max-height: 86px;
  object-fit: contain;
}

.color-grid {
  margin-top: 12px;
}

.color-grid input[type="color"] {
  min-height: 44px;
  padding: 4px;
}

.default-signature-preview img {
  max-width: 260px;
  max-height: 80px;
  object-fit: contain;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.button-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 4px;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.button-link.primary {
  background: var(--green);
}

.wide-field {
  grid-column: 1 / -1;
}

.subscription-bank-details {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.subscription-bank-details h4 {
  margin: 0 0 12px;
}

.subscription-bank-details dl {
  display: grid;
  grid-template-columns: minmax(110px, 0.45fr) 1fr;
  gap: 8px 16px;
  margin: 0;
}

.subscription-bank-details dt {
  font-weight: 700;
}

.subscription-bank-details dd {
  margin: 0;
}

.admin-account-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.admin-account-card {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 16px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--green);
  border-radius: 6px;
}

.admin-account-card h3,
.admin-account-card p {
  margin: 0 0 7px;
}

.admin-account-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 760px) {
  .admin-account-card {
    display: block;
  }

  .admin-account-actions {
    justify-content: stretch;
    margin-top: 12px;
  }

  .admin-account-actions button {
    width: 100%;
  }

  .subscription-bank-details dl {
    grid-template-columns: 1fr;
  }
}

.company-users-list {
  display: grid;
  gap: 8px;
}

.company-user-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px;
}

.company-user-row strong,
.company-user-row span {
  display: block;
}

.company-user-row span {
  color: var(--muted);
  font-size: 12px;
}

.saved-report-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px;
}

.print-continuation-header {
  display: none;
}

.saved-report-row strong {
  display: block;
  margin-bottom: 4px;
  color: var(--green-dark);
}

.saved-report-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.saved-report-actions {
  display: grid;
  grid-template-columns: repeat(5, auto);
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.current-report-actions {
  display: grid;
  gap: 8px;
  border: 1px solid var(--green);
  background: #f5fbf7;
  padding: 12px;
  margin-bottom: 12px;
}

.current-report-actions strong {
  color: var(--green-dark);
  font-size: 16px;
}

.current-report-actions span {
  color: var(--muted);
  font-size: 12px;
}

.current-report-actions div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-list-mode #reportContent {
  display: none;
}

.report-text-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr)) repeat(7, auto);
  gap: 8px;
  align-items: end;
  border: 1px solid var(--line);
  background: #f7faf8;
  padding: 10px;
  margin: 10px 0 14px;
}

.report-text-tools label {
  margin: 0;
}

.report-text-tools button {
  min-height: 42px;
}

.report-text-list {
  margin: 0 0 2mm 6mm;
  padding-left: 5mm;
}

.report-bullet-disc {
  list-style-type: disc;
}

.report-bullet-circle {
  list-style-type: circle;
}

.report-bullet-square {
  list-style-type: square;
}

.report-check-list {
  list-style: none;
}

.report-check-list li::before {
  content: "\2713";
  color: var(--green-dark);
  display: inline-block;
  font-weight: 900;
  margin-left: -5mm;
  width: 5mm;
}

.section-a-print mark {
  background: #fff3a3;
  color: var(--ink);
  padding: 0 2px;
}

.download-report-button,
.download-report-button span {
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.download-report-button span {
  min-width: 2.4em;
  font-weight: 900;
}

.report-header {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: center;
  justify-items: center;
  text-align: center;
  border-bottom: 2px solid var(--green);
  padding-bottom: 22px;
  margin-bottom: 18px;
}

.report-address {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  padding: 14px 26px;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.app-footer strong {
  color: var(--green-dark);
}

.app-footer > .footer-block {
  display: none;
}

.footer-block {
  display: grid;
  gap: 2px;
}

.footer-block span {
  color: var(--muted);
}

.footer-block span:first-of-type {
  color: var(--ink);
}

.app-footer a,
.footer-block a {
  color: var(--green);
  font-weight: 800;
  text-decoration: none;
}

.footer-powered-by {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--red);
  font-weight: 900;
  text-align: center;
}

.footer-powered-by img {
  width: 280px;
  max-width: 100%;
  max-height: 112px;
  object-fit: contain;
}

@media (min-width: 900px) {
  .app-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    font-size: 10px;
  }

  .footer-powered-by {
    justify-self: end;
  }
}

.report-header > img {
  width: 170px;
}

.report-logo-stack {
  display: grid;
  gap: 8px;
  align-content: center;
  justify-items: center;
}

.report-logo-stack img {
  width: 380px;
  max-height: 205px;
  object-fit: contain;
  border: 0;
  background: #fff;
}

.report-header.ohs-inspection-cover,
.report-header.picture-report-cover:not(.environmental-report-cover) {
  gap: 22px;
  padding-bottom: 22px;
  margin-bottom: 18px;
}

.report-header.ohs-inspection-cover .report-logo-stack img,
.report-header.picture-report-cover:not(.environmental-report-cover) .report-logo-stack img {
  width: 410px;
  max-height: 225px;
}

.report-header.ohs-inspection-cover h2,
.report-header.picture-report-cover:not(.environmental-report-cover) h2 {
  font-size: 26px;
  line-height: 1.18;
  margin: 0 0 8px;
}

.report-header.ohs-inspection-cover .report-address,
.report-header.picture-report-cover:not(.environmental-report-cover) .report-address {
  font-size: 14px;
}

.report-header.ohs-inspection-cover .report-cover-details,
.picture-report-body:not(.environmental-report-body) .picture-report-cover-details {
  font-size: 15px;
  line-height: 1.38;
}

.picture-report-cover-details {
  text-align: center;
  margin-top: 0;
}

.picture-report-body:not(.environmental-report-body) .picture-report-cover-details h2 {
  font-size: 26px;
  line-height: 1.18;
  margin: 0 0 12px;
}

.report-cover-details,
.picture-report-details {
  text-align: center;
  line-height: 1.38;
}

.report-cover-details p,
.picture-report-details p {
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 12px;
}

.report-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.report-kpis div {
  border: 1px solid var(--line);
  padding: 10px;
}

.empty {
  color: var(--muted);
  padding: 18px;
}

@media (max-width: 900px) {
  .app-header,
  .app-footer,
  .panel-grid,
  .metrics,
  .question,
  .report-header,
  .report-kpis,
  .scope-options,
  .chart-row,
  .picture-report-grid,
  .contractor-stats,
  .contractor-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .contractor-notes {
    grid-column: auto;
  }

  .tabs,
  .header-actions {
    flex-wrap: wrap;
  }

  .app-header {
    position: static;
    gap: 12px;
    grid-template-columns: 1fr;
  }

  .brand {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 24px;
  }

  .brand-meta {
    width: auto;
  }

  .header-logo-frame {
    width: 280px;
    height: 112px;
  }

  .form-grid,
  .saved-report-row {
    grid-template-columns: 1fr;
  }

  .saved-report-actions {
    justify-content: flex-start;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .photo-finding-grid {
    grid-template-columns: 1fr;
  }

  .template-builder-form,
  .template-scope-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    background: #fff;
    font-size: 14px;
  }

  .modal-backdrop {
    padding: 8px;
    align-items: start;
  }

  .modal {
    width: 100%;
    max-height: calc(100vh - 16px);
    padding: 14px;
    border-radius: 10px;
  }

  .modal-header {
    top: -14px;
    margin: -14px -14px 8px;
    padding: 14px 14px 8px;
  }

  .scope-options {
    gap: 8px;
  }

  .scope-options button {
    min-height: 50px;
    padding: 9px 12px;
  }

  .template-builder-panel {
    padding: 10px;
    border-radius: 12px;
  }

  .template-builder-form textarea {
    min-height: 76px;
    max-height: 120px;
  }

  .photo-finding-actions {
    flex-direction: column;
  }

  .photo-finding-actions button {
    width: 100%;
  }

  .app-header {
    width: calc(100% - 20px);
    max-width: calc(100vw - 20px);
    margin: 10px auto 0;
    padding: 10px;
    border-radius: 24px;
    overflow: hidden;
  }

  .brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    overflow: hidden;
  }

  .header-logo-frame {
    flex: 0 0 48%;
    width: 48%;
    height: 88px;
    order: 2;
  }

  .brand-meta {
    font-size: 9px;
    line-height: 1.18;
    min-width: 0;
    flex: 1 1 58%;
    order: 1;
    width: auto;
    justify-self: auto;
    overflow-wrap: anywhere;
  }

  .brand-meta strong {
    font-size: 11px;
  }

  .tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 5px;
  }

  .tab {
    min-height: 38px;
    padding: 7px 6px;
    font-size: 11px;
    line-height: 1.1;
    text-align: center;
    white-space: normal;
  }

  button {
    min-height: 42px;
    padding: 9px 10px;
    text-align: center;
    white-space: normal;
  }

  main {
    padding: 16px 10px 28px;
  }

  .page-title {
    margin-bottom: 14px;
  }

  .page-title h1 {
    font-size: 20px;
    line-height: 1.2;
  }

  .page-title p {
    font-size: 14px;
    line-height: 1.35;
  }

  .compact h1 {
    font-size: 18px;
  }

  .metrics {
    gap: 10px;
  }

  .metric {
    min-height: auto;
    padding: 10px 12px;
    border-radius: 16px;
  }

  .metric span {
    font-size: 11px;
    line-height: 1.2;
    margin-bottom: 6px;
  }

  .metric strong {
    display: block;
    font-size: 16px;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .panel,
  .report-panel {
    border: 1.5px solid #c8d5d1;
    border-radius: 18px;
    padding: 14px 10px;
  }

  .sap-logo-box {
    width: 100%;
    max-width: calc(100vw - 40px);
    margin-left: auto;
    margin-right: auto;
    padding: 18px 20px;
    border: 2px solid #c8d5d1;
    border-radius: 18px;
    box-shadow: 0 0 0 2px rgba(31, 111, 55, 0.06), 0 10px 22px rgba(31, 45, 55, 0.08);
  }

  .sap-logo-box img {
    max-width: 100%;
  }

  .section-heading-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
  }

  .section-heading-row h2 {
    min-width: 0;
    font-size: 18px;
    line-height: 1.15;
  }

  .section-heading-row button {
    min-height: 40px;
    padding: 8px 10px;
    max-width: 150px;
    font-size: 11px;
    line-height: 1.15;
  }

  .analytics-card {
    border-radius: 16px;
  }

  .analytics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-row {
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 12px;
  }

  .donut-chart {
    width: 108px;
    height: 108px;
  }

  .donut-chart::after {
    width: 68px;
    height: 68px;
  }

  .bar-line {
    grid-template-columns: minmax(74px, 0.9fr) minmax(76px, 1fr) 28px;
    gap: 6px;
  }

  .audit-introduction {
    border-radius: 18px;
    background: #fff;
    border: 1.5px solid #c8d5d1;
  }

  .audit-introduction p {
    background: #fff;
    font-size: 14px;
    line-height: 1.5;
    padding: 14px 16px;
  }

  .audit-introduction h2 {
    font-size: 18px;
    line-height: 1.2;
    padding: 14px 16px;
  }

  .intro-logo-row img {
    max-width: 100%;
  }

  .panel-grid {
    gap: 10px;
  }

  .intro-logo-row {
    grid-template-columns: 1fr;
  }

  .chart-row {
    gap: 12px;
  }

  .donut-chart {
    width: 108px;
    height: 108px;
  }

  .bar-line {
    grid-template-columns: minmax(74px, 0.9fr) minmax(76px, 1fr) 28px;
    gap: 6px;
  }

  .bar-line strong {
    text-align: right;
  }

  .question {
    padding: 12px 10px;
  }

  .category-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .category-tools,
  .question-tools,
  .audit-toolbar,
  .settings-actions,
  .signature-upload-row,
  .signature-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .category-tools button,
  .question-tools button,
  .audit-toolbar button,
  .settings-actions button,
  .signature-actions button {
    width: 100%;
  }

  .saved-report-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    width: 100%;
  }

  .saved-report-actions button,
  .current-report-actions button {
    width: 100%;
    min-width: 0;
  }

  .current-report-actions div {
    display: grid;
    grid-template-columns: 1fr;
  }

  .report-text-tools {
    grid-template-columns: 1fr 1fr;
  }

  .report-text-tools label,
  .report-text-tools .primary {
    grid-column: 1 / -1;
  }

  .contact-field {
    grid-column: 1 / -1;
  }

  .evidence-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-header {
    gap: 10px;
    align-items: start;
  }

  .report-logo-stack img {
    width: 180px;
    max-height: 98px;
  }

  .report-kpis {
    gap: 8px;
  }

  .report-signature {
    grid-template-columns: 1fr;
  }

  .picture-report-grid {
    gap: 10px;
  }

  .picture-detail-grid,
  .picture-finding-grid,
  .score-graph-kpis,
  .approval-grid,
  .appendix-photo-layout {
    grid-template-columns: 1fr;
  }

  .score-graph-heading,
  .score-graph-bar {
    grid-template-columns: 1fr;
  }

  .score-graph-heading {
    flex-direction: column;
  }

  .picture-editor-heading,
  .picture-finding-topline {
    flex-direction: column;
  }

  .appendix-photo-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .company-user-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-footer {
    width: 100%;
    padding: 14px 16px 18px;
    gap: 16px;
    font-size: 11.5px;
  }

  body:not(.locked-out) .request-access-panel {
    display: none;
  }

  #report.view:not(.active) {
    display: none;
  }

  #report.active {
    display: flex;
    flex-direction: column;
  }

  #report .page-title {
    order: 1;
  }

  .saved-reports-panel {
    order: 3;
  }

  #reportContent {
    order: 2;
  }

  .saved-reports-panel h2 {
    font-size: 18px;
    margin-top: 0;
  }

  .saved-report-row {
    border-radius: 14px;
    padding: 12px;
  }
}

.safetyculture-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 16px;
}

.safetyculture-card h2,
.safetyculture-list-panel h2 {
  margin: 0 0 12px;
}

.workflow-form {
  display: grid;
  gap: 10px;
}

.workflow-form input,
.workflow-form select,
.workflow-form textarea {
  width: 100%;
  min-width: 0;
}

.workflow-form textarea {
  min-height: 84px;
  resize: vertical;
}

.safetyculture-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}

.safetyculture-summary div {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 12px;
}

.safetyculture-summary span,
.workflow-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.safetyculture-summary strong {
  display: block;
  color: var(--green-dark);
  font-size: 24px;
  line-height: 1.1;
}

.workflow-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.workflow-dashboard-grid div {
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 14px;
  background: #f7fbf8;
  padding: 12px;
  min-width: 0;
}

.workflow-dashboard-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}

.workflow-dashboard-grid strong {
  display: block;
  color: var(--green-dark);
  font-size: 24px;
  line-height: 1.1;
  margin-top: 4px;
}

.workflow-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.workflow-list .empty {
  padding: 0;
  text-align: left;
}

.template-scope-options {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.template-scope-heading {
  grid-column: 1 / -1;
  color: var(--green-dark);
  font-weight: 900;
}

.template-scope-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.template-scope-card button {
  min-width: 0;
}

.template-scope-card [data-new-scope] {
  display: grid;
  gap: 4px;
  text-align: left;
}

.template-scope-card [data-new-scope] span {
  color: var(--muted);
  font-size: 11px;
}

.template-live-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(64px, auto));
  gap: 6px;
  align-items: stretch;
}

.template-live-actions button {
  min-height: 0;
  padding: 8px 10px;
  text-align: center;
}

.template-builder-panel {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f7fbf8;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.template-builder-panel h3,
.template-builder-panel p {
  margin: 0;
}

.template-builder-panel p {
  color: var(--muted);
  line-height: 1.45;
}

.template-archive-panel {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 22px;
  background: #fbfcfb;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.template-archive-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.template-archive-heading h3 {
  margin: 0;
  color: var(--green-dark);
}

.template-archive-heading span,
.template-archive-summary span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.archived-template-options {
  margin-top: 0;
}

.archived-template-card {
  opacity: 0.92;
}

.template-archive-summary {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 10px 12px;
  min-width: 0;
}

.template-archive-summary strong,
.template-archive-summary span {
  display: block;
  overflow-wrap: anywhere;
}

.template-builder-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 0.45fr);
  gap: 10px;
}

.template-builder-form input,
.template-builder-form select,
.template-builder-form textarea,
.template-builder-form button {
  width: 100%;
  min-width: 0;
}

.template-builder-form textarea,
.template-builder-form button {
  grid-column: 1 / -1;
}

.template-builder-form textarea {
  min-height: 96px;
  max-height: 170px;
}

@media (max-width: 640px) {
  .template-builder-form,
  .template-scope-options,
  .template-scope-card {
    grid-template-columns: 1fr;
  }

  .template-live-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .template-builder-form textarea {
    min-height: 76px;
    max-height: 120px;
  }

  .template-archive-heading {
    display: grid;
  }
}

.workflow-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
}

.workflow-item.overdue {
  border-color: #ef9a9a;
  background: #fff8f8;
}

.workflow-item strong {
  display: block;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.workflow-item p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.workflow-actions,
.approval-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.workflow-actions button,
.approval-strip button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

.compact-workflow-item {
  align-items: center;
}

.status-pill.open {
  background: #e8f4ff;
  color: #155e91;
}

.status-pill.closed,
.status-pill.signed-off,
.status-pill.scheduled,
.status-pill.completed,
.status-pill.approved,
.status-pill.active,
.status-pill.sent {
  background: #e7f6ec;
  color: var(--green-dark);
}

.status-pill.assigned,
.status-pill.submitted,
.status-pill.pending,
.status-pill.medium,
.status-pill.changes-required {
  background: #fff7df;
  color: #9a6200;
}

.status-pill.high,
.status-pill.rejected,
.status-pill.paused {
  background: #ffe7e7;
  color: #a11212;
}

.status-pill.low {
  background: #edf7ff;
  color: #12608c;
}

@media (max-width: 640px) {
  .safetyculture-grid,
  .safetyculture-summary {
    grid-template-columns: 1fr;
  }

  .workflow-dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .template-builder-form,
  .template-scope-options,
  .template-scope-card {
    grid-template-columns: 1fr;
  }

  .workflow-item {
    grid-template-columns: 1fr;
  }

  .workflow-actions,
  .approval-strip {
    justify-content: stretch;
  }

  .workflow-actions button,
  .approval-strip button {
    flex: 1 1 120px;
    white-space: normal;
  }

  .table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 16px;
  }

  .table-wrap table,
  .contractor-table {
    min-width: 680px;
    font-size: 12px;
    line-height: 1.25;
  }

  th,
  td {
    padding: 8px 7px;
    line-height: 1.25;
    overflow-wrap: normal;
    word-break: normal;
  }

  td button,
  .table-wrap button {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 11px;
    line-height: 1.1;
  }

  .workspace-view .table-wrap,
  .workspace-view .contractor-table {
    margin-top: 6px;
  }

  .workspace-view .page-title p,
  .dashboard-folder-content p,
  .empty {
    text-align: left;
  }

  .contractor-form label,
  .form-grid label,
  .report-panel label {
    align-items: stretch;
  }
}

/* Rounded surface pass */
.app-header,
.page-title,
.page-title.workspace-title,
.dashboard-folder,
.workspace-view .dashboard-folder-content,
.metric,
.metrics > *,
.panel,
.panel-grid > .panel,
.analytics-card,
.contractor-stats div,
.safetyculture-summary div,
.workflow-dashboard-grid div,
.workflow-item,
.template-builder-panel,
.template-scope-card,
.table-wrap,
.report-panel,
.saved-reports-panel,
.photo-finding-panel,
.photo-finding-result,
.evidence-card,
.modal,
.admin-account-card,
.score-card-graph-section,
.report-executive-summary,
.report-summary-body > div:not(.safety-file-section-b),
.score-card-report-section,
.score-card-parent-section,
.score-card-report-question {
  border-radius: 26px;
}

.template-scope-card button,
.workflow-form input,
.workflow-form select,
.workflow-form textarea,
.template-builder-form input,
.template-builder-form select,
.template-builder-form textarea,
input,
select,
textarea {
  border-radius: 18px;
}

.modal-header,
.table-wrap table {
  border-radius: 26px 26px 0 0;
}

@media (max-width: 720px) {
  .app-header,
  .page-title,
  .page-title.workspace-title,
  .dashboard-folder,
  .workspace-view .dashboard-folder-content,
  .metric,
  .metrics > *,
  .panel,
  .panel-grid > .panel,
  .analytics-card,
  .contractor-stats div,
  .safetyculture-summary div,
  .workflow-dashboard-grid div,
  .workflow-item,
  .template-builder-panel,
  .template-scope-card,
  .table-wrap,
  .report-panel,
  .saved-reports-panel,
  .photo-finding-panel,
  .photo-finding-result,
  .evidence-card,
  .modal,
  .admin-account-card {
    border-radius: 22px;
  }
}

/* Compact New Scope template builder */
#scorecardOptions .template-builder-panel,
#scorecardOptions .template-archive-panel {
  padding: 10px 12px;
  gap: 8px;
  border-radius: 18px;
}

#scorecardOptions .template-builder-panel h3,
#scorecardOptions .template-archive-heading h3 {
  font-size: 16px;
  line-height: 1.15;
}

#scorecardOptions .template-builder-panel p,
#scorecardOptions .template-archive-heading span,
#scorecardOptions .template-archive-summary span,
#scorecardOptions .empty {
  font-size: 12px;
  line-height: 1.3;
}

#scorecardOptions .template-builder-form {
  gap: 8px;
}

#scorecardOptions .template-builder-form input,
#scorecardOptions .template-builder-form select,
#scorecardOptions .template-builder-form textarea,
#scorecardOptions .template-builder-form button,
#scorecardOptions .template-live-actions button {
  font-size: 12px;
  min-height: 34px;
  padding: 7px 10px;
}

#scorecardOptions .template-builder-form textarea {
  min-height: 76px;
  max-height: 92px;
}

#scorecardOptions .template-archive-summary {
  padding: 8px 10px;
  border-radius: 16px;
}

@media (max-width: 720px) {
  #scorecardOptions .template-builder-panel,
  #scorecardOptions .template-archive-panel {
    padding: 9px;
    gap: 7px;
    border-radius: 16px;
  }

  #scorecardOptions .template-builder-panel h3,
  #scorecardOptions .template-archive-heading h3 {
    font-size: 15px;
  }

  #scorecardOptions .template-builder-form input,
  #scorecardOptions .template-builder-form select,
  #scorecardOptions .template-builder-form textarea,
  #scorecardOptions .template-builder-form button,
  #scorecardOptions .template-live-actions button {
    font-size: 11px;
    min-height: 30px;
    padding: 6px 8px;
  }

  #scorecardOptions .template-builder-form textarea {
    min-height: 58px;
    max-height: 74px;
  }
}

/* Rounded controls pass */
button,
.button-link,
.primary,
.secondary,
.tab,
.scope-options button,
.settings-actions button,
.signature-actions button,
.signature-upload-row button,
.saved-report-actions button,
.current-report-actions button,
.report-bottom-actions button,
.report-text-tools button,
.category-tools button,
.question-tools button,
.audit-toolbar button,
.workflow-actions button,
.approval-strip button,
td button,
.table-wrap button,
input[type="file"]::file-selector-button {
  border-radius: 999px;
}

.save-status,
.login-help-box,
.current-report-actions,
.report-text-tools,
.status-pill,
.panel-note {
  border-radius: 18px;
}

.saved-report-actions button,
.current-report-actions button,
.settings-actions button,
.signature-actions button,
.report-bottom-actions button {
  min-height: 38px;
  padding: 8px 12px;
}

@media (max-width: 720px) {
  .saved-report-actions,
  .current-report-actions div,
  .settings-actions,
  .signature-actions,
  .signature-upload-row {
    gap: 8px;
  }

  .saved-report-actions button,
  .current-report-actions button,
  .settings-actions button,
  .signature-actions button,
  .report-bottom-actions button {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 12px;
  }
}

/* New Scope modal shell stays square and work-focused */
#newAuditModal .modal {
  border-radius: 6px;
}

#newAuditModal .modal-header {
  border-radius: 6px 6px 0 0;
}

/* Mobile overlap hardening */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

img,
video,
canvas,
svg {
  max-width: 100%;
}

body,
button,
input,
select,
textarea,
td,
th,
p,
span,
strong,
label,
a {
  overflow-wrap: anywhere;
  word-break: normal;
}

button,
.button-link,
input,
select,
textarea {
  max-width: 100%;
}

@media (max-width: 720px) {
  .app-header,
  main,
  .app-footer,
  .workspace-view,
  .dashboard-folder,
  .workspace-view .dashboard-folder-content,
  .panel,
  .report-panel,
  .saved-reports-panel,
  .photo-finding-panel,
  .modal {
    max-width: 100%;
  }

  .brand,
  .brand-meta,
  .page-title,
  .section-heading-row,
  .modal-header,
  .settings-actions,
  .signature-upload-row,
  .signature-actions,
  .photo-finding-actions,
  .report-bottom-actions,
  .current-report-actions div,
  .saved-report-actions,
  .workflow-actions,
  .approval-strip {
    min-width: 0;
  }

  .page-title,
  .page-title.workspace-title {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 10px;
  }

  .page-title h1 {
    font-size: clamp(22px, 7vw, 30px);
    line-height: 1.05;
  }

  .page-title p,
  .modal p,
  .form-help,
  .save-status,
  .empty,
  .panel-note {
    font-size: 12px;
    line-height: 1.35;
    text-align: left;
  }

  .form-grid,
  .analytics-grid,
  .photo-finding-grid,
  .panel-grid,
  .metrics,
  .safetyculture-grid,
  .safetyculture-summary,
  .workflow-dashboard-grid,
  .report-evidence,
  .contractor-layout,
  .project-layout {
    grid-template-columns: 1fr !important;
  }

  .section-heading-row,
  .modal-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
  }

  .section-heading-row h2,
  .section-heading-row h3,
  .modal-header h2 {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .modal {
    width: min(96vw, 760px);
    max-width: calc(100vw - 16px);
  }

  .modal .scope-options,
  #scorecardOptions .scope-options,
  #scorecardOptions .template-scope-options {
    grid-template-columns: 1fr !important;
  }

  .scope-options button,
  .template-scope-card {
    min-height: 40px;
    padding: 10px 12px;
    white-space: normal;
    text-align: left;
  }

  .template-live-actions,
  .workflow-actions,
  .approval-strip,
  .saved-report-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .template-live-actions button,
  .workflow-actions button,
  .approval-strip button,
  .saved-report-actions button,
  .current-report-actions button,
  .settings-actions button,
  .signature-actions button,
  .report-bottom-actions button,
  .report-text-tools button,
  .category-tools button,
  .question-tools button,
  .audit-toolbar button {
    width: 100%;
    min-width: 0;
    white-space: normal;
    line-height: 1.15;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-wrap table,
  .contractor-table {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
  }

  .table-wrap th,
  .table-wrap td,
  .contractor-table th,
  .contractor-table td {
    max-width: 140px;
    font-size: 12px;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    vertical-align: top;
  }

  .table-wrap td:last-child,
  .table-wrap th:last-child,
  .contractor-table td:last-child,
  .contractor-table th:last-child {
    max-width: 180px;
  }

  .table-wrap button,
  .contractor-table button,
  td button {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
  }

  .saved-report-row,
  .workflow-item,
  .template-scope-card,
  .current-report-actions {
    grid-template-columns: 1fr !important;
  }

  .app-footer {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
    font-size: 12px;
  }

  .footer-block,
  .footer-powered-by {
    min-width: 0;
  }
}

@media (max-width: 420px) {
  .page-title h1 {
    font-size: 24px;
  }

  .table-wrap th,
  .table-wrap td,
  .contractor-table th,
  .contractor-table td {
    max-width: 115px;
    font-size: 11px;
  }

  .template-live-actions,
  .workflow-actions,
  .approval-strip,
  .saved-report-actions {
    grid-template-columns: 1fr !important;
  }
}

@media print {
  @page {
    margin: 16mm 14mm 52mm;
  }

  body {
    background: #fff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .app-header,
  .app-footer,
  .page-title,
  .no-print,
  .saved-reports-panel,
  #dashboard,
  #audit,
  #settings,
  #actions {
    display: none !important;
  }

  .print-only {
    display: block !important;
  }

  main {
    max-width: none;
    padding: 0;
  }

  #report {
    display: block !important;
  }

  .print-continuation-header {
    display: none !important;
  }

  .report-panel {
    border: 0;
    padding: 0;
  }

  .review-letter {
    padding: 8mm 9mm;
    margin-bottom: 4mm;
    line-height: 1.2;
  }

  .review-letter-header {
    margin-bottom: 4mm;
  }

  .review-letter p,
  .section-a-print p {
    margin: 0 0 1.4mm;
  }

  .compact-section-text p {
    margin: 0 0 1.6mm;
  }

  .section-a-print .paragraph-gap {
    height: 0;
  }

  .review-letter-actions {
    margin: 4mm 0 0;
    padding: 4mm;
  }

  .review-letter-actions ul {
    margin-top: 2mm;
  }

  .review-letter-actions li {
    margin: 0 0 1mm;
  }

  .report-summary-body {
    margin-top: 3mm;
    padding-bottom: 26mm;
  }

  .picture-report-body {
    padding-bottom: 26mm;
  }

  .report-summary-body h2 {
    margin: 3mm 0 2mm;
  }

  .report-summary-body p {
    margin: 0 0 2mm;
    line-height: 1.22;
  }

  .safety-file-report-item {
    break-inside: avoid;
    page-break-inside: avoid;
    display: block;
    margin-bottom: 5mm !important;
    padding-bottom: 5mm;
  }

  .report-meta-footer {
    position: fixed;
    left: 14mm;
    right: 14mm;
    bottom: 10mm;
    background: #fff;
    border-top: 0.4mm solid #dfe7e2;
    color: #4f5c57;
    font-size: 9px;
    line-height: 1.2;
    padding-top: 2mm;
    min-height: 16mm;
    z-index: 20;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  #reportContent::after {
    content: "";
    display: block;
    height: 28mm;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  img,
  svg {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .report-header .report-logo-stack {
    margin-bottom: 10mm;
  }

  .report-header.ohs-inspection-cover,
  .report-header.picture-report-cover:not(.environmental-report-cover) {
    padding-top: 9mm;
  }

  .report-logo-stack img {
    width: 90mm;
    max-height: 50mm;
  }

  .report-header.ohs-inspection-cover .report-logo-stack img,
  .report-header.picture-report-cover:not(.environmental-report-cover) .report-logo-stack img {
    width: 98mm;
    max-height: 54mm;
  }

  .report-header.ohs-inspection-cover h2,
  .report-header.picture-report-cover:not(.environmental-report-cover) h2,
  .picture-report-body:not(.environmental-report-body) .picture-report-cover-details h2 {
    font-size: 19px;
    line-height: 1.18;
    margin: 0 0 3mm;
  }

  .report-header.ohs-inspection-cover .report-cover-details,
  .picture-report-body:not(.environmental-report-body) .picture-report-cover-details {
    font-size: 13px;
    line-height: 1.45;
  }

  .report-cover-details,
  .picture-report-details {
    line-height: 1.45;
  }

  .report-cover-details p,
  .picture-report-details p {
    margin-bottom: 3.2mm;
  }

  .report-toc-approval-page {
    break-before: page;
    page-break-before: always;
    min-height: 220mm;
    padding-top: 8mm;
  }

  .report-header,
  .report-kpis,
  .report-toc,
  .review-letter,
  .report-summary-body > h2,
  .report-summary-body > p,
  .report-evidence,
  .picture-report-item,
  .appendix-photo-block,
  .picture-detail-grid,
  .controls-approval,
  .report-signature {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .report-summary-body h2,
  .picture-report-body h2 {
    break-after: avoid;
    page-break-after: avoid;
    margin-top: 4mm;
  }

  .report-summary-body h2:first-child,
  .picture-report-body h2:first-child {
    margin-top: 0;
  }

  .score-card-graph-section,
  .report-executive-summary,
  .report-summary-body > div:not(.safety-file-section-b) {
    break-before: page;
    page-break-before: always;
    padding-bottom: 4mm;
  }

  .report-narrative-section {
    border: 0;
    break-inside: auto;
    page-break-inside: auto;
    padding: 0;
    margin: 0 0 8mm;
    orphans: 3;
    widows: 3;
  }

  .picture-report-purpose .report-narrative-section {
    break-before: auto;
    page-break-before: auto;
    break-inside: auto;
    page-break-inside: auto;
    padding: 0;
    margin: 0 0 8mm;
  }

  .report-narrative-sections .introduction-page,
  .picture-report-purpose .introduction-page,
  .report-narrative-sections .auditee-details-page,
  .picture-report-purpose .auditee-details-page,
  .report-narrative-sections .objective-scope-page,
  .picture-report-purpose .objective-scope-page,
  .report-narrative-sections .audit-criteria-page,
  .picture-report-purpose .audit-criteria-page,
  .report-narrative-sections .categorization-page,
  .picture-report-purpose .categorization-page,
  .report-narrative-sections .conclusion-page,
  .picture-report-purpose .conclusion-page {
    break-before: page;
    page-break-before: always;
    padding-top: 0;
  }

  .report-narrative-sections .site-safety-page,
  .picture-report-purpose .site-safety-page {
    break-before: page;
    page-break-before: always;
    padding-top: 0;
  }

  .audit-reference-block,
  .dual-photo-grid,
  .finding-category-grid,
  .monthly-evidence-graph,
  .compliance-methodology,
  .section-photo-output,
  .report-signature,
  .approval-grid,
  .controls-approval {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .score-card-report-section {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 8mm;
    padding-bottom: 8mm;
    border-bottom: 1px solid var(--line);
  }

  .score-card-report-page {
    break-after: page;
    page-break-after: always;
  }

  .score-card-report-section:last-of-type,
  .score-card-report-page:last-of-type {
    break-after: auto;
    page-break-after: auto;
  }

  .score-card-parent-section {
    break-inside: avoid;
    page-break-inside: avoid;
    margin: 8mm 0 4mm;
    border-bottom: 1px solid var(--green);
  }

  .score-card-report-question {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  tr,
  figure,
  .environmental-table-row,
  .safety-file-report-item,
  .picture-report-item,
  .report-signature,
  .report-powered-by,
  .report-meta-line {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .report-evidence {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4mm;
    margin-top: 3mm;
  }

  .report-evidence figure {
    padding: 3mm;
  }

  .report-evidence img {
    aspect-ratio: 16 / 9;
    height: 34mm;
    max-height: 34mm;
    object-fit: cover;
    display: block;
    visibility: visible;
  }

  .section-photo-output img,
  .appendix-photo-layout img {
    width: 100%;
    height: 42mm;
    max-height: 42mm;
    object-fit: cover;
    display: block;
    visibility: visible;
    opacity: 1;
    background: #fff;
  }

  .dual-photo-slot.section-photo-output img {
    height: 38mm;
    max-height: 38mm;
  }

  .approval-signature,
  .report-signature img,
  .report-summary-signature img,
  .picture-report-signature img {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    max-height: 22mm;
    max-width: 55mm;
    object-fit: contain;
  }

  .report-narrative-section .section-a-print,
  .report-narrative-section p,
  .report-narrative-section li,
  .environmental-table-row {
    line-height: 1.35;
    orphans: 3;
    widows: 3;
    overflow-wrap: anywhere;
  }

  .report-narrative-section p,
  .report-narrative-section li,
  .report-text-list {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .report-narrative-section h2,
  .report-narrative-section h3 {
    break-after: avoid;
    page-break-after: avoid;
  }

  .safety-file-section-b {
    break-before: page;
    page-break-before: always;
    padding-top: 6mm;
    padding-bottom: 4mm;
  }

  .safety-file-section-b .report-summary-signature {
    break-before: auto;
    page-break-before: auto;
    break-inside: avoid;
    page-break-inside: avoid;
    margin-top: 4mm;
  }

  .safety-file-section-b-heading {
    color: var(--green-dark);
    font-size: 18px;
    font-weight: 900;
    margin: 0 0 4mm;
  }
}

/* Policy footer refresh */
.policy-footer {
  display: grid !important;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.25fr) minmax(0, .8fr) minmax(160px, auto) !important;
  gap: 18px !important;
  align-items: start !important;
  padding: 20px 26px !important;
  background: #fff !important;
  color: var(--muted) !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
  border-top: 1px solid var(--line) !important;
}

.policy-footer > .footer-block {
  display: grid !important;
  gap: 4px !important;
  min-width: 0 !important;
}

.policy-footer strong {
  display: block !important;
  margin: 0 0 4px !important;
  color: var(--green-dark) !important;
  font-size: 13px !important;
  line-height: 1.25 !important;
}

.policy-footer span,
.policy-footer a {
  color: var(--muted) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.45 !important;
  text-decoration: none !important;
  overflow-wrap: anywhere !important;
}

.policy-footer a:hover {
  color: var(--green) !important;
  text-decoration: underline !important;
}

.policy-footer .footer-powered-by {
  justify-self: end !important;
  display: grid !important;
  justify-items: center !important;
  gap: 7px !important;
  color: var(--red) !important;
  text-align: center !important;
}

.policy-footer .footer-powered-by img {
  width: 260px !important;
  max-width: 100% !important;
  max-height: 104px !important;
  object-fit: contain !important;
}

@media (max-width: 760px) {
  .policy-footer {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    padding: 18px 16px !important;
    text-align: left !important;
  }

  .policy-footer .footer-powered-by {
    justify-self: start !important;
    justify-items: start !important;
  }

  .policy-footer .footer-powered-by img {
    width: 220px !important;
  }
}

.policy-page {
  margin: 0;
  background: #f6faf8;
  color: var(--ink);
}

.policy-document {
  width: min(920px, calc(100% - 32px));
  margin: 28px auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  padding: 28px;
}

.policy-logo {
  width: 190px;
  max-width: 70%;
  height: auto;
  display: block;
  margin: 0 0 18px;
}

.policy-document h1 {
  margin: 0 0 14px;
  color: var(--green-dark);
  font-size: 34px;
  line-height: 1.1;
}

.policy-document h2 {
  margin: 20px 0 8px;
  color: var(--green-dark);
  font-size: 18px;
}

.policy-document p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.policy-document a {
  color: var(--green);
  font-weight: 800;
}

@media (max-width: 760px) {
  .policy-document {
    width: calc(100% - 24px);
    margin: 14px auto;
    padding: 20px;
    border-radius: 16px;
  }

  .policy-document h1 {
    font-size: 28px;
  }

  .policy-document p {
    font-size: 14px;
  }
}

/* Decorated policy section cards */
.policy-document {
  display: grid;
  gap: 18px;
}

.policy-document > p:first-of-type {
  margin: 0 0 6px;
  padding: 16px 18px;
  border-left: 5px solid var(--green);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(7, 122, 72, .10), rgba(215, 38, 56, .06));
  color: var(--ink);
  font-weight: 700;
}

.policy-document section {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(13, 43, 28, .08);
}

.policy-document section:nth-of-type(even) {
  border-left-color: var(--red);
}

.policy-document section h2 {
  margin-top: 0;
}

.policy-document section p {
  margin-bottom: 0;
}

.policy-document > p:last-child {
  margin-top: 8px;
}

@media (max-width: 760px) {
  .policy-document {
    gap: 14px;
  }

  .policy-document > p:first-of-type,
  .policy-document section {
    padding: 15px;
    border-radius: 15px;
  }
}

/* TAS Armed Response style for policy pages only */
.policy-page {
  background: #f4f7fb !important;
  color: #142033 !important;
}

.policy-document {
  width: min(1040px, calc(100% - 36px)) !important;
  margin: 34px auto !important;
  padding: 0 !important;
  display: grid !important;
  gap: 22px !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.policy-logo {
  width: 230px !important;
  max-width: 78% !important;
  margin: 0 !important;
  padding: 14px 16px !important;
  background: #ffffff !important;
  border: 1px solid #dfe4ec !important;
  border-radius: 8px !important;
  box-shadow: 0 14px 34px rgba(6, 26, 59, .10) !important;
}

.policy-document h1 {
  margin: 0 !important;
  padding: 24px 28px !important;
  background: #061a3b !important;
  color: #ffffff !important;
  border-left: 8px solid #d50012 !important;
  border-radius: 8px !important;
  font-size: 38px !important;
  line-height: 1.1 !important;
  box-shadow: 0 16px 36px rgba(6, 26, 59, .16) !important;
}

.policy-document > p:first-of-type {
  margin: 0 !important;
  padding: 18px 22px !important;
  background: #ffffff !important;
  border: 1px solid #dfe4ec !important;
  border-left: 6px solid #d50012 !important;
  border-radius: 8px !important;
  color: #142033 !important;
  font-weight: 700 !important;
  box-shadow: 0 12px 28px rgba(6, 26, 59, .08) !important;
}

.policy-document section {
  margin: 0 !important;
  padding: 22px 24px !important;
  background: #ffffff !important;
  border: 1px solid #dfe4ec !important;
  border-left: 6px solid #061a3b !important;
  border-radius: 8px !important;
  box-shadow: 0 12px 28px rgba(6, 26, 59, .08) !important;
}

.policy-document section:nth-of-type(even) {
  border-left-color: #d50012 !important;
}

.policy-document section h2 {
  margin: 0 0 10px !important;
  color: #061a3b !important;
  font-size: 20px !important;
  line-height: 1.2 !important;
}

.policy-document section p {
  margin: 0 !important;
  color: #5c6676 !important;
  font-size: 15px !important;
  line-height: 1.7 !important;
}

.policy-document > p:last-child {
  margin: 0 !important;
  padding: 16px 20px !important;
  background: #061a3b !important;
  border-radius: 8px !important;
  text-align: center !important;
}

.policy-document > p:last-child a {
  color: #ffffff !important;
  font-weight: 900 !important;
  text-decoration: none !important;
}

@media (max-width: 760px) {
  .policy-document {
    width: calc(100% - 24px) !important;
    margin: 18px auto !important;
    gap: 16px !important;
  }

  .policy-logo {
    width: 190px !important;
    padding: 12px !important;
  }

  .policy-document h1 {
    padding: 20px !important;
    font-size: 30px !important;
  }

  .policy-document > p:first-of-type,
  .policy-document section {
    padding: 16px !important;
  }

  .policy-document section h2 {
    font-size: 18px !important;
  }

  .policy-document section p {
    font-size: 14px !important;
  }
}

/* Small logo-to-policy spacing adjustment */
.policy-logo {
  margin-bottom: 18px !important;
}

@media (max-width: 760px) {
  .policy-logo {
    margin-bottom: 14px !important;
  }
}

/* Smaller policy page title */
.policy-document h1 {
  font-size: 30px !important;
  padding: 20px 24px !important;
}

@media (max-width: 760px) {
  .policy-document h1 {
    font-size: 24px !important;
    padding: 16px 18px !important;
    line-height: 1.15 !important;
  }
}
