/* =========================================================
   The UGC Lab — automations.css · PAGE-SCOPED styles for the
   Automation Studio (/automations). Everything is scoped under
   #autox so nothing leaks, mirroring campaigns.css.

   Design tokens come from variables.css overridden by
   theme-dark.css (dark canvas #0a0e13, yellow --violet #ffd84d
   accent with dark ink, green #3ce0a3, red #ff6b81). Every
   figure is tabular-nums. This file deliberately avoids the
   shared .field / .modal / .primary classes (ui.css hardcodes
   light fills on them) and ships its own dark-native
   components instead.

   Screens: 1 account picker (grouped by campaign) → 2 account
   automation home (metrics + folder shelf + rows) → 3 builder
   (steps + sticky IG conversation preview).
   ========================================================= */

#autox {
  --ax-amber: #f5c451;
  --ax-r: 16px;
  --ax-r-sm: 12px;
}
#autox .num { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
#autox .axmuted { color: var(--text-mute); }
#autox .axdim { color: var(--text-dim); }
#autox .axeyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--text-dim);
}

/* ---- buttons (dark-native, campaigns geometry) -------------------------- */
#autox .axbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 16px; border-radius: 999px;
  font: inherit; font-weight: 600; font-size: 13.5px; white-space: nowrap;
  background: var(--bg-elev); color: var(--text);
  border: 1px solid var(--border-lt); cursor: pointer; transition: .15s;
  text-decoration: none;
}
#autox .axbtn:hover { border-color: #39485a; }
#autox .axbtn--primary { background: var(--violet); color: #0a0e13; border: 1px solid transparent; font-weight: 700; }
#autox .axbtn--primary:hover { filter: brightness(1.06); border-color: transparent; }
#autox .axbtn--ghost { background: transparent; border: 1px solid var(--border); }
#autox .axbtn--danger {
  background: rgba(255, 107, 129, .1); color: var(--red);
  border: 1px solid rgba(255, 107, 129, .3);
}
#autox .axbtn--danger:hover { background: rgba(255, 107, 129, .18); border-color: rgba(255, 107, 129, .5); }
#autox .axbtn--sm { min-height: 32px; padding: 0 12px; font-size: 12.5px; }
#autox .axbtn[disabled] { opacity: .45; cursor: not-allowed; }
#autox .axiconbtn {
  width: 34px; height: 34px; padding: 0; border-radius: 10px;
  background: none; border: 1px solid transparent;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-mute); cursor: pointer; transition: .13s;
}
#autox .axiconbtn:hover { color: var(--text); background: var(--bg-elev); border-color: var(--border-lt); }
#autox .axiconbtn svg { display: block; }

/* ---- pills / badges ------------------------------------------------------ */
#autox .axpill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: 999px; font-size: 11px; font-weight: 700;
  background: var(--bg-elev); color: var(--text-mute); border: 1px solid var(--border);
  white-space: nowrap; letter-spacing: .03em;
}
#autox .axpill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
#autox .axpill--live { background: rgba(255, 216, 77, .12); color: var(--violet); border-color: rgba(255, 216, 77, .3); text-transform: uppercase; }
#autox .axpill--live .dot { animation: axpulse 1.8s ease-in-out infinite; }
#autox .axpill--paused { text-transform: uppercase; }
#autox .axpill--draft { background: rgba(245, 196, 81, .12); color: var(--ax-amber); border-color: rgba(245, 196, 81, .26); text-transform: uppercase; }
#autox .axpill--green { background: rgba(60, 224, 163, .12); color: var(--green); border-color: rgba(60, 224, 163, .24); }
#autox .axpill--red { background: rgba(255, 107, 129, .1); color: var(--red); border-color: rgba(255, 107, 129, .24); }
@keyframes axpulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) {
  #autox .axpill--live .dot { animation: none; }
}

/* keyword chips inside rows */
#autox .axkw {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px;
  border-radius: 7px; font-size: 11.5px; font-weight: 700;
  background: rgba(122, 162, 255, .12); color: var(--violet-light);
}
#autox .axkw--any { background: var(--bg-elev); color: var(--text-mute); font-weight: 600; }

