:root {
  --bg-primary: #f3f2ef;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-rail: #f9f8f5;
  --border-color: #ece9e3;
  --sidebar-inset-x: 16px;
  --text-main: #111827;
  --text-muted: #6b7280;
  --accent-color: #7d18ff;
  --accent-hover: #6944eb;
  --accent-light: rgba(125, 24, 255, 0.1);
  --success-color: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --warning-color: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --danger-color: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, 0.06);
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  width: min(100%, 400px);
  padding: 32px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
}

.login-brand {
  margin-bottom: 28px;
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login-card h1 {
  font-size: 22px;
  letter-spacing: -0.02em;
}

.login-intro {
  margin: 6px 0 24px;
  color: var(--text-muted);
  font-size: 13px;
}

.login-error {
  margin: -4px 0 16px;
  color: var(--danger-color);
  font-size: 13px;
}

.login-error:not(.is-error):not(.hidden) {
  color: var(--success-color);
}

.login-submit {
  width: 100%;
}

.login-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.login-footer a {
  color: var(--accent-color);
  font-weight: 600;
  text-decoration: none;
}

.login-footer a:hover {
  text-decoration: underline;
}

.plan-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.plan-option:has(input:checked) {
  border-color: var(--accent-color);
  background: #f8fbff;
}

.plan-option input {
  margin-top: 2px;
  accent-color: var(--accent-color);
}

.plan-option-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.login-card--signup {
  max-width: 440px;
}

.plan-option-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.plan-option-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.plan-option-price {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-color);
  white-space: nowrap;
}

.plan-option-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.plan-option-features {
  margin: 6px 0 0;
  padding-left: 16px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.plan-option-features li + li {
  margin-top: 2px;
}

.plan-soft-start-hint {
  margin: 10px 0 0;
}

.login-check-mail {
  text-align: center;
}

.login-check-mail p {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.onboarding-meta {
  margin: -8px 0 20px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.onboarding-meta strong {
  color: var(--text-main);
  font-weight: 600;
}

.text-center {
  text-align: center;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 6px;
}

.dashboard-container {
  display: flex;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

/* Icon rail */
.icon-rail {
  width: 76px;
  flex-shrink: 0;
  background: #ffffff;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 20px 0 0;
  position: sticky;
  top: 0;
  height: 100vh;
  align-self: flex-start;
}

.rail-section {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.rail-section-bottom {
  margin-top: auto;
  padding: 20px 0 24px;
  background: #ffffff;
}

.rail-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9ca3af;
  text-align: center;
  padding: 0 8px 14px;
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 0;
}

.rail-item {
  position: relative;
  width: 100%;
  height: 44px;
  border: none;
  background: transparent;
  color: #374151;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
  text-decoration: none;
  padding: 0;
}

.rail-indicator {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 24px;
  border-radius: 0 4px 4px 0;
  background: transparent;
  transition: background 0.15s ease;
}

.rail-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.rail-item svg {
  width: 20px;
  height: 20px;
}

.rail-item:hover {
  color: #111827;
}

.rail-item:hover .rail-icon-wrap {
  background: #f3f4f6;
}

.rail-item.active {
  color: var(--accent-color);
}

.rail-item.active .rail-indicator {
  background: var(--accent-color);
}

.rail-item.active .rail-icon-wrap {
  background: rgba(125, 24, 255, 0.12);
}

.rail-item-link {
  color: #374151;
}

.rail-item-link:hover {
  color: #111827;
}

.rail-download-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.rail-version {
  font-size: 9px;
  font-weight: 600;
  color: #9ca3af;
  letter-spacing: 0.02em;
  line-height: 1;
  margin-bottom: 2px;
}

/* Sidebar */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 0 var(--sidebar-inset-x) 20px;
  gap: 8px;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-height: 72px;
  padding: 16px 8px 18px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.portal-nav-toggle,
.portal-nav-close {
  display: none;
  flex-shrink: 0;
}

/* After .icon-btn (display:flex) so desktop stays hidden */
.icon-btn.portal-nav-toggle,
.icon-btn.portal-nav-close {
  display: none;
}

.sidebar-backdrop {
  display: none;
}

.logo-text {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.logo-title {
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.02em;
  line-height: 1.15;
  padding: 0;
}

.logo-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
  min-height: 0;
  padding-top: 12px;
  padding-right: 2px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 0 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  letter-spacing: -0.01em;
}

.nav-section-chevron {
  width: 16px;
  height: 16px;
  color: #9ca3af;
  transition: transform 0.2s ease;
}

.nav-section.collapsed .nav-section-chevron {
  transform: rotate(180deg);
}

.nav-section.collapsed .nav-section-body {
  display: none;
}

.nav-section-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-add-client {
  display: block;
  width: 100%;
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 1px dashed #d1d5db;
  border-radius: 8px;
  background: #fafafa;
  color: #374151;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.nav-add-client:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.nav-clients-empty {
  padding: 8px 12px;
  font-size: 13px;
  margin: 0;
}

.nav-clients-trash-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-color);
}

.nav-clients-trash-title {
  margin: 0 0 10px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-client-group--trashed {
  opacity: 0.72;
}

.nav-client-header--trashed {
  cursor: pointer;
}

.nav-client-header--trashed .nav-client-chevron {
  display: none;
}

.nav-client-trash-name {
  display: block;
  color: var(--text-muted);
  text-decoration: line-through;
}

.nav-client-trash-meta {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-muted);
}

.client-trash-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 24px;
  padding: 14px 16px;
  border: 1px solid #fcd34d;
  border-radius: var(--radius-md);
  background: #fffbeb;
}

.client-trash-banner-main strong {
  display: block;
  margin-bottom: 4px;
  color: #92400e;
}

.client-danger-zone {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.client-danger-zone .section-subtitle {
  color: #b91c1c;
}

.client-danger-zone .form-hint {
  margin-bottom: 0;
}

.client-danger-zone .btn-danger {
  margin-top: 16px;
}

.client-workspace--trashed .client-danger-zone {
  display: none;
}

.nav-client-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-client-header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}

.nav-client-header:hover {
  background: #f3f4f6;
}

.nav-client-chevron {
  width: 14px;
  height: 14px;
  color: #9ca3af;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.nav-client-chevron svg {
  width: 12px;
  height: 12px;
}

.nav-client-group.expanded .nav-client-chevron {
  transform: rotate(90deg);
}

.nav-client-avatar {
  position: relative;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  border-radius: 6px;
  background: #e8d9ff;
  color: #6944eb;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.nav-client-avatar.has-thumb {
  background: #fff;
  border: 1px solid #e5e7eb;
}

.nav-client-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.nav-client-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-client-fallback.hidden,
.nav-client-thumb.hidden {
  display: none;
}

.nav-client-label {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-client-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.nav-client-dot--active {
  position: relative;
  z-index: 1;
  background: var(--success-color);
  transform: translateZ(0);
}

.nav-client-dot--active::before,
.nav-client-dot--active::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 50%;
  border: 1.5px solid rgba(16, 185, 129, 0.5);
  background: transparent;
  animation: live-pulse 2s linear infinite;
  will-change: transform, opacity;
  pointer-events: none;
}

.nav-client-dot--active::after {
  animation-delay: -1s;
}

.nav-client-dot--review {
  background: var(--warning-color);
}

@keyframes live-pulse {
  0% {
    transform: scale(1);
    opacity: 0.55;
  }
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}

.nav-client-children {
  display: none;
  flex-direction: column;
  gap: 2px;
  margin: 2px 0 4px 22px;
  padding: 4px 0 4px 12px;
  border-left: 1px solid #e5e7eb;
}

.nav-item-children {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 2px 0 4px 22px;
  padding: 4px 0 4px 12px;
  border-left: 1px solid #e5e7eb;
}

.nav-client-group.expanded .nav-client-children {
  display: flex;
}

.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #6b7280;
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-subsettings {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 4px 0 4px 18px;
  padding-left: 12px;
  border-left: 1px solid var(--border-color);
}

.nav-subsettings.hidden {
  display: none;
}

.nav-subsettings-item {
  width: 100%;
  padding: 6px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #6b7280;
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-subsettings-item:hover {
  background: #f3f4f6;
  color: var(--text-main);
}

.nav-subsettings-item.active {
  background: var(--accent-light);
  color: var(--accent-color);
  font-weight: 600;
}

.nav-sub-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
}

.nav-sub-icon svg {
  width: 13px;
  height: 13px;
}

.nav-sub-item:hover .nav-sub-icon {
  color: #6b7280;
}

.nav-sub-item.active .nav-sub-icon {
  color: #5b1fd6;
}

.nav-sub-item:hover {
  background: #f3f4f6;
  color: #111827;
}

.nav-sub-item.active {
  background: #f1e9ff;
  color: #5b1fd6;
  font-weight: 600;
}

.client-empty-state {
  padding: 32px;
  text-align: center;
}

.client-dashboard {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.client-dashboard .clients-dash-section .card-header {
  padding: 18px 22px;
}

.clients-dash-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 22px 22px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.clients-dash-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 0 22px 16px;
}

.clients-dash-toolbar-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

.clients-dash-toolbar-search {
  flex: 1 1 220px;
  min-width: 200px;
}

.clients-dash-toolbar-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.clients-dash-toolbar-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary, #374151);
  padding-bottom: 8px;
  white-space: nowrap;
}

.clients-dash-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #fff;
}

.clients-dash-item--attention {
  border-color: #f1c40f;
  background: #fffbeb;
}

.clients-dash-item-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 220px;
}

.clients-dash-item-copy {
  min-width: 0;
}

.clients-dash-item-name {
  font-size: 14px;
  font-weight: 600;
}

.clients-dash-item-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.clients-dash-item-owner {
  margin-top: 4px;
  font-size: 12px;
}

.clients-dash-owner {
  color: var(--text-secondary, #374151);
}

.clients-dash-owner-missing {
  color: #92400e;
  font-weight: 600;
}

.clients-dash-item-license {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  flex: 0 1 160px;
  min-width: 140px;
}

.clients-dash-plan-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 8px;
  border-radius: 4px;
  background: #f1e9ff;
  color: #5b1fd6;
}

.clients-dash-stripe {
  font-size: 12px;
  color: var(--text-muted);
}

.clients-dash-usage {
  width: 100%;
}

.clients-dash-usage-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #374151);
}

.clients-dash-usage--warn .clients-dash-usage-text {
  color: var(--danger-color, #b91c1c);
}

.clients-dash-usage-bar {
  margin-top: 4px;
  height: 4px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.clients-dash-usage-bar > span {
  display: block;
  height: 100%;
  background: #6366f1;
}

.clients-dash-usage--warn .clients-dash-usage-bar > span {
  background: var(--danger-color, #b91c1c);
}

.clients-dash-item-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 900px) {
  .clients-dash-item {
    flex-wrap: wrap;
  }

  .clients-dash-item-license {
    flex: 1 1 100%;
  }
}

.client-overview {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.client-overview-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  flex-wrap: wrap;
}

.client-overview-hero-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.client-overview-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 40px;
  min-height: 34px;
  background: var(--warning-color);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 500;
  transition: padding 0.15s ease, min-height 0.15s ease;
}

.impersonation-banner.hidden {
  display: none;
}

.impersonation-banner.collapsed {
  padding: 0;
  min-height: 0;
  background: transparent;
}

.impersonation-banner.collapsed .impersonation-banner-text {
  display: none;
}

.impersonation-banner.collapsed .impersonation-banner-toggle {
  position: fixed;
  top: 6px;
  transform: none;
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning-color);
}

.impersonation-banner.collapsed .impersonation-banner-toggle:hover {
  background: rgba(245, 158, 11, 0.28);
}

.impersonation-banner-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: background 0.15s ease;
}

.impersonation-banner-toggle:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.impersonation-banner-toggle svg {
  width: 13px;
  height: 13px;
  transition: transform 0.15s ease;
}

.impersonation-banner.collapsed .impersonation-banner-toggle svg {
  transform: rotate(180deg);
}

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

