/* ═══ THE CHOSEN ONE, EVERYWHERE ═══════════════════════════════════════════
   "this pill is hideous, what is causing this? i want this type of pill gone
   from everywhere in CRM" — 2026-09-14.

   The pill: a two-part switch where the chosen half is a solid near-black block
   with a white tick, sitting beside a plain white half. It was Material's filter
   chip, and the app had grown it in nine places under six different class names
   (.chip, .mcatchip, .dtab, .mseg, .seg2, .fl-kind, .dl-dest, .bd-sz) — which is
   why fixing it where he saw it would not have fixed it anywhere else.

   What replaces it is the mark the app ALREADY uses for "you are here": the
   accent's own pale tint under normal ink. The rail's active app, the side
   panel's lit section and the sidebar's active row all wear it, so this is not a
   new idea — it is the one idea, finally said in one place.

   ⚠ LOADED LAST, after projects.css, or it cannot reach .pj .mseg — every rule
   in that file is fenced behind .pj and it is generated, never hand-edited.
   ⚠ TWO THINGS KEEP THEIR BLACK, on purpose:
     · .nbell.on — a round icon button, not a segment; black IS its pressed state.
     · .dtab.hot.on — a view with something OVERDUE behind it. It is solid accent
       and it earns it; that one is a warning, not a selection.
   ═════════════════════════════════════════════════════════════════════════ */

/* ── the tick goes ──
   ⚠ IT IS WRITTEN IN TWO PLACES IN m3.css, not one: line 77 draws it for
   .mseg and .seg2, line 94 for .chip, .mcatchip and .dtab. I killed the second
   and left the first, so the switch he pointed at kept its tick on a pink
   ground — "i dont want a checklist like this". Both are named here.
   ⚠ Anything added later that wants a tick is adding a checklist. There is one
   way to say "this one": the row is lit. */
.chip.on::before,.mcatchip.on::before,.dtab.on::before,
.mseg button.on::before,.seg2 button.on::before,
.pj .chip.on::before,.pj .dtab.on::before,
.pj .mseg button.on::before,.pj .seg2 button.on::before,
.pj.mseg button.on::before,.pj.seg2 button.on::before{
  content:none!important;display:none!important}
/* the padding that made room for it goes with it */
.chip.on,.mcatchip.on,.dtab.on{padding-left:16px}

/* ── the fill ── */
.chip.on,.mcatchip.on,.dtab.on,
.tv-tab.on,
.fl-kind.on,
.dl-dest button.on,
.bd-sz button.on,
.mseg button.on,
.pj .mseg button.on,.pj.mseg button.on,
.pj .seg2 button.on,.pj.seg2 button.on,
/* ⚠ PROJECTS HAD FIVE MORE OF ITS OWN, and he found them one screen at a time:
   .r2-seg is List|Board|Calendar|Timeline|Team, .tlzoom the timeline’s scale,
   .pkcell a day in the date picker, .home-look the home layout, .mbseg a done
   segment. Named here because projects.css is GENERATED and must not be edited,
   and because this file is the one place the app says what “chosen” looks like. */
.pj .r2-seg button.on,.pj.r2-seg button.on,
.pj .tlzoom button.on,.pj.tlzoom button.on,
.pj .pkcell.on,.pj.pkcell.on,
.pj .home-look button.on,.pj.home-look button.on,
.pj .mcatchip.on,.pj.mcatchip.on,
.pj .chip.on,.pj .dtab.on{
  background:var(--accent-soft)!important;
  color:var(--ink)!important;
  font-weight:600}
/* where the control has a border of its own, it takes the accent's pale edge
   rather than a black one — a black outline is the same shout in outline form */
.chip.on,.mcatchip.on,.dtab.on,.tv-tab.on,.fl-kind.on{
  border-color:var(--accent-line)!important}
/* a count inside a chosen chip was white-on-black and is now ink-on-tint */
.fl-kind.on b{color:var(--ink-soft)!important}

