/* ============================================================
   Compliance Guard - Premium Admin Shell
   Layout / styling: peptaura-inspired catalog cockpit
   Palette: redhelixresearch.com (slate neutrals + brand red gradient)
   ============================================================ */

.rpca-wrap.rpca-shell-active {
  background: var(--paper-50);
  color: var(--ink-900);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.5;
  /* WordPress wraps admin pages in #wpcontent, which already accounts for
     the WP sidebar (160px expanded, 36px collapsed, 0 on mobile auto-fold).
     The previous negative left margin and `max-width: none` pushed content
     under the WP sidebar at certain widths and let the topbar overflow off
     the right edge. Reset margin to 0 and clip horizontal overflow on the
     wrap itself so nothing bleeds outside the WP-provided content rect. */
  margin: 0;
  max-width: 100%;
  min-height: calc(100vh - 32px);
  overflow-x: hidden;
  padding: 0;
}

.rpca-wrap.rpca-shell-active * {
  box-sizing: border-box;
}

/* Belt-and-suspenders: clip the SPA root too, so a child grid that exceeds
   its own min-content width can never push the topbar past the visible
   content rect (which previously caused the theme select to scroll off the
   right edge). */
.rpca-ui-root {
  overflow-x: hidden;
}

.rpca-ui-root {
  color: var(--ink-900);
  display: block;
  font-size: var(--text-body);
  line-height: 1.5;
  min-height: calc(100vh - 32px);
}

.rpca-shell {
  background:
    radial-gradient(circle at 0% 0%, var(--grain-tint), transparent 38%),
    radial-gradient(circle at 100% 100%, var(--grain-tint), transparent 42%),
    var(--paper-50);
  color: var(--ink-900);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 32px);
}

/* --- Trust strip (signal band along top) ----------------- */

.rpca-band-strip {
  background:
    linear-gradient(
      90deg,
      var(--accent-primary) 0%,
      var(--accent-deep) 32%,
      color-mix(in srgb, var(--accent-deep) 24%, transparent) 70%,
      transparent 100%
    );
  height: 3px;
  transition: background var(--duration-slow) var(--ease-standard);
}

/* --- Top bar (white, with red brand mark - Red Helix style) - */

.rpca-topbar {
  align-items: center;
  background: var(--surface-card);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  color: var(--ink-900);
  display: flex;
  flex-wrap: wrap;
  row-gap: var(--space-2);
  gap: var(--space-4);
  /* Topbar height was a hard 64px while every child had flex-shrink: 0.
     Below ~1300px the contents (brand + tag + build stamp + 3 meta items
     + search + Run audit + theme select) overflowed off the right edge
     because there was nothing left to compress. Switch to wrap so the row
     reflows when narrow, and let the height grow with the wrapped rows. */
  min-height: var(--topbar-height);
  height: auto;
  min-width: 0;
  padding: var(--space-2) var(--space-6);
  position: sticky;
  top: 32px;
  z-index: 800;
}

/* The middle metadata strip is informational, not interactive. Let it shrink
   and finally hide on narrow viewports so the action buttons (Search / Run
   audit / Theme) stay reachable on the same row. */
.rpca-topbar-meta {
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
}

@media (max-width: 1100px) {
  .rpca-topbar-meta {
    display: none;
  }
}

@media (max-width: 900px) {
  .rpca-topbar-tag,
  .rpca-topbar-build {
    display: none;
  }
}

/* WordPress collapses its admin sidebar at ≤960px to a 36px icon-only rail.
   Tighten our padding then so the topbar children stay on one row. */
@media (max-width: 960px) {
  .rpca-topbar {
    padding: var(--space-2) var(--space-4);
    gap: var(--space-3);
  }
}

.rpca-topbar-brand {
  align-items: center;
  color: var(--ink-900);
  display: flex;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 400;
  gap: var(--space-3);
  letter-spacing: -0.005em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.rpca-topbar-brand:hover {
  color: var(--accent-primary);
}

.rpca-topbar-mark {
  align-items: center;
  background: var(--hero-gradient);
  border-radius: 6px;
  box-shadow: var(--shadow-red);
  color: #ffffff;
  display: inline-flex;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  height: 32px;
  justify-content: center;
  letter-spacing: 0.04em;
  width: 32px;
}

.rpca-topbar-tag {
  background: var(--accent-rose-soft);
  border: 1px solid color-mix(in srgb, var(--accent-primary) 24%, transparent);
  border-radius: var(--radius-pill);
  color: var(--accent-deep);
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  text-transform: uppercase;
  white-space: nowrap;
}

.rpca-topbar-build {
  background: transparent;
  border: 1px dashed var(--border-soft);
  border-radius: var(--radius-pill);
  color: var(--ink-500);
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  white-space: nowrap;
}

.rpca-topbar-spacer {
  flex: 1;
}

.rpca-topbar-meta {
  align-items: center;
  color: var(--ink-600);
  display: flex;
  font-family: var(--font-mono);
  font-size: 12px;
  gap: var(--space-5);
}

.rpca-topbar-meta-item {
  align-items: center;
  display: inline-flex;
  gap: var(--space-2);
}

.rpca-topbar-meta-dot {
  background: var(--current-band, var(--band-clear));
  border-radius: 50%;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--current-band, var(--band-clear)) 25%, transparent);
  display: inline-block;
  height: 7px;
  width: 7px;
}

.rpca-topbar-actions {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  gap: var(--space-2);
}

.rpca-topbar-search {
  align-items: center;
  background: var(--paper-50);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
  color: var(--ink-600);
  cursor: pointer;
  display: inline-flex;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  gap: var(--space-3);
  height: 36px;
  letter-spacing: 0.02em;
  padding: 0 var(--space-3);
  transition: all var(--duration-fast) var(--ease-standard);
  white-space: nowrap;
}

.rpca-topbar-search:hover,
.rpca-topbar-search:focus-visible {
  background: var(--paper-100);
  border-color: var(--border-strong);
  color: var(--ink-900);
  outline: none;
}

.rpca-topbar-search kbd {
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  color: var(--ink-600);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
}

.rpca-topbar-button {
  align-items: center;
  background: var(--hero-gradient);
  border: 1px solid var(--accent-deep);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-red);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  flex-shrink: 0;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  height: 36px;
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 0 var(--space-4);
  transition: all var(--duration-fast);
  white-space: nowrap;
}

.rpca-topbar-button:hover,
.rpca-topbar-button:focus-visible {
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--accent-primary) 100%);
  outline: none;
  transform: translateY(-1px);
}

.rpca-topbar-theme {
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
  color: var(--ink-700);
  flex-shrink: 0;
  font-family: var(--font-body);
  font-size: 12px;
  height: 36px;
  padding: 0 var(--space-3);
}

/* --- Shell grid ------------------------------------------ */

.rpca-shell-grid {
  display: grid;
  flex: 1;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  min-height: 0;
}

/* Each SPA section is now a real WordPress submenu page (v0.7.223) so the
   in-shell rail is duplicate navigation. Collapse it on narrow widths to
   give the content area the full width and let the merchant rely on the
   WP admin sidebar for section navigation. */
@media (max-width: 1024px) {
  .rpca-shell-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .rpca-rail {
    display: none;
  }
}

/* --- Left rail (catalog navigation) ---------------------- */

.rpca-rail {
  background: var(--surface-card);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding: var(--space-8) var(--space-4) var(--space-6);
  position: sticky;
  top: calc(32px + var(--topbar-height));
  height: calc(100vh - 32px - var(--topbar-height));
  overflow-y: auto;
}

.rpca-rail-brand {
  display: none;
}

.rpca-rail-eyebrow {
  color: var(--ink-500);
  font-family: var(--font-mono);
  font-size: var(--text-mono-small);
  font-weight: 600;
  letter-spacing: 0.12em;
  margin: 0 0 var(--space-3);
  padding: 0 var(--space-3);
  text-transform: uppercase;
}

.rpca-rail-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.rpca-rail-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rpca-rail-item {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: var(--radius-soft);
  color: var(--ink-700);
  cursor: pointer;
  display: flex;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  gap: var(--space-3);
  justify-content: space-between;
  letter-spacing: 0.005em;
  min-height: 38px;
  padding: 0 var(--space-3);
  position: relative;
  text-align: left;
  text-transform: none;
  transition: all var(--duration-fast);
}

