/* Exam simulator: deliberately plain, utilitarian test-driver look. Always light. */
#sim { position: fixed; inset: 0; z-index: 100; background: #eef0f3; color: #1b1b1b; font: 15px/1.5 Arial, "Helvetica Neue", Helvetica, sans-serif; display: flex; flex-direction: column; }
#sim[hidden] { display: none; }
#sim * { box-sizing: border-box; }

.x-head { flex: none; display: flex; align-items: center; gap: 16px; height: 52px; padding: 0 16px; background: #24384f; color: #fff; }
.x-head .x-title { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.x-head .x-sub { font-size: 12px; opacity: .8; }
.x-head .x-spacer { flex: 1; }
.x-tool { display: inline-flex; align-items: center; gap: 6px; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 3px; padding: 5px 10px; font: 13px Arial, sans-serif; cursor: pointer; }
.x-tool:hover { background: rgba(255,255,255,.12); }
.x-tool svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.x-timer { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; min-width: 120px; cursor: pointer; user-select: none; }
.x-timer small { font-size: 11px; opacity: .8; }
.x-timer b { font-size: 18px; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.x-timer.low b { color: #ffd166; }
.x-timer.crit b { color: #ff8a80; }
.x-timer.hidden b { visibility: hidden; }
.x-item { font-size: 13px; opacity: .9; white-space: nowrap; }

.x-body { flex: 1; min-height: 0; display: flex; }
.x-foot { flex: none; display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 16px; background: #dde1e6; border-top: 1px solid #c3c8cf; }
.x-foot .x-spacer { flex: 1; }
.x-btn { min-width: 96px; padding: 8px 16px; border-radius: 3px; border: 1px solid #1d4f91; background: #2462b0; color: #fff; font: 700 14px Arial, sans-serif; cursor: pointer; }
.x-btn:hover { background: #1d4f91; }
.x-btn:disabled { background: #9aa7b8; border-color: #9aa7b8; cursor: default; }
.x-btn.alt { background: #fff; color: #1d4f91; }
.x-btn.alt:hover { background: #eef3fb; }
.x-btn.danger { background: #b3261e; border-color: #8c1d17; }
.x-flag { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; user-select: none; }
.x-flag input { width: 16px; height: 16px; }

/* single-pane screens (welcome, NDA, tutorial, end) */
.x-page { flex: 1; overflow: auto; padding: 32px 16px; }
.x-sheet { max-width: 860px; margin: 0 auto; background: #fff; border: 1px solid #c9ced6; padding: 32px 40px; }
.x-sheet h1 { font: 700 22px Arial, sans-serif; margin: 0 0 16px; color: #1b1b1b; letter-spacing: 0; }
.x-sheet h2 { font: 700 17px Arial, sans-serif; margin: 22px 0 8px; color: #1b1b1b; letter-spacing: 0; }
.x-sheet p, .x-sheet li { font-size: 15px; }
.x-sheet ul, .x-sheet ol { padding-left: 1.3em; }
.x-sheet .x-box { border: 1px solid #c9ced6; background: #f6f7f9; padding: 14px 18px; height: 280px; overflow: auto; margin: 12px 0; font-size: 14px; }
.x-kv { display: grid; grid-template-columns: 200px 1fr; gap: 6px 16px; margin: 16px 0; }
.x-kv dt { color: #555; }
.x-kv dd { margin: 0; font-weight: 700; }
.x-radio { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.x-radio label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.x-note { font-size: 13px; color: #555; }
.x-sheet .x-shot { border: 1px solid #c9ced6; background: #eef0f3; padding: 12px; font-size: 13px; }

/* exercise: split pane */
.x-left { flex: 1 1 52%; min-width: 0; display: flex; flex-direction: column; background: #fff; border-right: 1px solid #c3c8cf; }
.x-right { flex: 1 1 48%; min-width: 0; display: flex; flex-direction: column; background: #fff; }
.x-split { flex: none; width: 6px; cursor: col-resize; background: #dde1e6; border-left: 1px solid #c3c8cf; border-right: 1px solid #c3c8cf; }
.x-split:hover { background: #b9c3cf; }
.x-tabs { flex: none; display: flex; flex-wrap: wrap; gap: 2px; padding: 8px 8px 0; background: #e7eaee; border-bottom: 1px solid #c3c8cf; }
.x-tabs button { border: 1px solid #c3c8cf; border-bottom: 0; background: #f4f5f7; color: #333; padding: 6px 12px; font: 13px Arial, sans-serif; cursor: pointer; border-radius: 3px 3px 0 0; margin-bottom: -1px; }
.x-tabs button.on { background: #fff; font-weight: 700; color: #1b1b1b; position: relative; }
.x-tabs button.seen:not(.on) { color: #666; }
.x-tabs button.seen:not(.on)::after { content: " ✓"; color: #2f7d55; }
.x-doc { flex: 1; overflow: auto; padding: 22px 26px; }
.x-doc h2 { font: 700 17px Arial, sans-serif; margin: 0 0 14px; color: #1b1b1b; letter-spacing: 0; }
.x-doc p, .x-doc li { font-size: 15px; }
.x-doc .mail-head { background: #f4f5f7; border: 1px solid #dde1e6; padding: 10px 12px; font-size: 13.5px; margin-bottom: 14px; line-height: 1.55; }
.x-doc .doc-table { border-collapse: collapse; width: 100%; font-size: 13.5px; margin: 6px 0 14px; }
.x-doc .doc-table th, .x-doc .doc-table td { border: 1px solid #c9ced6; padding: 6px 8px; text-align: left; vertical-align: top; }
.x-doc .doc-table th { background: #eef0f3; }
.x-doc .doc-note { font-size: 13px; color: #555; font-style: italic; }
.x-doc .handwritten { font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive; background: #fffbe6; border: 1px solid #eee2a8; padding: 14px 16px; transform: rotate(-.4deg); }
.x-doc mark.hl { background: #fff176; color: inherit; }
.x-doctools { flex: none; display: flex; gap: 6px; padding: 6px 10px; border-top: 1px solid #dde1e6; background: #f4f5f7; font-size: 12px; color: #555; align-items: center; }

.x-edtools { flex: none; display: flex; gap: 4px; align-items: center; padding: 6px 8px; background: #e7eaee; border-bottom: 1px solid #c3c8cf; }
.x-edtools button { background: #fff; border: 1px solid #b9c0ca; border-radius: 3px; padding: 4px 10px; font: 13px Arial, sans-serif; cursor: pointer; color: #222; }
.x-edtools button:hover { background: #eef3fb; }
.x-edtools .x-spacer { flex: 1; }
.x-edtools .x-wc { font-size: 13px; color: #333; }
.x-edlabel { flex: none; padding: 10px 12px 4px; font-size: 13px; color: #333; font-weight: 700; }
.x-editor { flex: 1; width: 100%; resize: none; border: 0; outline: none; padding: 14px 16px; font: 15px/1.55 Arial, sans-serif; color: #111; background: #fff; }
.x-editor:focus { box-shadow: inset 0 0 0 2px #2462b0; }

/* whiteboard */
.x-wb { position: absolute; top: 120px; left: 24px; width: 480px; height: 460px; background: #fff; border: 1px solid #8e99a8; box-shadow: 0 10px 30px rgba(0,0,0,.25); display: flex; flex-direction: column; z-index: 5; resize: both; overflow: hidden; min-width: 320px; min-height: 300px; }
.x-wb[hidden] { display: none; }
.x-wb-head { display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: #24384f; color: #fff; font-size: 13px; cursor: move; user-select: none; }
.x-wb-head .x-spacer { flex: 1; }
.x-wb-head button { background: transparent; border: 1px solid rgba(255,255,255,.35); color: #fff; border-radius: 3px; padding: 2px 8px; font: 12px Arial, sans-serif; cursor: pointer; }
.x-wb-head button.on { background: rgba(255,255,255,.25); }
.x-wb textarea { flex: 0 0 40%; border: 0; border-bottom: 1px solid #c3c8cf; padding: 10px; font: 14px/1.45 Arial, sans-serif; resize: none; outline: none; }
.x-wb canvas { flex: 1; width: 100%; cursor: crosshair; touch-action: none; display: block; }

/* modal + banners */
.x-modal-back { position: absolute; inset: 0; background: rgba(0,0,0,.4); display: grid; place-items: center; z-index: 10; padding: 16px; }
.x-modal { background: #fff; border: 1px solid #8e99a8; width: min(480px, 100%); box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.x-modal h3 { margin: 0; padding: 10px 14px; background: #24384f; color: #fff; font: 700 15px Arial, sans-serif; letter-spacing: 0; }
.x-modal .x-mb { padding: 18px 16px; font-size: 15px; }
.x-modal .x-mf { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px; background: #eef0f3; border-top: 1px solid #c9ced6; }
.x-banner { position: absolute; top: 60px; left: 50%; transform: translateX(-50%); background: #fff8d6; border: 1px solid #e0c95a; padding: 8px 16px; font-size: 14px; z-index: 6; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.x-proctor { position: absolute; bottom: 66px; left: 16px; background: #24384f; color: #fff; padding: 8px 12px; font-size: 13px; border-radius: 3px; z-index: 6; max-width: 360px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }

@media (max-width: 860px) {
  .x-body.split { flex-direction: column; }
  .x-split { display: none; }
  .x-left { flex: 1 1 50%; border-right: 0; border-bottom: 1px solid #c3c8cf; }
  .x-right { flex: 1 1 50%; }
  .x-sheet { padding: 20px; }
  .x-kv { grid-template-columns: 1fr; }
  .x-wb { left: 8px; right: 8px; width: auto; }
  .x-head .x-sub, .x-item { display: none; }
}
