/* Split bar in uiarc.dev's manner (arc_split_bar.js). Self-scoped under .asb so it reads the same on Arc
   pages and on the Swiss desk pages; tokens only. */

html body .asb {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--arc-foreground);
  font-family: var(--font-sans, inherit);
  font-size: var(--arc-text-sm);
  letter-spacing: 0;
  line-height: 1.45;
}
html body .asb .asb__probe { position: absolute; visibility: hidden; font-size: var(--arc-text-xs); font-weight: var(--arc-weight-strong); pointer-events: none; }

/* Head: the title on the left, a readout on the right naming the highlighted share, or the total. */
html body .asb .asb__head { display: flex; min-width: 0; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; }
html body .asb .asb__heading { display: grid; min-width: 0; gap: 2px; }
html body .asb .asb__title { margin: 0; color: var(--arc-foreground); font-size: var(--arc-text-md); font-weight: var(--arc-weight-strong); line-height: 1.35; }
html body .asb .asb__desc { margin: 0; color: var(--arc-text-muted); font-size: var(--arc-text-sm); }
html body .asb .asb__readout { position: relative; display: grid; min-width: 0; min-height: 22px; margin-left: auto; justify-items: end; align-items: end; }
html body .asb .asb__line {
  grid-area: 1 / 1;
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
  font-size: var(--arc-text-sm);
  transition: opacity var(--arc-dur-fast) var(--arc-ease), transform var(--arc-dur-snappy) var(--arc-snappy), filter var(--arc-dur-fast) var(--arc-ease);
}
html body .asb .asb__line.is-entering { opacity: 0; transform: translateY(6px); filter: blur(2px); transition: none; }
html body .asb .asb__line.is-leaving { opacity: 0; transform: translateY(-6px); filter: blur(2px); }
html body .asb .asb__line-swatch { width: 8px; height: 8px; flex: none; align-self: center; border-radius: 2px; background: var(--seg); }
html body .asb .asb__line-name { overflow: hidden; color: var(--arc-text-secondary); text-overflow: ellipsis; }
html body .asb .asb__line-share { color: var(--arc-foreground); font-size: var(--arc-text-lg); font-weight: var(--arc-weight-strong); line-height: 1.2; }
html body .asb .asb__line-value { color: var(--arc-text-muted); font-variant-numeric: tabular-nums; }

/* The bar: full-width layers cut with clip-path; a tinted body with a solid cap at its end. */
html body .asb .asb__bar {
  position: relative;
  height: 44px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--arc-surface-muted);
  outline: none;
  cursor: default;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}
html body .asb .asb__bar:focus-visible { box-shadow: 0 0 0 2px var(--arc-surface), 0 0 0 4px var(--arc-accent, var(--accent)); }
html body .asb .asb__seg {
  position: absolute;
  inset: 0;
  background: color-mix(in oklab, var(--seg) 42%, var(--arc-surface));
  will-change: clip-path;
}
html body .asb.is-ready .asb__seg { transition: clip-path var(--arc-dur-smooth) var(--arc-smooth), background-color var(--arc-dur-fast) var(--arc-ease), opacity var(--arc-dur) var(--arc-ease); }
html body .asb .asb__seg[data-active] { background: color-mix(in oklab, var(--seg) 62%, var(--arc-surface)); }
html body .asb .asb__seg[data-dimmed] { opacity: .5; }
html body .asb .asb__cap { position: absolute; top: 0; bottom: 0; width: 3px; background: var(--seg); pointer-events: none; }
html body .asb.is-ready .asb__cap { transition: left var(--arc-dur-smooth) var(--arc-smooth), opacity var(--arc-dur-fast) var(--arc-ease); }
html body .asb .asb__in {
  position: absolute;
  top: 0;
  display: flex;
  height: 100%;
  align-items: center;
  color: var(--arc-foreground);
  font-size: var(--arc-text-xs);
  font-weight: var(--arc-weight-strong);
  white-space: nowrap;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}
html body .asb.is-ready .asb__in { transition: left var(--arc-dur-smooth) var(--arc-smooth), opacity var(--arc-dur-fast) var(--arc-ease); }
html body .asb .asb__in-name { display: inline-block; overflow: hidden; font-weight: var(--arc-weight); text-overflow: clip; }
html body .asb.is-ready .asb__in-name { transition: max-width var(--arc-dur-morph) var(--arc-spring), margin-right var(--arc-dur-morph) var(--arc-spring), opacity var(--arc-dur-fast) var(--arc-ease); }

/* Labels that do not fit: a lane under the bar with leader lines. */
html body .asb .asb__lane { position: relative; height: 0; overflow: hidden; margin-top: -12px; }
html body .asb.is-ready .asb__lane { transition: height var(--arc-dur-smooth) var(--arc-smooth); }
html body .asb[data-lane] .asb__lane { height: 40px; }
html body .asb .asb__leaders { position: absolute; top: 0; left: 0; overflow: visible; }
html body .asb .asb__leader { fill: none; stroke: var(--arc-border-strong); stroke-width: 1; stroke-linejoin: round; transition: opacity var(--arc-dur) var(--arc-ease); }
html body .asb .asb__leader[data-dimmed] { opacity: .4; }
html body .asb .asb__out {
  position: absolute;
  top: 18px;
  left: 0;
  display: inline-flex;
  gap: 4px;
  color: var(--arc-foreground);
  font-size: var(--arc-text-xs);
  font-weight: var(--arc-weight-strong);
  line-height: 1.4;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  opacity: 0;
}
html body .asb.is-ready .asb__out { transition: transform var(--arc-dur-smooth) var(--arc-smooth), opacity var(--arc-dur-fast) var(--arc-ease); }
html body .asb .asb__out.is-in { opacity: 1; }
html body .asb .asb__out[data-dimmed] { opacity: .45; }
html body .asb .asb__out-name { color: var(--arc-text-secondary); font-weight: var(--arc-weight); }

