/* Fidelity overrides for states that were not part of the original three-crop
   pixel gate: Settings, overview panels, Help, alerts, and calculator chrome. */

/* Captured Settings menu: 175px wide, four 25px rows, y≈47 at 1280×1024. */
.tools-menu__overlay { width: 175px; }
#tools-zoom-menu1 { width: 65px; }
#tools-theme-menu1 { width: 110px; }
.tools-menu__item:focus { outline: 1px dotted currentColor; outline-offset: -2px; }

/* The title is present for assistive technology but visually hidden in the
   driver. Its iframe body starts after a 30px chrome clearance. */
#calculator .handle h2 {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
#calculator .modal-dialog { padding: 30px 0 0; }
.calcTop { position: relative; }
#calcMemory {
  position: absolute; z-index: 1; left: 10px; top: 10px;
  font: 700 11px/1 var(--font-shell); color: #333;
}
html.white-on-black #calcMemory { color: #fff; }

/* Exam and timing overviews are floating tool dialogs anchored immediately to
   the right of the status rail, matching the captured replacement driver. */
.overviewContainer { position: fixed; inset: 0; pointer-events: none; z-index: 997; }
.overviewContainer[hidden] { display: none; }
.overviewContainer .overviewDialog { pointer-events: auto; min-width: 0; box-sizing: border-box; overflow: hidden; }
#sessionStatusContainer .overviewDialog { left: 110px; top: 66px; width: 537px; height: 170px; }
#timeStatusContainer .overviewDialog { left: 110px; bottom: 66px; width: 445px; min-height: 295px; }
.overviewDialog .handle { height: 34px; margin: 3px 9px; background: #fff; }
html.white-on-black .overviewDialog .handle { background: #000; }
.overviewDialog .handle h2 {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.overviewDialog .modal-dialog { padding: 0 12px 10px; }
.overviewDialog .overviewContent {
  box-sizing: border-box;
  max-height: calc(100% - 44px);
  overflow: auto;
}
.overviewContent h3 { margin: 0 0 7px; text-align: center; font-size: 16px; }
.overviewTable { width: 100%; border-collapse: collapse; font-size: 12px; }
.overviewTable th, .overviewTable td { border: 1px solid currentColor; padding: 2px 5px; text-align: left; }
.overviewTable tr.current { background: #d9f4fb; }
html.white-on-black .overviewTable tr.current { background: #fff; color: #000; }
.overviewSummary { margin: 6px 0 0; font-size: 12px; }
.timingList { margin: 4px 0 12px; }
.timingList > div { display: flex; justify-content: space-between; border-bottom: 1px solid currentColor; padding: 8px 2px; }
.timingList dt { font-weight: 700; }
.timingList dd { margin: 0; font-variant-numeric: tabular-nums; }

/* The driver uses a large scrollable manual rather than the old condensed
   paragraph. */
#modal.help-panel {
  top: 15px; left: 50%; transform: translateX(-50%);
  width: 1000px; height: 800px; max-width: calc(100vw - 24px); max-height: calc(100vh - 30px);
  border-width: 2px; background: #d6dcec;
}
#modal.help-panel .handle { height: 40px; margin-top: -2px; background: var(--chrome); color: #fff; }
#modal.help-panel .handle h2 { margin: 2px 0; padding: 4px 45px 0; text-align: center; font-size: 18px; }
#modal.help-panel > .modal-dialog { height: calc(100% - 38px); padding: 0 5px 5px; }
#modal.help-panel .helpcontent { height: 100%; overflow-y: auto; background: #fff; color: #000; padding: 6px 10px 18px; }
html.white-on-black #modal.help-panel,
html.white-on-black #modal.help-panel .helpcontent { background: #000; color: #fff; }
#modal.help-panel .helpcontent h3 { text-align: center; margin: 14px 0 6px; }
#modal.help-panel .helpcontent table { border-collapse: collapse; width: 98%; margin: 8px auto; text-align: left; }
#modal.help-panel .helpcontent th,
#modal.help-panel .helpcontent td { border: 1px solid currentColor; padding: 6px 10px; vertical-align: top; }
#modal.help-panel .helpcontent th { width: 29%; }
#modal.help-panel .helpcontent .blueCell { background: #d9f4fb; }
html.white-on-black #modal.help-panel .helpcontent .blueCell { background: #222; }
#modal.help-panel .modalButtons { display: none; }

/* Confirmation alerts are a separate white/black family in the driver, not
   the blue-grey floating tool dialog. */
#modal.alert {
  top: 20vh; left: 50%; transform: translateX(-50%);
  width: 700px; max-width: calc(100vw - 32px); min-width: 0;
  height: 175px; background: #fff; color: #000;
  border: 1px solid #000; border-radius: 5px;
}
#modal.alert.head-incomplete { height: 190px; }
#modal.alert .handle { cursor: default; height: 38px; }
#modal.alert .handle h2 { padding: 7px 45px 6px; margin: 0; text-align: center; font-size: 18px; }
#modal.alert .modal-dialog { padding: 14px 28px; }
#modal.alert .modalButtons { margin-top: 15px; }
#modal.alert .modalButtons button { margin: 0 50px 15px; min-width: 150px; }
html.white-on-black #modal.alert { background: #000; color: #fff; border-color: #fff; }

/* Expiry occupies the full content region while the answer is finalized and
   the next block is selected. There is no usable question beneath it. */
#modal.alert.timeout {
  top: 61px; right: 0; bottom: 58px; left: 106px; transform: none;
  width: auto; height: auto; max-width: none; border-radius: 0;
}
#modal.alert.timeout .handle { visibility: hidden; }
#modal.alert.timeout .modal-dialog { margin-top: 5%; text-align: center; }

@media (max-width: 800px) {
  #sessionStatusContainer .overviewDialog,
  #timeStatusContainer .overviewDialog { left: 8px; max-width: calc(100vw - 16px); }
  #modal.alert { width: calc(100vw - 32px); }
}

/* Tutorial, authorized-break, and completion screens live outside the item
   shell, as they do in the test driver. */
#sessionScreen {
  position: fixed; inset: 0; z-index: 1200; overflow: auto;
  background: #fcfcfc; color: #000; font: 16px/1.45 Arial, sans-serif;
}
#sessionScreen[hidden] { display: none; }
.sessionSheet {
  box-sizing: border-box; width: min(1024px, calc(100% - 64px)); min-height: 560px;
  margin: 54px auto; padding: 28px 42px 44px;
  border-top: 1px solid #3852a4; border-bottom: 1px solid #3852a4;
  text-align: center;
}
.sessionEyebrow { margin: 0 0 3px; color: #283294; font-size: 13px; font-weight: bold; text-transform: uppercase; }
.sessionSheet h1 { margin: 0 0 14px; color: #283294; font-size: 22px; }
.sessionLead { max-width: 66ch; margin: 0 auto 20px; }
.sessionClockRow {
  display: flex; justify-content: center; gap: 0; width: max-content; max-width: 100%;
  margin: 18px auto 26px; border: 1px solid #8a8a8a; background: #fff;
}
.sessionClockRow span { min-width: 240px; padding: 9px 16px; border-right: 1px solid #8a8a8a; }
.sessionClockRow span:last-child { border-right: 0; }
.sessionClockRow strong { display: block; margin-top: 2px; font-size: 19px; }
.tutorialGrid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
  max-width: 780px; margin: 0 auto 26px; text-align: left;
}
.tutorialGrid section { padding: 13px 16px; border: 1px solid #a5aecb; background: #fff; }
.tutorialGrid h2 { margin: 0 0 4px; color: #283294; font-size: 15px; }
.tutorialGrid p { margin: 0; font-size: 14px; }
.sessionPrimary {
  padding: 7px 18px; border: 1px solid #004976; border-radius: 3px;
  background: linear-gradient(#078ec0, #004976); color: #fff;
  font: bold 14px Arial, sans-serif; cursor: pointer;
}
.sessionPrimary:hover { background: linear-gradient(#004976, #078ec0); }
.sessionPrimary:focus-visible { outline: 2px solid #004976; outline-offset: 3px; }
.sessionPrimary:disabled { opacity: .6; cursor: wait; }
.sessionBreak, .sessionComplete { padding-top: 132px; }
.sessionError, .launchError {
  max-width: 68ch; margin: 0 auto 16px; padding: 9px 12px;
  border: 1px solid #b60000; background: #fff2f2; color: #8c0000; text-align: center;
}
.serverDownPanel {
  position: fixed; z-index: 2000; left: 50%; top: 24%; transform: translateX(-50%);
  box-sizing: border-box; width: min(700px, calc(100vw - 32px)); padding: 24px 32px;
  border: 2px solid #9c0000; border-radius: 4px; background: #fff; color: #000;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .4); text-align: center;
  font: 16px/1.45 Arial, sans-serif;
}
.serverDownPanel[hidden] { display: none; }
.serverDownPanel h1 { margin: 0 0 10px; color: #9c0000; font-size: 21px; }
html.white-on-black .serverDownPanel { background: #000; color: #fff; border-color: #fff; }
html.white-on-black #sessionScreen,
html.white-on-black .sessionClockRow,
html.white-on-black .tutorialGrid section { background: #000; color: #fff; border-color: #fff; }
html.white-on-black .sessionSheet,
html.white-on-black .sessionClockRow span { border-color: #fff; }
html.white-on-black .sessionEyebrow,
html.white-on-black .sessionSheet h1,
html.white-on-black .tutorialGrid h2 { color: #fff; }

@media (max-width: 720px) {
  .sessionSheet { width: calc(100% - 28px); margin: 20px auto; padding: 22px 18px 32px; }
  .tutorialGrid { grid-template-columns: 1fr; }
  .sessionClockRow { width: 100%; flex-direction: column; }
  .sessionClockRow span { min-width: 0; border-right: 0; border-bottom: 1px solid #8a8a8a; }
  .sessionClockRow span:last-child { border-bottom: 0; }
}
