/* ==================================================================
   amendments.css - Applicant File > Application: the Stage 1 staff
   correction ("Correct answers or term"): the targeted correction
   workspace, the complete preview, the saved correction and its
   Outstanding consequences.

   Loads AFTER threshold-tokens.css, threshold-chrome.css (.cc-pill,
   .cc-btn), th-grid.css, all-files.css, af-requirements.css and
   ../review-decision/review-decision.css. The shell (.af-file-*), the
   reader (.af-section, .af-field, .af-instance, .af-rev-chip), the
   Amendments panel (.af-amendment*), the guard (.af-leave-*), the
   return note (.af-return), the row controls (.af-req-radio, -input,
   -textarea) and the Review & decision atoms (.rd-card, .rd-facts,
   .rd-notice, .rd-op, .rd-mark, .rd-history, .rd-field, .rd-error,
   .rd-hint, .rd-live, .rd-nobreak) are CONSUMED, never redeclared.

   Every rule is scoped by an `am-` class. Where a consumed class needs a
   different value here, the rule sits under an `am-` ancestor and is
   listed in README "Amendments to existing canon".

   TOKENS: no `--token:` declaration and no hex. Every colour resolves
   through --th-*; the only literals are sizes and one shadow (oklch
   with alpha, with its dark retune beside it).

   Breakpoints are container queries on .af-file (the shell's own
   container), as in all-files.css and review-decision.css:
     (max-width: 1100px)  the side column narrows to 320px
     (max-width: 900px)   one column: the side column follows the form
     (max-width: 720px)   narrow: stacked rows, 44px controls
   Convert to @media at lift, adding the 232px sidenav (1100 -> 1332,
   900 -> 1132, 720 -> 952).
   ================================================================== */

/* ------------------------------------------------------------------
   Destination root and the correction bar
   ------------------------------------------------------------------ */
.am-dest {
    padding: 14px 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    position: relative;
    font-family: var(--th-font-sans);
    color: var(--th-ink);
}
.am-dest svg { flex: none; }
.am-dest :where(button, a, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid var(--th-advant); outline-offset: 2px; }
.am-dest.is-saved { padding-bottom: 0; }

.am-bar {
    position: sticky;
    top: 0;
    z-index: 4;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px 18px;
    padding: 10px 14px;
    border: 1px solid var(--th-line);
    border-radius: var(--th-radius-5);
    background: var(--th-paper-sunk);
}
.am-bar-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.am-bar-title { margin: 0; font-family: var(--th-font-serif); font-weight: 600; font-size: var(--th-size-17); line-height: 1.3; }
.am-bar-title:focus:not(:focus-visible) { outline: none; }
.am-bar-sub { margin: 0; font-size: 12px; color: var(--th-ink-2); line-height: 1.45; }
.am-bar-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.am-count { font-size: 12.5px; color: var(--th-advant-deep); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }

.am-steps { margin: 0; padding: 0; list-style: none; display: flex; gap: 4px; flex-wrap: wrap; }
.am-step { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--th-ink-2); padding: 2px 8px 2px 3px; border-radius: var(--th-radius-pill); border: 1px solid transparent; }
.am-step-n { width: 17px; height: 17px; border-radius: 50%; border: 1px solid var(--th-line-2); display: inline-grid; place-items: center; font-family: var(--th-font-mono); font-size: 10px; background: var(--th-paper); }
.am-step[aria-current="step"] { color: var(--th-advant-deep); font-weight: 600; border-color: var(--th-advant); background: var(--th-advant-soft); }
.am-step[aria-current="step"] .am-step-n { border-color: var(--th-advant-deep); background: var(--th-advant-deep); color: var(--th-advant-fg); }
.am-step.is-done .am-step-n { border-color: var(--th-ink-3); }

/* ------------------------------------------------------------------
   Workspace: the application in context | the change list and reason
   ------------------------------------------------------------------ */
