/* pills.css (main session, 30 Nov) — Cedric: "When a certificate is selected, the pills should change colour and some pills should have
   cool effects". The customer card's order pills (.sibs): the chosen one turns deep Sofo orange with a light sweep each time it is chosen,
   and the header's status pills (brand · status · paid · warranty) catch a quiet sheen now and then, one after the other.
   Only transform / opacity move (compositor only); everything stands still with reduced motion or Animations off. */

/* the order pills */
.sibs .pill { position: relative; overflow: hidden; isolation: isolate;
  transition: background-color .2s ease, color .2s ease, box-shadow .25s cubic-bezier(.23, 1, .32, 1), transform .16s cubic-bezier(.23, 1, .32, 1); }
.sibs .pill:active { transform: scale(.97); }
.sibs .pill.on { background: linear-gradient(135deg, #c94a0b, #a83a09); color: #fff; font-weight: 700;
  box-shadow: 0 8px 20px -8px rgba(201, 74, 11, .75), inset 0 1px 0 rgba(255, 255, 255, .22); }
.sibs .pill.on::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 28%, rgba(255, 255, 255, .42) 50%, transparent 72%);
  transform: translateX(-120%); animation: pl-sweep .9s cubic-bezier(.23, 1, .32, 1) .05s 1 both; }
@keyframes pl-sweep { to { transform: translateX(120%); } }

/* the header's status pills: a sheen that ripples across them every few seconds */
.card-screen .chips .tag, .card-screen .chips .stp { position: relative; overflow: hidden; isolation: isolate; }
.card-screen .chips .tag::after, .card-screen .chips .stp::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 36%, rgba(255, 255, 255, .26) 50%, transparent 64%);
  transform: translateX(-130%); animation: pl-sheen 8s ease-in-out 1.2s infinite; }
.card-screen .chips > :nth-child(2)::after { animation-delay: 1.45s; }
.card-screen .chips > :nth-child(3)::after { animation-delay: 1.7s; }
.card-screen .chips > :nth-child(4)::after { animation-delay: 1.95s; }
@keyframes pl-sheen { 0% { transform: translateX(-130%); } 12%, 100% { transform: translateX(130%); } }

/* still: Animations off / reduced, or the device asks for less motion */
html.mo-off .sibs .pill.on::after, html.mo-reduced .sibs .pill.on::after,
html.mo-off .card-screen .chips .tag::after, html.mo-off .card-screen .chips .stp::after,
html.mo-reduced .card-screen .chips .tag::after, html.mo-reduced .card-screen .chips .stp::after { animation: none; display: none; }
@media (prefers-reduced-motion: reduce) {
  .sibs .pill.on::after, .card-screen .chips .tag::after, .card-screen .chips .stp::after { animation: none; display: none; }
}

/* room for the chosen pill's glow: the strip scrolls sideways, so it would cut the shadow flat */
.sibs { padding-top: 4px; padding-bottom: 14px; margin-bottom: -10px; }

/* ── buttons too (Cedric 30 Nov: "and buttons too") ──
   every button presses in under the finger; the orange main button has depth (a lit top edge, an orange glow) and catches a slow sheen;
   main buttons answer a tap with a soft ripple from the fingertip (js/haptics.js sets --rx / --ry and .rip). Still with less motion. */
.btn, .mini, .chip, .vb { transition: transform .16s cubic-bezier(.23, 1, .32, 1), box-shadow .2s ease, background-color .2s ease, filter .2s ease; -webkit-tap-highlight-color: transparent; }
.btn:active, .mini:active, .chip:active, .vb:active { transform: scale(.97); }
.btn, .vb { position: relative; overflow: hidden; isolation: isolate; }
.btn:not(.ghost):not(.white):not(.glass):not(.danger):not(.inv) {
  background: linear-gradient(180deg, color-mix(in srgb, var(--orange) 86%, #fff) 0%, var(--orange) 52%, color-mix(in srgb, var(--orange) 88%, #000) 100%);
  box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--orange) 85%, transparent), inset 0 1px 0 rgba(255, 255, 255, .32); }
.btn:not(.ghost):not(.white):not(.glass):not(.danger):not(.inv):active { filter: brightness(.96); box-shadow: 0 4px 12px -8px color-mix(in srgb, var(--orange) 85%, transparent), inset 0 1px 0 rgba(255, 255, 255, .22); }
.btn:not(.ghost):not(.white):not(.glass):not(.danger):not(.inv)::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 32%, rgba(255, 255, 255, .34) 50%, transparent 68%);
  transform: translateX(-130%); animation: pl-sheen 9s ease-in-out 2.2s infinite; }
