/* ── Design tokens ───────────────────────────────────────────────── */
:root {
  --bg:           #f5f5f7;
  --surface:      #ffffff;
  --surface-2:    #f9f9fb;
  --border:       rgba(0,0,0,.07);
  --border-strong:rgba(0,0,0,.12);
  --text:         #1d1d1f;
  --text-2:       #6e6e73;
  --text-3:       #aeaeb2;
  --accent:       #6366f1;
  --accent-light: #eef2ff;
  --accent-hover: #4f46e5;
  --green:        #34c759;
  --green-bg:     #f0fdf4;
  --green-border: #bbf7d0;
  --red:          #ff3b30;
  --red-bg:       #fff1f2;
  --red-border:   #fecdd3;
  --orange:       #ff9f0a;
  --orange-bg:    #fff7ed;
  --blue:         #0071e3;
  --blue-bg:      #eff6ff;
  --purple:       #bf5af2;
  --purple-bg:    #faf5ff;
  --sidebar-bg:   #e8ecf2;
  --sidebar-text: #334155;
  --sidebar-muted:#64748b;
  --sidebar-hover:rgba(0,0,0,.06);
  --sidebar-active:rgba(99,102,241,.14);
  --budget-strip-h: 47px;
  --r-xs: 8px;
  --r-sm: 10px;
  --r:    14px;
  --r-lg: 18px;
  --r-xl: 22px;
  --shadow-xs: 0 1px 4px rgba(0,0,0,.06);
  --shadow:    0 2px 16px rgba(0,0,0,.07);
  --shadow-md: 0 8px 32px rgba(0,0,0,.10);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.14);
}

/* ── Reset ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Arial Rounded MT Bold', 'Arial Rounded MT', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: var(--accent); }
h1 { margin: 0 0 4px; font-size: 22px; font-weight: 700; letter-spacing: 0; }
h2 { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
h3 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
p  { margin: 0; }
button { cursor: pointer; font-family: inherit; }

/* ── App shell ───────────────────────────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: 100vh;
  min-width: 0;
}
.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  font-size: 20px;
  line-height: 1;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-scrim {
  display: none;
}

/* ── Sidebar ─────────────────────────────────────────────────────── */
.sidebar {
  background: var(--sidebar-bg);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  padding: 4px 10px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #818cf8, #6d28d9);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(109,40,217,.35);
}
.brand-icon svg { width: 20px; height: 20px; }
.brand-text { line-height: 1.15; }
.brand-text strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -.2px;
}
.brand-text small {
  font-size: 10px;
  color: var(--sidebar-muted);
  font-weight: 500;
  letter-spacing: .2px;
  text-transform: uppercase;
}
.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--sidebar-muted);
  padding: 14px 12px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--sidebar-text);
  font-weight: 500;
  font-size: 13.5px;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--sidebar-hover); color: #1e293b; }