.am-ws { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.am-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.am-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.am-pv-note { margin: 0; display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; color: var(--th-ink); }
.am-pv-note > svg { margin-top: 3px; color: var(--th-warn-ink); }

/* Old and new, everywhere a value changes. "Was" / "Now" are read by
   assistive technology; the strike is not the only cue. */
.am-diff { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; overflow-wrap: anywhere; }
.am-old { color: var(--th-ink-2); text-decoration: line-through; text-decoration-color: var(--th-ink-3); }
.am-arrow { color: var(--th-ink-3); font-family: var(--th-font-mono); font-size: 12px; }
.am-new { color: var(--th-ink); font-weight: 600; }
.am-none { color: var(--th-ink-2); font-style: italic; font-weight: 400; }
.am-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.am-redact { flex: none; max-width: 100%; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--th-ink-2); border: 1px dashed var(--th-line-2); border-radius: var(--th-radius-3); padding: 0 6px; line-height: 1.7; }
.am-locked { display: inline-flex; align-items: center; gap: 5px; color: var(--th-ink-2); font-size: 12.5px; }
.am-empty { margin: 0; font-size: 12.5px; color: var(--th-ink-2); line-height: 1.5; }
.am-out-of-scope { margin: 0; padding: 10px 16px; font-size: 12.5px; color: var(--th-ink-2); }

/* The filed term beside the effective term in the shell summary (amendment A2). */
.am-filed-term { color: var(--th-ink-2); font-weight: 400; }

/* ------------------------------------------------------------------
   Term control: a dedicated control, never an answer row
   ------------------------------------------------------------------ */
.am-term { border: 1px solid var(--th-line); border-radius: var(--th-radius-5); background: var(--th-paper-sunk); }
.am-term.is-changed { box-shadow: inset 3px 0 0 var(--th-advant); }
.am-term-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 10px 16px; border-bottom: 1px solid var(--th-line); }
.am-term-title { margin: 0; font-family: var(--th-font-serif); font-weight: 600; font-size: var(--th-size-14); }
.am-term-def { font-size: 11.5px; color: var(--th-ink-2); font-family: var(--th-font-mono); }
.am-term-acts { margin-left: auto; display: flex; gap: 6px; align-self: center; }
.am-term-body { padding: 10px 16px 12px; display: flex; flex-direction: column; gap: 8px; }
.am-term-body .rd-facts { grid-template-columns: 150px minmax(0, 1fr); }
.am-term-note { margin: 0; font-size: 12px; color: var(--th-ink-2); line-height: 1.45; }

/* ------------------------------------------------------------------
   Answer rows. Changed: advant inset + "In this correction". Derived
   (follows the term): dashed ink inset, no edit control. Cleared: the
   same, with "Cleared automatically". Invalid: risk inset + error.
   ------------------------------------------------------------------ */
