/* ==========================================================================
   iAmAI — /app/* dashboard shell styles
   Mirrors onboarding.html visual language (top bar gradient, font stack,
   token-driven sidebar + content). All colors come from /design-tokens.css.
   No hex literals here outside of rgba() shadows.
   ========================================================================== */

/* ── Reset + base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--color-surface-50);
  color: var(--color-surface-900);
  font-family: 'Assistant', 'Heebo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: var(--text-base);
  line-height: 1.5;
  min-height: 100vh;
}
body { display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.material-symbols-rounded {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  user-select: none;
  vertical-align: middle;
}

/* ── Top bar — Code Space dark with subtle cyan undertone ───────────────
   Reverted from the all-cyan gradient (too loud against the deep-black
   body); now a dark glassmorphic bar with a thin cyan glow at the bottom
   edge. Logo + actions inherit the warm cyan from --cs-cyan. */
.top-bar {
  background: linear-gradient(180deg, rgba(13, 17, 23, 0.92), rgba(10, 10, 15, 0.86));
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  color: var(--cs-text);
  padding: 10px 20px;
  border-bottom: 1px solid var(--cs-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 var(--cs-cyan-soft), 0 4px 24px rgba(0, 0, 0, 0.45);
}
.top-bar-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-6);
}
.top-bar-logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--cs-cyan-soft);
  color: var(--cs-cyan);
  border: 1px solid var(--cs-cyan);
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: var(--text-sm);
  white-space: nowrap;
  box-shadow: 0 0 16px var(--cs-cyan-glow);
}
.top-bar-logo .material-symbols-rounded {
  font-size: 16px;
  color: var(--cs-cyan);
}

/* Admin-only store switcher (centered between logo + user dropdown).
   Hidden by default; app.js reveals it when home-summary returns
   is_admin:true. Translucent pill on the gradient bar — same family
   as .top-bar-user. Token sub: --color-brand-300 doesn't exist →
   --color-brand-50 used for the focus ring. */
.top-bar-store-switcher {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-inline: auto;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius-full);
}
.top-bar-store-switcher[hidden] { display: none !important; }
.store-switcher__label {
  color: rgba(255, 255, 255, 0.85);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
}
.store-switcher__select {
  background: var(--color-surface-0);
  border: 1px solid rgba(255, 255, 255, 0.30);
  border-radius: var(--radius-md);
  padding: 4px 12px;
  font-size: var(--text-sm);
  color: var(--color-surface-900);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  max-width: 280px;
}
.store-switcher__select:focus {
  outline: 2px solid var(--color-brand-50);
  outline-offset: 1px;
}
@media (max-width: 640px) {
  .top-bar-store-switcher { display: none; }   /* mobile: hide for screen budget */
}

/* User dropdown (right side in LTR / left side in RTL) */
.top-bar-user-wrap { position: relative; }
.top-bar-user {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px 10px 4px 6px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius-full);
  color: var(--color-surface-0);
  transition: background 120ms var(--ease);
}
.top-bar-user:hover { background: rgba(255, 255, 255, 0.22); }
.top-bar-user[aria-expanded="true"] { background: rgba(255, 255, 255, 0.26); }
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--color-surface-0);
  color: var(--color-brand-500);
  font-weight: 700;
  font-size: var(--text-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.user-chevron { font-size: 18px; opacity: 0.9; }

.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  /* In RTL, the toggle sits on the LEFT side of the top bar. Anchoring at
     the toggle's physical left edge (`inset-inline-end: 0`) lets the
     dropdown extend rightward into the viewport instead of leftward off
     the screen. */
  inset-inline-end: 0;
  inset-inline-start: auto;
  min-width: 240px;
  max-width: 320px;
  background: var(--color-surface-0);
  color: var(--color-surface-900);
  border: 1px solid var(--color-surface-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-3);
  padding: var(--space-2);
  z-index: 110;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.user-menu[hidden] { display: none; }
.user-menu-email {
  display: block;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-surface-500);
  word-break: break-all;
}
.user-menu-divider {
  border: 0;
  border-top: 1px solid var(--color-surface-200);
  margin: 4px 0;
}
.user-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: transparent;
  border: 0;
  color: var(--color-surface-900);
  font-size: var(--text-sm);
  text-align: start;
  width: 100%;
  transition: background 100ms var(--ease);
}
.user-menu-item:hover { background: var(--color-surface-100); }
.user-menu-item .material-symbols-rounded { font-size: 18px; color: var(--color-surface-500); }
.user-menu-signout { color: var(--color-error-500); }
.user-menu-signout .material-symbols-rounded { color: var(--color-error-500); }

/* ── Mobile menu toggle (hamburger) ───────────────────────────────────── */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 14px;
  inset-inline-start: 14px;
  z-index: 120;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--color-surface-0);
  border: 1px solid var(--color-surface-200);
  box-shadow: var(--shadow-1);
  align-items: center;
  justify-content: center;
  color: var(--color-surface-900);
}
.mobile-menu-toggle .material-symbols-rounded { font-size: 22px; }

/* ── Layout: sidebar (right in RTL) + content ─────────────────────────── */
.app-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 240px 1fr;   /* RTL: first column renders rightmost */
  align-items: stretch;
  min-height: calc(100vh - 64px);
}

