/* =======================
   1. THEME VARIABLES
   ======================= */
:root {
  /* Layout & Containers */
  --progress-offset: 0px;
  --app-nav-height: 74px;
  --bg-page:        #f3fbfd;
  --bg-container:   #f7fcfe;
  --bg-modal:       #ffffff;
  --overlay-bg:     rgba(0, 0, 0, 0.5);
  --surface-raised: rgba(255, 255, 255, 0.92);
  --surface-muted:  rgba(237, 249, 252, 0.78);
  --shadow-soft:    0 12px 28px rgba(14, 73, 92, 0.08);
  --shadow-strong:  0 20px 48px rgba(14, 73, 92, 0.16);
  --shadow-card:    0 10px 26px rgba(14, 73, 92, 0.09);

  /* Typography */
  --text-primary:   #10294a;
  --text-heading:   #061b3d;
  --text-muted:     #5b7184;
  --text-inverse:   #FFFFFF;
  --footer-text:    #47677b;

  /* Borders & Inputs */
  --border-color:   #bfddea;
  --input-bg:       #FFFFFF;

  /* Components */
  --item-bg:        #ffffff;
  --item-border:    rgba(0, 133, 176, 0.18);
  --surface:        #FFFFFF;
  --surface-card:   rgba(255, 255, 255, 0.9);
  --surface-subtle: rgba(237, 249, 252, 0.76);

  /* Buttons */
  --btn-bg:         #0098c7;
  --btn-hover-bg:   #007da8;
  --btn-hover-text: #ffffff;
  --btn-error-bg:   #ff2d2d;
  --btn-secondary-bg: #e6f6fb;
  --btn-secondary-text: #FFFFFF;

  /* Status Colors */
  --success:        #18b72f;
  --warning:        #f5a400;
  --error:          #ff2d2d;
  --info:           #008bc0;
  --accent:         #009ec3;

  /* Offline Message */
  --offline-bg:     #ff2d2d; /* Updated: Matches --error */
  --offline-text:   #FFFFFF;

  /* Form Actions */
  --form-actions-bg:    #0098c7; /* Updated: Matches --btn-bg */
  --form-actions-text:  #FFFFFF;

  /* Reporting */
  --reporting-bg:       #0098c7; /* Updated: Matches --btn-bg */
  --reporting-text:     #FFFFFF;
}

/* Dark theme overrides */
html[data-theme="dark"],
.dark-theme {
  --bg-page:        radial-gradient(circle at top left, rgba(0, 174, 239, 0.08), transparent 34rem), linear-gradient(180deg, #05080b 0%, #080d11 48%, #030506 100%);
  --bg-container:   #071015;
  --bg-modal:       #0b1419;
  --overlay-bg:     rgba(0, 3, 6, 0.76);
  --surface-raised: rgba(10, 18, 23, 0.96);
  --surface-muted:  rgba(14, 25, 31, 0.86);
  --shadow-soft:    0 14px 32px rgba(0, 0, 0, 0.46);
  --shadow-strong:  0 24px 58px rgba(0, 0, 0, 0.62);
  --shadow-card:    0 16px 34px rgba(0, 0, 0, 0.48);

  --text-primary:   #f4f8fb;
  --text-heading:   #ffffff;
  --text-muted:     #a9c1cf;
  --text-inverse:   #FFFFFF;
  --footer-text:    #9db9ca;

  --border-color:   #20313a;
  --input-bg:       #060b0f;

  --item-bg:        #091116;
  --item-border:    rgba(73, 104, 119, 0.32);
  --surface:        #091116;
  --surface-card:   rgba(9, 17, 22, 0.94);
  --surface-subtle: rgba(5, 11, 15, 0.84);

  --btn-bg:         #009ee8;
  --btn-hover-bg:   #16bfff;
  --btn-hover-text: #001017;
  --btn-error-bg:   #ff332b;
  --btn-secondary-bg: #111f27;
  --btn-secondary-text: #f4f8fb;

  --success:        #52dc3f;
  --warning:        #ffc400;
  --error:          #ff332b;
  --info:           #16bfff;
  --accent:         #00aeef;

  --offline-bg:     #ff332b;
  --offline-text:   #ffffff;
}

html[data-theme="nightwatch"] body.dark-theme {
  --bg-page:
    radial-gradient(circle at 18% 0%, rgba(119, 129, 139, 0.1), transparent 28rem),
    radial-gradient(circle at 88% 12%, rgba(200, 155, 44, 0.07), transparent 26rem),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.018) 0 1px, transparent 1px 8px),
    linear-gradient(180deg, #090b0e 0%, #0b0e12 46%, #07090c 100%);
  --bg-container:   #0d1116;
  --bg-modal:       #12161b;
  --overlay-bg:     rgba(2, 3, 5, 0.82);
  --surface-raised: rgba(24, 30, 36, 0.96);
  --surface-muted:  rgba(18, 22, 27, 0.88);
  --shadow-soft:    0 14px 34px rgba(0, 0, 0, 0.52);
  --shadow-strong:  0 26px 64px rgba(0, 0, 0, 0.7);
  --shadow-card:    0 18px 40px rgba(0, 0, 0, 0.5);

  --text-primary:   #f2f4f5;
  --text-heading:   #ffffff;
  --text-muted:     #a8b0b8;
  --text-inverse:   #090b0e;
  --footer-text:    #a8b0b8;

  --border-color:   #2a323b;
  --input-bg:       #0e1216;

  --item-bg:        #12161b;
  --item-border:    rgba(119, 129, 139, 0.34);
  --surface:        #12161b;
  --surface-card:   rgba(18, 22, 27, 0.96);
  --surface-subtle: rgba(14, 18, 22, 0.9);

  --btn-bg:         #c89b2c;
  --btn-hover-bg:   #e0b343;
  --btn-hover-text: #090b0e;
  --btn-error-bg:   #c64e48;
  --btn-secondary-bg: #181e24;
  --btn-secondary-text: #f2f4f5;

  --success:        #7fb879;
  --warning:        #e0b343;
  --error:          #d36a63;
  --info:           #95a5b5;
  --accent:         #c89b2c;

  --offline-bg:     #9e3833;
  --offline-text:   #ffffff;
  --form-actions-bg: #c89b2c;
  --form-actions-text: #090b0e;
  --reporting-bg: #c89b2c;
  --reporting-text: #090b0e;
}

/* Header logo slots use the same approved header asset in both themes. */
.light-logo { display: block; }
.dark-logo { display: none; }
body.dark-theme .light-logo { display: none; }
body.dark-theme .dark-logo { display: block; }
html[data-theme="dark"] .light-logo,
html[data-theme="nightwatch"] .light-logo { display: none; }
html[data-theme="dark"] .dark-logo,
html[data-theme="nightwatch"] .dark-logo { display: block; }

/* =======================
   2. RESET & BASE STYLES
   ======================= */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-page);
  min-height: 100vh;
  padding: 0 0 calc(var(--app-nav-height) + 12px);
  line-height: 1.5;
  color: var(--text-primary);
}

body.modal-open {
  overflow: hidden;
}

.dark-theme .runner-summary-item,
.dark-theme .runner-mobile-stat {
  background: rgba(5, 13, 18, 0.92);
  border-color: rgba(73, 104, 119, 0.34);
}

.dark-theme .runner-progressbar::before {
  background: rgba(73, 104, 119, 0.26);
}

.dark-theme .runner-progress-dot {
  background: rgba(73, 104, 119, 0.38);
  border-color: var(--bg-container);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.18);
}

.dark-theme .runner-progress-label {
  color: var(--text-heading);
}

.dark-theme .runner-progress-step.active .runner-progress-dot {
  background: var(--accent);
}

.dark-theme .runner-progress-step.active .runner-progress-label {
  color: var(--text-primary);
}

.dark-theme .runner-progress-step.complete .runner-progress-dot {
  background: var(--success);
}

.dark-theme .runner-progress-step.complete .runner-progress-label {
  color: #d7ffd2;
}

.dark-theme .section-guidance-banner {
  background: rgba(8, 17, 23, 0.94);
  border-color: rgba(73, 104, 119, 0.32);
}

.dark-theme .section-guidance-banner.is-warning {
  background: rgba(255, 196, 0, 0.14);
}

.dark-theme .section-guidance-banner.is-complete {
  background: rgba(82, 220, 63, 0.14);
}

.dark-theme .final-readiness-panel {
  background:
    linear-gradient(180deg, rgba(0,174,239,0.06), rgba(0,0,0,0.12)),
    var(--surface-raised);
}

.dark-theme .final-metric {
  background: rgba(5, 13, 18, 0.86);
  border-color: rgba(73, 104, 119, 0.28);
}

.dark-theme .issue-meta-toggle {
  background: rgba(5, 13, 18, 0.88);
  border-color: rgba(73, 104, 119, 0.3);
}

.dark-theme .runner-nav-button,
.dark-theme .item-status,
.dark-theme .section-jump-state,
.dark-theme legend,
.dark-theme .runner-summary-label,
.dark-theme .runner-mobile-stat-label,
.dark-theme .section-jump-stat-label,
.dark-theme .runner-kicker {
  color: var(--text-heading);
}

.dark-theme .runner-sticky-footer {
  background: rgba(2, 6, 9, 0.96);
  border-color: rgba(73, 104, 119, 0.28);
}

.dark-theme .runner-mobile-header {
  background:
    linear-gradient(180deg, rgba(0,174,239,0.08), rgba(0,0,0,0.12)),
    var(--surface-raised);
  border-color: rgba(73, 104, 119, 0.32);
}

.dark-theme .loaded-checksheet-banner {
  background:
    linear-gradient(90deg, rgba(0, 36, 51, 0.92), rgba(5, 13, 18, 0.96)),
    var(--surface-raised);
  border-color: rgba(0, 174, 239, 0.28);
}

.dark-theme .loaded-checksheet-banner__title {
  color: #ffffff;
}

.dark-theme .runner-dashboard__hero,
.dark-theme .runner-dashboard__sections,
.dark-theme .in-progress-workspace {
  background:
    linear-gradient(180deg, rgba(0,174,239,0.065), rgba(0,0,0,0.12)),
    var(--surface-raised);
  border-color: rgba(0, 174, 239, 0.24);
}

.dark-theme .runner-section-readiness,
.dark-theme .in-progress-card {
  background: rgba(5, 13, 18, 0.84);
  border-color: rgba(73, 104, 119, 0.28);
}

.dark-theme .runner-section-readiness:hover,
.dark-theme .runner-section-readiness:focus-visible,
.dark-theme .runner-section-readiness.is-active {
  background: rgba(0, 79, 112, 0.34);
  border-color: rgba(0, 174, 239, 0.52);
}

.dark-theme .runner-section-readiness.not-started,
.dark-theme .section-jump-card.not-started {
  background: rgba(8, 17, 23, 0.8);
  border-color: rgba(73, 104, 119, 0.34);
}

.dark-theme .runner-section-readiness.progress,
.dark-theme .section-jump-card.progress {
  background: rgba(255, 196, 0, 0.12);
  border-color: rgba(255, 196, 0, 0.48);
}

.dark-theme .runner-section-readiness.complete,
.dark-theme .section-jump-card.is-complete {
  background: rgba(82, 220, 63, 0.12);
  border-color: rgba(82, 220, 63, 0.5);
}

.dark-theme .runner-section-readiness.issue,
.dark-theme .section-jump-card.has-issue {
  background: rgba(255, 51, 43, 0.12);
  border-color: rgba(255, 51, 43, 0.5);
}

.dark-theme .checklist-item {
  border-color: rgba(0, 174, 239, 0.22);
}

.dark-theme .answer-chip {
  background: rgba(5, 13, 18, 0.88);
  border-color: rgba(73, 104, 119, 0.3);
}

.dark-theme .comments-container {
  background: rgba(0, 174, 239, 0.08);
  border-color: rgba(0, 174, 239, 0.28);
}

.dark-theme fieldset {
  background: rgba(8, 17, 23, 0.9);
  border-color: rgba(73, 104, 119, 0.28);
}

.dark-theme #stage-setup-panel .input-group {
  background: rgba(5, 13, 18, 0.9);
  border-color: rgba(73, 104, 119, 0.28);
}

.dark-theme form > fieldset:nth-of-type(1) button,
.dark-theme form > fieldset:nth-of-type(3) button {
  background: #111f27;
  color: var(--text-primary);
}

.dark-theme .runner-panel,
.dark-theme .control-accordion,
.dark-theme .control-subpanel,
.dark-theme .report-more-actions,
.dark-theme #report-list,
.dark-theme #archive-list,
.dark-theme .report-status-card,
.dark-theme .report-cockpit-card,
.dark-theme .report-card-metric,
.dark-theme .report-queue-card,
.dark-theme .review-card,
.dark-theme .issue-command-panel,
.dark-theme .issue-review-card,
.dark-theme .final-summary-panel,
.dark-theme .final-decision-panel,
.dark-theme .final-details-card,
.dark-theme .ra-section-card,
.dark-theme .ra-hazard-card,
.dark-theme .ra-review-metric,
.dark-theme .report-detail-stat,
.dark-theme .report-detail-section-card,
.dark-theme .report-detail-issue-card,
.dark-theme .report-detail-block,
.dark-theme .ra-detail-field,
.dark-theme .ra-detail-signature,
.dark-theme .ra-detail-action-card,
.dark-theme .ra-detail-hazard-card,
.dark-theme .report-detail-attachment-group,
.dark-theme .ra-action-closeout-panel,
.dark-theme .report-closeout-panel,
.dark-theme .backup-import-option,
.dark-theme .backup-import-checkbox,
.dark-theme .backup-import-summary-grid div {
  background:
    linear-gradient(180deg, rgba(0,174,239,0.055), rgba(255,255,255,0.012)),
    var(--surface-card);
  border-color: rgba(73, 104, 119, 0.32);
}

.dark-theme .modal-content,
.dark-theme .runner-drawer-panel,
.dark-theme #tutorial-modal .modal-content {
  background:
    linear-gradient(180deg, rgba(0,174,239,0.055), rgba(0,0,0,0.12)),
    var(--bg-modal);
  border: 1px solid rgba(73, 104, 119, 0.36);
}

.dark-theme .input,
.dark-theme .select,
.dark-theme textarea,
.dark-theme .comments-input,
.dark-theme .issue-meta-input,
.dark-theme .issue-review-input,
.dark-theme .ra-textarea,
.dark-theme .ra-action-closeout-grid input,
.dark-theme .ra-action-closeout-grid select,
.dark-theme .ra-action-closeout-grid textarea,
.dark-theme .report-closeout-grid input,
.dark-theme .report-closeout-grid select,
.dark-theme .report-closeout-grid textarea {
  background-color: #050a0e;
  border-color: rgba(73, 104, 119, 0.5);
  color: #f4f8fb;
}

.dark-theme .input::placeholder,
.dark-theme .select::placeholder,
.dark-theme textarea::placeholder {
  color: rgba(169, 193, 207, 0.68);
}

.dark-theme .input:disabled,
.dark-theme .select:disabled,
.dark-theme textarea:disabled,
.dark-theme .comments-input:disabled,
.dark-theme .input[readonly],
.dark-theme .ra-field--controlled .input[readonly] {
  background: rgba(8, 17, 23, 0.78);
  border-color: rgba(73, 104, 119, 0.34);
  color: rgba(244, 248, 251, 0.82);
}

.dark-theme .report-queue-badge.clear,
.dark-theme .issue-status-badge.clear,
.dark-theme .issue-status-badge.logged,
.dark-theme .ra-status-pill,
.dark-theme .final-readiness-badge.ready {
  background: rgba(82, 220, 63, 0.16);
  color: #b5ffad;
  border-color: rgba(82, 220, 63, 0.58);
}

.dark-theme .report-queue-badge.has-issues,
.dark-theme .issue-status-badge.blocked,
.dark-theme .final-readiness-badge.blocked,
.dark-theme .ra-completion-validation.is-blocked {
  background: rgba(255, 51, 43, 0.16);
  color: #ffb4af;
  border-color: rgba(255, 51, 43, 0.58);
}

.dark-theme .issue-status-badge.action,
.dark-theme .comment-required,
.dark-theme .ra-status-pill.is-review,
.dark-theme .ra-completion-validation.is-ready {
  background: rgba(255, 196, 0, 0.16);
  color: #ffe28a;
  border-color: rgba(255, 196, 0, 0.56);
}

.dark-theme .data-management-warning,
.dark-theme .backup-import-result,
.dark-theme .builder-validation-summary {
  color: #ffe7a8;
}

/* =======================
   3. CONTAINER & TOGGLE
   ======================= */
.container {
  position: relative;
  width: 100%;
  max-width: none;
  min-height: calc(100vh - var(--progress-offset));
  margin: 0;
  padding: 0.75rem;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.app-nav {
  position: fixed;
  left: 0.7rem;
  right: 0.7rem;
  bottom: calc(0.55rem + env(safe-area-inset-bottom, 0px));
  z-index: 950;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.42rem;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(237,249,252,0.9)),
    rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(0, 158, 195, 0.22);
  border-radius: 18px;
  box-shadow: 0 16px 42px rgba(14, 73, 92, 0.12);
  backdrop-filter: blur(16px);
}

.app-nav__item {
  min-width: 0;
  min-height: 56px;
  display: flex;
  margin: 0;
  text-decoration: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  padding: 0.35rem 0.2rem;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--text-heading);
  cursor: pointer;
  font: inherit;
  line-height: 1.05;
}

.app-nav__item:hover,
.app-nav__item:focus-visible {
  outline: none;
  color: #007da8;
  border-color: rgba(0, 158, 195, 0.28);
  background: rgba(0, 158, 195, 0.08);
}

.app-nav__item.is-active {
  color: #008bb7;
  background:
    linear-gradient(90deg, rgba(0, 174, 239, 0.24), rgba(0, 174, 239, 0.08)),
    rgba(232, 249, 253, 0.94);
  border-color: rgba(0, 158, 195, 0.32);
  box-shadow: inset 4px 0 0 var(--accent), inset 0 0 0 1px rgba(255,255,255,0.7);
}