.rpca-rail-item::before {
  background: var(--accent-primary);
  border-radius: 2px;
  content: "";
  height: 18px;
  left: -8px;
  opacity: 0;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  transition: opacity var(--duration-fast);
  width: 3px;
}

.rpca-rail-item:hover {
  background: var(--paper-50);
  color: var(--ink-900);
}

.rpca-rail-item.is-active {
  background: var(--accent-rose-soft);
  color: var(--accent-deep);
  font-weight: 600;
}

.rpca-rail-item.is-active::before {
  opacity: 1;
}

.rpca-rail-item-label {
  align-items: center;
  display: inline-flex;
  gap: var(--space-3);
}

.rpca-rail-item-glyph {
  color: var(--ink-400);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  width: 14px;
}

.rpca-rail-item.is-active .rpca-rail-item-glyph {
  color: var(--accent-primary);
}

.rpca-rail-item[data-locked] {
  color: var(--ink-400);
  cursor: not-allowed;
}

.rpca-rail-count,
.rpca-setup-chip,
.rpca-status-pill {
  background: var(--paper-100);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
  color: var(--ink-700);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  padding: 4px 9px;
}

.rpca-rail-item.is-active .rpca-rail-count {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
}

.rpca-setup-chip {
  align-self: flex-start;
  margin: 0 var(--space-3);
}

.rpca-rail-tools {
  display: grid;
  gap: var(--space-2);
  margin-top: auto;
  padding-top: var(--space-4);
}

.rpca-theme-select {
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-soft);
  color: var(--ink-900);
  font-family: var(--font-body);
  min-height: 38px;
  padding: 0 var(--space-3);
  width: 100%;
}

/* --- Main content area ----------------------------------- */

.rpca-main {
  background: transparent;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: var(--space-10) clamp(var(--space-6), 4vw, var(--space-12)) var(--space-16);
}

.rpca-content-frame {
  margin: 0 auto;
  max-width: var(--content-max);
  width: 100%;
}

.rpca-breadcrumbs {
  align-items: center;
  color: var(--ink-500);
  display: flex;
  font-family: var(--font-mono);
  font-size: 11px;
  gap: var(--space-2);
  letter-spacing: 0.06em;
  margin-bottom: var(--space-3);
  text-transform: uppercase;
}

.rpca-breadcrumbs a {
  color: var(--ink-500);
  text-decoration: none;
}

.rpca-breadcrumbs a:hover {
  color: var(--accent-primary);
}

.rpca-section-title-main {
  color: var(--ink-900);
  font-family: var(--font-display);
  font-size: var(--text-h1);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin: 0 0 var(--space-8);
}

.rpca-view[hidden] {
  display: none;
}

/* --- Cockpit / Hero (Red Helix red gradient) -------------- */

.rpca-cockpit {
  display: grid;
  gap: var(--space-8);
}

.rpca-hero-card {
  background:
    radial-gradient(circle at 92% -20%, rgba(255, 255, 255, 0.18), transparent 55%),
    var(--hero-gradient);
  border: 1px solid var(--accent-darker);
  border-radius: var(--radius-card);
  box-shadow: 0 20px 40px -20px rgba(107, 24, 39, 0.4), 0 4px 12px -4px rgba(15, 23, 42, 0.1);
  color: #ffffff;
  display: grid;
  gap: var(--space-8);
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.7fr);
  overflow: hidden;
  padding: var(--space-10);
  position: relative;
}

.rpca-hero-card::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, transparent 100%);
  content: "";
  height: 80%;
  left: 0;
  position: absolute;
  top: 0;
  width: 2px;
}

.rpca-hero-eyebrow {
  align-items: center;
  color: rgba(255, 255, 255, 0.78);
  display: inline-flex;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  gap: var(--space-2);
  letter-spacing: 0.16em;
  margin: 0 0 var(--space-4);
  text-transform: uppercase;
}

.rpca-hero-eyebrow::after {
  background: rgba(255, 255, 255, 0.32);
  content: "";
  height: 1px;
  width: 32px;
}

.rpca-hero-number {
  display: grid;
  gap: var(--space-3);
}

.rpca-hero-label {
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.rpca-score-line {
  align-items: baseline;
  color: #ffffff;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.rpca-score {
  color: #ffffff;
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 0.85;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

.rpca-score-denom {
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2vw, 1.5rem);
}

.rpca-delta {
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-pill);
  color: #ffffff;
  display: inline-flex;
  font-family: var(--font-mono);
  font-size: 12px;
  gap: 4px;
  margin-left: var(--space-2);
  padding: 4px 10px;
}

.rpca-delta.is-down {
  background: rgba(255, 255, 255, 0.16);
}

.rpca-delta.is-flat {
  color: rgba(255, 255, 255, 0.72);
}

.rpca-signal-row {
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.85);
  display: grid;
  font-family: var(--font-mono);
  font-size: 12px;
  gap: var(--space-3) var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-top: var(--space-6);
  padding-top: var(--space-5);
}

.rpca-signal-row > span {
  display: block;
}

.rpca-signal-row strong {
  color: #ffffff;
  display: block;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  margin-top: 4px;
}

/* circular gauge inside hero */
.rpca-hero-gauge {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  justify-content: center;
}

.rpca-hero-gauge-ring {
  align-items: center;
  background:
    conic-gradient(
      rgba(255, 255, 255, 0.92) calc(var(--gauge-percent, 0%) * 1),
      rgba(255, 255, 255, 0.16) 0
    );
  border-radius: 50%;
  display: flex;
  height: 168px;
  justify-content: center;
  position: relative;
  width: 168px;
}

.rpca-hero-gauge-ring::before {
  background: var(--accent-darker);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  content: "";
  inset: 10px;
  position: absolute;
}

.rpca-hero-gauge-inner {
  position: relative;
  text-align: center;
  z-index: 1;
}

.rpca-hero-gauge-inner span {
  color: rgba(255, 255, 255, 0.6);
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.rpca-hero-gauge-inner strong {
  color: #ffffff;
  display: block;
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 300;
  line-height: 1;
  margin-top: 4px;
}

.rpca-hero-gauge-tag {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-pill);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  text-transform: uppercase;
}

.rpca-hero-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.rpca-hero-card .rpca-button {
  background: #ffffff;
  border-color: #ffffff;
  color: var(--accent-deep);
}

.rpca-hero-card .rpca-button:hover {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.92);
  color: var(--accent-darker);
}

.rpca-hero-card .rpca-button.is-ghost {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

.rpca-hero-card .rpca-button.is-ghost:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.42);
}

/* --- Trust strip (chip row of compliance signals) -------- */

.rpca-trust-strip {
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  display: grid;
  gap: 0;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  overflow: hidden;
}

.rpca-trust-cell {
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--space-4) var(--space-5);
}

.rpca-trust-cell:last-child {
  border-right: 0;
}

