* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body { height: 100%; }

body {
  background: #ecf3f9; /* matches AP page bottom edge — hides letterbox gap */
  font-family: "Roboto", "Helvetica Neue", Arial, sans-serif;
  overflow: hidden; /* no scrolling — everything is sized to one screen */
}

.cb-page {
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden;
  background: #ecf3f9; /* same as image's bottom edge — no white gap */
}

/*
  The whole page is one screenshot. Overlays for the FINAL EXAM row are
  absolutely positioned as percentages of this wrapper, which is exactly
  the size of the image. container-type:inline-size makes `cqw` units = 1%
  of the wrapper width, so overlaid text scales with the image.
  Coordinates are measured against the cleaned image (1920 x 958).
*/
.shot-wrap {
  position: relative;
  /* never taller than the viewport (1920x958 image) so it fits a Chromebook
     screen with no scrolling, while preserving the image's aspect ratio and
     all percentage-positioned overlays */
  width: min(100%, calc(100vh * 2.0));
  container-type: inline-size;
  line-height: 0;
  background: #fff;
}

.shot-wrap > .full {
  display: block;
  width: 100%;
  height: auto;
}

/* White block erasing the original blue icon + "Unit 7 Progress Check: FRQ" */
.title-cover {
  position: absolute;
  left: 15.63%;
  width: 20.83%;
  top: 55.8%;
  height: 7.2%;
  background: #fff;
}

/* Real yellow clipboard icon over the original blue-icon position */
.final-icon-img {
  position: absolute;
  left: 17.16%;   /* center of original blue icon */
  top: 59.19%;    /* vertical center of the row */
  width: 2.4%;
  transform: translate(-50%, -50%);
}

/* Plain-text FINAL EXAM label, right where the title started */
.final-label {
  position: absolute;
  left: 18.5%;
  top: 59.34%;
  transform: translateY(-50%);
  font: 500 1.0cqw/1 "Roboto", Arial, sans-serif;
  letter-spacing: 0.1px;
  color: #1a62b3;
  white-space: nowrap;
}

/* White block erasing the original baked-in date + time */
.dt-cover {
  position: absolute;
  left: 36.56%;
  width: 3.9%;
  top: 56.8%;
  height: 4.7%;
  background: #fff;
}

/* New date (bold) */
.final-date {
  position: absolute;
  left: 36.77%;
  top: 57.93%;
  transform: translateY(-50%);
  font: 700 0.8cqw/1 "Roboto", Arial, sans-serif;
  color: #2b2b2b;
  white-space: nowrap;
}

/* New time (regular, gray) */
.final-time {
  position: absolute;
  left: 36.77%;
  top: 60.33%;
  transform: translateY(-50%);
  font: 400 0.8cqw/1 "Roboto", Arial, sans-serif;
  color: #5b5b5b;
  white-space: nowrap;
}

/* Invisible button sitting exactly over the real "Continue" pill */
.continue-hit {
  position: absolute;
  left: 91.4%;
  top: 56.9%;
  width: 5.1%;
  height: 4.4%;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  z-index: 5;
}
.continue-hit:focus-visible {
  outline: 2px solid #1a62b3;
  outline-offset: 1px;
  border-radius: 18px;
}

/* ===================== Modal (real screenshot) ===================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-overlay[hidden] { display: none; }

.modal {
  position: relative;
  /* fit inside a Chromebook screen height; keep 487x818 ratio so the
     invisible hit-areas stay aligned to the buttons in the screenshot */
  width: min(487px, calc((100vh - 40px) * 487 / 818));
  max-width: 100%;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  line-height: 0;
}

/* The popup IS the screenshot */
.modal-img {
  display: block;
  width: 100%;
  height: auto;
}

/* Invisible clickable hit areas over the real buttons in the image */
.hit {
  position: absolute;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
}
/* X close button — top-right of the popup */
.hit-x {
  top: 1.7%;
  right: 1.6%;
  width: 10%;
  height: 6%;
}
/* Cancel button — bottom row, left of Start Assignment */
.hit-cancel {
  bottom: 2.4%;
  left: 49%;
  width: 18%;
  height: 6%;
}
/* Start Assignment button — blue, bottom-right of popup */
.hit-start {
  top: 92.5%;
  left: 66.5%;
  width: 29.5%;
  height: 5.2%;
}

