:root {
  --ink:#163e34;
  --muted:#65766e;
  --paper:#f6f7f2;
  --white:#fff;
  --line:#dfe6dc;
  --lime:#e3efa8;
  --orange:#ee9361;
  --red:#a83f3f;
  --shadow:0 12px 34px #183e3408;
  font-family:Inter,"Segoe UI",Arial,sans-serif;
  color:var(--ink);
  background:var(--paper);
  font-synthesis:none;
}

* {
  box-sizing:border-box;
}

body {
  margin:0;
}

button,input,textarea,select {
  font:inherit;
}

a {
  color:inherit;
  text-underline-offset:4px;
}

button,a,input,select,textarea {
  -webkit-tap-highlight-color:transparent;
}

button,.button {
  cursor:pointer;
}

button:disabled,.button[aria-disabled=true] {
  opacity:.5;
  cursor:not-allowed;
}

button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,summary:focus-visible {
  outline:3px solid #9bb854;
  outline-offset:4px;
}

h1,h2,h3,p {
  margin-top:0;
}

h1 {
  font-family:Georgia,"Times New Roman",serif;
  font-size:clamp(2.3rem,4vw,3.7rem);
  font-weight:500;
  letter-spacing:-.04em;
  line-height:1.1;
  margin-bottom:18px;
}

h2 {
  font-size:1.35rem;
  letter-spacing:-.025em;
}

h3 {
  font-size:1.06rem;
}

p {
  line-height:1.65;
}

small,.small {
  font-size:.82rem;
}

button,.button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  background:var(--ink);
  color:white;
  border:1px solid var(--ink);
  border-radius:10px;
  padding:12px 20px;
  text-decoration:none;
  font-weight:650;
  line-height:1.25;
  min-height:44px;
  transition:background .16s,transform .16s;
}

button:hover,.button:hover {
  background:#245646;
}

button:active,.button:active {
  transform:translateY(1px);
}

.secondary {
  background:white;
  color:var(--ink);
  border-color:var(--line);
}

.secondary:hover {
  background:#edf1e8;
}

.ghost {
  background:transparent;
  color:var(--ink);
  border-color:transparent;
}

.ghost:hover {
  background:#e9eee3;
}

.danger {
  background:#fff4f0;
  color:var(--red);
  border-color:#efcfc6;
}

.danger:hover {
  background:#fce7df;
}

.compact {
  min-height:36px;
  padding:8px 12px;
  font-size:.85rem;
}

.muted {
  color:var(--muted);
}

.eyebrow {
  text-transform:uppercase;
  letter-spacing:.15em;
  font-size:.72rem;
  font-weight:750;
  margin-bottom:15px;
}

.accent {
  color:#5d7940;
}

.pill {
  display:inline-flex;
  gap:6px;
  align-items:center;
  padding:5px 10px;
  border-radius:30px;
  background:#eef2e8;
  color:#4b6453;
  font-size:.74rem;
  font-weight:650;
  white-space:nowrap;
}

.pill.live {
  background:var(--lime);
  color:#385026;
}

.pill.finished {
  background:#eff0ee;
}

.pill.self {
  background:#fcdfcc;
  color:#805735;
}

.dot {
  height:7px;
  width:7px;
  background:currentColor;
  border-radius:50%;
  display:inline-block;
}

.topbar {
  height:88px;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  padding:0 max(5vw,24px);
  background:#fafbf7;
}

.brand {
  display:flex;
  align-items:center;
  gap:12px;
  text-decoration:none;
  font-size:1.1rem;
  letter-spacing:-.02em;
  font-weight:750;
}

.brand-mark {
  width:35px;
  height:35px;
  border-radius:10px;
  background:var(--ink);
  color:var(--lime);
  display:grid;
  place-items:center;
  font-size:24px;
  font-family:Georgia,serif;
  font-weight:bold;
}

.brand span:last-child span {
  font-weight:400;
  color:var(--muted);
}

.topnav {
  display:flex;
  gap:28px;
  align-items:center;
  font-size:.88rem;
}

