:root {
  --ink: #111;
  --muted: #666;
  --paper: #f8f8f6;
  --white: #fff;
  --line: #d7d7d2;
  --soft-line: #e9e9e5;
  --progress: #315f85;
  --progress-soft: #e8f0f6;
  --correct: #23734d;
  --correct-soft: #e8f4ed;
  --error: #a33a34;
  --error-soft: #f8eae8;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  overflow-x: clip;
}

body {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 16px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  overflow-wrap: anywhere;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

button,
input {
  font: inherit;
}

button,
label,
a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

:focus-visible {
  outline: 3px solid var(--progress);
  outline-offset: 3px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2,
.brand {
  font-family: Georgia, "Times New Roman", serif;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(1.75rem, 8vw, 2.15rem);
  line-height: 1.1;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}

h2 {
  line-height: 1.3;
}

.site-header {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 2px 14px;
  border-bottom: 1px solid var(--ink);
  background: var(--white);
}

.brand {
  flex: 0 1 auto;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
}

.header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 14px;
  font-size: .8rem;
}

.header-actions a,
.header-actions button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}

.header-actions form {
  margin: 0;
}

.mobile-label {
  display: inline;
}

.desktop-label {
  display: none;
}

.text-button {
  padding: 0;
  border: 0;
  color: inherit;
  background: none;
  cursor: pointer;
}

.text-button.underline {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.page-shell {
  width: min(100% - 28px, 1120px);
  min-height: calc(100vh - 118px);
  margin: 0 auto;
  padding: 12px 0 56px;
}

.study-page .page-shell {
  padding-bottom: calc(110px + env(safe-area-inset-bottom));
}

.study-page {
  scroll-padding-bottom: calc(90px + env(safe-area-inset-bottom));
}

.site-footer {
  padding: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  font-size: .72rem;
}

.study-page .site-footer {
  padding-bottom: calc(82px + env(safe-area-inset-bottom));
}

.kicker {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.page-heading {
  max-width: 760px;
  margin-bottom: 24px;
}

.page-heading > p:not(.kicker):last-child,
.detail-heading > p:not(.kicker),
.topic-heading > div > p:last-child {
  color: var(--muted);
  font-size: .98rem;
}

.breadcrumbs {
  display: flex;
  max-width: 100%;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: .75rem;
}

.breadcrumbs a {
  color: var(--ink);
}

.breadcrumbs [aria-current="page"] {
  min-width: 0;
  overflow-wrap: anywhere;
}

.opposition-list {
  border-top: 1px solid var(--ink);
}

.opposition-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  gap: 16px;
  align-items: center;
  min-height: 44px;
  padding: 17px 4px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.opposition-row:active {
  background: var(--white);
}

.opposition-row > div:first-child {
  min-width: 0;
}

.row-index {
  display: none;
}

.opposition-row h2 {
  margin: 0;
  font-size: 1.08rem;
  overflow-wrap: anywhere;
}

.opposition-row p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: .85rem;
}

.opposition-row dl {
  display: flex;
  grid-column: 1;
  gap: 26px;
  margin: 2px 0 0;
}

.opposition-row dl div {
  min-width: 64px;
}

.opposition-row dt {
  color: var(--muted);
  font-size: .64rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.opposition-row dd {
  margin: 0;
  font: 700 1.2rem Georgia, serif;
}

.row-arrow {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.row-arrow,
.arrow-link {
  font-size: 1.35rem;
  text-decoration: none;
}

.detail-heading {
  max-width: 900px;
  margin-bottom: 28px;
}

.detail-heading h1 {
  font-size: clamp(1.8rem, 8vw, 2.2rem);
}

.opposition-actions {
  display: grid;
  justify-items: start;
  gap: 5px;
  margin-top: 16px;
}

.source-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  font-size: .82rem;
  font-weight: 700;
}

.opposition-details {
  width: 100%;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.opposition-details summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--ink);
  cursor: pointer;
  font-size: .82rem;
  font-weight: 700;
  list-style: none;
}

.opposition-details summary::-webkit-details-marker {
  display: none;
}

.opposition-details summary::after {
  flex: 0 0 auto;
  color: var(--muted);
  content: "+";
  font-size: 1.1rem;
  font-weight: 400;
}

.opposition-details[open] summary::after {
  content: "−";
}

.detail-grid {
  margin: 0;
  padding: 0 0 10px;
}

.detail-grid > div {
  display: grid;
  grid-template-columns: minmax(82px, 30%) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--soft-line);
}

