/* ── New matter wizard ─────────────────────────────────────────────────────── */

#ws-wizard-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.ws-wizard-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 37, 54, 0.6);
  backdrop-filter: blur(3px);
}

/* ── Panel ── */
.ws-wizard-panel {
  position: relative;
  width: 100%;
  max-width: 820px;
  height: auto;
  max-height: 88vh;
  padding: 0;
  background: var(--surface-canvas);
  box-shadow: 0 24px 80px rgba(10, 37, 54, 0.28);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
}

/* Content container fills the panel */
#ws-wizard-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Close ── */
.ws-wizard-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  /* Sits on the navy wz2 header — solid enough to read on dark or light */
  background: rgba(243, 250, 255, 0.18);
  border: 1px solid rgba(243, 250, 255, 0.35);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.8125rem;
  color: #FFFFFF;
  cursor: pointer;
  z-index: 10;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.ws-wizard-close:hover {
  background: rgba(243, 250, 255, 0.3);
  color: #FFFFFF;
}

/* ── Header — dark navy ── */
.ws-wizard-header {
  padding: 2rem 2.5rem 0;
  background: var(--brand-navy);
  flex-shrink: 0;
}

.ws-wizard-heading {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: #F3FAFF;
  margin: 0 0 1.75rem;
  letter-spacing: -0.01em;
}

/* ── Step progress ── */
.ws-wizard-steps {
  display: flex;
  align-items: center;
  gap: 0;
  padding-bottom: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.ws-wizard-steps::-webkit-scrollbar { display: none; }

.ws-wizard-step-item {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.ws-wizard-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.6875rem;
  flex-shrink: 0;
  border: 2px solid rgba(243, 250, 255,0.2);
  background: transparent;
  color: rgba(243, 250, 255,0.4);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.ws-wizard-step-item.is-active .ws-wizard-step-num {
  background: var(--brand-gold);
  border-color: var(--brand-gold);
  color: var(--brand-navy);
}

.ws-wizard-step-item.is-done .ws-wizard-step-num {
  background: rgba(51, 86, 109,0.25);
  border-color: var(--brand-gold);
  color: var(--brand-gold);
}

.ws-wizard-step-label {
  margin-left: 7px;
  font-size: 0.75rem;
  color: rgba(243, 250, 255,0.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
}

.ws-wizard-step-item.is-active .ws-wizard-step-label {
  color: rgba(243, 250, 255,0.95);
  font-weight: 600;
}

.ws-wizard-step-item.is-done .ws-wizard-step-label {
  color: rgba(243, 250, 255,0.5);
}

.ws-wizard-step-line {
  flex: 1;
  height: 1px;
  background: rgba(243, 250, 255,0.12);
  margin: 0 8px;
  flex-shrink: 0;
  transition: background 0.2s;
}

.ws-wizard-step-line.is-done {
  background: var(--brand-gold);
  opacity: 0.6;
}

/* ── Active step indicator bar ── */
.ws-wizard-step-indicator {
  height: 3px;
  background: var(--brand-gold);
  margin-top: 1.25rem;
  border-radius: 3px 3px 0 0;
  transition: width 0.3s ease;
}

/* ── Body ── */
.ws-wizard-body {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 2.5rem 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
}
.ws-wizard-body::-webkit-scrollbar { width: 5px; }
.ws-wizard-body::-webkit-scrollbar-track { background: transparent; }
.ws-wizard-body::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 3px; }

/* ── Section labels ── */
.ws-wizard-section-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 1.125rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--brand-gold);
}

/* ── Two-column grid ── */
.ws-wizard-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.25rem;
}

/* ── Section divider ── */
.ws-wizard-divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 1.75rem 0;
}

/* ── Footer ── */
.ws-wizard-footer {
  padding: 1.125rem 2.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  gap: 0.75rem;
  background: var(--surface-elevated);
}

/* ── Ghost button (Back / Cancel / Draft) ── */
.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  height: 40px;
  padding: 0 1.125rem;
  border-radius: var(--radius-md, 8px);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn--ghost:hover {
  border-color: var(--brand-navy);
  color: var(--brand-navy);
}

/* Make primary button in footer compact */
.ws-wizard-footer .btn--primary {
  height: 40px;
  padding: 0 1.5rem;
  font-size: 0.875rem;
}