.topnav a {
  text-decoration:none;
  color:var(--muted);
}

.topnav a.active {
  color:var(--ink);
  font-weight:700;
}

.page {
  max-width:1240px;
  margin:0 auto;
  padding:48px 40px 72px;
}

.page-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:24px;
  margin-bottom:34px;
}

.page-heading h1 {
  margin-bottom:12px;
}

.page-heading p {
  margin-bottom:0;
}

.row {
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}

.between {
  justify-content:space-between;
}

.stack {
  display:grid;
  gap:18px;
}

.card {
  background:white;
  border:1px solid var(--line);
  border-radius:16px;
  padding:26px;
  box-shadow:var(--shadow);
}

.card h2:last-child,.card p:last-child {
  margin-bottom:0;
}

.section-label {
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin:32px 0 18px;
}

.section-label h2 {
  margin:0;
}

.grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:22px;
}

.quiz-card {
  display:flex;
  flex-direction:column;
  min-height:250px;
  padding:0;
  overflow:hidden;
}

.quiz-card .cover {
  height:88px;
  background:#e8eedc;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:24px;
  color:#526542;
}

.quiz-card:nth-child(3n+2) .cover {
  background:#f6e6d8;
  color:#a56b47;
}

.quiz-card:nth-child(3n+3) .cover {
  background:#e1ebec;
  color:#58777b;
}

.cover-symbol {
  font-family:Georgia,serif;
  font-size:44px;
}

.quiz-card .content {
  padding:24px;
  display:flex;
  flex:1;
  flex-direction:column;
}

.quiz-card h3 {
  font-size:1.14rem;
  line-height:1.4;
  overflow-wrap:anywhere;
}

.quiz-card p {
  font-size:.88rem;
}

.quiz-card .actions {
  margin-top:auto;
  padding-top:15px;
  display:flex;
  justify-content:space-between;
  gap:10px;
}

.quiz-card .actions .button:first-child {
  flex:1;
}

.quiz-export {
  margin-top:14px;
  align-self:flex-start;
}

.quiz-import {
  margin-top:20px;
}

.quiz-import summary {
  cursor:pointer;
  font-weight:600;
}

.quiz-import form {
  margin-top:20px;
}

.quiz-import input[type="file"] {
  max-width:100%;
}

#import-status {
  display:block;
  margin-top:10px;
}

.welcome-strip {
  display:flex;
  align-items:center;
  gap:20px;
  justify-content:space-between;
  background:var(--ink);
  color:white;
  border-radius:16px;
  padding:25px 30px;
}

.welcome-strip p {
  color:#cedac8;
  font-size:.9rem;
  margin:5px 0 0;
}

.welcome-strip h2 {
  margin:0;
  font-size:1.15rem;
}

.welcome-strip .button {
  background:var(--lime);
  border-color:var(--lime);
  color:var(--ink);
  flex-shrink:0;
}

.empty {
  text-align:center;
  padding:54px 26px;
  border:1px dashed #bdcdb4;
  border-radius:16px;
  background:#fbfcf9;
}

.empty-icon {
  width:60px;
  height:60px;
  border-radius:18px;
  background:#e9eedc;
  display:grid;
  place-items:center;
  font-size:30px;
  margin:0 auto 18px;
}

.empty p {
  max-width:460px;
  margin:0 auto 24px;
}

.footer-note {
  text-align:center;
  font-size:.78rem;
  color:var(--muted);
  margin:38px 0 0;
}

.landing {
  max-width:1160px;
  margin:0 auto;
  padding:84px 40px;
  display:grid;
  grid-template-columns:1.15fr 1fr;
  align-items:center;
  gap:90px;
  min-height:calc(100vh - 88px);
}

.landing h1 {
  font-size:clamp(3.4rem,6vw,5.6rem);
  max-width:550px;
}

.landing .lead {
  font-size:1.1rem;
  max-width:440px;
  color:var(--muted);
}

