/* SALES DASHBOARD · LEAD ANALYTICS + AD LIBRARY (js/sales-lead-analytics.js).

   Two views of the sales board (js/sales-crm.js), drawn on the board's
   own ground: .sales-crm already carries every --crm-* token (page-crm.css
   grants it), so nothing here adds a token grant, a screen root or a palette.
   Every part is the CRM's own and is referenced, not copied:
     head ........... .crm-head / .crm-title / .crm-head-right / .ds-btn
     view row ....... .crm-controls / .crm-views / .crm-view-chip / .crm-view-reset
     sub-views ...... .crm-tabs2 / .crm-tab2 (the drawer's section tabs)
     filters ........ .crm-toolbar / .crm-tbtn / .crm-sched-chip / .sc-seg
     counts ......... .crm-sched-kpis / .crm-sched-kpi
     section labels . .crm-sec-title / .crm-sec-count
     cards .......... .crm-schedcard, notes .crm-sched-note / .crm-sched-filternote
     tables ......... .crm-tablewrap / .crm-table (and its phone card layout)
     drawer ......... .crm-scrim / .crm-drawer / .crm-rail-col / .crm-fact / .crm-whose
     states ......... .crm-sk, .crm-error, .crm-empty, .crm-btn
   This sheet holds only what none of them has, prefixed la- (the sales
   screen's legacy Reports page already owns #salesScreen .an-*).

   The CRM's colour rule holds: colour carries state, not identity. Gold is
   the current choice or your focus, red is blocked, green is cleared. The
   chart therefore has ONE ink (--crm-trail); states are told apart by
   position and label (small multiples), never by hue. Unknown is hatched
   in --crm-ink-3. Deltas are words with an arrow, not red or green. */