.rpca-trust-cell-label {
  color: var(--ink-500);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rpca-trust-cell-value {
  align-items: center;
  color: var(--ink-900);
  display: flex;
  flex-wrap: wrap;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  gap: var(--space-2);
  letter-spacing: -0.005em;
  line-height: 1.2;
}

.rpca-trust-cell-tag {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
  color: var(--ink-500);
  display: inline-flex;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  text-transform: uppercase;
}

.rpca-trust-cell-tag.is-pass {
  background: var(--band-clear-soft);
  border-color: color-mix(in srgb, var(--band-clear) 30%, transparent);
  color: var(--band-clear);
}

.rpca-trust-cell-tag.is-warn {
  background: var(--accent-gold-soft);
  border-color: color-mix(in srgb, var(--accent-gold) 30%, transparent);
  color: var(--accent-amber-ink);
}

.rpca-trust-cell-tag.is-bad {
  background: var(--band-red-soft);
  border-color: color-mix(in srgb, var(--band-red) 30%, transparent);
  color: var(--band-red);
}

/* --- One-thing card -------------------------------------- */

.rpca-one-thing,
.rpca-editorial-card,
.rpca-audit-launcher,
.rpca-this-week,
.rpca-cockpit-row {
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--space-7);
  position: relative;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.rpca-one-thing {
  border-left: 3px solid var(--accent-primary);
  padding: var(--space-7);
  position: relative;
}

.rpca-one-thing::before {
  background: var(--hero-gradient);
  border-radius: var(--radius-soft);
  box-shadow: var(--shadow-red);
  content: "PRIORITY";
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 4px 10px;
  position: absolute;
  right: var(--space-6);
  top: var(--space-6);
}

.rpca-eyebrow {
  color: var(--accent-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin: 0 0 var(--space-3);
  text-transform: uppercase;
}

.rpca-one-thing h3,
.rpca-editorial-card h3,
.rpca-audit-launcher h3,
.rpca-this-week h3,
.rpca-cockpit-row h3,
.rpca-settings-group h3 {
  color: var(--ink-900);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 0 0 var(--space-2);
}

.rpca-one-thing p,
.rpca-editorial-card p,
.rpca-audit-launcher p,
.rpca-toggle-row p {
  color: var(--ink-600);
  margin: 0;
}

/* --- Buttons --------------------------------------------- */

.rpca-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.rpca-button {
  align-items: center;
  background: var(--surface-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-soft);
  color: var(--ink-900);
  cursor: pointer;
  display: inline-flex;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  gap: var(--space-2);
  justify-content: center;
  letter-spacing: 0.005em;
  line-height: 1;
  min-height: 40px;
  padding: 10px var(--space-4);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-standard);
  white-space: nowrap;
}

.rpca-button:hover {
  background: var(--paper-50);
  border-color: var(--accent-primary);
  color: var(--accent-deep);
}

.rpca-button:active {
  transform: translateY(1px);
}

.rpca-button.is-primary {
  background: var(--hero-gradient);
  border-color: var(--accent-deep);
  box-shadow: var(--shadow-red);
  color: #ffffff;
}

.rpca-button.is-primary:hover {
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--accent-primary) 100%);
  border-color: var(--accent-primary);
  color: #ffffff;
  transform: translateY(-1px);
}

.rpca-button.is-text {
  background: transparent;
  border-color: transparent;
  color: var(--ink-700);
}

.rpca-button.is-text:hover {
  background: var(--paper-50);
  border-color: var(--border-soft);
  color: var(--ink-900);
}

.rpca-button.is-ghost {
  background: transparent;
  border-color: var(--border-soft);
  color: var(--ink-700);
}

.rpca-button.is-ghost:hover {
  background: var(--paper-50);
  border-color: var(--accent-primary);
  color: var(--accent-deep);
}

.rpca-button[disabled],
.rpca-button.is-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

/* --- Inline status --------------------------------------- */

.rpca-inline-status {
  background: var(--paper-50);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--accent-primary);
  border-radius: var(--radius-soft);
  color: var(--ink-700);
  font-size: 13px;
  margin: var(--space-4) 0 0;
  padding: var(--space-3) var(--space-4);
}

.rpca-inline-status.is-error {
  background: var(--band-red-soft);
  border-left-color: var(--band-red);
  color: var(--band-red);
}

.rpca-inline-status.is-success {
  background: var(--band-clear-soft);
  border-left-color: var(--band-clear);
  color: var(--band-clear);
}

/* --- Large-site mode toggle (v0.7.266) -------------------- */
/* Checkbox sits directly below the "Run processor audit scan"
   button. When checked, the JS dispatches to the segmented-scan
   chunked path. */
.rpca-large-site-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: var(--space-3) 0 0;
  font-size: 13px;
  color: color-mix(in srgb, var(--ink-50) 78%, transparent);
  cursor: pointer;
  user-select: none;
}
.rpca-large-site-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent-primary, #b08a2e);
  cursor: pointer;
}
.rpca-large-site-toggle:hover {
  color: var(--ink-50);
}

/* --- Scan progress bar (v0.7.265) ------------------------ */
/* Visible loading bar that tracks fetched/queueDepth from the
   live scan progress transient. Sits directly below the inline
   status message during long crawls so the merchant sees real
   movement instead of staring at "Checking your site..." */
.rpca-scan-progress {
  margin: var(--space-3) 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rpca-scan-progress[hidden] {
  display: none;
}
.rpca-scan-progress-bar {
  position: relative;
  height: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  overflow: hidden;
}
.rpca-scan-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-primary, #b08a2e) 0%, color-mix(in srgb, var(--accent-primary, #b08a2e) 60%, #ffffff 40%) 100%);
  border-radius: 999px;
  transition: width 320ms ease;
}
/* Indeterminate animation while we have no fetched count yet
   (very early in the crawl, before the first transient write) */
.rpca-scan-progress.is-indeterminate .rpca-scan-progress-fill {
  width: 35%;
  animation: rpca-scan-progress-indeterminate 1600ms ease-in-out infinite;
}
@keyframes rpca-scan-progress-indeterminate {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(285%); }
}
.rpca-scan-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: color-mix(in srgb, var(--ink-50) 70%, transparent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.02em;
}
.rpca-scan-progress-meta strong {
  color: var(--ink-50);
  font-weight: 600;
}

/* --- Notice card (amber, Red Helix's banner palette) ----- */

.rpca-notice-card {
  background: var(--accent-gold-soft);
  border: 1px solid color-mix(in srgb, var(--accent-gold) 35%, transparent);
  border-left: 3px solid var(--accent-gold);
  border-radius: var(--radius-card);
  color: var(--accent-amber-ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
  padding: var(--space-4) var(--space-5);
}

/* --- First-run setup ------------------------------------ */

.rpca-first-run-form {
  margin: 0 auto;
  max-width: 920px;
}

.rpca-first-run-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: var(--space-5);
}

.rpca-first-run-grid label,
.rpca-first-run-checks label {
  display: grid;
  gap: var(--space-2);
}

.rpca-first-run-grid span,
.rpca-first-run-checks span {
  color: var(--ink-900);
  font-size: 13px;
  font-weight: 600;
}

.rpca-first-run-grid small,
.rpca-first-run-checks small {
  color: var(--ink-500);
  font-size: 12px;
}

.rpca-first-run-grid input,
.rpca-first-run-grid select {
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-soft);
  color: var(--ink-900);
  font-family: var(--font-body);
  min-height: 42px;
  padding: 8px 12px;
  transition: all var(--duration-fast);
}

.rpca-first-run-grid input:focus,
.rpca-first-run-grid select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 14%, transparent);
  outline: none;
}

.rpca-first-run-checks {
  display: grid;
  gap: var(--space-3);
  margin: var(--space-6) 0;
}

.rpca-first-run-checks label {
  align-items: start;
  background: var(--paper-50);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-soft);
  grid-template-columns: auto 1fr;
  padding: var(--space-3) var(--space-4);
  transition: all var(--duration-fast);
}

.rpca-first-run-checks label:has(input:checked) {
  background: var(--accent-rose-soft);
  border-color: color-mix(in srgb, var(--accent-primary) 36%, transparent);
}

.rpca-first-run-checks input[type="checkbox"] {
  margin-top: 3px;
}

/* --- Setup progress (numbered step strip) --------------- */

.rpca-setup-progress {
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  list-style: none;
  margin: 0 0 var(--space-6);
  padding: var(--space-4) var(--space-5);
}

.rpca-setup-progress li {
  align-items: center;
  color: var(--ink-500);
  display: inline-flex;
  flex: 1 1 140px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  gap: var(--space-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rpca-setup-progress li::before {
  align-items: center;
  background: var(--paper-100);
  border: 1px solid var(--border-soft);
  border-radius: 50%;
  color: var(--ink-500);
  content: counter(rpca-step);
  counter-increment: rpca-step;
  display: inline-flex;
  font-family: var(--font-mono);
  font-size: 11px;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.rpca-setup-progress {
  counter-reset: rpca-step;
}

.rpca-setup-progress li.is-done {
  color: var(--band-clear);
}

.rpca-setup-progress li.is-done::before {
  background: var(--band-clear-soft);
  border-color: var(--band-clear);
  color: var(--band-clear);
}

.rpca-setup-progress li.is-current {
  color: var(--accent-primary);
}

.rpca-setup-progress li.is-current::before {
  background: var(--hero-gradient);
  border-color: var(--accent-deep);
  box-shadow: var(--shadow-red);
  color: #ffffff;
}

/* --- "This week" event lines ---------------------------- */

.rpca-this-week h3 {
  border-bottom: 1px solid var(--border-soft);
  margin: 0 0 var(--space-3);
  padding-bottom: var(--space-3);
}

.rpca-week-line {
  align-items: center;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border-soft);
  color: var(--ink-900);
  cursor: pointer;
  display: flex;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  gap: var(--space-3);
  justify-content: space-between;
  min-height: 46px;
  padding: var(--space-2) 0;
  text-align: left;
  transition: color var(--duration-fast);
  width: 100%;
}

.rpca-week-line:last-child {
  border-bottom: 0;
}

.rpca-week-line:hover {
  color: var(--accent-primary);
}

.rpca-week-line span:last-child {
  color: var(--ink-400);
}

.rpca-week-line:hover span:last-child {
  color: var(--accent-primary);
}

/* --- Compliance checklist (grouped) --------------------- */

.rpca-compliance-checklist {
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--space-7);
}

.rpca-checklist-head {
  align-items: end;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: space-between;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
}

.rpca-checklist-head h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
}