select.client-preview-select.form-input {
  width: auto;
  max-width: 220px;
  padding: 6px 12px;
  font-size: 12px;
}

.client-preview-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.client-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 20px;
  align-items: start;
}

.client-overview-section {
  min-width: 0;
}

@media (max-width: 960px) {
  .client-overview-grid {
    grid-template-columns: 1fr;
  }
}

.client-overview-section .card-header,
.client-overview-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
}

.client-overview-section-intro {
  min-width: 0;
  flex: 1;
}

.client-overview-section-intro .card-title {
  margin-bottom: 4px;
}

.client-overview-section-intro .form-hint {
  margin: 0;
}

.client-overview-section-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.client-overview-blogs {
  padding: 0 22px 22px;
}

.portal-dashboard-blocks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
  margin-bottom: 20px;
}

@media (max-width: 1100px) {
  .portal-dashboard-blocks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .portal-dashboard-blocks {
    grid-template-columns: 1fr;
  }
}

.portal-block-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.portal-block-card .card-header {
  padding: 16px 20px;
  min-height: 66px;
}

.portal-block-card .card-title {
  font-size: 17px;
}

.portal-summary-list {
  list-style: none;
  padding: 14px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.portal-summary-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
}

.portal-summary-icon {
  display: flex;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.portal-summary-icon svg {
  width: 100%;
  height: 100%;
}

.portal-summary-label {
  font-size: 13px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
}

.portal-summary-value {
  font-size: 14px;
  font-weight: 700;
  color: rgba(17, 24, 39, 0.62);
}

.portal-gauge-wrap {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 30px 20px 20px 0;
}

.portal-gauge-center {
  text-align: center;
}

.portal-gauge-total-label {
  font-size: 11px;
  color: var(--text-muted);
}

.portal-gauge-total {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.portal-donut-hole:has(.portal-gauge-tooltip:not(.hidden)) .portal-gauge-center {
  display: none;
}

.portal-donut {
  position: relative;
  width: 100%;
  max-width: 380px;
  flex-shrink: 0;
}

.portal-donut-svg {
  display: block;
  width: 100%;
  height: auto;
}

.portal-donut-segment {
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.portal-donut-segment:hover,
.portal-donut-segment:focus-visible {
  opacity: 0.75;
}

.portal-donut-hole {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 14%;
  pointer-events: none;
}

.portal-gauge-tooltip {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 8px 16px;
  text-align: center;
}

.portal-gauge-tooltip.hidden {
  display: none;
}

.portal-gauge-tooltip-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.portal-gauge-tooltip-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.portal-block-table {
  font-size: 13px;
}

.data-table.portal-block-table tr.clickable:hover {
  background: var(--accent-light);
}

.data-table.portal-block-table tr.clickable:hover .badge {
  background: var(--bg-card);
}

.portal-run-title {
  font-weight: 600;
}

.portal-run-date {
  font-size: 11px;
  color: var(--text-main);
  margin-top: 2px;
}

.portal-block-table td:last-child {
  text-align: right;
  white-space: nowrap;
}

.portal-block-empty {
  padding: 0 20px 20px;
}

.client-overview-runs {
  padding: 0;
}

.client-overview-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  padding: 0 0 4px;
}

.client-overview-empty .placeholder-text {
  margin: 0;
  padding: 0;
  font-size: 12px;
  font-style: italic;
}

.client-overview-blog-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
}

.client-overview-blog-card:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.client-overview-blog-action {
  white-space: nowrap;
  flex-shrink: 0;
}

.client-overview-blog-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 6px;
}

.client-overview-blog-keyword {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.client-overview-blog-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.client-overview-runs-table {
  width: 100%;
  table-layout: fixed;
  margin: 0;
}

.client-overview-runs-table th:first-child,
.client-overview-runs-table td:first-child {
  width: 40%;
  padding-left: 22px;
}

.client-overview-runs-table th:nth-child(2),
.client-overview-runs-table td:nth-child(2) {
  width: 24%;
  padding-right: 20px;
  white-space: nowrap;
}

.client-overview-runs-table th:nth-child(3),
.client-overview-runs-table td:nth-child(3) {
  width: 18%;
  padding-left: 8px;
  white-space: nowrap;
}

.client-overview-runs-table th:last-child,
.client-overview-runs-table td:last-child {
  width: 18%;
  padding-right: 22px;
  white-space: nowrap;
}

.client-overview-runs .client-overview-empty {
  padding: 8px 22px 22px;
}

.client-overview-runs-table .run-display-label {
  max-width: none;
}

.client-overview-runs-table .run-display-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.4;
}

.stat-card.accent {
  border-color: rgba(125, 24, 255, 0.18);
  background: linear-gradient(180deg, rgba(125, 24, 255, 0.06) 0%, #fff 100%);
}

.stat-card.accent .stat-value {
  color: var(--accent-color);
}

.blog-start-modal {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.blog-start-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.blog-start-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.blog-start-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.blog-start-value,
.blog-start-reason {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-main);
}

.blog-start-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.blog-start-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  color: var(--text-main);
  font-size: 13px;
}

.blog-start-chip-primary {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  font-weight: 600;
}

.blog-start-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  font-size: 13px;
  color: var(--text-muted);
}

.blog-start-hint {
  margin: 0;
}

.gsc-suggestion-action {
  white-space: nowrap;
  flex-shrink: 0;
  align-self: center;
}

.screen-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.screen-toolbar-end {
  justify-content: flex-end;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: #374151;
  transition: background 0.15s ease;
  text-decoration: none;
  min-height: 40px;
}

.nav-chevron {
  width: 14px;
  height: 14px;
  color: #d1d5db;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-chevron svg {
  width: 12px;
  height: 12px;
}

.nav-icon-box {
  position: relative;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon-box svg {
  width: 18px;
  height: 18px;
}

.nav-icon-blue { color: #7d18ff; }
.nav-icon-green { color: #22c55e; }
.nav-icon-purple { color: #a855f7; }

.nav-icon-dot {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  display: none;
}

.nav-icon-dot.visible {
  display: block;
}

.nav-label {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-label-text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-label-dot {
  display: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
}

.nav-label-dot.visible {
  display: inline-block;
}

.nav-meta {
  color: #9ca3af;
  font-weight: 400;
  font-size: 12px;
}

.nav-more {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #9ca3af;
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease;
}

.nav-more svg {
  width: 16px;
  height: 16px;
}

.nav-item:hover,
.nav-item.active {
  background: #f3f4f6;
  color: #111827;
}

.nav-item:hover .nav-more,
.nav-item.active .nav-more {
  opacity: 1;
}

.nav-item-link {
  color: #374151;
}

.nav-item-link:hover {
  color: #111827;
}

.sidebar-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: #f9fafb;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.6;
}

.model-info span {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-main);
  font-weight: 500;
}

/* App shell */
.app-shell {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}

.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 16px 28px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.header-left-text {
  min-width: 0;
}

.header-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 400;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f9fafb;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 8px 14px;
  min-width: 220px;
}

.search-bar svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-bar input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: var(--text-main);
  width: 100%;
}

.search-bar input::placeholder {
  color: #9ca3af;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.icon-btn:hover {
  background: #f9fafb;
  color: var(--text-main);
}

.icon-btn-plain {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
}

.icon-btn-plain:hover {
  background: #f3f4f6;
  color: var(--text-main);
}

.icon-btn-plain:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.icon-btn-accent {
  color: var(--accent-color);
}

.icon-btn-accent:hover {
  background: rgba(125, 24, 255, 0.08);
  color: #6944eb;
}

.icon-btn-danger {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #dc2626;
}

.icon-btn-danger:hover {
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

/* Flex mag niet op <td> — dat breekt table-borders (verspringende lijnen). */
td.table-actions {
  display: table-cell;
  vertical-align: middle;
  text-align: right;
}

.row-menu {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
}

.row-menu-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s ease;
}

.row-menu-trigger:hover {
  background: #f3f4f6;
  color: var(--text-main);
}

.row-menu-trigger svg {
  width: 18px;
  height: 18px;
}

.row-menu-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 20;
  min-width: 176px;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
}

.row-menu-dropdown.hidden {
  display: none;
}

.row-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text-main);
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  white-space: nowrap;
}

.row-menu-item svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.row-menu-item:hover {
  background: #f9fafb;
}

.row-menu-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.row-menu-item.danger {
  color: var(--danger-color);
}

.notification-wrap {
  position: relative;
}

.notification-btn {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(360px, calc(100vw - 32px));
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow: var(--shadow-md);
  z-index: 1200;
}

.notification-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
}

.notification-mark-read {
  border: none;
  background: transparent;
  color: var(--accent-color);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.notification-list {
  display: flex;
  flex-direction: column;
}

.notification-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-bottom: 1px solid #f3f4f6;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
}

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

.notification-item.unread {
  background: #f8fbff;
}

.notification-item:hover {
  background: #f3f4f6;
}

.notification-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.notification-item-message {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.notification-item-time {
  font-size: 11px;
  color: #9ca3af;
}

.gsc-data-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 220px;
  padding: 28px 20px;
  margin-top: 16px;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  background: #fafbfc;
  text-align: center;
}

.gsc-loader-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #e8d9ff;
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: gsc-spin 0.8s linear infinite;
}

.gsc-loader-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0;
}

@keyframes gsc-spin {
  to { transform: rotate(360deg); }
}

.usage-badge {
  display: inline-flex;
  align-items: center;
  height: 36px;
  box-sizing: border-box;
  font-size: 12px;
  font-weight: 600;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success-color);
  white-space: nowrap;
}

.usage-badge--warning {
  background: var(--danger-bg);
  color: var(--danger-color);
}

/* Tenant portal: larger nav icons (no icon-rail) */
#portal-dashboard .nav-section-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 4px;
}

#portal-dashboard .nav-sub-item {
  gap: 12px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

#portal-dashboard .nav-sub-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #f3f4f6;
  color: #374151;
}

#portal-dashboard .nav-sub-icon svg {
  width: 20px;
  height: 20px;
}

#portal-dashboard .nav-sub-item:hover .nav-sub-icon {
  background: #e5e7eb;
  color: #111827;
}

#portal-dashboard .nav-sub-item.active .nav-sub-icon {
  background: rgba(125, 24, 255, 0.12);
  color: var(--accent-color);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 4px 4px;
  border-radius: 999px;
  cursor: default;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b98bff, #7d18ff);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

#portal-user-avatar {
  background: #141414;
  width: 26px;
  height: 26px;
  font-size: 10px;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

.logout-button {
  margin-left: 4px;
}

/* ── Portal header: language switch + "Mijn omgeving" dropdown ── */
#portal-lang-switch,
#portal-user-menu {
  position: relative;
}