/* ── Sub-views and the filter row ─────────────────────────────────────── */
.sales-crm .la-tabsrow { display: flex; align-items: stretch; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; border-bottom: 1px solid var(--crm-grid); padding-right: 10px; }
.sales-crm .la-tabsrow .crm-tabs2 { border-bottom: 0; }
.sales-crm .la-tabsrow .la-asof { align-self: center; font-size: 12px; color: var(--crm-ink-2); }
.sales-crm .crm-tab2 .crm-sec-count { margin-left: 2px; }
.sales-crm .la-k { color: var(--crm-ink-2); font-weight: 500; }
.sales-crm .la-v { color: var(--crm-head); font-weight: 600; }
.sales-crm .la-toolsep { flex: none; width: 1px; height: 20px; background: var(--crm-rule); margin: 0 2px; }
.sales-crm .la-toolend { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.sales-crm .la-drills { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--crm-grid); }
.sales-crm .la-drills .crm-sched-filters-l { margin-right: 2px; }
.sales-crm .la-drills .crm-sched-chip svg { color: var(--crm-ink-2); }
.sales-crm .la-clear { border: 0; background: none; font: inherit; font-size: 12.5px; color: var(--crm-ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 4px 6px; }

/* ── Notes ─────────────────────────────────────────────────────────────── */
.sales-crm .la-note { display: flex; align-items: flex-start; gap: 9px; margin: 0 0 12px; }
.sales-crm .la-note svg { flex: none; margin-top: 1px; color: var(--crm-ink-2); }
.sales-crm .la-note .crm-btn { margin-left: auto; flex: none; }
.sales-crm .la-note.crm-sched-note { margin-top: 0; }
.sales-crm .la-filternote { display: flex; gap: 7px; align-items: flex-start; }
.sales-crm .la-filternote svg { flex: none; margin-top: 2px; color: var(--crm-ink-2); }

/* ── Counts strip: .crm-sched-kpis with a definition and a comparison ─── */
.sales-crm .la-kpis { margin-bottom: 18px; }
.sales-crm .la-kpis .crm-sched-kpi { flex: 1 1 210px; padding: 14px 16px 15px; gap: 3px; cursor: default; }
.sales-crm .la-kpis .crm-sched-kpi-n { font-size: 26px; margin: 2px 0 2px; }
.sales-crm .la-kpis .crm-sched-kpi-l { font-size: 12px; font-weight: 600; color: var(--crm-ink-mid); }
.sales-crm .la-kpidef { font-size: 12px; line-height: 1.45; color: var(--crm-ink-2); max-width: 36ch; }
.sales-crm .la-un { font-family: var(--font-sans); font-size: 15px !important; font-weight: 600; color: var(--crm-ink-2) !important; padding: 6px 0 3px; }

/* ── Comparison words: arrow + number + basis, in ink ─────────────────── */
.sales-crm .la-delta { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0 5px; font-size: 12px; line-height: 1.45; color: var(--crm-ink-2); font-variant-numeric: tabular-nums; }
.sales-crm .la-delta-v { font-weight: 600; color: var(--crm-ink); }
.sales-crm .la-delta-v svg { width: 8px; height: 8px; margin-right: 3px; vertical-align: 0; color: var(--crm-ink-2); }

/* ── Three metric cards ───────────────────────────────────────────────── */
.sales-crm .la-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.sales-crm .la-groups .crm-schedcard { min-width: 0; }
.sales-crm .la-groups .crm-sec-title { margin-bottom: 2px; }
.sales-crm .la-gmeta { margin: 0 0 8px; font-size: 12px; line-height: 1.4; color: var(--crm-ink-2); }
.sales-crm .la-mlist { margin: 0; }
.sales-crm .la-mrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 14px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--crm-rule); }
.sales-crm .la-mrow dt { font-size: 13px; font-weight: 500; color: var(--crm-head); }
.sales-crm .la-mrow dd { margin: 0; text-align: right; font-family: var(--font-serif); font-size: 19px; font-weight: 600; color: var(--crm-head); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sales-crm .la-mrow .la-mdef { grid-column: 1; font-size: 12px; line-height: 1.4; color: var(--crm-ink-2); }
.sales-crm .la-mrow .la-delta { grid-column: 2; justify-content: flex-end; text-align: right; }
.sales-crm .la-mrow dd.la-undd { font-family: var(--font-sans); font-size: 13px; font-weight: 600; color: var(--crm-ink-2); }
.sales-crm .la-groups .crm-sched-note { display: flex; gap: 7px; align-items: flex-start; }
.sales-crm .la-groups .crm-sched-note svg { flex: none; margin-top: 2px; color: var(--crm-ink-2); }

/* ── Sections ──────────────────────────────────────────────────────────── */
.sales-crm .la-sec { margin: 0 0 22px; }
.sales-crm .la-sechead { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 10px; }
.sales-crm .la-sechead .crm-sec-title { margin: 0 0 4px; }
.sales-crm .la-secmeta { margin: 0; font-size: 13px; line-height: 1.45; color: var(--crm-ink-2); max-width: 82ch; }
.sales-crm .la-secacts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sales-crm .la-foot { margin: 10px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--crm-ink-2); max-width: 100ch; }
.sales-crm .la-foot b { color: var(--crm-head); font-weight: 600; }
.sales-crm .sc-seg button { padding-top: 6px; padding-bottom: 6px; }

/* ── Lead progression: a .crm-table, one row per step ─────────────────── */
#salesScreen .sales-crm .la-steps tbody td { vertical-align: middle; height: 56px; padding-top: 8px; padding-bottom: 8px; white-space: normal; max-width: none; }
#salesScreen .sales-crm .la-table tbody td.la-wide { white-space: normal; max-width: none; }
.sales-crm .la-steps tbody tr { cursor: default; }
.sales-crm .la-step-l { font-size: 13.5px; font-weight: 600; color: var(--crm-head); }
.sales-crm .la-step-l small { display: block; font-size: 12px; font-weight: 400; color: var(--crm-ink-2); margin-top: 2px; }
.sales-crm .la-step-n { font-family: var(--font-serif); font-size: 19px; font-weight: 600; color: var(--crm-head); }
.sales-crm .la-step-r { font-size: 12px; color: var(--crm-ink-2); display: block; }
.sales-crm .la-bar { display: block; height: 6px; border-radius: 3px; background: var(--crm-panel-2); overflow: hidden; }
.sales-crm .la-bar > span { display: block; height: 100%; border-radius: 3px; background: var(--crm-trail); }
.sales-crm .la-why { font-size: 12.5px; line-height: 1.45; color: var(--crm-ink-mid); }
.sales-crm .la-acts { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 3px; }
.sales-crm .la-acts a { font-size: 12.5px; font-weight: 500; }
.sales-crm .la-off .la-step-l, .sales-crm .la-off .la-step-n { color: var(--crm-ink-2); font-weight: 500; }
.sales-crm .la-off .la-step-n { font-family: var(--font-sans); font-size: 13px; }