.rpca-checklist-summary {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  gap: var(--space-3);
}

.rpca-checklist-summary-tally {
  align-items: baseline;
  color: var(--ink-900);
  display: inline-flex;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
  gap: 6px;
  letter-spacing: -0.015em;
  line-height: 1;
}

.rpca-checklist-summary-tally span {
  color: var(--ink-400);
  font-family: var(--font-mono);
  font-size: 13px;
}

.rpca-checklist-group {
  margin-bottom: var(--space-6);
}

.rpca-checklist-group:last-child {
  margin-bottom: 0;
}

.rpca-checklist-group-head {
  align-items: center;
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.rpca-checklist-group-head h4 {
  color: var(--ink-700);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin: 0;
  text-transform: uppercase;
}

.rpca-checklist-group-rule {
  background: var(--border-soft);
  flex: 1;
  height: 1px;
}

.rpca-checklist-group-tally {
  color: var(--ink-500);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.rpca-checklist-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.rpca-checklist-item {
  align-items: start;
  background: var(--surface-card-alt);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-soft);
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 22px 1fr;
  padding: var(--space-4);
  transition: all var(--duration-fast);
}

.rpca-checklist-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
}

.rpca-check-shape {
  border: 1.5px solid var(--ink-300);
  border-radius: 50%;
  height: 16px;
  margin-top: 3px;
  position: relative;
  width: 16px;
}

.rpca-checklist-item.is-pass .rpca-check-shape {
  background: var(--band-clear);
  border-color: var(--band-clear);
}

.rpca-checklist-item.is-pass .rpca-check-shape::after {
  border-bottom: 1.5px solid #ffffff;
  border-left: 1.5px solid #ffffff;
  content: "";
  height: 4px;
  left: 4px;
  position: absolute;
  top: 4px;
  transform: rotate(-45deg);
  width: 7px;
}

.rpca-checklist-item.is-review .rpca-check-shape {
  background: var(--band-red-soft);
  border-color: var(--band-red);
}

.rpca-checklist-item.is-review .rpca-check-shape::after {
  background: var(--band-red);
  border-radius: 50%;
  content: "";
  height: 6px;
  left: 4px;
  position: absolute;
  top: 4px;
  width: 6px;
}

.rpca-checklist-item.is-pending .rpca-check-shape {
  background: var(--accent-gold-soft);
  border-color: var(--accent-gold);
}

.rpca-checklist-item strong {
  color: var(--ink-900);
  display: block;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1.3;
}

.rpca-checklist-item p {
  color: var(--ink-600);
  font-size: 13px;
  line-height: 1.45;
  margin: 4px 0 6px;
}

.rpca-checklist-item span:last-child {
  border-radius: var(--radius-pill);
  color: var(--ink-500);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0;
  text-transform: uppercase;
}

.rpca-checklist-item.is-pass span:last-child {
  color: var(--band-clear);
}

.rpca-checklist-item.is-review span:last-child {
  color: var(--band-red);
}

/* --- Generic editorial card grid ------------------------ */

.rpca-panel-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

/* --- Sub-tabs ------------------------------------------- */

.rpca-subtabs {
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  overflow-x: auto;
  padding-bottom: 1px;
  scrollbar-width: thin;
}

.rpca-subtab {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--ink-500);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  min-height: 40px;
  padding: 0 var(--space-3);
  transition: all var(--duration-fast);
  white-space: nowrap;
}

.rpca-subtab:hover {
  color: var(--ink-900);
}

.rpca-subtab.is-active {
  border-bottom-color: var(--accent-primary);
  color: var(--accent-deep);
  font-weight: 600;
}

/* --- Findings catalog ----------------------------------- */

.rpca-finding-toolbar {
  align-items: stretch;
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  display: grid;
  gap: var(--space-3);
  grid-template-columns: minmax(220px, 1fr) auto;
  margin-bottom: var(--space-5);
  padding: var(--space-3) var(--space-4);
}

.rpca-filter-input,
.rpca-command-input,
.rpca-modal textarea,
.rpca-modal input[type="text"],
.rpca-modal input[type="search"] {
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-soft);
  color: var(--ink-900);
  font-family: var(--font-body);
  font-size: 13px;
  min-height: 40px;
  padding: 8px 12px;
  width: 100%;
}

.rpca-filter-input:focus,
.rpca-command-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 14%, transparent);
  outline: none;
}

.rpca-saved-views {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.rpca-chip {
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
  color: var(--ink-700);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  min-height: 32px;
  padding: 0 var(--space-3);
  text-transform: uppercase;
  transition: all var(--duration-fast);
}

.rpca-chip:hover {
  border-color: var(--accent-primary);
  color: var(--accent-deep);
}

.rpca-chip.is-active {
  background: var(--hero-gradient);
  border-color: var(--accent-deep);
  box-shadow: var(--shadow-red);
  color: #ffffff;
}

.rpca-finding-list {
  display: grid;
  gap: var(--space-3);
}

.rpca-finding-row {
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  display: grid;
  gap: var(--space-3);
  padding: var(--space-5);
  position: relative;
  transition: all var(--duration-fast);
}

.rpca-finding-row::before {
  background: var(--accent-gold);
  border-radius: var(--radius-card) 0 0 var(--radius-card);
  content: "";
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 3px;
}

.rpca-finding-row:hover {
  box-shadow: var(--shadow-elevated);
  border-color: var(--border-strong);
}

.rpca-finding-row.is-current {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-elevated), 0 0 0 3px color-mix(in srgb, var(--accent-primary) 12%, transparent);
}

.rpca-finding-row[data-band="red"]::before { background: var(--band-red); }
.rpca-finding-row[data-band="orange"]::before { background: var(--band-orange); }
.rpca-finding-row[data-band="yellow"]::before { background: var(--accent-gold); }
.rpca-finding-row[data-band="green"]::before { background: var(--band-clear); }

.rpca-finding-row.is-ai-softened {
  border-color: color-mix(in srgb, var(--band-clear) 28%, var(--border-soft));
  box-shadow: none;
}

.rpca-finding-row.is-ai-softened::before {
  background: var(--band-clear);
}

.rpca-finding-row.is-coverage-sensitive {
  border-style: dashed;
}

.rpca-finding-row.is-coverage-sensitive::before {
  background: var(--accent-gold);
}

.rpca-finding-row.is-feedback-sensitive {
  border-color: #c9d8e4;
  box-shadow: none;
}

.rpca-finding-row.is-feedback-sensitive::before {
  background: #466273;
}

/* v0.7.284: applied-fix style — dim and tag the row so the merchant can see
   at a glance which findings they have already acted on without losing the
   row entirely (it remains in the Applied chip and the All chip). */
