/* Auto-Reply Studio — v4 (5-tab) + v5 (feedback-loop) overlay
   Mounted into #autoReplyPanel by autoreply-studio.js
   Uses project CSS variables (--bg, --surface, --border, --text, --text2, --accent...) when available,
   falls back to v4 design tokens. */

#autoReplyPanel.ar-studio-mounted .panel-scroll-content { display: none !important; }

.ar-studio {
  --ar-bg: var(--bg, #FAFAF7);
  --ar-surface: var(--surface, #FFFFFF);
  --ar-surface-2: var(--surface-2, #F4F4EE);
  --ar-border: var(--border, #E8E6DD);
  --ar-border-strong: #D4D2C7;
  --ar-text: var(--text, #18181B);
  --ar-text2: var(--text2, #71717A);
  --ar-text3: var(--text3, #A1A1AA);
  --ar-accent: var(--accent, #4F46E5);
  --ar-accent-hover: #4338CA;
  --ar-accent-soft: #EEF2FF;
  --ar-accent-border: #C7D2FE;
  --ar-success: #16a34a;
  --ar-success-soft: #F0FDF4;
  --ar-warn: #D97706;
  --ar-warn-soft: #FFFBEB;
  --ar-danger: #DC2626;
  --ar-danger-soft: #FEF2F2;
  --ar-pink: #EC4899;
  --ar-pink-soft: #FDF2F8;
  --ar-pink-border: #FBCFE8;

  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  color: var(--ar-text);
  font-size: 14px;
  line-height: 1.5;
  font-feature-settings: 'cv11', 'ss01';
}

[data-theme="dark"] .ar-studio {
  --ar-accent-soft: rgba(129,140,248,0.16);
  --ar-accent-border: rgba(129,140,248,0.35);
  --ar-success-soft: rgba(22,163,74,0.18);
  --ar-warn-soft: rgba(217,119,6,0.18);
  --ar-danger-soft: rgba(220,38,38,0.18);
  --ar-pink-soft: rgba(236,72,153,0.16);
  --ar-pink-border: rgba(236,72,153,0.4);
  --ar-border-strong: #3a3a44;
}

/* Focus styles for accessibility */
.ar-studio button:focus-visible,
.ar-studio select:focus-visible,
.ar-studio input:focus-visible,
.ar-studio textarea:focus-visible,
.ar-studio [tabindex="0"]:focus-visible {
  outline: 2px solid var(--ar-accent);
  outline-offset: 2px;
}
.ar-studio button:focus:not(:focus-visible) { outline: none; }

.ar-studio * { box-sizing: border-box; }

/* Status banner */
.ar-status {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--ar-accent-soft) 0%, var(--ar-surface) 100%);
  border: 1px solid var(--ar-accent-border);
  border-radius: 14px;
  flex-wrap: wrap;
}
.ar-status-orb {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--ar-accent-soft);
  position: relative; flex-shrink: 0; overflow: hidden;
}
.ar-status-orb::before, .ar-status-orb::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(6px);
  animation: arOrb 7s ease-in-out infinite;
}
.ar-status-orb::before {
  width: 55%; height: 55%; top: 15%; left: 10%;
  background: var(--ar-accent); opacity: 0.9;
}
.ar-status-orb::after {
  width: 40%; height: 40%; bottom: 10%; right: 8%;
  background: var(--ar-accent); opacity: 0.5;
  animation-delay: -3s;
}
@keyframes arOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(18%, -12%) scale(1.08); }
  66% { transform: translate(-12%, 14%) scale(0.92); }
}
.ar-status-text { flex: 1; min-width: 200px; }
.ar-status-text b { font-size: 14.5px; font-weight: 700; }
.ar-status-text .sub { font-size: 12.5px; color: var(--ar-text2); margin-top: 2px; }
.ar-status-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* Chip */
.ar-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 500;
  background: var(--ar-surface-2); color: var(--ar-text2);
  border: 1px solid var(--ar-border);
}
.ar-chip-ok { background: var(--ar-success-soft); color: var(--ar-success); border-color: rgba(22,163,74,0.25); }
.ar-chip-warn { background: var(--ar-warn-soft); color: var(--ar-warn); border-color: rgba(217,119,6,0.25); }
.ar-chip-pink { background: var(--ar-pink-soft); color: #9D174D; border-color: var(--ar-pink-border); }

/* Pulse */
.ar-pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ar-success);
  animation: arpulse 1.8s ease-out infinite;
}
@keyframes arpulse {
  0% { box-shadow: 0 0 0 0 rgba(22,163,74,0.5); }
  70% { box-shadow: 0 0 0 9px rgba(22,163,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); }
}

