/* Trial Edge — design system and screens (landing, trial workspace, all trials).
   AutomationEdge tokens only (ds/styles.css); light + dark via data-theme.
   Principles: flat neutral surfaces, 1px borders, shadow only on overlays; brand orange only for the
   primary action, the active navigation item and focus; status colours only for status. */

/* ===================================================================== 1. foundations */
.te {
  --gap-1: 4px; --gap-2: 8px; --gap-3: 12px; --gap-4: 16px; --gap-5: 20px; --gap-6: 24px; --gap-8: 32px;
  --r-sm: 6px; --r-md: 8px; --r-lg: 12px;
  --fs-xs: .75rem; --fs-sm: .8125rem; --fs-md: .875rem; --fs-base: .9375rem; --fs-lg: 1.0625rem; --fs-xl: 1.375rem;
  --h-sm: 32px; --h-md: 38px; --h-lg: 44px;
  --side-w: 272px;
  --shadow-overlay: 0 12px 32px rgb(16 24 40 / .14), 0 2px 6px rgb(16 24 40 / .06);
}
body.te { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--surface-page);
  color: var(--text-body); font-family: var(--font-sans); font-size: var(--fs-base); line-height: 1.5;
  -webkit-font-smoothing: antialiased; overflow-x: hidden; }
.te *, .te *::before, .te *::after { box-sizing: border-box; }
.te [hidden] { display: none !important; }
.te a { color: var(--text-link); text-underline-offset: 2px; }
.te a:hover { color: var(--text-link-hover); }
.te :focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; border-radius: var(--r-sm); }
.te h1, .te h2, .te h3, .te h4 { color: var(--text-strong); letter-spacing: -.01em; }
.te-visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.te-skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface-card); padding: 8px 12px; }
.te-skip:focus { left: 8px; }
.te-ico { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: -3px; }
[data-icon] { display: inline-flex; }

/* typography */
.te-h1 { margin: 0; font-size: var(--fs-xl); line-height: 1.25; font-weight: 650; }
.te-h2 { margin: 0; font-size: var(--fs-lg); line-height: 1.3; font-weight: 650; }
.te-h3 { margin: 0; font-size: var(--fs-base); font-weight: 600; }
.te-lead { margin: 4px 0 0; max-width: 72ch; color: var(--text-body); }
.te-muted { margin: 0; color: var(--text-muted); font-size: var(--fs-md); }
.te-small { font-size: var(--fs-sm); }
.te-fine { margin: 0; color: var(--text-subtle); font-size: var(--fs-sm); }
.te-eyebrow { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: var(--fs-xs); font-weight: 600;
  color: var(--text-muted); letter-spacing: .04em; text-transform: uppercase; }
.te-label-ai { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 500;
  color: var(--text-muted); background: var(--status-neutral-bg); border: 1px solid var(--status-neutral-border);
  padding: 1px 8px; border-radius: 999px; vertical-align: 2px; letter-spacing: 0; text-transform: none; }

/* ===================================================================== 2. components */
/* buttons — three sizes, four kinds */
.te-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--h-md); padding: 0 14px;
  font: inherit; font-size: var(--fs-md); font-weight: 600; line-height: 1; white-space: nowrap; border-radius: var(--r-md);
  border: 1px solid var(--border-default); background: var(--surface-card); color: var(--text-strong); text-decoration: none;
  cursor: pointer; transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.te a.te-btn, .te a.te-btn:hover { color: var(--text-strong); text-decoration: none; }
.te-btn:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.te-btn:active { background: var(--surface-active); }
.te-btn--primary, .te a.te-btn--primary { background: var(--surface-brand); border-color: var(--surface-brand); color: var(--text-on-brand); }
.te-btn--primary:hover, .te a.te-btn--primary:hover { background: var(--ae-orange-600); border-color: var(--ae-orange-600); color: var(--text-on-brand); }
.te-btn--ghost { background: transparent; border-color: transparent; color: var(--text-body); }
.te-btn--ghost:hover { background: var(--surface-hover); border-color: transparent; }
.te-btn--sm { height: var(--h-sm); padding: 0 10px; font-size: var(--fs-sm); }
.te-btn--lg { height: var(--h-lg); padding: 0 18px; font-size: var(--fs-base); }
.te-btn--block { width: 100%; }
.te-btn:disabled, .te-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.te-btn.is-loading .te-ico { animation: te-spin 1s linear infinite; }
.te-icon-btn { width: var(--h-md); height: var(--h-md); display: inline-grid; place-items: center; border-radius: var(--r-md);
  border: 1px solid transparent; background: transparent; color: var(--text-body); cursor: pointer; position: relative;
  transition: background-color .15s ease; }
.te-icon-btn:hover { background: var(--surface-hover); }
.te-actions { display: flex; gap: var(--gap-2); flex-wrap: wrap; align-items: center; }
.te-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 700; background: var(--surface-brand); color: var(--text-on-brand); }

/* tooltips (icon-only controls): <button data-tip="…" aria-label="…"> */
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after { content: attr(data-tip); position: absolute; top: calc(100% + 6px); right: 0;
  z-index: 60; white-space: nowrap; padding: 4px 8px; border-radius: var(--r-sm); font-size: var(--fs-xs); font-weight: 500;
  background: var(--surface-inverse); color: var(--text-inverse); pointer-events: none; }

/* inputs */
.te-form { display: grid; gap: var(--gap-4); }
.te-field { display: grid; gap: 6px; }
.te-field label, .te-label { font-size: var(--fs-md); font-weight: 600; color: var(--text-strong); }
.te-field input, .te-field select, .te-search, .te-chat__form textarea {
  font: inherit; font-size: var(--fs-base); height: var(--h-lg); padding: 0 12px; border-radius: var(--r-md);
  border: 1px solid var(--border-default); background: var(--surface-card); color: var(--text-body);
  transition: border-color .15s ease, box-shadow .15s ease; width: 100%; }
.te-field input:hover, .te-field select:hover, .te-search:hover { border-color: var(--border-strong); }
.te-field input:focus, .te-field select:focus, .te-search:focus, .te-chat__form textarea:focus { outline: none;
  border-color: var(--border-focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--border-focus) 22%, transparent); }
.te-field input[aria-invalid="true"] { border-color: var(--status-danger-fg); }
.te-help { margin: 0; font-size: var(--fs-sm); color: var(--text-subtle); }
.te-search { height: var(--h-md); width: 280px; max-width: 100%; }
.te-drop { display: grid; justify-items: center; gap: 4px; text-align: center; cursor: pointer; padding: 20px 16px;
  border: 1px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--surface-page);
  transition: border-color .15s ease, background-color .15s ease; }
.te-drop:hover, .te-drop.is-over { border-color: var(--border-brand); background: var(--surface-selected); }
.te-drop.has-file { border-style: solid; border-color: var(--status-success-fg); background: var(--status-success-bg); }
.te-drop__icon { color: var(--text-muted); }
.te-drop__icon .te-ico { width: 22px; height: 22px; }
.te-drop__title { font-weight: 600; color: var(--text-strong); overflow-wrap: anywhere; }
.te-drop__hint { font-size: var(--fs-sm); color: var(--text-muted); }
.te-more summary { cursor: pointer; font-size: var(--fs-md); font-weight: 600; color: var(--text-strong); min-height: 32px;
  display: flex; align-items: center; gap: 6px; }