.app-nav__icon {
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  border-radius: 0;
  background: transparent;
  color: inherit;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.app-nav__icon svg {
  width: 1.08rem;
  height: 1.08rem;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-nav__item:hover .app-nav__icon,
.app-nav__item:focus-visible .app-nav__icon {
  background: transparent;
  color: #008bb7;
  transform: translateY(-1px);
  box-shadow: none;
}

.app-nav__item.is-active .app-nav__icon {
  background: transparent;
  color: #009ec3;
  box-shadow: none;
}

.dark-theme .app-nav {
  background:
    linear-gradient(180deg, rgba(0,174,239,0.035), rgba(0,0,0,0.16)),
    rgba(2, 7, 10, 0.96);
  border-color: rgba(73, 104, 119, 0.36);
  box-shadow: 18px 0 42px rgba(0, 0, 0, 0.46);
}

.dark-theme .app-nav::before {
  color: #ffffff;
}

.dark-theme .app-nav__item {
  color: rgba(244, 248, 251, 0.82);
}

.dark-theme .app-nav__item:hover,
.dark-theme .app-nav__item:focus-visible {
  color: #ffffff;
  border-color: rgba(0, 174, 239, 0.42);
  background: rgba(0, 174, 239, 0.1);
}

.dark-theme .app-nav__item.is-active {
  color: #ffffff;
  background:
    linear-gradient(90deg, rgba(0,174,239,0.28), rgba(0,174,239,0.09)),
    rgba(7, 19, 25, 0.94);
  border-color: rgba(0, 174, 239, 0.48);
  box-shadow: inset 4px 0 0 var(--accent), inset 0 0 0 1px rgba(255,255,255,0.04);
}

.dark-theme .app-nav__icon {
  background: transparent;
}

.dark-theme .app-nav__item:hover .app-nav__icon,
.dark-theme .app-nav__item:focus-visible .app-nav__icon {
  background: transparent;
  box-shadow: none;
}

.dark-theme .app-nav__item.is-active .app-nav__icon {
  background: transparent;
  box-shadow: none;
}

.app-nav__label {
  font-size: 0.50rem;
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
}

body[data-app-view="dashboard"] #stage-section-panel,
body[data-app-view="dashboard"] #stage-issues-panel,
body[data-app-view="dashboard"] #stage-final-panel,
body[data-app-view="dashboard"] #reports-panel,
body[data-app-view="dashboard"] #history-panel {
  display: none !important;
}

body[data-app-view="questions"] .runner-dashboard,
body[data-app-view="questions"] #stage-setup-panel,
body[data-app-view="questions"] #stage-issues-panel,
body[data-app-view="questions"] .control-hub {
  display: none !important;
}

body[data-app-view="issues"] .runner-dashboard,
body[data-app-view="issues"] #stage-setup-panel,
body[data-app-view="issues"] #stage-section-panel,
body[data-app-view="issues"] #stage-final-panel,
body[data-app-view="issues"] .control-hub {
  display: none !important;
}

body[data-app-view="reports"] .runner-shell,
body[data-app-view="reports"] #inspection-tools-panel,
body[data-app-view="reports"] #history-panel {
  display: none !important;
}

body[data-app-view="history"] .runner-shell,
body[data-app-view="history"] #inspection-tools-panel,
body[data-app-view="history"] #reports-panel {
  display: none !important;
}

@media (min-width: 960px) {
  :root {
    --app-nav-height: 0px;
  }

  body {
    padding: 0 0 0 192px;
    overflow-x: hidden;
  }

  .container {
    min-height: calc(100vh - var(--progress-offset));
    padding: 0 1.25rem 1.5rem;
    overflow: visible;
  }

  .app-nav {
    top: var(--progress-offset);
    right: auto;
    bottom: 0;
    left: 0;
    width: 192px;
    display: flex;
    flex-direction: column;
    gap: 0.34rem;
    padding: 0.82rem 0.62rem;
    border-radius: 0;
    border-width: 0 1px 0 0;
    background:
      linear-gradient(180deg, rgba(255,255,255,0.98), rgba(237,249,252,0.92)),
      #ffffff;
    box-shadow: 16px 0 38px rgba(14, 73, 92, 0.1);
  }

  .app-nav::before {
    content: "CHECK LIB";
    display: block;
    padding: 0.38rem 0.48rem 0.7rem;
    color: var(--text-heading);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
  }

  .app-nav__item {
    min-height: 44px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.52rem;
    padding: 0.48rem 0.55rem;
    border-radius: 10px;
  }

  .app-nav__label {
    font-size: 0.86rem;
  }

  .app-nav__icon {
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 0;
    flex: 0 0 auto;
  }

  .app-nav__icon svg {
    width: 0.92rem;
    height: 0.92rem;
  }

  .app-nav__theme-toggle {
    margin-top: auto !important;
    min-height: 40px;
    padding: 0.48rem 0.55rem;
    justify-content: center;
    border-radius: 10px;
    font-size: 0.84rem;
  }

}

@media (min-width: 1025px) {
  #checklist-form {
    width: min(100%, 1480px);
    margin: 0 auto;
  }

  .runner-dashboard {
    grid-template-columns: minmax(320px, 0.72fr) minmax(0, 1.28fr);
  }

  .runner-dashboard__sections {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    max-height: 260px;
    overflow-y: auto;
  }

  .report-detail-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1600px) {
  #checklist-form {
    width: min(100%, 1680px);
  }

  .runner-dashboard {
    grid-template-columns: minmax(360px, 0.65fr) minmax(0, 1.35fr);
  }

  .runner-dashboard__sections {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

.theme-selector {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  width: auto !important;
  min-width: 0 !important;
  box-sizing: border-box;
  position: static;
  padding: 0.18rem;
  background: rgba(230, 246, 251, 0.92);
  color: var(--text-heading);
  border: 1px solid rgba(0, 158, 195, 0.24);
  border-radius: 999px;
  line-height: 1;
}

.theme-selector__option {
  min-width: 0;
  min-height: 30px;
  margin: 0;
  padding: 0.36rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-heading);
  box-shadow: none;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  text-transform: none;
  white-space: nowrap;
}

.theme-selector__option.is-active,
.theme-selector__option[aria-checked="true"] {
  background: var(--btn-bg);
  color: var(--btn-hover-text);
  border-color: rgba(0, 0, 0, 0.08);
}

.theme-selector__option:focus-visible {
  outline: 3px solid rgba(0, 158, 195, 0.24);
  outline-offset: 2px;
}

.dark-theme .theme-selector {
  background: rgba(7, 19, 25, 0.78);
  border-color: rgba(73, 104, 119, 0.32);
}

html[data-theme="nightwatch"] .theme-selector {
  background: rgba(14, 18, 22, 0.92);
  border-color: rgba(119, 129, 139, 0.36);
}

html[data-theme="nightwatch"] .theme-selector__option {
  color: #d8dde1;
}

html[data-theme="nightwatch"] .theme-selector__option.is-active,
html[data-theme="nightwatch"] .theme-selector__option[aria-checked="true"] {
  background: #c89b2c;
  color: #090b0e;
  border-color: rgba(224, 179, 67, 0.54);
}

html[data-theme="nightwatch"] .theme-selector__option:focus-visible {
  outline-color: rgba(224, 179, 67, 0.5);
}

html[data-theme="nightwatch"] .theme-cycle-button {
  background: rgba(14, 18, 22, 0.92);
  border-color: rgba(119, 129, 139, 0.42);
  color: #f2f4f5;
}

html[data-theme="nightwatch"] .theme-cycle-button:hover,
html[data-theme="nightwatch"] .theme-cycle-button:focus-visible {
  background: rgba(200, 155, 44, 0.16);
  border-color: rgba(224, 179, 67, 0.5);
  color: #ffffff;
}

.theme-toggle {
  display: inline-flex;
  width: auto !important;
  min-width: unset !important;
  box-sizing: border-box;
  position: static;
  padding: 0.55rem 0.8rem;
  background: rgba(230, 246, 251, 0.92);
  color: var(--text-heading);
  border: 1px solid rgba(0, 158, 195, 0.24);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}

.header-theme-toggle {
  display: inline-flex !important;
  position: fixed;
  top: 0.9rem;
  right: 0.75rem;
  z-index: 1100;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin: 0 !important;
  padding: 0.36rem 0.64rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: none;
}

@media (min-width: 601px) {
  .header-theme-toggle {
    display: none !important;
  }
}

@media (max-width: 600px) {
  .theme-cycle-button.header-theme-toggle {
    max-width: 8.8rem;
    min-width: 0 !important;
    min-height: 32px;
    padding: 0.34rem 0.55rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.app-nav__theme-toggle {
  min-width: 0 !important;
  min-height: 56px;
  width: 100% !important;
  margin: 0 !important;
  padding: 0.35rem 0.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(230, 246, 251, 0.92);
  border: 1px solid rgba(0, 158, 195, 0.24);
  color: var(--text-heading);
  box-shadow: none;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.05;
}

.app-nav__theme-toggle.theme-selector {
  justify-content: center;
  gap: 0.14rem;
  padding: 0.22rem;
}

.app-nav__theme-toggle:hover,
.app-nav__theme-toggle:focus-visible {
  outline: none;
  background: rgba(0, 158, 195, 0.1);
  border-color: rgba(0, 158, 195, 0.42);
  color: #008bb7;
  transform: translateY(-1px);
}

.dark-theme .app-nav__theme-toggle {
  color: rgba(244, 248, 251, 0.82);
  background: rgba(7, 19, 25, 0.78);
  border-color: rgba(73, 104, 119, 0.32);
}

.dark-theme .app-nav__theme-toggle:hover,
.dark-theme .app-nav__theme-toggle:focus-visible {
  background: rgba(0, 174, 239, 0.1);
  border-color: rgba(0, 174, 239, 0.42);
  color: #ffffff;
}

@media (min-width: 960px) {
  .app-nav__theme-toggle {
    margin-top: auto !important;
    min-height: 44px;
    width: 100% !important;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.52rem;
    padding: 0.48rem 0.55rem;
    border-radius: 10px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-heading);
    box-shadow: none;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.05;
  }

  .app-nav__theme-toggle::before {
    content: "";
    width: 1.45rem;
    height: 1.45rem;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font-size: 0.86rem;
    line-height: 1;
  }

  .app-nav__theme-toggle:hover,
  .app-nav__theme-toggle:focus-visible {
    outline: none;
    background: rgba(0, 158, 195, 0.1);
    border-color: rgba(0, 158, 195, 0.32);
    color: #008bb7;
    transform: translateY(-1px);
  }

  .app-nav__theme-toggle:hover::before,
  .app-nav__theme-toggle:focus-visible::before {
    background: transparent;
    box-shadow: none;
  }

  .dark-theme .app-nav__theme-toggle::before {
    background: transparent;
  }

  .dark-theme .app-nav__theme-toggle:hover::before,
  .dark-theme .app-nav__theme-toggle:focus-visible::before {
    background: transparent;
    box-shadow: none;
  }
}

/* =======================
   4. HEADER
   ======================= */
.header-container,
.app-header {
  display: flex;
  width: 100%;
}

.header-container {
  flex-direction: column;
  gap: 0;
  margin: -0.75rem -0.75rem 0.75rem;
  width: calc(100% + 1.5rem);
}

@media (min-width: 960px) {
  .header-container {
    margin: 0 -1.25rem 0.9rem;
    width: calc(100% + 2.5rem);
  }
}

@media (max-width: 600px) {
  .header-container {
    margin: -0.5rem -0.5rem 0.65rem;
    width: calc(100% + 1rem);
  }
}

.header-container {
  margin-bottom: 0.75rem;
}

.app-header {
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.72rem clamp(0.75rem, 1.8vw, 1.25rem);
  background:
    linear-gradient(90deg, rgba(255,255,255,0.98), rgba(237,249,252,0.92)),
    #ffffff;
  border: 0;
  border-bottom: 1px solid rgba(0, 158, 195, 0.2);
  border-radius: 0;
  box-shadow: 0 14px 34px rgba(14, 73, 92, 0.08);
}

.dark-theme .app-header {
  background:
    linear-gradient(90deg, rgba(0,174,239,0.055), rgba(0,0,0,0.12)),
    #03070a;
  border-bottom-color: rgba(73, 104, 119, 0.36);
  box-shadow: 0 16px 38px rgba(0,0,0,0.46);
}

.app-header__brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.header-logo {
  width: 55px;
  height: 55px;
  flex: 0 0 auto;
  border-radius: 15px;
  margin: 0;
  object-fit: cover;
  transition: filter 0.3s ease;
}

.header-title .main-title {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.75rem);
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: 0.06em;
  line-height: 1.05;
}

.dark-theme .header-title .main-title {
  color: #ffffff;
}

.header-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  min-width: 0;
}

.header-subtitle {
  margin-top: 0.2rem;
  color: #008bb7;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dark-theme .header-subtitle {
  color: rgba(0, 174, 239, 0.86);
}

.loaded-checksheet-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.62rem clamp(0.75rem, 1.8vw, 1.25rem);
  background:
    linear-gradient(90deg, rgba(255,255,255,0.92), rgba(237, 249, 252, 0.82)),
    var(--surface-raised);
  border: 0;
  border-bottom: 1px solid rgba(33, 132, 155, 0.18);
  border-radius: 0;
  box-shadow: 0 12px 26px rgba(14, 73, 92, 0.08);
}

.loaded-checksheet-banner__label {
  flex: 0 0 auto;
  color: var(--text-heading);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.loaded-checksheet-banner__title {
  min-width: 0;
  color: var(--text-primary);
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  font-weight: 600;
  line-height: 1.15;
  text-align: right;
}

.loaded-checksheet-banner__main {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.loaded-checksheet-banner__intro {
  flex: 0 0 auto;
  min-height: 40px;
  border: 1px solid rgba(49, 132, 155, 0.32);
  border-radius: 999px;
  background: rgba(49, 132, 155, 0.1);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.38rem 0.7rem;
  white-space: nowrap;
  box-shadow: none;
}

.loaded-checksheet-banner__intro:hover,
.loaded-checksheet-banner__intro:focus-visible {
  background: rgba(49, 132, 155, 0.16);
  color: var(--accent);
  outline: 2px solid rgba(49, 132, 155, 0.24);
  outline-offset: 2px;
}

#form-heading {
  color: var(--text-heading);
  font-size: 1.2rem;
  margin: 0 0 0.9rem;
  text-align: center;
}

#form-heading2 {
  color: #f80505; /* Updated: Matches headings */
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

/* =======================
   5. FORMS & INPUTS
   ======================= */
.input-group {
  margin-bottom: 1rem;
}

#stage-setup-panel {
  display: grid;
  gap: 0.58rem;
}

#stage-setup-panel .input-group {
  margin-bottom: 0;
  min-width: 0;
  padding: 0.78rem 0.82rem;
  border: 1px solid rgba(33, 132, 155, 0.14);
  border-radius: 14px;
  background: var(--surface-card);
}

#stage-setup-panel .input-group-checklist-select {
  grid-column: 1 / -1;
}

.selected-checklist-preview {
  margin-top: 0.45rem;
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--text-primary);
  word-break: break-word;
}

#stage-setup-panel .input-group label {
  margin-bottom: 0.34rem;
  font-size: 0.84rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

label {
  display: block;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 0.35rem;
}

.input,
.select,
textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 0.62rem 0.72rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background-color: var(--input-bg);
  font-size: 0.95rem;
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus,
.select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 158, 195, 0.16);
}

input[type="date"] {
  color-scheme: light;
  cursor: pointer;
}

input[type="date"].input {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  display: none;
  opacity: 0;
}

.dark-theme input[type="date"] {
  color-scheme: dark;
}

.runner-shell {
  border: 0;
  border-radius: 0;
  padding: 0;
  margin-bottom: 0.75rem;
  background: transparent;
  box-shadow: none;
}

.runner-stagebar {
  margin-bottom: 0.62rem;
}

.runner-progressbar {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  align-items: start;
}

.runner-progressbar::before {
  content: '';
  position: absolute;
  top: 11px;
  left: 12%;
  right: 12%;
  height: 2px;
  background: var(--item-border);
  z-index: 0;
}

.runner-progress-step {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
}

.runner-progress-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: rgba(76, 85, 96, 0.22);
  border: 2px solid var(--bg-container);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.22);
}

.runner-progress-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-heading);
  line-height: 1.2;
}

.runner-progress-step.active .runner-progress-dot {
  background: var(--btn-bg);
}

.runner-progress-step.active .runner-progress-label {
  color: var(--text-primary);
}

.runner-progress-step.complete .runner-progress-dot {
  background: var(--success);
}

.runner-progress-step.complete .runner-progress-label {
  color: var(--success);
}

.runner-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 0.62rem;
  margin-bottom: 0.62rem;
}

.runner-dashboard__hero,
.runner-dashboard__sections {
  border: 1px solid rgba(33, 132, 155, 0.16);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.72), rgba(239, 248, 249, 0.54)),
    var(--surface-card);
  box-shadow: var(--shadow-card);
}

.runner-dashboard__hero {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.72rem;
}

.runner-readiness-ring {
  width: 78px;
  height: 78px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--bg-container) 0 54%, transparent 55%),
    conic-gradient(var(--success) var(--runner-readiness, 0%), rgba(76, 85, 96, 0.18) 0);
  border: 1px solid rgba(33, 132, 155, 0.18);
}

.runner-readiness-ring span {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 700;
}

.runner-dashboard__copy {
  min-width: 0;
}

.runner-dashboard__copy strong {
  display: block;
  margin-top: 0.18rem;
  color: var(--text-primary);
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  line-height: 1.12;
}

.runner-dashboard__copy p {
  margin-top: 0.28rem;
  color: var(--text-heading);
  font-size: 0.86rem;
}

.runner-dashboard__sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.5rem;
  padding: 0.5rem;
  max-height: 260px; /* scroll panel for desktop */
  overflow-y: auto;
}

.in-progress-workspace {
  grid-column: 1 / -1;
  border: 1px solid rgba(33, 132, 155, 0.16);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.72), rgba(239, 248, 249, 0.54)),
    var(--surface-card);
  box-shadow: var(--shadow-card);
  padding: 0.72rem;
}

.in-progress-workspace__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  cursor: pointer;
  list-style: none;
}

.in-progress-workspace__header::-webkit-details-marker {
  display: none;
}

.in-progress-workspace[open] .in-progress-workspace__header {
  margin-bottom: 0.7rem;
}

.in-progress-workspace__header h3 {
  margin: 0.15rem 0 0;
  color: var(--text-primary);
  font-size: 1rem;
}

.in-progress-workspace__header h3 span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  min-height: 1.6rem;
  margin-left: 0.35rem;
  border-radius: 999px;
  background: rgba(33, 132, 155, 0.12);
  color: var(--accent-dark);
  font-size: 0.82rem;
}

