/* ── SHELL ── */
.shell { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
  width: 44px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  overflow: visible;
  padding: 8px 0;
}

.s-logo {
  height: 36px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;

}

.s-logo-mark {
  width: 28px; height: 28px;
  background: var(--black); border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: white;
}

.s-logo-text { display: none; }

.s-nav {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  overflow: visible;
  width: 100%;
  padding: 0 6px;
}

.s-item {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--rsm);
  cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  color: var(--text-2);
  user-select: none;
  -webkit-user-select: none;
  position: relative;
}

.s-item:hover { background: var(--bg); color: var(--text-1); }
.s-item.active { background: var(--ink); color: var(--surface); }

.s-icon {
  width: 32px; min-width: 32px;
  height: 32px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-left: 0;
}

.s-item svg { opacity: 0.55; transition: opacity 0.15s; width: 16px; height: 16px; }
.s-item:hover svg { opacity: 0.85; }
.s-item.active svg { opacity: 1; color: var(--surface); }

/* Popup tooltip on hover */
.s-label {
  position: absolute;
  left: 42px; top: 50%; transform: translateY(-50%);
  background: var(--black); color: #fff;
  font-size: 12px; font-weight: 500;
  padding: 5px 10px; border-radius: 6px;
  white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity 0.15s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  z-index: 200;
}
.s-label::before {
  content: ''; position: absolute;
  left: -4px; top: 50%; transform: translateY(-50%);
  border: 4px solid transparent;
  border-right-color: var(--black);
  border-left: none;
}
.s-item:hover .s-label { opacity: 1; }
.s-item.active .s-label { font-weight: 600; }

.s-sub { display: flex; flex-direction: column; margin: 2px 0 4px 34px; gap: 1px; }
.s-subitem { font-size: 12.5px; color: var(--ink-45); text-decoration: none; padding: 5px 8px; border-radius: 5px; }
.s-subitem:hover { background: rgba(0,0,0,0.05); color: var(--ink); }
.s-subitem.active { color: var(--ink); font-weight: 700; }
.s-count { margin-left: auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: var(--ink-45); }

.s-footer {
  border-top: 1px solid var(--border-light);
  padding: 8px 6px 4px; flex-shrink: 0;
  width: 100%;
  display: flex; flex-direction: column; align-items: center;
}

.s-user {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--rsm);
  cursor: pointer; white-space: nowrap;
  transition: background 0.15s;
  position: relative;
}
.s-user:hover { background: var(--bg); }

.s-avatar {
  width: 32px; min-width: 32px;
  height: 32px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-left: 0;
}

.s-avatar-inner {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg,#333,#777);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: white;
}

.s-user-info { display: none; }
.s-user-name { font-size: 12px; font-weight: 600; color: var(--text-1); }
.s-user-role { font-size: 11px; color: var(--text-3); }

