.r2-platform-page,
.r2-dev-page {
  display: grid;
  gap: var(--r2-space-5, 24px);
}

.r2-page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.r2-page-heading h1 {
  margin: 4px 0 8px;
  font-size: clamp(1.8rem, 2.4vw, 2.55rem);
  line-height: 1.08;
}

.r2-page-heading p { margin: 0; max-width: 720px; color: var(--r2-color-text-muted); }
.r2-page-heading--technical h1 { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: -0.04em; }
.r2-eyebrow { color: var(--r2-color-accent-strong); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.r2-heading-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

.r2-platform-tabs,
.r2-dev-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--r2-color-border);
  scrollbar-width: thin;
}

.r2-platform-tabs a,
.r2-dev-tabs a {
  flex: 0 0 auto;
  padding: 11px 14px;
  color: var(--r2-color-text-muted);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  font-weight: 650;
}

.r2-platform-tabs a:hover,
.r2-dev-tabs a:hover,
.r2-platform-tabs a.is-active,
.r2-dev-tabs a.is-active {
  color: var(--r2-color-text);
  border-bottom-color: var(--r2-color-accent);
}

.r2-platform-next,
.r2-dev-next {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 20px 22px;
  background: var(--r2-color-surface-accent);
  border-left: 4px solid var(--r2-color-accent);
}
.r2-dev-next { background: #eef3f8; border-left-color: #173a5e; }
.r2-platform-next span,
.r2-dev-next span { display: block; color: var(--r2-color-text-muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.r2-platform-next h2,
.r2-dev-next h2 { margin: 4px 0; font-size: 1.2rem; }
.r2-platform-next p,
.r2-dev-next p { margin: 0; color: var(--r2-color-text-muted); }

.r2-metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--r2-color-border);
  background: var(--r2-color-surface);
}
.r2-metric-strip > div { padding: 18px 20px; border-right: 1px solid var(--r2-color-border); }
.r2-metric-strip > div:last-child { border-right: 0; }
.r2-metric-strip span { display: block; color: var(--r2-color-text-muted); font-size: .82rem; }
.r2-metric-strip strong { display: block; margin-top: 6px; font-size: 1.75rem; line-height: 1; }
.r2-metric-strip--technical strong { font-size: 1.15rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.r2-platform-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 20px; align-items: start; }
.r2-platform-grid--products,
.r2-platform-grid--subjects { grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); }
.r2-panel { min-width: 0; border: 1px solid var(--r2-color-border); background: var(--r2-color-surface); }
.r2-panel--sticky { position: sticky; top: 88px; }
.r2-panel__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--r2-color-border); }
.r2-panel__head h2 { margin: 0 0 4px; font-size: 1.05rem; }
.r2-panel__head p { margin: 0; color: var(--r2-color-text-muted); font-size: .9rem; }
.r2-panel__head > a,
.r2-link { color: var(--r2-color-accent-strong); font-weight: 700; text-decoration: none; }
.r2-panel__footer { display: flex; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--r2-color-border); }
.r2-search { width: min(260px, 100%); min-height: 38px; }

.r2-compact-list { display: grid; }
.r2-compact-list > a { display: flex; justify-content: space-between; gap: 16px; padding: 15px 20px; border-bottom: 1px solid var(--r2-color-border); color: inherit; text-decoration: none; }
.r2-compact-list > a:last-child { border-bottom: 0; }
.r2-compact-list > a:hover { background: var(--r2-color-surface-subtle); }
.r2-compact-list strong,
.r2-compact-list small { display: block; }
.r2-compact-list small { margin-top: 4px; color: var(--r2-color-text-muted); }
.r2-product-summary { display: grid; }
.r2-product-summary > div { display: flex; justify-content: space-between; gap: 12px; padding: 15px 20px; border-bottom: 1px solid var(--r2-color-border); }
.r2-product-summary > div:last-child { border-bottom: 0; }
.r2-product-summary strong { font-size: 1.25rem; }