/* Switch */
.ar-switch { position: relative; display: inline-block; width: 38px; height: 22px; }
.ar-switch input { opacity: 0; width: 0; height: 0; }
.ar-switch-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #d4d4d4; border-radius: 22px; transition: 0.2s;
}
.ar-switch-slider::before {
  content: ''; position: absolute;
  height: 18px; width: 18px; left: 2px; top: 2px;
  background: #fff; border-radius: 50%; transition: 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.ar-switch input:checked + .ar-switch-slider { background: var(--ar-accent); }
.ar-switch input:checked + .ar-switch-slider::before { transform: translateX(16px); }

/* Buttons */
.ar-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 8px;
  border: 1px solid var(--ar-border-strong);
  background: var(--ar-surface); color: var(--ar-text);
  font-size: 13px; font-weight: 500; font-family: inherit;
  cursor: pointer; transition: all 0.15s;
}
.ar-btn:hover { background: var(--ar-surface-2); }
.ar-btn-primary { background: var(--ar-accent); color: #fff; border-color: transparent; }
.ar-btn-primary:hover { background: var(--ar-accent-hover); }
.ar-btn-pink { background: var(--ar-pink); color: #fff; border-color: transparent; }
.ar-btn-pink:hover { filter: brightness(0.95); }
.ar-btn-ghost { background: transparent; border-color: transparent; color: var(--ar-text2); }
.ar-btn-ghost:hover { background: var(--ar-surface-2); color: var(--ar-text); }
.ar-btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }

/* KPI strip */
.ar-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.ar-kpi {
  background: var(--ar-surface);
  border: 1px solid var(--ar-border);
  border-radius: 10px;
  padding: 14px 16px;
}
.ar-kpi-label {
  font-size: 10.5px; font-weight: 700;
  color: var(--ar-text3); text-transform: uppercase; letter-spacing: 0.5px;
}
.ar-kpi-value {
  font-size: 28px; font-weight: 700;
  letter-spacing: -0.02em; margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.ar-kpi-delta { font-size: 11.5px; color: var(--ar-text2); margin-top: 2px; }
.ar-kpi-delta.up { color: var(--ar-success); }
.ar-spark { display: flex; align-items: flex-end; gap: 2px; height: 28px; margin-top: 8px; }
.ar-spark span { flex: 1; background: var(--ar-accent); opacity: 0.85; border-radius: 1px; }

/* Tabs */
.ar-tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--ar-border);
  margin: 0 24px;
  padding-top: 14px;
  flex-shrink: 0;
}
.ar-tab {
  padding: 10px 14px;
  border: none; background: transparent;
  color: var(--ar-text2);
  font-size: 13px; font-weight: 500; font-family: inherit;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: inline-flex; align-items: center; gap: 6px;
}
.ar-tab:hover { color: var(--ar-text); }
.ar-tab.on { color: var(--ar-text); border-bottom-color: var(--ar-accent); font-weight: 600; }

.ar-tab-body {
  flex: 1;
  overflow: auto;
  padding: 18px 24px 32px;
}

/* Section header */
.ar-section-h {
  display: flex; align-items: center; justify-content: space-between;
  margin: 4px 0 10px;
}
.ar-section-h h3 {
  margin: 0;
  font-size: 12.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--ar-text2);
}

/* Card */
.ar-card {
  background: var(--ar-surface);
  border: 1px solid var(--ar-border);
  border-radius: 10px;
  padding: 16px;
}
.ar-card-tight { padding: 12px; }
.ar-card-title { font-size: 14px; font-weight: 700; }
.ar-card-sub { font-size: 12.5px; color: var(--ar-text2); margin-top: 2px; }

/* Filter pills */
.ar-filter-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ar-filter-pill {
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--ar-border);
  background: var(--ar-surface);
  font-size: 12px; font-weight: 500; font-family: inherit;
  color: var(--ar-text2); cursor: pointer;
}
.ar-filter-pill:hover { background: var(--ar-surface-2); }
.ar-filter-pill.on {
  background: var(--ar-text); color: var(--ar-surface);
  border-color: var(--ar-text);
}