/* ---- page head ----------------------------------------------------------- */
#autox .axtop { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
#autox .axtop h1 { margin: 4px 0 6px; font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
#autox .axtop .sub { margin: 0; color: var(--text-mute); font-size: 13.5px; max-width: 560px; line-height: 1.55; }
#autox .axback {
  display: inline-flex; align-items: center; gap: 7px; background: none; border: 0;
  padding: 0; font: inherit; font-size: 12.5px; font-weight: 650; color: var(--text-mute);
  cursor: pointer; text-decoration: none; margin-bottom: 4px;
}
#autox .axback:hover { color: var(--violet); }
#autox .axhead-acts { display: flex; gap: 9px; flex-shrink: 0; align-items: center; }
#autox .axmsg {
  margin: 0 0 14px; padding: 10px 13px; border-radius: 10px; font-size: 12.5px; font-weight: 600;
  border: 1px solid rgba(255, 107, 129, .35); background: rgba(255, 107, 129, .08); color: var(--red);
}

/* ================= SCREEN 1 · account picker ============================== */
#autox .axgroups { display: flex; flex-direction: column; gap: 22px; }
#autox .axgroup-hd { display: flex; align-items: center; gap: 10px; margin: 0 2px 10px; }
#autox .axgroup-hd .axlogo { width: 26px; height: 26px; border-radius: 8px; font-size: 12px; }
#autox .axgroup-hd h2 { margin: 0; font-size: 14.5px; font-weight: 700; }
#autox .axgroup-hd .n { color: var(--text-dim); font-size: 12px; font-weight: 600; }
#autox .axlogo {
  border-radius: 10px; flex-shrink: 0; overflow: hidden;
  display: grid; place-items: center; font-weight: 800; color: #0a0e13;
}
#autox .axlogo img { width: 100%; height: 100%; object-fit: cover; }
#autox .axacct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
#autox .axacct {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
  padding: 15px 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0;
  text-align: left; font: inherit; color: var(--text); cursor: pointer; transition: .14s;
}
#autox .axacct:hover { border-color: var(--border-lt); background: var(--bg-elev); }
#autox .axacct .idrow { display: flex; align-items: center; gap: 11px; min-width: 0; }
#autox .axav {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; object-fit: cover;
  display: grid; place-items: center; color: #fff; overflow: hidden;
}
#autox .axacct .who { min-width: 0; flex: 1; }
#autox .axacct .h { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#autox .axacct .lt { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#autox .axacct .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#autox .axacct .open {
  display: inline-flex; align-items: center; gap: 6px; margin-left: auto;
  font-size: 12.5px; font-weight: 700; color: var(--violet);
}
#autox .axacct .statline { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--border); padding-top: 11px; }
#autox .axacct .statline .s { font-size: 12px; color: var(--text-mute); font-weight: 600; }
#autox .axacct .statline .s b { color: var(--text); }
#autox .axacct.is-broken { border-style: dashed; }
#autox .axreconnect { color: var(--ax-amber); font-size: 11.5px; font-weight: 700; }

/* ================= SCREEN 2 · account home ================================ */
#autox .axkpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 18px; }
#autox .axkpi { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; min-width: 0; }
#autox .axkpi .l { font-size: 11px; color: var(--text-dim); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
#autox .axkpi .v { font-size: 22px; font-weight: 750; margin-top: 6px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
#autox .axkpi .v.acc { color: var(--violet); }
#autox .axkpi .v.warn { color: var(--ax-amber); }
#autox .axkpi .d { font-size: 11.5px; margin-top: 3px; color: var(--text-mute); font-variant-numeric: tabular-nums; }

