/* PTW document form, fill workflow, lifecycle, and print layouts. */
/* Fill form (permit submission) */
.ptw-form-fill-page {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ptw-form-fill-shell {
  background: var(--swi-surface);
  border: 1px solid var(--swi-border);
  border-radius: 14px;
  box-shadow: var(--swi-shadow-sm);
  padding: 1.35rem 1.5rem;
}

/* Fill form hub/landing â€” see styles/ptw-form-fill-hub.css (imported via index.css). */

/* Result states */
.ptw-form-fill-result {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
  max-width: 640px;
}

.ptw-form-fill-result--success {
  border-color: color-mix(in srgb, #1a6b38 35%, var(--swi-border));
  background: color-mix(in srgb, #1a6b38 5%, var(--swi-surface));
}

.ptw-form-fill-result__icon {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a6b38;
  background: color-mix(in srgb, #1a6b38 12%, var(--swi-surface));
  border: 1px solid color-mix(in srgb, #1a6b38 25%, var(--swi-border));
}

.ptw-form-fill-result__icon--done {
  color: var(--portal-accent, var(--swi-accent));
  background: color-mix(in srgb, var(--portal-accent, var(--swi-accent)) 12%, var(--swi-surface));
  border-color: color-mix(in srgb, var(--portal-accent, var(--swi-accent)) 25%, var(--swi-border));
}

.ptw-form-fill-result__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--swi-text);
}

.ptw-form-fill-result__text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--swi-text-secondary);
}

.ptw-form-fill-setup__action {
  display: flex;
  align-items: flex-end;
}

.ptw-form-fill__placeholder {
  margin: 0;
  padding: 1.5rem;
  text-align: center;
}

.ptw-form-fill {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Technical section progress HUD */
.ptw-tech-progress {
  position: relative;
  overflow: hidden;
  padding: 1rem 1.15rem 1.1rem;
  border: 1px solid color-mix(in srgb, var(--portal-accent, #c41e2d) 28%, var(--swi-border));
  border-radius: 12px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--swi-surface) 92%, #0f141c) 0%, var(--swi-surface) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 28px rgba(12, 18, 28, 0.08);
}

.ptw-tech-progress__grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(120, 130, 150, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 130, 150, 0.08) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 88%);
}

.ptw-tech-progress__mono {
  font-family: "Consolas", "SFMono-Regular", "Liberation Mono", monospace;
  letter-spacing: 0.04em;
}

.ptw-tech-progress__sep {
  opacity: 0.45;
}

.ptw-tech-progress__header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.ptw-tech-progress__header-left {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
}

.ptw-tech-progress__pulse {
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  margin-top: 0.35rem;
  border-radius: 50%;
  background: var(--portal-accent, var(--swi-accent));
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--portal-accent, #c41e2d) 55%, transparent);
  animation: ptw-tech-pulse 2s ease-out infinite;
}

@keyframes ptw-tech-pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--portal-accent, #c41e2d) 50%, transparent);
  }

  70% {
    box-shadow: 0 0 0 10px transparent;
  }

  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

.ptw-tech-progress__kicker {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--swi-text-secondary);
}

.ptw-tech-progress__route {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--swi-text);
}

.ptw-tech-progress__header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.ptw-tech-progress__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.ptw-tech-progress__badge--live {
  color: #0d3d28;
  background: #b8f5d4;
  border: 1px solid #5fd39a;
}

.ptw-tech-progress__clock {
  padding: 0.25rem 0.45rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--swi-text);
  background: color-mix(in srgb, var(--swi-surface-muted) 80%, #0f141c);
  border: 1px solid var(--swi-border);
}

.ptw-tech-progress__steps {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 0 0 0.95rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 0.45rem;
}

