/* ============================================
   Wardpair Admin Styles
   Version: 1.0.0
   ============================================ */

/* ── CSS Variables ───────────────────────────────────────────────────────── */
:root {
  --color-background-primary: #ffffff;
  --color-background-secondary: #f9fafb;
  --color-text-primary: #1e293b;
  --color-text-secondary: #475569;
  --color-text-tertiary: #94a3b8;
  --color-border-primary: #e2e8f0;
  --color-border-secondary: #cbd5e1;
  --color-border-tertiary: #e2e8f0;
  --border-radius-sm: 6px;
  --border-radius-md: 8px;
  --border-radius-lg: 12px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
}

/* ── Base Layout ─────────────────────────────────────────────────────────── */
.swp-wrap {
  max-width: 100% !important;
  margin: 20px 20px 0 0;
  font-family: var(--font-sans);
}

.swp-page-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 24px;
  font-weight: 600;
}

.swp-page-title .swp-page-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: block;
}

.swp-page-title .dashicons {
  font-size: 28px;
  width: 28px;
  height: 28px;
  color: #0c447c;
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.swp-tabs.nav-tab-wrapper {
  margin-bottom: 0;
  border-bottom: 1px solid #c3c4c7;
}

.swp-tabs .nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-bottom: 2px solid transparent;
  background-color: #185fa5;
  color: #fff;
  transition: all 0.2s;
}

.swp-tabs .nav-tab:hover {
  color: var(--color-text-primary);
  background: var(--color-background-secondary);
}

.swp-tabs .nav-tab-active {
  border-bottom-color: #185fa5;
  color: #185fa5;
  background-color: transparent;
}

.swp-tabs .nav-tab .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
}

.swp-tab-content {
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--color-border-tertiary);
  padding-top: 20px;
}

/* Shared responsive-table wrapper — horizontal scroll instead of cramped/
   overflowing columns on narrow screens. Wrap a wide <table> in
   <div class="swp-table-responsive"> to use it. */
.swp-table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.swp-table-responsive table { min-width: 560px; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.swp-card {
  background: #fff;
  border: 1px solid var(--color-border-tertiary);
  border-radius: var(--border-radius-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.swp-card h2 {
  font-size: 15px;
  margin-top: 0;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f1;
  color: #1d2327;
}

/* Single definition of card-header used everywhere */
.swp-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border-tertiary);
}

.swp-card-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  border: none;
  padding: 0;
}

.swp-card-header .dashicons {
  color: #185fa5;
  font-size: 20px;
  width: 20px;
  height: 20px;
}

/* ── Grid System ─────────────────────────────────────────────────────────── */
.swp-grid { display: grid; gap: 20px; }
.swp-grid--2col { grid-template-columns: 1fr 1fr; }

/* ── Forms — single definition ───────────────────────────────────────────── */
.swp-form-group { margin-bottom: 20px; }

.swp-form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--color-text-primary);
}

.swp-form-group input[type="text"],
.swp-form-group input[type="email"],
.swp-form-group input[type="password"],
.swp-form-group input[type="url"],
.swp-form-group select,
.swp-form-group textarea {
  width: 100%;
  max-width: 400px;
  padding: 8px 12px;
  border: 1px solid var(--color-border-secondary);
  border-radius: var(--border-radius-md);
  font-size: 14px;
}