.landing .tagline {
  margin-top:34px;
  display:flex;
  gap:20px;
  font-size:.8rem;
  color:var(--muted);
}

.join-card {
  padding:36px;
  border-radius:22px;
  position:relative;
}

.join-card:before {
  content:"";
  position:absolute;
  top:-15px;
  right:26px;
  height:30px;
  width:80px;
  background:var(--lime);
  transform:rotate(6deg);
  opacity:.9;
}

.join-card h2 {
  font-family:Georgia,serif;
  font-weight:500;
  font-size:2rem;
}

.join-card .button,.join-card button {
  width:100%;
}

.form-field {
  display:grid;
  gap:8px;
  margin-bottom:20px;
}

.form-field label,.field-label {
  font-size:.84rem;
  font-weight:650;
}

.form-field small {
  color:var(--muted);
  line-height:1.5;
}

input:not([type=radio]):not([type=range]),textarea,select {
  background:#fbfcf9;
  color:var(--ink);
  width:100%;
  border:1px solid #cdd8c7;
  border-radius:8px;
  padding:12px 14px;
  min-height:46px;
}

textarea {
  resize:vertical;
  min-height:80px;
  line-height:1.5;
}

input::placeholder,textarea::placeholder {
  color:#8a9787;
}

input.code {
  font-size:1.75rem;
  letter-spacing:.24em;
  font-weight:650;
}

input[type=radio] {
  accent-color:var(--ink);
  width:20px;
  height:20px;
  flex-shrink:0;
}

input[type=range] {
  accent-color:var(--ink);
  width:100%;
}

.login {
  max-width:440px;
  margin:65px auto;
  padding:0 20px;
}

.editor {
  max-width:900px;
}

.editor-title {
  display:grid;
  grid-template-columns:1fr 180px;
  gap:18px;
}

.question-editor {
  position:relative;
}

.question-editor .question-top {
  margin-bottom:20px;
}

.question-number {
  font-size:.74rem;
  letter-spacing:.1em;
  font-weight:700;
  text-transform:uppercase;
}

.question-settings {
  display:grid;
  grid-template-columns:1fr 170px;
  gap:18px;
}

.option-edit {
  display:flex;
  align-items:center;
  gap:12px;
  margin:10px 0;
}

.option-edit input[type=text] {
  flex:1;
}

.option-edit label {
  display:flex;
  align-items:center;
  gap:8px;
  flex-shrink:0;
}

.editor-footer {
  position:sticky;
  bottom:16px;
  margin-top:24px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  padding:16px 20px;
  background:#f6f7f2ed;
  border:1px solid #ccd7c5;
  border-radius:12px;
  backdrop-filter:blur(12px);
}

.session-layout {
  display:grid;
  grid-template-columns:minmax(0,1fr) 320px;
  gap:24px;
  align-items:start;
}

.join-info {
  background:var(--ink);
  color:white;
}

.join-info .eyebrow {
  color:var(--lime);
}

.join-code {
  font-size:clamp(2.4rem,4vw,4rem);
  font-weight:750;
  letter-spacing:.12em;
  line-height:1.15;
  margin:15px 0;
}

.join-url {
  overflow-wrap:anywhere;
  font-size:.85rem;
  color:#d5dfd2;
}

.join-info .secondary {
  background:#ffffff13;
  color:white;
  border-color:#ffffff30;
}

.join-info .secondary:hover {
  background:#ffffff25;
}

.notice {
  border-radius:10px;
  background:#f0f3e7;
  padding:14px 18px;
  font-size:.86rem;
  line-height:1.6;
  color:#516746;
}

.notice.warning {
  background:#fff0de;
  color:#835e33;
}

.control-list {
  display:grid;
  gap:12px;
}

.control-list button,.control-list .button {
  width:100%;
}

