/* ═══════════════════════════════════════════════════════════════
   XEWI Design System — xewi.css
   Hand-rolled CSS custom properties. No utility-class system.
   Import: base_v2.html. All tokens + all component classes here.
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. Design tokens ──────────────────────────────────────────── */
:root {
  /* Colour — XEWI brand system (single source of truth, shared with the landing
     page: cream ground, charcoal ink, burnt gold primary, forest/orange/red as
     the world-model semantics). Retinted 2026-07 from the slate/indigo palette;
     every surface inherits through these tokens, so no markup changed. */
  --color-bg:              #F4EFE6;  /* cream */
  --color-bg-surface:      #FBF8F1;  /* card */
  --color-bg-raised:       #FBF8F1;
  --color-bg-sunken:       #EFE8DB;  /* cream-2 */
  --color-bg-sidebar:      #12151B;  /* charcoal panel */

  --color-text:            #1D2129;  /* ink */
  --color-text-secondary:  #5C616B;  /* ~ink @ .64 on cream */
  --color-text-muted:      #8A8F99;  /* ~ink @ .42 on cream */
  --color-text-inverse:    #F4EFE6;

  --color-primary:         #D9A727;  /* burnt gold */
  --color-primary-hover:   #C0901C;  /* gold-deep */
  --color-primary-text:    #1D2129;

  --color-accent:          #3E4756;  /* charcoal-lifted (was indigo — off-brand);
                                        stays dark so white badge text keeps contrast */
  --color-success:         #2FA05F;  /* forest green — OPENING */
  --color-warning:         #E08A2E;  /* orange — CONTESTED */
  --color-danger:          #D14B3D;  /* red — LOCKED / alert */

  --color-border:          #E3DBCC;  /* ~ink @ .14 on cream */
  --color-border-strong:   #CFC5B2;  /* ~ink @ .24 on cream */

  /* Confidence */
  --color-conf-high:       #2FA05F;
  --color-conf-medium:     #E08A2E;
  --color-conf-low:        #D14B3D;

  /* Typography */
  --font-sans:    'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Montserrat', 'Inter', system-ui, sans-serif;  /* headings */
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;
  --font-size-xs:   0.75rem;
  --font-size-sm:   0.875rem;
  --font-size-base: 1rem;
  --font-size-lg:   1.125rem;
  --font-size-xl:   1.25rem;
  --font-size-2xl:  1.5rem;

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-12: 3rem;

  /* Shape */
  --radius-sm:   0.25rem;
  --radius-md:   0.375rem;
  --radius-lg:   0.5rem;
  --radius-full: 9999px;
  --shadow-sm:   0 1px 2px rgba(0,0,0,.05);
  --shadow-md:   0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg:   0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);

  /* Layout */
  --sidebar-width:     15rem;
  --header-height:     3.5rem;
  --content-max-width: 80rem;
}

/* ── 2. Reset / base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { display: block; max-width: 100%; }
[x-cloak] { display: none !important; }

/* ── 3. App shell ──────────────────────────────────────────────── */
.xw-shell {
  display: flex;
  min-height: 100dvh;
}

/* Sidebar */
.xw-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--color-bg-sidebar);
  color: rgba(244,239,230,.46);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100dvh;
  z-index: 40;
  transform: translateX(0);
  transition: transform 0.25s ease;
}
.xw-sidebar--hidden { transform: translateX(-100%); }

.xw-sidebar-logo {
  display: flex;
  align-items: center;
  height: var(--header-height);
  padding: 0 var(--space-4);
  gap: var(--space-2);
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.xw-sidebar-logo img { height: 2rem; width: auto; }

.xw-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3) 0;
}

.xw-nav-group {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(244,239,230,.34);
  padding: 0.9rem var(--space-4) 0.25rem;
  font-weight: 700;
}

.xw-nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1px var(--space-2);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-md);
  color: rgba(244,239,230,.46);
  font-size: var(--font-size-sm);
  transition: background .12s, color .12s;
  cursor: pointer;
}
.xw-nav-link:hover { background: #232832; color: #F4EFE6; }
.xw-nav-link--active { background: #2A2F3A; color: #fff; box-shadow: inset 2px 0 0 var(--color-primary); }
.xw-nav-icon { width: 1rem; height: 1rem; opacity: .65; flex-shrink: 0; }
.xw-nav-link--active .xw-nav-icon { opacity: 1; }

.xw-nav-badge {
  margin-left: auto;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #000;
}

.xw-sidebar-footer {
  flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,.06);
  padding: var(--space-3);
}
.xw-nav-link--danger { color: #f87171; }
.xw-nav-link--danger:hover { background: rgba(220, 38, 38, .12); color: #fca5a5; }

/* Main area */
.xw-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* Header */
.xw-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-height);
  background: var(--color-bg-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-6);
}

.xw-header-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--color-text-muted);
  border-radius: var(--radius-md);
}
.xw-header-hamburger:hover { background: var(--color-bg-sunken); }

.xw-header-title {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  truncate: overflow;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 16rem;
}

.xw-header-spacer { flex: 1; }

/* Push status dot */
.xw-push-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  background: var(--color-bg-sunken);
  color: var(--color-text-muted);
  user-select: none;
  cursor: default;
}
.xw-push-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--color-border-strong);
  transition: background .3s;
}
.xw-push-dot--connected { background: var(--color-success); }
.xw-push-dot--error     { background: var(--color-danger); }

/* Marketplace switcher */
.xw-market-switcher {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}
.xw-market-switcher select {
  font-family: inherit;
  font-size: var(--font-size-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-1) var(--space-2);
  background: var(--color-bg-surface);
  color: var(--color-text);
  max-width: 10rem;
  cursor: pointer;
}

/* Language switch (EN | PT) — one language per page */
.xw-lang-switch {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg-surface);
}
.xw-lang-switch__btn {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: .04em;
  padding: var(--space-1) var(--space-2);
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}
.xw-lang-switch__btn + .xw-lang-switch__btn { border-left: 1px solid var(--color-border); }
.xw-lang-switch__btn:hover { background: var(--color-bg-sunken); }
.xw-lang-switch__btn.is-active { background: var(--color-text); color: var(--color-bg-surface); }

/* Cmd-K trigger */
.xw-cmdk-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-surface);
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  cursor: pointer;
}
.xw-cmdk-trigger:hover { background: var(--color-bg-sunken); }
.xw-kbd {
  display: inline-block;
  padding: 0.05rem 0.3rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  font-family: var(--font-mono);
  background: var(--color-bg-sunken);
  color: var(--color-text-muted);
}

/* Content */
.xw-content {
  flex: 1;
  padding: var(--space-6);
  max-width: var(--content-max-width);
  width: 100%;
  margin: 0 auto;
}

/* Mobile overlay */
.xw-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 39;
}

/* ── 4. Toast ──────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.xw-toast {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-text);
  color: var(--color-text-inverse);
  font-size: var(--font-size-sm);
  box-shadow: var(--shadow-lg);
  max-width: 20rem;
  animation: xw-toast-in 0.2s ease;
}
.xw-toast--success { background: var(--color-success); }
.xw-toast--error   { background: var(--color-danger); }
.xw-toast--info    { background: var(--color-accent); }
@keyframes xw-toast-in {
  from { opacity: 0; transform: translateY(-0.5rem); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── 5. ASIN drawer ────────────────────────────────────────────── */
.xw-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 40;
}
.xw-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 24rem;
  max-width: 100%;
  background: var(--color-bg-surface);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
.xw-drawer--open { transform: translateX(0); }
.xw-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.xw-drawer-body { flex: 1; overflow-y: auto; padding: var(--space-4); }

/* ── 6. Cmd-K palette ──────────────────────────────────────────── */
.xw-cmdk-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 50;
}
.xw-cmdk {
  position: fixed;
  top: 25%;
  left: 50%;
  transform: translateX(-50%);
  width: 32rem;
  max-width: calc(100% - 2rem);
  background: var(--color-bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 51;
  overflow: hidden;
}
.xw-cmdk-search {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
}
.xw-cmdk-search input {
  flex: 1;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: var(--font-size-sm);
  color: var(--color-text);
  background: transparent;
}
.xw-cmdk-results {
  max-height: 20rem;
  overflow-y: auto;
  padding: var(--space-1) 0;
}
.xw-cmdk-result {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-sm);
  cursor: pointer;
  color: var(--color-text);
}
.xw-cmdk-result:hover, .xw-cmdk-result--active { background: var(--color-bg-sunken); }
.xw-cmdk-footer {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-2) var(--space-4);
  border-top: 1px solid var(--color-border);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  background: var(--color-bg-sunken);
}

/* ── 7. Chat widget ────────────────────────────────────────────── */
.xw-chat-widget {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
}
.xw-chat-panel {
  width: 20rem;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  height: 30rem;
  overflow: hidden;
}
.xw-chat-panel--open { display: flex; }
.xw-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: #0c0c0e;
  color: white;
  flex-shrink: 0;
}
.xw-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.xw-chat-input-row {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3) var(--space-3);
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}
.xw-chat-input {
  flex: 1;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-family: inherit;
  font-size: var(--font-size-sm);
  outline: none;
}
.xw-chat-input:focus { border-color: var(--color-primary); }
.xw-chat-toggle {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-primary-text);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}
.xw-chat-toggle:hover { background: var(--color-primary-hover); }

/* ── 8. Cards ──────────────────────────────────────────────────── */
.xw-card {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.xw-card-body { padding: var(--space-6); }
/* .xw-card-header had NO rule at all despite 20+ uses across every surface, so
   each card title and subtitle rendered flush against the card border. The
   bottom padding is 0 because .xw-card-body below supplies its own top padding —
   giving the header a full one would double the gap. */
.xw-card-header { padding: var(--space-5) var(--space-6) 0; }
/* Inside a header the title is followed by its own subtitle, so its default
   bottom margin reads as a stray gap between the two. */
.xw-card-header .xw-card-title { margin-bottom: 0; }
/* A header with no body under it still needs its own bottom padding. */
.xw-card-header:last-child { padding-bottom: var(--space-5); }
.xw-card-title {
  font-family: var(--font-display);
  font-size: var(--font-size-base);
  font-weight: 700;
  margin: 0 0 var(--space-3) 0;
}

/* ── 9. Buttons ────────────────────────────────────────────────── */
.xw-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  background: var(--color-bg-surface);
  color: var(--color-text);
  transition: background .12s, border-color .12s;
}
.xw-btn:hover { background: var(--color-bg-sunken); }
.xw-btn--primary {
  background: var(--color-primary);
  color: var(--color-primary-text);
  border-color: var(--color-primary);
}
.xw-btn--primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }
.xw-btn--ghost { border: none; background: transparent; }
.xw-btn--ghost:hover { background: var(--color-bg-sunken); }
.xw-btn--danger { background: var(--color-danger); color: white; border-color: var(--color-danger); }
.xw-btn--danger:hover { background: #b91c1c; }
.xw-btn--sm { padding: var(--space-1) var(--space-3); font-size: var(--font-size-xs); }
.xw-btn--xs { padding: 0.1rem var(--space-2); font-size: var(--font-size-xs); }
.xw-btn--disabled, .xw-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.xw-btn--square { padding: var(--space-2); }

/* ── 10. Badges ────────────────────────────────────────────────── */
.xw-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  background: var(--color-bg-sunken);
  color: var(--color-text-secondary);
}
.xw-badge--success { background: var(--color-success);  color: white; }
.xw-badge--warning { background: var(--color-warning);  color: white; }
.xw-badge--danger  { background: var(--color-danger);   color: white; }
.xw-badge--accent  { background: var(--color-accent);   color: white; }

/* Action type badges */
.xw-badge--bid_adjustment { background: var(--color-accent);   color: white; }
.xw-badge--listing_update { background: var(--color-primary);  color: var(--color-primary-text); }
.xw-badge--image_brief    { background: var(--color-warning);  color: white; }
.xw-badge--price_change   { background: var(--color-danger);   color: white; }
.xw-badge--monitor        { background: var(--color-bg-sunken); color: var(--color-text-secondary); }

/* ── 11. Table ─────────────────────────────────────────────────── */
.xw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}
.xw-table th {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  font-weight: 600;
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  border-bottom: 2px solid var(--color-border);
}
.xw-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}
.xw-table--compact th,
.xw-table--compact td { padding: var(--space-1) var(--space-2); }
.xw-table tbody tr:last-child td { border-bottom: none; }

