.ex-body { background: var(--light); color: var(--text); min-height: 100vh; display: flex; flex-direction: column; font-family: inherit; }
.ex-wrap { width: min(1100px, calc(100% - 32px)); margin: auto; }
.ex-top { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.ex-top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; flex-wrap: wrap; }
.ex-brand img { display: block; height: 44px; width: auto; }
.ex-nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ex-nav a { padding: 8px 14px; border-radius: 10px; font-weight: 700; color: var(--navy); text-decoration: none; }
.ex-nav a:hover { background: var(--light); }
.ex-nav a.out { background: var(--navy); color: #fff; }
.ex-who { font-weight: 700; color: var(--muted); margin-right: 6px; }
.ex-main { flex: 1; padding: 26px 0 50px; }
.ex-foot { text-align: center; padding: 18px; color: var(--muted); font-size: 14px; }
.ex-card { background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px; }
.ex-card h1, .ex-card h2 { color: var(--navy); margin: 0 0 12px; line-height: 1.25; }
.ex-card h1 { font-size: 26px; } .ex-card h2 { font-size: 20px; }
.ex-narrow { max-width: 440px; margin: 30px auto; }
.ex-muted { color: var(--muted); font-size: 14px; }
.ex-flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-weight: 600; }
.ex-flash.ok { background: #eef6dc; color: #3d5c0b; border: 1px solid #cfe3a3; }
.ex-flash.err { background: #fdecee; color: #8d1f27; border: 1px solid #f3c2c7; }
.ex-body label { display: block; font-weight: 700; font-size: 14px; color: var(--navy); margin: 14px 0 6px; }
.ex-body input[type=text], .ex-body input[type=password], .ex-body input[type=number], .ex-body input[type=datetime-local], .ex-body select, .ex-body textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--border); border-radius: 11px; font: inherit; background: #fff; }
.ex-body textarea { min-height: 90px; resize: vertical; }
.ex-body input:focus, .ex-body select:focus, .ex-body textarea:focus { outline: none; border-color: var(--green-dark); box-shadow: 0 0 0 3px rgba(110,159,24,.18); }
.ex-btn { display: inline-block; border: 0; border-radius: 11px; padding: 11px 20px; background: var(--green-dark); color: #fff; font-weight: 800; font-size: 15px; cursor: pointer; text-decoration: none; }
.ex-btn:hover { filter: brightness(.95); }
.ex-btn.ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--border); }
.ex-btn.red { background: #c0392b; } .ex-btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.ex-btn:disabled { opacity: .5; cursor: not-allowed; }
.ex-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ex-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.ex-stat { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 18px; }
.ex-stat b { display: block; font-size: 30px; color: var(--navy); }
.ex-tbl-wrap { overflow-x: auto; }
.ex-tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.ex-tbl th { text-align: left; background: var(--light); color: var(--navy); padding: 10px 12px; white-space: nowrap; }
.ex-tbl td { padding: 10px 12px; border-top: 1px solid var(--border); vertical-align: top; }
.ex-badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 800; background: #e9eef5; color: var(--navy); }
.ex-badge.g { background: #eef6dc; color: #3d5c0b; } .ex-badge.o { background: #fff3da; color: #8a5a00; } .ex-badge.r { background: #fdecee; color: #8d1f27; }
.ex-q { border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin-bottom: 14px; background: #fff; }
.ex-q .qt { font-weight: 700; color: var(--navy); margin-bottom: 10px; white-space: pre-wrap; }
.ex-q .mk { float: right; font-size: 12px; color: var(--muted); font-weight: 700; }
.ex-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 11px; margin-bottom: 8px; cursor: pointer; font-weight: 500 !important; color: var(--text) !important; margin-top: 0 !important; }
.ex-opt:hover { border-color: #b9c7d8; } .ex-opt input { margin-top: 4px; width: auto; }
.ex-opt.sel { border-color: var(--green-dark); background: #eef6dc; }
.ex-opt.right { border-color: #6e9f18; background: #eef6dc; } .ex-opt.wrong { border-color: #c0392b; background: #fdecee; }
.ex-timer { position: sticky; top: 64px; z-index: 15; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 12px; display: flex; justify-content: space-between; margin-bottom: 16px; font-weight: 800; }
.ex-timer.low { background: #c0392b; }
.ex-files { margin-top: 10px; font-size: 14px; } .ex-files li { margin: 4px 0; }
.ex-saved { font-size: 12px; color: var(--muted); }
.ex-cred { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; }
.ex-split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; } @media (max-width: 760px) { .ex-split { grid-template-columns: 1fr; } }
.ex-opt-edit { display: flex; gap: 8px; margin-bottom: 6px; align-items: center; } .ex-opt-edit input[type=text] { flex: 1; }
@media print { .ex-top, .ex-foot, .no-print { display: none !important; } .ex-card { box-shadow: none; border: 0; } }

.ex-tabs { display: flex; gap: 6px; background: var(--light); padding: 5px; border-radius: 12px; margin-bottom: 20px; }
.ex-tabs a { flex: 1; text-align: center; padding: 10px 8px; border-radius: 9px; font-weight: 800; color: var(--muted); text-decoration: none; }
.ex-tabs a.on { background: #fff; color: var(--navy); box-shadow: 0 2px 8px rgba(23,45,77,.12); }

/* ---- exam page: one question at a time, palette, watermark, copy lock ---- */
.ex-exam-grid { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; align-items: start; }
@media (max-width: 860px) { .ex-exam-grid { grid-template-columns: 1fr; } .ex-pal-box { position: static !important; } }
.ex-pal-box { background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); position: sticky; top: 120px; }
.ex-pal-box h3 { margin: 0 0 12px; color: var(--navy); font-size: 17px; }
.ex-pal { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; max-height: 46vh; overflow-y: auto; padding: 2px; }
.pal { border: 2px solid transparent; border-radius: 10px; padding: 9px 0; font-weight: 800; font-size: 14px; cursor: pointer; background: #e9eef5; color: var(--navy); }
.pal.done, .lg.done { background: #3fa535; color: #fff; }
.pal.skip, .lg.skip { background: #f5c518; color: #4a3b00; }
.pal.new, .lg.new { background: #e9eef5; color: var(--navy); }
.pal.cur { border-color: var(--navy); box-shadow: 0 0 0 2px #fff inset; outline: 2px solid var(--navy); outline-offset: 1px; }
.ex-legend { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.ex-legend .lg { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; }
.ex-nav-btns { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 6px 0 20px; }
.ex-wm { position: fixed; inset: -40%; z-index: 9; pointer-events: none; opacity: .07; background-repeat: repeat; background-size: 190px auto; transform: rotate(-22deg); }
.exam-lock .ex-card, .exam-lock .ex-q, .exam-lock .ex-pal-box { background: rgba(255,255,255,.9); }
.exam-lock, .exam-lock * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.exam-lock input[type=text], .exam-lock textarea { -webkit-user-select: text; user-select: text; }
@media print { .exam-lock * { display: none !important; } }
/* ---- message box + dashboard ---- */
.ex-modal { position: fixed; inset: 0; background: rgba(15,30,55,.55); z-index: 100; display: none; align-items: center; justify-content: center; padding: 16px; }
.ex-modal.on { display: flex; }
.ex-modal .box { background: #fff; border-radius: 18px; padding: 22px; width: min(560px, 100%); max-height: 92vh; overflow: auto; }
.ex-modal textarea { min-height: 260px; font-size: 14.5px; }
.ex-bar { display: flex; align-items: center; gap: 10px; margin: 6px 0; font-size: 14px; }
.ex-bar .lbl { width: 92px; color: var(--muted); } .ex-bar .fill { height: 14px; border-radius: 7px; background: var(--green-dark); min-width: 3px; }
.ex-prog { height: 8px; background: #e9eef5; border-radius: 6px; overflow: hidden; min-width: 80px; } .ex-prog i { display: block; height: 100%; background: var(--green-dark); }

.qpage { scroll-margin-top: 128px; }
.ex-verify { border: 1.5px dashed var(--border); border-radius: 14px; padding: 16px; margin: 16px 0; }
.ex-vbox { border-top: 1px solid var(--border); padding: 14px 0 4px; } .ex-vbox:first-of-type { border-top: 0; }
.ex-vbox h3 { margin: 0 0 4px; color: var(--navy); font-size: 17px; }
.vcam video { width: 100%; max-width: 360px; border-radius: 14px; background: #000; transform: scaleX(-1); display: block; margin-bottom: 10px; }
.vprev { display: block; width: 100%; max-width: 240px; border-radius: 12px; border: 1px solid var(--border); margin: 8px 0 12px; }
label.ex-btn { cursor: pointer; margin: 0 !important; }
.ex-btn:disabled { pointer-events: none; }
.ex-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); vertical-align: middle; }
.ex-photos img { max-width: 230px; width: 100%; border-radius: 12px; border: 1px solid var(--border); display: block; margin-top: 6px; }

.vcam video { max-height: 55vh; object-fit: cover; }
.vprev { max-height: 260px; object-fit: cover; }

/* ---- exam screen lock (warning / removal messages) ---- */
.ex-lockov { position: fixed; inset: 0; z-index: 2000; background: rgba(15,30,55,.96); display: none; align-items: center; justify-content: center; padding: 16px; overflow: auto; }
.ex-lockov.on { display: flex; }
.ex-lockov .box { background: #fff; border-radius: 18px; padding: 24px; width: min(640px, 100%); max-height: 94vh; overflow: auto; text-align: left; }
.ex-lockov h2 { margin: 0 0 12px; font-size: 22px; color: var(--navy); }
.ex-lockov.warn h2, .ex-lockov.kick h2 { color: #c0392b; }
.ex-lockov p { margin: 0 0 12px; line-height: 1.55; }
.ex-lockov .hi { color: #333; border-left: 3px solid #e3e8f0; padding-left: 10px; }
.ex-lockov .ex-btn { width: 100%; margin-top: 6px; }
.ex-lockbar { background: #fdecea; color: #922b21; border: 1px solid #f5c6c0; border-radius: 10px; padding: 8px 12px; font-size: 13px; line-height: 1.45; margin-bottom: 12px; }
.ex-lockbar b { color: #c0392b; }
