/* Generated from nival-design (shared/progress.css; `npm run sync` there). Change it there, never here: this app's `npm test` fails while this file differs from what nival-design gives. */
/* Nival's loading and progress pieces: the level bar (`.n-meter`), the busy dot (`.n-busy`) and the place of what's
   still loading (`.n-loading`), for every Nival web app (Renjume, 2026-11-14: "Yes, shared for all apps"; nival-design
   pieces.json › progress, busy, placeholder). Written by shared/Progress.tsx (`<Progress>`, `<Busy>`). */
/* A level, progress or a download: a track with one <span> in it, the level in ink (`--level`, 0 to 1),
   growing in. `--meter-fill`: a value's own colour. The one bar (the bars audit, 2026-11-13: a drive's and a day's
   were bars of their own, three were written without their span and showed an empty track). Its track shows on
   every ground, the fill's height and rounding (`--n-line2`, the stronger line, light and dark; the Shell manager,
   2026-11-14, of a drive's bar as this piece: "without a visible track the bar doesn't say how full, it only says
   how long": the track was a control's raised fill, a card's own colour, unseen on a card). The design gate holds
   its contrast against what it lies on. `--meter-track`: a track of its own, where the ground asks. */
/* The level as it's drawn, moving to `--level` as movement does (as Nival Operator's ProgressBar), from nothing as it
   comes. The bar's own, so a bar that goes from busy with no share known to a share grows from nothing to it, never
   from the whole track down (checks-copy, 2026-11-19, of Nival Strat's: the fill's transform went from none, a whole
   track, to the share). */
@property --meter-level {
  syntax: '<number>';
  inherits: true;
  initial-value: 0;
}
.n-meter {
  --meter-level: var(--level, 0);
  display: block;
  width: 100%;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--meter-track, var(--n-line2));
  overflow: hidden;
  transition: --meter-level var(--t-mid) var(--ease);
}
@starting-style {
  .n-meter {
    --meter-level: 0;
  }
}
.n-meter > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--meter-fill, var(--n-primary-art) var(--n-primary));
  transform-origin: left;
  transform: scaleX(var(--meter-level));
}
/* Busy with no level to show (an installer, a download of no known size): a short piece of ink
   travels along the track, round after round, never a made-up share. */
.n-meter[data-unknown] > span {
  width: 36%;
  transform: none;
  transition: none;
  /* `--meter-at`: where on a clock of its place's it is (a cover's line: the update's, cover.css). */
  animation: n-meter-run calc(var(--t-loop) / 2) var(--ease-io) var(--meter-at) infinite;
}
@property --meter-at {
  syntax: '<time>';
  inherits: true;
  initial-value: 0s;
}
@keyframes n-meter-run {
  from {
    translate: -100% 0;
  }
  to {
    translate: 280% 0;
  }
}
/* One canonical linear bar design everywhere in Nival (Renjume, 2026-11-29, e68: "we agreed to only have 1 bar design,
   that bar we use for updates in the settings and that across everywhere in nival"): every linear `.n-meter` — known
   level, indeterminate running, cover/update/curtain, deep progress, and countdown drain — keeps the exact 6 px
   rounded pill track (`--n-line2`) and `--n-primary` pill fill. `data-line` only slims circular rings
   (`.n-meter[data-ring][data-line]`, 2 px stroke for small rings beside words), never linear bars. */
/* A level that's a warning (a drive nearly full, the last seconds of a countdown). */
.n-meter[data-tone='danger'] > span {
  background: var(--n-danger-art) var(--n-danger);
}
/* Not at work: its place kept, unseen. */
.n-meter[data-unknown] {
  transition:
    opacity var(--t-mid) var(--ease),
    --meter-level var(--t-mid) var(--ease);
}
.n-meter[data-idle] {
  opacity: 0;
}
.n-meter[data-idle] > span {
  animation-play-state: paused;
}
/* Time left (`data-drain`, `--meter-for`): the bar starts full and empties at an even pace over that time (an undo's
   few seconds, a button that arms after a wait, a timed test). The one countdown (Renjume, 2026-11-19: "there should be
   1 loading bar design not 10": Nival Operator's DrainBar and Nival Trader's hold fill were bars of their own). It keeps
   going under reduced motion: the time left is what it says, not a flourish. */
.n-meter[data-drain] > span {
  transform: scaleX(1);
  animation: n-meter-drain var(--meter-for) linear forwards;
}
@keyframes n-meter-drain {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}
/* The same level in a circle (`data-ring`, `--ring` its size): the bar's track and fill, the fill going round from the
   top as the bar's goes along, at the bar's thickness (6 px; `data-line`, the slim one's 2 px, for a small ring beside
   words). A worker's budget, a topic's mastery, a test's score (Renjume, 2026-11-19: the shell's worker knot, Nival
   Code's mark and Nival Operator's rings were drawn three ways). It grows in and moves as the bar's fill does. */
