/* Regulatory change workspace (P1b): Work queue chips, case tabs and the training workspace in the Action Center. */
:root { --ri-train: #8a4b00; --ri-train-soft: #fff4e2; --ri-train-stripe: #f6dcae; --ri-chip-on: var(--brand-soft); }
/* dark theme: html[data-theme=dark], or the device setting when nothing is saved */ :root:where([data-theme="dark"]) { --ri-train: #f2b25c; --ri-train-soft: #2c2210; --ri-train-stripe: #3d2e12; } @media (prefers-color-scheme: dark){ :root:where(:not([data-theme])) { --ri-train: #f2b25c; --ri-train-soft: #2c2210; --ri-train-stripe: #3d2e12; } }

/* Training workspace: persistent striped banner and a distinct accent. */
.ri-training-banner { --ri-head: 78px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin: 4px 0 14px; padding: 6px 14px; position: sticky; top: var(--ri-head); z-index: 40; border: 2px solid var(--ri-train); border-radius: 12px; color: var(--ink);
  background: repeating-linear-gradient(135deg, var(--ri-train-soft) 0 14px, var(--ri-train-stripe) 14px 28px); }
.ri-training-banner[hidden] { display: none; }
.ri-training-banner { scroll-margin-top: 80px; }
#case-detail { scroll-margin-top: calc(80px + var(--ri-banner-h, 0px)); }
.ri-training-banner strong { color: var(--ri-train); }
.ri-training-banner span { font-size: .85rem; }
@media (max-width: 900px) { .ri-training-banner { --ri-head: 66px; } }
@media (max-width: 760px) { .ri-banner-more { display: none; } }
.ri-training .ac-tabs [role=tab][aria-selected=true], .ri-training .ri-case-tabs [role=tab][aria-selected=true] { color: var(--ri-train); border-bottom-color: var(--ri-train); }
.ri-training .ri-chip.on { border-color: var(--ri-train); box-shadow: inset 0 0 0 1px var(--ri-train); }
.ri-training .action-case.selected { border-color: var(--ri-train); }
.ri-training-tag { display: inline-block; margin: 0 0 8px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--ri-train); color: var(--ri-train); font-size: .85rem; font-weight: 700; }

/* Work queue: one row of single-select queue chips, an Overdue filter chip, a select under 600px. */
.ri-queues { margin: 8px 0 4px; }
.ri-queue-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.ri-chips, .ri-filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ri-filter-chips { padding-left: 8px; border-left: 1px solid var(--line); }
.ri-chip { display: grid; gap: 2px; min-height: 44px; padding: 6px 14px; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); font: inherit; cursor: pointer; }
.ri-chip:hover { border-color: var(--brand); }
.ri-chip:focus-visible { outline: 2px solid var(--focus, var(--brand)); outline-offset: 2px; }
.ri-chip.on { background: var(--ri-chip-on); border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.ri-chip-label { font-weight: 700; font-size: .92rem; }
.ri-chip-count { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ri-chip-count b { font-size: 1.15rem; color: var(--ink); margin-right: 2px; }
.ri-overdue.has-overdue .ri-chip-count b, .ri-overdue.has-overdue .ri-chip-label { color: var(--safety); }
.ri-overdue.has-overdue { border-color: var(--safety); }
.ri-chip-count.unavailable { font-style: italic; }
.ri-overdue.on { border-color: var(--safety); box-shadow: inset 0 0 0 1px var(--safety); }
.ri-queue-select-wrap { display: none; }
.ri-queue-summary { margin: 10px 0 0; }
.ri-coverage { margin: 2px 0 0; }
.ri-case-queues { font-size: .8rem; color: var(--muted); }

/* Case tabs (ARIA tabs). Scroll horizontally when they do not fit. */
.ri-case-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 8px 0 12px; overflow-x: auto; scrollbar-width: thin; }
.ri-case-tabs [role=tab] { flex: none; min-height: 44px; background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 0; padding: 10px 14px; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; }
.ri-case-tabs [role=tab]:hover { color: var(--ink); }
.ri-case-tabs [role=tab][aria-selected=true] { color: var(--brand); border-bottom-color: var(--brand); }
.ri-case-tabs [role=tab]:focus-visible { outline: 2px solid var(--focus, var(--brand)); outline-offset: -2px; }
.ri-case-panel:focus-visible { outline: 2px solid var(--focus, var(--brand)); outline-offset: 4px; border-radius: 6px; }
.ri-case-panel[hidden] { display: none; }
.ri-back { display: none; }

/* Overview */
.ri-primary { display: grid; gap: 6px; margin: 4px 0 16px; }
.ri-primary-btn { justify-self: start; min-height: 44px; }
/* dark theme: html[data-theme=dark], or the device setting when nothing is saved */ :where([data-theme="dark"]) .ri-primary-btn { border: 1px solid var(--brand); } @media (prefers-color-scheme: dark){ :where(:not([data-theme])) .ri-primary-btn { border: 1px solid var(--brand); } }
.ri-waiting p { margin: 0; padding: 10px 14px; border-left: 4px solid var(--muted); background: var(--panel); border-radius: 6px; }
.ri-review-note { font-size: .85rem; }
.ri-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0 0 14px; }
.ri-facts dt { font-weight: 700; color: var(--muted); }
.ri-facts dd { margin: 0; overflow-wrap: anywhere; }
.ri-request { border-top: 1px solid var(--line); padding: 10px 0; }
.ri-events { list-style: none; padding: 0; margin: 0; }

/* Phone: list OR case, never side by side; 44px touch targets. The register table already stacks into labelled rows. */
@media (max-width: 760px) {
  .ri-case-open .action-layout #case-list, .ri-case-open #filters, .ri-case-open #counts, .ri-case-open #candidates, .ri-case-open #queue-summary, .ri-case-open .ri-coverage { display: none; }
  /* The tabs scroll sideways; the faded right edge shows there is more. */
  .ri-case-tabs { mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); padding-right: 24px; }
  .ri-case-tabs [role=tab] { padding: 10px 10px; }
  .action-layout:has(.ri-no-case) #case-detail { display: none; }
  .ri-case-open .action-layout { margin-top: 8px; }
  .ri-back { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 8px; }
  /* The primary action stays in view under the sticky site header while the Overview tab scrolls. */
  .ri-primary { position: sticky; top: calc(66px + var(--ri-banner-h, 0px)); z-index: 3; padding: 10px 0; background: var(--bg, var(--panel)); border-bottom: 1px solid var(--line); }
  .ri-primary-btn { justify-self: stretch; }
  .action-page button, .action-page select, .action-page input:not([type=checkbox]):not([type=radio]), .action-page .act { min-height: 44px; }
  .action-page summary { min-height: 44px; display: flex; align-items: center; }
  .ri-facts { grid-template-columns: 1fr; }
  .ri-facts dd { margin-bottom: 6px; }
}
@media (max-width: 600px) {
  .ri-chips { display: none; }
  .ri-queue-select-wrap { display: grid; gap: 4px; flex: 1 1 200px; font-size: .9rem; }
  .ri-queue-select-wrap select { width: 100%; }
  .ri-filter-chips { padding-left: 0; border-left: 0; }
}