/* ── the one exception, kept ── */
/* an overdue view stays solid accent: that is a warning, not a selection */
.dtab.hot.on{background:var(--accent)!important;color:var(--on-accent)!important;
  border-color:var(--accent)!important;font-weight:600}
.dtab.hot.on span{color:rgba(var(--lift-rgb),.72)!important}

/* ═══ THE SLIDING SWITCH (restyle J2, 21 Oct 2026) ══════════════════════════
   "every button, switch and pop-up in the CRM looks like the ones I approved in
   the design library". A single-choice switch is one grey strip; the chosen one
   is a white raised piece that SLIDES to a new choice ("slides ofc", after
   :2010 tries/switch-move). Values: design-gallery tries/switches panel 1
   (.s-apple.crm). The piece itself is js/seg-knob.js: it adds one
   <span class="sk-knob"> per switch and marks the switch .sk-on; until then
   (or without the script) the chosen button is white itself and just jumps.

   ⚠ THE FENCE. Every rule below sits behind
     :where(body:not(.role-tech):not(.role-driver)) — zero specificity — so the
     technician's and the driver's own screens keep the block above (his law).
   ⚠ NOT IN THE SIDE PANEL. A switch topbar.js moves into #appside .as-end is
     a list of rows there (apppanel.css): :where(:not(#appside *)) leaves it be.
   ⚠ LEFT ALONE on purpose: .dtab (the section list), .chip, .mcatchip,
     .fl-kind (Files kind row stays pills), .tv-tab (the technician's tabs),
     ListKit .cg-seg (has its own piece), .pkcell, .mbseg. Home's .hm-seg,
     .hm-seg2, .hm-seg3 keep their own shape and only take the sliding piece.
   ⚠ The list of switches is written twice: here and in js/seg-knob.js SEL.
   ═════════════════════════════════════════════════════════════════════════ */

