:root {
  color-scheme: light;
  --dojo-red: #fa0900;
  --dojo-pink: #ff4bd8;
  --dojo-purple: #87328f;
  --dojo-yellow: #ffe90f;
  --dojo-wood: #d89b16;
  --dojo-green: #0c852b;
  --dojo-lime: #c6ff57;
  --dojo-blue: #2957ff;
  --dojo-sky: #63b5ef;
  --ink: #080914;
  --paper: #fff8df;
  --cream: #fff0bc;
  --muted: #634a35;
  --line: #080914;
  --shadow: rgba(8, 9, 20, 0.34);
  --hit: #60ff7f;
  --warn: #ff4d24;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 75, 216, 0.9) 0 42px, transparent 42px),
    linear-gradient(180deg, var(--dojo-red) 0 58%, var(--dojo-yellow) 58% 100%);
  color: var(--ink);
  font: 16px/1.5 "Trebuchet MS", "Comic Sans MS", ui-rounded, system-ui, sans-serif;
  overflow-x: hidden;
}

body::before {
  background:
    repeating-linear-gradient(0deg, rgba(120, 69, 4, 0.22) 0 2px, transparent 2px 12px),
    linear-gradient(90deg, var(--dojo-wood), #ffd34a 40%, var(--dojo-wood));
  border-bottom: 6px solid #7b4c08;
  content: "";
  height: 56px;
  left: 0;
  position: fixed;
  right: 0;
  top: 34px;
  z-index: -1;
}

body::after {
  background:
    linear-gradient(90deg, transparent 0 12%, var(--dojo-green) 12% 13%, transparent 13% 48%, var(--dojo-green) 48% 49%, transparent 49% 87%, var(--dojo-green) 87% 88%, transparent 88%),
    repeating-linear-gradient(0deg, rgba(8, 137, 37, 0.15) 0 2px, transparent 2px 18px),
    linear-gradient(90deg, rgba(198, 255, 87, 0.42), rgba(255, 233, 15, 0.12));
  bottom: 0;
  content: "";
  height: 33vh;
  left: 0;
  pointer-events: none;
  position: fixed;
  right: 0;
  z-index: -1;
}

button,
input {
  font: inherit;
}

.shell {
  margin: 0 auto;
  padding: 0 0 36px;
  width: 100%;
}

.compact-shell {
  padding-top: 0;
}

.dojo-scroll-scene {
  min-height: 188vh;
  position: relative;
}

.dojo-scroll-sticky {
  min-height: 100vh;
  overflow: hidden;
  position: sticky;
  top: 0;
}

.dojo-stage {
  background:
    linear-gradient(180deg, rgba(8, 9, 20, 0.28), transparent 22%, transparent 72%, rgba(8, 9, 20, 0.22)),
    var(--dojo-yellow);
  inset: 0;
  position: absolute;
}

.dojo-frame {
  aspect-ratio: 1920 / 1443;
  height: min(100vh, calc(100vw * 1443 / 1920));
  left: 50%;
  min-height: 720px;
  min-width: min(100vw, calc(100vh * 1920 / 1443));
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%) scale(1.02);
  transform-origin: center center;
  width: min(100vw, calc(100vh * 1920 / 1443));
}

.dojo-plate {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.dojo-sprite {
  display: block;
  filter: drop-shadow(0 14px 8px rgba(8, 9, 20, 0.26));
  height: auto;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  will-change: opacity, transform;
}

.dojo-sprite-onion {
  left: 3.4%;
  top: 4%;
  width: 49%;
}

.dojo-sprite-parappa {
  left: 50%;
  top: 28.5%;
  width: 38%;
}

.scroll-cue {
  align-items: center;
  background: var(--paper);
  border: 5px solid var(--line);
  border-radius: 999px;
  bottom: max(22px, env(safe-area-inset-bottom));
  box-shadow: 7px 7px 0 rgba(8, 9, 20, 0.24);
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 900;
  left: 50%;
  min-height: 44px;
  padding: 8px 16px;
  position: absolute;
  text-transform: uppercase;
  transform: translateX(-50%);
  transition: opacity 140ms linear;
}

.scroll-cue::after {
  border-bottom: 4px solid var(--line);
  border-right: 4px solid var(--line);
  content: "";
  height: 10px;
  margin-left: 10px;
  transform: rotate(45deg) translateY(-3px);
  width: 10px;
}

.mic-dock {
  align-items: start;
  bottom: clamp(12px, 3vh, 28px);
  display: grid;
  gap: 8px 12px;
  grid-template-columns: minmax(250px, 0.62fr) minmax(360px, 1fr);
  left: 50%;
  margin: 0;
  max-height: calc(100vh - 24px);
  opacity: 0;
  overflow: auto;
  position: absolute;
  transform: translate(-50%, 58vh) scale(0.98);
  width: min(1160px, calc(100vw - 24px));
  z-index: 4;
}

.mic-dock .record-copy {
  grid-column: 1;
  max-width: none;
}

.mic-dock .record-toolbar {
  grid-column: 1;
}

.mic-dock .mic-telemetry {
  grid-column: 2;
  grid-row: 1 / span 3;
}

.mic-telemetry {
  display: grid;
  gap: 8px;
}

.mic-telemetry .model-loader,
.mic-telemetry .meter,
.mic-telemetry .scope-wrap {
  margin-top: 0;
}

.mic-dock .status {
  grid-column: 1;
  margin-top: 0;
}

.mic-dock #scope {
  height: 96px;
}

