@layer cinder.tokens, cinder.foundation, cinder.components, cinder.utilities;
/* Compound composition aggregation: ApprovalCard renders these primitives
 * internally, so `cinder/approval-card/styles` must include their styling when
 * consumers import the component-specific style sidecar. Sibling paths mirror
 * between `src/` and generated `dist/`. */
@import '/assets/f47cf25678047dc1d0c5372c25b330b4ffdf35604610caa62c68ff9ad26b877e/components/alert/alert.css';
@import '/assets/f47cf25678047dc1d0c5372c25b330b4ffdf35604610caa62c68ff9ad26b877e/components/badge/badge.css';
@import '/assets/f47cf25678047dc1d0c5372c25b330b4ffdf35604610caa62c68ff9ad26b877e/components/button/button.css';
@import '/assets/f47cf25678047dc1d0c5372c25b330b4ffdf35604610caa62c68ff9ad26b877e/components/card/card.css';
@import '/assets/f47cf25678047dc1d0c5372c25b330b4ffdf35604610caa62c68ff9ad26b877e/components/checkbox/checkbox.css';
@import '/assets/f47cf25678047dc1d0c5372c25b330b4ffdf35604610caa62c68ff9ad26b877e/components/code-block/code-block.css';
@import '/assets/f47cf25678047dc1d0c5372c25b330b4ffdf35604610caa62c68ff9ad26b877e/components/copy-button/copy-button.css';
@import '/assets/f47cf25678047dc1d0c5372c25b330b4ffdf35604610caa62c68ff9ad26b877e/components/description-list/description-list.css';
@import '/assets/f47cf25678047dc1d0c5372c25b330b4ffdf35604610caa62c68ff9ad26b877e/components/json-editor/json-editor.css';
@import '/assets/f47cf25678047dc1d0c5372c25b330b4ffdf35604610caa62c68ff9ad26b877e/components/json-viewer/json-viewer.css';
@import '/assets/f47cf25678047dc1d0c5372c25b330b4ffdf35604610caa62c68ff9ad26b877e/components/link/link.css';
@import '/assets/f47cf25678047dc1d0c5372c25b330b4ffdf35604610caa62c68ff9ad26b877e/components/payload-inspector/payload-inspector.css';
@import '/assets/f47cf25678047dc1d0c5372c25b330b4ffdf35604610caa62c68ff9ad26b877e/components/status-dot/status-dot.css';
@import '/assets/f47cf25678047dc1d0c5372c25b330b4ffdf35604610caa62c68ff9ad26b877e/components/textarea/textarea.css';
@import '/assets/f47cf25678047dc1d0c5372c25b330b4ffdf35604610caa62c68ff9ad26b877e/components/tooltip/tooltip.css';