/* Server-paged list patterns: a control row (search + selects), sortable
   column headers and a "1–25 of N" pager. Used by any HTMX list that pages on
   the server instead of rendering every row. */
.xw-list-controls { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.xw-list-controls .xw-input { width: 14rem; max-width: 100%; padding: var(--space-1) var(--space-3); }
.xw-list-controls .xw-select { width: auto; padding: var(--space-1) var(--space-2); font-size: var(--font-size-xs); }
.xw-th-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-transform: inherit;
  letter-spacing: inherit; cursor: pointer; white-space: nowrap; }
.xw-th-sort:hover { color: var(--color-text); }
.xw-th-sort[aria-sort] { color: var(--color-text); }
.xw-pager { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  flex-wrap: wrap; padding: var(--space-3) var(--space-5); font-size: var(--font-size-xs);
  color: var(--color-text-muted); border-top: 1px solid var(--color-border); }
.xw-pager__nav { display: flex; gap: var(--space-2); }

/* A folded card: <details class="xw-card xw-fold"> — the title row stays,
   the body opens on click. For set-once settings and occasional tools. */
.xw-fold > .xw-fold__summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap;
  align-items: baseline; gap: var(--space-1) var(--space-3); padding: var(--space-4) var(--space-6); }
.xw-fold > .xw-fold__summary::-webkit-details-marker { display: none; }
.xw-fold > .xw-fold__summary::before { content: "▸"; color: var(--color-text-muted); transition: transform .15s; }
.xw-fold[open] > .xw-fold__summary::before { transform: rotate(90deg); }
.xw-fold__body { padding: 0 var(--space-6) var(--space-6); }
/* ⓘ — an explanation one tap away instead of a paragraph under every heading. */
.xw-info { display: inline; }
.xw-info > summary { display: inline; list-style: none; cursor: pointer; color: var(--color-text-muted); font-size: .95em; }
.xw-info > summary::-webkit-details-marker { display: none; }
.xw-info > summary:hover, .xw-info[open] > summary { color: var(--color-primary); }
.xw-info__body { display: block; margin-top: var(--space-1); font-size: var(--font-size-xs); line-height: 1.5; color: var(--color-text-muted); max-width: 48rem; }


/* ── 12. Stat bar ──────────────────────────────────────────────── */
.xw-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  background: var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.xw-stat {
  flex: 1 1 10rem;
  background: var(--color-bg-surface);
  padding: var(--space-4) var(--space-6);
}
.xw-stat-title {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.xw-stat-value {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--color-text);
  margin-top: var(--space-1);
}
.xw-stat-desc {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* ── 13. Page header ───────────────────────────────────────────── */
.xw-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.xw-page-header-text {}
.xw-page-title {
  font-family: var(--font-display);
  font-size: var(--font-size-xl);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-1) 0;
}
.xw-page-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin: 0;
}
.xw-page-actions { display: flex; gap: var(--space-2); align-items: center; flex-shrink: 0; }

/* ── 14. PEAL Brief ────────────────────────────────────────────── */
.xw-peal-brief {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.xw-peal-point {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.xw-peal-verdict {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
  margin: 0;
}

.xw-peal-model-badge {
  font-size: var(--font-size-xs);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  background: var(--color-bg-sunken);
  color: var(--color-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.xw-peal-evidence-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) 0;
  border: none;
  background: none;
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
}

.xw-peal-evidence-body {
  padding: var(--space-4) 0;
  border-top: 1px solid var(--color-border);
}

.xw-peal-source-tags {
  display: flex;
  gap: var(--space-1);
  margin-left: var(--space-2);
}

.xw-peal-sources {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-3);
}
.xw-peal-source {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.xw-peal-analysis {
  padding: var(--space-4) 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  border-top: 1px solid var(--color-border);
}

.xw-peal-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.xw-peal-action {
  background: var(--color-bg-sunken);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.xw-peal-action-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.xw-peal-action-desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-3) 0;
}

.xw-peal-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-3);
  font-size: var(--font-size-xs);
}

/* ── 15. Confidence badges ─────────────────────────────────────── */
.xw-conf-badge {
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.xw-conf-badge--high   { background: var(--color-conf-high);   color: white; }
.xw-conf-badge--medium { background: var(--color-conf-medium); color: white; }
.xw-conf-badge--low    { background: var(--color-conf-low);    color: white; }

/* ── 16. Chevron ───────────────────────────────────────────────── */
.xw-chevron { transition: transform 0.2s ease; display: inline-block; }
.xw-chevron::after { content: '\25B8'; }
.xw-chevron--open { transform: rotate(90deg); }

/* ── 17. Vulnerability score ───────────────────────────────────── */
.xw-vuln-score {
  font-weight: 700;
  font-size: var(--font-size-sm);
  color: hsl(calc(120 - var(--vuln) * 1.2), 70%, 40%);
}

/* ── 18. Layout utilities ──────────────────────────────────────── */
.xw-grid-sidebar { display: grid; gap: var(--space-6); }
@media (min-width: 1024px) {
  .xw-grid-sidebar { grid-template-columns: 20rem 1fr; }
}
.xw-flex { display: flex; }
.xw-flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.xw-flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}
.xw-gap-2 { gap: var(--space-2); }
.xw-gap-3 { gap: var(--space-3); }
.xw-gap-4 { gap: var(--space-4); }
.xw-font-mono { font-family: var(--font-mono); }
.xw-text-muted { color: var(--color-text-muted); font-size: var(--font-size-xs); }
.xw-text-sm    { font-size: var(--font-size-sm); }
.xw-text-xs    { font-size: var(--font-size-xs); }
.xw-hidden     { display: none !important; }
.xw-mt-4       { margin-top: var(--space-4); }
/* dashboard.html spaces all four Today panels with xw-mt-5, which was never
   defined — so the home page's vertical rhythm silently did nothing. */
.xw-mt-5       { margin-top: var(--space-5); }
.xw-mt-6       { margin-top: var(--space-6); }
.xw-mb-3       { margin-bottom: var(--space-3); }
.xw-mb-4       { margin-bottom: var(--space-4); }
.xw-w-full     { width: 100%; }

/* ── 19. Tabs ──────────────────────────────────────────────────── */
/* The tab strip scrolls inside itself on a narrow screen instead of widening
   the page; the rule is an inset shadow (not a border) so the active tab's
   underline can sit on it without overflowing the scroll box. */
.xw-tabs {
  display: flex;
  gap: 0;
  box-shadow: inset 0 -2px 0 var(--color-border);
  margin-bottom: var(--space-6);
  overflow-x: auto;
  scrollbar-width: none;
}
.xw-tabs::-webkit-scrollbar { display: none; }
.xw-tab {
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color .12s, border-color .12s;
}
.xw-tab:hover { color: var(--color-text); }
.xw-tab--active { color: var(--color-text); border-bottom-color: var(--color-primary); }

/* ── 20. Modal ─────────────────────────────────────────────────── */
.xw-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 50;
}
.xw-modal-backdrop--open { display: block; }
.xw-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--color-bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-6);
  z-index: 51;
  max-width: 32rem;
  width: calc(100% - var(--space-8));
}
.xw-modal-title { font-size: var(--font-size-lg); font-weight: 700; margin: 0 0 var(--space-1) 0; }
.xw-modal-subtitle { font-size: var(--font-size-sm); color: var(--color-text-secondary); margin: 0 0 var(--space-4) 0; }
.xw-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

/* ── 21. Form controls ─────────────────────────────────────────── */
.xw-form-group { margin-bottom: var(--space-3); }
.xw-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 500;
  margin-bottom: var(--space-1);
  color: var(--color-text);
}
.xw-label-hint { font-weight: 400; color: var(--color-text-muted); }
.xw-input {
  display: block;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--font-size-sm);
  color: var(--color-text);
  background: var(--color-bg-surface);
  outline: none;
  transition: border-color .12s;
}
.xw-input:focus { border-color: var(--color-primary); }
.xw-input--sm { padding: var(--space-1) var(--space-2); font-size: var(--font-size-xs); }
.xw-input--mono { font-family: var(--font-mono); }

/* ── 22. Spinner ───────────────────────────────────────────────── */
.xw-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: xw-spin 0.6s linear infinite;
}
.xw-spinner--sm { width: 0.75rem; height: 0.75rem; }
.xw-spinner--lg { width: 2rem; height: 2rem; border-width: 3px; }
@keyframes xw-spin { to { transform: rotate(360deg); } }

/* ── 23. Skeleton shimmer ──────────────────────────────────────── */
.xw-skeleton {
  border-radius: var(--radius-md);
  background: linear-gradient(90deg,
    var(--color-bg-sunken) 25%,
    var(--color-border) 50%,
    var(--color-bg-sunken) 75%);
  background-size: 200% 100%;
  animation: xw-shimmer 1.5s ease-in-out infinite;
}
@keyframes xw-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── 24. Empty state ───────────────────────────────────────────── */
.xw-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-12) var(--space-4);
  color: var(--color-text-muted);
}
.xw-empty-title {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-text-secondary);
  margin: var(--space-3) 0 var(--space-2) 0;
}
.xw-empty-desc { font-size: var(--font-size-sm); margin: 0 0 var(--space-4) 0; }

/* ── 25. Tier upgrade gate ─────────────────────────────────────── */
.xw-upgrade-gate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: linear-gradient(135deg, #fef9ec 0%, #fffdf5 100%);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

/* ── 26. Freshness badge ───────────────────────────────────────── */
.xw-freshness {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}
.xw-freshness-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--color-success);
}
.xw-freshness-dot--stale { background: var(--color-warning); }
.xw-freshness-dot--old   { background: var(--color-danger); }

/* ── 27. Cluster card ──────────────────────────────────────────── */
.xw-cluster-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-surface);
  cursor: pointer;
  text-align: left;
  transition: border-color .12s, background .12s;
  margin-bottom: var(--space-2);
}
.xw-cluster-card:hover { border-color: var(--color-primary); background: #fef9ec; }
.xw-cluster-card--active { border-color: var(--color-primary); background: #fef9ec; box-shadow: inset 3px 0 0 var(--color-primary); }
.xw-cluster-card-name { font-size: var(--font-size-sm); font-weight: 600; color: var(--color-text); }
.xw-cluster-card-meta { display: flex; align-items: center; gap: var(--space-2); }

/* ── 28. Chip / ASIN chip ──────────────────────────────────────── */
.xw-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-family: var(--font-mono);
  cursor: pointer;
  background: var(--color-bg-surface);
  color: var(--color-text-secondary);
  transition: border-color .12s;
}
.xw-chip:hover { border-color: var(--color-primary); color: var(--color-text); }
.xw-chip--active { border-color: var(--color-primary); background: #fef9ec; color: var(--color-text); }

/* ── 29. Native dialog (replaces DaisyUI .modal) ──────────────── */
dialog.xw-dialog {
  border: none;
  padding: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 32rem;
  width: calc(100% - var(--space-8));
  background: var(--color-bg-surface);
}
dialog.xw-dialog--wide { max-width: 48rem; }
dialog.xw-dialog--xl   { max-width: 64rem; }
dialog.xw-dialog::backdrop { background: rgba(0,0,0,.45); }
.xw-dialog-box {
  padding: var(--space-6);
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
}
.xw-dialog-title { font-size: var(--font-size-lg); font-weight: 700; margin: 0 0 var(--space-1) 0; }
.xw-dialog-subtitle { font-size: var(--font-size-sm); color: var(--color-text-secondary); margin: 0 0 var(--space-4) 0; }
.xw-dialog-body { flex: 1; overflow-y: auto; padding-right: var(--space-1); }
.xw-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  padding-top: var(--space-4);
  flex-shrink: 0;
}

/* ── 30b. Alert banners ────────────────────────────────────────── */
.xw-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  background: var(--color-bg-sunken);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}
.xw-alert--success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.xw-alert--error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.xw-alert--warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.xw-alert--info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

/* ── 30c. Select + Textarea ────────────────────────────────────── */
.xw-select {
  display: block;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--font-size-sm);
  color: var(--color-text);
  background: var(--color-bg-surface);
  outline: none;
  cursor: pointer;
}
.xw-select:focus { border-color: var(--color-primary); }
.xw-select--sm { padding: var(--space-1) var(--space-2); font-size: var(--font-size-xs); }
.xw-textarea {
  display: block;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  color: var(--color-text);
  background: var(--color-bg-surface);
  resize: vertical;
  outline: none;
  min-height: 5rem;
}
.xw-textarea:focus { border-color: var(--color-primary); }