.rpca-finding-row.is-applied {
  background: color-mix(in srgb, #dcfce7 35%, var(--surface-base));
  border-color: #86efac;
  opacity: 0.92;
}
.rpca-finding-row.is-applied::before {
  background: #16a34a;
}
.rpca-finding-row.is-applied .rpca-finding-title {
  text-decoration: none;
}

.rpca-finding-main {
  align-items: start;
  display: grid;
  gap: var(--space-4);
  grid-template-columns: minmax(0, 1fr) minmax(160px, 240px);
}

.rpca-finding-headline {
  display: flex;
  gap: var(--space-3);
}

.rpca-band-dot {
  background: var(--band-red);
  border-radius: 50%;
  flex-shrink: 0;
  height: 10px;
  margin-top: 7px;
  width: 10px;
}

.rpca-band-dot.is-green { background: var(--band-clear); box-shadow: 0 0 0 4px var(--band-clear-soft); }
.rpca-band-dot.is-yellow { background: var(--accent-gold); box-shadow: 0 0 0 4px var(--accent-gold-soft); }
.rpca-band-dot.is-orange { background: var(--band-orange); box-shadow: 0 0 0 4px var(--band-orange-soft); }
.rpca-band-dot.is-red { background: var(--band-red); box-shadow: 0 0 0 4px var(--band-red-soft); }

.rpca-finding-title {
  align-items: center;
  color: var(--ink-900);
  display: flex;
  flex-wrap: wrap;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  gap: var(--space-2);
  letter-spacing: -0.005em;
  line-height: 1.3;
  margin: 0;
}

.rpca-severity-tag {
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 4px 9px;
  text-transform: uppercase;
}

.rpca-severity-tag.is-critical {
  background: var(--hero-gradient);
  box-shadow: var(--shadow-red);
  color: #ffffff;
}

.rpca-severity-tag.is-high {
  background: var(--band-orange);
  color: #ffffff;
}

.rpca-severity-tag.is-medium {
  background: var(--accent-gold-soft);
  color: var(--accent-amber-ink);
}

.rpca-severity-tag.is-low {
  background: var(--band-clear-soft);
  color: var(--band-clear);
}

.rpca-path {
  color: var(--ink-500);
  font-family: var(--font-mono);
  font-size: 12px;
  margin-top: 4px;
}

.rpca-flagged-span {
  background: var(--accent-gold-soft);
  border-left: 2px solid var(--accent-gold);
  border-radius: 4px;
  color: var(--accent-amber-ink);
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  margin-top: var(--space-3);
  padding: 6px 10px;
}

.rpca-severity-mark {
  color: var(--accent-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  margin-left: var(--space-2);
}

.rpca-confidence {
  display: grid;
  gap: 6px;
}

.rpca-confidence-label {
  color: var(--ink-500);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: right;
  text-transform: uppercase;
}

.rpca-confidence-track {
  background:
    linear-gradient(
      90deg,
      var(--ink-200) 0 33%,
      var(--accent-gold-soft) 33% 66%,
      var(--band-clear-soft) 66% 100%
    );
  border-radius: var(--radius-pill);
  height: 6px;
  position: relative;
}

.rpca-confidence-tick {
  background: var(--ink-900);
  border-radius: var(--radius-pill);
  box-shadow: 0 0 0 3px var(--surface-card);
  height: 14px;
  position: absolute;
  top: -4px;
  width: 2px;
}

.rpca-confidence-zones {
  color: var(--ink-400);
  display: flex;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  justify-content: space-between;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rpca-finding-actions {
  border-top: 1px dashed var(--border-soft);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: var(--space-3);
}

/* --- Why / rewrite panels ------------------------------- */

.rpca-why-panel,
.rpca-rewrite-panel,
.rpca-screenshot-panel {
  background: var(--surface-card-alt);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-soft);
  margin-top: var(--space-3);
  padding: var(--space-5);
}

.rpca-why-panel h4,
.rpca-rewrite-panel h4 {
  color: var(--ink-700);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin: 0 0 var(--space-2);
  text-transform: uppercase;
}

.rpca-why-panel p {
  color: var(--ink-700);
  margin: 0 0 var(--space-3);
}

.rpca-rewrite-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr 1fr;
}

.rpca-rewrite-grid > div {
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-soft);
  padding: var(--space-4);
}

.rpca-diff-remove {
  background: var(--band-red-soft);
  border-radius: 3px;
  color: var(--band-red);
  padding: 0 5px;
  text-decoration: line-through;
}

.rpca-diff-add {
  background: var(--band-clear-soft);
  border-radius: 3px;
  color: var(--band-clear);
  font-weight: 600;
  padding: 0 5px;
}

.rpca-screenshot-frame {
  aspect-ratio: 16 / 10;
  background: var(--surface-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-soft);
  display: grid;
  overflow: hidden;
  place-items: center;
  position: relative;
}

.rpca-screenshot-box {
  border: 2px solid var(--accent-primary);
  border-radius: 4px;
  height: 68px;
  left: 18%;
  position: absolute;
  top: 34%;
  width: 46%;
}

/* --- Settings ------------------------------------------- */

.rpca-settings-presets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-3) 0 var(--space-2);
}

.rpca-settings-groups {
  display: grid;
  gap: var(--space-6);
}

.rpca-settings-group {
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--space-7);
}

.rpca-settings-group h3 {
  border-bottom: 1px solid var(--border-soft);
  margin: 0 0 var(--space-4);
  padding-bottom: var(--space-3);
}

.rpca-settings-group > p {
  color: var(--ink-600);
  font-size: 13px;
  margin: 0 0 var(--space-4);
}

.rpca-toggle-row {
  background: var(--surface-card-alt);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-soft);
  margin-top: var(--space-3);
  padding: var(--space-4) var(--space-5);
  position: relative;
  transition: all var(--duration-fast);
}

.rpca-toggle-row:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
}

.rpca-toggle-head {
  align-items: center;
  display: flex;
  gap: var(--space-4);
  justify-content: space-between;
}

.rpca-toggle-name {
  color: var(--ink-900);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.005em;
}

.rpca-switch {
  align-items: center;
  background: var(--paper-100);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  color: var(--ink-700);
  cursor: pointer;
  display: inline-flex;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  gap: 6px;
  letter-spacing: 0.1em;
  min-width: 64px;
  padding: 5px 12px 5px 10px;
  transition: all var(--duration-fast);
}

.rpca-switch::before {
  background: var(--ink-400);
  border-radius: 999px;
  content: "";
  height: 8px;
  transition: background var(--duration-fast);
  width: 8px;
}

.rpca-switch.is-on {
  background: var(--band-clear-soft);
  border-color: var(--band-clear);
  color: var(--band-clear);
}

.rpca-switch.is-on::before {
  background: var(--band-clear);
}

.rpca-toggle-meta {
  color: var(--ink-600);
  display: grid;
  font-size: 12.5px;
  gap: 4px;
  margin-top: var(--space-3);
}

.rpca-preview-popout {
  background: var(--surface-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-soft);
  box-shadow: var(--shadow-elevated);
  font-size: 12px;
  max-width: 360px;
  opacity: 0;
  padding: var(--space-4);
  pointer-events: none;
  position: absolute;
  right: var(--space-4);
  top: calc(100% - 8px);
  transform: translateY(4px);
  transition: opacity var(--duration-medium), transform var(--duration-medium);
  z-index: 8;
}

.rpca-toggle-row:hover .rpca-preview-popout,
.rpca-toggle-row:focus-within .rpca-preview-popout {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 600ms;
}

.rpca-ai-key-card {
  background:
    linear-gradient(135deg, var(--accent-rose-soft) 0%, var(--surface-card) 50%),
    var(--surface-card);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--accent-primary);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--space-6);
  padding: var(--space-7);
}

.rpca-ai-key-card .rpca-kicker {
  color: var(--accent-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin: 0 0 var(--space-2);
  text-transform: uppercase;
}

.rpca-ai-key-card h3 {
  color: var(--ink-900);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-2);
}

.rpca-ai-key-card > p {
  color: var(--ink-600);
  margin: 0 0 var(--space-4);
}

/* --- Command palette / modal --------------------------- */

.rpca-command-overlay,
.rpca-modal-overlay {
  background: var(--surface-overlay);
  backdrop-filter: blur(6px);
  inset: 0;
  position: fixed;
  z-index: 100000;
}

.rpca-help-rail {
  background: var(--surface-overlay);
  inset: 0;
  position: fixed;
  z-index: 100000;
}

.rpca-command-overlay[hidden],
.rpca-modal-overlay[hidden],
.rpca-help-rail[hidden] {
  display: none;
}

.rpca-command {
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-modal);
  left: 50%;
  max-width: 720px;
  position: absolute;
  top: 12vh;
  transform: translateX(-50%);
  width: min(720px, calc(100vw - 32px));
}

.rpca-command-input {
  border: 0;
  border-bottom: 1px solid var(--border-soft);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  font-family: var(--font-mono);
  font-size: 14px;
  min-height: 56px;
  padding: 0 var(--space-5);
}