.te-more summary { list-style: none; }
.te-more summary::-webkit-details-marker { display: none; }
.te-more summary::before { content: ""; width: 6px; height: 6px; margin: 0 4px 0 2px; border-right: 2px solid var(--text-subtle);
  border-bottom: 2px solid var(--text-subtle); transform: rotate(-45deg); transition: transform .15s ease; }
.te-more[open] summary::before { transform: rotate(45deg); }
.te-chip { font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--text-muted);
  background: var(--status-neutral-bg); border-radius: 999px; padding: 1px 7px; }
.te-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap-3); margin-top: var(--gap-3); }
.te-switch { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-muted); cursor: pointer; }
.te-switch input { width: 16px; height: 16px; accent-color: var(--surface-brand); }

/* badges: status (pill), metadata (tag), agent state */
.te-pill, .te-tag, .te-state { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; border-radius: 999px;
  border: 1px solid var(--status-neutral-border); background: var(--status-neutral-bg); color: var(--status-neutral-fg); }
.te-pill { font-size: var(--fs-xs); font-weight: 600; padding: 2px 9px; }
.te-pill--ok, .te-tag.is-good, .te-state[data-state="done"] { background: var(--status-success-bg); color: var(--status-success-fg); border-color: var(--status-success-border); }
.te-pill--warn, .te-tag.is-warn { background: var(--status-warning-bg); color: var(--status-warning-fg); border-color: var(--status-warning-border); }
.te-pill--bad, .te-state[data-state="failed"] { background: var(--status-danger-bg); color: var(--status-danger-fg); border-color: var(--status-danger-border); }
.te-pill--info, .te-state[data-state="working"] { background: var(--status-info-bg); color: var(--status-info-fg); border-color: var(--status-info-border); }
.te-tag { font-size: var(--fs-xs); padding: 1px 8px; }
.te-tag .te-ico { width: 12px; height: 12px; }
.te-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.te-state { font-size: 11px; font-weight: 600; padding: 0 7px; text-transform: capitalize; }
.te-status-dot { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.te-status-dot::before, .te-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--border-strong); }
.te-status-dot[data-s="completely"]::before, .te-dot.is-ok::before { background: var(--status-success-fg); }
.te-status-dot[data-s="partial"]::before { background: var(--status-warning-fg); }
.te-status-dot[data-s="cannot"]::before, .te-dot:not(.is-ok):not(.is-off)::before { background: var(--status-danger-fg); }
.te-dot { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-muted); }

/* panels — one container style (no shadow; only overlays get a shadow) */
.te-card, .te-wf, .te-kpi, .te-health, .te-sidecard, .te-tech, .te-timeline, .te-table-wrap, .te-summary {
  background: var(--surface-card); border: 1px solid var(--border-default); border-radius: var(--r-lg); }
.te-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap-4); }
.te-wf { display: grid; gap: var(--gap-3); align-content: start; padding: var(--gap-4) var(--gap-5); min-width: 0; }
.te-wf__top { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: var(--gap-3); align-items: start; }
.te-wf__icon { width: 36px; height: 36px; border-radius: var(--r-md); display: grid; place-items: center;
  color: var(--text-muted); background: var(--surface-sunken); }
.te-wf__icon .te-ico { width: 18px; height: 18px; }
.te-wf__name { font-weight: 650; color: var(--text-strong); line-height: 1.3; }
.te-wf__sub { margin-top: 2px; font-size: var(--fs-sm); color: var(--text-subtle); overflow-wrap: anywhere; }
.te-wf__desc { margin: 0; font-size: var(--fs-md); color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden; }
.te-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap-2); padding-top: var(--gap-3);
  border-top: 1px solid var(--border-subtle); }
.te-stat__k { font-size: var(--fs-xs); color: var(--text-subtle); }
.te-stat__v { font-size: var(--fs-base); font-weight: 650; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.te-stat__v.is-good { color: var(--status-success-fg); }
.te-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: var(--fs-md); color: var(--text-muted); }
.te-checks li { display: grid; grid-template-columns: 18px 1fr; gap: 6px; align-items: start; }
.te-checks li .te-ico { margin-top: 2px; }
.te-checks li.is-ok .te-ico { color: var(--status-success-fg); }
.te-links { display: flex; flex-wrap: wrap; gap: var(--gap-2); }

/* key figures */
.te-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--gap-3); }
.te-kpi { padding: var(--gap-3) var(--gap-4); min-width: 0; }
.te-kpi__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-muted); font-size: var(--fs-sm); }
.te-kpi__icon { color: var(--text-subtle); }
.te-kpi__value { margin: 4px 0 0; font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; color: var(--text-strong);
  font-variant-numeric: tabular-nums; line-height: 1.2; }
.te-kpi__value.is-good { color: var(--status-success-fg); }
.te-kpi__value.is-muted { color: var(--text-muted); }
.te-kpi__note { margin-top: 2px; font-size: var(--fs-xs); color: var(--text-subtle); }

/* alerts / notes */
.te-note, .te-error { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 var(--gap-4); padding: 10px 14px;
  border-radius: var(--r-md); font-size: var(--fs-md); border: 1px solid var(--status-info-border); background: var(--status-info-bg); color: var(--status-info-fg); }
.te-note--warn { border-color: var(--status-warning-border); background: var(--status-warning-bg); color: var(--status-warning-fg); }
.te-error, .te-note--error { border-color: var(--status-danger-border); background: var(--status-danger-bg); color: var(--status-danger-fg); }
.te-error { margin: 0; }
.te-note .te-ico { margin-top: 3px; }

/* empty states */
.te-empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: 6px; text-align: center; padding: 36px 20px;
  border: 1px dashed var(--border-default); border-radius: var(--r-lg); color: var(--text-muted); font-size: var(--fs-md); }
.te-empty .te-ico { width: 24px; height: 24px; color: var(--text-subtle); }
.te-empty b { color: var(--text-strong); font-size: var(--fs-base); }

/* skeleton loaders */
.te-skel { position: relative; overflow: hidden; background: var(--surface-sunken); border-radius: var(--r-md); border-color: transparent !important; }
.te-skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface-card) 70%, transparent), transparent);
  animation: te-shimmer 1.4s ease-in-out infinite; }
.te-skel--kpi { height: 84px; border-radius: var(--r-lg); }
.te-skel--card { height: 220px; border-radius: var(--r-lg); }
.te-skel--line { display: block; height: 12px; margin: 4px 0; }
.te-w-70 { width: 70%; }
.te-self-start { justify-self: start; }

/* tables: sortable headers + segmented filter */
.te-table-wrap { overflow-x: auto; }
.te-table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.te-table th { position: sticky; top: 0; z-index: 1; text-align: left; font-weight: 600; font-size: var(--fs-xs);
  color: var(--text-muted); background: var(--surface-page); padding: 10px 14px; white-space: nowrap;
  border-bottom: 1px solid var(--border-default); }