@layer cinder.components {
  .cinder-approval-card {
    display: block;
    /* Narrow rules ask about the card's own width, so a phone and a narrow pane read the same. */
    container-type: inline-size;
    line-height: var(--cinder-leading-normal);
  }

  .cinder-approval-card__surface {
    overflow: hidden;
  }

  /* ----------------------------------------
   * Header: risk glyph, then source, question, tool and risk word
   * ---------------------------------------- */

  /* The first row of the body, on the card's own fill: no band, no divider and no padding of its
   * own. Neutral even for a dangerous tool; the glyph carries the alert. */
  .cinder-approval-card__header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--cinder-space-2) var(--cinder-space-3);
  }

  .cinder-approval-card__title-group {
    display: flex;
    flex-direction: column;
    flex: 1 1 14rem;
    gap: var(--cinder-gap-stack);
    min-inline-size: 10rem;
  }

  .cinder-approval-card__eyebrow,
  .cinder-approval-card__risk-line,
  .cinder-approval-card__consequence {
    margin: 0;
    color: var(--cinder-text-subtle);
    font-size: var(--cinder-text-sm);
    line-height: var(--cinder-leading-normal);
  }

  .cinder-approval-card__title {
    margin: 0;
    color: var(--cinder-text-default);
    font-size: var(--cinder-text-base);
    font-weight: var(--cinder-font-semibold);
    /* Every line of an approval keeps the body line height; groups stand apart by the stack gap. */
    line-height: var(--cinder-leading-normal);
    overflow-wrap: anywhere;
    /* A heading balances its lines by default, which breaks a title early with room left; the
     * approval card's titles fill each line before they break. */
    text-wrap: wrap;
  }

  .cinder-approval-card__title-tool,
  .cinder-approval-card__tool-identifier {
    font-family: var(--cinder-font-mono);
  }

  .cinder-approval-card__tool-identifier {
    font-size: var(--cinder-text-xs);
    white-space: nowrap;
  }

  /* The pieces of a metadata line (tool, risk word, who asked, when) are told apart by a gap and a
   * step in weight and colour, never by a comma (COR-2445): the tool label is medium in the body
   * colour; the rest of the line is regular and subtle, with the time in tabular numerals. */
  .cinder-approval-card__tool-label {
    color: var(--cinder-text-default);
    font-weight: var(--cinder-font-medium);
  }

  /* Risk words are muted regular text everywhere, "Dangerous" included. */
  .cinder-approval-card__risk-word {
    color: var(--cinder-text-subtle);
    font-weight: var(--cinder-font-normal);
  }

  /* Who asked is one step stronger than when: muted against the subtle time, so the two are not a
   * bare run of words in one weight and one colour (COR-2445). */
  .cinder-approval-card__line-source > span,
  .cinder-approval-card__eyebrow > span,
  .cinder-approval-card__detail-ask > span {
    color: var(--cinder-text-muted);
  }

  /* The gap that stands where the comma was, beside the space the markup keeps for the reader. */
  .cinder-approval-card__keep + .cinder-approval-card__keep,
  .cinder-approval-card__line-tool:has(*) + .cinder-approval-card__line-source,
  .cinder-approval-card__line-source > span + time,
  .cinder-approval-card__eyebrow > * + *,
  .cinder-approval-card__detail-ask > * + *,
  .cinder-approval-card__risk-word + .cinder-approval-card__undone,
  .cinder-approval-card__tool-identifier + .cinder-approval-card__risk-word,
  .cinder-approval-card__outcome-word + .cinder-approval-card__outcome-time,
  .cinder-approval-card__outcome-time + .cinder-approval-card__outcome-trailing,
  .cinder-approval-card__outcome-word + .cinder-approval-card__outcome-trailing {
    margin-inline-start: var(--cinder-space-1-5);
  }

  /* "Can't be undone" is a step darker than the risk word beside it (the detail layout sets it
   * in the body colour and semibold). */
  .cinder-approval-card__risk-line .cinder-approval-card__undone {
    color: var(--cinder-text-muted);
  }

  .cinder-approval-card__line time,
  .cinder-approval-card__eyebrow time,
  .cinder-approval-card__detail-ask time,
  .cinder-approval-card__outcome-time {
    font-variant-numeric: tabular-nums;
  }

  .cinder-approval-card__input-pairs > .cinder-approval-card__pair-label:not(:first-child) {
    margin-inline-start: var(--cinder-space-1-5);
  }

  /* "Can't be undone" never breaks across lines. */
  .cinder-approval-card__undone {
    white-space: nowrap;
  }

  .cinder-approval-card__badges {
    display: flex;
    flex: 0 1 auto;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--cinder-space-2);
  }

  /* StatusDot and Badge each define their own type scale per size step, and
     those scales don't line up 1:1 (StatusDot's "sm" label text is larger
     than Badge's "sm" text). Force every status/expiry indicator in this
     row to the same font-size so the row reads as one cohesive unit. */
  .cinder-approval-card__badges .cinder-status-dot[data-cinder-size='sm'],
  .cinder-approval-card__badges .cinder-badge[data-cinder-size='sm'] {
    font-size: var(--cinder-text-xs);
  }

  /* One glyph for every risk: the shield carries the alert in amber while the approval waits
   * on someone, and goes quiet once it is decided or cannot be answered. */
  .cinder-approval-card__risk-icon {
    display: inline-flex;
    flex: none;
    align-items: center;
    margin-block-start: 2px;
    border-radius: var(--cinder-radius-sm);
    color: var(--cinder-status-warning-text);
    font: inherit;
  }

  .cinder-approval-card__risk-icon[data-cinder-risk='low'],
  .cinder-approval-card:not([data-cinder-state='pending']) .cinder-approval-card__risk-icon {
    color: var(--cinder-text-subtle);
  }

  .cinder-approval-card__risk-icon:focus-visible {
    /* cinder-focus-ring-owner: parent — the trigger self-owns its box-shadow
       ring; the outline is intentionally suppressed. */
    outline: none;
    box-shadow:
      0 0 0 var(--cinder-ring-offset, 1px) var(--cinder-ring-offset-color),
      0 0 0 calc(var(--cinder-ring-offset, 1px) + var(--cinder-ring-width)) var(--cinder-ring-color);
  }

  /* ----------------------------------------
   * Body sections
   * ---------------------------------------- */

  /* One --cinder-space-3 inset, and the stack gap between groups, as in the row layout. */
  .cinder-approval-card__body {
    display: flex;
    flex-direction: column;
    gap: var(--cinder-gap-stack);
    padding: var(--cinder-space-3);
  }

  .cinder-approval-card__section {
    display: flex;
    flex-direction: column;
    gap: var(--cinder-space-2);
  }

  .cinder-approval-card__section-title {
    margin: 0;
    color: var(--cinder-text-default);
    font-size: var(--cinder-text-sm);
    font-weight: var(--cinder-font-semibold);
  }

  .cinder-approval-card__muted {
    margin: 0;
    color: var(--cinder-text-muted);
    font-size: var(--cinder-text-sm);
  }

  /* ----------------------------------------
   * Files touched
   * ---------------------------------------- */

  .cinder-approval-card__file-list {
    display: flex;
    flex-direction: column;
    max-block-size: 14rem;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  /* A flat row: the file glyph, the path, then the copy button at the inline end. No chip, no
   * border; the glyph is what marks the line as a file. */
  .cinder-approval-card__file {
    display: flex;
    align-items: flex-start;
    gap: var(--cinder-space-2);
    padding-block: var(--cinder-space-0-5);
  }

  .cinder-approval-card__file-icon {
    flex: none;
    /* Centred on the first line of the path (xs text at the snug leading). */
    margin-block-start: calc((var(--cinder-text-xs) * var(--cinder-leading-snug) - 16px) / 2 + 2px);
    color: var(--cinder-accent-text);
  }

  .cinder-approval-card__file-path {
    flex: 1 1 auto;
    min-inline-size: 0;
    padding-block-start: 2px;
    overflow-wrap: anywhere;
    font-family: var(--cinder-font-mono);
    font-size: var(--cinder-text-xs);
    line-height: var(--cinder-leading-snug);
    text-align: start;
  }

  /* The directory recedes and the name carries the line. A line breaks after a slash first, so the
   * name stays whole; only a name wider than the card itself breaks inside. */
  .cinder-approval-card__file-directory,
  .cinder-approval-card__file-name {
    /* Whole pieces: a hyphen inside "run-step-timeline.svelte" is no place to break. */
    display: inline-block;
    max-inline-size: 100%;
    overflow-wrap: anywhere;
  }

  .cinder-approval-card__file-directory {
    color: var(--cinder-text-subtle);
  }

  .cinder-approval-card__file-name {
    color: var(--cinder-text-default);
    font-weight: var(--cinder-font-medium);
  }

  .cinder-approval-card__file .cinder-approval-card__file-copy {
    flex: 0 0 auto;
    margin-inline-start: auto;
    padding: var(--cinder-space-1);
    border: none;
  }

  /* ----------------------------------------
   * Environment names
   * ---------------------------------------- */

  .cinder-approval-card__environment-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--cinder-space-2);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  /* ----------------------------------------
   * Resolution controls and actions
   * ---------------------------------------- */

  .cinder-approval-card__actions {
    display: flex;
    flex-direction: column;
    gap: var(--cinder-space-3);
  }

  .cinder-approval-card__resolution-controls {
    display: flex;
    flex-direction: column;
    gap: var(--cinder-space-2);
  }

  /* A line of context above the question, such as "Test chat, this runs for real". */
  .cinder-approval-card__context {
    color: var(--cinder-text-subtle);
    font-size: var(--cinder-text-sm);
    line-height: var(--cinder-leading-normal);
  }

  .cinder-approval-card__asker {
    display: flex;
    gap: var(--cinder-space-1);
    margin: var(--cinder-space-1) 0 0;
  }

  .cinder-approval-card__asker-time {
    color: var(--cinder-text-muted);
  }

  /* Why the last answer did not go through: Alert's tinted, bordered danger message, drawn as one
   * compact line of a glyph, the bold summary and the reason. */
  .cinder-approval-card__failure.cinder-alert {
    align-items: flex-start;
    gap: var(--cinder-space-2);
    padding: var(--cinder-space-2-5) var(--cinder-space-3);
    border-radius: var(--cinder-radius-md);
    font-size: var(--cinder-text-sm);
    line-height: var(--cinder-leading-normal);
  }

  .cinder-approval-card__failure .cinder-alert__icon {
    inline-size: 1rem;
    block-size: 1rem;
  }

  .cinder-approval-card__failure-summary {
    font-weight: var(--cinder-font-semibold);
  }

  /* What the approval led to, once it is decided. */
  .cinder-approval-card__result {
    margin: 0;
    color: var(--cinder-text-default);
    font-size: var(--cinder-text-sm);
    line-height: var(--cinder-leading-normal);
  }

  .cinder-approval-card__result-label {
    font-weight: var(--cinder-font-semibold);
  }

  /* What happens once the approver decides, under the buttons. */
  .cinder-approval-card__footnote {
    margin: 0;
    color: var(--cinder-text-subtle);
    font-size: var(--cinder-text-sm);
    line-height: var(--cinder-leading-normal);
    text-align: end;
  }

  /* The "Allow <tool> for ..." checkbox sits on its own line before Deny and Approve. */
  .cinder-approval-card__remember {
    display: flex;
    font-size: var(--cinder-text-sm);
  }

  /* A long label ("Allow Issue refund for the rest of this chat") wraps beside its box, not under it. */
  .cinder-approval-card__remember .cinder-checkbox-field {
    flex-wrap: nowrap;
    align-items: flex-start;
  }

  .cinder-approval-card__remember .cinder-checkbox-field > .cinder-form-field__label {
    min-inline-size: 0;
  }

  /* Why Deny and Approve are off, or why an approval cannot be answered now. */
  .cinder-approval-card__reason {
    margin: 0;
    color: var(--cinder-text-subtle);
    font-size: var(--cinder-text-sm);
    line-height: var(--cinder-leading-normal);
  }

  .cinder-approval-card__action-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--cinder-space-3);
  }

  .cinder-approval-card__action-buttons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--cinder-space-2);
    margin-inline-start: auto;
  }

  .cinder-approval-card__editor {
    display: flex;
    flex-direction: column;
    gap: var(--cinder-space-2);
    border: 1px solid var(--cinder-border-muted);
    border-radius: var(--cinder-radius-md);
    padding: var(--cinder-space-3);
    background: var(--cinder-surface-inset);
  }

  .cinder-approval-card__editor-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--cinder-space-2);
  }

  /* ----------------------------------------
   * Read-only summary for terminal states
   * ---------------------------------------- */

  .cinder-approval-card__readonly-summary {
    margin: 0;
    border: 1px solid var(--cinder-border-muted);
    border-radius: var(--cinder-radius-md);
    padding: var(--cinder-space-3);
    background: var(--cinder-surface-inset);
    color: var(--cinder-text-muted);
    font-size: var(--cinder-text-sm);
  }

  /* In the row the notice lines up with the question, past the glyph. */
  .cinder-approval-card--row > .cinder-approval-card__readonly-summary {
    margin-inline-start: calc(16px + var(--cinder-space-2));
  }

  .cinder-approval-card__readonly-summary[data-cinder-state='approved'],
  .cinder-approval-card__readonly-summary[data-cinder-state='approved_with_edits'] {
    border-color: var(--cinder-status-success-border);
    background: var(--cinder-status-success-background);
    color: var(--cinder-status-success-text);
  }

  /* ----------------------------------------
   * Card disclosures: the arguments, then Details (sandbox, environment, request metadata)
   * ---------------------------------------- */

  /* Flat chevron lines in the row layout's style, with no box around them: they sit between the
   * files and the decision, one --cinder-space-1 apart. */
  .cinder-approval-card__disclosures {
    display: flex;
    flex-direction: column;
    gap: var(--cinder-space-1);
    font-size: var(--cinder-text-sm);
  }

  .cinder-approval-card__details-content {
    display: flex;
    flex-direction: column;
    gap: var(--cinder-space-3);
    padding-block: var(--cinder-space-1);
  }

  .cinder-approval-card__details-group {
    display: flex;
    flex-direction: column;
    gap: var(--cinder-space-1);
  }

  .cinder-approval-card__details-label {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: var(--cinder-space-2);
    margin: 0;
    color: var(--cinder-text-default);
    font-size: var(--cinder-text-xs);
    font-weight: var(--cinder-font-semibold);
  }

  .cinder-approval-card__details-label .cinder-approval-card__muted {
    font-size: var(--cinder-text-xs);
    font-weight: var(--cinder-font-normal);
    text-transform: none;
    letter-spacing: normal;
  }

  .cinder-approval-card__metadata {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: var(--cinder-space-3);
    margin: 0;
  }

  .cinder-approval-card__metadata--compact {
    gap: var(--cinder-space-2);
  }

  .cinder-approval-card__metadata-item {
    min-inline-size: 0;
  }

  .cinder-approval-card__metadata-item dt {
    color: var(--cinder-text-muted);
    font-size: var(--cinder-text-xs);
    font-weight: var(--cinder-font-medium);
  }

  .cinder-approval-card__metadata-item dd {
    display: flex;
    flex-direction: column;
    gap: var(--cinder-space-1);
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--cinder-text-default);
    font-family: var(--cinder-font-mono);
    font-size: var(--cinder-text-xs);
  }

  .cinder-approval-card__metadata-help {
    color: var(--cinder-text-muted);
    font-family: var(--cinder-font-sans);
    font-size: var(--cinder-text-xs);
  }

  /* ----------------------------------------
   * Row layout: the shared approval row on a neutral raised surface
   * ---------------------------------------- */

  /* Groups (the question, expiry and risk, the tool and who asked, the input, the actions) stand
   * apart by the stack gap; the lines inside a group keep the body line height and no gap. */
  .cinder-approval-card--row {
    display: flex;
    flex-direction: column;
    gap: var(--cinder-gap-stack);
    box-sizing: border-box;
    border: 1px solid var(--cinder-border);
    border-radius: var(--cinder-radius-lg);
    padding: var(--cinder-space-3);
    background: var(--cinder-surface-raised);
    font-size: var(--cinder-text-sm);
  }

  .cinder-approval-card__row {
    display: flex;
    align-items: flex-start;
    gap: var(--cinder-space-2);
  }

  .cinder-approval-card__row-main {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: var(--cinder-gap-stack);
    min-inline-size: 0;
  }

  .cinder-approval-card__row-title-line {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: var(--cinder-gap-stack) var(--cinder-space-2);
    min-inline-size: 0;
  }

  /* The question may wrap: a long title never truncates. */
  .cinder-approval-card__row-question {
    /* The title takes the line at its natural size, so a trailing badge is what wraps (the
     * decision head does the same). */
    flex: 0 1 auto;
    min-inline-size: 0;
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--cinder-text-default);
    font-size: var(--cinder-text-base);
    font-weight: var(--cinder-font-semibold);
    line-height: var(--cinder-leading-normal);
    text-wrap: wrap;
  }

  /* Decided on another page: a glyph in the decision's tone stands where the risk shield stood,
     and the question is the size of the line under it. */
  .cinder-approval-card__decided-glyph {
    display: inline-flex;
    flex: none;
    align-items: center;
    /* One line tall, so the glyph is centred on the question's first line. */
    block-size: 1lh;
    color: var(--cinder-text-subtle);
  }

  .cinder-approval-card__decided-glyph[data-cinder-tone='success'] {
    color: var(--cinder-status-success-text);
  }

  .cinder-approval-card__row[data-cinder-collapsed] .cinder-approval-card__row-question {
    font-size: var(--cinder-text-sm);
    line-height: var(--cinder-leading-normal);
  }

  .cinder-approval-card__line {
    margin: 0;
    color: var(--cinder-text-subtle);
    font-size: var(--cinder-text-sm);
    line-height: var(--cinder-leading-normal);
  }

  /* The line may wrap between the identifier, the risk word and "Can't be undone", but never inside
   * one of them: a piece stays whole with the comma that follows it, so a comma never starts a
   * line or stands alone, and a phone never cuts "Can't be undone" off at the card's edge. */
  .cinder-approval-card__keep {
    white-space: nowrap;
  }

  .cinder-approval-card__line time,
  .cinder-approval-card__eyebrow time,
  .cinder-approval-card__detail-ask time {
    white-space: nowrap;
  }

  /* The state word at the right of the title: neutral, never a colour. */
  .cinder-approval-card__state-word {
    flex: none;
    color: var(--cinder-text-subtle);
    font-size: var(--cinder-text-sm);
    white-space: nowrap;
  }

  /* Everything below the title lines up with the question, past the glyph. */
  .cinder-approval-card__row-body,
  .cinder-approval-card--row > .cinder-approval-card__result {
    display: flex;
    flex-direction: column;
    gap: var(--cinder-gap-stack);
    margin: 0;
    padding-inline-start: 0;
  }

  /* Only a row collapsed to its outcome draws a glyph before the question; the outcome under it
   * lines up past that glyph. Otherwise the outcome starts at the content edge, as the input does. */
  .cinder-approval-card--row:has(> .cinder-approval-card__row[data-cinder-collapsed])
    > .cinder-approval-card__outcome {
    padding-inline-start: calc(16px + var(--cinder-space-2));
  }

  /* Running text, so a long chat title wraps and a comma stays with what it follows. */
  .cinder-approval-card__outcome {
    margin: 0;
    color: var(--cinder-text-subtle);
    font-size: var(--cinder-text-sm);
    line-height: var(--cinder-leading-normal);
  }

  /* A decision reads as neutral text with a quiet dot, whatever was decided. */
  .cinder-approval-card__outcome-word {
    display: inline-flex;
    align-items: center;
    gap: var(--cinder-space-2);
    font-weight: var(--cinder-font-semibold);
  }

  .cinder-approval-card__outcome-dot {
    flex: none;
    inline-size: 8px;
    block-size: 8px;
    border-radius: var(--cinder-radius-full);
    background: var(--cinder-text-subtle);
  }

  /* An approval is green; a denial, an expiry and every other decision stay neutral. */
  .cinder-approval-card__outcome[data-cinder-tone='success'] .cinder-approval-card__outcome-dot {
    background: var(--cinder-status-success-solid);
  }

  /* Where the question was asked, after the outcome and its time. */
  .cinder-approval-card__outcome-trailing {
    overflow-wrap: anywhere;
  }

  /* The note the approver left: "Your note", the note, then where it went. */
  .cinder-approval-card__decision-note {
    margin: 0;
    color: var(--cinder-text-muted);
    font-size: var(--cinder-text-sm);
    line-height: var(--cinder-leading-normal);
    overflow-wrap: anywhere;
  }

  /* The same label as "Result:": one weight and ink, and the one space the markup leaves after it
   * is the whole gap, so a note and a result under it start their words the same distance in. */
  .cinder-approval-card__decision-note-label,
  .cinder-approval-card__result-label {
    color: var(--cinder-text-default);
    font-weight: var(--cinder-font-semibold);
  }

  /* In a receipt's details the note and the result read as one list: both values in the default
   * ink, the labels carrying the difference. */
  .cinder-approval-card__receipt-details .cinder-approval-card__decision-note {
    color: var(--cinder-text-default);
  }

  .cinder-approval-card__decision-note-caption {
    margin-inline-start: var(--cinder-space-1);
    color: var(--cinder-text-subtle);
  }

  .cinder-approval-card__input {
    display: flex;
    flex-direction: column;
    gap: var(--cinder-space-1);
  }

  .cinder-approval-card__input-toggle:not(.cinder-disclosure-trigger) {
    appearance: none;
    display: flex;
    align-items: center;
    gap: var(--cinder-space-2);
    min-block-size: 24px;
    min-inline-size: 0;
    padding: 0;
    border: 0;
    border-radius: var(--cinder-radius-sm);
    background: none;
    color: var(--cinder-text-subtle);
    font: inherit;
    text-align: start;
    cursor: pointer;
  }

  /* Input, Why, Details and source-said disclosures share the compact Cinder trigger contract:
   * a text-sized desktop face, one token of vertical breathing room, and the coarse-pointer
   * target expansion below. */
  .cinder-approval-card__input-toggle,
  .cinder-approval-card__said-toggle {
    padding-block: var(--cinder-space-0-5);
  }

  .cinder-approval-card__input-toggle:focus-visible {
    outline: var(--cinder-ring-width) solid transparent;
    box-shadow: var(--_cinder-focus-ring-shadow);
  }

  .cinder-approval-card__input-toggle:not(.cinder-disclosure-trigger) svg {
    flex: none;
    align-self: center;
    margin-block-start: 1px;
    transition: transform var(--cinder-duration-fast) var(--cinder-ease-standard);
  }

  .cinder-approval-card__input-toggle:not(.cinder-disclosure-trigger) svg[data-cinder-open] {
    transform: rotate(90deg);
  }

  /* A collapsed disclosure points toward the inline end, so RTL mirrors it. */
  .cinder-approval-card__input-toggle:not(.cinder-disclosure-trigger):is(
      [dir='rtl'],
      [dir='rtl'] *
    ):where(:not([dir='rtl'] [dir='ltr'], [dir='rtl'] [dir='ltr'] *))
    svg:not([data-cinder-open]),
  .cinder-approval-card:has(
      :is(
          .cinder-approval-card__title,
          .cinder-approval-card__decision-title,
          .cinder-approval-card__row-question
        ):is([dir='rtl'], [dir='rtl'] *):where(
          :not([dir='rtl'] [dir='ltr'], [dir='rtl'] [dir='ltr'] *)
        )
    )
    :is(
      .cinder-approval-card__input-toggle:not(.cinder-disclosure-trigger),
      .cinder-approval-card__said-toggle
    )
    svg:not([data-cinder-open]),
  .cinder-approval-card[dir='rtl']
    :is(
      .cinder-approval-card__input-toggle:not(.cinder-disclosure-trigger),
      .cinder-approval-card__said-toggle
    )
    svg:not([data-cinder-open]) {
    transform: scaleX(-1);
  }

  .cinder-approval-card__input-word {
    flex: none;
    color: var(--cinder-text-muted);
    font-weight: var(--cinder-font-semibold);
  }

  /* The summary is one line: a few short pairs, cut with an ellipsis only if it must. */
  .cinder-approval-card__input-pairs {
    min-inline-size: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .cinder-approval-card__pair-value {
    color: var(--cinder-text-muted);
  }

  .cinder-approval-card__pair-value[data-cinder-muted] {
    color: var(--cinder-text-subtle);
    font-style: italic;
  }

  /* The input in the open, at the card's content edge with no chevron and no box: DescriptionList's
   * grid lays the pairs out (as many columns as the card is wide, each label over its value), and
   * "Show all" sits under the grid. */
  .cinder-approval-card__input-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--cinder-space-2);
    min-inline-size: 0;
  }

  .cinder-approval-card__input-list > .cinder-approval-card__input-rows {
    align-self: stretch;
  }

  .cinder-approval-card__input-list > .cinder-approval-card__input-rows[hidden] {
    display: none;
  }

  .cinder-approval-card__show-all {
    appearance: none;
    padding: 0;
    border: 0;
    border-radius: var(--cinder-radius-sm);
    background: none;
    color: var(--cinder-accent-text);
    font: inherit;
    font-weight: var(--cinder-font-medium);
    text-align: start;
    cursor: pointer;
  }

  @media (hover: hover) {
    .cinder-approval-card__show-all:hover {
      text-decoration: underline;
      text-underline-offset: 0.15em;
    }
  }

  .cinder-approval-card__show-all:focus-visible {
    outline: var(--cinder-ring-width) solid transparent;
    box-shadow: var(--_cinder-focus-ring-shadow);
  }

  .cinder-approval-card__row-input {
    display: flex;
    flex-direction: column;
    gap: var(--cinder-space-1);
  }

  .cinder-approval-card__row-input[hidden] {
    display: none;
  }

  .cinder-approval-card__note {
    display: flex;
    flex-direction: column;
  }

  .cinder-approval-card__row-actions {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    /* The decision buttons end at the trailing content edge on every line they occupy, the
     * primary last; the note toggle's auto margin keeps it at the leading end of the first line. */
    justify-content: flex-end;
    gap: var(--cinder-space-1);
    /* When the actions wrap, the next line stands clear of the note toggle's hit-area overhang
     * (a 44px area on a 28px face), so the armed primary never covers its lower edge. */
    row-gap: var(--cinder-space-3);
    inline-size: 100%;
    min-inline-size: 0;
    direction: ltr;
  }

  .cinder-approval-card--row .cinder-approval-card__row-actions {
    direction: inherit;
  }

  /* InlineConfirm owns the two-press state, but its action and status hint participate directly in
   * this row so Deny and the primary share one baseline and painted height. */
  .cinder-approval-card__row-actions .cinder-inline-confirm__two-press {
    display: contents;
  }

  .cinder-approval-card__row-actions .cinder-inline-confirm__two-press-hint {
    flex: 1 0 100%;
    order: 3;
    margin: 0;
    /* Under the primary, which ends the row at the trailing edge, and not across the card. */
    text-align: end;
  }

  /* Approval words are critical confirmation text. Keep them inside the equal action faces even
   * when the armed irreversible label is longer than the phone can fit. The shared Button keeps
   * its single-line label contract elsewhere; this local action composition is deliberately
   * allowed to reflow rather than truncate or paint over the neighbouring Deny target. */
  .cinder-approval-card--row .cinder-approval-card__row-actions .cinder-button {
    flex: 0 1 auto;
    inline-size: auto;
    max-inline-size: 100%;
    min-inline-size: var(--cinder-touch-target-min);
    block-size: auto;
    align-self: stretch;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: var(--cinder-leading-tight);
  }

  .cinder-approval-card--row .cinder-approval-card__row-actions .cinder-button__label {
    display: block;
    max-inline-size: 100%;
    overflow: hidden;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
  }

  /* "Add note" is a ghost small Cinder Button with a note icon, so it reads as a control and not
   * as a caption for Deny. The tooltip wrapper is the flex item: it keeps its size, centres against
   * the buttons and sits --cinder-space-3 from Deny (the row gap is the other --cinder-space-1). */
  .cinder-approval-card__note-toggle-tip {
    flex: none;
    align-self: center;
    /* The auto margin takes the row's free space, so the decision buttons are trailing-most; the
     * padding keeps the old gap to Deny when they fit beside it. */
    margin-inline-end: auto;
    padding-inline-end: var(--cinder-space-2);
  }

  /* Under 30rem of card width the words give way to the icon; they stay the accessible name and
   * the tooltip says them. */
  /* The ghost face is pulled back by its own inline padding so the glyph and label start on the
   * card's text column, the edge "Expires in" and the title use. Its 44px hit area comes from the
   * Button's own pseudo-element, which takes no layout. */
  .cinder-approval-card
    :is(.cinder-approval-card__row-actions, .cinder-approval-card__action-row)
    .cinder-button.cinder-approval-card__note-toggle {
    align-self: center;
    flex: none;
    inline-size: auto;
    max-inline-size: none;
    min-inline-size: max-content;
    block-size: var(--_cinder-painted-height-sm);
    min-block-size: var(--_cinder-painted-height-sm);
    white-space: nowrap;
    margin-inline-start: calc(-1 * var(--cinder-button-padding-x-sm));
  }

  /* On a card 30rem or wider the words never squeeze, clip or wrap: one line at the label's own
   * width, in the batch row layout as well as the single card. */
  .cinder-approval-card
    :is(.cinder-approval-card__row-actions, .cinder-approval-card__action-row)
    .cinder-approval-card__note-toggle
    .cinder-button__label {
    flex: none;
    max-inline-size: none;
    min-inline-size: max-content;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    overflow-wrap: normal;
  }

  /* Only when the row cannot hold the words on one line does the toggle take Button's icon-only
   * geometry (`data-cinder-note-compact`, set by `fitNoteLabel` from what the row measures): a
   * square face the height of a small button with the glyph centred, in Deny's outline. The words
   * stay the accessible name and the tooltip says them. */
  .cinder-approval-card
    .cinder-approval-card__row-actions
    .cinder-button.cinder-approval-card__note-toggle[data-cinder-note-compact] {
    inline-size: var(--_cinder-painted-height-sm);
    min-inline-size: var(--_cinder-painted-height-sm);
    block-size: var(--_cinder-painted-height-sm);
    min-block-size: var(--_cinder-painted-height-sm);
    padding-inline: 0;
    aspect-ratio: 1;
    justify-content: center;
    /* A lone glyph must read as a button: it takes Deny's outline and fill, and sits on the
     * card's leading content edge, not pulled back past it. */
    margin-inline-start: 0;
    border-color: var(--cinder-button-border);
    background: var(--cinder-button-background);
    color: var(--cinder-button-foreground);
  }

  .cinder-approval-card
    .cinder-approval-card__row-actions
    .cinder-button.cinder-approval-card__note-toggle[data-cinder-note-compact]:hover:not(
      :disabled
    ):not([aria-disabled='true']) {
    background: var(--cinder-surface-raised-hover);
  }

  .cinder-approval-card
    .cinder-approval-card__row-actions
    .cinder-approval-card__note-toggle[data-cinder-note-compact]
    .cinder-button__label {
    position: absolute;
    inline-size: 1px;
    min-inline-size: 0;
    block-size: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  /* ----------------------------------------
   * Decision layout: the explicit decision and its retained receipt
   * ---------------------------------------- */

  .cinder-approval-card--decision {
    display: flex;
    flex-direction: column;
    gap: var(--cinder-gap-stack);
    inline-size: 100%;
    min-inline-size: 0;
    box-sizing: border-box;
    border: 1px solid var(--cinder-border);
    border-radius: var(--cinder-radius-lg);
    padding: var(--cinder-space-3);
    background: var(--cinder-surface-raised);
    font-size: var(--cinder-text-sm);
  }

  .cinder-approval-card--decision[data-cinder-state='expired'] {
    border-style: dashed;
    border-color: var(--cinder-border);
    background: var(--cinder-surface-raised);
  }

  /* A settled card (expired, approved or denied) is the title on its own line, then one small muted
   * status line and, for an expired card, "Ask again" at the trailing end of it. Two text sizes in
   * all: the title's and the small one the status and the button share. The title uses the full
   * width before it wraps. */
  .cinder-approval-card__settled-row {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--cinder-space-1) var(--cinder-space-3);
    min-inline-size: 0;
  }

  .cinder-approval-card__settled-title {
    grid-column: 1 / -1;
    min-inline-size: 0;
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--cinder-text-default);
    font-size: var(--cinder-text-base);
    font-weight: var(--cinder-font-semibold);
    line-height: var(--cinder-leading-normal);
    text-align: start;
    text-wrap: wrap;
  }

  .cinder-approval-card__settled-note {
    grid-column: 1;
    margin: 0;
    color: var(--cinder-text-muted);
    font-size: var(--cinder-text-sm);
    line-height: var(--cinder-leading-normal);
    text-align: start;
  }

  /* A settled receipt is one scan line once the card has room: status, the action, and who made
   * it stay together; the host-owned time remains the single timestamp beneath the card. */
  @container (inline-size >= 30rem) {
    .cinder-approval-card__settled-row {
      grid-template-columns: auto minmax(0, 1fr) auto;
      column-gap: var(--cinder-space-2);
    }

    .cinder-approval-card__settled-title {
      grid-column: 2;
      grid-row: 1;
      font-size: var(--cinder-text-sm);
      line-height: var(--cinder-leading-normal);
    }

    .cinder-approval-card__settled-note {
      grid-column: 1;
      grid-row: 1;
      white-space: nowrap;
    }

    .cinder-approval-card__settled-actions {
      grid-column: 3;
      grid-row: 1;
    }
  }

  /* An approval or a denial's line starts with a quiet dot in its tone and the word for what was
   * decided: green for an approval, neutral for a denial. The dot is the line's only mark. */
  .cinder-approval-card__settled-dot {
    display: inline-block;
    inline-size: 8px;
    block-size: 8px;
    /* Top-aligned to the line, then half the line less half the dot: centred on the first line. */
    margin-block-start: calc((1lh - 8px) / 2);
    margin-inline-end: var(--cinder-space-2);
    vertical-align: top;
    border-radius: var(--cinder-radius-full);
    background: var(--cinder-text-subtle);
  }

  .cinder-approval-card__settled-row[data-cinder-tone='success']
    .cinder-approval-card__settled-dot {
    background: var(--cinder-status-success-solid);
  }

  /* "Ask again" is last, at the trailing end of the note's line. */
  .cinder-approval-card__settled-actions {
    display: flex;
    grid-column: 2;
    align-items: center;
    justify-content: flex-end;
    gap: var(--cinder-space-3);
    margin-inline-start: auto;
  }

  /* The compact rule above is the base for a narrow receipt. Reassert the wide trailing column
     after it so the action does not collapse into column two and leave the grid's final gap empty. */
  @container (inline-size >= 30rem) {
    .cinder-approval-card__settled-actions {
      grid-column: 3;
    }
  }

  /* No glyph gutter: the action is the first thing on the row, and a badge beside it says when it
     cannot be undone. The title may wrap, so a long action never truncates. */
  .cinder-approval-card__decision-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--cinder-gap-stack) var(--cinder-space-2);
  }

  .cinder-approval-card__decision-title {
    flex: 1 1 12rem;
    min-inline-size: 0;
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--cinder-text-default);
    font-size: var(--cinder-text-base);
    font-weight: var(--cinder-font-semibold);
    line-height: var(--cinder-leading-normal);
    text-align: start;
    text-wrap: wrap;
  }

  /* The title takes the available width at its natural size, so when the badge would force the
   * title to break, the badge is the item that wraps, onto the line directly under the title. */
  .cinder-approval-card__decision-head .cinder-approval-card__decision-title {
    flex: 0 1 auto;
  }

  /* A pending reversible write has no risk glyph gutter. Keep its shared risk word visible as its
   * own quiet line, then omit it for every other approval and settled receipt. */
  .cinder-approval-card__decision-risk {
    margin: calc(-1 * var(--cinder-space-1)) 0 0;
    font-size: var(--cinder-text-sm);
    line-height: var(--cinder-leading-normal);
  }

  .cinder-approval-card__receipt .cinder-approval-card__input-toggle {
    align-self: flex-start;
    /* The receipt's last line sits at the card's padding, as its first does: the trigger's own
     * breathing room is the card's, not a second helping under the words. */
    padding-block: 0;
  }

  /* The person's own reason, quoted once under the decision, in the body. */
  .cinder-approval-card__decision-quote {
    margin: 0;
    padding-inline-start: var(--cinder-space-3);
    border-inline-start: 2px solid var(--cinder-border);
    color: var(--cinder-text-default);
    font-size: var(--cinder-text-sm);
    line-height: var(--cinder-leading-normal);
    overflow-wrap: anywhere;
  }

  .cinder-approval-card__decision-quote > p {
    margin: 0;
  }

  /* The receipt ends on its Details line. Under a touch screen the line is 44px tall for the
   * finger, and its words sit in the middle of that: without this the card's bottom padding is the
   * card's top padding plus half the target's spare height, a visibly deeper foot. The spare half
   * is given back where nothing sits under the line. */
  @media (any-pointer: coarse) {
    /* The line paints at its text height, so the foot is the card's padding at every pointer; the
     * 44px the finger needs is a reach around it, not height the card carries. */
    .cinder-approval-card__receipt .cinder-approval-card__input-toggle {
      position: relative;
      min-block-size: auto;
    }
  }

  .cinder-approval-card__pause {
    margin: 0;
    color: var(--cinder-text-muted);
    line-height: var(--cinder-leading-normal);
    text-align: start;
  }

  /* Host facts read as a compact definition list. Tool identity is already in the surrounding
   * step/title hierarchy, while the command remains visible without a redundant label row. */
  .cinder-approval-card__facts {
    display: flex;
    flex-direction: column;
    gap: var(--cinder-space-1);
    margin: 0;
  }

  .cinder-approval-card__fact {
    display: grid;
    grid-template-columns: minmax(4.5rem, max-content) minmax(0, 1fr);
    align-items: baseline;
    column-gap: var(--cinder-space-3);
  }

  .cinder-approval-card__fact > dt {
    color: var(--cinder-text-subtle);
    text-align: start;
  }

  .cinder-approval-card__fact--command {
    display: block;
  }

  .cinder-approval-card__fact--command > dd {
    grid-column: 1 / -1;
  }

  .cinder-approval-card__fact > dd {
    margin: 0;
    min-inline-size: 0;
    overflow-wrap: anywhere;
    color: var(--cinder-text-default);
    text-align: start;
  }

  .cinder-approval-card__command-value {
    padding-block-start: var(--cinder-space-0-5);
  }

  .cinder-approval-card__fact > dd[data-cinder-monospace] {
    font-family: var(--cinder-font-mono);
  }

  /* The question and facts may contain mixed-direction prose. Keep the command's explicit LTR
   * reading order, but mirror the definition-list columns with the actual fact direction so RTL
   * labels, values, and their alignment do not leave the card half-LTR. */
  .cinder-approval-card__fact:is([dir='rtl'], [dir='rtl'] *):where(
      :not([dir='rtl'] [dir='ltr'], [dir='rtl'] [dir='ltr'] *)
    ) {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-start;
    gap: 0 var(--cinder-space-3);
    direction: rtl;
  }

  .cinder-approval-card__fact:is([dir='rtl'], [dir='rtl'] *):where(
      :not([dir='rtl'] [dir='ltr'], [dir='rtl'] [dir='ltr'] *)
    )
    > dd {
    flex: 0 1 auto;
    direction: ltr;
    unicode-bidi: isolate;
  }

  .cinder-approval-card:has(
      .cinder-approval-card__title:is([dir='rtl'], [dir='rtl'] *):where(
          :not([dir='rtl'] [dir='ltr'], [dir='rtl'] [dir='ltr'] *)
        )
    )
    .cinder-approval-card__fact:not(.cinder-approval-card__fact--command) {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-start;
    gap: 0 var(--cinder-space-3);
    direction: rtl;
  }

  .cinder-approval-card:has(
      .cinder-approval-card__title:is([dir='rtl'], [dir='rtl'] *):where(
          :not([dir='rtl'] [dir='ltr'], [dir='rtl'] [dir='ltr'] *)
        )
    )
    .cinder-approval-card__fact:not(.cinder-approval-card__fact--command)
    > dd {
    flex: 0 1 auto;
    direction: ltr;
    unicode-bidi: isolate;
  }

  /* The actions row reads in the card's own direction, so the note toggle starts at the start edge
   * and the decision buttons end at the end edge in right-to-left content too. */
  .cinder-approval-card:has(
      :is(
          .cinder-approval-card__title,
          .cinder-approval-card__decision-title,
          .cinder-approval-card__row-question
        ):is([dir='rtl'], [dir='rtl'] *):where(
          :not([dir='rtl'] [dir='ltr'], [dir='rtl'] [dir='ltr'] *)
        )
    )
    .cinder-approval-card__row-actions {
    direction: rtl;
  }

  .cinder-approval-card[dir='rtl']
    .cinder-approval-card__fact:not(.cinder-approval-card__fact--command) {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-start;
    gap: 0 var(--cinder-space-3);
    direction: rtl;
  }

  .cinder-approval-card[dir='rtl']
    .cinder-approval-card__fact:not(.cinder-approval-card__fact--command)
    > dd {
    flex: 0 1 auto;
    direction: ltr;
    unicode-bidi: isolate;
  }

  .cinder-approval-card[dir='rtl'] .cinder-approval-card__row-actions {
    direction: rtl;
  }

  .cinder-approval-card[data-cinder-auto-rtl]
    .cinder-approval-card__input-toggle[aria-expanded='false']
    .cinder-disclosure-trigger__chevron {
    transform: scaleX(-1);
  }

  .cinder-approval-card__fact--command:is([dir='rtl'], [dir='rtl'] *):where(
      :not([dir='rtl'] [dir='ltr'], [dir='rtl'] [dir='ltr'] *)
    ) {
    grid-template-columns: minmax(0, 1fr);
  }

  /* The command is always open, so it is a code block that wraps: none of it hides behind a
     sideways scroll. */
  /* One code block in every layout. Its panel reaches past the text column by exactly its own
   * inline padding, so the command's first character sits on the label column instead of one
   * padding inside it, in the light scheme where the panel and the card share a white surface. */
  .cinder-approval-card__command {
    --_cinder-approval-card-command-padding: var(--cinder-space-2);
    /* @runtime-state */
    --cinder-code-block-padding: var(--_cinder-approval-card-command-padding);

    min-inline-size: 0;
    margin: 0;
    margin-inline: calc(-1 * var(--_cinder-approval-card-command-padding));
    text-align: start;
  }

  /* A receipt's details name the command ("Command", as they name the note and the result), and
   * the name stands on the card's text edge like those labels; only the code well hangs past it. */
  .cinder-approval-card__receipt-details .cinder-approval-card__command {
    margin-inline: 0;
  }

  .cinder-approval-card__receipt-details .cinder-approval-card__command > dd {
    margin-inline: calc(-1 * var(--_cinder-approval-card-command-padding));
  }

  /* The hang (`margin-inline`) is the padding, so the row's command text lands on the title column
   * and the panel keeps one space-1 from the card's border. */
  .cinder-approval-card--row .cinder-approval-card__command {
    --_cinder-approval-card-command-padding: var(--cinder-space-1);
  }

  /* The facts line is the two things an approver weighs before answering, in small text: a clock
   * and when the approval lapses, a warning glyph and that it cannot be undone. Glyphs are 14px
   * beside 12px text, so each glyph sits inside its line box. It is directly under the title; a
   * card 30rem wide or wider moves it to the trailing end of the title's own row. */
  .cinder-approval-card__facts-line {
    display: flex;
    flex: 0 0 100%;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--cinder-space-0-5) var(--cinder-space-3);
    min-inline-size: 0;
    margin: 0;
    color: var(--cinder-text-muted);
    font-size: var(--cinder-text-xs);
    line-height: var(--cinder-leading-normal);
    text-align: start;
  }

  .cinder-approval-card__facts-line-fact {
    display: inline-flex;
    align-items: center;
    gap: var(--cinder-space-1);
    white-space: nowrap;
  }

  .cinder-approval-card__facts-line-fact svg {
    flex: none;
    inline-size: 14px;
    block-size: 14px;
  }

  /* The narrow card's form of the deadline; drawn only in a narrow card (below). */
  .cinder-approval-card__countdown-short {
    display: none;
  }

  .cinder-approval-card__facts-line-tip {
    display: inline-flex;
    flex: none;
    align-items: center;
  }

  /* The irreversible fact is a status word, so it is a soft danger Badge (the owner's rule: a
   * status word is a badge); its line takes the danger text colour for the glyph's sake. */
  .cinder-approval-card__facts-line-fact[data-cinder-tone='danger'] {
    color: var(--cinder-status-danger-text);
  }

  @container (inline-size >= 30rem) {
    .cinder-approval-card__row-title-line,
    .cinder-approval-card__decision-head {
      flex-wrap: nowrap;
    }

    .cinder-approval-card__facts-line {
      flex: none;
      flex-wrap: nowrap;
      align-self: flex-start;
      margin-inline-start: auto;
      /* The 12px line sits centred on the title's first line, which is a little taller. */
      margin-block-start: 1px;
    }
  }

  @container (inline-size < 24rem) {
    .cinder-approval-card--decision .cinder-approval-card__row-actions .cinder-button {
      line-height: var(--cinder-leading-tight);
    }

    .cinder-approval-card--decision .cinder-approval-card__facts {
      gap: var(--cinder-space-0-5);
    }

    .cinder-approval-card--decision .cinder-approval-card__fact--command {
      grid-template-columns: minmax(0, 1fr);
      row-gap: var(--cinder-space-0-5);
    }

    .cinder-approval-card--decision .cinder-approval-card__command {
      --_cinder-approval-card-command-padding: var(--cinder-space-1-5);
    }
  }

  .cinder-approval-card__countdown,
  .cinder-approval-card__arm-hint {
    margin: 0;
    color: var(--cinder-text-subtle);
    font-size: var(--cinder-text-sm);
    line-height: var(--cinder-leading-normal);
    text-align: start;
  }

  @media (any-pointer: coarse) {
    .cinder-approval-card__arm-escape {
      display: none;
    }
  }

  .cinder-approval-card__why-body {
    margin: 0;
    padding-block-start: 0;
    color: var(--cinder-text-muted);
    line-height: var(--cinder-leading-normal);
    text-align: start;
  }

  .cinder-approval-card__why-body[hidden] {
    display: none;
  }

  /* The retained receipt: what was approved, who decided where and when, and the details a
     disclosure away. */
  .cinder-approval-card__receipt {
    display: flex;
    flex-direction: column;
    gap: var(--cinder-gap-stack);
  }

  .cinder-approval-card__receipt-details {
    display: flex;
    flex-direction: column;
    gap: var(--cinder-space-2);
    padding-block-start: var(--cinder-space-2);
  }

  .cinder-approval-card__receipt-details[hidden] {
    display: none;
  }

  /* ----------------------------------------
   * Detail layout: an approval's own page
   * ---------------------------------------- */

  .cinder-approval-card--detail {
    display: flex;
    flex-direction: column;
    gap: var(--cinder-gap-stack);
    font-size: var(--cinder-text-sm);
  }

  .cinder-approval-card__detail-header {
    display: flex;
    flex-direction: column;
    gap: var(--cinder-gap-stack);
  }

  /* Who asked is running text, so a long chat title wraps and the comma stays with what it follows. */
  .cinder-approval-card__detail-ask,
  .cinder-approval-card__detail-tool {
    margin: 0;
    color: var(--cinder-text-subtle);
    font-size: var(--cinder-text-sm);
    line-height: var(--cinder-leading-normal);
    overflow-wrap: anywhere;
  }

  .cinder-approval-card__detail-eyebrow {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0 var(--cinder-space-1);
    margin: 0;
    color: var(--cinder-text-subtle);
    font-size: var(--cinder-text-sm);
    line-height: var(--cinder-leading-normal);
  }

  .cinder-approval-card__detail-eyebrow {
    gap: var(--cinder-space-2);
    color: var(--cinder-text-muted);
    font-weight: var(--cinder-font-semibold);
  }

  .cinder-approval-card__detail-eyebrow .cinder-approval-card__risk-icon {
    margin-block-start: 0;
  }

  .cinder-approval-card__detail-body {
    display: flex;
    flex-direction: column;
    gap: var(--cinder-gap-stack);
  }

  /* The approval shows what will run, so short Fields summaries wrap when they need room. */
  .cinder-approval-card--detail .cinder-payload-inspector__inline {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  /* The risk glyph line under Input: what cannot be undone and what approving does. */
  .cinder-approval-card__detail-risk {
    display: flex;
    align-items: flex-start;
    gap: var(--cinder-space-2);
    margin: 0;
    color: var(--cinder-text-default);
    line-height: var(--cinder-leading-normal);
  }

  .cinder-approval-card__detail-risk > svg {
    flex: none;
    margin-block-start: 2px;
    color: var(--cinder-status-warning-text);
  }

  .cinder-approval-card--detail:not([data-cinder-state='pending'])
    .cinder-approval-card__detail-risk
    > svg,
  .cinder-approval-card--detail[data-cinder-risk='low'] .cinder-approval-card__detail-risk > svg {
    color: var(--cinder-text-subtle);
  }

  .cinder-approval-card--detail .cinder-approval-card__consequence {
    color: inherit;
    font-size: inherit;
  }

  /* "Can't be undone." leads the consequence line in semibold, as the board sets it. */
  .cinder-approval-card__detail-risk .cinder-approval-card__undone {
    color: var(--cinder-text-default);
    font-weight: var(--cinder-font-semibold);
  }

  /* What the source said when it asked: a collapsed line that opens in place to the whole text. */
  .cinder-approval-card__said {
    display: flex;
  }

  .cinder-approval-card__said-toggle {
    appearance: none;
    display: flex;
    align-items: baseline;
    gap: var(--cinder-space-2);
    inline-size: 100%;
    min-inline-size: 0;
    padding: 0;
    border: 0;
    border-radius: var(--cinder-radius-sm);
    background: none;
    color: var(--cinder-text-muted);
    font: inherit;
    text-align: start;
    cursor: pointer;
  }

  .cinder-approval-card__said-toggle:focus-visible {
    outline: var(--cinder-ring-width) solid transparent;
    box-shadow: var(--_cinder-focus-ring-shadow);
  }

  .cinder-approval-card__said-toggle svg {
    flex: none;
    align-self: center;
    transition: transform var(--cinder-duration-fast) var(--cinder-ease-standard);
  }

  .cinder-approval-card__said-toggle svg[data-cinder-open] {
    transform: rotate(90deg);
  }

  .cinder-approval-card__said-label {
    flex: none;
    color: var(--cinder-text-default);
    font-weight: var(--cinder-font-semibold);
  }

  /* Closed it is one line cut with an ellipsis; open it wraps in full. */
  .cinder-approval-card__said-text {
    min-inline-size: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .cinder-approval-card__said-text[data-cinder-open] {
    overflow: visible;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  /* ----------------------------------------
   * Answered somewhere else: the card gives way to what happened and who did it
   * ---------------------------------------- */

  .cinder-approval-card--elsewhere {
    display: flex;
    align-items: flex-start;
    gap: var(--cinder-space-3);
    box-sizing: border-box;
    border: 1px solid var(--cinder-border);
    border-radius: var(--cinder-radius-lg);
    padding: var(--cinder-space-3) var(--cinder-space-4);
    background: var(--cinder-surface);
    color: var(--cinder-text-default);
    font-size: var(--cinder-text-sm);
  }

  .cinder-approval-card--elsewhere > svg {
    flex: none;
    margin-block-start: 2px;
    color: var(--cinder-text-muted);
  }

  .cinder-approval-card__elsewhere-text {
    display: flex;
    flex-direction: column;
    gap: var(--cinder-space-0-5);
    min-inline-size: 0;
  }

  .cinder-approval-card__elsewhere-title {
    margin: 0;
    font-size: var(--cinder-text-sm);
    font-weight: var(--cinder-font-semibold);
    line-height: var(--cinder-leading-normal);
    text-wrap: wrap;
  }

  .cinder-approval-card__elsewhere-body {
    margin: 0;
    color: var(--cinder-text-muted);
    line-height: var(--cinder-leading-normal);
    overflow-wrap: anywhere;
  }

  /* ----------------------------------------
   * Narrow cards (a phone, a side panel) and touch
   * ---------------------------------------- */

  /* Where the whole line cannot fit, who asked and when sit on a line of their own, so the
   * line never breaks in the middle of "issue-refund, Dangerous, Can't be undone". */
  @container (inline-size < 40rem) {
    .cinder-approval-card__line-source {
      display: block;
    }

    .cinder-approval-card__line-tool:has(*) + .cinder-approval-card__line-source {
      margin-inline-start: 0;
    }
  }

  /* A narrow row says things once, so the whole card fits a phone's transcript: the tool's name
   * goes, because the step row above it and the question already say it, and who asked and when
   * stay on one line (COR-2327). The risk word stays: nothing else says it. */
  @container (inline-size < 24rem) {
    .cinder-approval-card--row .cinder-approval-card__line-tool-name {
      display: none;
    }

    /* The gap stood for the name that is gone, so the risk word starts the line at the card's text
       edge rather than 6px in (COR-2438). */
    .cinder-approval-card--row .cinder-approval-card__line-tool-name + .cinder-approval-card__keep {
      margin-inline-start: 0;
    }

    /* A deadline more than a day out is written as its day ("Expires Nov 17"), so the expiry and
     * "Can't be undone" share one line. */
    .cinder-approval-card__facts-line-fact[data-cinder-shortened]
      > .cinder-approval-card__countdown-full {
      display: none;
    }

    .cinder-approval-card__facts-line-fact[data-cinder-shortened]
      > .cinder-approval-card__countdown-short {
      display: inline;
    }
  }

  /* Where even "who asked and when" cannot fit on a line, the time takes a line of its own. The
   * row's line is short; the card's eyebrow and the detail's ask line are longer. */
  @container (inline-size < 14rem) {
    .cinder-approval-card__line time {
      display: block;
      margin-inline-start: 0;
    }
  }

  @container (inline-size < 19rem) {
    .cinder-approval-card__eyebrow time,
    .cinder-approval-card__detail-ask time {
      display: block;
      margin-inline-start: 0;
    }
  }

  /* Deny and Approve keep their compact width at a 44px height in a narrow card, where the card
   * layout's buttons take a line of their own at the trailing end under "Add note" (so its words
   * always fit there), and everywhere on a touch screen. The selectors repeat the button's own attribute so
   * they outrank the compact desktop height without a cross-component custom property. */
  @container (inline-size < 32rem) {
    /* The input line wraps rather than cutting its values, so a phone still reads all of it. */
    .cinder-approval-card__input-toggle {
      align-items: center;
    }

    .cinder-approval-card__input-pairs {
      overflow: visible;
      white-space: normal;
    }

    /* The card's arguments line names its block in more than one word, so its pairs take the line
     * under the name and start at the body's content edge, where the command and the chevron
     * start, instead of a squeezed column beside it or a column past the chevron. */
    .cinder-approval-card__disclosures .cinder-approval-card__input-toggle {
      flex-wrap: wrap;
      row-gap: 0;
    }

    .cinder-approval-card__disclosures .cinder-approval-card__input-pairs {
      flex-basis: 100%;
    }

    /* Svelte leaves whitespace text nodes in an empty pairs list, so `:empty` never matches. */
    .cinder-approval-card__disclosures .cinder-approval-card__input-pairs:not(:has(*)) {
      display: none;
    }

    /* The status badge sits above the question, in the column beside the risk glyph, so the
     * question keeps the full line under it. A resolved or answerable card with no badge draws no
     * badge row, because the empty group is hidden and the row gap is zero. */
    .cinder-approval-card__header {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr);
      grid-template-areas:
        'icon badges'
        'icon title';
      row-gap: 0;
    }

    .cinder-approval-card__risk-tip {
      grid-area: icon;
    }

    .cinder-approval-card__badges {
      grid-area: badges;
      justify-content: flex-start;
      margin-block-end: var(--cinder-space-2);
    }

    /* The group holds two conditional children, so Svelte leaves whitespace text nodes between
     * its anchors and `:empty` never matches; test for an element child instead. */
    .cinder-approval-card__badges:not(:has(*)) {
      display: none;
    }

    .cinder-approval-card__title-group {
      grid-area: title;
      min-inline-size: 0;
    }

    /* Compact intrinsic widths, never equal or full width; the 44px height is the target. */
    .cinder-approval-card__action-buttons
      .cinder-button:is(
        .button-size-extra-small,
        .button-size-small,
        .button-size-medium,
        .button-size-large
      ) {
      flex: 0 1 auto;
      min-height: var(--cinder-touch-target-min);
    }

    .cinder-approval-card__row-actions {
      flex-wrap: wrap;
    }

    .cinder-approval-card__row-actions
      .cinder-button:is(
        .button-size-extra-small,
        .button-size-small,
        .button-size-medium,
        .button-size-large
      ) {
      min-inline-size: var(--cinder-touch-target-min);
      max-inline-size: none;
      white-space: nowrap;
      overflow-wrap: normal;
    }

    /* The buttons take the row but stay at its trailing end, the primary last. */
    .cinder-approval-card__action-buttons {
      flex: 1 1 100%;
      justify-content: flex-end;
      margin-inline-start: 0;
    }
  }

  @container (inline-size < 24rem) {
    /* Keep decisions in flow so they never cover the input on narrow screens. */
    .cinder-approval-card--detail .cinder-approval-card__action-row {
      padding-block: var(--cinder-space-2);
    }

    .cinder-approval-card--detail .cinder-approval-card__action-buttons {
      display: grid;
      grid-auto-flow: column;
      grid-auto-columns: minmax(0, 1fr);
      align-items: start;
    }

    .cinder-approval-card--detail .cinder-approval-card__action-buttons .cinder-button {
      inline-size: 100%;
      min-block-size: var(--cinder-touch-target-min);
    }
  }

  @media (any-pointer: coarse) {
    .cinder-approval-card--decision
      .cinder-approval-card__row-actions
      .cinder-inline-confirm__two-press
      .cinder-button {
      block-size: auto;
    }

    .cinder-approval-card__row-actions
      .cinder-button:is(
        .button-size-extra-small,
        .button-size-small,
        .button-size-medium,
        .button-size-large
      ),
    .cinder-approval-card__action-buttons
      .cinder-button:is(
        .button-size-extra-small,
        .button-size-small,
        .button-size-medium,
        .button-size-large
      ) {
      min-inline-size: var(--cinder-touch-target-min);
    }

    /* The disclosures (Input, Details, Why the agent wants to do this, what the source said) are painted at text height; on a touch screen each reaches a 44px hit area
     * through a pseudo-element that takes no layout space, so the rows keep their rhythm. */
    .cinder-approval-card__input-toggle,
    .cinder-approval-card__said-toggle,
    .cinder-approval-card__show-all {
      position: relative;
    }

    .cinder-approval-card__input-toggle::before,
    .cinder-approval-card__said-toggle::before,
    .cinder-approval-card__show-all::before {
      content: '';
      position: absolute;
      inset-block: min(0px, calc((100% - var(--cinder-touch-target-min)) / 2));
      inset-inline: min(0px, calc((100% - var(--cinder-touch-target-min)) / 2));
    }
  }

  /* A narrow card keeps host-specified facts but omits the duplicate Tool row supplied by the
   * card itself (COR-2327). Its attributes outrank the direction-specific fact display above. */
  @container (inline-size < 24rem) {
    .cinder-approval-card
      .cinder-approval-card__fact[data-cinder-fact='tool'][data-cinder-auto-fact] {
      display: none;
    }

    /* Keep explicit facts in view without making a short approval occupy another line. */
    .cinder-approval-card__facts:is(
      .cinder-approval-group .cinder-approval-card--row *,
      .cinder-approval-card--decision *:has([data-cinder-fact='tool']:not([data-cinder-auto-fact]))
    ) {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      column-gap: var(--cinder-space-2);
    }

    .cinder-approval-card__facts:is(
        .cinder-approval-group .cinder-approval-card--row *,
        .cinder-approval-card--decision
          *:has([data-cinder-fact='tool']:not([data-cinder-auto-fact]))
      )
      > .cinder-approval-card__fact:not(.cinder-approval-card__fact--command) {
      grid-template-columns: fit-content(50%) minmax(0, 1fr);
      column-gap: var(--cinder-space-1);

      > dt {
        overflow-wrap: anywhere;
      }
    }

    .cinder-approval-card__facts:is(
        .cinder-approval-group .cinder-approval-card--row *,
        .cinder-approval-card--decision
          *:has([data-cinder-fact='tool']:not([data-cinder-auto-fact]))
      )
      > .cinder-approval-card__fact--command {
      grid-column: 1 / -1;
    }
  }

  /* An armed primary reads "Press again to refund" and, in a narrow card (a phone), "Press again":
   * the rest of the face is hidden and the resting button holds room only for the short words, so
   * it stays beside Deny and does not grow to the long ones. The accessible name is the whole
   * sentence in both. */
  @container (inline-size < 24rem) {
    .cinder-approval-card .cinder-inline-confirm__face-more {
      display: none;
    }

    .cinder-approval-card
      .cinder-inline-confirm__two-press
      .cinder-button__label[data-cinder-reserve-narrow]::after {
      content: attr(data-cinder-reserve-narrow);
    }
  }

  /* ----------------------------------------
   * Forced colors
   * ---------------------------------------- */

  @media (forced-colors: active) {
    .cinder-approval-card__risk-icon {
      color: CanvasText;
    }

    .cinder-approval-card__risk-icon:focus-visible,
    .cinder-approval-card__input-toggle:focus-visible,
    .cinder-approval-card__show-all:focus-visible {
      outline: 2px solid CanvasText;
      outline-offset: 2px;
      box-shadow: none;
    }

    .cinder-approval-card__outcome-dot {
      background: CanvasText;
    }
  }
}