/* ── Parties repeater ── */
.ws-party-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.ws-party-row .form-input { flex: 1; }

.ws-party-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.125rem;
  padding: 0.5rem 0.25rem;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s;
}
.ws-party-remove:hover { color: var(--status-danger); }

.ws-add-party-btn {
  background: none;
  border: 1px dashed var(--border-strong);
  color: var(--text-muted);
  border-radius: var(--radius-md, 8px);
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  cursor: pointer;
  width: 100%;
  margin-top: 0.375rem;
  font-family: var(--font-sans);
  transition: border-color 0.15s, color 0.15s;
}
.ws-add-party-btn:hover {
  border-color: var(--brand-navy);
  color: var(--brand-navy);
}

/* ── Tag chips ── */
.ws-tags-input {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 8px);
  padding: 0.375rem 0.5rem;
  min-height: 42px;
  align-items: center;
  cursor: text;
  background: var(--surface-elevated);
  transition: border-color 0.15s;
}
.ws-tags-input:focus-within { border-color: var(--brand-navy); }

.ws-tag-chip {
  background: var(--brand-navy);
  color: var(--surface-canvas);
  border-radius: 20px;
  padding: 0.175rem 0.625rem;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ws-tag-remove {
  background: none;
  border: none;
  color: rgba(243, 250, 255,0.6);
  cursor: pointer;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1;
  transition: color 0.1s;
}
.ws-tag-remove:hover { color: #F3FAFF; }

.ws-tag-input-inner {
  border: none;
  outline: none;
  font-size: 0.875rem;
  flex: 1;
  min-width: 120px;
  font-family: var(--font-sans);
  background: transparent;
  color: var(--text-primary);
}

/* ── SoL block ── */
.ws-sol-block {
  background: var(--status-warning-soft);
  border: 1px solid var(--status-warning);
  border-radius: var(--radius-md, 8px);
  padding: 1rem 1.125rem;
  margin: 1.25rem 0;
}

.ws-sol-label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--status-warning);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

/* ── Conflict check ── */
.ws-conflict-result {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md, 8px);
  font-size: 0.875rem;
}
.ws-conflict-result--clear   { background: var(--status-success-soft); color: var(--status-success); }
.ws-conflict-result--review  { background: var(--status-warning-soft); color: var(--status-warning); }
.ws-conflict-result--loading { background: var(--surface-recessed); color: var(--text-muted); }

/* ── Upload area ── */
.ws-upload-area {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md, 8px);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.ws-upload-area:hover,
.ws-upload-area.is-dragging {
  border-color: var(--brand-navy);
  background: rgba(10, 37, 54, 0.03);
}

/* ── Client type toggle ── */
.wz-client-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
  width: fit-content;
  margin-bottom: 1.25rem;
}
.wz-client-toggle-btn {
  padding: 0.5rem 1.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: var(--surface-elevated);
  color: var(--text-muted);
  font-family: var(--font-sans);
  transition: background 0.15s, color 0.15s;
}
.wz-client-toggle-btn.is-active {
  background: var(--brand-navy);
  color: var(--surface-canvas);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  #ws-wizard-overlay { padding: 0; }
  .ws-wizard-panel {
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
}
@media (max-width: 640px) {
  .ws-wizard-two-col { grid-template-columns: 1fr; }
  .ws-wizard-step-label { display: none; }
  .ws-wizard-body { padding: 1.25rem 1.25rem 1rem; }
  .ws-wizard-header { padding: 1.25rem 1.25rem 0; }
  .ws-wizard-footer { padding: 0.875rem 1.25rem; }
}

/* ── People step — autocomplete ── */
.form-label-opt {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.wz-ac-wrap {
  position: relative;
}

.wz-ac-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 8px);
  box-shadow: 0 8px 24px rgba(10, 37, 54, 0.12);
  z-index: 200;
  overflow: hidden;
  max-height: 220px;
  overflow-y: auto;
}

.wz-ac-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  cursor: pointer;
  transition: background 0.1s;
}
.wz-ac-item:hover {
  background: var(--surface-recessed);
}

.wz-ac-item__av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-navy);
  color: var(--surface-canvas);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.wz-ac-item__info {
  min-width: 0;
  flex: 1;
}

.wz-ac-item__name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wz-ac-item__role {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
}
