/* SealVero Fill & Sign Studio */
.fs-hub-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 18px;
}
.fs-dropzone {
  border: 1.5px dashed rgba(59, 231, 192, 0.45);
  border-radius: 16px;
  padding: 28px 22px;
  text-align: center;
  background: rgba(19, 185, 158, 0.06);
  transition: border-color 0.2s, background 0.2s;
}
.fs-dropzone:hover {
  border-color: var(--teal);
  background: rgba(19, 185, 158, 0.11);
}
.fs-dropzone h3 {
  margin: 10px 0 6px;
  font-size: 17px;
}
.fs-dropzone p {
  margin: 0 0 16px;
  font-size: 12px;
  color: var(--muted);
}
.fs-quick-list {
  display: grid;
  gap: 10px;
}
.fs-quick-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--surface2);
}
.fs-quick-item strong {
  display: block;
  font-size: 13px;
  color: var(--ink);
}
.fs-quick-item span {
  font-size: 11px;
  color: var(--muted);
}

/* Studio Shell */
.fs-studio {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  min-height: calc(100vh - 150px);
  box-shadow: var(--shadow);
}
.fs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex-wrap: wrap;
}
.fs-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.fs-title-input {
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 750;
  padding: 5px 8px;
  border-radius: 8px;
  min-width: 180px;
  max-width: 320px;
}
.fs-title-input:hover,
.fs-title-input:focus {
  border-color: var(--line);
  background: var(--surface2);
  outline: none;
}
.fs-save-state {
  font-size: 11px;
  color: var(--muted);
  padding: 4px 9px;
  border-radius: 99px;
  background: var(--surface2);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.fs-save-state.saved {
  color: var(--green);
  border-color: rgba(108, 231, 181, 0.3);
}
.fs-save-state.dirty {
  color: var(--orange);
  border-color: rgba(255, 204, 144, 0.35);
}

/* Lumin-style Sticky Toolbar */
.fs-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface2);
  flex-wrap: wrap;
  position: sticky;
  top: 76px;
  z-index: 4;
}
.fs-tool-sep {
  width: 1px;
  height: 24px;
  background: var(--line);
  margin: 0 4px;
}
.fs-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  transition: 0.15s;
}
.fs-tool:hover {
  color: var(--ink);
  background: var(--surface3);
}
.fs-tool.active {
  color: #071d20;
  background: var(--teal);
  border-color: var(--teal);
}
.fs-tool:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.fs-tool .svg-icon {
  width: 15px;
  height: 15px;
}

.fs-color-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 4px;
}
.fs-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  transition: transform 0.15s, border-color 0.15s;
}
.fs-swatch:hover {
  transform: scale(1.12);
}
.fs-swatch.active {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px var(--surface2);
}
.fs-size-select {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 700;
}

/* Placement Hint Banner */
.fs-hint-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(59, 231, 192, 0.12);
  border-bottom: 1px solid rgba(59, 231, 192, 0.25);
  color: var(--teal);
  font-size: 12px;
  font-weight: 650;
}

/* Canvas Viewport Stage */
.fs-stage {
  position: relative;
  flex: 1;
  overflow: auto;
  padding: 28px 20px 88px;
  background:
    radial-gradient(circle, rgba(149, 166, 185, 0.13) 1px, transparent 1px),
    var(--bg);
  background-size: 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}
.fs-page-wrap {
  position: relative;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  user-select: none;
  flex-shrink: 0;
}
.fs-page-wrap[data-cursor="text"] { cursor: text; }
.fs-page-wrap[data-cursor="crosshair"] { cursor: crosshair; }
.fs-page-wrap[data-cursor="copy"] { cursor: copy; }
.fs-page-wrap[data-cursor="eraser"] { cursor: not-allowed; }

.fs-pdf-canvas {
  display: block;
  border-radius: 4px;
}
.fs-draw-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}
.fs-draw-svg.eraser-active {
  pointer-events: auto;
}
.fs-draw-svg path.fs-stroke {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.fs-draw-svg.eraser-active path.fs-stroke {
  pointer-events: stroke;
  cursor: pointer;
}
.fs-draw-svg.eraser-active path.fs-stroke:hover {
  opacity: 0.45;
}

.fs-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
}

/* Annotation Items */
.fs-item {
  position: absolute;
  box-sizing: border-box;
  border: 1.5px solid transparent;
  border-radius: 4px;
  cursor: move;
}
.fs-item:hover {
  border-color: rgba(19, 185, 158, 0.55);
}
.fs-item.selected {
  border-color: #0d9488;
  background: rgba(59, 231, 192, 0.07);
  z-index: 6;
}
.fs-item.eraser-hover:hover {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.14);
  cursor: pointer;
}
.fs-item-text {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  resize: none;
  outline: none;
  padding: 1px 3px;
  margin: 0;
  line-height: 1.25;
  overflow: hidden;
  font-family: Helvetica, Arial, sans-serif;
  cursor: inherit;
}
.fs-item.editing .fs-item-text {
  cursor: text;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 3px;
}
.fs-item-typed-sig {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
}
.fs-item-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  display: block;
}
.fs-item-mark {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
.fs-item-highlight {
  width: 100%;
  height: 100%;
  opacity: 0.32;
  border-radius: 2px;
  pointer-events: none;
}

/* Selection Controls */
.fs-del-btn {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  background: #ef4444;
  color: #fff;
  font-size: 13px;
  line-height: 1;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.fs-item.selected .fs-del-btn {
  display: flex;
}
.fs-resize-handle {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: #0d9488;
  border: 1.5px solid #fff;
  cursor: nwse-resize;
  display: none;
  z-index: 10;
}
.fs-item.selected .fs-resize-handle {
  display: block;
}

.fs-live-highlight {
  position: absolute;
  pointer-events: none;
  opacity: 0.35;
  border: 1px dashed #0d9488;
  z-index: 8;
}

/* Floating Bottom Pill (Lumin Zoom & Page Bar) */
.fs-bottom-bar {
  position: sticky;
  bottom: 16px;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  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 12px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
}
.fs-bottom-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #eff8fb;
  font-size: 14px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.fs-bottom-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
}

/* Signature Modal */
.fs-sig-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.fs-sig-pad-wrap {
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background: #ffffff;
  padding: 6px;
  margin-bottom: 10px;
}
.fs-sig-canvas {
  width: 100%;
  height: 160px;
  display: block;
  touch-action: none;
  cursor: crosshair;
}
.fs-saved-sigs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 10px;
}
.fs-saved-sig-card {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.fs-saved-sig-card:hover {
  border-color: var(--teal);
}
.fs-saved-sig-card img {
  max-width: 100%;
  height: 54px;
  object-fit: contain;
}

@media (max-width: 960px) {
  .fs-hub-grid {
    grid-template-columns: 1fr;
  }
  .fs-toolbar {
    top: 0;
    position: static;
  }
}


/* Fill & Sign Interactive Polish */
.fs-item-text {
  user-select: text;
  -webkit-user-select: text;
}
.fs-item.editing {
  border: 1.5px dashed #0d9488;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 16px rgba(13, 148, 136, 0.18);
  z-index: 8;
}
.fs-edit-btn {
  position: absolute;
  top: -12px;
  right: 14px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  background: #0d9488;
  color: #fff;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
}
.fs-item.selected .fs-edit-btn {
  display: flex;
}
.fs-item.editing .fs-edit-btn {
  display: none;
}
.fs-hint-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.fs-date-input {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--teal);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}
.fs-page-wrap[data-cursor="eraser"] {
  cursor: crosshair;
}
