:root {
  color-scheme: light;
  font-family: Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #f1f3f4;
  color: #202124;
  font-size: 18px;
}

main {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 24px;
}

h1 {
  margin: 0 0 20px;
  font-size: 32px;
}

.panel {
  background: white;
  border: 2px solid #5f6368;
  border-radius: 8px;
  padding: 22px;
  margin-bottom: 18px;
}

.connection-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.connection-panel p { margin: 4px 0; }

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

label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

input, select, button { font: inherit; }

input, select {
  width: 100%;
  min-height: 50px;
  border: 2px solid #5f6368;
  border-radius: 5px;
  padding: 8px 10px;
  background: white;
}

#search { margin-top: 14px; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  font-weight: 700;
  cursor: pointer;
}

.checkbox-row input {
  width: 28px;
  height: 28px;
  min-height: 0;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  accent-color: #1967d2;
}

.summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 14px;
}

.summary button { min-height: 44px; }
.pupil { border-width: 4px; }

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.badge {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 5px;
  font-weight: 700;
}

.missing { background: #fce8e6; color: #a50e0e; }
.recorded { background: #e6f4ea; color: #137333; }

.pupil-name {
  margin: 18px 0 8px;
  font-size: clamp(32px, 6vw, 52px);
  line-height: 1.05;
}

.details { font-size: 20px; margin: 5px 0; }

.script {
  margin: 22px 0;
  padding: 18px;
  background: #e8f0fe;
  border-left: 8px solid #1967d2;
  font-size: 25px;
}

.filename {
  padding: 12px;
  background: #f8f9fa;
  border: 1px solid #bdc1c6;
  font-family: monospace;
  font-size: 20px;
}

.controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

button {
  min-height: 62px;
  border: 2px solid #3c4043;
  border-radius: 6px;
  padding: 10px 16px;
  background: white;
  color: #202124;
  font-weight: 700;
  cursor: pointer;
}

button:hover:not(:disabled) { filter: brightness(.95); }

button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 4px solid #fbbc04;
  outline-offset: 2px;
}

button:disabled { opacity: .42; cursor: not-allowed; }
.connect-btn { background: #1967d2; color: white; min-width: 220px; }
.record-btn { background: #c5221f; color: white; }
.stop-btn { background: #202124; color: white; }
.save-btn { background: #188038; color: white; font-size: 22px; }
.secondary { min-height: 46px; font-weight: 400; }
audio { width: 100%; margin-top: 16px; }

.message {
  display: none;
  padding: 18px;
  margin-bottom: 18px;
  border: 3px solid;
  border-radius: 6px;
  font-weight: 700;
  font-size: 21px;
}

.message.show { display: block; }
.message.info { background: #e8f0fe; border-color: #1967d2; color: #174ea6; }
.message.success { background: #e6f4ea; border-color: #188038; color: #0d652d; font-size: 28px; }
.message.error { background: #fce8e6; border-color: #c5221f; color: #a50e0e; }
.message.warning { background: #fef7e0; border-color: #f9ab00; color: #7a4d00; }
.duration { min-height: 26px; margin-top: 10px; font-weight: 700; }
.recording-now { color: #c5221f; }
.hidden { display: none !important; }

@media (max-width: 650px) {
  main { padding: 12px; }
  .chooser-grid, .controls { grid-template-columns: 1fr; }
  .summary, .status-row, .connection-panel { align-items: flex-start; flex-direction: column; }
  .connect-btn { width: 100%; }
}
