:root {
  --bg: #e7e7e7;
  --ink: #16212a;
  --muted: #657481;
  --panel: #ffffff;
  --line: #ccd5dd;
  --line-dark: #9aa9b5;
  --navy: #073f52;
  --navy-2: #06384a;
  --teal: #126f68;
  --teal-soft: #d9eeeb;
  --gold: #c9902f;
  --red: #ba4a3d;
  --blue: #356f9f;
  --orange: #d84610;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.exam-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 112px 1fr 62px;
}

.exam-header {
  background: #fff;
  color: var(--ink);
  display: grid;
  grid-template-rows: 36px 76px;
  border-bottom: 1px solid var(--orange);
}

.testlet-strip {
  min-width: 0;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
}

.sample-title {
  flex: 0 0 300px;
  align-self: stretch;
  display: flex;
  align-items: center;
  padding-left: 16px;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: .04em;
  white-space: nowrap;
  background: #073a4c;
}

.testlet-tab {
  height: 36px;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, .12);
  background: transparent;
  color: #cce0e9;
  min-width: 136px;
  padding: 0 14px;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.testlet-tab.active {
  background: #fff;
  color: var(--orange);
}

.testlet-tab.locked span {
  color: transparent;
  width: 18px;
  height: 18px;
  position: relative;
}

.testlet-tab.locked span:before {
  content: "";
  width: 14px;
  height: 10px;
  background: #8fb3bf;
  border-radius: 2px;
  position: absolute;
  left: 2px;
  bottom: 1px;
}

.testlet-tab.locked span:after {
  content: "";
  width: 9px;
  height: 9px;
  border: 3px solid #8fb3bf;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  position: absolute;
  left: 2px;
  top: 0;
}

.pin-dot {
  width: 17px;
  height: 17px;
  background: var(--orange);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: inline-block;
  position: relative;
}

.pin-dot:after {
  content: "";
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  left: 5px;
  top: 5px;
}

.close-sample {
  margin-left: auto;
  align-self: center;
  border: 1px solid #138442;
  background: #00843d;
  color: #fff;
  padding: 5px 15px;
  font-weight: 800;
  font-size: 16px;
}

.exam-workbar {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) auto minmax(140px, 1fr);
  align-items: stretch;
  background: #fff;
}

.time-block {
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-left: 72px;
}

.clock-face {
  position: absolute;
  left: -20px;
  top: -12px;
  width: 105px;
  height: 105px;
  border: 3px solid #e1e1e1;
  border-radius: 50%;
  opacity: .72;
}

.clock-face:before,
.clock-face:after {
  content: "";
  position: absolute;
  background: #cfcfcf;
  transform-origin: left center;
  left: 52px;
  top: 52px;
}

.clock-face:before {
  width: 34px;
  height: 4px;
  transform: rotate(180deg);
}

.clock-face:after {
  width: 38px;
  height: 3px;
  transform: rotate(220deg);
}

.time-block b {
  color: var(--navy);
  font-size: 58px;
  line-height: 1;
  font-weight: 300;
  letter-spacing: -2px;
}

.time-block strong {
  color: var(--navy);
  font-size: 14px;
  line-height: 1.15;
  margin-left: 12px;
}

.tool-dock {
  display: flex;
  align-items: stretch;
  border-left: 1px solid #d8d8d8;
  border-right: 1px solid #d8d8d8;
}

.tool-button {
  width: 86px;
  border: 0;
  border-right: 1px solid #ddd;
  background: #fff;
  color: var(--navy);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
}

.tool-button:hover {
  background: #f3f7f8;
}

.tool-button b {
  font-size: 13px;
  font-weight: 500;
}

.workbar-return {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 26px;
  border-right: 1px solid #d8d8d8;
}

.workbar-return a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--orange);
  background: #fff;
  color: var(--navy);
  padding: 0 32px;
  text-decoration: none;
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
}

.workbar-return a:hover {
  background: #fff8f5;
}