/* folder shelf */
#autox .axshelf { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
#autox .axfolder {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 13px;
  border-radius: 999px; font: inherit; font-size: 12.5px; font-weight: 650;
  color: var(--text-mute); border: 1px solid var(--border); background: var(--bg-card);
  cursor: pointer; transition: .13s; user-select: none; -webkit-user-select: none;
}
#autox .axfolder:hover { color: var(--text); border-color: var(--border-lt); }
#autox .axfolder.on { background: var(--violet); color: #0a0e13; border-color: transparent; font-weight: 750; }
#autox .axfolder .n { font-size: 11px; font-weight: 800; opacity: .75; font-variant-numeric: tabular-nums; }
#autox .axfolder.is-dropover {
  border-color: var(--violet); box-shadow: 0 0 0 2px rgba(255, 216, 77, .35);
  color: var(--text);
}
#autox .axfolder.is-dragging { opacity: .4; }
#autox .axfolder--new { border-style: dashed; background: none; color: var(--text-dim); }
#autox .axfolder--new:hover { color: var(--violet); border-color: rgba(255, 216, 77, .4); }

/* toolbar (search + actions) */
#autox .axbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
#autox .axsearch {
  display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 13px; flex: 1;
  min-width: 220px; max-width: 420px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 11px;
  color: var(--text-dim); font-size: 13px;
}
#autox .axsearch:focus-within { border-color: var(--border-lt); }
#autox .axsearch input {
  background: none !important; border: none !important; outline: none;
  color: var(--text); flex: 1; font: inherit; font-size: 13px; min-width: 0;
  padding: 0; box-shadow: none !important;
}
#autox .axsearch input::placeholder { color: var(--text-dim); }
#autox .axbar .count { font-size: 12px; color: var(--text-dim); font-weight: 600; font-variant-numeric: tabular-nums; }

/* automation rows */
#autox .axrows { display: flex; flex-direction: column; gap: 8px; }
#autox .axrowhd {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 84px 84px 96px 40px;
  gap: 12px; align-items: center; padding: 0 16px; min-height: 26px;
  color: var(--text-dim); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
#autox .axrowhd .r { text-align: right; }
#autox .axrow {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 84px 84px 96px 40px;
  gap: 12px; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
  padding: 13px 16px; cursor: pointer; transition: .13s; position: relative;
}
#autox .axrow:hover { border-color: var(--border-lt); background: var(--bg-elev); }
#autox .axrow.is-off { opacity: .6; }
#autox .axrow.is-dragging { opacity: .35; }
#autox .axrow .main { min-width: 0; }
#autox .axrow .toprow { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
#autox .axrow .nm { font-weight: 700; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#autox .axrow .trig { font-size: 12px; color: var(--text-mute); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#autox .axrow .chips { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
#autox .axrow .fold { font-size: 11px; color: var(--text-dim); font-weight: 650; display: inline-flex; align-items: center; gap: 4px; }
#autox .axrow .stat { text-align: right; font-variant-numeric: tabular-nums; }
#autox .axrow .stat b { display: block; font-size: 14.5px; font-weight: 750; }
#autox .axrow .stat span { display: block; font-size: 10.5px; color: var(--text-dim); font-weight: 600; margin-top: 2px; }
#autox .axrow .upd { text-align: right; font-size: 11.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
/* on/off toggle */
#autox .axtgl {
  position: relative; width: 38px; height: 22px; border-radius: 999px; border: none;
  background: var(--border-lt); cursor: pointer; transition: background .18s; flex: none; padding: 0;
}
#autox .axtgl::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #0a0e13; transition: transform .18s;
}
#autox .axtgl.is-on { background: var(--violet); }
#autox .axtgl.is-on::after { transform: translateX(16px); }
#autox .axtgl:disabled { opacity: .5; cursor: not-allowed; }

/* overflow menu */
#autox .axmenu {
  position: fixed; z-index: 60; min-width: 190px; padding: 6px;
  background: var(--bg-card); border: 1px solid var(--border-lt); border-radius: 13px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, .5);
}
#autox .axmenu button {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 11px;
  border: 0; border-radius: 9px; background: none; font: inherit; font-size: 13px;
  font-weight: 600; color: var(--text); cursor: pointer; text-align: left;
}
#autox .axmenu button:hover { background: var(--bg-elev); }
#autox .axmenu button.danger { color: var(--red); }
#autox .axmenu button.danger:hover { background: rgba(255, 107, 129, .1); }
#autox .axmenu button:disabled { opacity: .45; cursor: not-allowed; }
#autox .axmenu .sep { height: 1px; background: var(--border); margin: 5px 4px; }
#autox .axmenu .hd { padding: 7px 11px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-dim); }