.lang-switch-trigger,
.user-menu-trigger {
  display: flex;
  align-items: center;
  height: 36px;
  box-sizing: border-box;
  gap: 6px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  padding: 0 10px 0 4px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.lang-switch-trigger:hover,
.user-menu-trigger:hover {
  background: var(--bg-rail);
  border-color: #d8d4cc;
}

.notification-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  box-sizing: border-box;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
  background: #ffffff;
  border-radius: 50%;
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.notification-btn:hover {
  background: var(--bg-rail);
  border-color: #d8d4cc;
}

.notification-btn svg {
  width: 18px;
  height: 18px;
}

.flag-circle {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.flag-circle span {
  display: block;
  height: 33.33%;
}

.flag-circle-nl span:nth-child(1) { background: #ae1c28; }
.flag-circle-nl span:nth-child(2) { background: #ffffff; }
.flag-circle-nl span:nth-child(3) { background: #21468b; }

.lang-switch-trigger svg,
.user-menu-chevron {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.lang-switch-menu,
.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 6px;
  z-index: 600;
}

.lang-switch-menu.hidden,
.user-menu-dropdown.hidden {
  display: none;
}

.lang-switch-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.lang-switch-item.is-active {
  background: var(--accent-light);
}

.lang-switch-note {
  margin: 4px 4px 2px;
  padding: 0 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.user-menu-dropdown-email {
  padding: 8px 10px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 4px;
  word-break: break-all;
}

.user-menu-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.15s ease;
}

.user-menu-dropdown-item:hover {
  background: var(--bg-rail);
}

.user-menu-dropdown-item.danger {
  color: var(--danger-color);
}

.main-content {
  flex: 1;
  padding: 24px 24px 32px;
  overflow-y: auto;
}

.content-panel {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.runs-panel-card .card-header-compact,
.clients-dash-section .card-header {
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
}

.runs-table-toolbar {
  display: flex;
  justify-content: flex-end;
}

.runs-table-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.runs-table-select-col {
  width: 44px;
  padding-right: 0 !important;
  text-align: center;
  vertical-align: middle;
}

.runs-table-select-col input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.runs-table-row-selected {
  background: rgba(125, 24, 255, 0.06);
}

.run-display-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.run-display-title {
  display: block;
  font-weight: 600;
  line-height: 1.4;
}

.run-display-title-pending {
  color: var(--text-muted);
  font-weight: 600;
}

.run-display-keyword {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
}

.runs-panel-card .data-table th:first-child,
.runs-panel-card .data-table td:first-child,
.clients-dash-section .data-table th:first-child,
.clients-dash-section .data-table td:first-child {
  padding-left: 20px;
}

.runs-panel-card .data-table th:last-child,
.runs-panel-card .data-table td:last-child,
.clients-dash-section .data-table th:last-child,
.clients-dash-section .data-table td:last-child {
  padding-right: 20px;
}

.table-card .data-table th:first-child,
.table-card .data-table td:first-child {
  padding-left: 20px;
}

.table-card .data-table th:last-child,
.table-card .data-table td:last-child {
  padding-right: 20px;
}

.client-workspace {
  padding: 0;
  overflow: hidden;
}

.card.client-workspace {
  border: none;
}

.client-workspace-body {
  padding: 16px 20px 20px;
}

.screen {
  animation: fadeIn 0.25s ease;
}

.hidden {
  display: none !important;
}

.portal-boot-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-primary);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.screen-header {
  margin-bottom: 24px;
}

.screen-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.screen-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stats-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.stats-range-toggle {
  display: inline-flex;
  gap: 8px;
}

.stats-range-btn.active {
  background: var(--text-primary, #111827);
  color: #fff;
  border-color: var(--text-primary, #111827);
}

.stats-updated {
  margin: 0;
}

.stats-revenue-warning,
#stats-revenue-warning {
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: var(--radius-md, 8px);
  background: var(--warning-bg);
  color: #92400e;
  border: 1px solid #fbbf24;
  font-size: 13px;
}

.stats-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.stats-chart-card .card-header {
  margin-bottom: 8px;
}

.stats-chart-wrap {
  position: relative;
  height: 200px;
}

.stat-card {
  background: #f9fafb;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  transition: box-shadow 0.15s ease;
}

.stat-card:hover {
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  margin-top: 6px;
  letter-spacing: -0.02em;
}

.stat-value.mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  color: var(--accent-color);
}

.stat-card.warning .stat-value {
  color: var(--warning-color);
}

.card {
  background-color: #ffffff;
  background-image: linear-gradient(180deg, #f8f8f8 0%, #ffffff 100%);
  background-size: 100% 300px;
  background-repeat: no-repeat;
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
}

.card-header.card-header-compact {
  justify-content: flex-end;
  padding: 12px 20px;
}

.card-title {
  font-weight: 600;
  font-size: 14px;
}

.plugin-download-card {
  margin-bottom: 20px;
}

.plugin-download-body {
  padding: 16px 20px;
}

.file-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #f9fafb;
}

.file-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  color: var(--accent-color);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-size: 14px;
  font-weight: 600;
}

.file-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.split-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  align-items: start;
}

.btn {
  border: none;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

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

.btn-primary {
  background: #141414;
  color: #ffffff;
}

.btn-primary:hover {
  background: #2b2b2b;
}

.btn-save {
  background: var(--success-color);
  color: #ffffff;
}

.btn-save:hover {
  background: #059669;
}

.save-status {
  margin-left: 12px;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  max-width: min(520px, 100%);
  line-height: 1.45;
}

.save-status.success { color: #059669; }
.save-status.error { color: #ef4444; white-space: normal; }

.settings-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.stripe-settings-danger {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stripe-clear-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.stripe-clear-btn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.stripe-clear-btn:hover {
  color: var(--danger-color);
  border-color: color-mix(in srgb, var(--danger-color) 35%, var(--border-color));
  background: color-mix(in srgb, var(--danger-color) 6%, transparent);
}

.stripe-products-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.stripe-products-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.stripe-products-tables {
  margin-top: 12px;
}

.stripe-products-tables .table-wrap + .table-wrap,
.stripe-products-tables .stripe-linked-products-details .table-wrap {
  margin-top: 0;
}

.stripe-products-table {
  table-layout: fixed;
}

.stripe-products-table .col-product {
  width: 46%;
}

.stripe-products-table .col-meta {
  width: auto;
}

.stripe-products-table .col-action {
  width: 120px;
  text-align: right;
  white-space: nowrap;
}

.stripe-products-table td.col-product .form-hint {
  margin-top: 3px;
  font-size: 11px;
}

.stripe-products-table td.col-action.table-actions {
  padding-right: 16px;
}

.stripe-linked-products-details {
  margin-top: 20px;
}

.stripe-linked-products-details summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0 0 8px;
  list-style: none;
}

.stripe-linked-products-details summary::-webkit-details-marker {
  display: none;
}

.stripe-linked-products-details summary::before {
  content: '▸';
  display: inline-block;
  width: 1em;
  margin-right: 4px;
  transition: transform 0.15s ease;
}

.stripe-linked-products-details[open] summary::before {
  transform: rotate(90deg);
}

.client-ai-test-actions {
  margin-top: 12px;
  margin-bottom: 0;
}

.version-input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.version-block {
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #fafafa;
}

.version-current-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.version-current-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.version-current-value {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
}

.version-publish-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.version-publish-actions .btn-disabled,
.version-publish-actions .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.plugin-code-changes-list {
  margin-bottom: 10px;
}

.plugin-code-changes {
  margin: 0;
  padding-left: 18px;
  color: #374151;
  font-size: 13px;
  line-height: 1.6;
}

.plugin-code-changes .mono {
  color: #6b7280;
  font-size: 12px;
}

.plugin-code-change-time {
  display: inline-block;
  margin-left: 8px;
  color: #9ca3af;
  font-size: 12px;
  white-space: nowrap;
}

.plugin-update-proposal {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #d1d5db;
}

.plugin-update-proposal-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #b45309;
  font-size: 13px;
}

.plugin-update-proposal-banner strong {
  color: #92400e;
}

.version-block--update-ready {
  border-color: #fbbf24;
  background: #fffbeb;
}

.plugin-pending-release {
  color: #b45309;
  font-weight: 500;
}

.version-arrow {
  opacity: 0.55;
  margin: 0 2px;
}

.btn-link {
  border: none;
  background: transparent;
  color: var(--accent-color);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-link:hover {
  color: #6944eb;
}

.plugin-pending-release {
  color: #b45309;
  font-weight: 500;
}

.rail-icon-wrap-relative {
  position: relative;
}

.rail-icon-dot {
  top: 8px;
  right: 8px;
}

.modal-content-wide {
  width: 640px;
}

.modal-content-fullscreen {
  width: min(1120px, calc(100vw - 48px));
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
}

.modal-content-fullscreen .modal-body {
  overflow-y: auto;
  flex: 1 1 auto;
}

.sub-plan-editor {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sub-plan-section {
  padding: 16px 18px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #fafbfc;
}

.sub-plan-section-head {
  margin-bottom: 14px;
}

.sub-plan-section-head h4 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #111827);
}

.sub-plan-section-head p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-muted, #6b7280);
}

.sub-plan-section .settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 0;
  align-items: start;
}

.sub-plan-section .settings-grid .form-group {
  margin-bottom: 0;
  gap: 6px;
}

.sub-plan-section .settings-grid .form-hint {
  margin: 0;
}

@media (max-width: 720px) {
  .sub-plan-section .settings-grid {
    grid-template-columns: 1fr;
  }
}

#sub-plan-id:disabled,
#sub-plan-id[readonly],
#sub-plan-name:disabled,
#sub-plan-name[readonly] {
  background: #f3f4f6;
  color: #374151;
  cursor: not-allowed;
  opacity: 1;
}

.changelog-history {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.changelog-history-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
}

.changelog-history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 280px;
  overflow-y: auto;
}

.changelog-entry {
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #fafafa;
}

.changelog-entry-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.changelog-entry-date {
  font-size: 12px;
  color: var(--text-muted);
}

.changelog-entry-notes {
  font-size: 13px;
  line-height: 1.5;
  color: #374151;
}

.btn-with-icon {
  gap: 6px;
}

.btn-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.btn-secondary {
  background: #f3f4f6;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: #e5e7eb;
}

.btn-sm {
  padding: 10px 20px;
  font-size: 12px;
}

.btn-wp-resync {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.btn-wp-resync-icon {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  display: block;
  color: #21759b;
}

.btn-wp-resync-spinner {
  display: none;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(33, 117, 155, 0.25);
  border-top-color: #21759b;
  border-radius: 50%;
  animation: wp-resync-spin 0.7s linear infinite;
  flex-shrink: 0;
}

.btn-wp-resync.is-loading .btn-wp-resync-spinner {
  display: inline-block;
}

.btn-wp-resync.is-loading .btn-wp-resync-icon {
  opacity: 0.35;
}

.btn-wp-resync.is-loading {
  pointer-events: none;
  opacity: 0.92;
}

@keyframes wp-resync-spin {
  to { transform: rotate(360deg); }
}

.wp-resync-status {
  display: inline-flex;
  align-items: center;
  max-width: 280px;
  font-size: 12px;
  line-height: 1.3;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wp-resync-status.is-active {
  color: #21759b;
}

.wp-resync-log {
  margin: 16px 0 24px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  overflow: hidden;
}

.wp-resync-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
}

.wp-resync-log-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #f8fafc;
}

.wp-resync-log-body {
  margin: 0;
  padding: 14px;
  max-height: 420px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: #cbd5e1;
}

.run-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: background 0.12s ease;
}

.run-list-item:hover {
  background: #f9fafb;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.queued, .status-dot.pending { background: #9ca3af; }
.status-dot.running { background: var(--accent-color); }
.status-dot.completed { background: var(--success-color); }
.status-dot.failed { background: var(--danger-color); }
.status-dot.awaiting_review { background: var(--warning-color); }

.run-info {
  flex: 1;
  min-width: 0;
}

.run-keyword {
  font-weight: 600;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.run-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.run-meta span {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
}

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge.queued, .badge.pending { background: #f3f4f6; color: var(--text-muted); }
.badge.running { background: var(--accent-light); color: var(--accent-color); }
.badge.completed { background: var(--success-bg); color: var(--success-color); }
.badge.failed { background: var(--danger-bg); color: var(--danger-color); }
.badge.cancelled { background: #f3f4f6; color: #6b7280; }
.badge.awaiting_review { background: var(--warning-bg); color: var(--warning-color); }
.badge.badge-warning { background: var(--warning-bg); color: var(--warning-color); }
.badge.badge-success { background: var(--success-bg); color: var(--success-color); }

.cost-bars-list {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cost-bar-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cost-bar-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
}

.cost-bar-val {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  font-size: 12px;
}

.cost-bar-outer {
  height: 6px;
  border-radius: 3px;
  background: #eef2f7;
  overflow: hidden;
}

.cost-bar-inner {
  height: 100%;
  background: var(--accent-color);
  border-radius: 3px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.costs-log-pipeline-link {
  color: var(--accent-color);
  font-weight: 600;
  text-decoration: none;
}

.costs-log-pipeline-link:hover {
  text-decoration: underline;
}

.table-card {
  padding: 0;
  overflow: visible;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  background: #fafbfc;
}

.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr.clickable {
  cursor: pointer;
}

.data-table tr.clickable:hover {
  background: #f9fafb;
}

.data-table .empty-cell {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  text-align: center;
}

.plugin-installations-section {
  margin-top: 0;
  padding-top: 0;
}

.plugin-installations-section .section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.clients-split {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  align-items: start;
}

.client-sidebar {
  min-height: 500px;
}

.client-list-group {
  display: flex;
  flex-direction: column;
}

.client-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: all 0.15s ease;
}

.client-item:hover {
  background: #f9fafb;
}

.client-item.active {
  background: var(--accent-light);
}

.client-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.client-item-meta {
  min-width: 0;
  flex: 1;
}

.client-item-name {
  font-weight: 600;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-item-slug {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 1px;
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
}

.workspace-title {
  font-size: 18px;
  font-weight: 700;
}

.workspace-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 2px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.settings-grid .form-group-full {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.settings-grid .settings-grid {
  width: 100%;
}

.portal-ai-model-grid {
  margin-bottom: 20px;
}

.portal-ai-key-warning {
  color: var(--color-warning, #9a6700);
  grid-column: 1 / -1;
}

.ai-override-fields {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(240px, 2fr);
  gap: 16px;
  width: 100%;
}

.portal-ai-combobox {
  position: relative;
  width: 100%;
}

.portal-ai-combobox-results {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #d0d7de);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.portal-ai-combobox-option {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  cursor: pointer;
}

.portal-ai-combobox-option:hover,
.portal-ai-combobox-option.is-active {
  background: var(--color-surface-muted, #f6f8fa);
}

.portal-ai-combobox-option-name {
  font-size: 0.95rem;
}

.portal-ai-combobox-option-id {
  font-size: 0.8rem;
  opacity: 0.7;
}

.portal-ai-combobox-option-price {
  font-size: 0.75rem;
  opacity: 0.65;
  margin-top: 1px;
}

.portal-ai-combobox-empty {
  padding: 10px 12px;
  opacity: 0.7;
  font-size: 0.9rem;
}

.ai-override-fields .form-group {
  margin-bottom: 0;
}

.ai-override-fields .ai-override-help {
  grid-column: 1 / -1;
  margin: 0;
}

.ai-override-fields .form-input,
.ai-override-fields select.form-input {
  width: 100%;
  max-width: 100%;
}

#client-ai-model-custom,
#ai-default-model-custom {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.settings-grid .form-group-full textarea.form-input {
  min-height: 84px;
  resize: vertical;
}

.form-input-wide {
  width: 100%;
  max-width: 100%;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-group label {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}

.form-legend {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.form-fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 16px;
}

.form-label-optional {
  display: inline;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}


.form-hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.byok-keys-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.byok-keys-section .settings-grid,
.portal-byok-grid {
  grid-template-columns: 1fr;
  max-width: 560px;
}

.byok-keys-intro {
  margin: 0 0 16px;
  max-width: 720px;
}

.byok-key-status {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 500;
}

.byok-key-status.saved {
  color: #059669;
}

.byok-key-status.missing {
  color: var(--text-muted);
}

.form-input {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-main);
  background: #ffffff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.form-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-light);
}

textarea.form-input {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  line-height: 1.45;
}

select.form-input {
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
}

.form-input.text-area {
  min-height: 100px;
  resize: vertical;
  padding: 12px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.55;
}

.form-input.text-area.small {
  min-height: 70px;
}

.style-profile-section {
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  margin-top: 10px;
  margin-bottom: 20px;
}

.section-subtitle {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

.slider-group {
  margin-bottom: 20px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.slider-title {
  font-size: 12.5px;
  font-weight: 600;
}

.slider-val {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--accent-color);
  font-size: 13px;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.style-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: #e5e7eb;
  outline: none;
}

.style-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-color);
  cursor: pointer;
}

.word-lists-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.35);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
  overflow-y: auto;
}

html.scroll-locked,
body.portal-nav-lock,
body.scroll-locked {
  overflow: hidden;
  overscroll-behavior: none;
}

.modal-content {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  width: 480px;
  max-width: 90%;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
}

.modal-close {
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-body {
  padding: 20px;
}

.modal-client-context {
  margin: 0 0 16px;
  font-size: 14px;
  color: #64748b;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  background: #fafbfc;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 16px;
}

.detail-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.detail-run-meta {
  font-size: 13px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.detail-run-last-refresh {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 9rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: 16px;
  transition: color 0.15s ease;
}

.back-link:hover {
  color: var(--accent-color);
}

.step-progress-flow {
  display: flex;
  margin-bottom: 16px;
  background: #fafbfc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 32px 20px 36px;
  overflow: visible;
}

.step-progress-flow.pipeline-complete {
  background: linear-gradient(180deg, #e5f7f1 0%, #fafbfc 100%);
  border-color: #bbf7d0;
}

.progress-step-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.progress-step-line {
  position: absolute;
  top: 20px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: #e5e7eb;
  z-index: 1;
}

.progress-step-line.active {
  background: var(--success-color);
}

.progress-step-line.finish-gradient {
  background: linear-gradient(to right, var(--success-color) 0%, #e5f7f1 100%);
}

.progress-step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  background: #ffffff;
  border: 2px solid #d1d5db;
  color: var(--text-muted);
  z-index: 2;
}

.progress-step-item.success .progress-step-circle {
  background: var(--success-color);
  border-color: var(--success-color);
  color: #ffffff;
}

.progress-step-item.finished .progress-step-circle {
  width: 44px;
  height: 44px;
  background: #e5f7f1;
  border: none;
  box-shadow: none;
}

.progress-step-item.finished .progress-step-line {
  top: 22px;
}

.progress-step-confetti {
  display: block;
  font-size: 22px;
  line-height: 1;
  animation: progress-confetti-pop 0.55s ease;
}

@keyframes progress-confetti-pop {
  0% { transform: scale(0.5) rotate(-12deg); opacity: 0; }
  70% { transform: scale(1.12) rotate(6deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); }
}

.progress-step-item.running .progress-step-circle {
  position: relative;
  border-color: var(--success-color);
  background: #ffffff;
  color: var(--success-color);
  transform: translateZ(0);
  isolation: isolate;
}

.progress-step-item.running .progress-step-circle::before,
.progress-step-item.running .progress-step-circle::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(16, 185, 129, 0.45);
  animation: live-pulse 2s linear infinite;
  will-change: transform, opacity;
  pointer-events: none;
}

.progress-step-item.running .progress-step-circle::after {
  animation-delay: -1s;
}

.progress-step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success-color);
  position: relative;
  z-index: 1;
}

.progress-step-item.running .progress-step-label {
  color: #047857;
  font-weight: 700;
}

.progress-step-item.running .progress-step-status {
  color: var(--success-color);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.progress-step-line.flowing {
  background: var(--success-color);
}

.progress-step-item.failed .progress-step-circle {
  background: var(--danger-color);
  border-color: var(--danger-color);
  color: #ffffff;
}

.progress-step-label {
  font-size: 12px;
  font-weight: 600;
  margin-top: 10px;
  text-align: center;
}

.progress-step-status {
  font-size: 11px;
  margin-top: 2px;
  font-weight: 500;
}

.progress-step-item.success .progress-step-status { color: var(--success-color); }
.progress-step-item.failed .progress-step-status { color: var(--danger-color); }
.progress-step-item.pending .progress-step-status { color: var(--text-muted); }

.detail-cards-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-card {
  background: #fafbfc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.step-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 14px 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: background 0.15s ease;
}

.step-card-header:hover {
  background: #f3f4f6;
}

.step-card-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.step-card-time {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.step-card-time-failed {
  color: var(--danger-color);
}

.progress-step-time {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.2;
}

.step-card-chevron {
  width: 16px;
  height: 16px;
  color: #9ca3af;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.step-card.collapsed .step-card-chevron {
  transform: rotate(-90deg);
}

.step-card-body-wrap {
  padding: 14px 16px 16px;
  background: #f8fafc;
}

.step-card.collapsed .step-card-body-wrap {
  display: none;
}

.step-card-title {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.step-card-title span.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.step-card-title span.dot.success { background: var(--success-color); }
.step-card-title span.dot.running { background: var(--accent-color); }
.step-card-title span.dot.failed { background: var(--danger-color); }
.step-card-title span.dot.pending { background: var(--text-muted); }

.step-card-body {
  font-size: 13px;
  color: #374151;
  line-height: 1.6;
  white-space: pre-wrap;
}

.step-card-code {
  font-family: 'JetBrains Mono', monospace;
  background: #f3f4f6;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 0;
  overflow-x: auto;
  font-size: 12px;
}

.gsc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.integrations-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.integrations-header .gsc-header-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.integration-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border-color);
}

.integration-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px 10px;
  margin-bottom: -1px;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.integration-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #059669;
  flex-shrink: 0;
}

.integration-tab-badge svg {
  width: 11px;
  height: 11px;
}

.integration-tab.active .integration-tab-badge {
  background: #d1fae5;
  color: #047857;
}

.integration-tab:hover {
  color: var(--text-main);
}

.integration-tab.active {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
  background: transparent;
  box-shadow: none;
}

.integrations-tab-panel {
  min-height: 120px;
}

.ai-settings-tab-panel {
  margin-top: 4px;
}

.plugin-settings-tab-panel {
  margin-top: 4px;
}

.ai-exclusions-intro {
  margin-bottom: 24px;
}

.ai-exclusions-section {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.ai-exclusions-section:last-of-type {
  border-bottom: none;
  margin-bottom: 12px;
}

.ai-exclusions-heading {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
}

.ai-exclusion-add-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.ai-exclusion-add-row .form-input {
  flex: 1;
  min-width: 0;
}

.ai-exclusion-quick-add {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.ai-exclusion-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.ai-exclusion-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 6px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  border: 1px solid var(--border-color);
  font-size: 13px;
}

.ai-exclusion-chip-remove {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}

.ai-exclusion-chip-remove:hover {
  color: var(--danger-color);
}

.ai-exclusion-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 6px 14px;
  margin-top: 10px;
}

.ai-exclusion-step-item {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 400;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
}

.ai-exclusion-step-item input[type="checkbox"] {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.ai-exclusion-empty {
  margin: 0;
  padding: 0;
}

.ai-exclusion-client-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.ai-exclusion-client-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #fafbfc;
}

.ai-exclusion-client-remove {
  flex-shrink: 0;
}

.seranking-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.seranking-header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.seranking-connect-form {
  margin-bottom: 20px;
  max-width: 520px;
}

.seranking-subtabs {
  margin-top: 8px;
  margin-bottom: 16px;
}

.seranking-research-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

#seranking-research-meta {
  margin: 0 0 20px;
  line-height: 1.5;
}

.seranking-research-chart-card {
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #fff;
}

.seranking-research-chart-title {
  margin: 0 0 10px;
  font-size: 0.92rem;
  font-weight: 600;
}

.seranking-research-chart-card canvas {
  width: 100% !important;
  height: 120px !important;
}

.seranking-sparkline {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 18px;
}

.seranking-spark-bar {
  display: inline-block;
  width: 4px;
  background: #6944eb;
  border-radius: 1px;
}

.gsc-header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.gsc-notice {
  padding: 14px 16px;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  background: #fafafa;
  margin-bottom: 16px;
}

.gsc-notice-error {
  border-color: #fecaca;
  background: #fef2f2;
}

.gsc-property-setup {
  padding: 16px;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #ffffff;
}

.gsc-property-linked {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-top: 10px;
}

.gsc-property-linked-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-sm);
  background: #ecfdf5;
}

.gsc-property-linked-label {
  font-size: 12px;
  font-weight: 500;
  color: #047857;
}

.gsc-property-linked-url {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  word-break: break-all;
}

.gsc-property-picker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gsc-property-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.gsc-property-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #fafbfc;
}

.gsc-property-item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.gsc-property-radio {
  flex-shrink: 0;
  width: 16px;
  color: var(--accent-color);
  font-size: 14px;
  line-height: 1.4;
}

.gsc-property-item-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.gsc-property-selected-label {
  font-size: 13px;
  font-weight: 600;
  color: #047857;
  margin: 0;
}

.gsc-property-item:hover:not(:disabled) {
  border-color: var(--accent-color);
  background: #f8fbff;
}

.gsc-property-item.selected {
  border-color: var(--accent-color);
  background: #f3ecff;
  box-shadow: 0 0 0 2px var(--accent-light);
}

.gsc-property-item.taken,
.gsc-property-item:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: #f9fafb;
}