/* ── 30d. Button colour variants ───────────────────────────────── */
.xw-btn--success { background: var(--color-success); color: white; border-color: var(--color-success); }
.xw-btn--success:hover { background: #15803d; }
.xw-btn--warning { background: var(--color-warning); color: white; border-color: var(--color-warning); }
.xw-btn--warning:hover { background: #b45309; }

/* ── 30e. Two-col form grid ────────────────────────────────────── */
.xw-form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.xw-form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-2); }

/* ── 30f. Collapse section (replaces DaisyUI .collapse) ───────── */
.xw-collapse { border: 1px solid var(--color-border); border-radius: var(--radius-md); margin-bottom: var(--space-3); }
.xw-collapse-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  background: var(--color-bg-sunken);
  border-radius: var(--radius-md);
}
.xw-collapse-body { padding: var(--space-4); border-top: 1px solid var(--color-border); }

/* ── 30g. Radio button group ───────────────────────────────────── */
.xw-radio-group {
  display: flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  width: fit-content;
}
.xw-radio-btn {
  padding: var(--space-1) var(--space-4);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: var(--color-bg-surface);
  color: var(--color-text-secondary);
  border-right: 1px solid var(--color-border);
}
.xw-radio-btn:last-child { border-right: none; }
.xw-radio-btn--active { background: var(--color-primary); color: var(--color-primary-text); }

/* ── 30h. Data label (stat-desc equiv) ────────────────────────── */
.xw-stat-desc { font-size: var(--font-size-xs); color: var(--color-text-muted); margin-top: var(--space-1); }

/* ── Focus visible ─────────────────────────────────────────────── */
.xw-btn:focus-visible,
.xw-tab:focus-visible,
.xw-peal-evidence-toggle:focus-visible,
.xw-cluster-card:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ── 30. Responsive ────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .xw-sidebar { transform: translateX(-100%); }
  .xw-sidebar--mobile-open { transform: translateX(0); }
  .xw-main { margin-left: 0; }
  .xw-header-hamburger { display: flex; }
  /* The overlay is shown by toggleNav() only while the menu is open. A
     display:block here dimmed every page below 1024px on load and swallowed
     the first tap. */
  .xw-push-label { display: none; }
}

/* Keep the page itself from scrolling sideways. A flex item defaults to
   min-width:auto, so one wide table or graph used to stretch .xw-main past the
   window (a page-wide left-right scrollbar, worst with the menu open). Wide
   content now scrolls inside its own card instead. */
.xw-main, .xw-content { min-width: 0; }
.xw-grid-sidebar > * { min-width: 0; }
.xw-card-body:has(> table), .xw-card:has(> table) { overflow-x: auto; }
/* Many pages give .xw-grid-sidebar an inline two-column template, which beat
   the media query above and never stacked on a laptop-narrow or phone screen. */
@media (max-width: 1023px) {
  .xw-grid-sidebar { grid-template-columns: minmax(0, 1fr) !important; }
}

/* ── 31. Flywheel nav extras ───────────────────────────────────── */

/* Collapsible sidebar toggle (desktop) */
.xw-nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--color-text-muted);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}
.xw-nav-toggle:hover { background: var(--color-bg-sunken); }

/* Collapsed sidebar state (class on .xw-shell) */
.xw-shell.nav-collapsed .xw-sidebar { width: 4.3rem !important; }
.xw-shell.nav-collapsed .xw-main { margin-left: 4.3rem !important; }
.xw-shell.nav-collapsed .xw-nav-link {
  gap: 0;
  justify-content: center;
  font-size: 0;
  padding-left: 0;
  padding-right: 0;
  margin-left: 6px;
  margin-right: 6px;
  position: relative;
}
.xw-shell.nav-collapsed .xw-nav-icon { width: 1.2rem; height: 1.2rem; }
.xw-shell.nav-collapsed .xw-nav-group {
  height: 1px;
  margin: 10px 12px;
  padding: 0;
  overflow: hidden;
  color: transparent;
  background: rgba(255,255,255,.08);
}
.xw-shell.nav-collapsed .xw-nav-badge {
  position: absolute;
  top: 5px;
  right: 7px;
  width: 7px;
  height: 7px;
  min-width: 0;
  padding: 0;
  font-size: 0;
}
.xw-shell.nav-collapsed .nav-wordmark { display: none; }
.xw-sidebar-legal { padding: var(--space-2) var(--space-3) 0; font-size: 0.6875rem; color: var(--color-text-muted); }
.xw-sidebar-legal a { color: inherit; text-decoration: none; }
.xw-sidebar-legal a:hover { text-decoration: underline; }
.xw-shell.nav-collapsed .xw-sidebar-legal { display: none; }
.xw-shell.nav-collapsed .xw-sidebar-logo { justify-content: center; padding: 0; }

/* ── 32. PEAL / Command surface components ─────────────────────── */

/* Evidence pills */
.xw-ev-pill {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-sunken);
  border-radius: var(--radius-md);
  min-width: 0;
}

/* Reaction graph nodes */
.xw-node {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-surface);
  text-align: center;
  min-width: 6.5rem;
}
.xw-node--you { border-color: var(--color-primary); background: #fef9ec; }

/* Diff lines (listing rewrite) */
.xw-diffline {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  line-height: 1.5;
}
.xw-diffline--old {
  background: #fef2f2;
  color: #991b1b;
  text-decoration: line-through;
  text-decoration-color: #f8b4b4;
}
.xw-diffline--new { background: #f0fdf4; color: #166534; }

/* Stat metric (triage) */
.xw-metric {
  flex: 1;
  background: var(--color-bg-surface);
  padding: var(--space-3) var(--space-4);
}

/* Product thumbnail placeholder */
.xw-thumb {
  position: relative;
  border-radius: var(--radius-md);
  background: repeating-linear-gradient(135deg, #eef1f4 0 7px, #e6eaef 7px 14px);
  border: 1px solid var(--color-border);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.xw-thumb span {
  font-family: var(--font-mono);
  font-size: .5rem;
  color: var(--color-text-muted);
  letter-spacing: .02em;
  text-align: center;
  padding: 2px;
  line-height: 1.15;
}

/* KPI card */
.xw-kpi {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
}
.xw-kpi-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
}
.xw-kpi-value {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-top: 8px;
  line-height: 1;
}
.xw-kpi-delta { font-size: var(--font-size-xs); margin-top: 8px; }

/* Pill tab toggle (D/W/M) */
.xw-pill-tabs {
  display: inline-flex;
  gap: 2px;
  background: var(--color-bg-sunken);
  border-radius: var(--radius-full);
  padding: 3px;
}
.xw-pill {
  padding: 5px 14px;
  border-radius: var(--radius-full);
  border: none;
  background: none;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
}
.xw-pill--active {
  background: var(--color-bg-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}

/* Opportunity row */
.xw-opp {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-surface);
  transition: border-color .12s, box-shadow .12s;
}
.xw-opp:hover { border-color: var(--color-border-strong); box-shadow: var(--shadow-sm); }
.xw-opp-rail { width: 3px; border-radius: 3px; align-self: stretch; flex-shrink: 0; }
.xw-opp-ic {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-md);
  background: var(--color-bg-sunken);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Brief row (Today / Triage) */
.xw-brief-row {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-surface);
  transition: border-color .12s, box-shadow .12s;
}
.xw-brief-row:hover { border-color: var(--color-border-strong); box-shadow: var(--shadow-sm); }

/* Strike inbox item */
.xw-strike-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid transparent;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border);
  transition: background .12s;
}
.xw-strike-item:hover { background: var(--color-bg-sunken); }
.xw-strike-item--active { background: #fef9ec; border-left-color: var(--color-primary); }

/* AI assistant */
.xw-assist-launch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: .62rem 1.05rem;
  border-radius: var(--radius-full);
  background: #0c0c0e;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  font-size: var(--font-size-sm);
  font-weight: 600;
}
.xw-assist-launch:hover { background: #232832; }
.xw-assist-panel {
  width: 27rem;
  max-width: calc(100vw - 3rem);
  height: 35rem;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Chat messages */
.xw-msg {
  max-width: 86%;
  padding: .6rem .8rem;
  border-radius: .9rem;
  font-size: var(--font-size-sm);
  line-height: 1.5;
}
.xw-msg--ai {
  background: var(--color-bg-sunken);
  color: var(--color-text);
  align-self: flex-start;
  border-bottom-left-radius: .2rem;
}
.xw-msg--me {
  background: var(--color-primary);
  color: var(--color-primary-text);
  align-self: flex-end;
  border-bottom-right-radius: .2rem;
}

/* Suggestion chips */
.xw-suggest {
  border: 1px solid var(--color-border);
  background: var(--color-bg-surface);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  font-size: var(--font-size-xs);
  cursor: pointer;
  color: var(--color-text-secondary);
  text-align: left;
}
.xw-suggest:hover { border-color: var(--color-primary); color: var(--color-text); }

/* Explain / what-do chip */
.xw-explain-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-surface);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: var(--font-size-xs);
  cursor: pointer;
  color: var(--color-text-secondary);
}
.xw-explain-chip:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* Scannable impact chip */
.xw-impact {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--color-bg-sunken);
  color: var(--color-text-secondary);
  white-space: nowrap;
}

/* Line clamp */
.xw-clamp2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── 33. The living flywheel (sidebar identity) ───────────────── */
.xw-flywheel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 0 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.xw-flywheel-svg { width: 66px; height: 66px; overflow: visible; }
.xw-fw-ring { fill: none; stroke: rgba(255,255,255,.12); stroke-width: 2; }
.xw-fw-dot {
  fill: rgba(244,239,230,.34);
  transition: fill .3s, r .2s, filter .3s;
  cursor: pointer;
}
.xw-fw-dot:hover { fill: rgba(244,239,230,.46); }
.xw-fw-dot.is-active { fill: var(--color-primary); filter: drop-shadow(0 0 5px rgba(212,160,23,.85)); }
.xw-fw-spin { transform-origin: 36px 36px; animation: xw-fw-turn 7s linear infinite; }
.xw-fw-spark { fill: var(--color-primary); filter: drop-shadow(0 0 4px rgba(212,160,23,.95)); }
@keyframes xw-fw-turn { to { transform: rotate(360deg); } }
.xw-fw-center { fill: rgba(255,255,255,.5); font-family: var(--font-mono); font-size: 11px; font-weight: 800; }
.xw-flywheel-label { display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.xw-fw-stage { color: #F4EFE6; font-size: .72rem; font-weight: 700; letter-spacing: .02em; }
.xw-fw-stage-pt { color: rgba(244,239,230,.4); font-size: .6rem; font-style: italic; }

/* Collapsed sidebar: shrink the wheel, drop the label */
.xw-shell.nav-collapsed .xw-flywheel { padding: 8px 0; }
.xw-shell.nav-collapsed .xw-flywheel-svg { width: 40px; height: 40px; }
.xw-shell.nav-collapsed .xw-flywheel-label { display: none; }

@media (prefers-reduced-motion: reduce) { .xw-fw-spin { animation: none; } }

/* ── 34. Motion micro-layer ───────────────────────────────────── */
/* Staggered entrance — add .xw-animate (+ optional style="--d:.08s") */
.xw-animate { opacity: 0; transform: translateY(10px); will-change: opacity, transform; }
.xw-animate.xw-in {
  opacity: 1;
  transform: none;
  transition: opacity .5s ease, transform .55s cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--d, 0s);
}
/* Self-drawing line — add .xw-draw and pathLength="1" to a polyline/path */
.xw-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: xw-draw 1s ease .1s forwards; }
@keyframes xw-draw { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  .xw-animate { opacity: 1; transform: none; transition: none; }
  .xw-draw { animation: none; stroke-dashoffset: 0; }
}

/* ── 35. Provenance chip — {source · freshness · confidence} ───── */
.xw-prov {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: .66rem;
  color: var(--color-text-muted);
  background: var(--color-bg-sunken);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
  cursor: default;
}
.xw-prov-src { font-weight: 600; color: var(--color-text-secondary); }
.xw-prov-sep { opacity: .45; }
.xw-prov-fresh { display: inline-flex; align-items: center; gap: 3px; }
.xw-prov-conf { display: inline-flex; align-items: center; gap: 2px; }
.xw-prov-conf i { width: 5px; height: 5px; border-radius: 50%; background: var(--color-border-strong); display: inline-block; }
.xw-prov-conf--high   i:nth-child(-n+3) { background: var(--color-conf-high); }
.xw-prov-conf--medium i:nth-child(-n+2) { background: var(--color-conf-medium); }
.xw-prov-conf--low    i:nth-child(-n+1) { background: var(--color-conf-low); }
.xw-prov-hyp { font-style: italic; color: var(--color-accent); font-size: .6rem; text-transform: uppercase; letter-spacing: .03em; }