.in-progress-workspace__toggle {
  flex: 0 0 auto;
  border: 1px solid rgba(33, 132, 155, 0.2);
  border-radius: 999px;
  color: var(--accent-dark);
  padding: 0.22rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.in-progress-division-filter {
  max-width: 13rem;
  margin-left: auto;
}

.in-progress-workspace[open] .in-progress-workspace__toggle {
  font-size: 0;
}

.in-progress-workspace[open] .in-progress-workspace__toggle::after {
  content: "Hide";
  font-size: 0.8rem;
}

.in-progress-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.65rem;
}

.in-progress-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-width: 0;
  border: 1px solid var(--item-border);
  border-radius: 8px;
  background: rgba(255,255,255,0.66);
  padding: 0.75rem;
}

.in-progress-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
}

.in-progress-card__title {
  display: block;
  margin-top: 0.15rem;
  color: var(--text-primary);
  font-size: 0.98rem;
}

.in-progress-card__type {
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(33, 132, 155, 0.1);
  color: var(--accent-dark);
  padding: 0.18rem 0.5rem;
  font-size: 0.74rem;
  font-weight: 700;
}

.in-progress-card__meta {
  display: grid;
  gap: 0.3rem;
  color: var(--text-heading);
  font-size: 0.85rem;
}

.in-progress-card__meta span {
  display: block;
}

.in-progress-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.in-progress-card__actions button {
  flex: 1 1 8rem;
}

.in-progress-empty {
  margin: 0;
  color: var(--text-heading);
}

.in-progress-list:not(:empty) + .in-progress-empty {
  display: none;
}

.runner-section-readiness {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.46rem 0.5rem;
  border: 1px solid var(--item-border);
  border-radius: 11px;
  background: rgba(255,255,255,0.66);
  color: var(--text-primary);
  text-align: left;
  box-shadow: none;
  cursor: pointer;
}

.runner-section-readiness:hover,
.runner-section-readiness:focus-visible,
.runner-section-readiness.is-active {
  outline: none;
  border-color: rgba(49, 132, 155, 0.42);
  background: rgba(231, 248, 250, 0.86);
}

.runner-section-readiness.not-started {
  background: rgba(76, 85, 96, 0.08);
  border-color: rgba(76, 85, 96, 0.24);
}

.runner-section-readiness.progress {
  background: rgba(255, 193, 7, 0.12);
  border-color: rgba(192, 139, 47, 0.34);
}

.runner-section-readiness.complete {
  background: rgba(40, 167, 69, 0.12);
  border-color: rgba(47, 125, 75, 0.34);
}

.runner-section-readiness.issue {
  background: rgba(185, 48, 48, 0.1);
  border-color: rgba(185, 48, 48, 0.36);
}

.runner-section-readiness__ring {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--bg-container) 0 54%, transparent 55%),
    conic-gradient(var(--success) var(--section-readiness, 0%), rgba(76, 85, 96, 0.18) 0);
  font-size: 0.72rem;
  font-weight: 700;
}

.runner-section-readiness.issue .runner-section-readiness__ring {
  background:
    radial-gradient(circle at center, var(--bg-container) 0 54%, transparent 55%),
    conic-gradient(var(--error) var(--section-readiness, 0%), rgba(76, 85, 96, 0.18) 0);
}

.runner-section-readiness.progress .runner-section-readiness__ring {
  background:
    radial-gradient(circle at center, var(--bg-container) 0 54%, transparent 55%),
    conic-gradient(var(--warning) var(--section-readiness, 0%), rgba(76, 85, 96, 0.18) 0);
}

.runner-section-readiness.not-started .runner-section-readiness__ring {
  background:
    radial-gradient(circle at center, var(--bg-container) 0 54%, transparent 55%),
    conic-gradient(rgba(76, 85, 96, 0.48) var(--section-readiness, 0%), rgba(76, 85, 96, 0.18) 0);
}

.runner-section-readiness__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.14rem;
}

.runner-section-readiness__title {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.runner-section-readiness__meta {
  color: var(--text-heading);
  font-size: 0.72rem;
  font-weight: 600;
}

.runner-section-readiness.is-empty {
  grid-column: 1 / -1;
  justify-content: center;
  cursor: default;
}

.runner-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  margin-bottom: 0.28rem;
}

.runner-summary-item {
  background: var(--surface-card);
  border: 1px solid var(--item-border);
  border-radius: 12px;
  padding: 0.52rem 0.58rem;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
}

.runner-summary-item strong,
.runner-mobile-stat strong {
  color: var(--text-primary);
}

.runner-summary-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-heading);
  font-weight: 600;
}

.runner-autosave-status {
  margin: 0 0 0.55rem;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  color: var(--text-heading);
  text-align: right;
}

.runner-panel.hidden {
  display: none;
}

.runner-scroll-anchor {
  display: block;
  height: 1px;
  margin: 0;
  padding: 0;
  scroll-margin-top: calc(var(--progress-offset) + 12px);
}

.runner-mobile-header {
  position: sticky;
  top: calc(var(--progress-offset) + 6px);
  z-index: 20;
  margin: -0.15rem -0.15rem 0.85rem;
  padding: 0.72rem 0.76rem;
  border: 1px solid rgba(76, 85, 96, 0.14);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.28), rgba(255,255,255,0.08)),
    var(--surface-raised);
  box-shadow: 0 10px 24px rgba(17, 20, 24, 0.14);
}

.runner-mobile-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.runner-mobile-header-actions {
  display: flex;
  align-items: center;
  gap: 0.42rem;
}

.runner-nav-button {
  margin: 0;
  min-height: 40px;
  padding: 0.42rem 0.66rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  border: 1px solid rgba(76, 85, 96, 0.18);
  box-shadow: none;
}

.runner-mobile-checklist {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.runner-question-site-label {
  display: inline-flex;
  align-self: flex-start;
  margin: 0.35rem 0 0;
  padding: 0.28rem 0.55rem;
  border: 1px solid rgba(33, 132, 155, 0.22);
  border-radius: 999px;
  background: rgba(33, 132, 155, 0.08);
  color: var(--text-heading);
  font-size: 0.78rem;
  font-weight: 600;
}

.runner-mobile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.42rem;
  margin-top: 0.62rem;
}

.runner-mobile-stat {
  padding: 0.58rem 0.62rem;
  border: 1px solid var(--item-border);
  border-radius: 12px;
  background: var(--surface-card);
}

.runner-mobile-stat-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-heading);
  font-weight: 600;
}

.runner-issue-badge {
  min-width: 82px;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #a92d2d, #c34343);
  color: var(--text-inverse);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}

.runner-issue-badge.is-clear {
  background: var(--success);
}

.runner-section-header,
.runner-review-header {
  margin-bottom: 1rem;
}

.runner-kicker {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-heading);
  font-weight: 600;
}

.runner-section-meta {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.section-guidance-banner {
  margin-top: 0.65rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid rgba(76, 85, 96, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
}

.section-guidance-banner.is-warning {
  border-color: rgba(192, 139, 47, 0.52);
  background: rgba(192, 139, 47, 0.15);
}

.section-guidance-banner.is-complete {
  border-color: rgba(47, 125, 75, 0.45);
  background: rgba(47, 125, 75, 0.12);
}

.section-guidance-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.section-guidance-actions {
  margin-top: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.section-guidance-actions .runner-nav-button {
  padding: 0.38rem 0.66rem;
  font-size: 0.79rem;
}

.runner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.95rem;
}

.runner-actions button {
  margin: 0;
  flex: 1 1 160px;
}

.runner-actions #section-next,
.runner-actions #issues-next,
.runner-actions #final-proceed-signature {
  background: linear-gradient(135deg, #3f6f5b, #2f7d4b);
  border-color: rgba(47, 125, 75, 0.35);
}

.runner-actions #section-prev,
.runner-actions #issues-back,
.runner-actions #final-back,
.runner-actions #section-review,
.runner-actions #final-save-draft {
  background: linear-gradient(135deg, #5f6975, #74808d);
}

.runner-sticky-footer {
  position: sticky;
  bottom: calc(var(--app-nav-height) + 0.9rem);
  z-index: 25;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  margin-top: 0.78rem;
  padding: 0.5rem;
  border: 1px solid rgba(76, 85, 96, 0.18);
  border-radius: 16px;
  background: rgba(231, 240, 245, 0.94);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
}

.runner-sticky-footer button {
  margin: 0;
  min-width: 0;
  padding: 0.62rem 0.45rem;
  font-size: 0.84rem;
  border-radius: 10px;
  box-shadow: none;
}

.runner-sticky-footer #section-next-sticky {
  background: linear-gradient(135deg, #3f6f5b, #2f7d4b);
}

.runner-sticky-footer #section-prev-sticky,
.runner-sticky-footer #section-review-sticky {
  background: linear-gradient(135deg, #5f6975, #74808d);
}

.runner-sticky-footer #section-save-sticky {
  background: var(--warning);
  color: var(--text-primary);
}

.runner-sticky-footer #section-save-sticky:hover {
  background: #D4A017;
  color: var(--text-inverse);
}

.runner-drawer.hidden {
  display: none;
}

.runner-drawer {
  position: fixed;
  inset: 0;
  z-index: 950;
}

.runner-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
}

.runner-drawer-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(100%, 420px);
  max-height: 82vh;
  padding: 1rem 1rem 1.15rem;
  border-radius: 20px 20px 0 0;
  background: var(--bg-modal);
  box-shadow: 0 -14px 28px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.runner-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.runner-drawer-dismiss {
  margin: 0;
  padding: 0.45rem 0.8rem;
}

.runner-drawer-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: calc(82vh - 72px);
  overflow-y: auto;
  padding-right: 0.1rem;
}

.section-jump-card {
  width: 100%;
  margin: 0;
  padding: 0.85rem;
  border: 1px solid var(--item-border);
  border-radius: 14px;
  background: var(--surface-card);
  color: var(--text-primary);
  text-align: left;
}

.section-jump-card.is-active {
  border-color: var(--border-color);
  box-shadow: inset 0 0 0 1px rgba(0, 158, 195, 0.22);
}

.section-jump-card.is-complete {
  background: rgba(40, 167, 69, 0.1);
  border-color: rgba(47, 125, 75, 0.36);
}

.section-jump-card.has-issue {
  background: rgba(185, 48, 48, 0.1);
  border-color: rgba(185, 48, 48, 0.38);
}

.section-jump-card.not-started {
  background: rgba(76, 85, 96, 0.06);
  border-color: rgba(76, 85, 96, 0.24);
  border-style: dashed;
}

.section-jump-card.progress {
  background: rgba(255, 193, 7, 0.1);
  border-color: rgba(192, 139, 47, 0.32);
}

.section-jump-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.section-jump-title {
  display: block;
  margin-top: 0.2rem;
  font-weight: 600;
}

.section-jump-state {
  flex-shrink: 0;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-container);
  color: var(--text-heading);
}

.section-jump-state.complete {
  background: rgba(40, 167, 69, 0.14);
  color: var(--success);
}

.section-jump-state.issue {
  background: rgba(185, 48, 48, 0.12);
  color: var(--error);
}

.section-jump-state.progress {
  background: rgba(255, 193, 7, 0.18);
  color: #7b5b00;
}

.section-jump-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.section-jump-stat {
  padding: 0.45rem 0.5rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.04);
}

.section-jump-stat-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-heading);
  font-weight: 600;
}

/* =======================
   7. CHECKLIST ITEMS
   ======================= */
.section-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.single-question-shell {
  display: grid;
  gap: 0.45rem;
}

.single-question-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.single-question-count {
  padding: 0.24rem 0.5rem;
  border: 1px solid rgba(33, 132, 155, 0.18);
  border-radius: 999px;
  background: rgba(33, 132, 155, 0.1);
  color: var(--text-heading);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.single-question-site {
  padding: 0.24rem 0.55rem;
  border: 1px solid rgba(76, 85, 96, 0.14);
  border-radius: 999px;
  background: var(--surface-card);
  color: var(--text-primary);
  font-size: 0.76rem;
  font-weight: 600;
}

.section-checklist.filter-unanswered .checklist-item:not(.is-incomplete) {
  display: none;
}

.checklist-item.section-item-focus {
  box-shadow: 0 0 0 2px rgba(76, 85, 96, 0.28), 0 10px 22px rgba(19, 24, 29, 0.16);
}

.checklist-item {
  margin-bottom: 0;
  padding: clamp(0.75rem, 1.2vw, 1rem);
  border: 1px solid rgba(33, 132, 155, 0.14);
  border-left: 4px solid transparent;
  border-radius: 14px;
  background-color: var(--item-bg);
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.checklist-item.is-issue {
  border-color: var(--error);
  border-left-color: var(--error);
  background:
    linear-gradient(180deg, rgba(185, 48, 48, 0.07), rgba(185, 48, 48, 0.02)),
    var(--item-bg);
  box-shadow: inset 0 0 0 1px rgba(185, 48, 48, 0.18);
}

.checklist-item.is-complete {
  border-color: var(--success);
  border-left-color: var(--success);
  background:
    linear-gradient(180deg, rgba(47, 125, 75, 0.08), rgba(47, 125, 75, 0.02)),
    var(--item-bg);
}

.checklist-item.is-incomplete {
  border-style: dashed;
  border-left-color: var(--warning);
  background:
    linear-gradient(180deg, rgba(192, 139, 47, 0.08), rgba(192, 139, 47, 0.02)),
    var(--item-bg);
}

.checklist-item.needs-comment {
  border-color: var(--warning);
  box-shadow: inset 0 0 0 1px rgba(192, 139, 47, 0.26), 0 8px 18px rgba(19, 24, 29, 0.08);
}

.checklist-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.62rem;
}

.checklist-item-head-main {
  flex: 1 1 auto;
}

.checklist-item-statuses {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.item-status {
  flex-shrink: 0;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  background: var(--bg-container);
  color: var(--text-heading);
  border: 1px solid var(--item-border);
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.task-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 24px;
  margin-bottom: 0.34rem;
  padding: 0.1rem 0.45rem;
  border-radius: 8px;
  background: rgba(33, 132, 155, 0.12);
  color: var(--text-heading);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.task-description {
  display: block;
  font-size: clamp(0.92rem, 1.05vw, 1rem);
  font-weight: 400;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 0;
}

.checklist-item.is-complete .item-status {
  color: var(--success);
  border-color: rgba(47, 125, 75, 0.4);
  background: rgba(47, 125, 75, 0.1);
}

.checklist-item.is-incomplete .item-status {
  color: #7b5b00;
  border-color: rgba(192, 139, 47, 0.45);
  background: rgba(192, 139, 47, 0.16);
}

.checklist-item.is-issue .item-status {
  color: var(--error);
  border-color: rgba(185, 48, 48, 0.45);
  background: rgba(185, 48, 48, 0.14);
}

.answer-segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.42rem;
  margin-bottom: 0.15rem;
}

.answer-chip {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.46rem 0.35rem;
  border: 1px solid rgba(76, 85, 96, 0.24);
  border-radius: 11px;
  background: var(--input-bg);
  color: var(--text-primary);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.answer-chip:hover,
.answer-chip:focus-within {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

.answer-chip input[type='radio'] {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.answer-chip.selected.pass {
  background: rgba(40, 167, 69, 0.14);
  border-color: var(--success);
  color: var(--success);
  box-shadow: 0 0 0 2px rgba(47, 125, 75, 0.24);
}

.answer-chip.selected.issue {
  background: rgba(185, 48, 48, 0.12);
  border-color: var(--error);
  color: var(--error);
  box-shadow: 0 0 0 2px rgba(185, 48, 48, 0.22);
}

.answer-chip.selected.na {
  background: rgba(255, 193, 7, 0.18);
  border-color: var(--warning);
  color: #7b5b00;
  box-shadow: 0 0 0 2px rgba(192, 139, 47, 0.24);
}

.answer-chip.selected {
  transform: translateY(-1px);
}

.answer-chip.selected span {
  font-weight: 700;
}

.answer-chip span {
  font-size: clamp(0.92rem, 1vw, 1.02rem);
  line-height: 1.05;
}

.answer-chip small {
  margin-top: 0.12rem;
  color: inherit;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0.74;
  text-transform: uppercase;
}

/* =======================
   8. COMMENTS
   ======================= */
.question-evidence {
  margin-top: 0.65rem;
  padding: 0.65rem;
  border: 1px solid rgba(33, 132, 155, 0.18);
  border-radius: 12px;
  background: rgba(33, 132, 155, 0.06);
}

.question-evidence__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.question-evidence__top strong {
  display: block;
  color: var(--text-heading);
  font-size: 0.88rem;
}

.question-evidence__top span,
.question-evidence__preview figcaption {
  display: block;
  margin-top: 0.12rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.question-evidence__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.question-evidence__upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(33, 132, 155, 0.32);
  border-radius: 999px;
  background: rgba(33, 132, 155, 0.12);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.question-evidence__upload--secondary {
  border-color: rgba(76, 85, 96, 0.22);
  background: rgba(76, 85, 96, 0.08);
  color: var(--text-heading);
}

.question-evidence__upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.question-evidence__remove {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0.32rem 0.58rem;
  border: 1px solid rgba(185, 48, 48, 0.28);
  border-radius: 999px;
  background: rgba(185, 48, 48, 0.1);
  color: var(--error);
  font-size: 0.74rem;
  font-weight: 600;
  box-shadow: none;
}

.question-evidence__preview {
  margin: 0.6rem 0 0;
  max-width: 340px;
}

.question-evidence__preview img {
  display: block;
  width: 100%;
  max-height: 220px;
  border: 1px solid rgba(76, 85, 96, 0.22);
  border-radius: 12px;
  background: #ffffff;
  object-fit: contain;
}

.comments-container {
  margin-top: 0.65rem;
  padding: 0.65rem;
  border: 1px solid rgba(33, 132, 155, 0.18);
  border-radius: 12px;
  background: rgba(33, 132, 155, 0.05);
}

.comments-container.hidden {
  display: none;
}

.comments-input {
  width: 100%;
  min-height: 78px;
  padding: 0.62rem 0.7rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background-color: var(--input-bg);
  color: var(--text-primary);
  font-size: 0.94rem;
  line-height: 1.4;
}

.comments-input:disabled {
  background-color: #909499;
  cursor: not-allowed;
}

.issue-meta-grid,
.issue-review-meta-grid {
  margin-top: 0.55rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.issue-meta-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.issue-meta-field > span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-heading);
  font-weight: 600;
}

.issue-meta-input {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border-color);
  border-radius: 11px;
  background: var(--input-bg);
  color: var(--text-primary);
}

.issue-meta-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  align-self: end;
  min-height: 44px;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--item-border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.62);
  font-size: 0.85rem;
  font-weight: 600;
}

.issue-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 102px;
  min-height: 28px;
  border-radius: 999px;
  padding: 0.18rem 0.52rem;
  font-size: 0.68rem;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  border: 1px solid transparent;
}

.issue-status-badge.clear,
.issue-status-badge.logged {
  background: rgba(47, 125, 75, 0.14);
  color: var(--success);
  border-color: rgba(47, 125, 75, 0.4);
}

.issue-status-badge.blocked {
  background: rgba(185, 48, 48, 0.14);
  color: var(--error);
  border-color: rgba(185, 48, 48, 0.45);
}

.issue-status-badge.action {
  background: rgba(192, 139, 47, 0.16);
  color: #7b5b00;
  border-color: rgba(192, 139, 47, 0.5);
}

.issue-reference {
  margin: 0.1rem 0 0.42rem;
  font-size: 0.72rem;
  color: var(--text-heading);
  font-weight: 600;
}

.add-comment {
  background-color: var(--btn-bg);
  color: var(--text-inverse);
  border: none;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.2s, color 0.2s;
}

.add-comment:hover,
.add-comment:focus {
  background-color: var(--btn-hover-bg);
  color: var(--btn-hover-text);
}

.comment-required {
  display: inline-flex;
  align-items: center;
  color: #7b5b00;
  background: rgba(192, 139, 47, 0.2);
  border: 1px solid rgba(192, 139, 47, 0.45);
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
  padding: 0.16rem 0.5rem;
  font-weight: 600;
}

.comment-required.hidden {
  display: none;
}

/* =======================
   9. BUTTONS & FIELDSETS
   ======================= */
button {
  padding: 0.68rem 0.9rem;
  margin: 0.45rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: linear-gradient(135deg, #173d47, #264d58);
  color: var(--text-inverse);
  font-size: 0.94rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(27, 31, 36, 0.16);
  transition: background-color 0.3s, color 0.3s, transform 0.18s ease, box-shadow 0.18s ease;
}

button:hover {
  background: var(--btn-hover-bg);
  color: var(--btn-hover-text);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(27, 31, 36, 0.2);
}

#export-report, #export-pdf {
  background-color: var(--btn-bg); /* Updated: Matches other buttons */
}

#export-report:hover, #export-pdf:hover {
  background-color: var(--btn-hover-bg);
}

