/* ProctorShield theme: navy blue, signal red and white. */
:root {
  --blue-900: #071d4a;
  --blue-800: #0a2a66;
  --blue-700: #11398a;
  --blue-600: #1846b8;
  --blue-100: #dce6ff;
  --blue-50: #eef3ff;
  --red-700: #9e0b22;
  --red-600: #c8102e;
  --red-500: #e0253f;
  --red-50: #fdecef;
  --white: #ffffff;
  --ink: #0f172a;
  --muted: #5b6478;
  --line: #dce3f0;
  --surface: #f6f8fc;
  --green-600: #11804a;
  --green-50: #e7f6ee;
  --amber-600: #b45309;
  --amber-50: #fff5e1;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(10, 42, 102, .06), 0 4px 16px rgba(10, 42, 102, .07);
  --shadow-lg: 0 12px 40px rgba(7, 29, 74, .18);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--surface);
}
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; color: var(--blue-900); }
h1 { font-size: 2rem; letter-spacing: -.02em; }
h2 { font-size: 1.4rem; letter-spacing: -.01em; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 820px; }

/* ---------- top bar ---------- */
.topbar {
  background: var(--blue-800);
  color: var(--white);
  border-bottom: 4px solid var(--red-600);
  position: sticky; top: 0; z-index: 50;
}
.topbar .container { display: flex; align-items: center; gap: 1rem; min-height: 62px; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--white); font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 8px; background: var(--white);
  display: grid; place-items: center; flex: none;
}
.brand-mark .mark-text { display: inline-block; font-weight: 900; font-size: .95rem; color: var(--blue-900, #0a2a66); letter-spacing: -.02em; }
.brand-mark .mark-text::first-letter { color: var(--red-600); }
.brand span b { color: #ff8a99; font-weight: 800; }
.topnav { display: flex; gap: .25rem; margin-left: auto; align-items: center; flex-wrap: wrap; }
.topnav a, .topnav button.linklike {
  color: #dbe5ff; padding: .45rem .7rem; border-radius: var(--radius-sm); font-weight: 500; font-size: .93rem;
}
.topnav a:hover, .topnav button.linklike:hover { background: rgba(255, 255, 255, .1); color: var(--white); text-decoration: none; }
.userchip { display: flex; align-items: center; gap: .5rem; color: var(--white); font-size: .9rem; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--red-600); color: var(--white);
  display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none;
}
.role-tag { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #ffb3bf; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font: inherit; font-weight: 600; font-size: .93rem; line-height: 1;
  padding: .7rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; background: var(--blue-700); color: var(--white); transition: background .15s, box-shadow .15s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--blue-800); text-decoration: none; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, button:focus-visible {
  outline: 3px solid rgba(24, 70, 184, .35); outline-offset: 2px;
}
.btn.red { background: var(--red-600); }
.btn.red:hover { background: var(--red-700); }
.btn.ghost { background: var(--white); color: var(--blue-800); border-color: var(--line); }
.btn.ghost:hover { background: var(--blue-50); }
.btn.danger-ghost { background: var(--white); color: var(--red-600); border-color: #f3c2ca; }
.btn.danger-ghost:hover { background: var(--red-50); }
.btn.light { background: var(--white); color: var(--blue-800); }
.btn.light:hover { background: var(--blue-50); }
.btn.sm { padding: .45rem .7rem; font-size: .84rem; }
.btn.lg { padding: .9rem 1.4rem; font-size: 1rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
button.linklike { background: none; border: 0; font: inherit; cursor: pointer; }

/* ---------- cards & layout ---------- */
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.4rem;
}
.card.flat { box-shadow: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.page { padding: 28px 0 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 1.7rem; }
.page-head p { margin: .25rem 0 0; }

.stat { padding: 1.1rem 1.2rem; border-left: 4px solid var(--blue-600); }
.stat.red { border-left-color: var(--red-600); }
.stat .label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.stat .value { font-size: 1.9rem; font-weight: 800; color: var(--blue-900); line-height: 1.1; margin-top: .2rem; }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; font-size: .88rem; color: var(--blue-900); margin-bottom: .35rem; }
.field { margin-bottom: 1rem; }
.hint { font-size: .8rem; color: var(--muted); margin-top: .3rem; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--white);
  border: 1px solid #c9d3e6; border-radius: var(--radius-sm); padding: .62rem .75rem;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(24, 70, 184, .12); outline: none; }
textarea { min-height: 96px; resize: vertical; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 500; color: var(--ink); cursor: pointer; margin: 0; }
.check input { margin-top: .25rem; width: 17px; height: 17px; accent-color: var(--blue-700); flex: none; }
.form-error { background: var(--red-50); color: var(--red-700); border: 1px solid #f5c1ca; padding: .65rem .8rem; border-radius: var(--radius-sm); font-size: .9rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem 0.2rem; margin: 0 0 1.2rem; }
legend { font-weight: 700; color: var(--blue-800); padding: 0 .4rem; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .7rem .85rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--blue-50); color: var(--blue-900); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafbff; }
td .row { flex-wrap: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 2.2rem 1rem; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .55rem; border-radius: 999px;
  font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
  background: var(--blue-50); color: var(--blue-700);
}
.badge.red { background: var(--red-50); color: var(--red-700); }
.badge.green { background: var(--green-50); color: var(--green-600); }
.badge.amber { background: var(--amber-50); color: var(--amber-600); }
.badge.gray { background: #eef0f4; color: #4b5565; }
.badge.solid-red { background: var(--red-600); color: var(--white); }
.badge.solid-blue { background: var(--blue-700); color: var(--white); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: .25rem; border-bottom: 2px solid var(--line); margin-bottom: 1.4rem; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.tabs a, .tabs button {
  padding: .7rem 1rem; font-weight: 600; color: var(--muted); border: 0; background: none; font: inherit; font-weight: 600;
  border-bottom: 3px solid transparent; margin-bottom: -2px; cursor: pointer; white-space: nowrap;
}
.tabs a:hover, .tabs button:hover { color: var(--blue-800); text-decoration: none; }
.tabs .active { color: var(--blue-800); border-bottom-color: var(--red-600); }

/* ---------- toast & modal ---------- */
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 300; display: flex; flex-direction: column; gap: .5rem; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--blue-900); color: var(--white); padding: .8rem 1rem; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-size: .92rem; border-left: 4px solid var(--blue-100); }
.toast.error { border-left-color: var(--red-500); }
.toast.success { border-left-color: #4ade80; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(7, 29, 74, .55); z-index: 200; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; padding: 1.5rem; border-top: 5px solid var(--blue-700); }
.modal.warn { border-top-color: var(--red-600); }
.modal h3 { margin-bottom: .6rem; }
.modal .actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.3rem; flex-wrap: wrap; }

/* ---------- landing ---------- */
.hero { background: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-700) 70%, #1b4fd0 100%); color: var(--white); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(200, 16, 46, .35); }
.hero .container { padding-top: 72px; padding-bottom: 80px; position: relative; z-index: 1; }
.hero h1 { color: var(--white); font-size: clamp(2rem, 4.5vw, 3.1rem); max-width: 760px; }
.hero h1 em { font-style: normal; color: #ff8a99; }
.hero p.lead { font-size: 1.15rem; color: #d6e0ff; max-width: 640px; margin-bottom: 1.8rem; }
.portal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: -48px; position: relative; z-index: 2; }
.portal { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 1.5rem; border-top: 5px solid var(--blue-700); display: flex; flex-direction: column; }
.portal.red { border-top-color: var(--red-600); }
.portal h3 { margin-bottom: .3rem; }
.portal p { color: var(--muted); flex: 1; }
.feature { display: flex; gap: .9rem; }
.feature .icon { width: 42px; height: 42px; border-radius: 10px; background: var(--red-50); color: var(--red-600); display: grid; place-items: center; flex: none; }
.feature .icon.blue { background: var(--blue-50); color: var(--blue-700); }
.feature .icon { font-weight: 800; font-size: .95rem; letter-spacing: .02em; }
.feature h3 { margin-bottom: .2rem; font-size: 1rem; }
.feature p { color: var(--muted); font-size: .92rem; margin: 0; }
.section { padding: 56px 0; }
.section-title { text-align: center; margin-bottom: 2rem; }
.section-title p { color: var(--muted); }
footer.site { background: var(--blue-900); color: #b9c6e8; padding: 28px 0; font-size: .88rem; border-top: 4px solid var(--red-600); }
footer.site a { color: var(--white); }
footer.site .row { justify-content: space-between; }

/* ---------- auth pages ---------- */
.auth-wrap { min-height: calc(100vh - 66px); display: grid; place-items: center; padding: 32px 16px; background: linear-gradient(180deg, var(--blue-50), var(--surface)); }
.auth-card { width: 100%; max-width: 440px; }
.auth-card .card { padding: 1.8rem; border-top: 5px solid var(--red-600); }
.role-switch { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--blue-50); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 1.4rem; }
.role-switch button { border: 0; background: none; padding: .55rem .3rem; border-radius: 5px; font: inherit; font-weight: 600; font-size: .86rem; color: var(--blue-800); cursor: pointer; }
.role-switch button.active { background: var(--blue-700); color: var(--white); box-shadow: var(--shadow); }

/* ---------- legal pages ---------- */
.legal h2 { margin-top: 1.8rem; font-size: 1.2rem; border-left: 4px solid var(--red-600); padding-left: .6rem; }
.legal li { margin-bottom: .4rem; }
.notice { background: var(--blue-50); border: 1px solid var(--blue-100); border-left: 4px solid var(--blue-700); padding: .9rem 1rem; border-radius: var(--radius-sm); }
.notice.red { background: var(--red-50); border-color: #f5c1ca; border-left-color: var(--red-600); }

/* ---------- exam cards (student) ---------- */
.exam-card { display: flex; flex-direction: column; gap: .6rem; border-top: 4px solid var(--blue-700); }
.exam-card.live { border-top-color: var(--red-600); }
.exam-card .meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; color: var(--muted); font-size: .85rem; }
.exam-card .actions { margin-top: auto; padding-top: .6rem; }

/* ---------- exam builder ---------- */
.q-editor { border: 1px solid var(--line); border-left: 4px solid var(--blue-700); border-radius: var(--radius); padding: 1rem 1.1rem; background: var(--white); margin-bottom: 1rem; }
.q-editor .q-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .8rem; flex-wrap: wrap; }
.q-editor .q-num { background: var(--blue-700); color: var(--white); font-weight: 700; border-radius: 6px; padding: .15rem .55rem; font-size: .85rem; }
.opt-row { display: flex; gap: .5rem; align-items: center; margin-bottom: .45rem; }
.opt-row input[type=text] { flex: 1; }
.opt-row .correct-toggle { display: flex; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 600; color: var(--green-600); margin: 0; white-space: nowrap; }
.opt-row .correct-toggle input { accent-color: var(--green-600); width: 16px; height: 16px; }
.icon-btn { border: 1px solid var(--line); background: var(--white); color: var(--muted); border-radius: 6px; width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer; flex: none; font-size: 1rem; line-height: 1; }
.icon-btn:hover { color: var(--red-600); border-color: #f3c2ca; background: var(--red-50); }
.sticky-actions { position: sticky; bottom: 0; background: rgba(246, 248, 252, .95); backdrop-filter: blur(6px); padding: .9rem 0; border-top: 1px solid var(--line); display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; z-index: 5; }

/* ---------- risk ---------- */
.risk-meter { height: 10px; background: #e8ecf5; border-radius: 999px; overflow: hidden; }
.risk-meter > span { display: block; height: 100%; border-radius: 999px; background: var(--green-600); }
.risk-meter.medium > span { background: var(--amber-600); }
.risk-meter.high > span { background: var(--red-600); }
.flag { display: flex; gap: .75rem; padding: .7rem 0; border-bottom: 1px dashed var(--line); }
.flag:last-child { border-bottom: 0; }
.flag .pts { font-weight: 800; color: var(--red-600); min-width: 40px; }
.timeline { list-style: none; padding: 0; margin: 0; max-height: 380px; overflow: auto; font-size: .86rem; }
.timeline li { display: flex; gap: .7rem; padding: .45rem 0; border-bottom: 1px solid #eef1f7; }
.timeline time { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 72px; }
.answer-review { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: .8rem; background: var(--white); }
.answer-review.right { border-left: 4px solid var(--green-600); }
.answer-review.wrong { border-left: 4px solid var(--red-600); }
.answer-review.pending { border-left: 4px solid var(--amber-600); }
.answer-review .opt { padding: .3rem .55rem; border-radius: 5px; margin: .2rem 0; }
.answer-review .opt.correct { background: var(--green-50); color: var(--green-600); font-weight: 600; }
.answer-review .opt.chosen-wrong { background: var(--red-50); color: var(--red-700); font-weight: 600; text-decoration: line-through; }
.answer-review pre, .pre { white-space: pre-wrap; word-break: break-word; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: .7rem; font: inherit; margin: .4rem 0; }

/* ---------- exam taking ---------- */
body.exam-mode { user-select: none; -webkit-user-select: none; background: #eef2f9; }
body.exam-mode textarea, body.exam-mode input[type=text] { user-select: text; -webkit-user-select: text; }
.exam-bar { background: var(--blue-800); color: var(--white); border-bottom: 4px solid var(--red-600); position: sticky; top: 0; z-index: 40; }
.exam-bar .container { display: flex; align-items: center; gap: 1rem; min-height: 64px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.exam-bar .title { font-weight: 700; font-size: 1.02rem; }
.timer { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.35rem; background: var(--white); color: var(--blue-900); border-radius: 8px; padding: .3rem .8rem; min-width: 110px; text-align: center; }
.timer.low { background: var(--red-600); color: var(--white); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .75; } }
.proctor-pill { display: inline-flex; align-items: center; gap: .45rem; font-size: .82rem; font-weight: 600; background: rgba(255, 255, 255, .12); padding: .35rem .7rem; border-radius: 999px; }
.proctor-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .25); }
.proctor-pill.alert .dot { background: var(--red-500); box-shadow: 0 0 0 3px rgba(224, 37, 63, .3); }
.exam-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 1.2rem; padding: 22px 0 40px; }
.question-card { min-height: 360px; display: flex; flex-direction: column; }
.question-card .q-text { font-size: 1.08rem; font-weight: 600; color: var(--blue-900); white-space: pre-wrap; margin-bottom: 1.2rem; }
.choice { display: flex; gap: .8rem; align-items: center; border: 2px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; margin-bottom: .6rem; cursor: pointer; background: var(--white); transition: border-color .12s, background .12s; font-weight: 500; }
.choice:hover { border-color: var(--blue-100); background: var(--blue-50); }
.choice.selected { border-color: var(--blue-700); background: var(--blue-50); }
.choice input { width: 18px; height: 18px; accent-color: var(--blue-700); flex: none; }
.choice .letter { width: 28px; height: 28px; border-radius: 50%; background: var(--blue-50); color: var(--blue-800); display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; }
.choice.selected .letter { background: var(--blue-700); color: var(--white); }
.q-nav { margin-top: auto; padding-top: 1.2rem; display: flex; gap: .6rem; flex-wrap: wrap; border-top: 1px solid var(--line); }
.palette { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; }
.palette button { aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--line); background: var(--white); font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; position: relative; }
.palette button.answered { background: var(--blue-700); border-color: var(--blue-700); color: var(--white); }
.palette button.flagged::after { content: ""; position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--red-600); border: 1px solid var(--white); }
.palette button.current { outline: 3px solid var(--red-600); outline-offset: 1px; }
.legend { display: grid; gap: .35rem; font-size: .8rem; color: var(--muted); margin-top: .9rem; }
.legend span { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: .4rem; border: 1px solid var(--line); }
.save-state { font-size: .8rem; color: var(--muted); }
.lock-screen { position: fixed; inset: 0; z-index: 250; background: rgba(7, 29, 74, .94); color: var(--white); display: grid; place-items: center; padding: 20px; text-align: center; }
.lock-screen .box { max-width: 520px; }
.lock-screen h2 { color: var(--white); font-size: 1.6rem; }
.lock-screen .count { display: inline-block; background: var(--red-600); border-radius: 999px; padding: .3rem .9rem; font-weight: 700; margin-bottom: 1rem; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid #eef1f7; align-items: center; }
.checklist .ok { color: var(--green-600); font-weight: 800; }
.checklist .bad { color: var(--red-600); font-weight: 800; }
.score-ring { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 1rem; background: conic-gradient(var(--blue-700) calc(var(--p) * 1%), #e5eaf5 0); }
.score-ring > div { width: 118px; height: 118px; border-radius: 50%; background: var(--white); display: grid; place-items: center; font-size: 1.7rem; font-weight: 800; color: var(--blue-900); }

@media (max-width: 960px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3, .portal-grid { grid-template-columns: 1fr; }
  .exam-layout { grid-template-columns: 1fr; }
  .portal-grid { margin-top: -32px; }
}
@media (max-width: 640px) {
  .grid.cols-2, .grid.cols-4 { grid-template-columns: 1fr; }
  .container { padding: 0 16px; }
  .topnav .hide-sm { display: none; }
  h1 { font-size: 1.6rem; }
  .timer { font-size: 1.1rem; min-width: 90px; }
}
@media print {
  body.exam-mode * { display: none !important; }
}

/* ---------- phase 2: Google button, alerts, rooms, chat, labs ---------- */
.divider-text { display: flex; align-items: center; gap: .7rem; color: var(--muted); font-size: .85rem; margin: 1rem 0 .4rem; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.btn.outline { background: var(--white); color: var(--blue-900); border: 1px solid var(--line); }
.btn.outline:hover { border-color: var(--blue-700); text-decoration: none; }
.bell { position: relative; }
.bell-count { display: inline-block; min-width: 1.3em; margin-left: .3rem; padding: 0 .35em; border-radius: 999px; background: var(--red-600); color: #fff; font-size: .75rem; font-weight: 700; text-align: center; }
.alert-list { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow: auto; }
.alert-item { padding: .7rem .2rem; border-bottom: 1px solid var(--line); display: grid; gap: .2rem; }
.alert-item.unread { background: var(--red-50); padding-left: .6rem; border-left: 3px solid var(--red-600); }
.room-code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 800; letter-spacing: .18em; color: var(--blue-900); background: var(--blue-50); border: 1px dashed var(--blue-700); border-radius: var(--radius-sm); padding: .35rem .6rem; display: inline-block; }
.room-code.big { font-size: 1.6rem; margin-bottom: .6rem; }
.room-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; gap: 1.2rem; }
@media (max-width: 900px) { .room-grid { grid-template-columns: 1fr; } }
.chat { display: flex; flex-direction: column; gap: .6rem; }
.chat-log { height: 380px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem; background: var(--surface); display: flex; flex-direction: column; gap: .5rem; }
.chat-msg { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: .45rem .6rem; max-width: 92%; overflow-wrap: anywhere; }
.chat-msg.mine { align-self: flex-end; border-color: #f3c2ca; background: var(--red-50); }
.chat-form { display: flex; gap: .5rem; align-items: flex-end; }
.chat-form textarea { flex: 1; min-height: 44px; resize: vertical; }
.chat-note { padding: .4rem .6rem; background: var(--amber-50); border-radius: var(--radius-sm); }
.code-editor, pre.code { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: .88rem; line-height: 1.45; tab-size: 2; }
textarea.code-editor { width: 100%; min-height: 300px; white-space: pre; overflow: auto; background: #0b1630; color: #e6edff; border-radius: var(--radius-sm); padding: .7rem; }
.builder textarea.code-editor, .test-row textarea.code-editor { min-height: 70px; }
pre.code { white-space: pre-wrap; margin: .2rem 0 .5rem; }
.run-output { margin-top: .7rem; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem; background: var(--white); }
.run-output .test { border-left: 3px solid var(--line); padding: .3rem .6rem; margin-top: .5rem; }
.run-output .test.pass, .test-list .pass { border-color: var(--green-600); color: var(--green-600); }
.run-output .test.fail, .test-list .fail { border-color: var(--red-600); color: var(--red-600); }
.test-list { margin: .3rem 0; padding-left: 1.1rem; font-size: .9rem; }
.test-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: .6rem; align-items: start; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem; margin-bottom: .5rem; }
@media (max-width: 700px) { .test-row { grid-template-columns: 1fr; } }
.card.release { border-left: 4px solid var(--amber-600); }
.card.release.on { border-left-color: var(--green-600); }

/* ---------- TRACE (coding-process report) ---------- */
.trace-card { margin-top: .8rem; padding: .8rem 1rem; border: 1px solid var(--line); border-left: 4px solid var(--blue-600); border-radius: var(--radius-sm); background: var(--blue-50); }
.trace-metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem 1rem; margin: .7rem 0; }
.trace-reasons { margin: .3rem 0 0; padding-left: 0; list-style: none; }
.trace-reasons li { margin: .25rem 0; }
.trace-reasons .pts { display: inline-block; min-width: 2.4rem; font-weight: 700; color: var(--red-600); }
.trace-doc { max-height: 360px; overflow: auto; background: var(--white); }
.trace-caret { display: inline-block; width: 2px; height: 1.1em; margin: 0 -1px; vertical-align: text-bottom; background: var(--red-600); }