.te-table th button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.te-table th button:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; border-radius: 4px; }
.te-table th[aria-sort] button::after { content: "\2195"; opacity: .35; font-size: 11px; }
.te-table th[aria-sort="ascending"] button::after { content: "\2191"; opacity: 1; }
.te-table th[aria-sort="descending"] button::after { content: "\2193"; opacity: 1; }
.te-table td { padding: 11px 14px; border-top: 1px solid var(--border-subtle); vertical-align: middle; }
.te-table tbody tr:first-child td { border-top: 0; }
.te-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.te-table tbody tr { transition: background-color .12s ease; }
.te-table tbody tr:hover { background: var(--surface-hover); }
.te-table tr.is-clickable { cursor: pointer; }
.te-table tr.is-clickable:focus-visible { outline: 2px solid var(--border-focus); outline-offset: -2px; }
.te-table tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--surface-brand); }
.te-table tr.is-dim td { color: var(--text-subtle); }
.te-uc-name b { color: var(--text-strong); font-weight: 600; }
.te-table tr.is-dim .te-uc-name b { color: var(--text-muted); font-weight: 500; }
.te-seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: var(--r-md); background: var(--surface-sunken); flex-wrap: wrap; }
.te-seg button { font: inherit; font-size: var(--fs-sm); font-weight: 500; height: 28px; padding: 0 10px; border: 0;
  border-radius: 6px; background: transparent; color: var(--text-muted); cursor: pointer; }
.te-seg button[aria-pressed="true"] { background: var(--surface-card); color: var(--text-strong); box-shadow: 0 1px 2px rgb(16 24 40 / .08); }
.te-seg button:hover { color: var(--text-strong); }

/* compact horizontal progress (build stages) */
.te-timeline { list-style: none; margin: 0 0 var(--gap-4); padding: var(--gap-3) var(--gap-4); display: grid;
  grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--gap-3); }
.te-tl { position: relative; display: grid; gap: 2px; padding-top: 24px; font-size: var(--fs-sm); min-width: 0; }
.te-tl::before { content: ""; position: absolute; top: 8px; left: 22px; right: -8px; height: 2px; background: var(--border-default); }
.te-tl:last-child::before { display: none; }
.te-tl__dot { position: absolute; top: 0; left: 0; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-card); border: 2px solid var(--border-strong); color: #fff; }
.te-tl__dot .te-ico { width: 10px; height: 10px; }
.te-tl b { color: var(--text-strong); font-weight: 600; }
.te-tl small { color: var(--text-subtle); overflow-wrap: anywhere; }
.te-tl[data-status="running"] .te-tl__dot { border-color: var(--status-info-fg); box-shadow: 0 0 0 3px var(--status-info-bg); }
.te-tl[data-status="done"] .te-tl__dot { border-color: var(--status-success-fg); background: var(--status-success-fg); }
.te-tl[data-status="done"]::before { background: var(--status-success-fg); }
.te-tl[data-status="failed"] .te-tl__dot { border-color: var(--status-danger-fg); background: var(--status-danger-fg); }
.te-tl[data-status="skipped"] .te-tl__dot { border-color: var(--border-strong); background: var(--border-strong); }

/* disclosure (technical details) */
.te-tech { margin-top: var(--gap-4); }
.te-tech > summary { cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 var(--gap-4);
  font-weight: 600; color: var(--text-strong); list-style: none; }
.te-tech > summary::-webkit-details-marker { display: none; }
.te-tech > summary::after { content: ""; margin-left: auto; width: 7px; height: 7px; border-right: 2px solid var(--text-subtle);
  border-bottom: 2px solid var(--text-subtle); transform: rotate(45deg); transition: transform .15s ease; }
.te-tech[open] > summary::after { transform: rotate(-135deg); }
.te-tech > .te-files { padding: 0 var(--gap-4) var(--gap-4); }
.te-tech.te-tech--card { margin-top: 0; border-color: var(--border-subtle); background: var(--surface-page); }
.te-tech--card > summary { min-height: 36px; padding: 0 var(--gap-3); font-size: var(--fs-sm); color: var(--text-muted); }
.te-tech--card > :not(summary) { margin: 0 var(--gap-3) var(--gap-3); }

/* dialog + slide-over drawer */
.te-dialog { width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--border-default);
  border-radius: var(--r-lg); background: var(--surface-card); color: var(--text-body); box-shadow: var(--shadow-overlay); }
.te-dialog::backdrop, .te-drawer::backdrop { background: var(--surface-overlay); }
.te-dialog__head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; gap: 16px; align-items: flex-start;
  padding: var(--gap-4) var(--gap-5); background: var(--surface-card); border-bottom: 1px solid var(--border-default); }
.te-dialog__body { padding: var(--gap-4) var(--gap-5) var(--gap-6); overflow: auto; max-height: calc(100vh - 150px); display: grid; gap: var(--gap-5); }
.te-drawer { margin: 0 0 0 auto; width: min(420px, 100vw); height: 100vh; max-height: 100vh; padding: 0; border: 0;
  border-left: 1px solid var(--border-default); background: var(--surface-card); color: var(--text-body); box-shadow: var(--shadow-overlay); }
.te-drawer[open] { display: grid; grid-template-rows: auto 1fr auto; animation: te-slide .2s ease both; }
.te-drawer__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: var(--gap-3) var(--gap-5);
  border-bottom: 1px solid var(--border-default); }
.te-drawer__body { overflow-y: auto; padding: var(--gap-4) var(--gap-5); }
.te-drawer__foot { padding: var(--gap-3) var(--gap-5); border-top: 1px solid var(--border-subtle); }
.te-dsec h4 { margin: 0 0 8px; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--text-subtle); }
.te-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 18px; }
.te-fact { display: grid; gap: 2px; min-width: 0; }
.te-fact span { font-size: var(--fs-xs); color: var(--text-subtle); }
.te-fact b { font-size: var(--fs-md); color: var(--text-strong); font-weight: 600; overflow-wrap: anywhere; }
.te-prose { margin: 0; font-size: var(--fs-md); line-height: 1.6; }
.te-mini { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.te-mini th, .te-mini td { text-align: left; padding: 7px 10px; border-top: 1px solid var(--border-subtle); vertical-align: top; }
.te-mini th { background: var(--surface-page); color: var(--text-muted); font-weight: 600; border-top: 0; }
.te-quote { margin: 0; padding: 8px 12px; border-left: 3px solid var(--border-strong); background: var(--surface-page);
  border-radius: 0 var(--r-md) var(--r-md) 0; font-size: var(--fs-sm); }
.te-md { font-size: var(--fs-md); line-height: 1.6; }
.te-md h1, .te-md h2, .te-md h3, .te-md h4 { margin: 16px 0 6px; line-height: 1.3; }
.te-md h1 { font-size: 1.1rem; } .te-md h2 { font-size: 1rem; } .te-md h3, .te-md h4 { font-size: var(--fs-base); }
.te-md p, .te-md ul { margin: 6px 0; } .te-md ul { padding-left: 20px; }
.te-md pre { margin: 8px 0; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-sunken);
  font-family: var(--font-mono); font-size: var(--fs-xs); white-space: pre-wrap; }
.te-md table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: var(--fs-sm); }
.te-md td, .te-md th { border: 1px solid var(--border-subtle); padding: 5px 8px; vertical-align: top; text-align: left; }
.te-md th { background: var(--surface-page); }

/* toasts */
.te-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.te-toast { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: start; padding: 12px 14px;
  border-radius: var(--r-md); background: var(--surface-card); color: var(--text-body); border: 1px solid var(--border-default);
  box-shadow: var(--shadow-overlay); font-size: var(--fs-md); animation: te-rise .2s ease both; }
.te-toast .te-ico { margin-top: 2px; color: var(--status-info-fg); }
.te-toast--ok .te-ico { color: var(--status-success-fg); }
.te-toast--warn .te-ico { color: var(--status-warning-fg); }
.te-toast--error .te-ico { color: var(--status-danger-fg); }
.te-toast button { all: unset; cursor: pointer; color: var(--text-subtle); padding: 0 2px; font-size: 18px; line-height: 1; }
.te-toast button:focus-visible { outline: 2px solid var(--border-focus); }

