﻿@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  color-scheme: light;

  /* 8px spacing scale */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-7: 56px;
  --space-8: 64px;

  /* Layout rhythm â€” premium SaaS section spacing */
  --layout-section-gap: clamp(2.75rem, 3.5vw, 4.25rem);
  --layout-stack-gap: var(--space-4);
  --layout-head-gap: var(--space-4);
  --layout-page-gap: var(--space-5);
  --layout-card-pad: var(--space-4);
  --layout-field-gap: var(--space-3);

  /* Surfaces */
  --bg: #fafafb;
  --panel: #ffffff;
  --card: #ffffff;
  --surface: #f4f4f5;
  --surface-elevated: #ffffff;

  /* Text */
  --text: #09090b;
  --text-secondary: #52525b;
  --muted: #71717a;

  /* Borders */
  --line: #ececef;
  --line-strong: #e4e4e7;

  /* Primary accent */
  --accent: #635bff;
  --accent-hover: #5249e5;
  --accent-subtle: rgba(99, 91, 255, 0.08);
  --accent-muted: rgba(99, 91, 255, 0.14);
  --primary: var(--accent);

  /* Semantic */
  --success: #16a34a;
  --success-subtle: #ecfdf5;
  --warning: #d97706;
  --warning-subtle: #fffbeb;
  --danger: #ef4444;
  --danger-subtle: #fef2f2;
  --code-surface: #18181b;

  /* Radius */
  --radius: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(9, 9, 11, 0.04);
  --shadow-sm: 0 1px 2px rgba(9, 9, 11, 0.04), 0 4px 12px rgba(9, 9, 11, 0.04);
  --shadow-md: 0 2px 4px rgba(9, 9, 11, 0.04), 0 8px 24px rgba(9, 9, 11, 0.06);
  --shadow-lg: 0 4px 8px rgba(9, 9, 11, 0.04), 0 16px 40px rgba(9, 9, 11, 0.08);
  --shadow: var(--shadow-sm);

  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --motion-fast: 0.12s cubic-bezier(0.4, 0, 0.2, 1);
  --motion-base: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --motion-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --motion-spring: 0.45s cubic-bezier(0.34, 1.2, 0.64, 1);
  --motion-lift: translateY(-2px);
  --motion-press: translateY(1px);
  --focus-ring: 0 0 0 3px var(--accent-subtle);
  --focus-ring-strong: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);
  --shell-pad: clamp(var(--space-2), 2.5vw, var(--space-4));
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Buttons */
  --btn-height: 2.5rem;
  --btn-height-sm: 2rem;
  --btn-height-lg: 2.875rem;
  --btn-padding-x: 1rem;
  --btn-padding-x-sm: 0.75rem;
  --btn-padding-x-lg: 1.25rem;
  --btn-radius: 10px;
  --btn-font-size: 0.8125rem;
  --btn-font-size-sm: 0.75rem;
  --btn-font-size-lg: 0.875rem;
  --btn-font-weight: 600;
  --btn-gap: 0.4rem;
  --btn-shadow-primary: 0 1px 2px rgba(9, 9, 11, 0.08), 0 0 0 1px rgba(99, 91, 255, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  --btn-shadow-secondary: 0 1px 2px rgba(9, 9, 11, 0.05);
  --btn-focus-ring: 0 0 0 3px var(--accent-subtle);

  /* Typography scale (setup & settings) */
  --type-display: clamp(1.35rem, 2.5vw, 1.75rem);
  --type-section: 1.125rem;
  --type-body: 0.875rem;
  --type-body-sm: 0.8125rem;
  --type-caption: 0.75rem;
  --type-overline: 0.6875rem;
  --lh-tight: 1.25;
  --lh-snug: 1.4;
  --lh-normal: 1.5;
  --lh-relaxed: 1.6;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  /* Premium inputs */
  --input-bg: #ffffff;
  --input-border: #e4e4e7;
  --input-border-hover: #d4d4d8;
  --input-radius: 10px;
  --input-pad-y: 0.6875rem;
  --input-pad-x: 0.875rem;
  --input-shadow: 0 1px 2px rgba(9, 9, 11, 0.04);
  --input-transition: border-color 0.18s ease, box-shadow 0.2s ease, background-color 0.18s ease;
  --input-focus-border: rgba(99, 91, 255, 0.55);
  --input-focus-ring: 0 0 0 3px rgba(99, 91, 255, 0.14);
  --input-valid-border: #86efac;
  --input-valid-ring: 0 0 0 3px rgba(22, 163, 74, 0.12);
  --input-invalid-border: #fca5a5;
  --input-invalid-ring: 0 0 0 3px rgba(239, 68, 68, 0.12);
  --input-placeholder: #a1a1aa;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

.shell-body {
  --setup-sticky-top: 56px;
  background: var(--bg);
}

.shell {
  min-height: 100vh;
  width: 100%;
}

.shell-topbar {
  align-items: center;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  display: flex;
  gap: var(--space-2);
  justify-content: space-between;
  padding: var(--space-2) var(--shell-pad);
  position: sticky;
  top: 0;
  z-index: 40;
}

.shell-brand {
  align-items: center;
  display: inline-flex;
  flex-shrink: 0;
  text-decoration: none;
}

.shell-brand img {
  display: block;
  height: 28px;
  max-width: min(200px, 50vw);
  object-fit: contain;
}

.shell-controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  justify-content: flex-end;
}

.shell-ctl {
  align-items: center;
  display: inline-flex;
  gap: 0.45rem;
  margin: 0;
}

.shell-ctl-label {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.shell-select {
  appearance: none;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 0.45rem center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  min-width: 7.5rem;
  padding: 0.45rem 1.6rem 0.45rem 0.65rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.shell-select:focus {
  border-color: var(--accent-muted);
  box-shadow: 0 0 0 3px var(--accent-subtle);
  outline: none;
}

.shell-icon-btn {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
  color: var(--text-secondary);
  display: inline-flex;
  height: 36px;
  justify-content: center;
  text-decoration: none;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition), color var(--transition);
  width: 36px;
}

.shell-icon-btn:hover {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--text);
}

.shell-avatar {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 700;
  height: 34px;
  justify-content: center;
  letter-spacing: 0.02em;
  width: 34px;
}

.shell-context {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0  var(--shell-pad) 0.85rem;
  text-transform: uppercase;
}

.shell-nav {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0 var(--shell-pad);
}

.shell-nav-link {
  align-items: center;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.8125rem;
  font-weight: 500;
  gap: 0.35rem;
  margin-bottom: -1px;
  padding: 0.75rem var(--space-2);
  text-decoration: none;
  transition: color var(--transition), border-color var(--transition);
}

.shell-nav-link:hover {
  color: var(--text);
}

.shell-nav-link.is-active {
  border-bottom-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.shell-content {
  padding: var(--space-4) var(--shell-pad) var(--space-8);
  width: 100%;
}

.shell-content-auth {
  margin: 0 auto;
  max-width: 440px;
  padding-top: 1rem;
}

.ico {
  flex-shrink: 0;
}

header {
  display: none;
}

main {
  margin: 0;
  max-width: none;
  padding: 0;
}

h1,
h2,
h3 {
  margin-top: 0;
}

h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.035em;
}

h2 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 0.65rem;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

input,
select,
textarea {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--input-radius);
  box-shadow: var(--input-shadow);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.45;
  padding: var(--input-pad-y) var(--input-pad-x);
  transition: var(--input-transition);
  width: 100%;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]):hover,
select:hover,
textarea:hover {
  border-color: var(--input-border-hover);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]):focus,
select:focus,
textarea:focus {
  background: var(--input-bg);
  border-color: var(--input-focus-border);
  box-shadow: var(--input-focus-ring);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--input-placeholder);
  opacity: 1;
}

input::placeholder {
  font-weight: var(--fw-regular);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  cursor: pointer;
  padding-right: 2.25rem;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input[type="color"] {
  border-radius: var(--radius-sm);
  cursor: pointer;
  height: 2.75rem;
  padding: 0.25rem;
}

/* â”€â”€â”€ Button system â”€â”€â”€ */

button {
  font: inherit;
}

button,
.button,
a.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--btn-radius);
  cursor: pointer;
  display: inline-flex;
  font-family: inherit;
  font-size: var(--btn-font-size);
  font-weight: var(--btn-font-weight);
  gap: var(--btn-gap);
  justify-content: center;
  letter-spacing: -0.01em;
  line-height: 1.2;
  min-height: var(--btn-height);
  padding: 0 var(--btn-padding-x);
  text-decoration: none;
  transition:
    background var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    color var(--transition),
    transform 0.12s ease;
  white-space: nowrap;
}

button .ico,
.button .ico,
a.button .ico {
  flex-shrink: 0;
  opacity: 0.92;
}

button:focus-visible,
.button:focus-visible,
a.button:focus-visible {
  outline: none;
  box-shadow: var(--btn-focus-ring);
}

button:disabled,
.button:disabled,
a.button[aria-disabled="true"],
button:disabled:hover,
.button:disabled:hover {
  cursor: not-allowed;
  opacity: 0.48;
  pointer-events: none;
  transform: none;
}

