:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #080b0d;
  color: #eef8f4;
  --ink: #080b0d;
  --tile: #11171a;
  --tile-edge: rgba(188, 215, 204, 0.1);
  --panel: rgba(11, 18, 20, 0.82);
  --panel-border: rgba(122, 201, 190, 0.28);
  --text: #eef8f4;
  --muted: #99b6b0;
  --teal: #159c9a;
  --aqua: #5fd1cf;
  --green: #78b95c;
  --gold: #d59b43;
  --red: #d83316;
  --deep-blue: #0d4f8f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 82% 10%, rgba(95, 209, 207, 0.18), transparent 28%),
    radial-gradient(circle at 68% 76%, rgba(120, 185, 92, 0.14), transparent 32%),
    radial-gradient(circle at 18% 84%, rgba(216, 51, 22, 0.12), transparent 26%),
    linear-gradient(145deg, #14191a, var(--ink) 52%, #071311);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(33deg, transparent 8px, rgba(255, 255, 255, 0.035) 9px, transparent 10px),
    linear-gradient(113deg, transparent 14px, rgba(0, 0, 0, 0.4) 15px, transparent 16px),
    repeating-linear-gradient(132deg, rgba(255, 255, 255, 0.028) 0 2px, transparent 2px 42px),
    repeating-linear-gradient(24deg, transparent 0 18px, rgba(255, 255, 255, 0.022) 18px 20px);
  background-color: rgba(8, 11, 13, 0.92);
  background-size: 72px 64px, 88px 80px, 116px 116px, 92px 92px;
  opacity: 0.9;
}

button,
select {
  min-width: 88px;
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  font: inherit;
}

button {
  background: linear-gradient(135deg, var(--teal), #0f6f78);
  color: white;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(21, 156, 154, 0.2);
}

select {
  border: 1px solid rgba(122, 201, 190, 0.34);
  background: #101719;
  color: var(--text);
}

#startButton {
  display: inline-flex;
  min-width: 132px;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  order: 10;
}

.button-label,
.button-subheading {
  display: block;
  line-height: 1.15;
}

.button-subheading {
  font-size: 12px;
  opacity: 0.82;
}

button.secondary {
  background: #263235;
}

.audio-output-toggle {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(122, 201, 190, 0.34);
  background: #182326;
  color: #eef8f4;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: none;
}

.audio-output-toggle[aria-pressed="true"] {
  background: #0f6f78;
  border-color: #5fd1cf;
}

.lab-link {
  display: block;
  width: fit-content;
  margin-top: 12px;
  color: var(--aqua);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.lab-link:hover {
  color: var(--text);
}

.lab-link:focus-visible {
  outline: 2px solid var(--aqua);
  outline-offset: 4px;
}

button.active {
  background: linear-gradient(135deg, var(--gold), #8f5621);
  box-shadow: 0 10px 30px rgba(213, 155, 67, 0.24);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.voice-control {
  display: inline-flex;
  flex-direction: column;
  gap: 5px;
  min-width: 240px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.voice-control select {
  width: 100%;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  text-transform: none;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100vw - 32px));
  margin: 32px auto;
}

.panel,
article {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
}

.panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--aqua);
  font-size: 13px;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 32px;
}

h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.action-button {
  min-width: 180px;
}

button.challenge-action {
  background: linear-gradient(135deg, var(--red), #982613);
}

button.expand-action {
  background: linear-gradient(135deg, var(--green), #167e73);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1.3fr;
  gap: 16px;
  margin-top: 16px;
}

article {
  min-width: 0;
  padding: 18px;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

.scroll {
  min-height: 360px;
  max-height: 55vh;
  overflow: auto;
}

#transcript.scroll {
  padding-right: 10px;
}

@media (max-width: 820px) {
  .panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .grid {
    grid-template-columns: 1fr;
  }
}