.n-meter[data-ring] {
  --ring-w: 6px;
  width: var(--ring, 20px);
  height: var(--ring, 20px);
  flex: none;
  border-radius: 50%;
  mask: radial-gradient(farthest-side, transparent calc(100% - var(--ring-w) - 0.5px), #000 calc(100% - var(--ring-w)));
}
.n-meter[data-ring][data-line] {
  --ring-w: 2px;
}
.n-meter[data-ring] > span {
  width: 100%;
  border-radius: 50%;
  transform: none;
  transition: none;
  background: conic-gradient(var(--meter-fill, var(--n-primary)) calc(var(--meter-level) * 1turn), transparent 0);
}
.n-meter[data-ring][data-tone='danger'] > span {
  background: conic-gradient(var(--n-danger) calc(var(--meter-level) * 1turn), transparent 0);
}
/* A ring with no level is its track alone: nothing goes round (a busy mark breathes, never turns). */
.n-meter[data-ring][data-unknown] > span {
  animation: none;
  background: none;
}
/* Something at work with nothing to measure: a small dot breathing, never a
   turning mark (Renjume, 2026-10-27: "i dont like the button spinning animation"), the one time every busy mark
   breathes on. Its own breath (`n-busy`), so an app needn't have one of its own. */
@keyframes n-busy {
  from {
    opacity: 1;
    scale: 1;
  }
  to {
    opacity: var(--busy-o);
    scale: var(--busy-s);
  }
}
.n-busy {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--n-ink-art) var(--n-ink);
  animation: n-busy calc(var(--t-turn) * 1.4) var(--ease-io) infinite alternate;
  --busy-o: 0.35;
  --busy-s: 0.7;
}
.n-busy[data-small] {
  width: 6px;
  height: 6px;
}
/* Paused: it holds still and dim. */
.n-busy[data-still] {
  animation: none;
  opacity: 0.35;
}
/* What's at work is a mark of its own (the assistant's spark, a button's icon while it waits, a device being paired):
   `data-n-busy` on it, and it breathes on the dot's clock, dimming less and drawing in less, as a mark carries more
   than a dot (Renjume, 2026-11-19: every busy mark breathed at its own depth and pace, five of them). On what holds an
   icon (a button, the mark's circle) it's the icon that breathes, so what's round it keeps still. */
[data-n-busy]:not(:has(> svg)),
[data-n-busy] > svg {
  animation: n-busy calc(var(--t-turn) * 1.4) var(--ease-io) infinite alternate;
  --busy-o: 0.45;
  --busy-s: 0.88;
}
[data-n-busy='still']:not(:has(> svg)),
[data-n-busy='still'] > svg {
  animation: none;
  opacity: 0.45;
}
@media (prefers-reduced-motion: reduce) {
  .n-meter,
  .n-meter[data-unknown] {
    transition: none;
  }
  /* No travelling: the piece rests in the middle of its track, which still says busy. */
  .n-meter[data-unknown] > span {
    animation: none;
    translate: 89% 0;
  }
  .n-meter[data-ring][data-unknown] > span {
    translate: none;
  }
  .n-busy,
  [data-n-busy],
  [data-n-busy] > svg {
    animation: none;
  }
}

/* A skeleton's bar: what stands where something is still loading (Renjume, 2026-11-24: "i kall these loading place holders
 * skeletons. from now one skeletons should haveae teh same size and positioning of the content thats being loaded"; first
 * 2026-10-07, "make it either show that its loading or fix the issue"). Where it stands and how big it is are its content's
 * own: skeletons.js lays the bars out (skeleton.css), and nothing else draws one. It fills as the second layer does, never as a
 * button (Renjume, 2026-11-20: "there should only be 1 button color and nothing else should have it"), with a quiet wash over
 * it (--n-layer-wash): it lies on cards of that same fill most of all, where without the wash only its passing light is seen.
 * With reduced motion the light rests in its middle. `.n-loading` is its name from before, a pill or a line (`.text`) of a size
 * of its own: only while an app still has one of those (its place of it becomes a skeleton). */
.n-skeleton,
.n-loading {
  display: inline-block;
  border-radius: var(--r-pill);
  background:
    linear-gradient(100deg, transparent 30%, var(--n-press-tint) 50%, transparent 70%) 0 0 / 220% 100% no-repeat,
    linear-gradient(var(--n-layer-wash) 0 0) var(--n-layer);
  animation: n-skeleton calc(var(--t-loop) / 2) linear infinite, n-fade-in var(--t-fast) linear backwards;
  vertical-align: middle;
}
.n-loading {
  width: 84px;
  height: 30px;
}
.n-loading.text {
  width: 9em;
  height: 0.9em;
}
@keyframes n-skeleton {
  from {
    background-position: 120% 0;
  }
  to {
    background-position: -120% 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .n-skeleton,
  .n-loading {
    animation: none;
    background-position: 50% 0;
  }
}

/* Windows' high contrast (the notes' high-contrast.md 2, 2026-11-24): fills and gradients are gone there, so a track and its
   level were one colour, and the ring and the dot not there at all. Windows' own colours, named; nothing outside it. */
@media (forced-colors: active) {
  .n-meter:not([data-ring]) {
    outline: var(--line-hair) solid CanvasText;
  }
  .n-meter > span,
  .n-meter[data-tone='danger'] > span {
    forced-color-adjust: none;
    background: Highlight;
  }
  /* The ring's mask cuts an outline away: its track is a line of its own, at its edge. */
  .n-meter[data-ring] {
    forced-color-adjust: none;
    background: radial-gradient(farthest-side, transparent calc(100% - var(--line-hair)), CanvasText 0);
  }
  .n-meter[data-ring] > span,
  .n-meter[data-ring][data-line] > span,
  .n-meter[data-ring][data-tone='danger'] > span {
    background: conic-gradient(Highlight calc(var(--meter-level) * 1turn), transparent 0);
  }
  .n-meter[data-ring][data-unknown] > span {
    background: none;
  }
  .n-busy {
    forced-color-adjust: none;
    background: CanvasText;
  }
}