.gsc-property-url {
  font-size: 13px;
  color: var(--text-main);
  word-break: break-all;
}

.gsc-property-taken {
  font-size: 11px;
  color: var(--text-muted);
}

.gsc-property-picker .btn,
.gsc-property-linked .btn {
  align-self: flex-start;
}

.gsc-data-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #f8fafc;
}

.gsc-filter-tabs-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gsc-filter-tabs-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.gsc-filter-tabs .gsc-tab {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 999px;
}

.gsc-data-toolbar-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.gsc-toolbar-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gsc-toolbar-field .form-input {
  min-width: 160px;
}

.gsc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gsc-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.gsc-tab:hover {
  border-color: #cbd5e1;
  color: var(--text-main);
}

.gsc-tab.active {
  border-color: var(--accent-color);
  background: var(--accent-light);
  color: var(--accent-color);
  box-shadow: inset 0 0 0 1px rgba(125, 24, 255, 0.15);
}

.gsc-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(107, 114, 128, 0.12);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.gsc-tab.active .gsc-tab-count {
  background: rgba(125, 24, 255, 0.15);
  color: var(--accent-color);
}

.gsc-search-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 0;
  border-bottom: none;
}

.gsc-search-bar .gsc-meta-label {
  margin-bottom: 0;
}

.gsc-tab-panel {
  padding-top: 20px;
}