/* ── Sidebar ──────────────────────────────────────────────────────────── */
.app-sidebar {
  background: var(--color-surface-0);
  border-inline-start: 1px solid var(--color-surface-200); /* visual seam toward content */
  padding: var(--space-6) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-3);
  border-radius: var(--radius-md);
  color: var(--color-surface-900);
  font-size: var(--text-sm);
  font-weight: 500;
  position: relative;
  transition: background 120ms var(--ease), color 120ms var(--ease);
}
.sidebar-item:hover { background: var(--color-surface-100); }
.sidebar-item.is-active {
  background: var(--color-brand-50);
  color: var(--color-brand-700);
  font-weight: 700;
}
/* Right-edge accent on the active item (RTL: this is the edge nearest content) */
.sidebar-item.is-active::before {
  content: "";
  position: absolute;
  inset-block: 6px;
  inset-inline-end: -16px;     /* sit on the sidebar's start border */
  width: 3px;
  background: var(--color-brand-500);
  border-radius: 3px;
}
.sidebar-icon {
  width: 24px;
  text-align: center;
  font-size: 18px;
  flex-shrink: 0;
}
.sidebar-label { flex: 1; }

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-surface-200);
}
.sidebar-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 var(--space-2);
  font-size: var(--text-xs);
}
.sidebar-user-label { color: var(--color-surface-500); }
.sidebar-user-email {
  color: var(--color-surface-900);
  font-weight: 600;
  word-break: break-all;
}
.sidebar-signout {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  justify-content: center;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-surface-50);
  border: 1px solid var(--color-surface-200);
  color: var(--color-error-500);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: background 120ms var(--ease);
}
.sidebar-signout:hover { background: var(--color-error-50); }
.sidebar-signout .material-symbols-rounded { font-size: 18px; }

/* ── Main content ─────────────────────────────────────────────────────── */
.app-content {
  padding: var(--space-8);
  background: var(--color-surface-50);
  min-width: 0; /* allow grid child to shrink */
}

/* ── Page wrapper + placeholder card (one per route) ──────────────────── */
/* `.page` is the route-level section that the SPA router toggles via
   `hidden`. The visible content lives inside `.page-placeholder`. */
.page-placeholder {
  max-width: 480px;
  margin: 80px auto;
  padding: 48px 32px;
  background: var(--color-surface-0);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-surface-200);
  box-shadow: var(--shadow-2);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}
.page-placeholder__icon-wrapper {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  /* Soft halo: pale brand → white. brand-100 isn't in the token set,
     so we substitute brand-50 → surface-0 which gives the same visual. */
  background: linear-gradient(135deg, var(--color-brand-50), var(--color-surface-0));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-2);
}
.page-placeholder__icon {
  font-size: 40px !important;
  color: var(--color-brand-500);
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 40;
}
.page-placeholder h2 {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-surface-900);
}
.page-placeholder__description {
  margin: 0;
  color: var(--color-surface-500);
  font-size: var(--text-base);
  line-height: 1.5;
}
.page-placeholder__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--color-warning-50);
  color: var(--color-warning-900);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-top: var(--space-2);
}
.page-placeholder__badge .material-symbols-rounded {
  font-size: 14px;
}

/* ── Mobile sidebar backdrop ──────────────────────────────────────────── */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: var(--backdrop-overlay);
  z-index: 90;
}
.sidebar-backdrop[hidden] { display: none; }

/* ── Responsive: mobile drawer ────────────────────────────────────────── */
@media (max-width: 768px) {
  .mobile-menu-toggle { display: inline-flex; }

  .top-bar { padding-inline-start: 64px; } /* leave room for the hamburger */

  .app-layout {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    /* RTL: drawer slides in from the right edge */
    inset-inline-end: 0;
    height: 100vh;
    width: 280px;
    z-index: 100;
    transform: translateX(100%);   /* off-screen to the start side (right in RTL = +X) */
    transition: transform 220ms var(--ease);
    border-inline-start: 0;
    box-shadow: -4px 0 16px rgba(60, 64, 67, 0.18);
    padding-top: var(--space-12);
  }
  /* In RTL, translateX(100%) actually moves toward the logical start (right);
     re-confirm by using a class toggle. */
  .app-sidebar.is-open { transform: translateX(0); }

  .sidebar-item.is-active::before { display: none; }

  .app-content { padding: var(--space-4); }
  .page-placeholder { padding: var(--space-12) var(--space-4); }
}

/* ── Reduced motion ──────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .app-sidebar, .top-bar-user, .sidebar-item, .user-menu-item, .sidebar-signout {
    transition: none;
  }
}

/* ════════════════════════════════════════════════════════════════════════
   HOME PAGE
   Token notes: design-tokens.css doesn't define -300/-400/-700 surface
   variants or brand-300, so this section uses the closest existing
   tokens (200, 500, 900 / brand-500). Same substitution policy as Part 1.
   ════════════════════════════════════════════════════════════════════════ */

/* ── Welcome header ──────────────────────────────────────────────────── */
.home-welcome {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
  gap: var(--space-4);
}
.home-welcome__greeting h1 {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-surface-900);
  margin: 0 0 var(--space-2) 0;
}
.home-welcome__subtitle {
  font-size: var(--text-base);
  color: var(--color-surface-500);
  margin: 0;
}
.home-welcome__store-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--color-success-50);
  color: var(--color-success-900);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
}
.home-welcome__store-status .material-symbols-rounded { font-size: 16px; }
.home-welcome__store-status.is-disconnected {
  background: var(--color-warning-50);
  color: var(--color-warning-900);
}