.am-qs { padding: 4px 0; }
.am-q {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr) auto;
    gap: 4px 14px;
    align-items: baseline;
    padding: 7px 16px;
    border-top: 1px solid var(--th-line-soft);
}
.am-q:first-child { border-top: 0; }
.am-q-label { font-size: 11.5px; color: var(--th-ink-2); line-height: 1.5; }
.am-req { font-size: 10.5px; font-weight: 600; color: var(--th-warn-ink); }
.am-q-body { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-width: 0; }
.am-q-value { font-size: 13.5px; color: var(--th-ink); line-height: 1.45; overflow-wrap: anywhere; }
.am-q-why { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.am-q-note { font-size: 11.5px; color: var(--th-ink-2); line-height: 1.45; }
.am-q-acts { display: flex; gap: 6px; justify-self: end; }
.am-q.is-changed { box-shadow: inset 3px 0 0 var(--th-advant); }
.am-q.is-derived, .am-q.is-cleared { box-shadow: inset 3px 0 0 var(--th-ink-4); }
.am-q.is-invalid { box-shadow: inset 3px 0 0 var(--th-risk); }
.am-q.is-editing { background: var(--th-paper-2); }
.am-q.is-revealed { box-shadow: inset 3px 0 0 var(--th-warn); }
.am-q > .am-editor { grid-column: 1 / -1; }
.am-warn-line { margin: 0; display: flex; gap: 6px; align-items: flex-start; font-size: 12px; color: var(--th-ink); line-height: 1.45; }
.am-warn-line > svg { margin-top: 2px; color: var(--th-warn-ink); }

/* ------------------------------------------------------------------
   Inline editor, one per answer family
   ------------------------------------------------------------------ */
.am-editor { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; margin: 4px 0 2px; border: 1px solid var(--th-advant); border-radius: 4px; background: var(--th-paper); max-width: 560px; min-width: 0; }
.am-editor-head { margin: 0; font-size: 12px; color: var(--th-ink-2); line-height: 1.45; }
.am-editor-foot { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.am-editor .af-req-input, .am-editor .af-req-textarea, .am-editor .rd-select { width: 100%; max-width: 100%; }
.am-editor .am-input-num { max-width: 120px; }
.am-date { margin: 0; padding: 0; border: 0; min-width: 0; }
.am-date-row { display: flex; gap: 8px; flex-wrap: wrap; }
.am-date-row .rd-field { min-width: 0; }
.am-date-row .rd-select { min-width: 140px; }
.am-date-row .rd-field > .am-input-day { width: 64px; }
.am-date-row .rd-field > .am-input-year { width: 84px; }
.am-listbox { margin: 0; padding: 4px 0; list-style: none; border: 1px solid var(--th-line-2); border-radius: 4px; max-height: 236px; overflow-y: auto; background: var(--th-paper-sunk); }
.am-opt-group { padding: 2px 0; }
.am-opt-group-label { display: block; padding: 4px 10px 2px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--th-ink-2); }
.am-opts { margin: 0; padding: 0; list-style: none; }
.am-opt { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: 13px; color: var(--th-ink); cursor: pointer; min-height: 32px; }
.am-opt:hover { background: var(--th-paper-2); }
.am-opt[aria-selected="true"] { background: var(--th-advant-soft); color: var(--th-advant-deep); font-weight: 600; }
.am-opt-tick { width: 11px; flex: none; }
.am-opt-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.am-opt-meta { font-size: 11.5px; color: var(--th-ink-2); font-weight: 400; }
.am-opt-none { padding: 8px 10px; font-size: 12.5px; color: var(--th-ink-2); }

/* ------------------------------------------------------------------
   Repeating entries: add, member edit, removal with an exact preview
   ------------------------------------------------------------------ */
.am-entry-head { flex-wrap: wrap; row-gap: 4px; }
.am-entry-acts { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.am-entry.is-changed, .am-entry.is-added { box-shadow: inset 3px 0 0 var(--th-advant); }
.am-entry.is-removed { border-style: dashed; background: transparent; }
.am-entry.is-removed .af-member-value, .am-entry.is-removed .af-instance-title { color: var(--th-ink-2); text-decoration: line-through; text-decoration-color: var(--th-ink-3); }
.am-entry-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 12px; }
.am-remove { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--th-risk); border-radius: 4px; background: var(--th-risk-soft); display: flex; flex-direction: column; gap: 8px; }
.am-remove-title { margin: 0; font-size: 13px; font-weight: 600; color: var(--th-ink); }
.am-remove .rd-facts { grid-template-columns: 120px minmax(0, 1fr); }
.am-group-foot { display: flex; }
.am-entry-wide { grid-column: 1 / -1; }

/* ------------------------------------------------------------------
   The change list and the reason
   ------------------------------------------------------------------ */
.am-changes:focus:not(:focus-visible) { outline: none; }
.am-change-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.am-change { display: flex; flex-direction: column; gap: 6px; padding: 9px 0; border-top: 1px solid var(--th-line-soft); }
.am-change:first-child { border-top: 0; padding-top: 0; }
.am-change-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 13px; }
.am-change-what { font-size: 12px; font-weight: 600; color: var(--th-ink); }
.am-change-note { font-size: 11.5px; color: var(--th-ink-2); line-height: 1.45; }
.am-change-problem { display: flex; gap: 5px; align-items: flex-start; font-size: 12px; color: var(--th-risk-ink); line-height: 1.45; }
.am-change-problem > svg { margin-top: 2px; }
.am-change-acts { display: flex; gap: 4px; flex-wrap: wrap; }
.am-change.is-auto { padding-left: 10px; border-left: 2px dashed var(--th-line-2); border-top: 0; margin-top: 6px; }