.detail-grid dt {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.detail-grid dd {
  min-width: 0;
  margin: 0;
  font-size: .82rem;
  overflow-wrap: anywhere;
}

.topic-section {
  margin-bottom: 34px;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.section-title > div {
  min-width: 0;
}

.section-title span,
.section-title small {
  color: var(--muted);
  font-size: .68rem;
}

.section-title h2 {
  margin: 2px 0 0;
  font-size: 1.08rem;
  overflow-wrap: anywhere;
}

.academic-table-wrap {
  overflow: visible;
  border-top: 1px solid var(--ink);
}

.academic-table,
.academic-table tbody {
  display: block;
  width: 100%;
}

.academic-table {
  border-collapse: collapse;
}

.academic-table thead {
  display: none;
}

.academic-table tbody {
  display: grid;
  gap: 10px;
  padding-top: 10px;
}

.academic-table tr {
  display: grid;
}

.academic-table td {
  display: block;
  padding: 0;
  border: 0;
  text-align: left;
}

.topic-table-row {
  position: relative;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 18px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--white);
}

.topic-table-row td:first-child {
  grid-column: 1 / -1;
  padding-right: 28px;
}

.topic-table-row td:first-child a {
  display: flex;
  gap: 9px;
  align-items: baseline;
  text-decoration: none;
}

.topic-table-row td:first-child a::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
}

.topic-table-row td:nth-child(2) {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--ink);
  font-weight: 700;
}

.topic-table-row td:nth-child(2)::before {
  color: var(--muted);
  content: attr(data-label);
  font-size: .67rem;
  font-weight: 400;
  text-transform: uppercase;
}

.topic-table-row td:nth-child(3) {
  grid-column: 1 / -1;
}

.topic-table-row td:last-child {
  position: absolute;
  top: 12px;
  right: 14px;
}

.topic-table-row td:last-child a {
  display: flex;
  width: 32px;
  min-height: 44px;
  align-items: center;
  justify-content: flex-end;
}

.topic-code {
  flex: 0 0 auto;
  min-width: 32px;
  color: var(--muted);
  font: .67rem system-ui;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: .68rem;
}

.progress-track {
  height: 5px;
  overflow: hidden;
  background: var(--soft-line);
}

.progress-track span {
  display: block;
  height: 100%;
  background: var(--progress);
}

.topic-heading,
.study-heading {
  display: flex;
  align-items: stretch;
  flex-direction: column;
  gap: 22px;
  margin-bottom: 28px;
}

.topic-heading h1 {
  font-size: clamp(1.65rem, 7.5vw, 2.05rem);
}

.topic-heading form,
.topic-heading form .button {
  width: 100%;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border: 1px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  background: var(--white);
  font-weight: 700;
  cursor: pointer;
}

.button.primary {
  color: #fff;
  background: var(--ink);
}

.button:active {
  filter: contrast(.8);
}

.button:disabled {
  cursor: not-allowed;
  opacity: .35;
}

.progress-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 30px;
  padding: 18px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
}

.progress-summary > div:not(.wide-progress) strong,
.progress-summary > div:not(.wide-progress) span {
  display: block;
}

.progress-summary > div:not(.wide-progress) strong {
  font: 700 1.35rem Georgia, serif;
}

.progress-summary > div:not(.wide-progress) span {
  color: var(--muted);
  font-size: .68rem;
}