#clear-form, #clear-reports {
  background: linear-gradient(135deg, #a92d2db6, #c34343ab);
}

#clear-form:hover, #clear-reports:hover {
  background: #790000;
  color: var(--text-inverse);
}

#load-progress, #save-progress {
  background: linear-gradient(135deg, #173d47, #264d58);
  color: var(--text-inverse);
}

#load-progress:hover, #save-progress:hover {
  background-color: var(--btn-hover-bg);
}

#report-status,
#archive-status {
  width: 100%;
}

fieldset {
  border: 1px solid rgba(76, 85, 96, 0.12);
  border-radius: 16px;
  padding: 0.82rem;
  margin-bottom: 0.78rem;
  background: var(--surface-muted);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.32), var(--shadow-card);
}

legend {
  font-weight: 600;
  color: var(--text-heading);
  padding: 0 0.35rem;
  margin-left: 0.4rem;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

form > fieldset:nth-of-type(1) button,
form > fieldset:nth-of-type(3) button {
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  border-color: rgba(76, 85, 96, 0.16);
  box-shadow: 0 8px 18px rgba(27, 31, 36, 0.14);
}

form > fieldset:nth-of-type(1) button:hover,
form > fieldset:nth-of-type(3) button:hover {
  background: var(--btn-hover-bg);
  color: var(--btn-hover-text);
}

form > fieldset:nth-of-type(2) {
  background: linear-gradient(180deg, rgba(184,162,122,0.12), rgba(184,162,122,0.04));
}

form > fieldset:nth-of-type(2) button:not(#clear-reports) {
  background: linear-gradient(135deg, #4a5560, #6a747f);
}

/* Form Actions */
#form-actions legend { color: var(--text-heading); } /* Updated: Matches headings */
#form-actions button {
  background-color: var(--btn-bg);
  color: var(--text-inverse);
  padding: 0.5rem 1rem;
  margin: 0.5rem; /* Updated: Consistent */
}

#form-actions button:hover { background-color: var(--btn-hover-bg); }

/* Reporting */
#reporting legend { color: var(--text-heading); }
#reporting button {
  background-color: var(--btn-bg);
  color: var(--text-inverse);
  padding: 0.5rem 1rem;
  margin: 0.5rem;
}

#reporting button:hover { background-color: var(--btn-hover-bg); }

/* Progress & Updates */
#progress-updates legend { color: var(--text-heading); }
#progress-updates button {
  background-color: var(--btn-bg);
  color: var(--text-inverse);
  padding: 0.5rem 1rem;
  margin: 0.5rem;
}

#progress-updates button:hover { background-color: var(--btn-hover-bg); }

/* =======================
   USEFUL TEXT
   ======================= */
.useful-text-nav-button {
  appearance: none;
  -webkit-appearance: none;
}

.useful-text-modal-content {
  width: min(94vw, 1050px);
  max-width: 1050px;
  max-height: min(92vh, calc(100dvh - 1.5rem));
  padding: 1rem;
  text-align: left;
}

.useful-text-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
}

.useful-text-modal-header h3 {
  margin: 0.2rem 0 0.25rem;
  color: var(--text-heading);
}

.useful-text-modal-header p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.45;
}

.useful-text-modal-header .runner-nav-button {
  flex: 0 0 auto;
}

.useful-text-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.useful-text-card {
  min-width: 0;
  padding: 0.9rem;
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}

.useful-text-card--wide {
  grid-column: 1 / -1;
}

.useful-text-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

.useful-text-card h4 {
  margin: 0;
  color: var(--text-heading);
  font-size: 1rem;
  line-height: 1.3;
}

.useful-text-card p {
  margin: 0;
  color: var(--text-body);
  line-height: 1.55;
  white-space: pre-wrap;
}

.useful-text-card ol {
  margin: 0.75rem 0 0;
  padding-left: 1.45rem;
  color: var(--text-body);
}

.useful-text-card li {
  margin-bottom: 0.45rem;
  line-height: 1.45;
}

.useful-text-card li:last-child {
  margin-bottom: 0;
}

.useful-text-copy-button {
  flex: 0 0 auto;
  min-height: 38px;
  margin: 0;
  padding: 0.48rem 0.7rem;
  border: 1px solid rgba(0, 158, 195, 0.34);
  border-radius: 9px;
  background: rgba(0, 158, 195, 0.08);
  color: var(--text-heading);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.1;
}

.useful-text-copy-button:hover,
.useful-text-copy-button:focus-visible {
  outline: none;
  border-color: var(--accent);
  background: rgba(0, 158, 195, 0.16);
}

.useful-text-copy-button:disabled {
  cursor: default;
  opacity: 0.72;
}

.dark-theme .useful-text-card {
  background:
    linear-gradient(180deg, rgba(0,174,239,0.055), rgba(255,255,255,0.012)),
    var(--surface-card);
  border-color: rgba(73, 104, 119, 0.32);
}

.dark-theme .useful-text-copy-button {
  border-color: rgba(0, 174, 239, 0.42);
  background: rgba(0, 174, 239, 0.1);
  color: #ffffff;
}

.dark-theme .useful-text-copy-button:hover,
.dark-theme .useful-text-copy-button:focus-visible {
  border-color: rgba(0, 174, 239, 0.72);
  background: rgba(0, 174, 239, 0.2);
}

@media (max-width: 760px) {
  .useful-text-modal-content {
    width: min(94vw, 720px);
    padding: 0.75rem;
  }

  .useful-text-modal-header {
    align-items: stretch;
    flex-direction: column;
  }

  .useful-text-modal-header .runner-nav-button {
    align-self: flex-start;
    min-height: 40px;
  }

  .useful-text-grid {
    grid-template-columns: 1fr;
  }

  .useful-text-card--wide {
    grid-column: auto;
  }

  .useful-text-card__header {
    align-items: stretch;
    flex-direction: column;
  }

  .useful-text-copy-button {
    align-self: flex-start;
    min-height: 42px;
  }
}

/* =======================
   10. MODAL & SIGNATURE PAD
   ======================= */
.modal {
  position: fixed;
  inset: 0;
  background-color: var(--overlay-bg);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.65rem;
  z-index: 2000;
  -webkit-overflow-scrolling: touch;
}

.modal.hidden { display: none; }

.modal-content {
  background-color: var(--bg-modal);
  padding: 0.9rem;
  border-radius: 12px;
  max-width: 1100px;
  width: min(92vw, 1100px);
  max-height: 92vh;
  overflow-y: auto;
  margin: auto;
  text-align: center;
  box-shadow: var(--shadow-strong);
}

@media (min-width: 641px) {
  .modal {
    padding: 1rem;
  }

  .modal-content {
    width: min(90vw, 1100px);
  }
}

.export-options-content {
  text-align: left;
}

.export-modal-context {
  margin: 0.35rem 0 0.9rem;
  font-size: 0.88rem;
  color: var(--text-heading);
  line-height: 1.35;
}

.report-detail-content {
  max-width: 1050px;
  width: min(94vw, 1050px);
  max-height: min(92vh, calc(100dvh - 1.5rem));
  overflow-x: hidden;
  overflow-y: auto;
  text-align: left;
}

.report-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.9rem;
}

.report-detail-header .runner-nav-button {
  flex-shrink: 0;
}

.report-detail-summary,
.report-detail-sections,
.report-detail-issues {
  margin-top: 0.9rem;
}

.report-detail-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.report-detail-stat,
.report-detail-section-card,
.report-detail-issue-card,
.report-detail-block {
  border: 1px solid var(--item-border);
  border-radius: 14px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
}

.report-detail-stat {
  padding: 0.75rem 0.8rem;
}

.report-detail-label {
  display: block;
  margin-bottom: 0.18rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-heading);
}

.report-detail-block {
  padding: 0.85rem;
}

.report-detail-block h4 {
  margin-bottom: 0.65rem;
  color: var(--text-heading);
}

.report-detail-closeout-focus p {
  margin: 0;
  color: var(--text-heading);
  font-size: 0.9rem;
  font-weight: 600;
}

.report-detail-section-list,
.report-detail-issue-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.report-detail-section-card,
.report-detail-issue-card {
  padding: 0.75rem 0.8rem;
}

.report-detail-section-top,
.report-detail-issue-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.report-detail-section-meta {
  font-size: 0.88rem;
  color: var(--text-heading);
}

.report-detail-issue-card p {
  margin-bottom: 0.28rem;
}

.report-detail-attachment-list {
  display: grid;
  gap: 0.75rem;
}

.report-detail-attachment-group {
  min-width: 0;
  padding: 0.72rem;
  border: 1px solid var(--item-border);
  border-radius: 11px;
  background: var(--surface);
}

.report-detail-attachment-group__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
}

.report-detail-attachment-group__head strong {
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.report-detail-attachment-group__head span {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.report-detail-legacy-evidence {
  margin-bottom: 0.55rem;
}

.ra-detail-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ra-detail-block {
  border-radius: 8px;
}

.ra-detail-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.ra-detail-field {
  min-width: 0;
  padding: 0.7rem;
  border: 1px solid var(--item-border);
  border-radius: 8px;
  background: var(--surface);
  overflow-wrap: anywhere;
}

.ra-detail-field p,
.ra-detail-field ul {
  margin: 0;
  color: var(--text-heading);
  line-height: 1.4;
}

.ra-detail-field ul {
  padding-left: 1.05rem;
}

.ra-detail-control-list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding-left: 1.15rem;
}

.ra-detail-control-list li {
  padding: 0.55rem 0.62rem;
  border: 1px solid rgba(33, 132, 155, 0.14);
  border-radius: 8px;
  background: var(--surface-card);
}

.ra-detail-control-list li.is-not-applicable {
  border-color: rgba(110, 116, 123, 0.28);
  background: rgba(110, 116, 123, 0.07);
  color: var(--text-muted);
}

.ra-detail-control-list li.is-not-applicable > span {
  display: block;
  opacity: 0.78;
}

.ra-detail-control-list li strong {
  display: inline-flex;
  margin-top: 0.42rem;
  padding: 0.14rem 0.46rem;
  border: 1px solid rgba(110, 116, 123, 0.32);
  border-radius: 999px;
  background: rgba(110, 116, 123, 0.1);
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.dark-theme .ra-detail-control-list li {
  border-color: rgba(73, 104, 119, 0.36);
  background: rgba(8, 17, 23, 0.58);
}

.dark-theme .ra-detail-control-list li.is-not-applicable {
  border-color: rgba(169, 193, 207, 0.22);
  background: rgba(169, 193, 207, 0.07);
}

.ra-detail-signature {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--item-border);
  border-radius: 8px;
  background: var(--surface);
}

.ra-detail-signature img {
  width: min(100%, 240px);
  height: auto;
  max-height: 90px;
  object-fit: contain;
  padding: 0.45rem;
  border: 1px solid var(--item-border);
  border-radius: 8px;
  background: #fff;
}

.ra-detail-action-list,
.ra-detail-hazard-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ra-detail-action-card,
.ra-detail-hazard-card {
  min-width: 0;
  border: 1px solid var(--item-border);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.ra-detail-action-head,
.ra-detail-hazard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  background: var(--surface-card);
  border-bottom: 1px solid var(--item-border);
}

.ra-detail-hazard-head strong,
.ra-detail-action-head strong {
  color: var(--text-heading);
}

.ra-detail-hazard-head span,
.ra-detail-action-head span {
  font-weight: 700;
  color: var(--text-heading);
}

.ra-detail-action-card .ra-detail-field-grid,
.ra-detail-hazard-card .ra-detail-field-grid {
  padding: 0.75rem;
}

.ra-detail-action-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.ra-detail-action-title h4 {
  margin-bottom: 0.25rem;
}

.ra-detail-action-title p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.ra-detail-readonly-pill {
  flex-shrink: 0;
  padding: 0.28rem 0.55rem;
  border: 1px solid rgba(33, 132, 155, 0.28);
  border-radius: 999px;
  background: rgba(33, 132, 155, 0.08);
  color: var(--text-heading);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ra-closeout-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.ra-closeout-summary span {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding: 0.65rem;
  border: 1px solid var(--item-border);
  border-radius: 8px;
  background: var(--surface);
}

.ra-closeout-summary strong {
  color: var(--text-heading);
  font-size: 1.25rem;
}

.ra-closeout-summary small {
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ra-action-closeout-panel {
  margin: 0 0.75rem 0.75rem;
  padding: 0.75rem;
  border: 1px solid rgba(33, 132, 155, 0.24);
  border-radius: 8px;
  background: rgba(33, 132, 155, 0.06);
}

.ra-action-closeout-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.ra-action-closeout-panel__head strong {
  color: var(--text-heading);
}

.ra-action-closeout-panel__head span {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.ra-action-closeout-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.ra-action-closeout-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  color: var(--text-heading);
  font-size: 0.78rem;
  font-weight: 800;
}

.ra-action-closeout-grid select,
.ra-action-closeout-grid input,
.ra-action-closeout-grid textarea {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text-heading);
  font: inherit;
}

.ra-action-closeout-grid select,
.ra-action-closeout-grid input {
  min-height: 44px;
  padding: 0.48rem 0.55rem;
}

.ra-action-closeout-grid textarea {
  min-height: 82px;
  padding: 0.55rem;
  resize: vertical;
}

.ra-action-closeout-grid__full {
  grid-column: 1 / -1;
}

.ra-action-closeout-error {
  min-height: 1rem;
  margin-top: 0.55rem;
  color: #9c1f1f;
  font-size: 0.82rem;
  font-weight: 700;
}

.ra-detail-action-card.has-error {
  border-color: rgba(185, 48, 48, 0.55);
  box-shadow: 0 0 0 2px rgba(185, 48, 48, 0.1);
}

.ra-action-closeout-save {
  margin-top: 0.85rem;
}

.ra-detail-field .is-good {
  color: #17633d;
}

.ra-detail-field .is-muted {
  color: var(--text-muted);
}

.ra-detail-action-head .is-open {
  color: #8a620f;
}

.ra-detail-action-head .is-overdue {
  color: #9c1f1f;
}

.report-closeout-panel {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid rgba(33, 132, 155, 0.2);
  border-radius: 12px;
  background: rgba(33, 132, 155, 0.06);
}

.report-closeout-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
}

.report-closeout-panel__head strong {
  color: var(--text-heading);
}

.report-closeout-panel__head span {
  padding: 0.18rem 0.5rem;
  border: 1px solid rgba(33, 132, 155, 0.25);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 600;
}

.report-closeout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.report-closeout-grid label {
  margin: 0;
}

.report-closeout-grid span {
  display: block;
  margin-bottom: 0.22rem;
  color: var(--text-heading);
  font-size: 0.76rem;
  font-weight: 600;
}

.report-closeout-grid input,
.report-closeout-grid select,
.report-closeout-grid textarea {
  width: 100%;
  min-height: 38px;
  padding: 0.5rem 0.58rem;
  border: 1px solid var(--item-border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-primary);
  font: inherit;
}

.report-closeout-grid textarea {
  min-height: 74px;
  resize: vertical;
}

.report-closeout-grid__full {
  grid-column: 1 / -1;
}

.report-closeout-save {
  width: auto;
  margin-top: 0.65rem;
}

.report-closeout-evidence {
  margin-top: 0.75rem;
  padding: 0.65rem;
  border: 1px solid rgba(33, 132, 155, 0.18);
  border-radius: 12px;
  background: rgba(33, 132, 155, 0.05);
}

.report-closeout-evidence__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.report-closeout-evidence__top strong {
  display: block;
  color: var(--text-heading);
  font-size: 0.88rem;
}

.report-closeout-evidence__top span,
.report-closeout-evidence__preview figcaption,
.report-closeout-evidence__empty {
  display: block;
  margin-top: 0.12rem;
  color: var(--text-heading);
  font-size: 0.72rem;
  font-weight: 500;
}

.report-closeout-evidence__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.report-closeout-evidence__data {
  display: none;
}

.report-closeout-evidence__remove {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0.32rem 0.58rem;
  border: 1px solid rgba(185, 48, 48, 0.28);
  border-radius: 999px;
  background: rgba(185, 48, 48, 0.1);
  color: var(--error);
  font-size: 0.74rem;
  font-weight: 600;
  box-shadow: none;
}

.report-closeout-evidence__gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 240px));
  gap: 0.65rem;
  margin-top: 0.65rem;
}

.report-closeout-evidence__preview {
  position: relative;
  margin: 0;
  max-width: 240px;
}

