/* L94 — Leads toolbar + section headers on phones (<=640px). Last layer, after m-phone-lock.css. Tokens only; wide screens untouched.
   Goal: kill dead space. Search + month = one 42px pill. Count · filter · sort = ONE 36px row. Section headers = 48px, one line.
   The "New 2" strip under a header repeated the count, so it is hidden when it holds a single stage (it stays, slim, when there are 2+ stages).
   Roll back: remove the m-lead-toolbar.css link. */
@media(max-width:640px){
  /* ===== 1. search pill (month picker lives inside it) ===== */
  html body main:has(.lf-top){padding-top:calc(var(--hdr-total) + var(--sp-1))}
  html body .lf-top{margin:0 0 var(--sp-2)}
  html body .lf-top>#q{height:42px;min-height:42px;padding-inline-start:42px;padding-inline-end:104px;border:1px solid var(--ln-strong);background-color:var(--bg-surface);background-position:14px 50%;background-size:18px;box-shadow:var(--sh-1);font-size:var(--fs-md)}
  [dir=rtl] html body .lf-top>#q,html[dir=rtl] body .lf-top>#q{background-position:calc(100% - 14px) 50%}
  html body .lf-top .lf-mo-wrap{top:5px;inset-inline-end:5px}
  html body .lf-top .lf-mo{height:32px;padding:0 var(--sp-2) 0 var(--sp-3);background:var(--c-starlight);color:var(--tx-on-accent);font-size:var(--fs-sm);line-height:1}
  html body .lf-top .lf-mo .li{width:14px;height:14px}
  html body .lf-top .lf-mo-pop{top:38px}

  /* ===== 2. one compact row: count · filter · sort ===== */
  html body .pv-bar{padding:0 0 var(--sp-2);gap:0}
  html body .pv-bar .pv-top{gap:var(--sp-2);min-height:36px}
  html body .pv-bar .pv-count{flex:none;margin-inline-end:auto;display:flex;align-items:baseline;gap:var(--sp-1);font-size:var(--fs-sm);font-weight:600;color:var(--tx-muted)}
  html body .pv-bar .pv-count b{font-size:var(--fs-lg);font-weight:700;line-height:1;color:var(--tx-strong);font-variant-numeric:tabular-nums}
  html body .pv-bar .pv-fb{width:36px;height:36px;min-height:36px;border:1px solid var(--ln-strong);border-radius:var(--rd-md);background:var(--bg-surface);color:var(--tx-strong)}
  html body .pv-bar .pv-fb.on,html body .pv-bar .pv-fb[aria-expanded="true"]{background:var(--c-starlight);border-color:var(--c-starlight);color:var(--tx-on-accent)}
  html body .pv-bar .pv-fb .li{width:18px;height:18px}
  html body .pv-bar #pv-sort,html body .pv-bar .pv-ag{height:36px;min-height:36px;padding:0 var(--sp-3);border:1px solid var(--ln-strong);border-radius:var(--rd-md);background-color:var(--bg-surface);color:var(--tx-strong);font-size:var(--fs-sm);font-weight:600;text-overflow:ellipsis}
  html body .pv-bar #pv-sort{flex:0 1 7.5rem;min-width:0;max-width:none}
  html body .pv-bar .pv-ag{flex:0 1 8.5rem;min-width:0}
  html body .pv-bar .pv-clr{min-height:36px;padding:0 var(--sp-2)}

  /* ===== 3. section headers: 48px, one line, one accent (status colour is set here so phones get it too) ===== */
  html body .list .lg{--g:var(--c-n600);--g-rgb:var(--c-n600-rgb)}
  html body .list .lg-urgent{--g:var(--c-danger);--g-rgb:var(--c-danger-rgb)}
  html body .list .lg-none{--g:var(--c-sand-dark);--g-rgb:var(--c-sand-dark-rgb)}
  html body .list .lg-once{--g:var(--c-blue);--g-rgb:var(--c-blue-rgb)}
  html body .list .lg-twice{--g:var(--c-success);--g-rgb:var(--c-success-rgb)}
  html body .list .lg-unassigned{--g:var(--c-starlight);--g-rgb:var(--c-starlight-rgb)}
  html body .list .pv-i:not(:has(.pv-r)){padding-top:var(--sp-2)}
  html body .list .pv-pad0+.pv-i:not(:has(.pv-r)){padding-top:0}
  html body .list .lg{margin:0}
  html body .list .lg-h{min-height:48px;gap:var(--sp-2);padding:0 var(--sp-3);border:1px solid rgba(var(--g-rgb),.22);border-inline-start:4px solid var(--g);border-radius:var(--rd-md);background:linear-gradient(90deg,rgba(var(--g-rgb),.1),var(--bg-surface) 55%);box-shadow:var(--sh-1)}
  html body .list .lg-h:hover{transform:none}
  html body .list .lg-ic{width:30px;height:30px;border-radius:var(--rd-sm);background:rgba(var(--g-rgb),.14);color:var(--g);box-shadow:none}
  html body .list .lg-ic svg{width:16px;height:16px}
  html body .list .lg-t{gap:0}
  html body .list .lg-t b{font-size:var(--fs-lg);font-weight:700;line-height:1.2}
  html body .list .lg-t small{display:none}
  html body .list .lg-n{min-width:28px;padding:2px var(--sp-2);background:rgba(var(--g-rgb),.16);color:var(--tx-strong);font-size:var(--fs-sm);line-height:1.5;box-shadow:none}
  html body .list .lg-hot .lg-n{animation:none}
  html body .list .lg-hot>.lg-h::after{display:none}

  /* ===== 4. detail strip under an open section: slim, or gone when it only repeats the count ===== */
  html body .list .lg-info{gap:0;margin-top:-1px;padding:var(--sp-2) var(--sp-3);border-inline-start-width:4px;border-radius:0 0 var(--rd-md) var(--rd-md);box-shadow:none}
  html body .list .lg-row1{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;gap:var(--sp-3)}
  html body .list .lg-leg{flex-wrap:nowrap;gap:var(--sp-3);white-space:nowrap;font-size:var(--fs-sm)}
  html body .list .lg-info:has(.lg-leg>.lg-lg:only-child){display:none}
  html body .list .lg:has(.lg-leg>.lg-lg:only-child)>.lg-h{border-bottom-left-radius:var(--rd-md);border-bottom-right-radius:var(--rd-md)}
}