/* ===================================================================== 3. layout */
.te-header { position: sticky; top: 0; z-index: 30; background: var(--surface-card); border-bottom: 1px solid var(--border-default); }
.te-header__inner { display: flex; align-items: center; gap: var(--gap-4); height: 56px; padding: 0 var(--gap-5); max-width: 1440px; margin: 0 auto; }
.te-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.te .te-brand, .te .te-brand:hover { color: var(--text-strong); text-decoration: none; }
.te-brand__logo { width: 24px; height: 24px; }
.te-brand__name { font-weight: 700; }
.te-brand__product { font-weight: 600; font-size: var(--fs-xs); color: var(--text-muted); padding: 1px 8px; border-radius: 999px;
  border: 1px solid var(--border-default); }
.te-crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: var(--fs-md); color: var(--text-muted); }
.te-crumbs::before { content: ""; width: 1px; height: 20px; background: var(--border-default); margin-right: 8px; }
.te-crumbs b { color: var(--text-strong); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.te-header__end { margin-left: auto; display: flex; align-items: center; gap: var(--gap-1); }
.te-footer { text-align: center; padding: var(--gap-4); font-size: var(--fs-sm); color: var(--text-subtle); border-top: 1px solid var(--border-default); }

/* landing */
.te-landing { flex: 1; display: grid; align-items: center; }
.te-hero__inner { max-width: 1200px; width: 100%; margin: 0 auto; padding: 40px var(--gap-6); display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 56px; align-items: center; }
.te-hero__title { margin: 12px 0 0; font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem); line-height: 1.15; font-weight: 750;
  letter-spacing: -.02em; text-wrap: balance; }
.te-hero__title em { font-style: normal; color: var(--text-brand); }
.te-hero__sub { margin: 14px 0 0; max-width: 56ch; font-size: var(--fs-lg); color: var(--text-muted); }
.te-gets { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 10px; }
.te-gets li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: center; }
.te-gets li > span:first-child { width: 28px; height: 28px; border-radius: var(--r-md); display: grid; place-items: center;
  background: var(--surface-sunken); color: var(--text-muted); }
.te-gets b { color: var(--text-strong); }
.te-hero__time { display: inline-flex; align-items: center; gap: 6px; margin-top: 20px; }
.te-trust { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 0 0; padding: 0; font-size: var(--fs-sm); color: var(--text-muted); }
.te-trust li { display: inline-flex; align-items: center; gap: 6px; }
.te-trust .te-ico { color: var(--status-success-fg); }
.te-upload { padding: var(--gap-6); }
.te-upload__head { margin-bottom: var(--gap-4); }
.te-hero__visual .te-help { display: none; }

/* trial workspace: header bar, step bar, then content with the AI team / activity panel on the right */
.te-app { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: var(--gap-5) var(--gap-6) var(--gap-8);
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--gap-4) var(--gap-6); align-items: start; }
.te-trialbar { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--gap-4) var(--gap-6);
  align-items: center; padding: var(--gap-4) var(--gap-5); background: var(--surface-card); border: 1px solid var(--border-default);
  border-radius: var(--r-lg); }
.te-trialbar__main { display: grid; gap: 4px; min-width: 0; }
.te-trial__title { margin: 0; font-size: var(--fs-xl); font-weight: 650; line-height: 1.25; }
.te-trial__sub { display: none; }
.te-progress { height: 6px; max-width: 560px; border-radius: 999px; background: var(--surface-sunken); overflow: hidden; margin-top: 6px; }
.te-progress__fill { height: 100%; width: 3%; border-radius: inherit; background: var(--surface-brand); transition: width .5s ease; }
.te-trial__step { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--text-muted); }
.te-trialbar__actions { display: flex; flex-wrap: wrap; gap: var(--gap-2); align-items: center; justify-content: flex-end; }

/* step bar (horizontal) */
.te-steps { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 4px;
  background: var(--surface-card); border: 1px solid var(--border-default); border-radius: var(--r-lg); }
.te-step { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: center; width: 100%;
  min-height: 52px; padding: 6px 12px; border: 0; border-radius: var(--r-md); background: none; color: var(--text-body); font: inherit;
  text-align: left; cursor: pointer; transition: background-color .12s ease; }
.te-step:hover:not(:disabled) { background: var(--surface-hover); }
.te-step:disabled { cursor: not-allowed; opacity: .45; }
.te-step__num { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font-size: var(--fs-xs);
  font-weight: 700; color: var(--text-muted); border: 1px solid var(--border-strong); background: var(--surface-card); }