.report-closeout-evidence__preview img {
  display: block;
  width: 100%;
  max-height: 180px;
  border: 1px solid rgba(76, 85, 96, 0.22);
  border-radius: 12px;
  background: #ffffff;
  object-fit: contain;
}

.report-closeout-evidence__remove-image {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  min-height: 28px;
  margin: 0;
  padding: 0.24rem 0.45rem;
  border: 1px solid rgba(185, 48, 48, 0.34);
  border-radius: 999px;
  background: rgba(185, 48, 48, 0.9);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 600;
  box-shadow: none;
}

.export-options-group {
  margin: 0.9rem 0 1rem;
}

.export-options-group label {
  margin-bottom: 0.4rem;
}

#export-run {
  background: linear-gradient(135deg, #3f6f5b, #2f7d4b);
}

#export-cancel {
  background: linear-gradient(135deg, #5f6975, #74808d);
}

.signature-pad {
  width: 100%;
  height: 200px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--input-bg);
  margin-bottom: 10px;
}

.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 8px; /* Updated: Matches tutorial-modal */
}

.confirm-modal-content {
  text-align: left;
}

.checklist-intro-content {
  width: min(92vw, 1100px);
  max-width: 1100px;
  max-height: 90vh;
  overflow-y: auto;
  text-align: left;
}

.checklist-intro-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.72rem;
}

.checklist-intro-header > div {
  min-width: 0;
}

.checklist-intro-header h3 {
  margin: 0.2rem 0 0.35rem;
  color: var(--text-heading);
}

.checklist-intro-header .runner-nav-button {
  flex: 0 0 auto;
  width: auto !important;
  max-width: 100%;
  margin: 0;
  white-space: nowrap;
}

.checklist-intro-meta {
  margin: 0;
  color: var(--text-heading);
  font-size: 0.9rem;
  font-weight: 600;
}

.checklist-intro-text {
  margin: 0 0 0.75rem;
  color: var(--text-primary);
  font-size: 0.94rem;
  line-height: 1.45;
}

.checklist-intro-guidance {
  padding: 0.75rem;
  border: 1px solid rgba(49, 132, 155, 0.18);
  border-radius: 14px;
  background: rgba(49, 132, 155, 0.08);
}

.checklist-intro-guidance h4 {
  margin: 0 0 0.6rem;
  color: var(--text-heading);
  font-size: 0.96rem;
}

.checklist-intro-guidance ul {
  margin: 0;
  padding-left: 1.2rem;
}

.checklist-intro-guidance li {
  margin: 0.28rem 0;
  color: var(--text-primary);
  line-height: 1.45;
}

#confirm-modal-message {
  margin: 0.75rem 0 1rem;
  color: var(--text-primary);
}

#confirm-modal-confirm {
  background: var(--btn-error-bg);
}

#confirm-modal-confirm:hover {
  background: #790000;
  color: var(--text-inverse);
}

/* Modal styles to match #signature-modal */
#tutorial-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay-bg);
  z-index: 1000;
}

#tutorial-modal .modal-content {
  background: var(--bg-modal);
  margin: 5% auto;
  padding: 20px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border-color);
}

#tutorial-modal h2 {
  color: var(--text-heading);
  font-size: 16px;
  text-align: center;
}

#tutorial-modal h3 {
  font-size: 14px;
  color: 'var(--text-heading)';
  font-weight: bold;
}

#tutorial-modal p {
  font-size: 12px;
}

#tutorial-modal .tip {
  font-style: italic;
  font-size: 11px;
}

/* Center the “Learn More” button inside the modal */
#tutorial-modal #tutorial-learn-more {
  font-size: 12px;
  color: var(--text-heading);
  background: none;
  border: none;
  cursor: pointer;

  /* ensure it doesn’t stretch full-width */
  display: inline-block !important;
  /* auto-center within the parent’s text-align or block context */
  margin: 0.5rem auto;
}

#tutorial-modal .modal-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  gap: 8px;
}

#tutorial-modal .modal-actions button, #tutorial-modal .modal-actions select {
  background: var(--btn-bg);
  color: var(--text-inverse);
  padding: 0.5rem 1rem; /* Updated: Consistent */
  border: none;
  font-size: 12px;
  cursor: pointer;
  flex: 1;
}

#tutorial-modal .modal-actions button:hover, #tutorial-modal .modal-actions select:hover {
  background: var(--btn-hover-bg);
  color: var(--btn-hover-text);
}

#tutorial-modal .modal-close {
  text-align: center;
  font-size: 11px;
}

#tutorial-modal .modal-close a {
  color: var(--text-heading);
  text-decoration: none;
}

/* Pulse effect for highlighting elements */
@keyframes pulse {
  0% { border-color: var(--border-color); }
  50% { border-color: var(--text-inverse); }
}
.pulse {
  border: 2px solid var(--border-color);
  animation: pulse 1s infinite;
}

/* =======================
   11. ERROR STYLES
   ======================= */
.error-message {
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 5px;
  text-align: center;
}

.error-message.hidden { display: none; }

.error-highlight {
  border-color: var(--error);
  box-shadow: 0 0 5px rgba(185, 48, 48, 0.5); /* Updated: Matches --error */
}

/* =======================
   12. STATUS BANNERS
   ======================= */
.resume-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
  padding: 12px 14px;
  border: 1px solid rgba(0, 158, 195, 0.28);
  border-radius: 14px;
  background: rgba(0, 158, 195, 0.08);
  box-shadow: var(--shadow-soft);
}

.resume-banner.hidden {
  display: none;
}

.resume-banner-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  color: var(--text-primary);
}

.resume-banner-copy strong {
  font-weight: 600;
}

.resume-banner-meta {
  font-size: 0.9rem;
  color: var(--text-heading);
}

.resume-banner-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.resume-banner-actions button {
  margin: 0;
}

@media (max-width: 640px) {
  .resume-banner {
    flex-direction: column;
    align-items: stretch;
  }

  .resume-banner-actions button {
    flex: 1;
  }
}

/* =======================
   14. REPORT LIST
   ======================= */
.control-hub {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.4rem;
}

.control-accordion {
  border: 1px solid rgba(76, 85, 96, 0.12);
  border-radius: 18px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.control-accordion summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-heading);
}

.control-accordion summary::-webkit-details-marker {
  display: none;
}

.control-accordion[open] summary {
  border-bottom: 1px solid var(--item-border);
}

.control-accordion-kicker {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-heading);
  opacity: 0.9;
}

.control-accordion-panel {
  padding: 0.95rem 1rem 1rem;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.control-grid button {
  width: 100%;
  margin: 0;
}

#inspection-tools-panel .control-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

#inspection-tools-panel .control-grid button {
  min-height: 36px;
  padding: 0.42rem 0.55rem;
  border-radius: 10px;
  font-size: 0.82rem;
  box-shadow: none;
}

.control-grid-compact {
  margin-bottom: 0;
}

.data-management-note {
  margin: 0 0 0.75rem;
  color: var(--text-heading);
  font-size: 0.9rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.data-management-full-backup {
  width: 100%;
  margin: 0.65rem 0 0;
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
}

.data-management-warning {
  margin: 0.65rem 0 0;
  padding: 0.65rem 0.7rem;
  border: 1px solid rgba(180, 83, 9, 0.35);
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.12);
  color: var(--text-heading);
  font-size: 0.84rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.backup-import-content {
  max-width: 760px;
}

.backup-import-summary {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0;
}

.backup-import-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.backup-import-summary-grid div {
  min-width: 0;
  padding: 0.75rem;
  border: 1px solid var(--item-border);
  border-radius: 10px;
  background: var(--surface-subtle);
}

.backup-import-summary-grid span,
.backup-import-option small {
  display: block;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.backup-import-summary-grid strong {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-heading);
  overflow-wrap: anywhere;
}

.backup-import-warning,
.backup-import-result {
  margin: 0;
  padding: 0.75rem;
  border: 1px solid rgba(180, 83, 9, 0.35);
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.12);
  color: var(--text-heading);
  line-height: 1.45;
}

.backup-import-help {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.backup-import-result:empty {
  display: none;
}

.backup-import-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.backup-import-result-grid span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.backup-import-options {
  display: grid;
  gap: 0.65rem;
  margin: 0 0 1rem;
}

.backup-import-option,
.backup-import-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem;
  border: 1px solid var(--item-border);
  border-radius: 10px;
  background: var(--surface-card);
  color: var(--text-heading);
}

.backup-import-option input,
.backup-import-checkbox input {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.12rem;
  flex: 0 0 auto;
}

.backup-import-option strong {
  display: block;
  margin-bottom: 0.2rem;
}

.backup-import-option--danger {
  border-color: rgba(185, 28, 28, 0.35);
}

.backup-import-content .modal-buttons {
  flex-wrap: wrap;
}

.backup-import-content .modal-buttons button {
  min-width: 0;
}

.report-primary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.report-primary-actions button {
  width: 100%;
  margin: 0;
}

.report-primary-button {
  min-height: 52px;
}

.report-primary-button-export {
  background: linear-gradient(135deg, #3f6f5b, #2f7d4b);
  border-color: rgba(47, 125, 75, 0.35);
}

.report-more-actions {
  margin-bottom: 0.8rem;
  border: 1px solid var(--item-border);
  border-radius: 14px;
  background: var(--surface-card);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.report-more-actions summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-heading);
}

.report-more-actions summary::-webkit-details-marker {
  display: none;
}

.report-more-actions[open] summary {
  border-bottom: 1px solid var(--item-border);
}

.report-more-actions-kicker {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-heading);
  opacity: 0.9;
}

.report-more-actions-panel {
  padding: 0.8rem 0.85rem 0.85rem;
}

.control-accordion-panel .control-grid + .report-dashboard-tiles {
  margin-top: 0.6rem;
}

.report-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--item-border);
  border-radius: 14px;
  background: var(--surface-card);
}

.report-status-card-muted {
  opacity: 0.9;
}

.report-dashboard-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0.85rem 0 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--item-border);
}

@media (min-width: 900px) {
  .report-dashboard-tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.report-dashboard-tile {
  border: 1px solid var(--item-border);
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
  background: var(--surface-card);
  box-shadow: var(--shadow-soft);
  text-align: left;
  width: 100%;
  margin: 0;
  color: var(--text-primary);
}

.report-dashboard-tile.muted {
  opacity: 0.94;
}

.report-dashboard-tile.is-clickable {
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.report-dashboard-tile.is-clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(27, 31, 36, 0.16);
  background: var(--surface-card);
  color: var(--text-primary);
}

.report-dashboard-tile.is-active,
.report-dashboard-tile.is-active:hover {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(0, 158, 195, 0.22), 0 10px 22px rgba(14, 73, 92, 0.1);
  background:
    linear-gradient(180deg, rgba(0,158,195,0.12), rgba(0,158,195,0.04)),
    var(--surface-card);
  color: var(--text-primary);
}

.report-dashboard-tile.is-active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(0, 158, 195, 0.22), 0 10px 22px rgba(14, 73, 92, 0.1);
  background:
    linear-gradient(180deg, rgba(0,158,195,0.12), rgba(0,158,195,0.04)),
    var(--surface-card);
}

.report-dashboard-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-heading);
  margin-bottom: 0.22rem;
}

.report-dashboard-tile strong {
  display: block;
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--text-primary);
}

.report-cockpit-charts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
  margin: 0.85rem 0;
}

.report-cockpit-charts.muted {
  opacity: 0.96;
}

@media (min-width: 1100px) {
  .report-cockpit-charts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.report-cockpit-card {
  min-width: 0;
  padding: 0.8rem;
  border: 1px solid var(--item-border);
  border-radius: 14px;
  background: var(--surface-card);
  box-shadow: var(--shadow-soft);
}

.report-cockpit-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.report-cockpit-card__head strong {
  color: var(--text-primary);
  font-size: 0.9rem;
}

.report-cockpit-card__head span {
  color: var(--text-heading);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.report-cockpit-empty {
  margin: 0;
  color: var(--text-heading);
  font-size: 0.82rem;
}

.report-cockpit-bar,
.report-cockpit-status {
  display: grid;
  gap: 0.28rem;
  margin-top: 0.52rem;
}

.report-cockpit-bar:first-of-type,
.report-cockpit-status:first-of-type {
  margin-top: 0;
}

.report-cockpit-bar__top,
.report-cockpit-status {
  color: var(--text-heading);
  font-size: 0.8rem;
  font-weight: 600;
}

.report-cockpit-bar__top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.report-cockpit-bar__top strong,
.report-cockpit-status strong {
  color: var(--text-primary);
}

.report-cockpit-bar__track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(76, 85, 96, 0.14);
}

.report-cockpit-bar__track span {
  display: block;
  width: var(--bar-width, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--info);
}

.report-cockpit-status {
  grid-template-columns: minmax(0, 1fr) auto;
}

.report-cockpit-status .report-cockpit-bar__track {
  grid-column: 1 / -1;
}

.report-cockpit-status.is-attention .report-cockpit-bar__track span {
  background: var(--error);
}

.report-cockpit-status.is-good .report-cockpit-bar__track span {
  background: var(--success);
}

.report-cockpit-status.is-muted {
  opacity: 0.72;
}

.report-filter-strip {
  margin-bottom: 0.75rem;
  border: 1px solid var(--item-border);
  border-radius: 14px;
  background: var(--surface-card);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.report-filter-strip summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-heading);
}

.report-filter-strip summary::-webkit-details-marker {
  display: none;
}

.report-filter-strip[open] summary {
  border-bottom: 1px solid var(--item-border);
}

.report-filter-strip-kicker {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-heading);
  opacity: 0.92;
}

.report-filter-strip-panel {
  padding: 0.8rem 0.85rem 0.85rem;
}

.report-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 0.55fr) minmax(150px, 0.55fr) minmax(160px, 0.65fr);
  gap: 0.6rem;
  margin-bottom: 0;
  padding-top: 0;
}

.report-search-input,
.report-filter-select {
  margin: 0;
}

#export-queue-csv,
#export-archive-csv {
  margin: 0;
}

.report-status-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-heading);
}

#report-status strong,
#archive-status strong {
  font-size: 1.1rem;
  color: var(--text-primary);
}

.control-subpanel {
  border: 1px solid rgba(76, 85, 96, 0.12);
  border-radius: 16px;
  margin-top: 0.85rem;
  padding: 0.85rem;
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
}

.control-subpanel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.control-subpanel-header h3 {
  margin: 0;
  font-size: 1.02rem;
  color: var(--text-heading);
}

.control-subpanel-kicker {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-heading);
}

#report-list {
  border: 1px solid rgba(76, 85, 96, 0.12);
  border-radius: 18px;
  margin-top: 1rem;
  padding: 0.85rem;
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
}

#report-list h3 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  color: var(--text-heading);
}

#report-items,
#archive-items {
  list-style: none;
  padding: 0;
  margin: 0;
}

#report-items li {
  list-style: none;
}

#report-items li:last-child,
#archive-items li:last-child { border-bottom: none; margin-bottom: 0; }

.empty-archive {
  padding: 0.85rem 0;
  color: var(--text-heading);
  text-align: center;
  border-bottom: none;
}

.report-queue-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.9rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--item-border);
  border-left: 4px solid rgba(76, 85, 96, 0.2);
  border-radius: 16px;
  background: var(--surface-card);
  box-shadow: var(--shadow-soft);
  color: var(--text-primary);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.report-queue-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(27, 31, 36, 0.16);
}

.report-queue-card:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(27, 31, 36, 0.14);
}


/* Queue card status accents */

.report-queue-card.has-issues {
  border-left-color: var(--error);
  background:
    linear-gradient(180deg, rgba(185, 48, 48, 0.08), rgba(185, 48, 48, 0.02)),
    var(--surface-card);
}

.report-queue-card.has-issues:hover {
  background:
    linear-gradient(180deg, rgba(185, 48, 48, 0.12), rgba(185, 48, 48, 0.03)),
    var(--surface-card);
}

.report-queue-card.is-clear {
  border-left-color: var(--success);
  background:
    linear-gradient(180deg, rgba(47, 125, 75, 0.06), rgba(47, 125, 75, 0.02)),
    var(--surface-card);
}

.report-queue-card.is-clear:hover {
  background:
    linear-gradient(180deg, rgba(47, 125, 75, 0.1), rgba(47, 125, 75, 0.03)),
    var(--surface-card);
}

.report-queue-card.muted {
  opacity: 0.9;
}

.report-queue-card-main {
  flex: 1;
  min-width: 0;
}

.report-queue-card-top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.report-queue-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  border-radius: 999px;
  background: rgba(76, 85, 96, 0.12);
  color: var(--text-heading);
  font-size: 0.8rem;
  font-weight: 600;
}

.report-queue-title {
  font-size: 0.96rem;
  color: var(--text-primary);
}

.report-queue-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.report-queue-badge.clear {
  background: rgba(47, 125, 75, 0.14);
  color: var(--success);
  border: 1px solid rgba(47, 125, 75, 0.4);
}

.report-queue-badge.has-issues {
  background: rgba(185, 48, 48, 0.14);
  color: var(--error);
  border: 1px solid rgba(185, 48, 48, 0.45);
}

.report-lifecycle-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.14rem 0.48rem;
  border: 1px solid rgba(33, 132, 155, 0.28);
  border-radius: 999px;
  background: rgba(33, 132, 155, 0.1);
  color: var(--text-primary);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 600;
  line-height: 1.2;
}

.report-queue-card.is-exported {
  border-left-color: var(--info);
}

.report-lifecycle-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.14rem 0.48rem;
  border: 1px solid rgba(33, 132, 155, 0.28);
  border-radius: 999px;
  background: rgba(33, 132, 155, 0.1);
  color: var(--text-primary);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 600;
  line-height: 1.2;
}

.report-queue-card.is-exported {
  border-left-color: var(--info);
}

.report-queue-card.is-closeout-complete {
  border-left-color: var(--success);
}

.report-queue-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--text-heading);
}

.report-queue-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 0.9rem;
  margin-top: 0.2rem;
}

@media (min-width: 1200px) {
  .report-queue-meta-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .report-detail-content {
    width: min(96vw, 920px);
  }

  .ra-detail-summary-grid,
  .ra-closeout-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ra-action-closeout-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-queue-card.is-risk-assessment {
    flex-direction: column;
    align-items: stretch;
  }

  .report-queue-card.is-risk-assessment .report-card-actions {
    width: 100%;
    align-self: stretch;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-queue-card.is-risk-assessment .card-action-button {
    min-height: 44px;
  }
}

.report-queue-meta-grid span strong {
  color: var(--text-primary);
}

.report-card-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.report-card-metric {
  display: flex;
  min-height: 58px;
  flex-direction: column;
  justify-content: center;
  gap: 0.16rem;
  padding: 0.5rem 0.56rem;
  border: 1px solid rgba(76, 85, 96, 0.14);
  border-radius: 10px;
  background: var(--surface-card);
  color: var(--text-heading);
}

.report-card-metric strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.15;
}

