/* Quiz pages (quiz.html): Google Forms' layout in the Library's blue. */

:root {
  --qz-accent: #0b57d0;
  --qz-accent-hover: #0a4fbd;
  --qz-accent-bar: #4c8df6;
  --qz-accent-tint: #e8f0fe;
  --qz-accent-soft: #d3e3fd;
  --qz-bg: #eef3fc;
  --qz-card: #ffffff;
  --qz-ink: #202124;
  --qz-muted: #5f6368;
  --qz-faint: #80868b;
  --qz-line: #dadce0;
  --qz-line-soft: #e8eaed;
  --qz-hover: #f1f3f4;
  --qz-field: #f1f3f4;
  --qz-red: #d93025;
  --qz-red-tint: #fce8e6;
  --qz-green: #188038;
  --qz-green-ink: #137333;
  --qz-green-tint: #e6f4ea;
  --qz-amber: #b06000;
  --qz-amber-tint: #fef7e0;
  --qz-font: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --qz-display: "Google Sans", Rubik, Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --qz-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 2px 6px 2px rgba(60, 64, 67, 0.15);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--qz-bg);
  color: var(--qz-ink);
  font-family: var(--qz-font);
  font-size: 14px;
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--qz-accent); }
[hidden] { display: none !important; }
.qz-muted { color: var(--qz-muted); }
.small { font-size: 12px; }
.qz-spacer { flex: 1 1 auto; }

/* ── Loading ─────────────────────────────────────────────────────────────── */
.qz-boot { display: flex; justify-content: center; padding: 120px 0; }
.qz-spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid var(--qz-accent-soft); border-top-color: var(--qz-accent);
  animation: qz-spin 0.8s linear infinite;
}
.qz-spinner.small { width: 22px; height: 22px; border-width: 2.5px; }
@keyframes qz-spin { to { transform: rotate(360deg); } }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.qz-page { max-width: 770px; margin: 12px auto 0; padding: 0 16px; }
.qz-respond { max-width: 672px; }
.qz-card {
  position: relative;
  background: var(--qz-card);
  border: 1px solid var(--qz-line);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 12px;
}
.qz-head-card { border-top: 10px solid var(--qz-accent); padding-top: 22px; }
.qz-form-title {
  margin: 0;
  font-family: var(--qz-display);
  font-size: 32px; line-height: 1.25; font-weight: 400;
  word-break: break-word;
}
.qz-form-desc { margin-top: 12px; white-space: normal; word-break: break-word; }
.qz-head-meta { margin: 20px -24px -6px; padding: 12px 24px 0; border-top: 1px solid var(--qz-line); }
.qz-account { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; color: var(--qz-muted); }
.qz-account-email { color: var(--qz-ink); font-weight: 500; }
.qz-account a { text-decoration: none; font-weight: 500; }
.qz-required-note { color: var(--qz-red); margin-top: 8px; font-size: 14px; }

/* A selected card in the editor: blue bar on the left (like Forms). */
.qz-ecard.active, .qz-ehead.active { box-shadow: var(--qz-shadow); }
.qz-ecard.active::before, .qz-ehead.active::before {
  content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 6px;
  background: var(--qz-accent-bar); border-radius: 8px 0 0 8px;
}
.qz-ehead.active::before { top: -10px; border-radius: 0 0 0 8px; }

/* ── Questions (answering + read-only) ───────────────────────────────────── */
.qz-q-head { display: flex; align-items: flex-start; gap: 16px; }
.qz-q-title { flex: 1 1 auto; font-size: 16px; line-height: 1.5; font-weight: 400; letter-spacing: 0.1px; word-break: break-word; }
.qz-q-points { flex: 0 0 auto; color: var(--qz-muted); font-size: 14px; }
.qz-q-points.qz-nokey { color: var(--qz-amber); }
.qz-req { color: var(--qz-red); }
.qz-q-desc { margin-top: 4px; color: var(--qz-ink); font-size: 14px; word-break: break-word; }
.qz-q-body { margin-top: 16px; }
.qz-block-title { font-family: var(--qz-display); font-size: 24px; line-height: 1.3; word-break: break-word; }
.qz-text-block .qz-q-desc { margin-top: 8px; }

.qz-opt { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 4px 0; cursor: pointer; position: relative; }
.qz-opt input { position: absolute; opacity: 0; width: 20px; height: 20px; margin: 0; left: 0; pointer-events: none; }
.qz-opt-text { flex: 1 1 auto; word-break: break-word; }

