/* Accounts Receivable page: "The life of one invoice". The screen is pinned on the left while the dated stages scroll by on
   the right; the stage nearest the reading line is lit and its screen shows. Markup: ar_story() in tools/build_services.py,
   screens in tools/ar-screens.html (styled by the screen kit in assets/quote-build.css). Behaviour: assets/ar-story.js.
   Without the script every stage is shown at full strength beside one screen. Only opacity and transform are animated. */
.ars{ --ars-fg:var(--fg, #fff); --ars-low:var(--low, #7c7c7c); --ars-mid:var(--mid, #c8c8c8); --ars-line:var(--line, rgba(255,255,255,.18));
  --qx-fg:var(--fg, #fff); --qx-low:var(--low, #7c7c7c); --qx-mid:var(--mid, #c8c8c8); --qx-line:var(--line, rgba(255,255,255,.18)); --qx-hard:var(--hard, #fff);
  --ui-bg:#0b0b0b; --ui-hov:#1d1d1d;
  display:grid; grid-template-columns:minmax(0,1fr); gap:clamp(2rem, 4vw, 3rem); }
@media (min-width:1000px){ .ars{ grid-template-columns:minmax(0,60fr) minmax(0,40fr); gap:clamp(3rem, 5vw, 5rem); align-items:start; } }

/* the pinned screen */
.ars-win{ position:sticky; top:clamp(5.5rem, 13vh, 7.5rem); z-index:2; }
.ars-k{ margin-bottom:1rem; font-size:.8125rem; font-weight:500; letter-spacing:.09em; text-transform:uppercase; color:var(--lab, var(--ars-low)); }

/* the stages */
.ars-stage{ padding-block:clamp(1.5rem, 3vw, 2rem); box-shadow:inset 0 1px 0 var(--ars-line); }
.ars-stage:first-child{ box-shadow:inset 0 1px 0 var(--hard, #fff); }
.ars-day{ display:block; font-weight:300; font-size:clamp(2rem, 3.2vw, 2.75rem); line-height:1; letter-spacing:-.035em; font-variant-numeric:tabular-nums; }
.ars-t{ margin-top:.875rem; font-weight:500; font-size:clamp(1.25rem, 1.7vw, 1.5rem); line-height:1.2; letter-spacing:-.018em; }
.ars-d{ margin-top:.5rem; max-width:30rem; font-size:clamp(1rem, 1.2vw, 1.0625rem); line-height:1.55; color:var(--ars-mid); }

/* with the script: each stage gets a stretch of scrolling, the current one is lit, the screen follows */
.ars-js .ars-stage{ min-height:68vh; opacity:.28; transition:opacity .5s ease; }
.ars-js .ars-stage:last-child{ min-height:52vh; }
.ars-js .ars-stage.is-on{ opacity:1; }
.ars-js .ui-s{ display:flex; flex-direction:column; visibility:hidden; opacity:0; transform:translateY(10px); transition:opacity .45s ease, transform .8s var(--expo, cubic-bezier(.16,1,.3,1)), visibility 0s linear .45s; }
.ars-js .ui-s.on{ visibility:visible; opacity:1; transform:none; transition-delay:0s; }
.ars-js .ui-s.on :is(.erp-t tbody tr, .erp-note, .erp-ev, .ol-m, .ol-body p){ animation:uiRow .55s var(--expo, cubic-bezier(.16,1,.3,1)) both; }
.ars-js .ui-s.on tr:nth-child(2){ animation-delay:.08s; } .ars-js .ui-s.on tr:nth-child(3){ animation-delay:.16s; } .ars-js .ui-s.on tr:nth-child(4){ animation-delay:.24s; }
.ars .ui-s[data-k="5"]{ display:none; }
.ars .ui-s[data-k="3"]{ display:block; }           /* no script: the payment matched to its invoices */
.ars-js .ui-s[data-k="3"], .ars-js .ui-s[data-k="5"]{ display:flex; }

/* evidence list on the dispute screen */
.erp-ev{ margin-top:.75rem; padding:.625rem .75rem; background:var(--e-card); box-shadow:inset 0 0 0 1px var(--e-line); border-radius:4px; }
.erp-ev-h{ font-size:.6875rem; color:var(--e-dim); }
.erp-ev p:not(.erp-ev-h){ display:flex; gap:.5rem; align-items:flex-start; margin-top:.4rem; }
.erp-ev svg{ margin-top:.1rem; color:var(--e-dim); }

/* phones and tablets: the screen stays pinned under the menu and the stages scroll up beneath it */
@media (max-width:999px){
  .ars-win{ top:4.25rem; padding-bottom:.75rem; background:var(--bg, #000); }
  .ars-k{ display:none; }
  .ars-js .ars-stage{ min-height:46vh; }
  .ars-js .ars-stage:last-child{ min-height:40vh; }
  .ars .ui{ max-height:56vh; }
}

@media (prefers-reduced-motion: reduce){ .ars *, .ars *::before, .ars *::after{ animation:none !important; transition:none !important; } }