.tool-icon {
  min-height: 22px;
  display: grid;
  place-items: center;
  color: var(--navy);
  font-weight: 800;
}

.calc-icon {
  width: 18px;
  height: 24px;
  border: 2px solid var(--navy);
  border-radius: 2px;
  font-size: 6px;
  align-content: start;
  padding-top: 2px;
  position: relative;
}

.calc-icon:after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 3px;
  height: 14px;
  background:
    linear-gradient(var(--navy), var(--navy)) 0 0/100% 1px,
    linear-gradient(var(--navy), var(--navy)) 0 50%/100% 1px,
    linear-gradient(var(--navy), var(--navy)) 0 100%/100% 1px,
    linear-gradient(90deg, var(--navy), var(--navy)) 0 0/1px 100%,
    linear-gradient(90deg, var(--navy), var(--navy)) 50% 0/1px 100%,
    linear-gradient(90deg, var(--navy), var(--navy)) 100% 0/1px 100%;
  background-repeat: no-repeat;
}

.grid-icon {
  width: 27px;
  height: 27px;
  border: 3px solid var(--navy);
  background:
    linear-gradient(var(--navy), var(--navy)) 0 33%/100% 2px,
    linear-gradient(var(--navy), var(--navy)) 0 66%/100% 2px,
    linear-gradient(90deg, var(--navy), var(--navy)) 33% 0/2px 100%,
    linear-gradient(90deg, var(--navy), var(--navy)) 66% 0/2px 100%;
  background-repeat: no-repeat;
}

.overview-icon {
  display: grid;
  grid-template-rows: repeat(3, 6px);
  row-gap: 2px;
  align-items: center;
  font-size: 9px;
  line-height: 1;
  position: relative;
  width: 39px;
  min-height: 22px;
}

.overview-icon em {
  display: grid;
  grid-template-columns: 10px 24px;
  column-gap: 5px;
  align-items: center;
  font-style: normal;
  line-height: 1;
  text-align: right;
}

.overview-icon em:after {
  content: "";
  display: inline-block;
  width: 24px;
  height: 3px;
  background: var(--navy);
}

.help-icon {
  font-size: 36px;
  line-height: .75;
}

.exam-main {
  display: block;
  min-height: 0;
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  overflow: hidden;
}

.mode-tabs button {
  border: 0;
  background: #fff;
  padding: 11px;
  color: var(--muted);
}

.mode-tabs button.active {
  background: var(--orange);
  color: #fff;
}