.btn.rip::before, .vb.rip::before { content: ""; position: absolute; left: var(--rx, 50%); top: var(--ry, 50%); width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border-radius: 50%; background: currentColor; opacity: .22; pointer-events: none; z-index: -1; transform: scale(0); animation: pl-rip .55s cubic-bezier(.23, 1, .32, 1) forwards; }
@keyframes pl-rip { to { transform: scale(14); opacity: 0; } }
html.mo-off .btn::after, html.mo-reduced .btn::after, html.mo-off .btn.rip::before, html.mo-reduced .btn.rip::before, html.mo-off .vb.rip::before, html.mo-reduced .vb.rip::before { animation: none; display: none; }
@media (prefers-reduced-motion: reduce) { .btn::after, .btn.rip::before, .vb.rip::before { animation: none; display: none; } }

/* ── the customer card's photo, full height and edge to edge (Cedric 30 Nov: "make the photo full height, it looks really great") ──
   On the phone the banner now starts at the very top of the screen, under the glass top bar (and the real app's slim line), and is
   about half the screen tall, with the name on the dark end of the veil. Without a photo nothing changes (html.b16-cover is only set
   when the order has one — js/photohero.js). */
@media (max-width: 899px) {
  html.b16-cover .card-screen .phead-l > h1 { margin-top: calc(-1 * (var(--safe-t) + 61px + 14px)); padding-top: max(200px, calc(54vh - 40px));
    border-radius: 0 0 26px 26px; background-position: center, 50% 45%, center; }
  html.b16-cover:has(#sofoRealBar) .card-screen .phead-l > h1 { margin-top: calc(-1 * (var(--safe-t) + 61px + 24px + 14px)); }
}
@media (min-width: 900px) { html.b16-cover .card-screen .phead-l > h1 { padding-top: 220px; } }

/* "remove the blue on the header": the warranty pill becomes a quiet pill like the others (it was the only blue there) */
.card-screen .chips .tag[style*="var(--info)"] { color: var(--text) !important; background: var(--glass-hover) !important; }

/* ── status pills glow in their own colour (Cedric 30 Nov: "pills that are cancelled or delivered or pending or any other should have a
   subtle glow for me to easily know") — everywhere a status pill shows (lists, cards, boards); the order strip gets a glowing status dot ── */
.stp { box-shadow: 0 0 0 1px color-mix(in srgb, currentColor 24%, transparent), 0 0 16px -5px color-mix(in srgb, currentColor 75%, transparent); }
.sibs .pill .sdot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--sd, var(--muted));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--sd, var(--muted)) 22%, transparent), 0 0 10px 1px color-mix(in srgb, var(--sd, var(--muted)) 70%, transparent); }
.sibs .pill.on .sdot { box-shadow: 0 0 0 2px rgba(255, 255, 255, .35), 0 0 10px 1px rgba(255, 255, 255, .5); }

/* ── page changes glide like iOS instead of snapping (Cedric 30 Nov: "smooth animation for any operations / click to open a window
   instead of a too fast opening, same as iOS or Android") — the new page comes in further and slower, the old one leaves a bit quicker ── */