/* the strip */
:where(body:not(.role-tech):not(.role-driver)) :is(.mseg,.seg2,.dl-dest,.bd-sz,.fl-seg,.mtg-seg,.nt-seg,.sr-seg,.spr-seg,.mp-seg,.pa-seg,.tp-segs,.bd-seg,.pj .r2-seg,.pj .tlzoom,.pj .home-look,.pj .ev-seg,.pj .seeseg):where(:not(#appside *)){
  /* equal pieces as wide as the widest word; where that does not fit, a long word
     ("Anyone who can see this customer") keeps its width and the rest share what is left */
  /* ⚠ display is NOT !important: the app hides a switch with an inline display:none
     (the delivery form's "Where it goes" on a Collection), .hidden, [hidden] or an id
     rule (Data Bank's phone switch on the laptop), and every one of those must win. */
  display:inline-grid;grid-auto-flow:column!important;grid-auto-columns:minmax(max-content,1fr)!important;
  grid-template-columns:none!important;align-items:stretch!important;
  /* 44 tall, as every button and typing box beside it ("this is too small", 23 Oct; was 32) */
  height:44px!important;min-height:0!important;max-width:100%!important;padding:3px!important;gap:0!important;
  border:0!important;border-radius:22px!important;background:var(--field)!important;box-shadow:none!important;
  overflow:visible!important;isolation:isolate}
/* the two that filled their row (the phone's pane switch, the delivery form's
   "Where it goes") keep filling it. (Class doubled: the strip rule above weighs two classes.) */
:where(body:not(.role-tech):not(.role-driver)) :is(.pa-seg.pa-seg,.dl-dest.dl-dest):where(:not(#appside *)){display:grid}
/* a switch the app hides with the hidden attribute (the board's Joined switch) stays hidden */
:where(body:not(.role-tech):not(.role-driver)) :is(.mseg,.seg2,.dl-dest,.bd-sz,.fl-seg,.mtg-seg,.nt-seg,.sr-seg,.spr-seg,.mp-seg,.pa-seg,.tp-segs,.bd-seg,.pj .r2-seg,.pj .tlzoom,.pj .home-look,.pj .ev-seg,.pj .seeseg)[hidden]{display:none!important}
/* Data Bank's view switch: hidden on the laptop by an id rule, shown as a flex row on the
   phone and with the tree off; where it is shown it is the strip (one class more than its rules) */
@media (max-width:760px){
  :where(body:not(.role-tech):not(.role-driver)) #view-databank .pj .db-phv.mseg{display:grid}
}
@media (min-width:761px){
  body.tree-off:not(.role-tech):not(.role-driver) #view-databank .pj .db-phv.mseg{display:inline-grid}
}

/* the pieces */
:where(body:not(.role-tech):not(.role-driver)) :is(.mseg,.seg2,.dl-dest,.bd-sz,.fl-seg,.mtg-seg,.nt-seg,.sr-seg,.spr-seg,.mp-seg,.pa-seg,.tp-segs,.bd-seg,.pj .r2-seg,.pj .tlzoom,.pj .home-look,.pj .ev-seg,.pj .seeseg):where(:not(#appside *)) > button{
  position:relative;z-index:1;
  height:auto!important;min-height:0!important;min-width:0!important;margin:0!important;padding:0 16px!important;
  border:0!important;border-radius:19px!important;background:none!important;box-shadow:none!important;
  font:500 15px/1.2 'Inter',sans-serif!important;color:var(--ink)!important;letter-spacing:0!important;
  white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis;flex:none!important;
  transition:color .2s!important}
/* a hair between two pieces that are not chosen */
:where(body:not(.role-tech):not(.role-driver)) :is(.mseg,.seg2,.dl-dest,.bd-sz,.fl-seg,.mtg-seg,.nt-seg,.sr-seg,.spr-seg,.mp-seg,.pa-seg,.tp-segs,.bd-seg,.pj .r2-seg,.pj .tlzoom,.pj .home-look,.pj .ev-seg,.pj .seeseg):where(:not(#appside *)) > button + button::before{
  content:""!important;display:block!important;position:absolute;left:0;top:11px;bottom:11px;width:1px;
  background:var(--rule-strong);transition:opacity .2s;pointer-events:none}
:where(body:not(.role-tech):not(.role-driver)) :is(.mseg,.seg2,.dl-dest,.bd-sz,.fl-seg,.mtg-seg,.nt-seg,.sr-seg,.spr-seg,.mp-seg,.pa-seg,.tp-segs,.bd-seg,.pj .r2-seg,.pj .tlzoom,.pj .home-look,.pj .ev-seg,.pj .seeseg):where(:not(#appside *)) > button:is(.on,[aria-pressed="true"],[aria-checked="true"])::before,
:where(body:not(.role-tech):not(.role-driver)) :is(.mseg,.seg2,.dl-dest,.bd-sz,.fl-seg,.mtg-seg,.nt-seg,.sr-seg,.spr-seg,.mp-seg,.pa-seg,.tp-segs,.bd-seg,.pj .r2-seg,.pj .tlzoom,.pj .home-look,.pj .ev-seg,.pj .seeseg):where(:not(#appside *)) > button:is(.on,[aria-pressed="true"],[aria-checked="true"]) + button::before{
  opacity:0}
/* the chosen one: white and raised (before the piece arrives, or with no script) */
:where(body:not(.role-tech):not(.role-driver)) :is(.mseg,.seg2,.dl-dest,.bd-sz,.fl-seg,.mtg-seg,.nt-seg,.sr-seg,.spr-seg,.mp-seg,.pa-seg,.tp-segs,.bd-seg,.pj .r2-seg,.pj .tlzoom,.pj .home-look,.pj .ev-seg,.pj .seeseg):where(:not(#appside *)) > button:is(.on,[aria-pressed="true"],[aria-checked="true"]){
  background:var(--surface)!important;font-weight:600!important;color:var(--ink)!important;
  box-shadow:0 3px 8px rgba(0,0,0,.12),0 3px 1px rgba(0,0,0,.04),0 0 0 .5px rgba(0,0,0,.04)!important}
:root[data-theme="dark"] :where(body:not(.role-tech):not(.role-driver)) :is(.mseg,.seg2,.dl-dest,.bd-sz,.fl-seg,.mtg-seg,.nt-seg,.sr-seg,.spr-seg,.mp-seg,.pa-seg,.tp-segs,.bd-seg,.pj .r2-seg,.pj .tlzoom,.pj .home-look,.pj .ev-seg,.pj .seeseg):where(:not(#appside *)) > button:is(.on,[aria-pressed="true"],[aria-checked="true"]){
  background:var(--rule-strong)!important;box-shadow:0 3px 8px rgba(0,0,0,.12)!important}

/* the wall board scales its controls with S / M / L (--bs): the strip does too.
   (Classes doubled here and on .nt-seg below: the strip rules weigh two classes.) */
:where(body:not(.role-tech):not(.role-driver)) :is(.bd-seg.bd-seg,.bd-sz.bd-sz):where(:not(#appside *)){
  height:calc(32px * var(--bs,1))!important;padding:calc(2px * var(--bs,1))!important;border-radius:calc(16px * var(--bs,1))!important}
:where(body:not(.role-tech):not(.role-driver)) :is(.bd-seg.bd-seg,.bd-sz.bd-sz):where(:not(#appside *)) > button{
  font-size:calc(14px * var(--bs,1))!important;padding:0 calc(12px * var(--bs,1))!important;border-radius:calc(14px * var(--bs,1))!important}

/* ── the sliding piece (js/seg-knob.js) ── */
.sk-knob{display:none}
:where(body:not(.role-tech):not(.role-driver)) .sk-rel{position:relative}
:where(body:not(.role-tech):not(.role-driver)) .sk-knob{
  display:block;position:absolute;left:0;top:0;z-index:0;pointer-events:none;
  background:var(--surface);border-radius:19px;
  box-shadow:0 3px 8px rgba(0,0,0,.12),0 3px 1px rgba(0,0,0,.04),0 0 0 .5px rgba(0,0,0,.04);
  transition:transform var(--mo-knob),width var(--mo-knob),height var(--mo-knob)}
:root[data-theme="dark"] :where(body:not(.role-tech):not(.role-driver)) .sk-knob{
  background:var(--rule-strong);box-shadow:0 3px 8px rgba(0,0,0,.12)}
:where(body:not(.role-tech):not(.role-driver)) .sk-still > .sk-knob{transition:none!important}
#appside .sk-knob{display:none!important}
/* once the piece is there, the chosen button hands it its white
   (one class more than the white rule above, in both themes, so it wins) */
:where(body:not(.role-tech):not(.role-driver)) :is(.mseg,.seg2,.dl-dest,.bd-sz,.fl-seg,.mtg-seg,.nt-seg,.sr-seg,.spr-seg,.mp-seg,.pa-seg,.tp-segs,.bd-seg,.pj .r2-seg,.pj .tlzoom,.pj .home-look,.pj .ev-seg,.pj .seeseg,.hm-seg,.hm-seg2,.hm-seg3).sk-on:where(:not(#appside *)) > button:is(.on,[aria-pressed="true"],[aria-checked="true"]),
:root[data-theme="dark"] :where(body:not(.role-tech):not(.role-driver)) :is(.mseg,.seg2,.dl-dest,.bd-sz,.fl-seg,.mtg-seg,.nt-seg,.sr-seg,.spr-seg,.mp-seg,.pa-seg,.tp-segs,.bd-seg,.pj .r2-seg,.pj .tlzoom,.pj .home-look,.pj .ev-seg,.pj .seeseg,.hm-seg,.hm-seg2,.hm-seg3).sk-on:where(:not(#appside *)) > button:is(.on,[aria-pressed="true"],[aria-checked="true"]){
  background:transparent!important;box-shadow:none!important}
/* Home's own switches keep their shape; their words sit above the piece */
:where(body:not(.role-tech):not(.role-driver)) :is(.hm-seg,.hm-seg2,.hm-seg3).sk-on > button{position:relative;z-index:1}

@media (max-width:760px){
  /* a thumb-wide target without changing the drawn shape (tries/switches line 153).
     ⚠ overflow CLIP with an 8px clip margin, not hidden: hidden cut the 44px band
     back to the 28px piece, visible let "Shared with me" run off the strip. Each
     word takes the width it needs here (equal widths cut it at 375px), and only a
     word that still cannot fit ends in "…". */
  :where(body:not(.role-tech):not(.role-driver)) :is(.mseg,.seg2,.dl-dest,.bd-sz,.fl-seg,.mtg-seg,.nt-seg,.sr-seg,.spr-seg,.mp-seg,.pa-seg,.tp-segs,.bd-seg,.pj .r2-seg,.pj .tlzoom,.pj .home-look,.pj .ev-seg,.pj .seeseg):where(:not(#appside *)){grid-auto-columns:minmax(0,auto)!important}
  :where(body:not(.role-tech):not(.role-driver)) :is(.mseg,.seg2,.dl-dest,.bd-sz,.fl-seg,.mtg-seg,.nt-seg,.sr-seg,.spr-seg,.mp-seg,.pa-seg,.tp-segs,.bd-seg,.pj .r2-seg,.pj .tlzoom,.pj .home-look,.pj .ev-seg,.pj .seeseg):where(:not(#appside *)) > button{
    overflow:clip;overflow-clip-margin:8px;padding:0 8px!important}
  :where(body:not(.role-tech):not(.role-driver)) :is(.mseg,.seg2,.dl-dest,.bd-sz,.fl-seg,.mtg-seg,.nt-seg,.sr-seg,.spr-seg,.mp-seg,.pa-seg,.tp-segs,.bd-seg,.pj .r2-seg,.pj .tlzoom,.pj .home-look,.pj .ev-seg,.pj .seeseg):where(:not(#appside *)) > button::after{
    content:"";position:absolute;left:0;right:0;top:50%;height:44px;transform:translateY(-50%)}
  /* ⚠ "who can open this" stays a COLUMN on a phone ("wtf is that", 18 Sep: its
     first choice alone is wider than 375px). Same strip, stood on end; the piece
     slides down instead of across. */
  :where(body:not(.role-tech):not(.role-driver)) .nt-seg.nt-seg:where(:not(#appside *)){
    display:grid;grid-auto-flow:row!important;grid-auto-rows:auto!important;height:auto!important;width:100%!important}
  :where(body:not(.role-tech):not(.role-driver)) .nt-seg.nt-seg:where(:not(#appside *)) > button{
    min-height:44px!important;padding:10px 14px!important;text-align:left;white-space:normal!important;line-height:1.3!important}
  :where(body:not(.role-tech):not(.role-driver)) .nt-seg.nt-seg:where(:not(#appside *)) > button + button::before{
    left:12px;right:12px;top:0;bottom:auto;width:auto;height:1px}
}
@media (prefers-reduced-motion:reduce){
  .sk-knob{transition:none!important}
}

/* ═══ THE NEW TRIP FORM (26 Oct 2026) ═════════════════════════════════════════
   Its Day strip (.tr-days) and each stop's kind (.tr-kind, trip.js trDraw) were the
   old black chips; they are the sliding switch above, the same values. Kept in its own
   block (and its own line in js/seg-knob.js SEL) so it joins the other restyle rows
   cleanly. The trip form is an office pop-up: the fence is kept all the same. */
:where(body:not(.role-tech):not(.role-driver)) :is(.tr-days,.tr-kind):where(:not(#appside *)){
  display:inline-grid;grid-auto-flow:column!important;grid-auto-columns:minmax(max-content,1fr)!important;
  grid-template-columns:none!important;align-items:stretch!important;
  height:44px!important;min-height:0!important;max-width:100%!important;padding:3px!important;gap:0!important;
  border:0!important;border-radius:22px!important;background:var(--field)!important;box-shadow:none!important;
  overflow:visible!important;isolation:isolate;position:relative}
:where(body:not(.role-tech):not(.role-driver)) :is(.tr-days,.tr-kind):where(:not(#appside *)) > button{
  position:relative;z-index:1;
  height:auto!important;min-height:0!important;min-width:0!important;margin:0!important;padding:0 16px!important;
  border:0!important;border-radius:19px!important;background:none!important;box-shadow:none!important;
  font:500 15px/1.2 'Inter',sans-serif!important;color:var(--ink)!important;letter-spacing:0!important;
  white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis;flex:none!important;cursor:pointer;
  transition:color .2s!important}
:where(body:not(.role-tech):not(.role-driver)) :is(.tr-days,.tr-kind):where(:not(#appside *)) > button + button::before{
  content:""!important;display:block!important;position:absolute;left:0;top:11px;bottom:11px;width:1px;
  background:var(--rule-strong);transition:opacity .2s;pointer-events:none}
:where(body:not(.role-tech):not(.role-driver)) :is(.tr-days,.tr-kind):where(:not(#appside *)) > button:is(.on,[aria-pressed="true"])::before,
:where(body:not(.role-tech):not(.role-driver)) :is(.tr-days,.tr-kind):where(:not(#appside *)) > button:is(.on,[aria-pressed="true"]) + button::before{
  opacity:0}
:where(body:not(.role-tech):not(.role-driver)) :is(.tr-days,.tr-kind):where(:not(#appside *)) > button:is(.on,[aria-pressed="true"]){
  background:var(--surface)!important;font-weight:600!important;color:var(--ink)!important;
  box-shadow:0 3px 8px rgba(0,0,0,.12),0 3px 1px rgba(0,0,0,.04),0 0 0 .5px rgba(0,0,0,.04)!important}
:root[data-theme="dark"] :where(body:not(.role-tech):not(.role-driver)) :is(.tr-days,.tr-kind):where(:not(#appside *)) > button:is(.on,[aria-pressed="true"]){
  background:var(--rule-strong)!important;box-shadow:0 3px 8px rgba(0,0,0,.12)!important}
:where(body:not(.role-tech):not(.role-driver)) :is(.tr-days,.tr-kind).sk-on:where(:not(#appside *)) > button:is(.on,[aria-pressed="true"]),
:root[data-theme="dark"] :where(body:not(.role-tech):not(.role-driver)) :is(.tr-days,.tr-kind).sk-on:where(:not(#appside *)) > button:is(.on,[aria-pressed="true"]){
  background:transparent!important;box-shadow:none!important}
:where(body:not(.role-tech):not(.role-driver)) :is(.tr-days,.tr-kind):where(:not(#appside *)) > button:focus-visible{outline:2px solid var(--ink-faint);outline-offset:-2px}
@media (max-width:760px){
  :where(body:not(.role-tech):not(.role-driver)) :is(.tr-days,.tr-kind):where(:not(#appside *)){grid-auto-columns:minmax(0,auto)!important}
  :where(body:not(.role-tech):not(.role-driver)) :is(.tr-days,.tr-kind):where(:not(#appside *)) > button{
    overflow:clip;overflow-clip-margin:8px;padding:0 8px!important}
}
/* a phone: the four stop kinds two per row, as the delivery form's trip types */
@media (max-width:600px){
  :where(body:not(.role-tech):not(.role-driver)) .tr-kind.tr-kind:where(:not(#appside *)){
    display:grid;width:100%;height:auto!important;grid-auto-flow:row!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-auto-rows:38px}
  :where(body:not(.role-tech):not(.role-driver)) .tr-kind.tr-kind:where(:not(#appside *)) > button:nth-child(3)::before{display:none!important}
}
