/* =========================================================
   20. Tool: Secure Password Generator
   ========================================================= */

.zt-tool--secure-password-generator .zt-tool__body {
  gap: 14px;
}

.zt-spg__top-controls {
  border: 1px solid var(--zt-border);
  border-radius: 14px;
  background: var(--zt-bg-subtle);
  padding: 10px 12px;
}

.zt-spg__top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.zt-spg__length-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.zt-spg__length-stepper {
  width: 128px;
  height: 40px;
}

.zt-spg__length-stepper .zt-sc-stepper__value {
  width: 56px;
  font-weight: 700;
  text-align: center;
  padding: 0;
  line-height: 1;
}

.zt-spg__strength-wrap {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
}

.zt-spg__strength-group {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.zt-spg__strength-help {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--zt-border);
  border-radius: 999px;
  background: var(--zt-bg-page);
  color: var(--zt-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    background-color 0.2s ease;
}

.zt-spg__strength-help:hover,
.zt-spg__strength-help:focus-visible {
  color: var(--zt-text-primary);
  border-color: var(--zt-border-hover, var(--zt-border));
}

.zt-spg__strength-help:focus-visible {
  outline: 2px solid var(--zt-primary);
  outline-offset: 2px;
}

.zt-spg__strength-popover {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: min(320px, 86vw);
  padding: 12px 14px;
  border: 1px solid var(--zt-border);
  border-radius: 12px;
  background: var(--zt-bg-page);
  box-shadow: var(--zt-shadow-md);
  z-index: 20;
}

.zt-spg__strength-popover-title {
  margin-bottom: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--zt-text-primary);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.zt-spg__strength-popover-body {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--zt-text-secondary);
}

.zt-spg__meter {
  margin-top: -2px;
}

.zt-spg__meter-bar {
  height: 8px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.zt-spg__meter-fill {
  display: block;
  height: 100%;
  width: 20%;
  border-radius: inherit;
  transition: width 0.25s ease;
}

.zt-spg__meter-fill.is-weak {
  width: 33%;
  background: #f59e0b;
}

.zt-spg__meter-fill.is-medium {
  width: 66%;
  background: #f59e0b;
}

.zt-spg__meter-fill.is-strong {
  width: 100%;
  background: #22c55e;
}

.zt-spg__meter-fill.is-neutral {
  width: 16%;
  background: #cbd5e1;
}

.zt-spg__strength-summary {
  min-height: 20px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--zt-text-muted);
}

.zt-spg__auto-clear {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--zt-border);
  border-radius: 999px;
  background: var(--zt-bg-page);
  color: var(--zt-text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
}

.zt-spg__auto-clear input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

.zt-spg__countdown {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--zt-bg-subtle);
  color: var(--zt-text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.zt-spg__password-block {
  border: 1px solid var(--zt-border);
  border-radius: 14px;
  background: var(--zt-bg-subtle);
  padding: 11px;
  display: grid;
  gap: 8px;
}

.zt-spg__strength {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 34px;
  width: max-content;
  padding: 5px 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--zt-text-secondary);
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: 0.02em;
}