.report-card-metric small {
  display: block;
  color: var(--text-heading);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-transform: uppercase;
}

.report-card-metric.is-attention {
  border-color: rgba(185, 48, 48, 0.34);
  background: rgba(185, 48, 48, 0.08);
}

.report-card-metric.is-good {
  border-color: rgba(47, 125, 75, 0.28);
  background: rgba(47, 125, 75, 0.08);
}

.report-card-metric.is-info {
  border-color: rgba(33, 132, 155, 0.3);
  background: rgba(33, 132, 155, 0.08);
}

.report-card-metric.is-muted {
  opacity: 0.86;
}

.report-history-card {
  align-items: flex-start;
}

.report-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 132px;
  flex-shrink: 0;
  align-self: center;
}

.card-action-button {
  width: 100%;
  margin: 0;
  padding: 0.56rem 0.7rem;
  font-size: 0.82rem;
  border-radius: 10px;
  box-shadow: none;
}

.card-action-button.is-reexport {
  background: linear-gradient(135deg, #0098c7, #007da8);
}

.card-action-button.is-closeout {
  background: linear-gradient(135deg, #c08b2f, #d4a017);
  color: var(--text-primary);
}

.card-action-button.danger {
  background: linear-gradient(135deg, #a92d2d, #c34343);
}

.card-action-button.danger:hover {
  background: #790000;
  color: var(--text-inverse);
}

.delete-report {
  background-color: var(--btn-error-bg);
  color: var(--text-inverse);
  border: none;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  margin-left: 1rem;
}

.delete-report:hover {
  background-color: #790000;
  color: var(--text-inverse);
}

.review-card {
  border: 1px solid var(--item-border);
  border-radius: 16px;
  background: var(--surface-raised);
  padding: 1rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-soft);
}

.review-card h4 {
  color: var(--text-heading);
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.review-card p {
  margin-bottom: 0.35rem;
}

.risk-assessment-panel {
  display: grid;
  gap: 0.9rem;
  min-width: 0;
}

.risk-assessment-panel.hidden {
  display: none;
}

.ra-section-card {
  min-width: 0;
  border: 1px solid var(--item-border);
  border-radius: 16px;
  background: var(--surface-raised);
  padding: clamp(0.9rem, 2vw, 1.2rem);
  box-shadow: var(--shadow-soft);
}

.ra-section-head,
.ra-hazard-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.ra-section-head h4,
.ra-hazard-card__head h4 {
  margin: 0.1rem 0 0;
  color: var(--text-heading);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.ra-section-kicker {
  max-width: 100%;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: right;
  text-transform: uppercase;
}

.ra-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.72rem;
  min-width: 0;
}

.ra-field {
  display: grid;
  gap: 0.32rem;
  min-width: 0;
}

.ra-field .input,
.ra-field .select,
.ra-field input[type="date"],
.ra-field input[type="text"],
.ra-action-closeout-grid input,
.ra-action-closeout-grid select,
.ra-action-closeout-grid textarea {
  min-width: 0;
  max-width: 100%;
}

.ra-field > span,
.ra-field > label:first-child {
  color: var(--text-heading);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ra-field--controlled .input[readonly] {
  background: rgba(33, 132, 155, 0.06);
  border-color: rgba(33, 132, 155, 0.2);
  color: var(--text-primary);
  cursor: default;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dark-theme .ra-field--controlled .input[readonly] {
  background: rgba(0, 174, 239, 0.08);
  border-color: rgba(0, 174, 239, 0.3);
}

.ra-textarea {
  width: 100%;
  min-height: 112px;
  padding: 0.78rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--input-bg);
  color: var(--text-primary);
  font: inherit;
  line-height: 1.45;
  resize: vertical;
}

.ra-readonly-panel {
  min-height: 58px;
  padding: 0.78rem 0.85rem;
  border: 1px solid rgba(33, 132, 155, 0.2);
  border-radius: 14px;
  background: rgba(33, 132, 155, 0.06);
  color: var(--text-primary);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ra-readonly-panel ul {
  margin: 0;
  padding-left: 1.1rem;
}

.ra-control-list {
  display: grid;
  gap: 0.7rem;
  margin: 0;
  padding-left: 1.2rem;
}

.ra-control-list li {
  padding: 0.62rem 0.68rem;
  border: 1px solid rgba(33, 132, 155, 0.16);
  border-radius: 10px;
  background: var(--surface-card);
}

.ra-control-list li.is-not-applicable {
  border-color: rgba(110, 116, 123, 0.24);
  background: rgba(110, 116, 123, 0.07);
  color: var(--text-muted);
}

.ra-control-list li.is-not-applicable .ra-control-list__content > span {
  opacity: 0.72;
}

.ra-control-list__content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  min-width: 0;
}

.ra-control-na-status {
  flex: 0 0 auto;
  padding: 0.12rem 0.42rem;
  border: 1px solid rgba(110, 116, 123, 0.34);
  border-radius: 999px;
  background: rgba(110, 116, 123, 0.1);
  color: var(--text-muted);
  font-size: 0.68rem;
  line-height: 1.35;
  text-transform: uppercase;
}

.ra-control-applicability {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  align-items: center;
  width: auto;
  max-width: 100%;
  min-width: 0;
  margin: 0.55rem 0 0;
  padding: 0.22rem;
  border: 1px solid rgba(33, 132, 155, 0.16);
  border-radius: 999px;
  background: rgba(33, 132, 155, 0.04);
}

.ra-control-applicability label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  min-height: 32px;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 0.28rem 0.58rem;
  border: 1px solid var(--item-border);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.25;
  cursor: pointer;
  box-shadow: none;
}

.ra-control-applicability input[type="radio"] {
  flex: 0 0 auto;
  width: 0.95rem;
  height: 0.95rem;
  accent-color: var(--accent);
}

.ra-control-applicability label:has(input[type="radio"]:checked) {
  border-color: rgba(33, 132, 155, 0.48);
  background: rgba(33, 132, 155, 0.11);
  color: var(--text-heading);
}

.ra-control-applicability label:has(input[type="radio"]:focus-visible) {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.ra-control-applicability.is-locked {
  opacity: 0.82;
}

.ra-control-applicability.is-locked label {
  cursor: not-allowed;
}

.ra-control-applicability input[type="radio"]:disabled {
  cursor: not-allowed;
}

.ra-readonly-panel li + li {
  margin-top: 0.34rem;
}

.ra-control-list li + li {
  margin-top: 0;
}

.ra-readonly-panel p {
  margin: 0;
  color: var(--text-muted);
  font-style: italic;
}

.dark-theme .ra-readonly-panel {
  border-color: rgba(0, 174, 239, 0.3);
  background: rgba(0, 174, 239, 0.08);
}

.dark-theme .ra-control-list li {
  border-color: rgba(73, 104, 119, 0.38);
  background: rgba(8, 17, 23, 0.62);
}

.dark-theme .ra-control-list li.is-not-applicable {
  border-color: rgba(169, 193, 207, 0.22);
  background: rgba(169, 193, 207, 0.07);
}

.dark-theme .ra-control-applicability label {
  border-color: rgba(73, 104, 119, 0.42);
  background: rgba(8, 17, 23, 0.76);
}

.dark-theme .ra-control-applicability label:has(input[type="radio"]:checked) {
  border-color: rgba(0, 174, 239, 0.58);
  background: rgba(0, 174, 239, 0.14);
}

.dark-theme .ra-progress-summary div,
.dark-theme .ra-hazard-index__item,
.dark-theme .ra-hazard-toggle {
  border-color: rgba(73, 104, 119, 0.38);
  background: rgba(8, 17, 23, 0.62);
}

.dark-theme .ra-hazard-index__item.is-active {
  border-color: rgba(0, 174, 239, 0.58);
  box-shadow: inset 0 0 0 1px rgba(0, 174, 239, 0.22);
}

.dark-theme .ra-hazard-sticky-bar {
  border-color: rgba(73, 104, 119, 0.42);
  background: rgba(5, 10, 14, 0.92);
}

.ra-card-list {
  display: grid;
  gap: 0.75rem;
}

.ra-progress-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.ra-progress-summary div {
  min-width: 0;
  padding: 0.68rem 0.75rem;
  border: 1px solid var(--item-border);
  border-radius: 12px;
  background: var(--surface-card);
}

.ra-progress-summary span,
.ra-hazard-jump > span {
  display: block;
  color: var(--text-heading);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ra-progress-summary strong {
  display: block;
  margin-top: 0.18rem;
  color: var(--text-heading);
  font-size: 1.25rem;
}

.ra-hazard-workspace,
.ra-hazard-navigation,
.ra-hazard-card-list {
  display: grid;
  gap: 0.75rem;
}

.ra-hazard-jump {
  display: grid;
  gap: 0.35rem;
}

.ra-hazard-index {
  display: none;
}

.ra-hazard-index__item {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0.62rem 0.7rem;
  border: 1px solid var(--item-border);
  border-radius: 10px;
  background: var(--surface-card);
  color: var(--text-primary);
  text-align: left;
  box-shadow: none;
}

.ra-hazard-index__item span,
.ra-hazard-index__item strong {
  display: block;
  overflow-wrap: anywhere;
}

.ra-hazard-index__item span {
  font-weight: 700;
}

.ra-hazard-index__item strong {
  margin-top: 0.18rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ra-hazard-index__item.is-active {
  border-color: rgba(33, 132, 155, 0.55);
  box-shadow: inset 0 0 0 1px rgba(33, 132, 155, 0.24);
}

.ra-hazard-card {
  min-width: 0;
  border: 1px solid rgba(33, 132, 155, 0.18);
  border-left: 5px solid var(--accent);
  border-radius: 14px;
  background: var(--surface-card);
  padding: clamp(0.85rem, 1.8vw, 1.08rem);
}

.ra-hazard-card.is-collapsed {
  border-left-color: rgba(76, 85, 96, 0.38);
}

.ra-hazard-card.action {
  border-left-color: var(--warning);
}

.ra-hazard-card.progress {
  border-left-color: rgba(33, 132, 155, 0.72);
}

.ra-hazard-card__summary {
  margin: 0.28rem 0 0;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
}

.ra-hazard-card__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.ra-hazard-toggle {
  margin: 0;
  min-height: 32px;
  padding: 0.36rem 0.68rem;
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--text-heading);
  box-shadow: none;
}

.ra-hazard-panel {
  display: grid;
  gap: 0.78rem;
  min-width: 0;
  padding-top: 0.15rem;
}

.ra-hazard-panel[hidden] {
  display: none;
}

.ra-hazard-panel__section {
  min-width: 0;
}

.ra-hazard-card {
  scroll-margin-top: 1rem;
}

.ra-date-na-option {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  margin-top: 0.4rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.ra-date-na-option input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--accent);
}

.ra-control-review {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  margin-top: 0.7rem;
  padding: 0.7rem;
  border: 1px solid rgba(192, 139, 47, 0.36);
  border-radius: 12px;
  background: rgba(192, 139, 47, 0.08);
}

.ra-control-review.is-confirmed {
  border-color: rgba(47, 125, 75, 0.32);
  background: rgba(47, 125, 75, 0.08);
}

.ra-control-review button {
  margin: 0;
  padding: 0.52rem 0.72rem;
  box-shadow: none;
}

.ra-control-review button:disabled {
  background: var(--success);
  color: #fff;
  opacity: 1;
}

.ra-control-review span {
  flex: 1 1 15rem;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.ra-control-instruction {
  margin: 0 0 0.55rem;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.35;
}

.ra-hazard-card--site {
  border-left-color: var(--warning);
}

.ra-status-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0.22rem 0.6rem;
  border: 1px solid rgba(47, 125, 75, 0.32);
  border-radius: 999px;
  background: rgba(47, 125, 75, 0.1);
  color: var(--success);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: normal;
  text-align: center;
}

.ra-status-pill.is-muted {
  border-color: rgba(110, 116, 123, 0.32);
  background: rgba(110, 116, 123, 0.1);
  color: var(--text-muted);
}

.ra-status-pill.is-review {
  border-color: rgba(192, 139, 47, 0.42);
  background: rgba(192, 139, 47, 0.12);
  color: var(--warning);
}

.ra-status-pill.complete {
  border-color: rgba(47, 125, 75, 0.32);
  background: rgba(47, 125, 75, 0.1);
  color: var(--success);
}

.ra-status-pill.progress {
  border-color: rgba(33, 132, 155, 0.38);
  background: rgba(33, 132, 155, 0.1);
  color: var(--accent);
}

.ra-status-pill.action {
  border-color: rgba(192, 139, 47, 0.42);
  background: rgba(192, 139, 47, 0.12);
  color: var(--warning);
}

.ra-hazard-sticky-bar {
  position: sticky;
  bottom: calc(var(--app-nav-height) + env(safe-area-inset-bottom, 0px) + 0.75rem);
  z-index: 24;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
  padding: 0.5rem;
  border: 1px solid rgba(76, 85, 96, 0.18);
  border-radius: 16px;
  background: rgba(231, 240, 245, 0.94);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
}

.ra-hazard-sticky-bar button {
  min-width: 0;
  margin: 0;
  padding: 0.62rem 0.45rem;
  border-radius: 10px;
  box-shadow: none;
  font-size: 0.82rem;
}

.ra-hazard-sticky-bar [data-ra-save-hazard] {
  background: var(--warning);
  color: var(--text-primary);
}

.ra-hazard-sticky-bar [data-ra-review-assessment] {
  background: linear-gradient(135deg, #3f6f5b, #2f7d4b);
}

.ra-hazard-sticky-bar button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.ra-section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.ra-remove-button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0.32rem 0.68rem;
  border: 1px solid rgba(185, 48, 48, 0.28);
  border-radius: 999px;
  background: rgba(185, 48, 48, 0.08);
  color: var(--error);
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ra-remove-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.ra-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.ra-review-metric {
  min-height: 76px;
  padding: 0.68rem;
  border: 1px solid var(--item-border);
  border-radius: 13px;
  background: var(--surface-card);
}

.ra-review-metric span {
  display: block;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ra-review-metric strong {
  display: block;
  margin-top: 0.22rem;
  color: var(--text-heading);
  font-size: 1.55rem;
  line-height: 1;
}

.ra-review-metric.is-attention {
  border-color: rgba(192, 139, 47, 0.36);
  background: rgba(192, 139, 47, 0.1);
}

.ra-completion-validation {
  margin: 0.8rem 0 0;
  padding: 0.72rem 0.78rem;
  border: 1px solid var(--item-border);
  border-radius: 12px;
  background: var(--surface-card);
  color: var(--text-primary);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.ra-completion-validation.is-blocked {
  border-color: rgba(185, 48, 48, 0.38);
  background: rgba(185, 48, 48, 0.1);
  color: var(--error);
}

.ra-completion-validation.is-ready {
  border-color: rgba(47, 125, 75, 0.38);
  background: rgba(47, 125, 75, 0.1);
  color: var(--success);
}

.ra-completion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
  margin-top: 0.72rem;
}

.ra-completion-actions button {
  min-height: 44px;
  margin: 0;
}

#ra-proceed-signature {
  background: linear-gradient(135deg, #3f6f5b, #2f7d4b);
  border-color: rgba(47, 125, 75, 0.35);
}

.report-queue-card.is-risk-assessment {
  border-color: rgba(49, 132, 155, 0.46);
  box-shadow: inset 4px 0 0 rgba(49, 132, 155, 0.72), var(--shadow-card);
}

.report-ra-output-note {
  margin: 0.72rem 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.ra-review-note {
  margin: 0.8rem 0 0;
  color: var(--text-muted);
  font-weight: 600;
}

@media (min-width: 760px) {
  .ra-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-nav__theme-toggle.theme-selector {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.22rem;
    padding: 0.24rem;
  }

  .app-nav__theme-toggle.theme-selector::before {
    display: none;
  }

  .app-nav__theme-toggle .theme-selector__option {
    width: 100%;
    min-height: 28px;
    padding-inline: 0.36rem;
    font-size: 0.72rem;
  }

  .ra-progress-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .ra-hazard-workspace {
    grid-template-columns: minmax(180px, 0.34fr) minmax(0, 1fr);
    align-items: start;
  }

  .ra-hazard-jump {
    display: none;
  }

  .ra-hazard-index {
    position: sticky;
    top: calc(var(--app-nav-height) + 0.75rem);
    display: grid;
    gap: 0.45rem;
    max-height: min(70vh, 620px);
    overflow: auto;
  }

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

  .ra-review-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .ra-progress-summary {
    grid-template-columns: 1fr;
  }

  .ra-hazard-card__actions {
    justify-content: flex-start;
  }

  .ra-hazard-sticky-bar {
    gap: 0.32rem;
    padding: 0.42rem;
  }

  .ra-hazard-sticky-bar button {
    padding-inline: 0.28rem;
    font-size: 0.72rem;
    line-height: 1.15;
  }
}

.issue-command-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.9fr);
  gap: 0.85rem;
  align-items: center;
  margin-bottom: 0.9rem;
  padding: 1rem;
  border: 1px solid rgba(33, 132, 155, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.96), rgba(237,249,252,0.82)),
    var(--surface-raised);
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
}

.issue-command-panel h4 {
  margin: 0.14rem 0 0;
  color: var(--text-heading);
  font-size: clamp(1.18rem, 1.8vw, 1.55rem);
}

.issue-command-panel p {
  margin-top: 0.35rem;
  color: var(--text-muted);
  font-weight: 500;
}

.issue-command-panel .runner-kicker {
  color: var(--accent);
}

.issue-command-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.issue-command-metric {
  min-height: 72px;
  padding: 0.58rem;
  border: 1px solid rgba(0, 158, 195, 0.18);
  border-radius: 13px;
  background: rgba(255,255,255,0.66);
}

.issue-command-metric span {
  display: block;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.issue-command-metric strong {
  display: block;
  margin-top: 0.22rem;
  color: var(--text-heading);
  font-size: 1.45rem;
  line-height: 1;
}

.issue-command-metric.is-blocked {
  border-color: rgba(255, 190, 82, 0.42);
  background: rgba(192, 139, 47, 0.18);
}

.review-card .review-answer {
  font-weight: 700;
}

.review-card .review-answer.issue {
  color: var(--error);
}

.issue-review-card {
  border-left: 6px solid var(--warning);
  padding: clamp(0.95rem, 1.6vw, 1.2rem);
  overflow: hidden;
}

.issue-review-card.issue-review-card-warning {
  border-left-color: var(--error);
  box-shadow: inset 0 0 0 1px rgba(185, 48, 48, 0.16);
}

.issue-review-chipline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  margin: 0.55rem 0 0.65rem;
}

.issue-mini-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0.2rem 0.58rem;
  border: 1px solid var(--item-border);
  border-radius: 999px;
  background: var(--surface-card);
  color: var(--text-heading);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.issue-mini-chip.is-complete,
.issue-mini-chip.is-action-set,
.issue-mini-chip.is-severity-standard-comment,
.issue-mini-chip.is-severity-low {
  border-color: rgba(47, 125, 75, 0.42);
  background: rgba(47, 125, 75, 0.12);
  color: var(--success);
}

.issue-mini-chip.is-severity-medium {
  border-color: rgba(192, 139, 47, 0.52);
  background: rgba(192, 139, 47, 0.16);
  color: #7b5b00;
}

.issue-mini-chip.is-severity-high,
.issue-mini-chip.is-severity-critical,
.issue-mini-chip.is-blocked {
  border-color: rgba(185, 48, 48, 0.42);
  background: rgba(185, 48, 48, 0.12);
  color: var(--error);
}

.issue-mini-chip.is-muted {
  opacity: 0.88;
}

.issue-review-label {
  display: block;
  margin: 0.55rem 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-heading);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.issue-review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.55rem;
}

.issue-review-head h4 {
  margin: 0.1rem 0 0;
  color: var(--text-primary);
  font-size: clamp(1rem, 1.4vw, 1.22rem);
  line-height: 1.25;
}

.issue-review-input {
  width: 100%;
  min-height: 104px;
  padding: 0.78rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--input-bg);
  color: var(--text-primary);
  resize: vertical;
}

.issue-review-warning-list {
  margin-top: 0.55rem;
  display: grid;
  gap: 0.35rem;
}

.issue-review-warning {
  margin: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(185, 48, 48, 0.26);
  border-radius: 11px;
  background: rgba(185, 48, 48, 0.08);
  color: var(--error);
  font-weight: 600;
}

.issue-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.issue-review-actions button {
  margin: 0;
  flex: 1 1 150px;
  min-height: 44px;
}

.issue-guidance-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(33, 132, 155, 0.18);
  border-radius: 15px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
}

.issue-guidance-panel strong {
  color: var(--text-heading);
}

.issue-guidance-panel span {
  color: var(--text-secondary);
  font-weight: 600;
}

.issue-guidance-panel.has-blockers {
  border-color: rgba(185, 48, 48, 0.28);
  background: rgba(185, 48, 48, 0.06);
}

.issue-meta-toggle.is-active {
  border-color: rgba(192, 139, 47, 0.55);
  background: rgba(192, 139, 47, 0.12);
}

button.is-disabled,
button[aria-disabled="true"] {
  opacity: 0.72;
}

.final-status-card {
  border-left: 4px solid var(--warning);
}

.final-status-card.is-ready {
  border-left-color: var(--success);
  box-shadow: inset 0 0 0 1px rgba(47, 125, 75, 0.2), var(--shadow-soft);
}

.final-status-card.is-blocked {
  border-left-color: var(--error);
  box-shadow: inset 0 0 0 1px rgba(185, 48, 48, 0.24), var(--shadow-soft);
}

.final-readiness-panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.26), rgba(255,255,255,0.05)),
    var(--surface-raised);
}

