/* Derrick "Web app" demo (embeds/<feature>.html?surface=app).
   A replica of the app's list screen (app.derrick-app.com/lists/:id), fake data
   from window.SIM. Values copied from the app's web-theme.css (people-completor
   frontend/src/styles/web-theme.css) and the Tailwind classes of LeadGrid.tsx /
   CellContent.tsx / ActionsDrawer. Everything is scoped under .as-root. */

html.as-app, html.as-app body { height: 100%; margin: 0; overflow: hidden; background: #fff; }

.as-root {
  /* web-theme.css :root tokens (lines 18-80) */
  --d-brand: #097fe8;
  --d-brand-hover: #0768c5;
  --d-brand-tint: rgba(9, 127, 232, 0.1);
  --d-night: #0b1220;
  --d-night-elev: #11203d;
  --d-text: #1a1a1a;
  --d-text-body: #666666;
  --d-text-muted: #999999;
  --d-bg: #ffffff;
  --d-bg-subtle: #f8f9fa;
  --d-bg-muted: #f5f5f5;
  --d-border: #e5e5e5;
  --d-border-strong: #cccccc;
  --d-success: #10b981;
  --d-danger: #dc2626;
  --d-font-display: 'Syne', 'Trebuchet MS', system-ui, sans-serif;
  --d-font-body: 'Syne', 'Trebuchet MS', system-ui, sans-serif;
  --d-font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --d-chamfer: 9px;
  --d-shadow-md: 0 12px 32px rgba(0, 0, 0, 0.12);
  --d-focus-ring: 0 0 0 3px rgba(9, 127, 232, 0.14);
  --d-ease: cubic-bezier(0.4, 0, 0.2, 1);
  /* grid (LeadGrid.tsx Tailwind literals) */
  --g-line: #edeff2;
  --g-grey: #9aa3af;
  --g-num: #b6bcc6;
  --g-hover: #f7f8fa;
  --g-sel: #eaf4fd;

  display: flex;
  height: 100vh;
  min-height: 460px;
  overflow: hidden;
  background: var(--d-bg);
  color: var(--d-text);
  font-family: var(--d-font-body);
  font-size: 13px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  text-align: left;
}
.as-root *, .as-root *::before, .as-root *::after { box-sizing: border-box; }
.as-root :where(button, input, select, textarea) { font: inherit; color: inherit; margin: 0; }
.as-root :where(svg) { display: block; flex-shrink: 0; }
.as-ico { width: 12px; height: 12px; }

/* ── Main column ───────────────────────────────────────────────────────── */
.as-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* List tabs (ListTabs.tsx; .dw-ltabs*, web-theme.css 7476-7526, 7718-7719) */
.as-ltabs { display: flex; align-items: stretch; flex-shrink: 0; border-bottom: 1px solid var(--d-border); background: var(--d-bg-subtle); }
.as-ltabs__scroll { display: flex; align-items: stretch; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.as-ltabs__scroll::-webkit-scrollbar { display: none; }
.as-ltabs__tab {
  display: inline-flex; align-items: center; gap: 7px; max-width: 240px; padding: 0 8px 0 12px; height: 42px;
  border-right: 1px solid var(--d-border); font-family: var(--d-font-display); font-size: 13px; font-weight: 600;
  color: var(--d-text-muted); cursor: pointer; box-shadow: inset 0 -1px 0 var(--d-border); flex-shrink: 0;
  background: transparent; border-top: 0; border-left: 0; border-bottom: 0;
}
.as-ltabs__tab:hover { color: var(--d-text); background: var(--d-bg); }
.as-ltabs__tab.is-on { color: var(--d-text); background: var(--d-bg); max-width: 340px; box-shadow: inset 0 2px 0 var(--d-brand); cursor: default; }
.as-ltabs__ico { width: 11px; height: 11px; color: var(--d-text-muted); }
.as-ltabs__tab.is-on .as-ltabs__ico { color: var(--d-text-body); }
.as-ltabs__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-ltabs__count { font-family: var(--d-font-mono); font-size: 11px; font-weight: 400; color: var(--d-text-muted); flex-shrink: 0; }
.as-ltabs__close { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex-shrink: 0; color: var(--d-text-muted); opacity: 0.6; }
.as-ltabs__close:hover { opacity: 1; color: var(--d-text); background: var(--d-border); }
.as-ltabs__add {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex-shrink: 0; align-self: center;
  border: 0; border-left: 1px solid var(--d-border); background: transparent; cursor: pointer; color: var(--d-text-muted);
}
.as-ltabs__add:hover { color: var(--d-brand); background: var(--d-bg); }
.as-ltabs__tab.is-busy .as-ltabs__name { color: var(--d-brand); }
.as-spin {
  display: inline-block; width: 11px; height: 11px; flex-shrink: 0; border-radius: 50%;
  border: 2px solid rgba(9, 127, 232, 0.25); border-top-color: var(--d-brand); animation: as-spin 0.7s linear infinite;
}
.as-spin--w { border-color: rgba(255, 255, 255, 0.35); border-top-color: #fff; width: 13px; height: 13px; }
@keyframes as-spin { to { transform: rotate(360deg); } }

.as-body { flex: 1; min-height: 0; display: flex; }
.as-work { flex: 1; min-width: 0; display: flex; flex-direction: column; container-type: inline-size; }

/* Grid toolbar (GridToolbar.tsx; .dw-tb*, web-theme.css 6300-6420, 6537-6548, 6665-6670) */
.as-tb { display: flex; align-items: center; gap: 6px; padding: 8px 4px; flex-shrink: 0; }
.as-tb__wrap { position: relative; }
.as-tb__btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: 13px; color: var(--d-text-body);
  background: transparent; border: 0; border-radius: 6px; cursor: pointer; white-space: nowrap;
}
.as-tb__btn > svg { width: 11px; height: 11px; color: var(--d-text-muted); }
.as-tb__btn:hover { background: var(--d-bg-subtle); color: var(--d-text); }
.as-tb__btn[disabled] { opacity: 0.4; cursor: default; }
.as-tb__btn[disabled]:hover { background: transparent; color: var(--d-text-body); }
.as-tb__right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.as-tb__push {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border: 0;
  background: var(--d-night); color: #fff; cursor: pointer; white-space: nowrap;
  font-family: var(--d-font-display); font-size: 12.5px; font-weight: 600;
  --d-chamfer: 7px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--d-chamfer)), calc(100% - var(--d-chamfer)) 100%, 0 100%);
  transition: background-color 150ms var(--d-ease);
}
.as-tb__push:hover, .as-tb__push.is-on { background: var(--d-night-elev); }
.as-tb__push > svg { width: 12px; height: 12px; }
.as-tb__caret { width: 9px !important; height: 9px !important; opacity: 0.7; }
.as-tb__search {
  width: 160px; height: 30px; padding: 0 10px; border: 1px solid var(--d-border-strong); border-radius: 0;
  background: #fff; font-family: var(--d-font-body); font-size: 13px; color: var(--d-text); outline: none;
}
.as-tb__search:focus { border-color: var(--d-brand); box-shadow: var(--d-focus-ring); }
/* .dw-tb__pop + push menu */
.as-pop {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 50; min-width: 240px; padding: 8px;
  display: flex; flex-direction: column; gap: 2px; background: var(--d-bg); border: 1px solid var(--d-border); box-shadow: var(--d-shadow-md);
}
.as-pop__item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: transparent;
  text-align: left; cursor: pointer; border-radius: 6px; font-family: var(--d-font-display); font-size: 13px; color: var(--d-text-muted);
}
.as-pop__item:hover { background: var(--d-bg-subtle); color: var(--d-text); }
.as-pop__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-pop__connect { font-family: var(--d-font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--d-text-muted); }
.as-pop__item:hover .as-pop__connect { color: var(--d-brand); }
/* Narrow work area: labels go before the controls do. */
@container (max-width: 700px) { .as-tb__lbl { display: none; } }
@container (max-width: 470px) { .as-tb__opt { display: none; } }