.zt-spg__strength-icon {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.zt-spg__strength.is-weak {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.zt-spg__strength.is-medium {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}

.zt-spg__strength.is-strong {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.zt-spg__strength.is-neutral {
  border-color: var(--zt-border);
  background: var(--zt-bg-page);
  color: var(--zt-text-muted);
}

.zt-spg__password-field {
  margin: 0;
}

.zt-spg__output-wrap {
  position: relative;
}

.zt-spg__output-wrap .zt-spg__output {
  height: 48px;
  padding-right: 92px;
  font-family: var(--zt-font-mono);
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
  text-align: left;
}

.zt-tool--secure-password-generator.is-enhanced-output .zt-spg__output-wrap .zt-spg__output {
  color: transparent;
  text-shadow: none;
  caret-color: transparent;
}

.zt-spg__output-visual {
  position: absolute;
  left: 14px;
  right: 92px;
  top: 50%;
  transform: translateY(-50%);
  height: 1.35em;
  pointer-events: none;
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--zt-font-mono);
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.35;
  text-align: left;
}

.zt-spg__output-wrap::after {
  content: "";
  position: absolute;
  right: 92px;
  top: 8px;
  bottom: 8px;
  width: 22px;
  pointer-events: none;
  background: linear-gradient(to right, rgba(255, 255, 255, 0), var(--zt-bg-page));
}

.zt-spg__char {
  display: inline-block;
}

.zt-spg__char.is-uppercase {
  color: #134e4a;
}

.zt-spg__char.is-lowercase {
  color: #1d4ed8;
}

.zt-spg__char.is-number {
  color: #7c2d12;
}

.zt-spg__char.is-special {
  color: #9a3412;
}

.zt-spg__output-visual.is-auto-clear-off {
  opacity: 0.92;
}

.zt-spg__inline-actions {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.zt-spg__inline-actions .zt-icon-button {
  position: static;
  top: auto;
  right: auto;
  transform: none;
  width: 30px;
  height: 30px;
  border-radius: 7px;
}

.zt-spg__inline-actions .zt-icon-button:active {
  transform: scale(0.97);
}

.zt-spg__password-block.is-weak .zt-spg__output {
  border-color: #fecaca;
  background: #fff7f7;
}

.zt-spg__password-block.is-medium .zt-spg__output {
  border-color: #fde68a;
  background: #fffdf2;
}

.zt-spg__password-block.is-strong .zt-spg__output {
  border-color: #86efac;
  background: #f6fff8;
}

.zt-spg__password-block.is-neutral .zt-spg__output {
  border-color: var(--zt-border);
  background: var(--zt-bg-page);
}

.zt-spg__status {
  margin-top: 0;
  min-height: 22px;
}

.zt-spg__accordion {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  background: var(--zt-bg-page);
  overflow: hidden;
}

.zt-spg__accordion-toggle {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 0;
  border-radius: 12px;
  border-bottom: 1px solid var(--zt-border);
  background: var(--zt-bg-subtle);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
  color: var(--zt-text-primary);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.zt-spg__accordion-toggle[aria-expanded="true"] {
  background: var(--zt-bg-muted);
}

.zt-spg__accordion-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.zt-spg__accordion-label-icon {
  width: 16px;
  height: 16px;
  color: var(--zt-text-muted);
  flex-shrink: 0;
}

.zt-spg__accordion-toggle:hover {
  background: var(--zt-bg-muted);
}

.zt-spg__accordion-toggle:focus-visible {
  outline: 2px solid var(--zt-primary);
  outline-offset: 2px;
}

.zt-spg__accordion-icon {
  width: 16px;
  height: 16px;
  color: var(--zt-text-muted);
  transition: transform 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.zt-spg__accordion-toggle[aria-expanded="true"] .zt-spg__accordion-icon {
  transform: rotate(180deg);
}

.zt-spg__advanced {
  margin-top: -4px;
  border: 1px solid var(--zt-border);
  border-radius: 12px;
  padding: 0 12px;
  background: var(--zt-bg-subtle);
  overflow: hidden;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  max-height: 0;
  transition: max-height 0.25s ease, padding-top 0.2s ease, padding-bottom 0.2s ease;
}

.zt-spg__advanced.is-open {
  padding-top: 12px;
  padding-bottom: 12px;
  overflow: hidden;
}

.zt-spg__options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 10px;
  overflow: visible;
  align-items: start;
}

.zt-spg__option-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: var(--zt-bg-page);
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.zt-spg__option-row.is-inactive {
  opacity: 0.58;
  background: var(--zt-bg-subtle);
}

.zt-spg__option-row.is-optional {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.zt-spg__option-row.is-optional .zt-spg__count-value {
  color: #475569;
}

.zt-spg__optional-badge {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  margin-left: 4px;
  font-size: 0.72rem;
  line-height: 1;
  color: #64748b;
  font-style: italic;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.zt-spg__option {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--zt-text-secondary);
  font-size: 0.94rem;
  line-height: 1.25;
  min-width: 0;
}

.zt-spg__special-field--inline {
  width: 100%;
  max-width: 100%;
  margin: 0;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: var(--zt-bg-page, #ffffff);
  padding: 14px;
  display: grid;
  gap: 8px;
  box-sizing: border-box;
  align-content: start;
  min-height: 100%;
}

.zt-spg__support-block-title {
  font-size: 0.82rem;
  color: var(--zt-text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.zt-spg__support-block {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: var(--zt-bg-page, #ffffff);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 12px;
  margin-top: 0;
  width: 100%;
  min-height: 100%;
  box-sizing: border-box;
}

.zt-spg__advanced-bottom {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
}

.zt-spg__info-btn {
  position: relative;
  width: 18px;
  height: 18px;
  border: 1px solid var(--zt-border);
  border-radius: 999px;
  background: var(--zt-bg-subtle);
  color: var(--zt-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: help;
  flex-shrink: 0;
}

.zt-spg__info-btn:hover,
.zt-spg__info-btn:focus-visible {
  color: var(--zt-text-primary);
  border-color: var(--zt-border-hover, var(--zt-border));
}

.zt-spg__info-btn:focus-visible {
  outline: 2px solid var(--zt-primary);
  outline-offset: 2px;
}

.zt-spg__info-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  bottom: auto;
  transform: translateX(-50%);
  min-width: 180px;
  max-width: 220px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--zt-border);
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.73rem;
  line-height: 1.35;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 999;
}

.zt-spg__info-btn:hover::after,
.zt-spg__info-btn:focus-visible::after {
  opacity: 1;
}

.zt-spg__count-stepper {
  width: 102px;
  height: 36px;
  flex-shrink: 0;
  justify-self: end;
}

.zt-spg__count-stepper .zt-sc-stepper__btn {
  width: 31px;
  color: var(--zt-text-secondary);
}

.zt-spg__count-stepper .zt-spg__count-value {
  width: 40px;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  color: var(--zt-text-primary);
  padding: 0;
  line-height: 1;
}

.zt-spg__count-stepper .zt-sc-stepper__btn:hover {
  background: #edf4fc;
}

.zt-spg__count-stepper .zt-sc-stepper__btn:active {
  transform: scale(0.96);
}

.zt-spg__count-stepper .zt-sc-stepper__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.zt-spg__option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
}

.zt-spg__option input[type="checkbox"]:disabled + span {
  opacity: 0.6;
}

.zt-spg__special-field.is-inactive {
  opacity: 0.72;
}

.zt-spg__special-field.is-inactive .zt-label,
.zt-spg__special-field.is-inactive .zt-note {
  color: var(--zt-text-muted);
}

.zt-spg__special-field.is-inactive .zt-input {
  background: #f8fafc;
  border-color: var(--zt-border);
  color: var(--zt-text-muted);
}

.zt-spg__special-field .zt-input::placeholder {
  color: #94a3b8;
}

.zt-spg__special-hint {
  color: var(--zt-error);
}

.zt-spg__hex-inline {
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
  font-size: 0.72rem;
  line-height: 1;
  color: #64748b;
  font-style: italic;
  white-space: nowrap;
}

.zt-spg__hex-inline[hidden] {
  display: none;
}

.zt-spg__special-field-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-direction: column;
}

.zt-spg__special-field-top .zt-label {
  margin: 0;
  color: var(--zt-text-secondary);
  font-size: 0.9rem;
  white-space: nowrap;
}

.zt-spg__special-field-top .zt-input {
  width: min(320px, 100%);
  min-width: 180px;
  padding: 8px 10px;
  font-size: 0.92rem;
}

.zt-spg__special-field .zt-note {
  margin: 0;
}

.zt-spg__helper-text {
  font-size: 0.72rem;
  color: #64748b;
  font-style: italic;
  letter-spacing: 0.01em;
  margin: 0;
}

.zt-spg__secondary-options {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-top: 4px;
}

.zt-spg__support-block .zt-spg__secondary-options {
  margin: 0;
}

.zt-spg__info-btn--hex {
  margin-left: 2px;
}

.zt-spg__secondary-options .zt-spg__option {
  gap: 8px;
  padding: 2px 2px;
}

.zt-spg__advanced.is-conflict {
  animation: zt-spg-panel-conflict 0.35s ease;
}

.zt-spg__count-stepper.is-conflict {
  animation: zt-spg-stepper-conflict 0.35s ease;
}

@keyframes zt-spg-panel-conflict {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
  }
  35% {
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.18);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
  }
}

@keyframes zt-spg-stepper-conflict {
  0% {
    border-color: #e2e8f0;
  }
  35% {
    border-color: #fca5a5;
  }
  100% {
    border-color: #e2e8f0;
  }
}


@media (max-width: 980px) {
  .zt-spg__top-controls {
    padding: 10px;
  }

  .zt-spg__strength-wrap {
    order: 3;
    width: 100%;
  }

  .zt-spg__top-row {
    flex-direction: column;
    align-items: stretch;
  }

  .zt-spg__length-wrap {
    width: 100%;
  }

  .zt-spg__length-stepper {
    width: 128px;
  }

  .zt-spg__auto-clear {
    align-self: flex-start;
    padding: 5px 8px;
  }

  .zt-spg__output-wrap .zt-spg__output {
    padding-right: 84px;
    font-size: 1.02rem;
  }

  .zt-spg__output-visual {
    right: 84px;
    font-size: 1.02rem;
  }

  .zt-spg__inline-actions .zt-icon-button {
    width: 28px;
    height: 28px;
  }

  .zt-spg__options-grid {
    grid-template-columns: 1fr;
  }

  .zt-spg__option-row {
    gap: 8px;
  }

  .zt-spg__count-stepper {
    width: 96px;
  }

  .zt-spg__special-field--inline {
    max-width: 100%;
  }

  .zt-spg__special-field-top {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  
  .zt-spg__strength-group {
    flex-wrap: wrap;
  }

  .zt-spg__strength-popover {
    width: min(300px, calc(100vw - 48px));
  }
  
  .zt-spg__special-field-top .zt-input {
    min-width: 0;
    width: 100%;
  }
}


@media (min-width: 920px) {
  .zt-spg__options-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .zt-spg__advanced-bottom {
    grid-template-columns: 1fr 1fr;
  }

  .zt-spg__option-row {
    min-height: 52px;
  }

  .zt-spg__special-field--inline {
    grid-column: auto;
    max-width: 100%;
  }
}


@media (prefers-reduced-motion: reduce) {
  .zt-spg__advanced,
  .zt-spg__accordion-icon,
  .zt-spg__option-row,
  .zt-spg__count-stepper .zt-sc-stepper__btn {
    transition: none;
  }
  .zt-spg__info-btn::after {
    transition: none;
  }
}


/* ── Tabs ─────────────────────────────────────────────────── */

.zt-spg__tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--zt-border);
  margin-bottom: 20px;
}

.zt-spg__tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 8px 18px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--zt-text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.zt-spg__tab:hover {
  color: var(--zt-text);
}

.zt-spg__tab.is-active {
  color: var(--zt-brand);
  border-bottom-color: var(--zt-brand);
}

/* ── History toggle ───────────────────────────────────────── */

.zt-spg__history-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  gap: 8px;
  flex-wrap: wrap;
}

.zt-spg__history-save {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--zt-text-muted);
  cursor: pointer;
  user-select: none;
}

.zt-spg__history-save input[type="checkbox"] {
  accent-color: var(--zt-brand);
}

.zt-spg__history-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  color: var(--zt-text-muted);
  background: none;
  border: 1px solid var(--zt-border);
  border-radius: var(--zt-radius);
  padding: 4px 10px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.zt-spg__history-toggle:hover {
  color: var(--zt-brand);
  border-color: var(--zt-brand);
}

/* ── History panel ────────────────────────────────────────── */

.zt-spg__history-panel {
  margin-top: 10px;
  border: 1px solid var(--zt-border);
  border-radius: var(--zt-radius);
  overflow: hidden;
}

.zt-spg__history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--zt-bg-subtle, #f8fafc);
  border-bottom: 1px solid var(--zt-border);
  gap: 8px;
}

