/* Sign PDF (/tools/sign-pdf-document/), 2026-11-29.
   Uses tokens from ft-shell-20261106.css and components from ft-tool-20261106.css.
   Reserves signature pad and preview stage heights from first paint so CLS stays 0.000. */

.ft-tool .ft-fields {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), minmax(0, 1fr)));
}

.ft-tool .ft-field,
.ft-tool fieldset,
.ft-tool .ft-panel,
.ft-tool .ft-stack,
.ft-tool .ft-inputgroup {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.ft-tool .ft-select {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ft-tool input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.ft-tool select,
.ft-tool textarea,
.ft-tool .ft-input,
.ft-tool .ft-select {
  font-size: max(16px, 1rem);
  min-height: 44px;
}

.ft-tool input[type="range"] {
  width: 100%;
  min-height: 44px;
  margin: 0;
  accent-color: var(--ft-accent);
  cursor: pointer;
}

.ft-tool .ft-btn {
  min-width: 44px;
  min-height: 44px;
  height: auto;
  padding-block: 0.48rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

.spdf-filebar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--ft-space-2) var(--ft-space-3);
  margin-top: calc(-1 * var(--ft-space-2));
}

.spdf-fileinfo {
  flex: 1 1 13rem;
  min-width: 0;
  margin: 0;
  color: var(--ft-ink-2);
  font-size: var(--ft-text-sm);
  overflow-wrap: anywhere;
}

.spdf-fileinfo strong {
  color: var(--ft-ink);
  font-weight: 650;
}

.spdf-presets {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--ft-space-2);
}

.spdf-presets__label {
  margin: 0;
  color: var(--ft-ink);
  font-size: var(--ft-text-sm);
  font-weight: 600;
}

.spdf-presets__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ft-space-2);
}

.spdf-preset {
  justify-content: flex-start;
  text-align: left;
}

.spdf-preset[aria-pressed="true"],
.spdf-tab[aria-pressed="true"] {
  border-color: var(--ft-accent);
  background: var(--ft-accent-soft);
  color: var(--ft-ink);
  font-weight: 650;
}

.spdf-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--ft-space-3);
  min-width: 0;
  margin: 0;
  padding: var(--ft-space-4) 0 0;
  border: 0;
  border-top: 1px solid var(--ft-line);
}

.spdf-group__legend {
  float: left;
  width: 100%;
  margin: 0 0 var(--ft-space-1);
  padding: 0;
  color: var(--ft-ink);
  font-size: var(--ft-text-md);
  font-weight: 650;
}

.spdf-group__legend + * {
  clear: both;
}

.spdf-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 6.8rem), 1fr));
  gap: var(--ft-space-2);
}

.spdf-tab {
  justify-content: center;
  text-align: center;
}

.spdf-modepanel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--ft-space-2);
}

.spdf-modepanel[hidden] {
  display: none;
}

.spdf-pad-wrap {
  position: relative;
  display: grid;
  place-items: center;
  height: 9.5rem;
  border: 1.5px solid var(--ft-line);
  border-radius: var(--ft-radius);
  background: #ffffff;
  overflow: hidden;
}

.spdf-pad-wrap::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 24%;
  border-bottom: 1px dashed rgba(100, 116, 139, 0.45);
  pointer-events: none;
}

.spdf-pad {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

.spdf-mini-preview {
  display: grid;
  place-items: center;
  height: 5.75rem;
  padding: 0.35rem;
  border: 1px solid var(--ft-line);
  border-radius: var(--ft-radius);
  background-color: #ffffff;
  background-image:
    linear-gradient(45deg, #f1f5f9 25%, transparent 25%),
    linear-gradient(-45deg, #f1f5f9 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f1f5f9 75%),
    linear-gradient(-45deg, transparent 75%, #f1f5f9 75%);
  background-size: 14px 14px;
  background-position: 0 0, 0 7px, 7px -7px, -7px 0;
  overflow: hidden;
}

.spdf-mini-preview canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
}

.spdf-scan-upload {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ft-space-2);
  align-items: center;
}

.spdf-scan-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.spdf-range-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--ft-space-2);
}