/* Radio and checkbox marks */
.qz-mark { flex: 0 0 auto; display: inline-block; position: relative; width: 20px; height: 20px; border: 2px solid var(--qz-muted); transition: border-color 0.15s; }
.qz-mark.radio { border-radius: 50%; }
.qz-mark.check { border-radius: 2px; width: 18px; height: 18px; margin: 1px; }
.qz-opt input:checked + .qz-mark, .qz-mark.on,
.qz-radio-row input:checked + .qz-mark, .qz-check-row input:checked + .qz-mark { border-color: var(--qz-accent); }
.qz-opt input:checked + .qz-mark.radio::after, .qz-mark.radio.on::after,
.qz-radio-row input:checked + .qz-mark.radio::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--qz-accent);
}
.qz-opt input:checked + .qz-mark.check, .qz-mark.check.on,
.qz-check-row input:checked + .qz-mark.check { background: var(--qz-accent); }
.qz-opt input:checked + .qz-mark.check::after, .qz-mark.check.on::after,
.qz-check-row input:checked + .qz-mark.check::after {
  content: ""; position: absolute; left: 4px; top: 0; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.qz-opt input:focus-visible + .qz-mark,
.qz-radio-row input:focus-visible + .qz-mark,
.qz-check-row input:focus-visible + .qz-mark { box-shadow: 0 0 0 6px var(--qz-accent-tint); }
.qz-num { flex: 0 0 auto; min-width: 20px; color: var(--qz-muted); text-align: right; }

.qz-line-input {
  display: block; width: 50%; min-width: 220px; max-width: 100%;
  border: none; border-bottom: 1px solid var(--qz-line); outline: none;
  padding: 8px 0 6px; background: transparent; font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.qz-line-input.long { width: 100%; resize: none; overflow: hidden; line-height: 1.5; }
.qz-line-input:focus { border-bottom-color: var(--qz-accent); box-shadow: 0 1px 0 0 var(--qz-accent); }
.qz-select {
  min-width: 200px; max-width: 100%; height: 44px; padding: 0 36px 0 14px;
  border: 1px solid var(--qz-line); border-radius: 4px; background: #fff;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='%235f6368'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
}
.qz-select.small { height: 36px; min-width: 0; }
.qz-select:focus { outline: 2px solid var(--qz-accent); outline-offset: -1px; }
.qz-btn-text.qz-clear-choice { display: flex; width: fit-content; margin: 4px -8px -8px auto; padding: 0 8px; height: 32px; }

.qz-invalid { border-color: var(--qz-red); }
.qz-q-error { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--qz-red); font-size: 12px; }

.qz-submit-row { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 0; }
.qz-footer { max-width: 672px; margin: 24px auto 32px; padding: 0 16px; text-align: center; color: var(--qz-muted); font-size: 12px; }
.qz-footer p { margin: 0 0 12px; }
.qz-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--qz-muted); text-decoration: none; font-family: var(--qz-display); font-size: 18px; }
.qz-brand img { width: 24px; height: 24px; border-radius: 50%; }