.rpca-command-results {
  max-height: 420px;
  overflow: auto;
  padding: var(--space-2);
}

.rpca-command-row {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: var(--radius-soft);
  color: var(--ink-900);
  cursor: pointer;
  display: grid;
  font-family: var(--font-body);
  font-size: 13.5px;
  gap: var(--space-3);
  grid-template-columns: 84px 1fr;
  min-height: 40px;
  padding: 0 var(--space-3);
  text-align: left;
  width: 100%;
}

.rpca-command-row.is-active,
.rpca-command-row:hover {
  background: var(--accent-rose-soft);
  color: var(--accent-deep);
}

.rpca-command-type {
  color: var(--ink-500);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rpca-modal {
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-modal);
  left: 50%;
  max-height: calc(100vh - 24vh);
  max-width: 720px;
  overflow-y: auto;
  padding: var(--space-8);
  position: absolute;
  top: 12vh;
  transform: translateX(-50%);
  width: min(720px, calc(100vw - 32px));
}

.rpca-modal h2 {
  color: var(--ink-900);
  font-family: var(--font-display);
  font-size: var(--text-h2);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-2);
  padding-right: var(--space-8);
}

.rpca-modal textarea {
  min-height: 120px;
  margin: var(--space-3) 0 var(--space-4);
}

.rpca-modal label {
  color: var(--ink-700);
  display: grid;
  font-size: 13px;
  font-weight: 600;
  gap: var(--space-2);
}

.rpca-modal-close {
  align-items: center;
  background: var(--paper-50);
  border: 1px solid var(--border-soft);
  border-radius: 50%;
  color: var(--ink-600);
  cursor: pointer;
  display: inline-flex;
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 300;
  height: 32px;
  justify-content: center;
  line-height: 1;
  padding: 0 0 2px;
  position: absolute;
  right: var(--space-5);
  top: var(--space-5);
  transition: all var(--duration-fast);
  width: 32px;
}

.rpca-modal-close:hover,
.rpca-modal-close:focus-visible {
  background: var(--accent-rose-soft);
  border-color: var(--accent-primary);
  color: var(--accent-deep);
  outline: none;
}

.rpca-draft-meta {
  background: var(--paper-50);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-soft);
  color: var(--ink-600);
  font-family: var(--font-mono);
  font-size: 12px;
  margin: 0 0 var(--space-5);
  overflow: hidden;
  padding: 6px 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rpca-draft-pair {
  background: var(--surface-card-alt);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  display: grid;
  gap: 0;
  grid-template-columns: 1fr 1fr;
  margin-bottom: var(--space-3);
  overflow: hidden;
}

.rpca-draft-col {
  border-right: 1px solid var(--border-soft);
  padding: var(--space-4) var(--space-5);
}

.rpca-draft-col:last-child {
  border-right: 0;
}

.rpca-draft-col h4 {
  align-items: center;
  color: var(--ink-700);
  display: flex;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  gap: var(--space-2);
  letter-spacing: 0.12em;
  margin: 0 0 var(--space-2);
  text-transform: uppercase;
}

.rpca-draft-col p {
  color: var(--ink-800);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

.rpca-draft-thinking {
  align-items: center;
  color: var(--ink-500);
  display: inline-flex;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  gap: 6px;
  letter-spacing: 0;
  text-transform: none;
}

.rpca-spinner {
  animation: rpca-spin 720ms linear infinite;
  border: 2px solid var(--ink-200);
  border-radius: 50%;
  border-top-color: var(--accent-primary);
  display: inline-block;
  height: 12px;
  width: 12px;
}

.rpca-button.is-primary .rpca-spinner {
  border-color: rgba(255, 255, 255, 0.32);
  border-top-color: #ffffff;
}

@keyframes rpca-spin {
  to { transform: rotate(360deg); }
}

.rpca-draft-footer {
  border-top: 1px solid var(--border-soft);
  color: var(--ink-500);
  font-size: 12px;
  line-height: 1.5;
  margin: var(--space-5) 0 0;
  padding-top: var(--space-4);
}

@media (max-width: 720px) {
  .rpca-draft-pair {
    grid-template-columns: 1fr;
  }
  .rpca-draft-col {
    border-right: 0;
    border-bottom: 1px solid var(--border-soft);
  }
  .rpca-draft-col:last-child {
    border-bottom: 0;
  }
}

.rpca-context-panel {
  background: var(--surface-card);
  border-left: 1px solid var(--border-soft);
  bottom: 0;
  box-shadow: var(--shadow-modal);
  max-width: 420px;
  overflow: auto;
  padding: var(--space-8);
  position: absolute;
  right: 0;
  top: 0;
  width: min(420px, 92vw);
}

.rpca-glossary {
  border-bottom: 1px dotted var(--ink-500);
}

/* --- Toast notifications -------------------------------- */

.rpca-notifications {
  bottom: var(--space-6);
  display: grid;
  gap: var(--space-2);
  position: fixed;
  right: var(--space-6);
  z-index: 99999;
}

.rpca-toast {
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--accent-primary);
  border-radius: var(--radius-soft);
  box-shadow: var(--shadow-elevated);
  color: var(--ink-900);
  font-size: 13px;
  max-width: 360px;
  padding: var(--space-4);
}

/* --- Time machine sparkline ----------------------------- */

.rpca-time-machine {
  border-top: 1px solid var(--border-soft);
  margin-top: var(--space-6);
  padding-top: var(--space-4);
}

.rpca-time-machine summary {
  color: var(--ink-700);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rpca-sparkline {
  align-items: end;
  background: var(--paper-50);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-soft);
  display: grid;
  gap: 2px;
  grid-auto-flow: column;
  height: 64px;
  margin: var(--space-3) 0;
  padding: var(--space-3);
}

.rpca-sparkline span {
  background: var(--hero-gradient);
  border-radius: 2px;
  min-height: 3px;
}

/* --- Audit lanes ---------------------------------------- */

.rpca-audit-lanes {
  display: grid;
  gap: var(--space-3);
}

.rpca-audit-lane {
  align-items: center;
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 92px 1fr;
}

.rpca-audit-lane > span:first-child {
  color: var(--ink-500);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rpca-audit-track {
  background: var(--border-soft);
  border-radius: var(--radius-pill);
  height: 3px;
  position: relative;
}

.rpca-audit-dot {
  background: var(--accent-primary);
  border-radius: 999px;
  height: 9px;
  position: absolute;
  top: -3px;
  width: 9px;
}

.rpca-audit-launcher {
  background:
    linear-gradient(135deg, var(--accent-gold-soft) 0%, var(--surface-card) 70%);
  border-left: 3px solid var(--accent-gold);
}

/* --- Audit step list (processor audit) ----------------- */

.rpca-audit-step-list {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.rpca-audit-step {
  align-items: start;
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--accent-gold);
  border-radius: var(--radius-soft);
  display: grid;
  gap: var(--space-3);
  grid-template-columns: minmax(0, 1fr) auto;
  padding: var(--space-4);
}

.rpca-audit-step.is-pass {
  background: var(--band-clear-soft);
  border-left-color: var(--band-clear);
}

.rpca-audit-step.is-fail,
.rpca-audit-step.is-block {
  background: var(--band-red-soft);
  border-left-color: var(--band-red);
}

.rpca-audit-step strong {
  color: var(--ink-900);
  display: block;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
}

.rpca-audit-step p {
  color: var(--ink-700);
  font-size: 13px;
  margin: 4px 0 6px;
}

.rpca-audit-step small,
.rpca-audit-step > span {
  color: var(--ink-500);
  font-family: var(--font-mono);
  font-size: 11px;
}

.rpca-audit-step > span {
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 4px 9px;
  text-transform: uppercase;
  white-space: nowrap;
}

.rpca-audit-themes {
  border-top: 1px solid var(--border-soft);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
}

.rpca-audit-themes strong {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
}

/* --- Cockpit stats grid -------------------------------- */

.rpca-cockpit-stats {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.rpca-stat-card {
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
  position: relative;
  transition: all var(--duration-fast);
}

.rpca-stat-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-elevated);
}