.inline-map,
.review-grid {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.item-tile,
.review-tile {
  border: 0;
  background: transparent;
  min-height: auto;
  border-radius: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-weight: 700;
  position: relative;
  font-size: 20px;
  padding: 4px;
}

.item-tile.current,
.review-tile.current {
  color: var(--orange);
  font-size: 36px;
  line-height: .8;
  outline: 0;
}

.item-tile.answered,
.review-tile.answered {
  color: var(--teal);
}

.item-tile.marked:after,
.review-tile.marked:after {
  content: "";
  position: absolute;
  right: 5px;
  top: 5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
}

.legend {
  display: grid;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.legend span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend i {
  width: 18px;
  height: 18px;
  display: inline-block;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
}

.legend-current {
  outline: 2px solid var(--blue);
}

.legend-answered {
  background: var(--teal-soft);
}

.legend-marked {
  background: linear-gradient(135deg, transparent 55%, var(--gold) 56%);
}

.review-button,
.mark-button,
.footer-button {
  border: 1px solid var(--line-dark);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  padding: 11px 14px;
  font-weight: 700;
}

.review-button {
  margin-top: auto;
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.workspace {
  min-width: 0;
  padding: 0 24px 24px;
  overflow: auto;
}

.question-strip {
  height: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
}

.question-strip .mode-tabs {
  width: 142px;
  position: absolute;
  left: 24px;
}

.workspace-top {
  display: none;
}

.workspace-top span,
.sim-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--teal);
  font-weight: 800;
}

.workspace-top h1 {
  margin: 5px 0 0;
  font-size: 26px;
}

.mark-button.marked {
  background: #fff4d9;
  border-color: var(--gold);
}

.item-view {
  display: none;
}

.item-view.active {
  display: block;
}

.prompt,
.simulation-prompt,
.exhibit-panel,
.response-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.prompt {
  padding: 88px 120px;
  max-width: 1320px;
  min-height: calc(100vh - 241px);
  margin: 0 auto;
  border-radius: 0;
  border-left: 6px solid var(--orange);
  box-shadow: 0 0 8px rgba(0, 0, 0, .16);
  position: relative;
}

.prompt:before {
  content: "1";
  position: absolute;
  left: 38px;
  top: 22px;
  color: var(--orange);
  font-size: 48px;
  font-weight: 800;
}

.prompt:after {
  content: "";
  position: absolute;
  left: 14px;
  top: 22px;
  width: 0;
  height: 0;
  border-top: 15px solid transparent;
  border-bottom: 15px solid transparent;
  border-right: 15px solid #8e8e8e;
  box-shadow: 78px 0 0 #06475c;
}

.fact-pattern {
  display: none;
}

.prompt h2 {
  margin: 0 auto;
  max-width: 900px;
  line-height: 1.35;
  font-size: 20px;
  font-family: Arial, sans-serif;
  font-weight: 500;
}

.answer-list {
  width: min(900px, 100%);
  margin: 34px auto 0;
  display: grid;
  gap: 21px;
}

.answer-choice {
  border: 0;
  background: transparent;
  border-radius: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 680px);
  text-align: left;
  padding: 0;
  overflow: visible;
}

.answer-choice b {
  width: 15px;
  height: 15px;
  min-height: 0;
  align-self: center;
  border: 1px solid #808080;
  border-radius: 50%;
  background: #fff;
  color: transparent;
}

.answer-choice span {
  padding: 0 0 0 12px;
  line-height: 1.4;
  font-size: 20px;
}

.answer-choice.selected b {
  border: 4px solid var(--navy);
}

.answer-choice.selected {
  border: 0;
  box-shadow: none;
}

.answer-choice.correct,
.answer-choice.wrong {
  border: 0;
  background: transparent;
}

.answer-choice.correct span {
  color: var(--teal);
}

.answer-choice.wrong span {
  color: var(--red);
}

.learning-feedback {
  max-width: 720px;
  margin: 34px auto 0;
}

/*
 * The simulation keeps the cleaner Arven workspace because the screenshot only
 * concerns MCQ ergonomics and top exam tools.
 */
.simulation-prompt,
.exhibit-panel,
.response-panel {
  max-width: 1320px;
  margin-left: auto;
  margin-right: auto;
}

.simulation-prompt {
  border-left: 6px solid var(--orange);
}

/*
 * Retain the old definitions for non-MCQ controls after the MCQ-specific
 * overrides above.
 */
.simulation-prompt p {
  line-height: 1.6;
}

.simulation-prompt h2 {
  margin: 0;
  line-height: 1.45;
  font-size: 22px;
}

.simulation-layout {
  display: grid;
  gap: 16px;
}

.simulation-prompt,
.exhibit-panel,
.response-panel {
  padding: 18px;
}

.simulation-prompt p {
  color: var(--muted);
  line-height: 1.6;
}

.metadata-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.metadata-row span {
  padding: 7px 9px;
  background: #edf3f6;
  border-radius: 4px;
  color: var(--muted);
  font-size: 12px;
}

.exhibit-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.exhibit-tabs button {
  border: 1px solid var(--line-dark);
  background: #fff;
  border-radius: 4px;
  padding: 8px 11px;
}

.exhibit-tabs button.active {
  background: var(--navy);
  color: #fff;
}

.exhibit-body {
  background: #f6f8fa;
  border: 1px solid var(--line);
  border-radius: 5px;
  min-height: 96px;
  padding: 14px;
  line-height: 1.65;
}