.gsc-tab-panel > .form-hint {
  margin: 0 0 20px;
  line-height: 1.5;
}

#gsc-data-section .table-wrap {
  margin-top: 4px;
}

.gsc-lazy-scroll {
  max-height: 520px;
  overflow-y: auto;
}

.gsc-lazy-hint {
  margin: 10px 0 4px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.gsc-page-link {
  color: var(--text-main);
  text-decoration: none;
  word-break: break-word;
}

.gsc-page-link:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

.gsc-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.gsc-meta-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.gsc-meta-item-wide {
  grid-column: span 2;
}

@media (max-width: 720px) {
  .gsc-meta-item-wide {
    grid-column: span 1;
  }
}

.gsc-section {
  margin-bottom: 28px;
}

.gsc-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.gsc-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 8px;
}

.gsc-suggestions-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  flex-wrap: nowrap;
}

.gsc-suggestions-meta {
  margin: 0;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.gsc-meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f3f4f6;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
}

.gsc-meta-chip-muted {
  background: transparent;
  padding-left: 0;
  padding-right: 0;
}

.gsc-meta-chip-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.gsc-meta-source {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.3;
}

.gsc-meta-source-gsc {
  background: #ecfdf5;
  color: #047857;
}

.gsc-meta-source-seranking {
  background: #f3ecff;
  color: #5b1fd6;
}

.gsc-meta-source-both {
  background: #f5f3ff;
  color: #6d28d9;
}

.gsc-suggestions-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.gsc-sort-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.gsc-sort-select {
  width: auto;
  min-width: 180px;
  max-width: 100%;
  padding: 5px 8px;
  font-size: 12px;
}

.gsc-suggestions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gsc-suggestion-card {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #fff;
}

.gsc-suggestion-main {
  min-width: 0;
}

.gsc-suggestion-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.gsc-suggestion-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
}

.gsc-suggestion-action {
  flex-shrink: 0;
  white-space: nowrap;
}

.gsc-suggestion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
  justify-content: flex-end;
}

.gsc-saved-section {
  margin-bottom: 20px;
}

.gsc-suggestions-section {
  margin-top: 4px;
}

.gsc-section-title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.gsc-saved-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
  color: var(--text-muted);
  background: #eef2f7;
}

.gsc-suggestion-card.is-saved {
  border-color: #cbd5e1;
}

.gsc-suggestion-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.gsc-suggestion-keyword-value {
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
}

.gsc-suggestion-meta-item {
  color: var(--text-muted);
}

.gsc-suggestion-meta-item::before {
  content: '·';
  margin-right: 10px;
  color: #d1d5db;
}

.gsc-suggestion-meta > .gsc-meta-source + .gsc-suggestion-keyword-value::before,
.gsc-suggestion-meta > :first-child::before {
  content: none;
  margin: 0;
}

.gsc-suggestion-reason {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.gsc-keyword-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.gsc-keyword-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f9fafb;
  color: #374151;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.gsc-keyword-chip-primary {
  border-color: #d1d5db;
  background: #ffffff;
  font-weight: 600;
}

.gsc-keyword-chip-text {
  color: inherit;
}

.gsc-keyword-chip-source {
  flex-shrink: 0;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.gsc-keyword-chip:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #6b7280;
}

.gsc-keyword-more {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.step-output-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.step-hero {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--border-color);
}

.step-hero-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-main);
  margin: 0;
  letter-spacing: -0.02em;
}

.step-hero-slug {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-all;
}

.step-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.step-stat-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  border: 1px solid var(--border-color);
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}

.step-meta-card {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--border-color);
}

.step-meta-card-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.step-meta-card-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #374151;
}

.step-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.step-field-item {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--border-color);
}

.step-field-item-full {
  grid-column: 1 / -1;
}

.step-field-item dt {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.step-field-item dd {
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.5;
  margin: 0;
}

.step-output-block {
  margin-top: 2px;
}

.step-output-heading {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 10px;
}

.step-content-sections {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-content-section {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #ffffff;
  overflow: hidden;
}

.step-content-section summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  background: #fafbfc;
  border-bottom: 1px solid transparent;
  user-select: none;
}

.step-content-section summary::-webkit-details-marker {
  display: none;
}

.step-content-section summary::after {
  content: '›';
  float: right;
  color: #9ca3af;
  transform: rotate(90deg);
  transition: transform 0.15s ease;
}

.step-content-section:not([open]) summary::after {
  transform: rotate(0deg);
}

.step-content-section[open] summary {
  border-bottom-color: var(--border-color);
}

.step-section-body {
  padding: 14px 16px;
  max-height: 360px;
  overflow: auto;
}

.step-section-markdown {
  font-size: 13px;
  line-height: 1.7;
  color: #374151;
  white-space: pre-wrap;
}

.step-section-markdown .md-h1,
.step-section-markdown .md-h2,
.step-section-markdown .md-h3 {
  display: block;
  font-weight: 700;
  color: var(--text-main);
  margin: 12px 0 8px;
  white-space: normal;
}

.step-section-markdown .md-h3 { font-size: 14px; }
.step-section-markdown .md-h2 { font-size: 15px; }
.step-section-markdown .md-h1 { font-size: 16px; }

.step-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.step-tag {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1e9ff;
  color: #5b1fd6;
  font-size: 12px;
  font-weight: 500;
}

.step-outline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-outline-item {
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #fff;
}

.step-outline-item.level-3 {
  margin-left: 16px;
}

.step-outline-item ul {
  margin: 8px 0 0 18px;
  padding: 0;
  color: #374151;
  font-size: 13px;
}

.step-notes {
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.6;
  color: #374151;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--border-color);
}

.step-markdown-preview {
  display: none;
}

.step-preview-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.step-check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
}

.step-check-item.passed {
  background: #f0fdf4;
  color: #065f46;
}

.step-check-item.failed {
  background: #fef2f2;
  color: #991b1b;
}

.step-check-icon {
  font-weight: 700;
  flex-shrink: 0;
}

.step-schema-code {
  max-height: 280px;
  overflow: auto;
}

.step-links-table .step-link-hint {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

.step-link-url {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.step-raw-json {
  margin-top: 16px;
}

.step-raw-json summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  user-select: none;
}

.step-raw-json[open] summary {
  margin-bottom: 8px;
}

.margin-top-20 {
  margin-top: 20px;
}

.step-active-label {
  display: block;
  font-size: 11px;
  color: var(--accent-color);
  margin-top: 2px;
  font-weight: 500;
}

.btn-danger {
  background: var(--danger-color);
  color: #ffffff;
}

.btn-danger:hover {
  background: #dc2626;
}

.client-overview-wp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.client-overview-wp-body {
  padding: 0 20px 20px;
}

.client-overview-wp-body .wp-publish-mapping-card {
  margin-top: 0;
}

.client-overview-wp-body .client-overview-empty {
  padding: 8px 0;
}

.wp-publish-evidence {
  margin-top: 12px;
  font-size: 13px;
}

.wp-publish-evidence summary {
  cursor: pointer;
  color: var(--text-muted);
}

.wp-publish-evidence-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 12px;
}

.wp-publish-warnings {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 13px;
  color: #b45309;
}

.wp-publish-configured .api-key-info {
  margin-bottom: 10px;
}

.wp-publish-progress {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wp-publish-progress-item {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 8px 0;
  font-size: 13px;
  color: #9ca3af;
  border-bottom: 1px solid var(--border-color);
}

.wp-publish-progress-item:last-child {
  border-bottom: 0;
}

.wp-publish-progress-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  margin-top: 2px;
}

.wp-publish-progress-item.active {
  color: var(--text-main);
  font-weight: 500;
}

.wp-publish-progress-item.active .wp-publish-progress-icon {
  border-color: var(--accent-color);
  border-top-color: transparent;
  animation: wpPublishSpin 0.8s linear infinite;
}

.wp-publish-progress-item.done {
  color: #374151;
}

.wp-publish-progress-item.done .wp-publish-progress-icon {
  border-color: var(--success-color);
  background: var(--success-color);
  position: relative;
}

.wp-publish-progress-item.done .wp-publish-progress-icon::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.wp-publish-progress-detail {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

@keyframes wpPublishSpin {
  to { transform: rotate(360deg); }
}

.wp-publish-wizard-status {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  color: var(--text-muted);
  font-size: 14px;
}

.wp-publish-mapping-card {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #fff;
}

.wp-publish-mapping-card h4 {
  margin: 0 0 8px;
  font-size: 15px;
}

.wp-publish-mapping-list {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-main);
}

.wp-publish-confidence {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 11px;
  font-weight: 600;
}

