/* ============================================================
   Asite AI Demos — shell, landing grid and stub styles.
   Builds on the shared design tokens defined in main.css.
   ============================================================ */

/* Eyebrow above the landing title */
.eyebrow-demo {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--asite-blue);
  background: var(--asite-blue-light);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

/* ============================================================
   Landing — persona-led "Customer Experience Hub"
   ============================================================ */
.xp-landing { max-width: 1180px; margin: 0 auto; }

/* Hero */
.xp-hero { margin-bottom: 4px; }
.xp-hero-title {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.06;
  margin: 0 0 12px;
  color: var(--text);
}
.xp-hero-sub {
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-2);
  max-width: 66ch;
  margin: 0;
}
.xp-hero-sub b { color: var(--text); font-weight: 600; }

/* Up-front limitations note under the hero */
.xp-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2);
  background: var(--asite-blue-light);
  border: 1px solid color-mix(in srgb, var(--asite-blue) 18%, var(--line));
  border-radius: 10px;
}
.xp-note svg { flex: 0 0 auto; margin-top: 1px; color: var(--asite-blue); }
.xp-note b { color: var(--text); font-weight: 700; }

/* Persona group header with a trailing rule */
.xp-grp {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 30px 0 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--asite-blue);
}
.xp-grp::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* Toolbar — top-right category filter above the single grid */
.xp-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 26px;
}
.xp-filter {
  display: flex;
  align-items: center;
  gap: 10px;
}
.xp-filter-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.xp-filter-control { position: relative; }
.xp-filter-select {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 9px 38px 9px 14px;
  cursor: pointer;
  box-shadow: var(--sh-1);
  transition: border-color .14s ease, box-shadow .14s ease;
}
.xp-filter-select:hover { border-color: var(--asite-blue); }
.xp-filter-select:focus-visible {
  outline: none;
  border-color: var(--asite-blue);
  box-shadow: 0 0 0 3px var(--asite-blue-light);
}
.xp-filter-chev {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  display: flex;
  pointer-events: none;
  color: var(--text-3);
}
@media (max-width: 620px) {
  .xp-toolbar { justify-content: stretch; }
  .xp-filter { width: 100%; justify-content: space-between; }
}

/* Card grid */
.xp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 16px;
}
@media (max-width: 980px) { .xp-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .xp-grid { grid-template-columns: 1fr; } }

.xp-empty {
  margin-top: 16px;
  padding: 40px 24px;
  text-align: center;
  color: #5a6473;
  font-size: 15px;
  border: 1px dashed #d4d9e0;
  border-radius: 12px;
  background: #fafbfc;
}

/* Experience card */
.xp-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 196px;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--sh-1);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
/* The explicit display:flex above overrides the browser default
   [hidden]{display:none}, so cards never hide. This more-specific rule
   restores hiding for both the category dropdown and the search filter. */
.xp-card[hidden] {
  display: none !important;
}
.xp-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-2);
  border-color: #BBD6F5;
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  text-decoration: none;
}
.xp-card-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--accent, var(--asite-blue));
}
.xp-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 2px;
}
.xp-chip {
  width: 44px; height: 44px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent, #0072CE), var(--accent-2, #0A2E52));
}
.xp-ptag {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent, var(--asite-blue));
  background: var(--asite-blue-light);
  background: color-mix(in srgb, var(--accent) 12%, #fff);
  padding: 5px 10px;
  border-radius: 14px;
  white-space: nowrap;
}
.xp-fn {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 16px 0 6px;
}
.xp-card-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.2;
  margin: 0 0 7px;
  color: var(--text);
}
.xp-card-blurb {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-2);
  margin: 0 0 16px;
}
.xp-card-go {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent, var(--asite-blue));
}
.xp-card-go svg { transition: transform .14s ease; }
.xp-card:hover .xp-card-go svg { transform: translateX(3px); }

/* Under-the-hood builder strip (links out to Version B) */
.xp-grp-hood { color: var(--text-3); }
.xp-hood {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 16px;
  padding: 20px 24px;
  background: #FBFCFE;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: border-color .14s ease, background .14s ease, box-shadow .14s ease;
}
.xp-hood:hover {
  border-color: var(--asite-blue);
  background: #fff;
  box-shadow: var(--sh-1);
  text-decoration: none;
}
.xp-hood-chip {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #9AA4B6, #79829A);
}
.xp-hood-tx { flex: 1; min-width: 0; }
.xp-hood-tx h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text);
}
.xp-hood-tx p {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-2);
  margin: 0;
  max-width: 84ch;
}
.xp-hood-tx p b { color: var(--text); font-weight: 600; }
.xp-hood-go {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-3);
  white-space: nowrap;
}
.xp-hood-go svg { transition: transform .14s ease; }
.xp-hood:hover .xp-hood-go { color: var(--asite-blue); }
.xp-hood:hover .xp-hood-go svg { transform: translateX(3px); }