.wide-progress {
  grid-column: 1 / -1;
}

.color-progress {
  color: var(--progress) !important;
}

.color-correct {
  color: var(--correct) !important;
}

.color-error {
  color: var(--error) !important;
}

.question-list {
  border-top: 1px solid var(--ink);
}

.question-row {
  display: grid;
  grid-template-areas:
    "number state"
    "content content";
  grid-template-columns: 1fr auto;
  gap: 10px 14px;
  padding: 18px 14px;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
  background: var(--white);
  color: inherit;
  text-decoration: none;
  transition: background .15s ease;
}

.question-row:hover,
.question-row:focus-visible {
  background: var(--paper);
}

.question-row.status-correct {
  border-left-color: var(--correct);
}

.question-row.status-error {
  border-left-color: var(--error);
}

.question-number {
  grid-area: number;
  color: var(--muted);
  font-size: .68rem;
}

.question-row > div:first-of-type {
  min-width: 0;
  grid-area: content;
}

.question-row h2 {
  margin-bottom: 7px;
  font: 600 .94rem/1.5 system-ui;
  overflow-wrap: anywhere;
}

.question-row p {
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
  overflow-wrap: anywhere;
}

.question-state {
  grid-area: state;
  text-align: right;
}

.question-state small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: .65rem;
}

.status-badge {
  font-size: .7rem;
  font-weight: 700;
}

.status-badge.correct {
  color: var(--correct);
}

.status-badge.error {
  color: var(--error);
}

.status-badge.unanswered {
  color: var(--muted);
}

.study-heading h1 {
  margin: 0;
  font-size: clamp(1.55rem, 7vw, 1.95rem);
}

.session-counts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  color: var(--muted);
  font-size: .66rem;
}

.session-counts span {
  display: flex;
  flex-direction: column;
}

.session-counts strong {
  color: var(--ink);
  font-size: .95rem;
}

.study-card {
  padding: 22px 15px;
  border: 1px solid var(--ink);
  background: var(--white);
}

.question-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: .66rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.question-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.question-meta span:last-child {
  text-align: right;
}

.study-card > h2 {
  max-width: 920px;
  margin: 22px 0 26px;
  font: 600 .96rem/1.5 system-ui;
  overflow-wrap: anywhere;
}

.answer-options {
  display: grid;
  gap: 10px;
}

.answer-option {
  display: grid;
  min-height: 56px;
  grid-template-columns: 24px 24px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 14px 12px;
  border: 1px solid var(--line);
  cursor: pointer;
  font-size: .92rem;
  line-height: 1.45;
}

.answer-option:has(input:checked) {
  border-color: var(--ink);
}

.answer-option.is-correct {
  border-color: var(--correct);
  background: var(--correct-soft);
}

.answer-option.is-error {
  border-color: var(--error);
  background: var(--error-soft);
}

.answer-option input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--ink);
}

.option-letter {
  font-weight: 800;
}

.answer-option span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.answer-feedback {
  margin: 24px 0 0;
  padding: 16px;
  border-left: 4px solid;
}

.answer-feedback.correct {
  border-color: var(--correct);
  background: var(--correct-soft);
}

.answer-feedback.error {
  border-color: var(--error);
  background: var(--error-soft);
}

.answer-feedback p {
  margin: 9px 0 0;
  overflow-wrap: anywhere;
}

.answer-feedback .reference {
  color: var(--muted);
  font-size: .82rem;
}

.answer-content-links {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid currentColor;
}

.answer-content-links ul {
  margin: 7px 0 0;
  padding-left: 20px;
}

.answer-content-links a {
  font-weight: 700;
}

.topic-heading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.topic-content-heading {
  display: flex;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
}

.topic-content-heading > div {
  max-width: 760px;
}

.content-review,
.section-source {
  color: var(--muted);
  font-size: .85rem;
}