/* Stars */
.ar-stars { color: #F59E0B; letter-spacing: 1px; font-size: 12px; }
.ar-stars-empty { color: #D4D4D8; }

/* Tone pill */
.ar-tone-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 500;
}
.ar-tone-professional { background: #EFF6FF; color: #1D4ED8; }
.ar-tone-friendly     { background: #FEF3C7; color: #B45309; }
.ar-tone-emotional    { background: #FCE7F3; color: #BE185D; }
.ar-tone-formal       { background: #F1F5F9; color: #334155; }
.ar-tone-official     { background: #F1F5F9; color: #334155; }
.ar-tone-custom       { background: var(--ar-accent-soft); color: var(--ar-accent); }

/* Feed item */
.ar-feed-item {
  display: grid; grid-template-columns: 36px 1fr; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ar-border);
}
.ar-feed-item:last-child { border-bottom: none; }
.ar-feed-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--ar-accent-soft); color: var(--ar-accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.ar-feed-head {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin-bottom: 2px;
}
.ar-feed-author { font-size: 13.5px; font-weight: 600; }
.ar-feed-meta { font-size: 11.5px; color: var(--ar-text3); }
.ar-feed-product { font-size: 12px; color: var(--ar-text2); margin: 2px 0 6px; }
.ar-feed-review { font-size: 13.5px; color: var(--ar-text); }
.ar-feed-reply {
  margin-top: 10px; padding: 10px 12px;
  background: var(--ar-accent-soft);
  border-radius: 8px;
  border-left: 3px solid var(--ar-accent);
  font-size: 13px; white-space: pre-line;
}
.ar-feed-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.ar-fix-btn {
  border-color: var(--ar-pink-border) !important;
  background: var(--ar-pink-soft) !important;
  color: #9D174D !important;
}

/* Tone cards (Skills tab) */
.ar-tone-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
}
.ar-tone-card {
  padding: 12px; border: 1px solid var(--ar-border);
  border-radius: 10px;
  background: var(--ar-surface);
  cursor: pointer; transition: all 0.15s;
}
.ar-tone-card:hover { border-color: var(--ar-border-strong); }
.ar-tone-card.on {
  border-color: var(--ar-accent);
  background: var(--ar-accent-soft);
}
.ar-tone-card-name {
  font-size: 13px; font-weight: 700; margin-bottom: 4px;
  display: flex; align-items: center; gap: 6px;
}
.ar-tone-card-example {
  font-size: 11.5px; color: var(--ar-text2);
  font-style: italic; line-height: 1.4;
}

/* Word tags */
.ar-word {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 6px;
  font-size: 11.5px; font-weight: 500;
}
.ar-word-stop { background: var(--ar-danger-soft); color: var(--ar-danger); }
.ar-word-anchor { background: var(--ar-success-soft); color: var(--ar-success); }
.ar-word .x { cursor: pointer; opacity: 0.6; }
.ar-word .x:hover { opacity: 1; }

/* Shop card */
.ar-shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.ar-shop-card {
  background: var(--ar-surface);
  border: 1px solid var(--ar-border);
  border-radius: 10px;
  padding: 14px;
  transition: border 0.15s, box-shadow 0.15s;
}
.ar-shop-card:hover {
  border-color: var(--ar-border-strong);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.ar-shop-card.on {
  border-color: var(--ar-accent-border);
  background: linear-gradient(180deg, var(--ar-surface) 0%, var(--ar-accent-soft) 200%);
}
.ar-shop-card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px;
}
.ar-shop-card-name { font-size: 14px; font-weight: 700; }
.ar-shop-card-id {
  font-size: 11px; color: var(--ar-text3);
  font-variant-numeric: tabular-nums;
}
.ar-shop-card-sig {
  margin-top: 10px; font-size: 12px; color: var(--ar-text2);
  padding: 6px 8px;
  background: var(--ar-surface-2);
  border-radius: 6px;
  font-style: italic;
}
.ar-shop-card-sig input {
  width: 100%;
  background: transparent; border: none; outline: none;
  font: inherit; color: inherit;
  font-style: normal;
  padding: 0;
}
.ar-primary-tag {
  font-size: 9.5px; font-weight: 700;
  padding: 1px 5px; border-radius: 4px;
  background: var(--ar-accent); color: #fff;
  letter-spacing: 0.5px;
}

/* V5 — Pinned review context */
.ar-pinned {
  padding: 14px;
  background: var(--ar-pink-soft);
  border: 1px solid var(--ar-pink-border);
  border-radius: 10px;
  margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 12px;
}
.ar-pinned-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--ar-pink); color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ar-pinned-body { flex: 1; min-width: 0; }
.ar-pinned-eyebrow {
  font-size: 10.5px; font-weight: 700;
  color: #9D174D; text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.ar-pinned-quote {
  font-size: 12.5px; font-style: italic;
  color: var(--ar-text2); margin: 6px 0;
}
.ar-pinned-reply {
  font-size: 12.5px;
  padding: 8px 10px;
  background: var(--ar-surface);
  border-radius: 6px;
  white-space: pre-line;
  border: 1px solid var(--ar-border);
  line-height: 1.5;
}

/* V5 — Side-by-side */
.ar-diff {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; margin: 14px 0;
}
.ar-diff-col-head {
  font-size: 10.5px; font-weight: 700;
  color: var(--ar-text3); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 6px;
  display: flex; align-items: center; gap: 5px;
}
.ar-diff-col-head.new { color: #9D174D; }
.ar-diff-col {
  padding: 12px;
  background: var(--ar-surface);
  border-radius: 8px;
  border: 1px solid var(--ar-border);
  font-size: 12.5px; line-height: 1.55; white-space: pre-line;
  color: var(--ar-text2);
}
.ar-diff-col.new {
  border-color: var(--ar-pink-border);
  border-left-width: 3px;
  border-left-color: var(--ar-pink);
  color: var(--ar-text);
}

/* V5 — CTA bar */
.ar-cta-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px;
  background: var(--ar-pink-soft);
  border: 1px solid var(--ar-pink-border);
  border-radius: 10px;
  flex-wrap: wrap;
}
.ar-cta-bar > .label { flex: 1; font-size: 13px; min-width: 200px; }

/* Suggested rule card */
.ar-rule-suggest {
  padding: 16px; margin-bottom: 14px;
  background: var(--ar-surface);
  border: 1px solid var(--ar-pink-border);
  border-left: 3px solid var(--ar-pink);
  border-radius: 10px;
  display: flex; align-items: flex-start; gap: 12px;
}
.ar-rule-suggest-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--ar-pink); color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* History table */
.ar-history-tbl {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.ar-history-tbl thead th {
  background: var(--ar-surface-2);
  text-align: left; color: var(--ar-text2);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px;
  padding: 10px 14px; font-weight: 600;
}
.ar-history-tbl tbody tr { border-top: 1px solid var(--ar-border); }
.ar-history-tbl td { padding: 10px 14px; }
.ar-history-tbl td.time {
  color: var(--ar-text3);
  font-variant-numeric: tabular-nums;
}
.ar-history-tbl td.preview {
  color: var(--ar-text2);
  max-width: 280px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Inputs */
.ar-input, .ar-textarea, .ar-select {
  width: 100%;
  padding: 9px 11px;
  font-size: 13.5px; font-family: inherit;
  color: var(--ar-text);
  background: var(--ar-surface);
  border: 1px solid var(--ar-border);
  border-radius: 8px;
  outline: none;
  transition: border 0.12s, box-shadow 0.12s;
}
.ar-input:focus, .ar-textarea:focus, .ar-select:focus {
  border-color: var(--ar-accent);
  box-shadow: 0 0 0 3px var(--ar-accent-soft);
}
.ar-textarea { resize: vertical; min-height: 64px; line-height: 1.5; }
.ar-label {
  font-size: 11.5px; font-weight: 600;
  color: var(--ar-text2); text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: 14px 0 6px;
  display: block;
}
.ar-label:first-child { margin-top: 0; }

/* ────────────── Аналитика layout ────────────── */
.ar-analytics-wrap { margin: -18px -24px 0; }
.ar-analytics-topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--ar-border);
  background: var(--ar-surface);
  flex-wrap: wrap;
}
.ar-analytics-kpibar {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 14px; align-items: center;
  padding: 14px 24px;
  background: var(--ar-surface);
  border-bottom: 1px solid var(--ar-border);
}
.ar-period-pills { display: flex; gap: 4px; }
.ar-filter-pill.pink {
  background: var(--ar-pink) !important;
  border-color: var(--ar-pink) !important;
  color: #fff !important;
}
.ar-analytics-body {
  display: grid;
  grid-template-columns: 380px 1fr;
  min-height: 500px;
}
.ar-analytics-left {
  border-right: 1px solid var(--ar-border);
  overflow: auto;
  background: var(--ar-surface);
  max-height: calc(100vh - 240px);
}
.ar-analytics-list-header {
  padding: 12px 16px; border-bottom: 1px solid var(--ar-border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: var(--ar-surface); z-index: 1;
}
.ar-analytics-list-row {
  padding: 12px 16px;
  border-bottom: 1px solid var(--ar-border);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.12s;
}
.ar-analytics-list-row:hover { background: var(--ar-surface-2); }
.ar-analytics-list-row.selected {
  background: var(--ar-pink-soft);
  border-left-color: var(--ar-pink);
}
.ar-analytics-right {
  overflow: auto;
  padding: 18px 24px;
  max-height: calc(100vh - 240px);
}
.ar-sku-emoji {
  width: 42px; height: 42px; border-radius: 8px;
  background: var(--ar-surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.ar-sku-emoji-lg {
  width: 64px; height: 64px; border-radius: 10px;
  background: var(--ar-surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; flex-shrink: 0;
}
.ar-sku-header {
  display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px;
  flex-wrap: wrap;
}
.ar-defect-alert {
  padding: 14px;
  background: var(--ar-danger-soft);
  border: 1px solid #FECACA;
  border-radius: 10px; margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 12px;
}
[data-theme="dark"] .ar-defect-alert { border-color: rgba(220,38,38,0.35); }
.ar-analytics-charts {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px; margin-bottom: 16px;
}
.ar-ai-suggest {
  padding: 12px;
  background: var(--ar-pink-soft);
  border-radius: 8px;
  display: flex; align-items: flex-start; gap: 10px;
}
.ar-ai-suggest.defect {
  background: var(--ar-danger-soft);
  border: 1px solid #FECACA;
}
[data-theme="dark"] .ar-ai-suggest.defect { border-color: rgba(220,38,38,0.35); }
.ar-ai-suggest-icon {
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--ar-pink); color: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ────────────── Toast ────────────── */
.ar-toast { font-family: 'Inter', -apple-system, system-ui, sans-serif; }
[data-theme="dark"] .ar-toast {
  background: #f4f4f5 !important;
  color: #18181B !important;
}

/* ────────────── Hidden helpers ────────────── */
.ar-hidden-legacy { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Like state */
.ar-btn.liked { color: var(--ar-success); }

/* ────────────── Responsive ────────────── */
@media (max-width: 960px) {
  .ar-analytics-body { grid-template-columns: 1fr; }
  .ar-analytics-left {
    max-height: 320px;
    border-right: none;
    border-bottom: 1px solid var(--ar-border);
  }
  .ar-analytics-right { max-height: none; }
  .ar-analytics-kpibar { grid-template-columns: repeat(2, 1fr); }
  .ar-analytics-kpibar .ar-period-pills {
    grid-column: span 2; justify-content: center; margin-top: 4px;
  }
  .ar-analytics-charts { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .ar-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .ar-diff { grid-template-columns: 1fr; }
  .ar-tabs { margin: 0 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .ar-tab { white-space: nowrap; }
  .ar-tab-body { padding: 14px 12px 24px; }
  .ar-status-actions { width: 100%; justify-content: flex-start; }
  .ar-analytics-wrap { margin: -14px -12px 0; }
  .ar-analytics-topbar, .ar-analytics-kpibar { padding: 12px 14px; }
  .ar-analytics-right { padding: 14px; }
  .ar-shop-grid { grid-template-columns: 1fr; }
  .ar-history-tbl { font-size: 12px; }
  .ar-history-tbl thead th, .ar-history-tbl td { padding: 8px 10px; }
  .ar-cta-bar > .label { min-width: 100%; margin-bottom: 8px; }
}
@media (max-width: 480px) {
  .ar-kpi-grid { grid-template-columns: 1fr 1fr; }
  .ar-kpi-value { font-size: 22px; }
  .ar-status { flex-direction: column; align-items: flex-start; }
  .ar-status-orb { width: 36px; height: 36px; }
}


/* Feed skeleton loader — replaces the old MOCK fallback that flashed
   fake sellers/products while the real feed fetched. Static keyframe
   injected here so renderFeed can rely on it without inline <style>. */
@keyframes arSkeleton {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.ar-feed-skeleton > div { will-change: background-position; }