.exhibit-panel {
  display: none;
}

.response-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.response-heading h3 {
  margin: 0;
}

.response-heading span {
  color: var(--muted);
  font-size: 12px;
}

.sim-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
}

.sim-table th,
.sim-table td {
  border: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.sim-table th {
  background: #edf2f5;
  font-size: 12px;
}

.sim-table select,
.sim-table input {
  width: 100%;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  padding: 8px;
  background: #fff;
}

.tbs-template-tabs {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tbs-template-tabs button {
  border: 1px solid var(--line-dark);
  background: #fff;
  color: var(--navy);
  padding: 9px 12px;
  font-weight: 700;
}

.tbs-template-tabs button.active {
  background: var(--navy);
  color: #fff;
}

.tbs-exhibit-row {
  border: 1px solid #e0e0e0;
  background: #fbfbfb;
  min-height: 72px;
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr)) 150px;
  gap: 18px;
  align-items: center;
  padding: 12px 16px;
  color: var(--navy);
  font-size: 18px;
}

.tbs-exhibit-row a,
.exhibit-file {
  color: var(--navy);
  text-decoration: underline;
  position: relative;
  padding-left: 26px;
}

.exhibit-file {
  border: 0;
  background: transparent;
  width: fit-content;
  text-align: left;
  font-size: inherit;
}

