/* Settings page (3.1.3). Loaded only on wpcbl-check-for-broken-links-settings. */

.cbl-st {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  --cbl-st-ink-panel: #1f1447;
  --cbl-st-on-ink: #c9c1f0;
  /* Matches .cbl-main-content, so the sticky tabs read as part of the page. */
  --cbl-st-page: #f9f8ff;
}

/* Connection bar */
.cbl-st-conn {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  background: var(--cbl-bg-primary);
  border: 1px solid var(--cbl-border-color);
  border-radius: var(--cbl-radius-lg);
  padding: 14px 18px;
}
.cbl-st-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c3c4c7;
  box-shadow: 0 0 0 4px #f0f0f1;
  flex-shrink: 0;
}
.cbl-st-dot.is-on {
  background: var(--cbl-green);
  box-shadow: 0 0 0 4px var(--cbl-green-bg);
}
.cbl-st-conn-text {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  font-size: 13px;
  line-height: 1.5;
}
.cbl-st-conn-text strong {
  font-weight: 600;
  color: var(--cbl-text-primary);
}
.cbl-st-conn-text span {
  color: var(--cbl-text-secondary);
  overflow-wrap: anywhere;
}
.cbl-st-conn-link {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--cbl-purple);
  text-decoration: none;
}
.cbl-st-conn-link:hover {
  color: var(--cbl-purple-dark);
  text-decoration: underline;
}
.cbl-st-menu {
  position: relative;
}
.cbl-st-menu summary {
  list-style: none;
  width: 32px;
  height: 32px;
  border: 1px solid var(--cbl-border-color);
  border-radius: var(--cbl-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  color: var(--cbl-text-secondary);
  background: var(--cbl-bg-primary);
}
.cbl-st-menu summary::-webkit-details-marker {
  display: none;
}
.cbl-st-menu summary:hover,
.cbl-st-menu[open] summary {
  border-color: #8c8f94;
}
.cbl-st-menu-panel {
  position: absolute;
  right: 0;
  top: 38px;
  z-index: 20;
  min-width: 190px;
  background: var(--cbl-bg-primary);
  border: 1px solid var(--cbl-border-color);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 6px;
  display: flex;
  flex-direction: column;
}
.cbl-st-menu-panel form {
  margin: 0;
}
.cbl-st-menu-panel button {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  background: none;
  border-radius: var(--cbl-radius-sm);
  font: inherit;
  font-size: 13px;
  color: var(--cbl-text-primary);
  cursor: pointer;
}
.cbl-st-menu-panel button:hover {
  background: var(--cbl-bg-secondary);
}
.cbl-st-menu-panel button.is-danger {
  color: #b32d2e;
}
.cbl-st-menu-panel button.is-danger:hover {
  background: var(--cbl-red-bg);
}

/* Section tabs + autosave state */
.cbl-st-tabs {
  position: sticky;
  top: 32px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--cbl-st-page);
  border-bottom: 1px solid var(--cbl-border-color);
  padding: 4px 0 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.cbl-st-tabs::-webkit-scrollbar {
  display: none;
}
.cbl-st-tabs a {
  padding: 10px 14px;
  font-size: 14px;
  color: var(--cbl-text-secondary);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.cbl-st-tabs a:hover {
  color: var(--cbl-text-primary);
}
.cbl-st-tabs a:focus-visible {
  outline: 2px solid var(--cbl-purple);
  outline-offset: -2px;
  box-shadow: none;
}
.cbl-st-tabs a.is-active {
  color: var(--cbl-text-primary);
  font-weight: 600;
  border-bottom-color: var(--cbl-purple);
}
.cbl-st-autosave {
  margin-left: auto;
  padding: 0 4px 0 16px;
  font-size: 13px;
  color: var(--cbl-text-hint);
  white-space: nowrap;
}
.cbl-st-autosave.is-saved {
  color: var(--cbl-green);
}

/* Section cards and rows */
.cbl-st-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.cbl-st-card {
  background: var(--cbl-bg-primary);
  border: 1px solid var(--cbl-border-color);
  border-radius: var(--cbl-radius-lg);
  scroll-margin-top: 96px;
}
.cbl-st-card > h2 {
  margin: 0;
  padding: 18px 24px;
  font-size: 15px;
  font-weight: 600;
  color: var(--cbl-text-primary);
  border-bottom: 1px solid #f0f0f1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cbl-st-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px 32px;
  padding: 20px 24px;
}
.cbl-st-row + .cbl-st-row {
  border-top: 1px solid #f0f0f1;
}
.cbl-st-row-flat {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.cbl-st-row-flat .cbl-st-label {
  flex: 1;
  min-width: 240px;
}
.cbl-st-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cbl-st-label strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--cbl-text-primary);
}
.cbl-st-label strong label {
  cursor: default;
}
.cbl-st-label span {
  font-size: 13px;
  line-height: 1.5;
  color: var(--cbl-text-secondary);
}
.cbl-st-control {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
}
.cbl-st-inline {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.cbl-st-stack {
  gap: 12px;
}
.cbl-st-help {
  margin: 0;
  font-size: 13px;
  color: var(--cbl-text-secondary);
}
.cbl-st-pro,
.cbl-st-seg em {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--cbl-purple);
}
.cbl-st-card > h2 .cbl-st-pro {
  background: var(--cbl-purple-bg);
  padding: 3px 7px;
  border-radius: 999px;
}

/* Segmented control: radios (Pro, links per scan) or buttons (free schedule) */
.cbl-st-seg {
  display: inline-flex;
  flex-wrap: wrap;
  background: #f0f0f1;
  border-radius: var(--cbl-radius-md);
  padding: 3px;
  gap: 2px;
}
.cbl-st-seg label,
.cbl-st-seg button {
  position: relative;
  margin: 0;
}
.cbl-st-seg input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.cbl-st-seg label span,
.cbl-st-seg button {
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--cbl-radius-sm);
  background: transparent;
  color: var(--cbl-text-secondary);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cbl-st-seg label:hover input:not(:checked) + span,
.cbl-st-seg button:not(.is-on):hover {
  color: var(--cbl-text-primary);
  background: rgba(255, 255, 255, 0.6);
}
.cbl-st-seg input:checked + span,
.cbl-st-seg button.is-on {
  background: var(--cbl-bg-primary);
  color: var(--cbl-text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.cbl-st-seg input:focus-visible + span,
.cbl-st-seg button:focus-visible {
  outline: 2px solid var(--cbl-purple);
  outline-offset: 1px;
}
.cbl-st-nudge {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--cbl-text-secondary);
  background: var(--cbl-purple-bg);
  border-radius: var(--cbl-radius-md);
  padding: 10px 12px;
}
.cbl-st-nudge a {
  font-weight: 600;
  color: var(--cbl-purple);
}

.cbl-st-when {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.cbl-st-when[hidden],
.cbl-st-affix[hidden],
.cbl-st-field[hidden],
.cbl-st-nudge[hidden] {
  display: none;
}
.cbl-st-when label,
.cbl-st-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--cbl-text-secondary);
}
.cbl-st-field {
  width: 100%;
}
.cbl-st-field small {
  font-size: 12px;
  color: var(--cbl-text-hint);
}

/* Inputs */
.cbl-st .cbl-st-input,
.cbl-st .cbl-st-textarea,
.cbl-st .cbl-st-affix input {
  border: 1px solid #c3c4c7;
  border-radius: var(--cbl-radius-md);
  font-size: 14px;
  color: var(--cbl-text-primary);
  background: var(--cbl-bg-primary);
  box-shadow: none;
}
.cbl-st .cbl-st-input {
  min-height: 38px;
  padding: 0 12px;
  max-width: 100%;
}
.cbl-st .cbl-st-field .cbl-st-input {
  width: 100%;
  max-width: 420px;
}
.cbl-st .cbl-st-textarea {
  width: 100%;
  padding: 10px 12px;
  font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  resize: vertical;
}
.cbl-st .cbl-st-input:focus,
.cbl-st .cbl-st-textarea:focus,
.cbl-st .cbl-st-affix input:focus {
  border-color: var(--cbl-purple);
  box-shadow: 0 0 0 3px var(--cbl-purple-bg);
  outline: none;
}
.cbl-st-affix {
  display: inline-flex;
  align-items: stretch;
  height: 38px;
}
.cbl-st .cbl-st-affix input {
  width: 80px;
  border-radius: var(--cbl-radius-md) 0 0 var(--cbl-radius-md);
  padding: 0 12px;
  margin: 0;
}
.cbl-st-affix span {
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 13px;
  color: var(--cbl-text-secondary);
  background: #f6f7f7;
  border: 1px solid #c3c4c7;
  border-left: 0;
  border-radius: 0 var(--cbl-radius-md) var(--cbl-radius-md) 0;
}

/* Content type chips (checkboxes) */
.cbl-st-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cbl-st-chip {
  position: relative;
  height: 34px;
  padding: 0 14px 0 10px;
  border-radius: 999px;
  border: 1px solid #c3c4c7;
  background: var(--cbl-bg-primary);
  color: var(--cbl-text-secondary);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cbl-st-chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.cbl-st-chip-tick {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #dcdcde;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cbl-st-chip:hover {
  border-color: #8c8f94;
  color: var(--cbl-text-primary);
}
.cbl-st-chip:has(input:checked) {
  border-color: var(--cbl-purple);
  background: var(--cbl-purple-bg);
  color: var(--cbl-purple-text);
}
.cbl-st-chip:has(input:checked) .cbl-st-chip-tick {
  background: var(--cbl-purple);
}
.cbl-st-chip:has(input:checked) .cbl-st-chip-tick::after {
  content: "";
  width: 7px;
  height: 4px;
  border: solid #fff;
  border-width: 0 0 2px 2px;
  transform: translateY(-1px) rotate(-45deg);
}
.cbl-st-chip:has(input:focus-visible) {
  outline: 2px solid var(--cbl-purple);
  outline-offset: 1px;
}

/* Toggles */
.cbl-st-toggle {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}
.cbl-st-switch-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.cbl-st-switch {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #c3c4c7;
  padding: 2px;
  flex-shrink: 0;
  display: flex;
  box-sizing: border-box;
  transition: background 0.15s;
}
.cbl-st-switch::after {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s;
}
.cbl-st-toggle:hover .cbl-st-switch-input:not(:checked) + .cbl-st-switch {
  background: #a7aaad;
}
.cbl-st-switch-input:checked + .cbl-st-switch {
  background: var(--cbl-purple);
}
.cbl-st-switch-input:checked + .cbl-st-switch::after {
  transform: translateX(16px);
}
.cbl-st-switch-input:focus-visible + .cbl-st-switch {
  outline: 2px solid var(--cbl-purple);
  outline-offset: 2px;
}
.cbl-st-toggle-text {
  font-size: 14px;
  line-height: 20px;
  color: var(--cbl-text-primary);
}
.cbl-st-toggle-text small {
  display: block;
  font-size: 13px;
  line-height: 1.5;
  color: var(--cbl-text-secondary);
}

.cbl-st-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cbl-st-outline {
  height: 34px;
  padding: 0 14px;
  border-radius: var(--cbl-radius-md);
  border: 1px solid var(--cbl-purple);
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--cbl-purple);
  text-decoration: none;
  white-space: nowrap;
}
.cbl-st-outline:hover {
  background: var(--cbl-purple-bg);
  color: var(--cbl-purple-dark);
}

/* Free: Pro panel */
.cbl-st-upsell {
  background: var(--cbl-st-ink-panel);
  color: #fff;
  border-radius: var(--cbl-radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-margin-top: 96px;
}
.cbl-st-upsell-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}
.cbl-st-upsell-head > div {
  flex: 1;
  min-width: 240px;
}
.cbl-st-upsell h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
}
.cbl-st-upsell p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--cbl-st-on-ink);
}
.cbl-st-upsell-btn {
  height: 38px;
  padding: 0 18px;
  border-radius: var(--cbl-radius-md);
  background: #fff;
  color: var(--cbl-st-ink-panel);
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.cbl-st-upsell-btn:hover {
  background: var(--cbl-purple-bg);
  color: var(--cbl-st-ink-panel);
}
.cbl-st-upsell ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px 24px;
}
.cbl-st-upsell li {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--cbl-st-on-ink);
}
.cbl-st-upsell li strong {
  display: block;
  font-weight: 600;
  color: #fff;
}


@media (max-width: 782px) {
  .cbl-st-tabs {
    top: 46px;
  }
  .cbl-st-autosave {
    display: none;
  }
  .cbl-st-row {
    padding: 16px;
  }
  .cbl-st-card > h2 {
    padding: 16px;
  }
}

/* Below 600px the WordPress admin bar scrolls away, so nothing sits above the tabs. */
@media (max-width: 600px) {
  .cbl-st-tabs {
    top: 0;
  }
}