.rpca-stat-card-label {
  color: var(--ink-500);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rpca-stat-card-value {
  align-items: baseline;
  color: var(--ink-900);
  display: flex;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 400;
  gap: 6px;
  letter-spacing: -0.02em;
  line-height: 1;
}

.rpca-stat-card-value small {
  color: var(--ink-400);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}

.rpca-stat-card-meta {
  align-items: center;
  color: var(--ink-600);
  display: flex;
  font-size: 12px;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.rpca-stat-card-tag {
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  text-transform: uppercase;
}

.rpca-stat-card-tag.is-pass {
  background: var(--band-clear-soft);
  color: var(--band-clear);
}

.rpca-stat-card-tag.is-warn {
  background: var(--accent-gold-soft);
  color: var(--accent-amber-ink);
}

.rpca-stat-card-tag.is-bad {
  background: var(--band-red-soft);
  color: var(--band-red);
}

/* --- Payment readiness card (deep red, mirrors hero) ---- */

.rpca-payment-readiness {
  background:
    radial-gradient(circle at 90% -10%, rgba(255, 255, 255, 0.16), transparent 55%),
    var(--hero-gradient);
  border: 1px solid var(--accent-darker);
  border-radius: var(--radius-card);
  box-shadow: 0 16px 32px -16px rgba(107, 24, 39, 0.4);
  color: #ffffff;
  display: grid;
  gap: var(--space-5);
  grid-template-columns: minmax(0, 1fr) auto;
  padding: var(--space-7);
}

.rpca-payment-readiness h3 {
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-2);
}

.rpca-payment-readiness p {
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

.rpca-payment-readiness .rpca-eyebrow {
  color: rgba(255, 255, 255, 0.7);
}

.rpca-payment-readiness .rpca-button {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.32);
  color: #ffffff;
}

.rpca-payment-readiness .rpca-button:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.48);
  color: #ffffff;
}

.rpca-payment-readiness .rpca-button.is-text {
  background: transparent;
  border-color: transparent;
  color: rgba(255, 255, 255, 0.85);
}

.rpca-payment-readiness .rpca-button.is-text:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.rpca-payment-meter {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  justify-content: center;
}