.mic-output-panels {
  display: grid;
  gap: 10px;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
}

.dashboard-grid {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  margin: 14px auto 0;
  width: min(760px, calc(100vw - 20px));
}

.flow-panel {
  grid-column: 1;
}

.result-panel {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.backend-panel {
  grid-column: 1;
}

.record-console {
  background:
    radial-gradient(circle at 92% 12%, rgba(255, 75, 216, 0.22), transparent 180px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), transparent 42%),
    var(--paper);
  border: 7px solid var(--line);
  border-radius: 20px;
  box-shadow: 12px 12px 0 var(--shadow);
  margin: 0 auto 12px 0;
  max-width: 100%;
  padding: clamp(12px, 2vw, 18px);
}

.record-copy {
  max-width: 740px;
}

.record-copy h1 {
  font-size: clamp(2rem, 2.65rem, 2.9rem);
  margin-bottom: 8px;
}

.mic-dock .record-copy h1 {
  font-size: clamp(1.55rem, 2.15vw, 2.2rem);
  line-height: 0.96;
  margin-bottom: 4px;
}

.record-copy p:not(.eyebrow) {
  margin-bottom: 8px;
}

.mic-dock .record-copy p:not(.eyebrow) {
  font-size: 0.9rem;
  line-height: 1.22;
  margin-bottom: 0;
}

.record-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.record-toolbar .badge {
  min-height: 48px;
}

.model-loader {
  background: rgba(255, 248, 223, 0.82);
  border: 5px solid var(--line);
  border-radius: 14px;
  box-shadow: 6px 6px 0 rgba(8, 9, 20, 0.18);
  margin-top: 10px;
  padding: 8px 10px;
}

.model-loader.ready {
  background: rgba(96, 255, 127, 0.82);
}

.model-loader.failed {
  background: rgba(255, 77, 36, 0.86);
  color: var(--paper);
}

.mic-telemetry.model-ready .model-loader {
  display: none;
}

.mic-telemetry .scope-wrap {
  display: none;
}

.mic-telemetry.model-ready .scope-wrap {
  display: block;
}

.model-loader-top {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 6px;
}

.model-loader-top strong,
.model-loader-top span {
  font-weight: 900;
  text-transform: uppercase;
}

.model-loader-top span {
  color: var(--muted);
  font-size: 0.85rem;
}

.model-loader.failed .model-loader-top span {
  color: var(--paper);
}

.model-progress {
  background: rgba(8, 9, 20, 0.14);
  border: 4px solid var(--line);
  border-radius: 999px;
  height: 14px;
  overflow: hidden;
}

.model-progress span {
  background: linear-gradient(90deg, var(--dojo-pink), var(--dojo-yellow), var(--hit));
  display: block;
  height: 100%;
  transition: width 180ms ease;
  width: 0;
}

.hero {
  align-items: end;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 460px);
  min-height: 420px;
  padding-top: 48px;
}

.hero-copy {
  background: rgba(255, 248, 223, 0.9);
  border: 7px solid var(--ink);
  border-radius: 34px 34px 12px 34px;
  box-shadow: 14px 14px 0 var(--shadow);
  padding: clamp(22px, 5vw, 42px);
  transform: rotate(-1deg);
}

.hero-card {
  background: var(--paper);
  border: 7px solid var(--ink);
  border-radius: 28px;
  box-shadow: 12px 12px 0 var(--shadow);
  padding: 14px;
  position: relative;
  transform: rotate(1.5deg);
}