/* Build-your-own-agent card — deliberately OUTSIDE the filtered demo
   grid so the category dropdown / search never hide it. */
.xp-build-lede {
  margin: 10px 0 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-2);
  max-width: 84ch;
}
.xp-build-lede b { color: var(--text); font-weight: 600; }
.xp-build {
  display: grid;
  grid-template-columns: minmax(0, 460px);
  gap: 18px;
  margin-top: 16px;
}

/* Footer line */
.xp-foot {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-3);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.xp-foot b { color: var(--asite-navy); font-weight: 700; }
.xp-star { color: var(--asite-blue); }

@media (max-width: 620px) {
  .xp-hero-title { font-size: 30px; }
  .xp-hood { flex-direction: column; align-items: flex-start; gap: 14px; }
  .xp-foot { flex-direction: column; gap: 6px; }
}

/* ---- Stub placeholder (until a demo implements render()) ---- */
.demo-stub {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  min-height: 280px;
  padding: 56px 28px;
  background: #fff;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
}
.demo-stub-ico {
  width: 64px; height: 64px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: var(--asite-blue);
  background: var(--asite-blue-light);
  margin-bottom: 10px;
}
.demo-stub-title { font-size: 18px; font-weight: 700; }
.demo-stub-tag {
  font-size: 13px;
  color: var(--text-2);
  max-width: 520px;
  line-height: 1.55;
}
.demo-stub-note {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--warn);
  background: var(--warn-bg);
  padding: 6px 12px;
  border-radius: 999px;
}

/* ============================================================
   Markdown rendering (U.md output) — shared across chat demos
   (bid-evaluation, form-template, workflow-design). Scoped to
   the unique md-* element classes so it never leaks into other
   UI. Tables scroll horizontally inside narrow chat bubbles.
   ============================================================ */
.md-p { margin: 0 0 8px; }
.md-p:last-child { margin-bottom: 0; }
.md-h { margin: 10px 0 6px; font-weight: 700; line-height: 1.25; }
.md-h:first-child { margin-top: 0; }
h1.md-h { font-size: 1.15em; }
h2.md-h { font-size: 1.08em; }
h3.md-h, h4.md-h, h5.md-h, h6.md-h { font-size: 1em; }

.md-ul, .md-ol { margin: 4px 0 8px; padding-left: 20px; }
.md-ul:last-child, .md-ol:last-child { margin-bottom: 0; }
.md-ul li, .md-ol li { margin: 2px 0; }

.md-code {
  font-family: var(--f-mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);
  font-size: .92em;
  background: var(--bg-sunken);
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 1px 5px;
}
.md-pre {
  margin: 6px 0 8px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  overflow-x: auto;
}
.md-pre code {
  font-family: var(--f-mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);
  font-size: .88em;
  white-space: pre;
}

.md-tablewrap { margin: 6px 0 8px; max-width: 100%; overflow-x: auto; }
.md-tablewrap:last-child { margin-bottom: 0; }
.md-table {
  border-collapse: collapse;
  width: 100%;
  font-size: .92em;
  background: var(--bg-elev);
}
.md-table th, .md-table td {
  border: 1px solid var(--line);
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}
.md-table thead th {
  background: var(--bg-sunken);
  font-weight: 700;
  color: var(--ink, inherit);
}
.md-table tbody tr:nth-child(even) td { background: var(--bg-hover); }

/* ============================================================
   Expandable guided-tour player (one per demo screen). Collapsed
   to a single bar; expands to an inline 16:9 video of the demo's
   auto-recorded walkthrough. Accent follows the demo's card colour.
   ============================================================ */