/* Primary (default) */
button:not(.secondary):not(.ghost):not(.danger):not(.action-btn):not(.code-snippet-action):not(.code-snippet-toggle):not(.settings-section-card-toggle):not(.settings-advanced-section-toggle):not(.app-setup-mode-tab):not(.settings-dashboard-nav-item):not(.bogo-result):not(.bogo-chip-remove):not(.bogo-card-remove):not(.pg-picker-option):not(.pg-picker-card-remove),
.button:not(.secondary):not(.ghost):not(.danger),
a.button:not(.secondary):not(.ghost):not(.danger) {
  background: linear-gradient(180deg, #736cff 0%, var(--accent) 52%, #5a52eb 100%);
  border-color: #5249e5;
  box-shadow: var(--btn-shadow-primary);
  color: #ffffff;
}

button:not(.secondary):not(.ghost):not(.danger):not(.action-btn):not(.code-snippet-action):not(.code-snippet-toggle):not(.settings-section-card-toggle):not(.settings-advanced-section-toggle):not(.app-setup-mode-tab):not(.settings-dashboard-nav-item):not(.bogo-result):not(.bogo-chip-remove):not(.bogo-card-remove):not(.pg-picker-option):not(.pg-picker-card-remove):hover,
.button:not(.secondary):not(.ghost):not(.danger):hover,
a.button:not(.secondary):not(.ghost):not(.danger):hover {
  background: linear-gradient(180deg, #7d76ff 0%, var(--accent-hover) 52%, #635bff 100%);
  border-color: #4f46e5;
  box-shadow: 0 2px 8px rgba(99, 91, 255, 0.28), 0 0 0 1px rgba(99, 91, 255, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

button:not(.secondary):not(.ghost):not(.danger):not(.action-btn):active,
.button:not(.secondary):not(.ghost):not(.danger):active,
a.button:not(.secondary):not(.ghost):not(.danger):active {
  transform: translateY(1px);
}

/* Secondary */
button.secondary,
.button.secondary,
a.button.secondary {
  background: var(--panel);
  border-color: var(--line-strong);
  box-shadow: var(--btn-shadow-secondary);
  color: var(--text);
}

button.secondary:hover,
.button.secondary:hover,
a.button.secondary:hover {
  background: var(--surface);
  border-color: color-mix(in srgb, var(--line-strong) 70%, var(--accent) 30%);
  box-shadow: 0 2px 6px rgba(9, 9, 11, 0.06);
  color: var(--text);
}

button.secondary:active,
.button.secondary:active,
a.button.secondary:active {
  transform: translateY(1px);
}

/* Ghost */
button.ghost,
.button.ghost,
a.button.ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--text-secondary);
  min-height: calc(var(--btn-height) - 0.125rem);
  padding: 0 calc(var(--btn-padding-x) - 0.15rem);
}

button.ghost:hover,
.button.ghost:hover,
a.button.ghost:hover {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: none;
  color: var(--text);
}

button.ghost:active,
.button.ghost:active,
a.button.ghost:active {
  background: var(--surface-elevated);
  transform: none;
}

/* Danger â€” solid */
button.danger:not(.secondary):not(.ghost),
.button.danger:not(.secondary):not(.ghost),
a.button.danger:not(.secondary):not(.ghost) {
  background: linear-gradient(180deg, #f87171 0%, var(--danger) 55%, #dc2626 100%);
  border-color: #dc2626;
  box-shadow: 0 1px 2px rgba(9, 9, 11, 0.08), 0 0 0 1px rgba(239, 68, 68, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

button.danger:not(.secondary):not(.ghost):hover,
.button.danger:not(.secondary):not(.ghost):hover,
a.button.danger:not(.secondary):not(.ghost):hover {
  background: linear-gradient(180deg, #fb7185 0%, #ef4444 55%, #dc2626 100%);
  border-color: #b91c1c;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.28);
}

/* Danger â€” outline */
button.danger.secondary,
.button.danger.secondary,
a.button.danger.secondary {
  background: var(--panel);
  border-color: color-mix(in srgb, var(--danger) 32%, var(--line));
  box-shadow: var(--btn-shadow-secondary);
  color: #b91c1c;
}

button.danger.secondary:hover,
.button.danger.secondary:hover,
a.button.danger.secondary:hover {
  background: var(--danger-subtle);
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
  color: #991b1b;
}

/* Sizes */
button.sm,
.button.sm,
a.button.sm {
  font-size: var(--btn-font-size-sm);
  gap: 0.3rem;
  min-height: var(--btn-height-sm);
  padding: 0 var(--btn-padding-x-sm);
}

button.lg,
.button.lg,
a.button.lg {
  font-size: var(--btn-font-size-lg);
  min-height: var(--btn-height-lg);
  padding: 0 var(--btn-padding-x-lg);
}

.button-group,
.inline-actions,
.shopify-theme-install-actions,
.shopify-check-actions,
.page-actions,
.data-filters-actions {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.inline-actions form {
  margin: 0;
}

.app-setup-header-actions .button,
.page-actions .button,
.page-actions button:not(.action-btn),
.page-actions a.button {
  min-width: 0;
}

label,
.field {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}

.field-control {
  display: block;
  position: relative;
}

.field-control > input:not([type="checkbox"]):not([type="radio"]),
.field-control > select,
.field-control > textarea {
  width: 100%;
}

.field-control.is-focused > input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
.field-control.is-focused > select,
.field-control.is-focused > textarea {
  border-color: var(--input-focus-border);
  box-shadow: var(--input-focus-ring);
}

.field-control.is-valid > input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
.field-control.is-valid > select,
.field-control.is-valid > textarea {
  border-color: var(--input-valid-border);
  box-shadow: var(--input-valid-ring);
}

.field-control.is-invalid > input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
.field-control.is-invalid > select,
.field-control.is-invalid > textarea {
  border-color: var(--input-invalid-border);
  box-shadow: var(--input-invalid-ring);
}

.field-validation {
  color: var(--danger);
  font-size: var(--type-caption);
  font-weight: var(--fw-medium);
  line-height: var(--lh-relaxed);
  margin: 0.35rem 0 0;
  min-height: 0;
}

.field-validation:empty,
.field-validation[hidden] {
  display: none;
}

.field-validation.is-success {
  color: #047857;
}

.settings-field-cell .field {
  margin-bottom: 0;
}

.settings-field-cell .field-validation {
  margin-top: 0.35rem;
}

.settings-field-cell .sc-field-hint + .field-validation {
  margin-top: 0.25rem;
}

label span,
.field-label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
}

pre {
  background: var(--code-surface);
  border: 1px solid #27272a;
  border-radius: var(--radius-md);
  color: #e4e4e7;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  overflow-x: auto;
  padding: var(--space-2);
}

.actions,
.filters {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1rem 0;
}

.badge,
.store {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  display: inline-block;
  font-size: 0.82rem;
  padding: 0.25rem 0.65rem;
}

.card,
.metric {
  animation: fadeIn 0.2s ease;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-3);
  padding: var(--layout-card-pad);
}

.flash {
  animation: fadeIn 0.2s ease;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  color: var(--text);
  margin-bottom: var(--space-2);
  padding: var(--space-2);
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.metric span {
  color: var(--muted);
  display: block;
  font-size: 0.85rem;
}

.metric strong {
  display: block;
  font-size: 2rem;
  font-weight: 700;
}

.stack {
  display: grid;
  gap: 0.5rem;
}

.two-col {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
}

/* Dashboard */
.dash-section {
  margin-bottom: 1.5rem;
}

.dash-section-title {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.65rem;
  font-weight: 700;
  gap: 0.35rem;
  letter-spacing: 0.08em;
  margin: 0 0 0.85rem;
  text-transform: uppercase;
}

.dash-stats {
  display: grid;
  gap: 1.5rem clamp(1rem, 3vw, 2.5rem);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 2rem;
}

.dash-stat {
  animation: fadeIn 0.2s ease both;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

.dash-stat-label {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.65rem;
  font-weight: 700;
  gap: 0.3rem;
  letter-spacing: 0.08em;
  margin-bottom: 0.45rem;
  text-transform: uppercase;
}

.dash-stat-value {
  align-items: center;
  display: flex;
  font-size: clamp(1.75rem, 3.5vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  min-height: 1.75rem;
}

.dash-stat-neutral .dash-stat-value,
.dash-stat-success .dash-stat-value,
.dash-stat-warning .dash-stat-value,
.dash-stat-accent .dash-stat-value {
  color: var(--text);
}

.dash-actions {
  display: grid;
  gap: var(--space-2);
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.dash-action {
  align-items: center;
  animation: fadeIn 0.2s ease both;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  color: inherit;
  display: flex;
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-2);
  position: relative;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.dash-action:hover {
  background: var(--surface-elevated);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.dash-action-icon {
  align-items: center;
  color: var(--muted);
  display: flex;
}

.dash-action-body {
  display: grid;
  flex: 1;
  gap: 0.15rem;
}

.dash-action-title {
  font-weight: 600;
}

.dash-action-desc {
  color: var(--muted);
  font-size: 0.82rem;
}

.dash-action-arrow {
  color: var(--muted);
  display: flex;
}

.dash-action-primary {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  color: #ffffff;
}

.dash-action-primary .dash-action-desc {
  color: rgba(255, 255, 255, 0.72);
}

.dash-action-primary .dash-action-arrow {
  color: rgba(255, 255, 255, 0.7);
}

.dash-action-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.dash-action-primary:hover .dash-action-arrow {
  color: #ffffff;
}

.dash-actions .dash-action:nth-child(1) { animation-delay: 0.05s; }
.dash-actions .dash-action:nth-child(2) { animation-delay: 0.1s; }
.dash-actions .dash-action:nth-child(3) { animation-delay: 0.15s; }
.dash-actions .dash-action:nth-child(4) { animation-delay: 0.2s; }

.dash-empty {
  animation: fadeIn 0.2s ease;
  max-width: 520px;
  text-align: left;
}

.dash-empty p {
  color: var(--muted);
  margin: 0 0 1rem;
}

/* Stores */
.stores-layout {
  align-items: start;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
}

.stores-sidebar {
  position: sticky;
  top: 88px;
}

.stores-form-card h2 {
  margin-bottom: 0.35rem;
}

.stores-form-intro {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.stores-table-wrap {
  overflow-x: auto;
}

.stores-table tbody tr {
  transition: background var(--transition);
}

.stores-table tbody tr:hover {
  background: #fafafa;
}

.stores-row-current {
  background: var(--surface);
}

.stores-row-current:hover {
  background: #f0f0f0;
}

.stores-domain {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: "Manrope", sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
}

.stores-category-form {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.stores-category-form select {
  min-width: 10rem;
  font-size: 0.85rem;
}

.stores-category-form button {
  font-size: var(--btn-font-size-sm);
  min-height: var(--btn-height-sm);
  padding: 0 0.65rem;
}

.reviews-store-scope-category {
  display: inline-block;
  margin: 0 0.35rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #f0f0f0;
  color: #444;
}

.reviews-store-scope-category.is-kids {
  background: #fde8f0;
  color: #901a2e;
}

.stores-current-pill {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-left: 0.45rem;
  padding: 0.15rem 0.5rem;
  text-transform: uppercase;
  vertical-align: middle;
}

.stores-ai-col {
  min-width: 7.5rem;
  white-space: nowrap;
}

.stores-shopify-link {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.stores-shopify-link-ok {
  background: #dcfce7;
  color: #15803d;
}

.stores-shopify-link-warn {
  background: #fef3c7;
  color: #92400e;
}

.stores-shopify-link-muted {
  background: #f3f4f6;
  color: #6b7280;
}

.shopify-check-card {
  margin-bottom: 1rem;
  width: 100%;
}

.shopify-check-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.shopify-check-head h2 {
  margin: 0 0 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.shopify-check-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.shopify-check-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  margin: 0 0 1rem;
  padding: 0.75rem;
  border-radius: 10px;
  background: #f8f9fb;
  border: 1px solid var(--border, #e8eaee);
}

.shopify-check-meta dt {
  margin: 0 0 0.2rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.shopify-check-meta dd {
  margin: 0;
  font-size: 0.84rem;
  word-break: break-all;
}

.shopify-check-table-wrap {
  overflow-x: auto;
}

.shopify-check-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.shopify-check-table th,
.shopify-check-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border, #e8eaee);
  text-align: left;
  vertical-align: middle;
}

.shopify-check-table th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.shopify-check-foot {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
}

.shopify-theme-install-card {
  background: var(--panel);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.shopify-theme-install-card.is-busy {
  border-color: var(--accent-muted);
  box-shadow: 0 0 0 3px var(--accent-subtle), var(--shadow-sm);
}

.shopify-theme-install-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.shopify-theme-install-status {
  align-items: flex-end;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 0.4rem;
}

.shopify-theme-install-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #f4f4f5;
  color: #52525b;
}

.shopify-theme-install-badge.is-installed {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.shopify-theme-install-badge.is-pending {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}

.shopify-theme-install-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0.35rem 0 0.5rem;
}

.shopify-theme-install-progress {
  margin: 0.65rem 0 0.85rem;
}

.shopify-theme-install-progress-row {
  align-items: center;
  display: flex;
  gap: 0.75rem;
}

.shopify-theme-install-progress-track {
  background: var(--accent-subtle);
  border-radius: 999px;
  flex: 1 1 auto;
  height: 0.55rem;
  overflow: hidden;
}

.shopify-theme-install-progress-bar {
  background: linear-gradient(90deg, var(--accent) 0%, #8b85ff 100%);
  border-radius: 999px;
  height: 100%;
  transition: width 0.18s ease-out;
  width: 0;
}

.shopify-theme-install-progress-label {
  color: var(--accent);
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  min-width: 2.75rem;
  text-align: right;
}

.shopify-theme-install-progress-status {
  font-size: 0.78rem;
  margin: 0.35rem 0 0;
}

.shopify-theme-install-foot {
  margin-bottom: 0;
}

@media (max-width: 720px) {
  .shopify-theme-install-head {
    flex-direction: column;
  }

  .shopify-theme-install-status {
    align-items: flex-start;
  }
}

@media (max-width: 900px) {
  .shopify-check-meta {
    grid-template-columns: 1fr;
  }
}

.stores-ai-cost {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.stores-ai-cost.muted {
  color: var(--muted);
  font-weight: 600;
}

.stores-ai-meta {
  color: var(--muted);
  display: block;
  font-size: 0.72rem;
  margin-top: 0.2rem;
}

.stores-ai-num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.stores-usage-table tfoot th {
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}

.stores-ai-cost-link {
  color: inherit;
  display: block;
  text-decoration: none;
}

.stores-ai-cost-link:hover .stores-ai-cost {
  color: var(--accent);
  text-decoration: underline;
}

.stores-ai-cost-link-muted:hover .stores-ai-cost {
  color: var(--muted);
  text-decoration: none;
}

.ai-cost-summary {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  margin: 1rem 0 1.25rem;
}

.ai-cost-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 0.35rem;
  padding: 0.9rem 1rem;
}

.ai-cost-stat-remaining {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}

.ai-cost-stat-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ai-cost-stat-value {
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}

.ai-cost-stat-settled {
  color: var(--muted);
}

.ai-cost-table td,
.ai-cost-history-table td {
  vertical-align: middle;
}

.ai-cost-action {
  min-width: 14rem;
}

.ai-cost-settle-form {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.ai-cost-settle-amount {
  max-width: 6.5rem;
  min-width: 5rem;
}

.ai-cost-settle-note {
  flex: 1 1 7rem;
  min-width: 6rem;
}

.ai-cost-badge-settled {
  background: color-mix(in srgb, #16a34a 12%, var(--surface));
  border-color: color-mix(in srgb, #16a34a 35%, var(--line));
  color: #15803d;
}

.ai-cost-badge-partial {
  background: color-mix(in srgb, #d97706 12%, var(--surface));
  border-color: color-mix(in srgb, #d97706 35%, var(--line));
  color: #b45309;
}

.ai-cost-badge-unsettled {
  color: var(--muted);
}

.ai-expenses-summary {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  margin: 1rem 0 1.35rem;
}

.ai-expenses-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 0.3rem;
  min-height: 6.5rem;
  padding: 1rem 1.05rem;
}

.ai-expenses-stat-highlight {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.ai-expenses-stat-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ai-expenses-stat-value {
  font-size: 1.28rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.ai-expenses-stat-muted {
  color: var(--muted);
}

.ai-expenses-stat-hint {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.ai-expense-store-link {
  color: inherit;
  text-decoration: none;
}

.ai-expense-store-link:hover strong {
  color: var(--accent);
  text-decoration: underline;
}

.ai-expense-remaining {
  color: var(--ink);
}

.ai-expense-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.ai-expense-pill-settled {
  background: color-mix(in srgb, #16a34a 10%, var(--surface));
  border-color: color-mix(in srgb, #16a34a 28%, var(--line));
  color: #15803d;
}

.ai-expense-pill-due {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
  color: var(--ink);
}

.ai-expense-pill-idle {
  color: var(--muted);
}

.ai-expenses-store-table td,
.ai-expenses-feature-table td,
.ai-expenses-activity-table td {
  vertical-align: middle;
}

.ai-expenses-activity-wrap {
  max-height: 28rem;
  overflow: auto;
}

.ai-expense-when {
  min-width: 9.5rem;
  white-space: nowrap;
}

.sc-move-card {
  margin-top: 1rem;
  scroll-margin-top: 5rem;
}

.sc-analytics-card {
  margin-top: 1rem;
}

.sc-analytics-card h2 {
  align-items: center;
  display: flex;
  font-size: 0.95rem;
  gap: 0.4rem;
  margin: 0 0 0.75rem;
}

.sc-analytics-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr 1fr;
}

.sc-analytics-stat {
  background: var(--surface-2, #f6f7f9);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 0.75rem;
}

.sc-analytics-num {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
}

.sc-analytics-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sc-sidebar .sc-analytics-card {
  padding: 1rem 1.1rem;
}

.sc-move-card h2 {
  align-items: center;
  display: flex;
  font-size: 0.95rem;
  gap: 0.4rem;
  margin: 0 0 0.5rem;
}

.sc-move-form button {
  width: 100%;
}

.sc-sidebar .sc-move-card {
  padding: 1rem 1.1rem;
}

td.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

td.actions form {
  margin: 0;
}

td.actions .button,
td.actions a.button,
td.actions button.button {
  font-size: var(--btn-font-size-sm);
  min-height: var(--btn-height-sm);
  padding: 0 var(--btn-padding-x-sm);
}

/* Settings */
.settings-layout {
  align-items: start;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
}

.settings-sidebar {
  position: sticky;
  top: 88px;
}

.settings-main {
  display: grid;
  gap: 1rem;
}

.settings-widgets-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.settings-card h2 {
  margin-bottom: 0.35rem;
}

.settings-card-intro {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.settings-form .field {
  margin-bottom: 0.75rem;
}

.settings-field-grid {
  display: grid;
  gap: var(--layout-field-gap);
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
}

.settings-field-cell {
  min-width: 0;
}

.settings-field-cell.is-full {
  grid-column: 1 / -1;
}

.settings-field-grid .field {
  margin-bottom: 0;
}

.settings-field-grid .sc-field-hint {
  margin-bottom: 0;
}

.settings-subheading {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 1rem 0 0.35rem;
}

.settings-subheading:first-child,
.settings-card > .settings-subheading:first-of-type,
.settings-form > .settings-subheading:first-child {
  margin-top: 0;
}

.settings-subheading-sm {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0.85rem 0 0.45rem;
  text-transform: uppercase;
}

.settings-form-compact .settings-card-intro {
  font-size: 0.85rem;
  margin-bottom: 0.65rem;
}

.settings-card-compact {
  padding: 1rem 1.15rem;
}

.settings-card-compact h2 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.settings-toggle-grid {
  display: grid;
  gap: var(--layout-field-gap);
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: 0;
  width: 100%;
}

.settings-toggle-grid .settings-toggle {
  margin-bottom: 0;
}

.settings-toggle {
  align-items: start;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  box-shadow: none;
  column-gap: var(--space-4);
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 0;
  min-height: 0;
  padding: var(--space-2);
  position: relative;
  transition: background var(--transition);
}

.settings-toggle:hover {
  background: var(--surface);
}

.settings-toggle:has(input:checked) {
  background: var(--accent-subtle);
}

.settings-toggle:has(input:focus-visible) {
  outline: 2px solid var(--accent-muted);
  outline-offset: 2px;
}

.settings-toggle input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.settings-toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.settings-toggle-ui {
  align-self: start;
  background: #d4d4d8;
  border-radius: 999px;
  display: block;
  flex-shrink: 0;
  grid-column: 2;
  grid-row: 1;
  height: 30px;
  margin-top: 1px;
  position: relative;
  transition: background var(--transition), box-shadow var(--transition);
  width: 52px;
}

.settings-toggle-ui::after {
  background: #ffffff;
  border: none;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(9, 9, 11, 0.14), 0 1px 2px rgba(9, 9, 11, 0.06);
  content: "";
  height: 24px;
  left: 3px;
  position: absolute;
  top: 3px;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow var(--transition);
  width: 24px;
}

.settings-toggle input:checked + .settings-toggle-copy + .settings-toggle-ui,
.settings-toggle:has(input:checked) .settings-toggle-ui {
  background: linear-gradient(135deg, var(--accent) 0%, #7c73ff 100%);
  box-shadow: 0 0 0 3px var(--accent-subtle), 0 2px 10px rgba(99, 91, 255, 0.28);
}

.settings-toggle input:checked + .settings-toggle-copy + .settings-toggle-ui::after,
.settings-toggle:has(input:checked) .settings-toggle-ui::after {
  box-shadow: 0 2px 8px rgba(99, 91, 255, 0.35);
  transform: translateX(22px);
}

.settings-toggle-label {
  color: var(--text);
  font-size: var(--type-body-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.01em;
  line-height: var(--lh-snug);
}

.settings-toggle:has(input:checked) .settings-toggle-label {
  color: var(--text);
}

.settings-toggle-hint {
  color: var(--muted);
  font-size: var(--type-caption);
  font-weight: var(--fw-regular);
  line-height: var(--lh-relaxed);
}

.settings-toggle:has(input:checked) .settings-toggle-hint {
  color: var(--text-secondary);
}

@media (max-width: 639px) {
  .settings-toggle {
    column-gap: var(--space-3);
  }
}

.settings-steps {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.settings-step {
  align-items: flex-start;
  animation: fadeIn 0.2s ease both;
  display: grid;
  gap: 0.85rem;
  grid-template-columns: auto 1fr;
}

.settings-step:nth-child(1) { animation-delay: 0.02s; }
.settings-step:nth-child(2) { animation-delay: 0.06s; }
.settings-step:nth-child(3) { animation-delay: 0.1s; }
.settings-step:nth-child(4) { animation-delay: 0.14s; }
.settings-step:nth-child(5) { animation-delay: 0.18s; }

.settings-step-num {
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 700;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.settings-step p {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.2rem 0 0;
}

.settings-step code {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 0.85em;
  padding: 0.1rem 0.35rem;
}

.settings-checklist {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
}

.settings-checklist li {
  line-height: 1.5;
  margin: 0.45rem 0;
}

.settings-checklist code {
  font-size: 0.85em;
}

.settings-store-keys {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  padding-top: 1rem;
}

.settings-domain-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.settings-domain-pill {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  display: inline-flex;
  font-size: 0.82rem;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
}

.settings-domain-pill small {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.settings-domain-primary {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
}

.settings-code-block {
  margin-top: 1rem;
}

.settings-code-block:first-of-type {
  margin-top: 0.5rem;
}

.settings-code-header {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.settings-code-header span {
  font-size: 0.9rem;
  font-weight: 600;
}

.settings-copy-btn {
  font-size: 0.82rem;
  padding: 0.4rem 0.7rem;
}

.settings-code {
  background: var(--code-surface);
  border: 1px solid #27272a;
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  color: #e4e4e7;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.55;
  margin: 0;
  max-height: 220px;
  overflow: auto;
  padding: var(--space-2);
  white-space: pre-wrap;
  word-break: break-word;
}

.settings-snippets .settings-code-block + .settings-code-block {
  margin-top: var(--space-4);
}

/* Size Charts UI */
.page-header,
.data-toolbar {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  justify-content: space-between;
  margin-bottom: var(--layout-page-gap);
  padding-bottom: 0;
}

.data-page {
  animation: fadeIn 0.25s ease;
}

.data-title,
.page-header h1 {
  font-size: clamp(1.5rem, 2.8vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0;
}

.data-subtitle,
.page-header .subtitle {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0.4rem 0 0;
  max-width: 56ch;
}

.data-toolbar-actions,
.page-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.page-header .eyebrow {
  color: var(--accent);
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-1);
  text-transform: uppercase;
}

.status-badge {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  padding: 0.35rem 0.55rem;
  white-space: nowrap;
}

.review-source-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  padding: 0.35rem 0.55rem;
  white-space: nowrap;
}

.review-source-ai {
  background: #ede9fe;
  color: #5b21b6;
}

.review-source-csv {
  background: #dbeafe;
  color: #1d4ed8;
}

.review-source-loox {
  color: #6d28d9;
  background: #f3e8ff;
  border-color: #e9d5ff;
}

.review-source-storefront {
  background: #dcfce7;
  color: #15803d;
}

.review-source-other {
  background: #f3f4f6;
  color: #4b5563;
}

.review-detail-source {
  margin-bottom: 0.35rem;
}

.dash-source-note {
  margin-top: -0.25rem;
}

.dash-source-note .review-source-tag {
  margin: 0 0.15rem;
  vertical-align: middle;
}

.data-row-source {
  display: flex;
  align-items: center;
}

/* Data filters â€” inline strip */
.data-filters {
  align-items: flex-end;
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0;
  padding: 0.85rem 0;
}

.filter-field {
  display: grid;
  flex: 1 1 160px;
  gap: 0.3rem;
  margin: 0;
  min-width: 0;
}

.filter-field-label {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.62rem;
  font-weight: 700;
  gap: 0.3rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-field input,
.filter-field select {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 0.35rem 0;
  width: 100%;
}

.filter-field input:focus,
.filter-field select:focus {
  border-bottom-color: var(--text);
  box-shadow: none;
}

.data-filters-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 0.5rem;
  margin-left: auto;
}

/* Data list â€” partners-style rows */
.data-list {
  margin-top: 0;
}

.data-list-head,
.data-row {
  gap: 1rem;
}

.data-list-charts .data-list-head,
.data-list-charts .data-row {
  grid-template-columns: 2.5rem minmax(160px, 1.4fr) 5.5rem minmax(100px, 1fr) 4.5rem 4rem 4rem 6.5rem auto;
}

.data-list-reviews .data-list-head,
.data-list-reviews .data-row {
  grid-template-columns: 2rem 2.5rem minmax(160px, 1.4fr) 4rem minmax(120px, 1fr) 5.5rem 5.5rem 6.5rem auto;
}

.data-row-check {
  align-items: center;
  display: flex;
  justify-content: center;
}

.data-row-check input {
  height: 1rem;
  width: 1rem;
}

.reviews-bulk-bar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  padding: 0.75rem 0 1rem;
}

.reviews-select-all {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.82rem;
  gap: 0.45rem;
  margin-right: auto;
}

.reviews-bulk-form,
.reviews-delete-matching {
  margin: 0;
}

.reviews-handle {
  font-size: 0.78rem;
}

.reviews-moderation-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.reviews-moderation-tab {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.84rem;
  font-weight: 600;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  text-decoration: none;
}

.reviews-moderation-tab:hover {
  border-color: var(--accent-muted);
  color: var(--accent);
}

.reviews-moderation-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: var(--shadow-xs);
  color: #fff;
}

.reviews-moderation-count {
  background: rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  font-size: 0.75rem;
  line-height: 1;
  min-width: 1.35rem;
  padding: 0.2rem 0.4rem;
  text-align: center;
}

.reviews-moderation-tab.is-active .reviews-moderation-count {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.app-setup-top-row {
  align-items: stretch;
  display: grid;
  gap: var(--space-4);
  grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
  margin-bottom: var(--space-4);
}

.app-setup-top-row .shopify-theme-install-card {
  margin-bottom: 0;
}

.reviews-store-scope-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-bottom: 0;
}

.reviews-store-scope-card .reviews-store-scope-label {
  margin: 0;
}

.reviews-store-scope-store-name {
  font-size: 1.35rem;
  line-height: 1.2;
  margin: 0.35rem 0 0.75rem;
}

.reviews-store-scope-card .reviews-store-scope-category {
  margin: 0;
}

@media (max-width: 900px) {
  .app-setup-top-row {
    grid-template-columns: 1fr;
  }
}

.reviews-store-scope {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  margin-bottom: var(--space-2);
  padding: var(--space-2);
}

.reviews-store-scope-label {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 600;
  gap: 0.35rem;
}

.reviews-store-scope-key {
  font-size: 0.78rem;
}

.reviews-store-scope-note {
  color: var(--muted);
  flex: 1 1 220px;
  font-size: 0.8rem;
  min-width: 220px;
}

.data-list-imports .data-list-head,
.data-list-imports .data-row {
  grid-template-columns: 2.5rem minmax(180px, 1.5fr) 5.5rem minmax(140px, 1fr) 6.5rem auto;
}

.data-list-head {
  color: var(--muted);
  display: grid;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.85rem 0 0.5rem;
  text-transform: uppercase;
}

.data-list-head span:last-child {
  text-align: right;
}

.data-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  padding: 1.05rem 0;
  transition: background var(--transition);
}

.data-row:hover {
  background: var(--surface);
}

.data-row-index {
  color: #d4d4d8;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.data-row-main {
  min-width: 0;
}

.data-row-title {
  color: var(--text);
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  overflow: hidden;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-row-title:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.data-row-sub {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  margin-top: 0.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-row-meta {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.78rem;
  gap: 0.25rem;
  min-width: 0;
}

.data-meta-dot {
  color: var(--line-strong);
}

.data-row-rating {
  color: var(--text);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
}

.data-row-date {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.data-row-stat {
  text-align: left;
}

.data-stat-num {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.data-stat-label {
  color: var(--muted);
  display: block;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-top: 0.15rem;
  text-transform: uppercase;
}

.action-strip {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0;
  justify-content: flex-end;
}

.action-btn,
.action-btn-form button.action-btn {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  box-shadow: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: var(--btn-font-size-sm);
  font-weight: var(--btn-font-weight);
  gap: 0.32rem;
  justify-content: center;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-left: -1px;
  min-height: var(--btn-height-sm);
  padding: 0 0.65rem;
  text-decoration: none;
  transition:
    background var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    color var(--transition);
  white-space: nowrap;
}

.action-btn:first-child,
.action-btn-form:first-child .action-btn {
  border-radius: var(--btn-radius) 0 0 var(--btn-radius);
  margin-left: 0;
}

.action-strip > :last-child .action-btn,
.action-strip > .action-btn:last-child {
  border-radius: 0 var(--btn-radius) var(--btn-radius) 0;
}

.action-strip > :only-child .action-btn,
.action-strip > .action-btn:only-child {
  border-radius: var(--btn-radius);
}

.action-btn:hover {
  background: var(--surface);
  border-color: color-mix(in srgb, var(--line-strong) 70%, var(--accent) 30%);
  box-shadow: var(--btn-shadow-secondary);
  color: var(--text);
  z-index: 1;
}

.action-btn-danger {
  color: #b42318;
}

.action-btn-danger:hover {
  background: var(--danger-subtle);
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  color: #991b1b;
}

.action-btn-form {
  display: inline-flex;
  margin: 0;
}

.action-btn-label {
  display: none;
}

@media (min-width: 1100px) {
  .action-btn-label {
    display: inline;
  }
}

.data-list-empty,
.data-empty {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: center;
  padding: 3.5rem 1rem;
  text-align: center;
}

.data-empty .ico {
  color: var(--line-strong);
}

.data-empty p {
  margin: 0;
}

/* Data form â€” create / edit pages */
.data-form {
  border-top: 1px solid var(--line);
  margin-top: 0;
  padding-top: 0.5rem;
}

.data-form-layout {
  align-items: start;
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
}

.data-form-main {
  display: grid;
  gap: 0;
}

.form-field-row {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 1rem 1.25rem;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  padding: 1.35rem 0;
}

.form-field-step {
  color: #d4d4d8;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  padding-top: 0.15rem;
}

.form-field-body {
  min-width: 0;
}

.form-field-label {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.62rem;
  font-weight: 700;
  gap: 0.3rem;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.form-field-body input,
.form-field-body textarea,
.form-field-body select {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  font-size: 1rem;
  padding: 0.45rem 0;
  width: 100%;
}

.form-field-body textarea {
  min-height: 88px;
  resize: vertical;
}

.form-field-body input:focus,
.form-field-body textarea:focus,
.form-field-body select:focus {
  border-bottom-color: var(--text);
  box-shadow: none;
  outline: none;
}

.form-field-hint {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
  margin: 0.45rem 0 0;
}

.data-form-actions {
  display: flex;
  gap: 0.5rem;
  padding: 1.5rem 0 0.5rem 3.75rem;
}

.data-form-aside {
  border-left: 1px solid var(--line);
  padding: 1.25rem 0 1.25rem 1.5rem;
  position: sticky;
  top: 1rem;
}

.data-form-aside-title {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.62rem;
  font-weight: 700;
  gap: 0.35rem;
  letter-spacing: 0.08em;
  margin: 0 0 1rem;
  text-transform: uppercase;
}

.data-form-steps-list {
  display: grid;
  gap: 1.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.data-form-steps-list li {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 2rem minmax(0, 1fr);
}

.data-form-steps-num {
  color: #d4d4d8;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.data-form-steps-list strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.data-form-steps-list p {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
  margin: 0;
}

@media (max-width: 900px) {
  .data-form-layout {
    grid-template-columns: 1fr;
  }

  .data-form-aside {
    border-left: none;
    border-top: 1px solid var(--line);
    padding: 1.25rem 0 0;
    position: static;
  }

  .data-form-actions {
    padding-left: 0;
  }
}

.sc-edit-layout {
  align-items: start;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
}

.sc-sidebar {
  position: sticky;
  top: 1rem;
}

.sc-content {
  display: grid;
  gap: 1rem;
}

.sc-blocks {
  display: grid;
  gap: 0.85rem;
}

.sc-block-card {
  animation: fadeIn 0.2s ease;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.sc-block-head {
  align-items: center;
  background: #fafafa;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.85rem 1rem;
}

.sc-block-type {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  text-transform: uppercase;
}

.sc-block-body {
  padding: 1rem;
}

.sc-block-preview {
  background: #fafafa;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
}

.sc-block-preview img {
  border-radius: var(--radius-sm);
  display: block;
  max-width: 220px;
}

.sc-block-actions {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
  margin-top: 0.5rem;
  padding-top: 0.85rem;
}

.sc-add-block {
  border: 1px dashed var(--line-strong);
  background: var(--panel);
}

.sc-add-block h2 {
  align-items: center;
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}

.sc-block-card-legacy {
  opacity: 0.85;
}

.sc-add-block p {
  color: var(--muted);
  margin: 0 0 1rem;
}

.sc-field-hint {
  color: var(--muted);
  font-size: 0.8rem;
  margin: -0.35rem 0 0.75rem;
}

.status-draft,
.status-active,
.status-archived {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
}

.sc-empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  padding: 2rem 1rem;
  text-align: center;
}

.sc-empty a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.sc-empty a:hover {
  text-decoration: underline;
}

.sc-table-mini {
  border-collapse: collapse;
  font-size: 0.85rem;
  width: 100%;
}

.sc-table-mini th,
.sc-table-mini td {
  border: 1px solid var(--line);
  padding: 0.4rem 0.55rem;
}

.sc-preview-drawer {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-width: 420px;
  padding: 1.25rem;
}

.table-scroll {
  overflow-x: auto;
}

.sc-meta-status {
  margin-bottom: 1rem;
}

.sc-danger-zone {
  border-top: 1px solid var(--line);
  margin-top: 1rem;
  padding-top: 1rem;
}

.checkbox-field {
  align-items: center;
  grid-template-columns: auto 1fr;
}

.filters.card {
  margin-bottom: 1rem;
}

/* Size Charts list */
.sc-filters {
  align-items: flex-end;
  animation: fadeIn 0.2s ease;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 1rem;
}

.sc-filters .field {
  margin-bottom: 0;
}

.sc-filters-actions {
  display: flex;
  padding-bottom: 0.1rem;
}

.sc-filters-actions button {
  white-space: nowrap;
}

.sc-list-card {
  animation: fadeIn 0.2s ease both;
  padding: 0;
}

.sc-list-card .sc-empty {
  border: none;
  margin: 0;
}

.sc-table-wrap {
  overflow-x: auto;
}

.sc-list-table {
  width: 100%;
}

.sc-list-table tbody tr {
  transition: background var(--transition);
}

.sc-list-table tbody tr:hover {
  background: #fafafa;
}

.sc-chart-link {
  color: var(--text);
  display: inline-block;
  text-decoration: none;
  transition: color var(--transition);
}

.sc-chart-link:hover {
  color: var(--muted);
}

.sc-chart-link strong {
  font-weight: 600;
}

.sc-chart-slug {
  color: var(--muted);
  display: block;
  font-family: "Manrope", sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  margin-top: 0.15rem;
}

.sc-content-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.sc-content-pill {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.2rem 0.55rem;
}

.sc-content-pill-muted {
  background: #fafafa;
  color: var(--muted);
}

.sc-assigned-count {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.sc-date {
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
}

.sc-list-table td.actions .button {
  font-size: var(--btn-font-size-sm);
  min-height: var(--btn-height-sm);
  padding: 0 var(--btn-padding-x-sm);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 900px) {
  .sc-edit-layout,
  .stores-layout,
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .sc-sidebar,
  .stores-sidebar,
  .settings-sidebar {
    position: static;
  }

  .sc-filters {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  header,
  nav,
  .header-right,
  .actions,
  .filters,
  .page-header,
  .page-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  table {
    display: block;
    overflow-x: auto;
  }
}

.auth-shell {
  margin: 0 auto;
  max-width: 420px;
  padding-top: 2rem;
}

.auth-shell .card h2 {
  margin-bottom: 1rem;
}

/* Portal / pick cards â€” partners style */
.section-block {
  margin-bottom: 2rem;
}

.section-label {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.65rem;
  font-weight: 700;
  gap: 0.35rem;
  letter-spacing: 0.08em;
  margin: 0 0 0.85rem;
  text-transform: uppercase;
}

.pick-grid {
  display: grid;
  gap: var(--space-2);
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.pick-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: inherit;
  display: grid;
  gap: 0.2rem;
  margin: 0;
  min-height: 110px;
  padding: var(--space-3);
  position: relative;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.pick-card:hover {
  background: var(--surface-elevated);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.pick-card-icon {
  color: var(--muted);
  display: flex;
  margin-bottom: 0.25rem;
}

.pick-card-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.pick-card-desc {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
  padding-right: 1.25rem;
}

.pick-card-meta {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-top: 0.35rem;
  text-transform: uppercase;
}

.pick-card-arrow {
  color: var(--muted);
  position: absolute;
  right: 1rem;
  top: 1.1rem;
}

.empty-state {
  border: 1px solid var(--line);
  padding: 2rem;
  text-align: center;
}

.empty-state p {
  color: var(--muted);
  margin: 0 0 1rem;
}

.settings-layout-single .settings-main {
  max-width: none;
}

.settings-card-narrow {
  max-width: 560px;
}

.sc-workspace {
  display: grid;
  gap: 0;
}

.sc-workspace-head {
  border-bottom: 1px solid var(--line);
  padding: 1rem 1rem 0.85rem;
}

.sc-workspace-head h2 {
  align-items: center;
  display: flex;
  gap: 0.4rem;
  margin: 0 0 0.35rem;
}

.sc-workspace-rules {
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
  margin: 0.75rem 0 0;
  padding: 0.55rem 0.75rem;
}

.sc-workspace-alert {
  color: #b45309;
  font-size: 0.85rem;
  margin: 0.65rem 0 0;
}

.sc-workspace-preview,
.sc-workspace-empty {
  border-bottom: 1px solid var(--line);
  padding: 1rem;
}

.sc-workspace-empty {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: center;
}

.sc-workspace-empty p {
  margin: 0;
  max-width: 28rem;
}

.sc-workspace-preview .sc-block-preview {
  margin-bottom: 0;
}

.sc-editable-table-form {
  display: grid;
  gap: 0.65rem;
}

.sc-editable-table-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: space-between;
}

.sc-editable-table-hint {
  color: var(--muted);
  font-size: 0.82rem;
}

.sc-editable-table-wrap {
  margin-bottom: 0;
}

.sc-table-editable td {
  padding: 0.2rem;
}

.sc-table-cell {
  background: #fff;
  border: 1px solid transparent;
  border-radius: 4px;
  font: inherit;
  font-size: 0.85rem;
  min-width: 3.25rem;
  padding: 0.35rem 0.45rem;
  text-align: center;
  width: 100%;
}

.sc-table-cell:focus {
  background: #fff;
  border-color: #18181b;
  outline: none;
}

.sc-table-cell-size {
  font-weight: 700;
  min-width: 2.75rem;
  text-align: left;
}

.sc-table-editable tbody tr:hover .sc-table-cell {
  border-color: var(--line);
}

.sc-guide-workspace {
  margin-top: 1rem;
  position: relative;
}

.sc-guide-workspace.is-generating .sc-workspace-form {
  opacity: 0.45;
  pointer-events: none;
}

.sc-guide-loading {
  border-bottom: 1px solid var(--line);
  padding: 1.25rem 1rem;
}

.sc-guide-loading-inner {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  text-align: center;
}

.sc-guide-loading-ring {
  animation: scGuideSpin 1.1s linear infinite;
  border: 2px solid var(--line);
  border-radius: 50%;
  border-top-color: #18181b;
  height: 36px;
  width: 36px;
}

.sc-guide-loading-pct {
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.sc-guide-loading-step {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0;
}

.sc-guide-loading-bar {
  background: #f4f4f5;
  border-radius: 999px;
  height: 4px;
  margin-top: 0.15rem;
  overflow: hidden;
  width: min(100%, 280px);
}

.sc-guide-loading-bar span {
  background: #18181b;
  display: block;
  height: 100%;
  transition: width 0.45s ease;
  width: 0;
}

.sc-guide-loading-hint {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
  margin: 0.15rem 0 0;
  max-width: 22rem;
}

.sc-guide-status {
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
  padding: 0.75rem 1rem;
}

.sc-guide-status-success {
  background: #f4fdf7;
  color: #166534;
}

.sc-guide-status-error {
  background: #fff5f5;
  color: #991b1b;
}

@keyframes scGuideSpin {
  to {
    transform: rotate(360deg);
  }
}

.sc-guide-upload-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sc-guide-upload-grid--single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 28rem;
}

.sc-garment-structure-status {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  color: #52525b;
}

.sc-guide-upload-grid .sc-ai-image-drop {
  min-height: 7.5rem;
}

.sc-guide-wear-upload .sc-ai-image-preview {
  max-height: 130px;
}

.sc-guide-thumb,
.sc-guide-wear-preview {
  border: 1px solid var(--line);
  border-radius: 4px;
  display: block;
  margin: 0 auto;
  max-height: 130px;
  max-width: 100%;
  object-fit: contain;
}

.sc-guide-infographic-preview {
  border-bottom: 1px solid var(--line);
  padding: 1rem;
  text-align: center;
}

.sc-guide-infographic-preview img,
.sc-guide-infographic-img {
  border: 1px solid var(--line);
  border-radius: 4px;
  display: block;
  margin: 0 auto;
  max-height: 240px;
  max-width: 100%;
  object-fit: contain;
}

.sc-guide-infographic-empty {
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  text-align: center;
}

.sc-guide-infographic-empty p {
  margin: 0;
  max-width: 28rem;
}

@media (max-width: 720px) {
  .sc-guide-upload-grid {
    grid-template-columns: 1fr;
  }
}

.sc-workspace-form {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
}

.sc-workspace-actions {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: space-between;
  margin-top: 0.25rem;
  padding-top: 0.85rem;
}

.sc-workspace-delete {
  margin: 0;
}

.sc-ai-file-hidden {
  height: 1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.sc-workspace-form .sc-ai-image-drop kbd {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.75rem;
  padding: 0.1rem 0.35rem;
}

.sc-add-block textarea {
  min-height: 100px;
}

.sc-ai-image {
  display: grid;
  gap: 0.5rem;
  position: relative;
}

.sc-ai-image-drop {
  position: relative;
  border: 1px dashed var(--line, #d4d4d8);
  border-radius: 8px;
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  background: #fafafa;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.sc-ai-image-drop:hover,
.sc-ai-image-drop.is-dragover,
.sc-ai-image-drop:focus-visible {
  border-color: #18181b;
  background: #f4f4f5;
  outline: none;
}

.sc-ai-image-placeholder {
  display: grid;
  gap: 0.35rem;
  justify-items: center;
  color: var(--muted, #71717a);
}

.sc-ai-image-placeholder p {
  margin: 0;
  font-size: 14px;
  color: #18181b;
}

.sc-ai-image-placeholder span {
  font-size: 12px;
}

.sc-ai-image-preview {
  display: block;
  max-width: 100%;
  max-height: 160px;
  margin: 0 auto;
  border-radius: 6px;
  border: 1px solid var(--line, #e4e4e7);
}

.sc-ai-image-preview[hidden] {
  display: none !important;
}

.sc-ai-image-clear {
  margin-top: 0.75rem;
}

.sc-ai-image.has-image .sc-ai-image-drop {
  padding: 0.75rem;
}

.stores-domain-card {
  margin-top: 1.5rem;
}

.staff-store-grid {
  display: grid;
  gap: 0.5rem 1rem;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  margin-top: 0.35rem;
}

.staff-store-item {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-size: 0.9rem;
  gap: 0.5rem;
}

.staff-store-item input {
  accent-color: #18181b;
  flex: 0 0 auto;
}

.staff-store-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.staff-table td {
  vertical-align: top;
}

@media (max-width: 960px) {
  .dash-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .dash-stats {
    grid-template-columns: 1fr;
  }

  .shell-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .shell-controls {
    justify-content: flex-start;
    width: 100%;
  }

  .pick-grid {
    grid-template-columns: 1fr;
  }

  .data-list-head {
    display: none;
  }

  .data-list-charts .data-row,
  .data-list-reviews .data-row,
  .data-list-imports .data-row {
    gap: 0.5rem 0.75rem;
    grid-template-columns: 2rem 1fr;
    grid-template-areas:
      "index main"
      "index meta"
      "index source"
      "index status"
      "index actions";
    padding: 1rem 0;
  }

  .data-row-index { grid-area: index; }
  .data-row-main { grid-area: main; }
  .data-row-meta { grid-area: meta; }
  .data-row-source { grid-area: source; }
  .data-row-status { grid-area: status; }
  .data-row-date,
  .data-row-stat,
  .data-row-rating { display: none; }
  .action-strip { grid-area: actions; justify-content: flex-start; }
  .action-btn-label { display: inline; }

  .data-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .data-filters-actions {
    margin-left: 0;
    width: 100%;
  }
}

/* AI review generator â€” full-screen loading modal */
.ai-gen-overlay {
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  transition: opacity 0.28s ease;
  z-index: 10000;
}

.ai-gen-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.ai-gen-overlay[hidden] {
  display: none !important;
}

.ai-gen-backdrop {
  background: rgba(10, 12, 18, 0.72);
  backdrop-filter: blur(6px);
  inset: 0;
  position: absolute;
}

.ai-gen-modal {
  animation: aiGenModalIn 0.38s cubic-bezier(0.22, 1, 0.36, 1);
  background: var(--panel, #fff);
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
  left: 50%;
  max-height: min(90vh, 780px);
  max-width: min(560px, calc(100vw - 2rem));
  overflow: auto;
  padding: 1.75rem 1.6rem 1.4rem;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
}

.ai-gen-overlay.is-success .ai-gen-modal {
  max-width: min(920px, calc(100vw - 2rem));
}

@keyframes aiGenModalIn {
  from {
    opacity: 0;
    transform: translate(-50%, -46%) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.ai-gen-body-lock {
  overflow: hidden;
}

.ai-gen-view[hidden] {
  display: none !important;
}

.ai-gen-progress-top {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.ai-gen-spinner {
  animation: aiGenSpin 0.95s linear infinite;
  border: 2.5px solid var(--line, #e5e7eb);
  border-radius: 50%;
  border-top-color: #18181b;
  height: 40px;
  width: 40px;
}

.ai-gen-overlay.is-done .ai-gen-spinner {
  animation: none;
  border-color: transparent;
  height: 0;
  width: 0;
}

@keyframes aiGenSpin {
  to {
    transform: rotate(360deg);
  }
}

.ai-gen-pct {
  font-size: 2.35rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0;
}

.ai-gen-title {
  font-size: 1.1rem;
  margin: 0 0 0.35rem;
  text-align: center;
}

.ai-gen-message {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  margin: 0 0 1rem;
  text-align: center;
}

.ai-gen-phases {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.ai-gen-phases li {
  background: var(--surface-2, #f4f4f5);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.28rem 0.55rem;
  text-transform: uppercase;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.ai-gen-phases li.is-active {
  background: #18181b;
  color: #fff;
  transform: scale(1.05);
}

.ai-gen-phases li.is-done {
  background: #ecfdf3;
  color: #166534;
}

.ai-gen-bar {
  background: #f4f4f5;
  border-radius: 999px;
  height: 8px;
  margin-bottom: 0.65rem;
  overflow: hidden;
  position: relative;
}

.ai-gen-bar span {
  background: linear-gradient(90deg, #18181b 0%, #3f3f46 100%);
  border-radius: 999px;
  display: block;
  height: 100%;
  position: relative;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  width: 0;
}

.ai-gen-bar span::after {
  animation: aiGenShimmer 1.4s ease-in-out infinite;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  content: "";
  inset: 0;
  position: absolute;
}

@keyframes aiGenShimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.ai-gen-step {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  text-align: center;
}

.ai-gen-hint {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
  margin: 0.85rem 0 0;
  text-align: center;
}

.ai-gen-log-panel {
  background: var(--surface-2, #f6f7f9);
  border-radius: 10px;
  font-size: 0.8rem;
  margin-top: 0.5rem;
  padding: 0.45rem 0.65rem;
}

.ai-gen-log-panel summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  user-select: none;
}

.ai-gen-log-panel summary::-webkit-details-marker {
  display: none;
}

.ai-gen-log {
  list-style: none;
  margin: 0.55rem 0 0;
  max-height: 140px;
  overflow: auto;
  padding: 0;
}

.ai-gen-log li {
  border-top: 1px solid var(--line, #e5e7eb);
  display: grid;
  gap: 0.35rem;
  grid-template-columns: 3rem 1fr;
  padding: 0.35rem 0;
}

.ai-gen-log-time {
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.ai-gen-success-burst {
  height: 72px;
  margin: 0 auto 0.5rem;
  width: 72px;
}

.ai-gen-success-burst.ai-gen-animate .ai-gen-checkmark-circle {
  animation: aiGenStroke 0.55s cubic-bezier(0.65, 0, 0.45, 1) forwards;
  stroke: #16a34a;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 2;
}

.ai-gen-success-burst.ai-gen-animate .ai-gen-checkmark-check {
  animation: aiGenStroke 0.35s 0.45s cubic-bezier(0.65, 0, 0.45, 1) forwards;
  stroke: #16a34a;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  stroke-width: 3;
}

@keyframes aiGenStroke {
  100% {
    stroke-dashoffset: 0;
  }
}

.ai-gen-error-badge {
  align-items: center;
  background: #fee2e2;
  border-radius: 50%;
  color: #b91c1c;
  display: flex;
  font-size: 1.6rem;
  font-weight: 800;
  height: 56px;
  justify-content: center;
  margin: 0 auto 0.65rem;
  width: 56px;
}

.ai-gen-error-message {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  color: #991b1b;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
  margin: 0 0 0.75rem;
  padding: 0.75rem 0.85rem;
  text-align: left;
}

.ai-gen-error-details {
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

.ai-gen-error-details pre {
  background: var(--surface-2, #f6f7f9);
  border-radius: 8px;
  font-size: 0.76rem;
  margin: 0.45rem 0 0;
  overflow: auto;
  padding: 0.65rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-gen-table-wrap {
  margin: 1rem 0;
  overflow: auto;
}

.ai-gen-table {
  border-collapse: collapse;
  font-size: 0.82rem;
  width: 100%;
}

.ai-gen-table th,
.ai-gen-table td {
  border-bottom: 1px solid var(--line, #e5e7eb);
  padding: 0.5rem 0.55rem;
  text-align: left;
  vertical-align: top;
}

.ai-gen-table th {
  background: var(--surface-2, #f6f7f9);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ai-gen-preview-cell {
  color: var(--muted);
  max-width: 260px;
}

.ai-gen-stars {
  color: #f59e0b;
  letter-spacing: -0.04em;
}

.ai-gen-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 0.75rem;
}

.ai-gen-empty {
  color: var(--muted);
  text-align: center;
}

.settings-card.is-ai-generating {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.ai-gen-actions-inline {
  margin-top: 0.5rem;
  justify-content: flex-start;
}

.ai-gen-eta {
  font-size: 0.85rem;
  margin: 0.35rem 0 0;
  text-align: center;
}

.ai-jobs-card {
  margin-top: 1.25rem;
  width: 100%;
}

.ai-jobs-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.ai-job-card {
  width: 100%;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  background: #fff;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ai-job-card--running {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
}

.ai-job-card--pending {
  border-color: #fde68a;
  background: linear-gradient(180deg, #fffdf5 0%, #fff 100%);
}

.ai-job-card--done {
  border-color: #bbf7d0;
}

.ai-job-card--error {
  border-color: #fecaca;
  background: #fffafa;
}

.ai-job-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.ai-job-card-identity {
  min-width: 0;
  flex: 1;
}

.ai-job-card-label {
  margin: 0 0 0.2rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.ai-job-card-handle {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text, #111);
  word-break: break-word;
}

.ai-job-auto-badge {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1d4ed8;
  background: #dbeafe;
}

.ai-job-card-bar {
  height: 8px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.ai-job-card--pending .ai-job-card-bar {
  background: #fef3c7;
}

.ai-job-card--running .ai-job-card-bar {
  background: #dbeafe;
}

.ai-job-card--done .ai-job-card-bar {
  background: #dcfce7;
}

.ai-job-card-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: #3b82f6;
  transition: width 0.35s ease;
}

.ai-job-card--pending .ai-job-card-bar-fill {
  background: #f59e0b;
  width: 0 !important;
}

.ai-job-card--done .ai-job-card-bar-fill {
  background: #16a34a;
}

.ai-job-card-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  margin: 0;
}

.ai-job-card-meta > div {
  min-width: 0;
}

.ai-job-card-meta dt {
  margin: 0 0 0.2rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.ai-job-card-meta dd {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text, #111);
  line-height: 1.3;
}

.ai-job-card-message {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: #f8f9fb;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #4b5563;
}

.ai-job-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  padding-top: 0.15rem;
}

.ai-jobs-empty {
  color: var(--muted);
  margin: 0;
  padding: 0.5rem 0;
}

.ai-job-status {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.ai-job-status-running {
  background: #dbeafe;
  color: #1d4ed8;
}

.ai-job-status-done {
  background: #dcfce7;
  color: #15803d;
}

.ai-job-status-error {
  background: #fee2e2;
  color: #b91c1c;
}

.ai-job-status-cancelled {
  background: #f3f4f6;
  color: #4b5563;
}

.ai-job-status-pending {
  background: #fef3c7;
  color: #92400e;
}

/* AI review generator â€” product cards */
.ai-gen-studio-wrap {
  width: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ai-gen-studio {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ai-gen-studio-alert {
  margin: 0;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: #fff8e6;
  color: #7a5a00;
  font-size: 0.875rem;
}

.ai-gen-studio-products {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.ai-gen-product-card {
  position: relative;
  padding: 1rem 1rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
  min-width: 0;
  height: 100%;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.ai-gen-card-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.ai-gen-metric {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.ai-gen-metric span,
.ai-gen-studio-field span {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ai-gen-metric input[type="number"] {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--text, #111);
  -moz-appearance: textfield;
}

.ai-gen-metric input[type="number"]::-webkit-outer-spin-button,
.ai-gen-metric input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.ai-gen-card-panel {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8f9fb;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
}

.ai-gen-studio-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.ai-gen-studio-field input[type="url"] {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.82rem;
  background: #fff;
}

.ai-gen-row-remove {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 1.65rem;
  height: 1.65rem;
  border: none;
  border-radius: 999px;
  background: #fff;
  color: #666;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  z-index: 1;
}

.ai-gen-row-remove:hover {
  background: #fee;
  color: #c00;
}

.ai-gen-photo-zone {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ai-gen-photo-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.ai-gen-photo-pick {
  align-self: flex-start;
  font-size: 0.82rem;
  padding: 0.4rem 0.65rem;
}

.ai-gen-photo-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ai-gen-photo-thumb {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
}

.ai-gen-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ai-gen-photo-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 1.25rem;
  height: 1.25rem;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.ai-gen-card-footer {
  display: flex;
  justify-content: stretch;
  padding-top: 0.1rem;
  margin-top: auto;
}

.ai-gen-row-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  font-size: 0.82rem;
  padding: 0.5rem 0.65rem;
}

.ai-gen-studio-list-footer {
  display: flex;
  align-items: center;
}

.ai-gen-add-product {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.ai-gen-studio-usage {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Hide legacy explainer paragraphs on AI generator page */
.ai-generator-page .settings-card-intro,
.ai-generator-page .form-field-hint,
.ai-generator-page .sc-field-hint,
.ai-gen-studio-card .settings-card-intro,
.ai-gen-studio-wrap .settings-card-intro,
.ai-review-generator-notes,
.ai-generator-footnotes {
  display: none !important;
}

.ai-generator-page .ai-gen-studio-alert {
  display: block !important;
}

/* AI one-shot generator â€” compact form layout */
.ai-generator-card {
  max-width: 680px;
}

.ai-generator-page {
  display: grid;
  gap: 0;
  max-width: 100%;
}

.ai-generator-page .field {
  margin-bottom: 0;
}

.ai-generator-page input[type="text"],
.ai-generator-page input[type="url"],
.ai-generator-page input[type="number"],
.ai-generator-page select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line, #e8eaee);
  border-radius: var(--radius-sm, 8px);
  background: #fff;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.35;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ai-generator-page input[type="number"] {
  max-width: 9rem;
}

.ai-generator-page select {
  max-width: 22rem;
  padding-right: 2rem;
}

.ai-generator-page input:focus,
.ai-generator-page select:focus {
  border-color: #111;
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08);
  outline: none;
}

.ai-gen-section {
  display: grid;
  gap: 0.85rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--line, #e8eaee);
}

.ai-gen-section:first-of-type {
  border-top: none;
  padding-top: 0.15rem;
}

.ai-gen-section-title {
  margin: 0 0 0.15rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #666);
}

.ai-gen-fields-row {
  display: grid;
  gap: 0.85rem 1rem;
  grid-template-columns: repeat(2, minmax(0, 12rem));
  align-items: start;
}

.ai-gen-field-narrow .field {
  max-width: 22rem;
}

.ai-gen-submit-row {
  margin: 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line, #e8eaee);
}

.ai-generator-page .ai-gen-studio-alert {
  margin-bottom: 0.35rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm, 8px);
  font-size: 0.88rem;
  line-height: 1.45;
}

.ai-generator-page .ai-gen-brand-note {
  margin: 0;
  font-size: 0.86rem;
}

.ai-generator-page .ai-gen-randomize-wrap {
  margin: 0;
}

.ai-generator-page .ai-gen-image-note {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .ai-generator-card {
    max-width: none;
  }

  .ai-gen-fields-row {
    grid-template-columns: 1fr;
  }

  .ai-generator-page input[type="number"],
  .ai-generator-page select,
  .ai-gen-field-narrow .field {
    max-width: none;
  }
}

.ai-jobs-details {
  max-width: none;
  width: 100%;
  margin-top: 1rem;
}

.ai-jobs-summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.15rem 0;
}

.ai-jobs-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

.ai-jobs-summary::-webkit-details-marker {
  display: none;
}

.ai-jobs-details[open] .ai-jobs-list {
  margin-top: 1rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border, #e8eaee);
}

@media (max-width: 1200px) {
  .ai-gen-studio-products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .ai-gen-studio-products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-job-card-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .ai-gen-studio-products {
    grid-template-columns: 1fr;
  }

  .ai-job-card-top {
    flex-direction: column;
    gap: 0.5rem;
  }

  .ai-job-card-meta {
    grid-template-columns: 1fr 1fr;
  }

  .ai-job-card-actions {
    justify-content: stretch;
  }

  .ai-job-card-actions .button {
    flex: 1;
    justify-content: center;
  }
}

/* Auto order reviews â€” settings details page */
.auto-order-details {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 1100px;
}

.auto-order-section h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.auto-order-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
}

.auto-order-kpi {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.auto-order-kpi-label {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted, #64748b);
}

.auto-order-kpi-value {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
}

.auto-order-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 1.5rem;
  margin: 0;
}

.auto-order-facts > div {
  display: grid;
  gap: 0.15rem;
}

.auto-order-facts dt {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #64748b);
}

.auto-order-facts dd {
  margin: 0;
  font-size: 0.92rem;
}

.auto-order-facts-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0.75rem;
}

.auto-order-pill {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: #e2e8f0;
  color: #334155;
}

.auto-order-pill-ok {
  background: #dcfce7;
  color: #166534;
}

.auto-order-pill-warn {
  background: #fef3c7;
  color: #92400e;
}

.auto-order-pill-muted {
  background: #f1f5f9;
  color: #64748b;
}

.auto-order-pill-pending {
  background: #dbeafe;
  color: #1d4ed8;
}

.auto-order-steps {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.5rem;
}

.auto-order-steps li {
  line-height: 1.5;
}

.auto-order-table-wrap {
  overflow-x: auto;
  margin-top: 0.75rem;
}

.auto-order-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.auto-order-table th,
.auto-order-table td {
  padding: 0.55rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}

.auto-order-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #64748b);
  background: #f8fafc;
}

.auto-order-rules-table,
.auto-order-examples-table {
  max-width: 520px;
}

.auto-order-skip-list {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  color: #475569;
}

.auto-order-runs-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.auto-order-run-row {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fafbfc;
}

.auto-order-run-row summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  list-style: none;
}

.auto-order-run-row summary::-webkit-details-marker {
  display: none;
}

.auto-order-run-when {
  font-weight: 600;
}

.auto-order-run-stat {
  margin-left: auto;
}

.auto-order-run-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid #e2e8f0;
}

.auto-order-product-list {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.88rem;
}

.auto-order-run-errors {
  margin: 0.5rem 0 0;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .auto-order-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auto-order-facts {
    grid-template-columns: 1fr;
  }

  .auto-order-facts-compact {
    grid-template-columns: 1fr;
  }

  .auto-order-run-stat {
    margin-left: 0;
    width: 100%;
  }
}

.ai-preview-draft-list {
  display: grid;
  gap: 1rem;
}

.ai-preview-draft {
  padding: 1rem 1.1rem;
}

.ai-preview-draft.is-excluded {
  opacity: 0.65;
}

.ai-preview-draft-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.65rem;
}

.ai-preview-body {
  margin: 0 0 0.5rem;
  line-height: 1.5;
}

.ai-gen-handle-hint {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
}

.ai-gen-handle-hint code {
  font-size: 0.85rem;
}

.ai-gen-brand-note {
  margin: -0.25rem 0 0.5rem;
}

.ai-gen-randomize-wrap {
  margin: 0 0 0.15rem;
}

.ai-gen-randomize-btn {
  font-size: 0.88rem;
}

.ai-gen-image-picker {
  display: grid;
  gap: 0.75rem;
}

.ai-gen-image-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.ai-gen-image-card {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border, #e8eaee);
  background: #f8f9fb;
}

.ai-gen-image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ai-gen-image-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.78);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.ai-gen-image-remove:hover {
  background: #111;
}

.ai-gen-image-add {
  width: fit-content;
  cursor: pointer;
}

.ai-gen-image-note {
  margin: 0;
  font-size: 0.85rem;
}

.ai-gen-job-usage {
  margin: 0.75rem 0 0.35rem;
}

.ai-gen-job-usage-grid {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ai-gen-job-usage-grid > div {
  background: var(--surface-2, #f6f7f9);
  border-radius: 10px;
  display: grid;
  gap: 0.15rem;
  padding: 0.65rem 0.75rem;
}

.ai-gen-job-usage-grid span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.ai-gen-job-usage-grid strong {
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.ai-gen-job-usage-grid small {
  color: var(--muted);
  font-size: 0.72rem;
}

.ai-gen-job-usage-note {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
  margin: 0.55rem 0 0;
  text-align: center;
}

/* â”€â”€â”€ Premium design system polish â”€â”€â”€ */

.settings-main {
  gap: var(--space-2);
}

.settings-layout {
  gap: var(--space-2);
}

.settings-card h2 {
  font-size: var(--type-section);
  font-weight: var(--fw-bold);
  letter-spacing: -0.025em;
  line-height: var(--lh-tight);
  margin-bottom: var(--space-1);
}

.settings-card-intro {
  color: var(--muted);
  font-size: var(--type-body-sm);
  font-weight: var(--fw-regular);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--space-2);
}

.settings-card-compact {
  padding: var(--space-2) var(--space-3);
}

.settings-step {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.settings-step-num {
  background: var(--accent-subtle);
  color: var(--accent);
}

.settings-copy-btn {
  background: var(--panel);
  border-color: var(--line-strong);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  padding: 0.4rem 0.75rem;
}

.settings-copy-btn:hover {
  background: var(--surface);
  border-color: var(--accent-muted);
  color: var(--accent);
}

.data-row:hover {
  background: var(--accent-subtle);
}

.sc-list-card,
.shopify-check-card {
  box-shadow: var(--shadow-sm);
}

.dash-stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--space-3);
}

.dash-stat-accent .dash-stat-value {
  color: var(--accent);
}

.dash-stat-success .dash-stat-value {
  color: var(--success);
}

.dash-stat-warning .dash-stat-value {
  color: var(--warning);
}

.shell-context {
  background: var(--bg);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  padding: var(--space-1) var(--shell-pad) var(--space-2);
}

/* Settings dashboard â€” scroll layout + legacy sidebar */
.app-setup-dashboard {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.app-setup-sticky-nav {
  margin-bottom: var(--space-3);
  position: sticky;
  top: calc(var(--setup-sticky-top) + 4.25rem);
  z-index: 25;
}

.app-setup-sticky-nav-track {
  background: var(--surface);
  border-radius: var(--radius);
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  padding: 0.3rem;
  scrollbar-width: none;
}

.app-setup-sticky-nav-track::-webkit-scrollbar {
  display: none;
}

.app-setup-sticky-nav-link {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  flex: 0 0 auto;
  font-size: var(--type-body-sm);
  font-weight: var(--fw-medium);
  line-height: var(--lh-snug);
  padding: 0.45rem 0.75rem;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}

.app-setup-sticky-nav-link:hover {
  background: var(--panel);
  color: var(--text);
}

.app-setup-sticky-nav-link.is-active {
  background: var(--panel);
  border-color: var(--line);
  box-shadow: var(--shadow-xs);
  color: var(--text);
  font-weight: var(--fw-semibold);
}

.app-setup-sticky-nav-link.is-active::before {
  background: var(--accent);
  border-radius: 999px;
  content: "";
  display: inline-block;
  height: 6px;
  margin-right: 0.4rem;
  vertical-align: 0.05em;
  width: 6px;
}

.app-setup-scroll-main {
  display: flex;
  flex-direction: column;
  gap: var(--layout-section-gap);
  padding-bottom: var(--space-6);
}

.app-setup-scroll-section {
  scroll-margin-top: calc(var(--setup-sticky-top) + 8.75rem);
}

.app-setup-scroll-section-head {
  margin: 0 0 var(--layout-head-gap);
}

.app-setup-scroll-section-title {
  color: var(--text);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
  line-height: var(--lh-tight);
  margin: 0;
}

.app-setup-scroll-section-body > .settings-dashboard-form,
.app-setup-scroll-section-body > form {
  margin: 0;
}

@media (max-width: 760px) {
  .app-setup-sticky-nav {
    top: calc(var(--setup-sticky-top) + 3.5rem);
  }

  .app-setup-scroll-section {
    scroll-margin-top: calc(var(--setup-sticky-top) + 7.5rem);
  }
}

.app-setup-mode-tabs {
  display: inline-flex;
  gap: var(--space-1);
  padding: 0.25rem;
  background: var(--surface);
  border-radius: var(--radius);
  width: fit-content;
}

.app-setup-mode-tab {
  align-items: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  font-family: inherit;
  font-size: var(--type-body-sm);
  font-weight: var(--fw-medium);
  gap: 0.45rem;
  line-height: var(--lh-snug);
  padding: 0.55rem 0.85rem;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.app-setup-mode-tab .ico {
  color: var(--muted);
}

.app-setup-mode-tab:hover {
  background: var(--panel);
  color: var(--text);
}

.app-setup-mode-tab.is-active {
  background: var(--panel);
  box-shadow: var(--shadow-xs);
  color: var(--text);
  font-weight: var(--fw-semibold);
}

.app-setup-mode-tab.is-active .ico {
  color: var(--accent);
}

.settings-dashboard {
  align-items: start;
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 420px;
}

.settings-dashboard-sidebar {
  position: sticky;
  top: calc(var(--space-8) + 48px);
}

.settings-dashboard-nav-list {
  background: transparent;
  border: none;
  box-shadow: none;
  display: grid;
  gap: var(--space-1);
  padding: 0;
}

.settings-dashboard-nav-item {
  align-items: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  gap: 0.55rem;
  line-height: 1.35;
  padding: 0.55rem 0.65rem;
  text-align: left;
  transition: background var(--transition), color var(--transition);
  width: 100%;
}

.settings-dashboard-nav-item .ico {
  color: var(--muted);
  flex-shrink: 0;
}

.settings-dashboard-nav-item:hover {
  background: var(--surface);
  color: var(--text);
}

.settings-dashboard-nav-item.is-active {
  background: var(--accent-subtle);
  color: var(--accent);
  font-weight: 600;
}

.settings-dashboard-nav-item.is-active .ico {
  color: var(--accent);
}

.settings-dashboard-main {
  min-width: 0;
}

.settings-dashboard-panel {
  animation: fadeIn 0.18s ease;
  display: none;
}

.settings-dashboard-panel.is-active {
  display: block;
}

.settings-dashboard-panel .card {
  margin-bottom: var(--space-2);
}

.settings-dashboard-panel .card:last-child {
  margin-bottom: 0;
}

.settings-dashboard-form {
  display: block;
}

.settings-dashboard-form > .settings-dashboard-panel {
  margin-bottom: 0;
}

.settings-dashboard-savebar {
  background: linear-gradient(180deg, rgba(250, 250, 251, 0) 0%, var(--bg) 28%);
  bottom: 0;
  margin-top: var(--space-2);
  padding: var(--space-2) 0 var(--space-1);
  position: sticky;
  z-index: 2;
}

@media (max-width: 900px) {
  .settings-dashboard {
    grid-template-columns: 1fr;
  }

  .settings-dashboard-sidebar {
    position: static;
  }

  .settings-dashboard-nav-list {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

/* App setup sticky header */
.app-setup-header {
  align-items: flex-end;
  backdrop-filter: blur(12px);
  background: rgba(250, 250, 251, 0.92);
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  justify-content: space-between;
  margin-bottom: var(--space-5);
  padding: var(--space-3) 0 var(--space-4);
  position: sticky;
  top: var(--setup-sticky-top);
  z-index: 30;
}

.app-setup-header-body {
  flex: 1 1 280px;
  min-width: 0;
}

.app-setup-title {
  font-size: var(--type-display);
  font-weight: var(--fw-bold);
  letter-spacing: -0.03em;
  line-height: var(--lh-tight);
  margin: 0;
}

.app-setup-subtitle {
  color: var(--muted);
  font-size: var(--type-body-sm);
  font-weight: var(--fw-regular);
  line-height: var(--lh-relaxed);
  margin: 0.4rem 0 0;
  max-width: 52ch;
}

.app-setup-eyebrow {
  color: var(--accent);
  font-size: var(--type-overline);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.08em;
  margin: 0 0 var(--space-1);
  text-transform: uppercase;
}

.app-setup-last-saved {
  color: var(--muted);
  font-size: var(--type-caption);
  font-variant-numeric: tabular-nums;
  font-weight: var(--fw-regular);
  line-height: var(--lh-snug);
  white-space: nowrap;
}

.app-setup-header-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  justify-content: flex-end;
}

.app-setup-status-badge {
  border: none;
  border-radius: 999px;
  display: inline-flex;
  font-size: var(--type-caption);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.02em;
  line-height: var(--lh-snug);
  padding: 0.32rem 0.65rem;
  white-space: nowrap;
}

.app-setup-status-badge.is-live {
  background: var(--success-subtle);
  color: #047857;
}

.app-setup-status-badge.is-off {
  background: var(--surface);
  color: var(--text-secondary);
}

.app-setup-status-badge.is-pending {
  background: var(--warning-subtle);
  color: #b45309;
}

.app-setup-header [data-settings-save] {
  min-width: 8.5rem;
}

@media (max-width: 760px) {
  .app-setup-header {
    align-items: stretch;
    flex-direction: column;
  }

  .app-setup-header-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .app-setup-header [data-settings-save] {
    margin-left: auto;
  }
}

/* â”€â”€â”€ Settings section cards (collapsible) + typography hierarchy â”€â”€â”€ */

.settings-section-stack {
  display: flex;
  flex-direction: column;
  gap: var(--layout-stack-gap);
}

.settings-section-card {
  background: var(--panel);
  border: 1px solid transparent;
  border-radius: var(--radius);
  box-shadow: none;
  overflow: hidden;
  transition:
    border-color var(--motion-base),
    box-shadow var(--motion-base),
    transform var(--motion-base);
}

@media (hover: hover) and (pointer: fine) {
  .settings-section-card:hover {
    border-color: var(--line);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
  }
}

.settings-section-card-head {
  margin: 0;
}

.settings-section-card-toggle {
  align-items: flex-start;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  display: flex;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  text-align: left;
  transition: background var(--motion-base);
  width: 100%;
}

.settings-section-card-toggle:hover {
  background: color-mix(in srgb, var(--surface) 65%, transparent);
}

.settings-section-card-toggle:active {
  transform: scale(0.998);
}

.settings-section-card-toggle:focus-visible {
  box-shadow: var(--focus-ring);
  outline: none;
}

.settings-section-card-icon {
  align-items: center;
  background: transparent;
  border-radius: 0;
  color: var(--muted);
  display: flex;
  flex-shrink: 0;
  height: auto;
  justify-content: center;
  padding-top: 0.15rem;
  transition: color var(--motion-base), transform var(--motion-spring);
  width: auto;
}

.settings-section-card-toggle:hover .settings-section-card-icon {
  color: var(--accent);
  transform: scale(1.06);
}

.settings-section-card-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  padding-top: 0.1rem;
}

.settings-section-card-title {
  color: var(--text);
  font-size: var(--type-section);
  font-weight: var(--fw-bold);
  letter-spacing: -0.025em;
  line-height: var(--lh-tight);
}

.settings-section-card-desc {
  color: var(--muted);
  font-size: var(--type-body-sm);
  font-weight: var(--fw-regular);
  line-height: var(--lh-relaxed);
}

.settings-section-card-desc code {
  font-size: 0.72rem;
  font-weight: var(--fw-medium);
}

.settings-section-card-chevron {
  color: var(--muted);
  flex-shrink: 0;
  margin-top: 4px;
  transition: transform var(--motion-spring), color var(--motion-base);
}

.settings-section-card-toggle:hover .settings-section-card-chevron {
  color: var(--text-secondary);
}

.settings-section-card[data-collapsed="true"] .settings-section-card-chevron {
  transform: rotate(-90deg);
}

.settings-section-card-body {
  animation: polishReveal 0.32s ease both;
  display: flex;
  flex-direction: column;
  gap: var(--layout-field-gap);
  padding: 0 var(--space-5) var(--space-5);
}

.settings-section-card[data-collapsed="true"] .settings-section-card-body {
  animation: none;
  display: none;
}

/* â”€â”€â”€ Advanced settings disclosure â”€â”€â”€ */

.settings-advanced-section {
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
}

.settings-advanced-section-head {
  margin: 0;
}

.settings-advanced-section-toggle {
  align-items: flex-start;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  display: flex;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  text-align: left;
  width: 100%;
}

.settings-advanced-section-toggle:hover {
  background: color-mix(in srgb, var(--surface) 70%, var(--panel) 30%);
}

.settings-advanced-section-toggle:focus-visible {
  outline: 2px solid var(--accent-muted);
  outline-offset: -2px;
}

.settings-advanced-section-icon {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-shrink: 0;
  padding-top: 0.1rem;
}

.settings-advanced-section-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.settings-advanced-section-title {
  color: var(--text);
  font-size: var(--type-body);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.01em;
  line-height: var(--lh-tight);
}

.settings-advanced-section-desc {
  color: var(--muted);
  font-size: var(--type-body-sm);
  font-weight: var(--fw-regular);
  line-height: var(--lh-relaxed);
}

.settings-advanced-section-chevron {
  color: var(--muted);
  flex-shrink: 0;
  margin-top: 2px;
  transition: transform 0.2s ease;
}

.settings-advanced-section[data-collapsed="true"] .settings-advanced-section-chevron {
  transform: rotate(-90deg);
}

.settings-advanced-section-body {
  border-top: 1px dashed var(--line);
  padding: var(--space-4) var(--space-5) var(--space-5);
}

.settings-advanced-section[data-collapsed="true"] .settings-advanced-section-body {
  display: none;
}

.settings-advanced-section-body .settings-section-stack {
  gap: var(--layout-stack-gap);
}

.settings-advanced-section-body .settings-section-card {
  background: var(--panel);
}

.settings-section-card-body > .settings-card-intro:first-child {
  margin-top: 0;
}

/* â”€â”€â”€ Settings notice cards (info / success / warning / tip) â”€â”€â”€ */

.settings-notice-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.settings-notice {
  align-items: flex-start;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-2);
}

.settings-notice-icon {
  align-items: center;
  border-radius: var(--radius-sm);
  display: flex;
  flex-shrink: 0;
  height: 2rem;
  justify-content: center;
  margin-top: 0.05rem;
  width: 2rem;
}

.settings-notice-icon .ico {
  opacity: 1;
}

.settings-notice-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.settings-notice-title {
  color: var(--text);
  font-size: var(--type-body-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.01em;
  line-height: var(--lh-snug);
  margin: 0;
}

.settings-notice-text {
  color: var(--text-secondary);
  font-size: var(--type-body-sm);
  font-weight: var(--fw-regular);
  line-height: var(--lh-relaxed);
  margin: 0;
}

.settings-notice-text code {
  font-size: 0.78rem;
  font-weight: var(--fw-medium);
}

.settings-notice-text a {
  color: inherit;
  font-weight: var(--fw-medium);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 0.12em;
}

.settings-notice-text a:hover {
  color: var(--text);
}

.settings-notice.is-info {
  background: color-mix(in srgb, var(--accent) 7%, var(--panel));
  border-color: color-mix(in srgb, var(--accent) 18%, var(--line));
}

.settings-notice.is-info .settings-notice-icon {
  background: var(--accent-subtle);
  color: var(--accent);
}

.settings-notice.is-success {
  background: var(--success-subtle);
  border-color: color-mix(in srgb, var(--success) 24%, var(--line));
}

.settings-notice.is-success .settings-notice-icon {
  background: color-mix(in srgb, var(--success) 12%, var(--panel));
  color: #047857;
}

.settings-notice.is-success .settings-notice-text {
  color: #065f46;
}

.settings-notice.is-warning {
  background: var(--warning-subtle);
  border-color: color-mix(in srgb, var(--warning) 28%, var(--line));
}

.settings-notice.is-warning .settings-notice-icon {
  background: color-mix(in srgb, var(--warning) 12%, var(--panel));
  color: #b45309;
}

.settings-notice.is-warning .settings-notice-text {
  color: #92400e;
}

.settings-notice.is-error {
  background: var(--danger-subtle);
  border-color: color-mix(in srgb, var(--danger) 24%, var(--line));
}

.settings-notice.is-error .settings-notice-icon {
  background: color-mix(in srgb, var(--danger) 10%, var(--panel));
  color: #b91c1c;
}

.settings-notice.is-error .settings-notice-text {
  color: #991b1b;
}

.settings-notice.is-tip {
  background: color-mix(in srgb, #6366f1 6%, var(--panel));
  border-color: color-mix(in srgb, #6366f1 16%, var(--line));
}

.settings-notice.is-tip .settings-notice-icon {
  background: color-mix(in srgb, #6366f1 10%, var(--panel));
  color: #4f46e5;
}

.shopify-theme-install-card .settings-notice-stack {
  margin-bottom: var(--space-2);
}

.shopify-check-card > .settings-notice:first-of-type {
  margin-bottom: var(--space-3);
}

.shopify-check-card > .settings-notice:last-of-type {
  margin-top: var(--space-3);
}

.settings-section-card-body > .settings-notice-stack:first-child,
.settings-section-card-body > .settings-notice:first-child,
.shopify-theme-install-card > .settings-notice-stack:first-of-type,
.shopify-check-card > .settings-notice-stack:first-of-type {
  margin-top: 0;
}

.settings-section-card-body .settings-notice-stack {
  margin-bottom: var(--space-1);
}

.settings-advanced-section-body .settings-notice-stack {
  margin-top: var(--space-1);
}

.shopify-theme-install-foot.settings-notice {
  margin-top: var(--space-2);
}

.settings-section-card-body .settings-subheading-sm {
  margin-top: var(--space-1);
}

.settings-dashboard-panel .settings-section-stack {
  max-width: 100%;
}

/* Settings page typography â€” scoped to dashboard + setup header */
.settings-dashboard,
.app-setup-header {
  font-size: var(--type-body);
  line-height: var(--lh-normal);
}

.settings-dashboard .settings-card-intro,
.settings-section-card-body .settings-card-intro {
  color: var(--muted);
  font-size: var(--type-body-sm);
  font-weight: var(--fw-regular);
  line-height: var(--lh-relaxed);
  margin: 0 0 var(--space-3);
}

.settings-dashboard .settings-card-intro:last-child,
.settings-section-card-body .settings-card-intro:last-child {
  margin-bottom: 0;
}

.settings-dashboard .settings-card-intro strong,
.settings-section-card-body .settings-card-intro strong {
  color: var(--text-secondary);
  font-weight: var(--fw-semibold);
}

.settings-dashboard .settings-subheading,
.settings-section-card-body .settings-subheading {
  color: var(--text);
  font-size: var(--type-body);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.015em;
  line-height: var(--lh-snug);
  margin: var(--space-3) 0 var(--space-2);
}

.settings-dashboard .settings-subheading-sm,
.settings-section-card-body .settings-subheading-sm {
  color: var(--muted);
  font-size: var(--type-overline);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.06em;
  line-height: var(--lh-snug);
  margin: var(--space-2) 0 var(--space-1);
  text-transform: uppercase;
}

.settings-dashboard .field-label,
.settings-dashboard label > .field-label,
.settings-section-card .field-label {
  color: var(--text-secondary);
  font-size: var(--type-body-sm);
  font-weight: var(--fw-medium);
  letter-spacing: -0.01em;
  line-height: var(--lh-snug);
}

.settings-dashboard .sc-field-hint,
.settings-section-card .sc-field-hint {
  color: var(--muted);
  font-size: var(--type-caption);
  font-weight: var(--fw-regular);
  line-height: var(--lh-relaxed);
  margin: -0.25rem 0 0.65rem;
}

.settings-dashboard .settings-toggle-label {
  color: var(--text);
  font-size: var(--type-body-sm);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
}

.settings-dashboard .settings-step strong {
  color: var(--text);
  display: block;
  font-size: var(--type-body);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.015em;
  line-height: var(--lh-snug);
  margin-bottom: 0.15rem;
}

.settings-dashboard .settings-step p {
  color: var(--muted);
  font-size: var(--type-body-sm);
  font-weight: var(--fw-regular);
  line-height: var(--lh-relaxed);
  margin: 0;
}

.settings-dashboard .settings-step p small {
  font-size: var(--type-caption);
  line-height: var(--lh-relaxed);
}

.settings-dashboard .settings-code-header span {
  color: var(--text);
  font-size: var(--type-body-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.01em;
  line-height: var(--lh-snug);
}

.settings-dashboard .settings-checklist li {
  color: var(--text-secondary);
  font-size: var(--type-body-sm);
  font-weight: var(--fw-regular);
  line-height: var(--lh-relaxed);
}

.settings-dashboard-nav-item {
  font-size: var(--type-body-sm);
  font-weight: var(--fw-medium);
  line-height: var(--lh-snug);
}

.settings-dashboard-nav-item.is-active {
  font-weight: var(--fw-semibold);
}

.settings-dashboard .settings-store-keys .field-label {
  font-size: var(--type-caption);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* â”€â”€â”€ Clean setup UI â€” whitespace over borders â”€â”€â”€ */

.settings-dashboard {
  gap: var(--space-4);
}

.settings-dashboard-nav-item.is-active {
  background: var(--surface);
}

.settings-dashboard .settings-field-grid,
.settings-section-card .settings-field-grid {
  gap: var(--space-2);
}

.settings-dashboard .settings-step,
.settings-section-card .settings-step {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.settings-dashboard .settings-steps,
.settings-section-card .settings-steps {
  gap: var(--space-4);
  margin-bottom: var(--space-3);
}

.settings-dashboard .settings-step-num,
.settings-section-card .settings-step-num {
  background: var(--accent-subtle);
  border: none;
  color: var(--accent);
}

.settings-dashboard .settings-step code,
.settings-section-card .settings-step code {
  background: var(--surface);
  border: none;
}

.app-setup-top-row {
  gap: var(--space-4);
  margin-bottom: 0;
}

.app-setup-top-row .card,
.app-setup-top-row .shopify-theme-install-card,
.app-setup-top-row .reviews-store-scope-card {
  background: var(--panel);
  border: none;
  box-shadow: none;
  margin-bottom: 0;
  padding: var(--space-5);
}

.app-setup-top-row .settings-status-badge {
  border: none;
}

.settings-dashboard-panel .card {
  background: transparent;
  border: none;
  box-shadow: none;
  margin-bottom: 0;
  padding: 0;
}

.settings-dashboard .settings-code-header {
  margin-bottom: var(--space-1);
}

.settings-dashboard .settings-snippets .code-snippet-card + .code-snippet-card {
  margin-top: var(--space-3);
  padding-top: 0;
  border-top: none;
}

.settings-dashboard .settings-store-keys,
.settings-section-card .settings-store-keys {
  border-top: none;
  gap: var(--space-3);
  margin-top: var(--space-3);
  padding-top: 0;
}

.settings-dashboard .shopify-theme-install-card.is-busy {
  border: none;
  box-shadow: none;
}

/* â”€â”€â”€ Settings responsive grids (1 â†’ 2 â†’ 3 columns) â”€â”€â”€ */

@media (min-width: 640px) {
  .settings-field-grid,
  .settings-toggle-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .settings-dashboard .settings-field-grid,
  .settings-dashboard .settings-toggle-grid,
  .settings-section-card .settings-field-grid,
  .settings-section-card .settings-toggle-grid,
  .settings-form .settings-field-grid,
  .settings-form .settings-toggle-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.settings-section-card-body .settings-subheading-sm {
  grid-column: 1 / -1;
}

/* Premium inputs â€” settings scope polish */
.settings-dashboard .field-control > input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
.settings-dashboard .field-control > select,
.settings-dashboard .field-control > textarea,
.settings-section-card .field-control > input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
.settings-section-card .field-control > select,
.settings-section-card .field-control > textarea,
.settings-form .field-control > input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
.settings-form .field-control > select,
.settings-form .field-control > textarea {
  background: var(--input-bg);
}

.settings-form input[type="file"] {
  background: var(--surface);
  border: 1px dashed var(--input-border);
  border-radius: var(--input-radius);
  cursor: pointer;
  font-size: var(--type-body-sm);
  padding: var(--space-2);
  transition: var(--input-transition);
}

.settings-form input[type="file"]:hover {
  border-color: var(--input-border-hover);
  background: var(--panel);
}

.settings-form input[type="file"]:focus {
  border-color: var(--input-focus-border);
  box-shadow: var(--input-focus-ring);
  outline: none;
}

/* â”€â”€â”€ Code snippet cards (documentation) â”€â”€â”€ */

.settings-snippets .code-snippet-card + .code-snippet-card {
  margin-top: var(--space-2);
}

.code-snippet-card {
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.code-snippet-card:hover {
  border-color: color-mix(in srgb, var(--line) 70%, var(--accent) 30%);
}

.code-snippet-toolbar {
  align-items: center;
  background: var(--surface);
  display: flex;
  gap: var(--space-1);
  justify-content: space-between;
  min-height: 44px;
  padding: 0.35rem 0.5rem 0.35rem 0.35rem;
}

.code-snippet-toggle {
  align-items: center;
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex: 1;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.35rem 0.5rem;
  text-align: left;
}

.code-snippet-toggle:hover {
  color: var(--accent);
}

.code-snippet-chevron {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.code-snippet-card[data-collapsed="false"] .code-snippet-chevron {
  transform: rotate(0deg);
}

.code-snippet-card[data-collapsed="true"] .code-snippet-chevron {
  transform: rotate(-90deg);
}

.code-snippet-meta {
  align-items: center;
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  min-width: 0;
}

.code-snippet-filename {
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  padding: 0.2rem 0.45rem;
  white-space: nowrap;
}

.code-snippet-desc {
  color: var(--muted);
  font-size: var(--type-body-sm);
  font-weight: 500;
  line-height: var(--lh-tight);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-snippet-actions {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  gap: 0.25rem;
}

.code-snippet-action {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font-size: var(--btn-font-size-sm);
  font-weight: var(--btn-font-weight);
  gap: 0.35rem;
  line-height: 1;
  min-height: var(--btn-height-sm);
  padding: 0 0.55rem;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.code-snippet-action:hover {
  background: var(--surface-elevated);
  border-color: var(--line);
  color: var(--text);
}

.code-snippet-action:active {
  transform: scale(0.98);
}

.code-snippet-action svg {
  flex-shrink: 0;
  opacity: 0.85;
}

.code-snippet-body {
  border-top: 1px solid var(--line);
  position: relative;
}

.code-snippet-card[data-collapsed="true"] .code-snippet-body {
  display: none;
}

.code-snippet-display {
  background: var(--code-surface);
  border: none;
  border-radius: 0;
  color: #e4e4e7;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.76rem;
  font-weight: 450;
  line-height: 1.6;
  margin: 0;
  overflow-x: auto;
  padding: 1rem 1.1rem;
  tab-size: 2;
  white-space: pre;
}

.code-snippet-display code {
  display: block;
  font: inherit;
}

.code-snippet-body.is-clamped:not(.is-expanded) .code-snippet-display {
  max-height: 11.5rem;
  overflow: hidden;
}

.code-snippet-body.is-clamped:not(.is-expanded)::after {
  background: linear-gradient(180deg, transparent 0%, var(--code-surface) 88%);
  bottom: 0;
  content: "";
  height: 3rem;
  left: 0;
  pointer-events: none;
  position: absolute;
  right: 0;
}

.code-snippet-body.is-expanded .code-snippet-display {
  max-height: none;
  overflow-x: auto;
}

.code-snippet-body.is-expanded::after {
  display: none;
}

.code-snippet-display .tok-comment {
  color: #71717a;
  font-style: italic;
}

.code-snippet-display .tok-tag {
  color: #c4b5fd;
}

.code-snippet-display .tok-output {
  color: #7dd3fc;
}

.code-snippet-display .tok-string {
  color: #86efac;
}

.code-snippet-display .tok-keyword {
  color: #f9a8d4;
}

.code-snippet-display .tok-number {
  color: #fcd34d;
}

.code-snippet-display .tok-builtin {
  color: #fdba74;
}

/* â”€â”€â”€ Settings status badges (setup & admin) â”€â”€â”€ */

.settings-status-badge {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-secondary);
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 600;
  gap: 0.38rem;
  letter-spacing: 0.01em;
  line-height: 1;
  padding: 0.28rem 0.62rem 0.28rem 0.45rem;
  vertical-align: middle;
  white-space: nowrap;
}

.settings-status-dot {
  background: currentColor;
  border-radius: 50%;
  box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 16%, transparent);
  flex-shrink: 0;
  height: 6px;
  width: 6px;
}

.settings-status-label {
  line-height: 1.2;
}

.settings-status-badge.is-installed {
  background: var(--success-subtle);
  border-color: color-mix(in srgb, var(--success) 24%, var(--line));
  color: #047857;
}

.settings-status-badge.is-not-installed {
  background: var(--surface);
  border-color: var(--line);
  color: var(--muted);
}

.settings-status-badge.is-connected {
  background: var(--success-subtle);
  border-color: color-mix(in srgb, var(--success) 24%, var(--line));
  color: #047857;
}

.settings-status-badge.is-disabled {
  background: #f4f4f5;
  border-color: var(--line);
  color: #71717a;
}

.settings-status-badge.is-warning {
  background: var(--warning-subtle);
  border-color: color-mix(in srgb, var(--warning) 28%, var(--line));
  color: #b45309;
}

.settings-status-badge.is-error {
  background: var(--danger-subtle);
  border-color: color-mix(in srgb, var(--danger) 28%, var(--line));
  color: #b91c1c;
}

.shopify-theme-install-status .settings-status-badge,
.shopify-check-table td .settings-status-badge,
.shopify-check-meta dd .settings-status-badge {
  max-width: 100%;
}

.app-setup-header-actions .settings-status-badge {
  flex-shrink: 0;
}

.dash-stat-value .settings-status-badge {
  font-size: 0.74rem;
}

.status-badge {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-secondary);
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 600;
  gap: 0.38rem;
  letter-spacing: 0.01em;
  line-height: 1;
  padding: 0.28rem 0.62rem 0.28rem 0.45rem;
  white-space: nowrap;
}

/* â”€â”€â”€ Visual polish â€” motion, elevation, skeletons, micro-interactions â”€â”€â”€ */

@keyframes polishReveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes polishShimmer {
  from {
    background-position: 200% 0;
  }

  to {
    background-position: -200% 0;
  }
}

@keyframes polishSpin {
  to {
    transform: rotate(360deg);
  }
}

html.is-ui-loading [data-app-setup-scroll] .app-setup-sticky-nav,
html.is-ui-loading [data-app-setup-scroll] .app-setup-scroll-main {
  opacity: 0;
  pointer-events: none;
}

html.is-ui-ready [data-app-setup-scroll] .app-setup-sticky-nav,
html.is-ui-ready [data-app-setup-scroll] .app-setup-scroll-main {
  animation: polishReveal 0.42s ease both;
}

html.is-ui-ready [data-app-setup-scroll] .app-setup-scroll-section {
  animation: polishReveal 0.48s ease both;
}

html.is-ui-ready [data-app-setup-scroll] .app-setup-scroll-section:nth-child(1) { animation-delay: 0.04s; }
html.is-ui-ready [data-app-setup-scroll] .app-setup-scroll-section:nth-child(2) { animation-delay: 0.08s; }
html.is-ui-ready [data-app-setup-scroll] .app-setup-scroll-section:nth-child(3) { animation-delay: 0.12s; }
html.is-ui-ready [data-app-setup-scroll] .app-setup-scroll-section:nth-child(4) { animation-delay: 0.16s; }
html.is-ui-ready [data-app-setup-scroll] .app-setup-scroll-section:nth-child(5) { animation-delay: 0.2s; }
html.is-ui-ready [data-app-setup-scroll] .app-setup-scroll-section:nth-child(6) { animation-delay: 0.24s; }
html.is-ui-ready [data-app-setup-scroll] .app-setup-scroll-section:nth-child(n + 7) { animation-delay: 0.28s; }

html.is-ui-ready [data-app-setup-scroll] .settings-section-stack > .settings-section-card {
  animation: polishReveal 0.4s ease both;
}

html.is-ui-ready [data-app-setup-scroll] .settings-section-stack > .settings-section-card:nth-child(1) { animation-delay: 0.06s; }
html.is-ui-ready [data-app-setup-scroll] .settings-section-stack > .settings-section-card:nth-child(2) { animation-delay: 0.1s; }
html.is-ui-ready [data-app-setup-scroll] .settings-section-stack > .settings-section-card:nth-child(3) { animation-delay: 0.14s; }
html.is-ui-ready [data-app-setup-scroll] .settings-section-stack > .settings-section-card:nth-child(n + 4) { animation-delay: 0.18s; }

.app-setup-dashboard {
  position: relative;
}

.app-setup-skeleton {
  display: grid;
  gap: var(--layout-stack-gap);
  inset: 0;
  pointer-events: none;
  position: absolute;
  transition: opacity var(--motion-slow), visibility var(--motion-slow);
  z-index: 20;
}

html.is-ui-ready .app-setup-skeleton {
  opacity: 0;
  visibility: hidden;
}

.ui-skeleton {
  animation: polishShimmer 1.35s ease-in-out infinite;
  background: linear-gradient(
    90deg,
    var(--surface) 0%,
    color-mix(in srgb, var(--surface) 55%, var(--panel)) 45%,
    var(--surface) 90%
  );
  background-size: 200% 100%;
  border-radius: var(--radius-md);
}

.ui-skeleton-nav {
  border-radius: var(--radius);
  height: 2.75rem;
}

.ui-skeleton-title {
  height: 1.35rem;
  max-width: 12rem;
  width: 42%;
}

.ui-skeleton-card {
  height: 7.5rem;
}

.ui-skeleton-short {
  height: 5rem;
  max-width: 72%;
}

.card,
.metric,
.settings-notice,
.code-snippet-card,
.shopify-theme-install-card,
.shopify-check-card,
.settings-advanced-section {
  transition:
    border-color var(--motion-base),
    box-shadow var(--motion-base),
    transform var(--motion-base);
}

@media (hover: hover) and (pointer: fine) {
  .card:hover,
  .metric:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
  }

  .settings-notice:hover {
    box-shadow: var(--shadow-xs);
    transform: translateY(-1px);
  }

  .code-snippet-card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-sm);
  }

  .shopify-theme-install-card:hover,
  .shopify-check-card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
  }

  .settings-advanced-section:hover {
    border-color: color-mix(in srgb, var(--accent) 18%, var(--line-strong));
  }
}

.app-setup-sticky-nav-link {
  transition:
    background var(--motion-base),
    border-color var(--motion-base),
    box-shadow var(--motion-base),
    color var(--motion-base),
    transform var(--motion-fast);
}

.app-setup-sticky-nav-link:hover {
  transform: translateY(-1px);
}

.app-setup-sticky-nav-link:active {
  transform: translateY(0);
}

.app-setup-sticky-nav-link:focus-visible {
  box-shadow: var(--focus-ring);
  outline: none;
}

.settings-advanced-section-toggle {
  transition: background var(--motion-base);
}

.settings-advanced-section-toggle:hover {
  background: color-mix(in srgb, var(--surface) 70%, var(--panel) 30%);
}

.settings-advanced-section-toggle:focus-visible {
  box-shadow: var(--focus-ring);
  outline: none;
}

.settings-toggle-ui::after {
  transition: transform var(--motion-spring), background var(--motion-base);
}

.settings-toggle:active .settings-toggle-ui::after {
  width: 1.35rem;
}

.code-snippet-action:focus-visible,
.code-snippet-toggle:focus-visible {
  box-shadow: var(--focus-ring);
  outline: none;
}

.code-snippet-action.is-copied {
  background: var(--success-subtle);
  border-color: color-mix(in srgb, var(--success) 28%, var(--line));
  color: #047857;
}

.code-snippet-action.is-copied svg {
  color: #047857;
}

.button.is-saving,
button.is-saving {
  color: transparent !important;
  pointer-events: none;
  position: relative;
}

.button.is-saving .ico,
button.is-saving .ico {
  opacity: 0;
}

.button.is-saving::after,
button.is-saving::after {
  animation: polishSpin 0.65s linear infinite;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  border-top-color: #ffffff;
  content: "";
  height: 1rem;
  left: 50%;
  margin: -0.5rem 0 0 -0.5rem;
  position: absolute;
  top: 50%;
  width: 1rem;
}

.button.secondary.is-saving::after,
button.secondary.is-saving::after,
.button.ghost.is-saving::after,
button.ghost.is-saving::after {
  border-color: rgba(9, 9, 11, 0.12);
  border-top-color: var(--accent);
}

.shell-content a:not(.button):not(.app-setup-sticky-nav-link):not(.shell-nav-link):focus-visible {
  border-radius: var(--radius-xs);
  box-shadow: var(--focus-ring);
  outline: none;
}

[data-app-setup-scroll] form.is-submitting {
  opacity: 0.72;
  pointer-events: none;
  transition: opacity var(--motion-base);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .card:hover,
  .metric:hover,
  .settings-section-card:hover,
  .settings-notice:hover,
  .shopify-theme-install-card:hover,
  .shopify-check-card:hover,
  .app-setup-sticky-nav-link:hover {
    transform: none;
  }
}

/* Photo review cards â€” admin manager */
.prc-admin-panel {
  --prc-gold: #ffc152;
  --prc-gold-light: #ffeabc;
  --prc-gold-pale: #fff6e3;
  display: grid;
  gap: var(--space-5, 1.5rem);
  font-family: inherit;
}

.prc-admin-panel * {
  box-sizing: border-box;
}

.prc-admin-status {
  margin: 0;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md, 10px);
  font-size: 0.84rem;
  background: #ecfdf3;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.prc-admin-status.is-error {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.prc-admin-add-tile {
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  width: min(78vw, 220px);
}

.prc-admin-add-card {
  display: block;
  cursor: pointer;
  margin: 0;
}

.prc-admin-add-card input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.prc-store-card--add {
  border: 1.5px dashed var(--border, #e4e4e7);
  box-shadow: none;
  background: var(--surface-2, #fafafa);
  transition: border-color var(--motion-base, 0.15s ease), background var(--motion-base, 0.15s ease);
}

.prc-admin-add-card:hover .prc-store-card--add,
.prc-admin-add-card:focus-within .prc-store-card--add {
  border-color: var(--accent, #901a2e);
  background: #fff;
}

.prc-store-card-media--add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  text-align: center;
  padding: 1rem;
  color: var(--text-muted, #71717a);
  background: transparent;
}

.prc-store-card--add.is-uploading .prc-store-card-media--add {
  opacity: 0.55;
  pointer-events: none;
}

.prc-admin-add-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text, #18181b);
}

.prc-admin-add-hint {
  font-size: 0.72rem;
  line-height: 1.35;
  max-width: 12rem;
}

.prc-admin-section {
  display: grid;
  gap: var(--space-3, 0.85rem);
}

.prc-admin-section-head h2 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.prc-admin-section-head p {
  margin: 0;
  font-size: 0.84rem;
}

.prc-admin-queue {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3, 0.85rem);
  align-items: flex-start;
}

.prc-admin-preview-track {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.25rem 0.15rem 1rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.prc-admin-preview-track::-webkit-scrollbar {
  height: 6px;
}

.prc-admin-preview-track::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 999px;
}

.prc-admin-draft-wrap,
.prc-admin-preview-wrap {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  scroll-snap-align: start;
}

.prc-admin-draft-wrap {
  width: min(68vw, 220px);
}

.prc-admin-preview-wrap {
  width: 258px;
}

.prc-store-card {
  --prc-gold: #ffc152;
  --prc-gold-light: #ffeabc;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 193, 82, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  font-family: inherit;
  color: inherit;
}

.prc-store-card-media {
  position: relative;
  flex: 0 0 auto;
  aspect-ratio: 5 / 6;
  overflow: hidden;
  background: #f3f3f3;
}

.prc-store-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.prc-store-card-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 68%;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.03) 14%,
    rgba(255, 255, 255, 0.1) 28%,
    rgba(255, 255, 255, 0.22) 42%,
    rgba(255, 255, 255, 0.38) 54%,
    rgba(255, 255, 255, 0.56) 64%,
    rgba(255, 255, 255, 0.74) 76%,
    rgba(255, 255, 255, 0.9) 88%,
    #fff 96%,
    #fff 100%
  );
  pointer-events: none;
}

.prc-store-card-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  display: inline-block;
  width: max-content;
  max-width: calc(100% - 16px);
  padding: 3px 7px;
  border-radius: 2px;
  background: #fff;
  color: #1a1a1a;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.prc-store-card-content {
  position: relative;
  z-index: 2;
  margin-top: -3.5rem;
  padding: 0 14px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  font-family: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, 0.35) 1.4rem, rgba(255, 255, 255, 0.72) 2.4rem, #fff 3.2rem);
}

.prc-store-card-content--draft {
  margin-top: -2rem;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.55rem;
  min-height: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, 0.35) 1rem, rgba(255, 255, 255, 0.72) 1.8rem, #fff 2.5rem);
}

.prc-store-draft-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted, #71717a);
  text-align: center;
}

.prc-store-generate-btn {
  width: 100%;
  justify-content: center;
}

.prc-store-stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 0 0 16px;
  line-height: 0;
}

.prc-store-star {
  width: 18px;
  height: 18px;
  display: block;
}

.prc-store-quote-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 4px 0 0 20px;
  margin-top: 2px;
}

.prc-store-quote-mark--open {
  position: absolute;
  left: -3px;
  top: -12px;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 44px;
  font-weight: 400;
  line-height: 1;
  color: #f5c878;
  pointer-events: none;
  z-index: 1;
}

.prc-store-quote-body {
  margin: 0;
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.5;
  color: #4a4a4a;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prc-store-divider {
  display: block;
  height: 1px;
  margin: 12px 0 14px;
  background: var(--prc-gold-light);
  border: 0;
}

.prc-store-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
}

.prc-store-author {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.prc-store-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  color: #1a1a1a;
  background: var(--prc-gold);
}

.prc-store-avatar-img {
  object-fit: cover;
  padding: 0;
  border: 0;
  background: #f3f4f6;
}

.akilli-profile-photo-ring {
  --ring-size: 34px;
  --ring-pad: 2px;
  --ring-gap: 2.5px;
  width: var(--ring-size);
  height: var(--ring-size);
  flex: 0 0 var(--ring-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: var(--ring-pad);
  background: linear-gradient(45deg, #f09433 0%, #e6683c 20%, #dc2743 45%, #cc2366 70%, #bc1888 100%);
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.akilli-profile-photo-ring-gap {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  padding: var(--ring-gap);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
}

.akilli-profile-photo-ring-face {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

.akilli-profile-photo-ring-shield {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  z-index: 1;
  background: transparent;
}

.prc-store-author-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.prc-store-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prc-store-verified {
  font-size: 11px;
  font-weight: 400;
  line-height: 1.25;
  color: #888;
}

.prc-store-arrow {
  font-size: 14px;
  line-height: 1;
  color: var(--prc-gold-light);
  flex: 0 0 auto;
  padding-bottom: 1px;
}

.prc-admin-draft-remove {
  width: 100%;
  justify-content: center;
}

.prc-admin-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.prc-admin-social-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
  width: 100%;
  margin-bottom: 0.15rem;
  font-size: 0.72rem;
  color: var(--muted, #666);
}

.prc-admin-social-summary strong {
  color: var(--text, #111);
}

.prc-admin-social-missing {
  width: 100%;
  margin: 0 0 0.15rem;
  font-size: 0.72rem;
}

.prc-admin-product {
  width: 100%;
  margin: 0.35rem 0;
}

.prc-admin-product-search {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  font: inherit;
  font-size: 0.78rem;
}

.prc-admin-product-results {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 180px;
  overflow: auto;
  margin-top: 0.35rem;
}

.prc-admin-product-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.35rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.prc-admin-product-option-thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  overflow: hidden;
  background: #f3f4f6;
  flex: 0 0 auto;
}

.prc-admin-product-option-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.prc-admin-product-option-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.prc-admin-product-option-meta strong {
  font-size: 0.74rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prc-admin-product-option-meta code {
  font-size: 0.66rem;
}

.prc-admin-product-current {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
}

.prc-admin-preview-actions .button {
  flex: 1 1 auto;
  justify-content: center;
}

.prc-admin-empty {
  margin: 0;
  padding: 0.75rem 0;
  width: 100%;
}

@media (min-width: 750px) {
  .prc-admin-draft-wrap {
    width: 220px;
  }

  .prc-admin-preview-wrap {
    width: 258px;
  }
}

/* Product groups product picker */
.pg-picker {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.pg-picker-search {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line, rgba(0,0,0,.12));
  border-radius: 10px;
  font: inherit;
}
.pg-picker-results {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 240px;
  overflow: auto;
  padding: 0.35rem;
  border: 1px solid var(--line, rgba(0,0,0,.08));
  border-radius: 12px;
  background: var(--surface, #fafafa);
}
.pg-picker-option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 10px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.pg-picker-option:hover:not(:disabled) {
  border-color: rgba(88, 70, 200, 0.35);
}
.pg-picker-option.is-added,
.pg-picker-option:disabled {
  opacity: 0.65;
  cursor: default;
}
.pg-picker-option-thumb {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
  flex: 0 0 auto;
}
.pg-picker-option-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pg-picker-option-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}
.pg-picker-option-meta strong {
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pg-picker-option-meta code {
  font-size: 0.72rem;
  color: #6b7280;
}
.pg-picker-option-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: #5846c8;
  flex: 0 0 auto;
}
.pg-picker-selected {
  margin-top: 0.25rem;
}
.pg-picker-selected-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.pg-picker-empty {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
}
.pg-picker-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.pg-picker-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 12px;
  background: #fff;
  cursor: grab;
  user-select: none;
}
.pg-picker-card.is-dragging {
  opacity: 0.55;
  cursor: grabbing;
}
.pg-picker-card.is-drag-over {
  border-color: #5846c8;
  box-shadow: 0 0 0 2px rgba(88, 70, 200, 0.15);
}
.pg-picker-card-grip {
  color: #9ca3af;
  letter-spacing: -2px;
  font-size: 0.85rem;
  line-height: 1;
  flex: 0 0 auto;
}
.pg-picker-card-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
  flex: 0 0 auto;
}
.pg-picker-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pg-picker-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
  flex: 1;
}
.pg-picker-card-meta strong {
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pg-picker-card-meta code {
  font-size: 0.72rem;
  color: #6b7280;
}
.pg-picker-card-remove {
  flex: 0 0 auto;
}
.pg-picker-handles {
  display: none !important;
}

/* Product groups AI color detect */
.pg-btn-loader {
  display: none;
  width: 1em;
  height: 1em;
  margin-left: 0.55rem;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  vertical-align: -0.15em;
  animation: pg-spin .7s linear infinite;
}
.button.is-loading .pg-btn-loader {
  display: inline-block;
}
.button.secondary.is-loading .pg-btn-loader,
.button.ghost.is-loading .pg-btn-loader {
  border-color: rgba(88,70,200,.25);
  border-top-color: #5846c8;
}
.button.is-loading {
  opacity: 0.85;
  cursor: wait;
}
@keyframes pg-spin {
  to { transform: rotate(360deg); }
}
.pg-group-detect {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
}
.pg-bulk-detect-status {
  margin: 0;
  font-size: 0.86rem;
}
.pg-bulk-detect-status.is-success {
  color: #0f766e;
  font-weight: 600;
}
.pg-bulk-detect-status.is-error {
  color: #b91c1c;
  font-weight: 600;
}

/* Product groups panel hide */
.pg-group-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}
.pg-inline-form {
  display: inline;
  margin: 0;
}
.pg-hidden-groups {
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px dashed rgba(0,0,0,.14);
  border-radius: 12px;
  background: #fafafa;
}
.pg-hidden-groups-summary {
  cursor: pointer;
  font-weight: 650;
  list-style: none;
}
.pg-hidden-groups-summary::-webkit-details-marker {
  display: none;
}
.pg-hidden-groups-summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 0.45rem;
  transition: transform .15s ease;
}
.pg-hidden-groups[open] > .pg-hidden-groups-summary::before {
  transform: rotate(90deg);
}

/* Product group admin previews */
.pg-group-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.pg-group-card {
  padding: 0.85rem 1rem;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 14px;
  background: #fff;
}
.pg-group-card--hidden {
  background: #fafafa;
  border-style: dashed;
}
.pg-group-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}
.pg-group-card-head strong {
  font-size: 1.02rem;
}
.pg-group-card-head .muted {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
}
.pg-admin-preview {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.55rem;
  overflow-x: auto;
  padding: 0.15rem 0 0.25rem;
  scrollbar-width: thin;
}
.pg-admin-preview--empty {
  padding: 0.5rem 0;
}
.pg-admin-preview-card {
  flex: 0 0 86px;
  width: 86px;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.pg-admin-preview-img {
  display: block;
  width: 86px;
  height: 104px;
  background: #f3f4f6;
}
.pg-admin-preview-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pg-admin-preview-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 4px 5px;
  background: #fff;
  min-height: 22px;
}
.pg-admin-preview-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
  flex: 0 0 auto;
}
.pg-admin-preview-text {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.1;
  color: #222;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 68px;
}
.pg-admin-preview-more {
  flex: 0 0 auto;
  align-self: center;
  font-size: 0.8rem;
  padding: 0 0.35rem;
}


/* Hex color text fields */
.hex-color-field {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
}
.hex-color-swatch {
  flex: 0 0 auto;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.14);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
}
.hex-color-input {
  flex: 1 1 auto;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.hex-color-field.is-invalid-hex .hex-color-swatch {
  background: repeating-linear-gradient(45deg, #eee, #eee 4px, #fff 4px, #fff 8px) !important;
}
.hex-color-field.is-invalid-hex .hex-color-input {
  border-color: #b91c1c;
}
.settings-field-grid .hex-color-field input.hex-color-input {
  height: auto;
  min-height: 2.5rem;
}

/* Widget health monitor */
.wh-core,
.wh-stores {
  display: grid;
  gap: 0.85rem;
}
.wh-store-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: #fff;
}
.wh-store-card.wh-fail {
  border-color: rgba(185, 28, 28, 0.35);
  background: #fff7f7;
}
.wh-store-card.wh-slow {
  border-color: rgba(180, 120, 20, 0.35);
  background: #fffbeb;
}
.wh-store-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}
.wh-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: #eef2ff;
  color: #3730a3;
}
.wh-ok .wh-badge,
.wh-store-card.wh-ok .wh-badge {
  background: #ecfdf5;
  color: #047857;
}
.wh-slow .wh-badge,
.wh-store-card.wh-slow .wh-badge {
  background: #fffbeb;
  color: #b45309;
}
.wh-fail .wh-badge,
.wh-store-card.wh-fail .wh-badge {
  background: #fef2f2;
  color: #b91c1c;
}
.wh-checks {
  display: grid;
  gap: 0.4rem;
}
.wh-check {
  display: grid;
  grid-template-columns: minmax(7rem, 1fr) 5rem 5.5rem minmax(10rem, 2fr);
  gap: 0.5rem;
  align-items: center;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.03);
  font-size: 0.86rem;
}
.wh-check.wh-ok {
  background: rgba(16, 185, 129, 0.08);
}
.wh-check.wh-slow {
  background: rgba(245, 158, 11, 0.12);
}
.wh-check.wh-fail {
  background: rgba(239, 68, 68, 0.1);
}
.wh-check-name {
  font-weight: 600;
  text-transform: lowercase;
}
.wh-check-ms,
.wh-check-code {
  font-variant-numeric: tabular-nums;
  color: #4b5563;
}
.wh-check-detail {
  color: #374151;
}
@media (max-width: 900px) {
  .wh-check {
    grid-template-columns: 1fr 1fr;
  }
  .wh-check-detail {
    grid-column: 1 / -1;
  }
}

/* Buy 1 Get 1 product picker */
.bogo-picker {
  display: grid;
  gap: 1rem;
}
.bogo-store-hint {
  margin: 0;
}
.bogo-selected-wrap,
.bogo-search-wrap {
  display: grid;
  gap: 0.45rem;
}
.bogo-section-label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
}
.bogo-search {
  width: 100%;
  min-height: 2.6rem;
}
.bogo-search-results {
  display: grid;
  gap: 0.4rem;
  max-height: 280px;
  overflow: auto;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 0.45rem;
  background: #fafafa;
}
.bogo-result {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  background: #fff;
  color: #111;
  cursor: pointer;
  font: inherit;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
}
.bogo-result:hover {
  border-color: rgba(88, 70, 200, 0.35);
  background: #fff;
  color: #111;
}
.bogo-result.is-selected {
  opacity: 0.7;
  cursor: default;
  background: #f8f8f8;
}
.bogo-result-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
  flex: 0 0 auto;
}
.bogo-result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.bogo-result-meta {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}
.bogo-result-meta strong {
  font-size: 0.92rem;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bogo-result-meta code,
.bogo-card-meta code {
  font-size: 0.75rem;
  color: #6b7280;
}
.bogo-result-action {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 650;
  color: #5846c8;
  flex: 0 0 auto;
}
.bogo-result.is-selected .bogo-result-action {
  color: #6b7280;
}
.bogo-selected {
  display: grid;
  gap: 0.45rem;
}
.bogo-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  background: #fff;
}
.bogo-card-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
  flex: 0 0 auto;
}
.bogo-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.bogo-card-meta {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}
.bogo-card-meta strong {
  font-size: 0.95rem;
  color: #111;
}
.bogo-card-remove {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
  color: #6b7280;
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  box-shadow: none;
}
.bogo-card-remove:hover {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.35);
}
.bogo-search-empty {
  margin: 0.25rem;
}
.bogo-search-empty.is-error {
  color: #b91c1c;
}
.bogo-handles-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}


