/* THE ACTION COMPONENT — page kit, C.58c.
 *
 * One filled primary button, outlined secondaries, a destructive button
 * outlined red that arms itself in place, and one status line under the
 * row where the word appears after the press.
 *
 * THE STATUS LINE ALWAYS OCCUPIES ITS ROW, empty or full. That is not
 * decoration: a line that appears out of nothing pushes everything below
 * it down at the exact moment the reader is looking at the button, which
 * is the page movement law 7 forbids. It is there from the first paint,
 * transparent, and only its opacity changes — so the after-action word
 * costs the page not one pixel of height. The rule that makes that true
 * rather than intended is at the bottom of this file, and the five
 * pixels it was out by the first time are written down beside it.
 *
 * The two durations are tokens for the same reason every other number
 * is: kit/action.js reads them off the element with getComputedStyle
 * rather than carrying them, so how long a word stands is a property of
 * the component and a change to it is a change to the resource.
 *
 * NOT ONE LENGTH IS WRITTEN HERE — see kit-choice.css.
 */

.kit-action {
  margin-top: var(--rhythm-between);
  max-width: var(--measure);
}

.kit-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3);
}

.kit-action-note,
.kit-action-limit {
  margin-top: 0;
  margin-bottom: var(--rhythm-within);
}

.kit-button {
  font: inherit;
  font-weight: 650;
  min-height: var(--tap);
  padding: var(--s2) var(--s4);
  border-radius: var(--radius-sm);
  border: var(--hairline) solid transparent;
  cursor: pointer;
}

/* A way on drawn as a button (a spec with `href`): the same box, no
 * underline, its word centred like a button's. */
a.kit-button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.kit-button-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.kit-button-secondary {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line-strong);
}

/* THE CHOSEN ONE OF A ROW OF WAYS (C.131): a filter or a period preset
   that is the page's current reading wears the accent's soft fill and
   its frame, and says so to a screen reader (`aria-current`); before,
   the statistics' presets carried the `data-current` hook and no look */
.kit-button-secondary[data-current] {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

/* THE QUIET ACTION (card redesign 01.11.2026, CARD_REDESIGN D2 and law
 * CR2): the fourth of the kit's control kinds beside primary, secondary
 * and the choice's segment - a press that is the way out of a thing
 * rather than its job („Auswahl aufheben"), drawn as a link in the accent
 * ink: no fill, no border, underlined under the pointer and the keyboard
 * focus. It keeps the button's box, so its tap height is the kit's. */
.kit-button-quiet {
  background: transparent;
  color: var(--accent);
  border-color: transparent;
  border-width: 0;
  padding-inline: 0;
  font-weight: 500;
}

.kit-button-quiet:hover:not([disabled]),
.kit-button-quiet:focus-visible {
  text-decoration: underline;
}

.kit-button-destructive {
  background: var(--panel);
  color: var(--bad);
  border-color: var(--bad);
}

.kit-button[disabled],
.kit-button[aria-disabled="true"] {
  cursor: default;
  opacity: 0.6;
}

/* C.198: a primary that waits for boxes the reader can still tick looks
 * waiting, yet answers the press: formcheck.js brings the first missing
 * box into view and marks it, so the hand shows it can be pressed. */
.kit-button[aria-disabled="true"] {
  cursor: pointer;
}

/* Armed in place: the same button, in the same spot, saying the thing it
 * is about to do — no second dialog to close, nothing that moves. */
.kit-button-destructive.is-armed {
  background: var(--bad-soft);
  color: var(--bad);
}

.kit-destructive {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
}

/* -- the word where the control is --------------------------------- */

/* THE EMPTY LINE AND THE FULL LINE ARE THE SAME HEIGHT, and it took a
 * measurement to get that right. The first build reserved the row with
 * `min-height: var(--s4)` — 16 px, a guess — while the line box of the
 * word that lands in it is 21 px, so the document grew by five pixels at
 * the moment of the press and the scroll moved six. Five pixels is the
 * same defect as a hundred and twenty-nine: a page that moves under the
 * finger.
 *
 * So the row is not guessed at any more. The line height is STATED, and
 * the reserved height is the same token, so the box is that height with
 * a word in it and without one. A refusal long enough to wrap does grow
 * the page — a refusal is a real change of content and has to be
 * readable — and that is the one case this rule does not cover. */
.kit-action-status {
  margin-top: var(--rhythm-within);
  line-height: var(--s5);
  min-height: var(--s5);
  color: var(--good);
  opacity: 0;
  transition: opacity var(--kit-status-fade) linear;
}

.kit-action-status.is-shown {
  opacity: 1;
}

.kit-action-status.is-refused {
  color: var(--bad);
}

/* THE REASON A PRIMARY CANNOT BE PRESSED YET (C.58j, law 23): directly
 * under the row, in the help grey, present while the reason holds. */
.kit-action-reason {
  margin-top: var(--rhythm-within);
  margin-bottom: 0;
}

/* C.198: the reason is the row's own last part, on a line of its own,
 * so it sticks with the button it explains (the row's gap stands
 * above it). */
.kit-action-row > .kit-action-reason {
  flex-basis: 100%;
  margin-top: 0;
}

/* A LINE THE ANSWER NO LONGER CARRIES, kept where the reader pressed it
 * (C.58h): a deleted job's row stays in its place, in the quiet ink, its
 * controls switched off and the server's words in its status line, so
 * nothing slides under the reader's finger. The next visit to the page
 * no longer shows it. */
[data-kit-gone] {
  color: var(--ink-soft);
}

[data-kit-gone] code {
  color: inherit;
}

/* A PART IN ITS PARENT'S FLOW (C.196, `claim(key, flow=true)`): no box
 * of its own, so the grid or stack around it lays its children out as
 * if the part were not there. */
.kit-claim-flow {
  display: contents;
}

@media (prefers-reduced-motion: reduce) {
  .kit-action-status {
    transition: none;
  }
}
