
:root {
  color-scheme: light;
  --bg: #f4f7f8;
  --bg-deep: #e7edf1;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-solid: #ffffff;
  --panel-tint: #f8fbfc;
  --border: rgba(20, 33, 51, 0.1);
  --border-strong: rgba(20, 33, 51, 0.16);
  --text: #132235;
  --muted: #657489;
  --accent: #215cff;
  --accent-strong: #173fc5;
  --accent-soft: #ebf1ff;
  --accent-soft-strong: #dbe6ff;
  --accent-alt: #0e8b8d;
  --accent-alt-soft: #e7f8f7;
  --success: #15803d;
  --success-soft: #eaf8ef;
  --warning-bg: #fff3df;
  --warning-text: #975406;
  --danger: #c2410c;
  --danger-soft: #fff2e8;
  --shadow-lg: 0 16px 44px rgba(16, 30, 46, 0.08);
  --shadow-md: 0 10px 24px rgba(16, 30, 46, 0.06);
  --shadow-sm: 0 6px 16px rgba(16, 30, 46, 0.05);
  --radius-xl: 18px;
  --radius-lg: 12px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --container: 1240px;
}
* {
  box-sizing: border-box;
}
html {
  min-height: 100%;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(243, 247, 248, 0.98) 46%, rgba(236, 242, 245, 1) 100%),
    linear-gradient(110deg, rgba(33, 92, 255, 0.04) 0%, transparent 28%, rgba(14, 139, 141, 0.04) 100%);
  -webkit-font-smoothing: antialiased;
}
body {
  margin: 0;
  min-height: 100vh;
  position: relative;
}
h1,
h2,
h3,
h4,
h5,
p,
ul,
ol {
  margin: 0;
}
a,
button,
summary,
input {
  font: inherit;
  color: inherit;
}
button {
  border: none;
  background: none;
}
input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1rem;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
input::placeholder {
  color: #8a9bb3;
}
input:focus {
  outline: none;
  border-color: rgba(20, 99, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(20, 99, 255, 0.12);
  background: #ffffff;
}
.site-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: -1;
}
.backdrop-orb {
  display: none;
}
.orb-one {
  width: 30rem;
  height: 30rem;
  top: -8rem;
  left: -8rem;
  background: radial-gradient(circle, rgba(20, 99, 255, 0.12) 0%, rgba(20, 99, 255, 0) 72%);
}
.orb-two {
  width: 28rem;
  height: 28rem;
  right: -9rem;
  top: 4rem;
  background: radial-gradient(circle, rgba(255, 132, 76, 0.1) 0%, rgba(255, 132, 76, 0) 70%);
}
.backdrop-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(19, 34, 53, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19, 34, 53, 0.028) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.16), transparent 76%);
}
.review-warning {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 0.95rem 1.25rem;
  background: rgba(255, 243, 223, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(151, 84, 6, 0.18);
  color: var(--warning-text);
}
.review-warning p {
  width: min(100% - 2rem, var(--container));
  margin: 0 auto;
  line-height: 1.55;
  font-size: 0.94rem;
}
.app-shell {
  width: min(100% - 2rem, var(--container));
  margin: 0 auto;
}
.workspace {
  display: grid;
  gap: 1.5rem;
}
.glass-card {
  border: 1px solid rgba(255, 255, 255, 0.68);
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-xl);
}
.context-header h2 {
  font-family: "Sora", "Plus Jakarta Sans", sans-serif;
  letter-spacing: -0.04em;
}
.panel-copy,
.context-copy,
.topbar-note {
  color: var(--muted);
  line-height: 1.7;
}
.question-list,
.nav-list,
.content,
.questions-panel {
  display: grid;
  gap: 1rem;
}
.panel-kicker,
.eyebrow,
.field-label,
.nav-kicker {
  display: inline-block;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.panel-kicker,
.eyebrow {
  color: var(--accent);
}
.field-label,
.nav-kicker {
  color: #667995;
}
.primary-btn,
.ghost-btn,
.solution-btn {
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}
.primary-btn {
  border-radius: 999px;
  padding: 0.95rem 1.2rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(180deg, #2969ff 0%, #215cff 100%);
  box-shadow: 0 10px 22px rgba(33, 92, 255, 0.18);
}
.primary-btn:hover,
.solution-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(33, 92, 255, 0.22);
}
.ghost-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
}
.ghost-btn:hover {
  border-color: rgba(20, 99, 255, 0.28);
  color: var(--accent);
  background: rgba(232, 241, 255, 0.88);
}
.compact-btn {
  padding: 0.72rem 0.95rem;
}
.sidebar,
.context-header {
  padding: 1.6rem;
}
.topbar,
.brand,
.topbar-meta,
.part-preview-head,
.part-heading,
.question-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.app-shell {
  padding: 2rem 0 3rem;
}
.topbar {
  justify-content: space-between;
  padding: 1.3rem 1.4rem;
  margin-bottom: 1.5rem;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.64);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-md);
}
.brand {
  gap: 0.95rem;
}
.brand-mark {
  width: 3rem;
  height: 3rem;
  border-radius: 0.9rem;
  background: linear-gradient(135deg, #215cff 0%, #0e8b8d 100%);
  box-shadow: 0 10px 22px rgba(19, 34, 53, 0.14);
  position: relative;
}
.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
}
.brand-mark::before {
  width: 1.3rem;
  height: 0.2rem;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
}
.brand-mark::after {
  width: 0.2rem;
  height: 1.3rem;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
}
.brand h1 {
  font-size: 1.35rem;
  font-family: "Sora", "Plus Jakarta Sans", sans-serif;
  letter-spacing: -0.03em;
}
.topbar-meta {
  justify-content: space-between;
  margin-left: auto;
}
.workspace {
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
  gap: 1.25rem;
}
.sidebar {
  position: sticky;
  top: 5.6rem;
  display: grid;
  gap: 1rem;
  max-height: calc(100vh - 7rem);
  overflow: auto;
}
.nav-overview {
  border-radius: var(--radius-md);
  background: rgba(248, 251, 252, 0.98);
  border: 1px solid rgba(20, 33, 51, 0.08);
  padding: 0.95rem 1rem;
}
.nav-overview h3 {
  margin-top: 0.35rem;
  font-size: 1rem;
  font-family: "Sora", "Plus Jakarta Sans", sans-serif;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.nav-overview-copy {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}
.nav-section {
  min-height: 0;
}
.nav-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.nav-section h3 {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.nav-count {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.nav-search {
  margin-bottom: 0.75rem;
  padding: 0.8rem 0.95rem;
  font-size: 0.92rem;
}
.nav-list-subjects {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.nav-list-units {
  display: grid;
  gap: 0.45rem;
  max-height: 48vh;
  overflow: auto;
  padding-right: 0.2rem;
}
.nav-list-parts {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.6rem;
  overflow: auto;
  padding-bottom: 0.15rem;
  scroll-snap-type: x proximity;
}
.nav-button {
  width: 100%;
  text-align: left;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 0.7rem 0.8rem;
  background: transparent;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}
.nav-button:hover {
  transform: translateY(-1px);
  border-color: rgba(20, 99, 255, 0.14);
  background: rgba(255, 255, 255, 0.72);
}
.nav-button.is-active {
  border-color: rgba(33, 92, 255, 0.18);
  background: rgba(245, 248, 255, 0.96);
  box-shadow: var(--shadow-sm);
}
.nav-button > span {
  display: block;
}
.nav-button.is-active .nav-kicker {
  color: var(--accent);
}
.nav-button-subject {
  width: auto;
  min-width: 0;
  border-radius: 999px;
  padding: 0.58rem 0.82rem;
  background: rgba(255, 255, 255, 0.82);
}
.nav-subject-name {
  font-weight: 700;
  font-size: 0.94rem;
  line-height: 1.25;
}
.nav-button-unit {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.7rem;
  padding: 0.68rem 0.76rem;
  border-radius: var(--radius-sm);
}
.unit-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  background: rgba(20, 99, 255, 0.08);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
}
.nav-main {
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}
.nav-title {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.25;
}
.nav-meta {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}
.nav-button-part {
  width: auto;
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 999px;
  padding: 0.64rem 0.88rem;
  background: rgba(255, 255, 255, 0.82);
  scroll-snap-align: start;
}
.nav-button-part .nav-kicker {
  margin: 0;
}
.nav-part-title {
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.25;
}
.nav-empty {
  margin: 0;
  padding: 0.85rem 0.95rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.context-header {
  display: grid;
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}
.quiz-switcher {
  display: grid;
  gap: 0.7rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(18, 35, 63, 0.08);
}
.question-jump {
  display: grid;
  gap: 0.7rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(18, 35, 63, 0.08);
}
.question-jump-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  overflow: auto;
  padding-bottom: 0.15rem;
}
.question-jump-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  min-width: 2.35rem;
  height: 2.35rem;
  padding: 0 0.8rem;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}
.question-jump-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(33, 92, 255, 0.18);
  background: rgba(245, 248, 255, 0.96);
  color: var(--accent);
}
.question-jump-btn.is-active {
  border-color: rgba(33, 92, 255, 0.2);
  background: rgba(235, 241, 255, 0.96);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.context-header h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.02;
}
.question-card {
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.question-card.has-parts {
  overflow: visible;
}
.question-header {
  align-items: flex-start;
  padding: 1.5rem;
}
.question-card.has-parts .question-header {
  position: sticky;
  top: 0.85rem;
  z-index: 4;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(20, 33, 51, 0.08);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: 0 8px 18px rgba(18, 35, 63, 0.05);
}
.question-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #163c95, #215cff);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 800;
  flex-shrink: 0;
}
.question-copy {
  flex: 1;
  display: grid;
  gap: 1rem;
}
.question-figure {
  margin: 0;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(20, 33, 51, 0.08);
  background: rgba(249, 251, 252, 0.96);
  display: grid;
  gap: 0.65rem;
}
.question-figure img,
.question-figure svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius-lg) - 0.35rem);
  background: #ffffff;
}
.question-figure figcaption {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted);
}
.question-figure-html {
  overflow-x: auto;
}
.quiz-table-wrap {
  width: 100%;
}
.quiz-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 18rem;
  background: rgba(255, 255, 255, 0.96);
  border-radius: calc(var(--radius-lg) - 0.25rem);
  overflow: hidden;
}
.quiz-table th,
.quiz-table td {
  padding: 0.7rem 0.8rem;
  text-align: center;
  border: 1px solid rgba(18, 35, 63, 0.08);
}
.quiz-table th {
  font-weight: 800;
  color: var(--text);
  background: rgba(33, 92, 255, 0.06);
}
.question-card.has-parts .question-copy h4 {
  max-width: 68ch;
}
.question-copy h4,
.part-heading h5 {
  font-size: 1rem;
  line-height: 1.7;
  font-weight: 500;
}
.question-parts {
  display: grid;
  gap: 0.9rem;
}
.part-preview,
.steps-box {
  border-radius: var(--radius-lg);
}
.part-preview {
  border: 1px solid rgba(20, 33, 51, 0.08);
  background: rgba(249, 251, 252, 0.96);
  padding: 1rem;
  display: grid;
  gap: 1rem;
  scroll-margin-top: 8rem;
}
.part-details {
  display: grid;
  gap: 0.9rem;
}
.part-solution-btn {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border-radius: 999px;
  padding: 0.78rem 1rem;
  border: 1px solid rgba(20, 99, 255, 0.14);
  background: rgba(255, 255, 255, 0.94);
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}
.part-solution-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(20, 99, 255, 0.22);
  background: rgba(236, 244, 255, 0.95);
  box-shadow: var(--shadow-sm);
}
.part-solution-btn::-webkit-details-marker {
  display: none;
}
.part-details[open] .part-solution-btn {
  background: rgba(236, 244, 255, 0.98);
  border-color: rgba(20, 99, 255, 0.22);
}
.part-preview-head,
.part-heading {
  align-items: flex-start;
}
.part-preview-copy {
  line-height: 1.65;
}
.part-walkthrough {
  display: grid;
  gap: 1rem;
}
.part-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(20, 99, 255, 0.14);
  font-weight: 800;
  flex-shrink: 0;
}
.mcq-options {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.8rem;
}
.mcq-option {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.95rem 1rem;
  background: rgba(255, 255, 255, 0.84);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}