/* ═══════════════════════════════════════════════════════════════
   APP COMPONENT KIT v1 — implemented from the design handoff
   ("XEWI App Kit"). Appended deliberately: these rules share the
   specificity of the originals above, so the later definition wins
   and legacy components are UPGRADED in place without rewriting
   1500 lines of history. Semantics are load-bearing:
     green = opening/good  ·  orange = contested/caution
     red   = locked/bad    ·  gold   = you / primary action
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Readable ink for tinted surfaces — the kit puts DARK text on a
     colour wash rather than white on a saturated fill (far better
     contrast at badge sizes). */
  --color-success-ink: #1F6B40;
  --color-warning-ink: #9A5A14;
  --color-danger-ink:  #A33327;
  --color-primary-ink: #8A6410;
  /* Same families, legible on the charcoal panel */
  --color-success-on-dark: #7FC79F;
  --color-warning-on-dark: #E8B478;
  --color-danger-on-dark:  #E58B7F;
  --field-bg: #FFFDF8;
}

/* ── Section header (label + rule + count) ─────────────────────── */
.xw-section-header {
  display: flex; align-items: center; gap: var(--space-3); margin: 0 0 var(--space-3);
}
.xw-section-header h2, .xw-section-header h3, .xw-section-header h4 {
  font-family: var(--font-display); font-weight: 700; font-size: .8125rem;
  letter-spacing: .12em; text-transform: uppercase; margin: 0; color: var(--color-text);
}
.xw-section-header::after { content: ""; flex: 1; height: 1px; background: var(--color-border); }
.xw-section-count {
  font-size: var(--font-size-xs); color: var(--color-text-muted); font-variant-numeric: tabular-nums;
}

/* ── Badges — tinted wash + dark ink ───────────────────────────── */
.xw-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .6875rem; font-weight: 700; letter-spacing: .06em;
  border-radius: var(--radius-sm); padding: 3px 10px;
  background: var(--color-bg-sunken); color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}
.xw-badge--success  { color: var(--color-success-ink); background: rgba(47,160,95,.14);  border-color: rgba(47,160,95,.40); }
.xw-badge--warn,
.xw-badge--warning  { color: var(--color-warning-ink); background: rgba(224,138,46,.14); border-color: rgba(224,138,46,.45); }
.xw-badge--danger   { color: var(--color-danger-ink);  background: rgba(209,75,61,.12);  border-color: rgba(209,75,61,.40); }
.xw-badge--neutral  { color: var(--color-text-secondary); background: var(--color-bg-sunken); border-color: var(--color-border); }
.xw-badge--primary  { color: var(--color-primary-ink); background: rgba(217,167,39,.16); border-color: rgba(217,167,39,.50); }

/* ── Confidence pill ───────────────────────────────────────────── */
.xw-confidence {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .71875rem; font-weight: 600; border-radius: var(--radius-full);
  padding: 3px 11px; border: 1px solid var(--color-border); color: var(--color-text-secondary);
}
.xw-confidence::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--color-text-muted); }
.xw-confidence--high   { color: var(--color-success-ink); border-color: rgba(47,160,95,.40); }
.xw-confidence--high::before   { background: var(--color-success); }
.xw-confidence--medium { color: var(--color-warning-ink); border-color: rgba(224,138,46,.45); }
.xw-confidence--medium::before { background: var(--color-warning); }
.xw-confidence--low::before    { background: var(--color-text-muted); }
/* absent is NOT low: a dashed pill says the source was never connected */
.xw-confidence--absent { color: var(--color-text-muted); border-style: dashed; }
.xw-confidence--absent::before { display: none; }

/* ── Provenance chip ───────────────────────────────────────────── */
.xw-provenance {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-size: .65625rem;
  color: var(--color-text-secondary); background: var(--color-bg-sunken);
  border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 2px 8px;
  font-variant-numeric: tabular-nums;
}
.xw-provenance--hypothesis { color: var(--color-warning-ink); background: rgba(224,138,46,.10); border-color: rgba(224,138,46,.40); }

/* ── Dense data table (grid based; set --cols per instance) ─────── */
.xw-table { width: 100%; }
.xw-table__scroll { overflow-x: auto; }
.xw-table__head, .xw-table__row {
  display: grid; grid-template-columns: var(--cols, repeat(auto-fit, minmax(90px, 1fr)));
  gap: var(--space-3); align-items: center; padding: 9px var(--space-5);
  border-bottom: 1px solid var(--color-border);
}
.xw-table__head {
  background: var(--color-bg-sunken);
  font-size: .6875rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--color-text-secondary);
}
.xw-table__head [aria-sort] { color: var(--color-text); cursor: pointer; }
.xw-table__row { font-size: .84375rem; padding: 11px var(--space-5); }
.xw-table__row:hover { background: var(--color-bg-sunken); }
.xw-table .num  { text-align: right; font-variant-numeric: tabular-nums; }
.xw-table .asin { font-family: var(--font-mono); font-size: .75rem; color: var(--color-text-secondary); }
.xw-table .truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Verdict panel ─────────────────────────────────────────────── */
.xw-verdict { background: var(--color-bg-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; }
.xw-verdict__header { display: flex; align-items: center; gap: var(--space-4); padding: 18px var(--space-5); border-bottom: 1px solid var(--color-border); flex-wrap: wrap; }
.xw-verdict__chip {
  font-family: var(--font-display); font-weight: 800; font-size: .8125rem;
  letter-spacing: .06em; border-radius: var(--radius-md); padding: 7px 14px;
  background: var(--color-bg-sunken); color: var(--color-text);
}
.xw-verdict__chip--enter       { background: var(--color-success); color: #F4EFE6; }
.xw-verdict__chip--conditional { background: var(--color-warning); color: #12151B; }
.xw-verdict__chip--avoid       { background: var(--color-danger);  color: #F4EFE6; }
/* client summary — the seconds-long read on top of a research verdict */
.xw-client-block { display: grid; gap: var(--space-2); }
.xw-free-brief { border-left: 3px solid var(--color-success); padding-left: var(--space-3); }
.xw-client-block__head { display: flex; gap: var(--space-3); align-items: flex-start; }
.xw-client-block__photo { width: 4.5rem; height: 4.5rem; object-fit: contain; border-radius: var(--radius-sm); background: var(--color-bg-sunken); flex-shrink: 0; }
.xw-client-block__head .xw-client-summary { margin-top: 0; }
@media (max-width: 480px) { .xw-client-block__photo { width: 3.2rem; height: 3.2rem; } }
.xw-client-summary { background: var(--color-bg-surface); border: 1px solid var(--color-border-strong); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5); display: grid; gap: var(--space-2); }
.xw-client-summary__head { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.xw-client-summary__score { margin-left: auto; font-family: var(--font-display); font-variant-numeric: tabular-nums; color: var(--color-text-secondary); }
.xw-client-summary__score b { font-size: 1.75rem; font-weight: 800; color: var(--color-text); }
.xw-radar-parts { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); margin: var(--space-2) 0; font-size: var(--text-xs); }
.xw-radar-parts b { letter-spacing: 1px; }
.xw-radar-markets { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: var(--space-1); margin: var(--space-2) 0; }
.xw-radar-market { display: flex; flex-direction: column; gap: 2px; padding: var(--space-1) var(--space-2); border: 1px solid var(--color-border); border-radius: var(--radius-sm); font-size: var(--text-xs); min-width: 0; }
.xw-radar-market--home { border-color: var(--color-border-strong); background: var(--color-bg-sunken); }
.xw-radar-market .xw-verdict__chip { align-self: flex-start; }
.xw-client-summary__text { margin: 0; font-size: .9375rem; line-height: 1.5; }
.xw-client-summary__reasons { margin: 0; padding-left: 1.1rem; font-size: .84375rem; color: var(--color-text-secondary); display: grid; gap: 2px; }
.xw-client-summary__diff { margin: 0; font-size: .84375rem; }
.xw-client-summary__basis > summary, .xw-client-detail > summary { cursor: pointer; font-size: .75rem; color: var(--color-text-muted); }
.xw-client-summary__part { font-size: .78125rem; padding: 4px 0; border-bottom: 1px solid var(--color-border); overflow-wrap: anywhere; }
.xw-client-detail > summary { padding: var(--space-1) 0; }
.xw-client-detail[open] > summary { margin-bottom: var(--space-2); }
.xw-verdict__chip--insufficient { background: var(--color-bg-sunken); color: var(--color-text-secondary); }
.xw-trust-gauge { display: flex; align-items: center; gap: 10px; }
.xw-trust-gauge text { font-family: var(--font-mono); }
.xw-evidence-row {
  display: flex; align-items: baseline; gap: 6px var(--space-3);
  padding: 11px var(--space-5); border-bottom: 1px solid var(--color-border); flex-wrap: wrap;
}
.xw-evidence-row__label { font-size: .6875rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-secondary); width: 88px; flex-shrink: 0; }
.xw-evidence-row__value { font-size: .84375rem; flex: 1; min-width: 160px; }
.xw-evidence-row__tag   { font-family: var(--font-mono); font-size: .65625rem; color: var(--color-text-muted); margin-left: auto; font-variant-numeric: tabular-nums; }
/* the named gap — absence is a first-class row, never a blank cell */
.xw-gap-row { background: rgba(224,138,46,.08); }
.xw-gap-row .xw-evidence-row__label { color: var(--color-warning-ink); }

/* ── Skeleton ──────────────────────────────────────────────────── */
@keyframes xwshimmer { 0% { background-position: -360px 0; } 100% { background-position: 360px 0; } }
.xw-skeleton { display: grid; gap: var(--space-3); }
.xw-skeleton__line, .xw-skeleton > i {
  display: block; height: 10px; border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--color-bg-sunken) 25%, #F7F2E8 50%, var(--color-bg-sunken) 75%);
  background-size: 720px 100%; animation: xwshimmer 1.4s linear infinite;
}
.xw-skeleton__line--title { height: 14px; width: 55%; }

/* ── Locked / upgrade state ────────────────────────────────────── */
.xw-locked { position: relative; overflow: hidden; }
.xw-locked__blur { filter: blur(4px); opacity: .5; pointer-events: none; }
.xw-locked__overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--space-2);
  text-align: center; padding: var(--space-4);
}
.xw-locked__tier {
  font-size: .6875rem; font-weight: 800; letter-spacing: .1em;
  color: var(--color-primary-ink); background: rgba(217,167,39,.16);
  border: 1px solid rgba(217,167,39,.5); border-radius: var(--radius-full); padding: 3px 12px;
}

/* ── Approval row (human-in-the-loop) ──────────────────────────── */
.xw-approval-row { display: flex; align-items: center; gap: var(--space-4); padding: 15px var(--space-5); border-bottom: 1px solid var(--color-border); flex-wrap: wrap; }
.xw-approval-row__main  { flex: 1; min-width: 240px; }
.xw-approval-row__title { margin: 0; font-size: .84375rem; font-weight: 600; }
.xw-approval-row__why   { margin: 4px 0 0; font-size: var(--font-size-xs); color: var(--color-text-secondary); line-height: 1.5; }
.xw-asks-first {
  font-size: .625rem; font-weight: 800; letter-spacing: .08em; white-space: nowrap;
  color: var(--color-warning-ink); background: rgba(224,138,46,.10);
  border: 1px solid rgba(224,138,46,.5); border-radius: var(--radius-sm); padding: 3px 9px;
}