.qz-owner-banner {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 12px;
  background: #fff; border: 1px solid var(--qz-accent-soft); border-radius: 8px; color: var(--qz-ink);
}
.qz-owner-banner svg { color: var(--qz-accent); flex: 0 0 auto; }
.qz-owner-banner span { flex: 1 1 auto; }
.qz-owner-banner a { font-weight: 500; text-decoration: none; white-space: nowrap; }
.qz-prebuilt-banner { flex-wrap: wrap; }
.qz-prebuilt-banner svg { color: #e37400; }
.qz-prebuilt-note { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 6px 16px; background: #fef7e0; color: #5f4200; font-size: 13px; border-top: 1px solid var(--qz-line-soft); }
.qz-prebuilt-note svg { color: #e37400; flex: 0 0 auto; }

/* Messages and confirmation */
.qz-gate-lead { font-size: 16px; margin: 16px 0 0; }
.qz-gate-text { margin: 16px 0 0; font-size: 14px; }
.qz-gate .qz-muted { margin: 12px 0 0; }
.qz-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; }
.qz-copy-link { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.qz-copy-link input {
  flex: 1 1 auto; min-width: 0; height: 40px; padding: 0 12px;
  border: 1px solid var(--qz-line); border-radius: 4px; background: var(--qz-hover); color: var(--qz-muted);
}

/* Score view */
.qz-total { display: flex; align-items: baseline; gap: 12px; margin-top: 16px; font-size: 14px; color: var(--qz-muted); }
.qz-total strong { font-family: var(--qz-display); font-weight: 400; font-size: 28px; color: var(--qz-ink); }
.qz-result .qz-q-points.qz-score-right { color: var(--qz-green); font-weight: 500; }
.qz-result .qz-q-points.qz-score-wrong { color: var(--qz-red); font-weight: 500; }
.qz-opt-result { cursor: default; border-radius: 4px; padding: 6px 12px; margin: 0 -12px 2px; }
.qz-opt-result.chosen.right { background: var(--qz-green-tint); }
.qz-opt-result.chosen.wrong { background: var(--qz-red-tint); }
.qz-opt-result.key { box-shadow: inset 0 0 0 1px #a8dab5; }
.qz-ok { color: var(--qz-green); flex: 0 0 auto; }
.qz-no { color: var(--qz-red); flex: 0 0 auto; }
.qz-key-tag { color: var(--qz-green-ink); font-size: 12px; font-weight: 500; }
.qz-answer-text {
  display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: 4px;
  background: var(--qz-hover); word-break: break-word;
}
.qz-answer-text > span { flex: 1 1 auto; }
.qz-answer-text.right { background: var(--qz-green-tint); }
.qz-answer-text.wrong { background: var(--qz-red-tint); }
.qz-key-box { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--qz-line-soft); }
.qz-key-label { color: var(--qz-muted); font-size: 12px; font-weight: 500; margin-bottom: 6px; }
.qz-key-item { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.qz-feedback { margin-top: 16px; padding: 12px 16px; border-radius: 4px; background: var(--qz-accent-tint); word-break: break-word; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.qz-btn-primary, .qz-btn-text, .qz-btn-outline, .qz-btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 24px; border-radius: 18px; border: none;
  font-family: var(--qz-display); font-size: 14px; font-weight: 500; letter-spacing: 0.25px;
  text-decoration: none; white-space: nowrap; transition: background 0.15s, box-shadow 0.15s;
}
.qz-btn-primary { background: var(--qz-accent); color: #fff; }
.qz-btn-primary:hover { background: var(--qz-accent-hover); box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3); }
.qz-btn-primary:disabled { background: var(--qz-line); color: var(--qz-faint); box-shadow: none; cursor: default; }
.qz-btn-text { background: transparent; color: var(--qz-accent); padding: 0 12px; }
.qz-btn-text:hover { background: var(--qz-accent-tint); }
.qz-btn-outline { background: #fff; color: var(--qz-accent); border: 1px solid var(--qz-line); }
.qz-btn-outline:hover { background: var(--qz-accent-tint); }
.qz-btn-danger { background: transparent; color: var(--qz-red); padding: 0 12px; }
.qz-btn-danger:hover { background: var(--qz-red-tint); }
.qz-btn-primary.small, .qz-btn-text.small { height: 32px; padding: 0 14px; font-size: 13px; }
.qz-submit { border-radius: 4px; }
.qz-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 40px; height: 40px; padding: 0; border: none; border-radius: 50%;
  background: transparent; color: var(--qz-muted); text-decoration: none;
}
.qz-icon-btn:hover { background: rgba(60, 64, 67, 0.08); color: var(--qz-ink); }
.qz-icon-btn:disabled { opacity: 0.38; cursor: default; background: transparent; }
.qz-icon-btn.small { width: 32px; height: 32px; }
:focus-visible { outline: 2px solid var(--qz-accent); outline-offset: 2px; }

/* Switch */
.qz-switch { position: relative; flex: 0 0 auto; width: 40px; height: 24px; padding: 0; border: none; background: transparent; }
.qz-switch-track { position: absolute; left: 3px; right: 3px; top: 5px; height: 14px; border-radius: 7px; background: #bdc1c6; transition: background 0.15s; }
.qz-switch-thumb {
  position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); transition: transform 0.15s, background 0.15s;
}
.qz-switch.on .qz-switch-track { background: var(--qz-accent-soft); }
.qz-switch.on .qz-switch-thumb { transform: translateX(20px); background: var(--qz-accent); }

/* ── Editor header ───────────────────────────────────────────────────────── */
.qz-top { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--qz-line); transition: box-shadow 0.15s; }
.qz-top.scrolled { box-shadow: 0 1px 3px rgba(60, 64, 67, 0.2); }
.qz-top-row { display: flex; align-items: center; gap: 8px; height: 64px; padding: 0 12px 0 16px; }
.qz-app-icon {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 40px; height: 40px; border-radius: 8px; background: var(--qz-accent); color: #fff;
}
.qz-doc-title {
  min-width: 80px; max-width: 360px; flex: 0 1 auto; width: 240px; height: 36px; padding: 0 8px;
  border: 1px solid transparent; border-radius: 4px; background: transparent;
  font-family: var(--qz-display); font-size: 18px; color: var(--qz-ink); outline: none; text-overflow: ellipsis;
}
.qz-doc-title:hover { border-color: var(--qz-line); }
.qz-doc-title:focus { border-color: var(--qz-accent); box-shadow: inset 0 0 0 1px var(--qz-accent); }
.qz-save-status { display: inline-flex; align-items: center; gap: 6px; color: var(--qz-muted); font-size: 12px; white-space: nowrap; min-width: 0; overflow: hidden; }
.qz-save-status span { overflow: hidden; text-overflow: ellipsis; }
.qz-status-saving svg { animation: qz-spin 1.2s linear infinite; }
.qz-status-error, .qz-status-offline { color: var(--qz-amber); }
.qz-top-spacer { flex: 1 1 auto; }
.qz-top-actions { display: flex; align-items: center; gap: 4px; }
.qz-share-btn { margin: 0 4px 0 8px; padding: 0 18px 0 14px; }
.qz-people { display: inline-flex; align-items: center; }
.qz-person-face {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin-left: -6px;
  border: 2px solid #fff; border-radius: 50%; color: #fff; font-size: 13px; font-weight: 500;
}
.qz-person-face:first-child { margin-left: 0; }
.qz-person-face.more { background: var(--qz-muted); font-size: 11px; }
.qz-avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 32px; height: 32px; margin-left: 4px; border-radius: 50%;
  background: #1f3a68; color: #fff; font-weight: 500; font-size: 14px;
}
.qz-tabs { display: flex; justify-content: center; gap: 8px; height: 40px; }
.qz-tabs button {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 12px; border: none; background: none;
  color: var(--qz-ink); font-family: var(--qz-display); font-size: 14px; font-weight: 500;
}
.qz-tabs button:hover { color: var(--qz-accent); }
.qz-tabs button.active { color: var(--qz-accent); }
.qz-tabs button.active::after {
  content: ""; position: absolute; left: 6px; right: 6px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--qz-accent);
}
.qz-tab-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; background: var(--qz-accent); color: #fff; font-size: 11px;
}
.qz-main { padding-bottom: 96px; }

