/* Approved visual system. Do not add legacy layout overrides here. */
@import url('./design-system.css');

/* Runtime-only utility hooks; visible components remain design-system owned. */
[hidden],
.is-hidden {
  display: none !important;
}

.runtime-details {
  display: none;
}

.release-footer {
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 24px;
  text-align: center;
}

/* Available to keyboard users without appearing in the approved visible UI. */
.skip-link {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--text);
  transform: translateY(-120%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* Keeps the optional official reference-page choice grouped with the PDF action. */
.pdf-format {
  display: grid;
  gap: 10px;
  margin: 20px 0 0;
  padding: 16px;
  border: 1px solid var(--divider);
  border-radius: 8px;
}

.pdf-format legend {
  padding: 0 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.pdf-format .hint {
  margin: 0;
}

.pdf-format__option {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
}

.template-download {
  display: grid;
  gap: 4px;
  margin: 20px 0;
}

.action-step {
  margin: 0;
  color: #8EBFA0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

html[data-theme="light"] .action-step {
  color: #356E4C;
}

@media (prefers-color-scheme: light) {
  html:not([data-theme]) .action-step {
    color: #356E4C;
  }
}

.template-download__action {
  align-self: start;
  color: var(--green);
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.template-download__action:hover {
  color: #6BD28E;
}

.signature-option {
  display: grid;
  align-content: start;
  gap: 10px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--divider);
  border-radius: 8px;
}

.signature-option legend {
  padding: 0 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.signature-option__optional {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 400;
}

.signature-option .hint {
  margin: 0;
}

.signature-option .signature-actions {
  flex-wrap: nowrap;
  gap: 12px;
  justify-content: center;
  margin-top: 2px;
}

.signature-option [data-signature-cta] {
  justify-content: center;
  text-align: center;
  white-space: nowrap;
}

.signature-option--compact {
  margin-top: 20px;
}

.signature-option__content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
}

.signature-option--compact .signature-preview {
  width: 160px;
  min-height: 44px;
  margin: 0;
  padding: 6px 10px;
}

.signature-option--compact .signature-preview img {
  max-height: 30px;
}

.upload-step {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.upload-step .upload-zone {
  margin-top: 0;
}

.prepare-pdf {
  display: grid;
  justify-items: start;
  gap: 16px;
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--divider);
  border-radius: 8px;
}

.prepare-pdf .pdf-format {
  margin: 0;
  padding: 0;
  border: 0;
}

.prepare-pdf .pdf-format legend {
  padding: 0;
}

.prepare-pdf .pdf-format .hint {
  width: 100%;
}

.prepare-pdf__action {
  width: auto;
}

@media (max-width: 720px) {
  .signature-option__content {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .signature-option--compact .signature-preview {
    width: min(300px, 100%);
  }

  .prepare-pdf__action.button {
    width: auto;
  }
}

@media (max-width: 960px) and (min-width: 761px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

.shell--pdf-review {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: min(1440px, calc(100% - 32px));
  padding-bottom: 20px;
}

.preview-review-card {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.preview-review-card .preview-frame {
  display: block;
  flex: 1;
  min-height: max(560px, calc(100vh - 360px));
  width: min(100%, 1180px);
  margin: 0 auto;
}

.preview-review-card .preview-actions {
  justify-content: flex-start;
  margin: 0 0 16px;
}

@media (max-width: 640px) {
  .shell--pdf-review {
    width: min(100% - 20px, 1440px);
  }

  .preview-review-card .preview-frame {
    min-height: calc(100vh - 390px);
  }
}
