.vector-preflight-panel {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  background: rgba(0, 180, 200, 0.04);
}

.vector-preflight-head p {
  margin: 0.35rem 0 0;
  color: #4b5563;
  font-size: 0.92rem;
}

.vector-upload-field input[type="file"] {
  width: 100%;
}

.vector-upload-field {
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.85rem;
}

.vector-upload-field > span {
  display: flex;
  align-items: center;
  min-width: max-content;
  white-space: nowrap;
}

.vector-upload-field input[type="file"] {
  max-width: none;
}

.vector-preflight-summary {
  display: grid;
  gap: 0.35rem;
  font-size: 0.92rem;
}

.vector-preflight-summary.is-ready {
  margin-top: 0.35rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.65rem;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
}

.vector-preflight-summary.is-ready strong {
  color: #047857;
  font-size: 1.05rem;
}

.vector-preflight-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.55);
}

.vector-preflight-modal[hidden] {
  display: none !important;
}

.vector-preflight-dialog {
  width: min(1180px, 100%);
  max-height: min(92vh, 900px);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.vector-preflight-dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.vector-preflight-dialog-head h2 {
  margin: 0.15rem 0 0;
  font-size: 1.25rem;
}

.vector-preflight-dialog-body {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  min-height: 0;
  overflow: hidden;
}

.vector-preflight-stage,
.vector-preflight-side {
  min-height: 0;
  overflow: auto;
  padding: 1rem;
}

.vector-preflight-stage {
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.75rem;
}

.vector-preflight-viewport {
  position: relative;
  min-height: 0;
  display: grid;
  gap: 0.35rem;
}

.vector-preflight-zoom {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  gap: 0.35rem;
  padding: 0.25rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.vector-preflight-zoom-btn {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.45rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.vector-preflight-zoom-btn:hover {
  background: #f1f5f9;
}

.vector-preflight-zoom-reset {
  min-width: 3.4rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.vector-preflight-zoom-hint {
  margin: 0;
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.3;
}

.vector-preflight-preview {
  display: block;
  width: min(100%, calc((92vh - 190px) * 5 / 4));
  max-width: 100%;
  height: auto;
  aspect-ratio: 5 / 4;
  max-height: calc(92vh - 190px);
  margin-inline: auto;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  background: #fff;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.vector-preflight-preview.is-panning {
  cursor: grabbing;
}

.vector-preflight-stage-head {
  display: grid;
  gap: 0.25rem;
}

.vector-preflight-stage-head span {
  color: #475569;
  font-size: 0.9rem;
}

.vector-nest-live {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 1.25rem;
}

.vector-nest-live-copy {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.vector-nest-live.is-busy {
  display: flex;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  gap: 0.9rem;
  margin-top: 0.35rem;
  padding: 0.9rem 1rem;
  border: 1px solid #5eead4;
  border-radius: 12px;
  background: #ecfdf5;
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.16);
}

.vector-nest-live.is-busy .vector-nest-live-text {
  color: #0f766e;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}

.vector-preflight-stage-head .vector-nest-live-phase {
  color: #115e59;
  font-size: 0.95rem;
  line-height: 1.35;
}

.vector-nest-live-phase.is-changing {
  animation: vector-nest-phase 0.45s ease;
}

.vector-nest-live-spinner {
  width: 1rem;
  height: 1rem;
  flex: 0 0 1rem;
  border: 2px solid rgba(15, 118, 110, 0.22);
  border-top-color: #0d9488;
  border-radius: 50%;
  animation: vector-nest-spin 0.75s linear infinite;
}

.vector-nest-live.is-busy .vector-nest-live-spinner {
  width: 2.75rem;
  height: 2.75rem;
  flex-basis: 2.75rem;
  border-width: 4px;
  border-color: rgba(13, 148, 136, 0.2);
  border-top-color: #0f766e;
  box-shadow: 0 0 0 6px rgba(13, 148, 136, 0.08);
}

.vector-nest-live-spinner[hidden] {
  display: none !important;
}

@keyframes vector-nest-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes vector-nest-phase {
  from {
    opacity: 0.2;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.vector-preflight-modal.is-nesting .vector-preflight-preview {
  animation: vector-nest-pulse 1.15s ease-in-out infinite;
}

@keyframes vector-nest-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.82;
  }
}

.vector-nest-actions,
.vector-nest-back-actions,
.vector-apply-actions {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.vector-nest-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
  align-items: start;
  padding: 0.55rem 0.65rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.55rem;
  background: #f8fafc;
  font-size: 0.9rem;
  line-height: 1.35;
  cursor: pointer;
}

.vector-nest-option input {
  margin-top: 0.2rem;
}

.vector-nest-option.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.vector-nest-option small {
  display: block;
  color: #64748b;
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.vector-apply-hint {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.35;
  color: #64748b;
}

.vector-preflight-result {
  display: grid;
  gap: 0.5rem;
  font-size: 0.92rem;
}

.vector-preflight-result.is-approved {
  color: #065f46;
}

.vector-preflight-result.is-warning {
  color: #92400e;
}

.vector-preflight-result.is-rejected {
  color: #991b1b;
}

.vector-preflight-check {
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.vector-preflight-quote {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.35rem;
  font-weight: 600;
}

.vector-preflight-quote-block.is-ready {
  margin-top: 0.45rem;
  padding: 0.7rem 0.8rem;
  border-radius: 0.65rem;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
}

.vector-preflight-quote-block.is-ready .vector-preflight-quote {
  padding-top: 0;
}

.vector-preflight-quote-block.is-ready .vector-preflight-quote strong {
  color: #047857;
  font-size: 1.15rem;
}

@media (max-width: 860px) {
  .vector-preflight-dialog-body {
    grid-template-columns: 1fr;
  }

  .vector-preflight-stage {
    border-right: 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  }

  .vector-preflight-preview {
    width: min(100%, calc(42vh * 5 / 4));
    max-height: 42vh;
  }

  .vector-preflight-zoom-hint {
    font-size: 0.72rem;
  }
}

.vector-risk-option.is-invalid-focus {
  outline: 3px solid rgba(12, 169, 223, .55);
  border-color: var(--cyan);
}
.vector-risk-option input:focus-visible {
  outline: 3px solid rgba(12, 169, 223, .55);
  outline-offset: 2px;
}
