:root {
  color-scheme: light;
  --ink: #111827;
  --ink-2: #263146;
  --muted: #687286;
  --muted-2: #8a93a3;
  --line: #dfe4ec;
  --line-strong: #cbd3df;
  --paper: #ffffff;
  --wash: #f4f7fb;
  --blue: #2457eb;
  --blue-dark: #1748d6;
  --blue-soft: #eaf0ff;
  --violet: #7047eb;
  --violet-soft: #f0ebff;
  --amber: #9c5200;
  --amber-soft: #fff1d7;
  --green: #087b55;
  --green-soft: #e1f7ee;
  --red: #b42318;
  --red-soft: #ffebe9;
  --shadow: 0 24px 70px rgba(32, 46, 78, .12);
  font-family: Inter, Avenir, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--wash); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 93% 4%, rgba(36, 87, 235, .09), transparent 28rem),
    linear-gradient(180deg, #f7f9fd 0%, #fff 48%, #f8fafc 100%);
  font-size: 16px;
  line-height: 1.5;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
input, textarea { color: var(--ink); }
textarea { resize: vertical; }
.hidden { display: none !important; }
.button-reset { padding: 0; border: 0; background: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

:focus-visible { outline: 3px solid rgba(36, 87, 235, .38); outline-offset: 3px; }

.site-header {
  width: min(1220px, calc(100% - 40px));
  height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -.035em;
}

.brand-mark {
  width: 36px;
  height: 36px;
  padding: 9px 8px;
  border-radius: 11px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  background: var(--ink);
}
.brand-mark i { width: 4px; border-radius: 4px; background: #fff; }
.brand-mark i:nth-child(1) { height: 8px; }
.brand-mark i:nth-child(2) { height: 16px; background: #8ca9ff; }
.brand-mark i:nth-child(3) { height: 12px; }
.brand-light { color: white; }
.brand-light .brand-mark { background: rgba(255,255,255,.12); }

.header-actions { display: flex; align-items: center; gap: 10px; }
.language-button, .ghost-button, .secondary-button, .small-button, .icon-text-button {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(255,255,255,.82);
  color: var(--ink-2);
  font-weight: 700;
}
.language-button { padding: 0 14px; }
.connection-badge { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: .82rem; font-weight: 700; }
.connection-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.connection-badge.reconnecting i { background: var(--amber); }
.connection-badge.offline i { background: var(--red); }

.welcome-shell {
  width: min(1180px, calc(100% - 40px));
  min-height: calc(100vh - 132px);
  margin: 0 auto;
  padding: clamp(42px, 8vh, 92px) 0 64px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(390px, .8fr);
  align-items: center;
  gap: clamp(54px, 8vw, 112px);
}

.join-panel { max-width: 610px; }
.eyebrow { margin: 0 0 16px; color: var(--blue); font-size: .78rem; font-weight: 800; letter-spacing: .14em; }
.join-panel h1 { margin: 0; max-width: 600px; font-size: clamp(3rem, 6vw, 5.25rem); line-height: .98; letter-spacing: -.065em; }
.intro { max-width: 550px; margin: 26px 0 40px; color: var(--muted); font-size: 1.125rem; line-height: 1.65; }
.join-form label, .dialog-card label { display: block; margin-bottom: 9px; font-size: .9rem; font-weight: 800; }
.code-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: none;
  background: rgba(255,255,255,.94);
  box-shadow: 0 1px 2px rgba(17,24,39,.04);
}
input { min-height: 54px; padding: 0 16px; }
textarea { padding: 14px 16px; line-height: 1.55; }
input:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(36,87,235,.11); }
.code-row input { height: 58px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.primary-button {
  min-height: 50px;
  padding: 0 21px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(36,87,235,.19);
}
.code-row .primary-button { height: 58px; }
.primary-button:hover { background: var(--blue-dark); }
.primary-button.violet { background: var(--violet); }
.full-width { width: 100%; margin-top: 8px; }
.field-note { margin: 10px 0 0; color: var(--muted-2); font-size: .82rem; }
.form-error { min-height: 1.3em; margin: 7px 0 0; color: var(--red); font-size: .86rem; font-weight: 650; }
.teacher-entry { margin-top: 27px; display: flex; gap: 7px; color: var(--muted); font-size: .94rem; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--blue); font-weight: 800; }
.text-button:hover { text-decoration: underline; }
.resume-card { width: 100%; margin-top: 22px; padding: 14px 16px; border: 1px solid #bfcdf4; border-radius: 13px; display: flex; align-items: center; justify-content: space-between; text-align: left; background: var(--blue-soft); color: var(--ink); }
.resume-card span { display: grid; }
.resume-card small { color: var(--blue); font-size: .68rem; font-weight: 850; letter-spacing: .1em; }
.resume-card strong { margin-top: 3px; }
.resume-card b { color: var(--blue); letter-spacing: .11em; }

.participation-card {
  position: relative;
  padding: 22px;
  border: 1px solid rgba(203,211,223,.82);
  border-radius: 24px;
  background: rgba(255,255,255,.84);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.participation-card::before { content: ""; position: absolute; inset: 10px -12px -12px 12px; z-index: -1; border: 1px solid #dfe6f2; border-radius: 24px; background: #edf2fa; }
.card-topline { display: flex; justify-content: space-between; align-items: center; color: var(--muted-2); font-size: .78rem; font-weight: 700; }
.live-pill { display: inline-flex; gap: 7px; align-items: center; color: var(--blue); font-weight: 850; letter-spacing: .08em; }
.live-pill b { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 5px rgba(36,87,235,.1); }
.prompt-block { margin: 25px 0 18px; padding: 20px; border-radius: 16px; color: #fff; background: var(--ink); }
.prompt-block span { color: #aab7d0; font-size: .72rem; font-weight: 800; letter-spacing: .1em; }
.prompt-block p { margin: 9px 0 0; font-size: 1.2rem; line-height: 1.4; font-weight: 750; }
.response-stack { display: grid; gap: 10px; }
.response-card { display: flex; align-items: center; gap: 14px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.response-icon { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; font-weight: 850; }
.response-card div:last-child { display: grid; gap: 2px; }
.response-card strong { font-size: .95rem; }
.response-card span { color: var(--muted); font-size: .8rem; }
.accent-blue .response-icon { color: var(--blue); background: var(--blue-soft); }
.accent-violet .response-icon { color: var(--violet); background: var(--violet-soft); }
.accent-amber .response-icon { color: var(--amber); background: var(--amber-soft); }

.room-bar {
  width: min(1220px, calc(100% - 40px));
  margin: 2px auto 0;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: rgba(255,255,255,.86);
}
.room-bar > div:first-child { display: grid; }
.room-label { color: var(--muted-2); font-size: .66rem; font-weight: 850; letter-spacing: .1em; }
.room-bar-centre { display: flex; align-items: center; gap: 12px; font-size: .9rem; }
.room-bar-centre b { padding: 6px 9px; border-radius: 7px; background: var(--ink); color: white; letter-spacing: .1em; }
.room-bar .ghost-button { justify-self: end; padding: 0 14px; }

.student-shell {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: clamp(32px, 6vw, 84px);
  align-items: start;
}
.phase-line { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .83rem; font-weight: 750; }
.phase-line span:first-child { padding: 6px 10px; border-radius: 7px; background: var(--blue-soft); color: var(--blue); }
.student-prompt { padding: clamp(30px, 5vw, 52px) 0 34px; }
.student-prompt h2 { max-width: 710px; margin: 0; font-size: clamp(2.25rem, 4.4vw, 4.1rem); line-height: 1.08; letter-spacing: -.048em; }
.safe-copy { max-width: 620px; margin: 22px 0 0; color: var(--muted); }
.student-tools { position: sticky; top: 20px; padding: 9px; border: 1px solid var(--line); border-radius: 19px; background: #fff; box-shadow: 0 18px 50px rgba(31,43,72,.1); }
.participation-tabs { padding: 4px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; border-radius: 12px; background: var(--wash); }
.participation-tabs button { min-height: 42px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: .86rem; font-weight: 800; }
.participation-tabs button.active { background: white; color: var(--ink); box-shadow: 0 1px 5px rgba(17,24,39,.1); }
.participation-panel { padding: 22px 17px 16px; }
.participation-panel h3, .my-updates h3 { margin: 0; font-size: 1.08rem; }
.participation-panel > p { margin: 5px 0 16px; color: var(--muted); font-size: .86rem; line-height: 1.5; }
.sentence-starters { display: flex; gap: 7px; margin-bottom: 10px; overflow-x: auto; }
.sentence-starters button, .category-picker button, .poll-templates button { min-height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; white-space: nowrap; background: white; color: var(--muted); font-size: .76rem; font-weight: 700; }
.message-form textarea { min-height: 122px; }
.composer-footer { margin-top: 9px; display: flex; align-items: center; justify-content: space-between; }
.composer-footer > span { color: var(--muted-2); font-size: .75rem; }
.composer-footer button { min-height: 44px; }
.category-picker { display: flex; gap: 6px; margin-bottom: 10px; overflow-x: auto; }
.category-picker button.active { border-color: #b8a3fb; background: var(--violet-soft); color: var(--violet); }
.pace-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pace-options button { min-height: 79px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; display: grid; place-items: center; gap: 3px; background: white; color: var(--ink-2); }
.pace-options button span { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: var(--wash); color: var(--blue); font-weight: 850; }
.pace-options button b { font-size: .8rem; }
.pace-options button.active { border-color: var(--blue); background: var(--blue-soft); }
.my-updates { margin: 3px 8px 8px; padding: 17px; border-radius: 13px; background: var(--wash); }
.my-updates h3 { margin-bottom: 11px; }
.history-item { padding: 11px 0; border-top: 1px solid var(--line); }
.history-item:first-child { border-top: 0; }
.history-item p { margin: 0 0 5px; font-size: .84rem; }
.history-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: .72rem; }
.history-reply { margin-top: 8px; padding: 8px 10px; border-left: 3px solid var(--blue); background: white; color: var(--ink-2); font-size: .8rem; }

.poll-card, .published-board { margin-top: 18px; padding: 24px; border: 1px solid var(--line); border-radius: 17px; background: white; box-shadow: 0 12px 38px rgba(31,43,72,.07); }
.section-heading-row { display: flex; justify-content: space-between; gap: 16px; align-items: start; }
.section-heading-row h3 { margin: 0; font-size: 1.25rem; }
.answer-count, .section-heading-row > span { flex: 0 0 auto; padding: 5px 8px; border-radius: 7px; background: var(--wash); color: var(--muted); font-size: .72rem; font-weight: 750; }
.poll-options { margin-top: 18px; display: grid; gap: 8px; }
.poll-option { position: relative; min-height: 52px; padding: 0 15px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 11px; display: flex; align-items: center; gap: 11px; text-align: left; background: white; color: var(--ink); }
.poll-option .bar { position: absolute; inset: 0 auto 0 0; z-index: 0; width: 0; background: var(--blue-soft); transition: width .25s ease; }
.poll-option > *:not(.bar) { position: relative; z-index: 1; }
.poll-option .option-key { width: 27px; height: 27px; flex: 0 0 auto; border-radius: 8px; display: grid; place-items: center; background: var(--wash); color: var(--muted); font-size: .78rem; font-weight: 850; }
.poll-option .option-count { margin-left: auto; color: var(--muted); font-size: .82rem; font-weight: 750; }
.poll-option.selected { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36,87,235,.09); }
.poll-option.selected .option-key { background: var(--blue); color: white; }
.poll-note { margin: 12px 0 0; color: var(--muted); font-size: .78rem; }
.published-list { margin-top: 15px; display: grid; gap: 8px; }
.published-item { padding: 13px 15px; border-left: 3px solid var(--blue); border-radius: 4px 10px 10px 4px; background: var(--wash); }
.published-item p { margin: 0; }

.teacher-view { padding: 0 20px 60px; }
.teacher-topbar {
  width: min(1380px, 100%);
  margin: 5px auto 17px;
  padding: 19px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 18px;
  align-items: center;
  background: rgba(255,255,255,.9);
}
.teacher-topbar .eyebrow { margin-bottom: 3px; font-size: .65rem; }
.teacher-topbar h1 { margin: 0; font-size: 1.35rem; letter-spacing: -.03em; }
.teacher-share { display: flex; align-items: center; gap: 11px; }
.teacher-share > span { color: var(--muted); font-size: .66rem; font-weight: 850; letter-spacing: .1em; }
.teacher-share button { min-height: 48px; padding: 6px 11px; border: 1px solid #bdcaf0; border-radius: 10px; display: flex; gap: 11px; align-items: center; background: var(--blue-soft); }
.teacher-share b { color: var(--blue); letter-spacing: .13em; }
.teacher-share small { color: var(--muted); }
.secondary-button { padding: 0 15px; }
.teacher-shell { width: min(1380px, 100%); margin: 0 auto; display: grid; grid-template-columns: 190px minmax(400px, 1fr) 340px; gap: 17px; align-items: start; }
.lesson-rail, .teacher-main, .teacher-controls { min-width: 0; }
.lesson-rail { padding: 20px 15px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.rail-label { margin: 0 0 14px 9px; color: var(--muted-2); font-size: .68rem; font-weight: 850; letter-spacing: .11em; }
.lesson-rail ol { list-style: none; margin: 0; padding: 0; }
.phase-button { width: 100%; min-height: 45px; padding: 0 10px; border: 0; border-radius: 9px; display: flex; gap: 10px; align-items: center; background: transparent; color: var(--muted); text-align: left; font-size: .85rem; font-weight: 750; }
.phase-button span { width: 23px; height: 23px; border: 1px solid var(--line-strong); border-radius: 50%; display: grid; place-items: center; font-size: .7rem; }
.phase-button.active { background: var(--blue-soft); color: var(--blue); }
.phase-button.active span { border-color: var(--blue); background: var(--blue); color: white; }
.phase-button.complete span { border-color: #a9ddca; background: var(--green-soft); color: var(--green); }
.rail-summary { margin-top: 17px; padding: 14px 9px 0; border-top: 1px solid var(--line); display: grid; gap: 7px; color: var(--muted); font-size: .78rem; }
.rail-summary b { color: var(--ink); }
.teacher-main { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.88); }
.current-prompt-card { padding: 22px; border-radius: 14px; display: flex; gap: 18px; justify-content: space-between; align-items: start; background: var(--ink); color: white; }
.current-prompt-card .eyebrow { margin-bottom: 7px; color: #9bb3ff; font-size: .66rem; }
.current-prompt-card h2 { max-width: 660px; margin: 0; font-size: 1.35rem; line-height: 1.4; }
.icon-text-button { min-width: 102px; padding: 0 12px; border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: white; }
.inbox-heading { padding: 26px 2px 14px; display: flex; justify-content: space-between; gap: 16px; align-items: end; }
.inbox-heading h2 { margin: 0; font-size: 1.3rem; }
.inbox-heading p { margin: 3px 0 0; color: var(--muted); font-size: .82rem; }
.filter-tabs { display: flex; gap: 3px; padding: 3px; border-radius: 9px; background: var(--wash); }
.filter-tabs button { min-height: 34px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: .75rem; font-weight: 750; }
.filter-tabs button.active { background: white; color: var(--ink); box-shadow: 0 1px 4px rgba(17,24,39,.09); }
.question-inbox { display: grid; gap: 9px; }
.question-card { padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.question-meta { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .75rem; }
.question-meta b { color: var(--ink-2); }
.category-tag, .status-tag { padding: 3px 7px; border-radius: 6px; background: var(--violet-soft); color: var(--violet); font-size: .66rem; font-weight: 800; text-transform: uppercase; }
.status-tag { margin-left: auto; background: var(--wash); color: var(--muted); }
.question-card > p { margin: 11px 0 13px; line-height: 1.48; }
.question-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.question-actions button { min-height: 35px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink-2); font-size: .72rem; font-weight: 750; }
.question-actions .publish-button { border-color: #b8c7f3; background: var(--blue-soft); color: var(--blue); }
.reply-row { margin-top: 9px; display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.reply-row input { min-height: 40px; font-size: .8rem; }
.reply-row button { min-height: 40px; }
.empty-inbox { padding: 48px 20px; border: 1px dashed var(--line-strong); border-radius: 12px; text-align: center; color: var(--muted); }
.empty-inbox b { display: block; color: var(--ink-2); }
.teacher-controls { display: grid; gap: 12px; }
.control-card { padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.control-heading { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.control-heading span { color: var(--muted-2); font-size: .63rem; font-weight: 850; letter-spacing: .11em; }
.control-heading h3 { margin: 1px 0 0; font-size: 1rem; }
.control-heading small { color: var(--muted); font-size: .72rem; }
.small-button { min-height: 34px; padding: 0 10px; font-size: .73rem; }
.empty-control { min-height: 125px; display: grid; place-content: center; text-align: center; color: var(--muted); font-size: .8rem; }
.empty-control b { color: var(--ink-2); }
.teacher-poll-question { margin: 16px 0 11px; font-weight: 750; }
.teacher-poll-options { display: grid; gap: 7px; }
.mini-result { position: relative; min-height: 36px; padding: 0 9px; overflow: hidden; border-radius: 8px; display: flex; align-items: center; background: var(--wash); font-size: .75rem; }
.mini-result i { position: absolute; inset: 0 auto 0 0; background: var(--blue-soft); }
.mini-result span, .mini-result b { position: relative; z-index: 1; }
.mini-result b { margin-left: auto; }
.poll-control-actions { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.poll-control-actions button { min-height: 38px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink-2); font-size: .72rem; font-weight: 750; }
.pulse-grid { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.pulse-grid div { padding: 10px; border-radius: 9px; display: grid; background: var(--wash); }
.pulse-grid span { color: var(--muted); font-size: .7rem; }
.pulse-grid b { font-size: 1.25rem; }
.session-control { padding-bottom: 12px; }
.switch-row { min-height: 61px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch-row:first-of-type { margin-top: 12px; }
.switch-row span { display: grid; }
.switch-row b { font-size: .78rem; }
.switch-row small { color: var(--muted); font-size: .68rem; }
.switch-row input { appearance: none; width: 40px; min-height: 23px; padding: 0; border: 0; border-radius: 99px; background: var(--line-strong); box-shadow: none; }
.switch-row input::before { content: ""; display: block; width: 17px; height: 17px; margin: 3px; border-radius: 50%; background: white; transition: transform .16s ease; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch-row input:checked { background: var(--blue); }
.switch-row input:checked::before { transform: translateX(17px); }
.session-actions { padding-top: 10px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.ghost-button, .danger-button { padding: 0 12px; }
.danger-button { min-height: 42px; border: 1px solid #ffc3bd; border-radius: 10px; background: var(--red-soft); color: var(--red); font-weight: 800; }

.screen-view { min-height: 100vh; color: white; background: #0b1020; }
.screen-view:not(.hidden) + * { display: none; }
.screen-header { padding: 28px 42px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.12); }
.screen-header > div:last-child { display: flex; gap: 14px; align-items: center; color: #b7c1d9; }
.screen-header > div:last-child b { padding: 7px 10px; border-radius: 8px; background: white; color: var(--ink); letter-spacing: .12em; }
.screen-content { min-height: calc(100vh - 165px); padding: clamp(40px, 6vw, 80px); display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .8fr); gap: 48px; align-items: center; }
.screen-prompt p, .screen-kicker { margin: 0 0 19px; color: #8faeff; font-size: .9rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.screen-prompt h1 { max-width: 960px; margin: 0; font-size: clamp(3rem, 6vw, 6.5rem); line-height: 1.02; letter-spacing: -.06em; }
.screen-prompt > span { display: block; margin-top: 28px; color: #aeb8ce; font-size: 1.08rem; }
.screen-panel { padding: 30px; border: 1px solid rgba(255,255,255,.14); border-radius: 22px; background: rgba(255,255,255,.075); }
.screen-poll-title { margin: 0 0 20px; font-size: clamp(1.5rem, 2.5vw, 2.35rem); line-height: 1.25; }
.screen-result { margin-top: 11px; }
.screen-result-top { display: flex; justify-content: space-between; }
.screen-result-track { height: 13px; margin-top: 7px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.1); }
.screen-result-track i { display: block; height: 100%; border-radius: 99px; background: #8faeff; }
.screen-waiting { padding: 40px 0; text-align: center; color: #aeb8ce; }
.screen-waiting b { display: block; color: white; font-size: 3.5rem; }
.screen-ideas { display: grid; gap: 12px; }
.screen-idea { padding: 18px; border-left: 4px solid #8faeff; border-radius: 4px 12px 12px 4px; background: rgba(255,255,255,.08); font-size: 1.15rem; }
.screen-footer { padding: 18px 42px; display: flex; justify-content: center; gap: 10px; color: #8d99b1; }
.screen-footer b { color: white; letter-spacing: .12em; }

dialog { width: min(520px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 19px; background: transparent; box-shadow: 0 30px 100px rgba(17,24,39,.3); }
dialog::backdrop { background: rgba(9,14,27,.58); backdrop-filter: blur(5px); }
.dialog-card { position: relative; padding: 28px; border-radius: 19px; background: white; }
.dialog-card h2 { margin: 0; font-size: 1.65rem; letter-spacing: -.035em; }
.dialog-card > p:not(.eyebrow) { margin: 8px 0 22px; color: var(--muted); }
.dialog-card label { margin-top: 14px; }
.dialog-close { position: absolute; top: 16px; right: 16px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--wash); color: var(--muted); font-size: 1.3rem; }
.poll-dialog-card { max-height: min(760px, calc(100vh - 28px)); overflow-y: auto; }
.poll-templates { display: flex; gap: 6px; overflow-x: auto; }
.option-inputs { display: grid; gap: 8px; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 23px; }
.danger-copy { color: var(--red); }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 20; max-width: min(430px, calc(100% - 28px)); padding: 12px 17px; border-radius: 11px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: white; box-shadow: 0 14px 40px rgba(17,24,39,.25); font-size: .88rem; font-weight: 700; transition: opacity .18s ease, transform .18s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1120px) {
  .teacher-shell { grid-template-columns: 165px minmax(380px, 1fr); }
  .teacher-controls { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); }
  .screen-content { grid-template-columns: 1fr; align-content: center; }
}

@media (max-width: 850px) {
  .welcome-shell { grid-template-columns: 1fr; padding-top: 38px; gap: 52px; }
  .join-panel { max-width: none; }
  .participation-card { max-width: 590px; }
  .student-shell { grid-template-columns: 1fr; gap: 22px; padding-top: 30px; }
  .student-tools { position: static; }
  .teacher-topbar { grid-template-columns: 1fr auto; }
  .teacher-topbar .secondary-button { grid-column: 1 / -1; }
  .teacher-shell { grid-template-columns: 1fr; }
  .lesson-rail { overflow-x: auto; }
  .lesson-rail ol { display: flex; }
  .phase-button { min-width: 130px; }
  .rail-summary { display: flex; }
  .teacher-controls { grid-column: auto; grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .site-header { width: calc(100% - 28px); height: 72px; }
  .connection-badge { display: none; }
  .welcome-shell { width: calc(100% - 28px); min-height: auto; padding: 30px 0 55px; }
  .join-panel h1 { font-size: clamp(2.7rem, 14vw, 4rem); }
  .intro { margin: 21px 0 31px; font-size: 1rem; }
  .code-row { grid-template-columns: 1fr; }
  .teacher-entry { flex-wrap: wrap; }
  .participation-card { padding: 16px; }
  .room-bar { width: calc(100% - 28px); grid-template-columns: 1fr auto; }
  .room-bar-centre { grid-row: 2; grid-column: 1 / -1; margin-top: 10px; justify-content: space-between; }
  .student-shell { width: calc(100% - 28px); padding-bottom: 50px; }
  .student-prompt { padding-top: 35px; }
  .student-prompt h2 { font-size: 2.25rem; }
  .poll-card, .published-board { padding: 18px; }
  .teacher-view { padding: 0 8px 42px; }
  .teacher-topbar { grid-template-columns: 1fr; }
  .teacher-share { justify-content: space-between; }
  .teacher-share > span { display: none; }
  .teacher-share button { width: 100%; justify-content: space-between; }
  .current-prompt-card { flex-direction: column; }
  .inbox-heading { align-items: start; flex-direction: column; }
  .screen-header { padding: 20px; }
  .screen-header > div:last-child span { display: none; }
  .screen-content { padding: 38px 20px; }
  .screen-prompt h1 { font-size: 2.75rem; }
  .screen-footer { padding: 16px 20px; }
}

@media (prefers-reduced-motion: no-preference) {
  .participation-card { animation: arrive .5s cubic-bezier(.2,.8,.2,1) both; }
  @keyframes arrive { from { opacity: 0; transform: translateY(14px); } }
}

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