.participants {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.nickname {
  padding:10px 16px;
  border:1px solid #dbe5cf;
  background:#f5f8ef;
  border-radius:9px;
  font-size:.92rem;
  overflow-wrap:anywhere;
  max-width:100%;
}

.nickname:nth-child(3n) {
  background:#fbefe4;
  border-color:#f1ddc8;
}

.stat-grid {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:16px;
  margin-bottom:24px;
}

.stat {
  background:white;
  border:1px solid var(--line);
  border-radius:12px;
  padding:22px;
}

.stat .number {
  font-family:Georgia,serif;
  font-size:2.4rem;
  margin:0 0 6px;
  line-height:1.1;
}

.stat small {
  color:var(--muted);
}

.question-card h2 {
  font-size:clamp(1.6rem,2.5vw,2.25rem);
  line-height:1.3;
  overflow-wrap:anywhere;
}

.question-meta {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:24px;
  gap:12px;
}

.timer {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:70px;
  padding:10px 12px;
  border-radius:12px;
  background:var(--lime);
  font-size:1.35rem;
  font-variant-numeric:tabular-nums;
  font-weight:750;
}

.timer.urgent {
  background:#f5d3bd;
  color:#913e1c;
}

.answers {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}

.answer {
  border:1px solid #ccdbbf;
  background:#edf3e5;
  border-radius:12px;
  padding:20px;
  min-height:86px;
  color:var(--ink);
  justify-content:flex-start;
  text-align:left;
  font-size:1rem;
  line-height:1.4;
  overflow-wrap:anywhere;
  display:flex;
  align-items:center;
  gap:14px;
}

.answer:nth-child(2) {
  background:#f9e9da;
  border-color:#efd7bd;
}

.answer:nth-child(3) {
  background:#e6eff1;
  border-color:#cadde0;
}

.answer:nth-child(4) {
  background:#ede9f5;
  border-color:#dcd1eb;
}

.answer:hover {
  background:#dae8c9;
}

.answer .letter {
  display:grid;
  place-items:center;
  flex:0 0 30px;
  height:30px;
  background:#ffffff88;
  border-radius:7px;
  font-size:.82rem;
  font-weight:750;
}

.answer.correct {
  border:2px solid #558246;
  background:#e3efca;
}

.answer.selected {
  box-shadow:inset 0 0 0 2px #254f3b;
}

.answer.wrong {
  border:2px solid #b7684b;
}

.answer .answer-content {
  flex:1;
}

.answer .count {
  font-weight:750;
  font-size:1.2rem;
}

.answer:disabled {
  opacity:.75;
}

.table-wrap {
  overflow:auto;
  border:1px solid var(--line);
  border-radius:12px;
  background:white;
}

table {
  width:100%;
  border-collapse:collapse;
  text-align:left;
  font-size:.88rem;
}

th {
  background:#f0f3eb;
  font-size:.72rem;
  text-transform:uppercase;
  letter-spacing:.06em;
  color:#6e7e67;
  font-weight:650;
}

td,th {
  padding:16px 20px;
  border-bottom:1px solid var(--line);
  vertical-align:middle;
}

tbody tr:last-child td {
  border-bottom:0;
}

td:first-child {
  font-weight:600;
}

td small {
  font-weight:400;
}

td.wrap {
  min-width:200px;
  max-width:380px;
  overflow-wrap:anywhere;
}

.rank {
  display:inline-grid;
  place-items:center;
  width:28px;
  height:28px;
  border-radius:7px;
  background:#eef2e8;
}

.rank.first {
  background:var(--lime);
}

.bar-row {
  display:grid;
  grid-template-columns:1fr auto;
  gap:12px;
  margin:15px 0;
}

.bar-row progress {
  grid-column:1/-1;
  width:100%;
  height:9px;
  border:0;
  appearance:none;
  accent-color:#749552;
}

.bar-row progress::-webkit-progress-bar {
  background:#edf1e8;
  border-radius:8px;
}

.bar-row progress::-webkit-progress-value {
  background:#789759;
  border-radius:8px;
}

.bar-row small {
  color:var(--muted);
}

.report-question {
  margin:18px 0;
}

.report-question h3 {
  line-height:1.5;
}

.report-question summary {
  cursor:pointer;
  display:flex;
  justify-content:space-between;
  gap:18px;
  align-items:center;
}

.report-question summary h3 {
  margin:0;
}

.report-question summary .score-badge {
  font-size:1.4rem;
  font-family:Georgia,serif;
  white-space:nowrap;
}

.report-question[open] summary {
  margin-bottom:24px;
}

.hard {
  color:#9a5c38;
}

.report-tabs {
  display:flex;
  gap:6px;
  border-bottom:1px solid var(--line);
  margin-bottom:24px;
}

.report-tabs a {
  padding:12px 16px;
  text-decoration:none;
  font-size:.88rem;
}

.report-tabs a.active {
  border-bottom:3px solid var(--ink);
  font-weight:650;
}

.student-page {
  max-width:820px;
  margin:0 auto;
  padding:32px 24px 70px;
}

.student-heading {
  margin-bottom:24px;
  display:flex;
  gap:16px;
  align-items:center;
  justify-content:space-between;
}

.student-heading h1 {
  font-family:inherit;
  font-size:1.1rem;
  font-weight:650;
  letter-spacing:0;
  margin-bottom:6px;
  overflow-wrap:anywhere;
}

.student-heading p {
  margin:0;
  font-size:.84rem;
}

.waiting {
  text-align:center;
  padding:65px 25px;
}

.waiting h2 {
  font-family:Georgia,serif;
  font-size:2.3rem;
  font-weight:500;
}

.waiting .waiting-icon {
  width:86px;
  height:86px;
  border-radius:26px;
  background:var(--lime);
  display:grid;
  place-items:center;
  margin:0 auto 28px;
  font-size:36px;
}

.waiting p {
  max-width:430px;
  margin:0 auto 25px;
  color:var(--muted);
}

.feedback {
  margin:22px 0 0;
  padding:18px;
  background:#eef3e4;
  border-radius:10px;
  line-height:1.6;
}

.feedback.wrong {
  background:#fcf0e6;
}

.review-item {
  margin-top:16px;
}

.review-item p {
  margin:8px 0;
}

.review-item .answer {
  background: #f7f8f7;
  border: 1px solid var(--line);
  color: var(--ink);
}
.review-item .answer.correct {
  background: #e6f4e9;
  border: 2px solid #347347;
  color: #205b32;
}
.review-item .answer.wrong {
  background: #fce9e9;
  border: 2px solid #b64545;
  color: #8f2525;
}
.review-item .answer.selected {
  box-shadow: inset 0 0 0 1px currentColor;
}
.answer-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-top: 6px;
}
.your-answer {
  padding: 2px 7px;
  border: 1px solid currentColor;
  border-radius: 5px;
}
.answer-mark {
  flex: 0 0 auto;
  font-size: 1.5rem;
  font-weight: 750;
}