.mcq-option:hover {
  transform: translateY(-1px);
  border-color: rgba(33, 92, 255, 0.22);
  background: rgba(245, 248, 255, 0.88);
}
.mcq-option.correct {
  border-color: rgba(21, 128, 61, 0.24);
  background: #e9f9ef;
  color: #166534;
}
.mcq-option.incorrect {
  border-color: rgba(194, 65, 12, 0.24);
  background: #fff1e8;
  color: #9a3412;
}
.mcq-letter {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  border: 1px solid rgba(95, 114, 143, 0.5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--muted);
  flex-shrink: 0;
}
.mcq-option.correct .mcq-letter {
  background: var(--success);
  border-color: var(--success);
  color: #ffffff;
}
.mcq-option.incorrect .mcq-letter {
  background: var(--danger);
  border-color: var(--danger);
  color: #ffffff;
}
.answer-check-form {
  display: grid;
  gap: 0.65rem;
  padding: 0.95rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(20, 99, 255, 0.12);
  background: rgba(255, 255, 255, 0.82);
}
.answer-check-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: center;
}
.answer-input {
  min-width: 0;
}

.context-header,
.question-card {
  scroll-margin-top: 7.5rem;
}

.question-copy h4 > .katex,
.part-preview-copy > .katex,
.steps-list .katex,
.mcq-option .katex,
.answer-box .katex {
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  vertical-align: middle;
  padding-block: 0.2em;
}
.answer-feedback {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--muted);
}
.answer-feedback.is-match {
  color: var(--success);
  font-weight: 600;
}
.answer-feedback.is-close {
  color: #b45309;
  font-weight: 600;
}
.answer-feedback.is-miss {
  color: var(--danger);
  font-weight: 600;
}
.solution-details {
  border-top: 1px solid rgba(18, 35, 63, 0.08);
  background: rgba(252, 253, 254, 0.96);
  padding: 1.35rem 1.5rem 1.5rem;
}
.solution-btn {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.85rem 1.1rem;
  background: linear-gradient(180deg, #2969ff 0%, #215cff 100%);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(33, 92, 255, 0.18);
}
.solution-btn::-webkit-details-marker {
  display: none;
}
.question-body {
  display: grid;
  gap: 1.2rem;
  padding-top: 1.35rem;
}
.part-solution {
  display: grid;
  gap: 1rem;
  padding-top: 1.35rem;
  border-top: 1px solid rgba(18, 35, 63, 0.08);
}
.part-solution:first-child {
  padding-top: 0;
  border-top: none;
}
.steps-box {
  background: rgba(246, 249, 251, 0.98);
  padding: 1.2rem;
  border: 1px solid rgba(20, 33, 51, 0.08);
}
.steps-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.95rem;
}
.steps-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  line-height: 1.7;
}
.step-num {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(20, 33, 51, 0.1);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
}
.answer-box {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(33, 92, 255, 0.12);
  background: rgba(241, 246, 255, 0.98);
  padding: 1rem 1.1rem;
}
.answer-box > span {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.answer-box > strong {
  display: block;
  font-size: 1.15rem;
  line-height: 1.45;
}
.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.15rem;
}