/* ── Stats row ───────────────────────────────────────────────────────── */
.home-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}
.stat-card {
  position: relative;
  background: var(--color-surface-0);
  border: 1px solid var(--color-surface-200);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-1);
  transition: box-shadow 200ms var(--ease), transform 200ms var(--ease);
}
.stat-card:hover {
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
}
.stat-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.stat-card__icon {
  font-size: 24px;
  color: var(--color-brand-500);
}
.stat-card--gsc  .stat-card__icon { color: var(--color-brand-500); }
.stat-card--ai   .stat-card__icon { color: var(--color-warning-500); }
.stat-card--links .stat-card__icon { color: var(--color-success-500); }
.stat-card--indexing .stat-card__icon { color: var(--color-brand-500); }
.stat-card.is-clickable { cursor: pointer; }
.stat-card.is-clickable:focus-visible {
  outline: 2px solid var(--color-brand-500);
  outline-offset: 2px;
}
.stat-card__action {
  margin-top: var(--space-3);
}
.stat-card__cta {
  display: inline-block;
  padding: 6px 12px;
  background: var(--color-brand-500);
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.stat-card__cta:hover { filter: brightness(0.95); }
.stat-card__label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-surface-900);
}
.stat-card__value {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-surface-900);
  line-height: 1.1;
  margin-bottom: 4px;
}
.stat-card__sub {
  font-size: var(--text-xs);
  color: var(--color-surface-500);
}
/* "בקרוב" pill anchored top-start (right edge in RTL) on placeholder cards */
.stat-card__pending-badge {
  position: absolute;
  top: var(--space-3);
  inset-inline-end: var(--space-3);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: var(--color-warning-50);
  color: var(--color-warning-900);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.stat-card__pending-badge .material-symbols-rounded { font-size: 12px; }

/* ── Two-column grid: activity + actions ─────────────────────────────── */
.home-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--space-6);
}
.home-card {
  background: var(--color-surface-0);
  border: 1px solid var(--color-surface-200);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-1);
}
.home-card__header {
  margin-bottom: var(--space-4);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.home-card__header h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-surface-900);
  margin: 0;
}
.home-card__subtitle {
  font-size: var(--text-xs);
  color: var(--color-surface-500);
}

/* ── Activity timeline ───────────────────────────────────────────────── */
.activity-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-surface-100);
}
.activity-item:last-child { border-bottom: none; }
.activity-item__icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--color-brand-50);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.activity-item__icon .material-symbols-rounded {
  font-size: 18px;
  color: var(--color-brand-500);
}
.activity-item__icon--success { background: var(--color-success-50); }
.activity-item__icon--success .material-symbols-rounded { color: var(--color-success-500); }
.activity-item__icon--failed  { background: var(--color-error-50); }
.activity-item__icon--failed  .material-symbols-rounded { color: var(--color-error-500); }
.activity-item__content { flex: 1; min-width: 0; }
.activity-item__title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-surface-900);
}
.activity-item__time {
  font-size: var(--text-xs);
  color: var(--color-surface-500);
  margin-top: 2px;
}
.activity-empty {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--color-surface-500);
  font-size: var(--text-sm);
}

/* ── Quick action cards ──────────────────────────────────────────────── */
.quick-action {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-surface-200);
  margin-bottom: var(--space-2);
  cursor: pointer;
  transition: background 150ms var(--ease), border-color 150ms var(--ease);
  text-decoration: none;
  color: inherit;
}
.quick-action:last-child { margin-bottom: 0; }
.quick-action:hover:not(.quick-action--disabled) {
  background: var(--color-brand-50);
  border-color: var(--color-brand-500);
}
.quick-action--disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.quick-action__icon {
  font-size: 24px;
  color: var(--color-brand-500);
  flex-shrink: 0;
}
.quick-action--disabled .quick-action__icon { color: var(--color-surface-500); }
.quick-action__text { flex: 1; min-width: 0; }
.quick-action__title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-surface-900);
}
.quick-action__desc {
  font-size: var(--text-xs);
  color: var(--color-surface-500);
  margin-top: 2px;
}
.quick-action__arrow {
  font-size: 20px;
  color: var(--color-surface-500);
}

/* ── Loading skeleton (for activity timeline placeholder) ────────────── */
.loading-skeleton {
  height: 120px;
  background: linear-gradient(
    90deg,
    var(--color-surface-100),
    var(--color-surface-50),
    var(--color-surface-100)
  );
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}
@keyframes skeleton-pulse {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Mobile breakpoints ──────────────────────────────────────────────── */
@media (max-width: 968px) {
  .home-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .home-stats { grid-template-columns: 1fr; }
  .home-welcome__greeting h1 { font-size: var(--text-xl); }
}

/* ════════════════════════════════════════════════════════════════════════
   SETTINGS PAGE
   Token notes (same substitution policy as Part 1/Part 2):
     warning-700 → warning-900, surface-300 → surface-200,
     surface-700 → surface-900.
   ════════════════════════════════════════════════════════════════════════ */

/* ── Reusable page header (h1 + subtitle) ────────────────────────────── */
.page-header { margin-bottom: var(--space-8); }
.page-header h1 {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-surface-900);
  margin: 0 0 var(--space-2) 0;
}
.page-header__subtitle {
  font-size: var(--text-base);
  color: var(--color-surface-500);
  margin: 0;
}

/* ── Settings cards ──────────────────────────────────────────────────── */
.settings-card {
  background: var(--color-surface-0);
  border: 1px solid var(--color-surface-200);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-1);
}
.settings-card--featured {
  border-color: var(--color-brand-500);
  box-shadow: 0 0 0 4px var(--color-brand-50), var(--shadow-2);
}
.settings-card__header {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  align-items: flex-start;
}
.settings-card__icon {
  font-size: 32px !important;
  color: var(--color-brand-500);
  background: var(--color-brand-50);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}
.settings-card__header h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-surface-900);
  margin: 0 0 4px 0;
}
.settings-card__subtitle {
  font-size: var(--text-sm);
  color: var(--color-surface-500);
  margin: 0;
}