/* ── KPI tile ──────────────────────────────────────────────────── */
.xw-kpi { background: var(--color-bg-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5); }
.xw-kpi__label { font-size: .6875rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-secondary); margin: 0 0 var(--space-2); }
.xw-kpi__value { font-family: var(--font-mono); font-weight: 600; font-size: 1.5rem; margin: 0; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.xw-kpi__delta { font-size: .71875rem; font-weight: 600; margin: 6px 0 0; font-variant-numeric: tabular-nums; }
.xw-kpi__delta--up   { color: var(--color-success-ink); }
.xw-kpi__delta--down { color: var(--color-danger-ink); }
.xw-kpi__delta span  { color: var(--color-text-muted); font-weight: 400; }

/* ── Horizontal bar chart ──────────────────────────────────────── */
/* The BEM block itself had no rule — only its elements did. Harmless until a
   template used it as a container, which is exactly what the undefined-class
   guard is for. */
.xw-barchart        { display: block; }
.xw-barchart__row   { display: flex; align-items: center; gap: var(--space-3); padding: 6px 0; }
.xw-barchart__label { font-size: .78125rem; width: 150px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xw-barchart__track { flex: 1; height: 9px; background: var(--color-bg-sunken); border-radius: var(--radius-full); overflow: hidden; }
.xw-barchart__fill  { height: 100%; border-radius: var(--radius-full); background: var(--color-text-muted); }
.xw-barchart__row--lead .xw-barchart__label { font-weight: 700; }
.xw-barchart__row--lead .xw-barchart__fill  { background: var(--color-primary); }
.xw-barchart__pct { font-family: var(--font-mono); font-size: .6875rem; color: var(--color-text-secondary); font-variant-numeric: tabular-nums; width: 34px; text-align: right; }

/* ── Charcoal panel variant (board / graph surfaces) ───────────── */
.xw-panel--dark   { background: var(--color-bg-sidebar); color: #F4EFE6; border-radius: var(--radius-lg); }
.xw-card--on-dark { background: #1D2129; border: 1px solid rgba(244,239,230,.15); border-radius: var(--radius-lg); color: #F4EFE6; }
.xw-card--on-dark .xw-provenance     { color: rgba(244,239,230,.62); background: rgba(244,239,230,.06); border-color: rgba(244,239,230,.15); }
.xw-card--on-dark .xw-badge--success { color: var(--color-success-on-dark); background: rgba(47,160,95,.14); border-color: rgba(47,160,95,.5); }
.xw-card--on-dark .xw-badge--warn,
.xw-card--on-dark .xw-badge--warning { color: var(--color-warning-on-dark); background: rgba(224,138,46,.14); border-color: rgba(224,138,46,.5); }
.xw-card--on-dark .xw-badge--danger  { color: var(--color-danger-on-dark);  background: rgba(209,75,61,.14);  border-color: rgba(209,75,61,.6); }
.xw-card--on-dark .xw-confidence--high { color: var(--color-success-on-dark); border-color: rgba(47,160,95,.5); }
.xw-legend       { display: flex; gap: var(--space-4); flex-wrap: wrap; font-size: .71875rem; color: rgba(244,239,230,.62); }
.xw-legend span  { display: flex; align-items: center; gap: 6px; }

/* ── Focus visibility (kit-wide) ───────────────────────────────── */
.xw-btn:focus-visible, .xw-input:focus-visible, .xw-select:focus-visible,
.xw-toggle:focus-visible, .xw-approval-row button:focus-visible {
  outline: 2px solid var(--color-primary); outline-offset: 2px;
}
.xw-btn--primary:focus-visible { outline-color: var(--color-text); }

/* ── Market redesign additions (design handoff) ─────────────────── */
/* ═══════════════════════════════════════════════════════════════
   Market redesign — NEW .xw-* classes only.
   Append inside the APP COMPONENT KIT v1 layer in xewi.css.
   ═══════════════════════════════════════════════════════════════ */

/* ── Regime stamp — every finding is a dated claim (MARKET_REFLEXIVITY) ── */
.xw-regime {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: .66rem;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-secondary);
  background: color-mix(in srgb, var(--color-primary) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-primary) 40%, transparent);
  border-radius: var(--radius-full);
  padding: 3px 10px;
  line-height: 1;
  white-space: nowrap;
  cursor: default;
}
.xw-regime__dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--color-primary);
  flex-shrink: 0;
}

/* ── The move — a surface ends in a decision, never a dead-end ── */
.xw-move {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: color-mix(in srgb, var(--color-primary) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-primary) 35%, transparent);
  border-radius: var(--radius-md);
}
.xw-move__label {
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-primary-hover);
  margin: 0 0 2px;
}
.xw-move__text {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  line-height: 1.4;
}

/* ── Verdict gates — pass/fail/pending chips (get_market_verdict.gates[]) ── */
.xw-gate {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  line-height: 1.4;
  border: 1px solid var(--color-border);
  background: var(--color-bg-sunken);
  color: var(--color-text-secondary);
}
.xw-gate--pass {
  color: var(--color-success);
  border-color: color-mix(in srgb, var(--color-success) 45%, transparent);
  background: color-mix(in srgb, var(--color-success) 10%, transparent);
}
.xw-gate--fail {
  color: var(--color-danger);
  border-color: color-mix(in srgb, var(--color-danger) 45%, transparent);
  background: color-mix(in srgb, var(--color-danger) 9%, transparent);
}
.xw-gate--pending {
  color: var(--color-warning);
  border-style: dashed;
  border-color: color-mix(in srgb, var(--color-warning) 50%, transparent);
  background: color-mix(in srgb, var(--color-warning) 8%, transparent);
}

/* ── Coverage row — per-source freshness feeding a verdict ──
   Freshness vocabulary shared with /api/health/ingestion:
   fresh / recent / lagging / stale / none. */
.xw-coverage {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: .66rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.xw-coverage__dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; background: var(--color-border-strong); }
.xw-coverage__dot--fresh   { background: var(--color-success); }
.xw-coverage__dot--recent  { background: var(--color-success); opacity: .55; }
.xw-coverage__dot--lagging { background: var(--color-warning); }
.xw-coverage__dot--stale   { background: var(--color-danger); }
.xw-coverage__dot--none    { background: transparent; outline: 1.5px dashed var(--color-border-strong); outline-offset: -1px; }

/* ── Evidence row — label · value · per-row provenance tag ──
   The kit verdict-panel row generalised for Alpine-driven panels. */
.xw-ev-row {
  display: flex;
  align-items: baseline;
  gap: 4px 10px;
  padding: var(--space-3) 2px;
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}
.xw-ev-row__label {
  font-size: .625rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  width: 4.4rem;
  flex-shrink: 0;
}
.xw-ev-row__value {
  font-size: var(--font-size-sm);
  flex: 1;
  min-width: 7rem;
  font-variant-numeric: tabular-nums;
}
.xw-ev-row__tag {
  font-family: var(--font-mono);
  font-size: .6rem;
  color: var(--color-text-muted);
  margin-left: auto;
  white-space: nowrap;
}
.xw-ev-row--gap { background: color-mix(in srgb, var(--color-warning) 7%, transparent); }
/* first-party lane (SP-API return topics) — visually distinct from scraped voice */
.xw-ev-row--firstparty {
  background: color-mix(in srgb, var(--color-text) 4%, transparent);
  border-left: 3px solid var(--color-text);
  padding-left: var(--space-3);
}

/* ── Confounder chip — a caution about a reading, not a reading ── */
.xw-confound {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .66rem;
  font-weight: 600;
  color: var(--color-warning);
  border: 1px dashed color-mix(in srgb, var(--color-warning) 55%, transparent);
  background: color-mix(in srgb, var(--color-warning) 7%, transparent);
  border-radius: var(--radius-full);
  padding: 3px 10px;
  line-height: 1.3;
}

/* ── Constraint chip on a move (inventory bounds the play) ── */
.xw-constraint {
  display: inline-flex;
  align-items: center;
  font-size: .66rem;
  font-weight: 600;
  color: var(--color-warning);
  border: 1px dashed color-mix(in srgb, var(--color-warning) 55%, transparent);
  border-radius: var(--radius-full);
  padding: 3px 10px;
}
/* ── Ledger-record chip — always carries its n ── */
.xw-record {
  display: inline-flex;
  align-items: center;
  font-size: .66rem;
  font-weight: 600;
  color: var(--color-success);
  border: 1px solid color-mix(in srgb, var(--color-success) 45%, transparent);
  border-radius: var(--radius-full);
  padding: 3px 10px;
  font-variant-numeric: tabular-nums;
}

/* ── command redesign additions (design handoff) ── */
/* ═══════════════════════════════════════════════════════════════
   Command redesign — NEW .xw-* classes only.
   Append inside the APP COMPONENT KIT v1 layer, AFTER Market's
   additions (reuses .xw-ev-row, .xw-record, .xw-constraint from there).
   ═══════════════════════════════════════════════════════════════ */

/* ── Risk class — is this money/brand (asks first) or reversible? ── */
.xw-risk {
  display: inline-flex;
  align-items: center;
  font-size: .625rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  padding: 3px 9px;
  line-height: 1.3;
}
.xw-risk--money {
  color: var(--color-warning);
  border: 1px solid color-mix(in srgb, var(--color-warning) 55%, transparent);
  background: color-mix(in srgb, var(--color-warning) 9%, transparent);
}
.xw-risk--brand {
  color: var(--color-danger);
  border: 1px solid color-mix(in srgb, var(--color-danger) 45%, transparent);
  background: color-mix(in srgb, var(--color-danger) 8%, transparent);
}
.xw-risk--reversible {
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  background: var(--color-bg-sunken);
}

/* ── Expiry — unapproved actions never linger armed ── */
.xw-expiry {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: .66rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}
.xw-expiry--soon { color: var(--color-danger); font-weight: 600; }

/* ── health redesign additions (design handoff) ── */
/* ═══════════════════════════════════════════════════════════════
   Health — NEW .xw-* classes only. Reuses .xw-coverage__dot--*,
   .xw-gap-row, .xw-regime.
   ═══════════════════════════════════════════════════════════════ */

/* ── Trust banner — the roll-up verdict on today's data ── */
.xw-trust-banner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--color-bg-surface);
}
.xw-trust-banner--ok {
  border: 1.5px solid color-mix(in srgb, var(--color-success) 45%, transparent);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--color-success) 8%, transparent), transparent 60%),
    var(--color-bg-surface);
}
.xw-trust-banner--degraded {
  border: 1.5px solid color-mix(in srgb, var(--color-warning) 55%, transparent);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--color-warning) 9%, transparent), transparent 60%),
    var(--color-bg-surface);
}

/* ── Lane row — source · freshness · what it feeds · impact ── */
.xw-lane__row {
  display: flex;
  align-items: baseline;
  gap: 4px 12px;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}
.xw-lane__source { font-weight: 600; font-size: var(--font-size-sm); width: 9rem; flex-shrink: 0; }
.xw-lane__feeds  { font-size: var(--font-size-xs); color: var(--color-text-muted); flex: 1; min-width: 8rem; }
.xw-lane__stamp  { font-family: var(--font-mono); font-size: .66rem; color: var(--color-text-muted); margin-left: auto; font-variant-numeric: tabular-nums; }
.xw-lane__impact { width: 100%; font-size: var(--font-size-xs); color: var(--color-warning); font-weight: 600; }

/* ── listings redesign additions (design handoff) ── */
/* ═══════════════════════════════════════════════════════════════
   Listings redesign — NEW .xw-* classes only. Append to the kit
   layer after earlier additions (reuses .xw-ev-row(--firstparty),
   .xw-diffline--old/--new, .xw-risk--brand, .xw-record, .xw-thumb).
   ═══════════════════════════════════════════════════════════════ */

/* ── Living product card (the rail) ── */
.xw-product-card {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  width: 100%;
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-surface);
  cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
}
.xw-product-card:hover { border-color: var(--color-border-strong); box-shadow: var(--shadow-sm); }
.xw-product-card--active { border-color: var(--color-primary); box-shadow: 0 0 0 1px var(--color-primary); }
.xw-product-card__health {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .66rem;
  font-weight: 600;
}
.xw-product-card__health i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.xw-product-card__health--ok i          { background: var(--color-success); }
.xw-product-card__health--opportunity i { background: var(--color-primary); }
.xw-product-card__health--risk i        { background: var(--color-warning); }

/* ── The WHY panel — a rewrite arrives with its reason attached ── */
.xw-why {
  border: 1.5px solid color-mix(in srgb, var(--color-primary) 50%, transparent);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--color-primary) 8%, transparent), transparent 55%),
    var(--color-bg-surface);
  padding: var(--space-4) var(--space-5);
}
.xw-why__flag {
  font-family: var(--font-mono);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--color-primary-hover);
  text-transform: uppercase;
  margin: 0 0 var(--space-2);
}