.ptw-tech-progress__step {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--swi-border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--swi-surface-muted) 70%, transparent);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ptw-tech-progress__step--complete {
  border-color: color-mix(in srgb, #2f9d62 45%, var(--swi-border));
  background: color-mix(in srgb, #2f9d62 8%, var(--swi-surface-muted));
}

.ptw-tech-progress__step--active {
  border-color: color-mix(in srgb, var(--portal-accent, #c41e2d) 55%, var(--swi-border));
  background: color-mix(in srgb, var(--portal-accent, #c41e2d) 10%, var(--swi-surface));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--portal-accent, #c41e2d) 18%, transparent);
}

.ptw-tech-progress__step--cached {
  border-color: color-mix(in srgb, #3b82c4 45%, var(--swi-border));
  background: color-mix(in srgb, #3b82c4 8%, var(--swi-surface-muted));
}

.ptw-tech-progress__step--pending {
  opacity: 0.72;
}

.ptw-tech-progress__step-index {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--swi-text-secondary);
}

.ptw-tech-progress__step-body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.ptw-tech-progress__step-title {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--swi-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ptw-tech-progress__step-state {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--swi-text-secondary);
}

.ptw-tech-progress__step--active .ptw-tech-progress__step-state {
  color: var(--portal-accent, var(--swi-accent));
}

.ptw-tech-progress__step--complete .ptw-tech-progress__step-state {
  color: #2f9d62;
}

.ptw-tech-progress__step-node {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--swi-border);
  color: #2f9d62;
  background: var(--swi-surface);
}

.ptw-tech-progress__step--active .ptw-tech-progress__step-node {
  border-color: var(--portal-accent, var(--swi-accent));
  background: var(--portal-accent, var(--swi-accent));
  box-shadow: 0 0 10px color-mix(in srgb, var(--portal-accent, #c41e2d) 45%, transparent);
}

.ptw-tech-progress__step--pending .ptw-tech-progress__step-node,
.ptw-tech-progress__step--cached .ptw-tech-progress__step-node {
  background: transparent;
}

.ptw-tech-progress__rail-wrap {
  position: relative;
  z-index: 1;
}

.ptw-tech-progress__rail-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--swi-text-secondary);
}

.ptw-tech-progress__rail {
  position: relative;
  height: 14px;
  border-radius: 3px;
  border: 1px solid color-mix(in srgb, var(--swi-border-strong) 80%, #0f141c);
  background: color-mix(in srgb, var(--swi-surface-muted) 75%, #0f141c);
  overflow: hidden;
}

.ptw-tech-progress__rail-track {
  position: absolute;
  inset: 0;
}

.ptw-tech-progress__rail-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: color-mix(in srgb, var(--swi-text-secondary) 35%, transparent);
  transform: translateX(-50%);
}

.ptw-tech-progress__rail-fill {
  position: relative;
  height: 100%;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--portal-accent, #c41e2d) 85%, #000),
    var(--portal-accent, var(--swi-accent)),
    color-mix(in srgb, var(--portal-accent, #c41e2d) 65%, #fff)
  );
  box-shadow: 0 0 14px color-mix(in srgb, var(--portal-accent, #c41e2d) 35%, transparent);
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.ptw-tech-progress__rail-scan {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.35) 45%,
    transparent 90%
  );
  animation: ptw-tech-scan 2.4s linear infinite;
}

@keyframes ptw-tech-scan {
  0% {
    transform: translateX(-120%);
  }

  100% {
    transform: translateX(220%);
  }
}

.ptw-tech-progress__rail-head {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: #fff;
  border: 2px solid var(--portal-accent, var(--swi-accent));
  box-shadow: 0 0 8px color-mix(in srgb, var(--portal-accent, #c41e2d) 55%, transparent);
  transform: translateY(-50%);
  transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.ptw-tech-progress__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-top: 0.55rem;
}

.ptw-tech-progress__active-label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin: 0;
  min-width: 0;
}

.ptw-tech-progress__active-label .ptw-tech-progress__mono {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--swi-text-secondary);
}

.ptw-tech-progress__active-label strong {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--swi-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ptw-tech-progress__metrics {
  margin: 0;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--swi-text-secondary);
  white-space: nowrap;
}

@media (max-width: 720px) {
  .ptw-tech-progress__steps {
    grid-template-columns: 1fr;
  }

  .ptw-tech-progress__header {
    flex-direction: column;
  }

  .ptw-tech-progress__metrics {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ptw-tech-progress__pulse,
  .ptw-tech-progress__rail-scan {
    animation: none;
  }
}

.ptw-form-fill__header {
  padding: 0 0.15rem;
}

.ptw-form-fill__title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--swi-text);
}

.ptw-form-fill__desc {
  margin: 0 0 0.5rem;
  color: var(--swi-text-secondary);
  line-height: 1.5;
}

.ptw-form-fill__section {
  padding: 0;
  border: none;
  box-shadow: none;
  background: transparent;
}

.ptw-form-fill-shell.ptw-form-fill__section {
  padding: 1.35rem 1.5rem;
  background: var(--swi-surface);
  border: 1px solid var(--swi-border);
  border-radius: 14px;
  box-shadow: var(--swi-shadow-sm);
}

.ptw-form-fill__section-title {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--swi-text);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--swi-border);
}

.ptw-form-fill__questions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.ptw-form-fill__question-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.65rem;
}

.ptw-form-fill__question-text {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--swi-text);
  flex: 1;
  min-width: 0;
}

.ptw-fill-answer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ptw-fill-answer--yesno,
.ptw-fill-answer--options {
  flex-direction: column;
  gap: 0.55rem;
}

.ptw-fill-answer__note {
  margin: 0;
  font-size: 0.8125rem;
}

.ptw-form-fill__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.ptw-form-fill__footer-hint {
  margin: 0;
  max-width: 36ch;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--swi-text-secondary);
}

.ptw-form-fill-saved__list {
  margin-top: 0.75rem;
  max-height: 280px;
  overflow-y: auto;
}

.ptw-form-fill__progress {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.5rem 0;
}

.ptw-form-fill__progress-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--swi-text-secondary);
}

.ptw-form-fill__progress-done {
  font-size: 0.75rem;
  color: var(--swi-text-secondary);
  opacity: 0.85;
}

.ptw-risk-gateway {
  margin-bottom: 1.25rem;
}

.ptw-auth-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--swi-border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ptw-user-search {
  position: relative;
}

.ptw-user-search__input-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ptw-user-search__input {
  flex: 1;
}

.ptw-user-search__clear {
  flex-shrink: 0;
  min-width: 2rem;
  padding: 0.25rem 0.5rem;
}

.ptw-user-search__list-wrap {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  margin-top: 0.25rem;
  border: 1px solid var(--swi-border);
  border-radius: 8px;
  background: var(--swi-surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: min(280px, 40vh);
  overflow-y: auto;
}

.ptw-camera-selfie {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ptw-camera-selfie__viewport {
  position: relative;
  aspect-ratio: 4 / 3;
  max-width: 420px;
  border: 1px solid var(--swi-border);
  border-radius: 8px;
  overflow: hidden;
  background: #111;
}

.ptw-camera-selfie__video,
.ptw-camera-selfie__preview {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ptw-camera-selfie__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 0.875rem;
}

.ptw-camera-selfie__error {
  color: var(--swi-danger, #c0392b);
  margin: 0;
  font-size: 0.875rem;
}

.ptw-camera-selfie__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ptw-form-fill-result__validity {
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
  color: var(--swi-text-secondary);
}

.ptw-permits-detail__validity {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0.75rem 0;
  font-size: 0.875rem;
}

.ptw-expiry-warn-modal {
  max-width: 520px;
}

.ptw-expiry-warn-modal__actions {
  margin-top: 1.25rem;
  justify-content: flex-end;
}

.ptw-entry-warn-backdrop {
  z-index: 80;
  background: color-mix(in srgb, #0f141c 52%, transparent);
  backdrop-filter: blur(4px);
  animation: ptw-entry-warn-fade-in 0.18s ease-out;
}

.ptw-entry-warn-modal {
  position: relative;
  max-width: 440px;
  padding: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--portal-accent, #c41e2d) 22%, var(--swi-border));
  border-radius: 16px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 18px 48px rgba(12, 18, 28, 0.22);
  animation: ptw-entry-warn-rise 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.ptw-entry-warn-modal__accent {
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--portal-accent, #c41e2d) 0%,
    #e85d6b 55%,
    #f0a03a 100%
  );
}

.ptw-entry-warn-modal__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  margin: 1.35rem auto 0;
  border-radius: 999px;
  color: var(--portal-accent, #c41e2d);
  background:
    radial-gradient(
      circle at 50% 40%,
      color-mix(in srgb, var(--portal-accent, #c41e2d) 16%, transparent),
      transparent 70%
    ),
    color-mix(in srgb, var(--portal-accent, #c41e2d) 10%, var(--swi-surface));
  border: 1px solid color-mix(in srgb, var(--portal-accent, #c41e2d) 28%, var(--swi-border));
  box-shadow: 0 8px 20px color-mix(in srgb, var(--portal-accent, #c41e2d) 14%, transparent);
}

.ptw-entry-warn-modal__icon-svg {
  display: block;
}

.ptw-entry-warn-modal__head {
  padding: 0.9rem 1.5rem 0;
  text-align: center;
}

.ptw-entry-warn-modal__eyebrow {
  margin: 0 0 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--portal-accent, #c41e2d);
}

.ptw-entry-warn-modal__title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--swi-text);
  letter-spacing: -0.01em;
}

.ptw-entry-warn-modal__body {
  padding: 1rem 1.35rem 0;
}

.ptw-entry-warn-modal__message {
  margin: 0;
  padding: 0.95rem 1rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, #f0a03a 35%, var(--swi-border));
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, #f0a03a 12%, var(--swi-surface)) 0%,
      color-mix(in srgb, var(--portal-accent, #c41e2d) 6%, var(--swi-surface)) 100%
    );
  text-align: center;
  font-weight: 700;
  line-height: 1.5;
  font-size: 0.84rem;
  letter-spacing: 0.01em;
  color: var(--swi-text);
}

.ptw-entry-warn-modal__message p {
  margin: 0;
}

.ptw-entry-warn-modal__message p + p {
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px dashed color-mix(in srgb, #f0a03a 40%, var(--swi-border));
}

.ptw-entry-warn-modal__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  padding: 1.15rem 1.35rem 1.25rem;
  border-top: 1px solid var(--swi-border);
  background: color-mix(in srgb, var(--swi-surface-muted, #f4f5f7) 55%, var(--swi-surface));
}

.ptw-entry-warn-modal__cancel {
  min-width: 5.5rem;
}

.ptw-entry-warn-modal__confirm {
  min-width: 11.5rem;
  font-weight: 700;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--portal-accent, #c41e2d) 28%, transparent);
}

.ptw-entry-warn-modal__confirm:hover:not(:disabled) {
  box-shadow: 0 8px 20px color-mix(in srgb, var(--portal-accent, #c41e2d) 34%, transparent);
}

.ptw-entry-warn-modal__confirm:disabled,
.ptw-entry-warn-modal__cancel:disabled {
  opacity: 0.7;
  cursor: wait;
}

@keyframes ptw-entry-warn-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes ptw-entry-warn-rise {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ptw-entry-warn-backdrop,
  .ptw-entry-warn-modal {
    animation: none;
  }
}

@media (max-width: 480px) {
  .ptw-entry-warn-modal__actions {
    flex-direction: column-reverse;
  }

  .ptw-entry-warn-modal__cancel,
  .ptw-entry-warn-modal__confirm {
    width: 100%;
    min-width: 0;
  }
}

.ptw-lifecycle-form__declaration {
  margin: 0 0 1rem;
  line-height: 1.5;
}

.ptw-lifecycle-form__validity {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  color: var(--swi-text-secondary);
}

.ptw-doc-page .ptw-lifecycle-form__validity {
  color: #000;
  font-size: 0.8125rem;
  margin: 0 0 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #ccc;
}

.ptw-lifecycle-form__role {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--swi-border);
}

.ptw-signature-pad__canvas {
  display: block;
  width: 100%;
  border: 1px solid var(--swi-border);
  border-radius: 8px;
  background: #fff;
  touch-action: none;
  cursor: crosshair;
}

.ptw-signature-pad__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.ptw-form-fill-complete {
  padding: 1.25rem;
}

.ptw-form-fill-specialized__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.ptw-job-type-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0.65rem;
  margin-top: 1rem;
}

.ptw-job-type-picker__option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--swi-border, #d8dce3);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.ptw-job-type-picker__option input {
  flex-shrink: 0;
}

.ptw-job-type-picker__option.is-selected {
  border-color: var(--portal-accent, var(--swi-accent));
  background: color-mix(in srgb, var(--portal-accent, var(--swi-accent)) 8%, transparent);
}

.ptw-job-type-picker__label {
  font-weight: 600;
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .ptw-form-fill__footer {
    flex-direction: column;
    align-items: stretch;
  }

  .ptw-form-fill__footer .swi-btn {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .ptw-mgmt-form-grid {
    grid-template-columns: 1fr;
  }

  .ptw-mgmt-field--span2 {
    grid-column: span 1;
  }

  .ptw-mgmt-body {
    padding: 1rem;
  }
}

/* ----- PTW document form (index2.html layout) ----- */

.ptw-form-fill--document {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.ptw-form-fill-page.portal-page--document-full {
  max-width: none;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
  padding-left: clamp(0.5rem, 1vw, 1rem);
  padding-right: clamp(0.5rem, 1vw, 1rem);
}

.ptw-doc-wrap {
  --ptw-job-color: #ffff00;
  width: 100%;
  padding: 0;
  background: #fff;
}

.ptw-doc-page {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 0;
  margin: 0;
  background: #fff;
  padding: 0;
  border: 1px solid #000;
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
  box-sizing: border-box;
  overflow: hidden;
}

.ptw-doc-page__body {
  flex: 1 1 auto;
  min-width: 0;
  padding: 12px;
}

.ptw-doc-page__rail {
  flex: 0 0 18px;
  width: 18px;
  align-self: stretch;
  background: var(--ptw-job-color, #ffff00);
  pointer-events: none;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.ptw-doc-header {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) minmax(220px, 280px);
  grid-template-rows: minmax(70px, auto);
  align-items: stretch;
  background: var(--ptw-job-color, #ffff00);
  border: 2px solid #000;
}

.ptw-doc-header__hazard {
  background: repeating-linear-gradient(
    -80deg,
    #000 0 20px,
    var(--ptw-job-color, #ffff00) 20px 40px
  );
}

.ptw-doc-header__title {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  text-align: center;
  border-left: 2px solid #000;
  border-right: 2px solid #000;
  background: var(--ptw-job-color, #ffff00);
}

.ptw-doc-header__title h4 {
  margin: 0 0 6px;
  font-size: 14px;
}

.ptw-doc-header__title h3 {
  margin: 0;
  font-size: 18px;
}

.ptw-doc-header__permit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, 150px);
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: repeating-linear-gradient(
    -80deg,
    #000 0 20px,
    var(--ptw-job-color, #ffff00) 20px 40px
  );
}

.ptw-doc-header__permit > span {
  background: var(--ptw-job-color, #ffff00);
  padding: 8px;
  font-weight: 700;
  font-size: 13px;
}

.ptw-doc-header__permit-box {
  min-height: 30px;
  display: flex;
  align-items: center;
  padding: 4px 8px;
  background: #fff;
  border: 2px solid #000;
  font-size: 13px;
  font-weight: 700;
  word-break: break-all;
}

.ptw-doc-progress {
  margin-top: 8px;
  padding: 6px 8px;
  border: 1px solid #000;
  background: #fff;
}

.ptw-doc-progress__meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 4px;
}

.ptw-doc-progress__bar {
  height: 6px;
  background: #eee;
  border: 1px solid #000;
}

.ptw-doc-progress__fill {
  display: block;
  height: 100%;
  background: #000;
}

.ptw-doc-section {
  margin-top: 0;
}

.ptw-doc-job-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0;
}

.ptw-doc-job-table td {
  border: 2px solid #000;
  padding: 5px;
  vertical-align: top;
}

.ptw-doc-job-table__label {
  width: 180px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
}

.ptw-doc-job-table__sublabel {
  font-size: 11px;
  font-weight: 700;
}

.ptw-doc-job-table__work-info {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.ptw-doc-job-table--general {
  margin-top: 0;
}

.ptw-doc-job-table--general .ptw-doc-input--area {
  min-height: 28px;
}

/* Audit form section (WHO/DATE + action rows) */
.ptw-audit-section {
  margin-top: 0;
}

.ptw-audit-section__banner {
  border-top: 2px solid #000;
  margin-top: 0;
}

.ptw-audit-section__table {
  margin-top: 0;
}

.ptw-audit-section__table + .ptw-audit-section__table {
  margin-top: 0;
  border-top: none;
}

.ptw-audit-section__meta-cell {
  width: 50%;
  vertical-align: top;
}

.ptw-audit-section__inline-label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 4px;
  text-align: center;
}

.ptw-audit-section__actions thead th {
  border: 2px solid #000;
  padding: 5px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  vertical-align: middle;
}

.ptw-audit-section__col-action {
  width: 58%;
}

.ptw-audit-section__col-who {
  width: 21%;
}

.ptw-audit-section__col-when {
  width: 21%;
}

.ptw-audit-section--preview .ptw-preview-value {
  min-height: 28px;
}

/* Risk assessment matrix (5 columns) */
.ptw-risk-section {
  margin-top: 0;
}

.ptw-risk-section__banner {
  border-top: 2px solid #000;
  margin-top: 0;
}

.ptw-risk-section__table-wrap {
  overflow-x: auto;
  margin-top: 0;
}

.ptw-risk-section__table {
  margin-top: 0;
  min-width: 960px;
  table-layout: fixed;
}

.ptw-risk-section__head {
  border: 2px solid #000;
  padding: 5px;
  text-align: center;
  font-weight: 700;
  font-size: 11px;
  line-height: 1.25;
  vertical-align: middle;
}

.ptw-risk-section__table td {
  vertical-align: top;
  padding: 4px;
}

.ptw-risk-section__col-steps {
  width: 12%;
}

.ptw-risk-section__col-hazard {
  width: 22%;
}

.ptw-risk-section__col-harm {
  width: 26%;
}

.ptw-risk-section__col-controls {
  width: 26%;
}

.ptw-risk-section__col-implemented {
  width: 14%;
}

.ptw-risk-section__cell-input {
  min-height: 64px;
  resize: vertical;
  cursor: text;
}

.ptw-risk-section__cell-input:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  background: #f3f4f6;
}

.ptw-risk-section__empty-cell {
  min-height: 64px;
}

.ptw-risk-section__yesno {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 0;
}

.ptw-risk-section__yesno-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.ptw-risk-section--preview .ptw-preview-value {
  min-height: 48px;
  white-space: pre-wrap;
}

.ptw-risk-section__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-top: none;
  background: #f8fafc;
}

.ptw-risk-section__add-row {
  font-size: 13px;
  font-weight: 700;
  border: 1px dashed #94a3b8;
  background: #fff;
}

.ptw-risk-section__add-row:hover {
  border-color: var(--portal-accent, #c41e2d);
  color: var(--portal-accent, #c41e2d);
}

.ptw-risk-section__row-count,
.ptw-risk-section__row-limit {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.ptw-doc-input {
  width: 100%;
  border: none;
  min-height: 28px;
  outline: none;
  font: inherit;
  font-size: 13px;
  background: transparent;
  color: #000;
}

.ptw-doc-input--area {
  resize: vertical;
  min-height: 48px;
}

.ptw-doc-input--select {
  border: 1px solid #ccc;
  background: #fff;
  padding: 4px;
}

.ptw-doc-warning {
  margin: 0;
  text-align: center;
  font-weight: 700;
  padding: 10px 6px;
  line-height: 1.4;
  font-size: 14px;
  border-left: 2px solid #000;
  border-right: 2px solid #000;
}

.ptw-doc-checklist-gate {
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-left: 3px solid #64748b;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  line-height: 1.4;
}

.ptw-doc-checklist-gate--inline {
  margin: 0 0 8px;
}

.ptw-doc-section-title {
  background: var(--ptw-job-color, #ffff00);
  border: 2px solid #000;
  border-top: none;
  text-align: center;
  font-weight: 700;
  padding: 6px;
  font-size: 18px;
}

.ptw-doc-sheet-footer {
  margin-top: 8px;
  border: 2px solid #000;
  border-top: none;
  overflow: hidden;
}

.ptw-doc-sheet-footer__stripe {
  min-height: 28px;
  background: repeating-linear-gradient(
    -80deg,
    #000 0 20px,
    var(--ptw-job-color, #ffff00) 20px 40px
  );
}

.ptw-doc-question-table-wrap {
  width: 100%;
  overflow-x: hidden;
}

.ptw-doc-question-table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.ptw-doc-question-table__col-question {
  width: auto;
}

.ptw-doc-question-table__col-opt {
  width: 52px;
}

.ptw-doc-question-table th,
.ptw-doc-question-table td {
  border: 2px solid #000;
  padding: 5px 8px;
  font-size: 13px;
  vertical-align: middle;
}

.ptw-doc-question-table th {
  background: #fff;
  text-align: center;
  font-weight: 700;
}

.ptw-doc-question-table__heading {
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  white-space: normal;
}

.ptw-doc-question-table__question {
  text-align: left;
  white-space: nowrap;
  overflow: visible;
  font-weight: 400;
}

.ptw-doc-question-table tr.ptw-doc-question-table__row--no td {
  background: #fce8e8;
}

.ptw-doc-question-table tr.ptw-doc-question-table__row--no .ptw-doc-question-table__question--no {
  background: #f5caca;
  box-shadow: inset 4px 0 0 #b91c1c;
  color: #7f1d1d;
  font-weight: 500;
}

.ptw-doc-question-table th:nth-child(2),
.ptw-doc-question-table th:nth-child(3),
.ptw-doc-question-table th:nth-child(4) {
  width: 52px;
  min-width: 52px;
  max-width: 52px;
  padding: 4px 2px;
  font-size: 11px;
}

.ptw-doc-question-table__answer {
  padding: 5px 8px;
  vertical-align: middle;
}

.ptw-doc-check-cell-wrap {
  width: 52px;
  min-width: 52px;
  max-width: 52px;
  padding: 4px 2px;
  text-align: center;
  vertical-align: middle;
}

.ptw-doc-check-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 28px;
  padding: 4px 2px;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.ptw-doc-check-cell:hover:not(.ptw-doc-check-cell--selected) {
  background: #f8fafc;
}

.ptw-doc-check-cell:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}

.ptw-doc-check-cell__mark {
  display: block;
  width: 18px;
  height: 18px;
}

.ptw-doc-check-cell__mark--yes {
  color: #15803d;
}

.ptw-doc-check-cell__mark--no {
  color: #b91c1c;
}

.ptw-doc-check-cell__mark--na {
  color: #1d4ed8;
}

.ptw-doc-check-cell__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ptw-doc-inline-yesno {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.ptw-doc-muted {
  font-size: 12px;
  color: #666;
}

.ptw-doc-inline-yesno__opt {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.ptw-doc-risk-gateway {
  padding: 8px;
  border-left: 2px solid #000;
  border-right: 2px solid #000;
  font-size: 13px;
}

.ptw-doc-risk-gateway__lead {
  margin: 0 0 8px;
  font-weight: 700;
}

.ptw-doc-media-row {
  padding: 8px;
  border: 2px solid #000;
  border-top: none;
  font-size: 13px;
}

.ptw-doc-media-row--top {
  border-top: 2px solid #000;
}

.ptw-doc-media-row .swi-field__label {
  font-weight: 700;
  color: #000;
}

.ptw-signoff-block {
  margin: 0 0 0.75rem;
}

.ptw-signoff-block__declaration {
  margin: 0 0 0.5rem;
  padding: 4px 6px 5px;
  border-left: 2px solid #000;
  border-right: 2px solid #000;
  font-size: 11px;
  line-height: 1.3;
  font-weight: 400;
}

.ptw-signoff-block__sheet {
  border: 2px solid #000;
}

.ptw-signoff-block__table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.ptw-signoff-block__table th,
.ptw-signoff-block__table td {
  border: 1px solid #000;
  padding: 0;
  vertical-align: middle;
  background: #fff;
}

.ptw-signoff-block__table thead th {
  padding: 2px 3px;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  line-height: 1;
}

.ptw-signoff-block__col-role {
  width: 22%;
}

.ptw-signoff-block__col-name,
.ptw-signoff-block__col-company {
  width: 26%;
}

.ptw-signoff-block__col-signature {
  width: 26%;
}

.ptw-signoff-block__role-label {
  padding: 2px 3px;
  font-size: 8px;
  font-weight: 700;
  text-align: left;
  line-height: 1.05;
  word-break: break-word;
}

.ptw-signoff-block__cell-input {
  display: block;
  width: 100%;
  min-height: 22px;
  padding: 2px 4px;
  border: none;
  outline: none;
  font: inherit;
  font-size: 11px;
  line-height: 1.1;
  background: transparent;
  color: #000;
}

.ptw-signoff-block__cell-input::placeholder {
  color: #b0b0b0;
}

.ptw-signoff-block__name-cell,
.ptw-signoff-block__company-cell,
.ptw-signoff-block__signature-cell {
  height: 24px;
}

.ptw-signoff-block__signature-cell {
  position: relative;
  vertical-align: middle;
}

.ptw-text-answers-block {
  margin: 0 0 0.75rem;
  padding: 6px 8px 8px;
  border: 2px solid #000;
  background: #fff;
}

.ptw-text-answers-block__heading {
  margin: 0 0 0.5rem;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.ptw-text-answers-block__list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ptw-text-answers-block__item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ptw-text-answers-block__label {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  color: #000;
}

.ptw-text-answers-block__input {
  display: block;
  width: 100%;
  min-height: 2.25rem;
  padding: 4px 6px;
  border: 1px solid #000;
  border-radius: 0;
  font: inherit;
  font-size: 11px;
  line-height: 1.25;
  color: #000;
  background: #fff;
  resize: vertical;
}

.ptw-text-answers-block__input:focus {
  outline: 2px solid #000;
  outline-offset: 0;
}

.ptw-text-answers-block__input::placeholder {
  color: #888;
}

.ptw-name-field {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 100%;
  min-height: 22px;
}

.ptw-name-field__trigger {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  min-height: 22px;
  padding: 2px 4px;
  border: none;
  background: #fff;
  cursor: pointer;
  text-align: left;
  user-select: none;
}

.ptw-name-field__trigger:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.ptw-name-field__text {
  font-size: 11px;
  line-height: 1.1;
  color: #000;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ptw-name-field__placeholder {
  font-size: 8px;
  color: #666;
  text-decoration: underline;
  line-height: 1;
}

.ptw-name-field__clear {
  position: absolute;
  right: 1px;
  bottom: 0;
  z-index: 1;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 8px;
  line-height: 1;
  color: #555;
  text-decoration: underline;
  cursor: pointer;
}

.ptw-name-modal-backdrop {
  z-index: 120;
}

.ptw-name-modal .swi-modal__body {
  padding-top: 0.5rem;
}

.ptw-signature-field {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 100%;
  min-height: 22px;
}

.ptw-signature-field__trigger {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 22px;
  padding: 0 2px;
  border: none;
  background: #fff;
  cursor: pointer;
}

.ptw-signature-field__trigger:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.ptw-signature-field__trigger--signed {
  justify-content: flex-start;
}

.ptw-signature-field__placeholder {
  font-size: 8px;
  color: #666;
  text-decoration: underline;
  line-height: 1;
}

.ptw-signature-field__preview {
  display: block;
  width: 100%;
  height: 20px;
  object-fit: contain;
  object-position: left center;
  pointer-events: none;
}

.ptw-signature-field__clear {
  position: absolute;
  right: 1px;
  bottom: 0;
  z-index: 1;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 8px;
  line-height: 1;
  color: #555;
  text-decoration: underline;
  cursor: pointer;
}

.ptw-signature-modal-backdrop {
  z-index: 120;
}

.ptw-signature-modal {
  max-width: 640px;
}

.ptw-signature-modal__hint {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--swi-text-secondary);
}

.ptw-signature-modal .ptw-signature-pad__canvas {
  min-height: 280px;
}

.ptw-doc-job-table--auth .ptw-user-search__input,
.ptw-doc-job-table--auth .swi-input {
  font-size: 13px;
}

.ptw-doc-job-table--auth .ptw-camera-selfie__viewport {
  max-width: 100%;
}

.ptw-doc-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--swi-surface);
  border: 1px solid var(--swi-border);
  border-radius: 12px;
}

.ptw-doc-footer__error {
  flex: 1 1 100%;
  margin: 0;
}

.ptw-doc-footer__hint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--swi-text-secondary);
}

@media (max-width: 900px) {
  .ptw-doc-page__rail {
    flex-basis: 14px;
    width: 14px;
  }

  .ptw-doc-header {
    grid-template-columns: 96px minmax(0, 1fr) minmax(150px, 220px);
    grid-template-rows: minmax(64px, auto);
  }

  .ptw-doc-header__title h4 {
    font-size: 12px;
    margin-bottom: 4px;
  }

  .ptw-doc-header__title h3 {
    font-size: 15px;
  }

  .ptw-doc-header__permit {
    padding: 8px;
    gap: 6px;
    grid-template-columns: minmax(0, 1fr) minmax(88px, 120px);
  }

  .ptw-doc-header__permit > span {
    padding: 6px;
    font-size: 11px;
  }

  .ptw-doc-header__permit-box {
    font-size: 11px;
    min-height: 26px;
  }

  .ptw-doc-job-table__label {
    width: 120px;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 10mm;
  }

  html,
  body {
    background: #fff !important;
    color: #000 !important;
    height: auto !important;
    overflow: visible !important;
  }

  .portal-topbar,
  .portal-sidebar,
  .portal-sidebar__footer,
  .ptw-no-print,
  .ptw-permit-preview-page > .portal-page-header,
  .ptw-permit-preview-page > .swi-error {
    display: none !important;
  }

  .portal-root,
  .portal-body,
  .portal-main,
  .portal-page,
  .portal-page--document-full,
  .ptw-permit-preview-page {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  .ptw-permit-preview-documents,
  .ptw-print-current-sheet,
  .ptw-print-all-stack,
  .ptw-print-sheet {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
  }

  .ptw-print-exclude,
  video,
  .ptw-preview-media--video,
  .ptw-preview-media-interactive.ptw-print-exclude {
    display: none !important;
    visibility: hidden !important;
  }

  .ptw-preview-media__loading {
    display: none !important;
  }

  .ptw-print-media {
    max-height: none !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .ptw-print-permit-meta {
    display: block !important;
    margin: 0 0 8px;
    padding: 0 0 6px;
    border-bottom: 1px solid #000;
    font-family: Arial, Helvetica, sans-serif;
    color: #000;
  }

  .ptw-print-permit-meta__title {
    margin: 0 0 2px;
    font-size: 11pt;
    font-weight: 700;
  }

  .ptw-print-permit-meta__validity {
    margin: 0;
    font-size: 9pt;
  }

  .ptw-print-all-stack {
    position: fixed;
    top: 100vh;
    left: 0;
    width: 100%;
    pointer-events: none;
    z-index: -1;
  }

  body:not(.ptw-print-all) .ptw-print-all-stack {
    display: none !important;
  }

  body.ptw-print-all .ptw-print-current-sheet {
    display: none !important;
  }

  body.ptw-print-all .ptw-print-all-stack {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
    display: block !important;
    pointer-events: auto !important;
  }

  .ptw-print-sheet {
    page-break-after: always;
    break-after: page;
  }

  .ptw-print-sheet:last-child {
    page-break-after: auto;
    break-after: auto;
  }

  .ptw-print-sheet__label {
    display: block;
    margin: 0 0 6px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10pt;
    font-weight: 700;
    color: #000;
  }

  body:not(.ptw-print-all) .ptw-print-sheet__label {
    display: none !important;
  }

  .ptw-doc-wrap {
    background: #fff !important;
    padding: 0 !important;
    height: auto !important;
    overflow: visible !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .ptw-doc-page {
    width: 100% !important;
    display: flex !important;
    align-items: stretch !important;
    border: none !important;
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
    page-break-inside: auto !important;
    break-inside: auto !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .ptw-doc-page__body {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    padding: 12px !important;
  }

  .ptw-doc-page__rail {
    display: block !important;
    position: static !important;
    flex: 0 0 18px !important;
    width: 18px !important;
    align-self: stretch !important;
    background: var(--ptw-job-color, #ffff00) !important;
    border: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .ptw-doc-header {
    page-break-inside: avoid;
    break-inside: avoid;
    display: grid !important;
    grid-template-columns: 180px minmax(0, 1fr) minmax(220px, 280px) !important;
    grid-template-rows: minmax(70px, auto) !important;
    background: var(--ptw-job-color, #ffff00) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .ptw-doc-header__hazard,
  .ptw-doc-header__permit,
  .ptw-doc-header__title,
  .ptw-doc-header__permit > span {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .ptw-doc-section {
    page-break-inside: avoid !important;
    break-inside: avoid-page !important;
    overflow: visible !important;
  }

  .ptw-doc-section--preview {
    pointer-events: none !important;
  }

  .ptw-audit-section {
    page-break-inside: avoid !important;
    break-inside: avoid-page !important;
  }

  .ptw-doc-section-title,
  .ptw-doc-warning {
    page-break-inside: avoid;
    break-inside: avoid;
    page-break-after: avoid;
    break-after: avoid-page;
  }

  .ptw-doc-question-table-wrap,
  .ptw-signoff-block,
  .ptw-signoff-block__sheet,
  .ptw-text-answers-block {
    overflow: visible !important;
    page-break-inside: avoid !important;
    break-inside: avoid-page !important;
  }

  .ptw-doc-question-table,
  .ptw-signoff-block__table {
    page-break-inside: avoid !important;
    break-inside: avoid-page !important;
  }

  .ptw-doc-question-table thead {
    display: table-header-group;
  }

  .ptw-doc-question-table tbody {
    display: table-row-group;
  }

  .ptw-doc-question-table tr,
  .ptw-signoff-block__table tr,
  .ptw-text-answers-block__item {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .ptw-doc-question-table__question {
    white-space: normal !important;
    overflow: visible !important;
  }

  .ptw-doc-question-table th,
  .ptw-doc-question-table td,
  .ptw-signoff-block__table th,
  .ptw-signoff-block__table td {
    border-color: #000 !important;
    color: #000 !important;
  }

  .ptw-preview-value {
    border-color: #000 !important;
    background: #fff !important;
    color: #000 !important;
  }

  .ptw-doc-check-cell--readonly {
    border-color: #000 !important;
    background: #fff !important;
    color: #000 !important;
  }

  .ptw-doc-check-cell--selected {
    background: #eee !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .ptw-doc-warning {
    border-color: #000 !important;
    color: #000 !important;
    background: #fff !important;
  }

  .ptw-doc-section-title {
    background: var(--ptw-job-color, #ffff00) !important;
    color: #000 !important;
    border-color: #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .ptw-doc-section:has(.ptw-risk-section) {
    page-break-inside: auto !important;
    break-inside: auto !important;
  }

  .ptw-risk-section__toolbar {
    display: none !important;
  }

  .ptw-risk-section__table-wrap {
    overflow: visible !important;
    max-width: 100% !important;
  }

  .ptw-risk-section__table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: fixed !important;
  }

  .ptw-risk-section__table .ptw-doc-job-table__label,
  .ptw-risk-section__head {
    width: auto !important;
    min-width: 0 !important;
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
    font-size: 7pt !important;
    padding: 2px 3px !important;
    line-height: 1.2 !important;
  }

  .ptw-risk-section__table td,
  .ptw-risk-section__table th {
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
    padding: 3px !important;
    border-color: #000 !important;
    color: #000 !important;
  }

  .ptw-risk-section--preview .ptw-preview-value {
    min-height: 0 !important;
    font-size: 8pt !important;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .ptw-risk-section__table tr {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .ptw-doc-sheet-footer {
    page-break-inside: avoid;
    break-inside: avoid;
    display: block !important;
  }

  .ptw-doc-footer {
    display: none !important;
  }
}
