/*
 * The lead page in the new frame (static/crm/leadFrame.js; docs/systems/UI_PARTS.md
 * "Lead page"). Only main.lf, which only the frame draws. Colours come from the brand
 * variables and the shared parts (ui.css); crm.css still styles the cards themselves.
 */
.crm-app main.lf { display: flex; flex-direction: column; gap: 14px; }
.crm-app main.lf > .card { margin-bottom: 0; }

/* Navy header: who they are on the left, Actions ▾ on the right. */
.crm-app .lf-band {
  background: var(--brand-ink, #0B2339); color: #fff; border-radius: 14px; padding: 14px 18px;
  display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between;
}
.crm-app .lf-band-l { min-width: 0; flex: 1 1 420px; }
.crm-app .lf-band .lead-name { color: #fff; font-size: 24px; margin-bottom: 4px; }
.crm-app .lf-band .lead-name .crm-inline-input { color: var(--brand-ink, #0B2339); }
.crm-app .lf-band .crm-empty-hint { color: #9fb4c6; }
.crm-app .lf-band .crm-pencil { color: #9fe3e6; }
.crm-app .lf-meta { display: flex; flex-wrap: wrap; gap: 6px 0; align-items: center; font-size: 12.5px; color: #c9d6e2; }
.crm-app .lf-meta > * { padding: 0 10px; border-left: 1px solid rgba(255,255,255,.16); }
.crm-app .lf-meta > *:first-child { padding-left: 0; border-left: 0; }
.crm-app .lf-meta .meta-item { display: inline-flex; align-items: center; gap: 6px; }
.crm-app .lf-meta i.lead { color: #9fb4c6; font-size: 14px; }
.crm-app .lf-meta a { color: #fff; text-decoration: none; }
.crm-app .lf-meta a:hover { text-decoration: underline; }
.crm-app .lf-meta .id-pill { background: rgba(255,255,255,.1); color: #fff; }
.crm-app .lf-meta .tier-badge { background: var(--brand-accent, #008D95); }
.crm-app .lf-meta select { font: inherit; font-size: 12.5px; color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.25); border-radius: 6px; padding: 1px 4px; }
.crm-app .lf-meta select option { color: var(--brand-ink, #0B2339); }
.crm-app .lf-meta .crm-inline-input { color: var(--brand-ink, #0B2339); }
/* The phone number is the call button. */
.crm-app .lf-meta .lf-phone a {
  display: inline-flex; align-items: center; color: #fff; font-weight: 700; background: rgba(var(--brand-accent-rgb, 0,141,149), .35);
  border-radius: 999px; padding: 2px 10px;
}
.crm-app .lf-meta .lf-phone a:hover { background: var(--brand-accent, #008D95); text-decoration: none; }
.crm-app .lf-meta .crm-hdr-funnel-note { display: inline-flex; color: #4fd1c5; font-weight: 700; font-size: 11.5px; background: none; border: 0; padding: 0 10px; margin: 0; }
.crm-app .lf-band-r { display: flex; gap: 8px; }
.crm-app .lf-actions { background: transparent; color: #cfe0ec; border-color: rgba(255,255,255,.25); }
.crm-app .lf-actions:hover { background: rgba(255,255,255,.08); }

/* Tiles: the My Clients colours. */
.crm-app .lf-tiles { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.crm-app .lf-tiles .vx-tile b small { font-family: var(--brand-font-body, 'DM Sans', sans-serif); font-size: 13px; opacity: .75; }

/* Tabs and the Overview grid. */
.crm-app .lf-tabs { margin-top: 2px; }
.crm-app .lf-panel { display: flex; flex-direction: column; gap: 14px; }
.crm-app .lf-panel[hidden] { display: none; }
.crm-app .lf-panel > .card { margin-bottom: 0; }
.crm-app .lf-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.crm-app .lf-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.crm-app .lf-col > .card { margin-bottom: 0; }
@media (max-width: 1100px) { .crm-app .lf-grid { grid-template-columns: minmax(0, 1fr); } }

/* ONE journey line (Stuart, 14 Nov 2026): crm.js's stage bar (#__crm-lifecycle),
   restyled. Steps on the left as the mockup's line, "Current: …" and Convert / More on
   the right of the same row; anything the bar adds (warnings, deal bids, checks,
   setting up) runs full width underneath. Same buttons, same handlers. */
.crm-app main.lf .lc-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 24px; row-gap: 10px; align-items: center; padding: 12px 18px; }
.crm-app main.lf .lc-card > * { grid-column: 1 / -1; }
.crm-app main.lf .lc-card > .section-label { display: none; }
.crm-app main.lf .lc-card > .lc-steps { grid-column: 1; grid-row: 1; display: flex; gap: 4px; margin: 0; }
.crm-app main.lf .lc-card > .lc-foot { grid-column: 2; grid-row: 1; border-top: 0; padding-top: 0; flex-wrap: nowrap; gap: 14px; }
.crm-app main.lf .lc-card > .lc-loading { grid-column: 1 / -1; }
.crm-app main.lf .lc-step { flex: 1; min-width: 0; display: block; text-align: left; padding-top: 7px; border-top: 3px solid var(--vx-line, #e4e5e3); }
.crm-app main.lf .lc-step::before, .crm-app main.lf .lc-dot { display: none; }
.crm-app main.lf .lc-step.done, .crm-app main.lf .lc-step.now { border-top-color: var(--brand-accent, #008D95); }
.crm-app main.lf .lc-step-name { display: block; font-size: 12px; font-weight: 600; color: var(--vx-text-3, #848484); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-app main.lf .lc-step.done .lc-step-name { color: var(--vx-text-2, #56636e); }
.crm-app main.lf .lc-step.now .lc-step-name { color: var(--brand-ink, #0B2339); font-weight: 700; }
.crm-app main.lf .lc-step.now .lc-step-name::after { content: " \25CF"; color: var(--brand-accent, #008D95); font-size: 9px; vertical-align: 2px; }
.crm-app main.lf .lc-current { font-size: 12.5px; white-space: nowrap; }
.crm-app main.lf .lc-primary { padding: 7px 13px; }
@media (max-width: 1100px) {
  .crm-app main.lf .lc-card { grid-template-columns: minmax(0, 1fr); }
  .crm-app main.lf .lc-card > .lc-foot { grid-column: 1; grid-row: auto; flex-wrap: wrap; }
}

/* The S708 and adviser pickers carry inline white styles (crm.js): blend them into the navy. */
.crm-app .lf-meta select {
  background: transparent !important; color: #fff !important; border: 1px solid rgba(255,255,255,.22) !important;
  border-radius: 6px !important; padding: 2px 6px !important; font-size: 12.5px !important; cursor: pointer;
}
.crm-app .lf-meta select:hover { border-color: rgba(255,255,255,.5) !important; }
.crm-app .lf-meta select option { color: var(--brand-ink, #0B2339); background: #fff; }

/* My Leads in the new frame: the stage chips as four coloured group tiles
   (leadFrame.js stageTilesHtml; signed off 13 Nov, mockup "My Leads"). */
.crm-app .lf-fwrap { padding: 12px; border-bottom: 1px solid var(--vx-line, #e4e5e3); display: flex; flex-direction: column; gap: 8px; }
.crm-app .lf-ftiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.crm-app .lf-ftiles.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .crm-app .lf-ftiles, .crm-app .lf-ftiles.five { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.crm-app .lf-ftile { border-radius: 12px; padding: 10px 12px 12px; color: #fff; min-width: 0; box-shadow: 0 1px 2px rgba(var(--brand-ink-rgb, 11,35,57), .12); }
.crm-app .lf-ftile.navy { background: linear-gradient(135deg, var(--brand-ink, #0B2339), rgba(var(--brand-ink-rgb, 11,35,57), .86)); }
.crm-app .lf-ftile.teal { background: linear-gradient(135deg, rgba(var(--brand-accent-rgb, 0,141,149), .88), var(--brand-accent, #008D95)); }
.crm-app .lf-ftile.deep { background: linear-gradient(135deg, rgba(var(--brand-ink-rgb, 11,35,57), .92), rgba(var(--brand-accent-rgb, 0,141,149), .62)); }
.crm-app .lf-ftile.warm { background: linear-gradient(135deg, var(--vx-warm, #8c8478), var(--vx-warm-2, #a59d90)); }
.crm-app .lf-ftile.light { background: #fff; color: var(--brand-ink, #0B2339); border: 1px solid var(--vx-line, #e4e5e3); box-shadow: none; }
.crm-app .lf-ftile.on { outline: 3px solid rgba(var(--brand-accent-rgb, 0,141,149), .45); outline-offset: 1px; }
.crm-app .lf-fh { display: flex; align-items: baseline; gap: 8px; border: 0; background: none; color: inherit; padding: 0; cursor: pointer; font-family: var(--brand-font-body, 'DM Sans', sans-serif); width: auto; }
.crm-app .lf-fh b { font-family: var(--brand-font-display, 'DM Serif Display', serif); font-weight: 400; font-size: 27px; line-height: 1.1; }
.crm-app .lf-fh span { font-size: 13px; font-weight: 700; }
.crm-app .lf-fsubs { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.crm-app .lf-fsub { font: 600 11.5px/1 var(--brand-font-body, 'DM Sans', sans-serif); border: 0; border-radius: 999px; padding: 5px 9px; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; white-space: nowrap; width: auto; }
.crm-app .lf-fsub i { font-style: normal; opacity: .75; margin-left: 2px; }
.crm-app .lf-fsub:hover { background: rgba(255,255,255,.26); }
.crm-app .lf-fsub.on { background: #fff; color: var(--brand-ink, #0B2339); }
.crm-app .lf-ftile.light .lf-fsub { background: var(--vx-fill, #f1f2f2); color: var(--brand-ink, #0B2339); }
.crm-app .lf-ftile.light .lf-fsub.on { background: var(--brand-ink, #0B2339); color: #fff; }
.crm-app .lf-ftile.light .lf-fsub.bad { background: var(--vx-bad-bg, #fbeaea); color: var(--vx-bad, #a13434); }
.crm-app .lf-ftile.light .lf-fsub.bad.on { background: var(--vx-bad, #a13434); color: #fff; }
.crm-app .lf-fnone { font-size: 11.5px; opacity: .7; }
.crm-app .lf-fall button { border: 0; background: none; padding: 0; color: var(--brand-accent, #008D95); font: 600 12.5px var(--brand-font-body, 'DM Sans', sans-serif); cursor: pointer; width: auto; }

/* ── CRM list pages in the new frame (My Leads, Lead Clean-Up, My Network, Corporate
   Clients, My Clients, Premium / Private Sales and the other CRM pages) ────────────
   The CRM was left out of the Platform's shared header pass (sectionFrame.css): it has
   its own styles and inline ones. Here, the same look: a flat page header with the
   serif title (no header card), the list as one white card, the shared search box,
   selects, column head and 44px rows with a hover. The lead and network pages
   (main.lf) are left alone. CSS only; the rows' inline styles need !important. */
body.ws-frame:not(.ws-previewing) .crm-app main.main:not(.lf) > .card:first-child { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 4px 2px 6px !important; margin-bottom: 10px !important; }
body.ws-frame:not(.ws-previewing) .crm-app main.main:not(.lf) > .card:first-child > .section-label { font-size: 12px; letter-spacing: 0; text-transform: none; font-weight: 500; color: var(--vx-text-3, #848484); }
body.ws-frame:not(.ws-previewing) .crm-app main.main:not(.lf) > .card:first-child h2 { font-family: var(--brand-font-display, "DM Serif Display", Georgia, serif) !important; font-weight: 400 !important; font-size: 26px !important; color: var(--brand-ink, #0B2339) !important; margin-top: 2px !important; }
body.ws-frame:not(.ws-previewing) .crm-app main.main:not(.lf) > .card { border-color: var(--vx-line, #e4e5e3); border-radius: var(--vx-r-card, 12px); }
body.ws-frame:not(.ws-previewing) .crm-app #__crm-list-search { height: 32px; padding: 0 11px !important; border: 1px solid var(--vx-line-strong, #cfd0cc) !important; border-radius: var(--vx-r-ctl, 8px) !important; font-size: 13.5px !important; }
body.ws-frame:not(.ws-previewing) .crm-app #__crm-list-search:focus { outline: none; border-color: var(--brand-accent, #008D95) !important; box-shadow: 0 0 0 3px rgba(var(--brand-accent-rgb, 0,141,149), .15); }
body.ws-frame:not(.ws-previewing) .crm-app :is(#__crm-s708-filter, #__crm-category-filter, #__crm-age-sort) { height: 32px; padding: 0 9px !important; border: 1px solid var(--vx-line-strong, #cfd0cc) !important; border-radius: var(--vx-r-ctl, 8px) !important; font-size: 13px !important; }
body.ws-frame:not(.ws-previewing) .crm-app #__crm-list-head > div { background: var(--vx-head-fill, #f7f8f8); min-height: 34px; align-items: center; font-weight: 700; letter-spacing: .07em !important; color: var(--vx-text-3, #848484) !important; border-bottom: 1px solid var(--vx-line, #e4e5e3) !important; }
body.ws-frame:not(.ws-previewing) .crm-app .lead-row { min-height: 44px; padding-top: 8px !important; padding-bottom: 8px !important; border-bottom: 1px solid var(--vx-line, #e4e5e3) !important; transition: background .12s; }
body.ws-frame:not(.ws-previewing) .crm-app .lead-row:hover { background: var(--vx-fill, #f1f2f2); }
/* CRM tables and buttons, to the shared sizes (Insight Sales and Portal Access use
   .pa-table, Lead Response .lr-table). crm.css is :where()-scoped, so plain class
   selectors here win without !important. */
body.ws-frame:not(.ws-previewing) .crm-app :is(.pa-table, .lr-table) th { background: var(--vx-head-fill, #f7f8f8); font-size: 10.5px; font-weight: 700; letter-spacing: .07em; color: var(--vx-text-3, #848484); height: 34px; padding: 0 12px; border-bottom: 1px solid var(--vx-line, #e4e5e3); }
body.ws-frame:not(.ws-previewing) .crm-app :is(.pa-table, .lr-table) td { padding: 10px 12px; border-bottom: 1px solid var(--vx-line, #e4e5e3); }
body.ws-frame:not(.ws-previewing) .crm-app :is(.pa-table, .lr-table) tbody tr:hover td { background: var(--vx-fill, #f1f2f2); }
body.ws-frame:not(.ws-previewing) .crm-app .crm-btn { height: 32px; padding: 0 14px; border-radius: var(--vx-r-ctl, 8px); display: inline-flex; align-items: center; gap: 6px; }
body.ws-frame:not(.ws-previewing) .crm-app .btn-mini { height: 26px; padding: 0 10px; border-radius: 7px; border-color: var(--vx-line-strong, #cfd0cc); }

/* Page width: the CRM caps its pages at 1,360px (crm.css .main). In the new frame they
   fill the width like every other page; the AI panel keeps its room on the right. */
body.ws-frame:not(.ws-previewing) .crm-app main.main { max-width: none; }

/* ── Overview: the AI card + Do now (the mockup's "Where Priya is up to") ── */
.crm-app .lf-ai { display: flex; flex-direction: column; gap: 14px; }
.crm-app .lf-ai[hidden] { display: none; }
.crm-app .lf-ai .ai-card { border-color: rgba(0, 141, 149, .35); }
.crm-app .lf-ai .ai-card .vx-card-h h4 { color: #00727a; display: flex; gap: 6px; align-items: center; }
.crm-app .lf-ai .vx-card-h a { font-size: 12.5px; color: #00727a; cursor: pointer; text-decoration: none; }
.crm-app .lf-ai .ai-sum p { margin: 0 0 9px; font-size: 13.5px; line-height: 1.6; }
.crm-app .lf-ai .ai-sum p:last-of-type { margin-bottom: 0; }
.crm-app .lf-ai .ai-src { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 12px; color: var(--text-tertiary, #848484); padding-top: 10px; margin-top: 10px; border-top: 1px dashed var(--border, #e4e5e3); }

/* ── Lead page: Activity, Latest, unified Emails list, header extras (14 Nov) ── */
.crm-app .lf-meta .lf-trial { color: #4fd1c5; font-weight: 700; }
.crm-app .lf-meta .lf-num { color: #9fb4c6; }
.crm-app .lf-chips { gap: 6px; }
.crm-app .lf-panel .vx-feed li { align-items: start; }
.crm-app .lf-panel .vx-feed li > div b { font-weight: 600; font-size: 13.5px; }
.crm-app .lf-more { border: 1px solid var(--vx-line, #e4e5e3); border-radius: var(--vx-r-card, 12px); background: var(--vx-surface, #fff); padding: 0 14px; }
.crm-app .lf-more > summary { cursor: pointer; list-style: none; padding: 11px 0; font: 600 13px var(--brand-font-body, 'DM Sans', sans-serif); color: var(--vx-text-2, #56636e); }
.crm-app .lf-more[open] > summary { border-bottom: 1px solid var(--vx-line, #e4e5e3); margin-bottom: 12px; }
.crm-app .lf-more > [data-lf-egroup] { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.crm-app .lf-more .card { margin-bottom: 0; }

/* ── CRM list pages: row menu, Insight Sales tiles (14 Nov) ── */
body.ws-frame .crm-app .crm-row-act .vx-btn { height: 28px; }
body.ws-frame .crm-app .lf-istiles { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 12px; }
@media (max-width: 1100px) { body.ws-frame .crm-app .lf-istiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
body.ws-frame .crm-app .lf-istiles .vx-tile { cursor: pointer; }
body.ws-frame .crm-app .lf-istiles .vx-tile .vx-tile-s { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
body.ws-frame .crm-app #__crm-s708-filter.vx-chip { height: 32px; }
body.ws-frame .crm-app #__crm-s708-filter.vx-chip.on { background: var(--brand-ink, #0B2339); color: #fff; }

/* Journey line: the current step's sub-label, and the collapsed "Lead → client" step. */
.crm-app main.lf .lc-step .lc-sub-l { display: block; font-size: 11px; color: var(--vx-text-3, #848484); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-app main.lf .lc-step.lc-collapsed { flex: 0 0 auto; padding-right: 14px; }
.crm-app main.lf .lc-step.lc-collapsed .lc-step-name { color: var(--vx-text-3, #848484); font-weight: 600; }
/* §9.36 the lead bar (19 Nov): skipped steps, a lapsed trial, steps that are a move, Selling. */
.crm-app main.lf .lc-step.skipped { border-top-style: dashed; }
.crm-app main.lf .lc-step.skipped .lc-step-name { color: var(--vx-text-3, #848484); font-weight: 500; }
.crm-app main.lf .lc-step.lc-lapsed { border-top-color: #c27a00; }
.crm-app main.lf .lc-step.lc-lapsed .lc-step-name, .crm-app main.lf .lc-step.lc-lapsed .lc-sub-l { color: #8a5600; }
.crm-app main.lf .lc-step.lc-lapsed .lc-step-name::after { color: #c27a00; }
.crm-app main.lf .lc-step-btn { display: block; text-align: left; align-items: flex-start; }
.crm-app main.lf .lc-step-move:hover { border-top-color: var(--brand-accent, #008D95); }
.crm-app main.lf .lc-card > .lc-selling { grid-column: 1; margin: 0; }

/* ── Second pass (15 Nov): Calls tab order, read-only Network calls, AI thumbs, Details card ── */
/* Calls tab: the call list first, the log-a-call composer under it (the mockup has no composer on top). */
.crm-app main.lf:not(.lf-net) #__crm-logcall { display: flex; flex-direction: column; }
.crm-app main.lf:not(.lf-net) #__crm-logcall > #__crm-voip-list { order: -1; margin: 0 0 14px; }
.crm-app main.lf:not(.lf-net) #__crm-logcall > .card-head { order: -2; }
/* My Network contact: calls are a read-only history. */
.crm-app main.lf-net #__crm-logcall > textarea, .crm-app main.lf-net #__crm-logcall > .log-call-foot,
.crm-app main.lf-net #__crm-logcall > #__crm-logcall-manual { display: none !important; }
.crm-app main.lf-net #__crm-logcall > #__crm-voip-list { margin-top: 0; }
.crm-app .lf-thumbs { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; font-size: 12px; }
.crm-app .lf-thumbs .vx-btn { height: 24px; padding: 0 8px; }
.crm-app main.lf .vx-kv dd .vx-input { height: 28px; }
body.ws-frame .crm-app .is-pill-btn { border: 0; cursor: pointer; font-family: inherit; }
body.ws-frame .crm-app .is-ready-hint { font-size: 11.5px; margin-bottom: 4px; }

/* ── CRM list pages: one compact title row, tiles and toolbar on the page, one table block (15 Nov) ── */
body.ws-frame .crm-app .lf-head { display: flex !important; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
body.ws-frame .crm-app .lf-head-l { display: flex; align-items: baseline; gap: 4px 14px; flex-wrap: wrap; min-width: 0; }
body.ws-frame .crm-app .lf-head-l h2 { margin: 0 !important; }
body.ws-frame .crm-app .lf-head-sub { font-size: 13px; color: var(--vx-text-2, #56636e); }
body.ws-frame .crm-app .lf-head-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
body.ws-frame .crm-app .lf-head-r .vx-input { height: 32px; }
body.ws-frame .crm-app .lf-toolbar { margin-bottom: 10px; }
body.ws-frame .crm-app .lf-toolbar select.vx-input { padding-right: 24px; }
body.ws-frame .crm-app .lf-tablecard { overflow: hidden; }
body.ws-frame .crm-app .lf-fwrap { padding: 0; border-bottom: 0; margin-bottom: 12px; }
body.ws-frame .crm-app .lf-tablecard .lead-row { min-height: 38px; padding-top: 4px !important; padding-bottom: 4px !important; }
body.ws-frame .crm-app .lf-tablecard .placeholder { padding: 24px; }
/* My Leads' 15 columns: tighter gaps and narrower number columns so the name, email and stage get the room (15 Nov). */
body.ws-frame .crm-app .lf-tablecard #__crm-list-head > div, body.ws-frame .crm-app .lf-tablecard .lead-row, body.ws-frame .crm-app .lf-tablecard .lead-row > a { gap: 8px !important; }
body.ws-frame .crm-app .lf-tablecard [style*="flex:0 0 58px"], body.ws-frame .crm-app .lf-tablecard [style*="flex: 0 0 58px"] { flex-basis: 46px !important; }
body.ws-frame .crm-app .lf-tablecard [style*="flex:0 0 72px"] { flex-basis: 60px !important; }
body.ws-frame .crm-app .lf-tablecard [style*="flex:0 0 96px"] { flex-basis: 84px !important; }
body.ws-frame .crm-app .lf-tablecard [style*="flex:0 0 44px"] { flex-basis: 36px !important; }

/* Lead Response in the frame: no section label, body card on the page, tables as the shared table block. */
body.ws-frame .crm-app .lr-head .section-label { display: none; }
body.ws-frame .crm-app #lr-mg-body.lr-card, body.ws-frame .crm-app #lr-mg-board.lr-card { background: transparent; border: 0; box-shadow: none; padding: 0; }
body.ws-frame .crm-app #lr-mg-body .lr-table-wrap, body.ws-frame .crm-app #lr-mg-board .lr-table-wrap, body.ws-frame .crm-app .lr-card .lr-table-wrap { background: var(--vx-surface, #fff); border: 1px solid var(--vx-line, #e4e5e3); border-radius: var(--vx-r-card, 12px); overflow: hidden; }

/* Lead header: static text like the mockup; the editors sit in the Edit details card (15 Nov). */
.crm-app .lf-band .lf-static-name { color: #fff; font-family: var(--brand-font-display, 'DM Serif Display', serif); font-size: 24px; line-height: 1.2; margin-bottom: 4px; }
.crm-app .lf-edit[hidden] { display: none; }
.crm-app .lf-editmeta .lf-editrow { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-top: 10px; font-size: 13px; }
.crm-app .lf-editmeta .meta-item { display: inline-flex; align-items: center; gap: 6px; }

/* Calls tab: the log-a-call card's box is behind the "Log a call" button (a pop-up); it stays in the page, hidden, and does the saving. */
.crm-app main.lf:not(.lf-net) #__crm-logcall > textarea, .crm-app main.lf:not(.lf-net) #__crm-logcall > .log-call-foot,
.crm-app main.lf:not(.lf-net) #__crm-logcall > #__crm-logcall-manual, .crm-app main.lf:not(.lf-net) #__crm-logcall > .card-head { display: none !important; }
.crm-app main.lf-net .lf-logcall-btn { display: none; }
body.ws-frame .crm-app .lr-table { width: 100%; }
body.ws-frame .crm-app .lr-head { align-items: center; margin-bottom: 4px; }
body.ws-frame .crm-app .lr-head > div:first-child { display: flex; align-items: baseline; gap: 4px 14px; flex-wrap: wrap; }
body.ws-frame .crm-app .lr-head .lr-sub { margin: 0; }

/* My Leads big tabs (Stuart, 15 Nov): every lead list across the top in Vested colours, the
   active one teal, its count in the display face. The same bar heads Insight, Premium and
   Private Sales (leadFrame.js leadTabsBarHtml). The active tab's own stages sit under it as chips. */
.crm-app .lf-bigtabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.crm-app .lf-bigtab { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; padding: 11px 14px 12px; border: 0; border-radius: 12px; cursor: pointer; text-decoration: none; width: auto;
  background: linear-gradient(135deg, var(--brand-ink, #0B2339), rgba(var(--brand-ink-rgb, 11,35,57), .86)); color: #fff;
  font-family: var(--brand-font-body, 'DM Sans', sans-serif); box-shadow: 0 1px 2px rgba(var(--brand-ink-rgb, 11,35,57), .14); transition: transform .12s, box-shadow .12s; }
.crm-app .lf-bigtab:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(var(--brand-ink-rgb, 11,35,57), .18); color: #fff; }
.crm-app .lf-bigtab span { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.crm-app .lf-bigtab b { font-family: var(--brand-font-display, 'DM Serif Display', serif); font-weight: 400; font-size: 26px; line-height: 1.05; order: -1; }
.crm-app .lf-bigtab.on { background: linear-gradient(135deg, rgba(var(--brand-accent-rgb, 0,141,149), .88), var(--brand-accent, #008D95)); box-shadow: 0 0 0 3px rgba(var(--brand-accent-rgb, 0,141,149), .25); }
.crm-app .lf-fwrap > .lf-fsubs { margin-top: 0; }
.crm-app .lf-fwrap > .lf-fsubs .lf-fsub { background: var(--vx-fill, #f1f2f2); color: var(--brand-ink, #0B2339); }
.crm-app .lf-fwrap > .lf-fsubs .lf-fsub:hover { background: var(--vx-line, #e4e5e3); }
.crm-app .lf-fwrap > .lf-fsubs .lf-fsub.on { background: var(--brand-ink, #0B2339); color: #fff; }
.crm-app .lf-fwrap > .lf-fsubs .lf-fsub.bad { background: var(--vx-bad-bg, #fbeaea); color: var(--vx-bad, #a13434); }
.crm-app .lf-fwrap > .lf-fsubs .lf-fsub.bad.on { background: var(--vx-bad, #a13434); color: #fff; }

/* Lead page tabs (Stuart, 15 Nov): Calls & notes side by side; Emails = Outlook left, sending and
   email lists right, marketing history full width under them. */
.crm-app .lf-cn { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
/* "Where X is up to" as dot points by what was done (22 Nov). */
.crm-app .ai-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 24px; }
.crm-app .ai-g-h { font: 700 11px/1 var(--brand-font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--vx-text-2); margin: 2px 0 6px; }
.crm-app .ai-g ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; line-height: 1.4; color: var(--brand-ink); }
/* Emails tab (Stuart, 21 Nov): conversations, marketing history and tracking fill the left;
   the sending cards and email lists sit in a narrow fixed column on the right. */
.crm-app .lf-em { grid-template-columns: minmax(0, 1fr) 320px; }
.crm-app .lf-em .lf-col > .lf-mhist, .crm-app .lf-em .lf-col > .lf-mhist + * { margin-top: 0; }
.crm-app .lf-mhist { margin-top: 14px; }
.crm-app .lf-mhist + * { margin-top: 14px; }
@media (max-width: 1100px) { .crm-app .lf-cn, .crm-app .lf-em { grid-template-columns: minmax(0, 1fr); } }

/* A lead's stage chip in the header (20 Nov): a label, outlined, evenly padded. */
.crm-app main.lf .lf-meta .lf-stage-chip { display: inline-flex; align-items: center; padding: 3px 12px; border: 1px solid rgba(255,255,255,.55); border-radius: 999px; color: #fff; font-size: 12px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
