/* MathsPilot learner setup unification: Practice, Competition and SATs setup flows. */
:root {
  --learner-radius: 18px;
  --learner-border: color-mix(in srgb, var(--brand-500, #6b7852) 18%, rgba(42, 51, 37, 0.16) 82%);
  --learner-soft: color-mix(in srgb, var(--surface-card, #fffaf0) 90%, var(--brand-50, #f3eee4) 10%);
  --learner-ink: var(--brand-850, #2f3d28);
  --learner-muted: var(--text-muted, #66705d);
  --learner-shadow: 0 18px 44px rgba(42, 51, 37, 0.14);
  --learner-backdrop-layer: 90;
  --learner-modal-layer: 91;
}

.learner-setup {
  --learner-radius: 18px;
  --learner-border: color-mix(in srgb, var(--brand-500, #6b7852) 18%, rgba(42, 51, 37, 0.16) 82%);
  --learner-soft: color-mix(in srgb, var(--surface-card, #fffaf0) 90%, var(--brand-50, #f3eee4) 10%);
  --learner-ink: var(--brand-850, #2f3d28);
  --learner-muted: var(--text-muted, #66705d);
  --learner-shadow: 0 18px 44px rgba(42, 51, 37, 0.14);
  box-sizing: border-box;
}

html[data-appearance=dark] .learner-setup {
  --learner-border: color-mix(in srgb, var(--student-theme-primary, var(--brand-500, #7fa3ff)) 34%, rgba(188, 198, 230, 0.2) 66%);
  --learner-soft: color-mix(in srgb, var(--bg-panel, #202744) 86%, var(--student-theme-primary, var(--brand-500, #7fa3ff)) 14%);
  --learner-ink: var(--text-strong, #f4f6ff);
  --learner-muted: var(--text-body, #c6cee8);
  --learner-shadow: 0 22px 52px rgba(0, 0, 0, 0.3), inset 0 1px rgba(255, 255, 255, 0.08);
}

.learner-setup *,
.learner-setup *::before,
.learner-setup *::after {
  box-sizing: border-box;
}

.learner-setup__shell {
  border: 1px solid var(--learner-border);
  border-radius: var(--learner-radius);
  background:
    linear-gradient(135deg, rgba(255, 252, 246, 0.98), rgba(246, 249, 238, 0.96)),
    var(--learner-soft);
  box-shadow: var(--learner-shadow);
  min-width: 0;
}

html[data-appearance=dark] .learner-setup__shell {
  background:
    radial-gradient(circle at 88% 12%, color-mix(in srgb, var(--student-theme-primary, var(--brand-500, #7fa3ff)) 14%, transparent), transparent 42%),
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--bg-panel, #202744) 88%, var(--student-theme-primary, var(--brand-500, #7fa3ff)) 12%),
      color-mix(in srgb, var(--bg-canvas-soft, #182033) 92%, #000000 8%)
    );
}

.learner-setup__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  min-width: 0;
}

.learner-setup__header-main {
  min-width: 0;
}

.learner-setup__header-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.setup-close-button {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--learner-border) 76%, transparent);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--learner-ink);
  box-shadow: 0 8px 18px rgba(42, 51, 37, 0.07);
  font-size: 1.38rem;
  line-height: 1;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

html[data-appearance=dark] .setup-close-button {
  background: color-mix(in srgb, var(--bg-panel, #202744) 78%, var(--text-strong, #f4f6ff) 8%);
  color: var(--learner-ink);
  border-color: color-mix(in srgb, var(--learner-border) 86%, rgba(255, 255, 255, 0.1));
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24), inset 0 1px rgba(255, 255, 255, 0.08);
}

.setup-close-button:hover,
.setup-close-button:focus-visible {
  border-color: color-mix(in srgb, var(--brand-600, #5d6947) 45%, var(--learner-border));
  background: #ffffff;
  outline: none;
}

html[data-appearance=dark] .setup-close-button:hover,
html[data-appearance=dark] .setup-close-button:focus-visible {
  background: color-mix(in srgb, var(--bg-panel-2, #253055) 80%, var(--student-theme-primary, var(--brand-500, #7fa3ff)) 20%);
}

.learner-setup__header .eyebrow {
  letter-spacing: 0;
  text-transform: none;
}

.learner-setup__header h1,
.learner-setup__header h2 {
  color: var(--learner-ink);
  margin-block: 0;
  letter-spacing: 0;
  font-size: clamp(1.34rem, 2vw, 1.82rem);
  line-height: 1.08;
}

.learner-setup__header p {
  margin-block: 6px 0;
  max-width: 62ch;
  line-height: 1.35;
}

.learner-setup__stepper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  min-height: 44px;
  align-items: stretch;
}

.learner-setup__stepper li {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 7px 8px;
  border: 1px solid color-mix(in srgb, var(--learner-border) 72%, transparent);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--learner-muted);
  font-size: 0.82rem;
  font-weight: 800;
}

html[data-appearance=dark] .learner-setup__stepper li {
  background: color-mix(in srgb, var(--bg-panel, #202744) 82%, var(--text-strong, #f4f6ff) 6%);
  color: var(--learner-muted);
  border-color: color-mix(in srgb, var(--learner-border) 78%, rgba(255, 255, 255, 0.08));
}

.learner-setup__stepper span {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: rgba(107, 120, 82, 0.12);
  color: var(--brand-750, #435132);
}

html[data-appearance=dark] .learner-setup__stepper span {
  background: color-mix(in srgb, var(--student-theme-primary, var(--brand-500, #7fa3ff)) 18%, var(--bg-panel-2, #253055) 82%);
  color: var(--text-strong, #f4f6ff);
}

.learner-setup__stepper strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.78rem;
}

.learner-setup__stepper li.is-active {
  border-color: color-mix(in srgb, var(--brand-500, #6b7852) 42%, var(--learner-border));
  background: color-mix(in srgb, var(--brand-50, #f3eee4) 62%, #ffffff 38%);
  color: var(--learner-ink);
}

html[data-appearance=dark] .learner-setup__stepper li.is-active {
  background: color-mix(in srgb, var(--bg-panel-2, #253055) 70%, var(--student-theme-primary, var(--brand-500, #7fa3ff)) 30%);
  color: var(--learner-ink);
}

.learner-setup__stepper li.is-active span,
.learner-setup__stepper li.is-complete span {
  background: var(--brand-600, #5d6947);
  color: #fffaf0;
}

html[data-appearance=dark] .learner-setup__stepper li.is-active span,
html[data-appearance=dark] .learner-setup__stepper li.is-complete span {
  background: color-mix(in srgb, var(--student-theme-primary, var(--brand-500, #7fa3ff)) 78%, #ffffff 22%);
  color: #111827;
}

.learner-setup__body {
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
}

.learner-setup__body:not([hidden]) {
  display: grid;
  align-content: start;
  gap: 12px;
}

.learner-setup__body .section-header {
  margin-bottom: 10px;
}

.learner-setup__body .section-header h3,
.learner-setup__body .student-sats-custom-panel__head h2 {
  color: var(--learner-ink);
  font-size: clamp(1.18rem, 1.5vw, 1.45rem);
  letter-spacing: 0;
}

.learner-setup__grid,
.learner-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 10px;
  align-items: stretch;
  align-content: start;
}

.learner-option-card {
  border: 1px solid var(--learner-border);
  border-radius: var(--learner-radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(249, 247, 240, 0.92)),
    var(--surface-card, #fffaf0);
  box-shadow: 0 10px 24px rgba(42, 51, 37, 0.08);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

html[data-appearance=dark] .learner-setup .learner-option-card {
  border-color: color-mix(in srgb, var(--learner-border) 84%, rgba(255, 255, 255, 0.08));
  background:
    radial-gradient(circle at 88% 12%, color-mix(in srgb, var(--student-theme-primary, var(--brand-500, #7fa3ff)) 12%, transparent), transparent 42%),
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--bg-panel, #202744) 84%, var(--student-theme-primary, var(--brand-500, #7fa3ff)) 16%),
      color-mix(in srgb, var(--bg-canvas-soft, #182033) 90%, #000000 10%)
    );
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24), inset 0 1px rgba(255, 255, 255, 0.08);
}

.learner-option-card:hover,
.learner-option-card:focus-visible,
.learner-option-card:focus-within {
  border-color: color-mix(in srgb, var(--brand-600, #5d6947) 46%, var(--learner-border));
  box-shadow: 0 16px 30px rgba(42, 51, 37, 0.12);
  transform: none;
}

.learner-option-card.is-selected,
.learner-option-card.is-active,
.learner-option-card[aria-pressed="true"] {
  border-color: var(--brand-600, #5d6947);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 247, 229, 0.94)),
    var(--surface-card, #fffaf0);
}

html[data-appearance=dark] .learner-setup .learner-option-card:is(:hover, :focus-visible, :focus-within) {
  border-color: color-mix(in srgb, var(--student-theme-primary, var(--brand-500, #7fa3ff)) 48%, rgba(188, 198, 230, 0.28) 52%);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px color-mix(in srgb, var(--student-theme-primary, var(--brand-500, #7fa3ff)) 18%, transparent);
}

html[data-appearance=dark] .learner-setup .learner-option-card:is(.is-selected, .is-active, [aria-pressed="true"]) {
  border-color: color-mix(in srgb, var(--student-theme-primary, var(--brand-500, #7fa3ff)) 62%, rgba(188, 198, 230, 0.28) 38%);
  background:
    radial-gradient(circle at 88% 12%, color-mix(in srgb, var(--student-theme-primary, var(--brand-500, #7fa3ff)) 22%, transparent), transparent 42%),
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--bg-panel-2, #253055) 62%, var(--student-theme-primary, var(--brand-500, #7fa3ff)) 38%),
      color-mix(in srgb, var(--bg-panel, #202744) 76%, var(--student-theme-primary, var(--brand-500, #7fa3ff)) 24%)
    );
}

.learner-option-card[disabled],
.learner-option-card[aria-disabled="true"] {
  opacity: 0.54;
  cursor: not-allowed;
  transform: none;
}

.setup-option-tile {
  min-width: 0;
  min-height: 92px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
  text-align: left;
}

.setup-option-tile__content,
.student-sats-custom-choice-button.learner-option-card > span {
  min-width: 0;
  display: grid;
  gap: 5px;
  align-content: center;
}

.setup-option-tile__title,
.student-sats-custom-choice-button.learner-option-card strong {
  color: var(--learner-ink);
  font-size: clamp(0.98rem, 1.1vw, 1.08rem);
  line-height: 1.18;
  font-weight: 850;
}

html[data-appearance=dark] .learner-setup :is(.setup-option-tile__title, .student-sats-custom-choice-button.learner-option-card strong) {
  color: var(--learner-ink);
}

.setup-option-tile__detail,
.student-sats-custom-choice-button.learner-option-card small {
  color: var(--learner-muted);
  font-size: 0.86rem;
  line-height: 1.32;
}

html[data-appearance=dark] .learner-setup :is(.setup-option-tile__detail, .student-sats-custom-choice-button.learner-option-card small, .competition-sprint-choice .setup-option-tile__detail) {
  color: var(--learner-muted);
}

.setup-option-tile__badge,
.student-sats-custom-choice-button.learner-option-card em {
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-50, #f3eee4) 72%, #ffffff 28%);
  color: var(--learner-ink);
  font-size: 0.76rem;
  line-height: 1;
  font-style: normal;
  font-weight: 850;
}

html[data-appearance=dark] .learner-setup :is(.setup-option-tile__badge, .student-sats-custom-choice-button.learner-option-card em) {
  background: color-mix(in srgb, var(--text-strong, #f4f6ff) 16%, var(--bg-panel-2, #253055) 84%);
  color: var(--text-strong, #f4f6ff);
}

.learner-summary-card,
.learner-ready-panel {
  border-radius: var(--learner-radius);
  border-color: var(--learner-border);
  background: rgba(255, 255, 255, 0.72);
}

html[data-appearance=dark] .learner-setup :is(.learner-summary-card, .learner-ready-panel) {
  background: color-mix(in srgb, var(--bg-panel, #202744) 84%, var(--student-theme-primary, var(--brand-500, #7fa3ff)) 16%);
}

.learner-setup__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 8px 0 0;
  border-top: 1px solid color-mix(in srgb, var(--learner-border) 62%, transparent);
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.72), rgba(255, 252, 246, 0.98));
}

html[data-appearance=dark] .learner-setup__actions {
  border-top-color: color-mix(in srgb, var(--learner-border) 70%, rgba(255, 255, 255, 0.08));
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--bg-panel, #202744) 84%, transparent),
      color-mix(in srgb, var(--bg-canvas-soft, #182033) 94%, #000000 6%)
    );
}

.learner-setup__actions .btn {
  min-height: 44px;
  min-width: 96px;
}

.setup-footer-bar__back {
  margin-right: auto;
}

.setup-footer-bar__next {
  order: 2;
}

.setup-footer-bar__primary {
  order: 3;
}

.student-sats-custom-next-reason {
  order: 2;
  min-width: 0;
  color: var(--learner-muted);
  font-size: 0.84rem;
  line-height: 1.25;
}

.learner-setup__actions .btn[disabled],
.learner-setup__actions .btn[aria-disabled="true"],
.learner-setup .btn[disabled],
.learner-setup .btn[aria-disabled="true"] {
  border-color: color-mix(in srgb, var(--learner-border) 74%, transparent);
  background: color-mix(in srgb, #eef0eb 78%, #ffffff 22%);
  color: color-mix(in srgb, var(--learner-muted) 76%, #ffffff 24%);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 1;
}

body.portal-student .learner-setup :is(.learner-option-card, .student-sats-custom-choice-button, .student-sats-custom-goal-card, .student-sats-custom-status-card, .student-sats-custom-marks-card, .student-sats-custom-topic-card, .student-sats-custom-year-card, .student-sats-custom-paper-card, .student-sats-custom-count-card):is([disabled], [aria-disabled="true"]) {
  border-color: color-mix(in srgb, var(--learner-border) 76%, transparent);
  background: color-mix(in srgb, #f4f3ee 84%, #ffffff 16%);
  color: color-mix(in srgb, var(--learner-muted) 82%, #ffffff 18%);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 1;
}

body.portal-student .learner-setup :is(.learner-option-card, .student-sats-custom-choice-button, .student-sats-custom-goal-card, .student-sats-custom-status-card, .student-sats-custom-marks-card, .student-sats-custom-topic-card, .student-sats-custom-year-card, .student-sats-custom-paper-card, .student-sats-custom-count-card):is([disabled], [aria-disabled="true"]).is-active {
  border-color: color-mix(in srgb, var(--learner-border) 76%, transparent);
  background: color-mix(in srgb, #f4f3ee 84%, #ffffff 16%);
  box-shadow: none;
}

body.portal-student .learner-setup :is(.learner-option-card, .student-sats-custom-choice-button, .student-sats-custom-goal-card, .student-sats-custom-status-card, .student-sats-custom-marks-card, .student-sats-custom-topic-card, .student-sats-custom-year-card, .student-sats-custom-paper-card, .student-sats-custom-count-card):is([disabled], [aria-disabled="true"]) :is(.setup-option-tile__badge, .practice-icon, .student-sats-custom-choice-button__icon) {
  background: color-mix(in srgb, #ecebe6 88%, #ffffff 12%);
  color: color-mix(in srgb, var(--learner-muted) 78%, #ffffff 22%);
}

body.portal-student .student-sats-custom-wizard :is(.student-sats-custom-choice-button, .student-sats-custom-goal-card, .student-sats-custom-status-card, .student-sats-custom-marks-card, .student-sats-custom-topic-card, .student-sats-custom-year-card, .student-sats-custom-paper-card, .student-sats-custom-count-card):not(.is-active):not([disabled]):not([aria-disabled="true"]) {
  border-color: var(--learner-border);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.62);
}

body.portal-student .student-sats-custom-wizard :is(.student-sats-custom-choice-button, .student-sats-custom-goal-card, .student-sats-custom-status-card, .student-sats-custom-marks-card, .student-sats-custom-topic-card, .student-sats-custom-year-card, .student-sats-custom-paper-card, .student-sats-custom-count-card):not(.is-active):not([disabled]):not([aria-disabled="true"]):focus-visible {
  border-color: var(--learner-border);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

body.portal-student .student-sats-custom-wizard :is(.student-sats-custom-choice-button, .student-sats-custom-goal-card, .student-sats-custom-status-card, .student-sats-custom-marks-card, .student-sats-custom-topic-card, .student-sats-custom-year-card, .student-sats-custom-paper-card, .student-sats-custom-count-card).is-active:not([disabled]):not([aria-disabled="true"]) {
  border-color: color-mix(in srgb, var(--brand-600, #5d7ff4) 54%, var(--learner-border) 46%);
  background: color-mix(in srgb, var(--brand-100, #eef3ff) 48%, #ffffff 52%);
}

body.portal-student .student-sats-custom-wizard :is(.student-sats-custom-choice-button, .student-sats-custom-goal-card, .student-sats-custom-status-card, .student-sats-custom-marks-card, .student-sats-custom-topic-card, .student-sats-custom-year-card, .student-sats-custom-paper-card, .student-sats-custom-count-card).is-active:not([disabled]):not([aria-disabled="true"])::after {
  content: "Selected";
  align-self: start;
  justify-self: end;
  padding: 4px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-600, #5d7ff4) 86%, #ffffff 14%);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 850;
  line-height: 1;
}

html[data-appearance=dark] .learner-setup :is(.btn[disabled], .btn[aria-disabled="true"]) {
  border-color: color-mix(in srgb, var(--learner-border) 70%, rgba(255, 255, 255, 0.06));
  background: color-mix(in srgb, var(--bg-panel, #202744) 84%, #000000 16%);
  color: color-mix(in srgb, var(--learner-muted) 72%, var(--bg-panel, #202744) 28%);
}

.student-practice-builder-card[data-builder-state="open"]::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--learner-backdrop-layer);
  background: rgba(40, 49, 36, 0.38);
  backdrop-filter: blur(3px);
}

.student-practice-builder-card[data-builder-state="open"] > .section-header,
.student-practice-builder-card[data-builder-state="open"] > [data-practice-builder-intro] {
  visibility: hidden;
}

.student-practice-builder-card[data-builder-state="open"] .student-practice-builder__wizard {
  position: fixed;
  z-index: var(--learner-modal-layer);
  inset: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  width: min(980px, calc(100vw - 28px));
  height: min(680px, 96dvh);
  max-height: 96dvh;
  margin: auto;
  padding: clamp(14px, 1.7vw, 24px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: clamp(8px, 1vw, 14px);
  overflow: hidden;
}

.student-practice-builder__header {
  grid-row: 1;
}

.student-practice-builder__steps {
  grid-row: 2;
}

.student-practice-builder__core-controls {
  display: none;
}

.student-practice-builder__step:not([hidden]) {
  grid-row: 3;
}

.student-practice-builder__actions {
  grid-row: 4;
}

.student-practice-builder-card[data-builder-state="open"] .student-practice-builder__actions {
  position: static;
  bottom: auto;
}

.student-practice-builder__core-controls {
  min-height: 0;
  max-height: min(136px, 18dvh);
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--learner-border) 72%, transparent);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
  overflow: auto;
}

.student-practice-builder__wizard .student-form-grid {
  gap: 10px;
}

.student-practice-builder__step {
  min-height: 0;
  height: auto;
  max-height: none;
  overflow: auto;
  padding-right: 4px;
}

.student-practice-builder__step:not([hidden]) {
  display: grid;
  grid-template-rows: auto minmax(0, auto);
  align-content: start;
  gap: 12px;
}

.student-practice-builder__summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.student-practice-builder__summary-tile {
  padding: 10px;
}

.student-practice-builder__why {
  margin: 12px 0 0;
}

.student-practice-builder__advanced {
  margin-top: 12px;
}

.student-competition-builder-modal.learner-setup {
  position: fixed;
  inset: 0;
  z-index: var(--learner-backdrop-layer);
  display: grid;
  place-items: center;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}

.student-competition-builder-open [data-competition-hub] {
  visibility: hidden;
}

.student-competition-builder-modal[hidden] {
  display: none;
}

.student-competition-builder-modal__window.learner-setup__shell {
  width: min(1040px, calc(100vw - 28px));
  height: auto;
  min-height: min(420px, 96dvh);
  max-height: 96dvh;
  padding: clamp(14px, 1.7vw, 24px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(8px, 1vw, 14px);
  overflow: hidden;
}

.student-competition-mode-modal__window.learner-setup__shell {
  width: min(760px, calc(100vw - 28px));
}

.learner-setup .competition-sprint-hero {
  display: none;
}

.learner-setup .competition-sprint-layout {
  min-height: 0;
  height: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(10px, 1.2vw, 16px);
}

.learner-setup .student-competition-preview-card {
  display: none;
}

.learner-setup .competition-sprint-wizard-card {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(10px, 1.2vw, 16px);
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
}

.learner-setup .competition-sprint-wizard {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(8px, 1vw, 14px);
}

.learner-setup .competition-sprint-wizard__main {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
}

.learner-setup .competition-sprint-step {
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-right: 4px;
}

.learner-setup .competition-sprint-step:not([hidden]) {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, auto);
  align-content: start;
  gap: 12px;
}

.learner-setup .competition-sprint-choice {
  min-height: 112px;
}

.learner-setup .competition-sprint-choice-grid--question,
.learner-setup .competition-sprint-choice-grid--range {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.learner-setup .competition-sprint-choice-grid--duration {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.learner-setup .competition-sprint-choice .setup-option-tile__title,
.learner-setup .competition-sprint-choice .setup-option-tile__detail {
  min-width: 0;
  overflow-wrap: normal;
}

.learner-setup .competition-sprint-choice__visual--operations,
.learner-setup .competition-sprint-choice__visual--range,
.learner-setup .competition-sprint-choice__number-trail {
  max-width: 100%;
  flex-wrap: wrap;
}

.learner-setup .competition-sprint-choice--question,
.learner-setup .competition-sprint-choice--range {
  min-height: 104px;
  align-items: center;
}

.learner-setup .competition-sprint-inline-grid {
  margin-top: 12px;
}

.learner-setup .competition-sprint-ready__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.student-sats-page .student-sats-entry-card,
.student-sats-paper-row {
  border-radius: var(--learner-radius, 18px);
}

.student-sats-custom-page {
  width: min(100%, 1040px);
  margin-inline: auto;
}

.student-shell.student-shell--sats-custom-focus {
  width: 100%;
  max-width: none;
  margin-inline: 0;
  min-height: 100dvh;
}

.student-shell.student-shell--sats-custom-focus::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--layer-modal-scrim);
  pointer-events: none;
  background: color-mix(in srgb, #111827 32%, transparent);
  backdrop-filter: blur(8px);
}

.student-shell--sats-custom-focus .student-shell__body--compact-page {
  position: fixed;
  inset: 0 auto 0 50vw;
  transform: translateX(-50%);
  z-index: var(--layer-modal-content);
  width: 100vw;
  max-width: none;
  margin: 0;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  display: grid;
  place-items: center;
  overflow: auto;
  pointer-events: none;
}

.student-shell--sats-custom-focus .student-sats-custom-page {
  pointer-events: auto;
}

.student-sats-custom-screen-header {
  margin-bottom: 0;
}

.student-sats-custom-screen-header h1,
.student-sats-custom-screen-header h2 {
  font-size: clamp(1.55rem, 2.1vw, 2.25rem);
}

.student-sats-custom-wizard.learner-setup__shell {
  --sats-custom-footer-space: calc(var(--modal-footer-height, 72px) + 20px);
  width: min(100%, 1040px);
  margin-inline: auto;
  padding: clamp(14px, 1.7vw, 24px);
  height: auto;
  min-height: 0;
  max-height: 94dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(8px, 1vw, 14px);
  overflow: hidden;
}

.student-sats-custom-wizard .learner-setup__form {
  min-height: 0;
  height: auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(8px, 1vw, 14px);
}

.student-sats-custom-panels {
  min-height: 0;
  display: grid;
  align-content: start;
}

.student-sats-custom-panel.learner-setup__body {
  min-height: 0;
  align-self: start;
  max-height: 100%;
  overflow: auto;
  padding-right: 0;
  padding-bottom: var(--sats-custom-footer-space);
  scroll-padding-bottom: var(--sats-custom-footer-space);
}

.student-sats-custom-panel.learner-setup__body:not([hidden]) {
  display: grid;
  grid-template-rows: auto minmax(0, auto);
  align-content: start;
  gap: 12px;
}

.student-sats-custom-panel__head {
  margin-bottom: 10px;
}

.student-sats-custom-wizard .learner-setup__actions {
  margin-top: 4px;
  position: relative;
  bottom: auto;
  display: grid;
  grid-template-columns: minmax(96px, max-content) minmax(0, 1fr) minmax(110px, max-content);
  align-items: center;
  gap: 10px;
}

.student-sats-custom-actions .setup-footer-bar__back {
  grid-column: 1;
  justify-self: start;
  margin-right: 0;
}

.student-sats-custom-actions .student-sats-custom-next-reason {
  grid-column: 2;
  justify-self: end;
}

.student-sats-custom-actions .setup-footer-bar__next,
.student-sats-custom-actions .setup-footer-bar__primary {
  grid-column: 3;
  justify-self: end;
  width: auto;
  min-width: 96px;
}

.student-sats-custom-goal-grid,
.student-sats-custom-chip-grid,
.student-sats-custom-type-grid,
.student-sats-custom-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 10px;
  align-content: start;
}

.student-sats-custom-choice-button.learner-option-card {
  min-height: 108px;
  padding: 12px;
}

.student-sats-custom-year-paper {
  display: grid;
  gap: 12px;
}

.student-sats-custom-choice-button.learner-option-card span {
  gap: 6px;
}

.student-sats-custom-ready-card.learner-ready-panel {
  padding: 16px;
}

.student-sats-custom-ready-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.student-sats-custom-edit-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.student-official-filter-toolbar {
  border-radius: var(--learner-radius, 18px);
}

@media (min-width: 1280px) {
  .student-sats-custom-wizard.learner-setup__shell {
    min-height: 0;
    max-height: 94dvh;
    overflow: hidden;
  }

  .student-sats-custom-wizard .learner-setup__form {
    height: auto;
  }

  .student-sats-custom-panel.learner-setup__body {
    max-height: min(560px, 58dvh);
    overflow: auto;
  }
}

@media (min-width: 600px) and (max-width: 820px) {
  .student-sats-custom-wizard.learner-setup__shell {
    height: min(820px, 72dvh);
    min-height: 480px;
    max-height: 72dvh;
  }
}

@media (min-width: 821px) and (max-height: 840px) {
  .student-competition-builder-modal__window.learner-setup__shell {
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
    padding: 12px 20px;
    height: auto;
    max-height: 94dvh;
  }

  .student-competition-builder-modal__header.learner-setup__header {
    gap: 10px;
  }

  .student-competition-builder-modal__header h2,
  .learner-setup .competition-sprint-wizard__title {
    font-size: clamp(1.25rem, 1.7vw, 1.65rem);
  }

  .student-competition-builder-modal__header p,
  .learner-setup .competition-sprint-wizard__intro {
    margin-block: 4px 0;
  }

  .learner-setup .competition-sprint-layout,
  .learner-setup .competition-sprint-wizard-card,
  .learner-setup .competition-sprint-wizard {
    height: auto;
    min-height: 0;
  }

  .learner-setup .competition-sprint-wizard {
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
  }

  .learner-setup .competition-sprint-wizard__main {
    grid-template-rows: auto auto;
    gap: 8px;
  }

  .learner-setup .competition-sprint-step {
    max-height: none;
    overflow: auto;
  }

  .learner-setup .competition-sprint-choice {
    min-height: 76px;
    padding-block: 10px;
  }

  .learner-setup .competition-sprint-choice-grid--question,
  .learner-setup .competition-sprint-choice-grid--range {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .learner-setup .competition-sprint-inline-grid {
    margin-top: 8px;
  }

  .learner-setup .competition-sprint-choice__preview {
    transform: scale(0.86);
    transform-origin: center;
  }

  .learner-setup__actions {
    min-height: 50px;
    padding-top: 6px;
  }
}

@media (max-width: 820px) {
  .student-competition-builder-modal.learner-setup {
    place-items: start center;
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }

  .learner-setup__header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
  }

  .student-practice-builder__header.learner-setup__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .student-practice-builder__header .learner-setup__header-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    width: 100%;
  }

  .student-practice-builder__header .student-storage-mode-switch--wizard {
    min-width: 0;
    width: 100%;
  }

  .student-practice-builder__header h2 {
    font-size: clamp(1.5rem, 7vw, 1.9rem);
    max-width: 18ch;
  }

  .student-practice-builder__header p {
    max-width: 30ch;
  }

  .learner-setup__stepper {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .learner-setup__stepper li {
    padding: 6px;
  }

  .learner-setup__stepper strong {
    font-size: 0.75rem;
  }

  .student-practice-builder-card[data-builder-state="open"] .student-practice-builder__wizard,
  .student-competition-builder-modal__window.learner-setup__shell {
    width: min(100%, calc(100vw - 20px));
    min-height: 0;
    max-height: 96dvh;
    padding: 10px;
  }

  .student-practice-builder-card[data-builder-state="open"] .student-practice-builder__wizard {
    height: 96dvh;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }

  .student-competition-builder-modal__window.learner-setup__shell {
    height: auto;
    grid-template-rows: auto auto;
    align-content: start;
    align-items: start;
    overflow: auto;
  }

  .student-practice-builder__step {
    max-height: none;
  }

  .student-practice-builder__step--ready {
    gap: 8px;
  }

  .student-practice-builder__step--ready .student-practice-builder__summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .student-practice-builder__step--ready .student-practice-builder__summary-tile {
    min-height: 96px;
    padding: 9px;
    border-radius: 18px;
    gap: 5px;
  }

  .student-practice-builder__step--ready .student-practice-builder__summary-tile-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    justify-self: center;
  }

  .student-practice-builder__step--ready .student-practice-builder__summary-tile-icon > * {
    max-width: 100%;
    max-height: 100%;
  }

  .student-practice-builder__step--ready .practice-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
  }

  .student-practice-builder__step--ready .practice-icon svg {
    width: 23px;
    height: 23px;
  }

  .student-practice-builder__step--ready .student-practice-builder__summary-tile strong {
    font-size: 1rem;
    line-height: 1.1;
  }

  .student-practice-builder__step--ready .student-practice-builder__summary-tile span {
    font-size: 0.7rem;
    line-height: 1.12;
  }

  .student-practice-builder__why {
    margin-top: 8px;
  }

  .student-sats-custom-screen-header.learner-setup__header {
    margin-bottom: 8px;
  }

  .learner-setup .competition-sprint-layout,
  .learner-setup .competition-sprint-wizard-card,
  .learner-setup .competition-sprint-wizard {
    height: auto;
    min-height: 0;
  }

  .learner-setup .competition-sprint-wizard,
  .learner-setup .competition-sprint-wizard__main {
    grid-template-rows: auto auto;
  }

  .student-sats-custom-screen-header__nav {
    grid-column: 1 / -1;
  }

  .student-sats-custom-screen-header h1 {
    font-size: clamp(1.3rem, 5.2vw, 1.72rem);
    line-height: 1.08;
  }

  .student-sats-custom-screen-header p {
    display: none;
  }

  .learner-setup__grid,
  .learner-choice-grid,
  .student-sats-custom-goal-grid,
  .student-sats-custom-chip-grid,
  .student-sats-custom-type-grid,
  .student-sats-custom-pick-grid {
    grid-template-columns: 1fr;
  }

  .learner-setup .competition-sprint-choice-grid--question,
  .learner-setup .competition-sprint-choice-grid--duration,
  .learner-setup .competition-sprint-choice-grid--range {
    grid-template-columns: 1fr;
  }

  .setup-close-button {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  .learner-option-card {
    min-height: 76px;
  }

  .student-practice-builder__step .practice-builder-choice,
  .learner-setup .competition-sprint-choice,
  .student-sats-custom-choice-button.learner-option-card {
    min-height: 86px;
    padding: 10px 12px;
  }

  .learner-setup__actions {
    justify-content: stretch;
    flex-wrap: nowrap;
    min-height: 52px;
    padding-top: 8px;
  }

  .learner-setup__actions .btn {
    flex: 1 1 0;
    min-width: 0;
    padding-inline: 10px;
  }

  .student-sats-custom-panel.learner-setup__body {
    align-self: stretch;
    max-height: none;
    overflow: auto;
  }

  .student-sats-custom-wizard .learner-setup__form {
    height: 100%;
  }

  .student-sats-custom-wizard .learner-setup__actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .student-sats-custom-actions .student-sats-custom-next-reason {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .student-sats-custom-actions .setup-footer-bar__next,
  .student-sats-custom-actions .setup-footer-bar__primary {
    grid-column: 2;
    justify-self: stretch;
    width: 100%;
  }

  .learner-setup .competition-sprint-layout {
    grid-template-columns: 1fr;
  }

  .learner-setup .student-competition-preview-card {
    display: none;
  }
}

@media (max-width: 600px) {
  .student-competition-builder-modal__window.learner-setup__shell {
    height: 96dvh;
    min-height: min(560px, 96dvh);
    max-height: 96dvh;
  }

  .student-competition-builder-modal #studentCompetitionSprintForm.competition-sprint-wizard.learner-setup {
    height: 82dvh;
    min-height: min(520px, 82dvh);
    max-height: 82dvh;
  }

  .student-sats-custom-wizard.learner-setup__shell {
    --modal-footer-height: 78px;
    --sats-custom-footer-space: calc(var(--modal-footer-height) + 18px);
    height: 88dvh;
    min-height: min(590px, 88dvh);
    max-height: 88dvh;
  }

  .student-sats-custom-wizard .learner-setup__form,
  .learner-setup .competition-sprint-wizard,
  .learner-setup .competition-sprint-wizard__main {
    min-height: 0;
    height: 100%;
  }

  .student-sats-custom-panels {
    min-height: 0;
    overflow: hidden;
  }

  .student-sats-custom-panel.learner-setup__body {
    min-height: 0;
    max-height: 100%;
    padding-bottom: var(--sats-custom-footer-space);
    scroll-padding-bottom: var(--sats-custom-footer-space);
    overflow: auto;
  }

  .student-sats-custom-ready-card.learner-ready-panel {
    padding: 12px;
  }

  .student-sats-custom-ready-list {
    gap: 6px;
  }

  .student-sats-custom-edit-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .student-sats-custom-edit-links .btn {
    min-height: 42px;
    padding-inline: 8px;
    white-space: normal;
    line-height: 1.12;
  }

  .student-sats-custom-wizard .learner-setup__actions {
    position: relative;
    bottom: auto;
    min-height: var(--modal-footer-height);
    align-content: center;
  }

  .learner-setup .competition-sprint-wizard__main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .learner-setup .competition-sprint-actions {
    flex: 0 0 auto;
    position: relative;
    bottom: auto;
  }

  .learner-setup .competition-sprint-step {
    max-height: 100%;
    padding-bottom: 8px;
  }

  .learner-setup .competition-sprint-step:not([hidden]) {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: 100%;
    overflow: auto;
  }
}

@media (min-width: 601px) and (max-width: 820px) {
  .student-sats-custom-wizard.learner-setup__shell {
    height: 70dvh;
    min-height: min(760px, 70dvh);
    max-height: 70dvh;
  }
}

@media (max-width: 480px) {
  .student-practice-builder__header .learner-setup__header-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .student-practice-builder__header .setup-close-button {
    justify-self: end;
  }

  .student-practice-builder__step--ready .student-practice-builder__summary-tile {
    min-height: 74px;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    justify-items: start;
    text-align: left;
    padding: 8px;
  }

  .student-practice-builder__step--ready .student-practice-builder__summary-tile-icon {
    width: 36px;
    height: 36px;
    grid-row: 1 / 3;
  }

  .student-practice-builder__step--ready .practice-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .student-practice-builder__step--ready .practice-icon svg {
    width: 18px;
    height: 18px;
  }

  .student-practice-builder__step--ready .student-practice-builder__summary-tile strong {
    font-size: 0.94rem;
  }

  .student-practice-builder__step--ready .student-practice-builder__summary-tile span {
    font-size: 0.64rem;
  }

  .student-practice-builder__why {
    padding: 9px 10px;
    font-size: 0.9rem;
    line-height: 1.26;
  }

  .learner-setup__stepper {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .learner-setup__stepper li {
    min-height: 44px;
    padding: 5px 4px;
  }

  .learner-setup__stepper span {
    width: 22px;
    height: 22px;
    border-radius: 8px;
    font-size: 0.74rem;
  }

  .learner-setup__stepper strong {
    font-size: 0.72rem;
  }

  .setup-option-tile {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    min-height: 72px;
    padding: 10px;
  }

  .setup-option-tile > :first-child {
    display: none;
  }
}

@media (max-width: 480px) and (max-height: 720px) {
  .student-practice-builder-card[data-builder-state="open"] .student-practice-builder__wizard {
    padding: 8px;
    gap: 7px;
  }

  .student-practice-builder__header h2 {
    font-size: clamp(1.35rem, 6.2vw, 1.6rem);
  }

  .student-practice-builder__header p {
    margin-block-start: 2px;
    font-size: 0.94rem;
    line-height: 1.25;
  }

  .student-practice-builder__header .student-storage-mode-switch__label,
  .student-practice-builder__header .student-storage-mode-switch__detail {
    display: none;
  }

  .student-practice-builder__header .student-storage-mode-switch--wizard {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .student-practice-builder__header .student-storage-mode-switch__control {
    min-height: 44px;
  }

  .learner-setup__stepper li {
    min-height: 40px;
  }
}
