/* =========================================================
   Cert Trainer — "glass bubble" theme
   Translucent frosted surfaces over a soft animated gradient.
   ========================================================= */

:root {
  --text: #1d1b33;
  --muted: #5f5d7a;
  --primary: #6d4aff;
  --primary-2: #9b6bff;
  --primary-ink: #5134e0;
  --accent: #38bdf8;
  --pink: #f472b6;
  --amber: #f59e0b;
  --green: #0f9f6e;
  --red: #e5484d;

  --glass: rgba(255, 255, 255, 0.52);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --glass-soft: rgba(255, 255, 255, 0.34);
  --glass-border: rgba(255, 255, 255, 0.75);
  --glass-line: rgba(109, 74, 255, 0.12);
  --blur: blur(22px) saturate(170%);

  --primary-soft: rgba(109, 74, 255, 0.12);
  --green-soft: rgba(16, 185, 129, 0.14);
  --red-soft: rgba(229, 72, 77, 0.12);
  --amber-soft: rgba(245, 158, 11, 0.16);

  --radius: 24px;
  --radius-sm: 16px;
  --shadow: 0 10px 40px rgba(76, 56, 180, 0.12), 0 2px 8px rgba(76, 56, 180, 0.06);
  --shadow-lift: 0 18px 50px rgba(76, 56, 180, 0.2), 0 4px 12px rgba(76, 56, 180, 0.08);
  --inner: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -1px 0 rgba(255, 255, 255, 0.25);
  --font: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  background: linear-gradient(135deg, #eef0ff 0%, #f6efff 35%, #eaf7ff 70%, #fdf0f8 100%);
  background-attachment: fixed;
}
a { color: var(--primary-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.3; letter-spacing: -0.01em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
button { font: inherit; }
::selection { background: rgba(109, 74, 255, 0.22); }
[hidden] { display: none !important; }
kbd {
  font-family: ui-monospace, Menlo, monospace; font-size: 0.75rem;
  background: var(--glass-strong); border: 1px solid var(--glass-border);
  border-radius: 6px; padding: 1px 6px; box-shadow: var(--inner);
}

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.tiny { font-size: 0.72rem; }
.center { text-align: center; }
.right { text-align: right; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 0.85rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- animated bubble background ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.55; animation: float 26s ease-in-out infinite; }
.b1 { width: 520px; height: 520px; background: radial-gradient(circle at 30% 30%, #b9a6ff, #8b6dff 60%, transparent 70%); top: -140px; left: -120px; }
.b2 { width: 460px; height: 460px; background: radial-gradient(circle at 30% 30%, #9be7ff, #38bdf8 60%, transparent 70%); top: 10%; right: -140px; animation-delay: -6s; animation-duration: 30s; }
.b3 { width: 420px; height: 420px; background: radial-gradient(circle at 30% 30%, #ffc2e2, #f472b6 60%, transparent 70%); bottom: -160px; left: 18%; animation-delay: -12s; }
.b4 { width: 300px; height: 300px; background: radial-gradient(circle at 30% 30%, #c7f9e5, #34d399 60%, transparent 70%); bottom: 8%; right: 12%; opacity: 0.35; animation-delay: -18s; animation-duration: 34s; }
.b5 { width: 240px; height: 240px; background: radial-gradient(circle at 30% 30%, #ffe8b3, #fbbf24 60%, transparent 70%); top: 45%; left: 40%; opacity: 0.25; animation-delay: -9s; animation-duration: 38s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(60px, -40px) scale(1.08); }
  66% { transform: translate(-40px, 50px) scale(0.95); }
}

/* ---------- glass primitives ---------- */
.card, .topbar, .subbar, .opt, .btn-light, .select, .input,
input[type='number'], input[type='search'], .tab, .nav-light, .kpi, .toast, .drop, .file-block {
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 12px; z-index: 20;
  margin: 12px auto 0; max-width: 1280px; width: calc(100% - 24px);
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: 999px; box-shadow: var(--shadow), var(--inner);
}
.topbar-inner { padding: 8px 14px 8px 10px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 30% 25%, #c8b6ff, var(--primary) 55%, #4b2fd6);
  color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 20px;
  text-decoration: none !important;
  box-shadow: 0 6px 18px rgba(109, 74, 255, 0.45), inset 0 2px 4px rgba(255, 255, 255, 0.6);
}
.logo.big { width: 76px; height: 76px; font-size: 34px; margin: 0 auto 14px; }
.cert-pick { display: flex; flex-direction: column; min-width: 0; padding-left: 2px; }
.cert-select { min-width: 260px; max-width: 380px; font-weight: 600; }
.chip-version { background: var(--primary-soft); color: var(--primary-ink); font-weight: 700; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.nav-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 15px; border-radius: 999px;
  font-weight: 600; font-size: 0.88rem; text-decoration: none !important; white-space: nowrap;
  border: 1px solid var(--glass-border); color: var(--text); background: var(--glass-soft);
  box-shadow: var(--inner); transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
}
.nav-btn:hover { transform: translateY(-1px); background: var(--glass-strong); box-shadow: var(--shadow), var(--inner); }
.nav-amber { color: #b45309; }
.nav-green { color: var(--green); }
.nav-purple { color: var(--primary-ink); }
.nav-btn.active {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  box-shadow: 0 8px 22px rgba(109, 74, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.nav-amber.active { background: linear-gradient(135deg, #fbbf24, #f59e0b); box-shadow: 0 8px 22px rgba(245, 158, 11, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.45); }
.nav-green.active { background: linear-gradient(135deg, #34d399, #0f9f6e); box-shadow: 0 8px 22px rgba(16, 185, 129, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.45); }
.user { display: flex; align-items: center; gap: 8px; }
.user img { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--glass-border); box-shadow: var(--shadow); }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; font-size: 0.85rem; }

.subbar {
  margin: 14px auto 0; max-width: 1240px; width: calc(100% - 40px);
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--glass-soft); border: 1px solid var(--glass-border);
  border-radius: 999px; box-shadow: var(--inner);
}
.subbar-left, .subbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.counter { font-size: 0.95rem; white-space: nowrap; padding-left: 6px; }
.counter strong { color: var(--primary-ink); font-size: 1.15rem; }
.progress { width: 220px; max-width: 40vw; height: 10px; background: rgba(109, 74, 255, 0.1); border-radius: 99px; overflow: hidden; box-shadow: inset 0 1px 3px rgba(76, 56, 180, 0.15); }
.progress > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--primary-2), var(--primary)); transition: width 0.3s; }
.timer {
  font-family: ui-monospace, Menlo, monospace; font-weight: 700; font-size: 1.05rem;
  padding: 6px 14px; background: var(--glass-strong); border: 1px solid var(--glass-border);
  border-radius: 999px; box-shadow: var(--inner);
}
.timer.urgent { color: var(--red); background: var(--red-soft); border-color: rgba(229, 72, 77, 0.4); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(229, 72, 77, 0.12); } }

/* ---------- layout ---------- */
#main { min-height: calc(100vh - 80px); }
.page { max-width: 1240px; margin: 0 auto; padding: 24px 20px 56px; }
.page.narrow { max-width: 960px; }
.page.with-side { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; }
.center-screen { min-height: 75vh; display: grid; place-items: center; align-content: center; gap: 12px; padding: 20px; text-align: center; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 4px 16px; }
.section-head h2, .section-head h3 { margin: 0; }
.empty { text-align: center; padding: 64px 20px; }
.back { display: inline-block; margin: 0 0 12px 4px; font-weight: 600; }

/* ---------- cards (bubbles) ---------- */
.card {
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius);
  box-shadow: var(--shadow), var(--inner); margin-bottom: 18px; overflow: hidden; position: relative;
}
.card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 50%; pointer-events: none; border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0));
}
.card > * { position: relative; }
.card.pad, .pad { padding: 22px 26px; }
.card.success { background: linear-gradient(135deg, rgba(209, 250, 229, 0.7), rgba(255, 255, 255, 0.55)); border-color: rgba(16, 185, 129, 0.35); }
.login { padding: 40px 42px; width: min(440px, 92vw); text-align: center; background: var(--glass-strong); border-radius: 32px; }
.login h1 { font-size: 1.7rem; margin-bottom: 4px; }
.error-text { color: var(--red); font-size: 0.9rem; }

.qcard { border-radius: 28px; }
.qcard-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 26px; border-bottom: 1px solid var(--glass-line); }
.chips { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chip { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; border: 1px solid rgba(255, 255, 255, 0.6); }
.chip-solid { background: linear-gradient(135deg, var(--primary-2), var(--primary)); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(109, 74, 255, 0.3); }
.chip-soft { background: var(--primary-soft); color: var(--primary-ink); }
.chip-warn { background: var(--amber-soft); color: #b45309; }
.chip-ok { background: var(--green-soft); color: var(--green); }
.chip-bad { background: var(--red-soft); color: var(--red); }
.chip-muted { background: rgba(95, 93, 122, 0.1); color: var(--muted); }
.qcard-body { padding: 26px 30px 6px; }
.qtext { font-size: 1.14rem; font-weight: 600; white-space: pre-wrap; margin: 0 0 8px; }
.options { padding: 14px 30px 26px; display: grid; gap: 12px; }
.opt {
  display: flex; align-items: flex-start; gap: 14px; width: 100%; text-align: left; padding: 15px 18px;
  border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
  background: var(--glass-soft); color: var(--text); cursor: pointer; box-shadow: var(--inner);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
}
.opt:hover:not([disabled]) { transform: translateY(-2px); background: var(--glass-strong); box-shadow: var(--shadow-lift), var(--inner); }
.opt:active:not([disabled]) { transform: translateY(0) scale(0.995); }
.opt[disabled] { cursor: default; }
.opt-key {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 0.85rem; color: var(--primary-ink);
  background: radial-gradient(circle at 30% 25%, #ffffff, #e9e4ff); border: 1px solid rgba(109, 74, 255, 0.2);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.9), 0 2px 6px rgba(109, 74, 255, 0.15);
}
.opt-text { flex: 1; white-space: pre-wrap; padding-top: 2px; }
.opt-mark { flex: none; font-weight: 800; font-size: 1.05rem; padding-top: 2px; }
.opt.selected { background: linear-gradient(135deg, rgba(155, 107, 255, 0.2), rgba(255, 255, 255, 0.6)); border-color: rgba(109, 74, 255, 0.55); box-shadow: 0 8px 24px rgba(109, 74, 255, 0.18), var(--inner); }
.opt.selected .opt-key { background: radial-gradient(circle at 30% 25%, #c8b6ff, var(--primary)); color: #fff; border-color: transparent; }
.opt.correct { background: linear-gradient(135deg, rgba(52, 211, 153, 0.24), rgba(255, 255, 255, 0.6)); border-color: rgba(16, 185, 129, 0.6); }
.opt.correct .opt-key { background: radial-gradient(circle at 30% 25%, #a7f3d0, var(--green)); color: #fff; border-color: transparent; }
.opt.correct .opt-mark { color: var(--green); }
.opt.wrong { background: linear-gradient(135deg, rgba(229, 72, 77, 0.18), rgba(255, 255, 255, 0.6)); border-color: rgba(229, 72, 77, 0.55); }
.opt.wrong .opt-key { background: radial-gradient(circle at 30% 25%, #fecaca, var(--red)); color: #fff; border-color: transparent; }
.opt.wrong .opt-mark { color: var(--red); }
.explain {
  margin: 0 30px 26px; padding: 18px 20px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(155, 107, 255, 0.14), rgba(56, 189, 248, 0.1));
  border: 1px solid rgba(109, 74, 255, 0.2); box-shadow: var(--inner);
}
.explain-head { margin-bottom: 6px; }
.explain-body { white-space: pre-wrap; font-size: 0.95rem; }
.card-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: -4px 4px 8px; }
.footer-right { display: flex; gap: 10px; }
.hint { text-align: center; color: var(--muted); font-size: 0.8rem; margin-top: 18px; }

.icon-btn { background: var(--glass-soft); border: 1px solid var(--glass-border); cursor: pointer; color: #a3a0bf; padding: 6px; border-radius: 50%; display: grid; place-items: center; box-shadow: var(--inner); transition: transform 0.15s; }
.icon-btn:hover { transform: scale(1.08); background: var(--glass-strong); }
.icon-btn.star.on { color: var(--amber); background: var(--amber-soft); }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 20px;
  border-radius: 999px; border: 1px solid transparent; font-weight: 600; font-size: 0.9rem;
  cursor: pointer; white-space: nowrap; transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.sm { padding: 5px 12px; font-size: 0.8rem; }
.btn.icon { padding: 10px 13px; }
.btn-primary { background: linear-gradient(135deg, var(--primary-2), var(--primary)); color: #fff; box-shadow: 0 8px 22px rgba(109, 74, 255, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.45); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 12px 28px rgba(109, 74, 255, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.45); }
.btn-amber { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; box-shadow: 0 8px 22px rgba(245, 158, 11, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.45); }
.btn-light { background: var(--glass); border-color: var(--glass-border); color: var(--text); box-shadow: var(--inner); }
.btn-light:hover:not(:disabled) { background: var(--glass-strong); box-shadow: var(--shadow), var(--inner); }
.btn-light.active { color: var(--primary-ink); background: var(--primary-soft); border-color: rgba(109, 74, 255, 0.4); }
.btn-danger { background: var(--red-soft); color: var(--red); border-color: rgba(229, 72, 77, 0.3); }
.btn-google { width: 100%; padding: 13px; margin: 20px 0 10px; font-size: 0.95rem; background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: var(--shadow), var(--inner); }
.btn-google:hover { background: #fff; }
.select, .input, input[type='number'], input[type='search'] {
  font: inherit; padding: 9px 14px; border: 1px solid var(--glass-border); border-radius: 999px;
  background: var(--glass); color: var(--text); max-width: 100%; box-shadow: var(--inner); outline: none;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.select:focus, .input:focus, input:focus { border-color: rgba(109, 74, 255, 0.5); box-shadow: 0 0 0 4px rgba(109, 74, 255, 0.14), var(--inner); }
textarea.input { width: 100%; resize: vertical; border-radius: var(--radius-sm); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; margin-top: 16px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; font-weight: 600; }
.form-grid .span-2 { grid-column: span 2; }
fieldset { border: 1px solid var(--glass-line); border-radius: var(--radius-sm); padding: 10px 16px; display: flex; gap: 18px; flex-wrap: wrap; background: var(--glass-soft); }
legend { font-size: 0.85rem; font-weight: 600; padding: 0 6px; }
.radio, .check { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 6px; font-weight: 500 !important; cursor: pointer; }
input[type='radio'], input[type='checkbox'] { accent-color: var(--primary); width: 16px; height: 16px; }

.drop {
  display: block; border: 2px dashed rgba(109, 74, 255, 0.35); border-radius: var(--radius); padding: 32px;
  text-align: center; background: var(--glass-soft); cursor: pointer; margin: 14px 0;
  color: var(--primary-ink); font-weight: 600; transition: background 0.15s, border-color 0.15s;
}
.drop:hover { background: var(--glass-strong); border-color: rgba(109, 74, 255, 0.6); }
.drop input { display: none; }
.paste { margin-bottom: 14px; }
.paste summary { cursor: pointer; color: var(--muted); margin-bottom: 8px; }
.paste .btn { margin-top: 8px; }
.file-block { border: 1px solid var(--glass-border); border-radius: var(--radius-sm); padding: 14px 18px; margin: 12px 0; background: var(--glass-soft); box-shadow: var(--inner); }
.file-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.file-block details summary { cursor: pointer; color: var(--muted); margin-top: 8px; }
.issues { margin: 8px 0 0; padding-left: 18px; max-height: 220px; overflow: auto; font-size: 0.85rem; }
.issues .err { color: var(--red); }
.issues .warn { color: #b45309; }

/* ---------- tables, kpis ---------- */
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.9rem; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; padding: 12px 16px; border-bottom: 1px solid var(--glass-line); background: rgba(255, 255, 255, 0.3); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--glass-line); vertical-align: top; }
.table tr:last-child td { border-bottom: none; }
.table.compact td, .table.compact th { padding: 7px 12px; }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table .qcell { max-width: 560px; }
.table td.actions { white-space: nowrap; }
.table td.actions .btn { margin-left: 4px; }
.clickable { cursor: pointer; }
.clickable td { transition: background 0.15s; }
.clickable:hover td { background: rgba(255, 255, 255, 0.55); }
.pill { display: inline-block; padding: 2px 12px; border-radius: 99px; font-weight: 700; font-size: 0.82rem; border: 1px solid rgba(255, 255, 255, 0.6); }
.pill.good { background: var(--green-soft); color: var(--green); }
.pill.ok { background: var(--amber-soft); color: #b45309; }
.pill.bad { background: var(--red-soft); color: var(--red); }
.bar-cell { width: 40%; }
.bar { height: 10px; background: rgba(109, 74, 255, 0.1); border-radius: 99px; overflow: hidden; margin-top: 6px; box-shadow: inset 0 1px 3px rgba(76, 56, 180, 0.12); }
.bar-fill { height: 100%; border-radius: 99px; }
.bar-fill.good { background: linear-gradient(90deg, #6ee7b7, var(--green)); }
.bar-fill.ok { background: linear-gradient(90deg, #fde68a, var(--amber)); }
.bar-fill.bad { background: linear-gradient(90deg, #fca5a5, var(--red)); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 12px 0 18px; }
.kpi { padding: 16px 18px; margin: 0; display: flex; flex-direction: column; border-radius: 22px; }
.kpi span { color: var(--muted); font-size: 0.8rem; }
.kpi strong { font-size: 1.6rem; background: linear-gradient(135deg, var(--primary-ink), var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kpi.bad strong { background: none; color: var(--red); }
.trend { display: flex; align-items: flex-end; gap: 8px; height: 130px; padding-top: 8px; }
.trend-bar { flex: 1; border-radius: 12px 12px 4px 4px; min-width: 8px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5); }
.trend-bar.good { background: linear-gradient(180deg, #6ee7b7, var(--green)); }
.trend-bar.ok { background: linear-gradient(180deg, #fde68a, var(--amber)); }
.trend-bar.bad { background: linear-gradient(180deg, #fca5a5, var(--red)); }
.tabs { display: flex; gap: 8px; margin: 0 4px 14px; flex-wrap: wrap; }
.tab { border: 1px solid var(--glass-border); background: var(--glass); padding: 8px 16px; border-radius: 999px; cursor: pointer; font-weight: 600; box-shadow: var(--inner); transition: transform 0.15s; color: var(--text); }
.tab:hover { transform: translateY(-1px); }
.tab.active { background: linear-gradient(135deg, var(--primary-2), var(--primary)); color: #fff; border-color: transparent; box-shadow: 0 8px 22px rgba(109, 74, 255, 0.35); }

/* ---------- mock test ---------- */
.side { position: sticky; top: 160px; align-self: start; }
.nav-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; max-height: 60vh; overflow: auto; padding: 2px; }
.nav-cell {
  aspect-ratio: 1; border: 1px solid var(--glass-border); background: var(--glass-soft); border-radius: 50%;
  font-size: 0.76rem; cursor: pointer; position: relative; padding: 0; color: var(--text); box-shadow: var(--inner);
  transition: transform 0.12s;
}
.nav-cell:hover { transform: scale(1.08); }
.nav-cell.done { background: radial-gradient(circle at 30% 25%, #e3dbff, rgba(155, 107, 255, 0.45)); border-color: rgba(109, 74, 255, 0.35); color: var(--primary-ink); font-weight: 700; }
.nav-cell.flag::after { content: ''; position: absolute; top: 1px; right: 1px; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 2px #fff; }
.nav-cell.current { outline: 2px solid var(--primary); outline-offset: 2px; }
.nav-cell.sm { width: 14px; height: 14px; display: inline-block; vertical-align: middle; cursor: default; }
.legend { font-size: 0.78rem; color: var(--muted); margin: 12px 0 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.result-hero { display: flex; gap: 30px; align-items: center; padding: 26px 30px; }
.score-ring {
  width: 136px; height: 136px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-size: 1.75rem; font-weight: 800; border: 10px solid;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.35));
  box-shadow: var(--shadow-lift), inset 0 2px 8px rgba(255, 255, 255, 0.9);
}
.score-ring.good { border-color: rgba(16, 185, 129, 0.75); color: var(--green); }
.score-ring.ok { border-color: rgba(245, 158, 11, 0.75); color: #b45309; }
.score-ring.bad { border-color: rgba(229, 72, 77, 0.75); color: var(--red); }
.result-meta { flex: 1; min-width: 0; }
.stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 10px; }
.stats div { display: flex; flex-direction: column; }
.stats strong { font-size: 1.3rem; }
.stats span { color: var(--muted); font-size: 0.8rem; }
.review-item { margin-bottom: 8px; }
.review-flag { font-weight: 700; font-size: 0.85rem; margin: 18px 8px 6px; }
.review-item.is-correct .review-flag { color: var(--green); }
.review-item.is-wrong .review-flag { color: var(--red); }

/* ---------- misc ---------- */
.spinner { width: 40px; height: 40px; border: 4px solid rgba(109, 74, 255, 0.15); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); padding: 12px 22px; border-radius: 999px;
  background: rgba(29, 27, 51, 0.78); color: #fff; box-shadow: var(--shadow-lift); z-index: 50; max-width: 90vw; font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.2); animation: rise 0.25s ease-out;
}
.toast-error { background: rgba(229, 72, 77, 0.88); }
.toast-success { background: rgba(15, 159, 110, 0.88); }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 10px); } }

/* Browsers without backdrop-filter: make glass more opaque so text stays readable. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass: rgba(255, 255, 255, 0.88); --glass-strong: rgba(255, 255, 255, 0.95); --glass-soft: rgba(255, 255, 255, 0.78); }
}

@media (prefers-reduced-motion: reduce) {
  .blob, .timer.urgent, .toast { animation: none; }
  * { transition: none !important; }
}

@media (max-width: 900px) {
  .topbar { border-radius: var(--radius); }
  .subbar { border-radius: var(--radius); }
  .page.with-side { grid-template-columns: 1fr; }
  .side { position: static; }
  .nav-grid { grid-template-columns: repeat(10, 1fr); }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .nav { margin-left: 0; }
  .cert-select { min-width: 0; width: 100%; }
}
@media (max-width: 600px) {
  .topbar { width: calc(100% - 16px); top: 8px; margin-top: 8px; }
  .subbar { width: calc(100% - 16px); padding: 10px 12px; }
  .page { padding: 16px 10px 40px; }
  .topbar-inner { padding: 8px 10px; }
  .qcard-body { padding: 18px 18px 6px; }
  .options { padding: 10px 18px 20px; }
  .explain { margin: 0 18px 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .result-hero { flex-direction: column; text-align: center; }
  .stats { justify-content: center; }
  .table .qcell { max-width: 220px; }
  .nav-btn { padding: 6px 11px; font-size: 0.8rem; }
  .blob { filter: blur(50px); opacity: 0.4; }
}

/* =========================================================
   Solid white question card (inner box) over the glass page
   ========================================================= */
.qcard {
  background: #ffffff;
  border: 1px solid rgba(109, 74, 255, 0.12);
  box-shadow: 0 14px 44px rgba(76, 56, 180, 0.14), 0 2px 8px rgba(76, 56, 180, 0.06);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.qcard::before { display: none; }
.qcard .qcard-head { background: #fbfaff; border-bottom: 1px solid #efedf8; }
.qcard .opt {
  background: #ffffff;
  border: 1px solid #e7e4f3;
  box-shadow: 0 1px 2px rgba(76, 56, 180, 0.05);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.qcard .opt:hover:not([disabled]) { background: #faf8ff; border-color: rgba(109, 74, 255, 0.45); box-shadow: 0 8px 22px rgba(76, 56, 180, 0.12); }
.qcard .opt.selected { background: #f3efff; border-color: rgba(109, 74, 255, 0.6); }
.qcard .opt.correct { background: #ecfbf4; border-color: rgba(16, 185, 129, 0.65); }
.qcard .opt.wrong { background: #fdf0f0; border-color: rgba(229, 72, 77, 0.6); }
.qcard .explain { background: #f8f6ff; border: 1px solid #e6e0fb; box-shadow: none; }
.qcard .icon-btn { background: #f6f5fb; border-color: #ebe9f5; }

/* ---------- disputed answers ---------- */
.chip-dispute { background: #fff4e0; color: #b45309; border-color: #fde3b5; }
.dispute {
  margin-bottom: 10px; padding: 8px 12px; border-radius: 12px;
  background: #fff8eb; border: 1px solid #fde3b5; color: #92400e; font-size: 0.88rem;
}

/* ---------- mock test modes ---------- */
.mode-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 8px; }
.mode-card { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.mode-card h3 { margin: 4px 0 0; }
.mode-card p { margin: 0 0 4px; font-size: 0.9rem; }
.mode-card .btn { margin-top: auto; }
.mode-card.featured { background: linear-gradient(150deg, rgba(155, 107, 255, 0.22), rgba(255, 255, 255, 0.62) 55%); border-color: rgba(109, 74, 255, 0.35); }
.mode-icon {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 22px;
  background: radial-gradient(circle at 30% 25%, #ffffff, #ece6ff); box-shadow: var(--inner), 0 4px 12px rgba(109, 74, 255, 0.15);
}
.weak-list { list-style: none; padding: 0; margin: 4px 0; display: grid; gap: 6px; font-size: 0.85rem; }
.weak-list li { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.mini-fields { display: flex; gap: 10px; margin: 6px 0; }
.mini-fields label, .mini-select { display: flex; flex-direction: column; gap: 4px; font-size: 0.78rem; font-weight: 600; color: var(--muted); flex: 1; min-width: 0; }
.mini-fields input { width: 100%; }
.mini-select { margin-bottom: 6px; }

/* ---------- PASS / FAIL ---------- */
.pass-badge {
  display: inline-block; padding: 2px 12px; border-radius: 999px; font-weight: 800; font-size: 0.78rem;
  letter-spacing: 0.06em; color: #fff;
}
.pass-badge.pass { background: linear-gradient(135deg, #34d399, #0f9f6e); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35); }
.pass-badge.fail { background: linear-gradient(135deg, #fb7185, #e5484d); box-shadow: 0 4px 12px rgba(229, 72, 77, 0.3); }
.pass-badge.big { font-size: 1rem; padding: 4px 18px; }
.result-meta .row { margin-bottom: 8px; }

/* ---------- readiness ---------- */
.readiness { display: flex; gap: 24px; align-items: center; }
.ready-score { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 140px; padding: 14px; border-radius: 22px; background: rgba(255, 255, 255, 0.6); box-shadow: var(--inner); }
.ready-score strong { font-size: 2rem; line-height: 1.1; }
.ready-score span { font-size: 0.75rem; color: var(--muted); text-align: center; }
.ready-text h3 { margin: 0 0 2px; }
.ready-text p { margin: 2px 0; }
.readiness.good { border-color: rgba(16, 185, 129, 0.45); background: linear-gradient(135deg, rgba(209, 250, 229, 0.65), rgba(255, 255, 255, 0.5)); }
.readiness.good .ready-score strong { color: var(--green); }
.readiness.ok { border-color: rgba(245, 158, 11, 0.45); background: linear-gradient(135deg, rgba(254, 243, 199, 0.7), rgba(255, 255, 255, 0.5)); }
.readiness.ok .ready-score strong { color: #b45309; }
.readiness.bad { border-color: rgba(229, 72, 77, 0.35); background: linear-gradient(135deg, rgba(254, 226, 226, 0.65), rgba(255, 255, 255, 0.5)); }
.readiness.bad .ready-score strong { color: var(--red); }

.trend-wrap { position: relative; }
.pass-line { position: absolute; left: 0; right: 0; border-top: 2px dashed rgba(109, 74, 255, 0.55); z-index: 1; pointer-events: none; }
.pass-line span { position: absolute; right: 0; top: -20px; font-size: 0.72rem; font-weight: 700; color: var(--primary-ink); background: rgba(255, 255, 255, 0.85); padding: 0 6px; border-radius: 6px; }

/* ---------- admin exam settings ---------- */
.exam-edit { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.exam-edit input { width: 72px; padding: 5px 10px; }

.linkish { background: none; border: none; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 0.8rem; padding: 0; }
.linkish:hover { color: var(--red); }

@media (max-width: 1100px) { .mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .mode-grid { grid-template-columns: 1fr; }
  .readiness { flex-direction: column; text-align: center; }
}

/* =========================================================
   Header v2: user chip, collapse button, compact mode, RWD
   ========================================================= */
.user { gap: 8px; }
.avatar-btn { border: none; background: none; padding: 0; cursor: pointer; border-radius: 50%; line-height: 0; flex: none; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center;
  border: 2px solid var(--glass-border); box-shadow: var(--shadow);
}
.avatar-initial { background: radial-gradient(circle at 30% 25%, #c8b6ff, var(--primary)); color: #fff; font-weight: 700; font-size: 0.95rem; line-height: 1; }
.role { font-size: 0.78rem; font-weight: 700; color: var(--primary-ink); background: var(--primary-soft); padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.collapse-btn {
  flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  color: var(--primary-ink); background: var(--glass-soft); border: 1px solid var(--glass-border); box-shadow: var(--inner);
  transition: transform 0.2s, background 0.15s;
}
.collapse-btn:hover { background: var(--glass-strong); }
.collapse-btn svg { transition: transform 0.25s; }
.cert-pick { flex: 0 1 auto; }
.cert-select { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }

/* ---- compact (collapsed) state: only exam dropdown + avatar ---- */
body.compact .topbar { max-width: 760px; }
body.compact .topbar-inner { padding: 6px 8px 6px 10px; }
body.compact .logo,
body.compact .chip-version,
body.compact .cert-meta,
body.compact .nav,
body.compact .role,
body.compact .logout { display: none; }
body.compact .cert-pick { flex: 1 1 auto; min-width: 0; }
body.compact .cert-select { width: 100%; min-width: 0; max-width: none; }
body.compact .user { margin-left: auto; }
body.compact .collapse-btn svg { transform: rotate(180deg); }
body.compact .subbar { max-width: 760px; }
body.compact .subbar-stats,
body.compact .subbar-tools { display: none; }
body.compact .subbar-left { flex: 1 1 auto; }
body.compact .progress { flex: 1 1 auto; width: auto; max-width: none; }

/* ---- tablet & phone ---- */
@media (max-width: 900px) {
  .topbar-inner { gap: 8px; }
  .nav { order: 10; flex-basis: 100%; margin-left: 0; }
  .cert-pick { flex: 1 1 200px; min-width: 0; }
  .cert-select { width: 100%; min-width: 0; max-width: none; }
  .user { margin-left: auto; }
}

@media (max-width: 760px) {
  .topbar { width: calc(100% - 16px); top: 8px; margin-top: 8px; border-radius: 26px; }
  body.compact .topbar { border-radius: 999px; }
  .topbar-inner { padding: 8px; }
  .logo { width: 36px; height: 36px; font-size: 17px; }
  .chip-version { display: none; }
  .cert-select { font-size: 0.9rem; padding: 8px 12px; }
  .cert-meta { padding-left: 12px; }
  .avatar, .collapse-btn { width: 34px; height: 34px; }
  .role { font-size: 0.72rem; padding: 2px 8px; }

  /* nav becomes one horizontally scrollable row of pills */
  .nav { flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding: 2px 2px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-btn { flex: none; padding: 7px 12px; font-size: 0.82rem; }

  .subbar { width: calc(100% - 16px); border-radius: 22px; padding: 8px 10px; gap: 8px; }
  body.compact .subbar { border-radius: 999px; }
  .subbar-left { width: 100%; flex-wrap: wrap; gap: 6px 10px; }
  .progress { flex: 1 1 120px; width: auto; max-width: none; }
  .subbar-stats { flex-basis: 100%; padding-left: 6px; font-size: 0.78rem; }
  .subbar-right { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .subbar-right::-webkit-scrollbar { display: none; }
  .subbar-right > * { flex: none; }
  .subbar-right .btn { padding: 8px 14px; }

  .qcard { border-radius: 22px; }
  .qcard-head { padding: 12px 16px; align-items: flex-start; }
  .qtext { font-size: 1.02rem; }
  .opt { padding: 12px 14px; gap: 10px; }
  .opt-key { width: 26px; height: 26px; font-size: 0.8rem; }
  .card-footer { gap: 8px; }
  .card-footer > .btn { flex: 0 0 auto; }
  .footer-right { flex: 1; justify-content: flex-end; }
  .footer-right .btn { padding: 10px 14px; }
  .hint kbd { display: none; }
}

@media (max-width: 380px) {
  .role { display: none; }
  .footer-right .btn-amber { padding: 10px 12px; }
}

/* =========================================================
   Header v3: logo · exam dropdown · avatar menu
   ========================================================= */
.topbar { max-width: 960px; }
.subbar { max-width: 960px; }
.topbar-inner { flex-wrap: nowrap; padding: 6px 8px 6px 8px; }
.cert-pick { flex: 1 1 auto; min-width: 0; }
.cert-select { width: 100%; min-width: 0; max-width: none; }
.back-pill {
  flex: none; padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 0.85rem;
  color: var(--primary-ink); background: var(--primary-soft); text-decoration: none !important; white-space: nowrap;
}
.back-pill:hover { background: rgba(109, 74, 255, 0.2); }

.user-menu { position: relative; flex: none; margin-left: auto; }
.user-menu .avatar-btn { display: block; border-radius: 50%; transition: transform 0.15s, box-shadow 0.15s; }
.user-menu .avatar-btn:hover { transform: scale(1.05); }
.user-menu.open .avatar { box-shadow: 0 0 0 3px rgba(109, 74, 255, 0.35), var(--shadow); }
.menu {
  position: absolute; right: 0; top: calc(100% + 12px); z-index: 40; width: 260px; padding: 8px;
  background: rgba(255, 255, 255, 0.86); border: 1px solid var(--glass-border); border-radius: 22px;
  box-shadow: var(--shadow-lift), var(--inner);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  animation: menu-in 0.16s ease-out; transform-origin: top right;
}
@keyframes menu-in { from { opacity: 0; transform: scale(0.96) translateY(-4px); } }
.menu-head { display: flex; gap: 12px; align-items: center; padding: 10px 10px 12px; border-bottom: 1px solid var(--glass-line); margin-bottom: 6px; }
.avatar.lg { width: 46px; height: 46px; font-size: 1.1rem; }
.menu-id { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.menu-id strong { font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-id .tiny { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-id .role { align-self: flex-start; margin-top: 2px; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 14px;
  font: inherit; font-size: 0.92rem; font-weight: 600; color: var(--text); text-decoration: none !important;
  background: none; border: none; cursor: pointer; text-align: left;
}
.menu-item span { width: 22px; text-align: center; }
.menu-item:hover { background: var(--primary-soft); }
.menu-item.active { background: linear-gradient(135deg, var(--primary-2), var(--primary)); color: #fff; }
.menu-item.danger { color: var(--red); }
.menu-item.danger:hover { background: var(--red-soft); }
.menu-sep { height: 1px; background: var(--glass-line); margin: 6px 4px; }

@media (max-width: 760px) {
  .topbar-inner { padding: 6px; gap: 6px; }
  .topbar, body.compact .topbar { border-radius: 999px; }
  .back-pill { padding: 6px 10px; font-size: 0.8rem; }
  .menu { width: min(280px, calc(100vw - 32px)); }
  .subbar, body.compact .subbar { border-radius: 22px; }
}

/* ---- avatar menu: solid white; two mock modes side by side ---- */
.menu {
  background: #ffffff;
  border: 1px solid #ebe8f6;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: 0 18px 50px rgba(76, 56, 180, 0.18), 0 2px 8px rgba(76, 56, 180, 0.08);
}
.menu-head { border-bottom-color: #f0eef8; }
.menu-sep { background: #f0eef8; }
.menu-item:hover { background: #f4f1ff; }
.mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 960px; }
@media (max-width: 1100px) { .mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .mode-grid { grid-template-columns: 1fr; } }

/* ---------- answer-change requests ---------- */
.ar-link { margin-top: 10px; padding-top: 8px; border-top: 1px dashed #e6e0fb; }
.ar-link .linkish { font-size: 0.85rem; color: var(--primary-ink); }
.ar-link .linkish:hover { color: var(--primary); }
.dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; padding: 22px; border: 1px solid var(--glass-border); background: #fff; color: var(--text); }
.dialog::backdrop { background: rgba(29, 27, 51, 0.35); backdrop-filter: blur(3px); }
.ar-form fieldset { border: 1px solid var(--glass-line); border-radius: var(--radius-sm); padding: 10px 14px; margin: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.ar-form .ar-opt { align-items: flex-start !important; }
.ar-form .ar-opt input { margin-top: 5px; }
.ar-reason { display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; font-weight: 600; }
.ar-actions { justify-content: flex-end; margin-top: 14px; }
.ar-question { white-space: pre-wrap; margin: 8px 0; }
.ar-item + .ar-item { border-top: 1px solid var(--glass-line); }
section.ar-item + section.ar-item { border-top: 1px solid var(--glass-border); margin-top: 14px; }
.ar-options { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 6px; font-size: 0.92rem; }
.ar-options li { padding: 6px 10px; border-radius: 10px; border: 1px solid transparent; }
.ar-options li.is-current { background: rgba(95, 93, 122, 0.06); }
.ar-options li.is-proposed { background: var(--primary-soft); border-color: rgba(109, 74, 255, 0.25); }
.ar-options .chip { margin-left: 6px; font-size: 0.72rem; }
.ar-review { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; padding: 12px; border-radius: var(--radius-sm); background: #f8f6ff; border: 1px solid #e6e0fb; }
.ar-withdraw { margin-left: auto; }

/* ---------- question bank editor ---------- */
.bank-head { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.bank-head label { display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; font-weight: 600; flex: 1 1 220px; }
.bank-flags { white-space: nowrap; }
.bank-flags .chip { margin-right: 4px; }
.dialog-wide { width: min(860px, calc(100vw - 32px)); }
.q-edit { display: flex; flex-direction: column; gap: 14px; }
.q-edit > label { display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; font-weight: 600; }
.q-edit > label.check { flex-direction: row; }
.q-edit-head { justify-content: space-between; flex-wrap: nowrap; }
.q-edit-head h3 { margin: 0; }
.q-edit fieldset { border: 1px solid var(--glass-line); border-radius: var(--radius-sm); padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.q-edit legend { font-size: 0.88rem; font-weight: 600; padding: 0 4px; }
.opt-edit { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: start; }
.opt-edit .pick { padding-top: 10px; white-space: nowrap; min-width: 52px; text-align: right; }
.opt-edit .check { padding-top: 8px; }
.opt-edit textarea { resize: vertical; min-height: 44px; }
.q-edit-actions { position: sticky; bottom: -22px; background: #fff; padding: 12px 0; margin-bottom: -12px; border-top: 1px solid var(--glass-line); }
.spacer { flex: 1; }
.hist-item { border-top: 1px solid var(--glass-line); padding: 10px 0; }
.hist-change { margin-top: 6px; font-size: 0.88rem; }
.hist-diff { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.hist-diff del, .hist-diff ins { white-space: pre-wrap; padding: 6px 8px; border-radius: 8px; text-decoration: none; font-size: 0.85rem; }
.hist-diff del { background: var(--red-soft); }
.hist-diff ins { background: var(--green-soft); }
.edit-link { text-decoration: none !important; color: var(--muted); font-size: 1.05rem; }
.edit-link:hover { color: var(--primary-ink); }
@media (max-width: 640px) { .hist-diff { grid-template-columns: 1fr; } }
.qcard-tools { display: flex; gap: 6px; align-items: center; }

.q-stats { padding: 10px 14px; border-radius: var(--radius-sm); background: #f8f6ff; border: 1px solid #e6e0fb; display: flex; flex-direction: column; gap: 2px; }
.q-stats.warn { background: var(--red-soft); border-color: rgba(229, 72, 77, 0.3); }
.topic-form { flex-wrap: nowrap; }
.topic-form .input { min-width: 200px; }
.pill.muted { background: rgba(95, 93, 122, 0.1); color: var(--muted); }