/* ── Chart: one ink, small multiples for a split ──────────────────────── */
.sales-crm .la-chart { position: relative; padding: 14px 16px 12px; }
.sales-crm .la-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.sales-crm .la-chart .la-grid line { stroke: var(--crm-rule); stroke-width: 1; }
.sales-crm .la-chart .la-base { stroke: var(--crm-grid-strong); stroke-width: 1; }
.sales-crm .la-chart text { font-family: var(--font-sans); font-size: 11.5px; fill: var(--crm-ink-2); font-variant-numeric: tabular-nums; }
.sales-crm .la-chart text.la-cap { font-size: 12px; font-weight: 600; fill: var(--crm-head); }
.sales-crm .la-chart text.la-rowl { font-size: 12.5px; font-weight: 600; fill: var(--crm-head); }
.sales-crm .la-chart text.la-rowt { font-size: 12px; fill: var(--crm-ink-2); }
.sales-crm .la-chart .la-hit { fill: transparent; }
.sales-crm .la-chart .la-hit:focus-visible { outline: none; stroke: var(--crm-gold-ink); stroke-width: 2; }
.sales-crm .la-chart .la-hover { fill: var(--crm-gold-faint); }
.sales-crm .la-f { fill: var(--crm-trail); }
.sales-crm .la-f.la-on { fill: var(--crm-gold); }
.sales-crm .la-unkf { fill: url(#la-hatch); }
.sales-crm .la-hatch-bg { fill: var(--crm-paper); }
.sales-crm .la-hatch-ln { stroke: var(--crm-ink-3); stroke-width: 1.6; }
.sales-crm .la-tip {
  position: absolute; z-index: 4; min-width: 172px; padding: 9px 11px; box-sizing: border-box;
  border: 1px solid var(--crm-grid-strong); border-radius: 8px; background: var(--crm-paper);
  box-shadow: var(--crm-shadow-card); font-size: 12.5px; color: var(--crm-ink); pointer-events: none;
}
.sales-crm .la-tip-h { font-weight: 600; color: var(--crm-head); margin-bottom: 4px; }
.sales-crm .la-tip-r { display: flex; align-items: center; gap: 7px; line-height: 1.6; }
.sales-crm .la-tip-r b { margin-left: auto; padding-left: 12px; color: var(--crm-head); font-variant-numeric: tabular-nums; }
.sales-crm .la-tip-tot { border-top: 1px solid var(--crm-rule); margin-top: 4px; padding-top: 4px; font-weight: 600; }
.sales-crm .la-tabletoggle { margin-top: 8px; font-size: 13px; color: var(--crm-ink-mid); }
.sales-crm .la-tabletoggle > summary { cursor: pointer; padding: 6px 0; font-weight: 500; color: var(--crm-head); }
/* ── Tables ──────────────────────────────────────────────────────────── */
/* The sales board restates .crm-table at #salesScreen strength (page-sales-crm.css),
   so a cell that must wrap says so at that strength. */
body.lh-shell #salesScreen .sales-crm .la-table thead th { white-space: normal; line-height: 1.25; vertical-align: bottom; }
#salesScreen .sales-crm .la-table tbody td { height: 52px; }
.sales-crm .la-table tbody tr { cursor: default; }
.sales-crm .la-th-sub { display: block; margin-top: 2px; font-size: 10.5px; text-transform: none; letter-spacing: 0.02em; font-weight: 500; color: var(--crm-ink-2); }
.sales-crm .la-now { display: block; color: var(--crm-head); font-weight: 500; }
.sales-crm .la-was { display: block; font-size: 12px; color: var(--crm-ink-2); }
.sales-crm .la-rowbtn { display: inline-block; max-width: 100%; padding: 0; border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--crm-head); cursor: pointer; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sales-crm .la-rowbtn:hover { text-decoration: underline; text-decoration-color: var(--crm-gold); text-underline-offset: 3px; }
.sales-crm .la-sub { display: block; font-size: 12px; font-weight: 400; color: var(--crm-ink-2); }
.sales-crm .la-na { color: var(--crm-ink-2); font-size: 12.5px; }
.sales-crm tr.la-unkrow td { background: var(--crm-panel); }
.sales-crm tr.la-totrow td { border-top: 1px solid var(--crm-grid-strong); }
.sales-crm .la-tfoot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 2px 0; font-size: 12.5px; color: var(--crm-ink-2); }
.sales-crm .la-lead b { display: block; font-weight: 600; color: var(--crm-head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sales-crm .la-lead span { display: block; font-size: 12px; color: var(--crm-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sales-crm .la-lead b.la-plain { font-weight: 500; }
.sales-crm .la-table tbody tr.la-row-open { cursor: pointer; }
.sales-crm .la-open { color: inherit; text-decoration: none; }
.sales-crm .la-open:hover b, .sales-crm .la-table tr.la-row-open:hover .la-open b { text-decoration: underline; text-decoration-color: var(--crm-gold); text-underline-offset: 3px; }
.sales-crm .la-open:focus-visible { outline: 2px solid var(--crm-gold-ink); outline-offset: 2px; border-radius: 2px; }

/* State words: an icon and a word, the CRM's three colours only. */
.sales-crm .la-word { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--crm-ink); white-space: nowrap; }
.sales-crm .la-word svg { flex: none; color: var(--crm-ink-2); }
.sales-crm .la-word.la-cleared svg { color: var(--crm-clear); }
.sales-crm .la-word.la-blocked { color: var(--crm-blocked); font-weight: 600; }
.sales-crm .la-word.la-blocked svg { color: var(--crm-blocked); }
.sales-crm .la-word.la-muted { color: var(--crm-ink-2); }

/* ── Ad library ───────────────────────────────────────────────────────── */
.sales-crm .la-adsum { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 2px 12px; font-size: 13px; color: var(--crm-ink-2); font-variant-numeric: tabular-nums; }
.sales-crm .la-adsum b { color: var(--crm-head); font-weight: 600; }
.sales-crm .la-adgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; list-style: none; margin: 0; padding: 0; }
/* A tile is a .crm-kcard grown a media frame: rule border, gold on hover, no lift. */
.sales-crm .la-ad {
  display: flex; flex-direction: column; width: 100%; height: 100%; padding: 0; box-sizing: border-box;
  border: 1px solid var(--crm-grid-strong); border-radius: 10px; background: var(--crm-paper);
  box-shadow: var(--crm-shadow-card); overflow: hidden; text-align: left; font: inherit; color: inherit; cursor: pointer;
  transition: border-color .14s ease-out;
}
.sales-crm .la-ad:hover { border-color: var(--crm-gold); }
.sales-crm .la-ad:focus-visible { outline: 2px solid var(--crm-gold-ink); outline-offset: 2px; }
.sales-crm .la-media, .crm-drawer .la-media {
  position: relative; display: grid; place-items: center; aspect-ratio: 1 / 1; overflow: hidden;
  background: var(--crm-navy); border-bottom: 1px solid var(--crm-grid);
}
.sales-crm .la-media > svg, .sales-crm .la-media > img { max-width: 100%; max-height: 100%; width: auto; height: 100%; object-fit: contain; display: block; }
.sales-crm .la-mtag {
  position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 7px; border-radius: 5px; background: rgba(15, 18, 26, .78); color: #f0f0f3;
  font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.sales-crm .la-media-missing { background: var(--crm-panel); }
.sales-crm .la-media-missing span { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12.5px; color: var(--crm-ink-2); text-align: center; padding: 0 16px; }
.sales-crm .la-ad-body { display: flex; flex-direction: column; gap: 5px; padding: 11px 12px 12px; min-width: 0; flex: 1; }
.sales-crm .la-ad-title { font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--crm-head); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sales-crm .la-ad-meta { font-size: 11.5px; line-height: 1.4; color: var(--crm-ink-3); }
.sales-crm .la-ad-res { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--crm-rule); font-size: 12.5px; color: var(--crm-ink-2); font-variant-numeric: tabular-nums; }
.sales-crm .la-ad-res b { color: var(--crm-head); font-weight: 600; }

/* ── Creative card: the CRM drawer, its media frame and the ad's words ── */
.sales-crm .la-drawer .la-media { aspect-ratio: 16 / 10; border: 1px solid var(--crm-rule); border-radius: 6px; }
.sales-crm .la-player { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: linear-gradient(transparent, rgba(10, 12, 18, .72)); color: #f0f0f3; font-size: 12px; }
.sales-crm .la-track { flex: 1; height: 4px; border-radius: 2px; background: rgba(255,255,255,.3); }
.sales-crm .la-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13px; }
.sales-crm .la-copy { margin: 16px 0 0; }
.sales-crm .la-copy-row { padding: 12px 0; border-top: 1px solid var(--crm-rule); }
.sales-crm .la-copy-row dt { margin-bottom: 4px; }
.sales-crm .la-copy-row dd { margin: 0; font-size: 14px; line-height: 1.6; color: var(--crm-ink); white-space: pre-line; max-width: 68ch; }
.sales-crm .la-copy-row dd.la-none { color: var(--crm-ink-2); }

/* ── Live-page details ─────────────────────────────────────────────────── */
.sales-crm .la-gap { margin-top: 12px; }
.sales-crm .la-empty-t { display: block; color: var(--crm-head); font-size: 15px; margin-bottom: 6px; }
.sales-crm .crm-empty > svg { display: block; margin: 0 auto 8px; color: var(--crm-ink-2); }
.sales-crm .crm-empty .la-sub { margin-top: 8px; }
.sales-crm .la-drawer-t { font-size: 21px; }
.sales-crm.la-busy .crm-controls ~ * { opacity: .55; transition: opacity .12s ease-out; }
.sales-crm.la-view .crm-tbtn select { field-sizing: content; max-width: 240px; text-overflow: ellipsis; }
.sales-crm .crm-tbtn input[type="date"] { border: 0; background: transparent; color: inherit; font: inherit; outline: none; }
.sales-crm .la-adsearch { flex: 1 1 220px; max-width: 360px; }
.sales-crm .la-drawer .la-media > video, .sales-crm .la-drawer .la-media > img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sales-crm .la-media > img, .sales-crm .la-media > video { width: 100%; height: 100%; object-fit: cover; }
.sales-crm .la-chart .la-hit.la-on { fill: var(--crm-gold-faint); }

/* ── States ────────────────────────────────────────────────────────────── */
.sales-crm .la-skkpis { display: flex; gap: 0; border: 1px solid var(--crm-rule); border-radius: 12px; overflow: hidden; margin-bottom: 18px; }
.sales-crm .la-skkpis .crm-sk { flex: 1; height: 96px; border-radius: 0; border-right: 1px solid var(--crm-rule); }
.sales-crm .la-skcards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.sales-crm .la-skcards .crm-sk { height: 200px; border-radius: 12px; }
.sales-crm .la-err { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.sales-crm .la-err .crm-btn { margin-left: auto; }
.sales-crm .crm-empty .crm-btn { margin-top: 14px; }

/* ── Links and focus on the board ─────────────────────────────────────── */
.sales-crm.la-view a { color: var(--crm-head); text-decoration-color: var(--crm-rule-firm); text-underline-offset: 3px; }
.sales-crm.la-view a:hover { color: var(--crm-gold-ink); }
.sales-crm.la-view :is(a, button, summary, [tabindex]):focus-visible { outline: 2px solid var(--crm-gold-ink); outline-offset: 2px; }

/* ── The portal's design system on this screen ────────────────────────────
   The schedule parts borrowed above (the counts strip, the cards, the
   section labels, the sub-view tabs) come boxed and in tracked capitals.
   Here they follow the design system: sentence case, no boxes, each group
   told apart by the space around it. The tables stay board tables. The
   creative card keeps the project card's own parts, so it is left out. */
.sales-crm.la-view .la-tabsrow .crm-tab2 { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 500; }
.sales-crm.la-view .la-tabsrow .crm-tab2-on { font-weight: 600; }
.sales-crm.la-view :is(.la-sechead, .la-groups) .crm-sec-title {
  text-transform: none; letter-spacing: 0; font-family: var(--font-serif, inherit);
  font-size: 17px; font-weight: 600; line-height: 1.3; color: var(--crm-head);
}
.sales-crm.la-view .crm-sched-filters-l { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 500; color: var(--crm-ink-2); }
.sales-crm.la-view .la-kpis { gap: 18px 44px; margin-bottom: 36px; border: 0; border-radius: 0; background: transparent; overflow: visible; }
.sales-crm.la-view .la-kpis .crm-sched-kpi, .sales-crm.la-view .la-kpis .crm-sched-kpi:hover { padding: 0; border: 0; background: transparent; }
.sales-crm.la-view .la-groups { gap: 32px 48px; margin-bottom: 40px; }
.sales-crm.la-view .la-groups .crm-schedcard { padding: 0; border: 0; border-radius: 0; background: transparent; }
.sales-crm.la-view .crm-schedcard.la-chart { padding: 6px 0 0; border: 0; border-radius: 0; background: transparent; }
.sales-crm.la-view .la-sec { margin-bottom: 40px; }
.sales-crm.la-view .la-skkpis { border: 0; border-radius: 0; gap: 44px; }
.sales-crm.la-view .la-skkpis .crm-sk { border-right: 0; border-radius: 8px; }
body.lh-shell #salesScreen .sales-crm.la-view .crm-table:not(.la-drawer .crm-table) thead th {
  text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 500;
}

/* ── Tablet and phone ─────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .sales-crm .la-groups { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .sales-crm .la-tabsrow { padding-right: 0; }
  .sales-crm .la-tabsrow .crm-tabs2 { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 0 4px; }
  .sales-crm .la-tabsrow .la-asof { padding: 0 12px 10px; }
  .sales-crm .crm-tab2, .sales-crm .crm-tbtn, .sales-crm .crm-sched-chip, .sales-crm .sc-seg button { min-height: 44px; }
  .sales-crm .la-toolsep { display: none; }
  .sales-crm .la-toolend { margin-left: 0; }
  .sales-crm .la-kpis .crm-sched-kpi { flex: 1 1 100%; border-right: 0; border-bottom: 1px solid var(--crm-rule); }
  .sales-crm .la-kpis .crm-sched-kpi:last-child { border-bottom: 0; }
  .sales-crm .la-chart { padding: 10px 10px 8px; }
  /* the board's phone table-as-cards: the step and the lead lead each card */
  #salesScreen .sales-crm .la-steps tbody tr td:first-child,
  #salesScreen .sales-crm .la-table tbody tr td:first-child { grid-column: 1 / -1; }
  #salesScreen .sales-crm .la-steps tbody td, #salesScreen .sales-crm .la-table tbody td { height: auto; border: 0; padding: 0; background: transparent; }
  #salesScreen .sales-crm .la-steps tbody td.la-wide, #salesScreen .sales-crm .la-table tbody td.la-wide { grid-column: 1 / -1; }
  #salesScreen .sales-crm .la-table td[data-k]::before { content: attr(data-k); display: block; font-size: 11px; color: var(--crm-ink-3); text-transform: none; }
  #salesScreen .sales-crm .la-table td.crm-num { text-align: left; }
  .sales-crm .la-adgrid { grid-template-columns: 1fr; gap: 0; border: 1px solid var(--crm-grid-strong); border-radius: 10px; overflow: hidden; background: var(--crm-paper); box-shadow: var(--crm-shadow-card); }
  .sales-crm .la-adgrid > li + li { border-top: 1px solid var(--crm-grid); }
  .sales-crm .la-ad { flex-direction: row; border: 0; border-radius: 0; box-shadow: none; min-height: 112px; }
  .sales-crm .la-ad .la-media { flex: none; width: 104px; aspect-ratio: auto; border-bottom: 0; border-right: 1px solid var(--crm-grid); }
  .sales-crm .la-ad-res { border-top: 0; padding-top: 2px; }
  .sales-crm .la-copy-row dd { font-size: 15px; }
  .sales-crm .la-skcards { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .sales-crm .la-ad { transition: none; }
}

/* ══ MYTHRIL VERSION 1: Lead analytics and the Ad library (Nick, 11/11/26) ══
   The sub-views are the shell's rounded tabs (tinted glass when chosen, no
   underline), the counts strip and the three metric groups sit on one lifted
   sheet each, and the ad tiles are lifted squares with no outline. The tables
   keep their board table rules. */
.sales-crm.la-view .la-tabsrow { border-bottom: 0; padding: 0 0 6px; align-items: center; }
.sales-crm.la-view .la-tabsrow .crm-tabs2 { gap: 4px; padding: 0; border-bottom: 0; }
.sales-crm.la-view .la-tabsrow .crm-tab2 {
  height: 36px; padding: 0 14px; margin: 0; border: 0; border-radius: 10px;
  font: 500 14px/1 var(--font-sans); color: var(--text-body); background: none;
  transition: color .2s, background .25s var(--my-ease-out), box-shadow .25s var(--my-ease-out);
}
.sales-crm.la-view .la-tabsrow .crm-tab2:hover { color: var(--text-strong); border-bottom-color: transparent; }
.sales-crm.la-view .la-tabsrow .crm-tab2-on, .sales-crm.la-view .la-tabsrow .crm-tab2-on:hover {
  color: var(--royal-ink); font-weight: 600; border-bottom-color: transparent;
  background: linear-gradient(180deg, color-mix(in oklab, var(--royal) 13%, transparent), color-mix(in oklab, var(--royal) 8%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--royal) 26%, transparent), inset 0 1px 0 rgba(255,255,255,.7);
}
[data-theme="dark"] .sales-crm.la-view .la-tabsrow .crm-tab2-on, [data-theme="dark"] .sales-crm.la-view .la-tabsrow .crm-tab2-on:hover {
  color: #f3e2b3; background: linear-gradient(180deg, rgba(226,194,122,.2), rgba(226,194,122,.1));
  box-shadow: inset 0 0 0 1px rgba(226,194,122,.34), inset 0 1px 0 rgba(255,255,255,.14);
}
.sales-crm.la-view .la-tabsrow .crm-tab2-on::before, .sales-crm.la-view .la-tabsrow .crm-tab2-on::after { display: none; }
.sales-crm.la-view .la-toolsep { width: 0; background: none; margin: 0 6px; }
.sales-crm.la-view .la-drills { border-top: 0; padding: 10px 0 0; }

/* One sheet for the counts, one for each metric group, one per chart. */
.sales-crm.la-view .la-kpis, .sales-crm.la-view .la-groups .crm-schedcard, .sales-crm.la-view .crm-schedcard.la-chart {
  background: var(--surface); border-radius: var(--my-r-lg, 18px); box-shadow: var(--ds-shadow-card);
}
.sales-crm.la-view .la-kpis { padding: 22px 24px; }
.sales-crm.la-view .la-groups { gap: 18px; }
.sales-crm.la-view .la-groups .crm-schedcard { padding: 20px 22px 14px; }
.sales-crm.la-view .crm-schedcard.la-chart { padding: 18px 20px 14px; }
.sales-crm.la-view .la-kpis .crm-sched-kpi-n { font-family: var(--font-serif); font-weight: 600; font-size: 30px; letter-spacing: -.01em; color: var(--text-strong); }
.sales-crm.la-view .la-kpis .crm-sched-kpi-l { font-weight: 500; color: var(--text-muted); }
.sales-crm.la-view .la-mrow { border-top-color: var(--hairline); }
.sales-crm.la-view .la-tip { border: 0; border-radius: 12px; box-shadow: var(--my-pop-shadow); }
[data-theme="dark"] .sales-crm.la-view .la-tip { background: #1e2745; }
.sales-crm.la-view .la-bar { background: color-mix(in oklab, var(--text-faint) 18%, transparent); }
.sales-crm.la-view .la-skkpis { border-radius: var(--my-r-lg, 18px); }
.sales-crm.la-view .la-skcards .crm-sk { border-radius: var(--my-r-lg, 18px); }

/* The ad tiles: lifted rounded squares, the gold line on hover becomes a lift. */
.sales-crm .la-ad { border: 0; border-radius: 14px; box-shadow: var(--ds-shadow-card); transition: transform .3s var(--my-spring, ease-out), box-shadow .2s ease-out; }
.sales-crm .la-ad:hover { border-color: transparent; transform: translateY(-2px); box-shadow: 0 2px 4px rgba(15,19,30,.06), 0 14px 30px -14px rgba(15,19,30,.32); }
.sales-crm .la-media, .crm-drawer .la-media { border-bottom: 0; }
.sales-crm .la-ad-res { border-top-color: var(--hairline); }
.sales-crm .la-mtag { border-radius: 7px; background: rgba(15,18,26,.62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sales-crm .la-drawer .la-media { border: 0; border-radius: 12px; }
.sales-crm .la-copy-row { border-top-color: var(--hairline); }
@media (prefers-reduced-motion: reduce) { .sales-crm .la-ad, .sales-crm .la-ad:hover { transition: none; transform: none; } }
@media (max-width: 640px) {
  .sales-crm.la-view .la-tabsrow .crm-tabs2 { padding: 0; }
  .sales-crm.la-view .la-kpis { padding: 16px 18px; }
  .sales-crm.la-view .la-kpis .crm-sched-kpi { border-bottom-color: var(--hairline); }
  .sales-crm .la-adgrid > li + li { border-top: 0; }
  .sales-crm .la-ad .la-media { border-right: 0; }
}
/* The chart's one ink: a soft royal slate in light (the board's navy trail
   stays navy everywhere else); dark keeps the board's own. */
:root:not([data-theme="dark"]) .sales-crm.la-view { --crm-trail: #7c88b4; }