.projection {
  background:#102f28;
  color:#fafdf6;
  min-height:100vh;
  padding:35px 5vw 60px;
}

.projection .project-top {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  padding-bottom:25px;
  border-bottom:1px solid #ffffff20;
}

.projection .brand-mark {
  background:var(--lime);
  color:var(--ink);
}

.projection .brand span:last-child span {
  color:#b0c2ad;
}

.projection .project-title {
  max-width:1150px;
  margin:42px auto 28px;
  text-align:center;
}

.projection h1 {
  font-size:clamp(2.8rem,5vw,5rem);
}

.projection .muted {
  color:#b1c7b9;
}

.projection .project-code {
  font-size:clamp(4rem,10vw,9rem);
  letter-spacing:.12em;
  font-weight:750;
  line-height:1.15;
  margin:15px 0 22px;
  color:var(--lime);
}

.projection .project-url {
  font-size:1.15rem;
  overflow-wrap:anywhere;
}

.projection .project-join {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:clamp(24px,5vw,64px);
  margin:28px auto 0;
}

.projection .project-qr {
  flex:none;
  width:clamp(220px,25vw,320px);
  max-width:100%;
  margin:0;
}

.projection .project-qr img {
  display:block;
  width:100%;
  height:auto;
  background:#fff;
  border:12px solid #fff;
  border-radius:12px;
}