.topic-content-layout {
  display: grid;
  grid-template-columns: minmax(210px, 270px) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
}

.topic-content-index {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
}

.topic-content-index summary {
  font-weight: 800;
  cursor: pointer;
}

.topic-content-index section {
  margin-top: 16px;
}

.topic-content-index ul {
  margin: 7px 0 0;
  padding-left: 18px;
}

.topic-content-index li + li {
  margin-top: 5px;
}

.topic-content-document {
  min-width: 0;
}

.topic-content-group {
  margin-bottom: 48px;
}

.topic-content-group > h2 {
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
}

.topic-content-section {
  scroll-margin-top: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.topic-content-section h3 {
  margin-bottom: 12px;
}

.content-summary p,
.legal-text p {
  margin: 0 0 10px;
}

.legal-text {
  margin: 16px 0 0;
  padding: 14px 16px;
  border-left: 3px solid var(--progress);
  background: var(--progress-soft);
  font-style: normal;
}

@media (max-width: 760px) {
  .topic-content-heading {
    display: block;
  }

  .topic-content-heading .button {
    width: 100%;
    margin-top: 12px;
  }

  .topic-content-layout {
    display: block;
  }

  .topic-content-index {
    position: static;
    max-height: none;
    margin-bottom: 28px;
  }
}

.study-action-bar {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--ink);
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, .08);
}

.study-action-bar form,
.study-action-bar .button {
  width: 100%;
}

.noscript-action {
  margin-top: 20px;
}

.noscript-action .button {
  width: 100%;
}

.finish-form {
  margin-top: 24px;
  text-align: center;
}

.finish-form .text-button {
  min-height: 44px;
}

.empty-state {
  padding: 44px 16px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.empty-state h2 {
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--muted);
}

.messages {
  margin-bottom: 20px;
}

.message {
  padding: 12px 14px;
  border-left: 3px solid var(--progress);
  background: var(--progress-soft);
  overflow-wrap: anywhere;
}

.message.success {
  border-color: var(--correct);
  background: var(--correct-soft);
}

.message.error {
  border-color: var(--error);
  background: var(--error-soft);
}

.auth-card {
  width: min(100%, 440px);
  margin: 3vh auto;
  padding: 26px 20px;
  border: 1px solid var(--ink);
  background: var(--white);
}

.auth-card .eyebrow {
  color: var(--muted);
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.auth-card .muted {
  color: var(--muted);
}

.stack-form {
  display: grid;
  gap: 12px;
}

.stack-form label {
  font-size: .8rem;
  font-weight: 700;
}

.stack-form input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
}

.stack-form .button {
  width: 100%;
  margin-top: 4px;
}