.te-step__num .te-ico { width: 13px; height: 13px; }
.te-step__text { display: grid; line-height: 1.25; min-width: 0; }
.te-step__text b { font-size: var(--fs-md); font-weight: 600; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.te-step__text small { font-size: var(--fs-xs); color: var(--text-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.te-step[aria-selected="true"] { background: var(--surface-selected); }
.te-step[aria-selected="true"] .te-step__text b { color: var(--text-brand); }
.te-step[aria-selected="true"] .te-step__num { border-color: var(--surface-brand); color: var(--text-brand); }
.te-step.is-done .te-step__num { background: var(--status-success-fg); border-color: var(--status-success-fg); color: #fff; }
.te-step.is-busy .te-step__num { border-color: var(--status-info-fg); color: var(--status-info-fg); animation: te-pulse 1.4s ease-in-out infinite; }

.te-main { grid-column: 1; grid-row: 3; min-width: 0; padding: var(--gap-2) 0 0; }
.te-rail { grid-column: 2; grid-row: 3; position: sticky; top: 72px; display: grid; gap: var(--gap-3); margin-top: var(--gap-2); min-width: 0; }
.te-rail__card { padding: var(--gap-3) var(--gap-3); background: var(--surface-card); border: 1px solid var(--border-default); border-radius: var(--r-lg); min-width: 0; }
.te-rail__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 4px var(--gap-2); }
.te-rail__head h3 { margin: 0; font-size: var(--fs-md); font-weight: 650; }
.te-rail__card--feed { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: calc(100vh - 420px); min-height: 220px; }
.te-rail__card--feed .te-feed { overflow-y: auto; padding: 0 4px; }
.te-rail__card--feed .te-fine { margin: var(--gap-2) 4px 0; }

/* AI team (right panel) */
.te-agents { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.te-agent { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; align-items: center; padding: 4px 8px; border-radius: var(--r-md); }
.te-avatar { width: 26px; height: 26px; border-radius: var(--r-sm); display: grid; place-items: center; font-weight: 700;
  font-size: 10px; color: var(--text-muted); background: var(--surface-sunken); border: 1px solid var(--border-default); }
.te-agent[data-state="working"] .te-avatar { color: var(--status-info-fg); border-color: var(--status-info-border); background: var(--status-info-bg); }
.te-agent[data-state="done"] .te-avatar { color: var(--status-success-fg); border-color: var(--status-success-border); background: var(--status-success-bg); }
.te-agent[data-state="failed"] .te-avatar { color: var(--status-danger-fg); border-color: var(--status-danger-border); background: var(--status-danger-bg); }
.te-agent__name { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-strong); }
.te-agent__what { font-size: var(--fs-xs); color: var(--text-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.te-agent .te-state { display: none; }

/* activity feed (right panel) */
.te-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--gap-3); align-content: start; }
.te-feed:empty::before { content: "Updates from the AI agents appear here."; color: var(--text-subtle); font-size: var(--fs-sm); }
.te-feed__item { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; font-size: var(--fs-sm); }
.te-feed__meta { color: var(--text-subtle); font-size: var(--fs-xs); }
.te-feed__text { color: var(--text-body); line-height: 1.45; overflow-wrap: anywhere; }
.te-feed__text.is-clamped { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }

/* page structure inside the workspace */
.te-pane { min-width: 0; animation: te-fade .2s ease both; }
.te-pane__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--gap-4); flex-wrap: wrap; margin: 0 0 var(--gap-5); }
.te-section-head { display: flex; justify-content: space-between; align-items: center; gap: var(--gap-3); flex-wrap: wrap; margin: var(--gap-6) 0 var(--gap-3); }
.te-section-head h3 { margin: 0; font-size: var(--fs-base); font-weight: 650; }
.te-section-head h3 .te-muted { font-weight: 400; margin-left: 4px; }
.te-banner { display: flex; align-items: center; gap: 10px; margin: 0 0 var(--gap-4); padding: 8px 12px; border-radius: var(--r-md);
  font-size: var(--fs-md); background: var(--status-warning-bg); color: var(--status-warning-fg); border: 1px solid var(--status-warning-border); }

/* analysis status */
.te-status { padding: var(--gap-6); display: grid; grid-template-columns: 40px 1fr; gap: var(--gap-4); max-width: 720px; }
.te-status__icon { width: 40px; height: 40px; border-radius: var(--r-md); display: grid; place-items: center;
  background: var(--status-info-bg); color: var(--status-info-fg); }
.te-status__icon .te-ico { width: 20px; height: 20px; animation: te-spin 1.2s linear infinite; }
.te-status__icon.is-done { background: var(--status-success-bg); color: var(--status-success-fg); }
.te-status__icon.is-failed { background: var(--status-danger-bg); color: var(--status-danger-fg); }
.te-status__icon.is-done .te-ico, .te-status__icon.is-failed .te-ico { animation: none; }
.te-status__body { display: grid; gap: var(--gap-2); }
.te-bar { height: 6px; border-radius: 999px; background: var(--surface-sunken); overflow: hidden; }
.te-bar__fill { height: 100%; width: 5%; border-radius: inherit; background: var(--surface-brand); transition: width .5s ease; }

/* findings */
.te-summary { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: var(--gap-3) 0 0; padding: 10px 14px; font-size: var(--fs-sm); color: var(--text-muted); }
.te-summary b { color: var(--text-strong); font-variant-numeric: tabular-nums; }
.te-proposed { display: flex; align-items: center; gap: 6px; margin-top: var(--gap-3); }

/* test systems */
.te-health { margin: 0 0 var(--gap-4); padding: var(--gap-3) var(--gap-4); }
.te-health__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.te-health__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.te-health__list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: var(--fs-md); min-width: 0; }
.te-health__list b { min-width: 9rem; font-weight: 600; color: var(--text-strong); }
.te-cred { display: grid; gap: 6px; }
.te-cred__row { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: var(--fs-sm); }
.te-cred__k { color: var(--text-muted); font-weight: 600; }
.te-cred__v { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-strong); overflow-wrap: anywhere; }

/* files */
.te-files { display: grid; grid-template-columns: minmax(240px, 1fr) 2fr; gap: var(--gap-3); }
.te-files:has(.te-code[hidden]) { grid-template-columns: 1fr; }
.te-file-list { list-style: none; margin: 0; padding: 4px; max-height: 420px; overflow: auto; border: 1px solid var(--border-subtle);
  border-radius: var(--r-md); }
.te-file-list button { width: 100%; min-height: 32px; display: flex; align-items: center; gap: 8px; padding: 4px 8px; border: 0;
  border-radius: var(--r-sm); background: none; color: var(--text-body); font: inherit; font-size: var(--fs-sm); text-align: left;
  cursor: pointer; overflow-wrap: anywhere; }
.te-file-list button:hover { background: var(--surface-hover); }
.te-file-list button.is-active { background: var(--surface-selected); color: var(--text-brand); font-weight: 600; }
.te-file-list .te-ico { color: var(--text-subtle); }
.te-code { margin: 0; max-height: 420px; overflow: auto; padding: 14px; border-radius: var(--r-md); font-family: var(--font-mono);
  font-size: var(--fs-xs); line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-sunken); color: var(--text-body); }

/* chat */
.te-chatwrap.is-ready { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: var(--gap-4); align-items: start; }
.te-chat { display: grid; grid-template-rows: 1fr auto auto; height: min(620px, calc(100vh - 220px)); min-height: 420px;
  border: 1px solid var(--border-default); border-radius: var(--r-lg); background: var(--surface-card); overflow: hidden; }
.te-chat__log { overflow-y: auto; padding: var(--gap-4); display: flex; flex-direction: column; gap: 10px; background: var(--surface-page); }
.te-msg { max-width: min(80%, 640px); padding: 9px 13px; border-radius: 12px; font-size: var(--fs-md); line-height: 1.5;
  overflow-wrap: anywhere; animation: te-fade .15s ease both; }
.te-msg--user { align-self: flex-end; background: var(--surface-brand); color: var(--text-on-brand); border-bottom-right-radius: 4px; }
.te-msg--bot { align-self: flex-start; background: var(--surface-card); border: 1px solid var(--border-default); border-bottom-left-radius: 4px; }
.te-msg--system { align-self: center; background: none; color: var(--text-subtle); font-size: var(--fs-xs); padding: 2px; }
.te-msg .te-md p:first-child { margin-top: 0; } .te-msg .te-md p:last-child { margin-bottom: 0; }
.te-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 11px 13px; border-radius: 12px;
  background: var(--surface-card); border: 1px solid var(--border-default); }
.te-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-subtle); animation: te-dot 1.2s infinite ease-in-out; }
.te-typing i:nth-child(2) { animation-delay: .15s; } .te-typing i:nth-child(3) { animation-delay: .3s; }
.te-acard { margin-top: 8px; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--status-warning-border);
  background: var(--status-warning-bg); display: grid; gap: 8px; }
.te-acard .te-md { color: var(--text-strong); }
.te-acard__facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: var(--fs-sm); }
.te-acard__facts span { color: var(--text-muted); }
.te-acard__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.te-chat__chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 0; }
.te-chip-btn { border: 1px solid var(--border-default); background: var(--surface-card); color: var(--text-body); border-radius: 999px;
  padding: 0 12px; height: 30px; font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.te-chip-btn:hover { border-color: var(--border-brand); background: var(--surface-selected); }
.te-chat__form { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 12px 12px; align-items: end; }
.te-chat__form textarea { height: auto; min-height: var(--h-md); max-height: 160px; padding: 9px 12px; line-height: 1.45;
  resize: none; overflow-y: auto; display: block; }

/* chat: who is speaking */
.te-msgrow { align-self: flex-start; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; max-width: min(86%, 680px);
  animation: te-fade .15s ease both; }
.te-msgrow .te-msg { max-width: 100%; animation: none; }
.te-msgrow.is-cont { margin-top: -4px; }
.te-msgrow.is-cont .te-avatar { visibility: hidden; }
.te-msgcol { display: grid; gap: 3px; min-width: 0; }
.te-avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; align-self: start;
  background: var(--surface-brand); color: var(--text-on-brand); }