.swp-form-group .description {
  margin-top: 4px;
  font-size: 12px;
  color: var(--color-text-tertiary);
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.swp-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--border-radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.swp-button-primary { background: #185fa5; color: #fff; }
.swp-button-primary:hover { background: #0c447c; color: #fff; }

.swp-button-secondary {
  background: transparent;
  border-color: var(--color-border-secondary);
  color: var(--color-text-secondary);
}
.swp-button-secondary:hover {
  background: var(--color-background-secondary);
  color: var(--color-text-primary);
}

.swp-button-danger { background: #dc2626; color: #fff; }
.swp-button-danger:hover { background: #b91c1c; }

.swp-btn-danger {
  background: #d63638 !important;
  border-color: #d63638 !important;
  color: #fff !important;
}
.swp-btn-danger:hover {
  background: #b32d2e !important;
  border-color: #b32d2e !important;
}

.swp-btn-danger-outline { color: #d63638 !important; border-color: #d63638 !important; }
.swp-btn-danger-outline:hover { background: #d63638 !important; color: #fff !important; }

/* ── Status Indicators ───────────────────────────────────────────────────── */
.swp-status-banner {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  border-left-width: 4px;
  border-left-style: solid;
  gap: 20px;
  flex-wrap: wrap;
  row-gap: 12px;
}

.swp-status--green { border-left-color: #00a32a; }
.swp-status--amber { border-left-color: #dba617; }
.swp-status--red   { border-left-color: #d63638; }
.swp-status--grey  { border-left-color: #8c8f94; }

.swp-status-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #c3c4c7;
  flex-shrink: 0;
}

.swp-status--green .swp-status-dot { background: #00a32a; box-shadow: 0 0 0 3px rgba(0,163,42,.15); }
.swp-status--amber .swp-status-dot { background: #dba617; box-shadow: 0 0 0 3px rgba(219,166,23,.15); }
.swp-status--red   .swp-status-dot { background: #d63638; box-shadow: 0 0 0 3px rgba(214,54,56,.15); }
.swp-status--grey  .swp-status-dot { background: #8c8f94; box-shadow: 0 0 0 3px rgba(140,143,148,.15); }

/* Zone 1: dot + label + timestamp — never truncates, shrinks last */
.swp-status-primary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 240px;
}

.swp-status-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.swp-status-text {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.swp-status-subtext {
  font-size: 12px;
  color: #787c82;
}

/* Divider between the two zones — hidden once the banner stacks */
.swp-status-divider {
  width: 1px;
  align-self: stretch;
  background: #dcdcde;
  flex-shrink: 0;
}

/* Zone 2: role + partner link — the piece that used to wrap raggedly */
.swp-status-connection {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 0 1 auto;
}

.swp-partner-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 280px;
  padding: 4px 12px;
  background: #f6f7f7;
  border: 1px solid #e2e4e7;
  border-radius: 20px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #2271b1;
  text-decoration: none;
  overflow: hidden;
  white-space: nowrap;
  min-width: 0;
}

.swp-partner-link:hover { background: #eef1f4; color: #135e96; text-decoration: none; }

.swp-partner-link .dashicons {
  font-size: 14px;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.swp-partner-url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

@media (max-width: 600px) {
  .swp-status-divider { display: none; }
  .swp-status-connection { width: 100%; }
  .swp-partner-link { max-width: none; flex: 1 1 auto; }
}

.swp-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.swp-status-normal  { background: #eaf3de; color: #27500a; }
.swp-status-failed  { background: #fee2e2; color: #991b1b; }
.swp-status-warning { background: #fef3c7; color: #92400e; }

.swp-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f0f0f1;
  padding: 3px 12px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  flex-shrink: 0;
  white-space: nowrap;
}

.swp-role-badge .dashicons {
  font-size: 13px;
  width: 13px;
  height: 13px;
}

.swp-role-badge--primary   { background: #eaf3de; color: #27500a; }
.swp-role-badge--secondary { background: #e7f1fb; color: #0a4b78; }
.swp-role-badge--none      { background: #f0f0f1; color: #50575e; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.swp-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.swp-badge--green { background: #edfaef; color: #00a32a; }
.swp-badge--amber { background: #fcf9e8; color: #996800; }

/* ── Check / Cross Icons ─────────────────────────────────────────────────── */
.swp-check { color: #00a32a; font-weight: 700; }
.swp-cross { color: #d63638; font-weight: 700; }
.swp-check-large { font-size: 48px; color: #00a32a; display: block; margin-bottom: 8px; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.swp-table { width: 100%; border-collapse: collapse; }
.swp-table th { width: 160px; text-align: left; font-weight: 600; color: #50575e; padding: 6px 0; }
.swp-table td { padding: 6px 0; }

.swp-backup-table .swp-backup-actions { white-space: nowrap; }
.swp-backup-table .swp-backup-actions .button { margin-right: 4px; }
.swp-backup-table .swp-backup-actions .dashicons { margin-top: 2px; }

/* Backup History header: bulk buttons wrap instead of overflowing on small screens. */
.swp-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
@media (max-width: 782px) {
  .swp-bulk-actions { width: 100%; }
  .swp-bulk-actions .button {
    flex: 1 1 auto;
    margin: 0;
    text-align: center;
    white-space: normal;
  }
}

/* ── Role Selector (dashboard) ───────────────────────────────────────────── */
.swp-role-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.swp-role-card {
  border: 2px solid #dcdcde;
  border-radius: 6px;
  padding: 20px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  text-align: center;
}

.swp-role-card:hover { border-color: #2271b1; box-shadow: 0 0 0 1px #2271b1; }
.swp-role-card .dashicons { font-size: 32px; width: 32px; height: 32px; color: #2271b1; margin-bottom: 8px; }
.swp-role-card h3 { margin: 8px 0 6px; font-size: 15px; }
.swp-role-card p  { margin: 0; color: #50575e; font-size: 13px; }

/* Mobile: stack the Primary and Secondary role cards, one above the other. */
@media (max-width: 782px) {
  .swp-role-cards { grid-template-columns: 1fr; }
  .swp-role-card  { padding: 16px; }
}

/* ── Token Display ───────────────────────────────────────────────────────── */
.swp-token-display {
  background: #f6f7f7;
  border: 1px solid #dcdcde;
  border-radius: 4px;
  padding: 16px;
  margin: 16px 0;
}

.swp-token-display label {
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  text-transform: uppercase;
  color: #50575e;
  letter-spacing: .5px;
}

.swp-copyable { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }

.swp-copyable code {
  flex: 1;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 3px;
  font-size: 13px;
  word-break: break-all;
}

.swp-token-expiry { color: #996800; }

/* ── Paired State ────────────────────────────────────────────────────────── */
.swp-paired-state   { text-align: center; padding: 20px 0; }
.swp-paired-state h2 { border: none; margin-bottom: 8px; }
.swp-paired-actions  { margin-top: 20px; }

/* ── AJAX Messages ───────────────────────────────────────────────────────── */
.swp-ajax-msg { display: inline-block; margin-left: 12px; font-size: 13px; vertical-align: middle; }
.swp-ajax-msg.is-success { color: #00a32a; }
.swp-ajax-msg.is-error   { color: #d63638; }

/* ── Notices ─────────────────────────────────────────────────────────────── */
.swp-notice-inline { margin: 0 0 16px !important; }

.swp-notice {
  padding: 12px;
  margin: 15px 0;
  border-left: 4px solid;
  border-radius: var(--border-radius-sm);
}

.swp-notice-success { background: #e8f5e9; border-left-color: #00a32a; }
.swp-notice-info    { background: #e7f1ff; border-left-color: #2271b1; }
.swp-notice-warning { background: #fff3e6; border-left-color: #dba617; }
.swp-notice .dashicons { font-size: 20px; width: 20px; height: 20px; }
.swp-notice a { margin-left: auto; text-decoration: none; }

/* ── Spinner ─────────────────────────────────────────────────────────────── */
@keyframes swp-spin { to { transform: rotate(360deg); } }
.swp-spin { display: inline-block; animation: swp-spin 1s linear infinite; }

/* ── Copy Field ──────────────────────────────────────────────────────────── */
.swp-copy-field { display: flex; gap: 10px; align-items: center; margin: 10px 0; }

.swp-copy-field code {
  flex: 1;
  padding: 8px;
  background: #f5f5f5;
  border-radius: 4px;
  font-family: monospace;
  font-size: 13px;
  word-break: break-all;
}

/* ── Dropzone ────────────────────────────────────────────────────────────── */
.swp-dropzone {
  border: 2px dashed var(--color-border-secondary);
  border-radius: var(--border-radius-lg);
  background: var(--color-background-secondary);
  padding: 40px 20px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.swp-dropzone.drag-over { border-color: #2271b1; background: #f0f8ff; }
.swp-dropzone-content   { pointer-events: none; }

.swp-dropzone-content .dashicons {
  font-size: 48px;
  width: 48px;
  height: 48px;
  color: var(--color-text-tertiary);
  margin-bottom: 12px;
}

.swp-dropzone-content p   { margin: 8px 0; color: var(--color-text-secondary); }
.swp-dropzone-or          { font-size: 12px; color: var(--color-text-tertiary); }
.swp-dropzone-content button { pointer-events: auto; margin-top: 8px; }

/* ── File Info ───────────────────────────────────────────────────────────── */
.swp-file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: #e8f5e9;
  border-radius: var(--border-radius-md);
  margin-top: 15px;
}

.swp-file-info .dashicons            { color: #00a32a; font-size: 20px; width: 20px; height: 20px; }
.swp-file-info #swp-file-name        { flex: 1; font-size: 13px; color: #1e293b; }
.swp-file-info #swp-clear-file       { padding: 0; margin: 0; color: #d63638; }
.swp-file-info #swp-clear-file .dashicons { font-size: 16px; width: 16px; height: 16px; color: #d63638; }

/* ============================================
   Welcome Page
   ============================================ */

.swp-welcome-wrap {
  font-family: 'DM Sans', var(--font-sans), sans-serif;
  background: var(--color-background-primary);
  max-width: 860px;
  margin: 20px auto 0;
  padding: 2rem 1.5rem 3rem;
  color: var(--color-text-primary);
}

.swp-welcome-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 0.5px solid var(--color-border-tertiary);
}

.swp-welcome-brand { display: flex; align-items: center; gap: 12px; }

.swp-welcome-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: block;
}

.swp-welcome-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--color-text-primary);
  margin: 0;
}

.swp-welcome-tagline { font-size: 13px; color: var(--color-text-secondary); margin-top: 2px; margin-bottom: 0; }

.swp-welcome-version {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--color-background-secondary);
  border: 0.5px solid var(--color-border-tertiary);
  color: var(--color-text-secondary);
  white-space: nowrap;
  margin-top: 4px;
}

.swp-welcome-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1.75rem;
  padding: 0.6rem 1rem;
  border-radius: var(--border-radius-md);
  background: #eaf3de;
  border: 0.5px solid #c0dd97;
  font-size: 13px;
  color: #27500a;
}

.swp-welcome-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #639922; flex-shrink: 0; }

/* Welcome Cards */
.swp-welcome-card {
  background: var(--color-background-secondary);
  border-radius: var(--border-radius-lg);
  border: 0.5px solid var(--color-border-tertiary);
  margin-bottom: 2rem;
  overflow: hidden;
  padding: 1.25rem;
}

.swp-welcome-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 0.5px solid var(--color-border-tertiary);
}

.swp-welcome-step-num {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-tertiary);
  background: var(--color-background-primary);
  padding: 3px 8px;
  border-radius: 20px;
  border: 0.5px solid var(--color-border-tertiary);
}

.swp-welcome-card-header h2 { font-size: 16px; font-weight: 600; margin: 0; color: var(--color-text-primary); }

.swp-welcome-section-desc { font-size: 13px; color: var(--color-text-secondary); margin-bottom: 1.25rem; line-height: 1.5; }

/* Welcome Progress Bar */
.swp-welcome-progress-wrap { margin-bottom: 1.25rem; }

.swp-welcome-progress-bar {
  height: 3px;
  background: var(--color-border-tertiary);
  border-radius: 2px;
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.swp-welcome-progress-fill { height: 100%; border-radius: 2px; background: #185fa5; transition: width 0.3s ease; }
.swp-welcome-progress-label { font-size: 11px; color: var(--color-text-tertiary); }

/* Welcome Checklist */
.swp-checklist { list-style: none; margin: 0; padding: 0; }

.swp-checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0.75rem 0;
  border-bottom: 0.5px solid var(--color-border-tertiary);
  cursor: pointer;
}

.swp-checklist-item:last-child { border-bottom: none; }

.swp-checklist-item .swp-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--color-border-secondary);
  background: var(--color-background-primary);
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  padding: 0;
}

.swp-checklist-item .swp-checkbox .dashicons { font-size: 12px; width: 12px; height: 12px; display: none; color: #ffffff; }
.swp-checklist-item.is-checked .swp-checkbox { background: #185fa5; border-color: #185fa5; }
.swp-checklist-item.is-checked .swp-checkbox .dashicons { display: block; }

.swp-checklist-text { flex: 1; }

.swp-checklist-label { font-size: 14px; color: var(--color-text-primary); line-height: 1.5; display: block; }
.swp-checklist-item.is-checked .swp-checklist-label { color: var(--color-text-secondary); text-decoration: line-through; }
.swp-checklist-hint { font-size: 12px; color: var(--color-text-tertiary); display: block; margin-top: 1px; }

/* Welcome Role Grid */
.swp-welcome-role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 1rem; }

.swp-welcome-role-card {
  border: 1.5px solid var(--color-border-tertiary);
  border-radius: var(--border-radius-lg);
  padding: 1.25rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--color-background-primary);
  position: relative;
}

.swp-welcome-role-card:hover { border-color: var(--color-border-secondary); background: var(--color-background-secondary); }
.swp-welcome-role-card.is-selected { border-color: #185fa5; border-width: 2px; background: #e6f1fb; }

.swp-welcome-role-radio {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--color-border-secondary);
  background: var(--color-background-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.swp-welcome-role-card.is-selected .swp-welcome-role-radio { border-color: #185fa5; background: #185fa5; }
.swp-welcome-role-card.is-selected .swp-welcome-role-radio::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #fff; display: block; }

.swp-welcome-role-badge { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 8px; border-radius: 20px; margin-bottom: 10px; display: inline-block; }
.swp-welcome-badge--primary   { background: #e6f1fb; color: #0c447c; }
.swp-welcome-badge--secondary { background: #eaf3de; color: #27500a; }

.swp-welcome-role-icon { position: absolute; top: 1.1rem; left: 1.1rem; font-size: 20px; width: 20px; height: 20px; color: var(--color-text-tertiary); }
.swp-welcome-role-name { font-size: 16px; font-weight: 600; margin-bottom: 5px; color: var(--color-text-primary); padding-left: 28px; }
.swp-welcome-role-desc { font-size: 13px; color: var(--color-text-secondary); line-height: 1.55; margin: 0; padding-left: 28px; }
.swp-welcome-role-saved { font-size: 12px; color: #639922; margin-top: 0.75rem; margin-bottom: 0; min-height: 24px; }

/* Welcome Flow */
.swp-welcome-flow {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-top: 0.5rem;
  background: var(--color-background-primary);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .swp-welcome-flow { flex-wrap: nowrap; }
}

.swp-welcome-flow-step { flex: 1; padding: 1rem; position: relative; display: flex; gap: 12px; align-items: flex-start; }

@media (min-width: 768px) {
  .swp-welcome-flow-step { border-right: 0.5px solid var(--color-border-tertiary); }
  .swp-welcome-flow-step:last-child { border-right: none; }
}

.swp-welcome-flow-arrow { display: flex; align-items: center; justify-content: center; padding: 0 0.5rem; color: var(--color-text-tertiary); }

@media (max-width: 767px) { .swp-welcome-flow-arrow { display: none; } }

.swp-welcome-flow-dot { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.swp-flow-dot--blue  { background: #b5d4f4; }
.swp-flow-dot--blue  .dashicons { color: #185fa5; font-size: 16px; width: 16px; height: 16px; }
.swp-flow-dot--teal  { background: #9fe1cb; }
.swp-flow-dot--teal  .dashicons { color: #0f6e56; font-size: 16px; width: 16px; height: 16px; }
.swp-flow-dot--amber { background: #fac775; }
.swp-flow-dot--amber .dashicons { color: #854f0b; font-size: 16px; width: 16px; height: 16px; }

.swp-welcome-flow-body { flex: 1; }
.swp-welcome-flow-num   { font-family: 'DM Mono', monospace; font-size: 10px; font-weight: 500; color: var(--color-text-tertiary); margin-bottom: 4px; display: block; letter-spacing: 0.04em; }
.swp-welcome-flow-title { font-size: 13px; font-weight: 600; color: var(--color-text-primary); display: block; margin-bottom: 3px; }
.swp-welcome-flow-desc  { font-size: 12px; color: var(--color-text-secondary); line-height: 1.5; display: block; }

/* Welcome Actions */
.swp-welcome-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-top: 1rem;
  border-top: 0.5px solid var(--color-border-tertiary);
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.swp-welcome-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--border-radius-md);
  background: #185fa5;
  color: #fff !important;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}

.swp-welcome-btn-primary:hover { background: #0c447c; color: #fff !important; }
.swp-welcome-btn-primary .dashicons { font-size: 16px; width: 16px; height: 16px; }

.swp-welcome-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--border-radius-md);
  background: transparent;
  color: var(--color-text-secondary) !important;
  font-size: 14px;
  font-weight: 500;
  border: 0.5px solid var(--color-border-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}

.swp-welcome-btn-secondary:hover { background: var(--color-background-secondary); color: var(--color-text-primary) !important; }
.swp-welcome-btn-secondary .dashicons { font-size: 16px; width: 16px; height: 16px; }

.swp-welcome-dismiss {
  margin-left: auto;
  font-size: 12px;
  color: var(--color-text-tertiary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: none;
  padding: 9px 12px;
}

.swp-welcome-dismiss:hover { color: var(--color-text-secondary); }

.swp-welcome-skip-container { margin-top: 30px; text-align: right; padding-top: 20px; border-top: 1px solid var(--color-border-tertiary); }

.swp-welcome-skip-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: transparent;
  border: 1px solid var(--color-border-secondary);
  border-radius: var(--border-radius-md);
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.swp-welcome-skip-btn .dashicons { font-size: 18px; width: 18px; height: 18px; }
.swp-welcome-skip-btn:hover { background: var(--color-background-secondary); border-color: #2271b1; color: #2271b1; }

/* ============================================
   Welcome Wizard
   ============================================ */

.swp-wizard-steps {
  display: flex;
  justify-content: space-between;
  margin: 30px 0;
}

.swp-wizard-step {
  flex: 1;
  text-align: center;
  padding: 15px;
  background: var(--color-background-secondary);
  margin: 0 5px;
  border-radius: var(--border-radius-md);
  position: relative;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--color-border-tertiary);
}

.swp-wizard-step.active { background: #2271b1; color: white; border-color: #2271b1; }

.swp-wizard-step .dashicons {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #00a32a;
  font-size: 16px;
  width: 16px;
  height: 16px;
}

.swp-step-num   { font-size: 24px; font-weight: bold; }
.swp-step-label { font-size: 12px; margin-top: 5px; }

.swp-wizard-panes   { position: relative; }
.swp-wizard-pane    { display: none; }
.swp-wizard-pane.active { display: block; }

/* Wizard Role Grid */
.swp-wizard-role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 20px 0; }

.swp-role-option {
  padding: 20px;
  border: 2px solid var(--color-border-tertiary);
  border-radius: var(--border-radius-lg);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.swp-role-option:hover   { border-color: #2271b1; background: var(--color-background-secondary); }
.swp-role-option.selected { border-color: #2271b1; background: #f0f8ff; }

.swp-role-option .dashicons { font-size: 48px; width: 48px; height: 48px; margin-bottom: 10px; color: #2271b1; }
.swp-role-option h3 { margin: 8px 0 6px; font-size: 16px; }
.swp-role-option p  { margin: 0; color: var(--color-text-secondary); font-size: 13px; }

.swp-role-option ul { text-align: left; margin-top: 10px; font-size: 13px; list-style: none; padding-left: 0; }
.swp-role-option ul li { margin: 5px 0; }

.swp-wizard-actions { margin-top: 20px; display: flex; align-items: center; gap: 10px; }

.swp-complete-card { text-align: center; }

.swp-complete-icon .dashicons { font-size: 64px; width: 64px; height: 64px; color: #00a32a; margin-bottom: 20px; }

.swp-complete-details { text-align: left; margin: 20px 0; padding: 15px; background: #f8f9fa; border-radius: var(--border-radius-md); }
.swp-complete-details ul { list-style: none; padding-left: 0; margin: 0; }
.swp-complete-details li { margin: 8px 0; }

/* ============================================
   Activity Monitor
   ============================================ */

.swp-activity-monitor { padding-bottom: 0; }

.swp-am-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f1;
  gap: 10px;
  flex-wrap: wrap;
}

.swp-am-title-row { display: flex; align-items: center; gap: 8px; }

.swp-am-title-row h2 { margin: 0; font-size: 15px; font-weight: 600; border: none; padding: 0; }

.swp-am-icon { color: #185fa5; font-size: 18px; width: 18px; height: 18px; }

.swp-am-clear-btn { display: inline-flex; align-items: center; gap: 4px; }
.swp-am-clear-btn .dashicons { font-size: 14px; width: 14px; height: 14px; margin-top: 1px; }

/* Status badge */
.swp-am-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 2px 9px;
  border-radius: 20px;
  transition: background .3s, color .3s;
}

.swp-am-badge--idle     { background: #f0f0f1; color: #50575e; }
.swp-am-badge--running  { background: #e6f1fb; color: #185fa5; }
.swp-am-badge--complete { background: #edfaef; color: #00a32a; }
.swp-am-badge--failed   { background: #fee2e2; color: #d63638; }
.swp-am-badge--unknown  { background: #fcf9e8; color: #996800; }

/* Step Tracker */
.swp-step-tracker {
  display: flex;
  align-items: center;
  margin: 0 0 20px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scrollbar-width: none;
}

.swp-step-tracker::-webkit-scrollbar { display: none; }

.swp-step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: 60px;
  transition: all .25s;
}

.swp-step-item span {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: #94a3b8;
  white-space: nowrap;
  transition: color .25s;
}

.swp-step-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  background: #fff;
  transition: border-color .3s, background .3s, box-shadow .3s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: transparent;
  font-weight: 700;
}

.swp-step-conn {
  flex: 1;
  height: 2px;
  min-width: 16px;
  background: #e2e8f0;
  margin-bottom: 22px;
  transition: background .4s;
  border-radius: 1px;
}

.swp-step-item.is-active .swp-step-dot {
  border-color: #185fa5;
  background: #185fa5;
  box-shadow: 0 0 0 4px rgba(24,95,165,.14);
}

.swp-step-item.is-active span { color: #185fa5; }

.swp-step-item.is-active .swp-step-dot::after {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: swp-pulse-dot 1.2s ease-in-out infinite;
}

@keyframes swp-pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.35); opacity: .7; }
}

.swp-step-item.is-done .swp-step-dot { border-color: #00a32a; background: #00a32a; color: #fff; }

.swp-step-item.is-done .swp-step-dot::after {
  content: '✓';
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  display: block;
  animation: none;
}

.swp-step-item.is-done span  { color: #00a32a; }
.swp-step-conn.is-done       { background: #00a32a; }
.swp-step-conn.is-active     { background: linear-gradient(90deg, #00a32a, #185fa5); }

.swp-step-item.is-failed .swp-step-dot { border-color: #d63638; background: #d63638; color: #fff; }

.swp-step-item.is-failed .swp-step-dot::after {
  content: '✕';
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  display: block;
  animation: none;
}

.swp-step-item.is-failed span { color: #d63638; }

/* Progress Bar */
.swp-am-progress-wrap { margin: 0 0 18px; }

.swp-am-progress-track { height: 10px; background: #f0f0f1; border-radius: 5px; overflow: hidden; }

.swp-am-progress-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, #185fa5 0%, #2271b1 100%);
  transition: width .5s ease;
  position: relative;
  overflow: hidden;
}

.swp-am-progress-fill.is-running::after {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 120%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.35) 50%, transparent 100%);
  animation: swp-shimmer 1.6s ease-in-out infinite;
}

@keyframes swp-shimmer {
  0%   { left: -150%; }
  100% { left: 200%; }
}

.swp-am-progress-fill.is-complete { background: linear-gradient(90deg, #00a32a, #3dbb65); }
.swp-am-progress-fill.is-failed   { background: linear-gradient(90deg, #d63638, #e06060); }

.swp-am-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 7px;
  font-size: 12px;
  color: #50575e;
}

.swp-am-pct { font-weight: 700; font-size: 13px; color: #185fa5; transition: color .3s; min-width: 36px; text-align: right; }
.swp-am-pct.is-complete { color: #00a32a; }
.swp-am-pct.is-failed   { color: #d63638; }

/* Idle State */
.swp-am-idle { text-align: center; padding: 36px 20px 40px; color: #94a3b8; }

.swp-am-idle-icon { display: block; font-size: 40px; width: 40px; height: 40px; margin: 0 auto 12px; color: #c3c4c7; }

.swp-am-idle p { margin: 0 auto; font-size: 13px; color: #94a3b8; max-width: 340px; line-height: 1.6; }

/* Activity Feed */
.swp-am-feed {
  border-top: 1px solid #f0f0f1;
  max-height: 260px;
  overflow-y: auto;
  scroll-behavior: smooth;
  background: #fafafa;
  border-radius: 0 0 8px 8px;
  margin: 0 -24px;
  padding: 0;
}

.swp-am-feed::-webkit-scrollbar { width: 4px; }
.swp-am-feed::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 4px; }

.swp-am-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 20px;
  border-bottom: 1px solid #f0f0f1;
  font-size: 12.5px;
  line-height: 1.5;
  animation: swp-line-in .18s ease;
  transition: background .15s;
}

.swp-am-line:last-child { border-bottom: none; }
.swp-am-line:hover      { background: #f5f5f5; }

@keyframes swp-line-in {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: none; }
}

.swp-am-line-icon { font-size: 13px; width: 13px; height: 13px; flex-shrink: 0; margin-top: 2px; }

.swp-am-line-time {
  font-size: 10px;
  color: #94a3b8;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
  font-family: 'Courier New', monospace;
  min-width: 58px;
}

.swp-am-line-msg { flex: 1; color: #1e293b; word-break: break-word; }

.swp-am-line.info    .swp-am-line-icon { color: #2271b1; }
.swp-am-line.success .swp-am-line-icon { color: #00a32a; }
.swp-am-line.error   .swp-am-line-icon { color: #d63638; }
.swp-am-line.warning .swp-am-line-icon { color: #996800; }

.swp-am-line.success .swp-am-line-msg { color: #00a32a; font-weight: 500; }
.swp-am-line.error   .swp-am-line-msg { color: #d63638; font-weight: 500; }
.swp-am-line.success { background: #f0fdf4; }
.swp-am-line.error   { background: #fff5f5; }

/* Mini Progress (Run Backup card) */
.swp-mini-progress-wrap  { margin-top: 4px; }
.swp-mini-progress-track { height: 8px; background: #f0f0f1; border-radius: 4px; overflow: hidden; }

.swp-mini-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #185fa5, #2271b1);
  transition: width .4s ease;
}

.swp-mini-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 5px;
  font-size: 12px;
  color: #50575e;
}

.swp-mini-progress-pct { font-weight: 600; color: #185fa5; }

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 782px) {
  .swp-grid--2col      { grid-template-columns: 1fr; }
  .swp-tabs.nav-tab-wrapper {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
  }
  .swp-tabs.nav-tab-wrapper::-webkit-scrollbar { display: none; }
  .swp-tabs .nav-tab   {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 6px 12px;
    font-size: 13px;
  }
  .swp-tab-content     { padding: 16px; }
  .swp-card            { padding: 16px; }
  .swp-wizard-role-grid { grid-template-columns: 1fr; }
  .swp-wizard-steps    { flex-wrap: wrap; gap: 10px; }
  .swp-wizard-step     { flex: auto; min-width: 80px; }
}

@media (max-width: 640px) {
  .swp-welcome-wrap           { padding: 1.5rem 1rem; }
  .swp-welcome-role-grid      { grid-template-columns: 1fr; }
  .swp-welcome-actions        { flex-direction: column; align-items: stretch; }
  .swp-welcome-dismiss        { margin-left: 0; justify-content: center; }
  .swp-welcome-skip-container { text-align: center; }
  .swp-welcome-role-name,
  .swp-welcome-role-desc      { padding-left: 0; }
  .swp-welcome-role-icon      { display: none; }
  .swp-am-feed                { margin: 0 -16px; }
  .swp-step-item              { min-width: 50px; }
}
/* ============================================
   Clone / Verify panel  (Pairing tab, primary)
   ============================================ */

.swp-clone-choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 18px 0 12px;
}

.swp-clone-choice {
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--color-border-primary);
  border-radius: var(--border-radius-md);
  background: var(--color-background-secondary);
}

/* The recommended option is the one that matches the pairing state — a fresh
   secondary gets "Full clone", one that already holds a copy gets
   "Check & repair". Marked visually so the faster, safer path is the one the
   eye lands on first. */
.swp-clone-choice.is-recommended {
  border-color: #2271b1;
  background: #f0f6fc;
  box-shadow: 0 0 0 1px #2271b1 inset;
}

.swp-clone-choice.is-recommended::before {
  content: 'Recommended';
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #2271b1;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.swp-clone-choice h3 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--color-text-primary);
}

.swp-clone-choice .description {
  flex: 1 1 auto;
  margin: 0 0 14px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

.swp-clone-choice .button { align-self: flex-start; }

.swp-clone-status {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--color-border-primary);
  border-radius: var(--border-radius-md);
  background: var(--color-background-primary);
}

.swp-clone-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--color-border-primary);
  overflow: hidden;
}

.swp-clone-bar {
  height: 100%;
  width: 0;
  background: #2271b1;
  border-radius: 999px;
  transition: width .4s ease;
}

/* A full clone reports progress through the activity log, not this bar, so
   it animates rather than pretending to know a percentage. */
.swp-clone-bar.is-indeterminate {
  background: linear-gradient(90deg, #2271b1 25%, #7eb6e8 50%, #2271b1 75%);
  background-size: 200% 100%;
  animation: swp-clone-shimmer 1.4s linear infinite;
  transition: none;
}

@keyframes swp-clone-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.swp-clone-message {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--color-text-primary);
}

.swp-clone-db-line {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: var(--border-radius-sm);
  font-size: 13px;
  line-height: 1.5;
}

.swp-clone-db-line.is-success {
  background: #f0f9f2;
  border-left: 3px solid #2ea043;
  color: #14532d;
}

.swp-clone-db-line.is-error {
  background: #fdf2f2;
  border-left: 3px solid #d63638;
  color: #7f1d1d;
}

.swp-clone-drift { margin-top: 12px; }

.swp-clone-drift summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.swp-clone-drift ul {
  margin: 10px 0 0;
  max-height: 260px;
  overflow-y: auto;
  padding: 10px 12px;
  border-radius: var(--border-radius-sm);
  background: var(--color-background-secondary);
  font-family: Menlo, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--color-text-secondary);
  word-break: break-all;
}

.swp-clone-drift li { margin: 0; list-style: none; }

@media (max-width: 782px) {
  .swp-clone-choices { grid-template-columns: 1fr; }
}

/* ============================================
   Pairing tab: layout, action rows, labels
   ============================================ */

.swp-section-label {
  margin: 26px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--color-border-primary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

/* Paired header and facts */
.swp-paired-head { display: flex; align-items: center; gap: 14px; }
.swp-paired-head h2 { margin: 0 0 2px; border: none; padding: 0; }
.swp-paired-icon {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #f0f9f2; color: #00a32a;
  font-size: 20px; font-weight: 700;
}
.swp-paired-sub { margin: 0; font-size: 13px; color: var(--color-text-secondary); }

.swp-paired-facts {
  margin: 18px 0 0;
  border: 1px solid var(--color-border-primary);
  border-radius: var(--border-radius-md);
  background: var(--color-background-secondary);
}
.swp-paired-facts > div {
  display: flex; gap: 16px; align-items: baseline;
  padding: 10px 14px;
}
.swp-paired-facts > div + div { border-top: 1px solid var(--color-border-primary); }
.swp-paired-facts dt { flex: 0 0 120px; margin: 0; font-size: 12px; color: var(--color-text-secondary); }
.swp-paired-facts dd { margin: 0; font-size: 13px; color: var(--color-text-primary); word-break: break-word; }

.swp-role-badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: #f0f6fc; color: #2271b1;
}
.swp-role-badge.is-secondary { background: #f3f0fa; color: #5b3fa0; }

/* Action rows: title and explanation left, button right */
.swp-action-list {
  border: 1px solid var(--color-border-primary);
  border-radius: var(--border-radius-md);
  overflow: hidden;
}
.swp-action-row {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 14px 16px;
  background: var(--color-background-primary);
}
.swp-action-row + .swp-action-row { border-top: 1px solid var(--color-border-primary); }
.swp-action-row.is-danger { background: #fdf8f8; }
.swp-action-text { flex: 1 1 auto; min-width: 0; }
.swp-action-text strong { display: block; font-size: 13px; color: var(--color-text-primary); }
.swp-action-text .description { margin: 4px 0 0; font-size: 12px; line-height: 1.5; color: var(--color-text-secondary); }
.swp-action-control { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.swp-action-control .swp-ajax-msg { margin-left: 0; max-width: 260px; text-align: right; }
.swp-action-control .button { white-space: normal; text-align: center; }

/* Recovery tools: folded away until a clone is running, paused or has failed */
.swp-recovery > summary {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
  list-style: none;
}
.swp-recovery > summary::-webkit-details-marker { display: none; }
.swp-recovery > summary::after {
  content: "+";
  font-size: 16px; font-weight: 400; letter-spacing: 0;
}
.swp-recovery[open] > summary::after { content: "\2212"; }
.swp-recovery:not([open]) > summary { margin-bottom: 0; }
.swp-recovery-intro { margin: 0 0 12px; font-size: 12px; }
.swp-recovery-result { display: block; margin: 10px 0 0; }
.swp-recovery-result:empty { display: none; }

/* Clone option cards: effect tags and fact lists */
.swp-effect-tag {
  align-self: flex-start;
  margin-bottom: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px; font-weight: 600;
}
.swp-effect-tag.is-safe       { background: #f0f9f2; color: #14532d; }
.swp-effect-tag.is-writes     { background: #fff8e5; color: #7a5200; }
.swp-effect-tag.is-overwrites { background: #fdf2f2; color: #7f1d1d; }

.swp-clone-facts { margin: 0 0 14px; padding: 0; list-style: none; font-size: 12px; line-height: 1.5; color: var(--color-text-primary); }
.swp-clone-facts li { margin: 0 0 4px; }
.swp-clone-facts li span {
  display: block;
  font-size: 10px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--color-text-tertiary);
}

/* Result line shown right after pressing a clone button */
#swp-clone-result {
  display: block;
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: var(--border-radius-sm);
  font-size: 13px; line-height: 1.5;
}
#swp-clone-result:empty { display: none; }
#swp-clone-result.is-success { background: #f0f6fc; border-left: 3px solid #2271b1; color: #1e293b; }
#swp-clone-result.is-error   { background: #fdf2f2; border-left: 3px solid #d63638; color: #7f1d1d; }

/* Unpaired: role cards and token steps */
.swp-role-card .swp-role-detail { margin-top: 8px; font-size: 12px; line-height: 1.5; }
.swp-role-cta { display: inline-block; margin-top: 12px; font-size: 12px; font-weight: 600; color: #2271b1; }
.swp-steps-list { margin: 8px 0 16px 20px; font-size: 13px; line-height: 1.6; }
.swp-action-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.swp-action-inline .swp-ajax-msg { margin-left: 0; }
.swp-action-inline .description { flex-basis: 100%; margin: 0; }

@media (max-width: 782px) {
  .swp-action-row { flex-direction: column; align-items: stretch; }
  .swp-action-control { align-items: flex-start; }
  .swp-action-control .swp-ajax-msg { text-align: left; }
  .swp-paired-facts > div { flex-direction: column; gap: 2px; }
  .swp-paired-facts dt { flex-basis: auto; }
}

/* ============================================
   Settings tab
   ============================================ */

.swp-settings { max-width: 980px; }

/* Intro + quick links */
.swp-settings-intro {
  margin: 20px 0;
  padding: 20px 24px;
  background: #f0f6fc;
  border: 1px solid #cfe0f1;
  border-left: 4px solid #185fa5;
  border-radius: var(--border-radius-lg);
}
.swp-settings-intro h2 { margin: 0 0 6px; font-size: 18px; color: var(--color-text-primary); }
.swp-settings-intro p  { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--color-text-secondary); max-width: 70ch; }

.swp-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.swp-jump a {
  padding: 4px 12px;
  background: #fff;
  border: 1px solid var(--color-border-secondary);
  border-radius: 999px;
  font-size: 12.5px;
  text-decoration: none;
  color: #185fa5;
  transition: background .15s, border-color .15s;
}
.swp-jump a:hover,
.swp-jump a:focus { background: #185fa5; border-color: #185fa5; color: #fff; }

/* Section cards */
.swp-section { scroll-margin-top: 48px; padding: 24px 28px; }

.swp-section__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}
.swp-section__head .dashicons {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: #185fa5;
  background: #e8f1fa;
  border-radius: var(--border-radius-md);
}
.swp-section .swp-section__head h2 {
  margin: 0; padding: 0; border: 0;
  font-size: 17px; font-weight: 600;
  color: var(--color-text-primary);
}
.swp-section__lead {
  margin: 0 0 18px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--color-text-secondary);
  max-width: 75ch;
}

/* Tags */
.swp-tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: .02em;
  vertical-align: middle;
}
.swp-tag--ok    { background: #e6f6ea; color: #137a2c; }
.swp-tag--warn  { background: #fff4de; color: #8a5a00; }
.swp-tag--pro   { background: #efe9ff; color: #5b34b5; }
.swp-tag--muted { background: #f1f5f9; color: #64748b; }

/* Form rows */
.swp-section .form-table { margin-top: 0; }
.swp-section .form-table tr { border-top: 1px solid #f1f5f9; }
.swp-section .form-table tr:first-child { border-top: 0; }
.swp-section .form-table th {
  width: 190px;
  padding: 18px 20px 18px 0;
  vertical-align: top;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-text-primary);
}
.swp-section .form-table td { padding: 16px 0; vertical-align: top; }
.swp-section .form-table .description,
.swp-section .description {
  margin: 8px 0 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: #64748b;
  font-style: normal;
}
.swp-section input[type="text"],
.swp-section input[type="email"],
.swp-section input[type="url"],
.swp-section input[type="password"],
.swp-section input[type="number"],
.swp-section select,
.swp-section textarea {
  border-color: var(--color-border-secondary);
  border-radius: var(--border-radius-sm);
  box-shadow: none;
}
.swp-section input:focus,
.swp-section select:focus,
.swp-section textarea:focus {
  border-color: #185fa5;
  box-shadow: 0 0 0 1px #185fa5;
}
.swp-section .regular-text { width: 100%; max-width: 420px; }
.swp-section textarea.code { font-size: 12.5px; line-height: 1.7; }
.swp-section .submit { margin: 4px 0 0; padding: 14px 0 0; border-top: 1px solid #f1f5f9; }

/* Number boxes and inline sentences */
.swp-num { width: 76px !important; text-align: center; }
.swp-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  font-size: 13.5px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}
.swp-inline--custom {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--color-background-secondary);
  border: 1px dashed var(--color-border-secondary);
  border-radius: var(--border-radius-md);
}
.swp-options + .swp-inline { margin-top: 14px; }
.swp-inline + .swp-options { margin-top: 12px; }

/* Selectable option cards */
.swp-options { display: flex; flex-direction: column; gap: 8px; }
.swp-options--tight { margin-top: 12px; }

.swp-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--color-border-primary);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.swp-option:hover { border-color: #93b8dc; background: #fafcff; }
.swp-option input[type="radio"] { margin: 3px 0 0; flex: 0 0 auto; }
.swp-option__body  { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.swp-option__title { font-size: 13.5px; font-weight: 600; color: var(--color-text-primary); }
.swp-option__desc  { font-size: 12.5px; line-height: 1.55; color: #64748b; }

.swp-option:has(input:checked) {
  border-color: #185fa5;
  background: #f0f6fc;
  box-shadow: 0 0 0 1px #185fa5 inset;
}
.swp-option:has(input:focus-visible) { outline: 2px solid #185fa5; outline-offset: 2px; }
.swp-option.is-disabled { opacity: .6; cursor: not-allowed; background: #f8fafc; }
.swp-option.is-disabled:hover { border-color: var(--color-border-primary); background: #f8fafc; }

/* Sub panels, notes, status lines */
.swp-subpanel {
  margin-bottom: 18px;
  padding: 14px 18px;
  background: var(--color-background-secondary);
  border: 1px solid var(--color-border-primary);
  border-radius: var(--border-radius-md);
}
.swp-subpanel h3 { margin: 0 0 6px; font-size: 13.5px; }
.swp-subpanel .description { margin: 0 0 10px; }
.swp-pause-on { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: #8a5a00; }
.swp-subpanel #swp-pause-reason { min-width: 200px; }

.swp-estimate {
  margin: 12px 0 0;
  padding: 8px 12px;
  background: #f0f6fc;
  border-left: 3px solid #185fa5;
  border-radius: var(--border-radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: #0c447c;
}
.swp-status-line { margin: 10px 0 0; font-size: 12.5px; color: #64748b; }

.swp-note {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-left: 3px solid #cbd5e1;
  border-radius: var(--border-radius-sm);
  background: #f8fafc;
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text-secondary);
}
.swp-note--info { background: #f0f6fc; border-left-color: #2271b1; }

.swp-format {
  margin: 8px 0;
}
.swp-format code {
  display: inline-block;
  padding: 6px 10px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: var(--border-radius-sm);
  font-size: 12px;
}
.swp-notes {
  margin: 8px 0 0 18px;
  list-style: disc;
  font-size: 12.5px;
  line-height: 1.6;
  color: #64748b;
}

/* Collapsible how-to guides */
.swp-guide {
  margin-top: 18px;
  background: #fffdf5;
  border: 1px solid #f1e6b8;
  border-radius: var(--border-radius-md);
  overflow: hidden;
}
.swp-guide > summary {
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #7a5b00;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.swp-guide > summary::-webkit-details-marker { display: none; }
.swp-guide > summary::before {
  content: "?";
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #e8c75b; color: #fff;
  font-size: 11px; font-weight: 700;
}
.swp-guide > summary::after {
  content: "+";
  margin-left: auto;
  font-size: 16px; font-weight: 400;
}
.swp-guide[open] > summary::after { content: "\2212"; }
.swp-guide[open] > summary { border-bottom: 1px solid #f1e6b8; }
.swp-guide > ol,
.swp-guide > ul { margin: 0; padding: 14px 20px 16px 38px; font-size: 13px; line-height: 1.7; color: #4b4b3a; }
.swp-guide > ul { list-style: disc; }
.swp-guide li + li { margin-top: 6px; }

/* Numbered step list with badges (Cloudflare) */
.swp-steps { list-style: none !important; counter-reset: swp-step; padding: 14px 20px 16px !important; margin: 0; }
.swp-steps > li {
  counter-increment: swp-step;
  position: relative;
  padding-left: 38px;
  min-height: 26px;
}
.swp-steps > li::before {
  content: counter(swp-step);
  position: absolute; left: 0; top: 0;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: #185fa5; color: #fff;
  font-size: 12px; font-weight: 700;
}
.swp-steps a { display: inline-block; margin-left: 6px; font-weight: 600; }

.swp-perm-table {
  margin: 10px 0 4px;
  border-collapse: collapse;
  background: #fff;
  font-size: 12.5px;
}
.swp-perm-table th,
.swp-perm-table td { padding: 6px 14px; border: 1px solid #e5dcb0; text-align: left; }
.swp-perm-table th { background: #faf3d6; font-weight: 600; }

/* Action rows and small controls */
.swp-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
}
.swp-actions .swp-ajax-msg,
.swp-actions .description { margin: 0 0 0 4px; }
.swp-remove { display: inline-block; margin-left: 12px; font-size: 12.5px; color: #64748b; }

/* License */
.swp-section .swp-table th { width: 140px; padding: 8px 0; }
.swp-upgrade { margin-left: 10px; font-weight: 600; text-decoration: none; }
.swp-danger-zone {
  margin-top: 18px;
  padding: 14px 18px;
  background: #fff8f8;
  border: 1px solid #f3caca;
  border-radius: var(--border-radius-md);
}
.swp-danger-zone h3 { margin: 0 0 4px; font-size: 13.5px; color: #b32d2e; }
.swp-danger-zone .description { margin: 0 0 12px; }

/* Narrow screens */
@media (max-width: 782px) {
  .swp-section { padding: 18px 16px; }
  .swp-section .form-table th,
  .swp-section .form-table td { display: block; width: 100%; padding: 0; }
  .swp-section .form-table th { padding-top: 14px; padding-bottom: 6px; }
  .swp-section .form-table td { padding-bottom: 14px; }
  .swp-section .regular-text { max-width: 100%; }
  .swp-settings-intro { padding: 16px; }
  .swp-perm-table { display: block; overflow-x: auto; }
}
/* ============================================
   Guided tour
   ============================================ */

.swp-page-title .swp-tour-launch { margin-left: 6px; font-size: 12px; font-weight: 400; }

.swp-tour-spot {
  position: fixed;
  z-index: 100000;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.55);
  pointer-events: none;
  transition: top 0.2s ease, left 0.2s ease, width 0.2s ease, height 0.2s ease;
}
.swp-tour-spot.is-center {
  inset: 0;
  border-radius: 0;
  box-shadow: none;
  background: rgba(15, 23, 42, 0.55);
}

.swp-tour-pop {
  position: fixed;
  z-index: 100001;
  box-sizing: border-box;
  width: 340px;
  max-width: calc(100vw - 24px);
  padding: 16px 18px;
  background: #fff;
  color: #1d2327;
  border-top: 3px solid #185fa5;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
.swp-tour-count { margin-bottom: 4px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: #646970; }
.swp-tour-title { margin: 0 0 6px; padding: 0; font-size: 16px; line-height: 1.3; }
.swp-tour-body  { margin: 0 0 14px; font-size: 13px; line-height: 1.55; color: #3c434a; }
.swp-tour-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.swp-tour-skip { margin-right: auto; }

@media (prefers-reduced-motion: reduce) {
  .swp-tour-spot { transition: none; }
}
/* ── Connections list ────────────────────────────────────────────────────── */
.swp-conn-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.swp-conn a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 12px;
  padding: 10px 12px;
  border: 1px solid var(--color-border-tertiary);
  border-radius: var(--border-radius-md, 6px);
  text-decoration: none;
  color: inherit;
}
.swp-conn a:hover, .swp-conn a:focus { border-color: #2271b1; }
.swp-conn.is-viewing a { border-color: #2271b1; box-shadow: 0 0 0 1px #2271b1; }
.swp-conn-host { font-weight: 600; overflow-wrap: anywhere; }
.swp-conn-state { font-size: 12px; color: #646970; white-space: nowrap; }
.swp-conn.is-live .swp-conn-state { color: #00a32a; font-weight: 600; }
.swp-conn-meta { grid-column: 1 / -1; font-size: 12px; color: #646970; }
@media (max-width: 600px) {
  .swp-conn a { grid-template-columns: minmax(0, 1fr); }
  .swp-conn-state { white-space: normal; }
}
/* Sync Log refresh button on phones: WordPress makes buttons taller below 783px,
   which leaves the icon sitting high. Centre the icon and the label together. */
@media (max-width: 782px) {
  #swp-sync-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }
  #swp-sync-refresh .dashicons {
    width: 16px !important;
    height: 16px !important;
    font-size: 16px !important;
    line-height: 1 !important;
    margin: 0;
  }
}

/* Sync Log header controls on phones: the dropdown and Refresh share one row inside the
   card. The "Filter:" word is hidden (the dropdown says what it is) to save width, and the
   dropdown is allowed to shrink so it can never push the button out of the card. */
@media (max-width: 782px) {
  .swp-sync-controls {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .swp-sync-controls label { display: none; }
  .swp-sync-controls .swp-sync-filter {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
  .swp-sync-controls .button { white-space: nowrap; }
}

/* Read by the Support tab's display check to tell that this file loaded and applies. */
.swp-wrap { --swp-css-loaded: 1; }