.api-key-section {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.portal-billing-banner {
  margin: 0 0 20px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(105deg,
    #f4f3ef 0%,
    #edf5a8 22%,
    #d9bdfb 45%,
    #8a70e8 66%,
    #c98fae 86%,
    #f2925a 100%
  );
}

.portal-billing-banner .portal-settings-alert {
  margin-bottom: 12px;
}

.portal-billing-banner-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.portal-billing-banner-main {
  padding: 12px 0;
}

.portal-billing-banner-main strong {
  display: block;
  margin-bottom: 4px;
  color: #141414;
  font-size: 17px;
}

.portal-billing-banner-main .form-hint {
  margin: 0;
}

.portal-billing-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.portal-users-section {
  margin-top: 28px;
}

.portal-users-header,
.portal-users-eligible-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.portal-users-header {
  margin-bottom: 16px;
}

.portal-users-invite {
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #fafbfc;
}

.portal-users-invite-form {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.portal-users-invite-form .form-group {
  margin: 0;
}

.portal-users-invite-actions {
  display: flex;
  align-items: end;
}

.portal-users-section .section-subtitle,
.portal-users-section .section-desc {
  margin-bottom: 0;
}

.portal-users-list-section {
  margin-bottom: 20px;
}

.portal-users-subtitle {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
}

.portal-users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.portal-user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #fafbfc;
}

.portal-user-row--eligible {
  background: #ffffff;
}

.portal-user-row--linked {
  opacity: 0.72;
}

.portal-user-checkbox {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
}

.portal-user-checkbox:disabled {
  cursor: not-allowed;
}

.portal-user-details {
  flex: 1;
  min-width: 0;
}

.portal-user-name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-user-email {
  margin-top: 2px;
  overflow: hidden;
  font-size: 12px;
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.portal-user-role {
  flex-shrink: 0;
  background: #f1e9ff;
  color: #5b1fd6;
}

.portal-user-status--pending {
  background: #fffbeb;
  color: #92400e;
}

.portal-user-status--active {
  background: #ecfdf5;
  color: #047857;
}

.portal-user-status--expired {
  background: #fef2f2;
  color: #b91c1c;
}

.portal-user-linked-label {
  flex-shrink: 0;
  color: var(--success-color);
  font-size: 12px;
  font-weight: 600;
}

.portal-users-eligible {
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.portal-users-eligible-header {
  margin-bottom: 12px;
}

.portal-users-eligible-header .form-hint {
  margin-top: 4px;
}

.section-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin: 4px 0 16px;
}

.api-key-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #f9fafb;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.api-key-prefix {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.api-key-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
}

.api-key-badge.active {
  background: var(--success-bg);
  color: var(--success-color);
}

.api-key-badge.pending {
  background: var(--warning-bg);
  color: var(--warning-color);
}

.badge.portal-role-admin {
  background: #defc65;
  color: #3f5b00;
}

.badge.portal-role-member {
  background: #e5e7eb;
  color: #4b5563;
}

.integration-detail-topline .section-desc {
  margin: 0;
}

.card:has(.portal-combobox),
.client-workspace:has(.portal-combobox),
.client-workspace-body:has(.portal-combobox),
.portal-settings-input-action:has(.portal-combobox) {
  overflow: visible;
}

.portal-combobox {
  position: relative;
  flex: 1;
  min-width: 0;
}

.portal-combobox-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.portal-combobox-trigger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.portal-combobox-trigger svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.portal-combobox-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-combobox-value.is-placeholder {
  color: var(--text-muted);
}

.portal-combobox-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  padding: 8px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
}

.portal-combobox-panel.hidden {
  display: none;
}

.portal-combobox-search {
  margin-bottom: 8px;
}

.portal-combobox-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 240px;
  overflow-y: auto;
}

.portal-combobox-option {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
  font-size: 13px;
  color: var(--text-main);
  cursor: pointer;
}

.portal-combobox-option:hover {
  background: #f9fafb;
}

.portal-combobox-option.is-selected {
  background: var(--accent-light);
  color: var(--accent-color);
  font-weight: 600;
}

.portal-combobox-empty {
  margin: 0;
  padding: 10px;
  color: var(--text-muted);
  font-size: 12px;
}

.portal-combobox-empty.hidden {
  display: none;
}


.integration-detail-topline .btn {
  position: absolute;
  top: 16px;
  right: 20px;
}

.api-key-badge.revoked {
  background: var(--danger-bg);
  color: var(--danger-color);
}

.api-key-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.api-key-status {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.api-key-status.error { color: var(--danger-color); }

.api-key-reveal {
  margin-bottom: 14px;
}

.api-key-reveal label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.api-key-reveal-row {
  display: flex;
  gap: 8px;
}

.api-key-reveal-row input {
  flex: 1;
  font-size: 12px;
}

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

.mono {
  font-family: 'JetBrains Mono', monospace;
}

.portal-settings-layout {
  width: 100%;
}

.portal-settings-section {
  margin: 0;
}

.portal-settings-section + .portal-settings-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.portal-settings-section .section-subtitle {
  margin-bottom: 4px;
}

.portal-settings-readonly .form-input[readonly] {
  color: var(--text-muted);
  background: #f7f8fa;
  cursor: default;
}

.portal-settings-language {
  max-width: 280px;
}

.portal-byok-grid {
  margin-bottom: 0;
  grid-template-columns: 1fr;
  max-width: 560px;
}

.portal-byok-field {
  margin-bottom: 0;
}

.portal-settings-input-action {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.portal-settings-input-action .form-input {
  min-width: 0;
}

.portal-settings-input-action .btn {
  flex-shrink: 0;
}

.portal-settings-save {
  position: sticky;
  bottom: 0;
  justify-content: flex-end;
  margin: 28px -24px -24px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
}

/* Shared settings shell (admin + portal) */
.settings-shell {
  display: block;
  min-height: 320px;
}

.settings-shell--tabs {
  display: flex;
  flex-direction: column;
}

.settings-shell--tabs .settings-rail,
.settings-shell--tabs .settings-tabs {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0;
  padding: 0;
  margin: 0 0 4px;
  border-right: none;
  border-bottom: 1px solid var(--border-color);
}

.settings-shell--tabs .settings-rail-item {
  flex: 0 0 auto;
  width: auto;
  border-left: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 10px 16px;
  margin-bottom: -1px;
  background: transparent;
  white-space: nowrap;
}

.settings-shell--tabs .settings-rail-item:hover {
  background: transparent;
  color: var(--text-main);
}

.settings-shell--tabs .settings-rail-item.active {
  border-left-color: transparent;
  border-bottom-color: var(--accent-color);
  background: transparent;
}

.settings-shell--tabs .settings-panels {
  padding-top: 16px;
}

.settings-rail {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 12px 4px 0;
  border-right: 1px solid var(--border-color);
}

.settings-rail-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.settings-rail-item:hover {
  color: var(--text-main);
  background: var(--bg-rail);
}

.settings-rail-item.active {
  color: var(--accent-color);
  background: var(--accent-light);
  border-left-color: var(--accent-color);
}

.settings-rail-item:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.settings-panels {
  min-width: 0;
}

.settings-panel {
  display: block;
}

.settings-panel[hidden] {
  display: none !important;
}

.settings-panel-header {
  margin-bottom: 20px;
}

.settings-panel-header .section-subtitle {
  margin-bottom: 4px;
}

.settings-panel-header .section-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.settings-panel .byok-keys-section,
.settings-panel .style-profile-section,
.settings-panel .api-key-section,
.settings-panel .client-danger-zone {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.settings-save {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
  margin: 28px -24px -24px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  z-index: 2;
}

.settings-save .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.integrations-catalogue-toolbar[hidden] {
  display: none !important;
}

.integrations-catalogue--compact .integrations-catalogue-pills {
  display: none;
}

#client-users-panel .portal-users-section {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

#integrations-tab-wordpress .api-key-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.portal-settings-alert,
.portal-settings-key-reveal {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.portal-settings-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.portal-settings-alert--success {
  color: var(--success-color);
  background: var(--success-bg);
  border-color: rgba(5, 150, 105, 0.2);
}

.portal-settings-alert--error {
  color: var(--danger-color);
  background: var(--danger-bg);
  border-color: rgba(239, 68, 68, 0.2);
}

.portal-settings-alert--warning {
  color: var(--warning-color);
  background: var(--warning-bg);
  border-color: rgba(245, 158, 11, 0.25);
}

.billing-overview-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: none;
}

.billing-overview-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  padding: 26px 30px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: none;
}

.billing-overview-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: #8a8f98;
}

.billing-overview-value {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 17px;
  font-weight: 600;
  color: #101418;
}

.billing-overview-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--success-color);
  flex-shrink: 0;
}

.billing-overview-empty {
  padding: 20px 24px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: none;
}

.billing-overview-help {
  margin: 0;
  font-size: 12px;
  color: #8a8f98;
}

.billing-page-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-top: 4px;
}

.billing-invoices-card {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: none;
  border: 1px solid var(--border-color);
  background: #fff;
  background-image: none;
}

.portal-settings-alert--info {
  color: var(--accent-color);
  background: var(--accent-light);
  border-color: rgba(125, 24, 255, 0.2);
}

.portal-sr-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.portal-sr-overwrite {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.portal-sr-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-rail);
  color: var(--text-muted);
}

.portal-sr-status--ready_for_review,
.portal-sr-status--queued,
.portal-sr-status--running {
  background: var(--warning-bg);
  color: var(--warning-color);
}

.portal-sr-status--approved {
  background: var(--success-bg);
  color: var(--success-color);
}

.portal-sr-status--failed {
  background: var(--danger-bg);
  color: var(--danger-color);
}

@media (max-width: 640px) {
  .portal-sr-row {
    grid-template-columns: 1fr;
  }
}

.billing-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 16px 0 20px;
}

.billing-page-header {
  justify-content: flex-end;
  margin-bottom: 8px;
}

.billing-upgrade-usp {
  position: relative;
  overflow: hidden;
  margin: 0;
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: 14px;
  background: linear-gradient(105deg, #f3faf7 0%, #eaf8f2 46%, #ffffff 100%);
  box-shadow: none;
}

.billing-upgrade-usp-glow {
  position: absolute;
  right: -90px;
  top: -90px;
  width: 320px;
  height: 320px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, rgba(16, 185, 129, 0) 70%);
  pointer-events: none;
}

.billing-upgrade-usp-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 40px;
  padding: 28px 30px 30px;
}

.billing-upgrade-usp-copy {
  min-width: 0;
}

.billing-upgrade-usp-actions {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 10px;
}

.billing-upgrade-eyebrow {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #059669;
}

.billing-upgrade-title {
  display: block;
  margin: 9px 0 6px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #101418;
}

.billing-upgrade-body {
  margin: 0 0 20px;
  font-size: 13.5px;
  line-height: 1.55;
  color: #5f6570;
  max-width: 44ch;
}

.billing-upgrade-diff {
  max-width: none;
}

.billing-upgrade-diff .billing-diff-row {
  grid-template-columns: 104px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(16, 185, 129, 0.18);
  border-bottom: 0;
}

.billing-upgrade-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.billing-upgrade-price-amount {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #101418;
}

.billing-upgrade-price-unit {
  font-size: 13.5px;
  color: #6b7280;
}

.billing-upgrade-price-delta {
  font-size: 12.5px;
  color: #6b7280;
  text-align: right;
}

.billing-upgrade-cta {
  margin-top: 6px;
  padding: 12px 22px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
}

.billing-change-entry {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin: 0;
  padding: 22px 26px 22px 30px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: #fff;
  box-shadow: none;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  width: 100%;
}

.billing-change-entry:hover,
.billing-change-entry:focus-visible {
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: none;
  outline: none;
}

.billing-change-entry-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.billing-change-entry-copy strong {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #101418;
}

.billing-change-entry-copy span {
  font-size: 13px;
  line-height: 1.5;
  color: #6b7280;
}

.billing-change-entry-cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--success-color);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 9px;
  white-space: nowrap;
}

.billing-change-entry:hover .billing-change-entry-cta,
.billing-change-entry:focus-visible .billing-change-entry-cta {
  background: #059669;
}

@media (max-width: 900px) {
  .billing-overview-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .billing-upgrade-usp-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .billing-upgrade-usp-actions {
    align-items: flex-start;
  }

  .billing-upgrade-price-delta {
    text-align: left;
  }
}

@media (max-width: 560px) {
  .billing-overview-summary {
    grid-template-columns: 1fr;
  }
}

.billing-change-layout {
  max-width: none;
  width: 100%;
}

.billing-change-1a {
  display: grid;
  grid-template-columns: 1fr minmax(300px, 380px);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  box-shadow: none;
}

.billing-change-1a-main {
  padding: 28px 30px 32px;
  min-width: 0;
}

.billing-change-1a-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 4px;
}

.billing-change-1a-title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary, #101418);
}

.billing-change-1a-desc {
  margin: 0 0 22px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 52ch;
}

.billing-interval-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.billing-interval-toggle-pills {
  display: flex;
  padding: 3px;
  gap: 2px;
  border-radius: 999px;
  background: #f1f2f0;
}

.billing-interval-pill {
  border: 0;
  cursor: pointer;
  font: 500 13px inherit;
  padding: 8px 18px;
  border-radius: 999px;
  color: #6b7280;
  background: transparent;
}

.billing-interval-pill.is-active {
  color: #101418;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.billing-interval-hint {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--success-color);
}

.billing-plan-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.billing-plan-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  padding: 18px;
  border-radius: 12px;
  background: #fff;
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  font: inherit;
  color: inherit;
}

.billing-plan-card:hover {
  border-color: rgba(16, 185, 129, 0.45);
}

