:root {
  --ink: #172622;
  --muted: #687671;
  --line: #b5c7bd;
  --border: var(--line);
  --surface: #fff;
  --soft: #e7efe9;
  --surface-soft: var(--soft);
  --page-background: #e8eee9;
  --panel-shadow: 0 3px 12px rgba(22, 55, 43, .08);
  --cream: #f7f5ec;
  --green: #146b4b;
  --green-dark: #0c5038;
  --green-light: #d9eee4;
  --lime: #d4ed75;
  --orange: #f39b60;
  --danger: #bb3d3d;
  --shadow: 0 20px 60px rgba(22, 55, 43, .12);
  --radius: 18px;
}

.question-options-row { display: grid; grid-template-columns: minmax(180px, .7fr) minmax(240px, 1fr); gap: 16px; margin: 14px 0; }
.question-options-row label { display: grid; gap: 7px; font-weight: 700; }
.question-options-row select { width: 100%; }
.question-image-preview, .question-media { display: block; width: min(100%, 760px); max-height: 420px; object-fit: contain; border-radius: 16px; margin: 14px 0; background: var(--surface-soft); }
.short-answer { display: grid; gap: 8px; font-weight: 700; }
.short-answer input { font-size: 1.05rem; }
.answer-explanation { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-soft); }
.header-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.distribution-chart { display: grid; gap: 13px; }
.score-histogram { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; padding: 24px 0 4px; }
.histogram-axis { height: 220px; display: flex; flex-direction: column; justify-content: space-between; color: var(--muted); font-size: .8rem; text-align: right; }
.histogram-columns { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(8px, 2vw, 26px); background: repeating-linear-gradient(to top, transparent 0, transparent 54px, #e7eee9 54px, #e7eee9 55px) top / 100% 220px no-repeat; }
.histogram-column { min-width: 0; text-align: center; }
.histogram-track { height: 220px; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--line); }
.histogram-bar { position: relative; width: min(100%, 92px); background: linear-gradient(to top, var(--green), #39a675); border-radius: 6px 6px 0 0; }
.histogram-bar strong { position: absolute; bottom: 100%; left: 0; width: 100%; padding-bottom: 5px; color: var(--ink); font-size: .9rem; }
.histogram-column > span { display: block; padding-top: 12px; color: var(--muted); font-size: clamp(.65rem, 2vw, .9rem); white-space: nowrap; }
.distribution-chart > div { display: grid; grid-template-columns: 90px 1fr 36px; align-items: center; gap: 12px; }
.distribution-chart > div > span { color: var(--muted); font-size: .9rem; }
.members-panel { margin: 20px 0; padding: 16px; border: 1px solid var(--border); border-radius: 16px; }
.members-panel summary { cursor: pointer; font-weight: 800; }
.members-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; }
.members-toolbar p { margin: 0; color: var(--muted); }
.member-form { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 10px; margin: 14px 0; }
.privacy-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.privacy-actions form { padding: 16px; border: 1px solid var(--border); border-radius: 14px; }
.privacy-actions h3 { margin-top: 0; }
.danger-zone { margin-top: 22px; padding: 18px; border: 1px solid #efb4b4; border-radius: 14px; background: #fff8f8; }
.two-factor-box { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.two-factor-box code { overflow-wrap: anywhere; word-break: break-all; }
.totp-secret { display: inline-block; padding: 10px 14px; border-radius: 10px; background: var(--surface-soft); font-size: 1.05rem; letter-spacing: .12em; overflow-wrap: anywhere; }
.inline-security-form { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.report-box { margin: 20px clamp(20px, 4vw, 70px) 50px; padding: 14px 18px; border: 1px solid var(--border); border-radius: 14px; }
.report-box summary { cursor: pointer; color: var(--muted); font-weight: 700; }
.report-box form { display: grid; gap: 12px; max-width: 720px; margin-top: 14px; }
.admin-shell { margin: 34px clamp(20px, 4vw, 70px) 80px; }
.admin-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.storage-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.storage-grid > div { display: grid; gap: 5px; padding: 16px; border-radius: 14px; background: var(--surface-soft); }
.storage-grid span { color: var(--muted); }
.storage-grid strong { font-size: 1.35rem; }
.admin-list, .error-list { display: grid; gap: 10px; }
.admin-list article { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 15px; border: 1px solid var(--border); border-radius: 13px; }
.admin-list p { margin: 5px 0; }
.admin-list small, .error-list small { color: var(--muted); }
.error-list article { display: grid; gap: 5px; padding: 13px 15px; border-left: 4px solid #cf3d3d; background: #fff8f8; border-radius: 8px; }
.error-list code { overflow-wrap: anywhere; }
.error-list pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-weight: 700; }
.error-source { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: .75rem; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.error-source.is-client { color: #704800; background: #fff0c2; }
.error-source.is-server { color: #8c2020; background: #ffe0e0; }
@media (max-width: 700px) { .question-options-row { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .member-form { grid-template-columns: 1fr; } .members-toolbar { align-items: stretch; flex-direction: column; } }
@media (max-width: 900px) { .privacy-actions { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .admin-summary, .storage-grid { grid-template-columns: 1fr 1fr; } .admin-list article { align-items: flex-start; flex-direction: column; } }
@media (max-width: 560px) { .admin-summary, .storage-grid { grid-template-columns: 1fr; } }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--page-background);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body::selection { background: var(--lime); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; line-height: 1.12; letter-spacing: -.035em; }
p { margin: 0; }

.site-header {
  width: auto;
  height: 82px;
  margin: 0 clamp(20px, 4vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 10;
}
.site-header nav { display: flex; align-items: center; gap: 28px; font-weight: 600; }
.site-header nav > a:not(.button):hover { color: var(--green); }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 800 21px/1 system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: -.04em; }
.brand-logo { display: block; width: 195px; height: auto; flex: 0 0 auto; }
.brand-symbol { display: block; width: 76px; height: 76px; object-fit: contain; flex: 0 0 auto; }
@media (max-width: 560px) { .brand-symbol { width: 60px; height: 60px; } }
@media (max-width: 560px) { .brand-logo { width: 150px; } }
.brand-mark {
  width: 34px; height: 34px; display: block; flex: 0 0 auto;
}
.lang-switch { padding-left: 22px; border-left: 1px solid var(--line); font-size: 12px; letter-spacing: .12em; }
.inline-form { display: inline; margin: 0; }
.account-menu { position: relative; }
.account-trigger { padding: 5px 8px 5px 5px; display: flex; align-items: center; gap: 8px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; font-weight: 700; }
.account-avatar { width: 31px; height: 31px; display: grid; place-items: center; color: white; background: var(--green); border-radius: 8px; font: 800 13px system-ui, -apple-system, "Segoe UI", sans-serif; }
.account-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-dropdown { width: 245px; position: absolute; z-index: 50; top: calc(100% + 9px); right: 0; padding: 8px; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.account-summary { padding: 9px 10px 12px; display: flex; flex-direction: column; border-bottom: 1px solid var(--line); }
.account-summary small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; }
.account-dropdown > a, .account-dropdown form button { width: 100%; padding: 10px; display: block; color: #34443e; background: none; border: 0; border-radius: 7px; text-align: left; cursor: pointer; font-weight: 600; }
.account-dropdown > a:hover, .account-dropdown form button:hover { background: var(--soft); }
.account-dropdown form button:hover { color: var(--danger); }

.button {
  border: 1px solid var(--green);
  padding: 12px 20px;
  display: inline-flex; justify-content: center; align-items: center; gap: 12px;
  color: #fff; background: var(--green); border-radius: 10px;
  font-weight: 700; cursor: pointer; box-shadow: 0 8px 20px rgba(20,107,75,.14);
  transition: transform .18s, background .18s, box-shadow .18s;
}
.button:hover { background: var(--green-dark); transform: translateY(-1px); box-shadow: 0 10px 26px rgba(20,107,75,.2); }
.button-small { padding: 8px 14px; border-radius: 8px; font-size: 14px; }
.button-large { padding: 15px 24px; }
.button-wide { width: 100%; margin-top: 5px; }
.button-secondary { color: var(--green); border-color: #bfd1c8; background: #fff; box-shadow: none; }
.button-secondary:hover { color: #fff; border-color: var(--green-dark); }
.button-light { color: var(--green-dark); background: #fff; border-color: #fff; }
.button-light:hover { background: var(--lime); border-color: var(--lime); color: var(--green-dark); }

.hero {
  min-height: 660px;
  padding: 72px clamp(20px, 4vw, 72px) 90px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 70px; align-items: center;
  background:
    radial-gradient(circle at 92% 15%, rgba(212,237,117,.3), transparent 26%),
    linear-gradient(180deg, #fbfcfa 0%, var(--cream) 100%);
  overflow: hidden;
}
.eyebrow { display: inline-block; color: var(--green); font-weight: 800; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.hero h1 { margin: 18px 0 24px; font-size: clamp(48px, 5vw, 70px); }
.hero h1 em { color: var(--green); font-style: normal; position: relative; }
.hero h1 em::after { content: ""; position: absolute; height: 8px; left: 3px; right: 4px; bottom: -7px; background: var(--lime); border-radius: 50%; transform: rotate(-1deg); }
.lead { color: var(--muted); font-size: 18px; line-height: 1.65; }
.hero-copy .lead { max-width: 580px; }
.hero-actions { display: flex; align-items: center; gap: 25px; margin: 34px 0 28px; }
.text-link { color: var(--green); font-weight: 700; border-bottom: 1px solid var(--green); }
.trust-row { display: flex; flex-wrap: wrap; gap: 15px 24px; color: var(--muted); font-size: 13px; }
.trust-row span::first-letter { color: var(--green); }

.hero-demo { position: relative; padding: 25px 20px; }
.hero-demo::before {
  content: ""; position: absolute; inset: -15% -20%; z-index: 0;
  background: radial-gradient(circle, rgba(20,107,75,.15), transparent 62%);
}
.demo-window {
  position: relative; z-index: 1; overflow: hidden; background: white; border: 1px solid rgba(20,107,75,.12);
  border-radius: 22px; box-shadow: 0 35px 80px rgba(24,77,58,.2); transform: rotate(1deg);
}
.demo-top { height: 57px; padding: 0 18px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 1px solid var(--line); font-size: 13px; }
.demo-top > span:first-child { display: flex; gap: 5px; }
.demo-top i { width: 7px; height: 7px; display: block; background: #cfd7d2; border-radius: 50%; }
.demo-timer { justify-self: end; padding: 5px 9px; color: var(--green); background: var(--green-light); border-radius: 20px; font: 700 12px monospace; }
.demo-progress { height: 4px; background: #e8eee9; }
.demo-progress span { width: 30%; height: 100%; display: block; background: var(--green); }
.demo-body { padding: 34px 42px 38px; }
.demo-body small { color: var(--green); font-weight: 700; }
.demo-body h2 { margin: 12px 0 28px; font-size: 25px; }
.demo-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.demo-answers span { padding: 13px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-weight: 600; }
.demo-answers .selected { color: var(--green); background: #e8f5ed; border-color: var(--green); }
.demo-answers b { float: right; }
.demo-body button { float: right; margin-top: 22px; padding: 10px 15px; color: white; border: 0; border-radius: 8px; background: var(--green); font-weight: 700; }
.demo-body::after { content: ""; display: block; clear: both; }
.floating-card {
  position: absolute; z-index: 2; padding: 14px 18px; display: flex; flex-direction: column;
  background: white; border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow);
}
.floating-card b { color: var(--green); font: 800 22px system-ui, -apple-system, "Segoe UI", sans-serif; }
.floating-card small { color: var(--muted); }
.floating-one { right: -30px; top: 12%; transform: rotate(4deg); }
.floating-two { left: -35px; bottom: 6%; transform: rotate(-4deg); }

.features { padding: 110px clamp(20px, 4vw, 72px); background: #fff; }
.section-intro { display: grid; grid-template-columns: 1.2fr 1fr; gap: 25px; align-items: end; margin-bottom: 55px; }
.section-intro .eyebrow { grid-column: 1 / -1; }
.section-intro h2 { font-size: clamp(36px, 4vw, 52px); }
.section-intro p { justify-self: end; max-width: 360px; color: var(--muted); font-size: 17px; }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.feature-grid article { min-height: 260px; padding: 32px; border-right: 1px solid var(--line); transition: background .2s, transform .2s; }
.feature-grid article:last-child { border: 0; }
.feature-grid article:hover { background: var(--soft); }
.feature-icon { width: 42px; height: 42px; margin-bottom: 55px; display: grid; place-items: center; color: var(--green); background: var(--green-light); border-radius: 12px; font-size: 20px; }
.feature-grid h3 { margin-bottom: 12px; font-size: 20px; }
.feature-grid p { color: var(--muted); }
.cta-band { width: auto; margin: 20px clamp(20px, 4vw, 72px) 80px; padding: 55px 65px; display: flex; align-items: center; justify-content: space-between; color: white; background: var(--green); border-radius: 24px; }
.cta-band .eyebrow { color: var(--lime); }
.cta-band h2 { margin-top: 10px; font-size: 40px; }

footer { min-height: 150px; padding: 45px clamp(20px, 4vw, 72px); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px 35px; color: var(--muted); border-top: 1px solid var(--line); }
.brand-muted { color: var(--ink); }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.footer-links a { font-weight: 700; font-size: 13px; }
.footer-links a:hover { color: var(--green); }
.flash-stack { width: min(420px, calc(100% - 32px)); position: fixed; z-index: 100; bottom: 20px; right: 16px; display: grid; gap: 8px; pointer-events: none; }
.flash { padding: 12px 14px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 700; display: flex; align-items: flex-start; gap: 10px; pointer-events: auto; animation: flash-in .2s ease-out; }
.flash-message { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.flash-close { flex: 0 0 auto; width: 28px; height: 28px; padding: 0; border: 0; background: transparent; color: inherit; font-size: 22px; line-height: 1; cursor: pointer; border-radius: 6px; }
.flash-close:hover { background: rgb(0 0 0 / 6%); }
.flash-close:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.flash-success { color: #0a5439; background: #def4e8; border: 1px solid #b7e0ca; }
.flash-error { color: #8c2929; background: #fde8e7; border: 1px solid #f3c3c0; }
@keyframes flash-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .flash { animation: none; } }

/* Authentication */
.auth-page { background: var(--cream); }
.auth-layout, .join-layout { width: auto; min-height: 650px; margin: 25px clamp(20px, 4vw, 72px) 80px; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: clamp(35px, 6vw, 110px); align-items: center; }
.auth-side { padding: 40px; }
.auth-side h1, .join-copy h1 { margin: 18px 0 24px; font-size: clamp(42px, 5vw, 64px); }
.auth-side > p { color: var(--muted); font-size: 18px; }
.mini-testimonial { margin-top: 55px; padding: 20px 25px; color: var(--green-dark); background: rgba(255,255,255,.65); border-left: 4px solid var(--lime); border-radius: 0 12px 12px 0; font-weight: 600; }
.auth-card { padding: 38px; display: grid; gap: 20px; background: white; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.auth-card h2 { margin-bottom: 8px; font-size: 28px; }
label { display: grid; gap: 7px; font-weight: 700; color: #34443e; }
input, textarea, select { width: 100%; border: 1px solid #ccd8d1; padding: 12px 14px; color: var(--ink); background: #fff; border-radius: 9px; outline: none; transition: border .15s, box-shadow .15s; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(20,107,75,.1); }
.form-note { color: var(--muted); text-align: center; font-size: 13px; }
.form-note a { color: var(--green); font-weight: 700; }
.login-options { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 15px; font-size: 12px; }
.login-options .check-row { display: flex; gap: 7px; }
.login-options a { color: var(--green); font-weight: 700; white-space: nowrap; }
.legal-consent { padding-top: 12px; border-top: 1px solid var(--line); line-height: 1.5; }

/* Legal pages */
.legal-page { background: var(--soft); }
.legal-shell { margin: 35px clamp(20px, 4vw, 72px) 100px; }
.legal-hero { padding: 55px clamp(24px, 5vw, 80px); color: white; background: var(--green); border-radius: 22px; }
.legal-hero .eyebrow { color: var(--lime); }
.legal-hero h1 { margin: 12px 0 16px; max-width: 950px; font-size: clamp(38px, 5vw, 62px); }
.legal-hero p { max-width: 780px; margin-bottom: 25px; color: #dcebe4; font-size: 18px; }
.legal-hero > span:last-child { color: #bcd7ca; font-size: 12px; }
.legal-layout { margin-top: 24px; display: grid; grid-template-columns: minmax(240px, .25fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.legal-summary { padding: 24px; position: sticky; top: 20px; display: grid; gap: 12px; color: var(--green-dark); background: var(--green-light); border: 1px solid #bfddce; border-radius: 15px; }
.legal-summary strong { font: 800 18px system-ui, -apple-system, "Segoe UI", sans-serif; }
.legal-summary p { color: #466559; }
.legal-summary a { color: var(--green); font-weight: 800; overflow-wrap: anywhere; }
.legal-content { padding: 38px clamp(24px, 4vw, 60px); background: white; border: 1px solid var(--line); border-radius: 16px; }
.legal-content section { padding: 0 0 30px; margin-bottom: 30px; border-bottom: 1px solid var(--line); }
.legal-content section:last-child { padding: 0; margin: 0; border: 0; }
.legal-content h2 { margin-bottom: 13px; font-size: 23px; }
.legal-content p { margin: 0 0 12px; color: #4e5d58; font-size: 16px; line-height: 1.75; }
.legal-content p:last-child { margin-bottom: 0; }
.legal-content a { color: var(--green); font-weight: 700; text-decoration: underline; text-decoration-color: #9bc4b1; text-underline-offset: 3px; }
.legal-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 11px; }
.legal-table { width: 100%; border-collapse: collapse; min-width: 780px; }
.legal-table th, .legal-table td { padding: 14px 16px; vertical-align: top; text-align: left; border-bottom: 1px solid var(--line); }
.legal-table th { color: var(--green-dark); background: var(--soft); font-size: 12px; }
.legal-table td { color: #52615b; }
.legal-table tr:last-child td { border-bottom: 0; }

/* Dashboard */
.dashboard-shell { width: auto; min-height: 600px; margin: 55px clamp(20px, 4vw, 72px) 100px; }
.quiz-presentation { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
.quiz-presentation .site-header, .quiz-presentation footer { display: none; }
.quiz-presentation main { flex: 1; min-height: 0; }
.present-shell { width: 100%; max-width: 1200px; height: 100%; margin: 0 auto; padding: clamp(8px, 2vh, 24px) clamp(12px, 3vw, 36px); display: grid; grid-template-rows: auto auto auto minmax(0, 1fr) auto; gap: clamp(4px, 1.2vh, 14px); text-align: center; }
.present-back { display: block; justify-self: start; font-size: 14px; }
.present-shell h1 { margin: 0; font-size: clamp(20px, 4vh, 44px); line-height: 1.15; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.present-instruction { margin: 0; font-size: clamp(12px, 2vh, 18px); }
.present-qr { min-height: 0; min-width: 0; }
.present-qr canvas { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.present-qr canvas[hidden] { display: none; }
.present-url { display: block; max-height: 3.6em; overflow: auto; font-size: clamp(14px, 2.8vh, 26px); line-height: 1.2; font-weight: 700; color: var(--green-dark); overflow-wrap: anywhere; }
.page-heading { margin-bottom: 40px; display: flex; align-items: end; justify-content: space-between; }
.page-heading h1 { margin: 8px 0; font-size: 42px; }
.page-heading p { color: var(--muted); font-size: 17px; }
.quiz-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.quiz-table-wrap { max-width: 100%; background: white; border: 1px solid var(--line); border-radius: 12px; }
.quiz-table { width: 100%; min-width: 600px; border-collapse: collapse; text-align: left; }
.quiz-table thead th { padding: 11px 14px; color: var(--muted); background: var(--soft); font-size: 12px; white-space: nowrap; }
.quiz-table tbody th, .quiz-table td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: middle; font-size: 13px; }
.quiz-table-title { width: 100%; min-width: 180px; max-width: 420px; overflow-wrap: anywhere; }
.quiz-table-title a { color: var(--ink); }
.quiz-table-title a:hover { color: var(--green); text-decoration: underline; }
.quiz-table td { white-space: nowrap; }
.dashboard-table thead th:not(:first-child), .dashboard-table td { text-align: center; }
.dashboard-table td .inline-form, .instance-table td > form { display: flex; justify-content: center; }
.dashboard-table dialog { text-align: left; }
.dashboard-table .status-toggle { flex-direction: column; gap: 3px; }
.scheduled-opening { font-size: 10px; font-weight: 600; white-space: nowrap; }
.instance-title-button { padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.instance-title-button:hover { color: var(--green); text-decoration: underline; }
.instance-metadata { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.6; font-weight: 400; white-space: normal; }
.quiz-menu-trigger { padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: white; cursor: pointer; font-size: 16px; letter-spacing: 2px; }
.quiz-menu-trigger:hover { color: var(--green); background: var(--soft); }
.quiz-menu-trigger:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.quiz-actions-menu { position: fixed; inset: auto; margin: 0; width: 170px; padding: 6px; background: white; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.quiz-actions-menu form { margin: 0; }
.quiz-actions-menu > a, .quiz-actions-menu > button, .quiz-actions-menu form button { display: block; width: 100%; margin: 0; padding: 9px 12px; border: 0; border-radius: 5px; background: none; color: var(--ink); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.quiz-actions-menu > a:hover, .quiz-actions-menu > button:hover, .quiz-actions-menu form button:hover { background: var(--soft); }
.quiz-actions-menu > .danger-link, .quiz-actions-menu form .danger-link { color: var(--danger); }
.quiz-tile { min-height: 310px; padding: 25px; display: flex; flex-direction: column; background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 7px 22px rgba(27,62,49,.05); transition: transform .2s, box-shadow .2s; }
.quiz-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.tile-top { display: flex; justify-content: space-between; align-items: center; }
.status { display: inline-flex; padding: 5px 10px; border-radius: 20px; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.status-open { color: #08754e; background: #dff4e9; }
.status-draft { color: #68716e; background: #edf0ee; }
.status-scheduled { color: #775b00; background: #fff2c8; }
.status-closed { color: #9a3a36; background: #fde5e3; }
.status-toggle { border: 0; font-family: inherit; cursor: pointer; }
.status-toggle:hover { box-shadow: 0 0 0 2px currentColor; }
.status-toggle:focus-visible { outline: 2px solid var(--green-dark); outline-offset: 3px; }
.icon-button { color: var(--muted); border: 0; background: none; cursor: pointer; }
.quiz-tile h2 { margin: 22px 0 9px; font-size: 23px; }
.quiz-tile > p { min-height: 45px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-stats { margin: 24px 0; padding: 15px 0; display: grid; grid-template-columns: repeat(3, 1fr); color: var(--muted); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 11px; }
.tile-stats span { display: flex; flex-direction: column; }
.tile-stats strong { color: var(--ink); font-size: 17px; }
.tile-actions { margin-top: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.danger-link { margin-left: auto; padding: 5px; color: var(--danger); border: 0; background: none; cursor: pointer; font-weight: 600; font-size: 13px; }
.empty-state { max-width: 650px; margin: 80px auto; padding: 60px; text-align: center; background: white; border: 1px dashed #b9c9c0; border-radius: 20px; }
.empty-state h1, .empty-state h2 { margin-bottom: 12px; font-size: 30px; }
.empty-state p { margin-bottom: 25px; color: var(--muted); }
.empty-icon { width: 55px; height: 55px; margin: 0 auto 20px; display: grid; place-items: center; color: var(--green); background: var(--green-light); border-radius: 50%; font: 800 27px system-ui, -apple-system, "Segoe UI", sans-serif; }

/* Account */
.account-shell { margin: 55px clamp(20px, 4vw, 72px) 100px; }
.account-layout { display: grid; grid-template-columns: minmax(210px, .22fr) minmax(0, 1fr); gap: 25px; align-items: start; }
.account-layout > *, .account-content, .account-panel, .account-panel-heading > * { min-width: 0; }
.account-nav { padding: 10px; position: sticky; top: 20px; display: grid; background: white; border: 1px solid var(--line); border-radius: 14px; }
.account-nav a { padding: 11px 13px; color: var(--muted); border-radius: 8px; font-weight: 700; }
.account-nav a:hover, .account-nav a.is-active { color: var(--green); background: var(--soft); }
.account-nav a:last-child { margin-top: 10px; padding-top: 15px; border-top: 1px solid var(--line); }
.account-content { display: grid; gap: 22px; }
.account-panel { padding: 30px; background: white; border: 1px solid var(--line); border-radius: 16px; scroll-margin-top: 25px; }
.account-panel-heading { margin-bottom: 25px; display: grid; grid-template-columns: 42px 1fr; gap: 14px; align-items: center; }
.account-panel-heading h2 { margin-bottom: 4px; font-size: 22px; }
.account-panel-heading p { color: var(--muted); }
.settings-icon { width: 42px; height: 42px; display: grid; place-items: center; color: var(--green); background: var(--green-light); border-radius: 11px; font: 800 16px system-ui, -apple-system, "Segoe UI", sans-serif; }
.account-form { display: grid; gap: 18px; }
.account-form > label { max-width: 720px; }
.form-columns { max-width: 900px; display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.check-row { grid-template-columns: 20px 1fr; align-items: center; font-weight: 500; }
.check-row input { width: 18px; height: 18px; accent-color: var(--green); }
.devices-heading { grid-template-columns: 42px 1fr auto; }
.devices-list { display: grid; gap: 10px; }
.device-card { padding: 17px; display: grid; grid-template-columns: 45px 1fr auto; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 11px; }
.device-card.is-revoked { opacity: .58; background: #fafbfa; }
.device-icon { width: 44px; height: 44px; display: grid; place-items: center; color: var(--green); background: var(--soft); border-radius: 10px; font-size: 20px; }
.device-info div { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.device-info p { margin: 3px 0; color: var(--muted); font-size: 13px; }
.device-info small { color: #8b9892; }
.current-device, .revoked-device { padding: 3px 7px; color: var(--green); background: var(--green-light); border-radius: 20px; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.revoked-device { color: #6b7470; background: #e8ecea; }
.danger-outline { padding: 8px 11px; color: var(--danger); background: white; border: 1px solid #e7b5b2; border-radius: 8px; cursor: pointer; font-weight: 700; font-size: 12px; }
.danger-outline:hover { color: white; background: var(--danger); }
.security-note { margin-top: 18px; padding: 12px 15px; color: #705d14; background: #fff6d7; border-radius: 8px; font-size: 12px; }

/* Groups */
.groups-layout { display: grid; grid-template-columns: minmax(270px, .32fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.groups-list { display: grid; gap: 10px; }
.group-card { padding: 17px; display: grid; grid-template-columns: 43px 1fr auto; gap: 13px; align-items: center; background: white; border: 1px solid var(--line); border-radius: 12px; transition: .18s; }
.group-card:hover, .group-card.is-active { border-color: #87ae9d; box-shadow: 0 8px 20px rgba(22,55,43,.08); }
.group-card.is-active { background: #f0f8f4; }
.group-avatar { width: 43px; height: 43px; display: grid; place-items: center; color: white; background: var(--green); border-radius: 12px; font: 800 17px system-ui, -apple-system, "Segoe UI", sans-serif; }
.group-info { min-width: 0; display: flex; flex-direction: column; }
.group-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-info small { color: var(--muted); }
.group-detail { min-height: 460px; padding: 30px; background: white; border: 1px solid var(--line); border-radius: 16px; }
.group-detail-head { display: flex; justify-content: space-between; gap: 20px; }
.group-detail-head h2 { margin: 7px 0; font-size: 30px; }
.group-detail-head p { color: var(--muted); }
.instance-quiz-settings { padding: 15px; border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 14px; }
.instance-quiz-settings legend { padding: 0 6px; font-weight: 700; }
.instance-quiz-settings .settings-options { grid-template-columns: minmax(0, 1fr); }
.groups-table { min-width: 900px; }
.group-expand { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.group-expand[aria-expanded="true"] .group-expand-arrow { transform: rotate(90deg); }
.group-expand-arrow { display: inline-block; transition: transform .15s; }
.groups-table > tbody > .group-quiz-row > td { text-align: left; white-space: normal; padding: 0; }
.group-quiz-row[hidden] { display: none; }
.group-quiz-row .group-quizzes { margin: 0; border: 0; border-radius: 0; background: var(--soft); }
.group-quiz-row .group-quizzes > h3 { display: inline-block; margin-right: 16px; }
.groups-table > thead > tr > th:not(:first-child), .groups-table > tbody > tr > td { text-align: center; }
.group-table-title { min-width: 160px; max-width: 260px; overflow-wrap: anywhere; }
.group-table-description { display: block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.group-profile-fields { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(180px, 1fr) minmax(220px, 2fr); gap: 16px; }
@media (max-width: 560px) { .group-profile-fields { grid-template-columns: 1fr; } }
.group-access-form { margin: 24px 0 12px; padding: 18px 20px; display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 16px; background: #f7faf8; border: 1px solid var(--line); border-radius: 12px; }
.group-access-form h3 { margin: 4px 0; }
.group-access-form p { color: var(--muted); }
.group-access-form .access-warning { grid-column: 1 / -1; padding: 10px 12px; color: #805315; background: #fff4d8; border-radius: 8px; font-weight: 650; }
.assignment-form { margin: 24px 0; padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; align-items: end; background: var(--soft); border-radius: 12px; }
.assignment-form label { font-size: 12px; }
.assignment-form .form-note { grid-column: 1 / -1; text-align: left; }
@media (max-width: 560px) { .assignment-form { grid-template-columns: minmax(0, 1fr); } }
.button:disabled { opacity: .45; pointer-events: none; }
.instance-list > h3 { margin-bottom: 15px; font: 700 18px system-ui, -apple-system, "Segoe UI", sans-serif; }
.instance-card { margin-top: 10px; padding: 18px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px; border: 1px solid var(--line); border-radius: 11px; }
.instance-card h4 { margin: 8px 0 3px; font: 700 17px system-ui, -apple-system, "Segoe UI", sans-serif; }
.instance-card p { color: var(--muted); font-size: 12px; }
.instance-dates { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 12px 30px; }
.instance-dates span { min-width: 170px; display: flex; flex-direction: column; }
.instance-dates small { color: var(--muted); font-size: 10px; letter-spacing: .07em; text-transform: uppercase; }
.instance-dates strong { font-size: 13px; }
.instance-actions { max-width: 520px; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.compact-empty { padding: 55px 25px; text-align: center; }
.compact-empty h2 { margin: 12px 0 8px; }
.compact-empty p { color: var(--muted); }
.compact-empty .feature-icon { margin: 0 auto; }
.modal { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; overflow-y: auto; border: 0; border-radius: 20px; box-shadow: 0 30px 80px rgba(17,44,34,.3); }
.modal::backdrop { background: rgba(16,36,29,.55); backdrop-filter: blur(3px); }
.modal form { padding: 30px; display: grid; gap: 18px; }
.modal { white-space: normal; overflow-wrap: anywhere; text-align: left; }
.modal form > * { min-width: 0; }
.modal .header-actions { flex-wrap: wrap; }
.confirmation-modal button[type="submit"] { background: var(--danger); }
.modal-head { display: flex; align-items: start; justify-content: space-between; }
.modal-head h2 { margin-top: 6px; }
.modal-head button { color: var(--muted); background: none; border: 0; font-size: 28px; cursor: pointer; }
.instance-modal { width: min(780px, calc(100vw - 32px)); }
.instance-modal form { padding: 36px 40px; gap: 22px; }
.instance-modal .modal-head { margin-bottom: 2px; }
.instance-modal .form-columns { max-width: none; gap: 18px; }
.qr-modal { width: min(700px, calc(100vw - 32px)); }
.qr-dialog-content { padding: 36px 42px; display: grid; gap: 20px; }
.qr-dialog-content > p { color: var(--muted); }
.qr-canvas-wrap { padding: 14px; display: grid; place-items: center; background: var(--soft); border-radius: 14px; }
.qr-canvas-wrap canvas { width: min(100%, 460px); height: auto; display: block; background: white; image-rendering: pixelated; box-shadow: 0 8px 28px rgba(22,55,43,.12); }
.qr-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qr-feedback { min-height: 20px; color: var(--green) !important; text-align: center; font-weight: 700; font-size: 13px; }
.group-badge { margin-left: 8px; padding: 5px 10px; display: inline-flex; color: var(--green); background: var(--green-light); border-radius: 20px; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.field-note { color: var(--muted); font-weight: 400; font-size: 11px; }

/* Group analytics */
.analytics-shell { margin: 45px clamp(20px, 4vw, 72px) 100px; }
.analytics-heading { margin-bottom: 30px; display: flex; align-items: end; justify-content: space-between; gap: 25px; }
.analytics-heading .back-link { margin-bottom: 22px; display: block; }
.analytics-heading h1 { margin: 8px 0; font-size: clamp(34px, 4vw, 52px); }
.analytics-heading p { color: var(--muted); }
.analytics-summary { margin-bottom: 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.analytics-summary article { padding: 24px; display: flex; flex-direction: column; background: white; border: 1px solid var(--line); border-radius: 14px; }
.analytics-summary span { color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.analytics-summary strong { margin: 9px 0 2px; color: var(--green); font: 800 32px system-ui, -apple-system, "Segoe UI", sans-serif; }
.analytics-summary small { color: var(--muted); }
.analytics-panel { margin-bottom: 22px; padding: 28px; background: white; border: 1px solid var(--line); border-radius: 16px; }
.analytics-panel-head { margin-bottom: 25px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.analytics-panel-head h2 { margin-top: 6px; font-size: 25px; }
.question-chart { display: grid; gap: 4px; }
.chart-row { padding: 14px 0; display: grid; grid-template-columns: minmax(260px, .8fr) minmax(320px, 1.2fr); gap: 30px; align-items: center; border-bottom: 1px solid #edf1ef; }
.chart-row:last-child { border-bottom: 0; }
.chart-label { min-width: 0; display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; }
.chart-label > span { width: 26px; height: 26px; display: grid; place-items: center; color: var(--green); background: var(--green-light); border-radius: 7px; font-size: 11px; font-weight: 800; }
.chart-label strong { padding-top: 2px; font-size: 14px; }
.chart-value { display: grid; grid-template-columns: minmax(120px, 1fr) 48px 42px; gap: 10px; align-items: center; }
.chart-track { height: 12px; overflow: hidden; background: #e7eee9; border-radius: 10px; }
.chart-track span { height: 100%; display: block; background: linear-gradient(90deg, var(--green), #39a675); border-radius: 10px; }
.chart-value > strong { color: var(--green); text-align: right; }
.chart-value > small { color: var(--muted); text-align: right; }
.analytics-empty { padding: 45px 20px; color: var(--muted); text-align: center; background: var(--soft); border-radius: 12px; }
.analytics-empty h3 { margin-bottom: 7px; color: var(--ink); font: 700 20px system-ui, -apple-system, "Segoe UI", sans-serif; }
.table-scroll { overflow-x: auto; }
.results-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.results-table th { padding: 11px 14px; color: var(--muted); background: var(--soft); text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.results-table th:first-child { border-radius: 8px 0 0 8px; }
.results-table th:last-child { border-radius: 0 8px 8px 0; }
.results-table td { padding: 15px 14px; vertical-align: middle; border-bottom: 1px solid var(--line); }
.results-table tbody tr:last-child td { border-bottom: 0; }
.participant-results-table td:first-child { display: flex; align-items: center; gap: 10px; }
.admin-user-identity { display: grid; gap: 2px; }
.admin-user-identity small { color: var(--muted); font-size: 12px; }
.participant-avatar { width: 34px; height: 34px; display: grid; place-items: center; color: white; background: var(--green); border-radius: 9px; font: 800 12px system-ui, -apple-system, "Segoe UI", sans-serif; }
.score-pill { padding: 5px 9px; border-radius: 20px; font-weight: 800; font-size: 12px; }
.score-good { color: #08754e; background: #dff4e9; }
.score-low { color: #9a3a36; background: #fde5e3; }

/* White panels stand out against the page background. */
.quiz-table-wrap, .account-panel, .group-detail, .analytics-summary article,
.analytics-panel, .panel, .settings-sticky, .question-card {
  box-shadow: var(--panel-shadow);
}

/* Editor */
.editor-page { background: var(--page-background); }
.editor-page footer { display: none; }
.editor-shell { width: auto; margin: 20px clamp(20px, 3vw, 56px) 70px; }
.editor-header { margin-bottom: 28px; display: flex; justify-content: space-between; align-items: end; }
.editor-header h1 { margin-top: 9px; font-size: 34px; }
.back-link { color: var(--green); font-weight: 700; font-size: 13px; }
.editor-save { display: flex; gap: 10px; }
.autosave-status { align-self: center; color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
.panel, .settings-sticky { padding: 30px; background: white; border: 1px solid var(--line); border-radius: 16px; }
.panel { margin-bottom: 22px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px 0; }
.section-title { margin-bottom: 8px; }
.section-title h2 { font-size: 23px; }
.section-title p { color: var(--muted); font-size: 13px; }
.field-wide, .questions-panel > [data-question-list], .questions-panel > .add-question { grid-column: 1; }
.settings-panel { margin-bottom: 22px; }
.settings-sticky { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 17px 24px; }
.settings-sticky > .section-title { grid-column: 1 / -1; }
.settings-options { grid-column: 1 / -1 !important; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.settings-options .toggle-row { min-height: 56px; margin: 0; padding: 13px 16px; display: grid; grid-template-columns: minmax(0, 1fr) 42px; gap: 16px; align-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--soft); cursor: pointer; }
.settings-options .toggle-row > span:first-child { line-height: 1.35; }
.settings-options .toggle-row .toggle { justify-self: end; }
.settings-options .toggle-row:has(input:checked) { background: #edf8f1; border-color: #9ecab3; }
.settings-options .toggle-row:has(input:focus-visible) { outline: 2px solid var(--green); outline-offset: 2px; }
.settings-sticky .setting-field, .settings-sticky .segmented-field { padding: 16px; border: 1px solid var(--line); border-radius: 9px; }
.settings-sticky .setting-penalty { grid-column: 1 / -1 !important; }
.setting-penalty input { max-width: 180px; }
@media (max-width: 560px) { .settings-options { grid-template-columns: minmax(0, 1fr); } }
.help { width: 16px; height: 16px; display: inline-grid; place-items: center; color: #fff; background: #98aaa1; border-radius: 50%; font-size: 10px; cursor: help; }
.segmented-field { margin: 0; padding: 0; border: 0; }
.segmented-field legend { margin-bottom: 7px; font-weight: 700; color: #34443e; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: var(--soft); border-radius: 9px; }
.segmented label { display: block; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.segmented span { padding: 8px 6px; display: block; text-align: center; border-radius: 7px; font-size: 12px; cursor: pointer; }
.segmented input:checked + span { color: var(--green); background: white; box-shadow: 0 2px 8px rgba(24,55,43,.1); }
.toggle-row { min-height: 31px; grid-template-columns: 1fr auto; align-items: center; }
.toggle-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle { width: 42px; height: 23px; padding: 3px; background: #c9d2cd; border-radius: 20px; cursor: pointer; transition: .2s; }
.toggle::before { content: ""; width: 17px; height: 17px; display: block; background: white; border-radius: 50%; box-shadow: 0 1px 3px #567; transition: transform .2s; }
.toggle-row input:checked + .toggle { background: var(--green); }
.toggle-row input:checked + .toggle::before { transform: translateX(19px); }
.editor-question { margin-bottom: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #f0f5f1; }
.question-head { display: grid; grid-template-columns: 24px minmax(0, 1fr) 72px auto; align-items: center; gap: 10px; }
.question-position { color: var(--muted); font-size: 12px; }
.question-summary-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.question-summary-actions { display: flex; align-items: center; gap: 5px; }
.question-details { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.question-details[hidden], .question-details [hidden] { display: none; }
.question-summary-actions .move-question:disabled { opacity: .35; cursor: default; }
.question-head .points-field { margin: 0; gap: 2px; }
.question-head .points-field input { padding: 5px 7px; }
@media (max-width: 560px) {
  .question-head { grid-template-columns: 20px minmax(0, 1fr) 65px; gap: 6px; }
  .question-summary-actions { grid-column: 2 / -1; justify-content: flex-end; }
}
.drag-handle { color: #a6b2ac; letter-spacing: -3px; }
.move-question { width: 27px; height: 27px; padding: 0; color: var(--green); background: var(--soft); border: 0; border-radius: 6px; cursor: pointer; font-weight: 800; }
.question-row { display: grid; grid-template-columns: 1fr 80px; gap: 10px; align-items: start; }
.points-field { font-size: 11px; }
.points-field input { padding: 10px; }
.editor-answers { margin: 14px 0 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.editor-answer { display: grid; grid-template-columns: 36px 1fr 28px; align-items: center; }
.editor-answer input[type=text] { border-radius: 0; }
.correct-check { height: 100%; display: block; position: relative; }
.correct-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.correct-check span { height: 100%; display: grid; place-items: center; color: #9caaa3; background: #edf1ef; border: 1px solid #ccd8d1; border-right: 0; border-radius: 8px 0 0 8px; cursor: pointer; }
.correct-check input:checked + span { color: white; background: var(--green); border-color: var(--green); }
.editor-answer button { height: 100%; color: #89978f; border: 1px solid #ccd8d1; border-left: 0; border-radius: 0 8px 8px 0; background: white; cursor: pointer; font-size: 19px; }
.add-answer { padding: 3px; color: var(--green); border: 0; background: none; cursor: pointer; font-weight: 700; font-size: 12px; }
.add-question { min-height: 68px; color: var(--green); background: #f5faf7; border: 1px dashed #8eb8a6; border-radius: 11px; cursor: pointer; font-weight: 800; }
.add-question span { margin-right: 7px; font-size: 19px; }

/* Public quiz */
.join-layout { grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); }
.join-copy { padding: 40px 0; }
.quiz-facts { margin: 40px 0 25px; display: flex; gap: 40px; }
.quiz-facts div { display: flex; flex-direction: column; }
.quiz-facts strong { color: var(--green); font: 800 25px system-ui, -apple-system, "Segoe UI", sans-serif; }
.quiz-facts span { color: var(--muted); font-size: 12px; }
.muted { color: var(--muted); }
.notice { padding: 16px; color: #6d5a10; background: #fff5ce; border-radius: 10px; }
.quiz-participant .auth-nav-link { display: none; }
.waiting-confirmation { padding: 16px; display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: center; color: #175e45; background: #e9f7ef; border: 1px solid #b8dfca; border-radius: 11px; }
.waiting-confirmation > span { width: 34px; height: 34px; display: grid; place-items: center; color: white; background: var(--green); border-radius: 50%; font-weight: 900; }
.waiting-confirmation strong { display: block; }
.waiting-confirmation p { margin-top: 3px; color: #47705f; font-size: 13px; }
.waiting-confirmation a { color: var(--green); font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }
.quiz-running { background: var(--soft); }
.quiz-running .site-header, .quiz-running footer { display: none; }
.quiz-shell { width: auto; margin: 45px clamp(20px, 6vw, 110px) 90px; }
.preview-notice { margin-bottom: 22px; padding: 12px 16px; display: flex; align-items: center; gap: 14px; color: #5d500e; background: #fff4c9; border: 1px solid #eadb9b; border-radius: 10px; }
.preview-notice strong { color: #433907; }
.preview-notice span { color: #756a32; }
.preview-notice a { margin-left: auto; color: #5d500e; font-weight: 700; }
.quiz-topbar { display: flex; align-items: center; justify-content: space-between; }
.quiz-topbar h1 { margin-top: 6px; font-size: 30px; }
.quiz-topbar-meta { display: flex; align-items: stretch; justify-content: flex-end; gap: 10px; }
.participant-identity { min-width: 180px; max-width: min(330px, 36vw); padding: 10px 15px; display: flex; flex-direction: column; justify-content: center; color: white; background: var(--green); border-radius: 10px; box-shadow: 0 7px 20px rgba(20, 107, 75, .18); }
.participant-identity span { color: #cfe9de; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.participant-identity strong { overflow-wrap: anywhere; font: 800 18px/1.25 system-ui, -apple-system, "Segoe UI", sans-serif; }
.timer { min-width: 125px; padding: 10px 15px; display: flex; flex-direction: column; color: var(--green); background: white; border: 1px solid var(--line); border-radius: 10px; text-align: center; }
.timer span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.timer strong { font: 800 21px monospace; }
.timer-warning { color: var(--danger); background: #fff4f3; border-color: #e9a5a1; box-shadow: 0 8px 24px rgba(173, 52, 46, .12); }
.timer-critical {
  min-width: 190px;
  padding: 14px 24px;
  position: fixed;
  z-index: 100;
  top: 18px;
  left: 50%;
  color: white;
  background: var(--danger);
  border-color: #fff;
  border-radius: 15px;
  box-shadow: 0 14px 42px rgba(133, 26, 22, .42);
  transform: translateX(-50%);
  animation: timer-critical-pulse .8s ease-in-out infinite;
}
.timer-critical span { color: #ffe5e3; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.timer-critical strong { font-size: clamp(34px, 5vw, 48px); line-height: 1; }
@keyframes timer-critical-pulse {
  50% { transform: translateX(-50%) scale(1.06); box-shadow: 0 18px 52px rgba(133, 26, 22, .55); }
}
@media (prefers-reduced-motion: reduce) {
  .timer-critical { animation: none; }
}
.progress-track { height: 5px; margin: 22px 0 30px; overflow: hidden; background: #dce5e0; border-radius: 5px; }
.progress-track span { width: 0; height: 100%; display: block; background: var(--green); border-radius: 5px; transition: width .3s; }
.question-card { margin: 0 0 20px; padding: 35px; background: white; border: 1px solid var(--line); border-radius: 16px; }
.question-card legend { width: 100%; float: left; margin-bottom: 20px; font: 700 24px/1.35 system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: -.02em; }
.question-card legend span { margin-bottom: 10px; display: block; color: var(--green); font: 800 11px system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.question-description { clear: both; margin: 0 0 20px; color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; }
.question-hint { margin: 6px 0 16px; clear: both; color: var(--muted); font-size: 12px; }
.answer-list { display: grid; gap: 10px; clear: both; }
.answer-option { padding: 14px 16px; grid-template-columns: 22px 1fr; align-items: center; color: #3b4944; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 600; transition: .15s; }
.answer-option:hover { border-color: #8cb3a2; background: #f8fbf9; }
.answer-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice-marker { width: 19px; height: 19px; display: grid; place-items: center; border: 2px solid #b7c4bd; border-radius: 50%; }
input[type=checkbox] + .choice-marker { border-radius: 5px; }
.answer-option:has(input:checked) { color: var(--green); border-color: var(--green); background: #ecf7f1; }
.answer-option input:checked + .choice-marker { border: 5px solid var(--green); }
.answer-option input[type=checkbox]:checked + .choice-marker { border-width: 2px; background: var(--green); }
.answer-option input[type=checkbox]:checked + .choice-marker::after { content: "✓"; color: white; font-size: 12px; }
.quiz-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.quiz-actions [data-step-label] { margin: auto; color: var(--muted); font-weight: 700; }

/* Results */
.result-shell { width: auto; margin: 55px clamp(20px, 6vw, 110px) 100px; }
.result-card { padding: 50px; text-align: center; background: white; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.score-ring {
  width: 150px; height: 150px; margin: 28px auto; display: grid; place-content: center; color: var(--green);
  background: radial-gradient(closest-side, white 82%, transparent 83% 99%), conic-gradient(var(--green) calc(var(--score) * 1%), var(--green-light) 0);
  border-radius: 50%; font: 800 40px system-ui, -apple-system, "Segoe UI", sans-serif;
}
.score-ring small { font-size: 16px; }
.result-card h1 { font-size: 34px; }
.result-card .lead { margin: 15px auto 25px; max-width: 560px; }
.result-actions { display: flex; justify-content: center; gap: 10px; }
.correction-list { margin-top: 45px; }
.correction-list > h2 { margin-bottom: 18px; }
.correction-item { margin-bottom: 10px; padding: 20px; display: grid; grid-template-columns: 35px 1fr; gap: 12px; background: white; border: 1px solid var(--line); border-left: 4px solid; border-radius: 10px; }
.correction-item h3 { margin-bottom: 6px; font-size: 16px; }
.correction-item p { color: var(--muted); font-size: 13px; }
.is-correct { border-left-color: var(--green); }
.is-wrong { border-left-color: var(--danger); }
.is-correct .result-icon { color: var(--green); }
.is-wrong .result-icon { color: var(--danger); }
.result-icon { font-size: 24px; font-weight: 800; }

@media (max-width: 980px) {
  .site-header nav { gap: 14px; }
  .hero { grid-template-columns: 1fr; padding-top: 45px; text-align: center; }
  .hero-copy .lead { margin-inline: auto; }
  .hero-actions, .trust-row { justify-content: center; }
  .hero-demo { width: 100%; margin: auto; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .feature-grid article:nth-child(2) { border-right: 0; }
  .feature-grid article { border-bottom: 1px solid var(--line); }
  .auth-layout, .join-layout { grid-template-columns: minmax(0, 1fr) minmax(320px, .75fr); gap: 35px; }
  .quiz-grid { grid-template-columns: 1fr 1fr; }
  .groups-layout { grid-template-columns: minmax(250px, .4fr) minmax(0, 1fr); }
  .assignment-form { grid-template-columns: minmax(0, 1fr) auto; }
  .editor-grid { grid-template-columns: 1fr; }
  .account-layout { grid-template-columns: 1fr; }
  .legal-layout { grid-template-columns: 1fr; }
  .legal-summary { position: static; }
  .account-nav { position: static; grid-template-columns: repeat(4, auto); overflow-x: auto; }
  .account-nav a:last-child { margin: 0; padding-top: 11px; border: 0; }
  .settings-sticky { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 15px; }
  .settings-sticky > * { grid-column: auto; }
  .settings-sticky > .section-title { grid-column: 1 / -1; }
  .chart-row { grid-template-columns: minmax(220px, .8fr) minmax(280px, 1.2fr); gap: 18px; }
}

@media (max-width: 700px) {
  .site-header { width: auto; min-height: 68px; height: auto; margin-inline: 14px; }

  .site-header nav { gap: 10px; }
  .lang-switch { padding-left: 10px; }
  .account-name { display: none; }
  .account-trigger { padding-right: 5px; }
  .hero { padding: 50px 20px 65px; gap: 40px; }
  .hero h1 { font-size: 40px; }
  .hero-actions { flex-direction: column; }
  .trust-row { display: none; }
  .hero-demo { padding: 0; }
  .demo-body { padding: 25px 22px; }
  .demo-answers { grid-template-columns: 1fr; }
  .floating-card { display: none; }
  .features { padding: 75px 20px; }
  .section-intro { grid-template-columns: 1fr; }
  .section-intro p { justify-self: start; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-grid article { min-height: 210px; border-right: 0; }
  .feature-icon { margin-bottom: 32px; }
  .cta-band { width: auto; margin: 20px 15px 60px; padding: 35px 25px; flex-direction: column; align-items: flex-start; gap: 25px; }
  footer { flex-direction: column; gap: 15px; text-align: center; }
  .auth-layout, .join-layout { width: auto; grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 10px 14px 60px; }
  .auth-side, .join-copy { padding: 35px 5px; }
  .auth-side h1, .join-copy h1 { font-size: 39px; }
  .mini-testimonial { display: none; }
  .auth-card { padding: 26px; }
  .quiz-facts { gap: 22px; }
  .dashboard-shell { width: auto; margin: 28px 14px 60px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 22px; }
  .quiz-grid { grid-template-columns: 1fr; }
  .groups-layout { grid-template-columns: 1fr; }
  .group-detail { padding: 20px 15px; }
  .assignment-form { grid-template-columns: 1fr; }
  .group-access-form { grid-template-columns: 1fr; align-items: stretch; }
  .instance-card { grid-template-columns: 1fr; align-items: flex-start; }
  .group-detail-head { align-items: flex-start; flex-direction: column; }
  .instance-actions { width: 100%; flex-wrap: wrap; }
  .editor-shell { width: auto; margin: 10px 10px 70px; }
  .editor-header { align-items: stretch; flex-direction: column; gap: 20px; }
  .editor-save { display: grid; grid-template-columns: 1fr 1fr; }
  .autosave-status { grid-column: 1 / -1; }
  .editor-save .button { padding: 10px 8px; font-size: 12px; }
  .panel, .settings-sticky { padding: 20px 15px; }
  .panel { grid-template-columns: 1fr; }
  .panel > * { grid-column: 1 !important; }
  .settings-sticky { grid-template-columns: 1fr; }
  .settings-sticky > * { grid-column: 1 !important; }
  .editor-answers { grid-template-columns: 1fr; }
  .question-row { grid-template-columns: 1fr 70px; }
  .quiz-shell { margin-top: 10px; }
  .preview-notice { align-items: flex-start; flex-direction: column; }
  .preview-notice a { margin-left: 0; }
  .quiz-topbar { align-items: flex-start; gap: 10px; }
  .quiz-topbar h1 { margin-top: 3px; font-size: 21px; }
  .quiz-topbar { flex-direction: column; }
  .quiz-topbar-meta { width: 100%; justify-content: space-between; }
  .participant-identity { min-width: 0; max-width: none; flex: 1; padding: 7px 11px; }
  .participant-identity strong { font-size: 16px; }
  .quiz-topbar .timer { min-width: 105px; padding: 7px 11px; }
  .quiz-shell .progress-track { margin: 12px 0 16px; }
  .question-card { padding: 24px 19px; }
  .question-card legend { font-size: 20px; }
  .result-card { padding: 35px 22px; }
  .result-card h1 { font-size: 27px; }
  .result-actions { flex-direction: column; }
  .account-shell { margin: 35px 14px 70px; }
  .legal-shell { margin: 20px 14px 70px; }
  .legal-hero { padding: 38px 22px; border-radius: 16px; }
  .legal-content { padding: 26px 18px; }
  .account-nav { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: 100%; }
  .account-nav a { min-width: 0; overflow-wrap: anywhere; }
  .account-panel { padding: 22px 16px; }
  .form-columns { grid-template-columns: 1fr; }
  .devices-heading { grid-template-columns: 42px 1fr; }
  .devices-heading form { grid-column: 1 / -1; }
  .device-card { grid-template-columns: 42px 1fr; align-items: start; }
  .device-card > form { grid-column: 2; }
  .qr-dialog-content { padding: 22px 16px; }
  .instance-modal form { padding: 24px 16px; }
  .qr-actions { grid-template-columns: 1fr; }
  .analytics-shell { margin: 30px 14px 70px; }
  .analytics-heading { align-items: flex-start; flex-direction: column; }
  .analytics-summary { grid-template-columns: 1fr; }
  .analytics-panel { padding: 22px 15px; }
  .chart-row { grid-template-columns: 1fr; gap: 10px; }
  .chart-value { grid-template-columns: minmax(100px, 1fr) 48px 42px; }
}

.participant-fields-editor { width: 100%; min-width: 0; }
.participant-field-row { display: grid; grid-template-columns: minmax(140px, 2fr) minmax(120px, 1fr) auto auto; gap: 12px; align-items: end; padding: 12px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; }
.participant-field-row label { min-width: 0; }
.participant-field-row .participant-required { display: flex; align-items: center; gap: 8px; padding-bottom: 12px; }
.participant-required input { width: auto; margin: 0; }
.participant-details dl { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(100px, 2fr); gap: 4px 12px; margin: 8px 0; }
.participant-details dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
@media (max-width: 640px) {
  .participant-field-row { grid-template-columns: minmax(0, 1fr) auto; }
  .participant-field-row > label:nth-of-type(1), .participant-field-row > label:nth-of-type(2) { grid-column: 1 / -1; }
  .participant-field-row .participant-required { padding-bottom: 0; }
}

.group-access-form .participant-fields-editor { grid-column: 1 / -1; }

.group-access-form > label { min-width: 0; }

.participant-field-row > [data-remove-participant-field] { font-size: 20px; min-width: 32px; min-height: 32px; align-self: center; }

.members-table { min-width: 650px; }
.members-table td { vertical-align: middle; }
.members-table input { width: 100%; min-width: 130px; padding: 9px 10px; font-size: 14px; }
.members-table td:nth-child(1) { width: 30%; }
.members-table td:nth-child(2) { width: 32%; }
.members-table code { font-weight: 700; letter-spacing: .06em; white-space: nowrap; }
.member-row-actions { display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.member-row-actions form { margin: 0; }
.member-paste-panel { margin-top: 20px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.member-paste-panel > summary { cursor: pointer; font-weight: 700; }
.member-paste-panel > p { margin: 12px 0; }
.member-paste-form, .member-mapping-form { display: grid; gap: 12px; margin: 14px 0; }
.member-paste-form textarea { font-family: monospace; white-space: pre; overflow: auto; min-height: 130px; }
.member-paste-form > button, .member-import-confirm > button { justify-self: start; }
.member-mapping-form { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
.member-mapping-form .participant-required { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; }
.member-mapping-form input[type="checkbox"] { width: auto; }
.member-mapping-form > button { justify-self: start; }
.members-preview-table { min-width: 500px; }
.member-import-confirm { margin-top: 16px; }
@media (max-width: 700px) { .member-mapping-form { grid-template-columns: minmax(0, 1fr); } }

.quiz-marking-info { padding: 12px 16px; color: var(--green-dark); background: var(--green-light); border: 1px solid var(--line); border-radius: 10px; }
.quiz-marking-info p { margin-top: 4px; font-size: 13px; }

/* Navigation and long editing pages */
.primary-links, .header-tools { display: flex; align-items: center; gap: 18px; }
.primary-links a { padding: 10px 12px; border-radius: 8px; }
.primary-links a:hover, .primary-links a[aria-current], .auth-nav-link[aria-current] { color: var(--green-dark); background: var(--green-light); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.answer-option:has(input:focus-visible), .segmented label:has(input:focus-visible), .toggle-row:has(input:focus-visible) { outline: 2px solid var(--green); outline-offset: 3px; }
.invitation-note { max-width: 580px; margin: -8px 0 22px; color: var(--muted); font-size: 14px; }
.mobile-table-meta { display: none; }
.editor-toolbar { position: sticky; top: 0; z-index: 8; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; margin-bottom: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--panel-shadow); }
.section-jumps { display: flex; flex-wrap: wrap; gap: 6px; }
.section-jumps a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; color: var(--green-dark); background: var(--soft); border-radius: 8px; font-weight: 700; font-size: 14px; }
.section-jumps a:hover { background: var(--green-light); }
.editor-grid section { scroll-margin-top: 180px; }
.settings-sticky > .participant-fields-editor { grid-column: 1 / -1; padding-top: 8px; }
.participant-fields-editor > p { margin: 8px 0 16px; max-width: 850px; color: var(--muted); }
.settings-sticky > * { min-width: 0; }
.group-section-jumps { margin: 22px 0; }
.group-detail-head { align-items: center; flex-wrap: wrap; }
.group-access-form, .group-quizzes, .members-panel { scroll-margin-top: 20px; }
.group-quizzes { margin: 24px 0; padding: 22px; border: 1px solid var(--line); border-radius: 14px; }
.group-quizzes > h3 { font-size: 22px; }
@media (max-width: 980px) {
  .primary-links, .header-tools { gap: 8px; }
  .primary-links a { padding-inline: 9px; }
  .editor-toolbar .editor-save { flex: 1 1 100%; justify-content: flex-end; }
  .invitation-note { margin-inline: auto; }
}
@media (max-width: 700px) {
  .site-header { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; padding-bottom: 10px; }
  .site-header nav { display: contents; }
  .header-tools { grid-column: 2; grid-row: 1; justify-content: flex-end; }
  .primary-links { grid-column: 1 / -1; grid-row: 2; display: flex; flex-wrap: wrap; gap: 4px; }
  .primary-links a { flex: 1; text-align: center; font-size: 13px; min-height: 44px; }
  .lang-switch, .auth-nav-link { display: inline-flex; align-items: center; min-height: 44px; }
  .page-heading h1 { font-size: 30px; }
  .editor-header { margin-bottom: 16px; }
  .editor-toolbar { padding: 8px; gap: 8px; }
  .editor-toolbar .section-jumps { width: 100%; gap: 4px; }
  .editor-toolbar .section-jumps a { flex: 1; justify-content: center; font-size: 12px; padding-inline: 6px; }
  .editor-toolbar .editor-save { width: 100%; gap: 6px; }
  .editor-toolbar .editor-save .button { min-height: 44px; }
  .editor-toolbar .autosave-status { font-size: 11px; }
  .editor-grid section { scroll-margin-top: 190px; }
  .group-quizzes { padding: 16px; }
  .dashboard-table, .groups-table { min-width: 0; table-layout: fixed; }
  .dashboard-table th:nth-child(2), .dashboard-table td:nth-child(2),
  .dashboard-table th:nth-child(3), .dashboard-table td:nth-child(3),
  .dashboard-table th:nth-child(4), .dashboard-table td:nth-child(4),
  .dashboard-table th:nth-child(5), .dashboard-table td:nth-child(5),
  .dashboard-table th:nth-child(6), .dashboard-table td:nth-child(6),
  .groups-table > thead > tr > th:nth-child(n+2):nth-child(-n+6), .groups-table > tbody > tr > td:nth-child(n+2):nth-child(-n+6) { display: none; }
  .dashboard-table .quiz-table-title, .groups-table .group-table-title { width: auto; min-width: 0; max-width: none; overflow-wrap: anywhere; }
  .dashboard-table th:nth-child(7), .dashboard-table td:nth-child(7) { width: 94px; }
  .dashboard-table th:nth-child(8), .dashboard-table td:nth-child(8) { width: 62px; }
  .groups-table > thead > tr > th:last-child, .groups-table > tbody > tr:not(.group-quiz-row) > td:last-child { width: 112px; }
  .dashboard-table thead th, .dashboard-table tbody th, .dashboard-table td,
  .groups-table > thead > tr > th, .groups-table > tbody > tr > th, .groups-table > tbody > tr > td { padding: 12px 8px; white-space: normal; }
  .groups-table > tbody > .group-quiz-row > td { padding: 0; }
  .group-quiz-row .group-quizzes { padding: 12px; }
  .mobile-table-meta { display: block; margin-top: 7px; font-size: 11px; line-height: 1.6; font-weight: 400; color: var(--muted); }
  .quiz-menu-trigger { min-width: 44px; min-height: 44px; }
  .status-toggle { min-height: 44px; align-items: center; padding-inline: 7px; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