.projection .project-qr figcaption {
  margin-top:12px;
  font-size:1.2rem;
  font-weight:650;
}

.projection .project-join-details {
  min-width:0;
}

@media(max-width:720px) {
  .projection .project-join {
    flex-direction:column;
  }
}

.projection .participants {
  max-width:1050px;
  margin:35px auto;
  justify-content:center;
}

.projection .nickname {
  background:#ffffff0e;
  color:white;
  border-color:#ffffff25;
  font-size:1.3rem;
  padding:14px 24px;
}

.projection .question-card {
  max-width:1150px;
  margin:35px auto;
}

.projection .question-card h2 {
  font-size:clamp(2rem,4vw,3.5rem);
}

.projection .answer {
  font-size:1.5rem;
  min-height:110px;
}

.projection .question-meta {
  font-size:1.1rem;
}

.projection table {
  color:var(--ink);
  font-size:1.1rem;
}

.projection .table-wrap {
  max-width:1000px;
  margin:25px auto;
}

.projection .eyebrow {
  color:var(--lime);
}

.projection .timer {
  color:var(--ink);
  font-size:2rem;
  min-width:90px;
}

.projection .project-footer {
  text-align:center;
  color:#b1c7b9;
  margin-top:30px;
}

.session-row {
  display:flex;
  justify-content:space-between;
  gap:24px;
  align-items:center;
  padding:22px 0;
  border-bottom:1px solid var(--line);
}

.session-row:last-child {
  border-bottom:0;
}

.session-row h3 {
  margin:0 0 8px;
}

.session-row p {
  margin:0;
  font-size:.82rem;
  color:var(--muted);
}

.launch {
  max-width:760px;
}

.mode-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
  margin:18px 0 30px;
}

.mode-choice {
  border:1px solid var(--line);
  padding:22px;
  border-radius:12px;
  cursor:pointer;
  background:#fafbf7;
}

.mode-choice:has(input:checked) {
  border:2px solid #45633a;
  padding:21px;
  background:#edf3df;
}

.mode-choice strong {
  display:block;
  margin:12px 0 6px;
}

.mode-choice p {
  font-size:.85rem;
  color:var(--muted);
  margin:0;
}

.connection {
  position:sticky;
  top:0;
  z-index:100;
  padding:12px 20px;
  text-align:center;
  background:#f7dfbb;
  color:#664316;
  font-size:.85rem;
}

#toast {
  position:fixed;
  bottom:24px;
  left:50%;
  transform:translateX(-50%);
  background:#843b30;
  color:white;
  padding:16px 24px;
  border-radius:12px;
  z-index:200;
  box-shadow:0 8px 40px #0002;
  max-width:min(90vw,620px);
  line-height:1.5;
}

#toast.success {
  background:var(--ink);
}

[hidden] {
  display:none!important;
}

.loading {
  display:grid;
  place-items:center;
  min-height:70vh;
  color:var(--muted);
}

.skip-link {
  position:absolute;
  left:12px;
  top:-100px;
  z-index:500;
  background:white;
  padding:12px;
}

.skip-link:focus {
  top:12px;
}

.nowrap {
  white-space:nowrap;
}

.back {
  font-size:.85rem;
  display:inline-block;
  margin-bottom:25px;
  color:var(--muted);
  text-decoration:none;
}

.full-width {
  width:100%;
}

.spaced {
  margin-top:24px;
}

.zero {
  margin:0;
}

@media(min-width:1500px) {
  .page {
    padding-top:64px;
  }
  .landing {
    gap:120px;
  }
}

@media(max-width:1000px) {
  .grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .landing {
    gap:40px;
    padding-top:55px;
  }
  .session-layout {
    grid-template-columns:minmax(0,1fr) 280px;
  }
  .page {
    padding:35px 24px;
  }
  .topnav {
    gap:16px;
  }
}