.billing-plan-card.is-selected {
  border-color: var(--success-color);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.billing-plan-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.billing-plan-card-name {
  font-size: 14.5px;
  font-weight: 600;
  color: #101418;
}

.billing-plan-card-tag {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--success-color);
  background: #e6f4ee;
  padding: 3px 7px;
  border-radius: 5px;
}

.billing-plan-card-price {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.billing-plan-card-amount {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #101418;
}

.billing-plan-card-unit,
.billing-plan-card-meta {
  font-size: 12.5px;
  line-height: 1.45;
  color: #6b7280;
}

.billing-change-1a-aside {
  display: flex;
  flex-direction: column;
  padding: 28px 26px;
  background: #fbfbfa;
  border-left: 1px solid rgba(0, 0, 0, 0.08);
}

.billing-change-aside-label {
  margin-bottom: 14px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8a8f98;
}

.billing-diff-list {
  display: flex;
  flex-direction: column;
}

.billing-diff-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 11px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.billing-diff-label {
  font-size: 12.5px;
  color: #8a8f98;
}

.billing-diff-values {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.billing-diff-from {
  font-size: 13px;
  color: #a1a5ac;
}

.billing-diff-from.is-struck {
  text-decoration: line-through;
}

.billing-diff-arrow {
  font-size: 11px;
  color: #c3c6cb;
}

.billing-diff-to {
  font-size: 13.5px;
  font-weight: 600;
  color: #101418;
}

.billing-diff-to.is-changed {
  color: var(--success-color);
}

.billing-diff-note {
  font-size: 11px;
  font-weight: 500;
  color: var(--success-color);
  background: #e6f4ee;
  padding: 2px 7px;
  border-radius: 5px;
}

.billing-saving-box {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.billing-saving-box strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
}

.billing-saving-box span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.45;
  color: #6b7280;
}

.billing-saving-box--good {
  background: #eef8f3;
  border-color: #cfe8db;
}

.billing-saving-box--good strong {
  color: var(--success-color);
}

.billing-saving-box--muted {
  background: #f3f4f3;
  border-color: #e5e7e5;
}

.billing-saving-box--muted strong {
  color: #6b7280;
}

.billing-change-aside-spacer {
  flex: 1;
  min-height: 18px;
}

.billing-change-1a-cta {
  width: 100%;
  margin-top: 18px;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  background: var(--success-color);
  border-color: var(--success-color);
}

.billing-change-1a-cta:hover,
.billing-change-1a-cta:focus-visible {
  background: #059669;
  border-color: #059669;
}

.billing-change-aside-foot {
  margin: 10px 0 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: #8a8f98;
  text-align: center;
}

@media (max-width: 900px) {
  .billing-change-1a {
    grid-template-columns: 1fr;
  }

  .billing-change-1a-aside {
    border-left: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
  }
}

.billing-pay-layout {
  max-width: 720px;
}

.billing-pay-back {
  margin-bottom: 16px;
}

.billing-pay-hero {
  margin-bottom: 20px;
}

.billing-pay-brand {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--success-color);
}

.billing-pay-summary {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #fafbfc;
}

.billing-pay-summary > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.billing-pay-arrow {
  color: var(--text-muted);
  font-size: 18px;
}

.billing-pay-lines {
  margin-bottom: 16px;
}

.billing-pay-amount {
  text-align: right;
  white-space: nowrap;
}

.billing-pay-credit {
  color: #047857;
}

.billing-pay-totals {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.billing-pay-totals > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.billing-pay-due {
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.billing-pay-due strong {
  font-size: 20px;
}

.billing-pay-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 640px) {
  .billing-pay-summary {
    grid-template-columns: 1fr;
  }

  .billing-pay-arrow {
    display: none;
  }
}

.billing-summary > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.billing-summary strong {
  font-size: 15px;
}

.billing-change-plan {
  margin-bottom: 16px;
}

.billing-change-plan-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.billing-change-plan-controls .form-input {
  width: auto;
  min-width: 120px;
  max-width: 160px;
  flex: 0 0 auto;
}

.billing-change-plan-controls .billing-compare-benefits {
  margin: 0;
  flex: 0 1 auto;
  min-width: 0;
}

.billing-change-plan-btn {
  flex-shrink: 0;
  border: 1px solid var(--success-color);
  background: var(--success-color);
  color: #fff;
}

.billing-change-plan-btn:hover,
.billing-change-plan-btn:focus-visible {
  border-color: #059669;
  background: #059669;
  color: #fff;
}

.billing-change-plan-btn:disabled {
  border-color: #e5e7eb;
  background: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
  opacity: 1;
}

.billing-change-plan-btn:disabled:hover,
.billing-change-plan-btn:disabled:focus-visible {
  border-color: #e5e7eb;
  background: #f3f4f6;
  color: #9ca3af;
}

.billing-plan-compare {
  margin-top: 14px;
}

.billing-compare-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #fafbfc;
  overflow: hidden;
}

.billing-compare-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
}

.billing-compare-card-header .form-hint {
  margin: 0;
}

.billing-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.billing-compare-table th,
.billing-compare-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #eef0f3;
  vertical-align: top;
}

.billing-compare-table thead th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  background: transparent;
}

.billing-compare-table tbody th {
  width: 28%;
  font-weight: 500;
  color: var(--text-muted);
}

.billing-compare-table tr:last-child th,
.billing-compare-table tr:last-child td {
  border-bottom: none;
}

.billing-compare-row--changed td:last-child {
  font-weight: 600;
}

.billing-compare-value {
  margin-right: 6px;
}

.billing-compare-benefits {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  border: none;
  background: transparent;
}

.billing-compare-benefit-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.billing-compare-benefit-item strong {
  font-size: 12px;
  line-height: 1.2;
  color: #047857;
}

.billing-compare-benefit-item span {
  font-size: 10px;
  line-height: 1.2;
  color: #059669;
}

.billing-compare-value {
  margin-right: 6px;
}

.billing-compare-note {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #d1fae5;
  color: #047857;
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
  white-space: nowrap;
}

.billing-compare-row--benefit td:last-child {
  color: #047857;
}

.billing-compare-features {
  list-style: none;
  margin: 0;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.billing-compare-features li {
  font-size: 12px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.billing-compare-feature--gain {
  color: #047857;
}

.billing-compare-feature--loss {
  color: #b91c1c;
}

.portal-settings-alert-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  color: currentColor;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.portal-settings-alert-close:hover,
.portal-settings-alert-close:focus-visible {
  background: rgba(17, 24, 39, 0.07);
}

.portal-settings-key-reveal {
  background: var(--accent-light);
  border-color: rgba(79, 70, 229, 0.2);
}

.portal-settings-key-reveal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.portal-settings-key-reveal p {
  margin: 2px 0 10px;
  color: var(--text-muted);
  font-size: 12px;
}

.placeholder-text {
  padding: 20px;
  color: var(--text-muted);
  font-size: 13px;
}

@media (max-width: 1100px) {
  .split-grid,
  .clients-split {
    grid-template-columns: 1fr;
  }

  .user-info {
    display: none;
  }

  .search-bar {
    min-width: 160px;
  }
}

@media (max-width: 768px) {
  .icon-rail {
    display: none;
  }

  .ai-override-fields {
    grid-template-columns: 1fr;
  }

  .settings-shell {
    grid-template-columns: 1fr;
  }

  .settings-shell--tabs .settings-rail,
  .settings-shell--tabs .settings-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0;
  }

  .settings-shell--tabs .settings-rail-item {
    border-radius: 0;
    background: transparent;
    border-bottom: 2px solid transparent;
  }

  .settings-shell--tabs .settings-rail-item.active {
    border-left-color: transparent;
    border-bottom-color: var(--accent-color);
  }

  .settings-rail:not(.settings-tabs) {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 0 0 12px;
    border-right: 0;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .settings-rail:not(.settings-tabs) .settings-rail-item {
    flex: 0 0 auto;
    border-left: 0;
    border-bottom: 3px solid transparent;
    border-radius: 999px;
    padding: 8px 14px;
    background: var(--bg-rail);
    white-space: nowrap;
  }

  .settings-rail:not(.settings-tabs) .settings-rail-item.active {
    border-left-color: transparent;
    border-bottom-color: var(--accent-color);
  }

  .settings-panels {
    padding-left: 0;
    padding-top: 16px;
  }

  .settings-save,
  .portal-settings-save {
    margin-left: -16px;
    margin-right: -16px;
  }

  .icon-btn.portal-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
  }

  .icon-btn.portal-nav-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
  }

  .sidebar {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1200;
    width: min(280px, 86vw);
    height: 100vh;
    max-height: 100vh;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: none;
    background: var(--bg-sidebar);
  }

  .dashboard-container.portal-nav-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(15, 23, 42, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .dashboard-container.portal-nav-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .top-header {
    padding: 12px 16px;
  }

  .header-left {
    min-width: 0;
  }

  .main-content {
    padding: 12px;
  }

  .content-panel {
    padding: 16px;
  }

  .portal-users-header,
  .portal-users-eligible-header,
  .portal-user-row,
  .portal-billing-banner-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-users-invite-form {
    grid-template-columns: 1fr;
  }

  .portal-user-actions,
  .portal-billing-banner-actions {
    align-self: stretch;
    justify-content: space-between;
    width: 100%;
  }

  .portal-settings-input-action,
  .api-key-reveal-row {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-settings-save {
    margin-right: -16px;
    margin-left: -16px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .word-lists-grid {
    grid-template-columns: 1fr;
  }
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(400px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 16px 18px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 14px;
  box-shadow:
    0 20px 40px rgba(16, 24, 40, 0.12),
    0 4px 12px rgba(16, 24, 40, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: auto;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px) scale(0.97);
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast.leaving {
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
}

.toast-icon-wrap {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-icon-wrap svg {
  width: 20px;
  height: 20px;
  display: block;
}

.toast-body {
  flex: 1;
  min-width: 0;
  padding-top: 1px;
}

.toast-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-main);
  margin-bottom: 2px;
}

.toast-message {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

.toast-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.toast-close svg {
  width: 14px;
  height: 14px;
  display: block;
}

.toast-close:hover {
  background: rgba(17, 24, 39, 0.06);
  color: var(--text-main);
}

.toast-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  transform-origin: left center;
  animation: toast-progress var(--toast-duration, 4500ms) linear forwards;
}

@keyframes toast-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

.toast-success .toast-icon-wrap {
  background: var(--success-bg);
  color: var(--success-color);
}

.toast-success .toast-progress {
  background: var(--success-color);
}

.toast-error .toast-icon-wrap {
  background: var(--danger-bg);
  color: var(--danger-color);
}

.toast-error .toast-progress {
  background: var(--danger-color);
}

.toast-warning .toast-icon-wrap {
  background: var(--warning-bg);
  color: var(--warning-color);
}

.toast-warning .toast-progress {
  background: var(--warning-color);
}

.toast-info .toast-icon-wrap {
  background: var(--accent-light);
  color: var(--accent-color);
}

.toast-info .toast-progress {
  background: var(--accent-color);
}

/* WordPress onboarding tour + hub */
.portal-wp-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid rgba(217, 119, 6, 0.28);
  border-radius: var(--radius-sm);
  background: var(--warning-bg, #fffbeb);
  color: var(--text-main);
}

.portal-wp-banner p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.portal-wp-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.portal-wp-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 12px 0 16px;
}

.portal-wp-download {
  margin-bottom: 16px;
}

.portal-wp-instructions {
  margin: 0 0 20px;
  padding-left: 20px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}

.portal-wp-instructions li + li {
  margin-top: 6px;
}

.portal-required-pill,
.portal-optional-pill {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}

.portal-required-pill {
  color: #92400e;
  background: #fef3c7;
}

.portal-optional-pill {
  color: var(--text-muted);
  background: rgba(17, 24, 39, 0.06);
}

.portal-tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(15, 23, 42, 0.45);
}

.portal-tour-overlay.hidden {
  display: none;
}

.portal-tour-spotlight {
  position: fixed;
  z-index: 3001;
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.55);
  background: transparent;
  pointer-events: none;
  outline: 2px solid rgba(255, 255, 255, 0.85);
}

.portal-tour-popup {
  position: fixed;
  z-index: 3002;
  width: min(360px, calc(100vw - 32px));
  padding: 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(17, 24, 39, 0.08);
  box-shadow: 0 20px 40px rgba(16, 24, 40, 0.18);
}

.portal-tour-popup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.portal-tour-popup p {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

.portal-tour-popup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.portal-tour-step-indicator {
  margin: 12px 0 0 !important;
  font-size: 12px !important;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .portal-wp-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── Integrations catalogue ── */
.integrations-catalogue {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.integrations-catalogue-hero {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 0;
}

.integrations-catalogue-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--accent-light);
  color: var(--accent-color);
  flex-shrink: 0;
}

.integrations-catalogue-icon svg {
  width: 20px;
  height: 20px;
}

.integrations-catalogue-hero-text h2,
.integrations-catalogue-hero-text h3 {
  margin: 0 0 4px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.integrations-catalogue-hero-text p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
  max-width: 52ch;
}

.integrations-catalogue-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.integrations-catalogue-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-rail);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
}