/* drafts strip */
#autox .axdrafts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
#autox .axrow--draft { border-style: dashed; border-color: rgba(245, 196, 81, .35); }

/* empty states */
#autox .axempty {
  padding: 56px 32px; text-align: center; display: flex; flex-direction: column; align-items: center;
  background: var(--bg-card); border: 1px dashed var(--border); border-radius: 18px;
}
#autox .axempty .ill {
  width: 66px; height: 66px; border-radius: 20px; background: var(--bg-elev);
  border: 1px solid var(--border-lt); display: grid; place-items: center;
  color: var(--violet); margin-bottom: 18px;
}
#autox .axempty h2 { margin: 0; font-size: 18px; font-weight: 750; }
#autox .axempty p { color: var(--text-mute); max-width: 430px; margin: 9px 0 20px; font-size: 13.5px; line-height: 1.6; }

/* ================= SCREEN 3 · builder ===================================== */
#autox .axbuild { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
#autox .axbuild-head {
  display: flex; align-items: center; gap: 13px; margin-bottom: 18px; flex-wrap: wrap;
}
#autox .axbuild-head .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
#autox .axbuild-head .who .h { font-weight: 750; font-size: 16px; }
#autox .axbuild-head .who .lt { font-size: 12px; color: var(--text-dim); margin-top: 1px; }
#autox .axbuild-head .lock {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--bg-soft);
  color: var(--text-mute); font-size: 11px; font-weight: 700; white-space: nowrap;
}
#autox .axbuild-head .acts { margin-left: auto; display: flex; gap: 9px; align-items: center; }
#autox .axsteps { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
#autox .axstep {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--ax-r);
  padding: 18px 20px;
}
#autox .axstep .shd { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
#autox .axstep .shd .b {
  width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center;
  font-size: 12px; font-weight: 800; background: var(--violet); color: #0a0e13; flex-shrink: 0;
}
#autox .axstep .shd h3 { margin: 0; font-size: 14.5px; font-weight: 700; }
#autox .axstep .shd .hint { margin-left: auto; font-size: 11.5px; color: var(--text-dim); }
#autox .axstep--soon { border-style: dashed; }
#autox .axstep--soon .shd .b { background: var(--bg-elev); color: var(--text-dim); }
#autox .axstep--soon .soon {
  margin-left: auto; padding: 3px 9px; border-radius: 999px; font-size: 10px; font-weight: 800;
  letter-spacing: .05em; text-transform: uppercase; background: rgba(245, 196, 81, .12);
  color: var(--ax-amber); border: 1px solid rgba(245, 196, 81, .26);
}
#autox .axstep--soon p { margin: 0; font-size: 12.5px; color: var(--text-dim); line-height: 1.55; }

#autox .axlbl {
  display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--text-mute); margin: 16px 0 7px;
}
#autox .axlbl:first-child, #autox .axlbl.first { margin-top: 0; }
#autox .axlbl small { font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--text-dim); }
#autox .axhint { font-size: 12px; color: var(--text-dim); margin: 6px 0 0; line-height: 1.5; }
#autox .axinput, #autox .axta, #autox .axselect {
  width: 100%; box-sizing: border-box; background: var(--bg-soft) !important;
  border: 1px solid var(--border-lt) !important; border-radius: 11px !important;
  padding: 9px 12px; font: inherit; font-size: 13.5px; color: var(--text);
  box-shadow: none !important;
}
#autox .axinput:focus, #autox .axta:focus, #autox .axselect:focus { outline: none; border-color: var(--violet) !important; }
#autox .axta { resize: vertical; min-height: 88px; line-height: 1.5; }
#autox .axcount { font-size: 11px; color: var(--text-dim); text-align: right; margin-top: 4px; font-variant-numeric: tabular-nums; }
#autox .axcount.is-over { color: var(--red); font-weight: 700; }

