.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; }
}