.integrations-catalogue-pill--accent {
  border-color: transparent;
  background: var(--accent-light);
  color: var(--accent-color);
}

.integrations-catalogue-pill svg {
  width: 11px;
  height: 11px;
}

.integrations-catalogue-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.integrations-catalogue-mode {
  display: inline-flex;
  padding: 3px;
  border-radius: 8px;
  background: var(--bg-rail);
  border: 1px solid var(--border-color);
  gap: 2px;
}

.integrations-catalogue-mode-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.integrations-catalogue-mode-btn:hover {
  color: var(--text-main);
}

.integrations-catalogue-mode-btn.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.integrations-catalogue-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.integrations-catalogue-filters select.form-input,
.integrations-catalogue-search.form-input {
  min-width: 0;
  width: auto;
  font-size: 12px;
  padding: 6px 10px;
  height: 32px;
}

.integrations-catalogue-filters select.form-input {
  min-width: 132px;
}

.integrations-catalogue-search-wrap {
  position: relative;
  min-width: 140px;
  flex: 0 1 180px;
  max-width: 200px;
}

.integrations-catalogue-search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  color: var(--text-muted);
  pointer-events: none;
}

.integrations-catalogue-search.form-input {
  width: 100%;
  padding-left: 30px;
}

.integrations-catalogue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.integrations-catalogue-group + .integrations-catalogue-group {
  margin-top: 24px;
}

.integrations-catalogue-group-title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
}

.integrations-catalogue-footnote {
  margin: 20px 0 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.4;
}

.integration-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  min-height: 100%;
}

.integration-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.integration-card-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  flex-shrink: 0;
  overflow: hidden;
}

.integration-card-logo-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}

.integration-card-logo--mono {
  color: #fff;
}

.integration-card-logo--mono .integration-card-logo-img {
  filter: brightness(0) invert(1);
}

.integration-card-logo--color {
  background: #fff;
  border: 1px solid var(--border-color);
}

.integration-card-logo--color .integration-card-logo-img {
  width: 18px;
  height: 18px;
}

.integration-card-logo--wordpress { background: #21759b; }
.integration-card-logo--gsc { background: #4285f4; }
.integration-card-logo--seranking { background: #fff; }
.integration-card-logo--ai-visibility { background: linear-gradient(135deg, #7d18ff 0%, #5b21b6 100%); }

.integration-card-recommended,
.integration-card-required {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.integration-card-recommended {
  background: var(--warning-bg);
  color: #b45309;
}

.integration-card-required {
  background: var(--danger-bg);
  color: #b91c1c;
}

.integration-card-title-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.integration-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.integration-card-auth {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.integration-card-auth svg {
  width: 12px;
  height: 12px;
}

.integration-card-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  flex: 1;
}

.integration-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

.integration-card-actions .btn {
  width: auto;
}

.integration-card.is-connected {
  border-color: var(--success-color);
}

.integration-card-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--success-color);
  color: #ffffff;
}

.integration-card-check svg {
  width: 13px;
  height: 13px;
}

.integration-card-status {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--success-bg);
  font-size: 12px;
  font-weight: 600;
  color: var(--success-color);
}

.integration-card-status--pending {
  background: var(--warning-bg);
  color: var(--warning-color);
}

.integrations-catalogue-empty {
  padding: 36px 20px;
  text-align: center;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-rail);
}

.integrations-catalogue-empty p {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 14px;
}

.integrations-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}

.client-workspace-body:has(.integration-detail-topline) {
  position: relative;
}

.integrations-detail-back svg {
  width: 14px;
  height: 14px;
}

#integrations-detail-wrap.hidden,
#integrations-catalogue-root.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .integrations-catalogue-filters {
    margin-left: 0;
    width: 100%;
  }

  .integrations-catalogue-search-wrap {
    max-width: none;
    flex: 1 1 100%;
  }
}

@media (max-width: 640px) {
  .integrations-catalogue-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .integrations-catalogue-mode {
    width: 100%;
  }

  .integrations-catalogue-mode-btn {
    flex: 1;
    text-align: center;
  }
}

.custom-seeds-block {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.custom-seeds-header {
  margin-bottom: 8px;
}

.custom-seeds-input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.custom-seeds-input-row .form-input {
  flex: 1 1 220px;
  min-width: 180px;
}

.custom-seed-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.custom-seed-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 6px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  border: 1px solid var(--border-color);
  font-size: 13px;
}

.custom-seed-chip-text {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-seed-chip-remove {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}

.custom-seed-chip-remove:hover {
  color: var(--danger-color);
}

/* ── Public landing ── */
.landing-body {
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(125, 24, 255, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 0%, rgba(16, 185, 129, 0.08), transparent 50%),
    var(--bg-primary);
}

.landing-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 24px;
}

.landing-brand {
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.landing-top-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.landing-top-nav a:not(.btn) {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.landing-top-nav a:not(.btn):hover {
  color: var(--text-main);
}

.landing-hero {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 28px;
  text-align: center;
}

.landing-kicker {
  margin: 0 0 12px;
  color: var(--accent-color);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.landing-hero h1 {
  margin: 0;
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-size: clamp(34px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.landing-lead {
  margin: 16px auto 0;
  max-width: 540px;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.55;
}

.landing-cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}

.landing-plans {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 24px 64px;
  text-align: center;
}

.landing-plans h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.landing-section-intro {
  margin: 8px 0 24px;
  color: var(--text-muted);
  font-size: 14px;
}

.billing-interval-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin: 0 auto 20px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--bg-card);
}

.billing-interval-option {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.billing-interval-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.billing-interval-option span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.billing-interval-option:has(input:checked) span {
  background: var(--accent-color);
  color: #fff;
}

.billing-interval-save {
  font-style: normal;
  font-weight: 600;
  font-size: 11px;
  opacity: 0.9;
}

.signup-interval-wrap {
  margin: 0 0 12px;
}

.portal-billing-interval-wrap {
  margin: 0;
}

.portal-billing-interval-wrap .billing-interval-toggle {
  margin: 8px 0 0;
}

.landing-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  text-align: left;
}

.landing-plan-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.landing-plan-card--featured {
  border-color: var(--accent-color);
  background: #f8fbff;
}

.landing-plan-card h3 {
  margin: 0;
  font-size: 18px;
}

.landing-plan-price {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.landing-plan-meta {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 13px;
}

.landing-plan-card ul {
  margin: 0 0 16px;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  flex: 1;
}

.landing-plan-card ul li + li {
  margin-top: 4px;
}

.landing-plan-card .btn {
  align-self: flex-start;
}

.landing-footnote {
  margin: 18px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.landing-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  padding: 20px 24px 40px;
  color: var(--text-muted);
  font-size: 13px;
}

.landing-footer a {
  color: var(--text-muted);
}

.landing-footer a:hover {
  color: var(--text-main);
}

.portal-setup-checklist {
  margin-bottom: 16px;
  padding: 22px 24px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.portal-setup-checklist h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.portal-setup-title-done {
  display: flex;
  align-items: center;
  gap: 10px;
}

.portal-setup-title-struck {
  position: relative;
  display: inline-block;
  color: var(--text-muted);
}

.portal-setup-strike {
  position: absolute;
  left: -4px;
  right: -4px;
  bottom: 2px;
  width: calc(100% + 8px);
  height: 12px;
  color: #8222fe;
  overflow: visible;
  pointer-events: none;
}

.portal-setup-title-badge {
  padding: 4px 12px;
  border-radius: 999px;
  background: #defc65;
  color: #141414;
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
}

.portal-setup-checklist-list {
  list-style: none;
  margin: 0;
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.portal-setup-checklist-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 50px;
  padding: 10px 20px;
  border-radius: 18px;
  background: #f9fafb;
  font-size: 12px;
  font-weight: 600;
  box-sizing: border-box;
}

.portal-setup-checklist-list li:not(.is-done) {
  background: rgba(227, 226, 225, 0.55);
}

.portal-setup-checklist-list.is-complete li.is-done + li.is-done {
  margin-top: -22px;
  box-shadow: 0 -3px 0 var(--bg-card);
}

.portal-setup-checklist-list.is-complete li.is-done:nth-of-type(1) {
  width: 88%;
  align-self: center;
  opacity: 0.55;
}

.portal-setup-checklist-list.is-complete li.is-done:nth-of-type(2) {
  width: 92%;
  align-self: center;
  opacity: 0.7;
}

.portal-setup-checklist-list.is-complete li.is-done:nth-of-type(3) {
  width: 96%;
  align-self: center;
  opacity: 0.85;
}

.portal-setup-checklist-list li.portal-setup-done-note {
  justify-content: center;
  gap: 14px;
  height: auto;
  min-height: 60px;
  padding: 14px 28px;
  margin-top: 4px;
  background: #8222fe;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.portal-setup-confetti {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #ffffff;
  font-size: 20px;
  line-height: 1;
  text-indent: 1px;
}

.portal-setup-checklist-list li .btn-sm {
  padding: 6px 14px;
}

.portal-setup-checklist-list li .form-hint {
  margin: 0;
  display: flex;
  align-items: center;
  font-weight: 600;
}

.portal-setup-checklist-list li.is-done .form-hint {
  padding: 6px 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  font-size: 12px;
}

.portal-setup-checklist-list li.is-done {
  background: #defc65;
  color: #141414;
}

.portal-setup-checklist-list li.is-done .form-hint {
  color: #141414;
}

.portal-setup-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  font-weight: 600;
  margin-right: 8px;
}

.portal-setup-checklist-list li.is-done .portal-setup-check {
  border-radius: 50%;
  background: #141414;
  color: #defc65;
  font-size: 11px;
  flex-shrink: 0;
}

.portal-ai-visibility .portal-ai-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.portal-ai-kpi {
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #fafbfc;
}

.portal-ai-kpi-val {
  display: block;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.portal-ai-kpi-label {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.portal-ai-disclaimer {
  margin: 0 0 16px;
}

.portal-ai-visibility .settings-shell--tabs,
.portal-ai-visibility .portal-ai-tabs {
  margin-bottom: 16px;
}

.portal-ai-visibility .portal-ai-tabs {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0;
  padding: 0;
  margin: 0 0 16px;
  border-bottom: 1px solid var(--border-color);
}

.portal-ai-visibility .portal-ai-tabs .settings-rail-item {
  flex: 0 0 auto;
  width: auto;
  border-left: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 10px 16px;
  margin-bottom: -1px;
  background: transparent;
}

.portal-ai-visibility .portal-ai-tabs .settings-rail-item.active {
  border-bottom-color: var(--accent-color);
  background: transparent;
}

.portal-ai-upsell {
  padding: 20px;
}

@media (max-width: 720px) {
  .portal-ai-visibility .portal-ai-kpis {
    grid-template-columns: 1fr;
  }

  .landing-plan-grid {
    grid-template-columns: 1fr;
  }

  .landing-top {
    flex-wrap: wrap;
  }
}
