:root {
  color-scheme: dark;
  font: 16px/1.65 system-ui, "PingFang TC", sans-serif;
  color: #f6f6f3;
  background: #101923;
}
* { box-sizing: border-box; }
body { margin: 0; }
.listen {
  width: min(960px, calc(100% - 40px));
  margin-inline: auto;
  padding-block: clamp(42px, 8vw, 88px);
}
h1 {
  margin: 0;
  font-size: clamp(2.3rem, 7vw, 4.5rem);
  line-height: 1.2;
}
p { margin: 16px 0 24px; color: #b9c1cb; }
.channels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr));
  gap: 12px;
}
.channel, .status {
  color: inherit;
  background: #1a2631;
  border: 1px solid #34404d;
  border-radius: 12px;
  padding: 18px;
}
.channel { font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.channel:hover, .channel[aria-pressed="true"] { border-color: #9ef0d1; }
.channel[aria-pressed="true"] { color: #9ef0d1; background: #203a36; }
.channel:focus-visible { outline: 2px solid #9ef0d1; outline-offset: 3px; }
.status { margin-top: 18px; }

#player { width: min(100%, 380px); margin-top: 18px; }

.login { display: grid; gap: 14px; max-width: 380px; }
.login label { display: grid; gap: 6px; }
.login input { width: 100%; padding: 12px; font: inherit; background: #1a2631; color: inherit; border: 1px solid #647484; border-radius: 8px; }
.login button { text-align: center; border-color: #9ef0d1; }
.login p { margin: 0; color: #ffb9b9; }
.status + form { margin-top: 16px; }

#event-logo { max-width: min(220px, 60%); max-height: 110px; object-fit: contain; display: block; margin: 0 auto 20px; }
.channels { grid-template-columns: repeat(2, minmax(0, 1fr)); }

#event-logo[hidden], #play-toggle[hidden] { display: none; }
#play-toggle { margin-top: 16px; padding: 10px 18px; }

#play-toggle { display: inline-flex; align-items: center; gap: 10px; }
.play-toggle-icon { display: inline-grid; place-items: center; width: 16px; height: 16px; }
.play-toggle-icon::before { content: ""; }
[data-icon="pause"] .play-toggle-icon::before {
  width: 12px;
  height: 14px;
  border-inline: 4px solid currentColor;
  box-sizing: border-box;
}
[data-icon="play"] .play-toggle-icon::before {
  border-block: 7px solid transparent;
  border-left: 11px solid currentColor;
}

#waveform {
  display: block;
  width: 100%;
  height: clamp(56px, 13vw, 104px);
  margin-top: 16px;
  border: 1px solid #34404d;
  border-radius: 12px;
  background: #141f2a;
}
#waveform[hidden] { display: none; }

.listen a { color: inherit; }

.teacher-shell {
  width: min(860px, calc(100% - 32px));
  margin: auto;
  padding: clamp(20px, 5vw, 52px) 0 max(24px, env(safe-area-inset-bottom));
}
.teacher-shell h1 { font-size: clamp(1.75rem, 5vw, 2.75rem); }
.teacher-shell h2 { margin: 0 0 .75rem; font-size: 1.2rem; }
.teacher-account { margin: .5rem 0 1rem; }
.teacher-workbench {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.teacher-card {
  min-width: 0;
  border: 1px solid #34404d;
  border-radius: 14px;
  background: #16232e;
  padding: clamp(12px, 3vw, 22px);
}
.teacher-output { grid-column: 1 / -1; }
.teacher-shell button, .teacher-shell select {
  min-height: 44px;
  max-width: 100%;
  padding: 8px 14px;
  color: inherit;
  background: #243442;
  border: 1px solid #647484;
  border-radius: 9px;
  font: inherit;
}
.teacher-shell button:disabled { opacity: .7; cursor: not-allowed; }
.teacher-shell button:focus-visible, .teacher-shell select:focus-visible {
  outline: 2px solid #a9ebff;
  outline-offset: 3px;
}
.teacher-card label { display: grid; gap: 6px; margin-bottom: 10px; }
.teacher-card audio { display: block; max-width: 100%; }
.teacher-card p { margin: 8px 0; }
#channel-occupancy { padding-inline-start: 1.2rem; margin: 0; overflow-wrap: anywhere; }
#output-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr));
  gap: 10px;
}
#output-buttons button {
  display: grid;
  min-height: 62px;
  padding: 8px;
  background: #194d36;
  border-color: #70cf9b;
  overflow-wrap: anywhere;
}
#output-buttons button[aria-pressed="true"] {
  color: #8c1025;
  background: #ffe34d;
  border: 2px solid #fff4a3;
  font-weight: 800;
}
#output-buttons small { color: #f6f6f3; font-size: .8rem; }
#output-buttons button[aria-pressed="true"] small { color: inherit; font-weight: 800; }
#speak { min-width: min(100%, 130px); font-weight: 700; }
@media (max-width: 580px) {
  .teacher-workbench { grid-template-columns: minmax(0, 1fr); }
  .teacher-card #speak { width: 100%; }
}

.workspace-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1rem;
  margin-bottom: 1rem;
}
.workspace-heading img {
  max-width: min(150px, 45%);
  max-height: 70px;
  object-fit: contain;
}
.workspace-heading h1 { min-width: 0; overflow-wrap: anywhere; }

.teacher-monitor { border-color: #487c9e; }
.teacher-monitor h2 { color: #a1dbff; }
.teacher-shell #monitor {
  background: #163b56;
  border-color: #71b8e8;
}
.teacher-mic {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .65rem 1rem;
  margin-top: .85rem;
  padding: .75rem 1rem;
  border: 1px solid #647484;
  border-radius: 12px;
  background: #202d39;
}
.teacher-mic[data-active="true"] {
  position: fixed;
  z-index: 5;
  inset: auto max(12px, calc((100vw - 860px) / 2)) max(12px, env(safe-area-inset-bottom));
  background: #751927;
  border: 2px solid #ffa5ae;
  box-shadow: 0 6px 24px #0008;
}
.teacher-mic[data-active="true"] #speak-status { color: #fff; font-weight: 750; }
.teacher-mic[data-active="true"] #speak {
  background: #fff0f1;
  color: #61111d;
  border-color: #fff0f1;
}
.teacher-mic-active .teacher-shell { padding-bottom: 9rem; }

.channel.channel-playing {
  color: #102b24;
  background: #99f1c2;
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px #268b64;
}
.teacher-channel-live {
  color: #401317;
  background: #ffb1b8;
  border-inline-start: 5px solid #f15263;
  padding: .18rem .5rem;
  font-weight: 800;
}

.live-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
  font-variant-numeric: tabular-nums;
}
.live-table th, .live-table td {
  text-align: left;
  border-bottom: 1px solid #557082;
  padding: .5rem clamp(.35rem, 2vw, 1rem);
  overflow-wrap: anywhere;
}
.admin-srt-input summary { cursor: pointer; margin-block: .6rem; }