.hero-card img {
  display: block;
  width: 100%;
}

.hero-sticker {
  background: var(--dojo-yellow);
  border: 5px solid var(--ink);
  border-radius: 999px;
  bottom: 18px;
  box-shadow: 5px 5px 0 rgba(8, 9, 20, 0.28);
  font-weight: 900;
  left: 20px;
  letter-spacing: 0.04em;
  padding: 8px 14px;
  position: absolute;
  text-transform: uppercase;
}

.eyebrow {
  color: var(--dojo-purple);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.1rem, 4rem, 4.35rem);
  letter-spacing: 0;
  line-height: 0.86;
  margin-bottom: 18px;
  text-transform: uppercase;
}

h2 {
  font-size: clamp(1.25rem, 1.75rem, 2rem);
  letter-spacing: 0;
  line-height: 0.95;
  margin-bottom: 6px;
  text-transform: uppercase;
}

p {
  color: var(--muted);
  font-weight: 700;
}

.panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), transparent 38%),
    var(--cream);
  border: 6px solid var(--line);
  border-radius: 24px;
  box-shadow: 12px 12px 0 var(--shadow);
  margin: 12px 0;
  padding: clamp(12px, 2vw, 18px);
}

.panel:nth-of-type(2n) {
  background:
    repeating-linear-gradient(0deg, rgba(8, 9, 20, 0.05) 0 2px, transparent 2px 18px),
    #ffdd3b;
}

