/* One field layout for the six SHAREfire tools. Native records keep their controls. */
.sfw-active {
  --sfw-navy: #092744;
  --sfw-blue: #123e68;
  --sfw-ink: #102236;
  --sfw-muted: #53677e;
  --sfw-line: #d9e3ed;
  --sfw-wash: #edf3f9;
  --sfw-red: #c91932;
  width: min(100%, 1440px) !important;
  max-width: none !important;
  min-width: 0;
  padding-inline: clamp(14px, 3vw, 40px) !important;
  color: var(--sfw-ink);
  overflow-wrap: anywhere;
}
.sfw-active *,
.sfw-active *::before,
.sfw-active *::after {
  box-sizing: border-box;
}
.sfw-active .sfw-obsolete,
.sfw-active [data-sfw-off],
.sfw-active [hidden] {
  display: none !important;
}
.sfw-active .article-header {
  margin-bottom: 16px;
  padding: clamp(16px, 3vw, 28px) !important;
}
.sfw-active .article-header h1 {
  font-size: clamp(25px, 4vw, 40px) !important;
  line-height: 1.1 !important;
  margin-block: 8px !important;
}
.sfw-active .article-header .meta-row {
  display: none;
}
.sfw-workspace {
  border: 1px solid var(--sfw-line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  margin: 0 0 14px;
  scroll-margin-top: 115px;
}
.sfw-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px clamp(14px, 3vw, 24px);
  background: var(--sfw-navy);
  color: #fff;
}
.sfw-top span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #d3e2f2;
  margin-bottom: 4px;
}
.sfw-top h2 {
  font:
    700 clamp(19px, 3vw, 25px) / 1.2 Arial,
    sans-serif !important;
  color: white !important;
  margin: 0 !important;
}
.sfw-top a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 7px 12px;
  color: #fff;
  border: 1px solid #7693ad;
  border-radius: 7px;
  text-decoration: none;
  font-weight: 700;
}
.sfw-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(126px, 100%), 1fr));
  gap: 6px;
  padding: 10px;
  background: #f2f6fa;
}
.sfw-active .sfw-nav button,
.sfw-active .sfw-controls button,
.sfw-active .sfw-secondary {
  border: 1px solid #b4c6d8;
  background: #fff;
  color: var(--sfw-blue);
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 44px;
  font:
    700 14px/1.25 Arial,
    sans-serif;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  white-space: normal;
  box-shadow: none;
}
.sfw-active .sfw-nav button[aria-current='step'] {
  background: var(--sfw-blue);
  color: white;
  border-color: var(--sfw-blue);
}
.sfw-active .sfw-controls .sfw-primary {
  background: var(--sfw-red);
  border-color: var(--sfw-red);
  color: #fff;
}
.sfw-active .sfw-nav button:disabled,
.sfw-active .sfw-controls button:disabled {
  opacity: 0.5;
  cursor: default;
}
.sfw-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 17px;
}
.sfw-context h3,
.sfw-context p {
  margin: 0 !important;
}
.sfw-context h3 {
  font:
    700 19px/1.25 Arial,
    sans-serif !important;
  color: var(--sfw-blue) !important;
}
.sfw-context [data-sfw-step] {
  font-size: 12px;
  font-weight: 700;
  color: var(--sfw-muted);
  margin-bottom: 3px !important;
}
.sfw-context .sfw-save {
  font-size: 13px;
  color: var(--sfw-muted);
  max-width: 56ch !important;
}
.sfw-context .sfw-error {
  color: #a6172c;
  font-weight: 700;
}
.sfw-active .sf-trial-panel {
  background: white;
  border: 1px solid var(--sfw-line);
  border-radius: 11px;
  margin: 0 0 15px;
  padding: clamp(14px, 3vw, 24px);
}
.sfw-active .sf-trial-panel > h2,
.sfw-active .sf-trial-panel > p:not(.sf-trial-status) {
  display: none;
}
.sfw-active .sf-trial-status {
  padding: 10px 12px;
  margin: 12px 0 0;
  border-radius: 7px;
  background: var(--sfw-wash);
  font-size: 14px;
  line-height: 1.5;
}
.sfw-active .sf-trial-actions {
  align-items: stretch;
}
.sfw-active #sf-downloads {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sfw-review h3 {
  margin: 0;
  color: var(--sfw-blue);
}
.sfw-review [data-sfw-review] {
  font-weight: 700;
}
.sfw-evidence-note {
  font-size: 14px;
  color: var(--sfw-muted);
}
.sfw-active .single-form-viewer,
.sfw-active .paper-form {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  background: none !important;
  box-shadow: none !important;
  border: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}