html[data-mo-dir=fwd]::view-transition-old(root) { animation: pl-out-l 260ms cubic-bezier(.32, .72, 0, 1) both; }
html[data-mo-dir=fwd]::view-transition-new(root) { animation: pl-in-r 380ms cubic-bezier(.32, .72, 0, 1) both; }
html[data-mo-dir=back]::view-transition-old(root) { animation: pl-out-r 260ms cubic-bezier(.32, .72, 0, 1) both; }
html[data-mo-dir=back]::view-transition-new(root) { animation: pl-in-l 380ms cubic-bezier(.32, .72, 0, 1) both; }
html[data-mo-dir=latf]::view-transition-old(root) { animation: mo-out-l-s 220ms cubic-bezier(.32, .72, 0, 1) both; }
html[data-mo-dir=latf]::view-transition-new(root) { animation: mo-in-r-s 300ms cubic-bezier(.32, .72, 0, 1) both; }
html[data-mo-dir=latb]::view-transition-old(root) { animation: mo-out-r-s 220ms cubic-bezier(.32, .72, 0, 1) both; }
html[data-mo-dir=latb]::view-transition-new(root) { animation: mo-in-l-s 300ms cubic-bezier(.32, .72, 0, 1) both; }
html[data-mo-dir=swap]::view-transition-old(root) { animation: mo-fade-out 220ms ease both; }
html[data-mo-dir=swap]::view-transition-new(root) { animation: mo-in-up 320ms cubic-bezier(.32, .72, 0, 1) both; }
html.mo-reduced[data-mo-dir]::view-transition-old(root) { animation: mo-fade-out 200ms ease both; }
html.mo-reduced[data-mo-dir]::view-transition-new(root) { animation: mo-fade-in 260ms ease both; }
:root::view-transition-group(mo-photo), :root::view-transition-group(mo-name) { animation-duration: 380ms; animation-timing-function: cubic-bezier(.32, .72, 0, 1); }
:root::view-transition-old(mo-name), :root::view-transition-new(mo-name), :root::view-transition-old(mo-photo), :root::view-transition-new(mo-photo) { animation-duration: 380ms; }
@keyframes pl-out-l { to { opacity: 0; transform: translateX(-36px); } }
@keyframes pl-out-r { to { opacity: 0; transform: translateX(36px); } }
@keyframes pl-in-r { from { opacity: 0; transform: translateX(56px); } }
@keyframes pl-in-l { from { opacity: 0; transform: translateX(-56px); } }

/* ── the header over the hero photo, frosted (Cedric 30 Nov: "put the header over the hero photo with blur effect") — on a customer card
   with a cover photo the phone's top bar and the real app's slim line turn to see-through glass, so the photo runs under them blurred ── */
/* main 30 Nov 13:11 (Cedric: "Needs some visual adjustments for the hero and the header" — the glass made a muddy blurred band over the
   photo and washed-out buttons): the iPhone photo-page look. Over the photo the bar is clear — the photo itself up to the top, a soft dark
   fade under white buttons (both themes, the photo is the background); once the photo has scrolled away (html.b16-past, js/photohero.js)
   the usual glass bar comes back. */