/* ===================== LockDown Browser exam screen ===================== */
.lockdown {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #e6edf8; /* matches MCQ bottom edge — hides the bottom gap */
  font-family: "Roboto", Arial, sans-serif;
  color: #1c1c1c;
}
.lockdown[hidden] { display: none; }

/* Center the bar + MCQ as one window-width stack that fits in one screen.
   Bar = fixed 40px tall. MCQ 1921x974 -> h/w = 0.50703.
   So MCQ height = stackW * 0.50703; fit: 40 + stackW*0.50703 <= 100vh
   -> stackW <= (100vh - 40px) * 1.972 */
.ld-stack {
  /* bar is now a 2x asset (1970x82) so filling the screen DOWNSCALES it
     (crisp) instead of upscaling (blurry). MCQ 1921x958 also downscales.
     Combined h/w = 0.0416 + 0.4987 = 0.5403 -> width <= 100vh * 1.85,
     so the whole exam still fits one Chromebook screen with no scrolling. */
  width: min(100%, calc(100vh * 1.85));
  margin: 0 auto;
}

/* Top utility bar — real LockDown screenshot, full width & undistorted */
.ld-topbar {
  position: relative;
  width: 100%;
  line-height: 0;
  flex-shrink: 0;
  user-select: none;
}
.ld-bar-img {
  display: block;
  width: 100%;
  height: auto;
}

/* Invisible exit button over the real red X (96.0%–99.0% of bar width) */
.ld-exit {
  position: absolute;
  top: 0;
  left: 95.8%;
  width: 3.8%;
  height: 100%;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

/* The actual MCQ screenshot below the bar */
.ld-shot-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1921 / 958;
  container-type: inline-size;
  line-height: 0;
}
.ld-shot-wrap > img {
  display: block;
  width: 100%;
  height: 100%;
}

/* White-cover over the original baked-in title (header light-blue) */
.mcq-title-cover {
  position: absolute;
  left: 2%;
  top: 3.3%;
  width: 30%;
  height: 2.7%;
  background: #e6edf8;
  pointer-events: none;
}

/* Editable title in the same font/style as the screenshot */
.mcq-title {
  position: absolute;
  left: 2.24%;
  top: 4.67%;
  transform: translateY(-50%);
  z-index: 5;
  /* Wide + tall hit area so you can click anywhere in the left of the bar to
     edit and ADD words (clicking past the text puts the caret at the end). */
  width: 34%;
  font: 700 0.93cqw/1 "Roboto", Arial, sans-serif;
  letter-spacing: 0.1px;
  color: #1e1e1e;
  background: #e6edf8;
  white-space: nowrap;
  overflow: visible;
  outline: none;
  cursor: text;
  padding: 0.6cqw 0.3cqw;
  -webkit-font-smoothing: subpixel-antialiased;
}
.mcq-title:hover {
  box-shadow: inset 0 0 0 1px rgba(26, 98, 179, 0.28);
}
.mcq-title:focus {
  box-shadow: inset 0 0 0 1px rgba(26, 98, 179, 0.6);
  background: #eef3fb;
}

/* Mask any stray green line at the very top edge of a question image */
.q-topmask {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0.5%;
  background: #e6edf8;
  pointer-events: none;
}

/* Cover the baked-in "Question X of Y" pill (footer is light-blue #e6edf8) */
.q-pill-cover {
  position: absolute;
  left: 40%;
  width: 20%;
  top: 93.5%;
  height: 5.2%;
  background: #e6edf8;
  pointer-events: none;
}

/* Our chronological counter pill, drawn in the AP style */
.q-pill {
  position: absolute;
  left: 50%;
  top: 96.4%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 0.5cqw;
  background: #1f1f1f;
  color: #fff;
  font: 500 0.72cqw/1 "Roboto", Arial, sans-serif;
  letter-spacing: 0.2px;
  padding: 0.55cqw 1cqw;
  border-radius: 1.4cqw;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}
.q-pill svg {
  width: 0.8cqw;
  height: 0.8cqw;
  display: block;
}
/* the label text flows as one run; only the numbers are interactive */
.q-pill-body { pointer-events: none; }
.q-num {
  pointer-events: auto;
  cursor: text;
  outline: none;
  color: #fff;
  display: inline-block;
  min-width: 0.6em;
  text-align: center;
  border-radius: 2px;
  padding: 0 0.5px;
  transition: box-shadow 0.1s, background 0.1s;
}
/* minimal editing affordance: a faint underline on hover, solid on focus */
.q-num:hover { box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.4); }
.q-num:focus {
  box-shadow: inset 0 -1.5px 0 rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.1);
}