@media (hover: hover) {
  .opposition-row:hover,
  .topic-table-row:hover {
    background: var(--white);
  }

  .button:hover {
    filter: contrast(.8);
  }

  .topic-table td:first-child a:hover strong {
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}

@media (min-width: 768px) {
  h1 {
    font-size: clamp(2.2rem, 5vw, 3.2rem);
  }

  .site-header {
    min-height: 52px;
    gap: 24px;
    padding: 0 max(24px, calc((100vw - 1120px) / 2));
  }

  .brand {
    font-size: 1.1rem;
  }

  .header-actions {
    gap: 22px;
    font-size: .85rem;
  }

  .mobile-label {
    display: none;
  }

  .desktop-label {
    display: inline;
  }

  .page-shell {
    width: min(1120px, calc(100% - 48px));
    min-height: calc(100vh - 130px);
    padding: 22px 0 72px;
  }

  .study-page .page-shell {
    padding-bottom: 80px;
  }

  .study-page .site-footer {
    padding-bottom: 16px;
  }

  .page-heading {
    margin-bottom: 34px;
  }

  .breadcrumbs {
    gap: 9px;
    margin-bottom: 36px;
    font-size: .8rem;
  }

  .opposition-row {
    grid-template-columns: minmax(0, 1fr) auto 32px;
    gap: 30px;
    padding: 22px 8px;
  }

  .opposition-row > div:first-child {
    position: relative;
    padding-left: 52px;
  }

  .row-index {
    display: inline;
    position: absolute;
    top: 5px;
    left: 0;
    color: var(--muted);
    font: .75rem system-ui;
  }

  .opposition-row h2 {
    font-size: 1.3rem;
  }

  .opposition-row dl {
    grid-column: auto;
    gap: 28px;
    margin: 0;
  }

  .opposition-row .row-arrow {
    grid-column: auto;
    grid-row: auto;
  }

  .detail-heading {
    margin-bottom: 38px;
  }

  .detail-heading h1 {
    font-size: clamp(2.25rem, 4vw, 2.8rem);
  }

  .opposition-actions {
    max-width: 760px;
  }

  .detail-grid > div {
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 24px;
  }

  .detail-grid dd {
    font-size: .88rem;
  }

  .section-title > div {
    display: flex;
    align-items: baseline;
    gap: 14px;
  }

  .section-title h2 {
    margin: 0;
    font-size: 1.2rem;
  }

  .academic-table-wrap {
    overflow-x: auto;
  }

  .academic-table {
    display: table;
    background: var(--white);
  }

  .academic-table thead {
    display: table-header-group;
  }

  .academic-table tbody {
    display: table-row-group;
    padding: 0;
  }

  .academic-table tr,
  .topic-table-row {
    display: table-row;
    position: static;
    padding: 0;
    border: 0;
  }

  .academic-table th,
  .academic-table td {
    display: table-cell;
    padding: 16px 14px;
    border-bottom: 1px solid var(--soft-line);
    text-align: left;
  }

  .academic-table th {
    color: var(--muted);
    font-size: .68rem;
    letter-spacing: .09em;
    text-transform: uppercase;
  }

  .topic-table th:nth-child(2),
  .topic-table td:nth-child(2) {
    width: 100px;
    text-align: center;
  }

  .topic-table th:nth-child(3),
  .topic-table td:nth-child(3) {
    width: 210px;
  }

  .topic-table th:last-child,
  .topic-table td:last-child {
    position: static;
    width: 44px;
    text-align: right;
  }

  .topic-table-row td:first-child,
  .topic-table-row td:nth-child(3) {
    padding: 16px 14px;
  }

  .topic-table-row td:first-child a {
    gap: 12px;
  }

  .topic-table-row td:first-child a::after,
  .topic-table-row td:nth-child(2)::before {
    display: none;
  }

  .topic-table-row td:nth-child(2) {
    display: table-cell;
    color: inherit;
    font-weight: 400;
  }

  .topic-table-row td:last-child a {
    display: inline;
    width: auto;
    min-height: 0;
  }

  .topic-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 40px;
    align-items: end;
    margin-bottom: 36px;
  }

  .topic-heading h1 {
    font-size: clamp(1.9rem, 3.5vw, 2.5rem);
  }

  .topic-heading form,
  .topic-heading form .button {
    width: auto;
  }

  .progress-summary {
    grid-template-columns: repeat(4, auto) minmax(180px, 1fr);
    gap: 26px;
    margin-bottom: 38px;
    padding: 20px 0;
  }

  .wide-progress {
    grid-column: auto;
  }

  .question-row {
    grid-template-areas: "number content state";
    grid-template-columns: 42px minmax(0, 1fr) 130px;
    gap: 18px;
    padding: 22px 8px;
  }

  .question-row h2 {
    font-size: 1rem;
  }

  .question-state small {
    margin-top: 5px;
    font-size: .68rem;
  }

  .study-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    flex-direction: row;
    gap: 30px;
    margin-bottom: 28px;
  }

  .study-heading h1 {
    font-size: clamp(1.7rem, 3.5vw, 2.15rem);
  }

  .session-counts {
    display: flex;
    gap: 18px;
    white-space: nowrap;
    font-size: .72rem;
  }

  .session-counts span {
    display: inline;
  }

  .session-counts strong {
    font-size: 1rem;
  }

  .study-card {
    padding: clamp(30px, 5vw, 52px);
  }

  .study-card > h2 {
    margin: 26px 0 30px;
    font-size: clamp(1.08rem, 2vw, 1.25rem);
  }

  .answer-options {
    margin-bottom: 0;
  }

  .answer-option {
    grid-template-columns: 22px 28px minmax(0, 1fr);
    gap: 10px;
    padding: 14px;
    font-size: 1rem;
    line-height: 1.55;
  }

  .answer-feedback {
    margin: 26px 0 0;
    padding: 18px 20px;
  }

  .study-action-bar {
    position: static;
    display: flex;
    justify-content: flex-start;
    padding: 20px 0 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .study-action-bar form,
  .study-action-bar .button {
    width: auto;
  }

  .auth-card {
    margin: 7vh auto;
    padding: 38px;
  }
}