/* ── Editor: title card and question cards ───────────────────────────────── */
.qz-editor { position: relative; }
.qz-title-input, .qz-desc-input, .qz-q-title-input, .qz-q-desc-input, .qz-fb-input {
  display: block; width: 100%; border: none; outline: none; resize: none; overflow: hidden;
  background: transparent; padding: 4px 0; border-bottom: 1px solid transparent;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.qz-title-input { font-family: var(--qz-display); font-size: 32px; line-height: 1.25; }
.qz-desc-input { margin-top: 8px; font-size: 14px; line-height: 1.5; }
.qz-ehead.active .qz-title-input, .qz-ehead.active .qz-desc-input { border-bottom-color: var(--qz-line); }
.qz-title-input:focus, .qz-desc-input:focus, .qz-q-desc-input:focus, .qz-fb-input:focus { border-bottom-color: var(--qz-accent) !important; box-shadow: 0 1px 0 0 var(--qz-accent); }

.qz-ecard { cursor: default; padding-top: 24px; }
.qz-ecard:not(.active) { cursor: pointer; }
.qz-ecard:not(.active):hover { box-shadow: 0 1px 2px rgba(60, 64, 67, 0.2); }
.qz-drag {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%) rotate(90deg);
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  color: #bdc1c6; cursor: move; opacity: 0; touch-action: none;
}
.qz-ecard:hover .qz-drag, .qz-ecard.active .qz-drag { opacity: 1; }
.qz-ecard.dragging { z-index: 5; box-shadow: 0 4px 12px rgba(60, 64, 67, 0.3); opacity: 0.96; transition: none; }
.qz-drop-line { height: 3px; margin: -7px 0 4px; border-radius: 2px; background: var(--qz-accent-bar); }

.qz-edit-top { display: flex; align-items: flex-start; gap: 8px; }
.qz-q-title-input {
  flex: 1 1 auto; min-height: 56px; padding: 16px; background: var(--qz-field);
  border-bottom: 1px solid var(--qz-faint); border-radius: 4px 4px 0 0; font-size: 16px; line-height: 1.5;
}
.qz-q-title-input:focus { border-bottom: 2px solid var(--qz-accent); padding-bottom: 15px; }
.qz-block-input { font-family: var(--qz-display); font-size: 24px; line-height: 1.3; }
.qz-add-board { margin-top: 8px; }
.qz-type-btn {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px; width: 232px; height: 48px; margin-top: 4px;
  padding: 0 6px 0 12px; border: 1px solid var(--qz-line); border-radius: 4px; background: #fff; text-align: left;
}
.qz-type-btn:hover { background: var(--qz-hover); }
.qz-type-btn svg { color: var(--qz-muted); flex: 0 0 auto; }
.qz-type-label { flex: 1 1 auto; font-size: 14px; }
.qz-q-desc-input { margin-top: 8px; padding: 6px 0; border-bottom-color: var(--qz-line); }