/* ── Claim gate strip — risk phrases held out of copy ── */
.xw-claimgate {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-3) var(--space-4);
  border: 1px dashed color-mix(in srgb, var(--color-warning) 55%, transparent);
  background: color-mix(in srgb, var(--color-warning) 7%, transparent);
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}
.xw-claimgate code {
  font-family: var(--font-mono);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
}

/* ── Launch stepper ── */
.xw-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem; height: 1.7rem;
  border-radius: 50%;
  font-size: var(--font-size-xs);
  font-weight: 800;
  flex-shrink: 0;
  border: 1.5px solid var(--color-border-strong);
  color: var(--color-text-secondary);
  background: var(--color-bg-surface);
}
.xw-step--done   { background: var(--color-success); border-color: var(--color-success); color: #fff; }
.xw-step--active { background: var(--color-primary); border-color: var(--color-primary); color: #231B05; }
.xw-step--locked { border-style: dashed; color: var(--color-text-muted); }

/* ── A+ Content state machine — draft → submitted → approved → published ── */
.xw-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .625rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  padding: 3px 11px;
  color: var(--color-text-muted);
  border: 1px dashed var(--color-border-strong);
}
.xw-state--current {
  color: var(--color-primary-hover);
  border: 1.5px solid var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 9%, transparent);
}
.xw-state--done {
  color: var(--color-success);
  border: 1px solid color-mix(in srgb, var(--color-success) 45%, transparent);
  background: color-mix(in srgb, var(--color-success) 8%, transparent);
}
.xw-state-arrow { color: var(--color-text-muted); font-size: var(--font-size-xs); }

/* ── outcomes redesign additions (design handoff) ── */
/* ═══════════════════════════════════════════════════════════════
   Outcomes redesign — NEW .xw-* classes only.
   Append inside the APP COMPONENT KIT v1 layer, after Market/Command
   additions (reuses .xw-record, .xw-ev-row, .xw-regime, .xw-thumb).
   ═══════════════════════════════════════════════════════════════ */

/* ── Regime-shift alert — the highest-value finding, styled like one ── */
.xw-shift {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: var(--space-4) var(--space-5);
  border: 1.5px solid color-mix(in srgb, var(--color-primary) 55%, transparent);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--color-primary) 10%, transparent), transparent 60%),
    var(--color-bg-surface);
  margin-bottom: var(--space-3);
}
.xw-shift__flag {
  font-family: var(--font-mono);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: #231B05;
  background: var(--color-primary);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  flex-shrink: 0;
}

/* ── Outcome grade chip ── */
.xw-grade {
  display: inline-flex;
  align-items: center;
  font-size: .625rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  padding: 3px 9px;
  line-height: 1.3;
}
.xw-grade--improved {
  color: var(--color-success);
  border: 1px solid color-mix(in srgb, var(--color-success) 45%, transparent);
  background: color-mix(in srgb, var(--color-success) 9%, transparent);
}
.xw-grade--worsened {
  color: var(--color-danger);
  border: 1px solid color-mix(in srgb, var(--color-danger) 45%, transparent);
  background: color-mix(in srgb, var(--color-danger) 8%, transparent);
}
.xw-grade--flat {
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  background: var(--color-bg-sunken);
}
.xw-grade--measuring {
  color: var(--color-text-secondary);
  border: 1px dashed var(--color-border-strong);
  background: transparent;
}

/* ── Ledger predicted→actual arrow ── */
.xw-ledger-arrow {
  color: var(--color-primary);
  font-weight: 700;
  margin: 0 4px;
}

/* ── Measuring state — a countdown, never a provisional grade ── */
.xw-measuring {
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  border-bottom: 1px dashed var(--color-border-strong);
}

/* ── Hypothesis→confirmed-dynamic upgrade chip (gold — matches the
      confirmed edge on the Market board) ── */
.xw-upgrade {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .66rem;
  font-weight: 700;
  color: var(--color-primary-hover);
  border: 1px solid color-mix(in srgb, var(--color-primary) 50%, transparent);
  background: color-mix(in srgb, var(--color-primary) 9%, transparent);
  border-radius: var(--radius-full);
  padding: 3px 10px;
  margin-top: 4px;
}

/* ── learn redesign additions (design handoff) ── */
/* ═══════════════════════════════════════════════════════════════
   Learn / Patterns — NEW .xw-* classes only.
   Append inside the APP COMPONENT KIT v1 layer, after earlier
   additions (reuses .xw-record, .xw-ev-row, .xw-thumb, .xw-grade--*).
   ═══════════════════════════════════════════════════════════════ */

/* ── Lens card — one queryable memory ── */
.xw-lens {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.xw-lens__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.xw-lens__scope {
  font-family: var(--font-mono);
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .04em;
  border-radius: var(--radius-full);
  padding: 3px 10px;
  white-space: nowrap;
}
.xw-lens__scope--private {
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  background: var(--color-bg-sunken);
}
.xw-lens__scope--market {
  color: var(--color-primary-hover);
  border: 1px solid color-mix(in srgb, var(--color-primary) 45%, transparent);
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
}
.xw-lens__tool {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin: var(--space-4) 0 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
  line-height: 1.5;
}

/* ── Win-likeness gauge (0–1 vs YOUR winners) ── */
.xw-likeness {
  --p: 0;
  width: 3.6rem; height: 3.6rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: conic-gradient(var(--color-primary) calc(var(--p) * 1%), var(--color-bg-sunken) 0);
}
.xw-likeness span {
  width: 2.85rem; height: 2.85rem;
  border-radius: 50%;
  background: var(--color-bg-surface);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: var(--font-size-sm);
  font-variant-numeric: tabular-nums;
}

/* ── Similarity match row ── */
.xw-sim-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
}
.xw-sim-row__pct {
  font-family: var(--font-mono);
  font-size: .66rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  width: 2.6rem;
  flex-shrink: 0;
  text-align: right;
}

/* ── Outcome chips (vector-layer vocabulary) ── */
.xw-outcome {
  display: inline-flex;
  align-items: center;
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  flex-shrink: 0;
}
.xw-outcome--winner, .xw-outcome--converted {
  color: var(--color-success);
  border: 1px solid color-mix(in srgb, var(--color-success) 45%, transparent);
  background: color-mix(in srgb, var(--color-success) 9%, transparent);
}
.xw-outcome--loser, .xw-outcome--wasted {
  color: var(--color-danger);
  border: 1px solid color-mix(in srgb, var(--color-danger) 45%, transparent);
  background: color-mix(in srgb, var(--color-danger) 8%, transparent);
}
.xw-outcome--tracked {
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  background: var(--color-bg-sunken);
}

/* ── research redesign additions (design handoff) ── */
/* ═══════════════════════════════════════════════════════════════
   Research — NEW .xw-* classes only. Append after earlier additions
   (reuses .xw-gate--*, .xw-likeness, .xw-ev-row, .xw-record, .xw-thumb).
   ═══════════════════════════════════════════════════════════════ */

/* ── Funnel spine — discovered → gates → validated → ENTER ── */
.xw-funnel {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}
.xw-funnel__stage {
  border: 1px solid var(--color-border);
  background: var(--color-bg-surface);
  border-radius: var(--radius-full);
  padding: 5px 14px;
  font-variant-numeric: tabular-nums;
}
.xw-funnel__stage b { font-family: var(--font-mono); font-weight: 600; }
.xw-funnel__stage--enter {
  color: var(--color-success);
  border-color: color-mix(in srgb, var(--color-success) 45%, transparent);
  background: color-mix(in srgb, var(--color-success) 8%, transparent);
  font-weight: 700;
}
.xw-funnel__arrow { color: var(--color-text-muted); }

/* ── Why a candidate was dropped — exclusions are named, gate by gate ── */
.xw-gatechip--excluded {
  display: inline-flex;
  align-items: center;
  font-size: .6rem;
  font-weight: 600;
  color: var(--color-text-muted);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--color-danger) 60%, transparent);
}

/* ── workflows redesign additions (design handoff) ── */
/* ═══════════════════════════════════════════════════════════════
   Workflows — NEW .xw-* classes only.
   ═══════════════════════════════════════════════════════════════ */

/* ── Run audit timeline — trigger → conditions → staged → outcome ── */
.xw-runline {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-2) 0 var(--space-2) var(--space-5);
}
.xw-runline::before { /* connector */
  content: '';
  position: absolute;
  left: 7px; top: 0; bottom: 0;
  width: 2px;
  background: var(--color-border);
}
.xw-runline:first-child::before { top: 50%; }
.xw-runline:last-child::before  { bottom: 50%; }
.xw-runline__dot {
  position: absolute;
  left: 3px; top: calc(50% - 5px);
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--color-bg-surface);
  border: 2px solid var(--color-border-strong);
}
.xw-runline--fired  .xw-runline__dot { border-color: var(--color-primary); background: var(--color-primary); }
.xw-runline--pass   .xw-runline__dot { border-color: var(--color-success); }
.xw-runline--fail   .xw-runline__dot { border-color: var(--color-danger); }
.xw-runline--staged .xw-runline__dot { border-color: var(--color-warning); background: var(--color-warning); }
.xw-runline__label {
  font-size: .625rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  width: 6.4rem;
  flex-shrink: 0;
}
.xw-runline__text { font-size: var(--font-size-xs); color: var(--color-text); flex: 1; min-width: 10rem; line-height: 1.5; }
.xw-runline__tag  { font-family: var(--font-mono); font-size: .6rem; color: var(--color-text-muted); margin-left: auto; white-space: nowrap; }

/* ── ads redesign additions (design handoff) ── */
/* ═══════════════════════════════════════════════════════════════
   Ads redesign — NEW .xw-* classes only. Append after earlier
   additions (reuses .xw-ev-row, .xw-record, .xw-confound, .xw-regime,
   .xw-pill-tabs, .xw-thumb).
   ═══════════════════════════════════════════════════════════════ */

/* ── Overlapping product thumbs — which ASINs a campaign runs on ── */
.xw-thumbstack { display: inline-flex; align-items: center; }
.xw-thumbstack img, .xw-thumbstack .xw-thumb {
  width: 1.9rem; height: 1.9rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--color-bg-surface);
  background: var(--color-bg-sunken);
  object-fit: contain;
  margin-left: -8px;
}
.xw-thumbstack > :first-child { margin-left: 0; }
.xw-thumbstack__more {
  font-family: var(--font-mono);
  font-size: .6rem;
  color: var(--color-text-muted);
  margin-left: 4px;
}

/* ── Organic vs paid split bar ── */
.xw-split {
  display: flex;
  height: 9px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--color-bg-sunken);
  flex: 1;
  min-width: 6rem;
}
.xw-split__organic { background: var(--color-success); }
.xw-split__paid    { background: var(--color-primary); }

/* ── ACOS judged against returns-adjusted breakeven ── */
.xw-acos--under { color: var(--color-success); font-weight: 700; font-variant-numeric: tabular-nums; }
.xw-acos--over  { color: var(--color-danger);  font-weight: 700; font-variant-numeric: tabular-nums; }
.xw-acos--nobe  { color: var(--color-text-secondary); font-variant-numeric: tabular-nums;
                  border-bottom: 1px dashed var(--color-border-strong); /* no breakeven on file — a gap, not a judgement */ }

/* ── Per-card export affordance — provenance travels with the file ── */
.xw-export {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: .66rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  background: var(--color-bg-surface);
  border-radius: var(--radius-md);
  padding: 5px 10px;
  cursor: pointer;
  flex-shrink: 0;
}
.xw-export:hover { border-color: var(--color-primary); color: var(--color-text); }

/* ── Auth split layout (login / signup) ───────────────────────────
   The brand panel states what XEWI is before sign-in; it collapses away
   on narrow screens so the form is never pushed below the fold. */
.xw-auth-split{
  display:grid; grid-template-columns:1.05fr .95fr; gap:clamp(20px,4vw,44px);
  align-items:center; max-width:60rem; margin:0 auto; width:100%;
}
@media (max-width:860px){
  .xw-auth-split{ grid-template-columns:1fr; max-width:26rem; }
  .xw-auth-brand{ display:none; }         /* form first on mobile */
}
.xw-auth-brand{
  background:
    radial-gradient(120% 90% at 80% -10%, rgba(217,167,39,.16) 0%, transparent 60%),
    linear-gradient(150deg, #1D2129 0%, #12151B 72%);
  border:1px solid rgba(244,239,230,.10);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-lg);
  padding:clamp(22px,3vw,34px);
  color:#F4EFE6;
}
.xw-auth-brand__title{
  font-family:var(--font-display); font-weight:800; font-size:clamp(19px,2.2vw,25px);
  line-height:1.2; letter-spacing:-0.01em; margin:0 0 8px; color:#F4EFE6;
}
.xw-auth-brand__sub{ font-size:.875rem; line-height:1.55; color:rgba(244,239,230,.62); margin:0; }
.xw-auth-brand__legend{
  display:flex; gap:14px; flex-wrap:wrap; margin-top:16px;
  font-size:.6875rem; color:rgba(244,239,230,.62);
}
.xw-auth-brand__legend span{ display:inline-flex; align-items:center; gap:6px; }
.xw-auth-brand__legend i{ width:9px; height:9px; border-radius:50%; display:inline-block; }
.xw-auth-form{ width:100%; }