.panel-heading {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.badge {
  background: var(--paper);
  border: 4px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 0.85rem;
  font-weight: 900;
  padding: 6px 12px;
  text-transform: uppercase;
}

.badge.ready {
  background: var(--hit);
  color: var(--ink);
}

.badge.recording {
  background: var(--warn);
  color: var(--paper);
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  color: var(--muted);
  display: grid;
  font-size: 0.9rem;
  font-weight: 900;
  gap: 8px;
  text-transform: uppercase;
}

input {
  background: var(--paper);
  border: 4px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  min-width: 0;
  padding: 12px 14px;
}

input[type="file"] {
  padding: 10px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

button {
  background: var(--dojo-lime);
  border: 5px solid var(--line);
  border-radius: 999px;
  box-shadow: 5px 5px 0 rgba(8, 9, 20, 0.28);
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  padding: 11px 18px;
  text-transform: uppercase;
}

button:hover:not(:disabled) {
  transform: translate(-1px, -1px);
}

button.secondary {
  background: var(--dojo-sky);
}

button.danger {
  background: var(--warn);
  color: var(--paper);
}

button:disabled {
  cursor: not-allowed;
  filter: grayscale(1);
  opacity: 0.48;
}

.status {
  margin: 14px 0 0;
}

.meter,
.bar {
  background: rgba(8, 9, 20, 0.12);
  border: 4px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.meter {
  height: 16px;
  margin-top: 10px;
}

.meter span,
.bar i {
  background: linear-gradient(90deg, var(--dojo-green), var(--dojo-lime), var(--dojo-yellow));
  display: block;
  height: 100%;
  transition: width 120ms linear;
  width: 0;
}

.scope-wrap {
  background: #10151f;
  border: 6px solid var(--line);
  border-radius: 20px;
  box-shadow: inset 0 0 0 4px rgba(255, 233, 15, 0.18);
  margin-top: 10px;
  overflow: hidden;
}

.scope-label {
  align-items: center;
  background: var(--dojo-purple);
  color: var(--paper);
  display: flex;
  font-size: 0.8rem;
  font-weight: 900;
  justify-content: space-between;
  letter-spacing: 0;
  padding: 6px 10px;
  text-transform: uppercase;
}

#scope {
  display: block;
  height: 148px;
  width: 100%;
}

.flow-panel {
  background:
    linear-gradient(90deg, rgba(255, 75, 216, 0.16), transparent),
    var(--paper);
  overflow: hidden;
  position: relative;
}

.flow-panel > *:not(.signal-path):not(.signal-droplet) {
  position: relative;
  z-index: 2;
}

.flow-route {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  margin-bottom: 10px;
}

.flow-step {
  background: var(--cream);
  border: 5px solid var(--line);
  border-radius: 18px;
  box-shadow: 6px 6px 0 rgba(8, 9, 20, 0.2);
  min-height: 62px;
  padding: 8px 10px;
}

.flow-step.active {
  background: var(--dojo-sky);
}

.flow-step strong,
.flow-step small {
  display: block;
}

.flow-step strong {
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
}

.flow-step small {
  color: var(--muted);
  font-weight: 900;
}

.flow-icon {
  display: block;
  font-family: "Courier New", monospace;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 4px;
}

.flow-arrow {
  color: var(--dojo-purple);
  font-size: 1.5rem;
  font-weight: 900;
}

.flow-heads {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.flow-head {
  background: var(--cream);
  border: 4px solid var(--line);
  border-radius: 16px;
  box-shadow: 4px 4px 0 rgba(8, 9, 20, 0.18);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 58px;
  padding: 8px;
}

.flow-head-main {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: 14px minmax(0, 1fr) auto;
}

.flow-head.hit {
  background: var(--hit);
  box-shadow: 0 0 0 5px rgba(96, 255, 127, 0.28);
}

.flow-head strong {
  font-size: 0.7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.flow-head small {
  color: var(--muted);
  font-weight: 900;
  font-size: 0.68rem;
  min-width: 3.35rem;
  text-align: right;
}

.mic-dock .panel {
  border-width: 4px;
  border-radius: 14px;
  box-shadow: 5px 5px 0 rgba(8, 9, 20, 0.2);
  margin: 0;
  padding: 10px;
}

.mic-dock .panel-heading {
  align-items: center;
  margin-bottom: 6px;
}

.mic-dock .panel-heading p {
  display: none;
}

.mic-dock .panel h2 {
  font-size: 1rem;
}

.mic-dock .flow-route {
  gap: 5px;
  margin-bottom: 6px;
}

.mic-dock .flow-step {
  border-width: 3px;
  border-radius: 10px;
  box-shadow: none;
  min-height: 44px;
  padding: 5px 6px;
}

.mic-dock .flow-icon {
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.mic-dock .flow-step strong {
  font-size: 0.75rem;
}

.mic-dock .flow-step small {
  font-size: 0.66rem;
}

.mic-dock .flow-arrow {
  font-size: 1rem;
}

.mic-dock .flow-heads,
.mic-dock .heads {
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 124px;
  overflow: auto;
  padding-right: 2px;
}

.mic-dock .flow-head {
  border-width: 3px;
  border-radius: 10px;
  box-shadow: none;
  gap: 4px;
  min-height: 0;
  padding: 6px;
}

.mic-dock .donate-head-button,
.mic-dock .route-labeler {
  display: none;
}

.node-light {
  background: #4f4f4f;
  border: 2px solid var(--line);
  border-radius: 50%;
  height: 12px;
  width: 12px;
}

.signal-path {
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transition: opacity 180ms ease;
  z-index: 1;
}

.signal-path.active {
  opacity: 1;
}

.signal-path path {
  fill: none;
  stroke: #60ff7f;
  stroke-dasharray: 11 10;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 7;
  filter: drop-shadow(0 0 9px rgba(96, 255, 127, 0.86));
  animation: signal-dash 650ms linear infinite;
}

.signal-path.no-hit path {
  stroke: rgba(96, 255, 127, 0.62);
  stroke-dasharray: 5 16;
}

.signal-droplet {
  background: #60ff7f;
  border: 3px solid var(--line);
  border-radius: 50%;
  box-shadow: 0 0 16px rgba(96, 255, 127, 0.9);
  height: 18px;
  left: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 0;
  transform: translate(-50%, -50%);
  transition:
    left 220ms ease,
    top 220ms ease,
    opacity 160ms ease;
  width: 18px;
  z-index: 3;
}

.signal-droplet.active {
  opacity: 1;
}

.signal-droplet.no-hit {
  animation: drip-out 900ms ease-in-out infinite;
}

@keyframes signal-dash {
  to {
    stroke-dashoffset: -42;
  }
}

@keyframes drip-out {
  0%, 100% {
    transform: translate(-50%, -50%) scale(0.8);
  }
  50% {
    transform: translate(-50%, 18px) scale(0.35);
  }
}

.flow-head.hit .node-light {
  background: var(--dojo-yellow);
}

.donate-head-button {
  align-items: center;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.85), transparent 20%),
    linear-gradient(180deg, #ffb4eb 0%, var(--dojo-pink) 58%, #b52aa4 100%);
  border: 5px solid var(--line);
  border-radius: 22px;
  box-shadow:
    inset 0 7px 0 rgba(255, 255, 255, 0.32),
    inset 0 -8px 0 rgba(8, 9, 20, 0.16),
    0 8px 0 #5f1b5b,
    7px 12px 0 rgba(8, 9, 20, 0.22);
  color: var(--paper);
  display: flex;
  justify-content: center;
  letter-spacing: 0.04em;
  min-height: 48px;
  padding: 10px 12px 14px;
  text-shadow: 2px 2px 0 rgba(8, 9, 20, 0.35);
  width: 100%;
}

body:not(.labeler-open) .donate-head-button {
  display: none;
}

.donate-head-button:hover:not(:disabled) {
  transform: translateY(2px) scale(1.015);
}

.donate-head-button:active:not(:disabled) {
  box-shadow:
    inset 0 5px 0 rgba(255, 255, 255, 0.22),
    inset 0 -5px 0 rgba(8, 9, 20, 0.18),
    0 3px 0 #5f1b5b,
    4px 6px 0 rgba(8, 9, 20, 0.22);
  transform: translateY(6px) scale(0.98);
}

.route-labeler {
  background:
    linear-gradient(135deg, rgba(96, 255, 127, 0.22), transparent 42%),
    rgba(255, 248, 223, 0.92);
  border: 5px solid var(--line);
  border-radius: 18px;
  box-shadow: 8px 8px 0 rgba(8, 9, 20, 0.2);
  margin-top: 10px;
  padding: 0;
}

.route-labeler-heading {
  align-items: start;
  cursor: pointer;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  list-style: none;
  padding: 12px;
}

.route-labeler-heading::-webkit-details-marker {
  display: none;
}

.route-labeler[open] .route-labeler-heading {
  border-bottom: 4px solid var(--line);
}

.route-labeler h3 {
  font-size: clamp(1rem, 1.2rem, 1.35rem);
  letter-spacing: 0;
  line-height: 0.95;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.route-labeler p {
  margin-bottom: 0;
}

.route-labeler > :not(summary) {
  margin-left: 12px;
  margin-right: 12px;
}

.audio-tag-strip {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 14px;
}

.audio-tag-node {
  background:
    radial-gradient(circle at 24% 20%, rgba(255, 255, 255, 0.78), transparent 22%),
    linear-gradient(180deg, var(--dojo-yellow), #ffb21a);
  border: 4px solid var(--line);
  border-radius: 999px;
  box-shadow:
    inset 0 5px 0 rgba(255, 255, 255, 0.3),
    inset 0 -6px 0 rgba(8, 9, 20, 0.12),
    4px 7px 0 rgba(8, 9, 20, 0.22);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  padding: 10px 12px 12px;
  text-align: center;
  text-transform: uppercase;
}

.best-match {
  align-items: baseline;
  background:
    radial-gradient(circle at 92% 20%, rgba(255, 75, 216, 0.25), transparent 180px),
    var(--paper);
  border: 6px solid var(--line);
  border-radius: 22px;
  box-shadow: 8px 8px 0 rgba(8, 9, 20, 0.24);
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  padding: 16px;
}

.best-match .label,
.best-match .score {
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
}

.best-match strong {
  font-size: clamp(2rem, 3.65rem, 4.2rem);
  letter-spacing: 0;
  line-height: 0.9;
  text-transform: uppercase;
}

.mic-dock .best-match {
  border-width: 4px;
  border-radius: 14px;
  box-shadow: none;
  gap: 5px;
  margin-bottom: 8px;
  padding: 10px;
}

.mic-dock .best-match strong {
  font-size: clamp(1.35rem, 2.5vw, 2.2rem);
}

.heads {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.head-card {
  background: var(--paper);
  border: 4px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}

.mic-dock .head-card {
  border-width: 3px;
  border-radius: 10px;
  padding: 8px;
}

.head-card.matched {
  background: var(--hit);
  box-shadow: 0 0 0 6px rgba(96, 255, 127, 0.25);
}

.head-label {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.mic-dock .head-label {
  gap: 6px;
  margin-bottom: 6px;
}

.mic-dock .head-label strong,
.mic-dock .head-label span {
  font-size: 0.72rem;
}

.head-label strong {
  text-transform: uppercase;
}

.head-label span {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
}

.bar {
  height: 14px;
}

.mic-dock .bar {
  height: 10px;
}

.quality-card {
  background: rgba(255, 248, 223, 0.88);
  border: 5px solid var(--line);
  border-radius: 18px;
  margin-top: 16px;
  margin-bottom: 16px;
  padding: 14px;
}

.quality-card strong,
.mini-heading,
legend {
  font-weight: 900;
  text-transform: uppercase;
}

.quality-gates {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.quality-gates li {
  background: rgba(8, 9, 20, 0.08);
  border: 3px solid rgba(8, 9, 20, 0.35);
  border-radius: 12px;
  font-weight: 800;
  padding: 8px 10px;
}

.quality-gates li.pass {
  background: rgba(96, 255, 127, 0.45);
}

.quality-gates li.fail {
  background: rgba(255, 77, 36, 0.25);
}

.feedback-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(240px, 0.8fr) minmax(280px, 1.2fr);
}

fieldset {
  background: rgba(255, 248, 223, 0.82);
  border: 4px solid var(--line);
  border-radius: 16px;
  margin: 0;
  padding: 12px;
}

.radio-row,
.consent-row {
  align-items: center;
  display: flex;
  gap: 10px;
  text-transform: none;
}

.radio-row + .radio-row {
  margin-top: 10px;
}

textarea {
  background: var(--paper);
  border: 4px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font: inherit;
  min-height: 120px;
  padding: 12px;
  resize: vertical;
}

.mini-heading {
  display: block;
  margin: 18px 0 10px;
}

.feedback-heads {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.feedback-head-option {
  align-items: center;
  background: var(--cream);
  border: 4px solid var(--line);
  border-radius: 999px;
  display: flex;
  gap: 10px;
  font-weight: 900;
  padding: 10px 12px;
  text-transform: uppercase;
}

.feedback-head-option input,
.radio-row input,
.consent-row input {
  accent-color: var(--dojo-green);
  min-width: 18px;
}

.consent-row {
  background: rgba(255, 248, 223, 0.78);
  border: 4px solid var(--line);
  border-radius: 16px;
  margin-top: 16px;
  padding: 12px;
}

.backend-table {
  background: var(--paper);
  border: 5px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.backend-table [role="row"] {
  display: grid;
  gap: 12px;
  grid-template-columns: 160px 140px 1fr;
  padding: 12px 14px;
}

.backend-table [role="row"] + [role="row"] {
  border-top: 4px solid var(--line);
}

.table-head {
  background: var(--dojo-pink);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 900;
  text-transform: uppercase;
}

.supported {
  color: var(--dojo-green);
  font-weight: 900;
}

code {
  background: rgba(8, 9, 20, 0.08);
  border: 2px solid rgba(8, 9, 20, 0.4);
  border-radius: 6px;
  padding: 2px 5px;
}

@media (max-width: 920px) {
  .dashboard-grid,
  .mic-output-panels {
    grid-template-columns: 1fr;
  }

  .flow-panel,
  .result-panel,
  .backend-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero-card {
    max-width: 560px;
  }

  .flow-route,
  .feedback-grid {
    grid-template-columns: 1fr;
  }

  .flow-arrow {
    text-align: center;
    transform: rotate(90deg);
  }
}

@media (max-width: 760px) {
  .dojo-scroll-scene {
    min-height: 176vh;
  }

  .dojo-frame {
    min-height: 620px;
    min-width: 826px;
  }

  .dojo-sprite-onion {
    left: 15%;
    top: 8%;
    width: 42%;
  }

  .dojo-sprite-parappa {
    left: 41%;
    top: 31%;
    width: 33%;
  }

  .mic-dock {
    bottom: 10px;
    grid-template-columns: 1fr;
    width: min(720px, calc(100vw - 16px));
  }

  .mic-dock .record-copy,
  .mic-dock .record-toolbar,
  .mic-dock .mic-telemetry,
  .mic-dock .mic-output-panels,
  .mic-dock .status {
    grid-column: 1;
    grid-row: auto;
  }

  .record-copy h1 {
    font-size: clamp(1.75rem, 2.05rem, 2.25rem);
    line-height: 0.94;
  }

  .mic-dock .record-copy p:not(.eyebrow) {
    display: none;
  }

  .record-copy p:not(.eyebrow),
  .model-loader,
  .status {
    font-size: 0.9rem;
  }

  .scope-label {
    align-items: flex-start;
    display: grid;
    gap: 2px;
  }

  #scope {
    height: 92px;
  }

  .mic-dock .flow-heads,
  .mic-dock .heads {
    max-height: 104px;
  }

  .grid.two,
  .backend-table [role="row"] {
    grid-template-columns: 1fr;
  }

  .panel-heading {
    display: grid;
  }

  .hero-copy,
  .hero-card,
  .panel {
    box-shadow: 7px 7px 0 var(--shadow);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dojo-sprite,
  .scroll-cue,
  .mic-dock {
    transition: none;
  }
}