.nav-item.active { background: var(--sidebar-active); color: #4338ca; font-weight: 600; }
.nav-item .icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  background: rgba(0,0,0,.06);
}
.nav-item.active .icon { background: rgba(99,102,241,.18); }
.nav-divider { height: 1px; background: rgba(0,0,0,.08); margin: 8px 4px; }
.logout-link {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: #dc2626;
  font-weight: 600;
  font-size: 13px;
  transition: background .15s;
}
.logout-link:hover { background: rgba(220,38,38,.1); color: #b91c1c; }

/* ── Main area ───────────────────────────────────────────────────── */
.main { padding: 0; overflow-y: auto; min-width: 0; scroll-padding-top: var(--budget-strip-h); }
.main-body { padding: 24px 28px 48px; }
.public-main { min-height: 100vh; display: grid; place-items: center; padding: 24px; }

/* ── Sticky budget strip (DeepSeek sold + Apify remaining) ───────── */
.budget-strip {
  position: sticky; top: 0; z-index: 100;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.45fr);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.ds-bar, .apify-bar {
  margin: 0;
  padding: 10px 22px;
  display: flex; align-items: center; gap: 12px;
  font-size: 13px;
  min-height: 46px;
  border-bottom: none;
  position: static;
  backdrop-filter: none;
  transition: background .25s, color .25s;
}
.ds-bar {
  text-decoration: none;
  color: inherit;
  border-right: 1px solid var(--border);
  background: var(--blue-bg); color: #1d4ed8;
}
.ds-bar-ico, .apify-bar-ico { font-size: 15px; line-height: 1; }
.ds-bar-label, .apify-bar-label { font-weight: 700; white-space: nowrap; }
.ds-bar-amount, .apify-bar-amount { white-space: nowrap; }
.ds-bar-amount strong, .apify-bar-amount strong { font-weight: 800; font-variant-numeric: tabular-nums; }
.ds-bar-note {
  font-size: 11px; opacity: .85; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.ds-bar-cta {
  margin-left: auto; white-space: nowrap; font-size: 12px; font-weight: 700;
  text-decoration: underline;
}
.ds-bar.ok { background: var(--green-bg); color: #15803d; }
.ds-bar.crit {
  background: var(--red-bg); color: #b91c1c;
}
.ds-bar.crit .ds-bar-ico { animation: apifyPulse 1.1s ease-in-out infinite; }
.ds-bar-loading { background: var(--surface-2); color: var(--text-2); }

.apify-bar {
  cursor: pointer;
  background: var(--green-bg); color: #15803d;
}
.apify-bar-track {
  flex: 1; max-width: 180px; height: 7px; border-radius: 99px;
  background: rgba(255,255,255,.65); overflow: hidden;
}
.apify-bar-fill { display: block; height: 100%; border-radius: 99px;
  background: #22c55e; transition: width .4s, background .25s; }
.apify-bar-pct { white-space: nowrap; font-size: 12px; opacity: .9; }
.apify-bar-acct { white-space: nowrap; font-size: 12px; opacity: .9;
  display: flex; align-items: center; gap: 4px; font-weight: 700; }
.apify-bar-meta { margin-left: auto; white-space: nowrap; font-size: 11px; opacity: .8; }
.apify-bar-switch {
  margin-left: auto; white-space: nowrap; font-size: 12px; font-weight: 700;
  padding: 4px 12px; border-radius: 7px; color: #fff !important;
}
.apify-bar-switch + .apify-bar-meta { margin-left: 12px; }

.apify-bar.warn {
  background: var(--orange-bg); color: #b45309;
}
.apify-bar.warn .apify-bar-fill { background: #f59e0b; }
.apify-bar.warn .apify-bar-switch { background: #b45309; }
.apify-bar.crit {
  background: var(--red-bg); color: #b91c1c;
}
.apify-bar.crit .apify-bar-fill { background: #ef4444; }
.apify-bar.crit .apify-bar-switch { background: #b91c1c; }
.apify-bar.crit .apify-bar-ico { animation: apifyPulse 1.1s ease-in-out infinite; }
@keyframes apifyPulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.apify-bar-loading {
  background: var(--surface-2); color: var(--text-2);
}
.apify-bar-loading .apify-bar-fill { background: var(--text-3); }
.apify-bar.apify-bar-hidden { display: none; }

.ds-alert {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 18px;
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 13px; font-weight: 600;
  text-decoration: none;
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  color: #991b1b;
  animation: dsAlertIn .25s ease-out;
}
.ds-alert[hidden] { display: none !important; }
.ds-alert-cta { margin-left: auto; text-decoration: underline; white-space: nowrap; }
@keyframes dsAlertIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

@media (max-width: 860px) {
  .budget-strip {
    margin: 0;
    grid-template-columns: 1fr;
  }
  .ds-bar { border-right: none; border-bottom: 1px solid var(--border); }
  .ds-bar, .apify-bar { padding: 8px 16px; gap: 8px; flex-wrap: wrap; }
  .apify-bar-track { max-width: 140px; }
  .ds-bar-note, .apify-bar-meta { display: none; }
}

/* ── Page header ─────────────────────────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.page-header .muted { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.actions, .inline-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── Cards ───────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 20px;
  box-shadow: var(--shadow);
}

/* ── Stat cards ──────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.stats-grid-4 { grid-template-columns: repeat(4, 1fr); }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow .2s, transform .2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.stat-icon.indigo  { background: #eef2ff; }
.stat-icon.green   { background: var(--green-bg); }
.stat-icon.blue    { background: var(--blue-bg); }
.stat-icon.orange  { background: var(--orange-bg); }
.stat-icon.red     { background: var(--red-bg); }
.stat-icon.purple  { background: var(--purple-bg); }
.stat-value {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -.5px;
  color: var(--text);
  line-height: 1;
}
.stat-value.warn { color: var(--red); }
.stat-sub { font-size: 11px; color: var(--text-2); margin-top: 2px; }

/* ── Dashboard two-col ───────────────────────────────────────────── */
.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }

.budget-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 22px;
}
.budget-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
}
.budget-card-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-2); margin-bottom: 10px;
}
.budget-card-head a { font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.budget-card-value {
  font-size: 32px; font-weight: 800; letter-spacing: -.5px; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.budget-card-sub { font-size: 12px; color: var(--text-2); margin-top: 8px; }
.budget-card-ok { border-color: var(--green-border); background: #f8fff9; }
.budget-card-warn { border-color: #fed7aa; background: var(--orange-bg); }
.budget-card-crit { border-color: var(--red-border); background: var(--red-bg); }
.budget-card-crit .budget-card-value { color: var(--red); }

.trending-card { margin-bottom: 18px; }
.trending-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.trending-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 4px;
  border-top: 1px solid var(--border);
}
.trending-item:first-child { border-top: none; }
.trending-rank {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800;
  background: var(--surface-2); color: var(--text-2);
}
.trending-rank.gold { background: #fef3c7; color: #92400e; }
.trending-rank.silver { background: #e2e8f0; color: #334155; }
.trending-rank.bronze { background: #ffedd5; color: #9a3412; }
.trending-title {
  display: block; font-weight: 600; color: var(--text); font-size: 13.5px; line-height: 1.35;
}
.trending-title:hover { color: var(--accent); }
.trending-meta { font-size: 11px; color: var(--text-2); margin-top: 3px; }
.trending-clicks { text-align: right; }
.trending-clicks strong { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.trending-clicks small { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.trending-24h {
  display: inline-block; margin-top: 2px;
  font-size: 10px; font-weight: 700; color: #15803d;
  background: var(--green-bg); padding: 1px 6px; border-radius: 99px;
}
.empty-hint { color: var(--text-2); font-size: 13px; padding: 18px 4px; }

/* ── Scheduler bar ───────────────────────────────────────────────── */
.scheduler-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
  border: 1px solid transparent;
}
.scheduler-on  { background: var(--green-bg);  color: #15803d; border-color: var(--green-border); }
.scheduler-off { background: var(--orange-bg); color: #92400e; border-color: #fde68a; }
.scheduler-bar .dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.scheduler-on  .dot { background: var(--green); box-shadow: 0 0 0 3px rgba(52,199,89,.2); }
.scheduler-off .dot { background: var(--orange); }

/* ── Forms ───────────────────────────────────────────────────────── */
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
input, select, textarea {
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  font: inherit;
  font-size: 13px;
  width: 100%;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
textarea { resize: vertical; }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  padding: 9px 16px;
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: 13px;
  transition: background .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg); box-shadow: var(--shadow-xs); }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.success { background: var(--green-bg); border-color: var(--green-border); color: #15803d; }
.btn.danger  { background: var(--red-bg);   border-color: var(--red-border);   color: #be123c; }
.btn.small   { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Badges ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
}
.badge.good   { background: var(--green-bg);  color: #15803d; }
.badge.warn   { background: var(--orange-bg); color: #c2410c; }
.badge.error  { background: var(--red-bg);    color: #be123c; }
.badge.purple { background: var(--purple-bg); color: #6d28d9; }

/* ── Table ───────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; min-width: 820px; }
/* Posts table only: lock columns to the header widths so cell-content changes
   (e.g. the "✓ Copied!" button feedback) can't recompute column widths and
   shift the whole left side — that content-driven reflow caused the jitter. */
.posts-table-wrap .table { table-layout: fixed; }
.table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.table td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table tbody tr:hover > td { background: #fafafe; }
.table tbody tr:last-child > td { border-bottom: none; }
.redir-row td { border-bottom: none; }
.redir-row:last-child td + td { border-bottom: 1px solid var(--border); }

/* ── Alerts ──────────────────────────────────────────────────────── */
.alert {
  padding: 11px 15px;
  border-radius: var(--r-sm);
  border: 1px solid;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 500;
}
.alert         { background: var(--blue-bg);  color: #1d4ed8; border-color: #bfdbfe; }
.alert.error   { background: var(--red-bg);   color: #be123c; border-color: var(--red-border); }
.alert.success { background: var(--green-bg); color: #15803d; border-color: var(--green-border); }

/* ── Hints ───────────────────────────────────────────────────────── */
.muted { color: var(--text-2); }
.hint, .hint-box {
  font-size: 12px;
  color: var(--text-2);
}
.hint-box {
  padding: 11px 13px;
  border: 1px dashed #c7d2fe;
  border-radius: var(--r-sm);
  background: #f8f9ff;
  line-height: 1.55;
}

/* ── Settings / form grids ───────────────────────────────────────── */
.form-grid, .settings-grid {
  display: grid;
  gap: 14px;
}
.settings-grid { grid-template-columns: 1fr 1fr; }
.span-2 { grid-column: 1 / -1; }
.mt-16 { margin-top: 16px; }
.mt-8  { margin-top: 8px; }

/* ── Filter bar ──────────────────────────────────────────────────── */
.filter-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-bar select { width: auto; padding: 7px 11px; font-size: 12px; }

/* ── Article fix tools (Posts page) ──────────────────────────────── */
.fix-tools {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
  margin: 0 0 16px;
  width: 100%;
  box-sizing: border-box;
  background: #fff;
}
.fix-row {
  display: grid;
  grid-template-columns: 172px max-content max-content minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  padding: 7px 14px;
  font-size: 12px;
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.fix-row:last-child { border-bottom: none; }
.fix-img { background: #fff7ed; color: #9a3412; }
.fix-src { background: #eff6ff; color: #1e40af; }
.fix-empty { background: #fef2f2; color: #9f1239; }
.fix-score { background: #f8f7ff; color: #6d28d9; }
.fix-label { font-weight: 700; white-space: nowrap; }
.fix-btn {
  padding: 3px 12px; font-size: 12px; font-weight: 700;
  background: #fff; border-radius: 6px; cursor: pointer; font-family: inherit;
}
.fix-img .fix-btn { border: 1px solid #fed7aa; color: #c2410c; }
.fix-src .fix-btn { border: 1px solid #bfdbfe; color: #1d4ed8; }
.fix-empty .fix-btn { border: 1px solid #fecaca; color: #b91c1c; }
.fix-btn-solid { color: #fff !important; border: none !important; }
.fix-src .fix-btn-solid { background: #1d4ed8; }
.fix-empty .fix-btn-solid { background: #b91c1c; }
.fix-status { color: #64748b; }
.fix-hint { justify-self: end; font-size: 11px; color: #94a3b8; }
.posts-list { display: flex; flex-direction: column; gap: 16px; padding: 0; }
.posts-table-wrap {
  background: transparent;
  border: none;
  box-shadow: none;
}
.posts-table-wrap .posts-list,
.trending-card .posts-list { padding: 12px 0 8px; }
.trending-card {
  background: transparent;
  border: none;
  box-shadow: none;
  margin-bottom: 18px;
}
.post-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.post-card:hover { border-color: #c7d2fe; }
.post-card-missing { border-color: #fde68a; }
.post-card-main {
  display: grid;
  grid-template-columns: 22px 148px minmax(0,1.4fr) auto 130px 72px 120px 96px;
  gap: 12px;
  align-items: start;
  padding: 12px;
}
.post-card-rank {
  width: 26px; height: 26px; border-radius: 8px; margin-top: 0;
  background: #0f172a; color: #fff; font-size: 12px; font-weight: 800;
  display: grid; place-items: center;
}
.post-card-rank.gold { background: #d97706; }
.post-card .post-thumb { width: 148px; height: 100px; }
.post-card .thumb-empty {
  width: 148px; height: 100px; flex-direction: column; gap: 4px;
  font-size: 11px; font-weight: 800; color: #6d28d9; background: #f5f3ff;
  border: 1.5px dashed #c4b5fd;
}
.post-card .thumb-empty span { font-size: 10px; font-weight: 700; }
.post-card-body { min-width: 0; }
.hook-preview {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text);
}
.hook-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.35em * 2);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}
.hook-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 0;
  flex-wrap: nowrap;
  min-height: 22px;
}
.post-card-cat select {
  padding: 5px 8px; border-radius: 8px; border: 1px solid #d7deea;
  font-size: 12px; width: 100%; background: #fff;
}
.copy-img-btn {
  position: absolute; bottom: 4px; right: 4px;
  font-size: 9px; padding: 2px 6px;
  background: rgba(0,0,0,.55); color: #fff; border: none; border-radius: 4px; cursor: pointer;
}
.replace-img-btn {
  position: absolute; top: 4px; right: 4px;
  font-size: 9px; padding: 2px 6px;
  background: rgba(99,102,241,.85); color: #fff; border: none; border-radius: 4px; cursor: pointer;
  display: none;
}
.copy-all-btn {
  min-width: 72px; text-align: center; box-sizing: border-box;
  flex-shrink: 0; font-size: 10px; padding: 2px 8px; font-weight: 700;
  background: #eef2ff; color: #3730a3; border: 1px solid #c7d2fe;
  border-radius: 4px; cursor: pointer; white-space: nowrap; font-family: inherit;
}
.thumb-upload { margin-top: 6px; }
.thumb-upload input[type=text] {
  width: 148px; font-size: 10px; padding: 4px 6px;
  border: 1px solid #c7d2fe; border-radius: 5px; outline: none; display: block;
}
.thumb-file-btn {
  display: inline-block; margin-top: 4px; font-size: 10px; font-weight: 700;
  padding: 3px 8px; background: #ede9fe; color: #6d28d9;
  border: 1px solid #c4b5fd; border-radius: 6px; cursor: pointer;
}
.post-card .redir-inner-v2 {
  border: none;
  margin: 0 10px 10px;
  border-radius: 10px;
  background: #f8fafc;
}
.redir-card-v2 img { display: none; }
.posts-empty { text-align: center; padding: 40px; }
@media (max-width: 1100px) {
  .post-card-main {
    grid-template-columns: 22px 120px 1fr;
  }
  .post-card .hook-score-col,
  .post-card-cat, .post-card .click-cell, .post-card .stat-cell, .post-card .act-col {
    grid-column: 3;
  }
  .post-card .act-col { flex-direction: row; min-width: 0; flex-wrap: wrap; }
  .post-card .ab { width: auto; padding: 6px 10px; }
}
.post-thumb {
  width: 130px;
  height: 88px;
  object-fit: cover;
  border-radius: 9px;
  display: block;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.post-thumb:hover { transform: scale(1.04); box-shadow: var(--shadow-md); }
.thumb-empty {
  width: 130px;
  height: 88px;
  border-radius: 9px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 18px;
  transition: background .15s, color .15s;
}
.thumb-empty:hover { background: #ede9fe; color: #6d28d9; }

/* show replace button on hover */
.thumb-wrap:hover .replace-img-btn { display: block !important; }
/* broken image: dim the thumb and show a red tint */
.thumb-wrap.img-broken .post-thumb { opacity: .35; outline: 2px solid #fca5a5; border-radius: 9px; }
.thumb-wrap.img-broken::after {
  content: '⚠ broken';
  position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  font-size: 9px; background: #fee2e2; color: #b91c1c;
  padding: 1px 5px; border-radius: 4px; white-space: nowrap; pointer-events: none;
}
.url-preview  { font-size: 11px; color: var(--text-2); word-break: break-all; margin-top: 4px; }

/* Copy buttons keep a fixed footprint so the "✓ Copied!" feedback text can't
   change their width and re-wrap the row (which caused the image/text jitter). */
.copy-hook-btn {
  min-width: 82px; text-align: center; box-sizing: border-box;
  flex-shrink: 0; font-size: 10px; padding: 2px 6px;
  background: #e0e7ff; color: #3730a3; border: 1px solid #c7d2fe;
  border-radius: 4px; cursor: pointer; white-space: nowrap; font-family: inherit;
}
.copy-img-btn  { min-width: 58px; text-align: center; box-sizing: border-box; }

/* ── Copy buttons ────────────────────────────────────────────────── */
.copy-btn {
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #3730a3;
  padding: 4px 11px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.copy-btn.copied { background: var(--green-bg); border-color: var(--green-border); color: #15803d; }
.copy-url-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.copy-url-row a { font-size: 13px; color: var(--accent); word-break: break-all; flex: 1; }

/* ── Log list ────────────────────────────────────────────────────── */
.log-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.log-list li {
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: var(--surface-2);
}
.log-list li strong { font-size: 12px; font-weight: 700; }
.log-list li span   { font-size: 12px; color: var(--text-2); }
.log-list li small  { font-size: 10px; color: var(--text-3); }
.log-item-error  { border-left: 3px solid var(--red) !important; }
.log-item-warn   { border-left: 3px solid var(--orange) !important; }
.log-item-info   { border-left: 3px solid var(--accent) !important; }

/* ── Section head ────────────────────────────────────────────────── */
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

/* ── Login ───────────────────────────────────────────────────────── */
.login-wrap  { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.login-card  { width: min(400px, 95vw); }

/* ── Preview box ─────────────────────────────────────────────────── */
.preview-box {
  max-height: 520px; overflow: auto;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface-2);
}

/* ── Pages / Sample cards ────────────────────────────────────────── */
.sample-cards { display: flex; flex-direction: column; gap: 14px; }
.sample-card {
  display: flex; gap: 14px;
  border: 2px solid var(--border-strong);
  border-radius: var(--r-lg); overflow: hidden; background: var(--surface);
}
.sample-card.sample-match { border-color: #86efac; }
.sample-card.sample-skip  { border-color: #fde68a; }
.sample-card-img { width: 150px; min-width: 150px; height: 120px; object-fit: cover; display: block; }
.sample-card-img-empty {
  width: 150px; min-width: 150px; height: 120px;
  background: var(--surface-2); display: flex; align-items: center;
  justify-content: center; color: var(--text-3); font-size: 12px;
}
.sample-card-body  { padding: 12px; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.sample-card-meta  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sample-hook       { font-size: 13.5px; line-height: 1.5; color: var(--text); }
.sample-owner-comment {
  font-size: 12px; color: var(--text-2); padding: 7px 10px;
  background: var(--surface-2); border-radius: 8px;
}

/* ── Deep test cards ─────────────────────────────────────────────── */
.deep-card { border: 2px solid var(--border-strong); border-radius: var(--r-xl); overflow: hidden; background: var(--surface); margin-bottom: 20px; box-shadow: var(--shadow); }
.deep-card-pass { border-color: #86efac; }
.deep-card-fail { border-color: #fde68a; }
.deep-card-topbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.deep-card-body  { display: flex; gap: 0; align-items: flex-start; }
.deep-card-img-wrap { width: 300px; min-width: 260px; max-width: 320px; background: var(--surface-2); display: flex; align-items: flex-start; justify-content: center; padding: 14px; }
.deep-card-img { width: 100%; height: auto; max-width: 290px; border-radius: 12px; display: block; object-fit: contain; }
.deep-card-img-empty { width: 100%; height: 130px; border-radius: 12px; background: #e2e8f0; display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 12px; }
.deep-card-content { flex: 1; padding: 16px; display: flex; flex-direction: column; }
.deep-section-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: 4px; }
.deep-hook { font-size: 14px; line-height: 1.6; color: var(--text); white-space: pre-wrap; }
.deep-comment-box { font-size: 12px; color: var(--text-2); padding: 9px 11px; background: var(--green-bg); border: 1px solid var(--green-border); border-radius: 9px; white-space: pre-wrap; }
.deep-article-preview { font-size: 12px; line-height: 1.6; color: var(--text-2); max-height: 180px; overflow: auto; padding: 9px 11px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; white-space: pre-wrap; }
.deep-verdict { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.verdict-pass { font-size: 12px; color: #15803d; font-weight: 600; }
.verdict-fail { font-size: 12px; color: #c2410c; font-weight: 600; }

/* ── Manual / Group capture ──────────────────────────────────────── */
.capture-img-wrap { width: 200px; min-width: 180px; flex-shrink: 0; background: var(--surface-2); border-radius: 14px; overflow: hidden; display: flex; align-items: center; justify-content: center; align-self: flex-start; }
.capture-img       { width: 200px; height: 160px; object-fit: cover; display: block; }
.capture-img-empty { width: 200px; height: 160px; display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 12px; background: #e2e8f0; }

/* ── Dashboard health row ────────────────────────────────────────── */
.health-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.health-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}
.health-pill.ok     { background: var(--green-bg);  color: #15803d; border-color: var(--green-border); }
.health-pill.warn   { background: var(--orange-bg); color: #92400e; border-color: #fde68a; }
.health-pill.error  { background: var(--red-bg);    color: #be123c; border-color: var(--red-border); }
.health-pill .dot   { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.health-pill.ok   .dot  { background: var(--green); }
.health-pill.warn .dot  { background: var(--orange); }
.health-pill.error .dot { background: var(--red); }

/* ── Infinite scroll sentinel ────────────────────────────────────── */
#scroll-sentinel { height: 40px; display: flex; align-items: center; justify-content: center; }
.scroll-spinner  { width: 22px; height: 22px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Hook quality badge ──────────────────────────────────────────── */
.hook-score {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}
.hook-score.good   { background: var(--green-bg);  color: #15803d; }
.hook-score.ok     { background: var(--orange-bg); color: #c2410c; }
.hook-score.bad    { background: var(--red-bg);    color: #be123c; }

/* ── Click column ────────────────────────────────────────────────── */
.click-cell          { display:flex;flex-direction:column;align-items:center;gap:1px;line-height:1 }
.click-num           { font-size:13px;font-weight:700;color:var(--text-2) }
.click-num.click-fire{ color:#16a34a }     /* green  — 1 000+ lifetime clicks */
.click-num.click-wave{ color:#6b21a8 }     /* purple — 500+ lifetime clicks  */
.click-badge         { font-size:16px;line-height:1;display:block }
.click-24            { font-size:10px;font-weight:600;color:#16a34a;margin-top:2px }

/* 🔥 fire: gentle scale-pulse */
.click-num.click-fire + .click-badge {
  animation: fire-pulse 1.4s ease-in-out infinite;
  transform-origin: bottom center;
}
@keyframes fire-pulse {
  0%,100% { transform:scaleY(1) scaleX(1); filter:brightness(1) }
  40%     { transform:scaleY(1.28) scaleX(.88); filter:brightness(1.35) }
  70%     { transform:scaleY(.9) scaleX(1.08); filter:brightness(.95) }
}

/* 🌊 wave: horizontal sway */
.click-num.click-wave + .click-badge {
  animation: wave-sway 2s ease-in-out infinite;
  transform-origin: center bottom;
}
@keyframes wave-sway {
  0%,100% { transform:rotate(0deg) translateX(0) }
  25%     { transform:rotate(-12deg) translateX(-2px) }
  75%     { transform:rotate(12deg) translateX(2px) }
}

/* ── Stat warn ───────────────────────────────────────────────────── */
.stat-warn { color: var(--red); }

/* ── Two-col layout ──────────────────────────────────────────────── */
.two-col, .grid-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
.grid-2 { grid-template-columns: 1fr 1fr; }

/* ── Code box ────────────────────────────────────────────────────── */
.code-box { font-family: ui-monospace, "SF Mono", monospace; font-size: 12px; }

/* ── Batch bar (posts page) ──────────────────────────────────────── */
.posts-filters-sticky {
  position: sticky;
  top: var(--budget-strip-h);
  z-index: 90;
  margin-bottom: 14px;
  padding: 10px 16px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.batch-bar-v2 {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #e8ecf2;
  border: 1px solid #d1d9e6;
  border-radius: 14px;
  padding: 10px 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  position: sticky;
  top: calc(var(--budget-strip-h) + 54px);
  z-index: 89;
}
.bb-label {
  font-size: 12px; font-weight: 700;
  color: #475569; white-space: nowrap; margin-right: 2px;
}
.bb-sep { width: 1px; height: 26px; background: #c8d0dc; flex-shrink: 0; }
/* pill action buttons — all same min-width so they look equal */
.bp {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 12px; font-weight: 700;
  padding: 7px 14px; border-radius: 20px; min-width: 110px;
  border: none; cursor: pointer; white-space: nowrap;
  transition: filter .15s, transform .1s; line-height: 1;
  font-family: inherit;
}
.bp:hover  { filter: brightness(1.07); transform: translateY(-1px); }
.bp:active { transform: translateY(0); filter: brightness(.93); }
.bp-primary { background: linear-gradient(135deg,#6366f1,#8b5cf6); color:#fff; }
.bp-green   { background: linear-gradient(135deg,#10b981,#059669); color:#fff; }
.bp-blue    { background: linear-gradient(135deg,#0ea5e9,#0284c7); color:#fff; }
.bp-amber   { background: linear-gradient(135deg,#f59e0b,#d97706); color:#fff; }
.bp-danger  { background: linear-gradient(135deg,#ef4444,#dc2626); color:#fff; }
.bp-yellow  { background: linear-gradient(135deg,#fbbf24,#f59e0b); color:#78350f; }
/* category pill in batch bar */
.bb-cat-wrap {
  display: flex; align-items: center; gap: 7px;
  background: #fff; border: 1px solid #c8d0dc;
  border-radius: 20px; padding: 6px 14px;
}
.bb-cat-wrap label { font-size: 11px; font-weight: 600; color: #64748b; white-space: nowrap; }
.bb-cat-select {
  background: transparent; border: none; color: #1e293b;
  font-size: 12px; font-weight: 700; cursor: pointer; outline: none;
  font-family: inherit;
}
.bb-cat-hint { font-size: 10px; color: #94a3b8; white-space: nowrap; }
/* delete-after toggle */
.bb-toggle {
  display: flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid #c8d0dc;
  border-radius: 20px; padding: 6px 14px; cursor: pointer; user-select: none;
}
.bb-toggle input[type=checkbox] { accent-color: #10b981; width: 13px; height: 13px; cursor: pointer; }
.bb-toggle span { font-size: 11px; font-weight: 600; color: #475569; white-space: nowrap; }

/* ── Status cell (dot + label + words + WP id) ───────────────────── */
.stat-cell { display: flex; flex-direction: column; gap: 4px; }
.stat-top  { display: flex; align-items: center; gap: 6px; }
.stat-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.stat-dot.s-published { background: #16a34a; box-shadow: 0 0 0 3px #dcfce7; }
.stat-dot.s-rewritten { background: #0ea5e9; box-shadow: 0 0 0 3px #e0f2fe; }
.stat-dot.s-pending   { background: #f59e0b; box-shadow: 0 0 0 3px #fef9c3; }
.stat-dot.s-failed    { background: #ef4444; box-shadow: 0 0 0 3px #fee2e2; }
.stat-dot.s-captured  { background: #6366f1; box-shadow: 0 0 0 3px #e0e7ff; }
.stat-dot.s-skipped   { background: #94a3b8; box-shadow: 0 0 0 3px #f1f5f9; }
.stat-lbl { font-size: 12px; font-weight: 700; }
.stat-lbl.s-published { color: #15803d; }
.stat-lbl.s-rewritten { color: #0284c7; }
.stat-lbl.s-pending   { color: #b45309; }
.stat-lbl.s-failed    { color: #dc2626; }
.stat-lbl.s-captured  { color: #4338ca; }
.stat-lbl.s-skipped   { color: #64748b; }
.stat-words { font-size: 11px; color: #64748b; }
.stat-wpid  { font-size: 11px; color: #6366f1; font-weight: 600; }
.stat-quality { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 5px; display: inline-block; }
.qlt-excellent { background: #dcfce7; color: #15803d; }
.qlt-good      { background: #e0e7ff; color: #3730a3; }
.qlt-weak      { background: #fef9c3; color: #854d0e; }
.qlt-poor      { background: #fee2e2; color: #dc2626; }

/* ── Action column (vertical stack, same-width buttons) ──────────── */
.act-col { display: flex; flex-direction: column; gap: 5px; min-width: 90px; align-self: start; }
.act-col form { display: block; margin: 0; }
.ab {
  display: block; width: 100%; text-align: center;
  font-size: 12px; font-weight: 700; padding: 6px 0;
  border-radius: 8px; border: none; cursor: pointer;
  transition: filter .12s, transform .1s;
  text-decoration: none; line-height: 1.2; font-family: inherit;
}
.ab:hover  { filter: brightness(1.08); transform: translateY(-1px); }
.ab:active { transform: translateY(0); }
.ab-open { background: #e0e7ff; color: #3730a3; border: 1px solid #c7d2fe; }
.ab-rewp { background: linear-gradient(135deg,#10b981,#059669); color:#fff; }
.ab-rw   { background: linear-gradient(135deg,#6366f1,#8b5cf6); color:#fff; }
.ab-skip { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.ab-del  { background: linear-gradient(135deg,#ef4444,#dc2626); color:#fff; }

/* ── Redirect sub-row ────────────────────────────────────────────── */
.redir-inner-v2 {
  padding: 8px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: #fafbff;
  border-bottom: 1px solid var(--border);
}
/* cards row: page card + group card side by side */
.redir-cards-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.redir-card-v2 {
  flex: 1;
  min-width: 220px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px; border-radius: 10px;
}
.redir-card-v2.page-card  { background: #f0f9ff; border: 1px solid #bae6fd; }
.redir-card-v2.group-card { background: #faf5ff; border: 1px solid #c4b5fd; }
.redir-card-body { flex: 1; min-width: 0; }
.redir-card-title {
  font-size: 12px; font-weight: 600; color: #0f172a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.redir-card-url {
  font-size: 11px; color: #64748b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px;
}
.redir-card-meta { display: flex; align-items: center; gap: 6px; flex-shrink: 0; flex-wrap: nowrap; }
.redir-badge-page  { font-size: 11px; font-weight: 700; color: #0369a1; background: #e0f2fe; padding: 3px 9px; border-radius: 14px; white-space: nowrap; }
.redir-badge-group { font-size: 11px; font-weight: 700; color: #6d28d9; background: #ede9fe; padding: 3px 9px; border-radius: 14px; white-space: nowrap; }
.redir-copy-btn {
  font-size: 11px; font-weight: 700; padding: 4px 12px; min-width: 72px; text-align: center;
  border: none; border-radius: 7px; cursor: pointer; white-space: nowrap; font-family: inherit;
  transition: filter .12s;
}
.redir-copy-btn:hover { filter: brightness(1.08); }
.redir-copy-btn.page-copy  { background: #0ea5e9; color: #fff; }
.redir-copy-btn.group-copy { background: #7c3aed; color: #fff; }

/* action row — all buttons equal width, full-width below cards */
.redir-actions-row {
  display: flex;
  gap: 7px;
  align-items: stretch;
}
.redir-actions-row > button {
  flex: 1;
  min-width: 0;
  font-size: 11px; font-weight: 700;
  padding: 7px 4px; border-radius: 10px;
  cursor: pointer; text-align: center;
  font-family: inherit; border: none;
  transition: filter .12s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.btn-dupliquer {
  background: #faf5ff !important;
  color: #6d28d9 !important;
  border: 1px solid #c4b5fd !important;
}
.btn-dupliquer:hover { background: #ede9fe !important; }
.btn-test-lnk {
  background: linear-gradient(135deg,#10b981,#059669);
  color: #fff;
}
.btn-test-lnk:hover { filter: brightness(1.08); }
.btn-regen-lnk {
  background: linear-gradient(135deg,#fbbf24,#f59e0b);
  color: #78350f;
}
.btn-regen-lnk:hover { filter: brightness(1.08); }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .app-shell        { grid-template-columns: 1fr; }
  .nav-toggle       { display: inline-flex; position: fixed; top: 12px; left: 12px; z-index: 130; }
  .nav-scrim {
    display: block; position: fixed; inset: 0; background: rgba(15,23,42,.35);
    z-index: 120; opacity: 0; pointer-events: none; transition: opacity .2s;
  }
  .app-shell.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }
  .sidebar {
    position: fixed; top: 0; left: 0; z-index: 125;
    width: 230px; height: 100vh; flex-direction: column; flex-wrap: nowrap;
    transform: translateX(-105%); transition: transform .2s ease;
    box-shadow: var(--shadow-lg);
  }
  .app-shell.nav-open .sidebar { transform: none; }
  .main { padding-top: 56px; }
  .main-body { padding: 22px 20px 40px; }
  .budget-strip { margin: 0; }
  .page-header { flex-wrap: wrap; }
  .page-header .actions { width: 100%; }
  .stats-grid       { grid-template-columns: repeat(2,1fr); }
  .budget-grid      { grid-template-columns: 1fr; }
  .two-col, .grid-2, .settings-grid { grid-template-columns: 1fr; }
  .dash-grid        { grid-template-columns: 1fr; }
  .post-card-main {
    grid-template-columns: 28px 100px minmax(0,1fr);
  }
  .post-card .hook-score-col,
  .post-card-cat, .post-card .click-cell, .post-card .stat-cell, .post-card .act-col {
    grid-column: 3;
  }
  .post-card .act-col { flex-direction: row; min-width: 0; flex-wrap: wrap; }
  .post-card .ab { width: auto; padding: 6px 10px; }
  .post-card .post-thumb, .post-card .thumb-empty { width: 100px; height: 72px; }
}
@media (max-width: 700px) {
  .main { padding: 56px 0 0; }
  .main-body { padding: 18px 12px 24px; }
  .budget-strip { margin: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .post-card-main { grid-template-columns: 1fr; gap: 10px; }
  .post-card .hook-score-col,
  .post-card-cat, .post-card .click-cell, .post-card .stat-cell, .post-card .act-col {
    grid-column: 1;
  }
  .post-card .post-thumb, .post-card .thumb-empty { width: 100%; height: 160px; }
  .hs-cell { flex-direction: row; align-items: center; }
  .deep-card-body { flex-direction: column; }
  .deep-card-img-wrap { width: 100%; min-width: unset; }
  .sample-card { flex-direction: column; }
  .sample-card-img, .sample-card-img-empty { width: 100%; min-width: unset; height: 160px; }
  .capture-img-wrap { width: 100%; min-width: unset; }
  .capture-img, .capture-img-empty { width: 100%; height: 160px; }
}

/* ── Hook Score column ───────────────────────────────────────────── */
.hook-score-col { white-space: normal; padding: 0 !important; }
/* flex row: score box + button side by side, same height */
.hs-cell {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.hs-box {
  display: inline-flex; align-items: center; justify-content: center;
  height: 32px; min-width: 48px; padding: 0 10px;
  border-radius: 8px; flex-shrink: 0;
}
.hs-num { font-size: 13px; font-weight: 800; line-height: 1; }
.hs-excellent { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.hs-moyen     { background: #ffedd5; color: #9a3412; border: 1px solid #fed7aa; }
.hs-faible    { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.hs-unscored  { background: #f1f5f9; color: #94a3b8; border: 1px solid #e2e8f0; }
/* local score: dashed border to indicate estimate */
.hs-local { border-style: dashed !important; opacity: .85; }

/* toolbar "Score visible hooks" button */
.hs-toolbar-btn {
  padding: 4px 12px; font-size: 11px; font-weight: 700;
  background: #ede9fe; color: #7c3aed;
  border: 1px solid #c4b5fd; border-radius: 6px; cursor: pointer;
  font-family: inherit; transition: background .12s;
}
.hs-toolbar-btn:hover { background: #ddd6fe; }

/* Score breakdown bars */
.aih-bd-block { padding: 4px 14px 8px; }
.aih-bd-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; padding: 3px 0;
}
.aih-bd-lbl { width: 130px; flex-shrink: 0; color: #64748b; }
.aih-bd-bar {
  flex: 1; height: 6px; background: #e5e7eb; border-radius: 99px; overflow: hidden;
}
.aih-bd-fill { height: 100%; background: #6366f1; border-radius: 99px; }
.aih-bd-val { width: 28px; text-align: right; font-weight: 700; color: #0f172a; flex-shrink: 0; }

/* ── AI Hooks button (purple outline, matches hs-box height) ────── */
.ai-hooks-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  height: 32px; padding: 0 10px; width: 100%; box-sizing: border-box;
  font-size: 11px; font-weight: 700; border-radius: 8px; cursor: pointer;
  background: #f5f3ff; color: #7c3aed;
  border: 1.5px solid #7c3aed; white-space: nowrap;
  transition: background .12s; font-family: inherit;
}
.ai-hooks-btn:hover { background: #ede9fe; }
.ai-hooks-btn:disabled { opacity: .6; cursor: not-allowed; }

/* ── AI Hooks panel ──────────────────────────────────────────────── */
.aih-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.15), 0 2px 8px rgba(0,0,0,.08);
  overflow: hidden;
  max-height: 520px;
  display: flex; flex-direction: column;
}
.aih-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #f1f5f9;
  background: linear-gradient(135deg,#faf5ff,#f5f3ff);
  flex-shrink: 0;
}
.aih-title   { font-size: 14px; font-weight: 700; color: #0f172a; }
.aih-subtitle { font-size: 11px; color: #64748b; margin-top: 2px; }
.aih-close {
  background: none; border: none; cursor: pointer;
  font-size: 14px; color: #94a3b8; padding: 2px 6px;
  border-radius: 4px; line-height: 1; flex-shrink: 0;
  transition: background .1s, color .1s;
}
.aih-close:hover { background: #fee2e2; color: #dc2626; }

#aih-body {
  overflow-y: auto; flex: 1; min-height: 0;
}

.aih-loading {
  padding: 32px 16px; text-align: center;
}

.aih-error {
  padding: 20px 16px;
  color: #dc2626; font-size: 13px;
  background: #fef2f2; border-top: 1px solid #fecaca;
}

/* Current hook block */
.aih-current-block {
  margin: 12px 14px 8px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}
.aih-current-weak { background: #fff7ed; border-color: #fed7aa; }
.aih-current-label {
  font-size: 11px; font-weight: 700; color: #64748b;
  margin-bottom: 4px; display: flex; align-items: center; gap: 6px;
}
.aih-cur-score {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  font-size: 11px; font-weight: 800; flex-shrink: 0;
}
.aih-current-text {
  font-size: 12px; color: #0f172a; line-height: 1.5;
}
.aih-analysis {
  font-size: 11px; color: #64748b; margin-top: 6px;
  padding-top: 6px; border-top: 1px solid #e5e7eb;
  line-height: 1.5;
}

/* Section header row */
.aih-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 14px 4px;
}
.aih-section-title {
  font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .4px;
}
.aih-why-btn {
  font-size: 10px; font-weight: 600; color: #7c3aed;
  background: none; border: none; cursor: pointer; font-family: inherit;
  padding: 2px 6px; border-radius: 4px; transition: background .1s;
}
.aih-why-btn:hover { background: #ede9fe; }
.aih-why-box {
  margin: 0 14px 6px;
  padding: 8px 10px;
  background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: 8px;
  font-size: 11px; color: #4c1d95; line-height: 1.5;
}

/* Generated hooks list */
.aih-hooks-list {
  padding: 0 14px 8px;
  display: flex; flex-direction: column; gap: 5px;
}
.aih-hook-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  transition: background .1s;
}
.aih-hook-row:hover { background: #f1f5f9; }
.aih-hook-best { background: #f0fdf4; border-color: #bbf7d0; }
.aih-hook-best:hover { background: #dcfce7; }
.aih-hook-score { flex-shrink: 0; }

/* Circular score badges */
.aih-score-circle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 11px; font-weight: 800; flex-shrink: 0;
}
.aih-circle-green { background: #d1fae5; color: #065f46; }
.aih-circle-amber { background: #ffedd5; color: #9a3412; }
.aih-circle-red   { background: #fee2e2; color: #991b1b; }

.aih-hook-text {
  flex: 1; font-size: 12px; color: #0f172a; line-height: 1.4;
  min-width: 0; cursor: help;
}
.aih-use-btn {
  flex-shrink: 0;
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 6px; cursor: pointer;
  background: #e0e7ff; color: #3730a3; border: 1px solid #c7d2fe;
  white-space: nowrap; font-family: inherit;
  transition: background .12s;
}
.aih-use-btn:hover  { background: #c7d2fe; }
.aih-use-btn:disabled { opacity: .5; cursor: not-allowed; }
.aih-use-best {
  background: linear-gradient(135deg,#10b981,#059669);
  color: #fff; border-color: transparent;
}
.aih-use-best:hover { filter: brightness(1.08); }

.aih-footer {
  padding: 8px 14px;
  font-size: 10px; color: #94a3b8; text-align: center;
  border-top: 1px solid #f1f5f9; flex-shrink: 0;
}

/* ── Toast ───────────────────────────────────────────────────────── */
.aih-toast {
  padding: 10px 16px; border-radius: 10px;
  font-size: 13px; font-weight: 600; pointer-events: auto;
  opacity: 0; transform: translateY(8px);
  transition: opacity .2s, transform .2s;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.aih-toast-show { opacity: 1; transform: translateY(0); }
.aih-toast-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.aih-toast-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ── Settings tabs ───────────────────────────────────────────────── */
.stab-bar {
  display: flex; gap: 4px; margin-bottom: 20px;
  border-bottom: 2px solid #e5e7eb; padding-bottom: 0;
}
.stab {
  padding: 8px 20px; font-size: 13px; font-weight: 600;
  background: none; border: none; border-radius: 8px 8px 0 0;
  cursor: pointer; color: #64748b; font-family: inherit;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color .15s, border-color .15s, background .15s;
}
.stab:hover { color: #6366f1; background: #f5f3ff; }
.stab.active { color: #6366f1; border-bottom-color: #6366f1; background: #fff; }
.stab-panel { display: none; }
.stab-panel.active { display: block; }

/* ── Posts page responsive ───────────────────────────────────────── */
/* Make the filter bar wrap on small screens */
@media (max-width: 900px) {
  .filter-bar { flex-wrap: wrap; gap: 6px !important; }
  .filter-bar input[name="search"] { min-width: 120px !important; }
  /* batch bar wraps gracefully */
  .batch-bar-v2 { gap: 6px; padding: 8px 12px; }
  .fix-row { grid-template-columns: 1fr; }
  .fix-hint { justify-self: start; }
  .bp { min-width: 90px; padding: 6px 10px; font-size: 11px; }
  .bb-cat-wrap { padding: 5px 10px; }
  .bb-toggle  { padding: 5px 10px; }
}
@media (max-width: 640px) {
  /* table scrolls horizontally */
  .card.posts-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table { min-width: 680px; }
  /* redirect cards stack on mobile */
  .redir-cards-row { flex-direction: column; }
  .redir-card-v2 { min-width: unset; }
  /* action buttons wrap on very small screens */
  .redir-actions-row { flex-wrap: wrap; }
  .redir-actions-row > button { min-width: calc(50% - 4px); flex: none; }
  /* batch bar: 2 columns of pill buttons */
  .batch-bar-v2 { gap: 5px; }
  .bp { min-width: 0; flex: 1 1 calc(33% - 4px); }
  /* status & action columns minimum size */
  .act-col { min-width: 80px; }
}

/* ── Staged capture panel (manual + group capture) ──────────────── */
.staged-panel {
  background: #fff;
  border: 2px solid var(--accent);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(99,102,241,.14);
  margin-bottom: 28px;
}
.staged-header {
  background: linear-gradient(135deg,#6366f1,#4f46e5);
  padding: 14px 22px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}
.staged-title { color:#fff; font-weight:700; font-size:15px; display:flex; align-items:center; gap:8px; }
.staged-count { background:rgba(255,255,255,.25); color:#fff; font-size:12px; font-weight:700; padding:2px 10px; border-radius:20px; }
.staged-body { padding:16px 22px 14px; }
.staged-check-bar { display:flex; align-items:center; gap:10px; margin-bottom:14px; font-size:13px; color:#64748b; }
.staged-check-bar label { display:flex; align-items:center; gap:7px; cursor:pointer; font-size:13px; font-weight:500; color:#475569; }
.staged-empty { color:#94a3b8; font-size:13px; padding:14px 0; }

/* card grid */
.post-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.post-capture-card {
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  background: #fafafa;
  transition: box-shadow .15s, border-color .15s, opacity .25s, transform .25s;
  cursor: pointer;
  position: relative;
}
.post-capture-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.10); border-color: #a5b4fc; }
.post-capture-card.pcc-selected { border-color: var(--accent); background: #eef2ff; box-shadow: 0 0 0 3px rgba(99,102,241,.18); }

.pcc-img-wrap { position: relative; width: 100%; height: 130px; overflow: hidden; background: #e5e7eb; }
.pcc-img { width:100%; height:130px; object-fit:cover; display:block; }
.pcc-img-empty { width:100%; height:130px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; background: linear-gradient(135deg,#e5e7eb,#f3f4f6); color:#9ca3af; font-size:12px; }
.pcc-badge { position:absolute; bottom:6px; left:6px; font-size:10px; font-weight:700; padding:2px 8px; border-radius:20px; }
.pcc-badge-ok      { background:#16a34a; color:#fff; }
.pcc-badge-broken  { background:#dc2626; color:#fff; }
.pcc-badge-missing { background:#d97706; color:#fff; }
.pcc-badge-group   { background:#6366f1; color:#fff; }

.pcc-chk { position:absolute; top:7px; left:7px; width:17px; height:17px; accent-color:var(--accent); cursor:pointer; border-radius:4px; box-shadow:0 1px 4px rgba(0,0,0,.18); z-index:2; }
.pcc-remove { position:absolute; top:5px; right:5px; background:rgba(0,0,0,.45); color:#fff; border:none; border-radius:6px; width:22px; height:22px; display:flex; align-items:center; justify-content:center; font-size:12px; cursor:pointer; opacity:0; transition:opacity .15s; z-index:2; }
.post-capture-card:hover .pcc-remove { opacity:1; }

.pcc-body { padding:9px 11px 8px; }
.pcc-title { font-weight:600; font-size:12px; color:#1e293b; line-height:1.4; margin-bottom:4px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.pcc-hook  { font-size:11px; color:#64748b; line-height:1.4; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }

.pcc-footer { display:flex; align-items:center; justify-content:space-between; padding:7px 11px; border-top:1px solid #f1f5f9; background:#fff; }
.pcc-status { display:flex; align-items:center; gap:5px; }
.pcc-dot { width:7px; height:7px; border-radius:50%; flex-shrink:0; }
.pcc-dot-pending { background:#f59e0b; }
.pcc-dot-done    { background:#16a34a; }
.pcc-dot-draft   { background:#6366f1; }
.pcc-status-text { font-size:11px; font-weight:600; color:#64748b; }

/* success strip */
.capture-success-strip {
  display:none; align-items:center; gap:10px;
  background:var(--green-bg); border:1px solid var(--green-border);
  color:#166534; border-radius:10px; padding:11px 16px;
  font-size:13px; font-weight:600; margin-bottom:16px;
}
/* btn ghost-white for dark bg */
.btn-ghost-white { background:rgba(255,255,255,.18); border:1.5px solid rgba(255,255,255,.35); color:#fff; border-radius:10px; padding:7px 14px; font-size:12px; font-weight:700; cursor:pointer; display:inline-flex; align-items:center; gap:5px; }
.btn-ghost-white:hover { background:rgba(255,255,255,.28); }
.btn-white-accent { background:#fff; border:1.5px solid #fff; color:#4f46e5; border-radius:10px; padding:7px 14px; font-size:12px; font-weight:700; cursor:pointer; display:inline-flex; align-items:center; gap:5px; }
.btn-white-accent:hover { background:#eef2ff; }

/* ── Background job queue widget ─────────────────────────────────── */
.jobq {
  position: fixed; right: 18px; bottom: 18px; z-index: 300;
  width: 340px; max-width: calc(100vw - 36px);
  background: var(--surface); border: 1.5px solid #c7d2fe;
  border-radius: 13px; box-shadow: var(--shadow-md);
  font-size: 12.5px; overflow: hidden;
}
.jobq.idle { border-color: var(--border-strong); }
.jobq-head {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; background: #eef2ff; color: #3730a3;
  border-bottom: 1px solid #e0e7ff;
}
.jobq.idle .jobq-head { background: var(--surface-2); color: var(--text-2); }
.jobq-head strong { flex: 1; font-size: 12.5px; font-weight: 700; }
.jobq-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #6366f1;
  animation: jobqPulse 1.1s ease-in-out infinite; flex-shrink: 0;
}
.jobq.idle .jobq-dot { background: #22c55e; animation: none; }
@keyframes jobqPulse { 0%,100% { opacity: 1 } 50% { opacity: .25 } }
.jobq-x {
  background: none; border: none; cursor: pointer; color: inherit;
  font-size: 13px; padding: 0 2px; line-height: 1;
}
.jobq-now {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px 6px; color: var(--text);
}
.jobq-run {
  flex: 1; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.jobq-el { color: var(--text-3); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.jobq-track { height: 4px; background: #e0e7ff; }
.jobq-fill {
  height: 100%; width: 0; background: #6366f1;
  transition: width .4s ease;
}
.jobq-fill.done { background: #22c55e; }
.jobq-body { max-height: 210px; overflow: auto; border-top: 1px solid var(--border); }
.jobq-row {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-bottom: 1px solid var(--border);
}
.jobq-row:last-child { border-bottom: none; }
.jobq-ic { flex-shrink: 0; }
.jobq-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jobq-m { color: #16a34a; flex-shrink: 0; font-size: 11.5px; }
.jobq-m.bad { color: #b45309; }
@media (max-width: 640px) { .jobq { right: 10px; bottom: 10px; width: auto; left: 10px; } }

/* ── Missing-source warning + manual source panel ────────────────── */
.nosrc {
  margin-top: 8px; border: 1.5px solid #fcd34d; border-radius: 10px;
  background: #fffbeb; overflow: hidden; max-width: 640px;
}
.nosrc-head {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 11px; font-size: 12px; color: #92400e; font-weight: 600;
}
.nosrc-head > span { flex: 1; }
.nosrc-btn {
  flex-shrink: 0; font-size: 11.5px; font-weight: 700; padding: 4px 11px;
  background: #f59e0b; color: #fff; border: none; border-radius: 7px;
}
.nosrc-btn:hover { background: #d97706; }
.nosrc-body { padding: 10px 11px 11px; border-top: 1px solid #fde68a; background: #fff; }
.nosrc-tabs { display: flex; gap: 5px; background: #f1f0f5; border-radius: 8px; padding: 3px; margin-bottom: 8px; }
.nosrc-tab {
  flex: 1; font-size: 11.5px; font-weight: 700; padding: 5px; border: none;
  border-radius: 6px; background: transparent; color: #64748b;
}
.nosrc-tab.on { background: #fff; color: #4f46e5; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.nosrc-pane input, .nosrc-pane textarea {
  width: 100%; font-size: 12px; padding: 7px 9px; border: 1.5px solid #c7d2fe;
  border-radius: 8px; font-family: inherit; resize: vertical;
}
.nosrc-pane textarea { font-size: 11.5px; line-height: 1.5; }
.nosrc-hint { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.nosrc-actions { display: flex; align-items: center; gap: 10px; margin-top: 9px; }
.nosrc-chk { flex: 1; font-size: 11.5px; color: var(--text-2); display: flex; align-items: center; gap: 5px; }
.nosrc-chk input { width: auto; }
.nosrc-save {
  font-size: 12px; font-weight: 700; padding: 6px 14px;
  background: #22c55e; color: #fff; border: none; border-radius: 8px;
}
.nosrc-save:hover { background: #16a34a; }
.nosrc-save:disabled { opacity: .55; }
.nosrc-msg { font-size: 11.5px; margin-top: 7px; }
.nosrc-msg.ok  { color: #15803d; font-weight: 600; }
.nosrc-msg.bad { color: #b91c1c; font-weight: 600; }

/* ── Manual Capture: staged posts (left) + broken scrapes (right) ── */
.mc-split { display: flex; gap: 16px; align-items: flex-start; }
.mc-split > .staged-panel { flex: 1 1 auto; min-width: 0; max-width: 760px; }

.mc-broken {
  flex: 0 0 340px; width: 340px;
  border: 3px solid #7c3aed; border-radius: 14px;
  background: var(--surface); overflow: hidden;
  position: sticky; top: calc(var(--budget-strip-h) + 24px); align-self: flex-start;
  max-height: calc(100vh - 90px); display: flex; flex-direction: column;
}
.mc-broken-head {
  background: #a78bfa; color: #fff;
  padding: 12px 16px; font-size: 26px; font-weight: 800;
  letter-spacing: -.5px; text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.mc-broken-count {
  background: #fff; color: #6d28d9; font-size: 13px; font-weight: 800;
  border-radius: 99px; padding: 2px 11px; line-height: 1.5;
}
.mc-broken-sub {
  font-size: 11.5px; color: var(--text-2); line-height: 1.5;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
#mc-broken-list { overflow-y: auto; }
.mc-brk-item { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.mc-brk-item:last-child { border-bottom: none; }
.mc-brk-title {
  font-size: 12.5px; font-weight: 700; color: var(--text);
  margin-bottom: 6px; line-height: 1.35;
}
.mc-brk-label {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; color: #6d28d9; margin-bottom: 3px;
}
.mc-brk-fb {
  display: block; font-size: 11px; color: #1d4ed8;
  font-family: ui-monospace, monospace; word-break: break-all;
  text-decoration: underline; margin-bottom: 8px; line-height: 1.4;
}
.mc-brk-none { font-size: 11px; color: var(--text-3); margin-bottom: 8px; }
.mc-brk-box {
  border: 2px solid #7c3aed; border-radius: 9px;
  padding: 8px; background: #faf5ff;
}
.mc-brk-box input {
  width: 100%; font-size: 11.5px; padding: 6px 8px;
  border: 1px solid #c4b5fd; border-radius: 6px; margin-bottom: 6px;
}
.mc-brk-actions { display: flex; gap: 6px; }
.mc-brk-actions button {
  font-size: 11.5px; font-weight: 700; padding: 6px 10px;
  border-radius: 6px; border: none; cursor: pointer; white-space: nowrap;
}
.mc-brk-fix  { background: #7c3aed; color: #fff; flex: 1; }
.mc-brk-copy { background: #fff; color: #6d28d9; border: 1px solid #c4b5fd !important; }
@media (max-width: 1180px) {
  .mc-split { flex-direction: column; }
  .mc-broken { width: 100%; flex: 1 1 auto; position: static; max-height: none; }
  .mc-split > .staged-panel { max-width: none; }
}
.mc-brk-why {
  font-size: 11px; font-weight: 700; color: #b91c1c;
  background: #fef2f2; border: 1px solid #fecaca; border-radius: 5px;
  padding: 2px 7px; display: inline-block; margin-bottom: 7px;
}
.mc-brk-old {
  font-size: 10.5px; color: var(--text-3); font-family: ui-monospace, monospace;
  word-break: break-all; margin-bottom: 8px; text-decoration: line-through;
}

/* Row banner shown after a source is recovered by the re-fetch */
.nosrc-ok {
  display: flex; align-items: center; gap: 7px;
  margin-top: 8px; padding: 7px 12px;
  background: #f0fdf4; border: 1.5px solid #bbf7d0; border-radius: 9px;
  font-size: 12.5px; font-weight: 700; color: #15803d;
  animation: nosrcOkIn .35s ease-out;
}
@keyframes nosrcOkIn { from { opacity: 0; transform: translateY(-3px) } to { opacity: 1; transform: none } }