.tbs-exhibit-row a:before,
.exhibit-file:before {
  content: "";
  position: absolute;
  left: 0;
  top: 1px;
  width: 15px;
  height: 19px;
  border: 2px solid #245b6a;
  background:
    linear-gradient(#245b6a, #245b6a) 3px 5px/8px 2px,
    linear-gradient(#245b6a, #245b6a) 3px 10px/8px 2px;
  background-repeat: no-repeat;
}

.close-exhibits {
  color: #c9c9c9;
  font-weight: 700;
  text-align: right;
  cursor: pointer;
}

.tbs-paper,
.revision-document,
.revision-instructions {
  max-width: 1060px;
  margin: 18px auto;
  font-size: 20px;
  line-height: 1.28;
}

.tbs-paper p,
.revision-document p {
  margin: 0 0 18px;
}

.tbs-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
  margin-top: 18px;
}

.tbs-grid th,
.tbs-grid td {
  border: 1px solid #b9b9b9;
  padding: 8px;
  vertical-align: middle;
}

.tbs-grid th {
  background: #e9e9e9;
  text-align: center;
  font-weight: 800;
}

.tbs-grid .row-number {
  width: 44px;
  color: #53626b;
  font-style: italic;
  text-align: center;
}

.choice-grid th:nth-child(2),
.choice-grid td:nth-child(2) {
  width: 55%;
}

.cell-picker,
.numeric-cell {
  width: 100%;
  min-height: 35px;
  border: 0;
  background: #fff;
  color: #000;
  text-align: left;
  display: grid;
  grid-template-columns: 1fr 26px;
  align-items: center;
  padding: 0 2px 0 8px;
  position: relative;
}

.cell-picker:hover,
.numeric-cell:hover {
  box-shadow: inset 0 0 0 2px #c9d8dd;
}

.list-glyph,
.num-glyph {
  justify-self: end;
  width: 22px;
  height: 22px;
  border-radius: 3px;
  background: #245b6a;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.list-glyph:before {
  content: "";
  width: 13px;
  height: 12px;
  background:
    linear-gradient(#fff, #fff) 0 0/100% 2px,
    linear-gradient(#fff, #fff) 0 5px/100% 2px,
    linear-gradient(#fff, #fff) 0 10px/100% 2px;
  background-repeat: no-repeat;
}

.variance-grid th:nth-child(2),
.numeric-grid th:nth-child(2) {
  width: 52%;
}

.revision-document {
  border: 1px solid #b7b7b7;
  padding: 0 8px 22px;
}

.revision-document h4 {
  margin: 0 0 18px;
  font-size: 19px;
}

.revision-target {
  border: 0;
  background: #d6eef3;
  color: #001f2a;
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 3px;
  padding: 0 5px;
  box-shadow: inset 0 -3px 0 #07566b;
  font-weight: 700;
}

.revision-target:hover,
.revision-target:focus {
  background: #b6dfe8;
  outline: 2px solid #07566b;
  outline-offset: 1px;
}

.revision-target.answered:after {
  content: " (" attr(data-answer) ")";
  color: var(--teal);
  text-decoration: none;
  font-size: 16px;
}

.inline-revision-panel {
  margin: 8px 0 8px 18px;
  border: 1px solid #356a77;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .18);
  max-width: 820px;
}

.inline-revision-title {
  background: var(--navy);
  color: #fff;
  padding: 7px 10px;
  font-style: italic;
}

.inline-revision-panel form,
.choice-options {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.inline-revision-panel label,
.choice-options label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.revision-actions,
.choice-actions,
.numeric-actions {
  background: #d8e1e3;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
}

.revision-actions button,
.choice-actions button,
.numeric-actions button {
  border: 0;
  min-height: 36px;
  padding: 7px 12px;
  font-weight: 800;
}

.revision-actions [data-revision-reset],
.choice-reset,
.numeric-actions [data-num-reset] {
  background: #7997a1;
  color: #fff;
}

.revision-actions [data-revision-cancel],
.choice-cancel,
.numeric-actions [data-num-cancel] {
  background: transparent;
  color: var(--navy);
  text-decoration: underline;
}

.revision-actions [data-revision-accept],
.choice-accept,
.numeric-actions [data-num-accept] {
  background: #d98b72;
  color: #fff;
}

.choice-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .15);
  display: grid;
  place-items: center;
  z-index: 22;
}

.choice-modal[hidden] {
  display: none;
}

.exhibit-window-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 24;
}

.exhibit-doc-window {
  position: fixed;
  width: min(720px, calc(100vw - 30px));
  max-height: min(620px, calc(100vh - 70px));
  background: #fff;
  border: 6px solid var(--navy);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .32);
  display: grid;
  grid-template-rows: auto 1fr;
  pointer-events: auto;
  resize: both;
  overflow: hidden;
}

.exhibit-doc-head {
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  cursor: move;
  user-select: none;
}

.exhibit-doc-head button {
  border: 1px solid rgba(255, 255, 255, .45);
  background: transparent;
  color: #fff;
  padding: 6px 10px;
}

.exhibit-doc-body {
  padding: 18px;
  overflow: auto;
  line-height: 1.5;
  font-size: 17px;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.doc-table th,
.doc-table td {
  border: 1px solid #aeb9c0;
  padding: 8px;
  text-align: left;
}

.doc-table th {
  background: #edf2f5;
}

.choice-dialog {
  width: min(680px, calc(100vw - 28px));
  background: #fff;
  border: 10px solid var(--navy);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}

.choice-title {
  background: var(--navy);
  color: #fff;
  padding: 8px 4px 14px;
  font-size: 22px;
  font-weight: 800;
}

.numeric-grid td,
.variance-grid td {
  position: relative;
}

.numeric-popover {
  position: absolute;
  right: -20px;
  top: 28px;
  width: 250px;
  background: #fff;
  border: 6px solid var(--navy);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .32);
  z-index: 90;
}

.numeric-popover:after {
  content: "";
  position: absolute;
  right: -15px;
  top: 47px;
  width: 0;
  height: 0;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  border-left: 14px solid var(--navy);
}

.numeric-popover input {
  width: calc(100% - 12px);
  margin: 6px;
  height: 34px;
  border: 1px dotted #333;
  font-size: 18px;
  background: #fff;
  color: #000;
}

.formatted-label {
  background: #d3d8d9;
  color: #001924;
  font-size: 11px;
  padding: 8px;
  font-weight: 700;
}

.exam-footer {
  background: #fff;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 220px 1fr 220px;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
}

.tool-window {
  position: fixed;
  right: 36px;
  top: 128px;
  width: 282px;
  background: #fff;
  border: 1px solid #9aa9b5;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
  z-index: 2000;
}

.wide-tool {
  width: 520px;
}

.tool-window[hidden] {
  display: none;
}

.tool-window-head {
  background: var(--navy);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
}

.tool-window-head button {
  border: 1px solid rgba(255, 255, 255, .35);
  background: transparent;
  color: #fff;
  border-radius: 3px;
  padding: 4px 7px;
}

.calculator-display {
  margin: 12px;
  padding: 10px;
  border: 1px solid var(--line-dark);
  text-align: right;
  font-size: 24px;
  background: #f7f9fa;
}

.calculator-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  padding: 0 12px 12px;
}