.zt-spg__history-header-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--zt-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.zt-spg__history-actions {
  display: flex;
  gap: 6px;
}

.zt-spg__history-list {
  max-height: 280px;
  overflow-y: auto;
  padding: 6px 0;
}

.zt-spg__history-empty {
  padding: 16px 12px;
  font-size: 0.83rem;
  color: var(--zt-text-muted);
  text-align: center;
  margin: 0;
}

.zt-spg__history-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--zt-border);
}

.zt-spg__history-row:last-child {
  border-bottom: none;
}

.zt-spg__history-meta {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
}

.zt-spg__history-ts {
  font-size: 0.76rem;
  color: var(--zt-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.zt-spg__history-opts {
  font-size: 0.76rem;
  color: var(--zt-text-muted);
}

.zt-spg__history-pw-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.zt-spg__history-pw {
  font-family: var(--zt-font-mono, monospace);
  font-size: 0.88rem;
  color: var(--zt-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.zt-spg__history-copy,
.zt-spg__history-del {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
}

.zt-spg__history-del {
  color: var(--zt-text-muted);
}

.zt-spg__history-del:hover {
  color: #ef4444;
  border-color: #ef4444;
}

/* ── Bulk panel ───────────────────────────────────────────── */

.zt-spg__bulk-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.zt-spg__bulk-count-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zt-spg__bulk-count-label {
  font-size: 0.85rem;
  color: var(--zt-text-muted);
  white-space: nowrap;
}

.zt-spg__bulk-count-stepper {
  width: 110px;
}

.zt-spg__bulk-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* Bulk action buttons — match global zt-button style exactly */
.zt-spg__bulk-actions .zt-button--primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--zt-radius-md);
  background: var(--zt-primary);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.zt-spg__bulk-actions .zt-button--primary:hover {
  background: var(--zt-primary-hover, #1d4ed8);
}

.zt-spg__bulk-actions .zt-button--primary:active {
  transform: translateY(1px);
}

.zt-spg__bulk-actions .zt-button--ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  min-height: 42px;
  border: 1px solid var(--zt-border);
  border-radius: var(--zt-radius-md);
  background: transparent;
  color: var(--zt-text);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.zt-spg__bulk-actions .zt-button--ghost:hover {
  background: var(--zt-bg-subtle);
  border-color: var(--zt-text-muted);
}

.zt-spg__bulk-actions .zt-button--ghost:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* History header action buttons */
.zt-spg__history-actions .zt-button--ghost,
.zt-spg__history-actions .zt-button--sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  min-height: 28px;
  border: 1px solid var(--zt-border);
  border-radius: var(--zt-radius);
  background: transparent;
  color: var(--zt-text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.zt-spg__history-actions .zt-button--ghost:hover,
.zt-spg__history-actions .zt-button--sm:hover {
  background: var(--zt-bg-subtle);
  color: var(--zt-text);
  border-color: var(--zt-text-muted);
}

.zt-spg__bulk-status {
  font-size: 0.82rem;
  margin-bottom: 10px;
  min-height: 1.4em;
}

.zt-spg__bulk-list {
  border: 1px solid var(--zt-border);
  border-radius: var(--zt-radius);
  max-height: 340px;
  overflow-y: auto;
}

.zt-spg__bulk-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--zt-border);
}

.zt-spg__bulk-row:last-child {
  border-bottom: none;
}

.zt-spg__bulk-num {
  font-size: 0.75rem;
  color: var(--zt-text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 22px;
  flex-shrink: 0;
}

.zt-spg__bulk-pw {
  font-family: var(--zt-font-mono, monospace);
  font-size: 0.88rem;
  color: var(--zt-text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zt-spg__bulk-copy {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
}

.zt-spg__bulk-note {
  font-size: 0.78rem;
  color: var(--zt-text-muted);
  margin-top: 6px;
}

/* ── Settings save ────────────────────────────────────────── */

.zt-spg__settings-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-top: 1px solid var(--zt-border);
}

.zt-spg__settings-save {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--zt-text-muted);
  cursor: pointer;
  user-select: none;
}

.zt-spg__settings-save input[type="checkbox"] {
  accent-color: var(--zt-brand, #2563eb);
  cursor: pointer;
}

.zt-spg__settings-saved-badge {
  font-size: 0.76rem;
  color: #16a34a;
  display: none;
}

.zt-spg__settings-saved-badge.is-visible {
  display: inline;
}

.zt-spg__settings-reset {
  font-size: 0.78rem;
  color: var(--zt-text-muted);
  background: none;
  border: none;
  padding: 2px 4px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
  display: none;
}

.zt-spg__settings-reset.is-visible {
  display: inline;
}

.zt-spg__settings-reset:hover {
  color: var(--zt-text);
}

/* ── Layout zones ─────────────────────────────────────────── */

.zt-spg__config-zone {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.zt-spg__output-zone {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 2px solid var(--zt-border);
}

/* "Length" label before the stepper */
.zt-spg__config-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--zt-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  margin-right: 4px;
}

.zt-spg__length-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Tabs sit flush at top of output zone — remove top margin */
.zt-spg__output-zone .zt-spg__tabs {
  margin-bottom: 16px;
}

/* Single panel: small top gap */
#zt-spg-panel-single,
#zt-spg-panel-bulk {
  padding-top: 4px;
}
