:root {
  color-scheme: light;
  font-family: Tahoma, Arial, sans-serif;
  color: #232849;
  background: #232849;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 32px 24px;
  place-items: center;
  font-size: 15px;
  line-height: 1.95;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
button, input, textarea, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #929bc9; outline-offset: 4px; }

main {
  width: min(100%, 640px);
  min-width: 0;
  min-height: 280px;
  padding: 36px;
  border-radius: 20px;
  background: #fff;
}

main.wide { width: min(100%, 1040px); }
h1, h2, p { margin: 0; }
h1 { font-size: 24px; font-weight: 700; line-height: 1.7; }
h2 { font-size: 16px; font-weight: 700; }
strong { font-weight: 700; }
.intro { margin-top: 12px; color: #53596c; }
.secondary-text { color: #64697a; font-size: 13px; }
.screen > .button:last-child { margin-top: 24px; }

.instructions { display: grid; gap: 12px; margin: 22px 0 28px; padding-inline-start: 22px; }
.instructions li { padding-inline-start: 3px; }
.detailed { gap: 15px; }
.stack { display: grid; gap: 12px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.full-width { width: 100%; }

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border: 1.5px solid #232849;
  border-radius: 999px;
  font-weight: 700;
  line-height: 1.7;
  text-align: center;
}

.primary { background: #232849; color: #fff; }
.primary:hover:enabled { background: #343b62; }
.secondary { background: #fff; color: #232849; }
.secondary:hover:enabled { background: #f3f4f8; }
.text-button { min-height: 44px; padding: 6px 2px; border: 0; background: transparent; color: #232849; font-size: 13px; text-underline-offset: 5px; }
.text-button:hover:enabled { text-decoration: underline; }

input[type="text"], input[type="password"], textarea {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #d3d6e0;
  border-radius: 12px;
  background: #fff;
  color: #232849;
  font-size: 16px;
  line-height: 1.8;
}

input::placeholder, textarea::placeholder { color: #85899a; font-size: 14px; }
input[type="password"] { direction: ltr; }
textarea { resize: vertical; min-height: 112px; }
textarea:disabled { background: #f4f5f8; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
input[type="checkbox"] { flex: 0 0 auto; width: 18px; height: 18px; margin: 6px 0 0; accent-color: #232849; }

.account-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid #e9eaf0; color: #64697a; font-size: 12px; }
.notice { padding: 12px 14px; margin-bottom: 18px; border-radius: 10px; background: #f0f2f9; color: #373f66; font-size: 13px; }
.error { background: #fff0ee; color: #9b352c; }
.timer-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid #e9eaf0; }
.countdown { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.timer-bar.ending { color: #a54622; }

.equipment-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; margin: 24px 0; }
.equipment-controls { align-content: start; }
.devices-panel { display: grid; gap: 10px; }
.camera-window { position: relative; display: grid; aspect-ratio: 4 / 3; overflow: hidden; place-items: center; border-radius: 14px; background: #f0f1f6; color: #72788f; }
.camera-window video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.camera-window p { position: absolute; padding: 12px; text-align: center; pointer-events: none; }
.device-status, .microphone-status { color: #64697a; font-size: 12px; }
.device-status.available, .microphone-status.available { color: #2c6558; }
.microphone-status { display: grid; gap: 7px; }
meter { width: 100%; height: 8px; direction: ltr; }
meter::-webkit-meter-bar { border: 0; border-radius: 8px; background: #edf0f5; }
meter::-webkit-meter-optimum-value { background: #65789a; border-radius: 8px; }
.audio-test { margin-top: 6px; padding-top: 16px; border-top: 1px solid #e9eaf0; }
audio { width: 100%; min-width: 0; }

.section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.quiz-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); align-items: start; gap: 28px; }
.quiz-sidebar { display: grid; gap: 12px; }
.quiz-sidebar .notice { margin: 0; }
.quiz-sidebar .text-button { justify-self: start; }
.conversation { display: grid; min-width: 0; gap: 22px; }
.messages { display: flex; min-height: 180px; max-height: 440px; flex-direction: column; align-items: flex-start; gap: 16px; overflow-y: auto; overscroll-behavior: contain; padding: 2px 4px 2px 2px; scrollbar-width: thin; }
.message { max-width: 93%; padding: 12px 15px; border-radius: 14px 14px 4px 14px; background: #f0f2f7; overflow-wrap: anywhere; }
.message.student { align-self: flex-end; border-radius: 14px 14px 14px 4px; background: #232849; color: #fff; }
.message-label { margin-bottom: 5px; font-size: 11px; opacity: .75; }
.message p { white-space: pre-wrap; font-size: 14px; }
.composer { display: grid; gap: 10px; padding-top: 18px; border-top: 1px solid #e9eaf0; }
.composer-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.transcript { display: grid; gap: 14px; margin-top: 24px; }
.student-footer { margin-top: 24px; font-size: 12px; text-align: center; }
.student-footer a { color: #64697a; text-decoration: none; }
.student-footer a:hover { text-decoration: underline; }
#completed > p { margin-top: 16px; }
#completed > button { margin-top: 24px; }

dialog { width: min(480px, calc(100% - 40px)); padding: 28px; border: 0; border-radius: 20px; color: #232849; background: #fff; }
dialog::backdrop { background: #11152999; }
dialog p { margin: 16px 0 24px; }

@media (max-width: 740px) {
  .equipment-layout, .quiz-layout { grid-template-columns: minmax(0, 1fr); }
  .quiz-sidebar { display: grid; grid-template-columns: minmax(0, 1fr); }
  .quiz-sidebar .devices-panel { max-width: 280px; }
  .quiz-sidebar .camera-window { aspect-ratio: 16 / 9; }
  .messages { max-height: 400px; }
}

@media (max-width: 480px) {
  body { padding: 18px 14px; }
  main { padding: 24px 20px; }
  h1 { font-size: 21px; }
  .instructions { gap: 12px; margin-top: 18px; }
  .button { padding-inline: 18px; }
  .account-bar { gap: 4px; }
  .equipment-layout { gap: 24px; }
  .composer-footer .button { width: 100%; }
}
.quiz-picker { display: grid; gap: 6px; margin-bottom: 22px; font-size: 14px; }
.quiz-picker select { width: 100%; min-width: 0; min-height: 44px; padding: 8px 12px; font: inherit; color: inherit; background: #fff; border: 1px solid #d3d6e0; border-radius: 10px; }