/* Deliverables tab (P2a): the plan grouped by selection state, the exclusion form and the on-time table. */
.ri-deliverables { padding-bottom: 112px; } /* room for the floating Ask button over the last card actions */
.ri-deliverables h3 { margin-top: 0; }
.ri-dl-readiness { margin: 8px 0; padding: 8px 12px; border-left: 4px solid var(--brand); background: var(--panel); border-radius: 6px; }
.ri-dl-inputs > summary { cursor: pointer; font-size: .9rem; color: var(--muted); min-height: 32px; }
.ri-dl-inputs p { overflow-wrap: anywhere; margin: 4px 0 8px; }
.ri-dl-empty { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ri-dl-group { margin: 18px 0; }
.ri-dl-group > summary, .ri-dl-group > h4 { display: flex; align-items: center; gap: 8px; font-size: 1.02rem; font-weight: 750; margin: 0 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.ri-dl-group > summary { cursor: pointer; }
.ri-dl-count { display: inline-flex; align-items: center; justify-content: center; min-width: 1.8em; padding: 0 8px; border-radius: 999px; background: var(--ri-chip-on); color: var(--ink); font-size: .82rem; font-variant-numeric: tabular-nums; }
.ri-dl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ri-dl-item { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--panel); }
.ri-dl-item:focus-visible, .ri-dl-item:focus { outline: 2px solid var(--focus, var(--brand)); outline-offset: 2px; }
.ri-dl-item.ri-dl-selected { border-left: 4px solid var(--brand); }
.ri-dl-item.ri-dl-proposed { border-left: 4px solid var(--muted); }
/* dark theme: html[data-theme=dark], or the device setting when nothing is saved */ :where([data-theme="dark"]) .ri-dl-item.ri-dl-proposed { border-style: dashed; } @media (prefers-color-scheme: dark){ :where(:not([data-theme])) .ri-dl-item.ri-dl-proposed { border-style: dashed; } }
.ri-dl-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.ri-dl-item p { margin: 2px 0; overflow-wrap: anywhere; }
.ri-dl-id { font-size: .82rem; color: var(--muted); }
.ri-dl-templates { font-size: .9rem; }
.ri-dl-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.ri-dl-exclude { margin-top: 8px; }
.ri-dl-error { color: var(--safety); font-weight: 600; font-size: .88rem; margin: 2px 0 0; }
.ri-dl-exclude [aria-invalid=true] { border-color: var(--safety); box-shadow: inset 0 0 0 1px var(--safety); }
.ri-dl-table-wrap { overflow-x: auto; }
.ri-dl-table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.ri-dl-table th, .ri-dl-table td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.ri-dl-table td { text-align: right; font-variant-numeric: tabular-nums; }
.ri-dl-table thead th { font-size: .8rem; color: var(--muted); }
.ia-task-deliverable { font-weight: 600; }
@media (max-width: 760px) {
  /* Folded groups show + and − so the state is clear without the small native triangle. */
  .ri-dl-group > summary, .ri-dl-inputs > summary { list-style: none; gap: 8px; }
  .ri-dl-group > summary::-webkit-details-marker, .ri-dl-inputs > summary::-webkit-details-marker { display: none; }
  .ri-dl-group > summary::before, .ri-dl-inputs > summary::before { content: '+'; display: inline-flex; align-items: center; justify-content: center; width: 1.4em; height: 1.4em; border: 1px solid var(--line); border-radius: 6px; font-weight: 700; }
  .ri-dl-group[open] > summary::before, .ri-dl-inputs[open] > summary::before { content: '\2212'; }
}
@media (max-width: 600px) {
  /* The table stacks into labelled rows on a phone. */
  .ri-dl-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ri-dl-table, .ri-dl-table tbody, .ri-dl-table tr, .ri-dl-table th, .ri-dl-table td { display: block; width: auto; }
  .ri-dl-table tr { border-bottom: 1px solid var(--line); padding: 6px 0; }
  .ri-dl-table th, .ri-dl-table td { border: 0; padding: 2px 0; text-align: left; }
  .ri-dl-table td::before { content: attr(data-label) ': '; color: var(--muted); }
}

/* ---------- P2b: inline draft editor in the Deliverables tab ---------- */
.ri-dl-draft { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; font-size: .9rem; }
.ri-dl-draft-state { color: var(--muted); }
.ri-draft { margin: 12px 0 18px; padding: 12px 14px; border: 2px solid var(--brand); border-radius: 12px; background: var(--panel); color: var(--ink); scroll-margin-top: calc(90px + var(--ri-banner-h, 0px)); padding-bottom: 96px; /* room for the floating Ask widget */ }
.ri-draft[hidden] { display: none; }
.ri-draft-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.ri-draft-head h4 { margin: 0; font-size: 1.1rem; }
.ri-draft-head h4:focus-visible, .ri-merge h5:focus-visible { outline: 2px solid var(--focus, var(--brand)); outline-offset: 2px; }
.ri-draft-pill { font-weight: 700; }
.ri-draft-changes_requested { border-color: var(--safety); color: var(--safety); }
.ri-draft-meta { font-size: .85rem; color: var(--muted); margin: 4px 0; overflow-wrap: anywhere; }
.ri-draft-stale { border-left: 4px solid var(--safety); padding: 6px 10px; }
.ri-draft-section { margin: 12px 0; }
.ri-draft-section h5 { margin: 0 0 4px; font-size: .98rem; }
.ri-draft-text { field-sizing: content; min-height: 4.5em; max-height: 70vh; width: 100%; box-sizing: border-box; font: inherit; font-size: .92rem; line-height: 1.45; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg, var(--panel)); color: var(--ink); resize: vertical; }
/* One scroll direction only: the page scrolls vertically, a wide table scrolls sideways. */
.ri-draft-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.ri-draft-table { border-collapse: collapse; width: 100%; font-size: .85rem; }
.ri-draft-table th, .ri-draft-table td { border-bottom: 1px solid var(--line); padding: 4px 6px; text-align: left; vertical-align: top; overflow-wrap: anywhere; white-space: normal; }
.ri-draft-table thead th { white-space: nowrap; }
.ri-draft-wide { min-width: 1040px; }
.ri-draft-xwide { min-width: 1400px; }
.ri-draft-table .ri-draft-cite { white-space: nowrap; }
.ri-draft-table thead th { background: var(--panel); font-size: .78rem; color: var(--muted); }
.ri-draft-table input { width: 100%; min-width: 9em; box-sizing: border-box; min-height: 36px; font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg, var(--panel)); color: var(--ink); }
.ri-draft-cite { white-space: nowrap; color: var(--muted); }
.ri-draft-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.ri-draft-actions button, .ri-dl-draft button, .ri-draft-review button { min-height: 44px; }
/* The editor's action row stays in view at the bottom of the panel while the draft scrolls. */
.ri-draft-sticky { position: sticky; bottom: 0; z-index: 2; background: var(--panel); padding: 8px 0; margin: 10px 0 0; border-top: 1px solid var(--line); }
.ri-draft-alert { margin: 6px 0; font-weight: 600; }
.ri-draft-alert:empty { margin: 0; }
.ri-draft-next { margin: 6px 0; font-size: .92rem; }
.ri-draft-requested { margin: 8px 0; padding: 8px 10px; border-left: 4px solid var(--safety); border-radius: 6px; background: var(--bg, var(--panel)); overflow-wrap: anywhere; }
.ri-draft-requested p { margin: 2px 0; }
.ri-review-rule { margin: 4px 0; font-size: .9rem; font-weight: 600; }
.ri-draft-review [aria-invalid="true"] { outline: 2px solid var(--safety); outline-offset: 2px; }
.ri-export-dirty { font-size: .85rem; }
.ri-merge-last > summary { cursor: pointer; min-height: 32px; display: list-item; }
.ri-draft-cites, .ri-draft-pins, .ri-draft-history { margin: 8px 0; font-size: .88rem; }
.ri-draft-cites > summary, .ri-draft-pins > summary, .ri-draft-history > summary { cursor: pointer; min-height: 32px; font-weight: 650; }
.ri-draft-cites li, .ri-draft-pins dd, .ri-draft-history li { overflow-wrap: anywhere; }
.ri-draft-pins dt { font-weight: 650; }
.ri-draft-pins dd { margin: 0 0 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; }
.ri-draft-review { margin: 12px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.ri-draft-review fieldset, .ri-merge-choice { border: 0; padding: 0; margin: 6px 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.ri-draft-review fieldset label, .ri-merge-choice label { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.ri-merge { margin: 10px 0; }
.ri-merge-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ri-merge-item { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.ri-merge-item.ri-merge-conflict { border-left: 4px solid var(--safety); }
.ri-merge-item.ri-merge-mine, .ri-merge-item.ri-merge-removed { border-left: 4px solid var(--brand); }
.ri-merge-label { margin: 0 0 6px; }
.ri-merge h5, .ri-draft-review h5 { font-size: 1rem; margin: 4px 0 6px; }
.ri-merge-diff { display: inline; background: none; color: inherit; font-weight: 650; box-shadow: inset 3px 0 0 var(--brand); padding-left: 6px; }
.ri-merge-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ri-merge-col { min-width: 0; }
.ri-merge-h { margin: 0 0 2px; font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
.ri-merge-result { margin: 4px 0 0; padding: 6px 8px; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: .84rem; border: 1px dashed var(--brand); border-radius: 6px; }
.ri-merge-col pre { margin: 0; padding: 6px 8px; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: .84rem; border: 1px solid var(--line); border-radius: 6px; background: var(--bg, var(--panel)); }
@media (max-width: 760px) {
  .ri-draft { padding: 10px 10px 96px; }
  .ri-merge-cols { grid-template-columns: minmax(0, 1fr); }
  .ri-draft-sticky { margin-left: -10px; margin-right: -10px; padding-left: 10px; padding-right: 10px; }
  .ri-draft-table-wrap { max-height: none; overflow: visible; border: 0; }
  .ri-draft-wide, .ri-draft-xwide { min-width: 0; }
  .ri-draft-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ri-draft-table, .ri-draft-table tbody, .ri-draft-table tr, .ri-draft-table th, .ri-draft-table td { display: block; width: auto; }
  .ri-draft-table tr { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; margin-bottom: 6px; }
  .ri-draft-table th, .ri-draft-table td { border: 0; padding: 2px 0; }
  .ri-draft-table td::before { content: attr(data-label) ': '; color: var(--muted); font-size: .78rem; }
  .ri-draft-table input { min-height: 44px; }
}

/* ---------- P3: contracts, blocked groups, case facts and clinical blockers in the Deliverables tab ---------- */
.ri-dl-item.ri-dl-blocked_inputs, .ri-dl-item.ri-dl-blocked_template, .ri-dl-item.ri-dl-blocked_rights { border-left: 4px solid var(--safety); }
.ri-dl-item.ri-dl-blocked_template, .ri-dl-item.ri-dl-blocked_rights { border-left-style: double; }
.ri-dl-missing { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 4px; }
.ri-dl-missing li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; overflow-wrap: anywhere; }
.ri-dl-missing li > span:first-child { font-weight: 600; }
.ri-dl-missing button, .ri-dl-clinical button, .ri-dl-facts button { min-height: 44px; }
.ri-dl-missing a { display: inline-flex; align-items: center; min-height: 44px; }
.ri-dl-facts { margin: 18px 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.ri-dl-facts > summary { cursor: pointer; font-weight: 750; min-height: 32px; }
.ri-dl-facts textarea, .ri-dl-clear textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg, var(--panel)); color: var(--ink); }
.ri-dl-facts select { min-height: 44px; }
.ri-dl-facts-yn { display: grid; grid-template-columns: repeat(auto-fit, minmax(16em, 1fr)); gap: 8px 16px; }
.ri-dl-facts [aria-invalid=true], .ri-dl-clear [aria-invalid=true] { border-color: var(--safety); box-shadow: inset 0 0 0 1px var(--safety); }
.ri-dl-clinical { padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.ri-dl-group > .hint { margin: 0 0 8px; font-size: .85rem; }
.ri-dl-counter { margin: 4px 0 0; font-size: .8rem; }
.ri-dl-clinical .ri-dl-blocker-open { border-left: 4px solid var(--safety); }
.ri-dl-clinical .ri-dl-blocker-cleared { border-left: 4px solid var(--brand); }
.ri-dl-pill-open { border: 1px solid var(--safety); color: var(--safety); font-weight: 700; }
.ri-dl-cleared q { overflow-wrap: anywhere; }
.ri-dl-clear { margin-top: 8px; }
@media (max-width: 760px) { .ri-dl-facts > summary { list-style: none; } .ri-dl-facts > summary::-webkit-details-marker { display: none; } .ri-dl-facts > summary::before { content: '+'; display: inline-flex; align-items: center; justify-content: center; width: 1.4em; height: 1.4em; margin-right: 8px; border: 1px solid var(--line); border-radius: 6px; font-weight: 700; } .ri-dl-facts[open] > summary::before { content: '\2212'; } }
.ri-draft-table textarea.ri-draft-cell-text { field-sizing: content; width: 100%; min-width: 9em; min-height: 3.2em; box-sizing: border-box; font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg, var(--panel)); color: var(--ink); resize: vertical; }

/* ---------- P4: implementation records by deliverable (Implementation tab) ---------- */
.ri-impl { margin: 8px 0 18px; }
.ri-impl > h3 { margin-bottom: 4px; }
.ri-impl-list { display: grid; gap: 10px; }
.ri-impl-item { border: 1px solid var(--line); border-left: 4px solid var(--muted); border-radius: 10px; padding: 8px 12px; background: var(--panel); scroll-margin-top: calc(90px + var(--ri-banner-h, 0px)); }
.ri-impl-item:focus-visible, .ri-impl-item:focus { outline: 2px solid var(--focus, var(--brand)); outline-offset: 2px; }
.ri-impl-item p { margin: 2px 0; overflow-wrap: anywhere; }
.ri-impl-item.ri-impl-ready, .ri-impl-item.ri-impl-marked { border-left-color: var(--brand); }
.ri-impl-item.ri-impl-reconcile, .ri-impl-item.ri-impl-mismatch { border-left-color: var(--safety); }
.ri-impl-pill-warn { background: transparent; color: var(--safety); border: 1px solid var(--safety); font-weight: 700; }
.ri-impl-pill-ok { background: var(--ri-chip-on); color: var(--ink); border: 1px solid var(--brand); }
.ri-impl-reasons { margin: 6px 0; padding: 6px 10px; border: 1px solid var(--safety); border-radius: 8px; }
.ri-impl-reasons strong { color: var(--safety); }
.ri-impl-reasons ul { margin: 2px 0 0; padding-left: 20px; }
.ri-impl-facts { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 6px 0; font-size: .92rem; }
.ri-impl-facts dd { margin: 0; overflow-wrap: anywhere; }
.ri-impl-check { padding: 4px 10px; border-left: 3px solid var(--brand); background: var(--ri-chip-on); border-radius: 4px; }
.ri-impl-next { font-size: .88rem; }
.ri-impl-ws { margin: 6px 0 10px; }
.ri-impl-ws p { margin: 4px 0; }
.ri-impl-blockers { margin: 2px 0 8px; padding-left: 20px; }
.ri-impl-blockers a { overflow-wrap: anywhere; }
.ri-impl-ws-btn:disabled { cursor: not-allowed; opacity: .55; box-shadow: none; }
.ri-impl-form { margin-top: 8px; }
.ri-impl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 12px; }
.ri-impl-form [aria-invalid=true] { border-color: var(--safety); box-shadow: inset 0 0 0 1px var(--safety); }
.ri-impl-outcome label { display: block; min-height: 32px; }
.ri-impl-jira { margin: 8px 0; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 8px; }
.ri-impl-jira h5 { margin: 0 0 4px; font-size: 1rem; }
.ri-impl-payload { max-height: 260px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .82rem; background: var(--bg, var(--panel)); border: 1px solid var(--line); border-radius: 6px; padding: 8px; margin: 4px 0; }
.ri-impl-payload:focus-visible { outline: 2px solid var(--focus, var(--brand)); outline-offset: 2px; }
.ri-impl-sha code { overflow-wrap: anywhere; word-break: break-all; font-size: .82rem; }
.ri-impl-handoff { font-size: .85rem; }
.ri-impl-kpi thead th { overflow-wrap: normal; word-break: normal; hyphens: manual; }
.ri-impl-history > summary { cursor: pointer; font-size: .88rem; color: var(--muted); min-height: 32px; }
.ri-impl-pill-pending { background: transparent; color: var(--ink); border: 1px dashed var(--brand); }
.ri-impl-form h4 { margin: 0 0 6px; }
.ri-impl .act { min-height: 36px; }
.ri-impl-earlier-check { padding-left: 10px; border-left: 3px solid var(--line); }
.ri-impl-late { font-weight: 600; }
.ri-impl-nocheck { font-size: .9rem; }
.ri-impl-outside { margin: 4px 0 8px; }
.ri-impl-empty { margin: 8px 0; }
.ri-impl-empty p { margin: 0 0 8px; }
.ri-impl-handoffs > summary { cursor: pointer; font-size: .88rem; color: var(--muted); min-height: 32px; }
.ri-impl-kpi .ri-dl-ontime { display: block; font-weight: 400; }
@media (max-width: 600px) { .ri-impl-facts { grid-template-columns: 1fr; } .ri-impl-facts dt { margin-top: 4px; } .ri-impl-form { padding-bottom: 16px; } }

/* P5 Shadow check (queue chip view): agreement by stratum with denominators and the disagreements. */
.ri-shadow { margin: 14px 0 6px; padding: 14px 16px; border: 1px dashed var(--line); border-radius: 12px; background: var(--panel); }
.ri-shadow h2 { margin: 0 0 4px; font-size: 1.15rem; }
.ri-shadow h3 { margin: 16px 0 6px; font-size: 1rem; }
.ri-shadow-head .hint { margin: 0 0 8px; max-width: 75ch; }
.ri-shadow-flag { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ri-shadow-flag p { margin: 0; }
.ri-shadow-flag .act { min-height: 44px; }
.ri-shadow-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 12px 0 0; }
.ri-shadow-summary > div { padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg, var(--panel)); }
.ri-shadow-summary dt { font-weight: 700; color: var(--muted); font-size: .85rem; }
.ri-shadow-summary dd { margin: 2px 0 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ri-shadow-summary dd.hint { font-size: .8rem; }
.ri-shadow-controls { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin: 14px 0 8px; }
.ri-shadow-controls select { min-height: 40px; }
.ri-shadow-controls select:focus-visible { outline: 2px solid var(--focus, var(--brand)); outline-offset: 2px; }
.ri-shadow-only input:focus-visible { outline: 2px solid var(--focus, var(--brand)); outline-offset: 2px; }
.ri-shadow-small { color: var(--muted); font-size: .85em; font-weight: 400; }
.ri-shadow-scope { margin: 8px 0 0; }
.ri-shadow-lead { margin: 0; }
.ri-shadow-only { display: inline-flex; gap: 6px; align-items: center; min-height: 40px; }
.ri-shadow-only input { width: 20px; height: 20px; }
.ri-shadow-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ri-shadow-table th, .ri-shadow-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ri-shadow-table thead th { font-size: .85rem; color: var(--muted); }
.ri-shadow-list { list-style: none; margin: 0; padding: 0; }
.ri-shadow-list > li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.ri-shadow-list > li > button { background: none; border: 0; padding: 0; min-height: 44px; font: inherit; font-weight: 700; color: var(--brand); text-align: left; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.ri-shadow-list > li > button:focus-visible { outline: 2px solid var(--focus, var(--brand)); outline-offset: 2px; }
.ri-shadow-list ul { margin: 4px 0 0; padding-left: 18px; }
.ri-shadow-evals { margin: 4px 0; padding-left: 18px; }
.ri-shadow-eval .hint { margin: 4px 0 0; }
@media (max-width: 760px) {
  .ri-shadow { padding: 12px; }
  .ri-shadow-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .ri-shadow-table, .ri-shadow-table tbody, .ri-shadow-table tr, .ri-shadow-table th, .ri-shadow-table td { display: block; width: auto; }
  .ri-shadow-table tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .ri-shadow-table th, .ri-shadow-table td { border: 0; padding: 2px 0; }
  .ri-shadow-table td::before { content: attr(data-label) ': '; font-weight: 700; color: var(--muted); }
  .ri-shadow-flag .act { width: 100%; }
}
.ri-shadow-group { display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; }

/* ---------- Auto Assessment A1: source chips, source popover, case header strip ---------- */
/* Chips: quiet grey for rule, library, person and "before source tracking"; AI proposals get a dashed outline and a
   diamond mark, so they are distinguishable without colour. */
:root { --aa-chip-bg: #eef1f4; --aa-chip-ink: #3c4752; --aa-chip-line: #c9d1d9; }
/* dark theme: html[data-theme=dark], or the device setting when nothing is saved */ :root:where([data-theme="dark"]) { --aa-chip-bg: #222c35; --aa-chip-ink: #c9d3dc; --aa-chip-line: #4a5866; } @media (prefers-color-scheme: dark){ :root:where(:not([data-theme])) { --aa-chip-bg: #222c35; --aa-chip-ink: #c9d3dc; --aa-chip-line: #4a5866; } }
:root[data-theme="dark"] { --aa-chip-bg: #222c35; --aa-chip-ink: #c9d3dc; --aa-chip-line: #4a5866; }
.ia-pfield { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ia-phead { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.ia-phead label { font-weight: 600; }
.ia-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; padding: 1px 8px; border: 1px solid var(--aa-chip-line); border-radius: 999px;
  background: var(--aa-chip-bg); color: var(--aa-chip-ink); font: inherit; font-size: .78rem; line-height: 1.3; cursor: pointer; }
.ia-chip:hover { border-color: var(--muted); }
.ia-chip:focus-visible { outline: 3px solid var(--focus, #1a73e8); outline-offset: 2px; }
.ia-chip-ai_proposal { border: 2px dashed currentColor; background: transparent; color: var(--ink); font-weight: 600; }
.ia-chip-icon { font-size: .8em; }
.ia-hide-sources .ia-chip:not(.ia-chip-ai_proposal) { display: none; }
.ia-src-pop { border: 1px solid var(--line); border-left: 4px solid var(--muted); border-radius: 6px; padding: 8px 12px; background: var(--panel, #fff); font-size: .88rem; max-width: 100%; }
.ia-src-pop[hidden] { display: none; }
.ia-src-pop dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 12px; margin: 0 0 6px; }
.ia-src-pop dt { font-weight: 600; } .ia-src-pop dd { margin: 0; overflow-wrap: anywhere; }
.ia-src-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; }
.ia-src-summary .hint { margin: 0; }
.ia-date-row { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.ia-date-row input { flex: 1 1 9em; min-width: 0; }
/* Captioned options ("Precision: Month only") need their full width; the row wraps instead of cutting them. */
.ia-date-row select { flex: 1 1 auto; min-width: 0; }
.ia-lc-src { margin-top: 4px; }
@media (max-width: 600px) { .ia-src-pop dl { grid-template-columns: 1fr; } .ia-src-pop dd { margin-bottom: 4px; } }

/* Case header strip: Mode · State · Risk · Baseline · Next owner · Confidence, above the case tabs on every tab.
   Term/value pairs with an icon and words, never colour alone. At phone width only Mode, State and Next owner show;
   the rest are in "Case context (n more)". */
.aa-strip { margin: 8px 0 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel, transparent); }
.aa-strip dl { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; }
.aa-strip .aa-slot { display: flex; flex-direction: column; min-width: 0; }
/* The strip labels sit on the strip's tinted background: the body text colour keeps them above 4.5:1 (ux-11). */
.aa-strip dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink); }
.aa-strip dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.aa-strip .aa-icon { display: inline-block; width: 1.1em; margin-right: .3em; color: var(--muted); }
.aa-strip .aa-slot-confidence dd { font-weight: 400; font-style: italic; }
.aa-strip .aa-strip-narrow { display: none; }
.aa-strip details { margin-top: 6px; }
.aa-strip summary { cursor: pointer; font-size: .88rem; }
/* "Case context (n more)": a visible + / − marker (the native triangle is hidden by the phone summary rule) and a
   44 px target. */
.aa-strip .aa-strip-narrow > details > summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; }
.aa-strip .aa-strip-narrow > details > summary::-webkit-details-marker { display: none; }
.aa-strip .aa-strip-narrow > details > summary::before { content: '+'; display: inline-flex; align-items: center; justify-content: center; width: 1.4em; height: 1.4em; border: 1px solid var(--line); border-radius: 6px; font-weight: 700; }
.aa-strip .aa-strip-narrow > details[open] > summary::before { content: '\2212'; }
.ia-areas legend .ia-chip, .ia-lifecycle-details > summary .ia-chip { margin-left: 4px; vertical-align: middle; }
@media (max-width: 600px) {
  .aa-strip .aa-strip-wide { display: none; }
  .aa-strip .aa-strip-narrow { display: block; }
  .aa-strip dl { flex-direction: column; gap: 4px; }
}

/* ---------- Auto Assessment A2: Requirement changes in the case Evidence tab ---------- */
.aa2-changes { margin-top: 14px; }
.aa2-changes h3 { margin-bottom: 4px; }
.aa2-conclusion { margin: 6px 0; font-weight: 600; }
.aa2-health { margin: 6px 0; }
.aa2-deltas, .aa2-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 8px; }
.aa2-delta, .aa2-cand { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--panel); min-width: 0; overflow-wrap: anywhere; }
.aa2-delta { border-left: 4px solid var(--brand); }
.aa2-cand[data-applicability=out_of_scope] { border-left: 4px solid var(--muted); }
.aa2-cand[data-applicability=undetermined] { border-left: 4px dashed var(--muted); }
.aa2-cand[data-applicability=applicable] { border-left: 4px solid var(--brand); }
.aa2-line { margin: 0; }
.aa2-kind, .aa2-app, .aa2-pill { display: inline-block; margin-right: 6px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); font-size: .8rem; font-weight: 700; color: var(--ink); background: var(--bg, var(--panel)); }
.aa2-kind-added, .aa2-kind-modified, .aa2-kind-removed, .aa2-kind-clarified { border-color: var(--brand); }
.aa2-kind-removed { text-decoration: none; border-style: dashed; }
.aa2-pill.aa2-provisional, .aa2-pill.aa2-not_determined { border-style: dashed; border-color: var(--safety); color: var(--ink); }
.aa2-app-applicable { border-color: var(--brand); }
.aa2-app-undetermined { border-style: dashed; }
.aa2-reasons { margin: 4px 0 0; font-size: .88rem; color: var(--muted); }
.aa2-competing { margin: 4px 0 0; padding: 4px 8px; border-left: 3px solid var(--safety); font-size: .88rem; }
.aa2-more { margin-top: 4px; }
.aa2-more > summary, .aa2-group > summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; gap: 8px; color: var(--ink); }
.aa2-group > summary { font-weight: 700; min-height: 44px; border-top: 1px solid var(--line); }
.aa2-more > summary:focus-visible, .aa2-group > summary:focus-visible { outline: 2px solid var(--focus, var(--brand)); outline-offset: 2px; border-radius: 4px; }
.aa2-texts { margin: 6px 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.aa2-texts dt { font-weight: 700; color: var(--muted); font-size: .85rem; }
.aa2-texts dd { margin: 0 0 6px; }
.aa2-quote { margin: 2px 0; padding: 4px 10px; border-left: 3px solid var(--line); font-style: normal; }
.aa2-en { margin: 2px 0 0; }
@media (max-width: 600px) {
  .aa2-more > summary { min-height: 44px; }
  .aa2-delta, .aa2-cand { padding: 8px 10px; }
}
.aa2-more > summary, .aa2-group > summary { list-style: none; }
.aa2-more > summary::-webkit-details-marker, .aa2-group > summary::-webkit-details-marker { display: none; }
.aa2-more > summary::before, .aa2-group > summary::before { content: '+'; content: '+' / ''; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 1.4em; height: 1.4em; border: 1px solid var(--line); border-radius: 6px; font-weight: 700; }
.aa2-more[open] > summary::before, .aa2-group[open] > summary::before { content: '\2212'; content: '\2212' / ''; }
.aa2-caution { margin: 0 0 4px; font-size: .88rem; color: var(--ink); }
.aa2-not-returned { margin: 6px 0; }
.aa2-state-group { margin: 10px 0 4px; }
.aa2-state-group > h4 { margin: 8px 0 4px; font-size: .95rem; }
.aa2-why { margin: 0 0 6px; font-size: .88rem; color: var(--ink); }
.aa2-shown { margin: 4px 0; }
.aa2-show-all, .aa2-retry { min-height: 44px; }
.aa2-cand:focus-visible { outline: 2px solid var(--focus, var(--brand)); outline-offset: 2px; }

/* ==== aa2: scope tag review ==== */
/* Requirements page, Baseline releases view: sub-view buttons and the Scope tag review queue (aa-subviews.js,
   aa-binding-review.js). Selectors start with .aa-subviews or .aa2-review. */
.aa-subviews { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.aa-subviews .aa-subviews-btn { min-height: 44px; padding: 6px 14px; font-size: .95rem; color: var(--ink); }
.aa-subviews .aa-subviews-btn:focus-visible { outline: 2px solid var(--focus, var(--brand)); outline-offset: 2px; }
.aa-subview[hidden] { display: none; }
.aa2-review { min-width: 0; overflow-wrap: anywhere; color: var(--ink); }
/* The Requirements page keeps a light background in both themes; the sub-views carry their own themed surface so
   their text and cards share one theme (release review ux-01). */
.aa2-review, .aa3-baseline { background: var(--panel); color: var(--ink); padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
@media (max-width: 600px) { .aa2-review, .aa3-baseline { padding: 12px; } }
.aa2-review h2 { margin: 0 0 6px; font-size: 1.25rem; }
.aa2-review h3 { margin: 0 0 4px; font-size: 1.05rem; }
.aa2-review .act { min-height: 44px; padding: 6px 12px; font-size: .9rem; color: var(--ink); }
.aa2-review .act:focus-visible, .aa2-review select:focus-visible, .aa2-review input:focus-visible, .aa2-review textarea:focus-visible { outline: 2px solid var(--focus, var(--brand)); outline-offset: 2px; }
.aa2-review select, .aa2-review input, .aa2-review textarea { min-height: 44px; max-width: 100%; box-sizing: border-box; font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; }
.aa2-review textarea { width: 100%; min-height: 88px; }
.aa2-review-training { margin: 0 0 10px; padding: 6px 12px; border: 2px solid var(--ri-train); border-radius: 10px; background: var(--ri-train-soft); color: var(--ink); }
.aa2-review-intro { margin: 0 0 10px; max-width: 72ch; }
.aa2-review-note { margin: 6px 0; font-size: .92rem; }
.aa2-review-note[data-aa2-review="db_pending"] { padding: 8px 12px; border: 1px dashed var(--line); border-radius: 10px; color: var(--ink); }
.aa2-review-head, .aa2-review-drawbox { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 10px; }
.aa2-review-head > label, .aa2-review-drawbox > label { font-weight: 700; }
.aa2-review-line, .aa2-review-state { flex-basis: 100%; margin: 0; }
.aa2-review-state { font-weight: 700; }
.aa2-review-state[data-state="rejected"] { color: var(--safety); }
.aa2-review-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.aa2-review-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 10px; }
.aa2-review-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: var(--panel); min-width: 0; }
.aa2-review-row:focus-visible { outline: 2px solid var(--focus, var(--brand)); outline-offset: 2px; }
.aa2-review-row h3 { margin: 0 0 2px; font-size: 1rem; }
.aa2-review-loc, .aa2-review-actor { margin: 2px 0; }
.aa2-review-dim { margin: 8px 0 0; padding: 8px 0 0; border-top: 1px solid var(--line); }
.aa2-review-dimline, .aa2-review-person, .aa2-review-ev, .aa2-review-conflict { margin: 2px 0; }
.aa2-review-conflict { padding: 2px 8px; border-left: 3px solid var(--safety); font-size: .9rem; }
.aa2-pill.aa2-review-proposed, .aa2-pill.aa2-review-none { border-style: dashed; }
.aa2-pill.aa2-review-reviewed { border-color: var(--brand); }
.aa2-pill.aa2-review-rejected { text-decoration: line-through; }
.aa2-review-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 0; }
.aa2-review-form { display: grid; gap: 6px; margin: 8px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg, var(--panel)); }
.aa2-review-form > label { font-weight: 700; }
.aa2-review-values { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.aa2-review-values[disabled] { opacity: .6; }
.aa2-review-check { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.aa2-review-check input { min-height: 0; width: 20px; height: 20px; }
.aa2-review-exclude-hint { margin: 0; padding: 4px 8px; border-left: 3px solid var(--safety); }
.aa2-review-exclude-hint[hidden] { display: none; }
.aa2-review-error:empty { display: none; }
.aa2-review-error { margin: 4px 0; }
.aa2-review-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.aa2-review-families { margin: 8px 0; padding-left: 1.2em; }
.aa2-review-families li { margin: 4px 0; }
@media (max-width: 600px) {
  .aa-subviews .aa-subviews-btn, .aa2-review .act, .aa2-review select, .aa2-review input:not([type=checkbox]) { width: 100%; }
  .aa2-review-row { padding: 8px 10px; }
  .aa2-review-head, .aa2-review-drawbox { flex-direction: column; align-items: stretch; }
}
.aa2-review .aa2-pill { white-space: normal; max-width: 100%; overflow-wrap: anywhere; }

/* ==== aa25: company facts ==== */
/* Action Center case, Impact tab: the "Company facts" block (aa-context-panel.js). A table at wide widths and labelled
   cards in narrow containers (container query, so the case column and phones both work). Selectors start with .aa25-. */
.aa25-facts { margin: 0 0 14px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); min-width: 0; overflow-wrap: anywhere; container-type: inline-size; }
.aa25-facts > summary, .aa25-sub > summary, .aa25-record > summary, .aa25-request > summary, .aa25-unsaved > summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; color: var(--ink); }
.aa25-facts > summary { font-weight: 700; font-size: 1.05rem; }
.aa25-sub > summary { font-weight: 700; border-top: 1px solid var(--line); }
.aa25-facts summary::-webkit-details-marker { display: none; }
.aa25-facts > summary::before, .aa25-sub > summary::before, .aa25-record > summary::before, .aa25-request > summary::before, .aa25-unsaved > summary::before { content: '+'; content: '+' / ''; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 1.4em; height: 1.4em; border: 1px solid var(--line); border-radius: 6px; font-weight: 700; }
.aa25-facts[open] > summary::before, .aa25-sub[open] > summary::before, .aa25-record[open] > summary::before, .aa25-request[open] > summary::before, .aa25-unsaved[open] > summary::before { content: '\2212'; content: '\2212' / ''; }
.aa25-facts summary:focus-visible, .aa25-facts .act:focus-visible, .aa25-facts .btn:focus-visible, .aa25-facts select:focus-visible, .aa25-facts input:focus-visible { outline: 2px solid var(--focus, var(--brand)); outline-offset: 2px; }
.aa25-lead { margin: 4px 0; max-width: 72ch; }
.aa25-tag { margin: 4px 0; padding: 4px 10px; border: 1px dashed var(--line); border-radius: 8px; font-size: .9rem; }
.aa25-tag.aa25-training { border: 2px solid var(--ri-train); background: var(--ri-train-soft); }
.aa25-asof { margin: 4px 0; font-size: .9rem; }
.aa25-facts .act, .aa25-facts .btn { min-height: 44px; padding: 6px 12px; font-size: .9rem; color: var(--ink); }
.aa25-facts select, .aa25-facts input:not([type=checkbox]) { min-height: 44px; max-width: 100%; box-sizing: border-box; font: inherit; color: var(--ink); background: var(--bg, var(--panel)); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; }
.aa25-table { width: 100%; border-collapse: collapse; margin: 6px 0; font-size: .92rem; }
.aa25-table caption { text-align: left; font-weight: 700; padding: 4px 0; }
.aa25-table th, .aa25-table td { text-align: left; vertical-align: top; padding: 6px; border-bottom: 1px solid var(--line); }
.aa25-table td input:not([type=checkbox]), .aa25-table td select { width: 100%; min-width: 7em; }
.aa25-areas, .aa25-markets { margin: 6px 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.aa25-areas legend, .aa25-markets legend { font-weight: 700; font-size: .9rem; }
.aa25-chip { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 2px 4px 2px 10px; border: 1px solid var(--brand); border-radius: 999px; font-size: .88rem; }
.aa25-chip.aa25-suggested { border-style: dashed; border-color: var(--muted); border-radius: 10px; padding: 4px 4px 4px 10px; }
.aa25-only-eu, .aa25-partner { margin: 4px 0 0; padding: 2px 8px; border-left: 3px solid var(--safety); font-size: .88rem; }
.aa25-check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: 4px 0; }
.aa25-check input { width: 20px; height: 20px; }
.aa25-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 10px 0; }
.aa25-actions > .hint { flex-basis: 100%; margin: 0; }
.aa25-confirmed { margin: 0; font-weight: 700; }
.aa25-btn-disabled, .aa25-save[aria-disabled="true"] { opacity: .65; }
.aa25-conflict { margin: 8px 0; padding: 8px 12px; border-left: 4px solid var(--safety); }
.aa25-unsaved pre { white-space: pre-wrap; font-size: .85rem; }
.aa25-status { margin: 6px 0; }
.aa25-missing { margin: 10px 0 4px; padding-top: 6px; border-top: 1px solid var(--line); }
.aa25-missing h4 { margin: 4px 0; font-size: .95rem; }
.aa25-missing ul { margin: 4px 0; padding-left: 1.2em; }
.aa25-missing li { margin: 4px 0; }
.aa25-question { margin: 4px 0; padding: 6px 10px; border-left: 3px solid var(--line); }
.aa25-record dl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; margin: 4px 0; }
.aa25-record dt { font-weight: 700; color: var(--muted); font-size: .85rem; }
.aa25-record dd { margin: 0 0 4px; }
.aa25-hash { font-family: ui-monospace, monospace; font-size: .82rem; }
/* Cards below 960 px of the block's width: beside the sticky strip at 1440 the table had about 780 px (ux-10). */
@container (max-width: 960px) {
  .aa25-table, .aa25-table caption, .aa25-table tbody, .aa25-table tr, .aa25-table td { display: block; width: 100%; box-sizing: border-box; }
  .aa25-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .aa25-table tr { margin: 0 0 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; }
  .aa25-table td { border: 0; padding: 4px 0; }
  .aa25-table td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; font-weight: 700; font-size: .85rem; color: var(--muted); margin-bottom: 2px; }
  .aa25-actions .btn, .aa25-actions .act { width: 100%; }
}
@media (max-width: 600px) { .aa25-facts { padding: 6px 10px; } }