.r2-table-wrap { overflow-x: auto; }
.r2-table { width: 100%; border-collapse: collapse; }
.r2-table th,
.r2-table td { padding: 13px 16px; border-bottom: 1px solid var(--r2-color-border); text-align: left; vertical-align: top; }
.r2-table th { background: var(--r2-color-surface-subtle); color: var(--r2-color-text-muted); font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.r2-table tbody tr:last-child td { border-bottom: 0; }
.r2-table strong,
.r2-table small { display: block; }
.r2-table small { margin-top: 4px; color: var(--r2-color-text-muted); }
.r2-table--technical td { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88rem; }
.r2-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.r2-product-toggle-form { display: grid; gap: 10px; }
.r2-product-toggle-form > div { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.r2-product-toggle-form label { display: inline-flex; align-items: center; gap: 7px; font-size: .88rem; }

.r2-status { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 9px; border-radius: 999px; font-size: .78rem; font-weight: 750; }
.r2-status--success { background: #e6f2eb; color: #1f5a3b; }
.r2-status--danger { background: #fbe9e7; color: #8a2e25; }
.r2-menu { position: relative; }
.r2-menu summary { cursor: pointer; list-style: none; font-size: 1.25rem; font-weight: 800; }
.r2-menu summary::-webkit-details-marker { display: none; }
.r2-menu > div { position: absolute; z-index: 10; right: 0; top: calc(100% + 6px); min-width: 160px; padding: 8px; border: 1px solid var(--r2-color-border); background: var(--r2-color-surface); box-shadow: 0 12px 30px rgba(20, 35, 45, .14); }
.r2-menu button { width: 100%; border: 0; background: transparent; color: #9b2c2c; padding: 8px; text-align: left; cursor: pointer; }

.r2-role-product-form { display: grid; }
.r2-platform-switch {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}
.r2-platform-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}
.r2-platform-switch__track {
    position: relative;
    width: 38px;
    height: 22px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #c8d0d5;
    transition: background-color .15s ease;
}
.r2-platform-switch__track::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    content: "";
    transition: transform .15s ease;
}
.r2-platform-switch input:checked + .r2-platform-switch__track {
    background: var(--r2-color-accent);
}
.r2-platform-switch input:checked + .r2-platform-switch__track::after {
    transform: translateX(16px);
}
.r2-platform-switch input:focus-visible + .r2-platform-switch__track {
    outline: 2px solid var(--r2-focus-color);
    outline-offset: 2px;
}

.r2-subject-list { display: grid; }
.r2-subject-list article { display: flex; justify-content: space-between; gap: 16px; padding: 15px 20px; border-bottom: 1px solid var(--r2-color-border); }
.r2-subject-list article:last-child { border-bottom: 0; }
.r2-subject-list strong,
.r2-subject-list small { display: block; }
.r2-subject-list small { margin-top: 4px; color: var(--r2-color-text-muted); }
.r2-form-stack { display: grid; gap: 16px; padding: 18px 20px; }
.r2-form-stack label { display: grid; gap: 7px; font-weight: 650; }
.r2-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.r2-form-stack fieldset { border: 0; padding: 0; margin: 0; }
.r2-form-stack legend { margin-bottom: 8px; font-weight: 750; }
.r2-check-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px 12px; }
.r2-check-grid label { display: flex; align-items: center; gap: 6px; font-weight: 500; }

.r2-dev-tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.r2-dev-tool-grid a { display: grid; gap: 5px; min-height: 112px; padding: 18px; border: 1px solid #c8d2dc; background: #f7f9fb; color: #172b3c; text-decoration: none; }
.r2-dev-tool-grid a:hover { border-color: #46647d; background: #eef3f8; }
.r2-dev-tool-grid strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.r2-dev-tool-grid span { color: #5f7180; font-size: .88rem; }

.r2-empty { padding: 20px; color: var(--r2-color-text-muted); text-align: center; }

.auth-page .auth-main { max-width: 1180px; padding-top: 5vh; }
.r2-auth-shell { min-height: 78vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, .7fr); align-items: center; gap: clamp(36px, 8vw, 96px); }
.r2-auth-brand { display: grid; gap: 18px; }
.r2-auth-brand img { width: 180px; max-height: 64px; object-fit: contain; object-position: left center; }
.r2-auth-brand h1 { margin: 0; font-size: clamp(2.2rem, 5vw, 4rem); line-height: .98; letter-spacing: -.045em; }
.r2-auth-brand p { margin: 0; max-width: 620px; color: var(--r2-color-text-muted); font-size: 1.05rem; }
.r2-auth-points { display: grid; gap: 9px; margin-top: 6px; }
.r2-auth-points span::before { content: "✓"; margin-right: 9px; color: var(--r2-color-accent-strong); font-weight: 800; }
.r2-auth-card { border: 1px solid var(--r2-color-border); background: var(--r2-color-surface); padding: 28px; box-shadow: 0 18px 55px rgba(26, 44, 56, .10); }
.r2-auth-card h2 { margin: 0 0 6px; }
.r2-auth-card > p { margin: 0 0 22px; color: var(--r2-color-text-muted); }
.r2-auth-form { display: grid; gap: 14px; }
.r2-auth-form label { display: grid; gap: 7px; font-weight: 700; }
.r2-auth-links { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; margin-top: 6px; }
.r2-auth-links a { color: var(--r2-color-accent-strong); text-decoration: none; font-weight: 650; }
.r2-access-state { max-width: 700px; margin: 9vh auto; padding: 36px; border-left: 5px solid #a33a2d; background: var(--r2-color-surface); }
.r2-access-state strong { display: block; color: #a33a2d; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }
.r2-access-state h1 { margin: 8px 0 12px; }

@media (max-width: 980px) {
  .r2-platform-grid,
  .r2-platform-grid--products,
  .r2-platform-grid--subjects,
  .r2-auth-shell { grid-template-columns: 1fr; }
  .r2-panel--sticky { position: static; }
  .r2-dev-tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .r2-page-heading,
  .r2-platform-next,
  .r2-dev-next { flex-direction: column; align-items: stretch; }
  .r2-heading-actions { justify-content: flex-start; }
  .r2-metric-strip { grid-template-columns: 1fr 1fr; }
  .r2-metric-strip > div:nth-child(2) { border-right: 0; }
  .r2-metric-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--r2-color-border); }
  .r2-dev-tool-grid { grid-template-columns: 1fr; }
  .r2-form-row { grid-template-columns: 1fr; }
  .r2-check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .r2-auth-card { padding: 22px; }
}

/* Batch 43A: developer incident diagnostics */
.r2-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 20px;
  align-items: end;
}
.r2-filter-grid label { display: grid; gap: 7px; min-width: 0; font-weight: 650; }
.r2-filter-grid__wide { grid-column: span 2; }
.r2-filter-grid input,
.r2-filter-grid select { min-width: 0; width: 100%; }
.r2-definition-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
}
.r2-definition-grid > div { padding: 14px 18px; border-bottom: 1px solid var(--r2-color-border); }
.r2-definition-grid > div:nth-child(odd) { border-right: 1px solid var(--r2-color-border); }
.r2-definition-grid dt { color: var(--r2-color-text-muted); font-size: .78rem; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.r2-definition-grid dd { margin: 5px 0 0; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9rem; }
.r2-code-block {
  max-height: 520px;
  margin: 0;
  padding: 16px 18px;
  overflow: auto;
  border-top: 1px solid var(--r2-color-border);
  background: #101820;
  color: #eef4f8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: .82rem/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.r2-panel > details { padding: 14px 18px; border-top: 1px solid var(--r2-color-border); }
.r2-panel > details summary { cursor: pointer; font-weight: 700; }

@media (max-width: 980px) {
  .r2-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .r2-filter-grid { grid-template-columns: 1fr; }
  .r2-filter-grid__wide { grid-column: auto; }
  .r2-definition-grid { grid-template-columns: 1fr; }
  .r2-definition-grid > div:nth-child(odd) { border-right: 0; }
}

/* Batch 43C: operational health workspace. */
.r2-health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}
.r2-health-card,
.r2-maintenance-card {
    border: 1px solid var(--r2-border, #dde3dd);
    border-radius: 14px;
    background: var(--r2-surface, #fff);
    padding: 16px;
}
.r2-health-card--fail { border-color: color-mix(in srgb, #b42318 35%, var(--r2-border, #dde3dd)); }
.r2-health-card--degraded { border-color: color-mix(in srgb, #b7791f 35%, var(--r2-border, #dde3dd)); }
.r2-health-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.r2-health-card p,
.r2-maintenance-card span { margin: 8px 0; color: var(--r2-muted, #6b746f); }
.r2-health-card pre { max-height: 220px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.r2-inline-maintenance-form { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.r2-inline-maintenance-form span { color: var(--r2-muted, #6b746f); }
.r2-dev-tool-grid--maintenance form { display: flex; flex-direction: column; gap: 10px; }
.r2-maintenance-card .r2-button { margin-top: auto; align-self: flex-start; }
.r2-code-pair { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--r2-border, #dde3dd); }
.r2-code-pair:last-child { border-bottom: 0; }
@media (max-width: 640px) {
    .r2-code-pair { grid-template-columns: 1fr; gap: 4px; }
}

/* Legal links on authentication screens. */
.r2-auth-legal { margin: 6px 0 0; color: var(--r2-color-text-muted); font-size: .86rem; line-height: 1.55; }
.r2-auth-legal a { color: var(--r2-color-accent-strong); font-weight: 650; }

/* LEGAL-3: one-time first-login activation, intentionally separate from password management. */
.r2-activation-card { max-width: 620px; }
.r2-activation-consent { display: grid !important; grid-template-columns: 22px 1fr; align-items: start; gap: 12px !important; padding: 15px; border: 1px solid var(--r2-color-border); background: var(--r2-color-surface-muted, #f8fafb); font-weight: 500 !important; line-height: 1.55; }
.r2-activation-consent input { width: 18px; height: 18px; margin-top: 3px; }
.r2-activation-consent a { color: var(--r2-color-accent-strong); font-weight: 750; }
.r2-activation-consent small { display: block; margin-top: 4px; color: var(--r2-color-text-muted); font-weight: 600; }
.r2-activation-note { margin: 2px 0 0; color: var(--r2-color-text-muted); font-size: .9rem; line-height: 1.55; }
.r2-activation-logout { margin-top: 12px; }
.r2-activation-logout .r2-button { width: 100%; }

/* Batch 53.4 — platform consultation requests. */
.r2-inline-form { display: flex; align-items: end; gap: 10px; }
.r2-inline-form label { display: grid; gap: 6px; color: var(--r2-color-text-muted); font-size: .82rem; font-weight: 700; }
.r2-inline-form select { min-height: 38px; min-width: 160px; }
.r2-detail-list { margin: 0; display: grid; }
.r2-detail-list > div { display: grid; grid-template-columns: minmax(140px, .42fr) minmax(0, 1fr); gap: 22px; padding: 16px 20px; border-bottom: 1px solid var(--r2-color-border); }
.r2-detail-list > div:last-child { border-bottom: 0; }
.r2-detail-list dt { color: var(--r2-color-text-muted); font-size: .82rem; font-weight: 700; }
.r2-detail-list dd { min-width: 0; margin: 0; color: var(--r2-color-text); font-weight: 650; overflow-wrap: anywhere; }
.r2-preserve-lines { white-space: pre-wrap; font-weight: 500 !important; line-height: 1.55; }
@media (max-width: 680px) {
    .r2-detail-list > div { grid-template-columns: 1fr; gap: 5px; }
    .r2-inline-form { width: 100%; }
    .r2-inline-form label, .r2-inline-form select { width: 100%; }
}
