/* SealVero External Recipient Fill & Sign Studio */
.signer-review-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.ss-shell {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
}

.ss-toolbar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface2);
  flex-wrap: wrap;
}
.ss-tool {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: 0.15s;
}
.ss-tool:hover {
  color: var(--ink);
  background: var(--surface3);
}
.ss-tool.active {
  color: #071d20;
  background: var(--teal);
  border-color: var(--teal);
}
.ss-tool:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.ss-tool .svg-icon {
  width: 14px;
  height: 14px;
}
.ss-sep {
  width: 1px;
  height: 20px;
  background: var(--line);
  margin: 0 2px;
}
.ss-colors {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ss-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
}
.ss-swatch.active {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px var(--surface2);
}
.ss-size {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 700;
}
.ss-edit-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 750;
  padding: 3px 9px;
  border-radius: 99px;
  background: rgba(59, 231, 192, 0.12);
  color: var(--teal);
  border: 1px solid rgba(59, 231, 192, 0.25);
  white-space: nowrap;
}

.ss-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
  background: rgba(59, 231, 192, 0.1);
  border-bottom: 1px solid rgba(59, 231, 192, 0.22);
  color: var(--teal);
  font-size: 12px;
  font-weight: 650;
  flex-wrap: wrap;
}
.ss-hint-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ss-stage {
  position: relative;
  max-height: 70vh;
  min-height: 420px;
  overflow: auto;
  padding: 18px 12px 68px;
  background:
    radial-gradient(circle, rgba(149, 166, 185, 0.13) 1px, transparent 1px),
    var(--bg);
  background-size: 18px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  -webkit-overflow-scrolling: touch;
}

.ss-page-wrap {
  position: relative;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(255, 255, 255, 0.08);
  user-select: none;
  flex-shrink: 0;
}
.ss-page-wrap[data-cursor="text"] { cursor: text; }
.ss-page-wrap[data-cursor="crosshair"] { cursor: crosshair; }
.ss-page-wrap[data-cursor="copy"] { cursor: copy; }

.ss-pdf-canvas {
  display: block;
  border-radius: 4px;
}
.ss-draw-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}
.ss-draw-svg path.ss-stroke {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ss-fields-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.ss-fields-layer.clickable .signer-field-marker {
  pointer-events: auto;
}
.ss-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
}
.ss-overlay.touch-locked {
  touch-action: none;
}

.ss-item {
  position: absolute;
  box-sizing: border-box;
  border: 1.5px solid transparent;
  border-radius: 4px;
  cursor: move;
  touch-action: none;
}
.ss-item:hover {
  border-color: rgba(19, 185, 158, 0.6);
}
.ss-item.selected {
  border-color: #0d9488;
  background: rgba(59, 231, 192, 0.07);
  z-index: 7;
}
.ss-item.editing {
  border: 1.5px dashed #0d9488;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.18);
  z-index: 9;
}
.ss-item.eraser-hover:hover {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.14);
  cursor: pointer;
}

.ss-bottom-bar {
  position: sticky;
  bottom: 10px;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(13, 23, 38, 0.94);
  border: 1px solid var(--line);
  color: #eff8fb;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}

@media (max-width: 960px) {
  .signer-review-grid {
    grid-template-columns: 1fr;
  }
  .ss-stage {
    max-height: 62vh;
    padding: 12px 6px 60px;
  }
  .ss-toolbar {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
}

/* Fit the studio toolbar inside the narrow signer panel rather than clipping tools. */
.signer-review-grid > .panel, .signer-pdf-stage, .ss-shell, .ss-stage { min-width: 0; max-width: 100%; box-sizing: border-box; }
.signer-pdf-stage:has(.ss-shell) { display: block; max-height: none; overflow: visible; padding: 0; }
.ss-shell { width: 100%; }
@media (max-width: 960px) {
  .signer-review-grid { grid-template-columns: minmax(0, 1fr); }
  .ss-toolbar { flex-wrap: wrap; overflow-x: visible; }
  .ss-tool { min-height: 40px; flex: 0 0 auto; }
  .ss-stage { min-height: 250px; max-height: 55vh; }
  .ss-hint { min-width: 0; overflow-wrap: anywhere; }
}
