/* CrowdStack platform tour, ported from the homepage explainer in the
   CrowdStack repo (src/components/home-explainer.tsx + the .xp-* block in
   globals.css). Coordinates are stage pixels (1200x675). Every element the
   timeline animates starts hidden here; demo.js only ever adds fill-forwards
   animations, so initial states live in CSS. Colours are literal because the
   stage is a "screenshot". Palette: indigo accent #635bff / #5851db, ink
   #1f2a3d, soft ink #66758c. */
html, body { margin: 0; height: 100%; background: #fff; }
.ud-frame { height: 100%; background: #eef0fb; }
.ud-stage {
  --font-display: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Figtree", ui-sans-serif, system-ui, sans-serif;
  --font-logo: "Archivo", "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.35;
  color: #1f2a3d;
  -webkit-font-smoothing: antialiased;
}

/* The cursor lives inside .xp-window so camera moves carry it. It starts
   hidden and the timeline fades it in per shot. The arrow tip is the hotspot. */
.ud-cursor { opacity: 0; margin: -3px 0 0 -5px; }
.ud-cursor__ring { border: 0; background: rgba(99, 91, 255, 0.5); top: -10px; left: -10px; width: 44px; height: 44px; }

.product-icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.xp-stage-inner {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(99, 91, 255, 0.16), transparent 70%),
    linear-gradient(180deg, #f4f5fd, #e9ebf8);
}

.xp-stage-inner strong,
.xp-stage-inner b { font-weight: 600; }

.xp-scene { position: absolute; inset: 0; opacity: 0; visibility: hidden; }
.xp-scene--icons,
.xp-scene--outro { z-index: 3; }

/* Everything the timeline reveals. */
.xp-tile, .xp-window, .xp-inbox-row, .xp-empty, .xp-detail-head, .xp-msg, .xp-composer,
.xp-rail-card, .xp-side-item, .xp-page-head, .xp-stat, .xp-chart, .xp-table-head, .xp-tr,
.xp-peek, .xp-peek-chip, .xp-site-nav, .xp-site-block, .xp-launcher, .xp-widget, .xp-bubble,
.xp-typing, .xp-ai-badge, .xp-finding, .xp-builder-row, .xp-cond, .xp-card-link,
.xp-select-menu, .xp-report, .xp-bar-value, .xp-report-row, .xp-crumb, .xp-doc-title,
.xp-doc-line, .xp-doc-links, .xp-chip, .xp-hover, .xp-col, .xp-card, .xp-orbit,
.xp-outro-caption, .xp-switcher-label, .xp-menu, .xp-menu-item, .xp-chart-area, .xp-chart-dot {
  opacity: 0;
}

/* Tiles */
.xp-tiles { position: absolute; inset: 0; display: flex; gap: 34px; align-items: center; justify-content: center; }
.xp-tile, .xp-orbit { display: grid; gap: 10px; justify-items: center; width: 118px; }
.xp-orbit { position: absolute; transform: translate(-50%, -50%); }
.xp-tile-icon {
  display: grid; place-items: center; width: 84px; height: 84px; color: #fff; border-radius: 24px;
  background: linear-gradient(160deg, #7b74ff, #5851db);
  box-shadow: 0 12px 28px rgba(99, 91, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.xp-tile-icon .product-icon { width: 40px; height: 40px; color: #fff; stroke-width: 1.6; }
.xp-tile--crm .xp-tile-icon { background: linear-gradient(160deg, #3fb8a2, #2c8f7d); box-shadow: 0 12px 28px rgba(61, 154, 138, 0.35), inset 0 1px 0 rgba(255,255,255,0.35); }
.xp-tile--revenue .xp-tile-icon { background: linear-gradient(160deg, #f5a524, #d97706); box-shadow: 0 12px 28px rgba(217, 119, 6, 0.35), inset 0 1px 0 rgba(255,255,255,0.35); }
.xp-tile--tasks .xp-tile-icon { background: linear-gradient(160deg, #4f8cff, #2f63d6); box-shadow: 0 12px 28px rgba(47, 99, 214, 0.35), inset 0 1px 0 rgba(255,255,255,0.35); }
.xp-tile--feedback .xp-tile-icon { background: linear-gradient(160deg, #f26a8d, #d1365f); box-shadow: 0 12px 28px rgba(209, 54, 95, 0.35), inset 0 1px 0 rgba(255,255,255,0.35); }
.xp-tile--docs .xp-tile-icon { background: linear-gradient(160deg, #22252f, #4b5163); box-shadow: 0 12px 28px rgba(31, 42, 61, 0.35), inset 0 1px 0 rgba(255,255,255,0.25); }
.xp-tile-name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.xp-outro-caption {
  position: absolute; top: 548px; left: 0; right: 0; margin: 0;
  font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -0.03em; text-align: center;
}

/* Window */
.xp-window-frame {
  position: absolute; left: 60px; top: 34px; width: 1200px; height: 675px; z-index: 2;
  transform: scale(0.9); transform-origin: 0 0;
}
.xp-window {
  position: absolute; inset: 0; z-index: 2; overflow: hidden;
  border-radius: 14px; background: #fff;
  box-shadow: 0 0 0 1px rgba(31, 42, 61, 0.08), 0 30px 70px rgba(31, 42, 61, 0.18);
  will-change: transform;
}
.xp-topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  display: flex; gap: 14px; align-items: center; height: 52px; padding: 0 18px;
  border-bottom: 1px solid rgba(31, 42, 61, 0.08);
  background: linear-gradient(180deg, #f1f1ff, #fff);
}
.xp-logo { display: inline-flex; flex: none; gap: 8px; align-items: center; width: 140px; font-family: var(--font-logo); font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.xp-logo-mark { width: 24px; height: 14px; border-radius: 3px; background: linear-gradient(90deg, #635bff 50%, #b7b3ff 50%); }
.xp-switcher {
  position: relative; display: inline-flex; align-items: center; width: 96px; height: 32px; padding: 0 10px;
  font-weight: 500; border: 1px solid rgba(31, 42, 61, 0.12); border-radius: 8px; background: #fff;
}
.xp-switcher-label { position: absolute; left: 10px; }

/* Product menu dropped from the switcher chip at x 172. Item i is centred at
   y = 98 + 36i. */
.xp-menu {
  position: absolute; top: 46px; left: 172px; z-index: 5; display: grid; width: 210px; padding: 6px;
  visibility: hidden; border: 1px solid rgba(31, 42, 61, 0.1); border-radius: 12px; background: #fff;
  box-shadow: 0 1px 2px rgba(31, 42, 61, 0.06), 0 18px 40px rgba(31, 42, 61, 0.18);
  transform-origin: 24px 0;
}
.xp-menu::before {
  content: ""; position: absolute; top: -6px; left: 40px; width: 10px; height: 10px;
  border-top: 1px solid rgba(31, 42, 61, 0.1); border-left: 1px solid rgba(31, 42, 61, 0.1);
  background: #fff; transform: rotate(45deg);
}
.xp-menu-head { display: block; height: 28px; padding: 0 10px; font-size: 11px; font-weight: 700; line-height: 28px; letter-spacing: 0.06em; color: #66758c; text-transform: uppercase; }
.xp-menu-item { display: flex; gap: 10px; align-items: center; height: 36px; padding: 0 8px; font-weight: 500; border-radius: 7px; background: #fff; }
.xp-menu-icon { display: grid; flex: none; place-items: center; width: 22px; height: 22px; color: #fff; border-radius: 6px; background: linear-gradient(160deg, #7b74ff, #5851db); }
.xp-menu-icon.xp-tile--crm { background: linear-gradient(160deg, #3fb8a2, #2c8f7d); }
.xp-menu-icon.xp-tile--revenue { background: linear-gradient(160deg, #f5a524, #d97706); }
.xp-menu-icon.xp-tile--tasks { background: linear-gradient(160deg, #4f8cff, #2f63d6); }
.xp-menu-icon.xp-tile--feedback { background: linear-gradient(160deg, #f26a8d, #d1365f); }
.xp-menu-icon.xp-tile--docs { background: linear-gradient(160deg, #22252f, #4b5163); }
.xp-menu-icon--agents { background: linear-gradient(135deg, #635bff, #f26a8d); }
.xp-menu-icon .product-icon { width: 14px; height: 14px; color: #fff; }
.xp-menu-spark { width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.xp-caret { position: absolute; right: 9px; top: 10px; width: 7px; height: 7px; border-right: 1.5px solid #66758c; border-bottom: 1.5px solid #66758c; transform: rotate(45deg); }
.xp-search { display: inline-flex; gap: 8px; align-items: center; width: 420px; height: 32px; padding: 0 10px; color: #66758c; border: 1px solid rgba(31, 42, 61, 0.12); border-radius: 8px; background: #fff; }
.xp-search kbd { margin-left: auto; padding: 1px 5px; font-family: inherit; font-size: 11px; border: 1px solid rgba(31, 42, 61, 0.14); border-radius: 4px; }
.xp-search-glass { width: 11px; height: 11px; border: 1.5px solid #66758c; border-radius: 50%; }
.xp-trial { margin-left: auto; padding: 6px 10px; font-size: 13px; border: 1px solid rgba(31, 42, 61, 0.12); border-radius: 8px; }
.xp-user { display: inline-flex; gap: 8px; align-items: center; padding: 4px 10px 4px 4px; font-weight: 600; border: 1px solid rgba(31, 42, 61, 0.12); border-radius: 999px; }
.xp-avatar { display: inline-grid; flex: none; place-items: center; width: 28px; height: 28px; font-size: 11px; font-weight: 700; color: #4f48d6; border-radius: 50%; background: #e7e6ff; }
.xp-avatar--soft { color: #1f2a3d; background: #eef0f6; }
.xp-avatar--big { width: 44px; height: 44px; font-size: 15px; }
.xp-body { top: 52px; }
.xp-muted { color: #66758c; }
.xp-link { color: #635bff; }
.xp-pill { padding: 2px 8px; font-size: 12px; font-weight: 600; color: #4f48d6; border-radius: 999px; background: #e7e6ff; }
.xp-tag { display: inline-block; padding: 2px 7px; font-size: 11px; font-weight: 600; line-height: 1.3; border-radius: 6px; }
.xp-tag--open { color: #c2410c; background: #ffedd5; }
.xp-tag--internal { color: #b45309; background: #fef3c7; text-transform: uppercase; font-size: 10px; letter-spacing: 0.04em; }
.xp-tag--doing { color: #c2410c; background: #ffedd5; }
.xp-tag--planned { color: #b45309; background: #fef3c7; }
.xp-tag--shipped { color: #1f6f61; background: #d9f3ec; }
.xp-tag--high { color: #9f1239; background: #ffe4e6; }
.xp-tag--medium { color: #b45309; background: #fef3c7; }
.xp-tag--low { color: #475569; background: #e2e8f0; }
.xp-tag--review { color: #1d4ed8; background: #dbeafe; }
.xp-btn-primary { padding: 8px 14px; font-weight: 600; color: #fff; border-radius: 8px; background: #635bff; }

/* Support */
.xp-inbox { position: absolute; top: 0; bottom: 0; left: 0; width: 340px; border-right: 1px solid rgba(31, 42, 61, 0.08); background: #fff; }
.xp-inbox-head { display: flex; align-items: center; justify-content: space-between; height: 44px; padding: 0 16px; border-bottom: 1px solid rgba(31, 42, 61, 0.08); }
.xp-inbox-row { display: flex; gap: 12px; align-items: center; height: 64px; padding: 0 16px; border-bottom: 1px solid rgba(31, 42, 61, 0.06); background: #fff; }
.xp-inbox-text { display: grid; gap: 2px; min-width: 0; }
.xp-inbox-who { display: flex; justify-content: space-between; font-weight: 600; }
.xp-inbox-who em { font-size: 12px; font-style: normal; font-weight: 400; color: #66758c; }
.xp-inbox-subject { overflow: hidden; color: #66758c; white-space: nowrap; text-overflow: ellipsis; }
.xp-detail { position: absolute; top: 0; bottom: 0; left: 340px; width: 560px; background: #fafbfe; }
.xp-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #66758c; }
.xp-detail-head { display: flex; gap: 10px; align-items: center; height: 52px; padding: 0 24px; border-bottom: 1px solid rgba(31, 42, 61, 0.08); background: #fff; }
.xp-detail-head strong { font-size: 17px; letter-spacing: -0.01em; }
.xp-thread { display: grid; gap: 12px; padding: 20px 24px; }
.xp-msg { display: flex; gap: 12px; align-items: flex-start; }
.xp-msg-body { flex: 1; padding: 12px 14px; border: 1px solid rgba(31, 42, 61, 0.08); border-radius: 10px; background: #fff; }
.xp-msg--note .xp-msg-body { border-color: #f2dfa8; background: #fffaea; }
.xp-msg-meta { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; font-size: 13px; }
.xp-msg-meta em { margin-left: auto; font-size: 12px; font-style: normal; color: #66758c; }
.xp-msg-body p { margin: 0; font-size: 15px; line-height: 1.45; }
.xp-composer { position: absolute; bottom: 0; left: 0; right: 0; display: grid; gap: 12px; justify-items: end; padding: 16px 24px 20px; border-top: 1px solid rgba(31, 42, 61, 0.08); background: #fff; }
.xp-composer-box { width: 100%; box-sizing: border-box; padding: 12px 14px; color: #66758c; border: 1px solid rgba(31, 42, 61, 0.14); border-radius: 10px; }
.xp-rail { position: absolute; top: 0; right: 0; bottom: 0; display: grid; gap: 12px; align-content: start; width: 300px; box-sizing: border-box; padding: 16px; border-left: 1px solid rgba(31, 42, 61, 0.08); background: #fff; }
.xp-rail-card { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid rgba(31, 42, 61, 0.1); border-radius: 10px; background: #fff; }
.xp-rail-card--contact strong { font-size: 16px; }
.xp-rail-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: #66758c; text-transform: uppercase; }
.xp-kv { display: flex; gap: 10px; justify-content: space-between; font-size: 13px; }
.xp-kv span:first-child { color: #66758c; }
.xp-money { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; color: #2c8f7d; }

/* Sidebar + content */
.xp-side { position: absolute; top: 0; bottom: 0; left: 0; display: grid; gap: 4px; align-content: start; width: 220px; box-sizing: border-box; padding: 22px 16px; border-right: 1px solid rgba(31, 42, 61, 0.08); background: #fafbfe; }
.xp-side-title { margin-bottom: 10px; font-size: 15px; }
.xp-side-item { padding: 8px 12px; border-radius: 8px; }
.xp-side-item.is-active { font-weight: 600; background: #eef0f6; }
.xp-side-btn { margin-bottom: 10px; font-weight: 600; color: #4f48d6; text-align: center; background: #e7e6ff; }
.xp-content { position: absolute; top: 0; bottom: 0; left: 220px; right: 0; padding: 26px 28px; }
.xp-page-head h3 { margin: 0 0 4px; font-family: var(--font-display); font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.xp-page-head p { margin: 0; color: #66758c; }
.xp-page-head--row { display: flex; align-items: flex-start; justify-content: space-between; }
.xp-seg { display: inline-flex; padding: 3px; border: 1px solid rgba(31, 42, 61, 0.12); border-radius: 8px; }
.xp-seg span { padding: 5px 12px; border-radius: 6px; }
.xp-seg .is-on { font-weight: 600; color: #4f48d6; background: #e7e6ff; }

/* Revenue */
.xp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 26px; }
.xp-stat { display: grid; gap: 6px; padding: 14px 16px; border: 1px solid rgba(31, 42, 61, 0.1); border-radius: 10px; background: #fff; }
.xp-stat > span { color: #66758c; }
.xp-stat b, .xp-stat .xp-odo { font-size: 30px; font-weight: 700; line-height: 42px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: #1f2a3d; }
.xp-stat small { font-size: 12px; color: #66758c; }
.xp-up { color: #2c8f7d; }
.xp-odo { display: inline-flex; align-items: flex-start; height: 42px; }
.xp-odo-slot { display: inline-block; width: 1ch; height: 42px; overflow: hidden; text-align: center; }
.xp-odo-strip { display: grid; }
.xp-odo-strip span { display: block; height: 42px; line-height: 42px; }
.xp-chart { margin-top: 14px; padding: 14px 16px 12px; border: 1px solid rgba(31, 42, 61, 0.1); border-radius: 10px; background: #fff; }
.xp-chart-title { display: block; margin-bottom: 8px; color: #66758c; }
.xp-chart svg { display: block; width: 100%; height: 180px; overflow: visible; }
.xp-chart-line { stroke-dasharray: 1400; stroke-dashoffset: 1400; }
.xp-chart-dot { transform-box: fill-box; transform-origin: center; }

/* CRM */
.xp-table { position: absolute; top: 118px; left: 28px; right: 28px; overflow: hidden; border: 1px solid rgba(31, 42, 61, 0.1); border-radius: 10px; background: #fff; }
.xp-table-head, .xp-tr { display: grid; grid-template-columns: 40px 1.1fr 1.4fr 1.1fr 0.7fr 0.6fr; gap: 12px; align-items: center; padding: 0 14px; }
.xp-table-head { height: 40px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: #66758c; text-transform: uppercase; border-bottom: 1px solid rgba(31, 42, 61, 0.08); }
.xp-tr { height: 46px; border-bottom: 1px solid rgba(31, 42, 61, 0.06); background: #fff; }
.xp-tr--fb1 { position: relative; z-index: 1; border-radius: 8px; }
.xp-tr:last-child { border-bottom: 0; }
.xp-checkbox { width: 16px; height: 16px; border: 1.5px solid rgba(31, 42, 61, 0.28); border-radius: 4px; }
/* Dims everything but the contact card, clear circle centred on the card at
   stage (890, 420); this overlay's origin is stage (220, 52). */
.xp-spot { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; background: radial-gradient(circle at 670px 368px, rgba(20, 23, 63, 0) 210px, rgba(20, 23, 63, 0.42) 420px); }
.xp-peek { position: absolute; top: 300px; left: 470px; z-index: 2; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; width: 400px; box-sizing: border-box; padding: 16px; border: 1px solid rgba(31, 42, 61, 0.1); border-radius: 12px; background: #fff; box-shadow: 0 24px 50px rgba(31, 42, 61, 0.18); }
.xp-peek > div:first-of-type { display: grid; align-content: center; }
.xp-peek strong { font-size: 16px; }
.xp-peek-chips { display: flex; flex-wrap: wrap; gap: 8px; grid-column: 1 / -1; margin-top: 8px; }
.xp-peek-chip { padding: 5px 10px; font-size: 13px; font-weight: 500; border-radius: 999px; background: #eef0f6; }
.xp-peek-chip--money { color: #1f6f61; background: #d9f3ec; }

/* Feedback */
.xp-table--feedback .xp-table-head, .xp-table--feedback .xp-tr { grid-template-columns: 48px 2.2fr 0.9fr 0.9fr 0.5fr; }
.xp-vote { display: inline-flex; flex-direction: column; gap: 1px; align-items: center; justify-content: center; width: 48px; height: 30px; box-sizing: border-box; font-size: 12px; font-weight: 600; border: 1px solid rgba(31, 42, 61, 0.14); border-radius: 6px; background: #fff; }
.xp-vote-arrow { width: 6px; height: 6px; margin-top: 2px; border-top: 1.5px solid currentColor; border-left: 1.5px solid currentColor; transform: rotate(45deg); }
.xp-vote .xp-count { height: 14px; line-height: 14px; color: inherit; }
.xp-vote .xp-count span { height: 18px; line-height: 14px; }

/* Docs */
.xp-crumb { position: absolute; top: 26px; left: 28px; font-size: 13px; }
.xp-doc { position: absolute; top: 54px; left: 28px; width: 720px; }
.xp-doc-title { margin: 0 0 16px; font-family: var(--font-display); font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }
.xp-doc-line { display: block; font-size: 15px; line-height: 26px; }
.xp-doc-h { margin: 8px 0 4px; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.xp-doc-links { position: absolute; top: 300px; left: 28px; display: flex; gap: 8px; align-items: center; font-size: 13px; }
.xp-chip { display: inline-flex; gap: 6px; align-items: center; height: 28px; padding: 0 10px 0 8px; font-size: 13px; font-weight: 500; border-radius: 999px; background: #eef0f6; }
.xp-chip .product-icon { width: 14px; height: 14px; }
.xp-hover { position: absolute; top: 340px; left: 58px; display: grid; gap: 4px; justify-items: start; width: 340px; box-sizing: border-box; padding: 12px 14px; border: 1px solid rgba(31, 42, 61, 0.1); border-radius: 10px; background: #fff; box-shadow: 0 18px 40px rgba(31, 42, 61, 0.16); }
.xp-hover strong { font-size: 15px; }

/* Closing logo frame, over the whole window including the top bar. */
.xp-scene--logo { z-index: 4; display: grid; place-items: center; background: #fff; }
.xp-scene--logo img { width: 560px; height: auto; opacity: 0; }

/* A customer's website, over the whole window including the top bar. */
.xp-scene--site { z-index: 3; background: #fff; }
.xp-site-nav { display: flex; gap: 32px; align-items: center; height: 64px; padding: 0 48px; border-bottom: 1px solid rgba(31, 42, 61, 0.08); }
.xp-site-logo { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: #0f766e; }
.xp-site-links { display: flex; gap: 24px; color: #66758c; }
.xp-site-cta { margin-left: auto; padding: 8px 14px; font-weight: 600; color: #fff; border-radius: 8px; background: #0f766e; }
.xp-site-hero { display: grid; gap: 14px; justify-items: start; padding: 64px 48px 0; }
.xp-site-block { display: block; border-radius: 8px; background: #eef0f6; }
.xp-site-block--title { max-width: 560px; font-family: var(--font-display); font-size: 40px; font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; background: none; }
.xp-site-block--lead { width: 520px; height: 16px; }
.xp-site-block--short { width: 380px; }
.xp-site-block--btn { width: 140px; height: 42px; margin-top: 8px; background: #0f766e; }
.xp-site-cards { display: flex; gap: 20px; padding: 56px 48px 0; }
.xp-site-block--card { width: 240px; height: 150px; border-radius: 14px; }
.xp-launcher { position: absolute; right: 32px; bottom: 32px; display: grid; place-items: center; width: 56px; height: 56px; color: #fff; border-radius: 50%; background: #635bff; box-shadow: 0 10px 24px rgba(99, 91, 255, 0.4); }
.xp-launcher .product-icon { width: 26px; height: 26px; color: #fff; }
.xp-widget { position: absolute; right: 32px; bottom: 100px; display: grid; grid-template-rows: auto 1fr auto; width: 360px; height: 460px; overflow: visible; border: 1px solid rgba(31, 42, 61, 0.1); border-radius: 16px; background: #fff; box-shadow: 0 30px 70px rgba(31, 42, 61, 0.24); transform-origin: 100% 100%; }
.xp-widget-tabs { display: flex; gap: 4px; padding: 10px; border-bottom: 1px solid rgba(31, 42, 61, 0.08); border-radius: 16px 16px 0 0; background: #f4f4ff; }
.xp-widget-tabs span { flex: 1; padding: 8px; font-weight: 500; text-align: center; color: #66758c; border-radius: 8px; }
.xp-widget-tabs .is-active { font-weight: 600; color: #4f48d6; background: #fff; box-shadow: 0 1px 2px rgba(31, 42, 61, 0.08); }
.xp-widget-body { display: grid; gap: 10px; align-content: start; padding: 16px 14px; }
.xp-bubble { max-width: 270px; padding: 10px 12px; font-size: 14px; line-height: 1.4; border-radius: 14px; }
.xp-bubble--user { justify-self: end; color: #fff; border-bottom-right-radius: 4px; background: #635bff; }
.xp-bubble--ai { display: grid; gap: 8px; justify-items: start; border-bottom-left-radius: 4px; background: #eef0f6; }
.xp-bubble-who { font-size: 12px; font-weight: 600; color: #66758c; }
.xp-bubble--ai .xp-chip { background: #fff; }
.xp-typing { display: flex; gap: 4px; width: 52px; box-sizing: border-box; padding: 12px 14px; border-radius: 14px; border-bottom-left-radius: 4px; background: #eef0f6; }
.xp-typing i { width: 6px; height: 6px; border-radius: 50%; background: #66758c; animation: xp-dot 0.9s ease-in-out infinite; }
.xp-typing i:nth-child(2) { animation-delay: 0.15s; }
.xp-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes xp-dot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }
.xp-widget-composer { margin: 0 14px 14px; padding: 10px 12px; color: #66758c; border: 1px solid rgba(31, 42, 61, 0.14); border-radius: 10px; }
.xp-ai-badge { position: absolute; top: -16px; left: 50%; padding: 6px 12px; font-size: 12px; font-weight: 600; white-space: nowrap; color: #4f48d6; border: 1px solid #d6d3ff; border-radius: 999px; background: #fff; box-shadow: 0 6px 16px rgba(31, 42, 61, 0.12); transform: translateX(-50%); }

/* Reporting */
.xp-builder { position: absolute; top: 112px; left: 28px; display: grid; gap: 12px; }
.xp-builder-row { position: relative; display: flex; gap: 12px; align-items: center; height: 36px; }
.xp-builder-row:nth-child(1) { z-index: 3; }
.xp-builder-row:nth-child(2) { z-index: 2; }
.xp-builder-row:nth-child(3) { z-index: 1; }
.xp-builder-label { width: 108px; font-weight: 500; color: #66758c; }
.xp-select { position: relative; display: inline-flex; align-items: center; width: 200px; height: 36px; box-sizing: border-box; padding: 0 12px; font-weight: 500; border: 1px solid rgba(31, 42, 61, 0.14); border-radius: 8px; background: #fff; }
.xp-select .xp-caret { top: 12px; right: 12px; }
.xp-select-menu { position: absolute; top: 40px; left: 120px; z-index: 5; display: grid; width: 200px; box-sizing: border-box; padding: 6px; visibility: hidden; border: 1px solid rgba(31, 42, 61, 0.1); border-radius: 10px; background: #fff; box-shadow: 0 18px 40px rgba(31, 42, 61, 0.16); }
.xp-select-menu span { display: block; height: 34px; padding: 0 10px; font-weight: 500; line-height: 34px; border-radius: 6px; background: #fff; }
.xp-cell { display: inline-block; padding: 2px 6px; margin-left: -6px; border-radius: 6px; }
.xp-cond { display: inline-flex; align-items: center; height: 30px; padding: 0 10px; font-size: 13px; font-weight: 500; border: 1px solid rgba(31, 42, 61, 0.12); border-radius: 999px; background: #f5f6fa; }
.xp-report { position: absolute; top: 270px; left: 28px; right: 28px; display: grid; grid-template-columns: 1fr 260px; gap: 8px 24px; padding: 16px 18px 14px; border: 1px solid rgba(31, 42, 61, 0.1); border-radius: 10px; background: #fff; }
.xp-report-title { grid-column: 1 / -1; font-weight: 600; }
.xp-bars { display: flex; gap: 28px; align-items: flex-end; height: 176px; padding: 0 12px; border-bottom: 1px solid rgba(31, 42, 61, 0.08); }
.xp-bar-col { display: grid; flex: 1; gap: 6px; justify-items: center; align-content: end; }
.xp-bar { display: block; width: 100%; max-width: 96px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #7b74ff, #635bff); transform: scaleY(0); transform-origin: 50% 100%; }
.xp-bar-value { font-size: 13px; font-weight: 600; }
.xp-bar-label { padding-bottom: 6px; font-size: 12px; color: #66758c; }
.xp-report-table { display: grid; align-content: start; align-self: start; border: 1px solid rgba(31, 42, 61, 0.08); border-radius: 8px; }
.xp-report-row { display: flex; justify-content: space-between; height: 34px; padding: 0 12px; font-size: 13px; line-height: 34px; border-bottom: 1px solid rgba(31, 42, 61, 0.06); }
.xp-report-row:last-child { border-bottom: 0; }

/* Agents. Fixed line heights so the Accept button lands at a known y: card
   top + 106px to the top of the button row. */
.xp-findings { position: absolute; top: 112px; left: 28px; right: 28px; display: grid; gap: 12px; }
.xp-finding { display: grid; gap: 0; align-content: start; height: 148px; box-sizing: border-box; padding: 14px; border: 1px solid rgba(31, 42, 61, 0.1); border-radius: 10px; background: #fff; }
.xp-finding-head { display: flex; gap: 10px; align-items: center; height: 22px; font-size: 13px; line-height: 22px; }
.xp-finding-summary { margin: 6px 0 0; overflow: hidden; font-size: 14px; line-height: 20px; white-space: nowrap; text-overflow: ellipsis; }
.xp-finding-evidence, .xp-finding-proposal { display: block; overflow: hidden; font-size: 13px; line-height: 18px; white-space: nowrap; text-overflow: ellipsis; }
.xp-finding-proposal { font-weight: 500; }
.xp-finding-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.xp-accept { display: inline-block; height: 26px; box-sizing: border-box; padding: 4px 12px; font-size: 13px; font-weight: 600; line-height: 18px; color: #fff; border: 1px solid #635bff; border-radius: 7px; background: #635bff; }
.xp-dismiss { padding: 4px 10px; font-size: 13px; font-weight: 500; color: #66758c; }
.xp-swap { display: inline-block; height: 18px; overflow: hidden; line-height: 18px; vertical-align: top; }
.xp-swap span { display: block; height: 18px; line-height: 18px; }
.xp-swap-status { margin-left: auto; font-size: 12px; }

/* Tasks */
.xp-board { position: absolute; top: 108px; left: 28px; display: flex; gap: 16px; }
.xp-col { width: 220px; border: 1px solid rgba(31, 42, 61, 0.1); border-radius: 10px; background: #f5f6fa; }
/* The dragged card lives in "To do" and must paint over "Doing". */
.xp-col--todo { position: relative; z-index: 3; }
.xp-col-head { display: flex; align-items: center; justify-content: space-between; height: 40px; padding: 0 12px; font-weight: 500; }
.xp-count { display: block; height: 18px; overflow: hidden; color: #66758c; }
.xp-count span { display: block; height: 18px; line-height: 18px; }
.xp-col-body { position: relative; height: 350px; border-radius: 0 0 10px 10px; background: #f5f6fa; }
.xp-card { position: absolute; left: 12px; display: grid; gap: 4px; width: 196px; height: 96px; box-sizing: border-box; padding: 10px 12px; border: 1px solid rgba(31, 42, 61, 0.08); border-radius: 8px; background: #fff; box-shadow: 0 1px 2px rgba(31, 42, 61, 0.07); }
.xp-card--drag { z-index: 2; overflow: visible; }
.xp-card-link { position: absolute; top: -12px; right: -8px; display: inline-flex; gap: 5px; align-items: center; height: 24px; padding: 0 9px 0 7px; font-size: 11px; font-weight: 600; white-space: nowrap; color: #4f48d6; border: 1px solid #d6d3ff; border-radius: 999px; background: #fff; box-shadow: 0 6px 14px rgba(31, 42, 61, 0.14); }
.xp-card-link .product-icon { width: 12px; height: 12px; }
.xp-card-id { font-size: 11px; color: #66758c; }
.xp-card-title { overflow: hidden; font-size: 13px; font-weight: 500; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.xp-card-meta { overflow: hidden; font-size: 11px; color: #66758c; white-space: nowrap; text-overflow: ellipsis; }
