/* AAOIFI Exam Prep: design system
   Tokens -> base -> layout -> components -> pages. No build step. */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5faf7;
  --surface-3: #edf3f0;
  --border: #e3ece7;
  --border-strong: #cddcd4;
  --text: #0d1715;
  --text-2: #52675e;
  --muted: #75877e;

  --primary: #008452;
  --primary-hover: #006c43;
  --primary-soft: #e8f7ef;
  --primary-text: #ffffff;
  --accent: #29734a;
  --accent-soft: #edfad9;

  --success: #1f7a4d;
  --success-soft: #e2f3e9;
  --danger: #b3261e;
  --danger-soft: #fbe6e4;
  --warning: #9a6200;
  --warning-soft: #fdf1d8;
  --info: #1f5fa8;
  --info-soft: #e3edf9;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(20, 30, 25, .06);
  --shadow: 0 1px 3px rgba(20, 30, 25, .06), 0 6px 20px rgba(20, 30, 25, .06);
  --shadow-lg: 0 12px 40px rgba(20, 30, 25, .16);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --sidebar-w: 248px;
  --topbar-h: 60px;
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::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(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.mono { font-family: var(--mono); font-size: .9em; }
.nowrap { white-space: nowrap; }
.display { font-family: var(--font-display); font-weight: 600; letter-spacing: -.015em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 760px; }
.stack > * + * { margin-top: var(--gap, 1rem); }
.row { display: flex; align-items: center; gap: .75rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-sidebar { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
@media (max-width: 960px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-sidebar { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .container { padding: 0 16px; }
}
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2.5rem; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  --btn-border: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  height: 40px; padding: 0 16px;
  font: inherit; font-weight: 550; font-size: .93rem; line-height: 1;
  color: var(--btn-fg); background: var(--btn-bg);
  border: 1px solid var(--btn-border); border-radius: var(--radius-sm);
  cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { --btn-bg: var(--primary); --btn-fg: var(--primary-text); --btn-border: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-accent { --btn-bg: var(--accent); --btn-fg: #fff; --btn-border: var(--accent); }
.btn-accent:hover { filter: brightness(.95); background: var(--accent); }
.btn-danger { --btn-bg: var(--danger); --btn-fg: #fff; --btn-border: var(--danger); }
.btn-danger:hover { filter: brightness(.95); background: var(--danger); }
.btn-ghost { --btn-bg: transparent; --btn-border: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger-ghost { --btn-bg: transparent; --btn-border: transparent; --btn-fg: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-sm { height: 32px; padding: 0 12px; font-size: .85rem; }
.btn-lg { height: 48px; padding: 0 24px; font-size: 1rem; }
.btn-icon { width: 36px; padding: 0; }
.btn-block { width: 100%; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-sm svg { width: 16px; height: 16px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-body { padding: 20px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.card-header h2, .card-header h3 { margin: 0; font-size: 1rem; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.card-link { display: block; color: inherit; text-decoration: none !important; transition: border-color .15s, box-shadow .15s, transform .15s; }
.card-link:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }

/* ---------- Stat tiles ---------- */
.stat { padding: 18px 20px; }
.stat-label { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.stat-value { font-size: 1.85rem; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-hint { font-size: .85rem; color: var(--text-2); margin-top: 2px; }
.stat-accent { border-top: 3px solid var(--primary); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border-radius: 999px;
  font-size: .76rem; font-weight: 600; line-height: 1.6; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2);
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-xs { padding: 1px 7px; font-size: .68rem; vertical-align: 1px; white-space: nowrap; }
.admin-note { display: flex; gap: 8px; align-items: flex-start; color: var(--text-2); line-height: 1.5; }
.admin-note svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--primary); }
.cell-exam { min-width: 160px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }
.dot-live { color: var(--success); box-shadow: 0 0 0 0 currentColor; animation: pulse 1.8s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.presence-online { color: var(--success); }
.presence-idle { color: var(--warning); }
.presence-offline { color: var(--muted); }

/* ---------- Avatars ---------- */
.avatar {
  --size: 36px;
  width: var(--size); height: var(--size); flex: none;
  border-radius: 50%; overflow: hidden;
  display: inline-grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
  font-weight: 650; font-size: calc(var(--size) * .38);
}
.avatar { position: relative; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
/* while a new photo is being saved */
.avatar.is-uploading img, .avatar.is-uploading { opacity: .75; }
.avatar.is-uploading::after { content: ""; position: absolute; inset: 22%; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .7); border-top-color: var(--primary); animation: avatar-spin .8s linear infinite; }
@keyframes avatar-spin { to { transform: rotate(360deg); } }
/* profile page: change the photo right on the avatar */
.avatar-edit { position: relative; display: inline-flex; flex: none; }
.avatar-edit__btn { position: absolute; right: 0; bottom: 0; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--primary); color: var(--primary-text); border: 3px solid var(--surface); cursor: pointer; box-shadow: var(--shadow); transition: transform .15s; }
.avatar-edit__btn:hover { transform: scale(1.06); }
.avatar-edit__btn:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.avatar-edit__btn svg { width: 16px; height: 16px; }
.avatar-edit[aria-busy="true"] .avatar-edit__btn { pointer-events: none; opacity: .6; }
.avatar-sm { --size: 28px; }
.avatar-lg { --size: 72px; }
.avatar-xl { --size: 112px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 1rem 1.25rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
/* Password fields: show / hide button inside the field (common.js) */
.password-field { position: relative; display: block; }
.password-field > input { width: 100%; }
.field .password-field > input, .password-field > input { padding-right: 48px; }
.password-toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 36px; height: 36px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; transition: color .15s, background .15s; }
.password-toggle:hover { color: var(--text); background: var(--surface-2); }
.password-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; color: var(--text); }
.password-toggle[aria-pressed="true"] { color: var(--primary); }
.password-toggle svg { width: 18px; height: 18px; }
.caps-hint { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: .8rem; font-weight: 600; color: var(--warning); }
.caps-hint::before { content: "\21EA"; font-size: .95rem; }
/* Edge and old IE draw their own eye; ours replaces it */
input::-ms-reveal, input::-ms-clear { display: none; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.field label, .label { display: block; font-weight: 550; font-size: .9rem; margin-bottom: 6px; color: var(--text); }
.field .help { font-size: .82rem; color: var(--muted); margin-top: 5px; }
.field .errorlist, .errorlist { list-style: none; margin: 6px 0 0; padding: 0; color: var(--danger); font-size: .84rem; }
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: var(--danger); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"],
input[type="date"], input[type="tel"], input[type="url"], select, textarea {
  width: 100%; height: 42px; padding: 0 12px;
  font: inherit; font-size: .95rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 90px; line-height: 1.5; }
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a8380' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); width: 17px; height: 17px; margin: 0; flex: none; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-weight: 500; }
.check input { margin-top: 2px; }
.check .help { margin-top: 2px; display: block; font-weight: 400; }
.form-actions { display: flex; gap: .75rem; justify-content: flex-end; flex-wrap: wrap; padding-top: .5rem; }
.non-field-errors { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); font-size: .9rem; margin-bottom: 1rem; }
.non-field-errors ul { margin: 0; padding-left: 1.1rem; }

/* Segmented radio (question type etc.) */
.segmented { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
.segmented label { margin: 0; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 7px; font-weight: 550; font-size: .9rem; color: var(--text-2); transition: background .15s, color .15s; }
.segmented input:checked + span { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.segmented input:focus-visible + span { outline: 2px solid var(--primary); }
.segmented span { white-space: nowrap; }
.segmented svg { width: 18px; height: 18px; flex: none; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: .76rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-row-link { cursor: pointer; }
.cell-user { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.cell-user .name { font-weight: 600; color: var(--text); line-height: 1.2; }
.cell-user .sub { font-size: .8rem; color: var(--muted); }
tr.flash { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: var(--accent-soft); } to { background: transparent; } }

/* ---------- Progress ---------- */
.progress { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: inherit; transition: width .4s ease; }
.progress-sm { height: 5px; }
.progress-success > span { background: var(--success); }
.progress-danger > span { background: var(--danger); }

.score-ring {
  --p: 0; --size: 140px; --c: var(--primary);
  width: var(--size); height: var(--size); border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-3) 0);
  display: grid; place-items: center; flex: none;
}
.score-ring::before { content: ""; grid-area: 1 / 1; width: calc(var(--size) - 22px); height: calc(var(--size) - 22px); border-radius: 50%; background: var(--surface); }
.score-ring > div { grid-area: 1 / 1; text-align: center; z-index: 1; }
.score-ring strong { display: block; font-size: 1.8rem; letter-spacing: -.02em; }
.score-ring span { font-size: .8rem; color: var(--muted); }

/* ---------- Alerts & toasts ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid transparent; font-size: .93rem; display: flex; gap: 10px; align-items: flex-start; }
.alert-info { background: var(--info-soft); color: var(--info); }
.alert-warning { background: var(--warning-soft); color: var(--warning); }
.alert-danger, .alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-success { background: var(--success-soft); color: var(--success); }

.toasts { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px 12px 16px; border-radius: var(--radius);
  background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg);
  font-size: .92rem; animation: toast-in .25s ease-out;
}
.toast .toast-close { margin-left: auto; background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; font-size: 18px; line-height: 1; padding: 0 0 0 8px; }
.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-info { border-left: 4px solid var(--info); }
.toast.leaving { opacity: 0; transform: translateY(8px); transition: all .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Dropdown ---------- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; min-width: 220px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 6px; display: none;
}
.dropdown.open .dropdown-menu { display: block; animation: toast-in .15s ease-out; }
.dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border-radius: var(--radius-sm); border: 0; background: none;
  color: var(--text); font: inherit; font-size: .92rem; text-align: left; cursor: pointer; text-decoration: none !important;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); }
.dropdown-menu svg { width: 17px; height: 17px; color: var(--muted); }
.dropdown-head { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dropdown-head strong { display: block; }
.dropdown-head span { font-size: .82rem; color: var(--muted); }
.user-trigger { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 4px; border-radius: 999px; cursor: pointer; color: var(--text); font: inherit; }
.user-trigger:hover { background: var(--surface-2); }

/* ---------- Modal (<dialog>) ---------- */
dialog.modal {
  border: 0; padding: 0; border-radius: var(--radius-lg); background: var(--surface); color: var(--text);
  width: min(460px, calc(100vw - 32px)); box-shadow: var(--shadow-lg);
}
dialog.modal::backdrop { background: rgba(10, 18, 15, .45); backdrop-filter: blur(2px); }
dialog.modal[open] { animation: toast-in .2s ease-out; }
.modal-body { padding: 24px; }
.modal-actions { display: flex; gap: .75rem; justify-content: flex-end; padding: 16px 24px; background: var(--surface-2); border-top: 1px solid var(--border); }

/* ---------- Pagination & empty ---------- */
.pagination { display: flex; gap: 6px; align-items: center; justify-content: center; padding: 16px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 36px; height: 36px; padding: 0 10px; display: inline-grid; place-items: center; border-radius: var(--radius-sm); border: 1px solid var(--border); color: var(--text-2); font-size: .9rem; text-decoration: none !important; }
.pagination a:hover { background: var(--surface-2); }
.pagination .current { background: var(--primary); border-color: var(--primary); color: var(--primary-text); font-weight: 600; }
.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty svg { width: 44px; height: 44px; margin: 0 auto 12px; color: var(--border-strong); }
.empty h3 { color: var(--text); }

/* ---------- Brand (admin panel sidebar; the public header lives in header.css) ---------- */
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; letter-spacing: -.01em; text-decoration: none !important; white-space: nowrap; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--primary); color: var(--primary-text); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 20px; height: 20px; }
.brand small { display: block; font-size: .7rem; font-weight: 600; color: var(--accent); letter-spacing: .08em; text-transform: uppercase; line-height: 1; }
@media (max-width: 760px) {
  .hide-mobile { display: none !important; }
}

.page { padding: 32px 0 64px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 24px; }
.page-header h1 { margin: 0; }
.page-header p { margin: 4px 0 0; color: var(--text-2); }
.breadcrumbs { font-size: .85rem; color: var(--muted); margin-bottom: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--primary); }

/* ---------- Landing ---------- */
.hero { position: relative; overflow: hidden; padding: 88px 0 72px; border-bottom: 1px solid var(--border); background:
  radial-gradient(900px 400px at 85% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
  radial-gradient(700px 380px at 0% 110%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 70%); }
.hero-pattern { position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cpath d='M32 4l8 20 20 8-20 8-8 20-8-20-20-8 20-8z' fill='none' stroke='%23b5862a' stroke-opacity='.18'/%3E%3C/svg%3E");
  mask-image: linear-gradient(to left, #000 0%, transparent 60%); }
.hero .container { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .8rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.hero h1 { font-family: var(--font-display); font-size: clamp(2.2rem, 4.6vw, 3.4rem); font-weight: 600; letter-spacing: -.025em; margin: 18px 0 16px; }
.hero h1 em { font-style: normal; color: var(--primary); }
.hero .lead { font-size: 1.12rem; color: var(--text-2); max-width: 540px; margin-bottom: 28px; }
.hero-card { padding: 22px; transform: rotate(1.2deg); }
.hero-card .q { font-weight: 600; margin-bottom: 14px; }
.hero-card .opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-top: 8px; font-size: .92rem; }
.hero-card .opt.sel { border-color: var(--primary); background: var(--primary-soft); }
.hero-card .opt b { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; background: var(--surface-2); font-size: .8rem; }
.hero-card .opt.sel b { background: var(--primary); color: var(--primary-text); }
@media (max-width: 900px) { .hero .container { grid-template-columns: 1fr; } .hero-card { display: none; } .hero { padding: 56px 0; } }
.features { padding: 64px 0; }
.feature { padding: 24px; }
.feature-icon { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); margin-bottom: 14px; }
.feature-icon svg { width: 22px; height: 22px; }
.section-title { text-align: center; max-width: 620px; margin: 0 auto 36px; }
.section-title h2 { font-family: var(--font-display); font-size: 2rem; font-weight: 600; }

/* ---------- Exam cards ---------- */
.exam-card { display: flex; flex-direction: column; height: 100%; }
.exam-card .card-body { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.exam-card h3 { margin: 0; font-size: 1.05rem; }
.exam-card .desc { color: var(--text-2); font-size: .9rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: .85rem; }
.meta span { display: inline-flex; align-items: center; gap: 6px; }
.meta svg { width: 15px; height: 15px; }
.filters { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.filters input[type="search"], .filters input[type="text"] { max-width: 280px; }
.filters select, .filters input[type="date"] { width: auto; min-width: 150px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: .88rem; font-weight: 550; text-decoration: none !important; }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 0; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }

/* ---------- Exam player ---------- */
.player-body { background: var(--bg); min-height: 100vh; }
.player-top { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--border); }
.player-top .container { display: flex; align-items: center; gap: 1rem; height: 64px; max-width: 1240px; }
.player-title { min-width: 0; }
.player-title strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-title span { font-size: .8rem; color: var(--muted); }
.timer { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: var(--surface-2); font-weight: 700; font-variant-numeric: tabular-nums; font-size: 1.02rem; }
.timer svg { width: 18px; height: 18px; color: var(--muted); }
.timer.warn { background: var(--warning-soft); color: var(--warning); }
.timer.danger { background: var(--danger-soft); color: var(--danger); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .7; } }
.save-status { font-size: .82rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; min-width: 90px; }
.save-status.saving { color: var(--info); }
.save-status.error { color: var(--danger); }
.save-status.saved { color: var(--success); }
.save-status.preview { color: var(--info); white-space: nowrap; min-width: 0; }
.save-status.preview svg { width: 16px; height: 16px; flex: none; }
/* Admin preview strip, on the exam page, the player and the result page */
.preview-banner { position: relative; z-index: 41; background: color-mix(in srgb, var(--info) 13%, var(--surface)); border-bottom: 1px solid color-mix(in srgb, var(--info) 35%, transparent); color: var(--text); font-size: .86rem; line-height: 1.45; }
.preview-banner .container { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; padding-block: 9px; }
.preview-banner .container > svg { width: 18px; height: 18px; color: var(--info); }
.preview-banner strong, .preview-banner__note { color: var(--info); font-weight: 650; }
.preview-banner__short { display: none; }
@media (max-width: 760px) {
  .preview-banner .container { grid-template-columns: auto minmax(0, 1fr) auto; padding-block: 7px; }
  .preview-banner__long { display: none; }
  .preview-banner__short { display: inline; }
  .preview-banner .btn { padding-inline: 10px; }
}
.player-progress { height: 3px; background: var(--surface-3); }
.player-progress span { display: block; height: 100%; background: var(--primary); transition: width .3s; }
.player-main { max-width: 1240px; margin: 0 auto; padding: 28px 20px 96px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.question-card { padding: 32px; }
.question-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 18px; flex-wrap: wrap; }
.question-num { font-size: .82rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.question-text { font-size: 1.2rem; line-height: 1.55; font-weight: 550; margin-bottom: 26px; }
.options { display: grid; gap: 12px; }
.options.tf { grid-template-columns: 1fr 1fr; }
.option {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 16px 18px; text-align: left; cursor: pointer;
  font: inherit; font-size: 1rem; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
  transition: border-color .12s, background .12s, box-shadow .12s, transform .05s;
}
.option:hover { border-color: var(--border-strong); background: var(--surface-2); }
.option:active { transform: scale(.995); }
.option .key { width: 32px; height: 32px; flex: none; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: .9rem; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); transition: all .12s; }
.option.selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent); }
.option.selected .key { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.options.tf .option { justify-content: center; padding: 22px; font-weight: 600; font-size: 1.05rem; }
.player-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.palette-card { position: sticky; top: 88px; }
.palette { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.palette button {
  position: relative; aspect-ratio: 1; border-radius: 8px; cursor: pointer;
  font: inherit; font-size: .88rem; font-weight: 600; font-variant-numeric: tabular-nums;
  background: var(--surface); color: var(--text-2); border: 1.5px solid var(--border);
  transition: all .12s;
}
.palette button:hover { border-color: var(--border-strong); }
.palette button.answered { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.palette button.current { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.palette button.flagged::after { content: ""; position: absolute; top: -4px; right: -4px; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .8rem; color: var(--muted); margin-top: 14px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 6px; border: 1.5px solid var(--border); }
.legend .l-answered { background: var(--primary); border-color: var(--primary); }
.legend .l-flagged { background: var(--accent); border-color: var(--accent); border-radius: 50%; }
.kbd { display: inline-block; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--border-strong); border-bottom-width: 2px; font-family: var(--mono); font-size: .75rem; color: var(--text-2); background: var(--surface); }
.offline-banner { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; }
@media (max-width: 900px) {
  .player-main { grid-template-columns: 1fr; padding-top: 16px; }
  .palette-card { position: static; order: 2; }
  .question-card { padding: 22px; }
  .question-text { font-size: 1.08rem; }
  .palette { grid-template-columns: repeat(8, 1fr); }
}
@media (max-width: 520px) {
  .options.tf { grid-template-columns: 1fr; }
  .player-top .container { gap: .6rem; }
  .save-status { display: none; }
  .palette { grid-template-columns: repeat(6, 1fr); }
}

/* ---------- Exam text size: admins set --q-size / --opt-size (Panel → Exam text size) ---------- */
.exam-text { --q-size: 18px; --opt-size: 17px; }
.exam-text .question-text { font-size: var(--q-size); line-height: 1.6; }
.exam-text .option, .exam-text .options.tf .option { font-size: var(--opt-size); line-height: 1.5; }
.exam-text .option .key { width: calc(var(--opt-size) * 2); height: calc(var(--opt-size) * 2); font-size: calc(var(--opt-size) * .76); }
@media (max-width: 520px) {
  .exam-text .question-text { font-size: calc(var(--q-size) - 1px); }
  .exam-text .option, .exam-text .options.tf .option { font-size: calc(var(--opt-size) - 1px); }
}
.text-size-grid { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 24px; align-items: start; }
.text-size-field { display: grid; gap: 8px; }
.text-size-field label { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-weight: 600; }
.text-size-field output { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--primary); }
.text-size-field input[type="range"] { width: 100%; accent-color: var(--primary); cursor: pointer; }
.text-size-field .range-ends { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); }
.text-size-preview { padding: 26px; }
.text-size-preview .options { pointer-events: none; }
@media (max-width: 900px) { .text-size-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Review (results & admin detail) ---------- */
/* Answer review on the result page: a closed panel the candidate opens */
.review-panel > summary { list-style: none; }
.review-panel > summary::-webkit-details-marker { display: none; }
.review-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 14px 20px; flex-wrap: wrap; padding: 18px 22px; cursor: pointer; user-select: none; transition: border-color .15s, box-shadow .15s; }
.review-panel__head:hover { border-color: var(--border-strong); }
.review-panel__head:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.review-panel__title { display: grid; gap: 6px; min-width: 0; }
.review-panel__title h2 { margin: 0; }
.review-panel__counts { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); font-size: .85rem; }
.review-panel__counts span { display: inline-flex; align-items: center; gap: 6px; }
.review-panel__counts svg { width: 15px; height: 15px; }
.review-panel__counts .is-correct svg { color: var(--success); }
.review-panel__counts .is-wrong svg { color: var(--danger); }
.review-panel__toggle { pointer-events: none; gap: 8px; }
.review-panel__toggle svg { transition: transform .2s; }
.review-panel[open] .review-panel__toggle svg { transform: rotate(180deg); }
.review-panel__hide, .review-panel[open] .review-panel__show { display: none; }
.review-panel[open] .review-panel__hide { display: inline; }
.review-panel__body { margin-top: 16px; }
.review-panel[open] .review-panel__body { animation: review-open .2s ease-out; }
.review-panel__empty { text-align: center; padding: 24px 0; margin: 0; }
.review-panel__foot { display: flex; justify-content: center; margin-top: 16px; }
@keyframes review-open { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
  .review-panel__head { padding: 16px 18px; }
  .review-panel__toggle { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .review-panel[open] .review-panel__body { animation: none; }
  .review-panel__toggle svg { transition: none; }
}
@media print {
  .review-panel__toggle, .review-panel__foot, .review-panel [data-review-filter] { display: none; }
}

.review-item { padding: 20px 22px; border-left: 4px solid var(--border); }
.review-item.correct { border-left-color: var(--success); }
.review-item.wrong { border-left-color: var(--danger); }
.review-item.skipped { border-left-color: var(--border-strong); }
.review-q { font-weight: 600; margin: 8px 0 12px; }
.review-opts { display: grid; gap: 6px; }
.review-opt { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); font-size: .93rem; }
.review-opt .key { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; font-size: .78rem; font-weight: 700; background: var(--surface-2); flex: none; }
.review-opt.is-correct { border-color: color-mix(in srgb, var(--success) 50%, transparent); background: var(--success-soft); }
.review-opt.is-selected.is-wrong { border-color: color-mix(in srgb, var(--danger) 50%, transparent); background: var(--danger-soft); }
.review-opt .tag { margin-left: auto; font-size: .75rem; font-weight: 650; }
.explanation { margin-top: 12px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--info-soft); color: var(--text); font-size: .9rem; }
.explanation__label { display: block; margin-bottom: 4px; }

/* Formatted question text and explanations (apps/exams/rich_text.py): what the editor can produce */
.rich { overflow-wrap: anywhere; }
.rich > :first-child { margin-top: 0; }
.rich > :last-child { margin-bottom: 0; }
.rich p { margin: 0 0 .65em; }
.rich ul, .rich ol { margin: .4em 0 .65em; padding-inline-start: 1.5em; }
.rich li + li { margin-top: .2em; }
.rich blockquote { margin: .5em 0 .75em; padding: .1em 0 .1em 1em; border-inline-start: 3px solid var(--border-strong); color: var(--text-2); }
.rich a { text-decoration: underline; }
.rich sub, .rich sup { line-height: 0; }
.rich table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: .5em 0 .8em; font-size: .92em; font-weight: 400; }
.rich th, .rich td { border: 1px solid var(--border-strong); padding: 6px 10px; text-align: start; vertical-align: top; }
.rich th { background: var(--surface-2); font-weight: 650; }

/* The formatting editor on the question form */
.field .tox.tox-tinymce { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.field.has-error .tox.tox-tinymce { border-color: var(--danger); }
.field .tox.tox-tinymce.tox-edit-focus, .field .tox.tox-tinymce:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field textarea[data-rich-editor] { min-height: 160px; }
.review-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .8rem; color: var(--muted); margin-top: 10px; }

/* ---------- Panel layout ---------- */
.panel-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.sidebar .brand { padding: 0 20px; height: var(--topbar-h); border-bottom: 1px solid var(--border); }
.side-nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-nav .group { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 16px 10px 6px; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 550; font-size: .93rem; text-decoration: none !important; }
.side-nav .side-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--primary); color: var(--primary-text); font-size: .72rem; font-weight: 700; }

/* Panel → Messages (from the About page) */
.msg-from { display: flex; align-items: center; gap: 10px; min-width: 0; }
.msg-from .name { font-weight: 550; }
.msg-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); flex: none; }
.msg-from .msg-dot[hidden] { display: block; visibility: hidden; }
.msg-unread .name, .msg-unread .msg-cell strong { font-weight: 750; }
.msg-cell { min-width: 220px; }
.msg-body { white-space: normal; overflow-wrap: anywhere; line-height: 1.7; }
.msg-body p:last-child { margin-bottom: 0; }
.msg-kv dd { overflow-wrap: anywhere; }
.side-nav a svg { width: 18px; height: 18px; flex: none; }
.side-nav a:hover { background: var(--surface-2); color: var(--text); }
.side-nav a.active { background: var(--primary-soft); color: var(--primary); }
.side-nav a .count { margin-left: auto; }
.sidebar-foot { padding: 14px 16px; border-top: 1px solid var(--border); font-size: .85rem; }
/* Scrolled to the end, the last links clear the floating theme button in the bottom-left corner. */
.panel-body .sidebar { padding-bottom: 64px; }
.panel-top { position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: 1rem; padding: 0 28px; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.panel-content { padding: 28px; max-width: 1400px; width: 100%; }
.sidebar-toggle { display: none; }
.sidebar-backdrop { display: none; }
@media (max-width: 1000px) {
  .panel-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 70; left: 0; top: 0; width: var(--sidebar-w); transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .panel-shell.sidebar-open .sidebar { transform: none; }
  .panel-shell.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(0, 0, 0, .35); }
  .sidebar-toggle { display: inline-flex; }
  .panel-content { padding: 20px 16px; }
  .panel-top { padding: 0 16px; }
}

/* Bar chart (dashboard) */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .bar span { display: block; width: 100%; max-width: 30px; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 2px; transition: height .4s; opacity: .85; }
.bars .bar:hover span { opacity: 1; }
.bars .bar small { font-size: .68rem; color: var(--muted); white-space: nowrap; }
.bars .bar em { font-style: normal; font-size: .72rem; font-weight: 650; color: var(--text-2); }

/* Live monitor */
.live-head { display: flex; align-items: center; gap: 10px; }
.conn { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.conn.on { background: var(--success-soft); color: var(--success); }
.conn.off { background: var(--danger-soft); color: var(--danger); }
.monitor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.live-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; transition: border-color .3s, box-shadow .3s; }
.live-card.pulse { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.live-card .top { display: flex; align-items: center; gap: 10px; }
.live-card .exam { font-size: .86rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-card .nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.live-card .nums div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 4px; }
.live-card .nums b { display: block; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.live-card .nums small { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.live-card .foot { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: var(--muted); }
.live-card.enter { animation: toast-in .35s ease-out; }
.feed { list-style: none; margin: 0; padding: 0; max-height: 620px; overflow-y: auto; }
.feed li { display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); font-size: .88rem; }
.feed li.new { animation: flash 1.5s ease-out; }
.feed .ev-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--text-2); }
.feed .ev-icon svg { width: 16px; height: 16px; }
.feed time { font-size: .76rem; color: var(--muted); }
.ev-answered .ev-icon, .ev-started .ev-icon, .ev-resumed .ev-icon { background: var(--primary-soft); color: var(--primary); }
.ev-changed .ev-icon { background: var(--accent-soft); color: var(--accent); }
.ev-tab_hidden .ev-icon, .ev-cleared .ev-icon, .ev-expired .ev-icon { background: var(--warning-soft); color: var(--warning); }
.ev-submitted .ev-icon { background: var(--success-soft); color: var(--success); }

/* Admin attempt detail grid */
.q-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; }
.q-grid a { aspect-ratio: 1; display: grid; place-items: center; border-radius: 7px; font-size: .82rem; font-weight: 650; text-decoration: none !important; border: 1.5px solid var(--border); color: var(--text-2); background: var(--surface); position: relative; }
.q-grid a.correct { background: var(--success-soft); border-color: var(--success); color: var(--success); }
.q-grid a.wrong { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.q-grid a.answered { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.q-grid a.current { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; max-height: 720px; overflow-y: auto; }
.timeline li { position: relative; padding: 10px 18px 10px 44px; font-size: .88rem; border-bottom: 1px solid var(--border); }
.timeline li::before { content: ""; position: absolute; left: 20px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.timeline li.ev-answered::before, .timeline li.ev-started::before, .timeline li.ev-resumed::before { background: var(--primary); }
.timeline li.ev-changed::before { background: var(--accent); }
.timeline li.ev-cleared::before, .timeline li.ev-tab_hidden::before, .timeline li.ev-expired::before { background: var(--warning); }
.timeline li.ev-submitted::before { background: var(--success); }
.timeline li.ev-viewed { color: var(--muted); }
.timeline li.ev-viewed::before { width: 6px; height: 6px; left: 22px; top: 17px; }
.timeline.hide-views li.ev-viewed { display: none; }
.timeline time { display: block; font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline li.new { animation: flash 1.5s ease-out; }
.review-item.live-updated { animation: flash 1.5s ease-out; }

/* Question list (panel exam detail) */
.q-list { list-style: none; margin: 0; padding: 0; }
.q-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--border); align-items: start; }
.q-row:last-child { border-bottom: 0; }
.q-row:target { background: var(--accent-soft); }
.q-row .n { width: 32px; height: 32px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: var(--text-2); }
.q-row .text { font-weight: 550; }
.q-row .opts { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 3px; font-size: .88rem; color: var(--text-2); }
.q-row .opts li.ok { color: var(--success); font-weight: 600; }
.q-row .actions { display: flex; gap: 2px; align-items: center; }
.inline-form { display: inline; margin: 0; }
@media (max-width: 640px) { .q-row { grid-template-columns: 32px minmax(0, 1fr); } .q-row .actions { grid-column: 2; } }

/* Question form */
.choice-row { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: var(--radius); transition: border-color .12s, background .12s; }
.choice-row:has(input[type="radio"]:checked) { border-color: var(--success); background: var(--success-soft); }
.choice-row .correct-pick { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; cursor: pointer; width: 54px; }
.choice-row .letter { font-size: .95rem; color: var(--text); }
.choice-row input[type="text"] { border-color: transparent; background: transparent; }
.choice-row input[type="text"]:focus { background: var(--surface); border-color: var(--primary); }
.tf-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 420px; }
.tf-pick label { margin: 0; cursor: pointer; }
.tf-pick input { position: absolute; opacity: 0; }
.tf-pick span { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px; border: 1.5px solid var(--border); border-radius: var(--radius); font-weight: 650; }
.tf-pick input:checked + span { border-color: var(--success); background: var(--success-soft); color: var(--success); }
.tf-pick input:focus-visible + span { outline: 2px solid var(--primary); }
.points-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.points-pick label { margin: 0; cursor: pointer; }
.points-pick input { position: absolute; opacity: 0; }
.points-pick span { width: 38px; height: 38px; display: grid; place-items: center; border: 1.5px solid var(--border); border-radius: 8px; font-weight: 650; font-variant-numeric: tabular-nums; }
.points-pick input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.points-pick input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Auth pages */
.auth-wrap { min-height: calc(100vh - var(--topbar-h)); display: grid; place-items: center; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card .card-body { padding: 32px; }
.auth-card h1 { font-family: var(--font-display); font-weight: 600; font-size: 1.75rem; }
.form-grid > .form-hint { margin-top: -10px; }
.form-grid > .form-hint .help { margin-top: 0; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 16px; color: var(--muted); font-size: .85rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
/* "Continue with Google" in Google's own button colours (developers.google.com/identity/branding-guidelines):
   light #fff / #747775 / #1f1f1f, dark #131314 / #8e918f / #e3e3e3, the standard four-colour G. The extra
   selectors outweigh the themes' generic .btn rules. */
html body .btn.btn-google { gap: 10px; background: #fff; color: #1f1f1f; border: 1px solid #747775; box-shadow: none;
  font-family: Roboto, "Google Sans", Arial, sans-serif; font-weight: 500; letter-spacing: .1px; transform: none; }
html body .btn.btn-google:hover { background: #f2f2f2; }
html body .btn.btn-google:focus-visible { outline: 2px solid #1a73e8; outline-offset: 2px; }
html[data-theme="dark"] body .btn.btn-google { background: #131314; color: #e3e3e3; border-color: #8e918f; }
html[data-theme="dark"] body .btn.btn-google:hover { background: #1f1f20; }
.btn-google svg { width: 18px; height: 18px; flex: none; }

/* Short laptop screens: keep the whole sign-up / log-in card in view without scrolling. */
@media (min-width: 761px) and (max-height: 860px) {
  .auth-wrap.auth-wrap { min-height: 0; padding-block: 16px; }
  body .auth-card .card-body { padding: 24px 30px; }
  body .auth-card .text-2 { margin-bottom: 16px; }
  body .auth-card .form-grid { gap: 14px 18px; }
  body .auth-card .field input:not([type=checkbox]):not([type=radio]) { min-height: 42px; }
  .auth-divider { margin: 14px 0 12px; }
}

/* Sign-in methods on the profile */
.signin-methods { display: grid; gap: 0; }
.signin-method { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; padding: 14px 0; }
.signin-method + .signin-method { border-top: 1px solid var(--border); }
.signin-method:first-child { padding-top: 0; }
.signin-method:last-child { padding-bottom: 0; }
.signin-method__name { display: flex; align-items: center; gap: 12px; }
.signin-method__name svg { width: 20px; height: 20px; flex: none; }
.signin-method__name small { display: block; color: var(--muted); }

/* Profile */
.profile-hero { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.avatar-upload { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---- Exam start: time limit picker (topic/full) and fixed limit note (mock) ---- */
.time-choice { border: 0; margin: 0; padding: 0; min-width: 0; }
.time-choice legend { padding: 0; margin-bottom: .25rem; }
.time-choice > p { margin: 0 0 .75rem; }
.time-choice__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.time-choice__option { position: relative; display: block; cursor: pointer; }
.time-choice__option input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.time-choice__card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem;
  min-height: 84px; padding: .75rem .5rem; text-align: center;
  border: 1.5px solid var(--border-strong); border-radius: var(--radius); background: var(--surface);
  color: var(--text); transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.time-choice__card strong { font-size: .95rem; font-weight: 600; line-height: 1.2; }
.time-choice__icon { width: 22px; height: 22px; color: var(--muted); font-size: 1.6rem; line-height: 22px; font-weight: 500; }
.time-choice__option:hover .time-choice__card { border-color: var(--primary); }
.time-choice__option input:checked + .time-choice__card {
  border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary);
}
.time-choice__option input:checked + .time-choice__card .time-choice__icon { color: var(--primary); }
.time-choice__option input:focus-visible + .time-choice__card { outline: 2px solid var(--primary); outline-offset: 2px; }
.time-fixed {
  display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
}
.time-fixed > svg { width: 22px; height: 22px; flex: none; color: var(--primary); }
.time-fixed span { display: flex; flex-direction: column; }
.time-fixed small { color: var(--text-2); }

/* ---- Panel: group member picker ---- */
.pick-search { position: relative; }
.pick-search__icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; pointer-events: none; }
.pick-search__icon svg { width: 16px; height: 16px; }
.pick-search input[type="search"] { width: 100%; padding-left: 36px; }
.pick-heading { margin: 1rem 0 .4rem; font-size: .75rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pick-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.pick-list > li, [data-group-picker], .group-side { min-width: 0; }
.pick-row {
  display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 10px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; transition: background-color .12s, border-color .12s;
}
.pick-row:hover { background: var(--surface-2); }
.pick-row:has(input:checked) { background: var(--primary-soft); border-color: var(--primary); }
.pick-row input {
  appearance: none; -webkit-appearance: none; display: grid; place-content: center; flex: none;
  width: 18px; height: 18px; margin: 0; border: 1.5px solid var(--border-strong); border-radius: 5px;
  background: var(--surface); cursor: pointer; transition: background-color .12s, border-color .12s;
}
.pick-row input::before {
  content: ""; width: 10px; height: 6px; margin-top: -2px; border: solid var(--primary-text); border-width: 0 0 2px 2px;
  transform: rotate(-45deg) scale(0); transition: transform .12s;
}
.pick-row input:checked { background: var(--primary); border-color: var(--primary); }
.pick-row input:checked::before { transform: rotate(-45deg) scale(1); }
.pick-row input:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.pick-row input:disabled { background: var(--surface-3); cursor: default; }
.pick-row.is-member { cursor: default; opacity: .65; }
.pick-row.is-member:hover { background: transparent; }
.pick-row__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pick-row__name { font-weight: 600; color: var(--text); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-row__sub { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-note { margin: .5rem 0 0; }
/* Lists scroll inside their own boxes, so the button can stay in the flow (a sticky one covered rows on phones). */
.pick-actions { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--border); }
.pick-count:empty { display: none; }
.group-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.group-chips .chip { padding: 4px 10px; font-size: .82rem; }
.pick-heading__count { margin-left: 4px; padding: 0 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); letter-spacing: 0; font-size: .72rem; }
/* Long pick lists scroll inside the card instead of stretching it (about five rows visible). */
.pick-scroll { max-height: 296px; overflow-y: auto; overscroll-behavior: contain; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; }
.pick-scroll:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--radius-sm); }

/* ---- Private tests ---- */
.sent-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.sent-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.sent-list__text { display: flex; flex-direction: column; min-width: 0; }
.sent-list__text a { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sent-list__text small { color: var(--muted); font-size: .78rem; }
/* A test sent to this candidate: blue card. :root raises specificity above the theme card rules in both modes. */
:root .card.card-link.exam-card--private {
  background: linear-gradient(180deg, color-mix(in srgb, var(--info) 14%, var(--info-soft)), var(--info-soft));
  border-color: color-mix(in srgb, var(--info) 45%, transparent);
  box-shadow: inset 4px 0 0 var(--info);
}
:root .card.card-link.exam-card--private:hover { border-color: var(--info); }
:root .exam-card--private .meta { border-top-color: color-mix(in srgb, var(--info) 25%, transparent); }
:root .card.card-link.exam-card--private .exam-card-icon { background: var(--surface); color: var(--info); border-color: color-mix(in srgb, var(--info) 35%, transparent); }
.badge-private { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); color: var(--info); border: 1px solid color-mix(in srgb, var(--info) 50%, transparent); }
.badge-private svg { width: 12px; height: 12px; }

/* ---- Bulk selection (Users list, group members) ---- */
.select-cell { width: 44px; padding-right: 0 !important; }
.select-box { display: inline-grid; place-content: center; width: 28px; height: 28px; margin: -6px; cursor: pointer; border-radius: 6px; }
.select-box:hover { background: var(--surface-2); }
.select-box input, .pick-row input { appearance: none; -webkit-appearance: none; display: grid; place-content: center; flex: none; width: 18px; height: 18px; margin: 0; border: 1.5px solid var(--border-strong); border-radius: 5px; background: var(--surface); cursor: pointer; transition: background-color .12s, border-color .12s; }
.select-box input::before { content: ""; width: 10px; height: 6px; margin-top: -2px; border: solid var(--primary-text); border-width: 0 0 2px 2px; transform: rotate(-45deg) scale(0); transition: transform .12s; }
.select-box input:checked, .select-box input:indeterminate { background: var(--primary); border-color: var(--primary); }
.select-box input:checked::before { transform: rotate(-45deg) scale(1); }
.select-box input:indeterminate::before { width: 9px; height: 0; margin: 0; border-width: 0 0 2px 0; transform: none; }
.select-box input:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.table tr.is-selected td { background: var(--primary-soft); }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.bulk-bar__count { font-size: .85rem; color: var(--text-2); min-width: 84px; }
.bulk-bar__count strong { color: var(--text); }
.bulk-bar__group { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bulk-bar__group select, .bulk-bar__group input { height: 34px; min-width: 160px; }
.bulk-bar__or { font-size: .8rem; color: var(--muted); }
[data-bulk]:not(.has-selection) .bulk-bar { opacity: .75; }
[data-bulk].has-selection .bulk-bar { background: var(--primary-soft); }
.members-search { width: min(260px, 100%); }
.members-search input[type="search"] { height: 36px; }
.pick-heading-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pick-heading-row .pick-heading { margin-bottom: .4rem; }
.link-btn { border: 0; background: none; padding: 2px 4px; font: inherit; font-size: .8rem; font-weight: 600; color: var(--primary); cursor: pointer; border-radius: 4px; }
.link-btn:hover { text-decoration: underline; }
.link-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.paste-box { border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 10px 12px; }
.paste-box summary { cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 600; color: var(--text-2); list-style: none; }
.paste-box summary::-webkit-details-marker { display: none; }
.paste-box summary svg { width: 16px; height: 16px; }
.paste-box[open] summary { margin-bottom: 10px; color: var(--text); }
.paste-box textarea { width: 100%; resize: vertical; font-family: var(--mono); font-size: .82rem; }
.avatar-stack { display: flex; align-items: center; }
.avatar-stack .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-stack__count { margin-left: 8px; font-weight: 600; color: var(--text-2); font-size: .85rem; }
.group-main { min-width: 0; }
/* Emails and names in people tables: one line, cut with an ellipsis instead of breaking mid-word
   (cards use overflow-wrap:anywhere for long text elsewhere). */
.cell-user > div { min-width: 0; }
.cell-user .name, .cell-user .sub { overflow-wrap: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.group-chips .chip, .bulk-bar .btn, .bulk-bar__count { white-space: nowrap; }
.bulk-bar__group { flex-wrap: nowrap; }
@media (min-width: 761px) {
  .row-between > .filters { flex-wrap: nowrap; }
  .row-between > .filters input[type="search"] { min-width: 240px; }
}
@media (max-width: 760px) {
  .bulk-bar__group { flex-wrap: wrap; }
  .bulk-bar__group select, .bulk-bar__group input { min-width: 0; flex: 1 1 160px; }
}
.card-header:has(.members-search) { flex-wrap: wrap; }
.card-header:has(.members-search) h2 { white-space: nowrap; }
.card-header .members-search { flex: 1 1 200px; max-width: 280px; margin-left: auto; }
@media (max-width: 760px) { .card-header .members-search { max-width: none; } }

/* ---------- Panel: standards library ---------- */
.std-panel-head { flex-wrap: wrap; gap: 10px 16px; }
.std-panel-head .chips { flex: 1 1 auto; min-width: 0; }
.std-panel-head .chip.active { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.std-panel-head .chip.active .muted { color: inherit; opacity: .8; }
.std-cell { min-width: 220px; max-width: 420px; }
.std-file { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.badge-button { all: unset; cursor: pointer; display: inline-flex; border-radius: 999px; }
.badge-button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.badge-button:hover .badge { filter: brightness(.95); box-shadow: 0 0 0 1px var(--border-strong); }
.std-sections-admin { list-style: none; margin: 0; padding: 6px 0; }
.std-sections-admin li { display: flex; align-items: center; gap: 10px; padding: 8px 16px; }
.std-sections-admin li + li { border-top: 1px solid var(--border); }
.std-sections-admin__text { display: grid; flex: 1; min-width: 0; }
.std-sections-admin__text small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.std-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; margin: 0; font-size: .88rem; }
.std-facts dt { color: var(--muted); }
.std-facts dd { margin: 0; min-width: 0; }
.field .dropzone { position: relative; display: grid; justify-items: center; gap: 6px; padding: 30px 20px; margin: 0; text-align: center; border: 2px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); cursor: pointer; font-weight: 400; transition: border-color .15s, background .15s; }
.field .dropzone:hover, .dropzone.is-over, .dropzone:focus-within { border-color: var(--primary); background: var(--primary-soft); }
.dropzone input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone__icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.dropzone__icon svg { width: 22px; height: 22px; }
.upload-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; max-height: 320px; overflow: auto; }
.upload-item { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.upload-item__type { flex: none; min-width: 44px; padding: 3px 6px; border-radius: 6px; font-size: .7rem; font-weight: 700; text-align: center; background: var(--surface-2); color: var(--text-2); }
.upload-item--pdf .upload-item__type { background: var(--danger-soft); color: var(--danger); }
.upload-item--docx .upload-item__type { background: var(--info-soft); color: var(--info); }
.upload-item__text { display: grid; flex: 1; min-width: 0; }
.upload-item__text strong { font-size: .88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item__text small { color: var(--muted); font-size: .78rem; }
.upload-item.has-problem { border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); }
.upload-item.has-problem small { color: var(--danger); }
.upload-progress { display: grid; gap: 6px; }
.upload-progress__bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.upload-progress__bar span { display: block; width: 0; height: 100%; background: var(--primary); border-radius: inherit; transition: width .2s; }
.upload-kind { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; align-items: start; }
.upload-kind .badge { justify-content: center; }
.upload-tips { margin: 0; padding-left: 1.1rem; display: grid; gap: 6px; }
/* Standards text editor */
.std-editor__view { justify-content: flex-start; flex-wrap: wrap; gap: 10px 16px; }
.segmented-choice { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); }
.segmented-choice label { display: inline-flex; margin: 0; cursor: pointer; }
.segmented-choice input { position: absolute; opacity: 0; pointer-events: none; }
.segmented-choice span { padding: 6px 14px; border-radius: 999px; font-size: .86rem; font-weight: 550; color: var(--text-2); }
.segmented-choice input:checked + span { background: var(--primary); color: var(--primary-text); }
.segmented-choice input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.std-editor__area { position: relative; min-height: 520px; }
.std-editor__area textarea { width: 100%; min-height: 520px; border: 0; border-radius: 0; font-family: var(--mono); font-size: .85rem; }
.std-editor.is-ready .std-editor__area textarea { visibility: hidden; }
.std-editor__area .tox-tinymce { border: 0; border-radius: 0; }
.std-editor__loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--surface); color: var(--muted); }
.std-editor__loading .spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--primary); animation: std-spin .8s linear infinite; }
@keyframes std-spin { to { transform: rotate(360deg); } }
.std-editor__footer { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-radius: 0 0 var(--radius) var(--radius); }
.std-editor__footer > p { flex: 1 1 320px; }
@media (max-width: 700px) { .std-editor__footer > p { display: none; } .std-editor__footer { justify-content: flex-end; } }
.std-restore { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.tox.tox-tinymce-aux, .tox-fullscreen .tox.tox-tinymce-aux { z-index: 1300; }

/* Exam form: the mock duration only matters while the type is Mock test. */
form:has(select[name="kind"]) [data-mock-only] { display: none; }
form:has(select[name="kind"] option[value="mock"]:checked) [data-mock-only] { display: block; }