.qz-opts-view { margin-top: 12px; }
.qz-opt-view { cursor: inherit; min-height: 36px; }
.qz-opt-view .qz-mark { border-color: #bdc1c6; }
.qz-opt-view.right .qz-opt-text { color: var(--qz-green-ink); font-weight: 500; }
.qz-fake-input { margin-top: 16px; width: 50%; padding: 8px 0; border-bottom: 1px dotted #bdc1c6; color: var(--qz-faint); font-size: 14px; }
.qz-fake-input.long { width: 80%; }

.qz-opts-edit { margin-top: 16px; }
.qz-opt-edit { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.qz-opt-input {
  flex: 1 1 auto; min-width: 0; height: 36px; padding: 0; border: none; border-bottom: 1px solid transparent;
  outline: none; background: transparent; font-size: 14px;
}
.qz-opt-input:hover { border-bottom-color: var(--qz-line); }
.qz-opt-input:focus { border-bottom: 2px solid var(--qz-accent); }
.qz-opt-edit .qz-mark { border-color: #bdc1c6; }
.qz-add-option {
  padding: 6px 0; border: none; border-bottom: 1px solid transparent; background: none; color: var(--qz-faint); font-size: 14px;
}
.qz-add-option:hover { border-bottom-color: var(--qz-line); color: var(--qz-muted); }

.qz-ecard-foot {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  margin: 20px -24px -16px; padding: 8px 12px 8px 24px; border-top: 1px solid var(--qz-line);
}
.qz-key-link {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 8px; margin-left: -8px;
  border: none; border-radius: 18px; background: none; color: var(--qz-accent); font-family: var(--qz-display); font-weight: 500;
}
.qz-key-link:hover { background: var(--qz-accent-tint); }
.qz-key-points { color: var(--qz-muted); }
.qz-vsep { width: 1px; height: 32px; margin: 0 12px; background: var(--qz-line); }
.qz-req-label { margin-right: 8px; }

/* Answer key */
.qz-key-head {
  display: flex; align-items: center; gap: 10px; margin: -24px -24px 16px; padding: 14px 24px;
  border-bottom: 1px solid var(--qz-line-soft); font-weight: 500;
}
.qz-key-head svg { color: var(--qz-accent); }
.qz-points-input {
  width: 64px; height: 36px; padding: 0 8px; text-align: center;
  border: 1px solid var(--qz-line); border-radius: 4px; background: #fff; font-weight: 400;
}
.qz-points-input:focus { outline: none; border-color: var(--qz-accent); box-shadow: inset 0 0 0 1px var(--qz-accent); }
.qz-key-title { font-size: 16px; margin-bottom: 12px; word-break: break-word; }
.qz-key-opts { display: flex; flex-direction: column; gap: 2px; }
.qz-key-opt {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 8px 12px;
  border: none; border-radius: 4px; background: none; text-align: left;
}
.qz-key-opt:hover { background: var(--qz-hover); }
.qz-key-opt.right { background: var(--qz-green-tint); color: var(--qz-green-ink); font-weight: 500; }
.qz-key-opt.right .qz-mark { border-color: var(--qz-green); }
.qz-key-note { margin: 12px 0 0; color: var(--qz-muted); font-size: 13px; }
.qz-accepted-row { display: flex; align-items: center; gap: 8px; }
.qz-accept-input {
  flex: 1 1 auto; height: 40px; border: none; border-bottom: 1px solid var(--qz-line); background: transparent; outline: none;
}
.qz-accept-input:focus { border-bottom: 2px solid var(--qz-accent); }
.qz-accepted-add .qz-accept-input { border-bottom-style: dashed; }
.qz-feedback-edit { margin-top: 16px; }
.qz-fb-label { display: block; margin-top: 12px; color: var(--qz-muted); font-size: 12px; font-weight: 500; }
.qz-fb-input { border-bottom-color: var(--qz-line); padding: 6px 0; }
.qz-key-foot { display: flex; justify-content: flex-end; margin: 20px -24px -16px; padding: 10px 16px; border-top: 1px solid var(--qz-line); }

.qz-empty-list { text-align: center; color: var(--qz-muted); }
.qz-empty-list p { margin: 0 0 12px; }

/* Floating add bar beside the selected card */
.qz-fab {
  position: absolute; top: 0; right: -60px; width: 48px; z-index: 10;
  display: flex; flex-direction: column; align-items: center; padding: 4px 0;
  background: #fff; border: 1px solid var(--qz-line); border-radius: 8px; box-shadow: 0 1px 3px rgba(60, 64, 67, 0.2);
  transition: top 0.15s ease-out;
}
.qz-fab.docked {
  position: fixed; top: auto !important; right: auto; left: 50%; bottom: 16px; transform: translateX(-50%);
  width: auto; flex-direction: row; padding: 0 4px; border-radius: 28px; box-shadow: var(--qz-shadow);
}

/* ── Boards in questions ─────────────────────────────────────────────────── */
.qz-board { margin: 16px 0 4px; border: 1px solid var(--qz-line); border-radius: 8px; overflow: hidden; background: #fff; }
.qz-board-stage { position: relative; aspect-ratio: 16 / 10; background: #f4f1ec; }
.qz-board-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
/* The board's preview drawing, shown until (and while) the live board loads (quiz-core.js boardEmbed). */
.qz-board-preview { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 6%; }
.qz-board-preview svg { width: 100%; height: 100%; display: block; }
/* Once the live board has loaded it replaces the preview (a board page in a frame can be see-through). */
.qz-board-ready .qz-board-preview { display: none; }
.qz-board-status {
  position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: rgba(244, 241, 236, 0.72); color: var(--qz-muted); font-size: 13px; text-align: center; padding: 16px;
}
.qz-board-live .qz-board-status, .qz-board-failed .qz-board-status { display: flex; }
.qz-board-ready .qz-board-status { display: none; }
/* Not live (scrolled away, or past the live limit): the hint says how to load it. */
.qz-board-hint-load { display: none; }
.qz-board:not(.qz-board-live) .qz-board-hint-live { display: none; }
.qz-board:not(.qz-board-live) .qz-board-hint-load { display: inline; }
.qz-board-waiting .qz-board-hint, .qz-board:not(.qz-board-live) .qz-board-shield:hover .qz-board-hint { opacity: 1; transform: none; }
.qz-board:not(.qz-board-live) .qz-board-shield { align-items: center; }
.qz-board:not(.qz-board-live) .qz-board-hint { margin-bottom: 0; padding: 6px 12px; font-size: 12px; white-space: nowrap; }
.qz-board-failed .qz-board-status .qz-spinner { display: none; }
.qz-board-failed .qz-board-shield { display: none; }
.qz-board-shield {
  position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: none; background: transparent;
  display: flex; align-items: flex-end; justify-content: center; cursor: pointer;
}
.qz-board-hint {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 64px; padding: 8px 16px; border-radius: 20px;
  background: rgba(32, 33, 36, 0.78); color: #fff; font-size: 13px; font-weight: 500;
  opacity: 0; transform: translateY(4px); transition: opacity 0.15s, transform 0.15s; pointer-events: none;
}
.qz-board-ready .qz-board-shield:hover .qz-board-hint, .qz-board-shield:focus-visible .qz-board-hint { opacity: 1; transform: none; }
.qz-board-active .qz-board-shield { display: none; }
.qz-board-active .qz-board-stage { box-shadow: inset 0 0 0 2px var(--qz-accent-bar); }
.qz-board-stage:fullscreen { aspect-ratio: auto; width: 100%; height: 100%; }
.qz-board-bar { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 4px 8px 4px 12px; border-top: 1px solid var(--qz-line); font-size: 13px; }
.qz-board-name { display: inline-flex; align-items: center; gap: 8px; flex: 0 1 auto; min-width: 0; max-width: 60%; font-weight: 500; }
.qz-board-name svg { color: var(--qz-accent); flex: 0 0 auto; }
.qz-board-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qz-board-tip { flex: 1 1 0; min-width: 0; color: var(--qz-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qz-board-open { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; padding: 6px 10px; border-radius: 16px; font-weight: 500; text-decoration: none; }
.qz-board-open:hover { background: var(--qz-accent-tint); }
.qz-board-edit { display: none; justify-content: flex-end; gap: 4px; margin: 4px 0 -4px; }
.qz-ecard.active:not(.keymode) .qz-board-edit { display: flex; }
.qz-ecard.keymode .qz-slot-board { display: none; }

/* Board picker */
.qz-picker-search { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 22px; background: var(--qz-field); color: var(--qz-muted); }
.qz-picker-search input { flex: 1 1 auto; border: none; outline: none; background: transparent; color: var(--qz-ink); }
.qz-picker-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px;
  max-height: min(52vh, 460px); overflow: auto; margin: 16px -4px 0; padding: 4px;
}
.qz-picker-msg { grid-column: 1 / -1; display: flex; justify-content: center; padding: 32px 8px; color: var(--qz-muted); text-align: center; }
.qz-pick {
  display: flex; flex-direction: column; align-items: stretch; padding: 0 0 10px; overflow: hidden; text-align: left;
  border: 1px solid var(--qz-line); border-radius: 8px; background: #fff;
}
.qz-pick:hover { border-color: #bdc1c6; box-shadow: 0 1px 2px rgba(60, 64, 67, 0.2); }
.qz-pick-new { border-style: dashed; }
.qz-pick-new .qz-pick-thumb { background: var(--qz-accent-tint); color: var(--qz-accent); }
.qz-pick-new:hover { border-color: var(--qz-accent); }
.qz-pick.selected { border-color: var(--qz-accent); box-shadow: inset 0 0 0 1px var(--qz-accent); background: var(--qz-accent-tint); }
.qz-pick-thumb { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 10; background: #f8fafd; color: #bdc1c6; border-bottom: 1px solid var(--qz-line-soft); }
.qz-pick-svg { width: 100%; height: 100%; }
.qz-pick-title { margin: 8px 10px 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qz-pick-meta { margin: 0 10px; color: var(--qz-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qz-picker-link { display: flex; align-items: center; gap: 12px; margin-top: 16px; color: var(--qz-muted); }
.qz-picker-link span { flex: 0 0 auto; }
.qz-picker-link input { flex: 1 1 auto; min-width: 0; height: 36px; border: none; border-bottom: 1px solid var(--qz-line); outline: none; background: transparent; color: var(--qz-ink); }
.qz-picker-link input:focus { border-bottom: 2px solid var(--qz-accent); }

/* ── Dialogs, menus, messages ────────────────────────────────────────────── */
.qz-dialog-back { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(32, 33, 36, 0.55); }
.qz-dialog {
  width: min(440px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  padding: 24px; border-radius: 12px; background: #fff; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}
.qz-dialog.wide { width: min(760px, 100%); }
.qz-dialog-title { margin: 0 0 12px; font-family: var(--qz-display); font-size: 22px; font-weight: 400; }
.qz-dialog-text { margin: 0 0 12px; color: var(--qz-muted); }
.qz-dialog-input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--qz-line); border-radius: 4px; outline: none; }
.qz-dialog-input:focus { border-color: var(--qz-accent); box-shadow: inset 0 0 0 1px var(--qz-accent); }
.qz-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }

.qz-menu {
  position: absolute; z-index: 1100; min-width: 220px; max-width: calc(100vw - 16px); padding: 8px 0;
  background: #fff; border-radius: 4px; box-shadow: 0 2px 6px 2px rgba(60, 64, 67, 0.15), 0 1px 2px rgba(60, 64, 67, 0.3);
}
.qz-menu-item { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 40px; padding: 0 20px 0 16px; border: none; background: none; text-align: left; font-size: 14px; }
.qz-menu-item:hover, .qz-menu-item:focus-visible { background: var(--qz-hover); outline: none; }
.qz-menu-item.selected { background: var(--qz-accent-tint); }
.qz-menu-item:disabled { color: var(--qz-faint); cursor: default; background: none; }
.qz-menu-item.danger { color: var(--qz-red); }
.qz-menu-icon { color: var(--qz-muted); flex: 0 0 auto; }
.qz-menu-check { display: inline-flex; width: 20px; color: var(--qz-ink); }
.qz-menu-sep { height: 1px; margin: 8px 0; background: var(--qz-line); }
.qz-type-menu .qz-menu-item { min-height: 48px; }

.qz-snack {
  position: fixed; left: 24px; bottom: 24px; z-index: 1200; display: flex; align-items: center; gap: 16px;
  max-width: calc(100vw - 48px); min-height: 48px; padding: 6px 8px 6px 16px; border-radius: 4px;
  background: #323232; color: #fff; box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
  transform: translateY(120px); opacity: 0; transition: transform 0.2s, opacity 0.2s; pointer-events: none;
}
.qz-snack.on { transform: none; opacity: 1; pointer-events: auto; }
.qz-snack-action { border: none; background: none; color: #8ab4f8; font-weight: 500; padding: 8px; border-radius: 4px; }
.qz-snack-action:hover { background: rgba(255, 255, 255, 0.08); }

/* Send */
.qz-send-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.qz-send-label { display: block; margin: 20px 0 8px; font-weight: 500; }
.qz-send-row .qz-send-label { margin: 0; }
.qz-send-add { display: flex; gap: 8px; }
.qz-send-emails { flex: 1 1 auto; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--qz-line); border-radius: 4px; outline: none; }
.qz-send-emails:focus { border-color: var(--qz-accent); box-shadow: inset 0 0 0 1px var(--qz-accent); }
.qz-send-people { margin-top: 8px; max-height: 220px; overflow: auto; }
.qz-person { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.qz-person-avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--qz-accent-soft); color: var(--qz-accent); font-weight: 500; }
.qz-person-email { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.qz-send-note { margin: 12px 0 0; color: var(--qz-muted); font-size: 13px; }
.qz-send-note.top { margin: 0 0 16px; }
.qz-person-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.qz-person-main .qz-person-email { font-weight: 500; }
.qz-person .qz-select.small, .qz-general .qz-select.small, .qz-send-add .qz-select.small { min-width: 0; width: auto; }
.qz-general { display: flex; align-items: center; gap: 12px; }
.qz-general .qz-select { align-self: flex-start; border: none; padding-left: 0; height: 30px; font-weight: 500; background-position: right 0 center; padding-right: 26px; }
.qz-general-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--qz-hover); color: var(--qz-muted); flex: 0 0 auto; }
.qz-general-icon.open { background: #e6f4ea; color: var(--qz-green); }
.qz-share-error { margin-top: 12px; color: var(--qz-red); font-size: 13px; }

/* ── Settings ────────────────────────────────────────────────────────────── */
.qz-settings-h { margin: 12px 0 16px; font-family: var(--qz-display); font-size: 22px; font-weight: 400; }
.qz-set-card { padding: 8px 24px; }
.qz-set-group-title { padding: 16px 0 8px; font-family: var(--qz-display); font-size: 16px; font-weight: 500; }
.qz-set-row { display: flex; align-items: center; gap: 24px; padding: 16px 0; border-top: 1px solid var(--qz-line-soft); }
.qz-set-row.column { flex-direction: column; align-items: stretch; gap: 8px; }
.qz-set-text { flex: 1 1 auto; }
.qz-set-label { font-size: 14px; font-weight: 500; }
.qz-set-desc { color: var(--qz-muted); font-size: 13px; }
.qz-set-sub { padding: 0 0 16px; }
.qz-radio-row, .qz-check-row { position: relative; display: flex; align-items: flex-start; gap: 14px; padding: 6px 0; cursor: pointer; }
.qz-radio-row input, .qz-check-row input { position: absolute; opacity: 0; width: 20px; height: 20px; margin: 0; }
.qz-radio-row .qz-mark, .qz-check-row .qz-mark { margin-top: 1px; }
.qz-radio-row small, .qz-check-row small { display: block; color: var(--qz-muted); font-size: 12px; }

/* ── Responses ───────────────────────────────────────────────────────────── */
.qz-resp-loading { display: flex; justify-content: center; padding: 48px; }
.qz-resp-head { padding-bottom: 0; }
.qz-resp-top { display: flex; align-items: center; gap: 4px; }
.qz-resp-count { margin: 0; font-family: var(--qz-display); font-size: 28px; font-weight: 400; }
.qz-resp-accept { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 8px; font-size: 14px; }
.qz-resp-accept.closed { color: var(--qz-red); }
.qz-release-bar { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 12px 10px 16px; border-radius: 8px; background: var(--qz-accent-tint); }
.qz-release-bar svg { color: var(--qz-accent); }
.qz-release-bar span { flex: 1 1 auto; }
.qz-subtabs { display: flex; justify-content: center; gap: 8px; margin: 12px -24px 0; border-top: 1px solid var(--qz-line-soft); }
.qz-subtabs button {
  position: relative; height: 48px; padding: 0 16px; border: none; background: none;
  font-family: var(--qz-display); font-weight: 500; color: var(--qz-muted);
}
.qz-subtabs button.active { color: var(--qz-accent); }
.qz-subtabs button.active::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--qz-accent); }
.qz-resp-empty { text-align: center; color: var(--qz-muted); padding: 40px 24px; }
.qz-resp-empty svg { color: var(--qz-line); }
.qz-resp-empty p { margin: 8px 0 0; }
.qz-card-h { margin: 0 0 16px; font-family: var(--qz-display); font-size: 18px; font-weight: 400; }
.qz-card-sub { margin: 24px 0 12px; font-size: 14px; font-weight: 500; }
.qz-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.qz-stat { padding: 12px 16px; border-radius: 8px; background: var(--qz-hover); }
.qz-stat-label { color: var(--qz-muted); font-size: 12px; }
.qz-stat-value { font-family: var(--qz-display); font-size: 18px; }
.qz-pending-note { display: flex; align-items: center; gap: 8px; margin: 16px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--qz-amber-tint); color: #5f4200; }
.qz-dist { display: flex; align-items: flex-end; gap: 8px; height: 170px; padding: 0 4px; border-bottom: 1px solid var(--qz-line); }
.qz-dist-col { flex: 1 1 0; max-width: 56px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; padding-bottom: 0; }
.qz-dist-bar { display: block; width: 100%; min-height: 4px; border-radius: 4px 4px 0 0; background: var(--qz-accent); }
.qz-dist-n { font-size: 12px; color: var(--qz-muted); margin-bottom: 4px; }
.qz-dist-x { position: absolute; bottom: -22px; font-size: 12px; color: var(--qz-muted); }
.qz-dist-axis { margin-top: 28px; text-align: center; color: var(--qz-muted); font-size: 12px; }
.qz-missed-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--qz-line-soft); }
.qz-missed-row:first-of-type { border-top: none; }
.qz-qsum-meta { display: flex; gap: 16px; margin: 4px 0 16px; font-size: 13px; }
.qz-qsum-right { color: var(--qz-green-ink); font-weight: 500; }
.qz-bars { display: flex; flex-direction: column; gap: 10px; }
.qz-bar-row { display: grid; grid-template-columns: minmax(120px, 34%) 1fr auto; align-items: center; gap: 12px; }
.qz-bar-label { display: flex; align-items: center; gap: 6px; min-width: 0; }
.qz-bar-label > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qz-bar-gap { display: inline-block; width: 18px; flex: 0 0 auto; }
.qz-bar-row.right .qz-bar-label { color: var(--qz-green-ink); font-weight: 500; }
.qz-bar-track { height: 24px; border-radius: 4px; background: var(--qz-hover); overflow: hidden; }
.qz-bar-fill { display: block; height: 100%; background: var(--qz-accent); border-radius: 4px; }
.qz-bar-row.right .qz-bar-fill { background: var(--qz-green); }
.qz-bar-n { min-width: 64px; text-align: right; color: var(--qz-muted); font-size: 13px; }
.qz-text-answers { display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow: auto; }
.qz-text-answer { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 4px; background: var(--qz-hover); word-break: break-word; }
.qz-text-answer.right { background: var(--qz-green-tint); }
.qz-text-answer.wrong { background: var(--qz-red-tint); }
.qz-pager { display: flex; align-items: center; gap: 4px; padding: 12px 12px 12px 16px; }
.qz-pager .qz-select { flex: 0 1 380px; min-width: 0; }
.qz-pager-n { color: var(--qz-muted); padding: 0 4px; white-space: nowrap; }
.qz-group { padding: 16px 16px 12px 24px; }
.qz-group.qz-ungraded { border-left: 4px solid var(--qz-amber); padding-left: 21px; }
.qz-group-text { font-size: 15px; word-break: break-word; }
.qz-group-foot, .qz-grade-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.qz-grade-foot { margin: 16px -24px -16px; padding: 8px 16px 8px 24px; border-top: 1px solid var(--qz-line-soft); }
.qz-points-box { display: inline-flex; align-items: center; gap: 6px; color: var(--qz-muted); }
.qz-chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.qz-chip.warn { background: var(--qz-amber-tint); color: var(--qz-amber); }
.qz-chip.ok { background: var(--qz-green-tint); color: var(--qz-green-ink); }
.qz-resp-person .qz-total { margin: 0; }
.qz-person-line { display: flex; align-items: center; gap: 12px; }
.qz-person-line > svg { color: var(--qz-muted); }
.qz-person-name { font-size: 16px; font-weight: 500; }
.qz-person-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.qz-person-status:empty { display: none; }
.qz-result.qz-pending { border-left: 4px solid var(--qz-amber); }

/* ── Phones ──────────────────────────────────────────────────────────────── */
@media (max-width: 680px) {
  .qz-page { padding: 0 8px; }
  .qz-card { padding: 20px 16px; }
  .qz-head-meta { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
  .qz-form-title, .qz-title-input { font-size: 24px; }
  .qz-line-input, .qz-fake-input { width: 100%; min-width: 0; }
  .qz-top-row { gap: 4px; padding: 0 4px 0 8px; height: 56px; }
  .qz-doc-title { font-size: 16px; flex: 1 1 auto; }
  .qz-save-status span, .qz-copylink-btn, .qz-avatar { display: none; }
  .qz-share-btn { padding: 0 12px; margin: 0 2px; }
  .qz-edit-top { flex-wrap: wrap; }
  .qz-q-title-input { flex-basis: calc(100% - 48px); }
  .qz-type-btn { width: 100%; }
  .qz-ecard-foot, .qz-key-foot, .qz-grade-foot { margin-left: -16px; margin-right: -16px; padding-left: 12px; }
  .qz-key-head { margin: -20px -16px 16px; padding: 12px 16px; }
  .qz-vsep { margin: 0 4px; }
  .qz-board-tip { display: none; }
  .qz-board-bar { justify-content: space-between; }
  .qz-stats { grid-template-columns: 1fr; }
  .qz-bar-row { grid-template-columns: 1fr auto; }
  .qz-bar-track { grid-column: 1 / -1; grid-row: 2; }
  .qz-subtabs { margin-left: -16px; margin-right: -16px; }
  .qz-snack { left: 12px; right: 12px; bottom: 12px; }
  .qz-main { padding-bottom: 88px; }
}

/* ── Inside a briefing (?embed=1, quiz.html) ─────────────────────────────── */
.qz-embed body { background: transparent; }
.qz-embed .qz-footer { display: none; }
.qz-embed .qz-page { max-width: none; margin: 0; padding: 12px 10px 4px; }
