:root {
  --bg: #f6f4ef;
  --ink: #17171a;
  --soft: rgba(23, 23, 26, 0.58);
  --line: rgba(23, 23, 26, 0.1);
  --accent: #6a4cff;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 10px 12px;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; outline: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.bs { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; width: min(348px, 100%); padding: 18px 16px 16px; border-radius: 26px; background: #ffffff; box-shadow: inset 0 0 0 1px var(--line), 0 30px 44px -30px rgba(60, 50, 30, 0.45); }
.bs__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; padding: 0 2px; }
.bs__file { display: grid; gap: 2px; min-width: 0; }
.bs__file strong { font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; line-height: 18px; font-weight: 700; }
.bs__file span { font-size: 12px; line-height: 16px; font-weight: 620; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bs__total { display: flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.bs__total b { font-size: 40px; line-height: 40px; font-weight: 680; font-stretch: 88%; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.bs__total i { font-style: normal; font-size: 14px; font-weight: 700; color: var(--soft); }

/* the bar: its full width is the bundle as it is written; the mark stands where the budget is */
.bs__meter { position: relative; padding: 22px 0 0; }
.bs__track { position: relative; display: flex; gap: 2px; height: 30px; border-radius: 10px; background: rgba(23, 23, 26, 0.055); }
.bs__seg { position: relative; flex: none; height: 100%; min-width: 3px; border-radius: 4px; background: var(--accent); cursor: pointer; outline: none; }
.bs__seg:first-child { border-radius: 10px 4px 4px 10px; }
.bs__seg:last-child { border-radius: 4px 10px 10px 4px; }
.bs__seg::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.bs__seg:focus-visible { box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--ink); z-index: 1; }
.bs__mark { position: absolute; top: 16px; left: 0; width: 2px; height: 42px; margin-left: -1px; border-radius: 1px; background: var(--ink); }
.bs__budget { position: absolute; top: 0; left: 0; display: flex; align-items: center; height: 16px; font-size: 11.500px; line-height: 16px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; transition: color 0.3s ease; }
.bs__budget svg { display: block; width: 0; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.bs__budget svg path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.bs__budget.is-met { color: var(--accent); }
.bs__info { padding: 0 2px; margin-top: -2px; }
.bs__clip { display: block; height: 17px; line-height: 17px; overflow: hidden; white-space: nowrap; font-size: 12.500px; font-weight: 640; color: var(--soft); font-variant-numeric: tabular-nums; }
.bs__clip span { display: block; overflow: hidden; text-overflow: ellipsis; }

.bs__opts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.32fr) minmax(0, 0.92fr); gap: 6px; }
.bs__opts button { display: flex; justify-content: center; align-items: center; gap: 6px; height: 40px; border-radius: 14px; font-size: 12.500px; font-weight: 700; white-space: nowrap; box-shadow: inset 0 0 0 1.500px rgba(23, 23, 26, 0.14); transition: box-shadow 0.25s ease, background-color 0.25s ease; }
.bs__opts button[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 9%, #ffffff); box-shadow: inset 0 0 0 1.500px var(--accent); }
.bs__opts i { flex: none; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 5px; box-shadow: inset 0 0 0 1.500px rgba(23, 23, 26, 0.3); transition: background-color 0.2s ease, box-shadow 0.2s ease; }
.bs__opts button[aria-pressed="true"] i { background: var(--accent); box-shadow: none; }
.bs__opts svg { display: block; width: 12px; height: 12px; fill: none; stroke: #ffffff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bs__opts svg path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.bs__opts button:focus-visible { box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--ink); }

.ghost { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: -3px 0 0 -5px; transform-origin: 20% 15%; pointer-events: none; opacity: 0; fill: #17171a; stroke: #ffffff; stroke-width: 1.300; stroke-linejoin: round; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)); z-index: 6; }

@media (max-width: 350px) { .bs { padding: 16px 13px 14px; } .bs__opts { gap: 5px; } .bs__opts button { font-size: 12px; gap: 5px; } .bs__total b { font-size: 36px; } }
@media (prefers-reduced-motion: reduce) { .bs__opts button, .bs__opts i, .bs__budget { transition: none; } }