/* Grid (LeadGrid.tsx div-based rows: header h-[42px], gutter w-[48px], ROW_H 34) */
.as-grid { flex: 1; min-height: 0; overflow: auto; position: relative; border-top: 1px solid var(--d-border); }
.as-grid__inner { width: max-content; min-width: 100%; }
.as-hrow {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: stretch; height: 42px;
  border-bottom: 1px solid var(--g-line); background: #fff;
}
.as-row { display: flex; align-items: stretch; height: 34px; border-bottom: 1px solid var(--g-line); background: #fff; }
.as-row:hover, .as-row:hover .as-gut { background: var(--g-hover); }
.as-row.is-sel, .as-row.is-sel .as-gut { background: var(--g-sel); }
.as-gut {
  position: sticky; left: 0; z-index: 2; width: 48px; flex-shrink: 0; display: flex; align-items: center;
  justify-content: space-between; gap: 4px; padding: 0 6px; border-right: 1px solid var(--g-line); background: #fff;
}
.as-hrow .as-gut { justify-content: flex-end; padding: 0 8px 0 0; }
.as-gut input { width: 13px; height: 13px; margin: 0; cursor: pointer; accent-color: var(--d-brand); }
.as-row .as-gut input { opacity: 0; }
.as-row:hover .as-gut input, .as-row.is-sel .as-gut input { opacity: 1; }
.as-gut__n { font-size: 11px; font-variant-numeric: tabular-nums; color: var(--g-num); }
.as-th {
  position: relative; display: flex; flex-shrink: 0; align-items: center; gap: 6px; padding: 0 12px;
  border-left: 1px solid var(--g-line); min-width: 0; cursor: default;
}
.as-th.is-first, .as-td.is-first { border-left: 0; }
.as-th__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; color: var(--d-text); }
.as-th--action .as-th__label { font-weight: 700; }
.as-letter {
  flex-shrink: 0; border-radius: 4px; padding: 0 4px; font-size: 9px; font-weight: 600; line-height: 14px;
  background: #f1f3f6; color: var(--g-grey);
}
.as-letter--f { color: #fff; }
.as-th__icon { flex-shrink: 0; font-size: 11px; line-height: 1; }
.as-th__run {
  flex-shrink: 0; margin-left: auto; display: inline-flex; align-items: center; justify-content: center;
  padding: 3px 4px; border: 0; border-radius: 4px; background: transparent; color: var(--g-grey); cursor: pointer;
}
.as-th__run > svg { width: 10px; height: 10px; }
.as-th__run:hover { background: var(--g-sel); color: var(--d-brand); }
.as-th__run[disabled] { opacity: 0.4; cursor: default; }
.as-more {
  position: sticky; right: 0; z-index: 20; display: flex; flex-shrink: 0; align-items: center; gap: 6px; padding: 0 12px;
  border: 0; border-left: 1px solid #e2e5ea; background: #eef0f3; font-size: 13px; font-weight: 500; color: #5b6472; cursor: pointer; white-space: nowrap;
}
.as-more > svg { width: 11px; height: 11px; }
.as-more:hover { background: var(--g-sel); color: var(--d-brand); }
.as-more.is-icon { width: 36px; justify-content: center; padding: 0; }
.as-td {
  position: relative; display: flex; flex-shrink: 0; min-width: 0; align-items: center; padding: 6px 8px;
  border-left: 1px solid var(--g-line); overflow: hidden;
}
.as-v { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--d-text); }
.as-dash { font-size: 13px; color: var(--g-grey); }
.as-stat { font-size: 13px; color: var(--g-grey); white-space: nowrap; }
.as-lockic { color: #c4c9d1; }
.as-lockic > svg { width: 10px; height: 10px; }
/* CellContent.tsx: locked action cell */
.as-unlock {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid #e0d3fb; border-radius: 9999px;
  background: #f6f1fe; font-size: 12px; font-weight: 600; color: #7c3aed; cursor: pointer; white-space: nowrap;
}
.as-unlock > svg { width: 10px; height: 10px; }
.as-unlock:hover { border-color: #7c3aed; background: #efe6fd; }
.as-unlock[disabled] { opacity: 0.6; cursor: default; }
.as-unlock__cost { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 400; color: #9b8bc4; }
.as-unlock__cost > svg { width: 11px; height: 11px; }
/* CellContent.tsx: ActionOutcome (found) and not found */
.as-out { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.as-done { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--d-success); }
.as-done > svg { width: 11px; height: 11px; }
.as-cr { font-size: 10px; color: var(--g-grey); }
.as-fields {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; border: 1px solid #bcdcfb; border-radius: 4px;
  background: #eef6ff; font-size: 10px; font-weight: 600; color: var(--d-brand); cursor: pointer;
  box-shadow: 0 1px 0 rgba(9, 127, 232, 0.12); align-self: center;
}
.as-fields > svg { width: 8px; height: 8px; opacity: 0.7; }
.as-fields:hover { border-color: var(--d-brand); background: var(--d-brand); color: #fff; }
/* pending rows (import in flight): animate-pulse bars */
.as-pend { height: 12px; border-radius: 4px; background: #eef0f3; animation: as-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
@keyframes as-pulse { 50% { opacity: 0.5; } }
.as-row.is-new { animation: as-rise 0.3s var(--d-ease) both; }
.as-reveal { animation: as-fade 0.35s var(--d-ease) both; }
@keyframes as-rise { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes as-fade { from { opacity: 0; } to { opacity: 1; } }
/* "Add more leads" quick-add row, sticky at the bottom */
.as-addrow {
  position: sticky; bottom: 0; z-index: 10; display: flex; align-items: stretch; width: 100%; height: 34px;
  border: 0; border-top: 1px solid #e2e5ea; background: #f7f8fa; text-align: left; cursor: pointer; padding: 0;
}
.as-addrow .as-gut { background: #f7f8fa; justify-content: center; color: #5b6472; }
.as-addrow .as-gut > svg { width: 12px; height: 12px; }
.as-addrow__lbl { position: sticky; left: 48px; display: flex; align-items: center; gap: 6px; padding: 0 8px; font-size: 13px; font-weight: 500; color: #5b6472; }
.as-addrow__lbl > svg { width: 10px; height: 10px; }
.as-empty { padding: 28px 20px; font-size: 13px; color: var(--g-grey); position: sticky; left: 0; max-width: 100cqw; }

/* ── Right drawer (ActionsDrawer/index.tsx: aside w-[400px], header px-4 py-3; 340px under 1180px) ── */
.as-drawer {
  width: 400px; flex-shrink: 0; display: flex; flex-direction: column; overflow: hidden;
  border-left: 1px solid var(--g-line); background: #fff; animation: as-drawer 0.25s var(--d-ease) both;
}
@keyframes as-drawer { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.as-drawer[hidden] { display: none; }
.as-dh { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--g-line); }
.as-dh__t { display: flex; align-items: center; font-size: 14px; font-weight: 600; color: var(--d-text); }
.as-dh__t > svg { width: 12px; height: 12px; color: var(--d-brand); margin-right: 6px; }
.as-dh__scope { margin-left: 8px; border-radius: 9999px; background: var(--g-sel); padding: 2px 8px; font-size: 10px; font-weight: 500; color: var(--d-brand); }
.as-dh__x { border: 0; background: transparent; color: var(--g-grey); cursor: pointer; padding: 2px; }
.as-dh__x:hover { color: var(--d-text); }
.as-dh__x > svg { width: 13px; height: 13px; }
.as-dscroll { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }

/* Action page inside the drawer (.dw-feature + .dw-fbody*, web-theme.css 3965-4160, 4296-4560, 7833-7900, 8457-8462),
   at the drawer's narrow container sizes. */
.as-eyebrow { font-family: var(--d-font-mono); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; color: var(--d-text-muted); }
.as-head { display: flex; flex-direction: column; gap: 8px; padding: 16px 20px 2px; }
.as-head__t { margin: 0; font-family: var(--d-font-display); font-size: 22px; font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; color: var(--d-text); }
.as-costb {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; margin-top: 2px;
  background: var(--d-brand-tint); color: var(--d-brand); font-family: var(--d-font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.as-costb > svg { width: 12px; height: 12px; }
.as-col { display: flex; flex-direction: column; gap: 12px; padding: 12px 20px 12px; }
.as-mainf { display: flex; flex-direction: column; gap: 12px; }
/* Inputs card: hairline + brand register crosses at the corners */
.as-card { position: relative; padding: 14px 16px 14px; border: 1px solid var(--d-border-strong); background: var(--d-bg); }
.as-card::before {
  content: ''; position: absolute; inset: -4.5px; pointer-events: none; background-color: var(--d-brand);
  --cross: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='9'%3E%3Cpath d='M4.5 0v9M0 4.5h9' stroke='%23000' stroke-width='1'/%3E%3C/svg%3E");
  -webkit-mask-image: var(--cross), var(--cross), var(--cross), var(--cross); mask-image: var(--cross), var(--cross), var(--cross), var(--cross);
  -webkit-mask-position: left top, right top, left bottom, right bottom; mask-position: left top, right top, left bottom, right bottom;
  -webkit-mask-size: 9px 9px; mask-size: 9px 9px; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
.as-card__h { margin-bottom: 10px; }
.as-fieldset { display: flex; flex-direction: column; gap: 14px; }
.as-field { display: flex; flex-direction: column; }
.as-label { margin-bottom: 6px; font-family: var(--d-font-display); font-size: 14px; font-weight: 600; color: var(--d-text); }
.as-label i { font-style: normal; color: var(--d-text-muted); font-weight: 500; font-size: 12px; margin-left: 4px; }
/* react-select control in .dw-feature: 44px, square, #ccc */
.as-sel { position: relative; }
.as-sel__ctl {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--d-border-strong);
  border-radius: 0; background: #fff; font-size: 14px; color: var(--d-text); cursor: pointer; text-align: left;
}
.as-sel__ctl:hover { border-color: var(--d-text-muted); }
.as-sel.is-open .as-sel__ctl { border-color: var(--d-brand); box-shadow: var(--d-focus-ring); }
.as-sel.is-err .as-sel__ctl { border-color: var(--d-danger); }
.as-sel__v { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.as-sel__chev { width: 12px; height: 12px; color: var(--d-border-strong); padding-left: 8px; border-left: 1px solid var(--d-border); box-sizing: content-box !important; }
.as-badge { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex-shrink: 0; background: var(--d-brand); color: #fff; font-size: 10px; font-weight: 600; }
.as-sel__menu {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; padding: 4px 0; max-height: 220px; overflow-y: auto;
  background: #fff; border: 1px solid var(--d-border); box-shadow: var(--d-shadow-md);
}
.as-sel.is-open .as-sel__menu { display: block; }
.as-sel__opt { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 12px; border: 0; background: transparent; font-size: 14px; color: var(--d-text); cursor: pointer; text-align: left; }
.as-sel__opt:hover { background: #deebff; }
.as-sel__opt.is-on { background: var(--d-brand); color: #fff; }
.as-sel__opt.is-on .as-badge { background: #fff; color: var(--d-brand); }
.as-sample { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding-left: 2px; font-size: 10.5px; color: var(--g-grey); overflow: hidden; white-space: nowrap; }
.as-sample > svg { width: 9px; height: 9px; }
.as-sample b { font-family: var(--d-font-mono); font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.as-text {
  width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--d-border-strong); border-radius: 0; background: #fff;
  font-family: var(--d-font-body); font-size: 14px; color: var(--d-text); outline: none; resize: vertical; line-height: 1.4;
}
.as-text:focus { border-color: var(--d-brand); box-shadow: var(--d-focus-ring); }
.as-text.is-err { border-color: var(--d-danger); }
textarea.as-text { min-height: 62px; }
/* Prompt with @column mentions */
.as-prompt { position: relative; }
.as-prompt__ed { min-height: 72px; white-space: pre-wrap; word-break: break-word; cursor: text; }
.as-prompt__ed:empty::before { content: attr(data-ph); color: var(--d-text-muted); }
.as-prompt__ed[contenteditable='false'] { background: var(--d-bg-subtle); cursor: default; }
.as-root .tok { display: inline-block; padding: 0 5px; margin: 0 1px; background: var(--d-brand-tint); color: var(--d-brand-hover); font-weight: 600; font-size: 13px; }
.as-hint { font-family: var(--d-font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--d-text-muted); margin-left: 6px; font-weight: 400; }
.as-mention {
  display: none; position: absolute; left: 0; top: calc(100% + 4px); z-index: 30; min-width: 220px; padding: 4px;
  background: #fff; border: 1px solid var(--d-border); box-shadow: 0 16px 40px rgba(15, 54, 89, 0.16), 0 2px 6px rgba(15, 54, 89, 0.08);
}
.as-mention.is-on { display: block; }
.as-mention__h { padding: 6px 8px 4px; font-family: var(--d-font-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--d-text-muted); }
.as-mention__i { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 9px; border: 0; background: transparent; color: var(--d-text-body); font-size: 13px; cursor: pointer; text-align: left; }
.as-mention__i:hover { background: var(--d-bg-subtle); color: var(--d-text); }
.as-torun { margin-top: 10px; font-size: 14px; color: #9a9ab0; }
.as-torun span { text-decoration: underline; text-decoration-style: dashed; text-underline-offset: 3px; }
.as-err { display: none; align-items: center; gap: 7px; margin-top: 8px; font-size: 12.5px; color: var(--d-danger); }
.as-err.is-on { display: flex; }
.as-err > svg { width: 14px; height: 14px; }
/* "Where do the results go?" (GenericSectionV2.tsx ~433 + .dw-feature aria-pressed segment) */
.as-dest { display: flex; flex-direction: column; gap: 6px; }
.as-dest__l { font-size: 12px; font-weight: 600; color: var(--d-text); }
.as-seg { display: inline-flex; align-self: flex-start; border: 1px solid var(--d-border-strong); background: var(--d-bg); }
.as-seg button { padding: 8px 14px; border: 0; background: transparent; font-family: var(--d-font-display); font-size: 13px; font-weight: 600; color: #6b7280; cursor: pointer; }
.as-seg button + button { border-left: 1px solid var(--d-border); }
.as-seg button[aria-pressed='true'] { background: var(--d-text); color: #fff; }
/* Run footer (.dw-feature footer + .dw-web .dw-runbtn): 52px, night, chamfer */
.as-foot { flex-shrink: 0; display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 20px 12px; border-top: 1px solid var(--d-border); background: #fff; }
.as-run {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; padding: 0 20px; border: 0;
  background: var(--d-night); color: #fff; font-family: var(--d-font-display); font-size: 15px; font-weight: 600; cursor: pointer;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--d-chamfer)), calc(100% - var(--d-chamfer)) 100%, 0 100%);
  transition: background-color 300ms var(--d-ease);
}
.as-run:hover { background: var(--d-night-elev); }
.as-run > svg { width: 12px; height: 12px; }
.as-run__l { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-run__c { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; background: rgba(255, 255, 255, 0.14); padding: 3px 9px; font-size: 0.82em; font-weight: 600; }
.as-run__c > svg { width: 12px; height: 12px; }
.as-run.is-busy { cursor: default; background: var(--d-night-elev); }
.as-run.is-done { background: var(--d-success); }
.as-run.is-done:hover { background: #059669; }
.as-foot__meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 16px; }
.as-foot__cr { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; font-family: var(--d-font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--d-text-muted); }
.as-foot__cr > svg { width: 12px; height: 12px; color: var(--d-brand); }
.as-foot__cr > b { font-size: 12px; letter-spacing: 0; color: var(--d-text); font-variant-numeric: tabular-nums; transition: color 150ms var(--d-ease); }
.as-foot__cr.is-tick > b { color: var(--d-brand); }
.as-foot__cr.is-low > b { color: var(--d-danger); }
.as-again { display: none; border: 0; background: transparent; padding: 0; font-size: 11px; font-weight: 600; color: var(--d-text-muted); cursor: pointer; }
.as-again.is-on { display: inline-flex; align-items: center; gap: 5px; }
.as-again > svg { width: 11px; height: 11px; }
.as-again:hover { color: var(--d-text-body); }

/* ── Narrow iframes ─────────────────────────────────────────────────────── */
@media (max-width: 1179px) { .as-drawer { width: 340px; } }
@media (max-width: 719px) {
  html.as-app, html.as-app body { height: auto; overflow: auto; }
  .as-root { height: auto; min-height: 0; overflow: visible; }
  .as-body { flex-direction: column; }
  .as-work { height: 340px; flex: none; }
  .as-drawer { width: 100%; border-left: 0; border-top: 1px solid var(--d-border); overflow: visible; }
  .as-dscroll { overflow: visible; }
  .as-ltabs__tab:not(.is-on) { display: none; }
}

/* ?fit=1 (home hero window): the frame has a fixed height, so never stack. */
@media (max-width: 719px) {
  html.as-app.as-fitdoc, html.as-app.as-fitdoc body { height: 100%; overflow: hidden; }
  .as-root.as-fit { height: 100vh; min-height: 0; overflow: hidden; }
  .as-root.as-fit .as-body { flex-direction: row; }
  .as-root.as-fit .as-work { height: auto; flex: 1; }
}
.as-root.as-fit { min-height: 0; }
/* The home window is ~920px wide: a slimmer drawer leaves the grid room for the name column. */
@media (max-width: 1179px) { .as-root.as-fit .as-drawer { width: 300px; } }

@media (prefers-reduced-motion: reduce) {
  .as-root *, .as-root *::before, .as-root *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .as-spin { animation: none; }
}

/* ── Home hero autoplay (home-app.html + app-autoplay.js): no drawer, the
   list plays by itself; a glove clicks the column run buttons. ── */
.as-root.as-auto { position: relative; cursor: default; }
.as-auto .as-main { pointer-events: none; }
.as-auto .as-grid { overflow: hidden; transition: opacity 0.3s var(--d-ease); }
.as-auto .as-grid.is-fading { opacity: 0.25; }
.as-auto .as-hand {
  position: absolute; z-index: 40; width: 36px; height: 36px; left: 60%; top: 110%; pointer-events: none;
  opacity: 0; transform-origin: 40% 8%;
  filter: drop-shadow(0 3px 5px rgba(11, 20, 38, 0.35));
  transition: left 0.9s cubic-bezier(0.4, 0, 0.2, 1), top 0.9s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, transform 0.15s ease;
}
.as-auto .as-hand svg { width: 36px; height: 36px; }
.as-auto .as-hand.is-on { opacity: 1; }
.as-auto .as-hand.is-press { transform: scale(0.84); }
.as-auto .as-th__run.is-press { background: var(--g-sel); color: var(--d-brand); transform: scale(0.88); }
.as-auto .as-tb__push { transition: background-color 150ms var(--d-ease), transform 150ms var(--d-ease); }
.as-auto .as-tb__push.is-press { background: var(--d-night-elev); transform: scale(0.95); }

/* ── Single-step autoplay on any feature page (?surface=app&autoplay=1,
   app-sim.js): same glove and .as-auto rules as the home, plus the drawer
   controls the glove presses. Non interactive. ── */
.as-root.as-play { pointer-events: none; user-select: none; -webkit-user-select: none; }
.as-root.as-play .as-drawer { width: clamp(236px, 42%, 300px); }
.as-play .as-dscroll { overflow: hidden; }
.as-play .as-head { padding: 12px 16px 0; gap: 6px; }
.as-play .as-head__t { font-size: 16px; }
.as-play .as-col { padding: 10px 16px; }
.as-play .as-card { padding: 10px 12px; }
.as-play .as-card__h { margin-bottom: 6px; }
.as-play .as-label { font-size: 13px; margin-bottom: 4px; }
.as-play textarea.as-text { min-height: 56px; resize: none; }
.as-play .as-dest { display: none; }
.as-play .as-foot { padding: 10px 16px; gap: 6px; }
.as-play .as-run { height: 42px; font-size: 14px; }
.as-play .as-text.is-focus { border-color: var(--d-brand); box-shadow: var(--d-focus-ring); }
.as-play .as-text, .as-play .as-sel__ctl, .as-play .as-run { transition: transform 150ms var(--d-ease), background-color 150ms var(--d-ease); }
.as-play .as-text.is-press, .as-play .as-sel__ctl.is-press { border-color: var(--d-brand); transform: scale(0.98); }
.as-play .as-sel__opt.is-press { background: var(--d-brand-hover); }
.as-play .as-run.is-press { background: var(--d-night-elev); transform: scale(0.97); }
.as-play .as-unlock.is-press { transform: scale(0.94); }
.as-play .as-typing::after { content: ''; display: inline-block; width: 1px; height: 13px; margin-left: 1px; vertical-align: -2px; background: var(--d-text); animation: as-caret 0.8s steps(1) infinite; }
@keyframes as-caret { 50% { opacity: 0; } }
.as-play.is-paused *, .as-play.is-paused *::before, .as-play.is-paused *::after { animation-play-state: paused !important; }

/* ── Workflow demo (workflow.html + app-workflow.js): one list, several
   actions chained; the "Add a column" drawer shows the app's catalog
   (EnrichCatalog.tsx + ActionSearchBar + .dw-catchip). ── */
.as-root.as-wf .as-body { position: relative; }
.as-root.as-wf .as-drawer { width: clamp(260px, 34%, 340px); }
@media (max-width: 640px) {
  .as-root.as-wf .as-drawer { position: absolute; top: 0; right: 0; bottom: 0; width: 100%; z-index: 30; }
}
.as-wf .as-dh__x { display: inline-flex; color: var(--g-grey); }
.as-wf .as-dh__x > svg { width: 13px; height: 13px; }
.as-wf .as-th.wf-hi { background: var(--g-sel); box-shadow: inset 0 -2px 0 var(--d-brand); }
.as-wf .as-more.is-press { background: var(--g-sel); color: var(--d-brand); }
.wf-search { padding: 10px 14px 8px; }
.wf-search__box { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; background: #f5f5f5; min-width: 0; font-size: 13px; color: #1a1a1a; transition: box-shadow 150ms var(--d-ease); }
.wf-search__box > svg { width: 13px; height: 13px; color: #999; }
.wf-search__in { white-space: pre; }
.wf-search__ph { color: #999; }
.wf-search__in:not(:empty) + .wf-search__ph { display: none; }
.wf-search.is-focus .wf-search__box, .wf-search.is-press .wf-search__box { box-shadow: var(--d-focus-ring); }
.wf-search.is-focus .wf-search__in::after { content: ''; display: inline-block; width: 1px; height: 13px; margin-left: 1px; vertical-align: -2px; background: var(--d-text); animation: as-caret 0.8s steps(1) infinite; }
.wf-chips { display: flex; gap: 6px; overflow: hidden; padding: 6px 8px 4px; }
.wf-chips[hidden], #wfManual[hidden], .wf-row[hidden] { display: none; }
.wf-chip { display: inline-flex; align-items: center; flex-shrink: 0; padding: 5px 10px; border: 1px solid var(--d-border); background: var(--d-bg); font-family: var(--d-font-display); font-size: 12px; font-weight: 600; color: var(--d-text-body); white-space: nowrap; }
.wf-chip.is-on { background: var(--d-night); color: #fff; border-color: var(--d-night); }
.wf-list { display: flex; flex-direction: column; gap: 8px; padding: 12px 8px; }
.wf-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid #f0f1f3; border-radius: 8px; background: #fff; transition: border-color 150ms var(--d-ease), background-color 150ms var(--d-ease); }
.wf-row.is-manual { border-style: dashed; border-color: #dde1e6; margin: 8px 8px 0; width: calc(100% - 16px); }
.wf-row.is-press { border-color: #097fe8; background: #f7f8fa; }
.wf-ico { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 8px; }
.wf-ico > svg { width: 13px; height: 13px; }
.wf-ico--emoji { font-size: 15px; line-height: 1; }
.wf-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.wf-t { font-size: 13px; font-weight: 500; color: #1a1a1a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-d { font-size: 11px; color: #9aa3af; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-wf .as-prompt__ed { min-height: 88px; background: #fff; }
.as-wf .as-prompt__ed.is-focus { border-color: var(--d-brand); box-shadow: var(--d-focus-ring); }
.as-wf .as-prompt__ed.is-focus::after { content: ''; display: inline-block; width: 1px; height: 14px; margin-left: 1px; vertical-align: -2px; background: var(--d-text); animation: as-caret 0.8s steps(1) infinite; }
.as-wf .as-mention { position: relative; top: 4px; }
.as-wf .as-mention__i.is-press, .as-wf .as-mention__i.is-hover { background: var(--d-bg-subtle); color: var(--d-text); }
