body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  font-size: 14px;
  color: #172b4d;
  margin: 0;
  padding: 8px 12px;
}

h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
}

p {
  margin: 4px 0 8px 0;
  line-height: 1.4;
}

.btn {
  display: inline-block;
  padding: 8px 16px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background-color: #0079bf;
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background-color: #026aa7;
}

.btn-secondary {
  background-color: #ebecf0;
  color: #172b4d;
}

.btn-secondary:hover:not(:disabled) {
  background-color: #dfe1e6;
}

.btn-warning {
  background-color: #e2b203;
  color: #172b4d;
}

.btn-warning:hover:not(:disabled) {
  background-color: #cf9f02;
}

.btn-danger {
  background-color: #eb5a46;
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background-color: #cf513d;
}

.auth-container {
  text-align: center;
  padding: 16px;
}

/* --- Fullscreen settings layout --- */

.settings-page {
  display: flex;
  gap: 32px;
  padding: 24px;
  min-height: calc(100vh - 48px);
}

.settings-sidebar {
  flex: 0 0 360px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.preview-panel {
  flex: 1;
  border-left: 1px solid #dfe1e6;
  padding-left: 32px;
  min-width: 0;
}

/* Source board */

.source-board {
  background: #e4f0f6;
  border: 1px solid #b3d4e8;
  border-radius: 6px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.source-board .badge {
  background: #0079bf;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  white-space: nowrap;
}

.source-board .board-name {
  font-weight: 600;
  font-size: 15px;
}

/* Board list */

.section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: #5e6c84;
  letter-spacing: 0.04em;
  margin: 0 0 6px 0;
}

.boards-list {
  border: 1px solid #dfe1e6;
  border-radius: 3px;
  padding: 4px;
  max-height: 300px;
  overflow-y: auto;
}

.board-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 3px;
  cursor: pointer;
}

.board-item:hover {
  background-color: #f4f5f7;
}

.board-item input[type="checkbox"] {
  margin: 0;
}

/* Options */

.option-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background-color: #c1c7d0;
  border-radius: 22px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #eb5a46;
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

.option-text .option-title {
  font-weight: 500;
  margin-bottom: 2px;
}

.option-text .option-desc {
  font-size: 12px;
  color: #5e6c84;
  line-height: 1.4;
}

.deletion-warning {
  background: #fffae6;
  border: 1px solid #ffe380;
  border-radius: 3px;
  padding: 8px 12px;
  font-size: 12px;
  color: #7a6c0a;
  margin-top: 6px;
  display: none;
}

/* Actions */

.settings-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Last sync */

.last-sync {
  font-size: 12px;
  color: #5e6c84;
}

/* Warning / auth */

.warning {
  background-color: #fffae6;
  border: 1px solid #ffe380;
  border-radius: 3px;
  padding: 12px;
  text-align: center;
}

.loading {
  color: #5e6c84;
  text-align: center;
  font-style: italic;
}

.error {
  color: #eb5a46;
}

/* --- Preview panel --- */

.preview-placeholder {
  color: #5e6c84;
  text-align: center;
  padding: 60px 20px;
  font-size: 15px;
}

.preview-summary {
  background: #f4f5f7;
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 20px;
  font-weight: 500;
}

.preview-summary .count-create {
  color: #36b37e;
}

.preview-summary .count-delete {
  color: #eb5a46;
}

.preview-board {
  margin-bottom: 20px;
  border: 1px solid #dfe1e6;
  border-radius: 6px;
  overflow: hidden;
}

.preview-board-header {
  background: #f4f5f7;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 14px;
  border-bottom: 1px solid #dfe1e6;
}

.preview-board-body {
  padding: 12px 14px;
}

.preview-group-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: #5e6c84;
  margin: 0 0 8px 0;
}

.preview-group-title.create { color: #36b37e; }
.preview-group-title.delete { color: #eb5a46; }

.preview-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.label-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 13px;
  border: 1px solid #dfe1e6;
  background: #fff;
}

.label-badge.to-create {
  border-color: #36b37e;
  background: #e3fcef;
}

.label-badge.to-delete {
  border-color: #eb5a46;
  background: #ffebe6;
  text-decoration: line-through;
}

.label-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.preview-no-changes {
  color: #5e6c84;
  font-style: italic;
}

.preview-actions {
  margin-top: 20px;
  display: flex;
  gap: 8px;
}

.preview-sync-result {
  padding: 12px 16px;
  border-radius: 6px;
  margin-top: 16px;
  font-weight: 500;
}

.preview-sync-result.success {
  background: #e3fcef;
  color: #006644;
}

.preview-sync-result.error {
  background: #ffebe6;
  color: #bf2600;
}

/* --- Billing --- */

.billing-wall-content {
  max-width: 400px;
  margin: 60px auto;
  text-align: center;
  padding: 40px 24px;
}

.billing-wall-content h2 {
  font-size: 24px;
  margin: 0 0 8px 0;
}

.billing-price {
  font-size: 36px;
  font-weight: 700;
  color: #0079bf;
  margin: 20px 0;
}

.billing-price span {
  font-size: 16px;
  font-weight: 400;
  color: #5e6c84;
}

.billing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
  text-align: left;
}

.billing-features li {
  padding: 6px 0;
  padding-left: 24px;
  position: relative;
}

.billing-features li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: #36b37e;
  font-weight: 700;
}

.billing-note {
  font-size: 12px;
  color: #5e6c84;
  margin-top: 12px;
}

.billing-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  font-size: 13px;
}

.billing-banner-inner.trialing {
  background: #e4f0f6;
  border-bottom: 1px solid #b3d4e8;
}

.billing-banner-inner.past_due {
  background: #ffebe6;
  border-bottom: 1px solid #eb5a46;
}

.billing-banner-inner.active {
  background: #e3fcef;
  border-bottom: 1px solid #36b37e;
}

.billing-banner-inner .manage-link {
  color: #0079bf;
  cursor: pointer;
  text-decoration: underline;
  background: none;
  border: none;
  font-size: 13px;
}

/* Responsive */

@media (max-width: 700px) {
  .settings-page {
    flex-direction: column;
  }

  .settings-sidebar {
    flex: none;
  }

  .preview-panel {
    border-left: none;
    border-top: 1px solid #dfe1e6;
    padding-left: 0;
    padding-top: 20px;
  }
}
