/* ============================================================
   Legacy admin styles (hidden when the shell is active).
   The shell is rendered into #rpca-ui-root; these rules only
   apply to the legacy markup inside #rpca-legacy-admin.
   ============================================================ */

.rpca-wrap {
  color: #1f1719;
  max-width: 1480px;
}

.rpca-legacy-admin {
  display: block;
}

.rpca-wrap * {
  box-sizing: border-box;
  letter-spacing: 0;
}

.rpca-wrap h1,
.rpca-wrap h2,
.rpca-wrap h3,
.rpca-wrap h4,
.rpca-wrap p {
  margin-top: 0;
}

.rpca-muted,
.rpca-empty,
.rpca-wrap small,
.rpca-section-title p,
.rpca-hero p,
.rpca-start p,
.rpca-next-step p {
  color: #5b6470;
}

.rpca-hero {
  align-items: center;
  background: #fff;
  border: 1px solid #d8dee5;
  border-left: 5px solid #8B2635;
  border-radius: 8px;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin: 18px 0;
  padding: 22px 24px;
}

.rpca-hero h1 {
  font-size: 26px;
  line-height: 1.25;
  margin: 0 0 8px;
}

.rpca-hero p {
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
  max-width: 760px;
}

.rpca-kicker {
  color: #8B2635;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.rpca-hero-badge {
  background: #f6f7f7;
  border: 1px solid #d8dee5;
  border-radius: 8px;
  min-width: 170px;
  padding: 12px 14px;
}

.rpca-hero-badge span {
  color: #5b6470;
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
}

.rpca-hero-badge strong {
  display: block;
  font-size: 15px;
}

.rpca-legal-notice {
  background: #fff8e5;
  border: 1px solid #dba617;
  border-left: 5px solid #b7791f;
  border-radius: 8px;
  color: #3b2f12;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  margin: 0 0 18px;
  padding: 12px 14px;
}

.rpca-start,
.rpca-panel,
.rpca-settings {
  background: #fff;
  border: 1px solid #d8dee5;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  padding: 18px;
}

.rpca-start {
  margin-bottom: 18px;
}

.rpca-workspace-tabs {
  align-items: center;
  background: #fff;
  border: 1px solid #d8dee5;
  border-radius: 8px;
  display: flex;
  gap: 8px;
  margin: 0 0 18px;
  padding: 8px;
}

.rpca-workspace-button {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #1d2327;
  cursor: pointer;
  font-weight: 700;
  padding: 10px 14px;
}

.rpca-workspace-button:hover,
.rpca-workspace-button:focus,
.rpca-workspace-button.is-active {
  background: #f9f0f2;
  border-color: #d9a7b0;
  color: #6B1827;
}

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

.rpca-workspace-panel.is-active {
  display: block;
}

.rpca-fda-intel {
  background: #f8faf8;
  border: 1px solid #cfd8cf;
  border-radius: 8px;
  margin: 14px 0;
  padding: 14px;
}

.rpca-fda-intel-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.rpca-fda-intel-head h3 {
  font-size: 16px;
  line-height: 1.35;
  margin: 0;
}

.rpca-fda-intel-head p {
  margin: 6px 0 0;
}

.rpca-fda-intel-meta {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 190px;
  text-align: right;
}

.rpca-fda-status {
  background: #eef7ef;
  border: 1px solid #9fc7a5;
  border-radius: 999px;
  color: #22552b;
  display: inline-flex;
  font-weight: 700;
  line-height: 1;
  padding: 6px 9px;
  text-transform: capitalize;
}

.rpca-fda-status.is-error,
.rpca-fda-status.is-partial {
  background: #fff6e8;
  border-color: #d8a444;
  color: #6f4300;
}

.rpca-fda-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.rpca-fda-grid div {
  background: #fff;
  border: 1px solid #dfe6df;
  border-radius: 8px;
  line-height: 1.45;
  padding: 10px;
}

.rpca-term-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.rpca-term-cloud span {
  background: #eef2f6;
  border: 1px solid #d5dde6;
  border-radius: 999px;
  color: #26394d;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 6px 8px;
}

.rpca-fda-details {
  background: #fff;
  border: 1px solid #dfe6df;
  border-radius: 8px;
  margin-top: 10px;
  padding: 10px 12px;
}

.rpca-fda-details summary {
  cursor: pointer;
  font-weight: 700;
}