/* ── Mode selector (linking_mode 3-button radio) ─────────────────────── */
.mode-selector {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.mode-option {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--color-surface-50);
  border: 2px solid var(--color-surface-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 150ms var(--ease), border-color 150ms var(--ease), box-shadow 150ms var(--ease);
  width: 100%;
  text-align: start;
  font-family: inherit;
}
.mode-option:hover {
  background: var(--color-surface-0);
  border-color: var(--color-brand-500);
}
.mode-option:disabled { cursor: wait; opacity: 0.7; }
.mode-option.is-selected {
  background: var(--color-brand-50);
  border-color: var(--color-brand-500);
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.15);
}
.mode-option__icon {
  font-size: 32px !important;
  color: var(--color-surface-500);
  flex-shrink: 0;
}
.mode-option.is-selected .mode-option__icon { color: var(--color-brand-500); }
.mode-option__text { flex: 1; min-width: 0; }
.mode-option__title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-surface-900);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.mode-option__desc {
  font-size: var(--text-sm);
  color: var(--color-surface-500);
  margin-top: 4px;
}
.mode-option__badge {
  font-size: var(--text-xs);
  background: linear-gradient(135deg, var(--color-warning-500), var(--color-warning-900));
  color: var(--color-surface-0);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-weight: 600;
}
.mode-option__check {
  font-size: 24px !important;
  color: var(--color-surface-200);
  opacity: 0;
  transition: opacity 150ms var(--ease), color 150ms var(--ease);
  flex-shrink: 0;
}
.mode-option.is-selected .mode-option__check {
  color: var(--color-brand-500);
  opacity: 1;
}

/* ── Inline save status row beneath the selector ─────────────────────── */
.mode-status {
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-50);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-surface-900);
  display: none;
  align-items: center;
  gap: var(--space-2);
}
.mode-status.is-visible { display: flex; }
.mode-status .material-symbols-rounded { font-size: 16px; }
.mode-status.is-saving { color: var(--color-brand-700); }
.mode-status.is-saved  { color: var(--color-success-500); }
.mode-status.is-error  { color: var(--color-error-500); }

/* ── Connected store block ───────────────────────────────────────────── */
.store-info-block {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--color-surface-50);
  border-radius: var(--radius-md);
}
.store-info-block__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.store-info-block__details { flex: 1; min-width: 0; }
.store-info-block__name {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-surface-900);
}
.store-info-block__domain {
  font-size: var(--text-sm);
  color: var(--color-surface-500);
  margin-top: 2px;
  word-break: break-all;
}
.store-info-block__status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--color-success-50);
  color: var(--color-success-900);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  margin-top: var(--space-2);
}
.store-info-block__status .material-symbols-rounded { font-size: 14px; }
.store-info-empty {
  text-align: center;
  padding: var(--space-6) var(--space-4);
  color: var(--color-surface-500);
  font-size: var(--text-sm);
}
.store-info-empty a { color: var(--color-brand-500); font-weight: 600; }

/* ── Account info grid ───────────────────────────────────────────────── */
.account-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
@media (max-width: 768px) {
  .account-info-grid { grid-template-columns: 1fr; }
}
.account-field {
  padding: var(--space-3);
  background: var(--color-surface-50);
  border-radius: var(--radius-md);
}
.account-field__label {
  font-size: var(--text-xs);
  color: var(--color-surface-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.account-field__value {
  font-size: var(--text-base);
  color: var(--color-surface-900);
  font-weight: 600;
  word-break: break-all;
}

/* ════════════════════════════════════════════════════════════════════════
   LINKS PAGE — migrated from /public/auto-apply.html
   ────────────────────────────────────────────────────────────────────────
   Chunk 2A (2026-05-05): CSS-only port. The standalone /auto-apply.html
   still serves itself and loads its own <style> block + Tailwind CDN, so
   adding rules here is safe — auto-apply.html does NOT load this file.
   All rules below are scoped under `#page-links` so they don't bleed into
   /app/home, /app/settings, etc. Generic class names like `.card`, `.btn`,
   `.modal` are namespaced via that selector.

   The Tailwind utility shim at the bottom (.flex, .text-sm, .mb-4, etc.)
   reproduces the subset of utilities auto-apply.html actually uses inline,
   so Chunk 2B can drop the Tailwind CDN dependency from /app/links without
   re-rewriting the markup. Each utility maps to design tokens where one
   exists; otherwise it uses the same numeric value Tailwind v3 would
   produce so the visual result is byte-identical.

   Tokens substituted (none exist):
     • text-xl=20px (Tailwind) ≠ var(--text-xl)=24px → 20px hardcoded
   ════════════════════════════════════════════════════════════════════════ */

/* The original auto-apply page used <main style="max-width:720px;margin:0 auto">
   to keep the content column readable. Replicating that constraint here
   centers the section inside .app-content. We deliberately do NOT set
   `display` so the [hidden] attribute on the section still hides it. */
#page-links {
  max-width: 720px;
  margin: 0 auto;
}

/* ── Page card surface ───────────────────────────────────────────────── */
#page-links .card {
  background: var(--color-surface-0);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--space-6);
}

/* ── Store-state card (4 visual variants — connected/warning/neutral) ── */
#page-links .store-card {
  background: var(--color-surface-0);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--space-4) var(--space-6);
  border-right: 4px solid var(--color-surface-200);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}