@media (max-width: 899px) {
  html.b16-cover .topbar, html.b16-cover body #sofoRealBar { transition: background-color .22s ease, color .22s ease, -webkit-backdrop-filter .22s ease, backdrop-filter .22s ease; }
  html.b16-cover:not(.b16-past) .topbar { background: linear-gradient(180deg, rgba(0, 0, 0, .46) 0%, rgba(0, 0, 0, .22) 62%, rgba(0, 0, 0, 0) 100%) border-box no-repeat !important;   /* border-box no-repeat: never a dark 1 px repeat under the border */
    border-bottom-color: transparent !important; box-shadow: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
  html.b16-cover:not(.b16-past) .topbar .backb, html.b16-cover:not(.b16-past) .topbar .iconb, html.b16-cover:not(.b16-past) .topbar .brand { color: #fff !important; }
  html.b16-cover:not(.b16-past) .topbar .ic { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
  html.b16-cover:not(.b16-past) .topbar .backb span { text-shadow: 0 1px 3px rgba(0, 0, 0, .55); }
  html.b16-cover:not(.b16-past) body #sofoRealBar { background: linear-gradient(180deg, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0)) border-box no-repeat !important; border-color: transparent !important;
    backdrop-filter: none !important; -webkit-backdrop-filter: none !important; color: rgba(255, 255, 255, .94) !important; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
  html.b16-cover:not(.b16-past) body #sofoRealBar * { color: inherit !important; }
  /* past the photo: the app's own glass bar and slim line, exactly as on every other page (no override) */
  html.mo-off.b16-cover .topbar, html.mo-off.b16-cover body #sofoRealBar { transition: none; }
}

/* ── main 30 Nov — the FLOATING BUTTON bar (Cedric: "I love the floating button", the "6 · Floating button" bar of his video): the black bar
   keeps every tab's name; the open tab's icon rises into a glowing orange button that springs to the tab you tap (app.js fabMove), and the
   bar's top edge bulges smoothly around it (app.js barPath: one SVG path redrawn as it moves). ── */
nav.tabbar.fabbar { background: transparent; border: 0; padding: 0 4px; gap: 0; justify-content: space-between; overflow: visible; }   /* the pill's own shadow stays (box-shadow: no filter redrawn while the button moves) */
nav.tabbar.fabbar .tb-bg { position: absolute; left: 0; top: -16px; width: 100%; height: calc(100% + 17px); overflow: visible; pointer-events: none; z-index: 0; }
nav.tabbar.fabbar .tb-bgp { fill: var(--nav-bg); stroke: var(--nav-line); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-linejoin: round; pointer-events: visiblePainted; }   /* the bump catches taps (never the list behind it) */
nav.tabbar.fabbar.fabbar .tab { position: relative; z-index: 1; flex: 1 1 0; min-width: 0; height: 100%; padding: 0 0 7px; margin: 0; gap: 3px; flex-direction: column; justify-content: flex-end;
  background: transparent; border-radius: 14px; color: var(--nav-ic); font-size: 10.5px; font-weight: 600; letter-spacing: .01em; }
nav.tabbar.fabbar.fabbar .tab > span.tl { display: block; max-width: none; opacity: 1; overflow: visible; line-height: 13px; transition: color .25s ease; }
nav.tabbar.fabbar .tab .tic { transition: opacity .18s ease, transform .32s cubic-bezier(.23, 1, .32, 1); }
nav.tabbar.fabbar .tab .ic { width: 22px; height: 22px; }
nav.tabbar.fabbar.fabbar .tab.on { color: #fff; background: transparent; padding: 0 0 7px; gap: 3px; }
nav.tabbar.fabbar .tab.on .tic { opacity: 0; transform: translateY(-14px) scale(.55); }   /* the icon has risen into the button */
nav.tabbar.fabbar .tab.on .tl { color: var(--fab-t); font-weight: 700; }
/* Cedric 30 Nov: "make the button change Colour based on the tab in this order: red blue yellow green dark-grey" — Today red · Orders blue ·
   Inbox yellow · Money green · More dark grey. The colours are registered custom properties, so they blend (.5 s) while the button springs. */
@property --fab-a { syntax: '<color>'; inherits: true; initial-value: #FFB27A; }
@property --fab-b { syntax: '<color>'; inherits: true; initial-value: #FB8534; }
@property --fab-c { syntax: '<color>'; inherits: true; initial-value: #F97316; }
@property --fab-d { syntax: '<color>'; inherits: true; initial-value: #DD5A0C; }
@property --fab-g { syntax: '<color>'; inherits: true; initial-value: rgba(249, 115, 22, .62); }
@property --fab-h { syntax: '<color>'; inherits: true; initial-value: rgba(249, 115, 22, .32); }
@property --fab-t { syntax: '<color>'; inherits: true; initial-value: #FB8534; }
@property --fab-ink { syntax: '<color>'; inherits: true; initial-value: #ffffff; }
nav.tabbar.fabbar { --fab-a: #FFB27A; --fab-b: #FB8534; --fab-c: #F97316; --fab-d: #DD5A0C; --fab-g: rgba(249, 115, 22, .62); --fab-h: rgba(249, 115, 22, .32); --fab-t: var(--orange-h); --fab-ink: #fff;
  transition: --fab-a .5s cubic-bezier(.4, 0, .2, 1), --fab-b .5s cubic-bezier(.4, 0, .2, 1), --fab-c .5s cubic-bezier(.4, 0, .2, 1), --fab-d .5s cubic-bezier(.4, 0, .2, 1),
    --fab-g .5s ease, --fab-h .5s ease, --fab-t .35s ease, --fab-ink .35s ease; }
nav.tabbar.fabbar.tc0 { --fab-a: #FF9A93; --fab-b: #F4524B; --fab-c: #E53935; --fab-d: #B71C1C; --fab-g: rgba(229, 57, 53, .6); --fab-h: rgba(229, 57, 53, .3); --fab-t: #F0544D; --fab-ink: #fff; }
nav.tabbar.fabbar.tc1 { --fab-a: #9CC0FF; --fab-b: #4F8FF7; --fab-c: #2F6FE4; --fab-d: #1A4FB5; --fab-g: rgba(47, 111, 228, .6); --fab-h: rgba(47, 111, 228, .3); --fab-t: #4F8FF7; --fab-ink: #fff; }
nav.tabbar.fabbar.tc2 { --fab-a: #FFE89A; --fab-b: #FCCB3A; --fab-c: #F5B301; --fab-d: #C98A00; --fab-g: rgba(245, 179, 1, .58); --fab-h: rgba(245, 179, 1, .3); --fab-t: #F7C531; --fab-ink: #3A2A00; }
nav.tabbar.fabbar.tc3 { --fab-a: #93E6AE; --fab-b: #38C46C; --fab-c: #1FA855; --fab-d: #13803F; --fab-g: rgba(31, 168, 85, .58); --fab-h: rgba(31, 168, 85, .3); --fab-t: #2DB862; --fab-ink: #fff; }
nav.tabbar.fabbar.tc4 { --fab-a: #9AA0A8; --fab-b: #646A74; --fab-c: #4A4F58; --fab-d: #2E3238; --fab-g: rgba(20, 22, 26, .55); --fab-h: rgba(120, 128, 140, .22); --fab-t: #8A919B; --fab-ink: #fff; }
nav.tabbar.fabbar.tc4 { --fab-t: #B4BAC3; }   /* the bar is dark in both looks: the open tab's name stays light enough to read */
nav.tabbar.fabbar .tfab .tbadge { color: var(--fab-d); }
html.mo-off nav.tabbar.fabbar { transition: none; }
nav.tabbar.fabbar .tfab { position: absolute; z-index: 2; left: 0; top: -21px; width: 48px; height: 48px; margin-left: -24px; border-radius: 50%; display: grid; place-items: center; pointer-events: auto; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transform: translateX(var(--fx, -99px)); color: var(--fab-ink);
  background: radial-gradient(120% 120% at 30% 20%, var(--fab-a) 0%, var(--fab-b) 38%, var(--fab-c) 62%, var(--fab-d) 100%);
  box-shadow: 0 0 0 3.5px var(--nav-bg), 0 8px 22px -4px var(--fab-g), 0 0 26px var(--fab-h), inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -3px 8px rgba(0, 0, 0, .22); }
nav.tabbar.fabbar .tfab .ic { width: 22px; height: 22px; stroke-width: 2.1; animation: tfab-pop .34s cubic-bezier(.34, 1.56, .64, 1); }
nav.tabbar.fabbar .tfab .tbadge { top: -5px; left: auto; right: -7px; background: #fff; color: #C2410C; box-shadow: 0 0 0 2px var(--nav-bg); }   /* white on the orange button */
nav.tabbar.fabbar.no-act .tfab { opacity: 0; pointer-events: none; }
nav.tabbar.fabbar .tfab:active { filter: brightness(.94); }
nav.tabbar.fabbar .tab:active .tic .ic { transform: scale(.86); }
@keyframes tfab-pop { from { transform: scale(.6) rotate(-12deg); opacity: .4; } to { transform: none; opacity: 1; } }
html.mo-reduced nav.tabbar.fabbar .tfab .ic, html.mo-off nav.tabbar.fabbar .tfab .ic { animation: none; }
html.mo-reduced nav.tabbar.fabbar .tab .tic, html.mo-off nav.tabbar.fabbar .tab .tic { transition: none; }
@media (max-width: 360px) { nav.tabbar.fabbar.fabbar .tab { font-size: 9.5px; } }

/* main 30 Nov — the order list: a pin on the place name when the customer has a saved location (customers.js pinOf) */
.pr-sys .pr-pin{display:inline-flex;align-items:center;gap:2px;font-weight:inherit;vertical-align:bottom}
.pr-sys .pr-pin .ic{width:13px;height:13px;flex:none;stroke-width:2.2}
.pr-sys .pr-pin.own{color:var(--info)}.pr-sys .pr-pin.own .ic{color:var(--info-dot)}
.pr-sys .pr-pin.prof .ic{color:var(--muted)}
.pr-sys.pr-sys3{display:flex;align-items:baseline;min-width:0}
.pr-sys.pr-sys3>span:first-child{flex:none}
.pr-sys.pr-sys3 .pr-sy{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:inherit}   /* the system text gives way first */
.pr-sys.pr-sys3 .pr-pl{flex:0 0 auto;max-width:58%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:inherit}   /* the place (and its pin) stays */

/* main 30 Nov (Cedric: "The blur on the header is still there"): on the iPhone the frosted top bar (backdrop-filter, sticky) is drawn as its own
   layer, and with Text size Small (body zoom .94) iOS rasterises that layer soft — the bell, search and pen looked blurred. The bar was
   already 93–94 % opaque, so on phones it is now solid (same colour, no filter): everything in it is drawn sharp. The photo header of a
   customer card keeps its own see-through style (pills.css b16-cover) until it scrolls past the photo. */
:root,:root[data-theme="light"]{--bar-solid:#FAF6F2}
:root[data-theme="dark"]{--bar-solid:#111113}
@media (max-width:899px){
  html:not(.b16-cover) .topbar, html.b16-cover.b16-past .topbar { background: var(--bar-solid) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}