@media (min-width: 1024px) {
  .page-shell {
    padding-top: 24px;
    padding-bottom: 80px;
  }
}

.section-tabs {
  display: flex;
  gap: 24px;
  margin: -6px 0 34px;
  border-bottom: 1px solid var(--line);
}

.section-tabs a {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 750;
  text-decoration: none;
}

.section-tabs a[aria-current="page"] {
  border-bottom-color: var(--ink);
  color: var(--ink);
}

.exam-list-heading h2 {
  margin-bottom: 8px;
  font-size: clamp(1.4rem, 6vw, 1.8rem);
}

.active-session-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
  padding: 18px;
  border: 1px solid var(--progress);
  background: var(--progress-soft);
}

.active-session-banner div,
.active-session-banner strong,
.active-session-banner small {
  display: block;
}

.active-session-banner .kicker {
  margin-bottom: 3px;
}

.active-session-banner small,
.muted-copy,
.score-note {
  color: var(--muted);
}

.exam-heading > p:last-of-type {
  color: var(--muted);
}

.official-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 16px;
  font-size: .82rem;
  font-weight: 700;
}

.official-links a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}

.exam-summary-grid,
.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 36px;
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--line);
}

.exam-summary-grid > div,
.result-grid > div {
  padding: 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.exam-summary-grid span,
.result-grid span {
  display: block;
  color: var(--muted);
  font-size: .66rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.exam-summary-grid strong,
.result-grid strong {
  display: block;
  margin-top: 5px;
  font: 700 1.2rem Georgia, serif;
}

.exam-mode-section,
.attempt-history,
.result-review {
  margin-top: 40px;
}

.mode-grid {
  display: grid;
  gap: 14px;
}

.mode-card {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  flex-direction: column;
  gap: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--white);
}

.mode-card.active {
  border-color: var(--progress);
  background: var(--progress-soft);
}

.mode-card h3 {
  margin: 0 0 8px;
  font: 700 1.15rem Georgia, serif;
}

.mode-card p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: .85rem;
}

.mode-card form,
.mode-card .button {
  width: 100%;
}

.status-pill {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--progress);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  font-size: .78rem;
}

.history-table th,
.history-table td {
  padding: 12px;
  border-bottom: 1px solid var(--soft-line);
  text-align: left;
}

.history-table th {
  color: var(--muted);
  font-size: .65rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.exam-session-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.exam-session-header h1 {
  margin: 0;
  font-size: clamp(1.35rem, 5vw, 1.8rem);
}

.exam-session-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: .72rem;
}

#exam-countdown {
  min-width: 76px;
  color: var(--ink);
  font: 700 1.15rem ui-monospace, SFMono-Regular, Consolas, monospace;
  text-align: right;
}

#exam-countdown.is-urgent {
  color: var(--error);
}

.exam-layout {
  width: min(100%, 940px);
  margin: 0 auto;
}