#page-links .store-card.is-connected {
  background: var(--color-success-50);
  border-right-color: var(--color-success-500);
}
#page-links .store-card.is-warning {
  background: var(--color-warning-50);
  border-right-color: var(--color-warning-500);
}
#page-links .store-card.is-neutral {
  background: var(--color-surface-50);
  border-right-color: var(--color-surface-200);
}
#page-links .store-card .store-card-body { flex: 1; min-width: 240px; }
#page-links .store-card .store-card-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-surface-900);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 4px 0;
}
#page-links .store-card .store-card-meta {
  font-size: var(--text-sm);
  color: var(--color-surface-500);
}
#page-links .store-card .store-card-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
#page-links .store-card select {
  padding: 6px 10px;
  border: 1px solid var(--color-surface-200);
  border-radius: var(--radius-md);
  background: var(--color-surface-0);
  font-family: inherit;
  font-size: var(--text-sm);
  color: var(--color-surface-900);
  min-width: 220px;
}

/* ── Pills (status chips) ────────────────────────────────────────────── */
#page-links .pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 500;
}
#page-links .pill-on   { background: var(--color-success-50); color: var(--color-success-900); }
#page-links .pill-off  { background: var(--color-surface-200); color: var(--color-surface-500); }
#page-links .pill-warn { background: var(--color-warning-50); color: var(--color-warning-900); }
#page-links .pill-err  { background: var(--color-error-50);   color: var(--color-error-900); }

/* ── Big toggle switch (CSS-only, RTL-aware knob) ────────────────────── */
#page-links .switch {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 32px;
  cursor: pointer;
}
#page-links .switch input { display: none; }
#page-links .switch .track {
  position: absolute;
  inset: 0;
  background: var(--color-surface-200);
  border-radius: var(--radius-full);
  transition: background 200ms var(--ease);
}
#page-links .switch .knob {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  background: var(--color-surface-0);
  border-radius: 50%;
  box-shadow: var(--shadow-1);
  transition: transform 200ms var(--ease);
}
#page-links .switch input:checked + .track         { background: var(--color-success-500); }
#page-links .switch input:checked + .track + .knob { transform: translateX(-24px); }

/* ── Range slider ─────────────────────────────────────────────────────── */
#page-links input[type="range"] {
  width: 100%;
  height: 6px;
  background: var(--color-surface-200);
  border-radius: var(--radius-full);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
#page-links input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--color-brand-500);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--color-surface-0);
  box-shadow: var(--shadow-1);
}

/* ── Modal (3 instances: confirm, disconnect, realrun) ───────────────── */
#page-links .modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--backdrop-overlay);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
#page-links .modal-backdrop.open { display: flex; }
#page-links .modal {
  background: var(--color-surface-0);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  max-width: 520px;
  margin: var(--space-4);
  box-shadow: var(--shadow-3);
}

/* ── Toast (status message floater) ──────────────────────────────────── */
#page-links .toast {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-surface-900);
  color: var(--color-surface-0);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-2);
  z-index: 200;
  font-size: var(--text-sm);
  opacity: 0;
  transition: opacity 200ms var(--ease);
  pointer-events: none;
}
#page-links .toast.show  { opacity: 1; }
#page-links .toast.error { background: var(--color-error-500); }

/* ── Run-Now panel (admin-only diagnostic) ───────────────────────────── */
#page-links .admin-card {
  border: 2px dashed var(--color-warning-500);
  background: var(--color-warning-50);
}

/* ── History table (rollback log) ────────────────────────────────────── */
#page-links table.history {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
#page-links table.history th,
#page-links table.history td {
  padding: var(--space-3);
  text-align: right;
  border-bottom: 1px solid var(--color-surface-100);
  vertical-align: top;
}
#page-links table.history th {
  font-weight: 700;
  color: var(--color-surface-500);
  background: var(--color-surface-50);
  position: sticky;
  top: 0;
}
#page-links table.history tr.reverted td {
  opacity: var(--opacity-muted);
  text-decoration: line-through;
}

/* ── Buttons (5 variants + sm modifier) ──────────────────────────────── */
#page-links .btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  border: none;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--shadow-1);
  transition:
    box-shadow 150ms var(--ease),
    transform 150ms var(--ease),
    background 150ms var(--ease),
    color 150ms var(--ease);
}
#page-links .btn:hover:not(:disabled) {
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}
#page-links .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
#page-links .btn-primary {
  background: linear-gradient(135deg, var(--color-brand-500), var(--color-brand-700));
  color: var(--color-surface-0);
}
#page-links .btn-danger {
  background: linear-gradient(135deg, var(--color-error-500), var(--color-error-900));
  color: var(--color-surface-0);
}
#page-links .btn-secondary {
  background: var(--color-surface-100);
  color: var(--color-surface-900);
  box-shadow: none;
}
#page-links .btn-secondary:hover:not(:disabled) {
  background: var(--color-surface-200);
  transform: none;
  box-shadow: none;
}
#page-links .btn-warning {
  background: var(--color-warning-50);
  color: var(--color-warning-900);
  border: 2px dashed var(--color-warning-500);
  padding: 10px 22px;
  box-shadow: none;
}
#page-links .btn-warning:hover:not(:disabled) {
  background: var(--color-warning-50);
  box-shadow: var(--shadow-1);
  transform: none;
}
#page-links .btn-ghost {
  background: transparent;
  color: var(--color-surface-500);
  border: none;
  box-shadow: none;
  font-weight: 500;
}
#page-links .btn-ghost:hover:not(:disabled) {
  background: var(--color-surface-100);
  color: var(--color-surface-900);
  transform: none;
  box-shadow: none;
}
#page-links .btn-ghost-danger {
  background: transparent;
  color: var(--color-error-500);
  border: 1px solid var(--color-error-500);
  padding: 6px 14px;
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius-full);
  box-shadow: none;
}
#page-links .btn-ghost-danger:hover:not(:disabled) {
  background: var(--color-error-50);
  transform: none;
  box-shadow: none;
}
#page-links .btn-sm {
  padding: 6px 14px;
  font-size: var(--text-sm);
}