.te-avatar .te-ico { width: 15px; height: 15px; }
.te-msg__who { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }
.te-typing { align-items: center; gap: 8px; }
.te-typing__dots { display: inline-flex; gap: 4px; }
.te-typing__text { font-size: var(--fs-sm); color: var(--text-muted); }

/* chat: starter prompts under the greeting */
.te-chat__chips:not([hidden]) { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; padding: 10px 12px 0; }
.te-starter { display: grid; grid-template-columns: 16px 1fr; gap: 8px; align-items: start; min-height: 44px; padding: 9px 12px;
  border: 1px solid var(--border-default); border-radius: var(--r-md); background: var(--surface-card); color: var(--text-body);
  font: inherit; font-size: var(--fs-sm); line-height: 1.35; text-align: left; cursor: pointer;
  transition: border-color .12s ease, background-color .12s ease; }
.te-starter:hover, .te-starter:focus-visible { border-color: var(--border-brand); background: var(--surface-selected); }
.te-starter .te-ico { width: 16px; height: 16px; margin-top: 1px; color: var(--text-brand); }

/* chat: the approval card and the choice made on it */
.te-acard--approval { border-width: 1px 1px 1px 4px; }
.te-acard__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; color: var(--status-warning-fg); }
.te-acard__head .te-ico { width: 16px; height: 16px; }
.te-acard__head b { color: var(--text-strong); }
.te-acard__head .te-fine { margin-left: auto; }
.te-acard__facts { padding: 8px 10px; border-radius: var(--r-sm, 6px); background: var(--surface-card); }
.te-acard__actions .te-btn { min-height: 40px; }
.te-acard__stamp { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 600;
  color: var(--status-success-fg); }
.te-acard__stamp.is-no { color: var(--text-muted); }
.te-acard__stamp .te-ico { width: 15px; height: 15px; }

/* chat: the run timeline - what the agent is doing, live from the test systems */
.te-run { align-self: stretch; margin-left: 36px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--status-info-border);
  background: var(--status-info-bg); display: grid; gap: 10px; animation: te-fade .2s ease both; }
.te-run.is-done { border-color: var(--status-success-border); background: var(--status-success-bg); }
.te-run.is-warn { border-color: var(--status-warning-border); background: var(--status-warning-bg); }
.te-run__head { display: flex; align-items: center; gap: 8px; }
.te-run__head .te-ico { width: 16px; height: 16px; color: var(--text-brand); }
.te-run__title { color: var(--text-strong); }
.te-run__time { margin-left: auto; font-size: var(--fs-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.te-run__steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; position: relative; }
.te-run__step { display: grid; grid-template-columns: 16px 1fr auto; gap: 8px; align-items: start; font-size: var(--fs-sm);
  color: var(--text-body); animation: te-fade .2s ease both; }
.te-run__step > .te-ico { width: 16px; height: 16px; margin-top: 2px; }
.te-run__step.is-done > .te-ico { color: var(--status-success-fg); }
.te-run__step.is-warn > .te-ico { color: var(--status-warning-fg); }
.te-run__step.is-live > .te-ico { color: var(--status-info-fg); animation: te-spin 1s linear infinite; }
.te-run__step.is-live { color: var(--text-strong); font-weight: 600; }
.te-run__step b { color: var(--text-strong); }
.te-run__link { font-size: var(--fs-xs); color: var(--text-link); white-space: nowrap; }
.te-run__link:hover { color: var(--text-link-hover); }
.te-run__proof { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding-top: 8px;
  border-top: 1px solid var(--border-subtle); }
.te-run__note { margin: 0; }

/* Try it: one header row (title | how to try, new conversation), the chat, one tabbed help panel */
.te-tryhead > div:first-child { max-width: 680px; }
.te-tryhead__actions { align-items: center; }
.te-tryhead .te-modes { margin: 0; }
.te-btn--quiet { width: var(--h-md); padding: 0; justify-content: center; }
.te-btn--quiet .te-btn__label { display: none; }
.te-chatside.te-sidecard { padding: var(--gap-3); gap: var(--gap-3); }
.te-sidetabs { display: flex; gap: 2px; padding: 2px; border-radius: var(--r-md); background: var(--surface-sunken); }
.te-sidetabs button { flex: 1; min-height: 32px; padding: 0 10px; border: 0; border-radius: calc(var(--r-md) - 2px); background: none;
  font: inherit; font-size: var(--fs-sm); font-weight: 500; color: var(--text-muted); cursor: pointer; }
.te-sidetabs button[aria-selected="true"] { background: var(--surface-card); color: var(--text-strong); box-shadow: 0 1px 2px rgb(16 24 40 / .08); }
.te-sidetabs button:hover { color: var(--text-strong); }
.te-sidetabs button:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 1px; }
.te-sidepanel { display: grid; gap: 8px; min-width: 0; }
.te-sidepanel > .te-fine { margin: 0; }
/* chat: details from the screenshots - hint under the box, a live status, a clear failure, aligned typing */
.te-chat__hint { grid-column: 1 / -1; margin: -2px 2px 0; font-size: var(--fs-xs); color: var(--text-subtle); }
.te-chat__status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-card); border: 1px solid var(--border-subtle); color: var(--text-muted); }
.te-chat__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--status-success-fg);
  box-shadow: 0 0 0 3px var(--status-success-bg); }
.te-chat__fail { align-self: stretch; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 14px;
  border-radius: var(--r-md); border: 1px solid var(--status-warning-border); background: var(--status-warning-bg);
  color: var(--text-strong); font-size: var(--fs-sm); }
.te-chat__fail > .te-ico { width: 16px; height: 16px; color: var(--status-warning-fg); }
.te-chat__fail > span { flex: 1; min-width: 200px; }
.te-typing { margin-left: 36px; }
.te-chatside.is-empty { display: none; }
@media (max-width: 600px) { .te-chat__hint { display: none; } .te-typing { margin-left: 0; } }

/* Try it: the trial's automations as cards, and how a request flows through one */
.te-ucstrip { margin: 0 0 var(--gap-4); }
.te-ucstrip__row { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--gap-3); }
.te-uccard { display: grid; align-content: start; gap: 8px; padding: 12px 14px; border: 1px solid var(--border-default);
  border-radius: var(--r-lg); background: var(--surface-card); min-width: 0; }
.te-uccard.is-open { border-color: var(--border-brand); box-shadow: 0 0 0 1px var(--border-brand); }
.te-uccard__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.te-uccard__name { font-size: var(--fs-md); line-height: 1.3; color: var(--text-strong); }
.te-uccard__top .te-pill { flex: none; }
.te-uccard__sys { font-size: var(--fs-xs); color: var(--text-muted); }
.te-uccard .te-tag { justify-self: start; }
.te-uccard__acts { display: flex; flex-wrap: wrap; gap: 6px; }
.te-uccard--add { place-content: center; justify-items: center; text-align: center; min-height: 112px; border-style: dashed;
  background: none; font: inherit; color: var(--text-body); cursor: pointer; transition: border-color .12s ease, background-color .12s ease; }
.te-uccard--add:hover, .te-uccard--add:focus-visible { border-color: var(--border-brand); background: var(--surface-selected); }
.te-uccard--add .te-ico { width: 18px; height: 18px; color: var(--text-brand); }
.te-flow { margin-top: var(--gap-3); padding: 14px 16px; border: 1px solid var(--border-default); border-radius: var(--r-lg);
  background: var(--surface-card); animation: te-fade .15s ease both; }