.final-readiness-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}

.final-readiness-badge {
  border-radius: 999px;
  padding: 0.28rem 0.62rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.final-readiness-badge.ready {
  background: rgba(47, 125, 75, 0.15);
  color: var(--success);
  border: 1px solid rgba(47, 125, 75, 0.45);
}

.final-readiness-badge.blocked {
  background: rgba(185, 48, 48, 0.14);
  color: var(--error);
  border: 1px solid rgba(185, 48, 48, 0.5);
}

.final-readiness-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.55rem;
}

.final-metric {
  border: 1px solid var(--item-border);
  border-radius: 12px;
  background: rgba(255,255,255,0.64);
  padding: 0.6rem 0.65rem;
}

.final-metric-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-heading);
  font-weight: 600;
}

.section-review-card.is-blocked {
  border-left: 4px solid var(--error);
}

.section-review-card.is-ready {
  border-left: 4px solid var(--success);
}

.final-section-group {
  margin-bottom: 0.9rem;
}

.final-summary-disclosure {
  border: 1px solid var(--item-border);
  border-radius: 16px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.final-summary-disclosure summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-heading);
}

.final-summary-disclosure summary::-webkit-details-marker {
  display: none;
}

.final-summary-disclosure[open] summary {
  border-bottom: 1px solid var(--item-border);
}

.final-summary-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(76, 85, 96, 0.12);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 700;
}

.final-summary-panel {
  padding: 0.9rem 0.9rem 0.15rem;
}

.final-section-group-action summary {
  color: var(--error);
}

.final-section-group-ready summary {
  color: var(--success);
}

.final-status-text {
  margin-top: 0.55rem;
  font-weight: 700;
}

.final-status-text.ready {
  color: var(--success);
}

.final-status-text.blocked {
  color: var(--error);
}

.final-blocker-list,
.final-details-grid,
.section-review-card__metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.final-blocker-list span,
.final-details-grid span,
.section-review-card__metrics span {
  padding: 0.58rem 0.65rem;
  border: 1px solid var(--item-border);
  border-radius: 12px;
  background: rgba(255,255,255,0.55);
  color: var(--text-heading);
  font-size: 0.84rem;
  font-weight: 600;
}

.final-details-grid strong,
.section-review-card__metrics strong {
  display: block;
  margin-top: 0.16rem;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.section-review-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.section-review-card__top h4 {
  margin: 0.08rem 0 0;
  color: var(--text-primary);
}

.empty-review-strong {
  padding: 1.2rem;
  border-radius: 16px;
  background: rgba(47, 125, 75, 0.1);
  border: 1px solid rgba(47, 125, 75, 0.28);
  font-weight: 600;
}

#final-save-draft {
  background: var(--warning);
  color: var(--text-primary);
}

#final-save-draft:hover {
  background: #D4A017;
  color: var(--text-inverse);
}

.final-checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.62rem;
  margin-top: 0.8rem;
}

.final-check-item {
  display: grid;
  gap: 0.32rem;
  padding: 0.72rem 0.75rem;
  border: 1px solid var(--item-border);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.55);
}

.final-check-item > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
}

.final-check-item span {
  color: var(--text-heading);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.final-check-item strong {
  color: var(--text-primary);
  font-size: 0.9rem;
  text-align: right;
}

.final-check-item p {
  color: var(--text-heading);
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.35;
}

.final-check-item.is-ready {
  border-color: rgba(47, 125, 75, 0.38);
  background: rgba(47, 125, 75, 0.1);
}

.final-check-item.is-blocked {
  border-color: rgba(185, 48, 48, 0.36);
  background: rgba(185, 48, 48, 0.08);
}

.final-decision-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.85rem;
  padding: 0.78rem 0.85rem;
  border: 1px solid var(--item-border);
  border-radius: 14px;
  background: var(--surface-card);
}

.final-decision-panel strong {
  color: var(--text-primary);
}

.final-decision-panel span {
  color: var(--text-heading);
  font-size: 0.88rem;
  font-weight: 600;
}

.final-decision-panel.is-ready {
  border-color: rgba(47, 125, 75, 0.38);
  background: rgba(47, 125, 75, 0.1);
}

.final-decision-panel.is-blocked {
  border-color: rgba(185, 48, 48, 0.36);
  background: rgba(185, 48, 48, 0.08);
}

.final-details-card {
  border-left: 4px solid var(--warning);
}

.final-details-card.is-ready {
  border-left-color: var(--success);
}

.final-details-card.is-blocked {
  border-left-color: var(--error);
}

.final-details-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.final-details-card-head h4 {
  margin: 0;
}

.final-details-grid span.is-ready {
  border-color: rgba(47, 125, 75, 0.32);
}

.final-details-grid span.is-blocked {
  border-color: rgba(185, 48, 48, 0.38);
  background: rgba(185, 48, 48, 0.08);
}

#final-proceed-signature.is-disabled,
#final-proceed-signature[aria-disabled="true"] {
  opacity: 0.68;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .modal {
    align-items: flex-start;
    padding: 0.5rem;
  }

  .modal-content,
  .checklist-intro-content {
    width: min(92vw, 720px);
    max-height: 84vh;
    padding: 0.75rem;
  }

  .backup-import-summary-grid {
    grid-template-columns: 1fr;
  }

  .backup-import-result-grid {
    grid-template-columns: 1fr;
  }

  .checklist-intro-header {
    align-items: stretch;
    flex-direction: column;
  }

  .checklist-intro-header .runner-nav-button {
    align-self: flex-start;
    min-height: 40px;
  }

  .final-decision-panel,
  .final-details-card-head,
  .final-check-item > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .final-check-item strong {
    text-align: left;
  }
}

.empty-review {
  border: 1px dashed var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  color: var(--text-primary);
}

/* =======================
   15. FOOTER
   ======================= */
.footer-logo {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  margin: 10px auto 2px;
  display: block;
  object-fit: cover;
}

.footer-text {
  color: var(--footer-text);
  font-size: 0.9rem;
  text-align: center;
  margin: 5px 0;
}

/* =======================
   16. RESPONSIVE DESIGN
   ======================= */
@media (max-width: 600px) {
  :root {
    --app-nav-height: 58px;
  }

  .container { padding: 0.5rem; border-radius: 0; }

  body {
    padding-bottom: calc(var(--app-nav-height) + 0.55rem);
  }

  .app-header {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    gap: 0.65rem;
    text-align: left;
    position: relative;
    padding: 0.68rem 4.15rem 0.68rem 0.75rem;
  }
  .app-header__brand {
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    gap: 0.62rem;
  }
  .header-logo {
    width: 50px;
    height: 50px;
    border-radius: 11px;
  }
  button { width: 100%; margin: 0.38rem 0; } /* Updated: Consistent margin */

  .header-title .main-title {
    font-size: clamp(1rem, 5.2vw, 1.34rem);
    letter-spacing: 0.04em;
    white-space: nowrap;
  }

  .header-subtitle {
    font-size: 0.68rem;
    letter-spacing: 0.03em;
    white-space: nowrap;
  }

  .header-theme-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    width: auto !important;
    min-height: 34px;
    margin: 0 !important;
    padding: 0.36rem 0.64rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: none;
  }

  .app-nav__theme-toggle {
    display: none;
  }

  .loaded-checksheet-banner {
    gap: 0.28rem;
    padding: 0.48rem 0.75rem;
  }

  .loaded-checksheet-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .loaded-checksheet-banner__label {
    font-size: 0.66rem;
    letter-spacing: 0.04em;
  }

  .loaded-checksheet-banner__title {
    font-size: 0.95rem;
    text-align: left;
  }

  .loaded-checksheet-banner__main {
    align-items: flex-start;
    flex-direction: column;
    width: 100%;
  }

  .loaded-checksheet-banner__intro {
    width: auto;
    margin: 0;
    min-height: 40px;
    padding: 0.42rem 0.64rem;
    font-size: 0.72rem;
  }

  .report-dashboard-tile {
    margin: 0;
  }

  .report-primary-actions {
    grid-template-columns: 1fr;
  }

  .report-more-actions summary,
  .report-filter-strip summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .runner-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.34rem;
    margin-bottom: 0.18rem;
  }
  .runner-summary-item {
    padding: 0.4rem 0.42rem;
    border-radius: 10px;
  }
  .runner-summary-label {
    font-size: 0.62rem;
    letter-spacing: 0.02em;
  }
  .runner-summary-item strong {
    font-size: 0.92rem;
  }
  .runner-autosave-status {
    margin-bottom: 0.42rem;
    font-size: 0.72rem;
  }
  .runner-dashboard {
    grid-template-columns: 1fr;
    gap: 0.42rem;
    margin-bottom: 0.45rem;
  }
  .runner-dashboard__hero {
    align-items: center;
    gap: 0.58rem;
    padding: 0.55rem;
    border-radius: 13px;
  }
  .runner-readiness-ring {
    width: 48px;
    height: 48px;
  }
  .runner-readiness-ring span {
    font-size: 0.82rem;
  }
  .runner-dashboard__copy strong {
    margin-top: 0.08rem;
    font-size: 1rem;
  }
  .runner-dashboard__copy p {
    margin-top: 0.18rem;
    font-size: 0.82rem;
    line-height: 1.32;
  }
  .runner-kicker {
    font-size: 0.68rem;
    letter-spacing: 0.04em;
  }
  .runner-dashboard__sections {
    grid-template-columns: 1fr;
    max-height: 140px;
    padding: 0.42rem;
    border-radius: 13px;
  }
  .runner-dashboard__sections:has(.runner-section-readiness.is-empty) {
    display: none;
  }
  .runner-stagebar {
    margin-bottom: 0.36rem;
  }
  .runner-progressbar {
    display: flex;
    gap: 0.32rem;
    align-items: center;
    overflow-x: auto;
    padding: 0.24rem;
    border: 1px solid var(--item-border);
    border-radius: 999px;
    background: var(--surface-card);
    scrollbar-width: none;
  }
  .runner-progressbar::-webkit-scrollbar {
    display: none;
  }
  .runner-progressbar::before {
    display: none;
  }
  .runner-progress-step {
    flex: 1 0 66px;
    min-height: 24px;
    flex-direction: row;
    justify-content: center;
    gap: 0.28rem;
    padding: 0.2rem 0.3rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
  }
  .runner-progress-dot {
    width: 8px;
    height: 8px;
    border-width: 0;
    box-shadow: none;
  }
  .runner-progress-label {
    font-size: 0.58rem;
    letter-spacing: 0;
    line-height: 1;
    white-space: nowrap;
  }
  .runner-progress-step.active {
    border-color: rgba(49, 132, 155, 0.28);
    background: rgba(49, 132, 155, 0.1);
  }
  .runner-progress-step.complete {
    border-color: rgba(47, 125, 75, 0.22);
    background: rgba(47, 125, 75, 0.08);
  }
  .runner-mobile-header { top: 34px; }
  .runner-mobile-stats { grid-template-columns: repeat(3, 1fr); }
  .runner-actions-desktop { display: none; }
  .runner-panel[data-stage-panel="section"] { padding-bottom: 5.5rem; }
  .runner-drawer-panel { width: 100%; }
  fieldset { padding: 0.72rem; }
  form > fieldset button { font-size: 0.94rem; }
  .theme-toggle, .delete-report {
    width: auto !important;
    margin: 0.5rem;
  }

  .header-theme-toggle {
    display: inline-flex !important;
    margin: 0 !important;
  }

  .app-nav__theme-toggle {
    display: none !important;
  }

  #stage-setup-panel {
    gap: 0.42rem;
  }

  #stage-setup-panel .input-group {
    padding: 0.56rem 0.62rem;
    border-radius: 12px;
  }

  #stage-setup-panel .input-group label {
    margin-bottom: 0.24rem;
    font-size: 0.7rem;
    letter-spacing: 0.03em;
  }

  .selected-checklist-preview {
    margin-top: 0.32rem;
    font-size: 0.78rem;
    line-height: 1.25;
  }

  .input,
  .select,
  textarea {
    min-height: 42px;
    padding: 0.48rem 0.58rem;
    border-radius: 10px;
    font-size: 0.9rem;
  }

  .runner-actions {
    margin-top: 0.1rem;
  }

  .runner-actions button,
  #start-runner {
    min-height: 42px;
    padding: 0.52rem 0.68rem;
    font-size: 0.88rem;
  }

  .app-nav {
    left: 0.2rem;
    right: 0.2rem;
    bottom: calc(0.35rem + env(safe-area-inset-bottom, 0px));
    gap: 0.08rem;
    padding: 0.14rem;
    border-radius: 14px;
  }

  .app-nav__item {
    min-height: 48px;
    gap: 0.14rem;
    padding: 0.24rem 0.1rem;
    border-radius: 11px;
  }

  .app-nav__icon {
    width: 1.44rem;
    height: 1.44rem;
    border-radius: 0.5rem;
  }

  .app-nav__icon svg {
    width: 0.92rem;
    height: 0.92rem;
  }

  .app-nav__label {
    font-size: 0.53rem;
  }

  .app-nav__theme-toggle {
    min-height: 48px;
    padding: 0.24rem 0.1rem;
    border-radius: 11px;
    font-size: 0.72rem;
  }

  .report-queue-card {
    flex-direction: column;
    align-items: stretch;
  }

  .risk-assessment-panel {
    gap: 0.62rem;
  }

  .ra-section-card,
  .ra-hazard-card,
  .ra-detail-block,
  .ra-detail-action-card,
  .ra-detail-hazard-card {
    border-radius: 10px;
  }

  .ra-section-card,
  .ra-hazard-card {
    padding: 0.68rem;
  }

  .ra-section-head,
  .ra-hazard-card__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
  }

  .ra-section-kicker {
    text-align: left;
  }

  .ra-status-pill,
  .ra-remove-button {
    width: 100%;
    min-height: 40px;
  }

  .ra-textarea {
    min-height: 104px;
    padding: 0.62rem;
    border-radius: 10px;
  }

  .ra-readonly-panel {
    padding: 0.62rem;
    border-radius: 10px;
  }

  .ra-section-actions,
  .ra-completion-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .ra-section-actions .runner-nav-button,
  .ra-completion-actions button {
    width: 100%;
    min-height: 44px;
  }

  .ra-review-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ra-review-metric {
    min-height: 68px;
    padding: 0.55rem;
  }

  .report-queue-card.is-risk-assessment .report-card-actions {
    grid-template-columns: 1fr;
  }

  .report-queue-meta-grid {
    grid-template-columns: 1fr;
  }

  .report-card-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .report-card-actions {
    width: 100%;
    align-self: stretch;
  }

  .card-action-button {
    width: 100%;
  }

  .report-detail-summary-grid {
    grid-template-columns: 1fr;
  }

  .ra-detail-summary-grid,
  .ra-detail-field-grid,
  .ra-closeout-summary,
  .ra-action-closeout-grid {
    grid-template-columns: 1fr;
  }

  .ra-detail-block,
  .ra-detail-field,
  .ra-action-closeout-panel {
    padding: 0.62rem;
  }

  .ra-detail-action-card .ra-detail-field-grid,
  .ra-detail-hazard-card .ra-detail-field-grid {
    padding: 0.62rem;
  }

  .ra-action-closeout-panel {
    margin: 0 0.62rem 0.62rem;
  }

  .ra-action-closeout-save {
    width: 100%;
    min-height: 44px;
  }

  .ra-detail-signature img {
    width: 100%;
    max-width: 220px;
  }

  .report-detail-header {
    flex-direction: column;
    align-items: stretch;
  }

  .report-detail-section-top,
  .report-detail-issue-top,
  .ra-detail-signature,
  .ra-detail-action-title,
  .ra-action-closeout-panel__head,
  .ra-detail-action-head,
  .ra-detail-hazard-head,
  .report-closeout-panel__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .report-closeout-grid {
    grid-template-columns: 1fr;
  }

  .report-closeout-save {
    width: 100%;
  }

  .report-closeout-evidence__top,
  .report-closeout-evidence__actions {
    flex-direction: column;
  }

  .report-closeout-evidence__gallery {
    grid-template-columns: 1fr;
  }

  .report-closeout-evidence__preview {
    max-width: 100%;
  }

  .report-queue-card .delete-report {
    margin-left: 0;
    width: 100%;
  }
  .answer-segmented { gap: 0.34rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .answer-chip { min-height: 40px; padding: 0.34rem 0.24rem; font-size: 0.9rem; }
  .answer-chip span { font-size: 0.9rem; }
  .answer-chip small { font-size: 0.56rem; }
  .checklist-item {
    padding: 0.58rem;
    border-radius: 12px;
  }
  .checklist-item-head {
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.62rem;
  }
  .checklist-item-statuses {
    align-items: flex-start;
  }
  .item-status {
    align-self: flex-start;
  }
  .task-description {
    font-size: 0.9rem;
    line-height: 1.28;
  }
  .question-evidence,
  .comments-container {
    padding: 0.55rem;
  }

  .question-evidence__top,
  .question-evidence__actions {
    flex-direction: column;
  }

  .question-evidence__upload {
    width: 100%;
  }

  .question-evidence__preview {
    max-width: 100%;
  }
  .comments-input {
    min-height: 74px;
    font-size: 0.9rem;
  }
  .issue-meta-grid,
  .issue-review-meta-grid {
    grid-template-columns: 1fr;
  }
  .issue-status-badge {
    min-width: 0;
    font-size: 0.65rem;
  }
  .section-guidance-banner {
    padding: 0.62rem 0.62rem;
  }
  .section-guidance-text {
    font-size: 0.82rem;
    line-height: 1.35;
  }
  .section-guidance-actions .runner-nav-button {
    width: auto;
    margin: 0;
  }
  .runner-sticky-footer {
    grid-template-columns: 1fr 1fr 1fr 1.15fr;
  }

  .control-grid {
    grid-template-columns: 1fr;
  }

  #inspection-tools-panel .control-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .report-dashboard-tiles {
    grid-template-columns: 1fr 1fr;
  }

  .control-subpanel-header,
  .control-accordion summary {
    flex-direction: column;
    align-items: flex-start;
  }
  .final-readiness-top {
    align-items: flex-start;
    flex-direction: column;
  }
  .final-readiness-metrics {
    grid-template-columns: 1fr;
  }
  .issue-command-panel {
    grid-template-columns: 1fr;
  }
  .issue-command-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .issue-review-head,
  .section-review-card__top {
    flex-direction: column;
  }

  .issue-review-chipline {
    display: grid;
    grid-template-columns: 1fr;
  }

  .issue-mini-chip {
    justify-content: flex-start;
    width: 100%;
    min-height: 34px;
  }
}