.rpca-fda-details ul {
  display: grid;
  gap: 10px;
  margin: 10px 0 0;
  padding-left: 18px;
}

.rpca-fda-details li span {
  color: #5b6470;
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.rpca-fda-details li p {
  margin: 4px 0 0;
}

.rpca-fda-errors {
  background: #fff8e5;
  border: 1px solid #f0c36d;
  border-radius: 8px;
  margin-top: 10px;
  padding: 10px 12px;
}

.rpca-start h2,
.rpca-section-title h2,
.rpca-panel h2 {
  font-size: 18px;
  line-height: 1.3;
  margin: 0;
}

.rpca-steps {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 14px;
}

.rpca-steps div {
  border: 1px solid #e3e7ec;
  border-radius: 8px;
  padding: 14px;
}

.rpca-steps span {
  align-items: center;
  background: #8B2635;
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  height: 24px;
  justify-content: center;
  margin-bottom: 10px;
  width: 24px;
}

.rpca-steps strong {
  display: block;
  margin-bottom: 6px;
}

.rpca-steps p {
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

.rpca-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.75fr);
  gap: 18px;
  margin: 18px 0;
}

.rpca-panel-head {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.rpca-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.rpca-actions .button,
.rpca-chat-input .button {
  min-height: 36px;
}

.rpca-status {
  background: #f6f7f7;
  border-left: 4px solid #c3c4c7;
  border-radius: 6px;
  margin-bottom: 14px;
  min-height: 36px;
  padding: 9px 12px;
}

.rpca-status:empty {
  display: none;
}

.rpca-status.is-busy {
  background: #f9f0f2;
  border-left-color: #8B2635;
}

.rpca-status.is-success {
  background: #eef8f1;
  border-left-color: #2a7f3f;
}

.rpca-status.is-error {
  background: #fcf0f1;
  border-left-color: #b32d2e;
}

.rpca-empty-state,
.rpca-next-step,
.rpca-readiness,
.rpca-history {
  background: #f8fafc;
  border: 1px solid #dce3eb;
  border-radius: 8px;
  margin-bottom: 16px;
  padding: 14px;
}

.rpca-empty-state p,
.rpca-next-step p {
  line-height: 1.5;
  margin: 6px 0 0;
}

.rpca-addendum-dashboard {
  margin: 16px 0;
}

.rpca-addendum-overview {
  background: #fff;
  border: 1px solid #dce3eb;
  border-radius: 8px;
  padding: 14px;
}

.rpca-gauge-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.rpca-gauge {
  background: #f8fafc;
  border: 1px solid #dce3eb;
  border-radius: 8px;
  padding: 12px;
}

.rpca-gauge span {
  color: #526170;
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.rpca-gauge strong {
  color: #18212b;
  display: block;
  font-size: 24px;
  margin-top: 6px;
}

.rpca-defensibility-note {
  color: #3c4651;
  margin: 12px 0 0;
}

.rpca-module-tabs {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
}

.rpca-module-tabs details {
  background: #f8fafc;
  border: 1px solid #dce3eb;
  border-radius: 8px;
  padding: 10px;
}

.rpca-module-tabs summary {
  cursor: pointer;
  font-weight: 700;
}

.rpca-module-tabs ul {
  margin: 8px 0 0;
}

.rpca-module-tabs li {
  border-top: 1px solid #e4e7eb;
  list-style: none;
  margin: 0;
  padding: 7px 0;
}

.rpca-module-tabs li span {
  color: #526170;
  display: block;
  font-size: 11px;
  font-weight: 700;
}

.rpca-readiness summary,
.rpca-history summary {
  cursor: pointer;
  font-weight: 700;
}

.rpca-readiness-score {
  align-items: center;
  display: flex;
  gap: 10px;
  margin: 12px 0;
}

.rpca-readiness-score strong {
  background: #8B2635;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 14px;
  padding: 7px 10px;
}

.rpca-readiness ul {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 10px 0;
}

.rpca-readiness li {
  background: #fff;
  border: 1px solid #e4e7eb;
  border-radius: 6px;
  line-height: 1.4;
  list-style: none;
  margin: 0;
  padding: 9px;
}

.rpca-readiness li span {
  border-radius: 999px;
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  margin-right: 6px;
  padding: 4px 7px;
  text-transform: uppercase;
}

.rpca-readiness li.is-pass span {
  background: #e7f6ed;
  color: #1f6f37;
}

.rpca-readiness li.is-fail span {
  background: #fff1c2;
  color: #5f4200;
}

.rpca-readiness-actions {
  background: #fff;
  border: 1px solid #dce3eb;
  border-radius: 8px;
  margin-top: 12px;
  padding: 12px;
}

.rpca-readiness-actions h4 {
  font-size: 14px;
  margin: 0 0 10px;
}

.rpca-readiness-actions p {
  color: #3c4651;
  margin: 6px 0;
}

.rpca-readiness-action {
  border-top: 1px solid #eef1f5;
  padding: 10px 0 2px;
}

.rpca-readiness-action:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.rpca-readiness-action-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rpca-action-priority {
  background: #243746;
  border-radius: 999px;
  color: #fff;
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  text-transform: uppercase;
}

.rpca-action-owner {
  color: #526170;
  font-size: 12px;
  font-weight: 700;
  margin-top: 6px;
}

.rpca-action-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.rpca-action-evidence span {
  background: #eef4f8;
  border: 1px solid #c9d8e4;
  border-radius: 999px;
  color: #243746;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
}

.rpca-history table {
  border-collapse: collapse;
  margin-top: 12px;
  width: 100%;
}

.rpca-history th,
.rpca-history td {
  border-bottom: 1px solid #e4e7eb;
  padding: 8px;
  text-align: left;
  vertical-align: middle;
}

.rpca-summary {
  background: #fbfcfd;
  border: 1px solid #dce3eb;
  border-radius: 8px;
  margin-bottom: 14px;
  padding: 16px;
}

.rpca-summary > div:first-child {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.rpca-summary > p {
  color: #3c4651;
  margin: 0 0 14px;
}

.rpca-summary dl {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, minmax(76px, 1fr));
  margin: 14px 0 8px;
}

.rpca-summary dl div {
  background: #fff;
  border: 1px solid #e4e7eb;
  border-radius: 6px;
  padding: 9px;
}

.rpca-summary dt {
  color: #5b6470;
  font-size: 12px;
  margin-bottom: 2px;
}

.rpca-summary dd {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}

.rpca-rule-provenance {
  background: #fff;
  border: 1px solid #dce3eb;
  border-radius: 8px;
  margin: 0 0 14px;
  padding: 14px;
}

.rpca-rule-provenance h3 {
  font-size: 16px;
  margin: 2px 0 10px;
}

.rpca-rule-provenance dl {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 10px;
}

.rpca-rule-provenance dl div {
  border: 1px solid #e4e7eb;
  border-radius: 6px;
  padding: 8px;
}

.rpca-rule-provenance dt {
  color: #5b6470;
  font-size: 12px;
}

.rpca-rule-provenance dd {
  font-weight: 700;
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.rpca-badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 7px 9px;
  text-transform: uppercase;
}

.rpca-badge-critical {
  background: #b32d2e;
  color: #fff;
}

.rpca-badge-high {
  background: #b85c00;
  color: #fff;
}

.rpca-badge-medium {
  background: #fff1c2;
  color: #5f4200;
}

.rpca-badge-low {
  background: #e8f3ff;
  color: #6B1827;
}

.rpca-badge-clear {
  background: #e7f6ed;
  color: #1f6f37;
}

.rpca-ai {
  background: #f8fafc;
  border: 1px solid #dce3eb;
  border-radius: 8px;
  margin-bottom: 18px;
  padding: 16px;
}

.rpca-ai h3,
.rpca-ai h4 {
  margin: 0 0 8px;
}

.rpca-ai p,
.rpca-ai li {
  line-height: 1.55;
}

.rpca-ai pre {
  background: #fff;
  border: 1px solid #e4e7eb;
  border-radius: 6px;
  margin: 8px 0 0;
  padding: 12px;
  white-space: pre-wrap;
}

.rpca-ai-readable {
  background: #fff;
  border: 1px solid #e4e7eb;
  border-radius: 8px;
  padding: 12px 14px;
}

.rpca-ai-readable p {
  margin: 0 0 10px;
}

.rpca-ai-readable p:last-child {
  margin-bottom: 0;
}

.rpca-ai-review {
  background: #fff;
  border: 1px solid #cfd8e3;
  border-left: 4px solid #8B2635;
  border-radius: 8px;
  margin-top: 16px;
  padding: 14px;
}

.rpca-ai-review-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.rpca-ai-review h4 {
  font-size: 16px;
}

.rpca-ai-review-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.rpca-ai-review-badges span {
  background: #f9f0f2;
  border: 1px solid #c7e0f4;
  border-radius: 999px;
  color: #1d4f73;
  font-size: 12px;
  line-height: 1.35;
  padding: 5px 8px;
}

.rpca-ai-review-list {
  border-top: 1px solid #edf0f3;
  padding: 10px 0 0;
}

.rpca-ai-review-list summary {
  cursor: pointer;
  font-weight: 700;
}

.rpca-ai-review-list ul {
  margin-bottom: 0;
}

.rpca-warnings {
  background: #fff8e5;
  border: 1px solid #e0c36f;
  border-radius: 8px;
  margin-bottom: 16px;
  padding: 14px;
}

.rpca-warnings h3 {
  margin: 0 0 8px;
}

.rpca-warnings ul {
  margin-bottom: 0;
}

.rpca-findings {
  display: grid;
  gap: 12px;
}

.rpca-finding {
  border: 1px solid #d8dee5;
  border-radius: 8px;
  padding: 14px;
}

.rpca-finding-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 8px;
}

.rpca-finding a {
  display: inline-block;
  margin-bottom: 6px;
}

.rpca-finding small {
  display: block;
  margin-bottom: 8px;
}

.rpca-finding p {
  line-height: 1.5;
  margin: 8px 0;
}

.rpca-finding blockquote {
  background: #f6f7f7;
  border-left: 3px solid #8c8f94;
  margin: 8px 0 0;
  padding: 9px 11px;
}

.rpca-finding-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.rpca-finding-meta span {
  background: #eef4f8;
  border: 1px solid #c9d8e4;
  border-radius: 999px;
  color: #243746;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
}

.rpca-fix-card {
  background: #fbfcfd;
  border: 1px solid #dce3eb;
  border-radius: 8px;
  margin-top: 12px;
  padding: 12px;
}

.rpca-fix-card p {
  color: #3c4651;
  margin: 6px 0 10px;
}

.rpca-fix-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rpca-fix-ready,
.rpca-fix-manual {
  color: #5b6470;
  font-size: 12px;
}

.rpca-fix-drawer {
  background: #fff;
  border: 1px solid #c8d1dc;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.16);
  max-height: calc(100vh - 70px);
  max-width: 760px;
  overflow: auto;
  padding: 16px;
  position: fixed;
  right: 24px;
  top: 46px;
  transition: transform 0.18s ease, opacity 0.18s ease;
  width: calc(100vw - 56px);
  z-index: 100000;
}

.rpca-fix-drawer.is-collapsed {
  opacity: 0;
  pointer-events: none;
  transform: translateX(40px);
}

.rpca-fix-drawer-head {
  align-items: flex-start;
  border-bottom: 1px solid #e3e7ec;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
}

.rpca-fix-drawer-head h2 {
  font-size: 18px;
  margin: 0;
}

.rpca-fix-overview {
  background: #f8fafc;
  border: 1px solid #dce3eb;
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 12px;
}

.rpca-fix-overview p {
  line-height: 1.5;
  margin: 6px 0 0;
}

.rpca-fix-warning {
  color: #6b4d00;
}

.rpca-fix-changes,
.rpca-field-preview,
.rpca-preview-stack {
  border: 1px solid #dce3eb;
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
}

.rpca-fix-changes summary,
.rpca-field-preview summary,
.rpca-preview-stack summary {
  cursor: pointer;
  font-weight: 700;
}

.rpca-fix-changes ul {
  margin-bottom: 0;
}

.rpca-fix-changes li {
  line-height: 1.5;
  margin-bottom: 8px;
}

.rpca-field-preview-row {
  border-top: 1px solid #edf0f3;
  padding: 10px 0;
}

.rpca-field-preview-row:first-of-type {
  border-top: 0;
}

.rpca-field-preview-row dl {
  display: grid;
  gap: 6px 10px;
  grid-template-columns: 72px minmax(0, 1fr);
  margin: 8px 0 0;
}

.rpca-field-preview-row dt {
  color: #5b6470;
  font-weight: 700;
}

.rpca-field-preview-row dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.rpca-preview-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.rpca-preview-grid h3 {
  font-size: 14px;
  margin: 0 0 8px;
}

.rpca-preview-grid iframe {
  background: #fff;
  border: 1px solid #d8dee5;
  border-radius: 6px;
  height: 360px;
  width: 100%;
}

.rpca-fix-footer {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

.rpca-chat-panel {
  min-height: 560px;
}

.rpca-chat-log {
  background: #f8fafc;
  border: 1px solid #d8dee5;
  border-radius: 8px;
  height: 420px;
  overflow: auto;
  padding: 12px;
}

.rpca-chat-message {
  margin-bottom: 12px;
  max-width: 94%;
}

.rpca-chat-message span {
  color: #5b6470;
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
}

.rpca-chat-message p {
  background: #fff;
  border: 1px solid #d8dee5;
  border-radius: 8px;
  line-height: 1.5;
  margin: 0;
  padding: 10px;
  white-space: pre-wrap;
}

.rpca-chat-message.is-user {
  margin-left: auto;
}

.rpca-chat-message.is-user p {
  background: #e8f3ff;
  border-color: #d9a7b0;
}

.rpca-chat-input {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 10px;
}

.rpca-chat-input textarea {
  min-height: 78px;
  resize: vertical;
  width: 100%;
}

.rpca-setup-guide {
  align-items: start;
  background: #f8fafc;
  border: 1px solid #d8dee5;
  border-radius: 8px;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.45fr);
  margin-bottom: 16px;
  padding: 16px;
}

.rpca-setup-guide h2 {
  font-size: 18px;
  line-height: 1.3;
  margin: 0 0 6px;
}

.rpca-setup-guide p,
.rpca-help-note p,
.rpca-tutorial-grid p {
  color: #5b6470;
  line-height: 1.5;
  margin: 0;
}

.rpca-setup-guide ol {
  counter-reset: rpca-guide;
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.rpca-setup-guide li {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 26px 1fr;
  margin: 0;
}

.rpca-setup-guide li::before {
  align-items: center;
  background: #8B2635;
  border-radius: 50%;
  color: #ffffff;
  content: counter(rpca-guide);
  counter-increment: rpca-guide;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.rpca-tabs {
  border-bottom: 1px solid #d8dee5;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 18px;
}

.rpca-tab-button {
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  color: #3c434a;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  min-height: 42px;
  padding: 10px 12px 9px;
}

.rpca-tab-button:hover,
.rpca-tab-button:focus {
  color: #135e96;
  outline: 2px solid transparent;
}

.rpca-tab-button.is-active {
  border-bottom-color: #8B2635;
  color: #6B1827;
}

.rpca-tab-panel {
  display: none;
}

.rpca-tab-panel.is-active {
  display: block;
}

.rpca-tutorial-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  margin-bottom: 16px;
}

.rpca-tutorial-grid section {
  border: 1px solid #d8dee5;
  border-radius: 8px;
  padding: 14px;
}

.rpca-tutorial-grid span {
  align-items: center;
  background: #8B2635;
  border-radius: 50%;
  color: #ffffff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  height: 24px;
  justify-content: center;
  margin-bottom: 10px;
  width: 24px;
}

.rpca-tutorial-grid h3 {
  font-size: 15px;
  line-height: 1.35;
  margin: 0 0 6px;
}

.rpca-help-note {
  background: #fff8e5;
  border: 1px solid #f0c36d;
  border-radius: 8px;
  padding: 12px 14px;
}

.rpca-help-note strong {
  display: block;
  margin-bottom: 4px;
}

.rpca-section-title {
  margin-bottom: 16px;
}

.rpca-section-title p {
  line-height: 1.5;
  margin: 6px 0 0;
}

.rpca-settings-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  margin-bottom: 18px;
}

.rpca-settings label span,
.rpca-field > span,
.rpca-wide span {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.rpca-settings input[type="number"],
.rpca-settings input[type="email"],
.rpca-settings input[type="password"],
.rpca-settings input[type="text"],
.rpca-settings input[type="url"],
.rpca-settings select,
.rpca-settings textarea {
  border-color: #c8d1dc;
  max-width: 100%;
  width: 100%;
}

.rpca-settings input[type="color"] {
  border: 1px solid #c8d1dc;
  border-radius: 6px;
  cursor: pointer;
  height: 38px;
  max-width: 96px;
  padding: 2px;
  width: 96px;
}

.rpca-settings input:focus,
.rpca-settings select:focus,
.rpca-settings textarea:focus,
.rpca-chat-input textarea:focus {
  border-color: #8B2635;
  box-shadow: 0 0 0 1px #8B2635;
}

.rpca-inline {
  align-items: center;
  display: flex;
  gap: 8px;
  padding-top: 25px;
}

.rpca-inline span,
.rpca-check span,
.rpca-subcheck span {
  display: inline;
  font-weight: 400;
  margin: 0;
}

.rpca-subcheck {
  align-items: center;
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.rpca-columns {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  margin-bottom: 18px;
}

.rpca-columns fieldset {
  border: 1px solid #d8dee5;
  border-radius: 8px;
  margin: 0;
  padding: 12px 14px;
}

.rpca-columns legend {
  font-weight: 700;
  padding: 0 6px;
}

.rpca-check {
  display: block;
  margin: 8px 0;
}

.rpca-wide {
  display: block;
  margin-bottom: 16px;
}

@media (max-width: 1100px) {
  .rpca-hero,
  .rpca-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .rpca-layout,
  .rpca-setup-guide,
  .rpca-settings-grid,
  .rpca-columns,
  .rpca-steps,
  .rpca-tutorial-grid,
  .rpca-preview-grid {
    grid-template-columns: 1fr;
  }

  .rpca-actions {
    justify-content: flex-start;
  }

  .rpca-workspace-tabs {
    align-items: stretch;
    flex-direction: column;
  }

  .rpca-ai-review-head {
    flex-direction: column;
  }

  .rpca-fda-intel-head {
    flex-direction: column;
  }

  .rpca-fda-intel-meta {
    align-items: flex-start;
    min-width: 0;
    text-align: left;
  }

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

  .rpca-ai-review-badges {
    justify-content: flex-start;
  }

  .rpca-summary dl {
    grid-template-columns: repeat(2, minmax(70px, 1fr));
  }

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

  .rpca-fix-drawer {
    left: 12px;
    max-height: calc(100vh - 48px);
    right: 12px;
    top: 36px;
    width: auto;
  }
}

@media (max-width: 640px) {
  .rpca-summary dl,
  .rpca-chat-input {
    grid-template-columns: 1fr;
  }
}

/* ===========================================================
   Dedicated age-gate setup page (v0.7.250).
   Renders at admin.php?page=ruo-cg-age-gate as its own focused
   walkthrough rather than as a tab inside the cockpit SPA.
   =========================================================== */
.rpca-age-gate-page {
  max-width: 1280px;
}
.rpca-age-gate-page-header {
  align-items: flex-start;
  background: var(--rpca-surface, #fff);
  border: 1px solid var(--rpca-border, #d1d5db);
  border-radius: 12px;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr) auto;
  margin: 12px 0 20px;
  padding: 20px 24px;
}
.rpca-age-gate-page-header h1 {
  font-size: 22px;
  margin: 4px 0 8px;
}
.rpca-age-gate-page-lede {
  color: var(--rpca-text-soft, #4b5563);
  font-size: 13px;
  margin: 0;
}
.rpca-age-gate-page-status {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
}
.rpca-age-gate-pill {
  border-radius: 999px;
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 6px 14px;
  text-transform: uppercase;
}
.rpca-age-gate-pill-on {
  background: #dcfce7;
  color: #166534;
}
.rpca-age-gate-pill-off {
  background: #fee2e2;
  color: #991b1b;
}
.rpca-age-gate-pill-detail {
  color: var(--rpca-text-soft, #4b5563);
  font-size: 12px;
  max-width: 260px;
}
.rpca-age-gate-page-back {
  align-self: flex-start;
}

.rpca-age-gate-page-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
}
@media (max-width: 1100px) {
  .rpca-age-gate-page-grid {
    grid-template-columns: 1fr;
  }
}

.rpca-age-gate-page-form {
  display: grid;
  gap: 20px;
}
.rpca-age-gate-step {
  background: var(--rpca-surface, #fff);
  border: 1px solid var(--rpca-border, #d1d5db);
  border-radius: 12px;
  padding: 20px 24px;
}
.rpca-age-gate-step-head {
  align-items: flex-start;
  display: grid;
  gap: 14px;
  grid-template-columns: 44px minmax(0, 1fr);
  margin-bottom: 14px;
}
.rpca-age-gate-step-number {
  align-items: center;
  background: var(--rpca-accent, #3F8A4F);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 16px;
  font-weight: 700;
  height: 36px;
  justify-content: center;
  width: 36px;
}
.rpca-age-gate-step h2 {
  font-size: 16px;
  margin: 0 0 4px;
}
.rpca-age-gate-step-head p {
  color: var(--rpca-text-soft, #4b5563);
  font-size: 13px;
  margin: 0;
}
.rpca-age-gate-step fieldset {
  border: none;
  display: grid;
  gap: 12px;
  padding: 0;
}
.rpca-age-gate-step .rpca-check {
  align-items: center;
  display: flex;
  gap: 8px;
}

.rpca-age-gate-page-side {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 60px;
  align-self: flex-start;
}
.rpca-age-gate-preview-card {
  background: var(--rpca-surface, #fff);
  border: 1px solid var(--rpca-border, #d1d5db);
  border-radius: 12px;
  overflow: hidden;
}
.rpca-age-gate-preview-card > header {
  border-bottom: 1px solid var(--rpca-border, #d1d5db);
  padding: 16px 20px;
}
.rpca-age-gate-preview-card > header h2 {
  font-size: 15px;
  margin: 4px 0 0;
}
.rpca-age-gate-preview-stage {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 320px;
  padding: 24px;
}
.rpca-age-gate-preview-box {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.25);
  text-align: center;
  width: 100%;
}
.rpca-age-gate-preview-logo {
  display: block;
  height: auto;
  margin: 0 auto 12px;
  max-height: 80px;
  max-width: 160px;
  width: auto;
}
.rpca-age-gate-preview-box h3 {
  font-size: 17px;
  margin: 0 0 8px;
}
.rpca-age-gate-preview-box p {
  color: var(--rpca-text-soft, #4b5563);
  font-size: 13px;
  margin: 0 0 14px;
}
.rpca-age-gate-preview-actions {
  display: grid;
  gap: 8px;
}
.rpca-age-gate-preview-actions button {
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: default;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
}
.rpca-age-gate-preview-accept {
  color: #fff;
}
.rpca-age-gate-preview-dob {
  background: transparent;
  border-color: var(--rpca-border, #d1d5db);
  color: var(--rpca-text, #111827);
}
.rpca-age-gate-preview-decline {
  background: transparent;
  border-color: transparent;
  color: var(--rpca-text-soft, #6b7280);
  text-decoration: underline;
}

.rpca-age-gate-preview-tips {
  background: var(--rpca-surface, #fff);
  border: 1px solid var(--rpca-border, #d1d5db);
  border-radius: 12px;
  padding: 16px 20px;
}
.rpca-age-gate-preview-tips h3 {
  font-size: 14px;
  margin: 0 0 8px;
}
.rpca-age-gate-preview-tips ul {
  color: var(--rpca-text-soft, #4b5563);
  font-size: 12px;
  list-style: disc;
  margin: 0;
  padding-left: 20px;
}
.rpca-age-gate-preview-tips li + li {
  margin-top: 6px;
}

.rpca-age-gate-dedicated-link {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0 0;
}
.rpca-age-gate-dedicated-link small {
  color: var(--rpca-text-soft, #4b5563);
}

/* v0.7.346: Experimental-feature framing for the Gemini AI gate.
 * The deterministic scanner is the primary defense; Gemini is opt-in. */
.rpca-experimental-callout {
  background: #fef9c3;
  border: 1px solid #facc15;
  border-left: 4px solid #d97706;
  border-radius: 6px;
  color: #78350f;
  margin: 12px 0;
  padding: 12px 14px;
}
.rpca-experimental-callout strong {
  color: #78350f;
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
}
.rpca-experimental-callout p {
  color: #78350f;
  font-size: 12px;
  line-height: 1.5;
  margin: 0 0 6px;
}
.rpca-experimental-callout p:last-child {
  margin-bottom: 0;
}
.rpca-experimental-badge {
  background: #d97706;
  border-radius: 3px;
  color: #fff;
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-left: 6px;
  padding: 1px 6px;
  text-transform: uppercase;
  vertical-align: middle;
}