.rpca-payment-meter strong {
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 60px;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

.rpca-payment-meter span {
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* --- Page list ---------------------------------------- */

.rpca-pages-table {
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  width: 100%;
}

.rpca-pages-row {
  align-items: center;
  border-bottom: 1px solid var(--border-soft);
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 14px minmax(0, 2fr) minmax(0, 2fr) auto;
  padding: var(--space-3) var(--space-4);
  transition: background var(--duration-fast);
}

.rpca-pages-row:last-child {
  border-bottom: 0;
}

.rpca-pages-row:hover {
  background: var(--surface-card-alt);
}

.rpca-pages-row strong {
  color: var(--ink-900);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
}

.rpca-pages-row small {
  color: var(--ink-500);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* --- Compliance grade letter + cockpit timestamp -------- */

.rpca-grade-letter {
  background: linear-gradient(180deg, #ffffff 0%, color-mix(in srgb, var(--accent-soft) 55%, #ffffff 45%) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 200;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 4px 0 2px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.18);
}

.rpca-grade-score {
  color: rgba(255, 255, 255, 0.62);
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.rpca-hero-gauge-timestamp {
  color: rgba(255, 255, 255, 0.6);
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  margin-top: var(--space-2);
  text-align: center;
}

/* --- Category breakdown --------------------------------- */

.rpca-category-breakdown {
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--space-7);
}

.rpca-category-head {
  margin-bottom: var(--space-4);
}

.rpca-category-head h3 {
  color: var(--ink-900);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.005em;
  margin: 0 0 var(--space-2);
}

.rpca-category-list {
  display: grid;
  gap: var(--space-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.rpca-category-row {
  align-items: start;
  background: var(--surface-card-alt);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-soft);
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 56px 1fr;
  padding: var(--space-3) var(--space-4);
}

.rpca-category-row strong {
  color: var(--ink-900);
  display: block;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
}

.rpca-category-row small {
  color: var(--ink-500);
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.rpca-category-row .rpca-stat-card-tag {
  align-items: center;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  height: 32px;
  justify-content: center;
  margin-top: 2px;
  width: 56px;
}

/* --- FDA citation link on findings ---------------------- */

.rpca-finding-citation {
  align-items: center;
  background: var(--accent-rose-soft);
  border: 1px solid color-mix(in srgb, var(--accent-primary) 25%, transparent);
  border-radius: var(--radius-pill);
  color: var(--accent-deep);
  display: inline-flex;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  gap: 6px;
  letter-spacing: 0.04em;
  margin-top: var(--space-3);
  padding: 4px 9px;
  text-decoration: none;
}

.rpca-finding-citation:hover {
  background: var(--accent-rose);
  color: var(--accent-darker);
}

.rpca-finding-citation.is-ai-ok {
  background: var(--band-clear-soft);
  border-color: color-mix(in srgb, var(--band-clear) 35%, transparent);
  color: var(--band-clear);
}

.rpca-finding-citation.is-ai-confirmed {
  background: color-mix(in srgb, var(--band-red) 10%, #ffffff);
  border-color: color-mix(in srgb, var(--band-red) 32%, transparent);
  color: var(--band-red);
}

.rpca-finding-citation.is-ai-review {
  background: var(--accent-gold-soft);
  border-color: color-mix(in srgb, var(--accent-gold) 35%, transparent);
  color: var(--accent-amber-ink);
}

.rpca-finding-citation.is-coverage-review {
  background: #eef4f8;
  border-color: #c9d8e4;
  color: #243746;
}

.rpca-finding-citation.is-feedback-review {
  background: #f0f5f7;
  border-color: #c9d8e4;
  color: #243746;
}

/* --- Public trust badge (shortcode output) -------------- */

.rpca-trust-badge {
  align-items: center;
  background: linear-gradient(135deg, #ffffff 0%, var(--accent-rose-soft) 100%);
  border: 1px solid color-mix(in srgb, var(--accent-primary) 25%, transparent);
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
  color: var(--accent-deep);
  display: inline-flex;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  gap: var(--space-2);
  letter-spacing: 0.005em;
  padding: 6px 12px;
  text-decoration: none;
}

.rpca-trust-badge-mark {
  background: var(--hero-gradient);
  border-radius: 4px;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 6px;
}

.rpca-trust-badge-note {
  color: var(--ink-500);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  margin-left: 4px;
}

/* --- Processor-specific recommendations ----------------- */

.rpca-processor-recs {
  background:
    linear-gradient(135deg, var(--accent-gold-soft) 0%, var(--surface-card) 80%);
  border: 1px solid color-mix(in srgb, var(--accent-gold) 35%, transparent);
  border-left: 4px solid var(--accent-gold);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  margin: var(--space-5) 0;
  padding: var(--space-7);
}

.rpca-processor-recs-head {
  margin-bottom: var(--space-4);
}

.rpca-processor-recs-head h3 {
  color: var(--ink-900);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.005em;
  margin: 0 0 var(--space-2);
}

.rpca-processor-recs-head .rpca-eyebrow {
  color: var(--accent-amber-ink);
}

.rpca-processor-recs-head a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rpca-processor-rec-list {
  display: grid;
  gap: var(--space-3);
  list-style: none;
  margin: 0;
  padding: 0;
}

.rpca-processor-rec {
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  display: grid;
  gap: var(--space-2);
  padding: var(--space-5);
}

.rpca-processor-rec-head {
  align-items: start;
  display: flex;
  gap: var(--space-3);
}

.rpca-processor-rec-num {
  align-items: center;
  background: var(--accent-gold-soft);
  border: 1px solid color-mix(in srgb, var(--accent-gold) 35%, transparent);
  border-radius: 50%;
  color: var(--accent-amber-ink);
  display: inline-flex;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.rpca-processor-rec-head h4 {
  color: var(--ink-900);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1.35;
  margin: 4px 0 0;
}

.rpca-processor-rec-head .rpca-stat-card-tag {
  display: inline-block;
  margin-bottom: 6px;
}

.rpca-processor-rec-page,
.rpca-processor-rec-why {
  color: var(--ink-700);
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0;
}

.rpca-processor-rec-change {
  background: var(--surface-card-alt);
  border-left: 2px solid var(--accent-primary);
  border-radius: var(--radius-soft);
  color: var(--ink-800);
  font-size: 13.5px;
  line-height: 1.5;
  padding: var(--space-3) var(--space-4);
}

.rpca-processor-rec-change p {
  margin: 4px 0 0;
}

.rpca-section-divider-heading {
  border-top: 1px solid var(--border-soft);
  color: var(--ink-900);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.005em;
  margin: var(--space-8) 0 var(--space-2);
  padding-top: var(--space-6);
}

/* --- Empty / locked states ----------------------------- */

.rpca-empty-state {
  background: var(--surface-card);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-card);
  color: var(--ink-700);
  padding: var(--space-10);
  text-align: center;
}

.rpca-empty-state strong {
  color: var(--ink-900);
  display: block;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.005em;
  margin-bottom: var(--space-2);
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1100px) {
  .rpca-hero-card {
    grid-template-columns: 1fr;
    padding: var(--space-8);
  }

  .rpca-hero-gauge {
    align-items: flex-start;
  }
}

@media (max-width: 1023px) {
  .rpca-shell-grid {
    grid-template-columns: 1fr;
    padding-bottom: 72px;
  }

  .rpca-rail {
    background: var(--surface-card);
    border-right: 0;
    border-top: 1px solid var(--border-soft);
    bottom: 0;
    box-shadow: 0 -4px 12px -4px rgba(15, 23, 42, 0.08);
    color: var(--ink-700);
    display: flex;
    flex-direction: row;
    gap: 0;
    height: auto;
    left: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0;
    position: fixed;
    right: 0;
    top: auto;
    width: 100%;
    z-index: 9999;
  }

  .rpca-rail-eyebrow,
  .rpca-rail-tools,
  .rpca-setup-chip,
  .rpca-rail-item-glyph {
    display: none;
  }

  .rpca-rail-section {
    flex: 1 1 0;
    flex-direction: row;
    min-width: 0;
    width: auto;
  }

  .rpca-rail-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    width: 100%;
  }

  .rpca-rail-nav .rpca-rail-item {
    border-radius: 0;
    color: var(--ink-600);
    flex: 1 1 0;
    flex-direction: column;
    font-size: 10px;
    font-weight: 600;
    gap: 2px;
    justify-content: center;
    letter-spacing: 0.04em;
    min-height: 60px;
    min-width: 64px;
    padding: var(--space-1) var(--space-2);
    text-align: center;
    text-transform: uppercase;
  }

  .rpca-rail-item::before {
    border-radius: 2px;
    height: 3px;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 22px;
  }

  .rpca-rail-item:hover,
  .rpca-rail-item.is-active {
    background: var(--accent-rose-soft);
    color: var(--accent-deep);
  }

  .rpca-rail-item.is-active .rpca-rail-count {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #ffffff;
  }

  .rpca-topbar-meta {
    display: none;
  }

  .rpca-main {
    padding: var(--space-8) var(--space-4) calc(var(--space-16) + 60px);
  }

  .rpca-finding-main,
  .rpca-first-run-grid,
  .rpca-rewrite-grid {
    grid-template-columns: 1fr;
  }

  .rpca-confidence-label {
    text-align: left;
  }

  .rpca-payment-readiness {
    grid-template-columns: 1fr;
  }

  .rpca-finding-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .rpca-topbar {
    padding: 0 var(--space-3);
  }

  .rpca-topbar-tag,
  .rpca-topbar-search,
  .rpca-topbar-button {
    display: none;
  }

  .rpca-section-title-main {
    font-size: 1.6rem;
  }

  .rpca-hero-card {
    padding: var(--space-6);
  }

  .rpca-score {
    font-size: 3.4rem;
  }

  .rpca-checklist-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .rpca-score-line,
  .rpca-signal-row,
  .rpca-button-row {
    align-items: flex-start;
  }

  .rpca-button-row {
    flex-direction: column;
  }

  .rpca-button-row .rpca-button {
    width: 100%;
    justify-content: center;
  }

  .rpca-command,
  .rpca-modal {
    border-radius: 0;
    inset: 0;
    max-width: none;
    transform: none;
    width: auto;
  }

  .rpca-rail-nav .rpca-rail-item {
    font-size: 9px;
    min-width: 50px;
    padding: 4px 2px;
  }
}

/* ============================================================
   Dark theme adjustments
   ============================================================ */

[data-theme="dark"] .rpca-topbar {
  background: var(--surface-card);
  border-bottom-color: var(--border-soft);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .rpca-rail {
  background: var(--surface-card);
}

[data-theme="dark"] .rpca-button {
  background: var(--surface-card);
  color: var(--ink-900);
}

[data-theme="dark"] .rpca-button.is-primary,
[data-theme="dark"] .rpca-topbar-button {
  color: #ffffff;
}

[data-theme="dark"] .rpca-flagged-span {
  background: var(--accent-gold-soft);
  border-left-color: var(--accent-gold);
  color: var(--accent-gold);
}

[data-theme="dark"] .rpca-notice-card {
  background: var(--accent-gold-soft);
  border-color: color-mix(in srgb, var(--accent-gold) 35%, transparent);
  color: var(--accent-gold);
}

/* ============================================================
   Policies & COA section + page-planner chat (v0.7.231)
   ============================================================ */

.rpca-card-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  margin-bottom: var(--space-12);
}

.rpca-card-grid .rpca-editorial-card.is-active {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-primary) 25%, transparent);
}

.rpca-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.rpca-chat-bubble {
  align-items: center;
  background: var(--hero-gradient);
  border: 1px solid var(--accent-deep);
  border-radius: var(--radius-pill);
  bottom: var(--space-6);
  box-shadow: var(--shadow-red);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  gap: var(--space-2);
  padding: 12px 18px;
  position: fixed;
  right: var(--space-6);
  z-index: 850;
}

.rpca-chat-bubble:hover,
.rpca-chat-bubble:focus-visible {
  outline: none;
  transform: translateY(-1px);
}

.rpca-chat-bubble-dot {
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.25);
  display: inline-block;
  height: 8px;
  width: 8px;
  animation: rpca-chat-bubble-ping 1.6s ease-out infinite;
}

@keyframes rpca-chat-bubble-ping {
  0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.55); }
  70%  { box-shadow: 0 0 0 12px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.rpca-chat-panel {
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  bottom: var(--space-6);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  max-height: min(72vh, 640px);
  position: fixed;
  right: var(--space-6);
  width: min(420px, calc(100vw - 48px));
  z-index: 850;
}

.rpca-chat-header {
  align-items: center;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  gap: var(--space-3);
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
}

.rpca-chat-header h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.rpca-chat-thread {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: var(--space-3);
  overflow-y: auto;
  padding: var(--space-4);
}

.rpca-chat-msg {
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
}

.rpca-chat-msg.is-user {
  align-self: flex-end;
  background: var(--accent-soft);
  color: var(--accent-deep);
  max-width: 85%;
}

.rpca-chat-msg.is-assistant {
  align-self: flex-start;
  background: var(--paper-50);
  color: var(--ink-900);
  max-width: 85%;
}

.rpca-chat-role {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  opacity: 0.7;
  text-transform: uppercase;
}

.rpca-chat-msg p {
  margin: 0;
  white-space: pre-wrap;
}

.rpca-chat-busy {
  color: var(--ink-500);
  font-size: 12px;
  font-style: italic;
  margin: 0;
  text-align: center;
}

.rpca-chat-form {
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
}

.rpca-chat-form textarea {
  background: var(--paper-50);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  color: var(--ink-900);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 8px 10px;
  resize: vertical;
}

.rpca-chat-form textarea:focus {
  border-color: var(--accent-primary);
  outline: none;
}

.rpca-chat-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.rpca-chat-use {
  align-self: flex-start;
  font-size: 11px;
  margin-top: 6px;
  padding: 0;
  text-decoration: underline;
}

.rpca-chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: 8px;
}

.rpca-chat-actions .rpca-button {
  font-size: 12px;
}

.rpca-trigger-mark {
  background: var(--accent-gold-soft);
  border-bottom: 2px solid var(--accent-gold);
  border-radius: 3px;
  color: var(--ink-900);
  font-weight: 600;
  padding: 1px 4px;
}

.rpca-trigger-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rpca-trigger-list mark {
  font-size: 13px;
}

[data-theme="dark"] .rpca-trigger-mark {
  background: color-mix(in srgb, var(--accent-gold) 35%, transparent);
  color: var(--accent-gold);
}