/* ── Pop-up cards (data-xw-pop, see xewi.js) + trend charts ──── */
.xw-pop{
  position:fixed; z-index:60; width:min(30rem, calc(100vw - 24px));
  max-height:calc(100dvh - 24px); overflow:auto;
  background:var(--color-bg-surface); border:1px solid var(--color-border-strong);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-lg);
  padding:var(--space-4); display:grid; gap:var(--space-2);
  animation:xw-pop-in .14s ease-out;
}
.xw-pop--sheet{ left:12px; right:12px; bottom:12px; top:auto; width:auto; max-height:80dvh; }
@keyframes xw-pop-in{ from{ opacity:0; transform:translateY(4px); } to{ opacity:1; transform:none; } }
@media (prefers-reduced-motion: reduce){ .xw-pop{ animation:none; } }
.xw-pop-x{
  position:absolute; top:6px; right:8px; border:none; background:none; cursor:pointer;
  font-size:1.25rem; line-height:1; color:var(--color-text-muted); padding:4px;
}
.xw-pop-x:hover{ color:var(--color-text); }
.xw-pop-head{ display:flex; gap:var(--space-3); align-items:center; padding-right:var(--space-6); }
.xw-pop-metrics{ display:grid; grid-template-columns:1fr 1fr; gap:var(--space-2) var(--space-4); margin:var(--space-2) 0; }
.xw-pop-metric{ display:grid; gap:1px; font-size:var(--font-size-sm); padding-bottom:var(--space-1); border-bottom:1px solid var(--color-border); }
.xw-row-pop{ cursor:pointer; transition:background .12s; }
.xw-row-pop:hover, .xw-row-pop.xw-pop-open{ background:var(--color-bg-sunken); }
.xw-row-pop:focus-visible{ outline:2px solid var(--color-primary); outline-offset:-2px; }
.xw-pthumb{
  object-fit:contain; background:#fff; border:1px solid var(--color-border);
  border-radius:var(--radius-md); flex-shrink:0;
}
.xw-trend-kpis{ display:grid; gap:var(--space-3); grid-template-columns:repeat(auto-fit, minmax(10.5rem, 1fr)); }
.xw-kpi--click{
  text-align:left; font:inherit; color:inherit; cursor:pointer; padding:var(--space-4);
  transition:border-color .12s, box-shadow .12s, transform .12s;
}
.xw-kpi--click:hover, .xw-kpi--click.xw-pop-open{ border-color:var(--color-primary); box-shadow:var(--shadow-md); }
.xw-kpi--click:focus-visible{ outline:2px solid var(--color-primary); outline-offset:2px; }
.xw-chart-legend{ display:flex; gap:var(--space-4); flex-wrap:wrap; font-size:var(--font-size-xs); margin-bottom:var(--space-2); }
.xw-chart-legend span{ display:inline-flex; align-items:center; gap:6px; }
.xw-chart-legend i{ width:12px; height:10px; border-radius:2px; display:inline-block; }
.xw-chart .xw-chart-hit:hover{ fill:rgba(29,33,41,.06) !important; }
.xw-table--nums td:not(:first-child), .xw-table--nums th{ white-space:nowrap; }

/* ── Command queue: grouped by who it's for (command_router._render_group) ── */
.xw-command-queue{ display:grid; gap:var(--space-4); }
.xw-cmd-group{ padding:0; overflow:hidden; }
.xw-cmd-group-head{
  display:flex; gap:var(--space-4); align-items:center; padding:var(--space-4) var(--space-5);
  background:linear-gradient(90deg, rgba(217,167,39,.10), transparent 70%);
  border-bottom:1px solid var(--color-border);
}
.xw-cmd-group-title{ font-family:var(--font-display); font-size:var(--font-size-lg); margin:2px 0; }
/* Groups are <details>: the header line is the summary; folded groups lose
   the divider and show a chevron. */
.xw-cmd-group > summary.xw-cmd-group-head{ list-style:none; cursor:pointer; }
.xw-cmd-group > summary.xw-cmd-group-head::-webkit-details-marker{ display:none; }
.xw-cmd-group > summary.xw-cmd-group-head::after{ content:"▾"; color:var(--color-text-muted); margin-left:auto; transition:transform .15s; }
.xw-cmd-group:not([open]) > summary.xw-cmd-group-head{ border-bottom:0; }
.xw-cmd-group:not([open]) > summary.xw-cmd-group-head::after{ transform:rotate(-90deg); }
.xw-cmd-group-photos{ display:flex; flex-shrink:0; }
.xw-cmd-group-photos > *{ margin-left:-.6rem; box-shadow:0 0 0 2px var(--color-bg-surface); }
.xw-cmd-group-photos > *:first-child{ margin-left:0; }
.xw-cmd-items > .xw-cmd-item + .xw-cmd-item{ border-top:1px solid var(--color-border); }
.xw-cmd-item{ display:flex; gap:var(--space-3); align-items:center; padding:var(--space-3) var(--space-5); }
.xw-cmd-item-main{ display:flex; gap:var(--space-3); align-items:center; flex:1; min-width:0;
  margin:calc(-1 * var(--space-2)); padding:var(--space-2); border-radius:var(--radius-md); }
.xw-cmd-item-title{ font-size:var(--font-size-sm); margin:2px 0; }
.xw-cmd-item-side{ width:11rem; flex-shrink:0; display:grid; gap:4px; }
.xw-command-card-meta{ display:flex; gap:var(--space-1); align-items:center; flex-wrap:wrap; font-size:var(--font-size-xs); }
.xw-command-card-actions{ display:flex; gap:var(--space-2); justify-content:flex-end; flex-wrap:wrap; }
.xw-acos-track{ position:relative; height:6px; background:var(--color-bg-sunken); border-radius:3px; margin-top:3px; }
.xw-acos-track b{ position:absolute; left:0; top:0; bottom:0; border-radius:3px; }
.xw-acos-mark{ position:absolute; top:-3px; width:2px; height:12px; background:var(--color-text); }
.xw-acos-mark--be{ background:var(--color-danger); }
.xw-cmd-prod{ display:inline-flex; align-items:center; gap:6px; border:1px solid var(--color-border);
  background:var(--color-bg-surface); border-radius:var(--radius-md); padding:3px 8px 3px 3px; cursor:pointer; }
.xw-cmd-prod:hover{ border-color:var(--color-primary); }
@media (max-width:760px){
  .xw-cmd-item{ flex-direction:column; align-items:stretch; }
  .xw-cmd-item-main{ flex-wrap:wrap; }
  .xw-cmd-item-side{ width:100%; }
}

/* ── Agência: GoHighLevel digest + gap log ─────────────────────── */
.xw-ghl-grid{ display:grid; gap:var(--space-3); grid-template-columns:repeat(auto-fit, minmax(17rem, 1fr)); }
.xw-ghl-block{ background:var(--color-bg-sunken); border-radius:var(--radius-lg); padding:var(--space-3) var(--space-4); min-width:0; }
.xw-ghl-block-head{ display:flex; justify-content:space-between; align-items:center; gap:var(--space-2); margin-bottom:var(--space-2); }
.xw-ghl-block-head h3{ margin:0; font-size:var(--font-size-sm); font-weight:600; }
.xw-ghl-note{ margin:0; font-size:var(--font-size-xs); color:var(--color-text-muted); }
.xw-ghl-note code{ font-family:var(--font-mono); background:var(--color-bg-surface); padding:1px 5px; border-radius:var(--radius-sm); }
.xw-ghl-list{ margin:0; padding:0; list-style:none; display:grid; gap:4px; font-size:var(--font-size-sm); }
.xw-ghl-list li{ padding:4px 0; border-bottom:1px solid var(--color-border); }
.xw-ghl-list li:last-child{ border-bottom:none; }
/* GHL to-do rows: each one a button that opens the contact card. */
.xw-ghl-row{ display:flex; align-items:center; gap:var(--space-2); width:100%; padding:6px 4px; margin:0;
  background:none; border:0; border-radius:var(--radius-md); text-align:left; font:inherit; color:inherit; cursor:pointer; }
