/* Data boards: the reports and accounts sections drawn as live HTML charts in the BelGomla identity (D115),
   in place of the dashboard screenshots (D113 d). White cards with 20px corners and no shadow on the warm
   surface band; the orange is the one data accent, everything else is ink and warm greys.
   Motion (viz.js): cards rise in, the line draws from the oldest day, numbers count, bars and rings fill,
   once when the board comes into view and again when an accounts tab shows its panel. Without JS, or
   under prefers-reduced-motion, every chart is drawn in its final state. */

.viz-board, .hero-viz, .sp-viz {
  --v-cur: var(--p-accent, #E8590C);        /* the series the story is about */
  --v-prev: #8C847A;                        /* the comparison: warm grey, dashed */
  --v-grid: #EFE9E1;                        /* hairlines on the white card */
  --v-rest: #D3CABE;                        /* parts that are context */
  --v-soft: #F7E4D7;                        /* the orange's light step: ring track */
  --v-good: #1F7A45;
  --v-bad: #B42318;
  --v-ink: var(--p-ink, #2B2B2B);
  --v-muted: var(--p-muted, #555452);
  --v-card-r: 20px;
  --v-ease: cubic-bezier(.22, 1, .36, 1);
}
.viz-board {
  margin-top: var(--s-7, 48px);
  background: var(--p-surface, #EFE7DD);
  border-radius: 28px;
  padding: clamp(10px, 1.8vw, 22px);
  color: var(--v-ink);
  font: 400 14px/1.5 var(--font-text);
}
.viz-board :is(h3, p, dl, dd, ol, ul, figure) { margin: 0; }
.viz-board :is(ol, ul) { list-style: none; padding: 0; }

/* the toolbar over the board: where the figures come from (not controls) */
.viz-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 4px 6px 14px; color: var(--v-muted); font-size: 13px; }
.viz-crumb b { color: var(--v-ink); font-weight: 500; }
.viz-crumb i { font-style: normal; opacity: .5; margin: 0 4px; }
.viz-seg { display: inline-flex; background: #fff; border-radius: 999px; padding: 3px; gap: 2px; }
.viz-seg span { padding: 5px 12px; border-radius: 999px; white-space: nowrap; }
.viz-seg .is-on { background: var(--v-ink); color: var(--p-bg, #FFF8F0); }
.viz-bar__end { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 12px; }
.viz-live { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.viz-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--v-good); box-shadow: 0 0 0 0 rgb(31 122 69 / .45); }
.viz-chip { display: inline-flex; align-items: center; gap: 6px; background: #fff; border-radius: 999px; padding: 5px 12px; color: var(--v-ink); white-space: nowrap; }
.viz-chip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.viz-chip--action { background: var(--p-action, #C84D0A); color: var(--p-action-ink, #fff); }
.viz-range { background: var(--v-ink); color: var(--p-bg, #FFF8F0); border-radius: 999px; padding: 5px 12px; white-space: nowrap; }

/* the grid of cards: one column on the phone, the 12-column split from 1024 */
.viz-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(10px, 1.2vw, 14px); }
.viz-stack { display: grid; gap: inherit; align-content: start; min-width: 0; }
.viz-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: inherit; }
@media (min-width: 1024px) {
  .viz-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .viz-grid > * { grid-column: span var(--span, 12); }
}

.viz-card { background: #fff; border-radius: var(--v-card-r); padding: clamp(16px, 1.9vw, 26px); min-width: 0; display: grid; gap: 18px; align-content: start; }
.viz-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; }
.viz-title { font: 500 16px/1.4 var(--font-display); color: var(--v-ink); }
.viz-sub { color: var(--v-muted); font-size: 13px; line-height: 1.5; margin-top: 2px; }
.viz-label { color: var(--v-muted); font-size: 13px; }
.viz-fig { font: 600 clamp(30px, 3.3vw, 46px)/1.05 var(--font-text); letter-spacing: -.01em; color: var(--v-ink); white-space: nowrap; }
.viz-fig small { font-size: .38em; font-weight: 500; color: var(--v-muted); letter-spacing: 0; margin-inline-start: 4px; }
.viz-fig--md { font-size: clamp(22px, 2.1vw, 30px); }
.num, .viz-calc dd, .rb__val, .xp-row em, .stk-row em { font-variant-numeric: tabular-nums; }

/* signed change against the previous period: arrow + sign + words, never the colour alone */
.viz-delta { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--v-muted); flex-wrap: wrap; }
.viz-delta b { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; border-radius: 999px; padding: 2px 8px 2px 7px; }
.viz-delta svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.viz-delta.is-up b { color: var(--v-good); background: #EAF4EE; }
.viz-delta.is-down b { color: var(--v-bad); background: #FBEAE8; }

/* a sum written out under its figure */
.viz-calc { display: grid; gap: 0; }
.viz-calc > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--v-grid); font-size: 13.5px; }
.viz-calc dt { color: var(--v-muted); }
.viz-calc dd { font-weight: 500; white-space: nowrap; }
.viz-calc .is-sum dt, .viz-calc .is-sum dd { color: var(--v-ink); font-weight: 600; }

/* legend: line keys for lines, swatches for bars */
.viz-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--v-muted); font-size: 13px; }
.viz-legend li { display: inline-flex; align-items: center; gap: 7px; }
.k { display: inline-block; flex: none; }
.k--cur { width: 16px; height: 2px; border-radius: 2px; background: var(--v-cur); }
.k--prev { width: 16px; height: 0; border-top: 2px dashed var(--v-prev); }
.k--sq { width: 10px; height: 10px; border-radius: 3px; background: var(--k, var(--v-cur)); }

/* ------------------------------------------------------------------ line chart (lc) */
/* in Arabic the dashboard runs time from right (oldest) to left (today), with the value axis on the right */
.lc { --lc-h: clamp(190px, 24vw, 280px); display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: var(--lc-h) auto; column-gap: 12px; outline: none; }
.lc__plot { position: relative; grid-column: 2; grid-row: 1; }
.lc__plot > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.lc__plot path, .lc__plot line { vector-effect: non-scaling-stroke; }
.lc__grid line { stroke: var(--v-grid); stroke-width: 1; }
.lc__grid line.is-base { stroke: #DCD4C8; }
.lc__prev path { fill: none; stroke: var(--v-prev); stroke-width: 1.6; stroke-dasharray: 5 5; stroke-linecap: round; }
.lc__cur .lc__area { fill: url(#lc-wash); stroke: none; }
.hero-viz .lc__cur .lc__area { fill: url(#hv-wash); }
.lc__cur .lc__line { fill: none; stroke: var(--v-cur); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.lc__y { grid-column: 1; grid-row: 1; position: relative; width: 34px; color: var(--v-muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.lc__y span { position: absolute; inset-inline-start: 0; bottom: var(--y); transform: translateY(50%); line-height: 1; direction: ltr; }
.lc__x { grid-column: 2; grid-row: 2; position: relative; height: 26px; color: var(--v-muted); font-size: 11.5px; }
.lc__x span { position: absolute; top: 10px; left: var(--x); transform: translateX(-50%); white-space: nowrap; line-height: 1; }
.lc__x span:first-child { transform: translateX(-100%); }
.lc__x span:last-child { transform: none; }

/* marks over the plot, placed in % so they stay round however the plot stretches */
.lc__dot { position: absolute; left: var(--x); top: var(--y); width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--v-cur); box-shadow: 0 0 0 2px #fff; pointer-events: none; }
.lc__dot--end::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1.5px solid var(--v-cur); opacity: 0; }
.lc__note { position: absolute; left: var(--x); top: var(--y); transform: translate(14px, -6px); display: grid; gap: 1px; background: var(--v-ink); color: #fff; border-radius: 10px; padding: 7px 11px; font-size: 11.5px; line-height: 1.35; white-space: nowrap; pointer-events: none; }
.lc__note b { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.lc__note small { color: #CFC8C0; font-size: 11px; }

/* hover / keyboard read-out: crosshair snapped to the day, one tooltip for both periods */
.lc__hit { position: absolute; inset: 0; cursor: crosshair; touch-action: pan-y; }
.lc__cross { position: absolute; top: 0; bottom: 0; left: var(--x); width: 1px; background: #CFC6BA; pointer-events: none; }
.lc__hdot { position: absolute; left: var(--x); top: var(--y); width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; box-shadow: 0 0 0 2px #fff; pointer-events: none; }
.lc__hdot--cur { background: var(--v-cur); }
.lc__hdot--prev { background: var(--v-prev); }
.lc__tip { position: absolute; top: 6px; left: var(--x); transform: translateX(12px); min-width: 168px; background: #fff; border-radius: 12px; padding: 10px 12px; display: grid; gap: 6px; box-shadow: 0 1px 2px rgb(0 0 0 / .06), 0 16px 36px -14px rgb(43 43 43 / .32); font-size: 12px; pointer-events: none; z-index: 2; }
.lc__tip.is-flip { transform: translateX(calc(-100% - 12px)); }
.lc__tip > b { font: 500 12px/1.3 var(--font-text); color: var(--v-muted); }
.lc__tip p { display: flex; align-items: center; gap: 8px; }
.lc__tip strong { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--v-ink); }
.lc__tip span { color: var(--v-muted); margin-inline-start: auto; }
.lc.is-reading .lc__note { opacity: 0 !important; transition: opacity .15s ease; }   /* the read-out replaces the note while it is open */
.lc:focus-visible { outline: 2px solid var(--v-cur); outline-offset: 6px; border-radius: 8px; }
@media (max-width: 639px) {
  .lc__x span:nth-child(2), .lc__x span:nth-child(4), .lc__x span:nth-child(5) { display: none; }
}

/* ------------------------------------------------------------------ ranked bars (rb) */
.viz-toggle { display: inline-flex; background: var(--p-bg, #FFF8F0); border-radius: 999px; padding: 3px; gap: 2px; }
.viz-toggle button { font: inherit; font-size: 13px; border: 0; background: transparent; color: var(--v-muted); border-radius: 999px; padding: 6px 12px; cursor: pointer; min-height: 32px; transition: background-color .15s ease, color .15s ease; }
.viz-toggle button[aria-pressed="true"] { background: var(--v-ink); color: var(--p-bg, #FFF8F0); }
.viz-toggle button:focus-visible { outline: 2px solid var(--v-cur); outline-offset: 2px; }
.rb { display: grid; gap: 14px; }
.rb li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: 4px 12px; }
.rb__name { font-size: 14px; color: var(--v-ink); }
.rb__val { font-size: 14px; font-weight: 600; white-space: nowrap; }
.rb__pct { font-size: 12.5px; color: var(--v-muted); min-width: 42px; text-align: end; font-variant-numeric: tabular-nums; }
.rb__bar { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: var(--p-bg, #FFF8F0); overflow: hidden; }
.rb__bar i { display: block; height: 100%; width: var(--v); border-radius: inherit; background: var(--v-rest); transform-origin: 100% 50%; }
.rb li:first-child .rb__bar i { background: var(--v-cur); }

/* ------------------------------------------------------------------ ring meter */
.ring { position: relative; width: min(100%, 196px); aspect-ratio: 1; margin-inline: auto; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 11; }
.ring__track { stroke: var(--v-soft); }
.ring__arc { stroke: var(--v-cur); stroke-linecap: round; stroke-dasharray: 100 100; stroke-dashoffset: calc(100 - var(--v)); }
.ring__mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 2px; }
.ring__mid b { font: 600 clamp(30px, 3vw, 40px)/1 var(--font-text); }
.ring__mid small { color: var(--v-muted); font-size: 12.5px; }
/* the ring beside its figures (the collection card), or over them (the margin card) */
.ring-row { display: grid; grid-template-columns: minmax(112px, 150px) minmax(0, 1fr); align-items: center; gap: clamp(16px, 2vw, 28px); }
.ring-row .ring { width: 100%; }
.ring-row .ring__mid b { font-size: clamp(24px, 2.4vw, 32px); }
.viz-card > figcaption:not(.viz-head) { display: grid; gap: 2px; }

/* a thin meter: one ratio against its whole */
.meter { height: 8px; border-radius: 99px; background: var(--v-soft); overflow: hidden; }
.meter i { display: block; height: 100%; width: var(--v); border-radius: inherit; background: var(--v-cur); transform-origin: 100% 50%; }

/* ------------------------------------------------------------------ accounts: stock (stk) */
.stk { display: grid; }
.stk-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; padding: 14px 0; border-top: 1px solid var(--v-grid); }
.stk-row:first-child { border-top: 0; padding-top: 0; }
.stk-row b { font-weight: 500; font-size: 14.5px; }
.stk-row b code { font: 500 12px/1 var(--font-text); color: var(--v-muted); margin-inline-start: 8px; unicode-bidi: isolate; }
.stk-row em { font-style: normal; font-size: 13px; color: var(--v-muted); white-space: nowrap; }
.stk-row em strong { color: var(--v-ink); font-weight: 600; }
.stk-seg { grid-column: 1 / -1; display: flex; gap: 2px; height: 10px; }
.stk-seg i { display: block; height: 100%; border-radius: 3px; }
.stk-seg i:first-child { border-start-start-radius: 99px; border-end-start-radius: 99px; }
.stk-seg i:last-child { border-start-end-radius: 99px; border-end-end-radius: 99px; }
.stk-seg .is-res { background: var(--v-cur); width: var(--v); flex: none; }
.stk-seg .is-free { background: var(--v-rest); flex: 1; }
.stk-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--v-muted); }
.stk-meta span { font-variant-numeric: tabular-nums; }
.viz-flag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--v-bad); background: #FBEAE8; border-radius: 999px; padding: 1px 8px; }
.viz-flag--ok { color: var(--v-good); background: #EAF4EE; }
.viz-flag svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* a receipt: the stock and the average cost before and after */
.rcv { display: grid; gap: 12px; }
.rcv__line { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--v-muted); }
.rcv__line strong { color: var(--v-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.rcv__step { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--p-bg, #FFF8F0); }
.rcv__step > div { display: grid; gap: 2px; }
.rcv__step > div:last-child { text-align: end; }
.rcv__step small { color: var(--v-muted); font-size: 12px; }
.rcv__step b { font: 600 18px/1.2 var(--font-text); font-variant-numeric: tabular-nums; }
.rcv__step > div:last-child b { color: var(--p-accent-text, #C04C0E); }
.rcv__arrow { width: 28px; height: 12px; fill: none; stroke: var(--v-muted); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transform: scaleX(-1); }
.rcv__formula { font-size: 12.5px; color: var(--v-muted); text-align: start; font-variant-numeric: tabular-nums; }

/* a short ledger list: expenses, stock adjustments */
.xp { display: grid; }
.xp-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--v-grid); }
.xp-row:first-child { border-top: 0; padding-top: 0; }
.xp-row time, .xp-row .xp-tag { font-size: 12px; color: var(--v-muted); white-space: nowrap; min-width: 62px; }
.xp-row div { display: grid; min-width: 0; }
.xp-row div b { font-weight: 500; font-size: 14px; }
.xp-row div small { color: var(--v-muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xp-row em { font-style: normal; font-weight: 600; font-size: 14px; white-space: nowrap; }
.xp-row.is-void em { color: var(--v-muted); font-weight: 400; position: relative; }
.xp-row.is-void em::after { content: ""; position: absolute; inset-inline: -2px; top: 52%; height: 1.5px; background: var(--v-bad); transform-origin: 100% 50%; }
.xp-row.is-void small { color: var(--v-bad); }
.xp-row.is-void s { text-decoration: none; }   /* the strike is drawn by ::after, so it can be animated */
.xp-row.is-new { background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--v-cur) 8%, transparent) 30%, color-mix(in srgb, var(--v-cur) 8%, transparent) 70%, transparent); }
.qty-in { color: var(--v-good); }
.qty-out { color: var(--v-bad); }

/* ------------------------------------------------------------------ waterfall (wf) */
.wf { --wf-h: clamp(200px, 22vw, 260px); --bw: clamp(18px, 2.4vw, 24px); display: grid; gap: 10px; }
.wf__plot { position: relative; height: var(--wf-h); display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-bottom: 1px solid #DCD4C8; margin-top: 26px; }
.wf__plot::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(to top, var(--v-grid) 0 1px, transparent 1px 25%); pointer-events: none; }
.wf__col { position: relative; }
.wf__bar { position: absolute; left: 50%; width: var(--bw); margin-left: calc(var(--bw) / -2); bottom: var(--b); height: max(var(--h), 2px); border-radius: 4px 4px 0 0; background: var(--v-ink); transform-origin: 50% 100%; }
.wf__col.is-minus .wf__bar { background: var(--v-rest); border-radius: 0 0 4px 4px; transform-origin: 50% 0; }
.wf__col.is-net .wf__bar { background: var(--v-cur); }
.wf__val { position: absolute; left: 50%; bottom: calc(var(--b) + var(--h)); transform: translate(-50%, -6px); font-size: 12px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wf__col.is-minus .wf__val { color: var(--v-muted); font-weight: 500; }
.wf__val .s { display: none; }
.wf__link { position: absolute; bottom: var(--top); height: 1px; background: #BDB3A6; left: calc(50% + var(--bw) / 2); width: calc(100% - var(--bw)); }
.wf__names { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); font-size: 12.5px; color: var(--v-muted); text-align: center; line-height: 1.35; }
.wf__names span { padding-inline: 4px; }
.wf__names .is-key { color: var(--v-ink); font-weight: 600; }
@media (max-width: 639px) {
  .wf__val .f { display: none; }
  .wf__val .s { display: inline; }
  .wf__names { font-size: 11px; }
}
/* the right-to-left reading of the waterfall: the first step at the start (right) */
[dir="rtl"] .wf__link { left: auto; right: calc(50% + var(--bw) / 2); }

/* ------------------------------------------------------------------ panels of the accounts board */
.viz-panel[hidden] { display: none; }

/* ------------------------------------------------------------------ motion (viz.js adds html.viz-on) */
/* the start state is set without transitions (viz.js rewind) */
[data-viz].is-reset, [data-viz].is-reset *, [data-viz].is-reset *::after { transition: none !important; animation: none !important; }

@media (prefers-reduced-motion: no-preference) {
  /* clip-path only interpolates between two shapes, so the drawn state is a shape too, not none */
  html.viz-on :is(.lc__cur, .lc__prev, .stk-seg) { clip-path: inset(0 0 0 0); }
  html.viz-on .viz-card { transition: opacity .7s var(--v-ease), transform .9s var(--v-ease); transition-delay: calc(var(--i, 0) * 90ms); }
  html.viz-on [data-viz]:not(.is-in) .viz-card { opacity: 0; transform: translateY(22px); }

  /* the line draws from the oldest day (the right edge) to today; the comparison follows it */
  html.viz-on .lc__cur, html.viz-on .lc__prev { transition: clip-path 1.7s cubic-bezier(.45, .05, .25, 1); }
  html.viz-on .lc__cur { transition-delay: .35s; }
  html.viz-on .lc__prev { transition-delay: .2s; }
  html.viz-on [data-viz]:not(.is-in) :is(.lc__cur, .lc__prev) { clip-path: inset(0 0 0 100%); }
  html.viz-on .lc__dot, html.viz-on .lc__note { transition: opacity .4s ease, scale .5s var(--v-ease); transition-delay: 1.9s; }
  html.viz-on .lc__dot--peak, html.viz-on .lc__note { transition-delay: 1.35s; }
  html.viz-on [data-viz]:not(.is-in) :is(.lc__dot, .lc__note) { opacity: 0; scale: .4; }
  [data-viz].is-in .lc__dot--end::after { animation: viz-ping 2.6s ease-out 2.4s infinite; }
  [data-viz].is-in .lc__note { animation: viz-float 5s ease-in-out 2.2s infinite; }
  [data-viz].is-in .viz-live::before { animation: viz-live 2s ease-out infinite; }

  /* bars grow from the start side, one after another */
  html.viz-on :is(.rb__bar i, .meter i) { transition: transform 1.1s var(--v-ease); transition-delay: calc(.45s + var(--j, 0) * 90ms); }
  html.viz-on [data-viz]:not(.is-in) :is(.rb__bar i, .meter i), html.viz-on .rb.is-swap .rb__bar i { transform: scaleX(0); }
  html.viz-on .stk-seg { transition: clip-path 1.1s var(--v-ease); transition-delay: calc(.4s + var(--j, 0) * 110ms); }
  html.viz-on [data-viz]:not(.is-in) .stk-seg { clip-path: inset(0 0 0 100%); }

  /* the ring sweeps to its share */
  html.viz-on .ring__arc { transition: stroke-dashoffset 1.6s var(--v-ease) .5s; }
  html.viz-on [data-viz]:not(.is-in) .ring__arc { stroke-dashoffset: 100; }

  /* the waterfall: each step falls or rises from where the last one ended */
  html.viz-on .wf__bar { transition: transform .8s var(--v-ease); transition-delay: calc(.35s + var(--j, 0) * 170ms); }
  html.viz-on .wf__val, html.viz-on .wf__link { transition: opacity .4s ease; transition-delay: calc(.8s + var(--j, 0) * 170ms); }
  html.viz-on [data-viz]:not(.is-in) .wf__bar { transform: scaleY(0); }
  html.viz-on [data-viz]:not(.is-in) :is(.wf__val, .wf__link) { opacity: 0; }

  /* lists: rows slide in; a voided amount is struck through after it lands */
  html.viz-on :is(.xp-row, .stk-row, .sp__item) { transition: opacity .5s ease, transform .7s var(--v-ease); transition-delay: calc(.3s + var(--j, 0) * 80ms); }
  html.viz-on [data-viz]:not(.is-in) :is(.xp-row, .stk-row, .sp__item) { opacity: 0; transform: translateX(-14px); }
  html.viz-on .xp-row.is-void em::after { transition: transform .5s var(--v-ease) 1.1s; }
  html.viz-on [data-viz]:not(.is-in) .xp-row.is-void em::after { transform: scaleX(0); }
  [data-viz].is-in .xp-row.is-new { animation: viz-flash 2.4s ease-out 1s both; }
}

@keyframes viz-ping { 0% { opacity: .7; transform: scale(.6); } 80%, 100% { opacity: 0; transform: scale(2.2); } }
@keyframes viz-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
@keyframes viz-live { 0% { box-shadow: 0 0 0 0 rgb(31 122 69 / .45); } 100% { box-shadow: 0 0 0 8px rgb(31 122 69 / 0); } }
@keyframes viz-flash { 0% { background-color: color-mix(in srgb, var(--v-cur) 16%, transparent); } 100% { background-color: transparent; } }

/* the phone: tighter cards, the KPI pair kept side by side */
@media (max-width: 639px) {
  .viz-board { border-radius: 22px; }
  .viz-card { --v-card-r: 16px; gap: 14px; }
  .viz-bar { padding-bottom: 10px; }
  .viz-bar .viz-crumb, .viz-bar .viz-seg { display: none; }
  .viz-bar__end { margin-inline-start: 0; }
  .viz-fig--md { font-size: 22px; }
  .rcv__step b { font-size: 16px; }
  .lc__note { display: none; }                                  /* the plot is too narrow to carry it; the tooltip has the day */
  .ring-row { grid-template-columns: minmax(0, 1fr); }
  .ring-row .ring { width: min(100%, 160px); justify-self: center; }
}


/* ------------------------------------------------------------------ the hero: three data cards overlapping
   The season's weekly net sales, today's orders and one customer's credit limit, laid over each other on a
   warm plate. The stage keeps one shape (0.94 wide for 1 tall) inside whatever box the hero gives it, and
   everything in it is sized in its own width (cqw), so the composition scales as one picture.
   On a wide screen a loop (ui.loop, with the kit's pause button) confirms order 1042 and the WhatsApp
   message goes out, then the picture comes back; the cards drift a few pixels while it runs. */
.hero-viz { container: hero / size; color: var(--v-ink); font: 400 14px/1.5 var(--font-text); }
.hv-stage { position: absolute; inset: 0; margin: auto; width: min(100cqw, 94cqh); height: min(100cqh, 106.4cqw); container: stage / inline-size; }
.hv-plate { position: absolute; inset: 10% 3% 6% 10%; border-radius: 6cqw; background: var(--p-surface, #EFE7DD); }
.hv { position: absolute; padding: 3.6cqw; gap: 2cqw; border: 1px solid rgb(43 43 43 / .07);
      box-shadow: 0 1px 2px rgb(43 43 43 / .05), 0 5cqw 9cqw -5cqw rgb(43 43 43 / .32); --v-card-r: 3.4cqw; }
.hv .viz-label { font-size: max(11px, 2.1cqw); line-height: 1.4; }
.hv .viz-fig { font-size: max(20px, 5.6cqw); margin-top: .8cqw; }
.hv .viz-fig--md { font-size: max(18px, 4.6cqw); margin-top: 0; }
.hv .viz-delta { font-size: max(11px, 1.95cqw); gap: 1.2cqw; }
.hv .viz-delta b { padding: .3cqw 1.4cqw .3cqw 1.2cqw; }
.hv .viz-delta svg { width: max(10px, 1.9cqw); height: max(10px, 1.9cqw); }
.hv .viz-legend { font-size: max(10.5px, 1.9cqw); gap: 1cqw 3cqw; }
.hv .k--cur, .hv .k--prev { width: 2.8cqw; }

/* the season: the largest card, on the start side at the top */
.hv--season { top: 2%; inset-inline-start: 0; width: 72%; z-index: 1; }
.hv-day { background: var(--p-bg, #FFF8F0); color: var(--v-muted); border-radius: 999px; padding: .6cqw 2cqw; font-size: max(10.5px, 1.9cqw); white-space: nowrap; }
.lc--mini { --lc-h: 21cqw; grid-template-columns: minmax(0, 1fr); column-gap: 0; }
.lc--mini .lc__plot, .lc--mini .lc__x { grid-column: 1; }
.lc--mini .lc__x { height: 4.2cqw; font-size: max(10px, 1.8cqw); }
.lc--mini .lc__x span { top: 1.6cqw; }
.hero-viz .lc__tip { min-width: 150px; }

/* the credit limit: a ring on the far side, over the season's corner */
/* (it overlaps the season card only by that card's padding, so the newest week stays in sight) */
.hv--credit { top: 34%; inset-inline-end: 0; width: 31%; z-index: 2; justify-items: center; text-align: center; }
.hv--credit .viz-label { justify-self: stretch; text-align: start; }
.hv--credit .ring { width: 72%; }
.hv--credit .ring circle { stroke-width: 12; }
.hv--credit .ring__mid b { font-size: max(16px, 4.2cqw); }
.hv--credit .ring__mid small { font-size: max(10px, 1.7cqw); }
.hv-foot { display: flex; justify-content: space-between; gap: 2cqw; justify-self: stretch; color: var(--v-muted); font-size: max(10.5px, 1.8cqw); border-top: 1px solid var(--v-grid); padding-top: 1.6cqw; }

/* today's orders: over the season's foot */
.hv--orders { top: 50%; inset-inline-start: 5%; width: 60%; z-index: 3; }
.hv-orders__head { display: flex; justify-content: space-between; align-items: center; gap: 2cqw; }
.hv-rows { display: grid; }
.hv-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 1.8cqw; padding: 1.6cqw 1.2cqw; margin-inline: -1.2cqw; border-top: 1px solid var(--v-grid); border-radius: 1.6cqw; transition: background-color .35s ease; font-size: max(11px, 2.2cqw); }
.hv-row .ui-avatar { --u-bg: #fff; --u-ink: var(--v-ink); width: max(22px, 4.6cqw); height: max(22px, 4.6cqw); font-size: max(11px, 2.1cqw); }
.hv-row div { display: grid; min-width: 0; }
.hv-row b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hv-row small { color: var(--v-muted); font-size: max(10px, 1.8cqw); }
.hv-row em { font-style: normal; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hv-st { display: inline-grid; justify-items: end; min-width: 11cqw; }
.hv-st > i { grid-area: 1 / 1; display: inline-flex; align-items: center; gap: .6cqw; font-style: normal; font-weight: 600; font-size: max(10px, 1.75cqw); border-radius: 999px; padding: .4cqw 1.6cqw; white-space: nowrap; transition: opacity .3s ease, transform .4s var(--v-ease); }
.hv-st svg { width: max(9px, 1.6cqw); height: max(9px, 1.6cqw); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hv-st__new { background: #FCE9DD; color: var(--p-accent-text, #C04C0E); }
.hv-st__work { background: var(--p-bg, #FFF8F0); color: var(--v-muted); }
.hv-st__ok { background: #EAF4EE; color: var(--v-good); opacity: 0; transform: translateY(40%); }
.hero-viz.is-confirm .hv-row.is-lead { background: color-mix(in srgb, var(--v-cur) 7%, transparent); }
.hero-viz.is-confirm .is-lead .hv-st__new { opacity: 0; transform: translateY(-40%); }
.hero-viz.is-confirm .is-lead .hv-st__ok { opacity: 1; transform: none; }

/* the WhatsApp message the confirmation sends: only while the loop runs */
.hv-msg { position: absolute; bottom: 4%; inset-inline-end: 1%; width: 33%; z-index: 4; display: grid; gap: .8cqw; background: #fff; border: 1px solid rgb(43 43 43 / .07); border-radius: 3cqw 3cqw 3cqw .8cqw; padding: 2.4cqw 2.8cqw; font-size: max(11px, 2cqw); line-height: 1.5; box-shadow: 0 4cqw 8cqw -4cqw rgb(43 43 43 / .3); opacity: 0; transform: translateY(2cqw) scale(.96); transform-origin: 0 100%; transition: opacity .35s ease, transform .55s var(--v-ease); }
.hv-msg p { margin: 0; }
.hv-msg__from { color: var(--v-good); font-weight: 600; font-size: max(10px, 1.75cqw); }
.hv-msg small { justify-self: end; color: var(--v-muted); font-size: max(10px, 1.6cqw); }
.hero-viz.is-sent .hv-msg { opacity: 1; transform: none; }
/* the kit's pause button: the box's top far corner is the one no card covers at any width */
.hero-viz > button.loop-pause.loop-pause { right: auto; bottom: auto; left: 12px; top: 12px; }

@media (prefers-reduced-motion: no-preference) {
  html.viz-on .hero-viz .viz-card { transition-delay: calc(.25s + var(--i, 0) * 160ms); }
  html.viz-on .hero-viz[data-viz]:not(.is-in) .viz-card { transform: translateY(5cqw) scale(.97); }
  .hero-viz.is-in.is-live .hv--season { animation: viz-float 7s ease-in-out 2s infinite; }
  .hero-viz.is-in.is-live .hv--credit { animation: viz-float 6s ease-in-out 2.6s infinite; }
  .hero-viz.is-in.is-live .hv--orders { animation: viz-float 8s ease-in-out 3.2s infinite; }
}

/* a narrow stage (the 1024-1279 split): the small print goes, the figures stay */
@container stage (max-width: 520px) {
  .hv-foot, .hv--credit .ring__mid small, .hv-day, .hv-row:nth-child(3) { display: none; }
  .hv--credit .ring { width: 86%; }
  /* the orders card to the start edge and the message beside it, never over the status it confirms */
  .hv--orders { top: auto; bottom: 2%; inset-inline-start: 0; width: 58%; }
  .hv-msg { width: 39%; bottom: 3%; }
}

/* the phone: the season card and the credit ring only, the ring over the card's top corner. The card fills
   the box the hero leaves it and its chart takes what the words leave, so a short phone never overflows */
@media (max-width: 639px) {
  .hv-stage { width: 100cqw; height: 100cqh; }
  .hv-plate { inset: 14% 0 0 8%; border-radius: 22px; }
  .hv--season { top: 16%; bottom: 0; width: 100%; padding: 16px; gap: 10px; --v-card-r: 18px; grid-template-rows: auto auto minmax(0, 1fr) auto; }
  .hv--season .hv-day { display: none; }
  .hv .viz-fig { font-size: 24px; }
  .hero-viz .lc--mini { grid-template-rows: minmax(0, 1fr) auto; min-height: 0; }
  .hv--orders, .hv-msg { display: none; }
  .hv--credit { top: 0; width: 30%; padding: 10px; gap: 6px; --v-card-r: 16px; }
  .hv--credit .viz-label, .hv-foot { display: none; }
  .hv--credit .ring { width: 100%; }
  .hv--credit .ring__mid small { display: none; }
}
/* a short phone (the hero leaves the picture under 300px): the figure and its line, nothing over them */
@container hero (max-height: 300px) {
  .hv-plate, .hv--credit, .hv--season .viz-delta, .hv--season .viz-legend { display: none; }
  .hv--season { top: 0; grid-template-rows: auto minmax(0, 1fr); }
}


/* ------------------------------------------------------------------ request: the store the form leads to
   The merchant's store as a customer opens it, and the cart under it filling toward the store's minimum
   order (3,000.00, as in the prices section), on the same warm plate as the boards. */
.sp-viz { margin-top: var(--s-7, 48px); max-width: 460px; display: grid; background: var(--p-surface, #EFE7DD); border-radius: 28px; padding: clamp(12px, 1.6vw, 18px); color: var(--v-ink); font: 400 14px/1.5 var(--font-text); }
.sp { gap: 14px; padding: 20px 20px 56px; border: 1px solid rgb(43 43 43 / .06); }
.sp svg { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sp__bar { display: flex; justify-content: center; }
.sp__url { display: inline-flex; align-items: center; gap: 6px; background: var(--p-bg, #FFF8F0); border-radius: 999px; padding: 5px 14px; font-size: 12.5px; color: var(--v-muted); }
.sp__url svg { width: 12px; height: 12px; }
.sp__head { display: flex; gap: 12px; align-items: center; }
.sp__head b { display: block; font: 500 16px/1.35 var(--font-display); }
.sp__head small { color: var(--v-muted); font-size: 12.5px; }
.sp__logo { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--v-ink); color: var(--p-bg, #FFF8F0); font: 700 19px/1 var(--font-display); }
.sp__search { display: flex; align-items: center; gap: 8px; background: var(--p-bg, #FFF8F0); border-radius: 999px; padding: 10px 16px; color: var(--v-muted); font-size: 14px; }
.sp__search svg { width: 15px; height: 15px; }
.sp__cats { display: flex; flex-wrap: wrap; gap: 6px; }
.sp__cats span { background: var(--p-bg, #FFF8F0); color: var(--v-muted); border-radius: 999px; padding: 5px 12px; font-size: 13px; }
.sp__cats .is-on { background: var(--v-ink); color: var(--p-bg, #FFF8F0); }
.sp__items { display: grid; }
.sp__item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--v-grid); }
.sp__item:last-child { padding-bottom: 0; }
.sp__item div { display: grid; min-width: 0; }
.sp__item b { font-weight: 500; }
.sp__item small { color: var(--v-muted); font-size: 12.5px; }
.sp__item em { font-style: normal; font-weight: 600; font-size: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sp__item em small { font-weight: 400; font-size: 12px; }
.sp__add { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 18px; line-height: 1; background: var(--p-action, #C84D0A); color: var(--p-action-ink, #fff); }
/* the cart hangs over the store card's foot, on the end side, covering only its padding */
.sp-cart { position: relative; z-index: 1; margin-top: -40px; margin-inline-start: auto; margin-inline-end: 14px; width: min(74%, 300px); gap: 10px; padding: 16px 18px; border: 1px solid rgb(43 43 43 / .07); box-shadow: 0 26px 44px -26px rgb(43 43 43 / .38); }
.sp-cart__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sp-cart__sum { font: 600 20px/1.2 var(--font-text); white-space: nowrap; }
.sp-cart__sum small { color: var(--v-muted); font-size: 12px; font-weight: 400; }
.sp-cart__note { color: var(--v-muted); font-size: 12.5px; }
.sp-cart__note b { color: var(--p-accent-text, #C04C0E); font-weight: 600; }
@media (prefers-reduced-motion: no-preference) {
  /* the first item's add button answers once, when the cart has counted up to it */
  [data-viz].is-in .sp__item:first-child .sp__add { animation: viz-tap .6s var(--v-ease) 1.2s both; }
}
@keyframes viz-tap { 0%, 100% { scale: 1; } 40% { scale: .86; } 70% { scale: 1.08; } }
@media (max-width: 639px) {
  .sp-viz { max-width: none; border-radius: 22px; }
  .sp { padding: 16px 16px 52px; }
  .sp-cart { width: min(88%, 320px); margin-inline-end: 8px; }
}


/* ------------------------------------------------------------------ tabs that turn by themselves (accounts)
   viz.js moves the accounts tabs on every --rotate (3 s): a thin orange line fills under the open tab, and
   its end opens the next one. A tab the visitor picks, or the pause button beside the tabs, stops it; it waits
   while the board is off screen or a tab has the keyboard focus. Not under reduced motion. */
.tabs-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2, 8px); }
.tabs[data-rotate] .tab { position: relative; }
.tab-timer { display: none; }
.tabs.is-rotating .tab-timer { display: block; position: absolute; inset-inline: 12px; bottom: 5px; height: 2px; border-radius: 2px; overflow: hidden; background: rgb(255 248 240 / .2); pointer-events: none; }
.tabs.is-rotating .tab:not([aria-selected="true"]) .tab-timer { visibility: hidden; }
.tab-timer i { display: block; height: 100%; background: var(--p-accent, #E8590C); transform: scaleX(0); transform-origin: 100% 50%; }
.tabs.is-rotating .tab[aria-selected="true"] .tab-timer i { animation: viz-timer var(--rotate, 3s) linear forwards; }
.tabs.is-held .tab-timer i { animation-play-state: paused !important; }
@keyframes viz-timer { to { transform: scaleX(1); } }
.tab-auto { width: 36px; height: 36px; flex: none; display: grid; place-items: center; padding: 0; border-radius: 50%; border: 1px solid var(--line, #DCD4C8); background: transparent; color: var(--ink, #2B2B2B); cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
.tab-auto:hover { border-color: var(--line-strong, #BDB3A6); }
.tab-auto:focus-visible { outline: 2px solid var(--ink, #2B2B2B); outline-offset: 2px; }
.tab-auto svg { width: 12px; height: 12px; fill: currentColor; }
.tab-auto .i-play, .tab-auto.is-off .i-pause { display: none; }
.tab-auto.is-off .i-play { display: block; }

/* the three panels share one place, so the page keeps its height while they turn; the one leaving fades.
   (!important: system.css hides every [hidden] with !important; these stay laid out and are only unseen) */
:is(#accounts .acc-board, #prices .pr-board) { display: grid; }
:is(#accounts .acc-board, #prices .pr-board) > .viz-panel { grid-area: 1 / 1; transition: opacity .35s ease, visibility 0s; }
:is(#accounts .acc-board, #prices .pr-board) > .viz-panel[hidden] { display: block !important; visibility: hidden; opacity: 0; transition: opacity .35s ease, visibility 0s .35s; }
/* every panel takes the tallest one's height: its cards stretch to the plate's foot, the waterfall's plot grows
   into the room and the margin card spreads its parts, so a shorter panel never leaves an empty band */
:is(#accounts, #prices) .viz-panel { display: grid; grid-template-rows: auto minmax(0, 1fr); }
#accounts .viz-panel > .viz-grid { align-content: stretch; }
#accounts .viz-card:has(> .wf) { grid-template-rows: auto minmax(0, 1fr); }
#accounts .wf { grid-template-rows: minmax(var(--wf-h), 1fr) auto; }
#accounts .wf__plot { height: auto; }
#acc-screen-3 .viz-card:has(> .ring) { align-content: space-between; }
:is(#accounts, #prices) .tab-panels { display: grid; }
:is(#accounts, #prices) .tab-panels > [role="tabpanel"] { grid-area: 1 / 1; }
:is(#accounts, #prices) .tab-panels > [role="tabpanel"][hidden] { display: block !important; visibility: hidden; }


/* ------------------------------------------------------------------ the customer prices: one panel per customer
   The item as that customer sees it in the store: its price (counting down from the base price to theirs),
   the price ladder by quantity against the base ladder (dashed), every step labelled, and the rule it comes
   from on a card over the foot. The tabs turn by themselves like the accounts ones. */
.pr-board { margin-top: 0; align-self: start; }
.pr-card { gap: 14px; padding-bottom: 56px; }
.pr-card .viz-title { margin-top: 2px; }
.pr-who { display: inline-flex; align-items: center; gap: 8px; background: var(--p-bg, #FFF8F0); border-radius: 999px; padding: 4px 12px 4px 6px; font-size: 13px; white-space: nowrap; }
.pr-who .ui-avatar { --u-bg: #fff; --u-ink: var(--v-ink); width: 24px; height: 24px; font-size: 12px; }
.pr-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.pr-price .viz-fig { font-size: clamp(30px, 3vw, 40px); }
.pr-price__note { color: var(--v-muted); font-size: 13px; }
.pr-price .viz-delta { flex-basis: 100%; }
.viz-delta.is-flat b { background: var(--p-bg, #FFF8F0); color: var(--v-ink); }
.viz-delta.is-flat s { color: var(--v-muted); font-weight: 500; margin-inline-start: 4px; }
.pl { --lc-h: clamp(120px, 12vw, 150px); }
.pl .lc__plot path { stroke-linejoin: miter; stroke-linecap: butt; }
.pl .lc__x { height: 26px; font-size: 11.5px; }   /* the hero's mini chart sizes these in its stage's cqw; here there is no stage */
.pl .lc__x span { top: 10px; }
.pl .lc__x span:first-child { transform: translateX(-50%); }
.pl .lc__x span:last-child { color: var(--v-ink); }
.pl__val { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, calc(-100% - 6px)); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--v-ink); white-space: nowrap; pointer-events: none; }
/* under its step where the base ladder runs close above it, so a label never sits on the dashed line */
.pl__val.is-below { transform: translate(-50%, 7px); }
.pr-rule { position: relative; z-index: 1; margin-top: -40px; margin-inline-start: auto; margin-inline-end: 14px; width: min(78%, 340px); display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid rgb(43 43 43 / .07); box-shadow: 0 26px 44px -26px rgb(43 43 43 / .38); }
.pr-rule b { display: block; font-weight: 600; font-size: 14px; }
.pr-rule small { color: var(--v-muted); font-size: 12.5px; line-height: 1.45; }
.pr-rule__mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #FCE9DD; color: var(--p-accent-text, #C04C0E); }
.pr-rule__mark svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
@media (prefers-reduced-motion: no-preference) {
  html.viz-on .pl__val { transition: opacity .4s ease; transition-delay: 1.5s; }
  html.viz-on [data-viz]:not(.is-in) .pl__val { opacity: 0; }
}
@media (max-width: 639px) {
  .pr-rule { width: auto; margin-inline: 10px; }
  .pl .lc__x span { display: inline; }   /* four short ticks fit; the line chart's phone rule hides three */
}


/* ------------------------------------------------------------------ the orders board
   The day's orders with their states, and order 1042 open: the order's states as a track, its lines with
   the short one measured against the stock, and its total. From 640px the confirmation loop (viz.js) presses
   «تأكيد»: the row turns «اتأكد» and the track moves one step, then the picture comes back. */
.ord-board { position: relative; }
.ord-board > .ord-stage > .viz-bar { padding-inline-end: 52px; }
.ord-board > button.loop-pause.loop-pause { right: auto; bottom: auto; left: 16px; top: 14px; }
.ord-search svg { width: 14px; height: 14px; }
.ord-list { padding: 10px clamp(10px, 1.2vw, 16px); }
.ord-rows { display: grid; }
.ord-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 10px; padding: 12px 10px; border-top: 1px solid var(--v-grid); border-radius: 12px; transition: background-color .35s ease; }
.ord-row:first-child { border-top-color: transparent; }
.ord-row.is-sel { background: color-mix(in srgb, var(--v-cur) 7%, transparent); border-top-color: transparent; }
.ord-row.is-sel + .ord-row { border-top-color: transparent; }
.ord-row .ui-avatar { --u-bg: #fff; --u-ink: var(--v-ink); width: 32px; height: 32px; font-size: 13px; }
.ord-row div { display: grid; min-width: 0; }
.ord-row b { font-weight: 500; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ord-row small { color: var(--v-muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ord-row em { font-style: normal; font-weight: 600; font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ord-row time { color: var(--v-muted); font-size: 12px; min-width: 22px; text-align: end; }
.ord-st { display: inline-grid; justify-items: end; min-width: 74px; }
.st { grid-area: 1 / 1; display: inline-flex; align-items: center; gap: 4px; font-style: normal; font-weight: 600; font-size: 12px; border-radius: 999px; padding: 3px 9px 3px 8px; white-space: nowrap; transition: opacity .3s ease, transform .4s var(--v-ease); }
.st svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.st svg .fill { fill: currentColor; stroke: none; }
.st--new { background: #FCE9DD; color: var(--p-accent-text, #C04C0E); }
.st--work { background: var(--p-bg, #FFF8F0); color: var(--v-ink); box-shadow: inset 0 0 0 1px var(--v-grid); }
.st--done { background: #F3EEE8; color: var(--v-muted); }
.st--ok { background: #EAF4EE; color: var(--v-good); opacity: 0; transform: translateY(40%); }
.ord-board.is-confirm .ord-row.is-lead .st--new { opacity: 0; transform: translateY(-40%); }
.ord-board.is-confirm .ord-row.is-lead .st--ok { opacity: 1; transform: none; }

.ord-open { gap: 18px; }
.ord-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.ord-who { display: flex; align-items: center; gap: 12px; }
.ord-who .ui-avatar { --u-bg: #fff; --u-ink: var(--v-ink); width: 40px; height: 40px; font-size: 15px; }
.ord-who b { display: block; font: 500 22px/1.15 var(--font-display); }
.ord-who small { color: var(--v-muted); font-size: 13px; }
.ord-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.ord-btn { display: inline-grid; align-items: center; height: 34px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--v-grid); font-size: 13px; color: var(--v-ink); white-space: nowrap; }
.ord-btn.is-main { background: var(--p-action, #C84D0A); color: var(--p-action-ink, #fff); border-color: transparent; transition: background-color .3s ease, transform .2s ease; }
.ord-btn.is-main > i { grid-area: 1 / 1; display: inline-flex; align-items: center; justify-content: center; gap: 4px; font-style: normal; transition: opacity .25s ease; }
.ord-btn.is-main svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ord-btn__done { opacity: 0; }
.ord-board.is-confirm .ord-btn.is-main { background: #EAF4EE; color: var(--v-good); }
.ord-board.is-confirm .ord-btn__go { opacity: 0; }
.ord-board.is-confirm .ord-btn__done { opacity: 1; }

/* the order's states: five stops on a track, the reached part in orange (start side first) */
.ord-steps { position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); --p: 0; }
.ord-steps::before, .ord-steps::after { content: ""; position: absolute; top: 5px; height: 2px; border-radius: 2px; inset-inline-start: 10%; }
.ord-steps::before { inset-inline-end: 10%; background: var(--v-grid); }
.ord-steps::after { width: calc(var(--p) * 20%); background: var(--v-cur); transition: width .6s var(--v-ease); }
.ord-steps li { position: relative; z-index: 1; display: grid; justify-items: center; gap: 8px; text-align: center; font-size: 12.5px; color: var(--v-muted); line-height: 1.35; }
.ord-steps li::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: #DCD4C8; box-shadow: 0 0 0 3px #fff; transition: background-color .3s ease .3s; }
.ord-steps li:first-child { color: var(--v-ink); font-weight: 600; }
.ord-steps li:first-child::before { background: var(--v-cur); }
.ord-board.is-confirm .ord-steps { --p: 1; }
.ord-board.is-confirm .ord-steps li:nth-child(2) { color: var(--v-ink); font-weight: 600; }
.ord-board.is-confirm .ord-steps li:nth-child(2)::before { background: var(--v-cur); }
.ord-board.is-confirm .ord-steps li:first-child { font-weight: 400; }

.ord-meta { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.ord-meta span { background: var(--p-bg, #FFF8F0); border-radius: 999px; padding: 4px 12px; font-size: 12.5px; color: var(--v-muted); }
.ord-lines { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
.ord-lines th { text-align: start; color: var(--v-muted); font-weight: 500; font-size: 12px; padding: 0 6px 8px; border-bottom: 1px solid #DCD4C8; }
.ord-lines td { padding: 11px 6px; border-bottom: 1px solid var(--v-grid); vertical-align: top; }
.ord-lines :is(th, td):not(:first-child) { text-align: end; white-space: nowrap; }
.ord-lines td:last-child { font-weight: 600; }
.ord-name { display: block; }
.ord-short { display: grid; grid-template-columns: minmax(60px, 120px) auto auto; align-items: center; gap: 8px; margin-top: 6px; }
.ord-short .meter { height: 6px; }
.ord-short small { color: var(--v-muted); font-size: 12px; white-space: nowrap; }
.ord-flag { font-size: 11.5px; font-weight: 600; color: var(--v-bad); background: #FBEAE8; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.ord-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; color: var(--v-muted); }
.ord-total b { font: 600 22px/1.1 var(--font-text); color: var(--v-ink); }
.ord-total b small { font-size: 12px; font-weight: 400; color: var(--v-muted); }
@media (prefers-reduced-motion: no-preference) {
  html.viz-on :is(.ord-row, .ord-lines tbody tr) { transition: opacity .5s ease, transform .7s var(--v-ease), background-color .35s ease; transition-delay: calc(.3s + var(--j, 0) * 70ms), calc(.3s + var(--j, 0) * 70ms), 0s; }
  html.viz-on [data-viz]:not(.is-in) :is(.ord-row, .ord-lines tbody tr) { opacity: 0; transform: translateX(-14px); }
  [data-viz].is-in .ord-steps li:first-child::after { content: ""; position: absolute; top: -1px; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--v-cur); animation: viz-ping 2.6s ease-out 1.2s infinite; }
  .ord-board.is-confirm .ord-steps li:first-child::after { display: none; }
}
@media (max-width: 1279px) {
  .ord-row time { display: none; }   /* below 1280 the list card is too narrow for the age beside the amount */
}
@media (max-width: 639px) {
  .ord-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .ord-row em, .ord-row time { display: none; }
  .ord-rows .ord-row:nth-child(n+5) { display: none; }
  .ord-lines .ord-price { display: none; }
  .ord-short { grid-template-columns: minmax(40px, 1fr) auto; }
  .ord-short small { display: none; }
  .ord-steps li { font-size: 11px; }
  .ord-board > .ord-stage > .viz-bar { padding-inline-end: 0; }
}


/* ------------------------------------------------------------------ WhatsApp from the store's number
   The messages as the customer gets them, in the store's name (the store's own identity, not WhatsApp's
   look), coming in one after another; under them the store's WhatsApp settings: connected, and the order
   messages the merchant chose switching on in turn, cancellation left off. */
.wa-board { margin-top: 0; align-self: start; }
.wa-stage { display: grid; }
.wa-chat { gap: 0; padding: 0 0 52px; overflow: hidden; border: 1px solid rgb(43 43 43 / .06); }
.wa-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--v-grid); }
.wa-head b { display: block; font: 500 15px/1.35 var(--font-display); }
.wa-head small { color: var(--v-muted); font-size: 12px; }
.wa-logo { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--v-ink); color: var(--p-bg, #FFF8F0); font: 700 16px/1 var(--font-display); }
.wa-head__on { margin-inline-start: auto; background: var(--p-bg, #FFF8F0); color: var(--v-muted); border-radius: 999px; padding: 4px 12px; font-size: 12px; white-space: nowrap; }
.wa-thread { display: grid; gap: 10px; align-content: start; padding: 16px 18px 6px; background: var(--p-bg, #FFF8F0); }
.wa-day { justify-self: center; background: #fff; color: var(--v-muted); border-radius: 999px; padding: 2px 12px; font-size: 11.5px; }
.wa-msg { justify-self: start; max-width: 84%; display: grid; gap: 4px; background: #fff; border-radius: 16px; border-start-start-radius: 4px; padding: 10px 14px 8px; box-shadow: 0 1px 2px rgb(43 43 43 / .08); font-size: 14px; line-height: 1.55; transform-origin: 100% 0; }
.wa-msg p { margin: 0; }
.wa-msg small { justify-self: end; display: inline-flex; align-items: center; gap: 4px; color: var(--v-muted); font-size: 11px; }
.wa-msg svg { width: 15px; height: 10px; fill: none; stroke: var(--v-good); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
/* the settings hang over the chat's foot, on the end side, covering only its padding */
.wa-set { position: relative; z-index: 1; margin-top: -40px; margin-inline-start: auto; margin-inline-end: 14px; width: min(76%, 330px); gap: 12px; padding: 16px 18px; border: 1px solid rgb(43 43 43 / .07); box-shadow: 0 26px 44px -26px rgb(43 43 43 / .38); }
.wa-set__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.wa-set__head b { display: block; font-weight: 600; font-size: 14px; }
.wa-set__head small { color: var(--v-muted); font-size: 12px; }
.wa-set__head .viz-live { font-size: 12.5px; color: var(--v-good); font-weight: 600; }
.wa-set__list { display: grid; }
.wa-set__list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--v-grid); font-size: 13.5px; }
.wa-set__list li:first-child { border-top: 0; padding-top: 0; }
.sw { position: relative; width: 34px; height: 20px; flex: none; border-radius: 999px; background: #DCD4C8; transition: background-color .3s ease; }
.sw::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(43 43 43 / .25); transition: transform .35s var(--v-ease); }
.sw.is-on { background: var(--v-cur); }
.sw.is-on::after { transform: translateX(-14px); }   /* the page reads right to left: on is the end side */
@media (prefers-reduced-motion: no-preference) {
  html.viz-on .wa-msg { transition: opacity .4s ease, transform .55s var(--v-ease); transition-delay: calc(.6s + var(--j, 0) * .8s); }
  html.viz-on [data-viz]:not(.is-in) .wa-msg { opacity: 0; transform: translateY(10px) scale(.94); }
  html.viz-on .wa-set .sw, html.viz-on .wa-set .sw::after { transition-delay: calc(1s + var(--j, 0) * .25s); }
  html.viz-on [data-viz]:not(.is-in) .sw.is-on { background: #DCD4C8; }
  html.viz-on [data-viz]:not(.is-in) .sw.is-on::after { transform: none; }
}
@media (max-width: 639px) {
  .wa-head__on { display: none; }
  .wa-set { width: auto; margin-inline: 10px; }
}


/* ------------------------------------------------------------------ the three steps
   Three cards on the plate, each with a small screen of what the step gives: the store on its own address,
   the product file going in, the invitations going out. The step numbers turn orange one after another and
   an arrow between the cards points to the next. */
.steps-board { margin-top: 0; }
.step { display: flex; flex-direction: column; gap: 10px; position: relative; }
.step__n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--p-action, #C84D0A); color: var(--p-action-ink, #fff); font: 600 15px/1 var(--font-display); transition: background-color .4s ease, color .4s ease; transition-delay: calc(.6s + var(--j, 0) * .5s); }
.step .viz-title { font-size: 18px; margin-top: 4px; }
.step .viz-sub { font-size: 14px; }
.step .viz-sub { min-height: 3em; }   /* two lines held, so the three screens start on one line */
.step__ui { margin-top: 4px; flex: 1; display: grid; gap: 10px; align-content: center; background: var(--p-bg, #FFF8F0); border-radius: 16px; padding: 14px; min-height: 196px; font-size: 13px; }
.step:not(:last-child)::after { content: ""; position: absolute; z-index: 2; top: 30px; inset-inline-end: -17px; width: 20px; height: 20px; border-radius: 50%; background: var(--p-surface, #EFE7DD) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M7.5 3 4.5 6l3 3' fill='none' stroke='%23555452' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat; }

/* 1: the store on its address */
.step__ui .sp__url { justify-self: center; background: #fff; }
.step__ui .sp__url svg { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.s1-store { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 12px; padding: 10px 12px; }
.s1-store .sp__logo { width: 36px; height: 36px; border-radius: 11px; font-size: 16px; }
.s1-store div { display: grid; min-width: 0; flex: 1; }
.s1-store b { font: 500 14px/1.35 var(--font-display); }
.s1-store small { color: var(--v-muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s1-login { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: #fff; border-radius: 12px; padding: 10px 12px; color: var(--v-muted); font-size: 12px; }
.s1-login bdi { color: var(--v-ink); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* 2: the product file */
.s2-file { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 12px; padding: 10px 12px; }
.s2-ext { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: #EAF4EE; color: var(--v-good); font: 700 9.5px/1 var(--font-text); letter-spacing: .04em; }
.s2-file div { display: grid; }
.s2-file b { font-weight: 600; font-size: 13.5px; justify-self: start; }
.s2-file small { color: var(--v-muted); font-size: 11.5px; }
.s2-rows { display: grid; background: #fff; border-radius: 12px; padding: 4px 12px; }
.s2-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; padding: 6px 0; border-top: 1px solid var(--v-grid); font-variant-numeric: tabular-nums; }
.s2-row span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s2-row span:not(:first-child) { text-align: end; min-width: 40px; }
.s2-row--head { border-top: 0; color: var(--v-muted); font-size: 11.5px; }
.s2-done { display: grid; gap: 6px; }
.s2-done .meter { display: block; height: 6px; background: #fff; }
.s2-done .meter i { background: var(--v-good); }
.s2-done p { color: var(--v-muted); font-size: 12.5px; }
.s2-done b { color: var(--v-ink); font-weight: 600; }

/* 3: the invitations */
.s3-list { display: grid; background: #fff; border-radius: 12px; padding: 2px 12px; }
.s3-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--v-grid); }
.s3-list li:first-child { border-top: 0; }
.s3-list .ui-avatar { --u-bg: #fff; --u-ink: var(--v-ink); width: 28px; height: 28px; font-size: 12px; }
.s3-list div { display: grid; min-width: 0; }
.s3-list b { font-weight: 500; font-size: 13.5px; }
.s3-list small { color: var(--v-muted); font-size: 11.5px; }
.inv { display: inline-flex; align-items: center; gap: 3px; font-style: normal; font-weight: 600; font-size: 11.5px; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.inv svg, .s3-note svg, .s1-store .viz-flag svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.inv--sent { background: #EAF4EE; color: var(--v-good); }
.inv--wait { background: #FCE9DD; color: var(--p-accent-text, #C04C0E); }
.s3-note { display: flex; align-items: center; gap: 6px; color: var(--v-muted); font-size: 12px; }
.s3-note svg { width: 14px; height: 14px; flex: none; }

@media (prefers-reduced-motion: no-preference) {
  html.viz-on [data-viz]:not(.is-in) .step__n { background: #DCD4C8; color: var(--v-ink); }
  html.viz-on :is(.s2-row:not(.s2-row--head), .s3-list li) { transition: opacity .45s ease, transform .6s var(--v-ease); transition-delay: calc(.7s + var(--j, 0) * 120ms); }
  html.viz-on [data-viz]:not(.is-in) :is(.s2-row:not(.s2-row--head), .s3-list li) { opacity: 0; transform: translateX(-10px); }
  [data-viz].is-in .inv--wait { animation: viz-wait 1.6s ease-in-out 1.4s 4; }   /* a few beats, then it rests */
}
@keyframes viz-wait { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@media (max-width: 1023px) {
  .step:not(:last-child)::after { display: none; }
}