@media (max-width: 1080px) {
.workspace {
    grid-template-columns: 1fr;
  }
.sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 820px) {
.app-shell {
    width: min(100% - 1rem, var(--container));
  }
.sidebar,
.context-header {
    padding: 1.3rem;
  }
.topbar,
.topbar-meta {
    flex-direction: column;
    align-items: flex-start;
  }
.question-header,
.part-preview-head,
.part-heading {
    flex-direction: column;
    gap: 0.8rem;
  }
.question-card.has-parts .question-header {
    top: 0.75rem;
  }
.answer-check-row {
    grid-template-columns: 1fr;
  }
.solution-btn,
.part-solution-btn,
.primary-btn,
.ghost-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 560px) {
.review-warning {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
.question-header,
.solution-details {
    padding-left: 1rem;
    padding-right: 1rem;
  }
.question-card.has-parts .question-header {
    top: 0.6rem;
  }
.question-card,
.glass-card {
    border-radius: 16px;
  }
}

.archive-status { display: grid; gap: 1rem; padding: 1.6rem; color: var(--muted); }
[hidden] { display: none !important; }

.study-disclaimer {
  width: min(38rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  padding: clamp(1.4rem, 4vw, 2.4rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--panel-solid);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.study-disclaimer::backdrop {
  background: rgba(19, 34, 53, 0.65);
  backdrop-filter: blur(5px);
}

.study-disclaimer h2 {
  margin-top: 0.6rem;
  font-family: "Sora", "Plus Jakarta Sans", sans-serif;
  font-size: clamp(1.5rem, 4vw, 2rem);
  letter-spacing: -0.04em;
}

.study-disclaimer p:not(.eyebrow) {
  margin-top: 1rem;
  color: var(--muted);
  line-height: 1.7;
}

.study-disclaimer .primary-btn {
  width: 100%;
  margin-top: 1.5rem;
}

.study-disclaimer .primary-btn:focus-visible {
  outline: 3px solid var(--accent-alt);
  outline-offset: 4px;
}

/* Study library: readable sets, clear course order, and generous working space. */
.course-summary {
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.77rem;
  font-weight: 700;
  line-height: 1.6;
  color: var(--accent-strong);
}

.nav-button .nav-main { display: grid; }
.nav-list-units { max-height: none; overflow: visible; }
.brand h1:focus { outline: none; }
.unit-toggle { display: none; }

.study-position {
  width: fit-content;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 800;
}

.nav-list-parts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: visible;
  gap: 0.65rem;
}

.nav-button-part {
  display: grid;
  align-content: start;
  gap: 0.45rem;
  min-width: 0;
  width: 100%;
  padding: 1rem;
  text-align: left;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: background 0.15s, border-color 0.15s;
}

.nav-button-part.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-part-title {
  white-space: normal;
  line-height: 1.5;
  font-size: 0.88rem;
}

.nav-part-count {
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 500;
}

.content,
.questions-panel,
.context-header,
.question-copy {
  min-width: 0;
}

.question-copy h4 {
  font-size: 1.04rem;
  font-weight: 600;
  line-height: 1.8;
}

.question-card.has-parts .question-header {
  position: static;
}

.question-jump-list {
  flex-wrap: wrap;
  overflow: visible;
}

.question-figure img {
  width: 100%;
  max-width: 680px;
  max-height: 720px;
  object-fit: contain;
  margin: 0 auto;
}

.question-figure {
  overflow: auto;
}

.study-table-wrap {
  overflow-x: auto;
  max-width: 100%;
}

.study-table {
  border-collapse: collapse;
  width: 100%;
  min-width: max-content;
  font-size: 0.9rem;
  text-align: center;
  background: white;
}

.study-table caption {
  padding: 0 0 0.75rem;
  text-align: left;
  color: var(--muted);
  font-size: 0.78rem;
}

.study-table th,
.study-table td {
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border-strong);
}

.study-table th {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.study-table tr:nth-child(even) {
  background: var(--panel-tint);
}

.source-notice {
  padding: 0.9rem 1rem;
  border-left: 3px solid #d59a32;
  background: var(--warning-bg);
  color: var(--warning-text);
  font-size: 0.87rem;
  line-height: 1.65;
}

.study-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem;
}

.study-pagination span {
  color: var(--muted);
  font-size: 0.8rem;
}

button:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

button:focus-visible,
.mcq-option:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid var(--accent-alt);
  outline-offset: 3px;
}

.multi-select-hint,
.multi-feedback {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.mcq-option.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.mcq-option.correct {
  border-color: var(--success);
  background: var(--success-soft);
}

.mcq-option.incorrect {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.mcq-option > div,
.steps-list li > div:last-child,
.part-preview-copy,
.answer-box {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mcq-option {
  overflow-x: auto;
}

.katex-display {
  max-width: 100%;
}

@media (max-width: 560px) {
  .nav-list-parts { grid-template-columns: 1fr; }
  .context-header h2 { font-size: 1.65rem; line-height: 1.2; }
  .question-copy h4 { font-size: 0.98rem; }
  .question-figure { padding: 0.5rem; }
  .study-pagination { display: grid; grid-template-columns: 1fr 1fr; }
  .study-pagination span { grid-column: 1 / -1; grid-row: 1; text-align: center; }
  .study-pagination button { height: 100%; font-size: 0.85rem; }
}

@media (max-width: 1080px) {
  .unit-toggle { display: block; text-align: left; border-radius: var(--radius-sm); }
  .unit-navigation:not(.is-expanded) { display: none; }
  .sidebar { grid-template-columns: 1fr; }
  .sidebar .nav-overview { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