/* Theme colour picker — sits in the sidebar footer, just above the user chip. */
.s-theme { width: 100%; box-sizing: border-box; padding: 6px 10px 10px; display: flex; flex-direction: column; gap: 7px; }
.s-theme-label { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.s-theme-dots { display: flex; flex-wrap: wrap; gap: 8px; }
.s-swatch {
  width: 18px; height: 18px; padding: 0; border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.14); background: var(--sw, #ccc); cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4); transition: transform 0.12s ease;
}
.s-swatch:hover { transform: scale(1.15); }
.s-swatch.active { box-shadow: 0 0 0 2px var(--white, #fff), 0 0 0 3.5px var(--sw, #999); }

/* Retire the legacy per-page topbar colour picker — the theme picker now lives in
 * the sidebar footer. Hide each control's wrapper (button + popover host) so it
 * leaves no gap; the element stays in the DOM so each page controller's existing
 * listener bindings keep working. */
div:has(> [data-inv-theme-btn]),
div:has(> #mk-theme-btn),
div:has(> #bk-theme-btn),
div:has(> #sc-theme-btn),
div:has(> #ac-theme-btn),
div:has(> [data-sl="theme-btn"]) { display: none !important; }

/* ── MAIN ── */
.main {
  margin-left: var(--rail); flex: 1; display: flex; flex-direction: column;
  min-height: 100vh; min-width: 0;
}

/* ── TOPBAR ── */
.topbar {
  background: var(--white); border-bottom: 1px solid var(--border);
  height: 48px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}
/* Breadcrumb separator inside .topbar-left (between page and child label) */
.topbar-left .crumb-sep { font-size: 11px; margin: 0 4px; color: var(--text-3); }
.topbar-left .crumb-child { color: var(--text-1); font-weight: 600; }

/* ── CANVAS — canonical content container ──
   One max-width and side gutter for every page so content edges align when
   switching tabs. Apply via class="canvas" to a wrapper that holds the
   toolbar + page body. Pages also set this on their .page wrappers. */
.canvas {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 28px;
  width: 100%;
  box-sizing: border-box;
}

/* ── HERO / TOOLBAR ROW — tab pills left, primary action right ──
   The single row of controls that sits above content on every page. */
.hero {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  margin: 0;
}
.hero-title { display: none; }
.hero .btn-primary { margin-left: auto; }

/* ── PILL TAB PATTERN ──
   .hero .tab is used on stock-counts and activities.
   .subnav-item is the equivalent class in inventory-final.
   Both share one canonical spec so they read as the same component. */
.hero .tab,
.subnav-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 13px; font-weight: 600;
  color: var(--text-1);
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.4;
  text-decoration: none;
}
.hero .tab:hover,
.subnav-item:hover { border-color: #ccc; }
.hero .tab.active,
.subnav-item.active {
  background: #0a0a0a;
  border-color: #0a0a0a;
  color: #fff;
}
.hero .tab.active:hover,
.subnav-item.active:hover {
  background: #1a1a1a;
  border-color: #1a1a1a;
}

/* Pill-tab count badge — quiet inline number, semi-transparent white when active. */
.hero .tab-count,
.subnav-count {
  font-size: 11px;
  color: var(--text-3);
  margin-left: 2px;
  font-weight: 500;
  background: transparent;
  border: none;
  padding: 0;
  font-family: 'Inter', sans-serif;
  line-height: 1.4;
  border-radius: 0;
}
.hero .tab.active .tab-count,
.subnav-item.active .subnav-count { color: rgba(255,255,255,0.7); }

/* Sidebar count pill (shared-nav.js `badge`, today the Tasks waiting on the owner):
   small, purple, quiet; white-on-brand when its item is the current page.
   The [hidden] rule keeps the attribute winning over the display here. */
.anav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #f5f3ff; color: #7c3aed;
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px; font-weight: 500; line-height: 1;
  flex-shrink: 0;
}
a[aria-current="page"] .anav-badge { background: rgba(255,255,255,0.22); color: #fff; }
/* Tasks waiting on the owner: red, solid — a decision is owed (bots, 2026-11-07). */
.anav-badge[data-nav-count="tasks"] { background: #dc2626; color: #fff; font-weight: 700; }
.anav-badge[hidden] { display: none; }
/* Bot rows in the sidebar's Bots section: avatar + name + job (shared-nav.js). */
.anav-bot-job { display: block; font-size: 11px; font-weight: 500; color: var(--ink-45, #71717a); line-height: 1.2; }
/* Bot category headers in the sidebar (shared-nav.js; 2026-11-12): fold a group. */
.anav-botcat { display: flex; align-items: center; gap: 6px; width: 100%; box-sizing: border-box; padding: 8px 11px 4px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-65, #52525b); font: 700 11.5px Inter, system-ui, sans-serif; cursor: pointer; text-align: left; }
.anav-botcat:hover { background: var(--surface-hover, rgba(0,0,0,0.03)); color: var(--ink, #0a0a0a); }
.anav-botcat-n { font-weight: 600; color: var(--ink-45, #71717a); }
.anav-botcat-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber, #f5a524); margin-left: auto; flex-shrink: 0; }

/* ── TABLE-TOOLBAR — thin gray strip between the tab row and the data table.
   Shows the row count / filter chips on the left and small icon actions
   (Print, etc.) on the right. .po-toolbar (used inside inventory's PO/MO/SO
   panels) shares the exact same spec so the bar reads identically across
   every page. */
.table-toolbar,
.po-toolbar {
  background: #f3f4f6;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  border-radius: 4px 4px 0 0;
  min-height: 56px;       /* fixed bar height so content variation doesn't change it */
  box-sizing: border-box;
}
.table-toolbar .tt-count { font-weight: 600; color: var(--text-1); }
.table-toolbar .tt-spacer { flex: 1; }
.table-toolbar .tt-ico {
  width: 26px; height: 26px;
  border: 1px solid var(--border); border-radius: 4px;
  background: var(--white); color: var(--text-3);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.12s;
}
.table-toolbar .tt-ico:hover { color: var(--text-1); background: var(--bg); }

/* ── PRIMARY ACTION BUTTON — pairs with pill tabs in the hero/toolbar row. */
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  background: #0a0a0a;
  color: #fff;
  border: 1px solid #0a0a0a;
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.4;
}
.btn-primary:hover { background: #1a1a1a; border-color: #1a1a1a; color: #fff; }
.topbar-left { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); }
.topbar-left span { color: var(--text-1); font-weight: 600; }
.topbar-left a { color: var(--text-3); text-decoration: none; font-weight: 400; }
.topbar-left a:hover { color: var(--text-1); }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 32px; height: 32px; border-radius: var(--rsm);
  border: 1px solid var(--border); background: var(--white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-2); transition: all 0.15s;
}
.icon-btn:hover { background: var(--bg); color: var(--text-1); }
.t-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg,#888,#aaa);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: white; cursor: pointer;
  position: relative; opacity: 0.6;
}
.t-avatar .agent-dot {
  position: absolute; bottom: 0px; right: 0px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #9ca3af; border: 2px solid white;
}
.t-avatar .agent-tooltip {
  display: none; position: absolute; top: 44px; right: 0;
  background: #1a1a2e; color: #fff; font-size: 13px; font-weight: 400;
  padding: 14px 18px; border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.2); z-index: 999;
  line-height: 1.6; width: 360px; white-space: normal;
}
.t-avatar .agent-tooltip::before {
  content: ''; position: absolute; top: -5px; right: 14px;
  width: 10px; height: 10px; background: #1a1a2e;
  transform: rotate(45deg);
}
.t-avatar:hover .agent-tooltip { display: block; }
.t-avatar:hover { opacity: 1; }

/* ── PROFILE MENU ── */
.profile-menu {
  position: fixed; bottom: 48px; left: 46px; width: 200px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  overflow: hidden; display: none; z-index: 200;
}
.profile-menu.open { display: block; }
.profile-menu-header { padding: 12px 14px 10px; border-bottom: 1px solid rgba(0,0,0,0.03); }
.profile-menu-name { font-size: 13px; font-weight: 700; color: var(--text-1); }
.profile-menu-email { font-size: 12px; color: #a3a3a3; margin-top: 1px; }
.profile-menu-items { padding: 6px; }
.profile-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 6px;
  font-size: 13px; font-weight: 500; color: var(--text-1);
  cursor: pointer; transition: background 0.1s;
}
.profile-menu-item:hover { background: var(--bg); }
.profile-menu-item svg { color: #a3a3a3; flex-shrink: 0; }
.profile-menu-item.danger { color: #dc2626; }
.profile-menu-item.danger svg { color: #dc2626; opacity: 0.7; }
.profile-menu-item.danger:hover { background: #fef2f2; }
.profile-menu-sep { height: 1px; background: rgba(0,0,0,0.03); margin: 4px 6px; }

/* ── Quick-view drawers: darker contours ──────────────────────────────────
   Owner ask 2026-09-11: the quick views were hard to see. Every line inside a
   slide-over drawer comes from --rule (10% black ≈ #e6 on white); this makes
   that grey 25% darker (≈ #ac → 32% black) inside every quick-view panel —
   products/materials (workspace.html), Order (sell.html), Planning
   (planning-drawer.js), Manufacturing order (workspace-tables.js) and the
   count drawer (stock-counts.js). Page chrome outside the drawers is untouched. */
[data-inv-drawer-panel],
.sl-qv-panel,
[data-plan-drawer-panel],
[data-wt-mo-drawer-panel],
[data-sc="drawer-panel"] { --rule: rgba(0,0,0,0.32); }

/* ── PHONE (≤ 768px) ─────────────────────────────────────────────────────
   The sidebar is an off-canvas drawer here (shared-nav.js); the page gets
   the full width. Shared chrome tightens to a 16px gutter, the control rows
   wrap instead of overflowing, and the topbar tooltip/menu stay on screen. */
@media (max-width: 768px) {
  .canvas { padding: 0 16px; }
  .topbar { padding: 0 14px; height: auto; min-height: 48px; flex-wrap: wrap; row-gap: 6px; }
  .topbar-right { flex-wrap: wrap; }
  .hero { flex-wrap: wrap; row-gap: 8px; }
  .hero .btn-primary { margin-left: 0; }
  .table-toolbar, .po-toolbar { flex-wrap: wrap; min-height: 0; padding: 8px 12px; row-gap: 6px; }
  .t-avatar .agent-tooltip { width: min(360px, calc(100vw - 24px)); }
  .profile-menu { left: 12px; right: 12px; width: auto; }
  /* Legacy pages that still draw the 44px .sidebar rail (no #app-nav). */
  body:not(:has(#app-nav)) .sidebar { display: none; }
  body:not(:has(#app-nav)) .main { margin-left: 0; }
}

/* Phone: the header date/time clocks (Ship, Products, Materials, Stock, CRM,
   Dashboard) wrap one word per line in a 375px header — hide them. */
@media (max-width: 768px) {
  #sl-clock, #sc-clock, #st-clock, [data-inv-clock], #wsc-clock, .t-clock, .sv-clock { display: none !important; }
  /* Page headers that hard-code a 24px gutter inline. */
  .main > header, .shell > .main > header[data-inv-topbar] { padding-left: 16px !important; padding-right: 16px !important; flex-wrap: wrap; }
}

/* Phone: page-specific layouts that only work at desktop width.
   KPI strips become a two-column grid, control rows scroll sideways instead
   of crushing their pills, wide CSS-grid tables keep a readable minimum width
   inside a sideways-scrolling panel, and Settings stacks its side list above
   the content. */
@media (max-width: 768px) {
  /* KPI filter strips — /products, /materials (data-inv-kpi-strip and the
     planning strip data-wt-kpi-strip), /stock-counts (the div holding
     #sc-kpis), /stock-transfer (#st-kpis), /crm (.wsc-kpis) — are
     hidden on a phone (owner ask 2026-10-26: the table is what matters there;
     the tiles cost a screen of scrolling). The Dashboard tiles stay: they ARE
     that page. */
  [data-inv-kpi-strip], [data-wt-kpi-strip], div:has(> #sc-kpis), div:has(> #st-kpis), .wsc-kpis { display: none !important; }
  /* /dashboard seven-cell KPI strip → two columns. */
  .sv-region #kpiStrip, .sv-region .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sv-region .kpi-cell { border-bottom: 1px solid var(--rule); }
  /* Workspace tab rows (Inventory | Planning | Production …) and the toolbar
     that holds them: scroll sideways, never wrap into the search box. */
  div:has(> [data-inv-tabs]), div:has(> #sc-tabs), div:has(> #st-tabs), div:has(> .wsc-tabs) {
    overflow-x: auto; flex-wrap: nowrap !important; scrollbar-width: none; padding-left: 12px !important; padding-right: 12px !important;
  }
  div:has(> [data-inv-tabs])::-webkit-scrollbar, div:has(> #sc-tabs)::-webkit-scrollbar { display: none; }
  [data-inv-tabs], #sc-tabs, #st-tabs, .wsc-tabs { flex-shrink: 0; }
  /* Table toolbars with a search box: let the box take what is left. */
  div:has(> [data-inv-tabs]) > [style*="max-width:360px"], div:has(> #sc-tabs) > [style*="max-width:360px"] { min-width: 180px; }
  /* Wide CSS-grid tables on /crm: a readable minimum width inside a
     sideways-scrolling panel. */
  .wsc-thead, .wsc-row { min-width: 1000px; }
  .wsc-qhead, .wsc-qrow { min-width: 640px; }
  div:has(> .wsc-thead), div:has(> .wsc-qhead) { overflow-x: auto; }
  .wsc-cards { grid-template-columns: 1fr; }
  .wsc-run { grid-template-columns: 1fr; }
  /* /settings: the side list sits above the content instead of beside it. */
  .settings-layout { flex-direction: column; }
  .settings-layout > .settings-sidebar { width: 100%; position: static; }
  .settings-layout .settings-sidebar-list { flex-direction: row; flex-wrap: wrap; }
  .settings-layout .settings-sidebar-group { width: 100%; padding-top: 10px; }
  .settings-layout .settings-sidebar-item { border-left: 0; border-bottom: 3px solid transparent; }
  .settings-layout .settings-sidebar-item.active { border-bottom-color: var(--accent); }
  .settings-content .form-grid { grid-template-columns: 1fr; }
  /* /handbook and /playbook: their own ≤900/980px rules float the document
     list OVER the page; on a phone it stacks above the document instead. */
  .hb-shell, .pb-shell { grid-template-columns: 1fr !important; grid-template-rows: auto 1fr; }
  .hb-shell .hb-rail, .pb-shell .pb-rail { position: relative !important; inset: auto !important; width: auto !important; max-height: 38vh; border-right: 0; border-bottom: 1px solid var(--border); }
  .hb-shell.rail-collapsed .hb-rail, .pb-shell.rail-collapsed .pb-rail { display: none; }
  /* /dashboard range toolbar and /calendar header controls wrap. */
  .sv-toolbar { flex-wrap: wrap; padding: 12px 16px 8px; row-gap: 8px; }
  .cal-head, .cal-nav { flex-wrap: wrap; row-gap: 8px; }
  /* /management chain strip: scroll sideways, keep every step whole. */
  .chain-strip { overflow-x: auto; }
  .chain-step { min-width: 150px; }
  /* Page headers that hard-code a 24px gutter inline and a fixed row. */
  .main > header[style*="padding:14px 24px"], .inv-root > header[style*="padding:14px 24px"] { padding: 10px 16px !important; gap: 10px !important; flex-wrap: wrap; }
}

/* ── Bot avatar live states (bot-presence.js; spec 2026-11-10 §10) ───────────
   The eyes carry the state (bot-avatar.js draws every face; one shows at a time):
   idle = pill eyes that blink · tool = eyes glance aside + blue arc · thinking =
   three bouncing dots · waiting = eyes on you + amber dot · paused = eyes shut,
   greyed · error = wide eyes + red ! badge · done = happy eyes for a few seconds. */
@keyframes botav-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes botav-orbit { to { transform: rotate(360deg); } }
@keyframes botav-blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.08); } }
@keyframes botav-bob { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-8px); } }
@keyframes botav-glance { 0%, 100% { transform: translateX(0); } 30%, 60% { transform: translateX(-16px); } }
@keyframes botav-ping { 0%, 100% { transform: scale(.8); opacity: .55; } 50% { transform: scale(1.1); opacity: 1; } }
@keyframes botav-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@keyframes botav-hop { 0%, 45%, 100% { transform: translateY(0); } 20% { transform: translateY(-9%); } }
.bot-av { position: relative; }
.bot-av .pill { transform-box: fill-box; transform-origin: center; animation: botav-blink 4.2s infinite; animation-delay: var(--bav-blink, 0s); }
.bot-av[data-state="thinking"] .e-open, .bot-av[data-state="waiting"] .e-open, .bot-av[data-state="paused"] .e-open,
.bot-av[data-state="error"] .e-open, .bot-av[data-state="done"] .e-open { display: none; }
.bot-av[data-state="thinking"] .e-dots, .bot-av[data-state="waiting"] .e-look, .bot-av[data-state="waiting"] .ping,
.bot-av[data-state="paused"] .e-shut, .bot-av[data-state="error"] .e-wide, .bot-av[data-state="done"] .e-happy { display: inline; }
.bot-av[data-state="thinking"] svg { animation: botav-breathe 1.6s ease-in-out infinite; transform-origin: 50% 50%; }
.bot-av .e-dots circle { animation: botav-bob 1.2s ease-in-out infinite; }
.bot-av .e-dots circle:nth-child(2) { animation-delay: .15s; }
.bot-av .e-dots circle:nth-child(3) { animation-delay: .3s; }
.bot-av[data-state="tool"] .e-open { animation: botav-glance 2.6s ease-in-out infinite; }
.bot-av[data-state="tool"]::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--brand, #1a56db); animation: botav-orbit 1s linear infinite; pointer-events: none; }
.bot-av[data-state="waiting"] .ping { transform-box: fill-box; transform-origin: center; animation: botav-ping 1.8s ease-in-out infinite; }
.bot-av[data-state="paused"] { opacity: .5; filter: grayscale(1); }
.bot-av[data-state="error"] { animation: botav-shake .3s ease-in-out 1; }
.bot-av[data-state="error"]::before { content: "!"; position: absolute; top: -5px; right: -5px; width: 14px; height: 14px; border-radius: 50%; background: var(--red, #dc2626); color: #fff; font: 800 9px/14px Inter, system-ui, sans-serif; text-align: center; z-index: 1; pointer-events: none; }
.bot-av[data-state="done"] svg { animation: botav-hop 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .bot-av, .bot-av *, .bot-av::after { animation: none !important; }
}