@media (min-width: 601px) {
  #stage-setup-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.62rem;
  }

  #stage-setup-panel .runner-actions {
    grid-column: 1 / -1;
  }

  .runner-mobile-header {
    top: 42px;
    padding: 1rem 1.1rem;
  }

  .runner-sticky-footer {
    display: none;
  }

  .runner-drawer-panel {
    top: 0;
    bottom: 0;
    border-radius: 20px 0 0 20px;
    box-shadow: -14px 0 28px rgba(0, 0, 0, 0.22);
  }

  .runner-drawer-list {
    max-height: calc(100vh - 92px);
  }

  form > fieldset {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    align-items: start;
  }

  form > fieldset legend {
    margin-bottom: 0.35rem;
  }

  form > fieldset button {
    width: 100%;
    margin: 0;
  }

  .control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-toolbar {
    grid-template-columns: 1.4fr 1fr;
    align-items: center;
  }
}

/* =======================
   17. QUESTION ATTACHMENTS
   ======================= */
.question-attachment-empty {
  margin: 0.62rem 0 0;
  padding: 0.62rem 0.7rem;
  border: 1px dashed rgba(76, 85, 96, 0.24);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.42);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.35;
}

.question-attachment-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.62rem;
}

.question-attachment-item {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.62rem 0.68rem;
  border: 1px solid rgba(76, 85, 96, 0.18);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.58);
}

.question-attachment-item__meta {
  min-width: 0;
  display: grid;
  gap: 0.18rem;
}

.question-attachment-item__meta strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text-primary);
  font-size: 0.84rem;
  line-height: 1.25;
}

.question-attachment-item__meta span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
}

.dark-theme .question-attachment-empty {
  border-color: rgba(73, 104, 119, 0.34);
  background: rgba(5, 13, 18, 0.62);
}

.dark-theme .question-attachment-item {
  border-color: rgba(73, 104, 119, 0.3);
  background: rgba(5, 13, 18, 0.82);
}

@media (max-width: 600px) {
  .question-attachment-item {
    align-items: stretch;
    flex-direction: column;
  }

  .question-attachment-item .question-evidence__remove {
    width: 100%;
    margin: 0;
  }
}

/* =======================
   17. QUESTION ATTACHMENTS
   ======================= */
.question-attachment-empty {
  margin: 0.62rem 0 0;
  padding: 0.62rem 0.7rem;
  border: 1px dashed rgba(76, 85, 96, 0.24);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.42);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.35;
}

.question-attachment-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.62rem;
}

.question-attachment-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.62rem 0.68rem;
  border: 1px solid rgba(76, 85, 96, 0.18);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.58);
}

.question-attachment-item__preview {
  width: 84px;
  margin: 0;
}

.question-attachment-item__preview img {
  display: block;
  width: 84px;
  height: 62px;
  border: 1px solid rgba(76, 85, 96, 0.22);
  border-radius: 8px;
  background: rgba(76, 85, 96, 0.08);
  object-fit: cover;
}

.question-attachment-item__preview figcaption {
  margin-top: 0.18rem;
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

.question-attachment-item__preview.is-unavailable::after {
  content: "Preview unavailable";
  display: block;
  margin-top: 0.18rem;
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

.question-attachment-item__preview.is-unavailable figcaption {
  display: none;
}

.question-attachment-item__file-icon {
  width: 58px;
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(33, 132, 155, 0.24);
  border-radius: 9px;
  background: rgba(33, 132, 155, 0.08);
  color: var(--text-heading);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.question-attachment-item__meta {
  min-width: 0;
  display: grid;
  gap: 0.18rem;
}

.question-attachment-item__meta strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text-primary);
  font-size: 0.84rem;
  line-height: 1.25;
}

.question-attachment-item__meta span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
}

.question-attachment-item__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.38rem;
}

.question-attachment-action {
  min-height: 32px;
  margin: 0;
  padding: 0.32rem 0.58rem;
  border: 1px solid rgba(33, 132, 155, 0.28);
  border-radius: 999px;
  background: rgba(33, 132, 155, 0.1);
  color: var(--text-heading);
  font-size: 0.74rem;
  font-weight: 700;
  box-shadow: none;
}

.question-attachment-item.is-unavailable {
  border-color: rgba(185, 48, 48, 0.4);
}

.question-attachment-unavailable {
  color: var(--error) !important;
  font-size: 0.72rem;
  font-weight: 700;
}

.dark-theme .question-attachment-empty {
  border-color: rgba(73, 104, 119, 0.34);
  background: rgba(5, 13, 18, 0.62);
}

.dark-theme .question-attachment-item {
  border-color: rgba(73, 104, 119, 0.3);
  background: rgba(5, 13, 18, 0.82);
}

.dark-theme .question-attachment-item__preview img {
  border-color: rgba(73, 104, 119, 0.36);
  background: rgba(5, 13, 18, 0.94);
}

@media (max-width: 760px) {
  .question-attachment-item {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .question-attachment-item__preview {
    width: 72px;
  }

  .question-attachment-item__preview img {
    width: 72px;
    height: 56px;
  }

  .question-attachment-item__actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .question-attachment-item__actions button {
    flex: 1 1 6rem;
    margin: 0;
  }
}

@media (max-width: 420px) {
  .question-attachment-item {
    grid-template-columns: 1fr;
  }

  .question-attachment-item__preview,
  .question-attachment-item__preview img {
    width: 100%;
  }

  .question-attachment-item__preview img {
    height: 150px;
  }

  .question-attachment-item__file-icon {
    width: 100%;
  }

  .question-attachment-item__actions {
    grid-column: auto;
    flex-direction: column;
  }

  .question-attachment-item__actions button {
    width: 100%;
  }
}

/* Toast container */
#toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  min-width: 200px;
  background-color: var(--bg-modal);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: 0.25rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Nightwatch theme component polish */
html[data-theme="nightwatch"] body {
  color-scheme: dark;
}

html[data-theme="nightwatch"] .app-header {
  background:
    linear-gradient(90deg, rgba(10, 12, 15, 0.98), rgba(26, 31, 36, 0.96)),
    #090b0e;
  border-bottom-color: rgba(200, 155, 44, 0.48);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.62);
}

html[data-theme="nightwatch"] .header-subtitle {
  color: #c89b2c;
}

html[data-theme="nightwatch"] .app-nav {
  background:
    linear-gradient(180deg, rgba(22, 27, 32, 0.98), rgba(8, 10, 13, 0.98)),
    #090b0e;
  border-color: rgba(70, 81, 92, 0.46);
  box-shadow: 18px 0 46px rgba(0, 0, 0, 0.58);
}

html[data-theme="nightwatch"] .app-nav__item {
  color: #d8dde1;
}

html[data-theme="nightwatch"] .app-nav__item:hover,
html[data-theme="nightwatch"] .app-nav__item:focus-visible {
  background: rgba(119, 129, 139, 0.14);
  border-color: rgba(119, 129, 139, 0.38);
  color: #ffffff;
}

html[data-theme="nightwatch"] .app-nav__item.is-active {
  background:
    linear-gradient(90deg, rgba(200, 155, 44, 0.18), rgba(119, 129, 139, 0.08)),
    rgba(18, 22, 27, 0.96);
  border-color: rgba(200, 155, 44, 0.48);
  box-shadow: inset 4px 0 0 #c89b2c, inset 0 0 0 1px rgba(255, 255, 255, 0.035);
  color: #ffffff;
}

html[data-theme="nightwatch"] .loaded-checksheet-banner,
html[data-theme="nightwatch"] .runner-sticky-footer,
html[data-theme="nightwatch"] .ra-hazard-sticky-bar {
  background: rgba(14, 18, 22, 0.94);
  border-color: rgba(70, 81, 92, 0.46);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.48);
}

html[data-theme="nightwatch"] .runner-panel,
html[data-theme="nightwatch"] .control-accordion,
html[data-theme="nightwatch"] .control-subpanel,
html[data-theme="nightwatch"] .report-more-actions,
html[data-theme="nightwatch"] #report-list,
html[data-theme="nightwatch"] #archive-list,
html[data-theme="nightwatch"] .report-status-card,
html[data-theme="nightwatch"] .report-cockpit-card,
html[data-theme="nightwatch"] .report-card-metric,
html[data-theme="nightwatch"] .report-queue-card,
html[data-theme="nightwatch"] .review-card,
html[data-theme="nightwatch"] .issue-command-panel,
html[data-theme="nightwatch"] .issue-review-card,
html[data-theme="nightwatch"] .final-summary-panel,
html[data-theme="nightwatch"] .final-decision-panel,
html[data-theme="nightwatch"] .final-details-card,
html[data-theme="nightwatch"] .ra-section-card,
html[data-theme="nightwatch"] .ra-hazard-card,
html[data-theme="nightwatch"] .report-detail-section-card,
html[data-theme="nightwatch"] .report-detail-issue-card,
html[data-theme="nightwatch"] .report-detail-block,
html[data-theme="nightwatch"] .ra-detail-action-card,
html[data-theme="nightwatch"] .ra-detail-hazard-card,
html[data-theme="nightwatch"] .builder-hero-card,
html[data-theme="nightwatch"] .builder-metadata-card,
html[data-theme="nightwatch"] .builder-section-card,
html[data-theme="nightwatch"] .builder-card,
html[data-theme="nightwatch"] .checklib-help-card,
html[data-theme="nightwatch"] .checklib-help-mini-card,
html[data-theme="nightwatch"] .checklib-help-embed,
html[data-theme="nightwatch"] .checklib-help-modal-panel,
html[data-theme="nightwatch"] .checklib-help-menu-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(0, 0, 0, 0.08)),
    var(--surface-card);
  border-color: rgba(70, 81, 92, 0.48);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

html[data-theme="nightwatch"] .ra-hazard-card.is-open,
html[data-theme="nightwatch"] .control-accordion[open],
html[data-theme="nightwatch"] .section-jump-card.is-active,
html[data-theme="nightwatch"] .runner-section-readiness.is-active {
  border-left-color: #c89b2c;
  box-shadow: var(--shadow-card), inset 3px 0 0 #c89b2c;
}

html[data-theme="nightwatch"] button,
html[data-theme="nightwatch"] .loaded-checksheet-banner__intro,
html[data-theme="nightwatch"] .useful-text-copy-button {
  border-color: rgba(119, 129, 139, 0.38);
}

html[data-theme="nightwatch"] button:not(.app-nav__item):not(.theme-selector__option):not(.delete-report):not(.modal-close):not(.ra-remove-button):not(.closeout-remove-button) {
  background: #c89b2c;
  color: #090b0e;
}

html[data-theme="nightwatch"] button:not(.app-nav__item):not(.theme-selector__option):not(.delete-report):not(.modal-close):not(.ra-remove-button):not(.closeout-remove-button):hover,
html[data-theme="nightwatch"] button:not(.app-nav__item):not(.theme-selector__option):not(.delete-report):not(.modal-close):not(.ra-remove-button):not(.closeout-remove-button):focus-visible {
  background: #e0b343;
  color: #090b0e;
}

html[data-theme="nightwatch"] .delete-report,
html[data-theme="nightwatch"] .ra-remove-button,
html[data-theme="nightwatch"] .closeout-remove-button {
  background: rgba(158, 56, 51, 0.14);
  border-color: rgba(211, 106, 99, 0.42);
  color: #f0a29d;
}

html[data-theme="nightwatch"] .input,
html[data-theme="nightwatch"] .select,
html[data-theme="nightwatch"] textarea,
html[data-theme="nightwatch"] .comments-input,
html[data-theme="nightwatch"] .issue-meta-input,
html[data-theme="nightwatch"] .issue-review-input,
html[data-theme="nightwatch"] .ra-textarea,
html[data-theme="nightwatch"] input[type="file"] {
  background-color: #0e1216;
  border-color: rgba(119, 129, 139, 0.46);
  color: #f2f4f5;
}

html[data-theme="nightwatch"] .input::placeholder,
html[data-theme="nightwatch"] .select::placeholder,
html[data-theme="nightwatch"] textarea::placeholder {
  color: #7f8993;
}

html[data-theme="nightwatch"] .input:focus,
html[data-theme="nightwatch"] .select:focus,
html[data-theme="nightwatch"] textarea:focus,
html[data-theme="nightwatch"] button:focus-visible,
html[data-theme="nightwatch"] a:focus-visible {
  outline: 3px solid rgba(224, 179, 67, 0.42);
  outline-offset: 2px;
  border-color: rgba(224, 179, 67, 0.62);
}

html[data-theme="nightwatch"] .input:disabled,
html[data-theme="nightwatch"] .select:disabled,
html[data-theme="nightwatch"] textarea:disabled,
html[data-theme="nightwatch"] button:disabled {
  opacity: 0.52;
  filter: grayscale(0.25);
}

html[data-theme="nightwatch"] input[type="date"] {
  color-scheme: dark;
}

html[data-theme="nightwatch"] .ra-control-applicability label:has(input[type="radio"]:checked) {
  border-color: rgba(224, 179, 67, 0.62);
  background: #c89b2c;
  color: #090b0e;
  box-shadow: inset 0 0 0 2px rgba(224, 179, 67, 0.18);
}

html[data-theme="nightwatch"] .ra-control-applicability {
  border-color: rgba(70, 81, 92, 0.52);
  background: rgba(8, 10, 13, 0.52);
}

html[data-theme="nightwatch"] .ra-control-applicability label {
  border-color: rgba(119, 129, 139, 0.38);
  background: rgba(18, 22, 27, 0.92);
}

html[data-theme="nightwatch"] .ra-control-applicability label:has(input[value="not_applicable"]:checked) {
  border-color: rgba(119, 129, 139, 0.56);
  background: rgba(70, 81, 92, 0.22);
  color: #d8dde1;
}

html[data-theme="nightwatch"] .ra-hazard-index__item.is-active {
  border-color: rgba(224, 179, 67, 0.58);
  box-shadow: inset 3px 0 0 #c89b2c, inset 0 0 0 1px rgba(224, 179, 67, 0.14);
}

html[data-theme="nightwatch"] .ra-status-pill.action,
html[data-theme="nightwatch"] .issue-status-badge.action,
html[data-theme="nightwatch"] .final-readiness-badge.blocked {
  background: rgba(200, 155, 44, 0.14);
  border-color: rgba(224, 179, 67, 0.46);
  color: #f0d38d;
}

html[data-theme="nightwatch"] table,
html[data-theme="nightwatch"] th,
html[data-theme="nightwatch"] td {
  border-color: rgba(70, 81, 92, 0.48);
}

html[data-theme="nightwatch"] th {
  background: rgba(32, 39, 47, 0.92);
  color: #f2f4f5;
}

html[data-theme="nightwatch"] .toast {
  border: 1px solid rgba(70, 81, 92, 0.48);
  background: #181e24;
  color: #f2f4f5;
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme="nightwatch"] *,
  html[data-theme="nightwatch"] *::before,
  html[data-theme="nightwatch"] *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