.te-flow__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.te-flow__head .te-fine { flex: 1; }
.te-flow__steps { list-style: none; margin: 0; padding: 0 0 4px; display: grid; grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 1fr); gap: 24px; overflow-x: auto; }
.te-flow__node { position: relative; display: grid; align-content: start; gap: 3px; padding: 10px 12px; min-width: 0;
  border: 1px solid var(--border-default); border-radius: var(--r-md); background: var(--surface-page);
  font-size: var(--fs-sm); color: var(--text-muted); transition: border-color .2s ease, background-color .2s ease; }
.te-flow__node > b { color: var(--text-strong); }
.te-flow__node + .te-flow__node::before { content: ""; position: absolute; left: -20px; top: 22px; width: 14px; height: 2px;
  background: var(--border-strong); }
.te-flow__node + .te-flow__node::after { content: ""; position: absolute; left: -8px; top: 18px; border: 5px solid transparent;
  border-left-color: var(--border-strong); }
.te-flow__node.is-done { border-color: var(--status-success-border); background: var(--status-success-bg); }
.te-flow__node.is-live { border-color: var(--status-info-border); background: var(--status-info-bg); animation: te-pulse 1.6s ease-in-out infinite; }
.te-flow__node.is-warn { border-color: var(--status-warning-border); background: var(--status-warning-bg); }
.te-flow__systems { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 8px; }
.te-flow__systems li { display: grid; grid-template-columns: 14px 1fr; gap: 2px 6px; align-items: center; }
.te-flow__systems .te-ico { width: 14px; height: 14px; color: var(--text-subtle); }
.te-flow__systems li.is-done .te-ico { color: var(--status-success-fg); }
.te-flow__sys { color: var(--text-strong); font-weight: 600; }
.te-flow__systems .te-tag, .te-flow__does { grid-column: 2; justify-self: start; }
@media (max-width: 700px) {
  .te-ucstrip__row { grid-auto-flow: column; grid-auto-columns: minmax(230px, 82%); grid-template-columns: none;
    overflow-x: auto; scroll-snap-type: x mandatory; }
  .te-uccard { scroll-snap-align: start; }
  .te-flow__steps { grid-auto-flow: row; grid-auto-columns: auto; gap: 18px; }
  .te-flow__node + .te-flow__node::before { left: 22px; top: -14px; width: 2px; height: 10px; }
  .te-flow__node + .te-flow__node::after { left: 18px; top: -6px; border-left-color: transparent; border-top-color: var(--border-strong); }
}

/* Findings: the prospect adds use cases to the trial */
.te-addbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 var(--gap-3);
  padding: 10px 14px; border-radius: var(--r-md); border: 1px solid var(--border-brand); background: var(--surface-selected);
  font-size: var(--fs-sm); color: var(--text-strong); }
.te-addbar > span:first-child .te-ico { width: 16px; height: 16px; color: var(--text-brand); }
.te-addbar #te-uc-addtext { flex: 1; min-width: 200px; }
.te-addpick { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; min-height: 32px; padding: 0 8px;
  border-radius: var(--r-md); border: 1px solid var(--border-default); background: var(--surface-card);
  font-size: var(--fs-sm); color: var(--text-body); cursor: pointer; }
.te-addpick:hover { border-color: var(--border-brand); }
.te-addpick input { width: 16px; height: 16px; margin: 0; accent-color: var(--surface-brand); cursor: pointer; }

/* Connectors (admins) */
.tc-form { padding: var(--gap-5); margin-bottom: var(--gap-5); }
.tc-form .te-h2 { margin: 0 0 var(--gap-4); }
.tc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap-4); }
.tc-wide { grid-column: 1 / -1; }
.tc-grid .te-field .te-fine { display: block; margin-top: 4px; }
.tc-actions { white-space: nowrap; }
.tc-actions .te-btn + .te-btn { margin-left: 6px; }
.tc-url { overflow-wrap: anywhere; color: var(--text-muted); }
.tc-ok { color: var(--status-success-fg); }
.tc-bad { color: var(--status-danger-fg); }
@media (max-width: 700px) { .tc-grid { grid-template-columns: 1fr; } }
.te-app.is-try { grid-template-columns: minmax(0, 1fr); }
.te-app.is-try .te-rail { display: none; }
.te-app.is-try .te-chatwrap.is-ready { grid-template-columns: minmax(0, 1fr) minmax(0, 340px); }
.te-app.is-try .te-chat { height: min(680px, calc(100vh - 200px)); }
@media (max-width: 1100px) { .te-app.is-try .te-chatwrap.is-ready { grid-template-columns: minmax(0, 1fr); } }
.te-chatside { display: grid; gap: var(--gap-3); }
.te-sidecard { padding: var(--gap-3) var(--gap-4); }
.te-sidecard h3 { margin: 0 0 8px; font-size: var(--fs-md); font-weight: 650; }
.te-scenarios { display: grid; gap: 6px; }
.te-scenario { display: grid; grid-template-columns: 20px 1fr 14px; gap: 8px; align-items: center; width: 100%; min-height: 40px;
  padding: 6px 10px; border-radius: var(--r-md); border: 1px solid var(--border-default); background: var(--surface-card);
  color: var(--text-body); font: inherit; font-size: var(--fs-sm); text-align: left; cursor: pointer; transition: border-color .12s ease, background-color .12s ease; }
.te-scenario:hover { border-color: var(--border-brand); background: var(--surface-selected); }
.te-scenario .te-ico { width: 14px; height: 14px; color: var(--text-subtle); }
.te-scenario__n { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700;
  background: var(--surface-sunken); color: var(--text-muted); }
.te-howto { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: var(--fs-sm); color: var(--text-muted); }
.te-howto b { color: var(--text-strong); font-weight: 600; }
.te-next { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--gap-4); margin-top: var(--gap-4);
  padding: var(--gap-4) var(--gap-5); border-radius: var(--r-lg); border: 1px solid var(--border-default); background: var(--surface-card); }
.te-next h3 { margin: 0 0 2px; font-size: var(--fs-base); }

/* all-trials page */
.te-page { width: 100%; max-width: 1200px; margin: 0 auto; padding: var(--gap-6) var(--gap-6) var(--gap-8); flex: 1; }
.te-table--trials td:nth-child(1) { white-space: nowrap; }
.te-table--trials td:nth-child(2), .te-table--trials td:nth-child(3) { overflow-wrap: anywhere; max-width: 220px; }
.te-table--trials td:nth-child(5) { min-width: 150px; }
.te-table--trials td:nth-child(7), .te-table--trials td:nth-child(8) { white-space: nowrap; }

/* scrollbars: always visible (the design system hides them; these are long pages) */
@supports (-moz-appearance: none) { html, .te * { scrollbar-width: auto; scrollbar-color: var(--text-subtle) transparent; } }
/* The window scrollbar is styled from <body> here (its overflow passes to the viewport), so style both. */
:root::-webkit-scrollbar, body.te::-webkit-scrollbar { width: 12px; height: 12px; }
:root::-webkit-scrollbar-track, body.te::-webkit-scrollbar-track { background: var(--surface-page); }
:root::-webkit-scrollbar-thumb, body.te::-webkit-scrollbar-thumb { background: var(--text-subtle); border-radius: 999px;
  border: 3px solid var(--surface-page); }
