:root {
  --rms-primary: #2563eb;
  --rms-primary-hover: #1d4ed8;
  --rms-cyan: #0ea5e9;
  --rms-background: #f0f7f9;
  --rms-surface: #fff;
  --rms-text: #0f172a;
  --rms-muted: #475569;
  --rms-border: #e2e8f0;
  --rms-shadow: 0 4px 12px -2px rgba(14, 165, 233, .08);
}

body:not([data-school-branded="1"]) {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #0ea5e9;
  --brand-primary: #2563eb;
  --brand-gradient: #2563eb;
  --accent: #0ea5e9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --bg-surface: #fff;
  --border-default: #e2e8f0;
  --border-focus: #0ea5e9;
  --shadow-card: var(--rms-shadow);
  background: linear-gradient(180deg, #f0f7f9, #e6f4f8);
  color: #0f172a;
}

body .ms-shell-header .ms-shell-nav-frame {
  background: #fff;
  border-color: #e2e8f0;
  box-shadow: var(--rms-shadow);
}
.ms-shell-header .ms-shell-nav-link { font-size: 13px; gap: 4px; padding-inline: 9px; }
.rms-arena-icon { color: #0ea5e9; flex-shrink: 0; }
body .nav-auth-link.install {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(14, 165, 233, .1);
  color: #2563eb;
  border: 1px solid #bae6fd;
  border-radius: 999px;
}
body .nav-auth-link.install svg { flex: 0 0 16px; }
body .install-app-banner {
  position: fixed;
  z-index: 1200;
  bottom: 24px;
  right: 24px;
  width: 360px;
  max-width: calc(100vw - 32px);
  padding: 16px;
  background: #fff;
  border: 1px solid #e0f2fe;
  border-radius: 16px;
  box-shadow: 0 10px 25px -5px rgba(14, 165, 233, .15);
  color: #475569;
}
body .install-app-banner__content { display: grid; grid-template-columns: 40px 1fr; gap: 12px; }
.install-app-banner__icon {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 10px; color: #2563eb; background: #e0f2fe;
}
body .install-app-banner strong { color: #0f172a; font-size: 15px; }
body .install-app-banner p { margin: 6px 0 0; color: #475569; font-size: 13px; line-height: 1.5; }
body .install-app-banner__actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: 8px; }
body .install-app-banner__button, body .install-app-banner__dismiss {
  padding: 8px 16px; border: 0; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
body .install-app-banner__button { background: #2563eb; color: #fff; }
body .install-app-banner__button:hover { background: #1d4ed8; }
body .install-app-banner__dismiss { background: transparent; color: #475569; padding-inline: 12px; }
body .install-app-banner__dismiss:hover { background: #f1f5f9; }
body .install-app-banner__error { grid-column: 1 / -1; color: #b91c1c; }

.rms-features { width: min(1200px, calc(100% - 32px)); margin: 32px auto; }
.rms-practice-promos { order: 5; }
.rms-feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.rms-feature-card {
  min-width: 0; padding: 24px; border: 1px solid #e2e8f0; border-radius: 16px;
  background: #fff; color: #475569; box-shadow: var(--rms-shadow);
}
.rms-feature-card h2 { color: #0f172a; font-size: 24px; line-height: 1.25; margin: 12px 0; }
.rms-feature-card p { line-height: 1.6; }
.rms-badge { display: inline-flex; gap: 6px; align-items: center; padding: 5px 10px; border-radius: 999px; background: #e0f2fe; color: #0369a1; font-size: 12px; font-weight: 700; }
.rms-feature-card a.rms-action { display: inline-flex; padding: 10px 16px; border-radius: 10px; margin-top: 10px; background: #2563eb; color: #fff; text-decoration: none; font-weight: 700; }
.rms-feature-card a.rms-action:hover { background: #1d4ed8; }
.rms-mini-match { padding: 14px; border: 1px solid #e2e8f0; border-radius: 12px; background: #f8fafc; }
.rms-mini-match header { display: flex; justify-content: space-between; gap: 8px; color: #475569; font-size: 12px; }
.rms-mini-match button { padding: 6px 10px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; color: #0f172a; cursor: pointer; }
.rms-mini-match button[aria-pressed="true"] { background: #2563eb; color: #fff; }
.rms-metrics-strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0; }
.rms-metrics-strip span { padding: 10px; border: 1px solid #e0f2fe; border-radius: 12px; font-size: 12px; }
.rms-metrics-strip strong { display: block; color: #2563eb; font-size: 20px; }

body .question-count-pills button[aria-checked="true"],
body .duration-pills button[aria-checked="true"] { background: #2563eb; color: #fff; box-shadow: 0 2px 6px rgba(37, 99, 235, .25); }
body .question-instruction:not(.hidden) { padding: 12px 16px; background: #f0f9ff; border-left: 4px solid #0ea5e9; border-radius: 0 8px 8px 0; color: #0f172a; font-style: normal; }
body .option-button { border-radius: 12px; background: #fff; }
body .option-button .option-radio { margin-left: auto; width: 20px; height: 20px; flex: 0 0 20px; border: 2px solid #cbd5e1; border-radius: 50%; }
body .option-button.selected .option-radio { border: 6px solid #2563eb; background: #fff; }
body .option-button.selected { border: 2px solid #2563eb; background: #f8fafc; }
body .option-button.selected .option-key { background: #2563eb; color: #fff; }
body .question-nav-button { position: relative; min-width: 36px; min-height: 36px; border-radius: 8px; background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }
body .question-nav-button.answered { background: #ecfdf5; color: #047857; border-color: #10b981; }
body .question-nav-button.marked { background: #fffbeb; color: #b45309; border-color: #f59e0b; }
body .question-nav-button.marked::after { content: ''; position: absolute; top: 3px; right: 3px; width: 5px; height: 5px; border-radius: 50%; background: #f59e0b; }
body .question-nav-button.current { background: #2563eb; color: #fff; border-color: #2563eb; outline: 2px solid #93c5fd; }
.rms-session-user { display: inline-flex; align-items: center; gap: 6px; color: #0f172a; font-size: 12px; }
.rms-session-user-initial { display: grid; place-items: center; width: 30px; height: 30px; background: #e0f2fe; border-radius: 50%; font-weight: 700; }
.rms-contrast-toggle { min-width: 36px; min-height: 36px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; color: #0f172a; cursor: pointer; }
body.practice-session-mode .session-meta { position: sticky; top: 0; z-index: 35; display: flex; align-items: center; min-height: 64px; padding: 10px 16px; border-radius: 0; background: #fff; }
body .session-meta .timer { background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 999px; color: #0f172a; font-family: monospace; }
body .session-meta .timer.timer-warning, body .session-meta .timer.timer-danger { background: #fef2f2; border-color: #fecaca; color: #ef4444; }
body .rms-top-submit { min-height: 36px; padding: 8px 14px; background: #2563eb; color: #fff; border: 0; border-radius: 8px; cursor: pointer; font-weight: 700; }
body.practice-session-mode .rms-practice-promos, body.practice-focus-mode .rms-practice-promos { display: none; }
.rms-guide-link { display: inline-block; margin-top: 10px; color: #2563eb; text-decoration: underline; }
.rms-exam-links { grid-column: 1 / -1; padding: 10px 0 0; color: #475569; font-size: 13px; }
.rms-exam-links a { color: #2563eb; margin-right: 12px; text-decoration: underline; }
body.rms-high-contrast .question-card,
body.rms-high-contrast .navigator-card,
body.rms-high-contrast .session-meta { background: #fff; color: #000; border: 2px solid #000; }
body.rms-high-contrast .question-copy,
body.rms-high-contrast .question-instruction,
body.rms-high-contrast .question-passage,
body.rms-high-contrast .option-content { color: #000; font-size: 18px; }
body.rms-high-contrast .option-button { border-color: #000; }
body.rms-high-contrast .option-button.selected { border: 3px solid #1d4ed8; }
body :focus-visible { outline: 3px solid #0ea5e9; outline-offset: 3px; }
@media (max-width: 900px) { .rms-feature-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  body.practice-session-mode .session-meta { gap: 8px; }
  body .session-utility { display: flex; flex-wrap: wrap; gap: 8px; }
  .rms-session-user { display: none; }
}
@media (max-width: 480px) {
  body .install-app-banner { right: 16px; bottom: 16px; width: calc(100% - 32px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