/* segmented control */
#autox .axseg {
  display: inline-flex; background: var(--bg-soft); border: 1px solid var(--border-lt);
  border-radius: 11px; padding: 3px; gap: 3px; flex-wrap: wrap;
}
#autox .axseg button {
  height: 34px; padding: 0 14px; border: 0; border-radius: 9px; font: inherit;
  font-size: 12.5px; font-weight: 650; color: var(--text-mute); background: none;
  cursor: pointer; transition: .12s;
}
#autox .axseg button.on { background: var(--violet); color: #0a0e13; font-weight: 750; }
#autox .axseg button:hover:not(.on):not(:disabled) { color: var(--text); }
#autox .axseg button:disabled { opacity: .4; cursor: not-allowed; }

/* chips input (keywords) */
#autox .axchips {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  background: var(--bg-soft); border: 1px solid var(--border-lt); border-radius: 11px;
  padding: 7px 9px; cursor: text;
}
#autox .axchips:focus-within { border-color: var(--violet); }
#autox .axchip {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(122, 162, 255, .14); color: var(--violet-light);
  font-size: 12.5px; font-weight: 700; border-radius: 8px; padding: 3px 5px 3px 9px;
}
#autox .axchip button {
  border: none; background: none; color: inherit; cursor: pointer; font-size: 12px;
  line-height: 1; padding: 2px 4px; border-radius: 5px; opacity: .65;
}
#autox .axchip button:hover { opacity: 1; background: rgba(0, 0, 0, .25); }
#autox .axchips input {
  flex: 1; min-width: 110px; border: none !important; background: none !important;
  font: inherit; font-size: 13px; padding: 4px 2px; color: var(--text); box-shadow: none !important;
}
#autox .axchips input:focus { outline: none; }
#autox .axrow2 { display: flex; gap: 12px; align-items: center; margin-top: 9px; flex-wrap: wrap; }
#autox .axcheck { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--text); cursor: pointer; }
#autox .axcheck input { accent-color: var(--violet); width: 15px; height: 15px; }

/* link buttons editor */
#autox .axbtnrow { display: flex; gap: 8px; margin-top: 8px; }
#autox .axbtnrow input:first-child { flex: 0 0 140px; }
#autox .axiconx {
  display: grid; place-items: center; width: 36px; border: none; background: none;
  color: var(--text-mute); cursor: pointer; border-radius: 9px; flex: none;
}
#autox .axiconx:hover { color: var(--red); background: rgba(255, 107, 129, .08); }
#autox .axaddbtn {
  margin-top: 9px; display: inline-flex; align-items: center; gap: 6px; background: none;
  border: 1px dashed var(--border-lt); border-radius: 10px; padding: 8px 13px;
  font: inherit; font-size: 12.5px; font-weight: 650; color: var(--text-mute); cursor: pointer;
}
#autox .axaddbtn:hover { color: var(--violet); border-color: rgba(255, 216, 77, .4); }

/* content picker (specific post / story) */
/* type chooser (ManyChat-style entry) */
#autox .axchooser { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; max-width: 860px; }
#autox .axchoose {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 20px 18px; border-radius: 14px; cursor: pointer; text-align: left;
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text);
  font: inherit; transition: border-color .12s, transform .12s;
}
#autox .axchoose:hover { border-color: rgba(255, 216, 77, .5); transform: translateY(-2px); }
#autox .axchoose .ico { font-size: 26px; }
#autox .axchoose b { font-size: 15px; letter-spacing: -.01em; }
#autox .axchoose > span:last-child { font-size: 12.5px; color: var(--text-mute); line-height: 1.55; }
#autox .axchoose.is-off { opacity: .45; cursor: default; }
#autox .axchoose.is-off:hover { transform: none; border-color: var(--border); }
#autox .axpickgrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px; margin-top: 10px; max-height: 300px; overflow-y: auto; padding: 2px;
}
#autox .axpick {
  position: relative; border: 2px solid transparent; border-radius: 12px; overflow: hidden;
  aspect-ratio: 3 / 4; background: var(--bg-soft); cursor: pointer; padding: 0;
  display: block; width: 100%;
}
#autox .axpick img, #autox .axpick video { width: 100%; height: 100%; object-fit: cover; display: block; }
#autox .axpick .cap {
  position: absolute; inset: auto 0 0 0; padding: 14px 7px 6px; font-size: 10px;
  color: #fff; font-weight: 600; text-align: left; line-height: 1.35;
  background: linear-gradient(transparent, rgba(0, 0, 0, .78));
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
#autox .axpick .noimg {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--text-dim); font-size: 11px; font-weight: 650; padding: 8px; text-align: center;
}
#autox .axpick.on { border-color: var(--violet); }
#autox .axpick.on::after {
  content: "✓"; position: absolute; top: 6px; right: 6px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--violet); color: #0a0e13; font-size: 12px;
  font-weight: 800; display: grid; place-items: center;
}
#autox .axpick-note { margin: 9px 0 0; font-size: 12px; color: var(--text-dim); line-height: 1.5; }
#autox .axscopelock {
  display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 13px;
  border: 1px solid var(--border); border-radius: 11px; background: var(--bg-soft);
  font-size: 12.5px; color: var(--text-mute);
}