.exam-card {
  padding: 20px 15px;
}

.exam-navigation,
.exam-finish-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.exam-navigation {
  position: sticky;
  z-index: 5;
  bottom: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(10px);
}

.exam-navigation-side {
  display: flex;
  gap: 8px;
}

.exam-navigation-side.end {
  justify-content: flex-end;
}

.exam-direction-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 9px 4px;
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 700;
  text-decoration: none;
}

.exam-direction-link.disabled {
  color: var(--muted);
  cursor: default;
  opacity: .5;
}

#exam-answer-form[aria-busy="true"] .answer-options {
  opacity: .68;
  pointer-events: none;
}

#answer-form[aria-busy="true"] .answer-options {
  opacity: .68;
  pointer-events: none;
}

.question-index-trigger {
  display: flex;
  min-width: 82px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 5px 10px;
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}

.question-index-trigger strong {
  font-size: .78rem;
}

.question-index-trigger span {
  color: var(--muted);
  font-size: .65rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.button.secondary {
  background: transparent;
}

.exam-finish-actions {
  align-items: flex-start;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: .78rem;
}

.exam-finish-actions form {
  margin: 0;
}

.exam-page .page-shell {
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

.question-index-dialog {
  width: min(calc(100% - 20px), 720px);
  max-width: none;
  max-height: min(86vh, 780px);
  margin: auto auto 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  background: var(--paper);
}

.question-index-dialog::backdrop {
  background: rgb(0 0 0 / .48);
  backdrop-filter: blur(2px);
}

.question-index-dialog[open] {
  display: flex;
  flex-direction: column;
}

.question-index-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.question-index-header .kicker {
  margin-bottom: 4px;
}

.question-index-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.dialog-close {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 1.7rem;
  line-height: 1;
}

.question-index-filters {
  display: flex;
  gap: 7px;
  padding: 12px 14px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.question-index-filters button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--white);
  cursor: pointer;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}

.question-index-filters button[aria-pressed="true"] {
  border-color: var(--ink);
  color: var(--white);
  background: var(--ink);
}

.question-index-filters button span {
  font-variant-numeric: tabular-nums;
}

.question-index-groups {
  min-height: 110px;
  flex: 1 1 auto;
  padding: 4px 14px 18px;
  overflow-y: auto;
}

.question-index-group {
  padding-top: 16px;
}

.question-index-group h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font: 750 .68rem system-ui;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.question-index-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.question-index-grid a {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--white);
  font-size: .72rem;
  font-weight: 700;
  text-decoration: none;
}

.question-index-grid a.status-answered {
  border-color: var(--progress);
  background: var(--progress-soft);
}

.question-index-grid a.status-correct {
  border-color: var(--correct);
  background: var(--correct-soft);
}

.question-index-grid a.status-error {
  border-color: var(--error);
  background: var(--error-soft);
}

.question-index-grid a.status-annulled {
  border-style: dashed;
  color: var(--error);
  background: var(--error-soft);
}

.question-index-grid a.is-current {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.question-index-grid a[hidden],
.question-index-group[hidden] {
  display: none;
}

.index-state {
  flex: 0 0 auto;
  font-size: .8rem;
}

.question-index-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--white);
  color: var(--muted);
  font-size: .67rem;
}

.question-index-legend b {
  color: var(--ink);
}

.session-footer {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  border-top: 1px solid var(--ink);
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, .1);
  backdrop-filter: blur(12px);
}

.session-progress {
  height: 4px;
  overflow: hidden;
  background: var(--soft-line);
}

.session-progress span {
  display: block;
  height: 100%;
  background: var(--progress);
  transition: width .2s ease;
}

.session-footer-inner {
  display: grid;
  width: min(100%, 1120px);
  min-height: 68px;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 4px;
  align-items: center;
  margin: 0 auto;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
}

.session-footer-side {
  display: flex;
  min-width: 0;
}

