/* PostWatch Report Finalization v4
   Command Calm workflow + print artifact. Scoped to .rf-* so the existing
   Reports v3 and shared shell remain untouched. */

.rf-dialog {
  --rf-bg: var(--pw-bg, #f4f7fa);
  --rf-surface: var(--pw-surface, #ffffff);
  --rf-surface-muted: var(--pw-surface-muted, #edf2f7);
  --rf-text: var(--pw-text, #132235);
  --rf-muted: var(--pw-text-muted, #506176);
  --rf-border: var(--pw-border, #d7e0e8);
  --rf-primary: var(--pw-navy-800, #123a62);
  --rf-primary-deep: var(--pw-navy-950, #0b2037);
  --rf-primary-ink: #ffffff;
  --rf-steel: var(--pw-steel-600, #456e91);
  --rf-gold: var(--pw-gold-600, #a87920);
  --rf-gold-ink: #805a12;
  --rf-success: var(--pw-success, #157347);
  --rf-success-soft: #e8f5ee;
  --rf-warning: var(--pw-warning, #9a5b00);
  --rf-warning-soft: #fff4df;
  --rf-danger: var(--pw-danger, #b42318);
  --rf-danger-soft: #fdecea;
  --rf-info-soft: #eaf2fa;
  --rf-focus: #2e5bff;
  width: min(1540px, calc(100vw - 32px));
  height: min(980px, calc(100dvh - 32px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--rf-border);
  border-radius: 24px;
  background: var(--rf-bg);
  color: var(--rf-text);
  box-shadow: 0 32px 90px rgba(11, 32, 55, 0.24);
  font: 500 17px/1.55 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.rf-dialog::backdrop {
  background: rgba(5, 15, 27, 0.66);
  backdrop-filter: blur(4px);
}

html.dark .rf-dialog {
  --rf-bg: #0d141c;
  --rf-surface: #141d27;
  --rf-surface-muted: #1b2734;
  --rf-text: #f2f6fa;
  --rf-muted: #b7c4d2;
  --rf-border: #3a4a5b;
  --rf-primary: #93bce1;
  --rf-primary-deep: #dcebfa;
  --rf-primary-ink: #08111c;
  --rf-steel: #8fb3d0;
  --rf-gold: #e2b95f;
  --rf-gold-ink: #f4ce7a;
  --rf-success: #6ed6a1;
  --rf-success-soft: #102a20;
  --rf-warning: #f2bd63;
  --rf-warning-soft: #2d230f;
  --rf-danger: #ff9b91;
  --rf-danger-soft: #311714;
  --rf-info-soft: #182b3d;
  --rf-focus: #8aa6ff;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.5);
}

.rf-dialog,
.rf-dialog * {
  box-sizing: border-box;
}

.rf-dialog button,
.rf-dialog input,
.rf-dialog select,
.rf-dialog textarea {
  font: inherit;
}

.rf-dialog button,
.rf-dialog summary,
.rf-dialog a {
  touch-action: manipulation;
}

.rf-shell {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
}

.rf-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 22px clamp(20px, 3vw, 40px) 18px;
  background: var(--rf-bg);
}

.rf-header h1 {
  margin: 2px 0 5px;
  color: var(--rf-text);
  font-size: clamp(26px, 2.2vw, 36px);
  font-weight: 780;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.rf-header p:last-child {
  max-width: 720px;
  margin: 0;
  color: var(--rf-muted);
  font-size: 15px;
  line-height: 1.45;
}

.rf-eyebrow,
.rf-ai-label,
.rf-artifact__kicker {
  margin: 0;
  color: var(--rf-gold-ink);
  font-size: 14px;
  font-weight: 780;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-transform: uppercase;
}

.rf-progress {
  padding: 12px clamp(18px, 3vw, 40px);
  overflow: hidden;
  border-bottom: 1px solid var(--rf-border);
  background: var(--rf-bg);
}

.rf-steps {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rf-steps li {
  position: relative;
  min-width: 0;
}

.rf-steps li:not(:last-child)::after {
  position: absolute;
  z-index: 0;
  top: 20px;
  right: -8px;
  width: 8px;
  height: 1px;
  background: var(--rf-border);
  content: "";
}

.rf-steps button {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 5px 7px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--rf-muted);
  text-align: left;
  cursor: pointer;
  transition: background-color 180ms cubic-bezier(.2, .8, .2, 1), border-color 180ms cubic-bezier(.2, .8, .2, 1), color 180ms cubic-bezier(.2, .8, .2, 1);
}

.rf-steps button:hover:not(:disabled) {
  border-color: var(--rf-border);
  background: var(--rf-surface-muted);
  color: var(--rf-text);
}

.rf-steps button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.rf-steps .is-current button {
  border-color: color-mix(in srgb, var(--rf-primary) 52%, var(--rf-border));
  background: var(--rf-info-soft);
  color: var(--rf-primary-deep);
}

.rf-steps .is-past button {
  color: var(--rf-success);
}

.rf-step-number {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.rf-step-name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.rf-steps-compact {
  display: none;
  margin: 0;
  color: var(--rf-primary-deep);
  font-size: 14px;
  font-weight: 750;
}

.rf-live {
  min-height: 0;
  margin: 0;
  padding: 0 clamp(20px, 3vw, 40px);
  color: var(--rf-success);
  background: var(--rf-surface);
  font-size: 14px;
  font-weight: 700;
}

.rf-live:not(:empty) {
  min-height: 42px;
  padding-top: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rf-border);
}

.rf-live.is-error {
  color: var(--rf-danger);
  background: var(--rf-danger-soft);
}

.rf-body {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(20px, 3.5vw, 48px);
  scroll-padding: 24px;
  background: var(--rf-bg);
}

.rf-step-panel {
  width: min(100%, 1180px);
  margin-inline: auto;
  animation: rf-enter 260ms cubic-bezier(.2, .8, .2, 1) both;
}

.rf-step-panel--artifact {
  width: min(100%, 1320px);
}

@keyframes rf-enter {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

.rf-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 24px;
}

.rf-section-head h2 {
  margin: 4px 0 0;
  color: var(--rf-text);
  font-size: clamp(25px, 2.2vw, 34px);
  font-weight: 780;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.rf-section-head > p {
  max-width: 560px;
  margin: 0;
  color: var(--rf-muted);
  font-size: 16px;
  line-height: 1.55;
}

.rf-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--rf-border);
  border-radius: 16px;
  background: var(--rf-surface);
  box-shadow: 0 1px 2px rgba(11, 32, 55, 0.05), 0 1px 1px rgba(11, 32, 55, 0.03);
}

.rf-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.rf-field__label {
  color: var(--rf-text);
  font-size: 15px;
  font-weight: 750;
}

.rf-field__help,
.rf-inline-note {
  margin: 0;
  color: var(--rf-muted);
  font-size: 14px;
  line-height: 1.5;
}

.rf-field input,
.rf-field select,
.rf-field textarea,
.rf-settings-form input,
.rf-settings-form select,
.rf-settings-form textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--rf-border);
  border-radius: 12px;
  background: var(--rf-surface);
  color: var(--rf-text);
  font-size: 16px;
  line-height: 1.4;
  outline: none;
  transition: border-color 180ms cubic-bezier(.2, .8, .2, 1), box-shadow 180ms cubic-bezier(.2, .8, .2, 1), background-color 180ms cubic-bezier(.2, .8, .2, 1);
}

.rf-field textarea,
.rf-settings-form textarea {
  min-height: 100px;
  resize: vertical;
}

.rf-field input:focus,
.rf-field select:focus,
.rf-field textarea:focus,
.rf-settings-form input:focus,
.rf-settings-form select:focus,
.rf-settings-form textarea:focus {
  border-color: var(--rf-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--rf-focus) 22%, transparent);
}

.rf-readonly {
  display: grid;
  align-content: center;
  min-height: 76px;
  padding: 10px 14px;
  border: 1px solid var(--rf-border);
  border-radius: 12px;
  background: var(--rf-surface-muted);
}

.rf-readonly span {
  color: var(--rf-muted);
  font-size: 14px;
  font-weight: 650;
}

.rf-readonly strong {
  color: var(--rf-text);
  overflow-wrap: anywhere;
  font-size: 17px;
}

.rf-truth-note,
.rf-disclosure,
.rf-durable,
.rf-completeness,
.rf-blocked,
.rf-ready-card,
.rf-not-sent,
.rf-existing {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--rf-border);
  border-left-width: 5px;
  border-radius: 14px;
  background: var(--rf-surface);
  color: var(--rf-text);
}

.rf-truth-note,
.rf-disclosure {
  border-left-color: var(--rf-steel);
  background: var(--rf-info-soft);
}

.rf-durable,
.rf-ready-card {
  border-left-color: var(--rf-success);
  background: var(--rf-success-soft);
}

.rf-completeness {
  display: block;
  border-left-color: var(--rf-gold);
  background: var(--rf-warning-soft);
}

.rf-blocked,
.rf-not-sent {
  border-left-color: var(--rf-danger);
  background: var(--rf-danger-soft);
}

.rf-existing {
  align-items: center;
  border-left-color: var(--rf-gold);
}

.rf-existing > span,
.rf-existing > strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.rf-existing > span {
  flex: 1;
  color: var(--rf-muted);
  font-size: 14px;
}

.rf-truth-note p,
.rf-disclosure p,
.rf-durable p,
.rf-completeness p,
.rf-ready-card p,
.rf-not-sent p,
.rf-existing p {
  margin: 0;
}

.rf-truth-note svg,
.rf-disclosure svg,
.rf-durable svg,
.rf-blocked svg,
.rf-ready-card svg,
.rf-not-sent svg {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
}

.rf-preflight-list {
  display: grid;
  gap: 10px;
}

.rf-preflight-row {
  display: grid;
  grid-template-columns: 134px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--rf-border);
  border-radius: 14px;
  background: var(--rf-surface);
}

.rf-preflight-row strong,
.rf-preflight-row p {
  overflow-wrap: anywhere;
}

.rf-preflight-row p {
  margin: 3px 0 0;
  color: var(--rf-muted);
  font-size: 15px;
}

.rf-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.025em;
  line-height: 1.2;
  text-align: center;
}

.rf-status--pass { color: var(--rf-success); background: var(--rf-success-soft); }
.rf-status--will-disclose,
.rf-status--labelled { color: var(--rf-warning); background: var(--rf-warning-soft); }
.rf-status--block { color: var(--rf-danger); background: var(--rf-danger-soft); }

.rf-settings {
  margin-top: 18px;
  border: 1px solid var(--rf-border);
  border-radius: 16px;
  background: var(--rf-surface);
  overflow: clip;
}

.rf-settings summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px 16px;
  color: var(--rf-text);
  cursor: pointer;
  font-weight: 750;
}

.rf-settings__heading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 6px;
  color: var(--rf-text);
}

.rf-settings > .rf-inline-note,
.rf-settings > .rf-check,
.rf-settings > .rf-button {
  margin-right: 18px;
  margin-left: 18px;
}

.rf-settings > .rf-button {
  margin-bottom: 18px;
}

.rf-settings-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 18px;
  border-top: 1px solid var(--rf-border);
  background: var(--rf-surface-muted);
}

.rf-settings-form .rf-check,
.rf-settings-form > .rf-button,
.rf-settings-form > .rf-inline-note {
  grid-column: 1 / -1;
}

.rf-revision-card {
  display: grid;
  gap: 14px;
  margin-top: 20px;
  padding: 20px;
  border: 1px solid var(--rf-border);
  border-left: 5px solid var(--rf-gold);
  border-radius: 16px;
  background: var(--rf-surface);
}

.rf-revision-card h3,
.rf-revision-card p {
  margin: 0;
}

.rf-revision-card h3 {
  color: var(--rf-text);
  font-size: 19px;
}

.rf-revision-card p {
  color: var(--rf-muted);
  font-size: 14px;
}

.rf-zero-ai {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  margin-bottom: 18px;
  padding: 7px 12px;
  border: 1px solid color-mix(in srgb, var(--rf-success) 52%, var(--rf-border));
  border-radius: 999px;
  background: var(--rf-success-soft);
  color: var(--rf-success);
}

.rf-zero-ai strong,
.rf-zero-ai span {
  font-size: 14px;
}

.rf-facts-grid,
.rf-review-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.rf-fact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--rf-border);
  border-radius: 14px;
  background: var(--rf-surface);
}

.rf-fact-row > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.rf-fact-row > div:first-child span {
  color: var(--rf-muted);
  font-size: 14px;
  font-weight: 650;
}

.rf-fact-row > div:first-child strong {
  color: var(--rf-text);
  overflow-wrap: anywhere;
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.2;
}

.rf-fact-source {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 6px;
  max-width: 250px;
  color: var(--rf-muted);
  font-size: 14px;
  line-height: 1.4;
}

.rf-fact-source a {
  grid-column: 2;
  min-height: 32px;
  color: var(--rf-primary-deep);
  font-weight: 750;
}

.rf-num {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.rf-narrative-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.rf-narrative-choice article {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 260px;
  padding: 24px;
  border: 1px solid var(--rf-border);
  border-radius: 16px;
  background: var(--rf-surface);
}

.rf-narrative-choice article > svg {
  width: 30px;
  height: 30px;
  color: var(--rf-gold-ink);
}

.rf-narrative-choice h3 {
  margin: 18px 0 7px;
  color: var(--rf-text);
  font-size: 21px;
}

.rf-narrative-choice p {
  flex: 1;
  margin: 0 0 20px;
  color: var(--rf-muted);
}

.rf-ai-draft {
  border: 1px solid var(--rf-border);
  border-left: 6px solid var(--rf-gold);
  border-radius: 14px;
  background: var(--rf-warning-soft);
  overflow: hidden;
}

.rf-ai-draft .rf-ai-label {
  padding: 14px 18px;
  border-bottom: 1px solid var(--rf-border);
}

.rf-ai-draft pre {
  max-height: 440px;
  margin: 0;
  padding: 20px;
  overflow: auto;
  color: var(--rf-text);
  font: 500 16px/1.65 Inter, ui-sans-serif, sans-serif;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.rf-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 48px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--rf-border);
  border-radius: 12px;
  background: var(--rf-surface);
  color: var(--rf-text);
  cursor: pointer;
}

.rf-check--strong {
  border-left: 5px solid var(--rf-primary);
}

.rf-check input {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  margin: 1px 0 0;
  accent-color: var(--rf-primary);
}

.rf-blocked {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
}

.rf-blocked ul {
  grid-column: 2;
  margin: 0;
  padding-left: 20px;
}

.rf-empty {
  display: grid;
  place-items: center;
  min-height: 280px;
  padding: 32px;
  border: 1px dashed var(--rf-border);
  border-radius: 16px;
  background: var(--rf-surface);
  text-align: center;
}

.rf-empty svg {
  width: 40px;
  height: 40px;
  color: var(--rf-muted);
}

.rf-empty h3 {
  margin: 14px 0 5px;
  font-size: 22px;
}

.rf-empty p {
  max-width: 560px;
  margin: 0;
  color: var(--rf-muted);
}

.rf-artifact {
  --rf-document-text: #132235;
  --rf-document-muted: #506176;
  --rf-document-border: #d7e0e8;
  width: min(100%, 1040px);
  margin: 20px auto 0;
  padding: clamp(24px, 4vw, 52px);
  border: 1px solid var(--rf-document-border);
  border-radius: 4px;
  background: #ffffff;
  color: var(--rf-document-text);
  box-shadow: 0 14px 40px rgba(11, 32, 55, 0.13);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.rf-artifact__head {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 2px solid #123a62;
}

.rf-artifact__head img {
  display: block;
  width: 92px;
  height: 92px;
  object-fit: contain;
}

.rf-artifact__head p {
  margin: 2px 0;
  color: var(--rf-document-muted);
  font-size: 13px;
}

.rf-artifact__head .rf-artifact__company {
  margin: 0 0 5px;
  color: var(--rf-document-text);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.rf-artifact__ids {
  display: grid;
  grid-template-columns: auto auto;
  gap: 4px 12px;
  margin: 0;
  font-size: 12px;
}

.rf-artifact__ids dt {
  color: var(--rf-document-muted);
  font-weight: 700;
}

.rf-artifact__ids dd {
  margin: 0;
  color: var(--rf-document-text);
  text-align: right;
}

.rf-artifact__title {
  padding: 28px 0 16px;
}

.rf-artifact__title h1 {
  margin: 6px 0 8px;
  color: var(--rf-document-text);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 780;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.rf-artifact__title > p:last-child {
  margin: 0;
  color: var(--rf-document-muted);
  font-size: 15px;
}

.rf-artifact .rf-artifact__kicker,
.rf-artifact .rf-ai-label {
  color: #805a12;
}

.rf-artifact__completeness {
  padding: 16px 18px;
  border-left: 6px solid #a87920;
  background: #edf2f7;
}

.rf-artifact__completeness strong {
  font-size: 15px;
}

.rf-artifact__completeness p {
  margin: 4px 0 0;
  color: var(--rf-document-text);
  font-size: 14px;
  line-height: 1.55;
}

.rf-artifact__metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.rf-artifact-metric {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--rf-document-border);
  background: #ffffff;
}

.rf-artifact-metric span,
.rf-artifact-metric small {
  display: block;
  color: var(--rf-document-muted);
  font-size: 12px;
  line-height: 1.35;
}

.rf-artifact-metric strong {
  display: block;
  margin: 7px 0;
  color: var(--rf-document-text);
  overflow-wrap: anywhere;
  font-size: clamp(20px, 2.4vw, 29px);
  line-height: 1.1;
}

.rf-artifact__section {
  margin-top: 28px;
}

.rf-artifact__section h2 {
  margin: 0 0 12px;
  color: var(--rf-document-text);
  font-size: 21px;
  line-height: 1.25;
}

.rf-artifact__table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.rf-artifact table {
  width: 100%;
  border-collapse: collapse;
  color: var(--rf-document-text);
  font-size: 13px;
}

.rf-artifact caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.rf-artifact th,
.rf-artifact td {
  padding: 10px;
  border: 1px solid var(--rf-document-border);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.rf-artifact th {
  background: #edf2f7;
  font-weight: 750;
}

.rf-artifact__narrative {
  padding: 18px;
  border-left: 5px solid #a87920;
  background: #fff8e8;
}

.rf-artifact__prose {
  color: var(--rf-document-text);
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.rf-artifact__section ul {
  margin: 0;
  padding-left: 22px;
}

.rf-artifact__section li {
  margin: 6px 0;
  font-size: 14px;
  line-height: 1.55;
}

.rf-artifact__approval {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--rf-document-border);
}

.rf-artifact__approval span,
.rf-artifact__approval small {
  display: block;
  color: var(--rf-document-muted);
  font-size: 12px;
}

.rf-artifact__approval strong {
  display: block;
  margin: 6px 0;
  color: var(--rf-document-text);
}

.rf-artifact__signature {
  grid-column: 1 / -1;
  padding: 16px;
  border: 1px solid var(--rf-document-border);
  background: #fafbfc;
}

.rf-artifact__footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  margin-top: 34px;
  padding-top: 14px;
  border-top: 1px solid var(--rf-document-border);
  color: var(--rf-document-muted);
  font-size: 11px;
  line-height: 1.35;
}

.rf-artifact__page::after {
  content: counter(page);
}

.rf-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 76px;
  padding: 12px clamp(18px, 3vw, 40px) calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--rf-border);
  background: var(--rf-surface);
}

.rf-footer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
}

.rf-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 126px;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid var(--rf-border);
  border-radius: 12px;
  background: var(--rf-surface);
  color: var(--rf-text);
  font-size: 16px;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms cubic-bezier(.2, .8, .2, 1), border-color 160ms cubic-bezier(.2, .8, .2, 1), color 160ms cubic-bezier(.2, .8, .2, 1), box-shadow 160ms cubic-bezier(.2, .8, .2, 1), transform 130ms cubic-bezier(.2, .8, .2, 1);
}

.rf-button:hover:not(:disabled) {
  border-color: var(--rf-primary);
  background: var(--rf-info-soft);
}

.rf-button:active:not(:disabled) {
  transform: scale(.972);
}

.rf-button--primary {
  border-color: var(--rf-primary-deep);
  background: var(--rf-primary-deep);
  color: var(--rf-primary-ink);
}

.rf-button--primary:hover:not(:disabled) {
  border-color: var(--rf-primary);
  background: var(--rf-primary);
  color: var(--rf-primary-ink);
}

.rf-button--danger {
  border-color: var(--rf-danger);
  color: var(--rf-danger);
}

.rf-button--disabled,
.rf-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.rf-button--icon {
  min-width: 96px;
}

.rf-button svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.rf-dialog :focus-visible {
  outline: 3px solid var(--rf-focus);
  outline-offset: 3px;
}

@media (max-width: 1180px) {
  .rf-step-name {
    font-size: 13px;
  }

  .rf-fact-row {
    grid-template-columns: 1fr;
  }

  .rf-fact-source {
    max-width: none;
  }
}

@media (max-width: 900px) {
  .rf-steps {
    display: none;
  }

  .rf-steps-compact {
    display: block;
  }

  .rf-section-head {
    display: block;
  }

  .rf-section-head > p {
    margin-top: 8px;
  }

  .rf-form-grid,
  .rf-settings-form,
  .rf-facts-grid,
  .rf-review-summary {
    grid-template-columns: 1fr;
  }

  .rf-settings-form .rf-check,
  .rf-settings-form > .rf-button,
  .rf-settings-form > .rf-inline-note {
    grid-column: auto;
  }

  .rf-artifact__metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .rf-dialog {
    width: 100vw;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .rf-header {
    position: relative;
    gap: 12px;
    padding: calc(14px + env(safe-area-inset-top)) 16px 12px;
  }

  .rf-header h1 {
    font-size: 25px;
  }

  .rf-header p:last-child {
    display: none;
  }

  .rf-header .rf-button--icon {
    min-width: 48px;
    width: 48px;
    padding: 0;
  }

  .rf-header .rf-button--icon span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .rf-progress {
    padding: 11px 16px;
  }

  .rf-body {
    padding: 18px 16px 26px;
  }

  .rf-section-head {
    margin-bottom: 18px;
  }

  .rf-section-head h2 {
    font-size: 25px;
  }

  .rf-form-grid {
    gap: 14px;
    padding: 16px;
  }

  .rf-narrative-choice {
    grid-template-columns: 1fr;
  }

  .rf-narrative-choice article {
    min-height: 0;
    padding: 18px;
  }

  .rf-preflight-row {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .rf-status {
    justify-self: start;
  }

  .rf-existing {
    align-items: stretch;
    flex-direction: column;
  }

  .rf-artifact {
    padding: 18px;
    box-shadow: none;
  }

  .rf-artifact__head {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 14px;
  }

  .rf-artifact__head img {
    width: 72px;
    height: 72px;
  }

  .rf-artifact__ids {
    grid-column: 1 / -1;
  }

  .rf-artifact__title h1 {
    font-size: 27px;
  }

  .rf-artifact__metrics {
    grid-template-columns: 1fr 1fr;
  }

  .rf-artifact__approval,
  .rf-artifact__footer {
    grid-template-columns: 1fr;
  }

  .rf-artifact__signature {
    grid-column: auto;
  }

  .rf-footer {
    min-height: 0;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  }

  .rf-footer-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rf-footer-actions .rf-button {
    width: 100%;
    min-width: 0;
  }

  .rf-footer-actions .rf-button:only-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 430px) {
  .rf-facts-grid,
  .rf-review-summary,
  .rf-artifact__metrics,
  .rf-footer-actions {
    grid-template-columns: 1fr;
  }

  .rf-footer-actions .rf-button:only-child {
    grid-column: auto;
  }

  .rf-artifact__table-wrap {
    overflow: visible;
  }

  .rf-artifact table,
  .rf-artifact thead,
  .rf-artifact tbody,
  .rf-artifact tr,
  .rf-artifact th,
  .rf-artifact td {
    display: block;
    width: 100%;
  }

  .rf-artifact thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .rf-artifact tr {
    margin-bottom: 10px;
    border: 1px solid var(--rf-document-border);
  }

  .rf-artifact th,
  .rf-artifact td {
    border: 0;
    border-bottom: 1px solid var(--rf-document-border);
  }

  .rf-artifact tr > :last-child {
    border-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rf-step-panel {
    animation: none;
  }

  .rf-dialog *,
  .rf-dialog *::before,
  .rf-dialog *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (forced-colors: active) {
  .rf-dialog,
  .rf-preflight-row,
  .rf-form-grid,
  .rf-fact-row,
  .rf-artifact {
    border: 2px solid CanvasText;
  }

  .rf-button:focus-visible,
  .rf-dialog :focus-visible {
    outline: 3px solid Highlight;
  }
}

@page {
  size: A4;
  margin: 16mm;
}

@media print {
  .rf-legacy-internal-preview {
    display: none !important;
  }

  body > *:not(.rf-dialog.rf-printing) {
    display: none !important;
  }

  .rf-dialog.rf-printing {
    position: static !important;
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #ffffff !important;
  }

  .rf-dialog.rf-printing .rf-shell {
    display: block !important;
    height: auto !important;
  }

  .rf-dialog.rf-printing .rf-header,
  .rf-dialog.rf-printing .rf-progress,
  .rf-dialog.rf-printing .rf-live,
  .rf-dialog.rf-printing .rf-section-head,
  .rf-dialog.rf-printing .rf-not-sent,
  .rf-dialog.rf-printing .rf-footer {
    display: none !important;
  }

  .rf-dialog.rf-printing .rf-body,
  .rf-dialog.rf-printing .rf-step-panel {
    display: block !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #ffffff !important;
  }

  .rf-dialog.rf-printing .rf-empty {
    display: none !important;
  }

  .rf-artifact {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .rf-artifact__section,
  .rf-artifact__approval,
  .rf-artifact-metric,
  .rf-artifact tr {
    break-inside: avoid;
  }

  .rf-artifact__table-wrap {
    overflow: visible;
  }

  .rf-artifact__page::after {
    content: counter(page);
  }
}