.xw-ghl-row:hover{ background:var(--color-bg-surface); }
.xw-ghl-row:focus-visible{ outline:2px solid var(--color-primary); outline-offset:1px; }
.xw-ghl-row--static{ cursor:default; }
.xw-ghl-row--static:hover{ background:none; }
.xw-ghl-list{ grid-template-columns:minmax(0, 1fr); }
.xw-ghl-list li{ padding:0; min-width:0; }
.xw-ghl-row-main{ display:flex; flex-direction:column; min-width:0; flex:1; }
.xw-ghl-row-title{ font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.xw-ghl-row-sub{ font-size:var(--font-size-xs); color:var(--color-text-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.xw-ghl-dot{ display:inline-block; width:7px; height:7px; border-radius:50%; background:var(--color-primary); vertical-align:middle; }
.xw-ghl-filters{ display:flex; gap:4px; flex-wrap:wrap; margin-bottom:var(--space-2); }
.xw-ghl-filters .xw-chip{ display:inline-flex; align-items:center; gap:4px; padding:2px 8px; }
.xw-ghl-more{ margin-top:var(--space-2); }
.xw-ghl-time{ font-variant-numeric:tabular-nums; font-weight:600; font-size:var(--font-size-sm); min-width:3rem; }
.xw-ghl-call{ display:flex; align-items:center; gap:var(--space-1); }
.xw-ghl-call > .xw-ghl-row{ flex:1; min-width:0; }
.xw-ghl-call--next{ background:var(--color-bg-surface); border-radius:var(--radius-md); box-shadow:inset 3px 0 0 var(--color-primary); }
.xw-ghl-call--past .xw-ghl-row{ opacity:.6; }
.xw-ghl-join{ flex-shrink:0; }
.xw-ghl-examples{ margin-top:var(--space-2); }
.xw-ghl-examples summary{ cursor:pointer; }
/* Platform icons: the channel a message came from. */
.xw-ch{ display:inline-flex; align-items:center; justify-content:center; width:22px; height:22px; flex-shrink:0;
  border-radius:50%; color:#fff; background:var(--color-text-muted); }
.xw-ch svg{ width:13px; height:13px; }
.xw-ch--instagram{ background:linear-gradient(45deg,#f09433,#dc2743 50%,#bc1888); }
.xw-ch--whatsapp{ background:#25d366; }
.xw-ch--messenger{ background:#0a7cff; }
.xw-ch--email{ background:#5b6b7f; }
.xw-ch--sms{ background:#0e9f8f; }
.xw-ch--call{ background:#7c5cff; }
.xw-ch--chat{ background:#d97706; }
.xw-ch--google{ background:#4285f4; }
/* The contact card side panel. */
.xw-drawer--wide{ width:34rem; }
.xw-ghl-contact{ font-size:var(--font-size-sm); }
.xw-ghl-contact-head{ display:flex; gap:var(--space-2); align-items:flex-start; }
.xw-ghl-contact-head .xw-ch{ width:30px; height:30px; margin-top:2px; }
.xw-ghl-contact-head .xw-ch svg{ width:17px; height:17px; }
.xw-ghl-contact-name{ margin:0; font-size:var(--font-size-lg); }
.xw-ghl-tags{ display:flex; gap:4px; flex-wrap:wrap; margin-top:var(--space-1); }
.xw-ghl-actions{ display:flex; gap:var(--space-2); flex-wrap:wrap; margin:var(--space-3) 0; }
.xw-ghl-actform{ display:flex; flex-wrap:wrap; gap:var(--space-2); align-items:center; margin-top:var(--space-2); }
.xw-ghl-actform > select, .xw-ghl-actform > input{ width:auto; max-width:100%; }
.xw-ghl-actfields{ display:flex; flex-wrap:wrap; gap:var(--space-2); width:100%; }
.xw-ghl-actfields textarea{ width:100%; }
.xw-input--sm{ padding:var(--space-1) var(--space-2); font-size:var(--font-size-sm); width:auto; max-width:100%; }
.xw-ghl-sec{ border-top:1px solid var(--color-border); padding:var(--space-3) 0 0; margin-top:var(--space-3); }
.xw-ghl-sec h4{ display:inline; margin:0; font-size:var(--font-size-sm); font-weight:600; }
.xw-ghl-sec > h4{ display:block; margin-bottom:var(--space-2); }
.xw-ghl-sec > summary{ cursor:pointer; margin-bottom:var(--space-2); }
.xw-ghl-callcard, .xw-ghl-boardcard{ background:var(--color-bg-sunken); border-radius:var(--radius-md); padding:var(--space-2) var(--space-3); margin-bottom:var(--space-2); }
.xw-ghl-callcard--focus{ box-shadow:inset 3px 0 0 var(--color-primary); }
.xw-ghl-callcard-head{ display:flex; justify-content:space-between; align-items:center; gap:var(--space-2); }
.xw-ghl-notes{ margin:var(--space-2) 0 0; padding-left:1.1rem; display:grid; gap:4px; font-size:var(--font-size-sm); overflow-wrap:anywhere; }
.xw-ghl-chat{ list-style:none; margin:0; padding:0; display:grid; gap:var(--space-2); }
.xw-ghl-msg{ max-width:88%; padding:var(--space-2) var(--space-3); border-radius:var(--radius-lg); background:var(--color-bg-sunken); font-size:var(--font-size-sm); }
.xw-ghl-msg--outbound{ justify-self:end; background:#fef9ec; border:1px solid var(--color-border); }
.xw-ghl-msg--note{ justify-self:stretch; max-width:100%; background:none; border:1px dashed var(--color-border-strong); }
.xw-ghl-msg-meta{ display:flex; align-items:center; gap:4px; font-size:var(--font-size-xs); color:var(--color-text-muted); margin-bottom:2px; }
.xw-ghl-msg-meta .xw-ch{ width:16px; height:16px; }
.xw-ghl-msg-meta .xw-ch svg{ width:10px; height:10px; }
.xw-ghl-msg-body{ white-space:pre-wrap; overflow-wrap:anywhere; }
.xw-ghl-meeting{ margin-bottom:var(--space-2); }
.xw-ghl-meeting summary{ cursor:pointer; }
.xw-ghl-summary{ white-space:pre-wrap; font-size:var(--font-size-sm); margin-top:var(--space-2); max-height:18rem; overflow:auto; overflow-wrap:anywhere; }
/* Orders / Problems queues: one collapsible card per item. */
.xw-queue{ display:grid; gap:var(--space-2); }
.xw-queue-item{ border:1px solid var(--color-border); border-radius:var(--radius-md); background:var(--color-bg-surface); }
.xw-queue-item[open]{ border-color:var(--color-border-strong); }
.xw-queue-item > summary{ display:flex; align-items:center; gap:var(--space-2); padding:var(--space-2) var(--space-3); cursor:pointer; list-style:none; }
.xw-queue-item > summary::-webkit-details-marker{ display:none; }
.xw-queue-item > summary::after{ content:"▸"; color:var(--color-text-muted); margin-left:auto; }
.xw-queue-item[open] > summary::after{ content:"▾"; }
.xw-queue-main{ display:flex; flex-direction:column; min-width:0; flex:1; }
.xw-queue-title{ font-size:var(--font-size-sm); font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.xw-queue-sub{ font-size:var(--font-size-xs); color:var(--color-text-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.xw-queue-body{ padding:0 var(--space-3) var(--space-3); display:grid; gap:var(--space-2); }
.xw-queue-facts{ display:grid; grid-template-columns:max-content 1fr; gap:2px var(--space-3); font-size:var(--font-size-xs); margin:0; }
.xw-queue-facts dt{ color:var(--color-text-muted); }
.xw-queue-facts dd{ margin:0; overflow-wrap:anywhere; }
.xw-queue-icon{ display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:var(--radius-md); background:var(--color-bg-sunken); flex-shrink:0; font-size:15px; }
@media (max-width: 640px){
  .xw-drawer--wide{ width:100%; }
  .xw-queue-item > summary{ flex-wrap:wrap; }
}
.xw-gap-bar{ position:relative; height:1.15rem; background:var(--color-bg-sunken); border-radius:var(--radius-sm); overflow:hidden; }
.xw-gap-bar b{ position:absolute; inset:0 auto 0 0; background:rgba(217,167,39,.45); }
.xw-gap-bar span{ position:relative; font-size:var(--font-size-xs); font-weight:600; padding-left:6px; line-height:1.15rem; }

/* ── Ads campaigns: product photos + pop-up rows ─────────────── */
.xw-camp-thumbs{ display:inline-flex; align-items:center; flex:none; }
.xw-camp-thumbs > *{ margin-left:-6px; border:2px solid var(--color-bg-surface); border-radius:var(--radius-sm); }
.xw-camp-thumbs > *:first-child{ margin-left:0; }
.xw-camp-prod{ display:grid; grid-template-columns:auto auto 1fr; align-items:center; gap:var(--space-2);
  padding:var(--space-1) 0; border-bottom:1px solid var(--color-border); }
@media (max-width:640px){ .xw-camp-prod{ grid-template-columns:auto 1fr; } .xw-camp-prod .xw-font-mono{ display:none; } }

/* Why profit moved (Profit page) — one bar per driver, one compact row per
   product, detail on click. */
.xw-movers__head { display: grid; gap: var(--space-2); padding-bottom: var(--space-3); margin-bottom: var(--space-1); border-bottom: 1px solid var(--color-border); }
.xw-movers__total { font-size: .9375rem; }
.xw-movers__delta { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.xw-movers__delta--up { color: var(--color-success); }
.xw-movers__delta--down { color: var(--color-danger); }
.xw-movers__bar { display: grid; grid-template-columns: minmax(8rem, 13rem) minmax(4rem, 22rem) 5.5rem; justify-content: start; align-items: center; gap: var(--space-2); font-size: .8125rem; }
.xw-movers__bar-label { color: var(--color-text-secondary); text-transform: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xw-movers__bar-track { height: .5rem; background: var(--color-bg-sunken); border-radius: 999px; overflow: hidden; }
.xw-movers__bar-fill { display: block; height: 100%; border-radius: 999px; }
.xw-movers__bar-fill--up { background: var(--color-success); }
.xw-movers__bar-fill--down { background: var(--color-danger); }
.xw-movers__bar-amt { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; min-width: 5rem; }
.xw-movers__row { border-bottom: 1px solid var(--color-border); }
.xw-movers__row > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 11rem); align-items: center; gap: var(--space-3); padding: var(--space-3) 0; }
.xw-movers__row > summary::-webkit-details-marker { display: none; }
.xw-movers__row > summary > :last-child { justify-self: end; }
.xw-movers__row > summary:hover .xw-movers__title { text-decoration: underline; }
.xw-movers__name { display: grid; min-width: 0; }
.xw-movers__title { font-size: .875rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xw-movers__why { font-size: .8125rem; color: var(--color-text-muted); }
.xw-movers__detail { display: grid; gap: var(--space-2); padding: 0 0 var(--space-3) calc(2.2rem + var(--space-3)); }
.xw-movers__label { font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--color-text-muted); margin-top: var(--space-1); }
.xw-movers__text { margin: 0; font-size: .8125rem; }
.xw-movers__terms { display: flex; flex-wrap: wrap; gap: 4px; }
.xw-movers__terms span { font-size: .75rem; padding: 1px 6px; border-radius: var(--radius-sm); background: var(--color-bg-sunken); color: var(--color-text-secondary); }
.xw-movers__hyps { margin: 0; padding-left: 1.1rem; font-size: .8125rem; color: var(--color-text-secondary); }
.xw-movers__more { margin-top: var(--space-2); }
.xw-movers__shared { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-3); padding: var(--space-2) var(--space-3); background: var(--color-bg-sunken); border-radius: var(--radius-md); font-size: .8125rem; color: var(--color-text-secondary); }
@media (max-width: 640px) {
  .xw-movers__row > summary { grid-template-columns: auto minmax(0, 1fr) auto; }
  .xw-movers__row > summary .xw-btn { grid-column: 2 / -1; justify-self: start; }
  .xw-movers__bar { grid-template-columns: minmax(6rem, 9rem) minmax(3rem, 1fr) 4.5rem; }
  .xw-movers__detail { padding-left: 0; }
}

/* Public status page (/status, core/status.py) */
.xw-status { max-width: 40rem; margin: 0 auto; padding: var(--space-8) var(--space-5) var(--space-12); color: var(--color-text); }
.xw-status__top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-8); }
.xw-status__top img { height: 2rem; }
.xw-status__banner { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-radius: var(--radius-lg); border: 1px solid var(--color-border); background: var(--color-bg-sunken); margin-bottom: var(--space-6); }
.xw-status__banner h1 { font-family: var(--font-display); font-size: var(--font-size-xl); margin: 0; }
.xw-status__dot { width: .75rem; height: .75rem; border-radius: 50%; flex: none; }
.xw-status__dot.is-operational { background: var(--color-success); }
.xw-status__dot.is-degraded { background: var(--color-warning); }
.xw-status__dot.is-down { background: var(--color-danger); }
.xw-status__list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--color-border); border-radius: var(--radius-lg); }
.xw-status__row { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-4) var(--space-5); }
.xw-status__row + .xw-status__row { border-top: 1px solid var(--color-border); }
.xw-status__row .xw-status__dot { margin-top: .35rem; }
.xw-status__name { font-weight: 600; }
.xw-status__note { font-size: var(--font-size-sm); color: var(--color-text-muted); margin-top: var(--space-1); }
.xw-status__state { margin-left: auto; font-size: var(--font-size-sm); white-space: nowrap; color: var(--color-text-muted); }
.xw-status__foot { margin-top: var(--space-6); font-size: var(--font-size-sm); color: var(--color-text-muted); }

/* Agency team board (/agency → Quadro de clientes). State is always written
   out in words too (em atraso, à espera há N dias): colour is never the only cue. */
.xw-board__bar { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.xw-board__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: var(--space-4); align-items: start; }
.xw-board__col-title { margin: 0 0 var(--space-2); font-size: var(--font-size-xs); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .04em; }
.xw-board__list { display: flex; flex-direction: column; gap: var(--space-3); }
.xw-board__card { border: 1px solid var(--color-border); border-left: 4px solid var(--color-border-strong); border-radius: var(--radius-md); padding: var(--space-3); background: var(--color-bg-sunken); }
.xw-board__card:focus { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.xw-board__card--blocked, .xw-board__card--overdue { border-left-color: var(--color-danger); }
.xw-board__card--overdue { border-color: var(--color-danger); }
.xw-board__card--soon { border-left-color: var(--color-warning); }
.xw-board__card--waiting { border-left-color: var(--color-accent); border-left-style: dashed; }
.xw-board__card--done { border-left-color: var(--color-success); }
.xw-board__card--stale { opacity: .7; }
.xw-board__head { display: flex; justify-content: space-between; gap: var(--space-2); align-items: baseline; }
.xw-board__chips { display: flex; gap: var(--space-1); flex-wrap: wrap; justify-content: flex-end; }
.xw-board__line { margin: var(--space-1) 0 0; font-size: var(--font-size-sm); }
.xw-board__meta { margin: var(--space-2) 0 0; font-size: var(--font-size-xs); color: var(--color-text-muted); }
.xw-board__notes { margin: var(--space-2) 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--space-1); }
.xw-board__note { font-size: var(--font-size-xs); display: flex; gap: var(--space-2); justify-content: space-between; align-items: flex-start; }
.xw-board__form { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; margin: var(--space-2) 0 0; }
.xw-board__form .xw-input { flex: 1 1 9rem; min-width: 0; }
.xw-board__form--stack { flex-direction: column; align-items: stretch; }
.xw-board__form--stack .xw-input { flex: none; width: 100%; }
.xw-board__note-text { white-space: pre-line; }
.xw-board__field { display: flex; flex-direction: column; gap: 2px; font-size: var(--font-size-xs); color: var(--color-text-muted); }
.xw-board__link { background: none; border: 0; padding: 0; color: var(--color-text-muted); font-size: var(--font-size-xs); text-decoration: underline; cursor: pointer; }