/* ── Token-driven color helpers ──────────────────────────────────────── */
#page-links .t-muted     { color: var(--color-surface-500); }
#page-links .t-strong    { color: var(--color-surface-900); }
#page-links .t-brand     { color: var(--color-brand-500); }
#page-links .border-soft { border-color: var(--color-surface-200); }
#page-links .bg-error-soft {
  background: var(--color-error-50);
  color: var(--color-error-900);
}

/* ── Spinner (inline loading indicator) ──────────────────────────────── */
#page-links .spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ════════════════════════════════════════════════════════════════════════
   Tailwind-utility shim — minimum subset auto-apply.html uses inline.
   Lets Chunk 2B paste markup as-is and drop the Tailwind CDN. Each rule
   is scoped under #page-links so it does not bleed into other /app pages.
   Values match Tailwind v3 defaults exactly so the visual is unchanged.
   ════════════════════════════════════════════════════════════════════════ */

/* Display */
#page-links .hidden          { display: none !important; }
#page-links .flex            { display: flex; }
#page-links .flex-col        { flex-direction: column; }
#page-links .flex-wrap       { flex-wrap: wrap; }
#page-links .items-center    { align-items: center; }
#page-links .items-end       { align-items: flex-end; }
#page-links .items-start     { align-items: flex-start; }
#page-links .justify-between { justify-content: space-between; }
#page-links .justify-end     { justify-content: flex-end; }
#page-links .shrink-0        { flex-shrink: 0; }

/* Spacing */
#page-links .gap-2 { gap: var(--space-2); }   /* 8px */
#page-links .gap-3 { gap: var(--space-3); }   /* 12px */
#page-links .gap-4 { gap: var(--space-4); }   /* 16px */
#page-links .space-y-6 > * + * { margin-top: var(--space-6); }   /* 24px */

#page-links .mb-1 { margin-bottom: 4px; }
#page-links .mb-2 { margin-bottom: var(--space-2); }
#page-links .mb-3 { margin-bottom: var(--space-3); }
#page-links .mb-4 { margin-bottom: var(--space-4); }
#page-links .mb-6 { margin-bottom: var(--space-6); }
#page-links .mt-1 { margin-top: 4px; }
#page-links .mt-2 { margin-top: var(--space-2); }
#page-links .mt-4 { margin-top: var(--space-4); }
#page-links .mt-6 { margin-top: var(--space-6); }
#page-links .ml-2 { margin-inline-start: var(--space-2); } /* RTL-aware */
#page-links .p-4  { padding: var(--space-4); }
#page-links .py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }

/* Typography */
#page-links .text-center     { text-align: center; }
#page-links .font-bold       { font-weight: 700; }
#page-links .leading-relaxed { line-height: 1.625; }
#page-links .text-xs { font-size: var(--text-xs); }
#page-links .text-sm { font-size: var(--text-sm); }
#page-links .text-lg { font-size: var(--text-lg); }
#page-links .text-xl { font-size: 20px; } /* Tailwind text-xl = 20px, ≠ token --text-xl=24px */

/* Misc */
#page-links .overflow-x-auto { overflow-x: auto; }
#page-links .rounded-lg      { border-radius: var(--radius-lg); }

/* ── Pending suggestions list (manual review queue) ──────────────────── */
#page-links .suggestions-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
#page-links .suggestion-item {
  background: var(--color-surface-50);
  border: 1px solid var(--color-surface-200);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  transition: border-color 150ms var(--ease);
}
#page-links .suggestion-item:hover {
  border-color: var(--color-brand-500);
}
#page-links .suggestion-item__similarity {
  display: inline-block;
  background: var(--color-brand-50);
  color: var(--color-brand-700);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  margin-bottom: var(--space-2);
}
#page-links .suggestion-item__products {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
}
#page-links .suggestion-item__source,
#page-links .suggestion-item__target {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  background: var(--color-surface-0);
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--color-surface-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#page-links .suggestion-item__arrow {
  color: var(--color-brand-500);
  flex-shrink: 0;
}
#page-links .suggestion-item__sentence {
  font-size: var(--text-sm);
  color: var(--color-surface-900);
  background: var(--color-surface-0);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  border-inline-start: 3px solid var(--color-brand-500);
  margin-bottom: var(--space-3);
  line-height: 1.5;
}
#page-links .suggestion-item__actions {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
}
#page-links .suggestion-item.is-busy {
  opacity: 0.6;
  pointer-events: none;
}

/* ── Type badge (top-end of every suggestion-item card) ──────────────── */
#page-links .suggestion-item__type-badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-surface-500);
  background: var(--color-surface-0);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-2);
}

/* ── Meta title/description variant (before/after diff layout) ───────── */
#page-links .suggestion-item--meta .suggestion-item__diff {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
#page-links .suggestion-item__diff-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: var(--space-3);
  align-items: baseline;
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-0);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}
#page-links .suggestion-item__diff-label {
  font-weight: 700;
  color: var(--color-surface-500);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