/* Invisible Back button over the real "Back" pill (bottom-right, left of Next) */
.q-back {
  position: absolute;
  left: 88.8%;
  top: 92.8%;
  width: 4.5%;
  height: 6.2%;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  z-index: 6;
}
.q-back.is-first { cursor: default; }
.q-back:focus-visible {
  outline: 2px solid #1a62b3;
  outline-offset: 1px;
  border-radius: 18px;
}

/* Invisible Next button sitting over the real "Next" pill (bottom-right) */
.q-next {
  position: absolute;
  left: 93.5%;
  top: 92.8%;
  width: 4.5%;
  height: 6.2%;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  z-index: 6;
}
.q-next:focus-visible {
  outline: 2px solid #1a62b3;
  outline-offset: 1px;
  border-radius: 18px;
}
/* On the last question there's nothing to advance to */
.q-next.is-last {
  cursor: default;
}

/* Assignment header */
.ld-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #dcdcdc;
  padding: 8px 18px;
  flex-shrink: 0;
}

/* MCQ header: title left, tools right, with thin top accent line */
.ld-header-mcq {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 3px solid;
  border-image: linear-gradient(90deg, #6f7bd6 0%, #8aa0e6 50%, #c9d4f5 100%) 1;
  padding: 10px 22px;
}
.ld-assign-name { font-size: 15px; font-weight: 700; }
.ld-timerwrap { text-align: center; }
.ld-time { font-size: 18px; font-weight: 700; letter-spacing: .5px; }
.ld-hide {
  margin-top: 2px;
  background: #fff; border: 1px solid #c4c4c4; border-radius: 12px;
  font-size: 11px; padding: 1px 12px; cursor: pointer; color: #444;
}
.ld-tools { display: flex; justify-content: flex-end; gap: 22px; }
.ld-tool {
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 11px; color: #444;
}
.ld-tico { width: 22px; height: 22px; }
.ld-refico { font-size: 15px; font-weight: 600; color: #444; line-height: 22px; }
.ld-refico sup { font-size: 9px; }

/* Document content */
.ld-content {
  flex: 1;
  overflow-y: auto;
  padding: 22px 18px 40px;
}
.ld-doc {
  max-width: 1040px;
  margin: 0 auto;
  background: #fff;
  padding: 8px 4px 30px;
}
.ld-qhead { display: flex; align-items: center; gap: 14px; padding: 6px 4px; }
.ld-qnum {
  background: #3a3a3a; color: #fff; font-weight: 700; font-size: 14px;
  width: 26px; height: 26px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
}
.ld-mark {
  display: inline-flex; align-items: center; gap: 6px;
  color: #1a62b3; font-size: 13.5px; cursor: pointer;
}
.ld-rule { border: none; border-top: 1px solid #e2e2e2; margin: 8px 0 16px; }

.ld-doc p { font-size: 15px; line-height: 1.6; margin: 14px 4px; }
.ld-instr { color: #333; }
.ld-part { font-weight: 700; margin-top: 20px; }
.ld-sub { margin: 6px 4px 6px 34px; }
.ld-sub li { font-size: 15px; line-height: 1.6; margin: 8px 0; list-style: lower-roman; }

.ld-noteline { font-size: 15px; }
.ld-note {
  display: inline-block; background: #3a3a3a; color: #fff;
  font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 4px;
  margin-right: 6px;
}

/* Rich-text editor */
.ld-editor { margin: 16px 4px; border: 1px solid #cfcfcf; border-radius: 3px; }
.ld-toolbar {
  display: flex; align-items: center; gap: 2px;
  background: #f6f6f6; border-bottom: 1px solid #d9d9d9; padding: 4px 6px;
}
.ld-tb {
  min-width: 26px; height: 26px; background: none; border: none;
  cursor: pointer; font-size: 13px; color: #333; border-radius: 3px;
  display: inline-flex; align-items: center; justify-content: center;
}
.ld-tb:hover { background: #e4e4e4; }
.ld-tbsep { width: 1px; height: 18px; background: #d0d0d0; margin: 0 4px; }
.ld-textarea {
  min-height: 120px; background: #fff; padding: 10px 12px;
  font-size: 15px; outline: none;
}

/* Bottom navigation */
.ld-bottom {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: #fff;
  border-top: 1px solid #dcdcdc;
  padding: 10px 22px;
  flex-shrink: 0;
}
.ld-logo { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.ld-logo b { font-weight: 700; }
.ld-shield { width: 26px; height: 29px; }
.ld-qnav {
  justify-self: center;
  background: #3a3a3a; color: #fff; border: none; border-radius: 18px;
  padding: 8px 20px; font-size: 13.5px; font-weight: 500; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.ld-caretup { font-size: 12px; }
.ld-next {
  justify-self: end;
  background: #1a62b3; color: #fff; border: none; border-radius: 20px;
  padding: 9px 30px; font-size: 14px; font-weight: 500; cursor: pointer;
}
.ld-next:hover { background: #14508f; }

/* ===================== MCQ two-column layout ===================== */
/* serif acronyms like the real AP rendering */
.sf { font-family: "Cambria", "Times New Roman", Georgia, serif; }

.ld-content-mcq { padding: 0; background: #fff; }

.mcq-split {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  min-height: 100%;
}

.mcq-left { padding: 22px 40px 40px; }
.mcq-right { padding: 22px 40px 40px; }

.mcq-refline { font-size: 15px; font-weight: 700; color: #1c1c1c; margin: 4px 0 16px; }
.mcq-left p { font-size: 14.5px; line-height: 1.85; color: #2b2b2b; }

/* center divider with drag handle */
.mcq-divider {
  position: relative;
  background: #555;
  width: 1px;
}
.mcq-handle {
  position: absolute;
  top: 150px;
  left: 50%;
  transform: translateX(-50%);
  background: #3a3a3a;
  color: #fff;
  font-size: 9px;
  letter-spacing: -1px;
  padding: 6px 2px;
  border-radius: 3px;
  line-height: 1;
  white-space: nowrap;
}

/* question header bar */
.mcq-qhead {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f1f1f1;
  border-bottom: 2px solid #cfcfcf;
  padding: 8px 10px;
  margin: 0 0 18px;
}
.mcq-qhead .ld-qnum {
  background: #2b2b2b; color: #fff; font-weight: 700; font-size: 13px;
  width: 24px; height: 24px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
}
.mcq-qhead .ld-mark {
  display: inline-flex; align-items: center; gap: 6px;
  color: #1c1c1c; font-size: 13.5px; cursor: pointer;
}
.mcq-abc {
  margin-left: auto;
  background: #2f6fd0; color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: .5px;
  padding: 3px 6px; border-radius: 4px;
}

.mcq-stem { font-size: 14.5px; line-height: 1.7; color: #1c1c1c; margin: 0 4px 20px; }

/* answer rows */
.mcq-choices { display: flex; flex-direction: column; gap: 14px; }
.mcq-row { display: flex; align-items: center; gap: 16px; }

.mcq-choice {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid #cfcfcf;
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.mcq-choice:hover { border-color: #9bb6dd; }

.mcq-letter {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border: 1px solid #b5b5b5;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: #444;
}
.mcq-ctext { font-size: 14px; color: #1c1c1c; }

/* selected state */
.mcq-choice.selected {
  border-color: #1a50b3;
  box-shadow: 0 0 0 1px #1a50b3;
}
.mcq-choice.selected .mcq-letter {
  background: #1a50b3;
  border-color: #1a50b3;
  color: #fff;
}

/* eliminate buttons on the right */
.mcq-elim {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border: 1px solid #c4c4c4;
  border-radius: 50%;
  background: #fff;
  color: #8a8a8a;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  position: relative;
}
.mcq-elim::after {
  content: "";
  position: absolute;
  left: 4px; right: 4px; top: 50%;
  height: 1.5px;
  background: #8a8a8a;
  transform: translateY(-50%);
}
.mcq-elim:hover { border-color: #8a8a8a; }
.mcq-elim.struck { background: #ececec; }

/* a choice that has been eliminated */
.mcq-choice.eliminated { opacity: 0.5; }
.mcq-choice.eliminated .mcq-ctext { text-decoration: line-through; }