/* Legend: each item switches its share off and on; the swatch empties when off. */
html body .asb .asb__legend { display: flex; min-width: 0; flex-wrap: wrap; gap: 2px 4px; margin: 0 0 0 -8px; padding: 0; list-style: none; }
html body .asb .asb__legend > li { margin: 0; padding: 0; list-style: none; }
html body .asb .asb__legend > li::before, html body .asb .asb__legend > li::marker { content: none; }
html body .asb button.asb__item {
  display: inline-flex;
  min-height: 32px;
  height: auto;
  min-width: 0;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  padding: 6px 10px 6px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  color: var(--arc-foreground);
  font: inherit;
  font-size: var(--arc-text-sm);
  font-weight: var(--arc-weight);
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--arc-dur-fast) var(--arc-ease), color var(--arc-dur-fast) var(--arc-ease);
}
html body .asb button.asb__item[data-active] { background: var(--arc-surface-muted); }
@media (hover: hover) and (pointer: fine) {
  html body .asb button.asb__item:hover { background: var(--arc-surface-muted); }
}
html body .asb button.asb__item:focus { outline: none; }
html body .asb button.asb__item:focus-visible { box-shadow: 0 0 0 2px var(--arc-accent, var(--accent)); }
html body .asb .asb__label { display: inline-flex; align-items: baseline; gap: 8px; }
html body .asb .asb__label.is-nudge { animation: asb-nudge 320ms var(--arc-ease); }
@keyframes asb-nudge { 0% { transform: translateX(0); } 25% { transform: translateX(-3px); } 50% { transform: translateX(3px); } 75% { transform: translateX(-2px); } 100% { transform: translateX(0); } }
html body .asb .asb__swatch {
  position: relative;
  width: 12px;
  height: 12px;
  flex: none;
  align-self: center;
  box-sizing: border-box;
  translate: 0 1px;
  border-right: 3px solid var(--seg);
  border-radius: 3px;
  background: color-mix(in oklab, var(--seg) 42%, var(--arc-surface));
  transition: background-color var(--arc-dur) var(--arc-ease), border-color var(--arc-dur) var(--arc-ease), box-shadow var(--arc-dur) var(--arc-ease);
}
html body .asb button.asb__item[data-off] .asb__swatch { border-right-color: transparent; background: transparent; box-shadow: inset 0 0 0 1.5px var(--arc-border-strong); }
html body .asb .asb__name { color: var(--arc-text-secondary); transition: color var(--arc-dur-fast) var(--arc-ease); }
html body .asb button.asb__item[data-off] .asb__name { color: var(--arc-text-muted); text-decoration: line-through; text-decoration-color: var(--arc-border-strong); }
html body .asb .asb__share { position: relative; display: inline-grid; min-width: 2.6em; justify-items: start; color: var(--arc-foreground); font-variant-numeric: tabular-nums; }
html body .asb .asb__share > * { grid-area: 1 / 1; transition: opacity var(--arc-dur-fast) var(--arc-ease); }
html body .asb .asb__off { color: var(--arc-text-muted); opacity: 0; }
html body .asb button.asb__item[data-off] .asb__share > .asb-num { opacity: 0; }
html body .asb button.asb__item[data-off] .asb__off { opacity: 1; }

/* Odometer digits. */
html body .asb .asb-num { display: inline-flex; align-items: flex-start; white-space: nowrap; line-height: 1.2; user-select: none; font-variant-numeric: tabular-nums; }
html body .asb .asb-num__col {
  --feather: .18em;
  position: relative;
  display: inline-block;
  height: 1.2em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 var(--feather), #000 calc(100% - var(--feather)), transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 var(--feather), #000 calc(100% - var(--feather)), transparent);
}
html body .asb .asb-num__strip { display: flex; flex-direction: column; }
html body .asb.is-ready .asb-num__strip { transition: transform var(--arc-dur-smooth) var(--arc-smooth); }
html body .asb .asb-num__strip > span { display: block; height: 1.2em; text-align: center; }
html body .asb .asb-num__sym { display: inline-block; white-space: pre; }

html body .asb .asb__sr { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* A 34px bar for narrow cards. */
html body .asb.asb--sm { gap: 10px; }
html body .asb.asb--sm .asb__bar { height: 34px; border-radius: 10px; }
html body .asb.asb--sm .asb__line-share { font-size: var(--arc-text-md); }
html body .asb.asb--sm .asb__lane { margin-top: -10px; }

@media (prefers-reduced-motion: reduce) {
  html body .asb.is-ready :is(.asb__seg, .asb__cap, .asb__in, .asb__in-name, .asb__lane, .asb__out, .asb__line, .asb-num__strip, .asb__swatch, .asb__leader) { transition: none; }
  html body .asb .asb__label.is-nudge { animation: none; }
}

/* Chat charts: a pie arrives as a split bar (exhibit.js). */
html body .chat-render .render-split { padding: 12px 12px 10px; }