:root::-webkit-scrollbar-thumb:hover, body.te::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
.te *::-webkit-scrollbar { width: 8px; height: 8px; }
.te *::-webkit-scrollbar-track { background: transparent; }
.te *::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
.te *:hover::-webkit-scrollbar-thumb { background: var(--text-subtle); }

/* ===================================================================== 4. motion (subtle, and off for reduced motion) */
@keyframes te-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes te-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes te-slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes te-pulse { 50% { box-shadow: 0 0 0 4px var(--status-info-bg); } }
@keyframes te-spin { to { transform: rotate(360deg); } }
@keyframes te-shimmer { to { transform: translateX(100%); } }
@keyframes te-dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .te *, .te *::before, .te *::after { animation: none !important; transition: none !important; } }

/* ===================================================================== 5. responsive */
@media (max-width: 1100px) {
  .te-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .te-chatwrap.is-ready { grid-template-columns: 1fr; }
  .te-chatwrap.is-ready .te-chatside { order: 1; }           /* the conversation first, its helpers below */
}
@media (max-width: 900px) {
  .te-app { grid-template-columns: 1fr; padding: var(--gap-4); }
  .te-rail { grid-column: 1; grid-row: auto; position: static; order: 99; }
  .te-main { grid-row: auto; }
  .te-rail__card--feed { max-height: 420px; }
  .te-trialbar { grid-template-columns: 1fr; }
  .te-trialbar__actions { justify-content: flex-start; }
  .te-steps { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
  .te-step { flex: none; width: auto; min-height: 44px; padding: 4px 12px 4px 6px; scroll-snap-align: start; }
  .te-step__text small { display: none; }
  .te-main { padding: 0; }
  .te-hero__inner { grid-template-columns: 1fr; gap: var(--gap-6); padding: var(--gap-6) var(--gap-4); }
  .te-cards, .te-files, .te-grid3 { grid-template-columns: 1fr; }
  .te-timeline { grid-auto-flow: row; grid-auto-columns: auto; }
  .te-tl { padding: 0 0 0 28px; }
  .te-tl::before { display: none; }
  .te-crumbs { display: none; }
}
@media (max-width: 600px) {
  .te-header__inner { padding: 0 var(--gap-4); gap: var(--gap-2); }
  .te-brand__product { display: none; }
  .te-hide-sm { display: none !important; }
  .te-msg { max-width: 92%; }
  .te-msgrow { max-width: 96%; }
  .te-run { margin-left: 0; }
  .te-chat { height: calc(100vh - 220px); min-height: 380px; }
  .te-chat__form .te-btn__label { display: none; }
  .te-cred__row { grid-template-columns: 1fr auto; } .te-cred__k { grid-column: 1 / -1; }
  .te-upload { padding: var(--gap-4); }
  .te-search { width: 100%; }
  .te-pane__head .te-actions { width: 100%; }
}
@media (max-width: 420px) {
  .te-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap-2); }
  .te-kpi__value { font-size: 1.25rem; }
  .te-status { grid-template-columns: 1fr; }
}

/* test data (Try it) */
.te-testdata__table { overflow-x: auto; margin-top: 8px; border: 1px solid var(--border-subtle); border-radius: var(--r-md); }
.te-testdata__table table { width: 100%; border-collapse: collapse; font-size: var(--fs-xs); }
.te-testdata__table th, .te-testdata__table td { text-align: left; padding: 5px 8px; border-top: 1px solid var(--border-subtle);
  vertical-align: top; white-space: nowrap; }
.te-testdata__table th { border-top: 0; color: var(--text-muted); font-weight: 600; background: var(--surface-page); }
.te-testdata__table td:first-child { font-weight: 600; color: var(--text-strong); }
.te-testdata__name { margin: 10px 0 0; font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }
.te-chatwrap.is-ready { grid-template-columns: minmax(0, 1fr) minmax(0, 320px); }
/* the test-data tables are wide (nowrap): keep them inside their card and scroll sideways there */
.te-chatwrap > *, .te-chatside, .te-sidecard, #te-testdata-tables { min-width: 0; }
.te-chatside { align-content: start; }
@media (max-width: 1100px) { .te-chatwrap.is-ready { grid-template-columns: minmax(0, 1fr); } }

/* Try it: the trial's tickets in AiDesk */
.te-itsm { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; max-height: 360px; overflow-y: auto; }
.te-itsm__row { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--border-subtle); border-radius: var(--r-md);
  background: var(--surface-page); min-width: 0; }
.te-itsm__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.te-itsm__head b { font-size: var(--fs-sm); color: var(--text-strong); }
.te-itsm__title { font-size: var(--fs-sm); color: var(--text-body); overflow-wrap: anywhere; }
.te-itsm__open { font-size: var(--fs-xs); justify-self: start; }

/* Try it by e-mail */
.te-modes { margin: 0 0 var(--gap-3); }
.te-modes .te-ico { width: 14px; height: 14px; }
.te-modes button { display: inline-flex; align-items: center; gap: 6px; }
.te-mail { display: grid; gap: var(--gap-3); min-width: 0; align-content: start; }
.te-mail__bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: var(--fs-sm); color: var(--text-muted); }
.te-mail__bar b { color: var(--text-strong); overflow-wrap: anywhere; }
.te-mail__form { display: grid; gap: 8px; padding: var(--gap-3) var(--gap-4); border: 1px solid var(--border-default);
  border-radius: var(--r-lg); background: var(--surface-card); }
.te-mail__row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; align-items: center; }
.te-mail__row label { font-size: var(--fs-sm); color: var(--text-muted); }
.te-mail__row input, .te-mail__form textarea { width: 100%; min-width: 0; font: inherit; }
.te-mail__row input { height: var(--h-md); }
.te-mail__form textarea { resize: vertical; min-height: 96px; padding: 8px 10px; border: 1px solid var(--border-default);
  border-radius: var(--r-md); background: var(--surface-card); color: var(--text-body); }
.te-mail__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.te-mail__actions .te-fine { margin-right: auto; }
.te-mail__list { display: grid; gap: var(--gap-3); max-height: min(560px, calc(100vh - 260px)); overflow-y: auto; padding-right: 2px; }
.te-thread { display: grid; gap: 8px; padding: var(--gap-3) var(--gap-4); border: 1px solid var(--border-default);
  border-radius: var(--r-lg); background: var(--surface-card); min-width: 0; }
.te-thread > .te-btn { justify-self: start; }
.te-thread__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.te-thread__head h3 { margin: 0; font-size: var(--fs-md); font-weight: 650; overflow-wrap: anywhere; }
.te-thread__head .te-pill { flex: none; }
.te-mailmsg { padding: 8px 12px; border-radius: var(--r-md); background: var(--surface-page); border: 1px solid var(--border-subtle); min-width: 0; }
.te-mailmsg--bot { background: var(--surface-selected); border-color: var(--border-brand); }
.te-mailmsg__meta { display: flex; justify-content: space-between; gap: 8px; font-size: var(--fs-xs); color: var(--text-muted); margin-bottom: 4px; }
.te-mailmsg__meta b { color: var(--text-strong); font-weight: 600; overflow-wrap: anywhere; }
.te-mailmsg__text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-sm); line-height: 1.5; color: var(--text-body); }
@media (max-width: 600px) { .te-mail__row { grid-template-columns: 1fr; gap: 2px; } }
