/* Sales-projects canvas figures (c2c-v2, batchline, sales-central) — one stylesheet, two skins.

   Ink (default): colours come from the site's variables only (ink on paper, one accent),
   so the figures follow body.theme-dark / light. See ../../showcase/DRAWING-RULES.md.

   Product: put .skin-product on any wrapper. It only sets --sc-* variables (the products' own
   tokens, from their DESIGN.md files); the drawing code is the same. The figure reads --sc-rough
   when it mounts, so re-mount after changing the skin. */

/* =====================================================================
   The product skin: variables only
   ===================================================================== */
.skin-product {
  /* Click-to-Call and Sales Central (ns-twilio-c2c DESIGN.md §1, §2) */
  --sc-rough: .24;
  --sc-ink: #161513;
  --sc-muted: #5C5955;
  --sc-paper: #F1EFED;
  --sc-accent: #36677D;
  --sc-link: #00688C;
  --sc-on: #FFFFFF;
  --sc-halo: transparent;
  --sc-t-go: #436B1D;
  --sc-dot-go: #8AC94F;
  --sc-c-edge: #D9D5CF;   --sc-o-edge: 1;
  --sc-c-fine: #8B8780;   --sc-o-fine: 1;
  --sc-c-hair: #E5E2DD;   --sc-o-hair: 1;
  --sc-c-squig: #B4AFA7;  --sc-c-squig-soft: #D4D0CA;
  --sc-o-hatch: 0;
  --sc-f-card: #FBF9F8;
  --sc-f-surface: #FFFFFF;
  --sc-f-col: #F1EFEA;
  --sc-f-topbar: #1A2F3F;
  --sc-f-primary: #36677D;
  --sc-f-go: #436B1D;
  --sc-f-stop: #B3311F;
  --sc-f-seg: rgba(255, 255, 255, .14);
  --sc-f-key: rgba(255, 255, 255, .10);
  --sc-f-phonecard: rgba(255, 255, 255, .06);
  --sc-f-scrim: rgba(17, 32, 58, .14);
  --sc-phone-a: #1C3344; --sc-phone-b: #15283A; --sc-phone-c: #11203A;
  --sc-phone-shadow: drop-shadow(0 10px 18px rgba(17, 32, 58, .30));
  --sc-card-shadow: drop-shadow(0 1px 1.5px rgba(22, 21, 19, .14));
  --sc-font-ui: "Oracle Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --sc-font-label: var(--sc-font-ui);
  --sc-font-name: var(--sc-font-ui);
  --sc-font-num: var(--sc-font-ui);
  --sc-ls-label: .01em;
  --sc-tt-label: none;
  --sc-fw-label: 600;
  --sc-fs-name: normal;
  --sc-fw-name: 700;
  --sc-o-name: 1;
}
/* status chips: cs (done), cw (waiting), ci (info) */
.skin-product .sc-chip--cs { --sc-chip-bg: #EBF8DE; --sc-chip-fg: #436B1D; --sc-chip-edge: transparent; }
.skin-product .sc-chip--cw { --sc-chip-bg: #FDF2E5; --sc-chip-fg: #8F520A; --sc-chip-edge: transparent; }
.skin-product .sc-chip--ci { --sc-chip-bg: #EDF6F9; --sc-chip-fg: #00688C; --sc-chip-edge: transparent; }
/* on the navy softphone everything is light */
.skin-product .sc-phone {
  color: #F3F6FA;
  --sc-muted: #94A6BF;
  --sc-link: #9FD0FA;
  --sc-c-edge: rgba(255, 255, 255, .18);
  --sc-c-fine: rgba(255, 255, 255, .34);
  --sc-c-hair: rgba(255, 255, 255, .12);
  --sc-c-squig: rgba(255, 255, 255, .5);
  --sc-c-squig-soft: rgba(255, 255, 255, .24);
  --sc-accent: #9FD0FA;
}
.skin-product .sc-phone .sc-chip--cs { --sc-chip-bg: transparent; --sc-chip-fg: #8AC94F; --sc-chip-edge: rgba(138, 201, 79, .6); }

/* Batchline (netsuite-order-desk DESIGN.md §1: the --bl-* tokens) */
.skin-product [data-palette="batchline"],
.skin-product[data-palette="batchline"] {
  --sc-ink: #1A1816;                 /* --bl-text */
  --sc-muted: #5E5952;               /* --bl-text-muted */
  --sc-paper: #F5F4F2;               /* --bl-ground */
  --sc-accent: #24586A;              /* --bl-primary */
  --sc-link: #24586A;
  --sc-c-edge: #D4D0C9;              /* --bl-border-strong */
  --sc-c-fine: #77716A;              /* --bl-text-faint */
  --sc-c-hair: #EFEDE9;              /* --bl-border-soft */
  --sc-c-squig: #B9B4AC; --sc-c-squig-soft: #D4D0C9;
  --sc-f-surface: #FFFFFF;           /* --bl-surface */
  --sc-f-sunk: #FAF9F7;              /* --bl-surface-sunk */
  --sc-f-tint: #FCFBFA;              /* --bl-surface-tint */
  --sc-f-primary: #24586A;
  --sc-f-edited: #FDF3E6;            /* --bl-edited-bg */
  --sc-t-edited: #8A4B0F;            /* --bl-edited-fg */
  --sc-c-edited: #D9822B;            /* --bl-edited-dot */
  --sc-f-range: rgba(43, 122, 146, .12);
  --sc-f-flash: rgba(43, 122, 146, .28);
  --sc-c-focus: #2B7A92;             /* --bl-focus */
  --sc-t-success: #23663F;           /* --bl-success-fg */
  --sc-c-success: #2F8A57;           /* --bl-success-dot */
  --sc-f-success: #EAF5EE;           /* --bl-success-bg */
}

/* =====================================================================
   The figure
   ===================================================================== */
.sc-fig {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  color: var(--sc-ink, var(--near-black));
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  --sc-ease: cubic-bezier(.42, .05, .4, 1);
}
.sc-fig path { stroke-linecap: round; stroke-linejoin: round; }
.sc-cam { transition: transform 760ms var(--sc-ease); }
.sc-cam.is-snap { transition: none; }

/* when a stroke, a word or a surface starts: its part's delay + its place in the drawing order */
.sc-fig .sc-ink,
.sc-fig .sc-t,
.sc-fig .sc-fill { --sc-delay: calc(var(--sc-pd, 0ms) + var(--sc-n, 0) * var(--sc-st, 14ms)); }

/* ---------- ink: every stroke is drawn in with one dashoffset (pathLength = 1) ---------- */
.sc-fig .sc-ink path {
  fill: none;
  stroke-dasharray: 1 1.2;
  stroke-dashoffset: 0;
  visibility: visible;
  transition: stroke-dashoffset var(--sc-dur, 560ms) var(--sc-ease) var(--sc-delay, 0ms),
              visibility 0s linear var(--sc-delay, 0ms);
}
.sc-fig .is-off .sc-ink path {
  stroke-dashoffset: 1;                        /* un-drawn: the stroke runs back the way it came */
  visibility: hidden;
  transition: stroke-dashoffset 300ms var(--sc-ease) 0ms, visibility 0s linear 300ms;
}
.sc-fig .sc-edge { opacity: var(--sc-o-edge, .8); }
.sc-fig .sc-fine { opacity: var(--sc-o-fine, .6); }
.sc-fig .sc-hair { opacity: var(--sc-o-hair, .45); }
.sc-fig .sc-edge path { stroke: var(--sc-c-edge, currentColor); }
.sc-fig .sc-fine path { stroke: var(--sc-c-fine, currentColor); }
.sc-fig .sc-hair path { stroke: var(--sc-c-hair, currentColor); }
.sc-fig .sc-squig.sc-edge path,
.sc-fig .sc-squig.sc-fine path { stroke: var(--sc-c-squig, currentColor); }
.sc-fig .sc-squig.sc-hair path { stroke: var(--sc-c-squig-soft, currentColor); }
.sc-fig .sc-hatch { opacity: var(--sc-o-hatch, .4); }
.sc-fig .sc-inkline path { stroke: currentColor; }
.sc-fig .sc-inkline { opacity: .8; }
/* the one accent */
.sc-fig .sc-acc { color: var(--sc-accent, var(--brand)); }
.sc-fig .sc-acc .sc-ink path, .sc-fig .sc-ink.sc-acc path { stroke: currentColor; }
.sc-fig .sc-acc.sc-ink, .sc-fig .sc-acc .sc-ink { opacity: .9; }

/* ---------- surfaces (transparent in ink; the product's colour in the product skin) ---------- */
.sc-fig .sc-fill { stroke: none; opacity: 1; transition: opacity 340ms ease var(--sc-delay, 0ms); }
.sc-fig .is-off .sc-fill { opacity: 0; transition: opacity 200ms ease 0ms; }
.sc-fig .sc-stop-a { stop-color: var(--sc-phone-a, var(--sc-paper, var(--ivory))); }
.sc-fig .sc-stop-b { stop-color: var(--sc-phone-b, var(--sc-paper, var(--ivory))); }
.sc-fig .sc-stop-c { stop-color: var(--sc-phone-c, var(--sc-paper, var(--ivory))); }
.sc-fig .sc-phone-body { filter: var(--sc-phone-shadow, none); }
.sc-fig .sc-dot { stroke: none; fill: var(--sc-dot-go, currentColor); }

/* ---------- type ---------- */
.sc-fig text { pointer-events: none; }
.sc-fig .sc-t {
  clip-path: inset(-8px -8px -8px -8px);
  transition: clip-path var(--sc-tdur, 460ms) var(--sc-ease) var(--sc-delay, 0ms);
}
.sc-fig .is-off .sc-t {
  clip-path: inset(-8px 100% -8px -8px);
  transition: clip-path 220ms var(--sc-ease) 0ms;
}
.sc-fig .sc-label {
  font-family: var(--sc-font-label, var(--mono, "JetBrains Mono", monospace));
  font-size: 10px;
  font-weight: var(--sc-fw-label, 500);
  letter-spacing: var(--sc-ls-label, .14em);
  text-transform: var(--sc-tt-label, uppercase);
  fill: var(--sc-muted, var(--stone));
}
.sc-fig .sc-label--quiet { font-size: 9px; fill-opacity: .8; }
.sc-fig .sc-label--s { font-size: 8.5px; }
.sc-fig .sc-label--xs { font-size: 7.5px; }
.sc-fig .sc-tag { font-size: 9px; }
.sc-fig .sc-name {
  font-family: var(--sc-font-name, var(--serif, Charter, Georgia, serif));
  font-style: var(--sc-fs-name, italic);
  font-weight: var(--sc-fw-name, 400);
  font-size: 15px;
  fill: currentColor;
  fill-opacity: var(--sc-o-name, .88);
}
.sc-fig .sc-name--m { font-size: 13.5px; }
.sc-fig .sc-name--s { font-size: 11px; }
.sc-fig .sc-num {
  font-family: var(--sc-font-num, var(--mono, "JetBrains Mono", monospace));
  font-size: 9px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  fill: currentColor;
  fill-opacity: .86;
}
.sc-fig .sc-hand {
  font-family: "Caveat", "Comic Sans MS", cursive;
  font-weight: 600;
  font-size: 16px;
  fill: currentColor;
  fill-opacity: .84;
  --sc-tdur: 820ms;
}
.sc-fig .sc-hand--note { font-size: 21px; fill-opacity: .8; }
.sc-fig .sc-tc-ink { fill: currentColor; fill-opacity: .88; }
.sc-fig .sc-tc-link { fill: var(--sc-link, currentColor); }
.sc-fig .sc-tc-go { fill: var(--sc-t-go, currentColor); }
.sc-fig .sc-tc-on { fill: var(--sc-on, currentColor); }
.sc-fig .sc-tc-acc { fill: var(--sc-accent, var(--brand)); }
.sc-fig .sc-timer { font-size: 22px; font-weight: 400; letter-spacing: .02em; fill-opacity: .92; }

/* ---------- thread, knots, the sound wave ---------- */
.sc-fig .sc-thread {
  fill: none;
  stroke: currentColor;
  stroke-opacity: .45;
  stroke-width: 1.2;
  transition: stroke 200ms ease, stroke-opacity 200ms ease;
}
.sc-fig .sc-thread.is-live { stroke: var(--sc-accent, var(--brand)); stroke-opacity: .75; }
.sc-fig .sc-knot { fill: currentColor; fill-opacity: .5; opacity: 0; transition: fill 200ms ease; }
.sc-fig .sc-knot.is-shown { opacity: 1; }
.sc-fig .sc-knot.is-live { fill: var(--sc-accent, var(--brand)); fill-opacity: .85; }
.sc-fig .sc-wave { fill: none; stroke: var(--sc-accent, var(--brand)); stroke-opacity: .88; stroke-width: .9; }

/* ---------- callouts (a) (b) (c) ---------- */
.sc-fig .sc-note { pointer-events: none; }
.sc-fig .sc-note__text {
  font-family: var(--serif, Charter, Georgia, serif);
  font-style: italic;
  font-size: 13px;
  fill: var(--sc-accent, var(--brand));
  stroke: var(--sc-paper, var(--ivory));
  stroke-width: 4px;
  stroke-linejoin: round;
  paint-order: stroke fill;
  --sc-tdur: 520ms;
}
.sc-fig .sc-note__leader path { stroke: var(--sc-accent, var(--brand)); stroke-opacity: .7; stroke-width: .7; }

/* ---------- things that land as one piece: stamps, chips ---------- */
.sc-fig .sc-stamp {
  color: var(--sc-accent, var(--brand));
  opacity: .92;
  transform: scale(1);
  transform-box: fill-box;
  transform-origin: center;
  pointer-events: none;
  transition: transform 240ms cubic-bezier(.2, .8, .3, 1) var(--sc-pd, 0ms), opacity 80ms linear var(--sc-pd, 0ms);
}
.sc-fig .sc-stamp.is-off { opacity: 0; transform: scale(1.06); transition: opacity 160ms linear 0ms, transform 0s linear 160ms; }
.sc-fig .sc-stamp path { fill: none; }
.sc-fig .sc-stamp__text {
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  fill: currentColor;
}
.sc-fig .sc-pop {
  opacity: 1;
  transform: none;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 260ms cubic-bezier(.23, 1, .32, 1) var(--sc-pd, 0ms), opacity 140ms linear var(--sc-pd, 0ms);
}
.sc-fig .sc-pop.is-off { opacity: 0; transform: translateY(-4px) scale(.96); transition: opacity 140ms linear 0ms, transform 0s linear 140ms; }
.sc-fig .sc-chip__fill { fill: var(--sc-chip-bg, transparent); stroke: none; }
.sc-fig .sc-chip__edge path { fill: none; stroke: var(--sc-chip-edge, currentColor); stroke-opacity: .7; }
.sc-fig .sc-chip__text {
  font-family: var(--sc-font-label, var(--mono, "JetBrains Mono", monospace));
  font-size: 7px;
  font-weight: 600;
  letter-spacing: var(--sc-ls-label, .1em);
  text-transform: var(--sc-tt-label, uppercase);
  fill: var(--sc-chip-fg, currentColor);
  fill-opacity: .9;
}
.skin-product .sc-fig .sc-chip__text { font-size: 7.6px; }

/* ---------- a drawn button that plays the step again ---------- */
.sc-fig .sc-btn { cursor: pointer; outline: none; }
.sc-fig .sc-btn__in { transition: transform 90ms ease; }
.sc-fig .sc-btn.is-pressed .sc-btn__in { transform: translateY(1.2px); }
.sc-fig .sc-btn__hit { fill: transparent; stroke: none; }
.sc-fig .sc-btn:focus-visible .sc-btn__focus { opacity: 1; }
.sc-fig .sc-btn__focus { fill: none; stroke: var(--sc-accent, var(--brand)); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; }

/* =====================================================================
   The softphone (c2c-v2 and sales-central)
   ===================================================================== */
.sc-fig .sc-strong path { stroke: var(--sc-c-edge, currentColor); }
.sc-fig .sc-go { color: inherit; }
.sc-fig .sc-go .sc-f-go { transition: fill 260ms ease, opacity 340ms ease var(--sc-delay, 0ms); }
.sc-fig .sc-go.is-stop .sc-f-go { fill: var(--sc-f-stop, transparent) !important; }
.sc-fig .sc-go__edge path { stroke: var(--sc-f-go, currentColor); transition: stroke 260ms ease; }
.sc-fig .sc-go.is-stop .sc-go__edge path { stroke: var(--sc-f-stop, currentColor); }
.sc-fig .sc-go__edge { opacity: .9; }
.sc-fig .sc-go__ico path { stroke: var(--sc-on, currentColor); }
.sc-fig .sc-go__glyph { transform-box: fill-box; transform-origin: center; transition: transform 300ms cubic-bezier(.23, 1, .32, 1); }
.sc-fig .sc-go.is-stop .sc-go__glyph { transform: rotate(135deg); }
.sc-fig .sc-key { font-size: 10.5px; fill-opacity: .8; }
.sc-fig .sc-handset__in { transform-box: fill-box; transform-origin: center; }
.sc-fig .sc-handset.is-ringing .sc-handset__in { animation: sc-ring 520ms ease-out 1; }
@keyframes sc-ring {
  0%   { transform: rotate(0deg); }
  18%  { transform: rotate(-3deg); }
  38%  { transform: rotate(2.4deg); }
  58%  { transform: rotate(-1.5deg); }
  78%  { transform: rotate(.8deg); }
  100% { transform: rotate(0deg); }
}

/* ---------- c2c-v2 ---------- */
.c2v .c2v-callbtn { color: inherit; transition: color 200ms ease; }
.c2v .c2v-callbtn.is-focus { color: var(--sc-accent, var(--brand)); }
.c2v .c2v-callbtn__edge path { stroke: var(--sc-f-primary, currentColor); }
.c2v .c2v-callbtn__edge { opacity: .92; }
.c2v .c2v-callbtn__ico path { stroke: var(--sc-on, currentColor); }
.c2v .c2v-callbtn__t { fill: var(--sc-on, currentColor); fill-opacity: .95; }
.c2v .c2v-badge path { stroke: var(--sc-dot-go, currentColor); }
.c2v .c2v-badge__t { fill: var(--sc-dot-go, var(--sc-muted, var(--stone))); }

/* ---------- batchline ---------- */
.btl .bl-kpi { font-size: 11.5px; font-weight: 600; }
.btl .bl-ln { fill: var(--sc-muted, var(--stone)); font-size: 8px; }
.btl .bl-loc { font-size: 9px; }
.btl .bl-loc--old { fill-opacity: .62; }
.btl .bl-loc--new { fill: var(--sc-t-edited, var(--sc-accent, var(--brand))); fill-opacity: 1; font-weight: 600; transition: fill 260ms ease, clip-path var(--sc-tdur, 460ms) var(--sc-ease) var(--sc-delay, 0ms); }
.btl .is-saved .bl-loc--new { fill: currentColor; fill-opacity: .88; }
.btl .is-saved .sc-f-edited { opacity: 0 !important; }
.btl .is-slow .sc-t { --sc-tdur: 760ms; }
.btl .bl-dot { fill: none; stroke: var(--sc-c-edited, var(--sc-accent, var(--brand))); stroke-width: 1.3; }
.btl .bl-tick path { stroke: var(--sc-on, var(--sc-accent, var(--brand))); }
.btl .bl-range__edge path { stroke: var(--sc-c-focus, currentColor); }
.btl .bl-cell path { fill: none; stroke: var(--sc-c-focus, currentColor); }
.btl .bl-cell { color: var(--sc-accent, var(--brand)); }
.btl .bl-pencil path { stroke: currentColor; fill: var(--sc-paper, var(--ivory)); }
.btl .bl-pencil .bl-pencil__lead { fill: currentColor; fill-opacity: .8; }
.btl .bl-ok path { stroke: var(--sc-c-success, currentColor); }
.btl .bl-prog { fill: none; stroke: var(--sc-f-primary, currentColor); stroke-width: 3; stroke-dasharray: 1 1.2; stroke-dashoffset: 1; }
.btl .bl-apply__edge path { stroke: var(--sc-f-primary, currentColor); }
.btl .bl-flash { fill: var(--sc-f-flash, transparent); stroke: none; opacity: 0; pointer-events: none; }
.btl .bl-flash.is-on { animation: bl-flash 320ms ease-out 1; }
@keyframes bl-flash { 0% { opacity: 1; } 100% { opacity: 0; } }
.btl .bl-receipt .sc-f-surface { filter: var(--sc-card-shadow, none); }

/* ---------- sales-central ---------- */
.scl .sc-kpi { font-size: 15px; font-weight: 600; fill-opacity: .92; }
.scl .scl-bg { opacity: .74; }                        /* the workspace stays quiet so the modal reads first */
.scl.sc-is-product .scl-bg { opacity: .9; }
.scl .scl-card .sc-f-surface { filter: var(--sc-card-shadow, none); }
.scl .scl-card__bar path { stroke: var(--sc-f-primary, currentColor); }
.scl .scl-card__bar { opacity: .85; }
.scl .scl-amt { font-weight: 600; fill: var(--sc-t-go, currentColor); }
.scl .scl-countn { font-size: 8px; }
.scl .scl-hero.is-lifted .sc-edge path { stroke-width: 1.6; }
.scl .scl-ghost { stroke-opacity: .32; }
.scl .scl-delta { fill: var(--sc-t-go, var(--sc-muted, var(--stone))); }
.scl .scl-panel .sc-f-surface { filter: var(--sc-card-shadow, none); }
.scl.sc-is-product .sc-note__text { stroke: none; }      /* the scrim changes what is behind it: no paper halo */
.scl .scl-scrim { fill: var(--sc-f-scrim, transparent); stroke: none; opacity: 0; pointer-events: none; transition: opacity 280ms ease; }
.scl .scl-scrim.is-on { opacity: 1; }
/* Accept: the one accent of (a). Ink: the accent pen. Product: the product's go green. */
.scl.sc-is-ink .scl-accept { color: var(--sc-accent, var(--brand)); }
.scl.sc-is-ink .scl-accept__t { fill: var(--sc-accent, var(--brand)); }
.scl .scl-press .sc-btn__in { transform-box: fill-box; transform-origin: center; transition: transform 120ms cubic-bezier(.23, 1, .32, 1); }
.scl .scl-press.is-pressed .sc-btn__in { transform: scale(.97); }
/* product colours: the modal arrives (and leaves) as one piece */
.scl.sc-is-product .scl-modal {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 280ms cubic-bezier(.23, 1, .32, 1), opacity 280ms cubic-bezier(.23, 1, .32, 1);
}
.scl.sc-is-product .scl-modal.is-out { opacity: 0; transform: translateY(12px) scale(.96); transition-duration: 200ms; pointer-events: none; }
.scl .scl-modal.is-snap, .scl .scl-modal.is-snap * { transition: none !important; }

/* ---------- no animation: the finished drawing, at once ---------- */
.sc-fig.is-instant, .sc-fig.is-instant *,
.sc-fig.is-reduced, .sc-fig.is-reduced * { transition: none !important; animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .sc-fig, .sc-fig * { transition: none !important; animation: none !important; }
}