#page-links .suggestion-item__diff-value {
  color: var(--color-surface-900);
  word-break: break-word;
}
#page-links .suggestion-item__diff-value--before {
  color: var(--color-surface-500);
  text-decoration: line-through;
  text-decoration-color: var(--color-surface-200);
}
#page-links .suggestion-item__diff-value--after {
  font-weight: 600;
  border-inline-start: 3px solid var(--color-success-500);
  padding-inline-start: var(--space-2);
}
#page-links .suggestion-item__diff-meta {
  font-size: var(--text-xs);
  color: var(--color-surface-500);
  white-space: nowrap;
}
@media (max-width: 640px) {
  #page-links .suggestion-item__diff-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* ── Vendor block banner (2all HTML-preservation issue) ──────────────── */
#page-links .vendor-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  background: var(--color-warning-50);
  color: var(--color-warning-900);
  border: 1px solid var(--color-warning-500);
  border-inline-start: 4px solid var(--color-warning-500);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  line-height: 1.5;
}
#page-links .vendor-banner[hidden] { display: none !important; }
#page-links .vendor-banner .material-symbols-rounded {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ─────────────────────────────────────────────────────────────────────
   Tier 2 — Onboarding panel (/app/home).
   Shown while connected_stores.metadata.onboarding_phase is in-flight.
   ─#page-home.is-onboarding hides the stats row + activity grid so the
   panel is the only visible content.
   ───────────────────────────────────────────────────────────────────── */

#page-home .onboarding-panel[hidden] { display: none; }

#page-home.is-onboarding .home-welcome,
#page-home.is-onboarding .home-stats,
#page-home.is-onboarding .home-grid {
  display: none;
}

.onboarding-panel {
  background: var(--color-bg-elevated, #ffffff);
  border: 1px solid var(--color-border, rgba(255,255,255,0.08));
  border-radius: var(--radius-lg, 16px);
  padding: var(--space-8, 40px) var(--space-6, 28px);
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.onboarding-panel__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto var(--space-4, 18px);
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  animation: onboarding-pulse 2.4s ease-in-out infinite;
}
.onboarding-panel__icon .material-symbols-rounded {
  font-size: 36px;
}
@keyframes onboarding-pulse {
  0%, 100% { transform: translateY(0); box-shadow: 0 8px 24px rgba(99,102,241,0.25); }
  50%      { transform: translateY(-4px); box-shadow: 0 12px 36px rgba(99,102,241,0.35); }
}

.onboarding-panel__title {
  font-size: var(--text-2xl, 24px);
  font-weight: 700;
  margin: 0 0 var(--space-2, 8px);
  line-height: 1.3;
}
.onboarding-panel__subtitle {
  font-size: var(--text-base, 15px);
  color: var(--color-text-muted, rgba(0,0,0,0.55));
  margin: 0 0 var(--space-6, 28px);
}

.onboarding-progress {
  width: 100%;
  height: 8px;
  background: var(--color-bg-subtle, rgba(0,0,0,0.06));
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: var(--space-3, 12px);
}
.onboarding-progress__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #6366f1);
  border-radius: 999px;
  transition: width 600ms ease-out;
}

.onboarding-panel__current-phase {
  font-size: var(--text-sm, 14px);
  font-weight: 600;
  color: var(--color-text, rgba(0,0,0,0.85));
  margin: 0 0 var(--space-6, 28px);
  min-height: 1.4em;
}

.onboarding-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-4, 18px);
  display: flex;
  flex-direction: column;
  gap: var(--space-2, 8px);
  text-align: start;
  max-width: 360px;
  margin-inline: auto;
}
.onboarding-step {
  display: flex;
  align-items: center;
  gap: var(--space-3, 12px);
  font-size: var(--text-sm, 14px);
  color: var(--color-text-muted, rgba(0,0,0,0.55));
  transition: color 200ms ease;
}
.onboarding-step__dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid var(--color-border, rgba(0,0,0,0.18));
  flex-shrink: 0;
  position: relative;
  transition: all 200ms ease;
}
.onboarding-step.is-active .onboarding-step__dot {
  border-color: #6366f1;
  background: rgba(99,102,241,0.12);
  animation: onboarding-step-pulse 1.4s ease-in-out infinite;
}
.onboarding-step.is-done .onboarding-step__dot {
  background: #10b981;
  border-color: #10b981;
}
.onboarding-step.is-done .onboarding-step__dot::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3,8 7,12 13,4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
.onboarding-step.is-active,
.onboarding-step.is-done {
  color: var(--color-text, rgba(0,0,0,0.85));
  font-weight: 500;
}
@keyframes onboarding-step-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.35); }
  70%      { box-shadow: 0 0 0 8px rgba(99,102,241,0); }
}