@media(max-width:720px) {
  .topbar {
    height:72px;
    padding:0 20px;
  }
  .topnav .teacher-name {
    display:none;
  }
  .topnav {
    gap:12px;
    font-size:.8rem;
  }
  .topnav button {
    padding:8px;
    min-height:38px;
  }
  .brand {
    font-size:1rem;
  }
  .brand-mark {
    width:30px;
    height:30px;
  }
  .page {
    padding:28px 18px 50px;
  }
  .page-heading {
    align-items:flex-start;
    flex-direction:column;
    gap:18px;
    margin-bottom:25px;
  }
  .page-heading h1 {
    font-size:2.5rem;
  }
  .grid {
    grid-template-columns:1fr;
  }
  .welcome-strip {
    padding:24px;
    align-items:flex-start;
    flex-direction:column;
  }
  .landing {
    grid-template-columns:1fr;
    gap:36px;
    padding:35px 24px 55px;
    min-height:unset;
  }
  .landing h1 {
    font-size:3.4rem;
    margin-bottom:15px;
  }
  .landing .lead {
    font-size:1rem;
  }
  .landing .tagline {
    margin-top:20px;
  }
  .join-card {
    padding:28px;
  }
  .session-layout {
    grid-template-columns:1fr;
  }
  .session-layout aside {
    order:-1;
  }
  .join-code {
    font-size:3rem;
  }
  .stat {
    padding:16px 12px;
  }
  .stat .number {
    font-size:1.8rem;
  }
  .stat small {
    font-size:.72rem;
  }
  .stat-grid {
    gap:10px;
  }
  .card {
    padding:20px;
  }
  .answers {
    grid-template-columns:1fr;
  }
  .answer {
    min-height:68px;
    padding:15px;
  }
  .question-settings {
    grid-template-columns:1fr 120px;
  }
  .editor-title {
    grid-template-columns:1fr;
  }
  .option-edit {
    gap:8px;
  }
  .option-edit label span {
    display:none;
  }
  .editor-footer {
    padding:12px;
  }
  .session-row {
    align-items:flex-start;
    flex-direction:column;
    gap:16px;
  }
  .mode-grid {
    grid-template-columns:1fr;
  }
  .projection {
    padding:24px 20px;
  }
  .projection .project-top {
    font-size:.8rem;
  }
  .projection .answer {
    font-size:1.2rem;
    min-height:80px;
  }
  .projection .project-code {
    font-size:4.2rem;
  }
  .student-page {
    padding:24px 16px 55px;
  }
  .waiting {
    padding:45px 20px;
  }
  .report-question summary {
    align-items:flex-start;
  }
  .report-question summary h3 {
    font-size:.94rem;
  }
  .report-question summary .score-badge {
    font-size:1.1rem;
  }
  .topnav a {
    white-space:nowrap;
  }
  td,th {
    padding:12px 14px;
  }
  .quiz-card {
    min-height:220px;
  }
  .question-card h2 {
    font-size:1.5rem;
  }
  .row.mobile-stack {
    align-items:stretch;
    flex-direction:column;
  }
}

@media(prefers-reduced-motion:reduce) {
  * {
    transition:none!important;
    scroll-behavior:auto!important;
  }
}

/* Rich question content and the classroom presentation. */
.advance-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 12px;
  background: var(--lime);
  color: var(--ink);
  padding: 12px 18px;
  margin: 0 0 24px;
  font-size: .95rem;
}
.advance-notice strong {
  font-size: 1.4rem;
  font-variant-numeric: tabular-nums;
}
.projection .advance-notice {
  max-width: 1150px;
  margin: 24px auto;
  font-size: 1.15rem;
}
.rich-text {
  white-space: pre-wrap;
  min-width: 0;
}
.rich-text .katex {
  white-space: normal;
}
.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: .2em 0;
  max-width: 100%;
}
.question-body, .question-prompt, .answer-content {
  min-width: 0;
}
.question-image {
  margin: 20px 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}
