/* Shared styles for every FE exam section. */
:root {
  color-scheme: light;
  --paper: #f6f7f2;
  --white: #fff;
  --ink: #202521;
  --muted: #747b74;
  --line: #e4e8e0;
  --green: #28734f;
  --green-light: #e8f2e9;
  --orange: #f17951;
  --yellow: #eac95b;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "DM Sans", sans-serif; }
button { font: inherit; }
.display { font-family: "Space Grotesk", sans-serif; }
.mono { font-family: "DM Mono", monospace; }
.app-shell { min-height: 100vh; }
.sidebar { width: 236px; }
.nav-link { transition: background .18s ease, color .18s ease; }
.nav-link.active { color: var(--green); background: var(--green-light); }
.nav-link:hover:not(.active) { background: #f1f3ee; }
.preset-chip { height: 40px; min-width: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #687168; font-size: 12px; font-weight: 600; transition: background .16s ease, border-color .16s ease, color .16s ease; }
.preset-chip:hover { border-color: #9fbaa5; }
.preset-chip[aria-pressed="true"] { border-color: var(--green); background: var(--green-light); color: var(--green); }
.chart-tab { transition: background .18s ease, border-color .18s ease, color .18s ease; }
.chart-tab:hover { border-color: #9fbaa5; }
.chart-tab[aria-selected="true"] { border-color: var(--green); background: var(--green-light); color: var(--green); }
.hero-wash { background: linear-gradient(112deg, #e8f1e8 0%, #edf3e8 52%, #f6f0d9 100%); }
.question-option { transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.question-option:hover { transform: translateY(-1px); border-color: #8caf98; }
.question-option.selected { border-color: var(--green); background: #f0f6ef; box-shadow: 0 0 0 1px var(--green); }
.question-option.correct { border-color: #32805a; background: #eaf5ed; }
.question-option.incorrect { border-color: #d77058; background: #fff0ea; }
#exam-flag.flagged { border-color: #f0b79f; background: #fff3ec; color: #b4532f; }
#question-timer.over-pace { background: #fff0ea; color: #a94f3e; }
#quiz-view.exam-mode #question-panel { grid-template-columns: minmax(0, 1fr); }
#quiz-view.exam-mode #question-panel > aside { display: none; }
.step-number { display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 25px; border-radius: 50%; background: #e8f2e9; color: var(--green); font: 500 12px "DM Mono", monospace; }
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 3px 0; }
.fade-up { animation: fade-up .35s ease both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
html { -webkit-text-size-adjust: 100%; }
#solution-steps p, #question-prompt, #solution-takeaway { overflow-x: auto; overflow-y: hidden; padding-block: 3px; }
/* Reference handbook panel (handbook.js): fixed beside the questions on wide screens, over them on smaller ones. */
#handbook-toggle[aria-pressed="true"] { border-color: var(--green); background: var(--green-light); color: var(--green); }
.hb-page-link { padding: 0; border: 0; background: none; color: #3d6e4b; font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.hb-page-link:hover { color: var(--green); }
.hb-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 45; display: flex; flex-direction: column; width: var(--hb-width, 46vw); border-left: 1px solid var(--line); background: #e9ece6; box-shadow: -8px 0 24px rgba(32, 37, 33, .06); }
.hb-panel[hidden] { display: none; }
@media (min-width: 1100px) {
  body.handbook-open main { margin-right: var(--hb-width, 46vw); }
  body.handbook-open #question-panel { grid-template-columns: minmax(0, 1fr); }
  body.handbook-open #question-panel > aside { display: none; }
}
@media (max-width: 1099px) { .hb-panel { left: 236px; width: auto; } .hb-resize { display: none; } }
@media (max-width: 767px) { .hb-panel { left: 0; z-index: 60; } }
.hb-resize { position: absolute; top: 0; bottom: 0; left: -5px; z-index: 6; width: 10px; cursor: col-resize; touch-action: none; }
.hb-resize:hover, .hb-resize.dragging { background: linear-gradient(90deg, transparent 4px, var(--green) 4px, var(--green) 6px, transparent 6px); }
.hb-toolbar { display: grid; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: #fff; }
.hb-row { display: flex; align-items: center; gap: 4px; min-width: 0; }
.hb-row2 { justify-content: space-between; gap: 8px; color: #687168; font-size: 11px; }
.hb-btn { display: inline-grid; flex: 0 0 32px; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 7px; background: none; color: #4f5650; cursor: pointer; }
.hb-btn:hover { background: #f1f3ee; }
.hb-btn[aria-pressed="true"] { background: var(--green-light); color: var(--green); }
.hb-btn svg { width: 16px; height: 16px; }
.hb-search { display: flex; flex: 1; align-items: center; gap: 6px; min-width: 0; height: 34px; margin: 0 2px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcf9; }
.hb-search:focus-within { border-color: var(--green); box-shadow: 0 0 0 2px #28734f22; }
.hb-search svg { flex: none; width: 15px; height: 15px; color: #8a9189; }
.hb-search input { flex: 1; min-width: 0; border: 0; outline: none; background: none; color: var(--ink); font: 13px "DM Sans", sans-serif; }
.hb-count { flex: none; color: #7d857d; font: 500 10px "DM Mono", monospace; white-space: nowrap; }
.hb-pagebox { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.hb-pagebox input { width: 50px; height: 28px; border: 1px solid var(--line); border-radius: 6px; outline: none; text-align: center; font: 500 12px "DM Mono", monospace; }
.hb-pagebox input:focus { border-color: var(--green); }
.hb-pagebox span { font-family: "DM Mono", monospace; }
.hb-zoom { display: flex; align-items: center; gap: 2px; }
.hb-zoom .hb-btn { flex-basis: 28px; width: 28px; height: 28px; }
.hb-zoom-label { min-width: 42px; text-align: center; font: 500 11px "DM Mono", monospace; }
.hb-text-btn { height: 28px; margin-left: 4px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #4f5650; font-size: 11px; font-weight: 600; cursor: pointer; }
.hb-text-btn[aria-pressed="true"] { border-color: var(--green); background: var(--green-light); color: var(--green); }
.hb-body { position: relative; display: flex; flex: 1; min-height: 0; }
.hb-sidebar { display: flex; flex: none; flex-direction: column; width: 280px; max-width: 86%; min-height: 0; border-right: 1px solid var(--line); background: #fff; }
.hb-panel:not(.hb-wide) .hb-sidebar { position: absolute; inset: 0 auto 0 0; z-index: 4; box-shadow: 8px 0 22px rgba(32, 37, 33, .1); }
.hb-sidebar[hidden] { display: none; }
.hb-tabs { display: flex; border-bottom: 1px solid var(--line); }
.hb-tabs button { flex: 1; height: 38px; border: 0; border-bottom: 2px solid transparent; background: none; color: #858c84; font-size: 12px; font-weight: 600; cursor: pointer; }
.hb-tabs button[aria-selected="true"] { border-bottom-color: var(--green); color: var(--green); }
.hb-list { flex: 1; overflow: auto; padding: 6px; }
.hb-list[hidden] { display: none; }
.hb-list ul { margin: 0; padding: 0; list-style: none; }
.hb-list ul ul { padding-left: 14px; }
.hb-ol-row { display: flex; align-items: flex-start; }
.hb-ol-twisty, .hb-ol-pad { flex: 0 0 20px; height: 26px; }
.hb-ol-twisty { padding: 0; border: 0; background: none; color: #8a9189; font-size: 15px; line-height: 1; cursor: pointer; transition: transform .15s ease; }
.hb-ol-twisty[aria-expanded="true"] { transform: rotate(90deg); }
.hb-ol-link { flex: 1; min-width: 0; padding: 5px 6px; border: 0; border-radius: 5px; background: none; color: #424a43; font-size: 12px; line-height: 1.35; text-align: left; cursor: pointer; }
.hb-ol-link:hover, .hb-result:hover { background: #f1f3ee; }
.hb-result { display: block; width: 100%; margin-bottom: 2px; padding: 6px 8px; border: 0; border-radius: 6px; background: none; color: #505850; font-size: 11.5px; line-height: 1.45; text-align: left; cursor: pointer; }
.hb-result.current { background: var(--green-light); }
.hb-result b { display: block; color: var(--green); font: 500 10px "DM Mono", monospace; }
.hb-result mark { border-radius: 2px; background: #f6df8a; color: inherit; }
.hb-note { margin: 0; padding: 8px; color: #8a9189; font-size: 11.5px; line-height: 1.5; }
.hb-scroll { position: relative; flex: 1; min-width: 0; overflow: auto; padding: 12px; outline: none; overscroll-behavior: contain; }
.hb-page { position: relative; margin: 0 auto 12px; background: #fff; box-shadow: 0 1px 3px rgba(32, 37, 33, .16); }
.hb-page canvas { display: block; }
.hb-page-num { position: absolute; inset: 0; display: grid; place-items: center; color: #c0c5bd; font: 500 12px "DM Mono", monospace; }
.hb-page.ready .hb-page-num { display: none; }
.hb-hl-layer { position: absolute; inset: 0; pointer-events: none; }
.hb-hl { position: absolute; border-radius: 1px; background: rgba(240, 196, 40, .4); mix-blend-mode: multiply; transform-origin: 0 100%; }
.hb-hl.current { background: rgba(241, 121, 81, .5); outline: 1.5px solid #e0663e; }
.hb-empty { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; overflow: auto; padding: 20px; background: #f6f7f2; }
.hb-empty[hidden] { display: none; }
.hb-drop { max-width: 420px; padding: 28px 24px; border: 2px dashed #cfd6cb; border-radius: 14px; background: #fff; text-align: center; transition: border-color .15s ease, background .15s ease; }
.hb-empty.dragover .hb-drop { border-color: var(--green); background: var(--green-light); }
.hb-drop-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--green-light); color: var(--green); }
.hb-drop-icon svg { width: 22px; height: 22px; }
.hb-drop h2 { margin: 12px 0 6px; font: 600 17px "Space Grotesk", sans-serif; }
.hb-drop p { margin: 0; color: #6d756d; font-size: 12px; line-height: 1.55; }
.hb-primary { display: inline-flex; align-items: center; gap: 8px; height: 42px; margin-top: 16px; padding: 0 16px; border: 0; border-radius: 9px; background: var(--green); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; }
.hb-primary:hover { background: #205f41; }
.hb-primary svg { width: 16px; height: 16px; }
.hb-keep { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 12px; color: #4f5650; font-size: 12px; }
.hb-keep input { accent-color: var(--green); }
.hb-drop .hb-hint { margin-top: 12px; font-size: 11px; }
.hb-drop a { color: #477456; }
.hb-drop .hb-status { margin-top: 10px; color: #665a38; font-size: 12px; font-weight: 600; }
.hb-drop .hb-status.error { color: #a94f3e; }
.hb-filemenu { position: absolute; top: 6px; right: 8px; z-index: 7; width: 270px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 10px 28px rgba(32, 37, 33, .14); }
.hb-filemenu[hidden] { display: none; }
.hb-filename { margin: 0 0 6px; padding: 4px 6px; overflow: hidden; color: #858c84; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.hb-filemenu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px; border: 0; border-radius: 6px; background: none; color: #424a43; font-size: 12px; font-weight: 600; text-align: left; cursor: pointer; }
.hb-filemenu button:hover { background: #f1f3ee; }
.hb-filemenu button svg { width: 15px; height: 15px; }
.hb-filemenu .hb-danger { color: #a94f3e; }

/* Study schedule print-out: built off screen by planner.js, shown only when printing from the schedule page. */
#plan-print { display: none; }
@media print {
  @page { size: letter landscape; margin: 0.35in; }
  body.print-plan { background: #fff; }
  body.print-plan > :not(#plan-print) { display: none !important; }
  body.print-plan #plan-print { display: block; }
  #plan-print, #plan-print * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.pp-page { display: flex; flex-direction: column; height: 7.7in; break-after: page; page-break-after: always; color: #202521; font-family: "DM Sans", sans-serif; }
.pp-page:last-child { break-after: auto; page-break-after: auto; }
.pp-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 8px; padding-bottom: 7px; border-bottom: 2px solid #28734f; }
.pp-brand { color: #28734f; font: 500 7.5pt "DM Mono", monospace; letter-spacing: .12em; text-transform: uppercase; }
.pp-head h1 { margin: 3px 0 0; font: 600 21pt/1.1 "Space Grotesk", sans-serif; letter-spacing: -.01em; }
.pp-meta { color: #5d655e; font-size: 8pt; line-height: 1.5; text-align: right; }
.pp-grid { display: grid; flex: 1; min-height: 0; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: auto; grid-auto-rows: minmax(0, 1fr); border-top: 1px solid #c9d0c6; border-left: 1px solid #c9d0c6; }
.pp-dow { padding: 3px 0; border-right: 1px solid #c9d0c6; border-bottom: 1px solid #c9d0c6; background: #eef2eb; color: #5d655e; font: 500 7.5pt "DM Mono", monospace; letter-spacing: .08em; text-align: center; text-transform: uppercase; }
.pp-cell { position: relative; display: flex; flex-direction: column; gap: 2px; min-height: 0; overflow: hidden; padding: 3px 4px; border-right: 1px solid #c9d0c6; border-bottom: 1px solid #c9d0c6; }
.pp-out { background: #f7f8f5; }
.pp-off .pp-num { color: #b9bfb6; }
.pp-num { font: 600 9pt "Space Grotesk", sans-serif; }
.pp-box { position: absolute; top: 4px; right: 4px; width: 9px; height: 9px; border: 1px solid #7d857d; border-radius: 2px; }
.pp-item { padding: 2px 4px; border-left: 3px solid; border-radius: 2px; font-size: 7.5pt; font-weight: 600; line-height: 1.2; }
.pp-item small { display: block; font-size: 6.5pt; font-weight: 400; opacity: .85; }
.pp-rest { color: #a3aaa1; font-size: 7pt; }
.pp-examday { background: #e8f2e9; }
.pp-summary { display: grid; grid-template-columns: 1.45fr 1fr; gap: 22px; }
.pp-table { width: 100%; border-collapse: collapse; font-size: 8pt; }
.pp-table th { padding: 4px 6px; border-bottom: 1.5px solid #9aa39a; color: #5d655e; font: 500 7pt "DM Mono", monospace; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
.pp-table td { padding: 3.5px 6px; border-bottom: 1px solid #e1e5de; vertical-align: middle; }
.pp-swatch { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border: 1.5px solid; border-radius: 2px; vertical-align: -1px; }
.pp-notes { font-size: 8.5pt; line-height: 1.45; }
.pp-notes h2 { margin: 0 0 4px; font: 600 11pt "Space Grotesk", sans-serif; }
.pp-notes ul { margin: 0 0 14px; padding-left: 14px; }
.pp-notes li { margin-bottom: 3px; }
.pp-small { color: #8a9189; font-size: 7pt; }
@media (max-width: 1023px) {
  /* The set overview sits beside the question on wide screens; below it, it would push the solution off screen. */
  #question-panel > aside { display: none; }
}
@media (max-width: 767px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  .sidebar { width: 100%; height: auto; }
  .sidebar .brand-row { padding-top: 12px; padding-bottom: 12px; }
  .sidebar-bottom { display: none; }
  main { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }

  /* Main navigation becomes a tab bar fixed to the bottom of the screen. */
  .desktop-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; margin: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: rgba(255, 255, 255, .97); }
  .desktop-nav .nav-link { position: relative; flex-direction: column; justify-content: center; gap: 3px; width: auto; min-height: 50px; padding: 6px 2px; font-size: 10px; line-height: 1.1; text-align: center; }
  .desktop-nav .nav-link svg { width: 20px; height: 20px; }
  .desktop-nav #exam-resume-badge { position: absolute; top: 5px; left: calc(50% + 8px); width: 8px; height: 8px; margin: 0; padding: 0; border-radius: 50%; background: var(--orange); font-size: 0; }

  /* Larger reading text. Small caption sizes used across the page step up one notch. */
  html [class~="text-[9px]"] { font-size: 10px; }
  html [class~="text-[10px]"] { font-size: 11.5px; }
  html [class~="text-[11px]"] { font-size: 12.5px; }
  html [class~="text-[12px]"] { font-size: 13.5px; }
  html [class~="text-[13px]"] { font-size: 14.5px; }
  #question-title { font-size: 19px; }
  #question-prompt { font-size: 15px; line-height: 1.7; }
  #answer-options .question-option { padding-top: 14px; padding-bottom: 14px; font-size: 14.5px; }
  #solution-steps p { font-size: 14.5px; line-height: 1.7; }
  #answer-feedback { font-size: 14px; }

  /* iOS zooms the page when a focused field has text smaller than 16px. */
  input, select, textarea { font-size: 16px !important; }

  /* Comfortable touch targets. */
  #answer-hint + div { width: 100%; }
  #exam-flag, #exam-prev, #exam-next, #submit-answer { flex: 1 1 auto; justify-content: center; height: 46px; }
  #exam-nav-grid { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); }
  #exam-nav-grid button { height: 40px; font-size: 12px; }
  #readiness-list button, #custom-area-options label, #focus-areas button { min-height: 46px; }
  #select-all-areas, #clear-all-areas, #select-weakest-areas, #reset-progress, #back-dashboard { padding: 10px 4px; }
  #next-question, #review-set, #finish-dashboard, #exam-submit, #create-custom-quiz { min-height: 46px; }
}