.onboarding-panel--success .onboarding-panel__icon {
  background: linear-gradient(135deg, #10b981, #059669);
  animation: none;
}
.onboarding-panel--failed .onboarding-panel__icon {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  animation: none;
}
.onboarding-panel--failed .onboarding-progress__bar {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

.onboarding-panel__actions {
  display: flex;
  gap: var(--space-3, 12px);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--space-4, 18px);
}
.onboarding-panel__actions[hidden] { display: none; }

@media (max-width: 640px) {
  .onboarding-panel {
    padding: var(--space-6, 28px) var(--space-4, 16px);
  }
  .onboarding-panel__title { font-size: var(--text-xl, 20px); }
  .onboarding-panel__icon  { width: 60px; height: 60px; }
  .onboarding-panel__icon .material-symbols-rounded { font-size: 30px; }
  .onboarding-steps { max-width: 100%; }
}

/* ─────────────────────────────────────────────────────────────────────
   Part A — Sidebar pending-mutations red dot.
   Shows on the "אישורים" (formerly "קישורים פנימיים") sidebar item
   whenever /api/app/pending-suggestions reports >0 pending rows for
   the current store.
   ───────────────────────────────────────────────────────────────────── */
.sidebar-item { position: relative; }
.sidebar-badge {
  position: absolute;
  inset-inline-end: 12px;
  inset-block-start: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  background: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--color-bg-elevated, #fff);
  pointer-events: none;
}
.sidebar-badge[hidden] { display: none; }

/* ─────────────────────────────────────────────────────────────────────
   Tier 3 — AI Visibility tile trend arrow.
   ───────────────────────────────────────────────────────────────────── */
.stat-card__value-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-2, 8px);
}
.stat-card__trend {
  font-size: var(--text-sm, 14px);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.stat-card__trend[hidden] { display: none; }
.stat-card__trend--up   { color: #10b981; }
.stat-card__trend--down { color: #ef4444; }
.stat-card__trend--flat { color: var(--color-text-muted, rgba(0,0,0,0.55)); }

/* ─────────────────────────────────────────────────────────────────────
   Account deletion — danger zone card + 4-step wizard modal.
   ───────────────────────────────────────────────────────────────────── */

.settings-card--danger {
  border: 1px solid var(--color-error-500);
  border-inline-start: 4px solid var(--color-error-500);
  background: linear-gradient(180deg, var(--color-error-50, #fce8e6) 0%, var(--color-surface-0) 60%);
}
.settings-card--danger .settings-card__header h3 {
  color: var(--color-error-900);
}

.btn--danger {
  background: var(--color-error-500);
  background-image: linear-gradient(135deg, var(--color-error-500), var(--color-error-900));
  color: #fff;
  border: 0;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: var(--text-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  transition: filter 200ms var(--ease);
}
.btn--danger:hover { filter: brightness(0.92); }
.btn--danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: none;
}

/* Modal — wider variant for the multi-step wizard. The base
   .modal-backdrop / .modal styles are defined elsewhere; we add
   step-management + delete-specific bits here. */
.modal--wide { max-width: 520px; width: 100%; }

.modal__title {
  font-size: var(--text-xl);
  font-weight: 800;
  margin: 0 0 var(--space-3);
  color: var(--color-surface-900);
}
.modal__body {
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--color-surface-500);
  margin: 0 0 var(--space-4);
}
.modal__actions {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  margin-top: var(--space-4);
}
.modal-step[hidden] { display: none; }

.delete-modal-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-4);
  font-size: var(--text-sm);
  line-height: 2;
  color: var(--color-error-900);
}
.delete-modal-applied-banner {
  background: var(--color-warning-50);
  border: 1px solid var(--color-warning-500);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-warning-900);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.delete-modal-applied-banner strong {
  font-size: var(--text-lg);
  font-weight: 800;
}

.delete-modal-radios {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.delete-radio {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-surface-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 150ms var(--ease), border-color 150ms var(--ease);
}
.delete-radio:hover { background: var(--color-surface-50); }
.delete-radio:has(input:checked) {
  border-color: var(--color-brand-500);
  background: var(--color-brand-50);
}
.delete-radio input[type="radio"] {
  margin-top: 4px;
  flex-shrink: 0;
}
.delete-radio__content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--text-sm);
  color: var(--color-surface-900);
}
.delete-radio__content .t-muted {
  font-size: var(--text-xs);
  color: var(--color-surface-500);
}

.delete-modal-store-name {
  background: var(--color-surface-50);
  border: 1px solid var(--color-surface-200);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-family: 'Menlo','Consolas',monospace;
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--color-surface-900);
  margin: 0 0 var(--space-3);
  text-align: start;
  direction: ltr;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  font-size: var(--text-base);
  border: 1px solid var(--color-surface-200);
  border-radius: var(--radius-md);
  background: var(--color-surface-0);
  color: var(--color-surface-900);
  font-family: inherit;
  box-sizing: border-box;
}
.form-input:focus {
  outline: none;
  border-color: var(--color-brand-500);
  box-shadow: 0 0 0 3px var(--color-brand-50);
}

.delete-spinner {
  display: flex;
  justify-content: center;
  margin: var(--space-6) 0 var(--space-4);
}
.delete-spinner__ring {
  width: 56px;
  height: 56px;
  border: 4px solid var(--color-surface-200);
  border-top-color: var(--color-error-500);
  border-radius: 50%;
  animation: delete-spin 1s linear infinite;
}
@keyframes delete-spin {
  to { transform: rotate(360deg); }
}
.delete-modal-progress {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-surface-500);
  font-weight: 600;
  margin: 0;
}

/* ── Page Indexing drawer (Mission 2 2026-05-10) ──────────────────────── */
.indexing-drawer[hidden] { display: none; }
.indexing-drawer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.indexing-drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}
.indexing-drawer__panel {
  position: relative;
  background: var(--color-surface-0);
  border-radius: var(--radius-lg);
  width: min(560px, 92vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-3, 0 8px 32px rgba(0,0,0,0.18));
}
.indexing-drawer__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-surface-200);
}
.indexing-drawer__header h2 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-surface-900);
}
.indexing-drawer__close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: var(--color-surface-500);
  padding: 0 4px;
}
.indexing-drawer__close:hover { color: var(--color-surface-900); }
.indexing-drawer__intro {
  margin: 0;
  padding: var(--space-4) var(--space-6) var(--space-2);
  color: var(--color-surface-700);
  font-size: var(--text-sm);
}
.indexing-drawer__list {
  list-style: none;
  margin: 0;
  padding: var(--space-2) var(--space-6) var(--space-6);
  overflow-y: auto;
  flex: 1;
}
.indexing-drawer__item {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-surface-100);
}
.indexing-drawer__item:last-child { border-bottom: none; }
.indexing-drawer__handle {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: var(--text-sm);
  color: var(--color-surface-900);
  margin-bottom: 4px;
  word-break: break-all;
}
.indexing-drawer__actions {
  display: flex;
  gap: var(--space-3);
}
.indexing-drawer__actions a {
  font-size: 12px;
  color: var(--color-brand-500);
  text-decoration: none;
}
.indexing-drawer__actions a:hover { text-decoration: underline; }
.indexing-drawer__empty {
  padding: var(--space-6);
  text-align: center;
  color: var(--color-surface-500);
}