.spdf-range-val {
  color: var(--ft-ink-2);
  font-size: var(--ft-text-sm);
  font-variant-numeric: tabular-nums;
}

.spdf-addbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ft-space-2);
}

.spdf-inspector {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--ft-space-3);
  padding: var(--ft-space-3);
  border: 1px solid var(--ft-line);
  border-radius: var(--ft-radius);
  background: var(--ft-surface);
}

.spdf-inspector__top {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ft-space-2);
  align-items: flex-end;
}

.spdf-inspector__top > .ft-field {
  flex: 1 1 11rem;
}

.spdf-pos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 6.2rem), 1fr));
  gap: var(--ft-space-2);
}

.spdf-nudge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.spdf-check {
  display: flex;
  align-items: center;
  gap: var(--ft-space-2);
  min-width: 44px;
  min-height: 44px;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--ft-line);
  border-radius: var(--ft-radius);
  background: var(--ft-surface);
  color: var(--ft-ink);
  line-height: 1.35;
  box-sizing: border-box;
}

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

.spdf-check span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.spdf-scope-note {
  margin: 0;
  color: var(--ft-ink-2);
  font-size: var(--ft-text-sm);
  line-height: 1.45;
}

.spdf-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--ft-space-2);
}

.spdf-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}

.spdf-pill {
  min-width: 44px;
  min-height: 44px;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--ft-line);
  border-radius: var(--ft-radius);
  background: var(--ft-surface);
  color: var(--ft-ink-2);
  font: inherit;
  font-size: max(16px, var(--ft-text-sm));
  cursor: pointer;
}

.spdf-pill[aria-pressed="true"] {
  border-color: var(--ft-accent);
  background: var(--ft-accent-soft);
  color: var(--ft-ink);
  font-weight: 650;
}

.spdf-preview {
  margin: 0;
}

.spdf-frame {
  position: relative;
  display: grid;
  place-items: center;
  height: 31.5rem;
  padding: var(--ft-space-3);
  border: 1px solid var(--ft-line);
  border-radius: var(--ft-radius);
  background: var(--ft-surface-2, var(--ft-surface));
  overflow: hidden;
  box-sizing: border-box;
}

.spdf-frame canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 3px;
  box-shadow: 0 6px 22px rgba(15, 23, 32, 0.14);
  background: #ffffff;
  touch-action: none;
  cursor: grab;
}

.spdf-frame canvas[data-dragging="1"] {
  cursor: grabbing;
}

.spdf-busy {
  position: absolute;
  inset: auto var(--ft-space-3) var(--ft-space-3);
  margin: 0;
  padding: 0.45rem 0.75rem;
  border-radius: var(--ft-radius);
  background: var(--ft-surface);
  border: 1px solid var(--ft-line);
  color: var(--ft-ink);
  font-size: var(--ft-text-sm);
  font-weight: 600;
  text-align: center;
}

.spdf-checkcard {
  display: grid;
  gap: var(--ft-space-3);
  padding: var(--ft-space-3);
  border: 1px solid var(--ft-line);
  border-radius: var(--ft-radius);
  background: var(--ft-surface);
}

.spdf-checkcard__head {
  display: grid;
  gap: 0.25rem;
}

.spdf-checkcard__title {
  margin: 0;
  color: var(--ft-ink);
  font-size: var(--ft-text-md);
  font-weight: 650;
}

.spdf-checkcard__sub {
  margin: 0;
  color: var(--ft-ink-2);
  font-size: var(--ft-text-sm);
}

.spdf-stats {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), minmax(0, 1fr)));
}

.spdf-after-example {
  margin-top: var(--ft-space-3);
}

.ft-status {
  min-height: 1.35rem;
}

@media (max-width: 520px) {
  .spdf-frame {
    height: 22rem;
    padding: var(--ft-space-2);
  }

  .spdf-pad-wrap {
    height: 8.5rem;
  }
}