.demo-tour {
  --accent: var(--asite-blue);
  --accent-2: var(--asite-navy);
  margin: 0 0 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  overflow: hidden;
}
.demo-tour.accent-a { --accent: #0072CE; --accent-2: #0A2E52; }
.demo-tour.accent-b { --accent: #1F9D6B; --accent-2: #1f6b43; }
.demo-tour.accent-c { --accent: #C98A14; --accent-2: #9A6A0F; }
.demo-tour.accent-d { --accent: #0A2E52; --accent-2: #08243F; }
.demo-tour.accent-e { --accent: #6D5BD0; --accent-2: #4F3FB0; }

.demo-tour-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  color: var(--text);
  text-align: left;
  transition: background .15s ease;
}
.demo-tour-toggle:hover { background: var(--bg-hover); }
.demo-tour-toggle-main {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.demo-tour-play {
  flex: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--sh-1);
}
.demo-tour-play svg { margin-left: 2px; } /* optically centre the play triangle */
.demo-tour-label {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.demo-tour-cue {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  background: var(--bg-sunken);
  padding: 4px 10px;
  border-radius: 999px;
}
.demo-tour-cue svg { flex: none; }

/* Guided-tour popup (opened via U.modal). The video fills the modal body
   edge-to-edge; the hint + download link sit in the modal footer. */
.tour-modal { margin: -22px -24px; }
.tour-modal-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0A2E52;
}
.demo-tour-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
}
.demo-tour-hint svg { flex: none; color: var(--accent, var(--asite-blue)); }
.demo-tour-dl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent, var(--asite-blue));
  text-decoration: none;
  white-space: nowrap;
}
.demo-tour-dl:hover { text-decoration: underline; }

/* ---------------------------------------------------------------
   Dev-only guided-tour re-recorder panel.
   Reached from the header notification bell, which only becomes
   interactive (".rec-armed") when the backing __record-tours dev
   endpoint is detected — so none of this surfaces in production.
   --------------------------------------------------------------- */
.header-icon-btn.rec-armed { cursor: pointer; }
.header-icon-btn.rec-armed .dot {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, .28);
}

.rec-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 64px 16px 16px;
}
.rec-overlay[hidden] { display: none; }

.rec-panel {
  width: 100%; max-width: 460px;
  background: #fff; border-radius: 14px;
  box-shadow: 0 24px 60px rgba(2, 6, 23, .35);
  border: 1px solid rgba(15, 23, 42, .08);
  overflow: hidden; display: flex; flex-direction: column;
  max-height: calc(100vh - 96px);
}

.rec-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #eef1f6; }
.rec-head-txt { display: flex; flex-direction: column; line-height: 1.25; }
.rec-title { font-weight: 650; font-size: 14.5px; color: #0A2E52; }
.rec-sub { font-size: 11.5px; color: #64748b; }
.rec-close {
  margin-left: auto; border: 0; background: transparent;
  font-size: 22px; line-height: 1; color: #5A6473; cursor: pointer;
  width: 30px; height: 30px; border-radius: 8px;
}
.rec-close:hover { background: #f1f5f9; color: #334155; }

.rec-list { padding: 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.rec-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.rec-item:hover { background: #f6f8fb; }
.rec-item input { width: 16px; height: 16px; accent-color: #0072CE; flex: none; }
.rec-item-main { display: flex; flex-direction: column; min-width: 0; }
.rec-item-title { font-size: 13.5px; color: #0A2E52; font-weight: 550; }
.rec-item-id { font-size: 11px; color: #5A6473; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.rec-item-status { margin-left: auto; font-size: 11px; font-weight: 600; color: #5A6473; white-space: nowrap; }
.rec-item-status.is-queued { color: #5A6473; }
.rec-item-status.is-running { color: #0072CE; }
.rec-item-status.is-done { color: #16a34a; }
.rec-item-status.is-failed { color: #dc2626; }

.rec-actions { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid #eef1f6; }
.rec-selall { font-size: 12.5px; color: #475569; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.rec-selall input { width: 15px; height: 15px; accent-color: #0072CE; }
.rec-run {
  margin-left: auto; display: inline-flex; align-items: center; gap: 7px;
  background: #0072CE; color: #fff; border: 0; border-radius: 9px;
  padding: 9px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.rec-run:hover { background: #195fd6; }
.rec-run:disabled { background: #DCE6F0; cursor: not-allowed; }
.rec-run svg { display: block; }

.rec-log {
  margin: 0; padding: 12px 16px;
  background: #0b1220; color: #DCE6F0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px; line-height: 1.5;
  max-height: 220px; overflow: auto;
  white-space: pre-wrap; word-break: break-word;
  border-top: 1px solid #1e293b;
}
.rec-log[hidden] { display: none; }
.rec-panel.busy .rec-close { opacity: .4; pointer-events: none; }