/* ---- sticky IG conversation preview -------------------------------------- */
#autox .axphone-wrap { position: sticky; top: 84px; }
#autox .axphone-tabs { display: flex; gap: 2px; margin-bottom: 10px; }
#autox .axphone-tabs button {
  height: 34px; padding: 0 4px; margin-right: 18px; border: 0; background: none;
  border-bottom: 2px solid transparent; font: inherit; font-size: 13px;
  font-weight: 600; color: var(--text-mute); cursor: pointer;
}
#autox .axphone-tabs button.on { color: var(--text); border-bottom-color: var(--violet); }
#autox .axphone {
  background: #000; border: 1px solid var(--border-lt); border-radius: 26px;
  padding: 16px 14px 18px; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
#autox .axphone .bar { display: flex; align-items: center; gap: 9px; padding: 2px 2px 12px; border-bottom: 1px solid #1c242e; margin-bottom: 12px; }
#autox .axphone .bar .axav { width: 28px; height: 28px; border-radius: 50%; }
#autox .axphone .bar .h { font-size: 12.5px; font-weight: 700; color: #f2f5f8; }
#autox .axphone .bar .s { font-size: 10px; color: #6b7684; margin-top: 1px; }
#autox .axphone .bar .back { color: #f2f5f8; font-size: 15px; margin-right: 2px; }
#autox .pvx-ctx {
  background: #12181f; border: 1px solid #1c242e; border-radius: 13px;
  padding: 10px 12px; font-size: 12px; line-height: 1.45; color: #aab5c2; margin-bottom: 10px;
}
#autox .pvx-ctx b { color: #f2f5f8; font-weight: 700; }
#autox .pvx-ctx .kw { background: rgba(255, 216, 77, .28); color: #ffe9a3; border-radius: 4px; padding: 0 4px; font-weight: 800; }
#autox .pvx-ctx .pubreply { margin-top: 8px; padding: 7px 0 0 12px; border-left: 2px solid #2b3644; font-size: 11.5px; color: #8a97a6; }
#autox .pvx-ctx .thumb { display: flex; gap: 9px; align-items: center; margin-bottom: 8px; }
#autox .pvx-ctx .thumb img { width: 34px; height: 44px; border-radius: 7px; object-fit: cover; }
#autox .pvx-ctx .thumb .t { font-size: 10.5px; color: #6b7684; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#autox .pvx-arrow { text-align: center; color: #47525f; font-size: 14px; margin: 8px 0; }
#autox .pvx-dm { display: flex; gap: 8px; align-items: flex-end; }
#autox .pvx-dm .axav { width: 26px; height: 26px; border-radius: 50%; font-size: 11px; }
#autox .pvx-stack { flex: 1; min-width: 0; }
#autox .pvx-bubble {
  background: #262f3a; border-radius: 18px 18px 18px 5px; padding: 10px 13px;
  font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; color: #f2f5f8;
}
#autox .pvx-btn {
  margin-top: 6px; background: #12181f; border: 1px solid #2b3644; border-radius: 12px;
  padding: 9px 12px; text-align: center; font-size: 12.5px; font-weight: 700; color: #7aa2ff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#autox .pvx-meta { font-size: 10.5px; color: #5c6875; margin-top: 7px; }