/* ------------------------------------------------------------------
   Preview
   ------------------------------------------------------------------ */
.am-pv { gap: 12px; }
.am-pv-sec { border: 1px solid var(--th-line); border-radius: var(--th-radius-5); background: var(--th-paper-sunk); padding: 11px 16px 13px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.am-pv-title { margin: 0; font-family: var(--th-font-serif); font-weight: 600; font-size: var(--th-size-14); display: flex; align-items: center; gap: 7px; }
.am-pv-title:focus:not(:focus-visible) { outline: none; }
.am-rows { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.am-row { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 2px 14px; padding: 7px 0; border-top: 1px solid var(--th-line-soft); font-size: 13px; align-items: baseline; }
.am-row:first-child { border-top: 0; }
.am-row-label { font-size: 12px; color: var(--th-ink-2); }
.am-row-note { grid-column: 2; font-size: 11.5px; color: var(--th-ink-2); line-height: 1.45; }
.am-entries { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.am-pv-entry { border: 1px solid var(--th-line); border-radius: 4px; background: var(--th-paper); padding: 9px 12px; display: flex; flex-direction: column; gap: 6px; }
.am-pv-entry.is-remove { border-style: dashed; }
.am-pv-entry-head { margin: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.am-pv-entry-title { font-size: 13px; font-weight: 600; }
.am-pv-entry .rd-facts { grid-template-columns: 120px minmax(0, 1fr); }
.am-problems { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.am-problem { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; padding: 8px 10px; border-radius: 4px; font-size: 12.5px; line-height: 1.45; }
.am-problem.is-blocking { border: 1px solid var(--th-risk); background: var(--th-risk-soft); }
.am-problem.is-warning { border: 1px solid var(--th-line-2); background: var(--th-paper-2); grid-template-columns: 200px minmax(0, 1fr); }
.am-problem-q { display: inline-flex; gap: 6px; align-items: baseline; font-weight: 600; color: var(--th-ink); }
.am-problem.is-blocking .am-problem-q > svg { color: var(--th-risk-ink); align-self: center; }
.am-problem-text { color: var(--th-ink); }
.am-problem .cc-btn { background: var(--th-paper); }
.am-pv-cqs { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.am-pv-cq { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 8px 0; border-top: 1px solid var(--th-line-soft); }
.am-pv-cq:first-child { border-top: 0; padding-top: 0; }
.am-pv-cq.is-changed { box-shadow: inset 3px 0 0 var(--th-advant); padding-left: 10px; }
.am-cq-kind { font-size: 13px; font-weight: 600; color: var(--th-ink); }
.am-cq-source { font-size: 12px; color: var(--th-ink-2); }
.am-cq-change { display: inline-flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-size: 13px; min-width: 0; }
.am-cq-what { font-size: 12px; color: var(--th-ink-2); }
.am-cq-who { font-size: 11.5px; color: var(--th-ink-2); }

/* Changed since the preview: current facts beside the still-authorized draft. */
.am-compare { border: 1px solid var(--th-advant); background: var(--th-advant-soft); border-radius: var(--th-radius-5); padding: 11px 16px 12px; display: flex; flex-direction: column; gap: 8px; }
.am-compare .am-pv-title > svg { color: var(--th-advant-deep); }
.am-compare-lede { margin: 0; font-size: 12.5px; line-height: 1.5; }
.am-compare-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.am-compare-col { border: 1px solid var(--th-line-2); border-radius: 4px; background: var(--th-paper-sunk); padding: 8px 10px; min-width: 0; }
.am-compare-col.is-draft { border-style: dashed; }
.am-compare-h { margin: 0 0 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--th-ink-2); }
.am-compare .rd-list { color: var(--th-ink); }
.am-compare .rd-hint { color: var(--th-ink); }

/* What a correction never changes. */
.am-immut { border: 1px dashed var(--th-line-2); border-radius: var(--th-radius-5); padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.am-immut-title { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--th-ink); }
.am-immut-title > svg { color: var(--th-ink-3); }
.am-immut .rd-facts { grid-template-columns: 130px minmax(0, 1fr); font-size: 12.5px; }
.am-apply .rd-facts { grid-template-columns: 110px minmax(0, 1fr); }

/* Source-owned work, never Apply / Keep. */
.am-other { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.am-other-item { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--th-line); border-radius: 4px; background: var(--th-paper); }
.am-other-src { font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--th-ink-2); }
.am-other-what { font-size: 13px; color: var(--th-ink); line-height: 1.45; }
.am-other-who { font-size: 12px; color: var(--th-ink-2); line-height: 1.45; }
.am-other-item .rd-req-link { font-size: 12.5px; align-self: flex-start; }

/* ------------------------------------------------------------------
   Saved correction and Outstanding consequences
   ------------------------------------------------------------------ */
.am-saved-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 14px 18px; align-items: start; }
.am-saved-grid > .am-saved { grid-row: span 2; }
.am-saved .rd-facts { grid-template-columns: 96px minmax(0, 1fr); }
.am-saved-grid > .am-out, .am-saved-grid > .am-otherwork { grid-column: 2; }
.am-saved-grid > .am-out:first-child { grid-column: 1 / -1; }
.am-cqs { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.am-cq {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px 14px;
    align-items: start;
    padding: 11px 0;
    border-top: 1px solid var(--th-line-soft);
}
.am-cq:first-child { border-top: 0; padding-top: 2px; }
.am-cq-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.am-cq-state { align-self: start; }
.am-cq-acts { display: flex; gap: 6px; }
.am-cq-facts { grid-column: 1 / -1; margin: 0; display: grid; grid-template-rows: auto auto; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 1px 14px; font-size: 12.5px; }
.am-cq-facts > dt { font-size: 11px; color: var(--th-ink-2); }
.am-cq-facts > dd { margin: 0; color: var(--th-ink); line-height: 1.45; overflow-wrap: anywhere; }
.am-cq-result { grid-column: 1 / -1; margin: 0; display: flex; flex-direction: column; gap: 2px; padding: 7px 10px; border-radius: 4px; background: var(--th-paper-2); font-size: 12.5px; font-weight: 600; color: var(--th-ink); }
.am-cq-result:focus:not(:focus-visible) { outline: none; }
.am-cq-result-head { display: block; }
.am-cq-reason { font-weight: 400; color: var(--th-ink-2); line-height: 1.45; }
.am-cq-reason.is-withheld { display: inline-flex; align-items: center; gap: 5px; }
.am-all-done { margin: 4px 0 0; display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--th-ink); }
.am-all-done > svg { color: var(--th-ok-ink); }

/* An opened consequence: its current proposal and the decision. */
.am-cqd { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.am-back { align-self: flex-start; }
.am-cqd-head { display: flex; flex-direction: column; gap: 2px; }
.am-cqd-title { margin: 0; font-family: var(--th-font-serif); font-weight: 600; font-size: var(--th-size-15); }
.am-cqd-title:focus:not(:focus-visible) { outline: none; }
.am-cqd-sub { margin: 0; font-size: 12px; color: var(--th-ink-2); }
.am-proposal { padding: 10px 12px; border: 1px solid var(--th-line); border-radius: 4px; background: var(--th-paper); grid-template-columns: 140px minmax(0, 1fr); }
.am-cqd-ro { margin: 0; display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; color: var(--th-ink); line-height: 1.5; }
.am-cqd-ro > svg { margin-top: 3px; color: var(--th-ink-3); }
.am-unavail { display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; color: var(--th-ink); }
.am-unavail > svg { margin-top: 3px; }

/* Provenance for a corrected answer. */
.am-prov { max-width: 420px; border: 1px solid var(--th-line-2); border-radius: 6px; background: var(--th-paper-sunk); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 10px 30px oklch(20% 0.01 255 / 0.16); }
[data-theme="dark"] .am-prov { box-shadow: 0 10px 30px oklch(2% 0.01 255 / 0.55); }
.am-prov-head { display: flex; align-items: center; gap: 8px; }
.am-prov-title { margin: 0; font-size: 13.5px; font-weight: 600; }
.am-prov-head .rd-iconbtn { margin-left: auto; }
.am-prov .rd-facts { grid-template-columns: 120px minmax(0, 1fr); font-size: 12.5px; }
.am-prov-host { padding: 0 24px 4px; display: flex; flex-direction: column; gap: 8px; }

/* A queue or My Work row: identity and state only. */
.am-qrows { margin: 0; padding: 0; list-style: none; border: 1px solid var(--th-line); border-radius: var(--th-radius-5); background: var(--th-paper-sunk); }
.am-qrow { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.4fr) auto; gap: 4px 14px; padding: 10px 14px; border-top: 1px solid var(--th-line-soft); align-items: baseline; font-size: 13px; }
.am-qrow:first-child { border-top: 0; }
.am-qrow-who { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.am-qrow-name { font-weight: 600; color: var(--th-advant-deep); }
.am-qrow-ref { font-family: var(--th-font-mono); font-size: 11.5px; color: var(--th-ink-2); }
.am-qrow-what { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.am-qrow-sub { font-size: 12px; color: var(--th-ink-2); }

/* An unsent correction kept while the viewer is elsewhere on the same file. */
.am-keep { padding: 12px 24px 0; }

/* Sticky bar inside a reader that scrolls under it: keep focused controls clear of it. */
.af-file:has(.am-bar) { scroll-padding-top: 96px; }

/* ------------------------------------------------------------------
   1000 class
   ------------------------------------------------------------------ */
@media (max-width: 1332px) {
    .am-ws { grid-template-columns: minmax(0, 1fr) 320px; }
    .am-saved-grid { grid-template-columns: minmax(0, 1fr); }
    .am-saved-grid > .am-saved { grid-row: auto; }
    .am-saved-grid > .am-out, .am-saved-grid > .am-otherwork { grid-column: 1; }
    .am-q { grid-template-columns: 160px minmax(0, 1fr) auto; }
    .am-problem { grid-template-columns: minmax(0, 1fr) auto; }
    .am-problem.is-warning { grid-template-columns: minmax(0, 1fr); }
    .am-problem-text { grid-column: 1; }
}

/* ------------------------------------------------------------------
   One column: the change list and reason follow the form. The bar's
   "N changes" link jumps to the list.
   ------------------------------------------------------------------ */
@media (max-width: 1132px) {
    .am-ws { grid-template-columns: minmax(0, 1fr); }
    .am-bar { grid-template-columns: minmax(0, 1fr); }
    .am-bar-acts { justify-content: flex-start; }
}

/* ------------------------------------------------------------------
   Narrow (400; also 320 and 200% zoom)
   ------------------------------------------------------------------ */
@media (max-width: 952px) {
    .am-dest { padding: 12px 16px 24px; gap: 12px; }
    .am-bar { padding: 10px 12px; gap: 8px; top: 0; }
    .am-bar-acts .cc-btn { min-height: 44px; }
    .am-count { min-height: 44px; display: inline-flex; align-items: center; }
    .am-steps { gap: 2px; }
    .am-term-head, .am-term-body { padding-left: 12px; padding-right: 12px; }
    .am-term-acts { margin-left: 0; flex-basis: 100%; }
    .am-term-body .rd-facts { grid-template-columns: minmax(0, 1fr); }
    .am-q { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label acts" "body body"; gap: 2px 8px; padding: 8px 12px; align-items: center; }
    .am-q-label { grid-area: label; }
    .am-q-body { grid-area: body; }
    .am-q-acts { grid-area: acts; justify-self: end; }
    .am-q > .am-editor { grid-column: 1 / -1; grid-row: 3; }
    .am-q-acts .cc-btn, .am-editor-foot .cc-btn, .am-entry-acts .cc-btn, .am-change-acts .cc-btn, .am-group-foot .cc-btn, .am-cq-acts .cc-btn, .am-back, .am-cqd .rd-actions .cc-btn, .am-problem .cc-btn { min-height: 44px; }
    .am-editor { max-width: none; padding: 10px; }
    .am-opt { min-height: 44px; }
    .am-entry-acts { margin-left: 0; flex-basis: 100%; }
    .am-remove .rd-facts, .am-pv-entry .rd-facts, .am-immut .rd-facts, .am-apply .rd-facts, .am-saved .rd-facts, .am-proposal, .am-prov .rd-facts { grid-template-columns: minmax(0, 1fr); }
    .am-pv-sec { padding: 10px 12px 12px; }
    .am-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .am-row-note { grid-column: 1; }
    .am-problem, .am-problem.is-warning { grid-template-columns: minmax(0, 1fr); }
    .am-problem .cc-btn { justify-self: start; }
    .am-compare-grid { grid-template-columns: minmax(0, 1fr); }
    .am-cq { grid-template-columns: minmax(0, 1fr) auto; }
    .am-cq-acts { grid-column: 1 / -1; }
    .am-cq-facts { grid-template-rows: none; grid-auto-flow: row; grid-template-columns: 92px minmax(0, 1fr); gap: 3px 10px; }
    .am-qrow { grid-template-columns: minmax(0, 1fr); }
    .am-prov-host { padding: 0 16px 4px; }
    .am-keep { padding: 12px 16px 0; }
    .am-redact { white-space: normal; }
    .am-date-row .rd-select { min-width: 0; width: 100%; }
    .am-date-row > .rd-field:first-child { flex: 1 1 100%; }
}

/* A corrected answer inside an existing repeating entry carries the same chip as any
   corrected answer (owner decision 2026-10-29); it sits after the member's value. */
.af-member > .af-rev-chip { align-self: flex-start; margin-top: 2px; }

/* The complete correction record, inside the shared wide dialog. */
/* The record's facts read at the fact atoms' regular weight; the dialog shell's own text weight
   must not carry into them. */
.am-record { display: flex; flex-direction: column; gap: 14px; font-weight: 400; }
.am-record .af-amendments-empty { padding: 0; }
.am-record-sec { display: flex; flex-direction: column; gap: 6px; }
.am-record-head { margin: 0; font-size: 10.5px; font-weight: 600; color: var(--th-ink-2); text-transform: uppercase; letter-spacing: 0.06em; }
.am-record-kind { display: block; font-size: 11.5px; color: var(--th-ink-2); }
.am-record-entries { display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.am-record .rd-facts { grid-template-columns: 170px minmax(0, 1fr); font-size: 12.5px; }
.am-record-changes { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.am-record-change { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 2px 14px; }
.am-record-label { color: var(--th-ink-2); overflow-wrap: anywhere; }
.am-record-value { color: var(--th-ink); overflow-wrap: anywhere; }
.am-record-tech > summary { cursor: pointer; font-size: 12.5px; color: var(--th-ink-2); }
.am-record-tech > summary:focus-visible { outline: 2px solid var(--th-advant); outline-offset: 2px; border-radius: 2px; }
.am-record-tech[open] > summary { margin-bottom: 6px; }
.am-record-mono { font-family: var(--th-font-mono); font-size: 11.5px; overflow-wrap: anywhere; }

@media (max-width: 952px) {
    .am-prov .rd-facts, .am-record .rd-facts, .am-record-change { grid-template-columns: minmax(0, 1fr); }
    .am-prov-host { padding: 0 16px 4px; }
}
.af-group { min-width: 0; }

/* Correction leave questions keep the safe path primary; the shared dialog still
   owns containment, Escape and initial focus on Continue editing. */
.am-safe-leave .th-modal__foot > .cc-btn:not(.th-modal__confirm) { background: var(--th-advant-deep); border-color: var(--th-advant-deep); color: var(--th-advant-fg); }
.am-safe-leave .th-modal__foot > .th-modal__confirm.cc-btn:not(:disabled):not([aria-disabled="true"]) { background: var(--th-paper); border-color: var(--th-line); color: var(--th-ink); }
.am-safe-leave .th-modal__foot > .cc-btn:not(.th-modal__confirm):hover { background: oklch(from var(--th-advant-deep) calc(l - 0.04) c h); }
.am-safe-leave .th-modal__foot > .th-modal__confirm.cc-btn:not(:disabled):not([aria-disabled="true"]):hover { background: var(--th-paper-2); border-color: var(--th-line); }
.am-editor [role="checkbox"] .af-req-radio-dot,
.am-editor [role="checkbox"] .af-req-radio-dot > span { border-radius: 2px; }