.calculator-grid button {
  min-height: 38px;
  border: 1px solid var(--line-dark);
  background: #fff;
  border-radius: 4px;
}

.scratch-sheet {
  width: calc(100% - 24px);
  margin: 12px;
  border-collapse: collapse;
}

.scratch-sheet th,
.scratch-sheet td {
  border: 1px solid var(--line-dark);
  height: 32px;
  padding: 5px;
  min-width: 80px;
}

.scratch-sheet td {
  background: #fff;
  outline: none;
}

.scratch-sheet td:focus {
  background: #fffce8;
  box-shadow: inset 0 0 0 2px var(--orange);
}

.scratch-sheet th {
  background: #edf2f5;
}

.footer-center {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.footer-button.primary {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

.footer-button.ghost {
  color: var(--navy);
  background: #f8fafb;
}

.review-modal {
  position: fixed;
  inset: 0;
  background: rgba(12, 22, 30, .62);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 20;
}

.review-modal[hidden] {
  display: none;
}

.review-dialog {
  width: min(620px, 100%);
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 22px;
}

.review-dialog-header,
.review-actions,
.review-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.review-dialog-header {
  margin-bottom: 18px;
}

.review-dialog-header span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.review-dialog-header h2 {
  margin: 4px 0 0;
}

.review-dialog-header button {
  border: 1px solid var(--line-dark);
  background: #fff;
  border-radius: 4px;
  padding: 8px 11px;
}

.review-summary {
  color: var(--muted);
  font-size: 12px;
  margin: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 78px;
  background: var(--navy-2);
  color: #fff;
  padding: 12px 15px;
  border-radius: 5px;
  opacity: 0;
  transform: translateY(8px);
  transition: .2s;
  pointer-events: none;
  z-index: 30;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .exam-header {
    height: auto;
    grid-template-rows: auto auto;
  }

  .exam-shell {
    grid-template-rows: auto 1fr auto;
  }

  .testlet-strip {
    overflow-x: auto;
  }

  .sample-title {
    flex: 0 0 260px;
    font-size: 13px;
  }

  .exam-workbar {
    grid-template-columns: 1fr;
  }

  .time-block {
    min-height: 92px;
  }

  .tool-dock {
    justify-content: center;
    border-top: 1px solid #ddd;
  }

  .exam-footer {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .footer-center {
    order: 3;
  }
}

@media (max-width: 640px) {
  .workspace {
    padding: 0 12px 16px;
  }

  .question-strip {
    height: auto;
    padding: 10px 0;
    display: grid;
  }

  .question-strip .mode-tabs {
    position: static;
    width: 180px;
  }

  .time-block {
    padding-left: 72px;
  }

  .time-block b {
    font-size: 62px;
    letter-spacing: -3px;
  }

  .time-block strong {
    font-size: 13px;
  }

  .tool-button {
    width: 86px;
  }

  .prompt {
    padding: 78px 28px 42px;
    min-height: 540px;
  }

  .prompt h2,
  .answer-choice span {
    font-size: 18px;
  }

  .review-dialog-header,
  .review-actions,
  .review-summary {
    display: grid;
  }

  .item-map,
  .review-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .sim-table {
    min-width: 760px;
  }

  .response-panel {
    overflow-x: auto;
  }
}