.session-footer-side.end {
  justify-content: flex-end;
}

.session-footer-side form {
  margin: 0;
}

.session-nav-button {
  display: inline-flex;
  min-width: 0;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 7px;
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: .76rem;
  font-weight: 750;
  line-height: 1.15;
  text-decoration: none;
}

.session-nav-button.primary {
  min-width: 94px;
  color: var(--white);
  background: var(--ink);
}

.session-nav-button.disabled {
  color: var(--muted);
  cursor: default;
  opacity: .45;
}

.session-status-trigger {
  display: flex;
  min-width: 112px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 5px 8px;
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  line-height: 1.2;
}

.session-status-trigger strong {
  font-size: .8rem;
}

.session-status-trigger span {
  margin-top: 3px;
  color: var(--muted);
  font-size: .61rem;
  white-space: nowrap;
}

.session-status-trigger span b {
  color: inherit;
}

.session-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
  color: var(--muted);
  font-size: .68rem;
}

.session-summary span,
.session-summary strong {
  display: block;
}

.session-summary strong {
  color: var(--ink);
  font-size: 1rem;
}

.session-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: var(--white);
}

.session-dialog-actions.split {
  align-items: stretch;
  flex-direction: column;
}

.session-dialog-actions form {
  margin: 0;
}

.session-dialog-actions .button {
  min-height: 44px;
}

.session-dialog-actions .text-button {
  min-height: 44px;
}

.session-dialog-actions.split form,
.session-dialog-actions.split .button {
  width: 100%;
}

.score-note {
  max-width: 760px;
  margin: -18px 0 36px;
  font-size: .8rem;
}

.review-question {
  margin-bottom: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  background: var(--white);
}

.review-question.is-correct {
  border-left-color: var(--correct);
}

.review-question.is-error,
.review-question.is-annulled {
  border-left-color: var(--error);
}

.review-question h3 {
  margin: 16px 0;
  font: 600 .94rem/1.5 system-ui;
}

.review-options {
  display: grid;
  gap: 5px;
}

.review-options p {
  margin: 0;
  padding: 8px 10px;
  font-size: .8rem;
}

.review-options p.is-correct {
  background: var(--correct-soft);
}

.review-options p.is-error:not(.is-correct) {
  background: var(--error-soft);
}

@media (min-width: 768px) {
  .exam-summary-grid,
  .result-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mode-card {
    padding: 28px;
  }

  .mode-card form,
  .mode-card .button {
    width: auto;
  }

  .exam-card {
    padding: clamp(28px, 4vw, 46px);
  }

  .exam-navigation {
    position: static;
    padding: 16px 0 0;
    border: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .exam-page .page-shell {
    padding-bottom: 80px;
  }

  .question-index-dialog {
    margin: auto;
  }

  .question-index-header {
    padding: 22px 24px;
  }

  .question-index-filters,
  .question-index-legend {
    padding-right: 24px;
    padding-left: 24px;
  }

  .question-index-groups {
    padding-right: 24px;
    padding-left: 24px;
  }

  .question-index-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .session-footer-inner {
    padding-right: 24px;
    padding-left: 24px;
  }

  .session-nav-button {
    padding-right: 14px;
    padding-left: 14px;
    font-size: .82rem;
  }

  .session-status-trigger {
    min-width: 160px;
  }

  .session-dialog-actions.split {
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
  }

  .session-dialog-actions.split form,
  .session-dialog-actions.split .button {
    width: auto;
  }
}

@media (max-width: 360px) {
  .session-footer-inner {
    padding-right: 6px;
    padding-left: 6px;
  }

  .session-nav-button {
    padding-right: 5px;
    padding-left: 5px;
    font-size: .69rem;
  }

  .session-nav-button.primary {
    min-width: 82px;
  }

  .session-status-trigger {
    min-width: 100px;
    padding-right: 3px;
    padding-left: 3px;
  }

  .session-status-trigger span {
    font-size: .56rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
