/* ============================================================
   Lead Capture demo (Demos page, tile 05): one live sheet that fills two ways (outbound, inbound),
   with the AI deciding on every row. Built from two reference dashboards: a leads table with a stat
   strip, line charts, tick-mark scores and an orange accent, and a pipeline with pastel status tags.
   Colour: warm greys and white, one orange accent. Every text colour here is at least 4.5:1 on its
   background (white on the accent orange is 5.2:1); the pale fills and bars are decoration only.
   See scripts/leads-demo.js.
   ============================================================ */
.ld {
  --ld-ink: #1a1612; --ld-soft: #3d3a34; --ld-muted: #5f5c55; --ld-faint: #736f67;
  --ld-line: #e8e5df; --ld-line-2: #d6d2c9; --ld-tint: #f7f6f3; --ld-tint-2: #efede8;
  --ld-accent: #c2410c; --ld-accent-hi: #9a3412; --ld-accent-soft: #fdeadf; --ld-accent-g: #ea580c;
  --ld-ease: cubic-bezier(0.23, 1, 0.32, 1);
  --ld-cols: 20px minmax(136px, 1.05fr) 96px minmax(110px, 1.4fr) 104px 112px minmax(100px, 1fr) 32px;
  position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; outline: 0;
  font-family: var(--font-body, 'Switzer', 'Segoe UI', sans-serif); font-size: 13.5px; line-height: 1.4;
  color: var(--ld-ink); background: #fff; letter-spacing: -0.003em;
}
.ld [hidden] { display: none !important; }
:where(.ld) button, :where(.ld) input { font: inherit; color: inherit; letter-spacing: inherit; }
:where(.ld) button { cursor: pointer; border: 0; background: none; text-align: left; padding: 0; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.ld-i { width: 16px; height: 16px; flex: none; display: block; }
.ld :focus-visible { outline: 2px solid var(--ld-ink); outline-offset: 2px; }
.ld input:focus, .ld input:focus-visible { outline: 0; box-shadow: none; }
.ld h3 { margin: 0; font-weight: 500; font-size: 18px; letter-spacing: -0.02em; }

/* ---------- top bar ---------- */
.ld-top { display: flex; align-items: center; gap: 10px; padding: 12px 20px 8px; flex: none; }
.ld-title { display: flex; align-items: center; gap: 8px; margin-right: 4px; }
.ld-count { min-width: 28px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--ld-tint-2); color: var(--ld-muted); font-size: 12px; line-height: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.ld-pipe { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--ld-line); background: var(--ld-tint); font-size: 12.5px; color: var(--ld-muted); white-space: nowrap; }
.ld-pipe b { color: var(--ld-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.ld-queue { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.ld-queue:empty { display: none; }
.ld-queue::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ld-queue.is-busy { background: #fef3c7; color: #92400e; }
.ld-queue.is-busy::before { background: var(--ld-accent-g); animation: ld-blink 1.2s ease-in-out infinite; }
.ld-queue.is-clear { background: #dcfce7; color: #166534; }
@keyframes ld-blink { 50% { opacity: 0.35; } }
.ld-ai { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px 0 8px; border-radius: 999px; border: 1px solid var(--ld-line); background: #fff; min-width: 0; max-width: 270px; }
.ld-ai-orb { width: 24px; height: 24px; flex: none; display: block; }
.ld-ai-t { font-size: 12.5px; color: var(--ld-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-skip { height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--ld-line-2); background: #fff; font-size: 13px; transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease; }
.ld-skip:hover { border-color: var(--ld-ink); background: var(--ld-tint); }
.ld-skip:active { transform: scale(0.97); }

/* ---------- the three steps and what is happening ---------- */
.ld-rail { padding: 0 20px 8px; flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.ld-steps { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; list-style: none; flex: none; }
.ld-step { display: inline-flex; align-items: center; gap: 9px; padding: 4px 14px 4px 5px; border-radius: 999px; border: 1px solid var(--ld-line); color: var(--ld-muted); transition: background-color 260ms ease, color 260ms ease, border-color 260ms ease; }
.ld-n { width: 22px; height: 22px; border-radius: 50%; background: var(--ld-tint-2); color: var(--ld-soft); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; transition: background-color 260ms ease, color 260ms ease; }
.ld-sl { display: flex; flex-direction: column; line-height: 1.15; }
.ld-sl b { font-weight: 500; font-size: 13px; }
.ld-sl i { font-style: normal; font-size: 11px; color: var(--ld-faint); }
.ld-step.is-on { background: var(--ld-accent); border-color: var(--ld-accent); color: #fff; }
.ld-step.is-on .ld-n { background: #fff; color: var(--ld-accent); }
.ld-step.is-on .ld-sl i { color: #fff; }
.ld-step.is-done { color: var(--ld-soft); border-color: var(--ld-line-2); }
.ld-step.is-done .ld-n { background: var(--ld-ink); color: #fff; }
.ld-cap { margin: 0; flex: 1 1 300px; min-width: 0; font-size: 12.5px; line-height: 1.35; color: var(--ld-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ld-cap.ld-swap { animation: ld-fade 420ms ease-out both; }
@keyframes ld-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- the four numbers, each with its own line chart ---------- */
.ld-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 20px 10px; flex: none; border: 1px solid var(--ld-line); border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(26, 22, 18, 0.04); overflow: hidden; }
.ld-stat { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 16px 7px 18px; min-width: 0; border-left: 1px solid var(--ld-line); }
.ld-stat:first-child { border-left: 0; }
.ld-stat-t { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.ld-stat-t i { font-style: normal; font-size: 12px; color: var(--ld-muted); white-space: nowrap; }
.ld-stat-n { display: inline-flex; align-items: baseline; gap: 8px; }
.ld-stat-n b { font-size: 24px; font-weight: 500; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.ld-trend { font-style: normal; font-size: 11.5px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ld-trend.is-up { color: #166534; } .ld-trend.is-down { color: #b91c1c; }
.ld-spark { width: 84px; height: 34px; flex: none; overflow: visible; }
.ld-spark-l { fill: none; stroke: var(--ld-accent-g); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; stroke-dasharray: 260; stroke-dashoffset: 260; animation: ld-draw 1.1s var(--ld-ease) 0.25s forwards; }
.ld-spark-a { fill: rgba(234, 88, 12, 0.1); }
@keyframes ld-draw { to { stroke-dashoffset: 0; } }

/* ---------- the sheet ---------- */
.ld-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 272px; gap: 14px; padding: 0 20px; }
.ld-table { container: ldt / inline-size; min-width: 0; min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--ld-line); border-radius: 16px; overflow: hidden; background: #fff; position: relative; box-shadow: 0 1px 2px rgba(26, 22, 18, 0.04); }
.ld-bar2 { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px 0 6px; border-bottom: 1px solid var(--ld-line); flex: none; }
.ld-tabs { display: flex; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.ld-tabs::-webkit-scrollbar { display: none; }
.ld-tab { position: relative; height: 44px; padding: 0 13px; font-size: 13.5px; color: var(--ld-muted); white-space: nowrap; transition: color 160ms ease; }
.ld-tab b { font-weight: 500; font-size: 11.5px; margin-left: 3px; color: var(--ld-faint); font-variant-numeric: tabular-nums; }
.ld-tab::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--ld-accent); transform: scaleX(0); transition: transform 260ms var(--ld-ease); }
.ld-tab:hover { color: var(--ld-ink); }
.ld-tab.is-on { color: var(--ld-accent); font-weight: 500; }
.ld-tab.is-on b { color: var(--ld-accent); }
.ld-tab.is-on::after { transform: scaleX(1); }
.ld-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.ld-search { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 34px; width: 180px; padding: 0 2px; color: var(--ld-faint); border-bottom: 1px solid var(--ld-line-2); transition: color 160ms ease; }
.ld-search::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ld-accent); transform: scaleX(0); transform-origin: left; transition: transform 300ms var(--ld-ease); }
.ld-search:focus-within { color: var(--ld-accent); }
.ld-search:focus-within::after { transform: scaleX(1); }
.ld-search .ld-i { width: 15px; height: 15px; }
.ld-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: 13px; color: var(--ld-ink); caret-color: var(--ld-accent); -webkit-appearance: none; appearance: none; }
.ld-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.ld-search input::placeholder { color: var(--ld-faint); }
.ld-add { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px 0 11px; border-radius: 10px; background: var(--ld-accent); color: #fff; font-size: 13px; font-weight: 500; transition: background-color 160ms ease, transform 160ms ease; }
.ld-add .ld-i { width: 15px; height: 15px; }
.ld-add:hover { background: var(--ld-accent-hi); }
.ld-add:active { transform: scale(0.97); }
.ld-head, .ld-row { display: grid; grid-template-columns: var(--ld-cols); align-items: center; column-gap: 10px; padding: 0 14px; }
.ld-head { height: 34px; flex: none; background: #faf9f7; border-bottom: 1px solid var(--ld-line); font-size: 11px; color: var(--ld-muted); letter-spacing: 0.06em; text-transform: uppercase; }
.ld-head > span, .ld-head > button { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; text-transform: inherit; letter-spacing: inherit; height: 24px; border-radius: 6px; margin-left: -4px; padding: 0 4px; transition: color 140ms ease, background-color 140ms ease; }
.ld-sort:hover { color: var(--ld-ink); background: var(--ld-tint-2); }
.ld-sort-i { width: 12px; height: 12px; transform: rotate(90deg); transition: transform 240ms var(--ld-ease), opacity 160ms ease; opacity: 0.55; }
.ld-sort.is-on { color: var(--ld-accent); }
.ld-sort.is-on .ld-sort-i { opacity: 1; }
.ld-sort.is-asc .ld-sort-i { transform: rotate(-90deg); }
.ld-ow { display: inline-flex; justify-content: center; }
.ld-ow .ld-i { width: 14px; height: 14px; }
.ld-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ld-rows { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.ld-rows::-webkit-scrollbar { display: none; }
.ld-row {
  position: relative; height: 52px; max-height: 52px; overflow: hidden; border-bottom: 1px solid var(--ld-line); cursor: pointer;
  transition: opacity 300ms ease, max-height 340ms var(--ld-ease), background-color 160ms ease;
}
.ld-row.ld-enter, .ld-row.ld-leave { opacity: 0; max-height: 0; border-bottom-width: 0; }
.ld-row:hover { background: var(--ld-tint); }
.ld-row.is-sel { background: #fff7f0; }
.ld-row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; transition: background-color 400ms ease; }
.ld-row.ld-v-hot::before { background: #16a34a; }
.ld-row.ld-v-warm::before { background: var(--ld-accent-g); }
.ld-row.is-reading::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(234, 88, 12, 0.1), transparent); transform: translateX(-100%); animation: ld-scan 900ms ease-in-out infinite; pointer-events: none; }
@keyframes ld-scan { to { transform: translateX(100%); } }
.ld-row.ld-fresh { animation: ld-hot 1.5s ease-out; }
@keyframes ld-hot { 0% { background: rgba(22, 163, 74, 0.16); } 100% { background: transparent; } }
.ld-c { min-width: 0; display: flex; align-items: center; gap: 8px; }
.ld-c-ck { justify-content: center; }

/* the little tick box (also used to select every row) */
.ld-ck { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid #b3aea3; background: #fff; display: inline-flex; align-items: center; justify-content: center; color: #fff; flex: none; position: relative; transition: background-color 140ms ease, border-color 140ms ease; }
.ld-ck::before { content: ""; position: absolute; inset: -8px; }
.ld-ck .ld-i { width: 12px; height: 12px; opacity: 0; transform: scale(0.6); transition: opacity 120ms ease, transform 180ms var(--ld-ease); stroke-width: 2.6; }
.ld-ck:hover { border-color: var(--ld-ink); }
.ld-ck[aria-checked="true"], .ld-ck[aria-checked="mixed"] { background: var(--ld-accent); border-color: var(--ld-accent); }
.ld-ck[aria-checked="true"] .ld-i, .ld-ck[aria-checked="mixed"] .ld-i { opacity: 1; transform: none; }
.ld-ck[aria-checked="mixed"] .ld-i { transform: scaleX(0.6); }

.ld-avw { position: relative; flex: none; display: inline-flex; }
.ld-ava { width: 32px; height: 32px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 600; color: var(--ld-soft); }
.ld-dirb { position: absolute; right: -4px; bottom: -3px; width: 17px; height: 17px; border-radius: 50%; border: 2px solid #fff; display: inline-flex; align-items: center; justify-content: center; box-sizing: content-box; }
.ld-row:hover .ld-dirb { border-color: var(--ld-tint); }
.ld-dirb .ld-i { width: 10px; height: 10px; }
.ld-c-lead { gap: 10px; }
.ld-lt { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; border-radius: 6px; }
.ld-lt b { font-weight: 500; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-lt i { font-style: normal; font-size: 12px; color: var(--ld-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-lt:hover b { color: var(--ld-accent); }
.ld-src { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ld-dir { width: 24px; height: 24px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--ld-tint-2); color: var(--ld-soft); }
.ld-dir .ld-i { width: 13px; height: 13px; }
.ld-dir-in { background: #dbeafe; color: #1e40af; }
.ld-dir-out { background: var(--ld-accent-soft); color: var(--ld-accent-hi); }
.ld-src-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.ld-src-t b { font-weight: 500; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-src-t i { font-style: normal; font-size: 11px; color: var(--ld-faint); }
.ld-convo { font-size: 12.5px; color: var(--ld-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; animation: ld-fade 360ms ease-out both; }
.ld-convo .ld-ci { width: 12px; height: 12px; display: inline-block; vertical-align: -2px; margin-right: 6px; color: var(--ld-faint); }
.ld-convo.is-muted { color: var(--ld-muted); }
.ld-c-next { font-size: 12.5px; color: var(--ld-soft); animation: ld-fade 360ms ease-out both; display: block; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ld-skel { display: block; width: 70%; height: 8px; border-radius: 4px; background: var(--ld-tint-2); }

/* status tags (pastel pills) */
.ld-tag { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; animation: ld-fade 280ms ease-out both; }
.ld-t-grey { background: var(--ld-tint-2); color: #4a463f; }
.ld-t-blue { background: #dbeafe; color: #1e40af; }
.ld-t-teal { background: #ccfbf1; color: #0f5e57; }
.ld-t-purple { background: #ede9fe; color: #5b21b6; }
.ld-t-amber { background: #fef3c7; color: #92400e; }
.ld-t-green { background: #dcfce7; color: #166534; }

/* the score: ten ticks, filled by how high it is, then the number in a small box */
.ld-score { display: inline-flex; align-items: center; gap: 8px; }
.ld-ticks { display: inline-flex; align-items: center; gap: 2px; height: 18px; }
.ld-ticks i { display: block; width: 3px; height: 16px; border-radius: 2px; background: #e5e2db; transform-origin: center bottom; }
.ld-ticks i.on { animation: ld-tick 420ms var(--ld-ease) var(--d, 0ms) both; }
.ld-ticks i.on.ld-hot { background: color-mix(in srgb, #16a34a calc(var(--i, 0) * 11%), #eab308); }
.ld-ticks i.on.ld-warm { background: color-mix(in srgb, var(--ld-accent-g) calc(var(--i, 0) * 11%), #f59e0b); }
.ld-ticks i.on.ld-cold { background: #b8b4aa; }
@keyframes ld-tick { from { transform: scaleY(0.2); opacity: 0.3; } to { transform: none; opacity: 1; } }
.ld-sn { min-width: 30px; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--ld-line-2); background: #fff; font-size: 12.5px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; animation: ld-fade 320ms ease-out both; }
.ld-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.ld-chip.ld-hot { background: #dcfce7; color: #166534; }
.ld-chip.ld-warm { background: #fef3c7; color: #92400e; }
.ld-chip.ld-cold { background: var(--ld-tint-2); color: #4a463f; }
.ld-reading { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--ld-soft); }
.ld-reading i { width: 4px; height: 4px; border-radius: 50%; background: var(--ld-accent); animation: ld-dot 900ms ease-in-out infinite; }
.ld-reading i:nth-child(2) { animation-delay: 140ms; } .ld-reading i:nth-child(3) { animation-delay: 280ms; margin-right: 4px; }
@keyframes ld-dot { 0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }
.ld-c-ow { justify-content: center; }
.ld-av { width: 28px; height: 28px; border-radius: 50%; background: var(--ld-ink); color: #fff; font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em; display: inline-flex; align-items: center; justify-content: center; animation: ld-pop 380ms var(--ld-ease) both; }
.ld-av.is-ai { background: var(--ld-tint-2); color: var(--ld-soft); }
.ld-av-empty { background: transparent; animation: none; }
@keyframes ld-pop { from { opacity: 0; transform: scale(0.7); } to { opacity: 1; transform: none; } }
.ld-empty { margin: 0; padding: 28px; text-align: center; color: var(--ld-muted); }
.ld-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 36px; padding: 0 16px; border-top: 1px solid var(--ld-line); flex: none; font-size: 12.5px; color: var(--ld-muted); background: #fff; }

/* the bar that appears when you tick rows */
.ld-bulk { position: absolute; left: 50%; bottom: 48px; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 14px; background: #1f1b17; color: #fff; box-shadow: 0 18px 36px -12px rgba(26, 22, 18, 0.5); z-index: 6; animation: ld-bulk 280ms var(--ld-ease) both; white-space: nowrap; }
@keyframes ld-bulk { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translateX(-50%); } }
.ld-bulk-n { padding: 0 12px 0 8px; font-size: 13px; color: rgba(255, 255, 255, 0.88); font-variant-numeric: tabular-nums; }
.ld-bulk-sep { width: 1px; height: 22px; background: rgba(255, 255, 255, 0.2); margin-right: 4px; }
.ld-bulk button { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 9px; font-size: 13px; color: #fff; transition: background-color 140ms ease, transform 140ms ease; }
.ld-bulk button .ld-i { width: 15px; height: 15px; }
.ld-bulk button:hover { background: rgba(255, 255, 255, 0.14); }
.ld-bulk button:active { transform: scale(0.97); }
.ld-bulk .ld-bulk-x { background: #fff; color: var(--ld-ink); font-weight: 500; margin-left: 4px; }
.ld-bulk .ld-bulk-x:hover { background: #f3f1ec; }
.ld-bulk :focus-visible { outline-color: #fff; }
.ld-bulk-menu { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-30%); width: 210px; padding: 6px; border-radius: 14px; background: #fff; border: 1px solid var(--ld-line); box-shadow: 0 24px 44px -18px rgba(26, 22, 18, 0.45); }
.ld-bulk-menu button { width: 100%; color: var(--ld-soft); }
.ld-bulk-menu button:hover { background: var(--ld-tint); color: var(--ld-ink); }
.ld-bulk-menu button .ld-i { color: var(--ld-faint); }

/* ---------- what the AI is doing ---------- */
.ld-aside { min-width: 0; min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--ld-line); border-radius: 16px; background: var(--ld-tint); overflow: hidden; }
.ld-aside-h { padding: 12px 14px 10px; display: flex; flex-direction: column; border-bottom: 1px solid var(--ld-line); }
.ld-aside-h b { font-weight: 500; font-size: 13.5px; }
.ld-aside-h span { font-size: 11.5px; color: var(--ld-muted); }
.ld-feed { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding: 6px 14px 10px; }
.ld-feed::-webkit-scrollbar { display: none; }
.ld-fi { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--ld-line); animation: ld-fi 460ms var(--ld-ease) both; }
.ld-fi:last-child { border-bottom: 0; }
@keyframes ld-fi { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.ld-fi-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }
.ld-fi-dot.ld-hot { background: #16a34a; } .ld-fi-dot.ld-warm { background: var(--ld-accent-g); } .ld-fi-dot.ld-cold { background: #b8b4aa; }
.ld-fi-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ld-fi-h b { font-weight: 500; font-size: 12.5px; line-height: 1.3; }
.ld-fi ul { margin: 4px 0 4px; padding: 0; list-style: none; font-size: 12px; color: var(--ld-muted); }
.ld-fi li { padding-left: 11px; position: relative; line-height: 1.45; }
.ld-fi li::before { content: ""; position: absolute; left: 1px; top: 0.62em; width: 4px; height: 4px; border-radius: 50%; background: var(--ld-faint); }
.ld-fi small { font-size: 11.5px; color: var(--ld-muted); }

/* ---------- type your own ---------- */
.ld-dock { padding: 8px 20px 12px; flex: none; }
.ld-form { position: relative; display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 2px 0 0; background: none; border: 0; }
.ld-form::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--ld-line-2); }
.ld-form::after { content: ""; position: absolute; left: 0; right: 0; bottom: -0.5px; height: 2px; border-radius: 2px; background: var(--ld-accent); transform: scaleX(0); transform-origin: left; transition: transform 380ms var(--ld-ease); }
.ld-form:focus-within::after, .ld-form.is-nudge::after { transform: scaleX(1); }
.ld-in-text { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: 14.5px; caret-color: var(--ld-accent); }
.ld-in-text::placeholder { color: var(--ld-faint); }
.ld-in-text:disabled { opacity: 0.6; }
.ld-send { width: 34px; height: 34px; border-radius: 50%; flex: none; background: var(--ld-accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; transition: transform 160ms ease, background-color 180ms ease, color 180ms ease; }
.ld-send .ld-i { width: 17px; height: 17px; }
.ld-send:hover:not(:disabled) { background: var(--ld-accent-hi); transform: translateY(-1px); }
.ld-send:active:not(:disabled) { transform: scale(0.95); }
.ld-send:disabled { background: var(--ld-tint-2); color: #8c887f; cursor: default; }
.ld-toast { position: absolute; left: 50%; bottom: 78px; transform: translate(-50%, 8px); display: inline-flex; align-items: center; gap: 14px; padding: 9px 16px; border-radius: 999px; background: #1f1b17; color: #fff; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity 200ms ease, transform 280ms var(--ld-ease); z-index: 30; white-space: nowrap; }
.ld-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.ld-toast.has-undo.is-on { pointer-events: auto; }
.ld-undo { color: #fed7aa; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; padding: 2px 4px; border-radius: 4px; }
.ld-undo:hover { color: #fff; }
.ld-toast :focus-visible { outline-color: #fff; }

/* ---------- the lead card (opens when you click a lead) ---------- */
.ld-scrim { position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(255, 255, 255, 0.62); -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); animation: ld-fade 240ms ease-out both; }
.ld-card { position: relative; width: min(410px, 100%); max-height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; border-radius: 20px; background: #fff; border: 1px solid var(--ld-line); box-shadow: 0 2px 6px rgba(26, 22, 18, 0.06), 0 40px 70px -28px rgba(26, 22, 18, 0.4); padding: 16px 16px 18px; }
.ld-card::-webkit-scrollbar { display: none; }
.ld-card.is-in { animation: ld-card 360ms var(--ld-ease) both; }
@keyframes ld-card { from { opacity: 0; transform: scale(0.9) translateY(8px); } to { opacity: 1; transform: none; } }
.ld-card-h { display: flex; align-items: center; gap: 12px; }
.ld-ava-l { width: 46px; height: 46px; font-size: 15px; }
.ld-card-t { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.ld-card-t b { font-weight: 500; font-size: 16px; letter-spacing: -0.015em; }
.ld-card-t i { font-style: normal; font-size: 12.5px; color: var(--ld-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-x { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: var(--ld-muted); align-self: flex-start; transition: background-color 140ms ease; }
.ld-x:hover { background: var(--ld-tint-2); }
.ld-card-b { display: flex; gap: 8px; margin: 14px 0 12px; }
.ld-primary { flex: 1; height: 40px; border-radius: 12px; background: var(--ld-accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 500; transition: transform 160ms ease, background-color 160ms ease; }
.ld-primary:hover { background: var(--ld-accent-hi); }
.ld-primary:active { transform: scale(0.98); }
.ld-primary-s { flex: none; height: 34px; padding: 0 16px; margin-top: 10px; font-size: 13px; }
.ld-sq { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--ld-line-2); display: inline-flex; align-items: center; justify-content: center; color: var(--ld-soft); flex: none; transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease; }
.ld-sq:hover { border-color: var(--ld-ink); background: var(--ld-tint); }
.ld-sq:active { transform: scale(0.96); }
.ld-menu { position: absolute; top: 118px; right: 14px; z-index: 5; width: 222px; padding: 6px; border-radius: 14px; background: #fff; border: 1px solid var(--ld-line); box-shadow: 0 2px 6px rgba(26, 22, 18, 0.06), 0 24px 44px -18px rgba(26, 22, 18, 0.4); transform-origin: top right; }
.ld-menu.is-in { animation: ld-menu 180ms var(--ld-ease) both; }
@keyframes ld-menu { from { opacity: 0; transform: scale(0.95) translateY(-4px); } to { opacity: 1; transform: none; } }
.ld-menu button { width: 100%; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 9px; font-size: 13.5px; color: var(--ld-soft); transition: background-color 120ms ease, color 120ms ease; }
.ld-menu button .ld-i { width: 15px; height: 15px; color: var(--ld-faint); }
.ld-menu button:hover, .ld-menu button:focus-visible { background: var(--ld-tint); color: var(--ld-ink); }
.ld-menu hr { border: 0; border-top: 1px solid var(--ld-line); margin: 5px 4px; }
.ld-menu .ld-mback { color: var(--ld-muted); font-size: 12.5px; }
.ld-mh { margin: 4px 10px 4px; font-size: 11.5px; color: var(--ld-muted); }
.ld-tabs2 { display: flex; gap: 4px; border-bottom: 1px solid var(--ld-line); margin: 0 0 12px; }
.ld-tabs2 button { height: 34px; padding: 0 10px; font-size: 13.5px; color: var(--ld-muted); position: relative; transition: color 140ms ease; }
.ld-tabs2 button:hover { color: var(--ld-ink); }
.ld-tabs2 button.is-on { color: var(--ld-accent); font-weight: 500; }
.ld-tabs2 button.is-on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--ld-accent); }
.ld-pane { animation: ld-fade 260ms ease-out both; }
.ld-kv { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--ld-line); font-size: 13.5px; }
.ld-kv:last-child { border-bottom: 0; }
.ld-kv span { color: var(--ld-muted); flex: none; }
.ld-kv b { font-weight: 500; text-align: right; min-width: 0; overflow-wrap: anywhere; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ld-muted { color: var(--ld-muted); font-weight: 400; }
.ld-pri { display: inline-flex; align-items: center; gap: 7px; }
.ld-pri::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #b8b4aa; }
.ld-p-high::before { background: #dc2626; } .ld-p-medium::before { background: var(--ld-accent-g); }
.ld-thread { display: flex; flex-direction: column; gap: 8px; }
.ld-b { max-width: 88%; padding: 9px 13px; border-radius: 16px; font-size: 13.5px; line-height: 1.45; animation: ld-fade 260ms ease-out both; }
.ld-b-lead { background: var(--ld-tint-2); border-bottom-left-radius: 5px; align-self: flex-start; }
.ld-b-us { background: var(--ld-accent); color: #fff; border-bottom-right-radius: 5px; align-self: flex-end; }
.ld-draft { margin-top: 14px; padding: 12px 14px; border-radius: 14px; border: 1px dashed var(--ld-line-2); background: var(--ld-tint); }
.ld-draft > span { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ld-accent-hi); }
.ld-draft > span .ld-i { width: 13px; height: 13px; }
.ld-draft p { margin: 6px 0 0; font-size: 13.5px; color: var(--ld-soft); }
.ld-big { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.ld-big > b { font-size: 46px; font-weight: 500; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.ld-big > span { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.ld-big i { font-style: normal; font-size: 12.5px; color: var(--ld-muted); }
.ld-pb { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; }
.ld-pb > span:first-child { display: flex; flex-direction: column; line-height: 1.2; }
.ld-pb b { font-weight: 500; font-size: 13.5px; }
.ld-pb i { font-style: normal; font-size: 11.5px; color: var(--ld-muted); }
.ld-pb-t { display: inline-flex; align-items: center; gap: 10px; }
.ld-pb-bar { width: 120px; height: 6px; border-radius: 3px; background: var(--ld-tint-2); overflow: hidden; display: block; }
.ld-pb-bar span { display: block; height: 100%; border-radius: 3px; background: var(--ld-accent-g); transition: width 640ms var(--ld-ease); }
.ld-pb em { font-style: normal; font-size: 12px; color: var(--ld-muted); min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; }
.ld-sig { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; }
.ld-sig span { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 8px; border-radius: 8px; background: var(--ld-tint); border: 1px solid var(--ld-line); font-size: 12px; color: var(--ld-soft); }
.ld-sig .ld-i { width: 12px; height: 12px; color: #166534; }
.ld-nextbox { padding: 11px 14px; border-radius: 14px; background: var(--ld-accent-soft); border: 1px solid #f9d4bb; }
.ld-nextbox > span { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ld-accent-hi); }
.ld-nextbox > span .ld-i { width: 13px; height: 13px; }
.ld-nextbox p { margin: 4px 0 0; font-size: 13.5px; color: var(--ld-ink); }

/* ---------- smaller windows: columns drop out instead of being squeezed ---------- */
.df-window:has(.ld) { aspect-ratio: 16 / 10; }
@container ldt (max-width: 830px) {
  .ld-head, .ld-row { grid-template-columns: 20px minmax(130px, 1.1fr) minmax(110px, 1.5fr) 104px 112px minmax(100px, 1fr) 32px; }
  .ld-head > :nth-child(3), .ld-row .ld-c-src { display: none; }
  .ld-search { width: 150px; }
}
@container ldt (max-width: 680px) {
  .ld-head, .ld-row { grid-template-columns: 20px minmax(130px, 1.1fr) minmax(100px, 1.4fr) 104px 112px 32px; }
  .ld-head > :nth-child(7), .ld-row .ld-c-next { display: none; }
  .ld-search { width: 130px; }
}
@container ldt (max-width: 540px) {
  .ld-head, .ld-row { grid-template-columns: 20px minmax(0, 1fr) 104px 112px 32px; }
  .ld-head > :nth-child(4), .ld-row .ld-c-convo { display: none; }
  .ld-search { display: none; }
  .ld-add { width: 34px; padding: 0; justify-content: center; }
  .ld-add span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@container ldt (max-width: 430px) {
  .ld-head, .ld-row { grid-template-columns: 20px minmax(0, 1fr) auto 32px; }
  .ld-head > :nth-child(5), .ld-row .ld-c-stat { display: none; }
  .ld-ticks { display: none; }
  .ld-bulk button:not(.ld-bulk-x) span { display: none; }
}
@media (max-width: 1180px) { .ld-main { grid-template-columns: minmax(0, 1fr) 236px; } .ld-spark { width: 64px; } }
@media (max-width: 960px) { .ld-main { grid-template-columns: minmax(0, 1fr); } .ld-aside { display: none; } }
@media (max-width: 640px) {
  .df-window:has(.ld) { aspect-ratio: auto; height: min(760px, 92svh); }
  .ld-top { flex-wrap: wrap; gap: 8px 8px; padding: 12px 14px 8px; }
  .ld-title { order: 1; } .ld-skip { order: 2; margin-left: auto; } .ld-pipe { order: 3; } .ld-queue { order: 4; } .ld-ai { order: 5; flex: 1 1 100%; max-width: none; margin-left: 0; }
  .ld-rail { padding: 0 14px 8px; }
  .ld-steps { gap: 6px; } .ld-step { padding: 4px 10px 4px 4px; } .ld-sl i { display: none; } .ld-sl b { font-size: 12px; }
  .ld-step:not(.is-on) { padding: 4px; } .ld-step:not(.is-on) .ld-sl { display: none; }
  .ld-cap { font-size: 12.5px; flex-basis: 100%; }
  .ld-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 14px 8px; }
  .ld-stat:nth-child(3) { border-left: 0; } .ld-stat:nth-child(n+3) { border-top: 1px solid var(--ld-line); }
  .ld-stat { padding: 7px 12px; } .ld-stat-n b { font-size: 20px; } .ld-spark { width: 52px; height: 28px; }
  .ld-main { padding: 0 14px; }
  .ld-head, .ld-row { padding: 0 10px; column-gap: 8px; }
  .ld-dock { padding: 8px 14px 10px; }
  .ld-toast { bottom: 70px; }
}
@media (prefers-reduced-motion: reduce) {
  .ld *, .ld *::before, .ld *::after { animation-duration: 0.001ms !important; animation-delay: 0ms !important; transition-duration: 0.001ms !important; }
  .ld-spark-l { stroke-dashoffset: 0; }
}