.sfw-active .paper-section,
.sfw-active .paper-form > .form-meta-grid,
.sfw-active .paper-form > .form-control-grid,
.sfw-active .paper-form > .assessment-overview-grid,
.sfw-active .sf-evidence-summary,
.sfw-active .sf-assessment-preparation {
  background: #fff;
  border: 1px solid var(--sfw-line);
  border-radius: 11px;
  margin: 0 0 15px;
  padding: clamp(14px, 2.5vw, 24px);
  min-width: 0;
  scroll-margin-top: 110px;
}
.sfw-active .form-workspace-split,
.sfw-active .form-workspace-split > * {
  min-width: 0;
}
.sfw-active .paper-section h3 {
  font-size: clamp(17px, 3vw, 23px);
  line-height: 1.25;
  color: var(--sfw-blue);
}
.sfw-active .paper-form input:not([type='checkbox'], [type='radio'], [type='hidden']),
.sfw-active .paper-form select,
.sfw-active .paper-form textarea,
.sfw-active .sf-trial-fields input,
.sfw-active .sf-trial-fields select,
.sfw-active .fb-workspace input:not([type='checkbox'], [type='radio'], [type='hidden']),
.sfw-active .fb-workspace select,
.sfw-active .fb-workspace textarea {
  min-height: 44px;
  max-width: 100%;
  min-width: 0;
  font-size: 16px !important;
  border-radius: 7px;
}
.sfw-active .paper-form textarea {
  padding: 9px;
  resize: vertical;
  line-height: 1.45;
}
.sfw-active .paper-form input[type='file'] {
  max-width: 100%;
  min-width: 0;
}
.sfw-active .paper-form button,
.sfw-active .sf-trial-panel :is(button, a.button),
.sfw-active .fb-workspace button,
.sfw-active #fire-documents button {
  min-height: 44px;
  white-space: normal;
}
.sfw-active :is(button, a, input, textarea, select, summary):focus-visible {
  outline: 3px solid #2a80cb;
  outline-offset: 3px;
}
.sfw-active
  :is(.paper-section, .form-control, .linked-field, .sf-trial-fields, .sfw-media)
  :is(input, textarea, select) {
  scroll-margin-block: 115px 95px;
}
.sfw-active .table-wrap,
.sfw-active .fb-table-wrap {
  max-width: 100%;
  min-width: 0;
}
.sfw-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 6px 9px;
  border: 1px solid #bdccdb;
  border-radius: 7px;
  cursor: pointer;
  background: white;
  color: var(--sfw-blue);
  font-weight: 700;
  white-space: nowrap;
}
.sfw-active .sfw-option input[type='radio'] {
  margin: 0;
  accent-color: #123e68;
  width: 20px;
  height: 20px;
  flex: none;
}
.sfw-option:has(input:checked) {
  background: #e5eef8;
  border-color: var(--sfw-blue);
}
.sfw-follow-up {
  margin: 9px 0;
  border: 1px solid var(--sfw-line);
  border-radius: 8px;
  padding: 0 9px;
  background: #f4f7fa;
}
.sfw-follow-up summary {
  cursor: pointer;
  min-height: 44px;
  padding-block: 10px;
  color: var(--sfw-blue);
  font-weight: 700;
}
.sfw-follow-up div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(145px, 100%), 1fr));
  gap: 8px;
  padding-bottom: 10px;
}
.sfw-follow-up label {
  display: grid;
  gap: 5px;
  font-size: 14px;
}
.sfw-follow-up input {
  width: 100%;
  padding: 8px;
  border: 1px solid #aabed0;
}
.sfw-media-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sfw-media-buttons label {
  display: grid;
  gap: 4px;
  flex: 1 1 155px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--sfw-line);
  background: #fff;
  border-radius: 8px;
  color: var(--sfw-blue);
  font-weight: 700;
}
.sfw-media-buttons input {
  width: 100%;
  color: var(--sfw-ink);
}
.sfw-media-buttons ::file-selector-button {
  min-height: 36px;
  border: 1px solid #adc0d3;
  border-radius: 5px;
  color: var(--sfw-blue);
  background: #f0f5fa;
}
.sfw-photo-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(145px, 100%), 1fr));
  gap: 8px;
  margin-top: 8px;
}
.sfw-photo {
  margin: 0;
  padding: 8px;
  border: 1px solid var(--sfw-line);
  border-radius: 8px;
  overflow-wrap: anywhere;
}
.sfw-photo img {
  display: block;
  width: 100%;
  max-height: 190px;
  object-fit: contain;
  border-radius: 4px;
  background: #edf3f9;
}
.sfw-photo figcaption {
  font-size: 13px;
  margin-block: 6px;
}
.sfw-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px;
  background: #f5f8fb;
  border: 1px solid var(--sfw-line);
  border-radius: 9px;
  margin: 12px 0;
  position: sticky;
  bottom: 0;
  z-index: 5;
}
.sfw-progress {
  margin-right: auto;
  color: var(--sfw-muted);
  font-size: 13px;
  font-weight: 700;
}
.sfw-business-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.sfw-business :is(.fb-workspace, .paper-form, .fb-history, #fire-documents) {
  scroll-margin-top: 110px;
}
.sfw-business .fb-heading {
  background: var(--sfw-navy) !important;
}
.sfw-business .fb-workspace {
  border-radius: 11px;
  min-width: 0;
}
/* Wider workspaces retain tables. A tablet can work one test point at a time. */
@media (max-width: 1050px) {
  .sfw-active .sfw-cards,
  .sfw-active .sfw-cards tbody {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    table-layout: auto !important;
  }
  .sfw-active .sfw-cards thead {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .sfw-active .sfw-cards tr {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
    gap: 8px;
    padding: 12px;
    margin: 0 0 12px;
    border: 1px solid var(--sfw-line);
    border-radius: 9px;
    background: #f4f7fa;
  }
  .sfw-active .sfw-cards :is(td, th) {
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    border: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    text-align: left;
  }
  .sfw-active .sfw-cards td[data-sfw-label]::before {
    display: block;
    content: attr(data-sfw-label);
    color: var(--sfw-blue);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
  }
  .sfw-active
    .sfw-cards
    :is(td, th):has(textarea, .sfw-media, .fa-evidence, .action-create-control) {
    grid-column: 1/-1;
  }
  .sfw-active .sfw-cards .tick-cell:has(.sfw-option)::before {
    display: none;
  }
  .sfw-active .sfw-cards td:has(.sfw-option) {
    grid-column: auto;
  }
  .sfw-active :is([data-sfw-tool='drill'], [data-sfw-tool='hotworks']) .sfw-cards td:first-child {
    grid-column: 1/-1;
  }
  .sfw-active:is([data-sfw-tool='drill'], [data-sfw-tool='hotworks']) .sfw-cards tr {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .sfw-active:is([data-sfw-tool='drill'], [data-sfw-tool='hotworks']) .sfw-cards td:first-child {
    grid-column: 1/-1;
    font-weight: 700;
    color: var(--sfw-blue);
  }
  .sfw-active
    .sfw-cards
    td
    :is(input:not([type='radio'], [type='checkbox'], [type='file']), select, textarea) {
    width: 100% !important;
  }
  .sfw-active .sfw-cards td[contenteditable='true'] {
    min-height: 44px;
    padding: 9px !important;
    border: 1px solid #aabed0 !important;
    border-radius: 7px;
    background: #fff !important;
  }
  .sfw-active .sfw-cards .notes-cell,
  .sfw-active .sfw-cards [data-alarm-capture-controls] {
    min-width: 0;
  }
  .sfw-active .sfw-cards caption {
    display: block;
    text-align: left;
    font-weight: 700;
    margin-bottom: 6px;
  }
}
@media (max-width: 600px) {
  .sfw-active .article-header {
    margin-bottom: 12px;
  }
  .sfw-active .article-header .summary-answer {
    font-size: 14px !important;
    line-height: 1.5 !important;
  }
  .sfw-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .sfw-nav button {
    text-align: left;
  }
  .sfw-active .sf-trial-fields,
  .sfw-active .paper-form :is(.form-meta-grid, .form-control-grid, .form-signoff-grid),
  .sfw-active .fb-fields {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .sfw-active .paper-form :is(.form-control, .form-field-box) {
    grid-column: auto !important;
    min-width: 0;
  }
  .sfw-active .sfw-cards tr {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sfw-active .sfw-cards .sfw-option {
    padding-inline: 5px;
    gap: 4px;
    white-space: normal;
  }
  .sfw-active .sfw-cards .sfw-option input {
    width: 17px;
    height: 17px;
  }
  .sfw-controls {
    position: sticky;
    bottom: 0;
    bottom: env(safe-area-inset-bottom, 0px);
    padding: 7px;
    gap: 6px;
    justify-content: space-between;
  }
  .sfw-controls .sfw-progress {
    display: none;
  }
  .sfw-active .sfw-controls button {
    padding-inline: 9px;
  }
}
/* Keep the established registers in the same family without replacing their tabs. */
@media (max-width: 680px) {
  :is(#fire-door-app, #fire-extinguisher-app) .fd-topbar {
    padding: 14px;
  }
  :is(#fire-door-app, #fire-extinguisher-app) .fd-topbar > .fd-toolbar {
    width: 100%;
    gap: 7px;
  }
  :is(#fire-door-app, #fire-extinguisher-app) .fd-topbar button {
    flex: 1 1 100px;
    padding-inline: 8px;
  }
  :is(#fire-door-app, #fire-extinguisher-app) [role='tablist'] {
    scrollbar-width: thin;
    scroll-padding-inline: 12px;
  }
  :is(#fire-door-app, #fire-extinguisher-app) [role='tab'] {
    min-height: 44px;
    flex-shrink: 0;
  }
  :is(#fire-door-app, #fire-extinguisher-app) :is(input:not([type='file']), textarea, select) {
    font-size: 16px;
  }
}

.sfw-active .sfw-cards tr[data-sfw-check-off] {
  display: none !important;
}
.sfw-check-guide {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 9px 12px;
  margin: 0 0 10px;
  border: 1px solid var(--sfw-line);
  border-radius: 8px;
  background: var(--sfw-wash);
  color: var(--sfw-blue);
  scroll-margin-top: 120px;
  font-size: 14px;
}
.sfw-active:is([data-sfw-tool='drill'], [data-sfw-tool='hotworks'])
  .audit-voice
  [data-voice='record'],
.sfw-active .audit-voice small:empty {
  display: none !important;
}
.sfw-active .audit-voice {
  margin: 8px 0;
  line-height: 1.45;
}
.sfw-active .audit-voice-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.sfw-active :is(.audit-voice button, .audit-pen-entry button, .sfw-photo button) {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid #b4c6d8;
  border-radius: 7px;
  background: white;
  color: var(--sfw-blue);
  font:
    700 13px/1.3 Arial,
    sans-serif;
  cursor: pointer;
}
.sfw-active .audit-voice svg,
.sfw-active .audit-pen-entry svg,
.sfw-active .sfw-photo svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.sfw-active .audit-voice small {
  font-size: 12px;
  color: var(--sfw-muted);
}
.sfw-active .audit-pen-entry {
  margin: 7px 0;
}
body:has(.sfw-active) .audit-pen-dialog .audit-btn {
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid #b4c6d8;
  border-radius: 7px;
  background: white;
  color: #123e68;
  font-weight: 700;
}
body:has(.sfw-active) .audit-pen-dialog .audit-primary {
  background: #123e68;
  color: #fff;
}
body:has(.sfw-active) .audit-pen-dialog .audit-pen-head {
  padding-right: 48px;
}
@media (max-width: 1050px) {
  .sfw-active:is([data-sfw-tool='drill'], [data-sfw-tool='hotworks'])
    .sfw-cards
    td:first-child::before {
    display: none;
  }
}

.sfw-review-checks {
  list-style: none;
  padding: 0;
  margin: 12px 0;
  display: grid;
  gap: 7px;
}
.sfw-review-checks li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--sfw-line);
  border-radius: 7px;
  background: #f4f7fa;
}
.sfw-review-checks li span {
  flex: 1 1 200px;
}
.sfw-active .sf-fra-selection {
  font-size: 14px;
  color: var(--sfw-muted);
}
@media (max-width: 470px) {
  .sfw-top h2 {
    font-size: 19px !important;
  }
  .sfw-top a {
    min-height: 40px;
    font-size: 13px;
  }
  .sfw-check-guide {
    gap: 6px;
    padding: 7px;
  }
  .sfw-check-guide .sfw-secondary {
    font-size: 13px;
    padding-inline: 9px;
  }
}

.sfw-resources {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
  padding: 20px;
  border: 1px solid #d9e3ec;
  border-radius: 14px;
  background: #fff;
  color: #17344e;
}
.sfw-resources > div {
  flex: 1 1 270px;
}
.sfw-resources p {
  margin: 6px 0 0;
  font-size: 15px;
}
.sfw-resources a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.sfw-active #fire-documents {
  margin-top: 32px;
  scroll-margin-top: 24px;
}
.sfw-active #fire-documents > p,
.sfw-active #fire-documents > a {
  font-size: 16px;
}
@media (max-width: 600px) {
  .sfw-resources {
    padding: 16px;
  }
  .sfw-resources > a {
    width: 100%;
    justify-content: center;
  }
}

.sfw-evidence-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.sfw-evidence-downloads:empty {
  display: none;
}
.sfw-evidence-downloads p {
  flex-basis: 100%;
  margin: 8px 0;
}
.sfw-evidence-downloads a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border: 1px solid #b6c8d8;
  border-radius: 9px;
  text-decoration: none;
}

.sfw-review-confirm {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-height: 44px;
  padding: 16px;
  border: 1px solid #b6c8d8;
  border-radius: 10px;
  background: #f3f7fa;
  margin: 16px 0;
}
.sfw-review-confirm input {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  min-height: 22px;
  margin: 1px 0 0;
}
.sfw-review-confirm[hidden] {
  display: none;
}

.sfw-photo > .sfw-image-download,
.sfw-photo > [data-sfw-remove-photo] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 12px;
  margin: 6px;
  border: 1px solid #b6c8d8;
  border-radius: 8px;
  font-size: 14px;
  color: #123e68;
  background: #fff;
}