#autox .pvx-empty { color: #5c6875; font-size: 12px; text-align: center; padding: 26px 10px; line-height: 1.6; }
/* performance tab */
#autox .pvx-perf { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#autox .pvx-kpi { background: #12181f; border: 1px solid #1c242e; border-radius: 12px; padding: 11px 12px; }
#autox .pvx-kpi .l { font-size: 10px; color: #6b7684; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
#autox .pvx-kpi .v { font-size: 18px; font-weight: 750; color: #f2f5f8; margin-top: 4px; font-variant-numeric: tabular-nums; }
#autox .pvx-logrow { display: flex; gap: 8px; align-items: baseline; padding: 8px 2px; border-bottom: 1px solid #1c242e; font-size: 11.5px; color: #aab5c2; }
#autox .pvx-logrow:last-child { border-bottom: 0; }
#autox .pvx-logrow .who { font-weight: 700; color: #f2f5f8; white-space: nowrap; }
#autox .pvx-logrow .txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#autox .pvx-logrow .st { flex: none; font-size: 9.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; border-radius: 999px; padding: 2px 7px; background: #1c242e; }
#autox .pvx-logrow .st.sent { background: rgba(60, 224, 163, .16); color: #3ce0a3; }
#autox .pvx-logrow .st.failed { background: rgba(255, 107, 129, .14); color: #ff6b81; }

/* ---- toast with undo ------------------------------------------------------ */
#autox .axtoast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 80; display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border-lt); border-radius: 13px;
  padding: 11px 16px; font-size: 13px; font-weight: 600; color: var(--text);
  box-shadow: 0 18px 46px rgba(0, 0, 0, .5);
}
#autox .axtoast button {
  border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 750;
  color: var(--violet); cursor: pointer; padding: 2px 4px;
}
#autox .axtoast button:hover { text-decoration: underline; }

/* ---- modal (dark-native, own classes) ------------------------------------ */
#autox .axmodalback {
  position: fixed; inset: 0; padding: 18px; z-index: 70;
  background: rgba(6, 9, 13, .62); backdrop-filter: blur(6px);
  display: grid; place-items: center;
}
#autox .axmodal {
  width: min(460px, calc(100vw - 28px)); max-height: calc(100dvh - 36px);
  display: flex; flex-direction: column;
  background: var(--bg-card); border: 1px solid var(--border-lt); border-radius: 18px;
  overflow: hidden; box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .6);
}
#autox .axmodal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
#autox .axmodal-head h2 { margin: 0; font-size: 15.5px; font-weight: 700; flex: 1; }
#autox .axmodal-head .close {
  width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-elev); color: var(--text-mute); font-size: 15px; cursor: pointer;
}
#autox .axmodal-head .close:hover { color: var(--text); }
#autox .axmodal-body { padding: 20px; overflow-y: auto; min-height: 0; }
#autox .axmodal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* skeleton */
#autox .axskel { border-radius: 14px; background: var(--bg-card); border: 1px solid var(--border); animation: axskel 1.4s ease-in-out infinite; }
@keyframes axskel { 0%, 100% { opacity: .55; } 50% { opacity: .25; } }

/* ---- responsive ---------------------------------------------------------- */
@media (max-width: 1100px) {
  #autox .axkpis { grid-template-columns: repeat(3, 1fr); }
  #autox .axbuild { grid-template-columns: 1fr; }
  #autox .axphone-wrap { position: static; }
}
@media (max-width: 760px) {
  #autox .axkpis { grid-template-columns: 1fr 1fr; }
  #autox .axrowhd { display: none; }
  #autox .axrow { grid-template-columns: 44px minmax(0, 1fr) 40px; row-gap: 10px; }
  #autox .axrow .stat { display: inline-block; text-align: left; grid-column: 2; }
  #autox .axrow .stat b { display: inline; margin-right: 4px; }
  #autox .axrow .stat span { display: inline; }
  #autox .axrow .upd { display: none; }
  #autox .axacct-grid { grid-template-columns: 1fr; }
}