.question-image img {
  display: block;
  max-width: 100%;
  max-height: 360px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
}
.math-tools, .image-editor {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 20px 0;
  background: #fafcf6;
}
.math-tools .row {
  margin-top: 12px;
  gap: 8px;
}
.math-tools p {
  margin: 12px 0 0;
}
.image-editor .form-field {
  margin-top: 16px;
}
.image-editor .question-image img {
  max-height: 220px;
}
.upload-status:not(:empty) {
  display: block;
  padding-top: 12px;
}
.editor-preview {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 20px;
}
.editor-preview summary {
  cursor: pointer;
  font-weight: 650;
}
.editor-preview-content {
  padding-top: 20px;
}
.editor-preview-content .question-card h2 {
  font-size: 1.3rem;
}
.editor-preview-content .answer {
  font-size: .9rem;
  min-height: 64px;
}
.presentation-controls [aria-pressed="true"] {
  background: var(--lime);
  border-color: #9aad65;
}
.presentation-controls h2 {
  font-size: 1.1rem;
}
.presentation-controls select {
  text-overflow: ellipsis;
}
.presentation-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 1150px;
  margin: 32px auto 0;
  gap: 18px;
  text-align: center;
}
.presentation-metrics > div {
  background: #ffffff0d;
  border: 1px solid #ffffff24;
  border-radius: 14px;
  padding: 20px 12px;
}
.presentation-metrics strong {
  display: block;
  color: var(--lime);
  font-size: 2.1rem;
  margin-bottom: 8px;
}
.presentation-metrics span {
  color: #cedfce;
  font-size: .88rem;
}
.presentation-chart {
  max-width: 1100px;
  margin: 30px auto;
  display: grid;
  gap: 24px;
}
.presentation-chart-row {
  padding: 20px 26px;
  border-radius: 14px;
  border: 1px solid #ffffff24;
  background: #ffffff08;
}
.chart-question {
  font-size: 1.35rem;
  flex: 1;
}
.presentation-chart-row strong {
  font-size: 1.75rem;
  color: var(--lime);
}
.presentation-chart progress {
  display: block;
  width: 100%;
  height: 12px;
  margin: 18px 0 12px;
  appearance: none;
  border: 0;
  border-radius: 8px;
  background: #ffffff18;
  accent-color: var(--lime);
}
.presentation-chart progress::-webkit-progress-bar {
  background: #ffffff18;
  border-radius: 8px;
}
.presentation-chart progress::-webkit-progress-value {
  background: var(--lime);
  border-radius: 8px;
}
.chart-caption {
  color: #b1c7b9;
  font-size: .9rem;
}
.projection .question-body.with-image {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 32px;
  align-items: center;
}
.projection .with-image .answers {
  grid-template-columns: 1fr;
}
.projection .with-image h2 {
  font-size: clamp(1.7rem, 2.8vw, 2.7rem);
}
.projection .with-image .answer {
  min-height: 84px;
}
.projection .question-image img {
  max-height: min(38vh, 380px);
}
.projection .question-card h2 {
  line-height: 1.45;
}
.projection #fullscreen {
  background: #ffffff14;
  border-color: #ffffff30;
  color: white;
}
@media(max-width: 900px) {
  .projection .question-body.with-image {
    grid-template-columns: 1fr;
  }
  .presentation-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .projection .project-top > .muted {
    display: none;
  }
}
@media(max-width: 720px) {
  .question-image img {
    max-height: 260px;
  }
  .math-tools, .image-editor {
    padding: 14px;
  }
  .chart-question {
    font-size: 1rem;
  }
}
.countdown-number {
  display: block;
  font-size: clamp(3rem, 9vw, 6rem);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}
.projection .question-countdown p {
  color: #b1c7b9;
}

/* Custom sizing uses the available space, not the file's intrinsic size.
   Keep the original ratio, including for tall PDF pages and narrow phones. */
.question-image[data-image-width] {
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
}
.question-image[data-image-width] img {
  width: 100%;
  height: auto;
  max-height: none;
}
.image-sizing {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 20px;
}
.image-sizing output {
  float: right;
  font-variant-numeric: tabular-nums;
}