/* ==== aa3: company baseline ==== */
/* Requirements page, Baseline releases view: the Company baseline sub-view (aa-baseline-view.js) and the shared
   "Link a control" form (aa-coverage-form.js). Narrow containers stack fields and widen buttons (container query, so
   the sub-view and the impact matrix inspector both work). Selectors start with .aa3-. Colours come from the page
   variables, so light and dark follow the page. */
.aa3-baseline, .aa3-coverage-form { min-width: 0; overflow-wrap: anywhere; color: var(--ink); container-type: inline-size; }
.aa3-baseline h2 { margin: 0 0 6px; font-size: 1.25rem; }
.aa3-baseline h3 { margin: 0 0 4px; font-size: 1.05rem; }
.aa3-baseline h4 { margin: 12px 0 4px; font-size: .95rem; }
.aa3-baseline .act, .aa3-coverage-form .act { min-height: 44px; padding: 6px 12px; font-size: .9rem; color: var(--ink); }
.aa3-baseline .act.aa3-small { min-height: 44px; padding: 4px 10px; font-size: .85rem; }
.aa3-baseline .act.aa3-primary, .aa3-coverage-form .act.aa3-primary { border-color: var(--brand); font-weight: 700; }
.aa3-baseline .act:focus-visible, .aa3-baseline select:focus-visible, .aa3-baseline input:focus-visible, .aa3-baseline textarea:focus-visible, .aa3-baseline summary:focus-visible,
.aa3-coverage-form .act:focus-visible, .aa3-coverage-form select:focus-visible, .aa3-coverage-form input:focus-visible, .aa3-coverage-form textarea:focus-visible,
.aa3-baseline [tabindex="-1"]:focus-visible { outline: 2px solid var(--focus, var(--brand)); outline-offset: 2px; }
.aa3-baseline select, .aa3-baseline input:not([type=checkbox]), .aa3-baseline textarea,
.aa3-coverage-form select, .aa3-coverage-form input:not([type=checkbox]), .aa3-coverage-form textarea { min-height: 44px; max-width: 100%; box-sizing: border-box; font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; }
.aa3-baseline textarea, .aa3-coverage-form textarea { width: 100%; min-height: 72px; }
.aa3-training { margin: 0 0 10px; padding: 6px 12px; border: 2px solid var(--ri-train); border-radius: 10px; background: var(--ri-train-soft); color: var(--ink); }
.aa3-note { margin: 6px 0; font-size: .92rem; max-width: 72ch; }
.aa3-note[data-aa3="db_pending"] { padding: 8px 12px; border: 1px dashed var(--line); border-radius: 10px; color: var(--ink); }
.aa3-recorded, .aa3-draft, .aa3-start, .aa3-earlier, .aa3-coverage, .aa3-roles { margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); min-width: 0; }
.aa3-start:empty { display: none; }
.aa3-state { margin: 2px 0 6px; font-weight: 700; }
.aa3-state-draft { border-left: 4px dashed var(--ri-train); padding-left: 8px; }
.aa3-state-recorded { border-left: 4px solid var(--brand); padding-left: 8px; }
.aa3-replaced { margin: 2px 0 6px; font-size: .9rem; }
.aa3-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 0; }
.aa3-items { margin: 6px 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.aa3-item { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg, var(--panel)); min-width: 0; }
.aa3-item-line, .aa3-item-meta { margin: 2px 0; }
.aa3-pill { display: inline-block; margin: 2px 6px 2px 0; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); font-size: .8rem; font-weight: 700; color: var(--ink); background: var(--bg, var(--panel)); white-space: normal; max-width: 100%; }
.aa3-pill.aa3-ok { border-color: var(--brand); }
.aa3-pill.aa3-warn { border-color: var(--ri-train); border-style: dashed; }
.aa3-propose-log { margin: 6px 0; padding-left: 1.2em; font-size: .9rem; }
.aa3-propose-log:empty, .aa3-propose-result:empty, .aa3-error:empty { display: none; }
.aa3-propose-result { margin: 6px 0; padding: 6px 10px; border-left: 3px solid var(--brand); font-size: .92rem; }
.aa3-baseline details > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; color: var(--ink); }
.aa3-record-details dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 12px; margin: 4px 0; }
.aa3-record-details dt { font-weight: 700; }
.aa3-record-details dd { margin: 0; min-width: 0; }
.aa3-hash { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; word-break: break-all; }
.aa3-gaps, .aa3-confirmations, .aa3-coverage-list, .aa3-role-list, .aa3-earlier ul { margin: 4px 0; padding-left: 1.2em; }
.aa3-gaps li, .aa3-confirmations li, .aa3-earlier li, .aa3-role-list li { margin: 3px 0; }
.aa3-coverage-list > li { margin: 6px 0; }
.aa3-coverage-list .aa3-link { margin: 2px 0; font-size: .92rem; }
.aa3-statement, .aa3-standing { margin: 4px 0; max-width: 72ch; }
.aa3-standing { padding: 6px 10px; border: 1px dashed var(--line); border-radius: 8px; }
.aa3-start-form, .aa3-adopt-form, .aa3-local-form, .aa3-withdraw-form, .aa3-remove-form, .aa3-coverage-form { display: grid; gap: 8px; margin: 8px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg, var(--panel)); }
.aa3-start-form[hidden], .aa3-adopt-fields[hidden], .aa3-field[hidden] { display: none; }
.aa3-adopt-fields { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.aa3-adopt-fields > .aa3-boxes, .aa3-adopt-fields > .aa3-attest, .aa3-adopt-fields > .aa3-error, .aa3-adopt-fields > .aa3-actions { grid-column: 1 / -1; }
.aa3-coverage-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.aa3-coverage-form > h4, .aa3-coverage-form > .hint, .aa3-coverage-form > .aa3-covers, .aa3-coverage-form > .aa3-error, .aa3-coverage-form > .aa3-actions { grid-column: 1 / -1; }
.aa3-coverage-form > h4 { margin: 0; }
.aa3-field { display: grid; gap: 4px; min-width: 0; align-content: start; }
.aa3-field > label { font-weight: 700; }
.aa3-field > .hint { margin: 0; font-size: .85rem; }
.aa3-boxes, .aa3-covers { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.aa3-covers { display: block; }
.aa3-boxlabel { margin: 4px 0 0; font-weight: 700; font-size: .9rem; }
.aa3-check { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.aa3-check input { width: 20px; height: 20px; flex: none; }
.aa3-attest { align-items: flex-start; padding: 6px 0; }
.aa3-attest input { margin-top: 2px; }
.aa3-confirm-text { margin: 0 0 6px; padding: 8px 12px; border-left: 4px solid var(--brand); font-weight: 700; }
.aa3-error { margin: 4px 0; }
.aa3-role-pick { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.aa3-role { display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; }
@container (max-width: 640px) {
  .aa3-adopt-fields, .aa3-coverage-form { grid-template-columns: minmax(0, 1fr); }
  .aa3-baseline .act, .aa3-coverage-form .act, .aa3-baseline select, .aa3-baseline input:not([type=checkbox]), .aa3-coverage-form select, .aa3-coverage-form input:not([type=checkbox]) { width: 100%; }
  .aa3-record-details dl { grid-template-columns: minmax(0, 1fr); }
  .aa3-recorded, .aa3-draft, .aa3-start, .aa3-earlier, .aa3-coverage, .aa3-roles { padding: 8px 10px; }
  .aa3-role-pick { flex-direction: column; align-items: stretch; }
}

/* ==== aa4: matrix ==== */
/* The impact matrix of the Impact tab (aa-matrix-panel.js). Proposed values: dashed outline; decided: solid; the
   selected row: a bar on the left. The table becomes stacked cards below 720 px of the block's own width. */
.aa4-onthistab { margin: 0 0 12px; }
.aa4-onthistab ul { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; list-style: none; }
.aa4-onthistab a { display: inline-flex; align-items: center; min-height: 32px; }
.aa4-host:focus { outline: none; }
.aa4-host:focus-visible { outline: 2px solid var(--focus, var(--brand)); outline-offset: 2px; }
.aa4-matrix { container-type: inline-size; margin: 16px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); min-width: 0; }
.aa4-matrix h3 { margin: 0 0 6px; }
.aa4-matrix h4 { margin: 8px 0 6px; font-size: 1rem; }
.aa4-matrix h5 { margin: 0 0 6px; font-size: .95rem; }
.aa4-matrix h6 { margin: 8px 0 4px; font-size: .9rem; }
.aa4-matrix :is(h3, h4, p, .aa4-hidden-count)[tabindex="-1"]:focus { outline: none; }
.aa4-matrix :is(h3, h4, p, .aa4-hidden-count)[tabindex="-1"]:focus-visible { outline: 2px solid var(--focus, var(--brand)); outline-offset: 2px; }
.aa4-status:empty, .aa4-hidden-count:empty { display: none; }
.aa4-note { margin: 0 0 6px; max-width: 80ch; }
.aa4-tag { display: inline-block; margin: 0 0 8px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: .85rem; }
.aa4-tag.aa4-training { border-color: var(--ri-train, var(--brand)); background: var(--ri-train-soft, transparent); }
.aa4-summary { margin: 4px 0 8px; font-weight: 700; }
.aa4-example { margin: 0 0 10px; padding: 6px 12px 8px; border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.aa4-example legend { font-weight: 700; padding: 0 4px; }
.aa4-example .hint { margin: 2px 0 0; }
.aa4-check { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; margin-right: 12px; }
.aa4-check input { width: 20px; height: 20px; flex: none; margin: 0; }
.aa4-ack { align-items: flex-start; padding: 4px 0; }
.aa4-ack input { margin-top: 2px; }
.aa4-precheck { margin: 4px 0 10px; }
.aa4-checks { margin: 4px 0; padding-left: 1.2em; }
.aa4-checks li { margin: 3px 0; }
.aa4-link { overflow-wrap: anywhere; }
.aa4-banner { margin: 6px 0; padding: 8px 12px; border-left: 4px solid var(--line); border-radius: 4px; max-width: 90ch; }
.aa4-banner.warn { border-left-color: var(--safety, #b45309); }
.aa4-recorded { border-left-color: var(--brand); font-weight: 700; }
.aa4-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 14px; margin: 8px 0; }
.aa4-actions > .aa4-complete, .aa4-actions > .aa4-refusal, .aa4-actions > .aa4-inline-form { flex: 1 1 100%; }
.aa4-complete { display: grid; gap: 4px; justify-items: start; }
.aa4-aside { display: grid; gap: 2px; justify-items: start; }
.aa4-aside .hint, .aa4-why { margin: 0; font-size: .85rem; }
.aa4-main { min-height: 44px; }
.aa4-btn { min-height: 32px; }
.aa4-btn[aria-disabled="true"], .aa4-main[aria-disabled="true"] { opacity: .65; cursor: not-allowed; }
.aa4-refusal { display: grid; gap: 4px; justify-items: start; }
.aa4-refusal p { margin: 0; }
.aa4-owner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 6px 0; }
.aa4-owner p { margin: 0; }
.aa4-route { margin: 6px 0; font-size: .92rem; }
.aa4-stages { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 8px 0; padding: 0; list-style: none; counter-reset: aa4s; }
.aa4-stages li { counter-increment: aa4s; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: .88rem; }
.aa4-stages li::before { content: counter(aa4s) ". "; }
.aa4-stages li[data-state="done"] { border-color: var(--brand); }
.aa4-stages li[data-state="running"] { border: 2px solid var(--brand); font-weight: 700; }
.aa4-stages li[data-state="failed"] { border: 2px solid var(--safety, #b45309); font-weight: 700; }
.aa4-stages-done > summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.aa4-grid-wrap { margin-top: 8px; min-width: 0; }
.aa4-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 12px; margin: 0 0 8px; }
.aa4-field { display: grid; gap: 3px; min-width: 0; }
.aa4-field > label { font-weight: 700; font-size: .9rem; }
.aa4-field[hidden] { display: none; }
.aa4-filters select { max-width: 16rem; }
.aa4-filters-box > summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; font-weight: 700; }
.aa4-hidden { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 4px 0; }
.aa4-hidden-count { margin: 0; font-weight: 700; }
.aa4-legend { margin: 4px 0 8px; font-size: .88rem; color: var(--muted, inherit); }
.aa4-bulk { margin: 8px 0; display: grid; gap: 6px; justify-items: start; }
.aa4-bulk-panel { justify-self: stretch; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.aa4-bulk-panel h4 { margin-top: 0; }
.aa4-bulk-rows { margin: 4px 0; padding-left: 1.2em; font-size: .9rem; }
.aa4-skipped ul { margin: 4px 0; padding-left: 1.2em; }
.aa4-skipped h5 { margin: 8px 0 4px; }
.aa4-bulk-group > summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.aa4-bulk-result { margin: 0; font-weight: 700; }
.aa4-row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.aa4-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: .92rem; }
.aa4-table th, .aa4-table td { padding: 6px 8px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.aa4-table thead th { font-size: .85rem; border-bottom: 2px solid var(--line); }
.aa4-table thead th:first-child { width: 30%; }
.aa4-table thead th:last-child { width: 14%; }
.aa4-group-row th { padding-top: 12px; background: var(--bg, transparent); }
.aa4-gh { font-weight: 700; font-size: .95rem; }
.aa4-gh-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 2px 6px; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; text-align: left; }
.aa4-gh-btn::before { content: "▸"; }
.aa4-gh-btn[aria-expanded="true"]::before { content: "▾"; }
.aa4-gh-locked { display: inline-block; padding: 2px 6px; }
.aa4-row > * { border-left: 0; }
.aa4-row.is-proposed td:not(.aa4-decision) { outline: 1px dashed var(--line); outline-offset: -3px; }
.aa4-row.is-decided td:not(.aa4-decision) { outline: 1px solid var(--line); outline-offset: -3px; }
.aa4-row.is-selected > th { box-shadow: inset 4px 0 0 var(--brand); }
.aa4-title { display: block; min-height: 32px; padding: 2px 0; border: 0; background: none; color: var(--brand); font: inherit; font-weight: 700; text-align: left; text-decoration: underline; cursor: pointer; overflow-wrap: anywhere; }
.aa4-title[aria-current="true"] { color: var(--ink); }
.aa4-title:focus-visible, .aa4-gh-btn:focus-visible, .aa4-matrix summary:focus-visible, .aa4-onthistab a:focus-visible { outline: 2px solid var(--focus, var(--brand)); outline-offset: 2px; }
.aa4-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; font-weight: 400; }
.aa4-key { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; }
.aa4-badge { display: inline-block; padding: 0 6px; border: 1px solid var(--line); border-radius: 999px; font-size: .78rem; line-height: 1.5; }
.aa4-badge-changed { border-color: var(--brand); }
.aa4-req { font-weight: 700; }
.aa4-decision { font-weight: 700; }
.aa4-insp-row > td { padding: 0 0 10px; }
.aa4-inspector { margin: 4px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 8px; background: var(--bg, var(--panel)); min-width: 0; }
.aa4-inspector h4 { margin-top: 0; }
.aa4-halves { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@container (min-width: 760px) { .aa4-halves { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.aa4-half { min-width: 0; }
.aa4-part { margin: 6px 0; }
.aa4-part ul, .aa4-flags, .aa4-checks-box ul, .aa4-earlier ul { margin: 4px 0; padding-left: 1.2em; }
.aa4-quote { margin: 4px 0; padding: 4px 10px; border-left: 3px solid var(--line); }
.aa4-quote p { margin: 2px 0; }
.aa4-quote-h { font-size: .85rem; font-weight: 700; }
.aa4-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 12px; margin: 4px 0; }
.aa4-dl dt { font-weight: 700; }
.aa4-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.aa4-src { display: inline-block; padding: 0 6px; border: 1px dashed var(--line); border-radius: 999px; font-size: .78rem; }
.aa4-checks-box > summary, .aa4-record > summary, .aa4-original > summary, .aa4-earlier summary, .aa4-measures > summary, .aa4-unknown > summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.aa4-matrix summary, .aa4-proposals summary { gap: 6px; list-style: none; }
.aa4-matrix summary::-webkit-details-marker, .aa4-proposals summary::-webkit-details-marker { display: none; }
/* One disclosure marker across the new panels: + closed, − open, in a small box (ux-12). */
.aa4-matrix summary::before, .aa4-proposals summary::before, .aa3-baseline details > summary::before, .aa6-confidence summary::before {
  content: '+'; content: '+' / ''; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 1.4em; height: 1.4em; margin-right: 8px;
  border: 1px solid var(--line); border-radius: 6px; font-weight: 700; }
.aa4-matrix details[open] > summary::before, .aa4-proposals details[open] > summary::before, .aa3-baseline details[open] > summary::before, .aa6-confidence details[open] > summary::before, .aa6-confidence[open] > summary::before {
  content: '\2212'; content: '\2212' / ''; }
.aa3-baseline details > summary, .aa6-confidence summary { list-style: none; }
.aa3-baseline details > summary::-webkit-details-marker, .aa6-confidence summary::-webkit-details-marker { display: none; }
.aa4-earlier, .aa4-answer { margin: 8px 0; padding: 6px 10px; border: 1px dashed var(--line); border-radius: 8px; }
.aa4-earlier p, .aa4-answer p { margin: 2px 0; }
.aa4-answer-text { font-weight: 700; }
.aa4-decide { margin: 10px 0 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.aa4-decide legend { font-weight: 700; padding: 0 4px; }
.aa4-done { font-weight: 700; }
.aa4-undetermined { margin: 4px 0; padding: 4px 10px; border-left: 3px solid var(--safety, #b45309); }
.aa4-correct, .aa4-ask, .aa4-inline-form { display: grid; gap: 6px; margin: 8px 0 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; max-width: 60rem; }
.aa4-correct { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.aa4-correct > .aa4-row-actions, .aa4-correct > .hint, .aa4-correct > .aa4-derived, .aa4-correct > [data-field="reason"], .aa4-correct > [data-field="action"] { grid-column: 1 / -1; }
.aa4-correct textarea, .aa4-ask textarea, .aa4-inline-form textarea { width: 100%; box-sizing: border-box; }
.aa4-correct .hint[hidden] { display: none; }
.aa4-error:empty { display: none; }
.aa4-error { margin: 0; }
.aa4-count { margin: 0; font-size: .85rem; }
.aa4-changed { font-size: .85rem; }
.aa4-derived { margin: 0; font-size: .9rem; }
.aa4-queued { margin: 8px 0 0; font-size: .85rem; }
.aa4-alldone { display: grid; gap: 4px; justify-items: start; }
.aa4-alldone p { margin: 0; font-weight: 700; }
.aa4-cards { display: grid; gap: 10px; }
.aa4-cgroup-h { margin: 6px 0 4px; }
.aa4-card-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.aa4-card { padding: 8px 10px; border: 1px dashed var(--line); border-radius: 10px; min-width: 0; }
.aa4-card.is-decided { border-style: solid; }
.aa4-card.is-selected { box-shadow: inset 4px 0 0 var(--brand); }
.aa4-card > dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 10px; margin: 6px 0 0; font-size: .9rem; }
.aa4-card > dl dt { font-weight: 700; }
.aa4-card > dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.aa4-measures { margin: 12px 0 0; }
.aa4-measures p { margin: 4px 0; }
.aa4-proposals, .aa4-formbar:not([hidden]) { margin: 0 0 10px; }
.aa4-proposals { padding: 8px 12px; border: 1px dashed var(--brand); border-radius: 8px; }
.aa4-proposals p { margin: 4px 0; }
.aa4-fill-result:empty { display: none; }
.aa4-open-matrix { margin-left: 6px; }
@container (max-width: 719px) {
  .aa4-matrix .aa4-btn, .aa4-matrix .aa4-title, .aa4-matrix .aa4-gh-btn, .aa4-matrix .aa4-check, .aa4-matrix summary { min-height: 44px; }
  .aa4-matrix select, .aa4-matrix input:not([type=checkbox]):not([type=radio]), .aa4-filters select { width: 100%; max-width: none; }
  .aa4-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); align-items: end; }
  .aa4-correct { grid-template-columns: minmax(0, 1fr); }
  .aa4-dl, .aa4-card > dl { grid-template-columns: minmax(0, 1fr); }
  .aa4-dl dt, .aa4-card > dl dt { margin-top: 4px; }
  .aa4-row-actions > .aa4-btn, .aa4-actions > .aa4-main, .aa4-complete > .aa4-main { flex: 1 1 100%; justify-self: stretch; }
}
@media (max-width: 720px) { .aa4-matrix { padding: 10px; } .aa4-onthistab a { min-height: 44px; } }

/* ==== aa5: citations and manifest ==== */
.ri-draft .aa5-ready { margin: 6px 0; padding: 6px 10px; border-left: 3px solid var(--brand); font-size: .92rem; }
.ri-draft .aa5-ready strong { display: block; margin-top: 4px; }
.ri-draft .aa5-provisional, .aa5-manifest .aa5-provisional { margin: 6px 0; padding: 6px 10px; border: 1px dashed var(--safety, #b45309); border-radius: 6px; font-size: .92rem; }
.ri-draft .aa5-legacy, .ri-draft .aa5-pending { margin: 6px 0; }
.ri-draft button[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }
.aa5-preview { margin: 12px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.aa5-preview h5 { margin: 0 0 4px; }
.aa5-preview h6 { margin: 10px 0 4px; font-size: .9rem; }
.aa5-preview .aa5-lines { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.aa5-preview .aa5-line { min-width: 0; padding-left: 8px; border-left: 3px solid transparent; }
.aa5-preview .aa5-line > p { margin: 0; overflow-wrap: anywhere; }
.aa5-preview .aa5-line.aa5-no_source, .aa5-preview .aa5-line.aa5-changed { border-left-color: var(--safety, #b45309); }
.aa5-preview .aa5-line.aa5-placeholder > p { font-style: italic; }
.aa5-preview .aa5-cite { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 24px; margin: 0 1px; padding: 0 4px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: inherit; font: inherit; font-size: .85rem; cursor: pointer; vertical-align: baseline; }
.aa5-preview .aa5-cite[aria-expanded="true"] { border-color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand); }
.aa5-preview .aa5-cite:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.aa5-preview .aa5-flag { display: inline-block; margin-left: 4px; padding: 0 6px; border: 1px solid var(--safety, #b45309); border-radius: 999px; font-size: .8rem; font-weight: 700; }
.aa5-preview .aa5-pop { margin: 4px 0 6px; padding: 8px 12px; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 6px; background: var(--panel, transparent); font-size: .88rem; max-width: 100%; box-sizing: border-box; }
.aa5-preview .aa5-pop[hidden] { display: none; }
.aa5-preview .aa5-pop dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 12px; margin: 0 0 6px; }
.aa5-preview .aa5-pop dt { font-weight: 700; }
.aa5-preview .aa5-pop dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.aa5-preview .aa5-pop p { margin: 4px 0; }
.aa5-manifest { container: aa5-manifest / inline-size; margin: 16px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.aa5-manifest h3 { margin: 0 0 4px; }
.aa5-manifest .aa5-manifest-summary { margin: 6px 0; font-weight: 700; }
.aa5-manifest .aa5-manifest-wrap { max-width: 100%; overflow-x: auto; }
.aa5-manifest .aa5-manifest-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.aa5-manifest .aa5-manifest-table th, .aa5-manifest .aa5-manifest-table td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: break-word; hyphens: manual; }
/* Words stay whole; the record columns keep a readable width and the wrap scrolls when the table is wider (ux-13). */
.aa5-manifest .aa5-manifest-table thead th { min-width: 7rem; }
.aa5-manifest .aa5-manifest-table thead th:first-child { min-width: 9rem; }
.aa5-manifest .aa5-manifest-table thead th { font-weight: 700; }
.aa5-manifest .aa5-manifest-table tbody th { font-weight: 400; }
.aa5-manifest .aa5-nr { color: var(--muted); font-style: italic; }
.aa5-manifest .aa5-manifest-missing { margin: 8px 0; }
.aa5-manifest .aa5-manifest-actions { margin: 8px 0 0; }
@container aa5-manifest (max-width: 719px) {
  .aa5-manifest .aa5-manifest-wrap { overflow-x: visible; }
  .aa5-manifest .aa5-manifest-table, .aa5-manifest .aa5-manifest-table tbody, .aa5-manifest .aa5-manifest-table tr, .aa5-manifest .aa5-manifest-table th, .aa5-manifest .aa5-manifest-table td { display: block; width: auto; }
  .aa5-manifest .aa5-manifest-table thead { display: none; }
  .aa5-manifest .aa5-manifest-table tr { margin: 0 0 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
  .aa5-manifest .aa5-manifest-table th, .aa5-manifest .aa5-manifest-table td { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr); gap: 8px; border-bottom: 0; padding: 2px 0; }
  .aa5-manifest .aa5-manifest-table th::before, .aa5-manifest .aa5-manifest-table td::before { content: attr(data-label); font-weight: 700; font-style: normal; color: var(--ink); }
  .aa5-manifest .aa5-manifest-actions > button { flex: 1 1 100%; min-height: 44px; }
}
@media (max-width: 720px) { .aa5-preview .aa5-cite { min-width: 32px; min-height: 32px; } }

/* ==== aa6: confidence ==== */
.aa4-matrix .aa6-why { margin-left: 4px; }
.aa6-confidence { margin: 8px 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.aa6-confidence > summary { min-height: 44px; display: flex; align-items: center; padding: 8px 12px; font-weight: 700; cursor: pointer; }
.aa6-confidence > :not(summary) { margin-left: 12px; margin-right: 12px; }
.aa6-confidence h4 { margin: 12px 0 4px; font-size: .95rem; }
.aa6-confidence .aa6-dl { display: grid; grid-template-columns: minmax(0, 12rem) minmax(0, 1fr); gap: 4px 12px; margin: 8px 0; }
.aa6-confidence .aa6-dl dt { font-weight: 700; }
.aa6-confidence .aa6-dl dd { margin: 0; overflow-wrap: anywhere; }
.aa6-confidence .aa6-source { color: var(--muted); font-size: .85rem; }
.aa6-confidence .aa6-priority { margin: 8px 0; padding: 6px 10px; border-left: 4px solid var(--line); }
.aa6-confidence .aa6-priority p { margin: 2px 0; }
.aa6-confidence .aa6-checks { margin: 4px 0; padding-left: 18px; }
.aa6-confidence .aa6-checks li { margin: 2px 0; overflow-wrap: anywhere; }
.aa6-confidence .aa6-state { font-weight: 700; }
.aa6-confidence .aa6-system { margin: 8px 0; }
.aa6-confidence .aa6-system > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; }
.aa6-confidence .aa6-never { margin: 8px 0; }
.aa6-confidence .aa6-auto { margin: 8px 0 12px; }
.aa6-confidence .aa6-off { display: grid; gap: 6px; max-width: 32rem; }
@media (max-width: 600px) { .aa6-confidence .aa6-dl { grid-template-columns: minmax(0, 1fr); } }

/* Hand-off links between the steps Evidence -> Impact matrix -> Deliverables (ux-09). */
.aa-next { margin: 12px 0 0; }
.aa-next .aa-next-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.aa25-facts > summary .aa25-summary-h { display: inline; margin: 0; font-size: inherit; font-weight: inherit; }

/* Flow gaps release 2: "Correct priority facts" on the case Overview and the escalation pill in the queue (fx2- prefix). */
.fx2-priority { margin: 8px 0 12px; }
.fx2-priority .fx2-priority-toggle { min-height: 44px; }
.fx2-priority .fx2-priority-form { display: grid; gap: 10px; max-width: 36rem; border-left: 4px solid var(--fx2-line, #c9d3dc); }
.fx2-priority .fx2-priority-form h3 { margin: 0; font-size: 1rem; }
.fx2-priority .fx2-priority-form :is(select, input, textarea) { min-height: 44px; max-width: 100%; }
.fx2-priority .fx2-priority-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fx2-priority .fx2-priority-actions button { min-height: 44px; }
.fx2-priority .fx2-priority-error { color: var(--fx2-error, #b42318); font-weight: 700; }
/* dark theme: html[data-theme=dark], or the device setting when nothing is saved */ :root:where([data-theme="dark"]) { --fx2-line: #4a5866; --fx2-error: #ff9a8f; } @media (prefers-color-scheme: dark){ :root:where(:not([data-theme])) { --fx2-line: #4a5866; --fx2-error: #ff9a8f; } }
:root[data-theme="dark"] { --fx2-line: #4a5866; --fx2-error: #ff9a8f; }
.action-page .fx2-priority .fx2-priority-toggle, .action-page .fx2-priority .fx2-priority-form :is(select, input, textarea) { min-height: 44px; }
.fx2-priority-toggle[aria-expanded="true"] { box-shadow: inset 0 -3px 0 var(--fx2-line, #c9d3dc); }
.fx2-priority .fx2-priority-form .fx2-priority-clear input { min-height: auto; }

/* Flow gaps release 3: plan every kind (fx3- prefix). Category help line (inside the category field), "Also affects" (up to two secondary
   categories), the draft or consultation flag, the "Other" warning before saving and the Other note on the
   Deliverables tab. Compact on desktop, 44px targets on phones; colours from tokens with dark-mode values. */
.fx3-cat-help { margin: 4px 0 0; }
.fx3-secondary { margin: 8px 0; }
.fx3-secondary > .hint { flex-basis: 100%; margin: 0 0 4px; }
.fx3-secondary .ia-check:has(input:disabled) { opacity: .6; }
.fx3-sec-msg { flex-basis: 100%; margin: 0; color: var(--fx3-warn, #8a4b00); font-weight: 700; }
.fx3-sec-msg:empty { display: none; }
.fx3-draft { margin: 4px 0 8px; }
.fx3-draft .fx3-draft-hint { margin: 0 0 0 28px; }
.fx3-other-warn { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--fx3-line, #e0c48a); border-left: 4px solid var(--fx3-warn, #8a4b00); border-radius: 8px; background: var(--fx3-bg, #fff8eb); color: inherit; max-width: 44rem; }
.fx3-other-warn:focus-visible { outline: 2px solid var(--fx3-warn, #8a4b00); outline-offset: 2px; }
.fx3-other-warn p { margin: 0 0 8px; }
.fx3-other-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fx3-other-actions button { min-height: 44px; }
.fx3-other-note button { min-height: 44px; }
/* dark theme: html[data-theme=dark], or the device setting when nothing is saved */ :root:where([data-theme="dark"]) { --fx3-line: #6b5a35; --fx3-warn: #ffc56b; --fx3-bg: #2b2414; } @media (prefers-color-scheme: dark){ :root:where(:not([data-theme])) { --fx3-line: #6b5a35; --fx3-warn: #ffc56b; --fx3-bg: #2b2414; } }
:root[data-theme="dark"] { --fx3-line: #6b5a35; --fx3-warn: #ffc56b; --fx3-bg: #2b2414; }
.fx3-secondary-wrap { margin: 0 0 8px; }
.fx3-secondary-wrap > summary { min-height: 44px; padding: 12px 0; box-sizing: border-box; cursor: pointer; font-size: .9rem; display: list-item; }
.fx3-secondary-wrap .fx3-sec-count { color: var(--muted, #5b6770); }
@media (max-width: 760px) { .action-page .fx3-other-actions button, .action-page .fx3-other-note button, .action-page .fx3-secondary .ia-check, .action-page .fx3-draft .ia-check, .action-page .fx3-areas .ia-check { min-height: 44px; } }
.fx3-secondary-wrap .fx3-secondary { margin-top: 0; }

/* "Your product" flag (yp- prefix): a company-level pill, compact box and optional PV checklist. The shared Priority
   tier is never changed; the amber pill appears only on a detected safety trigger. */
:root{--yp-bg:#dff2ef;--yp-ink:#0b5048;--yp-line:#9fd3cb;--yp-box:#f3faf9}
/* dark theme: html[data-theme=dark], or the device setting when nothing is saved */:root:where([data-theme="dark"]){--yp-bg:#123a36;--yp-ink:#a6e6dc;--yp-line:#2d6b62;--yp-box:#13262a}@media (prefers-color-scheme: dark){:root:where(:not([data-theme])){--yp-bg:#123a36;--yp-ink:#a6e6dc;--yp-line:#2d6b62;--yp-box:#13262a}}
:root[data-theme="dark"]{--yp-bg:#123a36;--yp-ink:#a6e6dc;--yp-line:#2d6b62;--yp-box:#13262a}
.yp-pill{display:inline-flex;align-items:center;width:fit-content;border-radius:999px;padding:1px 8px;font-size:.72rem;font-weight:700;line-height:1.5;white-space:nowrap;background:var(--yp-bg);color:var(--yp-ink);border:1px solid var(--yp-line)}
.yp-pill.yp-raised{background:var(--yp-ink);color:var(--yp-box);border-color:var(--yp-ink)}
.yp-pills{display:flex;flex-wrap:wrap;gap:4px}
.yp-box{margin:8px 0;padding:8px 10px;border:1px solid var(--yp-line);border-left-width:3px;border-radius:6px;background:var(--yp-box);font-size:13px;line-height:1.4}
.yp-box p{margin:3px 0}
.yp-head{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px}
.yp-action{font-weight:650}
.yp-role{color:var(--muted)}
.yp-muted{color:var(--muted);font-size:12px}
.yp-raised-note{padding:4px 8px;border-radius:4px;background:var(--yp-bg);color:var(--yp-ink);border-left:3px solid var(--yp-ink)}
.yp-role-hint:empty{display:none}
.yp-pri{display:inline-flex;width:fit-content;border-radius:999px;padding:1px 8px;font-size:.72rem;font-weight:650;line-height:1.5;white-space:nowrap;border:1px solid var(--line);color:var(--muted)}
.yp-order{margin:0;padding:0 14px 6px;font-size:12px}
.yp-raised-note .yp-muted{color:inherit;opacity:.85}
.yp-checklist{margin-top:4px}
.yp-checklist>summary{cursor:pointer;font-weight:650;font-size:12px;min-height:24px;display:list-item}
.yp-checklist ul{margin:4px 0 2px;padding-left:18px}
.yp-checklist li{margin:1px 0}
@media(max-width:760px){.yp-checklist>summary{min-height:44px;padding:12px 0;box-sizing:border-box}}
.action-case .yp-pills{align-self:flex-start}

/* Flow gaps release 4b: product facts (fx4- prefix). The "Risk minimisation" cell of the Company facts product table:
   REMS (US), aRMM and the as-of date stacked, each with a visible label; aRMM by market as a compact list. */
.fx4-riskmin { display: grid; gap: 4px; min-width: 9em; }
.fx4-rm { display: grid; gap: 2px; font-size: .85rem; }
.fx4-rm > span { font-weight: 600; color: var(--muted); }
.fx4-rm-markets { margin: 0; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; display: grid; grid-template-columns: repeat(auto-fill, minmax(6em, 1fr)); gap: 4px; min-width: 0; }
.fx4-rm-markets legend { font-size: .8rem; font-weight: 600; padding: 0 2px; }
.fx4-rm-markets select, .aa25-table td .fx4-rm-markets select { width: 100%; min-width: 0; box-sizing: border-box; }
.fx4-rm-markets .fx4-rm { min-width: 0; }
.fx4-rm-hint { margin: 2px 0 8px; }
