@font-face {
  font-family: Space Grotesk;
  src: url("assets/fonts/space-grotesk-400.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Space Grotesk;
  src: url("assets/fonts/space-grotesk-600.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: IBM Plex Mono;
  src: url("assets/fonts/ibm-plex-mono.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #08090a;
  --panel: #121416;
  --line: #2b2e32;
  --text: #e8e9e5;
  --muted: #a3a9ae;
  --mono: "IBM Plex Mono", monospace;
  font-family: "Space Grotesk", Arial, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
}
button:disabled,
input:disabled,
select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
a {
  color: inherit;
  text-decoration: none;
}
a:hover,
button.quiet-button:hover {
  color: white;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #eee;
  outline-offset: 5px;
}
[hidden] {
  display: none !important;
}
input[type="range"] {
  accent-color: #dfe3e6;
  cursor: pointer;
}
button,
a {
  touch-action: manipulation;
}
.skip {
  position: fixed;
  z-index: 20;
  top: -100px;
  left: 20px;
  padding: 12px;
  background: white;
  color: black;
}
.skip:focus {
  top: 10px;
}
.header {
  height: 76px;
  max-width: 1600px;
  padding: 0 4%;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.wordmark {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.6px;
}
.logo {
  font:
    35px/1 Georgia,
    serif;
  font-weight: 400;
  flex-shrink: 0;
}
.wordmark-label {
  display: none;
}
nav {
  display: flex;
  align-items: center;
  gap: 28px;
  color: var(--muted);
  font-size: 12px;
}
.quiet-button {
  background: none;
  border: 0;
  padding: 8px 0;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  min-height: 36px;
}
.icon-button {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 24px;
  width: 36px;
  min-height: 36px;
}
.visualizer {
  max-width: 1510px;
  margin: auto;
  padding: 0 4%;
}
.intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 25px 0 28px;
}
.eyebrow {
  font: 11px var(--mono);
  letter-spacing: 1.6px;
  color: var(--muted);
  margin: 0 0 14px;
}
h1 {
  font-size: clamp(34px, 3.2vw, 52px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -2px;
  margin: 0 0 13px;
}
.intro p:not(.eyebrow) {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}
.intro-stamp {
  font: 11px var(--mono);
  letter-spacing: 2px;
  color: var(--muted);
  padding-bottom: 2px;
}
.source-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 0 18px;
  flex-wrap: wrap;
}
.source-actions {
  display: flex;
  gap: 9px;
}
.source-button {
  border: 1px solid #34383d;
  background: #15171a;
  border-radius: 5px;
  padding: 10px 15px;
  color: var(--text);
  font-size: 12px;
  min-height: 39px;
}
.source-button:first-child {
  background: #e4e7e3;
  color: #121416;
  border-color: #e4e7e3;
}
.source-button:hover {
  border-color: #9ca3a8;
}
.source-label {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  flex: 1;
  font: 11px var(--mono);
  color: var(--muted);
}
.source-label #file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 480px;
}
.small-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #858d93;
  flex-shrink: 0;
}
.small-dot.active {
  background: #c5dace;
  box-shadow: 0 0 8px #d6ffe244;
}
.play {
  display: flex;
  gap: 9px;
  align-items: center;
  background: transparent;
  color: var(--text);
  border: 0;
  font-size: 12px;
  min-height: 40px;
  padding: 8px 0;
}
.play span:first-child {
  font-size: 12px;
}
.visual-shell {
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: #050607;
}
.stage {
  position: relative;
  height: clamp(420px, 58vh, 740px);
  background: #050607;
}
.stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.stage #scene-3d {
  position: absolute;
  inset: 0;
  touch-action: none;
  cursor: grab;
}
.stage #scene-3d:focus-visible {
  outline-offset: -5px;
}
.stage #scene-3d:active {
  cursor: grabbing;
}
.stage-top,
.stage-bottom {
  position: absolute;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  pointer-events: none;
  font: 11px var(--mono);
  letter-spacing: 1px;
  color: #a1a7ab;
  z-index: 1;
}
.stage-top {
  top: 23px;
}
.stage-bottom {
  bottom: 23px;
  letter-spacing: 0.3px;
}
.status-chip {
  font-size: 11px;
  border: 1px solid #3b3f42;
  border-radius: 3px;
  padding: 6px 8px;
  color: #aeb7bb;
  background: #080a0bcc;
}
.visual-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 17px;
  background: #111315;
  border-top: 1px solid var(--line);
}
.mode-tabs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.mode-tabs button {
  border: 0;
  border-radius: 4px;
  background: none;
  color: #adb3b9;
  padding: 10px 14px;
  font-size: 12px;
  min-height: 36px;
  white-space: nowrap;
}
.mode-tabs button:hover {
  background: #1b1e22;
  color: #eee;
}
.mode-tabs button[aria-selected="true"] {
  background: #e3e6e1;
  color: #0c0e0f;
}
.mode-tabs span {
  font: 11px var(--mono);
  margin-left: 4px;
  opacity: 0.8;
}
.view-actions {
  display: flex;
  gap: 22px;
  align-items: center;
}
.view-actions .quiet-button {
  font-size: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.bottom-bar {
  display: flex;
  gap: 28px;
  align-items: center;
  padding: 15px 0;
  min-height: 54px;
}
.signal-status {
  color: var(--muted);
  font: 11px/1.6 var(--mono);
  margin: 0;
  flex: 1;
  overflow-wrap: anywhere;
}
.signal-status.error {
  color: #f2bdb7;
}
.listening {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
}
.listening input {
  width: 95px;
  height: 16px;
}
.listening output {
  font: 11px var(--mono);
  width: 30px;
}
.footer {
  padding: 16px 0 25px;
  border-top: 1px solid #25282b;
  color: #a1a7ac;
  font-size: 11px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
}
.footer a {
  color: #c7cbd0;
}
.youtube-dock {
  position: absolute;
  right: 20px;
  top: 65px;
  width: 286px;
  background: #121416;
  border: 1px solid #454b52;
  border-radius: 5px;
  z-index: 2;
  box-shadow: 0 15px 50px #0008;
}
.dock-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  font-size: 11px;
}
.dock-top button {
  border: 0;
  background: none;
  font-size: 20px;
}
.youtube-dock iframe {
  width: 100%;
  height: 205px;
  border: 0;
  display: block;
  background: #08090a;
}
.dock-bottom {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.dock-bottom button {
  font-size: 11px;
  border: 1px solid #68737c;
  background: #23282c;
  padding: 8px;
  border-radius: 3px;
}
.dock-bottom a {
  font-size: 11px;
  color: #c2c9cd;
}
.youtube-dock p {
  font-size: 11px;
  line-height: 1.6;
  color: #b5bdc3;
  padding: 0 12px 12px;
  margin: 0;
}
.exit-fullscreen {
  position: absolute;
  bottom: 22px;
  right: 24px;
  z-index: 4;
  pointer-events: auto;
}
.visual-shell:fullscreen {
  border: 0;
  border-radius: 0;
  width: 100%;
  background: #050607;
  display: flex;
  flex-direction: column;
}
.visual-shell:fullscreen .stage {
  flex: 1;
  height: auto;
}
.visual-shell:fullscreen .visual-toolbar {
  flex-shrink: 0;
}
dialog {
  max-width: 600px;
  width: calc(100% - 32px);
  max-height: 88vh;
  color: var(--text);
  background: #15181b;
  border: 1px solid #4b5259;
  border-radius: 7px;
  padding: 28px;
  overflow: auto;
}
dialog::backdrop {
  background: #000a;
  backdrop-filter: blur(7px);
}
.dialog-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 25px;
}
.dialog-top .eyebrow {
  font-size: 11px;
  margin-bottom: 10px;
}
.dialog-top h2 {
  margin: 0;
  font-size: 25px;
  font-weight: 400;
  letter-spacing: -0.8px;
}
.close-button {
  background: none;
  border: 0;
  color: #bbc2c7;
  font-size: 23px;
  width: 28px;
  min-height: 30px;
  line-height: 1;
}
.settings-dialog {
  max-width: 380px;
  margin-right: max(4%, calc((100vw - 1510px) / 2));
  padding: 25px 25px 22px;
}
.setting {
  margin-bottom: 25px;
}
.setting-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-bottom: 12px;
}
.setting-heading output {
  font: 11px var(--mono);
  color: #bac2c8;
}
.setting input[type="range"] {
  width: 100%;
  height: 17px;
  margin: 0;
}
.setting-title {
  font-size: 12px;
  display: block;
  margin-bottom: 14px;
}
.colors {
  display: flex;
  gap: 10px;
  align-items: center;
}
.color-chip {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--swatch);
  border: 3px solid #15181b;
  box-shadow: 0 0 0 1px #515b65;
  min-height: 25px;
}
.color-chip[aria-pressed="true"] {
  box-shadow: 0 0 0 2px #f0f2f3;
}
.color-chip[data-color="#e8e9e5"] {
  --swatch: #e8e9e5;
}
.color-chip[data-color="#93c9e8"] {
  --swatch: #93c9e8;
}
.color-chip[data-color="#c3b0ff"] {
  --swatch: #c3b0ff;
}
.color-chip[data-color="#ffa976"] {
  --swatch: #ffa976;
}
.custom-color {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  color: #b5bec5;
  margin-left: auto;
}
.custom-color input {
  border: 0;
  padding: 0;
  width: 23px;
  height: 23px;
  background: none;
  cursor: pointer;
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 11px;
  margin-bottom: 22px;
}
.toggle-row small {
  display: block;
  font-size: 11px;
  margin-top: 7px;
  color: #a9b4be;
}
.toggle-row input {
  accent-color: #dee3e6;
  width: 16px;
  height: 16px;
}
.settings-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}
.secondary-button {
  font-size: 11px;
  padding: 10px 12px;
  border: 1px solid #53606b;
  background: #20262b;
  border-radius: 4px;
}
.settings-actions .quiet-button {
  font-size: 11px;
}
details {
  border-top: 1px solid #41484f;
  padding-top: 17px;
  font-size: 11px;
  color: #b8c0c8;
}
summary {
  cursor: pointer;
  color: #c1c8ce;
}
details[open] summary {
  margin-bottom: 21px;
}
.control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0;
}
.control-row div {
  display: flex;
  gap: 6px;
  align-items: baseline;
  font: 11px var(--mono);
}
.control-row input {
  width: 82px;
  background: none;
  color: #e8edef;
  border: 0;
  border-bottom: 1px solid #69737c;
  font: 16px var(--mono);
  padding: 6px 0;
}
details input[type="range"] {
  width: 100%;
  height: 17px;
}
.presets {
  display: flex;
  gap: 8px;
  margin: 14px 0 20px;
}
.presets button {
  background: #262c31;
  color: #c9d0d6;
  border: 1px solid #5a656f;
  font: 11px var(--mono);
  padding: 7px 9px;
  border-radius: 3px;
}
details select {
  display: block;
  width: 100%;
  padding: 9px;
  margin-top: 10px;
  border: 1px solid #6b7782;
  background: #23292e;
  color: #e0e5e9;
  font-size: 11px;
  border-radius: 3px;
}
#youtube-form label {
  display: block;
  font-size: 12px;
  margin-bottom: 10px;
}
#youtube-url {
  width: 100%;
  padding: 13px;
  border: 1px solid #67747e;
  background: #0e1114;
  color: #e4eaee;
  border-radius: 4px;
  font-size: 12px;
}
.primary-button {
  margin-top: 15px;
  border: 0;
  border-radius: 4px;
  background: #e6eae4;
  color: #101314;
  width: 100%;
  padding: 13px;
  font-size: 12px;
}
.dialog-note,
.form-error {
  font-size: 12px;
  color: #b6bfc6;
  line-height: 1.7;
}
.form-error {
  color: #f4c0bc;
  min-height: 18px;
  margin-bottom: 0;
}
#model-dialog h2 {
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.8px;
}
#model-dialog p {
  font-size: 13px;
  line-height: 1.75;
  color: #c2cbd1;
}
#model-dialog code {
  display: block;
  padding: 15px;
  border: 1px solid #57636b;
  border-radius: 3px;
  font: 11px/1.8 var(--mono);
  white-space: pre-wrap;
}
#model-dialog .text-link {
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 4px;
  margin-top: 20px;
  display: inline-block;
}
.research-page {
  max-width: 1060px;
  margin: auto;
  padding: 55px 4%;
}
.research-page h1 {
  font-size: 55px;
  line-height: 1.14;
  margin-bottom: 25px;
}
.research-page h1 em {
  font-style: normal;
}
.research-page .lead {
  font-size: 17px;
  color: #b9c2cb;
  max-width: 780px;
  line-height: 1.6;
}
.research-page section {
  margin-top: 60px;
}
.research-page h2 {
  font-size: 29px;
  font-weight: 400;
  letter-spacing: -0.8px;
}
.research-page h3 {
  font-size: 20px;
  font-weight: 400;
}
.research-page p,
.research-page li {
  font-size: 13px;
  line-height: 1.8;
  color: #bdc6ce;
}
.research-page .review-status {
  border-left: 2px solid #899ca9;
  padding-left: 17px;
  font-size: 12px;
}
.research-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.research-card {
  border: 1px solid #343e45;
  padding: 23px;
  border-radius: 5px;
}
.research-card h3 {
  margin: 0 0 18px;
}
.research-card code {
  display: block;
  padding: 15px;
  font: 11px/1.8 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #151c20;
  border-radius: 3px;
}
.research-page li {
  margin-bottom: 14px;
}
.research-page a {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.download-list {
  padding: 0;
  list-style: none;
}
.research-page .return {
  display: inline-block;
  margin: 20px 0;
}
body > footer {
  max-width: 1360px;
  margin: auto;
  padding: 25px 4%;
  font: 11px var(--mono);
  color: #a7b2bc;
  border-top: 1px solid #30383f;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
}
@media (max-width: 1100px) {
  .source-label {
    font-size: 11px;
  }
  .mode-tabs button {
    padding: 9px 10px;
    font-size: 11px;
  }
  .view-actions {
    gap: 12px;
  }
  .youtube-dock {
    right: 14px;
    width: 245px;
  }
  .intro-stamp {
    display: none;
  }
}
@media (max-width: 780px) {
  .header {
    height: 65px;
    padding: 0 5%;
  }
  .wordmark {
    font-size: 21px;
  }
  nav {
    gap: 17px;
    font-size: 11px;
  }
  nav .quiet-button {
    font-size: 11px;
  }
  .visualizer {
    padding: 0 5%;
  }
  .intro {
    padding: 20px 0 20px;
  }
  h1 {
    font-size: 37px;
    letter-spacing: -1.6px;
  }
  .intro .eyebrow {
    font-size: 11px;
    margin-bottom: 11px;
  }
  .intro p:not(.eyebrow) {
    font-size: 11px;
  }
  .source-bar {
    gap: 12px;
    padding: 9px 0 14px;
  }
  .source-actions {
    gap: 7px;
    flex: 1;
  }
  .source-button {
    padding: 9px 11px;
    font-size: 11px;
    min-height: 38px;
  }
  .source-label {
    order: 3;
    flex-basis: 100%;
    max-width: 100%;
    font-size: 11px;
  }
  .source-label #file-name {
    max-width: 90%;
  }
  .play {
    font-size: 11px;
  }
  .stage {
    height: 430px;
  }
  .visual-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
  }
  .mode-tabs {
    width: 100%;
    gap: 5px;
  }
  .mode-tabs button {
    padding: 9px 10px;
    flex: 1;
    font-size: 11px;
  }
  .mode-tabs span {
    font-size: 11px;
  }
  .view-actions {
    align-self: flex-end;
    gap: 20px;
    width: 100%;
    justify-content: space-between;
    border-top: 1px solid #2e343a;
    padding: 4px 4px 0;
  }
  .view-actions .quiet-button {
    font-size: 11px;
  }
  .stage-top,
  .stage-bottom {
    left: 17px;
    right: 17px;
    font-size: 11px;
  }
  .stage-top {
    top: 17px;
  }
  .stage-bottom {
    bottom: 17px;
  }
  .status-chip {
    font-size: 11px;
  }
  .bottom-bar {
    flex-wrap: wrap;
    gap: 11px 20px;
    padding: 12px 0;
  }
  .signal-status {
    flex-basis: 100%;
    font-size: 11px;
    min-height: 16px;
  }
  .listening {
    flex: 1;
  }
  .bottom-bar > .quiet-button {
    font-size: 11px;
  }
  .footer {
    font-size: 11px;
    padding-top: 14px;
    gap: 15px;
  }
  .settings-dialog {
    margin: auto;
    max-width: 380px;
  }
  .stage #scene-3d {
    position: relative;
    inset: auto;
  }
  .youtube-dock {
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    border: 0;
    border-top: 1px solid #3b464e;
    border-radius: 0;
    box-shadow: none;
  }
  .stage:has(.youtube-dock:not([hidden])) {
    height: auto;
  }
  .stage:has(.youtube-dock:not([hidden])) > canvas {
    height: 430px;
  }
  .stage:has(.youtube-dock:not([hidden])) .stage-bottom {
    top: 397px;
    bottom: auto;
  }
  .youtube-dock iframe {
    height: 210px;
  }
  .youtube-dock p {
    font-size: 11px;
  }
  .dock-bottom button {
    font-size: 11px;
  }
  .dock-bottom a {
    font-size: 11px;
  }
  .dock-top {
    padding: 9px 14px;
  }
  .research-page {
    padding: 40px 5%;
  }
  .research-page h1 {
    font-size: 40px;
  }
  .research-page .lead {
    font-size: 15px;
  }
  .research-grid {
    grid-template-columns: 1fr;
  }
  .research-page section {
    margin-top: 45px;
  }
  .research-page h2 {
    font-size: 27px;
  }
  dialog {
    padding: 24px;
  }
  body > footer {
    font-size: 11px;
    flex-direction: column;
    gap: 12px;
  }
}
@media (max-width: 400px) {
  h1 {
    font-size: 33px;
  }
  .stage {
    height: 360px;
  }
  .source-button {
    padding: 9px 9px;
    font-size: 11px;
  }
  .mode-tabs button {
    font-size: 11px;
    min-width: 27%;
  }
  .stage:has(.youtube-dock:not([hidden])) {
    height: auto;
  }
  .stage:has(.youtube-dock:not([hidden])) > canvas {
    height: 360px;
  }
  .stage:has(.youtube-dock:not([hidden])) .stage-bottom {
    top: 327px;
  }
  .footer {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
    transition: none !important;
  }
}

/* Music workspace */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.header {
  max-width: 1600px;
  height: 64px;
  padding: 0 24px;
}
.visualizer {
  max-width: 1600px;
  padding: 0 24px;
}
.workspace-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin: 10px 0 18px;
}
.workspace-heading h1 {
  font-size: 22px;
  letter-spacing: -0.8px;
  line-height: 1.2;
  margin: 0;
}
.workspace-heading p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
  align-items: start;
}
.visual-column {
  min-width: 0;
}
.stage {
  height: clamp(560px, calc(100dvh - 175px), 1000px);
}
.visual-toolbar {
  padding: 10px;
  flex-wrap: wrap;
}
.mode-tabs {
  gap: 3px;
}
.mode-tabs button {
  padding: 10px 11px;
}
.view-actions {
  gap: 15px;
  margin-left: auto;
}
.canvas-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 43px;
  font: 11px var(--mono);
  color: #a5adb4;
}
.source-panel {
  padding: 22px;
  background: #111315;
  border: 1px solid #333940;
  border-radius: 7px;
  max-height: calc(100dvh - 110px);
  overflow: auto;
}
.panel-heading .eyebrow {
  font-size: 10px;
  margin-bottom: 9px;
}
.panel-heading h2 {
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.7px;
  margin: 0 0 19px;
}
.upload-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 8px;
  min-height: 142px;
  border: 1px dashed #7a8790;
  border-radius: 5px;
  background: #1c2327;
  color: #f0f2ee;
  margin-bottom: 12px;
}
.upload-card:hover,
.upload-card.dragging {
  border-color: #b7ece1;
  background: #263331;
}
.upload-card strong {
  font-size: 15px;
  font-weight: 600;
}
.upload-card > span:last-child {
  font-size: 12px;
  color: #bdc7cc;
}
.upload-icon {
  font-size: 27px;
  color: #a8d4c8;
  line-height: 1.1;
}
.source-actions {
  gap: 9px;
}
.source-actions .source-button {
  flex: 1;
  background: #1a1e22;
  color: #dce2e4;
  font-size: 12px;
  padding: 10px;
}
.source-label {
  margin: 18px 0 12px;
  font-size: 11px;
}
.source-label #file-name {
  max-width: calc(100% - 16px);
}
.play {
  width: 100%;
  justify-content: center;
  background: #e3e9e4;
  color: #0b1110;
  border-radius: 4px;
  font-size: 13px;
  min-height: 43px;
}
.listening {
  margin: 17px 0;
  font-size: 11px;
}
.listening input {
  flex: 1;
  min-width: 60px;
  width: 100%;
  height: 22px;
}
.source-panel .signal-status {
  font: 11px/1.7 var(--mono);
  margin: 10px 0 20px;
}
.source-panel h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 13px;
}
.source-panel select {
  display: block;
  width: 100%;
  padding: 10px;
  border: 1px solid #5a6670;
  background: #20262c;
  color: #e2e8ec;
  border-radius: 4px;
  font-size: 12px;
  min-height: 39px;
}
.color-section {
  margin: 19px 0 0;
  padding-top: 19px;
  border-top: 1px solid #343d43;
}
#palette-row {
  margin-top: 9px;
}
.palette-legend {
  display: flex;
  justify-content: space-between;
  gap: 9px;
  align-items: center;
  margin: 15px 0 12px;
  font-size: 11px;
  color: #bcc5cb;
}
.palette-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.palette-legend i {
  height: 7px;
  width: 14px;
  border-radius: 4px;
  background: #68e6cf;
}
.palette-legend span:nth-child(2) i {
  background: #b49aff;
}
.palette-legend span:nth-child(3) i {
  background: #ff93ba;
}
.panel-note {
  font-size: 11px;
  line-height: 1.7;
  margin: 9px 0 0;
  color: #b0bcc3;
}
#solid-colors {
  margin-top: 17px;
}
#solid-colors .setting {
  margin-bottom: 0;
}
#solid-colors .setting-title {
  display: none;
}
.sand-section {
  border-top: 1px solid #343d43;
  margin-top: 19px;
  padding-top: 19px;
}
.privacy-note {
  font: 10px/1.5 var(--mono);
  color: #acb7bf;
  margin: 23px 0 0;
}
.youtube-dock {
  position: relative;
  top: auto;
  right: auto;
  width: 100%;
  margin: 14px 0 20px;
  box-shadow: none;
}
.youtube-dock iframe {
  height: 205px;
}
.dock-bottom {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}
.dock-bottom button {
  font-size: 12px;
  min-height: 38px;
}
.dock-bottom a {
  font-size: 11px;
  text-align: center;
}
.youtube-dock p {
  font-size: 11px;
}
.footer {
  margin-top: 5px;
  font-size: 11px;
}
@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 14px;
  }
  .source-panel {
    padding: 18px;
  }
  .mode-tabs button {
    font-size: 11px;
    padding: 9px;
  }
}
@media (max-width: 900px) {
  .header {
    padding: 0 18px;
  }
  .visualizer {
    padding: 0 18px;
  }
  .workspace {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .source-panel {
    order: -1;
    width: 100%;
    max-height: none;
    overflow: visible;
    padding: 17px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
  }
  .panel-heading {
    grid-column: 1/-1;
  }
  .panel-heading .eyebrow {
    display: none;
  }
  .panel-heading h2 {
    font-size: 19px;
    margin: 0;
  }
  .upload-card {
    min-height: 94px;
    margin: 0;
    grid-row: 2/4;
  }
  .upload-icon {
    font-size: 21px;
  }
  .upload-card strong {
    font-size: 13px;
  }
  .upload-card > span:last-child {
    font-size: 11px;
  }
  .source-actions {
    grid-column: 2;
    display: flex;
    flex-wrap: wrap;
  }
  .source-actions .source-button {
    padding: 8px;
    min-height: 36px;
    flex-basis: 100%;
    font-size: 11px;
  }
  .source-label {
    grid-column: 1/-1;
    margin: 2px 0;
    order: 1;
  }
  .play {
    grid-column: 1;
    order: 2;
  }
  .listening {
    grid-column: 2;
    order: 2;
    margin: 0;
    gap: 7px;
  }
  .source-panel .signal-status {
    grid-column: 1/-1;
    order: 3;
    margin: 0;
  }
  .color-section {
    grid-column: 1/-1;
    order: 4;
    margin: 0;
    padding-top: 14px;
  }
  .sand-section {
    grid-column: 1/-1;
    order: 5;
    margin: 0;
    padding-top: 14px;
  }
  .privacy-note {
    grid-column: 1/-1;
    order: 6;
    margin: 1px 0 0;
  }
  .youtube-dock {
    grid-column: 1/-1;
    order: 3;
    margin: 4px 0 10px;
  }
  .visual-column {
    width: 100%;
  }
  .stage {
    height: clamp(400px, 68dvh, 680px);
  }
  .stage #scene-3d {
    position: absolute;
    inset: 0;
  }
  .visual-toolbar {
    flex-direction: column;
  }
  .mode-tabs button {
    min-width: 27%;
    flex: 1;
  }
  .view-actions {
    width: 100%;
    justify-content: space-between;
  }
  .workspace-heading {
    margin: 8px 0 15px;
  }
  .workspace-heading h1 {
    font-size: 21px;
  }
  .workspace-heading p {
    display: none;
  }
  .settings-dialog {
    margin: auto;
  }
}
@media (max-width: 420px) {
  .header,
  .visualizer {
    padding-left: 14px;
    padding-right: 14px;
  }
  .header nav {
    gap: 13px;
  }
  .wordmark {
    font-size: 20px;
  }
  .stage {
    height: 420px;
  }
  .stage-bottom {
    font-size: 10px;
  }
  .source-panel {
    padding: 14px;
    gap: 9px;
  }
  .listening label {
    display: none;
  }
  .palette-legend {
    font-size: 11px;
  }
  .footer {
    font-size: 10px;
    gap: 12px;
  }
  .canvas-foot {
    font-size: 10px;
  }
}
.quick-settings {
  margin-top: 19px;
  padding-top: 16px;
  border-top: 1px solid #343d43;
  font-size: 12px;
}
.quick-settings summary {
  font-size: 13px;
  color: #d7e0e5;
}
.quick-settings[open] summary {
  margin-bottom: 0;
}
.quick-settings .color-section {
  border-top: 0;
  padding-top: 17px;
  margin-top: 0;
}
@media (max-width: 900px) {
  .quick-settings {
    grid-column: 1/-1;
    order: 4;
    margin: 4px 0 0;
    padding-top: 13px;
  }
  .quick-settings .sand-section {
    margin-top: 18px;
  }
}

/* Compact source controls; all content stays in the document scroll flow. */
.source-panel {
  max-height: none;
  overflow: visible;
}
@media (min-width: 901px) {
  .stage {
    height: clamp(420px, calc(100dvh - 250px), 1000px);
  }
  .source-panel {
    padding: 16px;
  }
  .panel-heading .eyebrow {
    display: none;
  }
  .panel-heading h2 {
    font-size: 20px;
    margin-bottom: 12px;
  }
  .upload-card {
    min-height: 86px;
    gap: 5px;
    margin-bottom: 9px;
  }
  .upload-icon {
    font-size: 22px;
  }
  .upload-card strong {
    font-size: 13px;
  }
  .upload-card > span:last-child {
    font-size: 11px;
  }
  .source-actions .source-button {
    min-height: 34px;
    padding: 8px;
  }
  .source-label {
    margin: 11px 0 9px;
  }
  .play {
    min-height: 38px;
  }
  .listening {
    margin: 11px 0;
  }
  .source-panel .signal-status {
    margin: 7px 0 11px;
    font-size: 10px;
    line-height: 1.5;
  }
  .quick-settings {
    margin-top: 12px;
    padding-top: 12px;
  }
  .quick-settings .color-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding-top: 12px;
  }
  #palette-row {
    margin: 0;
  }
  .source-panel select {
    font-size: 11px;
    padding: 8px 5px;
    min-height: 36px;
  }
  .palette-legend {
    grid-column: 1/-1;
    margin: 2px 0 0;
  }
  #color-note {
    display: none;
  }
  #solid-colors {
    grid-column: 1/-1;
    margin: 0;
  }
  .sand-section {
    margin-top: 12px;
    padding-top: 12px;
  }
  .sand-section .panel-note {
    font-size: 10px;
    line-height: 1.5;
    margin-top: 6px;
  }
  .privacy-note {
    margin-top: 13px;
    font-size: 9px;
  }
  .youtube-dock {
    margin: 10px 0;
  }
  .youtube-dock iframe {
    height: 200px;
  }
  .dock-bottom {
    gap: 8px;
    padding: 9px;
  }
  .youtube-dock p {
    margin: 7px 9px 10px;
    font-size: 10px;
    line-height: 1.4;
  }
  .source-panel:has(.youtube-dock:not([hidden])) .upload-card {
    min-height: 38px;
    flex-direction: row;
  }
  .source-panel:has(.youtube-dock:not([hidden]))
    .upload-card
    > span:last-child {
    display: none;
  }
}

@media (min-width: 901px) {
  .source-panel:has(.youtube-dock:not([hidden])) .panel-heading,
  .source-panel:has(.youtube-dock:not([hidden])) .privacy-note {
    display: none;
  }
  .youtube-dock .dock-top {
    padding: 5px 9px;
    min-height: 30px;
  }
  .youtube-dock .dock-bottom {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px;
  }
  .youtube-dock .dock-bottom button {
    min-height: 34px;
    flex: 1;
    font-size: 11px;
    padding: 7px;
  }
  .youtube-dock .dock-bottom a {
    font-size: 10px;
    white-space: nowrap;
  }
  .youtube-dock p {
    padding: 0;
    margin: 7px 9px 9px;
    line-height: 1.4;
  }
}

.palette-legend.five-bands {
  gap: 5px;
  font-size: 10px;
}
.palette-legend.five-bands span {
  gap: 4px;
}
.palette-legend.five-bands i {
  width: 9px;
  flex-shrink: 0;
}

.source-actions .source-button {
  padding-inline: 6px;
  font-size: 11px;
}
#demo-track {
  border-color: #586b75;
  background: #242c31;
}
@media (max-width: 800px) {
  .source-actions {
    gap: 5px;
  }
  .source-actions .source-button {
    min-height: 31px;
    padding-block: 6px;
  }
}

#fill-canvas {
  white-space: nowrap;
}
#fill-canvas[aria-pressed="true"] {
  background: #e3e7e4;
  color: #0c1012;
  border-radius: 3px;
}
@media (min-width: 901px) and (max-width: 1250px) {
  .visual-toolbar {
    flex-wrap: wrap;
  }
  .mode-tabs {
    flex: 1 1 100%;
  }
  .view-actions {
    margin-left: auto;
  }
}

.stage.filled .stage-top > span,
.stage.filled .stage-bottom > span {
  background: #050607c7;
  padding: 5px 8px;
  border-radius: 3px;
}

#fill-canvas {
  padding: 9px 10px;
}

.settings-common {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px 12px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #343d43;
}
.settings-field label {
  display: block;
  font-size: 12px;
  margin-bottom: 8px;
}
.settings-field select,
.settings-field input[type="color"] {
  width: 100%;
  min-width: 0;
  height: 40px;
}
.settings-wide {
  grid-column: 1 / -1;
}
#sand-count-note {
  margin: -14px 0 22px;
}

.settings-field select,
.settings-field input[type="color"] {
  background: #20262c;
  color: #e2e8ec;
  border: 1px solid #5a6670;
  border-radius: 4px;
  font-size: 12px;
  padding: 8px;
}
.settings-field input[type="color"] {
  padding: 4px;
  cursor: pointer;
}

.tone-controls-open {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 24px);
  min-height: 440px;
  max-height: 1000px;
  scroll-margin-top: 12px;
  overflow-anchor: none;
}
.tone-controls-open .stage {
  flex: 1;
  min-height: 200px;
  height: auto;
}
.tone-controls-open .visual-toolbar,
.tone-panel {
  flex-shrink: 0;
}
.tone-panel {
  padding: 14px 18px;
  border-bottom: 1px solid #343e45;
  background: #151a1f;
  font-size: 12px;
}
.tone-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tone-heading h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}
#tone-settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 0.45fr);
  gap: 0 20px;
}
.tone-frequency,
.tone-stereo {
  min-width: 0;
}
.tone-frequency .control-row {
  margin: 0 0 5px;
}
.tone-frequency .control-row input {
  width: 110px;
}
.tone-stereo {
  align-self: start;
}
#tone-settings .panel-note {
  grid-column: 1 / -1;
  margin: 0 0 8px;
  font-size: 11px;
}
#tone-settings input[type="range"] {
  width: 100%;
}
.tone-range-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 3px;
  color: #b8c3cd;
  font: 10px var(--mono);
}
#tone-settings select {
  width: 100%;
  padding: 10px;
  border: 1px solid #5a6670;
  background: #20262c;
  border-radius: 4px;
  margin-top: 9px;
}
#tone-settings .presets button {
  flex: 1;
  min-height: 32px;
  padding: 6px;
  font-size: 11px;
}
#tone-settings .presets {
  margin: 8px 0 0;
}
@media (max-width: 600px) {
  .tone-panel {
    padding: 10px 12px;
  }
  #tone-settings {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
  }
  #tone-settings .panel-note {
    display: none;
  }
  .tone-stereo {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  #tone-settings select {
    width: auto;
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 6px;
  }
  .tone-controls-open .stage {
    min-height: 180px;
  }
}
#open-tone-settings {
  margin-top: 16px;
  display: block;
  background: transparent;
  border: 0;
  padding: 8px 0;
  min-height: 36px;
  color: #d4dfe7;
  font-size: 12px;
  text-align: left;
}

.model-notes {
  margin-top: 10px;
  border: 1px solid #343e45;
  border-radius: 5px;
  background: #101419;
  color: #bdc6ce;
  font-size: 12px;
}
.model-notes summary {
  min-height: 44px;
  cursor: pointer;
  padding: 12px 15px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  list-style: none;
  color: #e3e7e4;
}
.model-notes summary::-webkit-details-marker {
  display: none;
}
.model-notes summary::after {
  content: "+";
  margin-left: auto;
}
.model-notes[open] summary::after {
  content: "−";
}
.model-notes summary span {
  color: #bdc6ce;
  font: 10px/1.5 var(--mono);
}
.model-notes > p,
.model-notes > dl,
.model-notes > label {
  margin: 0 15px 14px;
}
.model-notes p {
  line-height: 1.7;
}
.model-notes .model-state {
  color: #e3e7e4;
}
.model-facts {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 9px 16px;
  line-height: 1.65;
}
.model-facts dt {
  color: #bdc6ce;
}
.model-facts dd {
  margin: 0;
  color: #e3e7e4;
  overflow-wrap: anywhere;
}
.model-notes > a {
  display: inline-block;
  color: #d4dfe7;
  margin: 0 15px 16px;
  line-height: 1.7;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.activity-option {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #e3e7e4;
  min-height: 38px;
  cursor: pointer;
}
.activity-option input {
  width: 17px;
  height: 17px;
  accent-color: #d4dfe7;
  flex: 0 0 auto;
}
.model-notes .activity-key {
  color: #bdc6ce;
  font: 10px/1.7 var(--mono);
}
.research-comparison {
  margin: 24px 0;
}
.research-comparison img {
  width: 100%;
  height: auto;
  display: block;
  background: white;
  border-radius: 4px;
}
.research-comparison figcaption {
  margin-top: 12px;
  color: #bdc6ce;
  font-size: 12px;
  line-height: 1.7;
}
.study-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  margin: 20px 0;
  line-height: 1.7;
}
@media (max-width: 650px) {
  .model-facts {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .model-facts dd {
    margin-bottom: 10px;
  }
}

.research-table-wrap {
  overflow-x: auto;
}
.validation-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 660px;
  color: #d4dfe7;
  font: 11px/1.7 var(--mono);
}
.validation-table caption {
  text-align: left;
  margin: 10px 0;
  font:
    12px/1.7 "Space Grotesk",
    Arial,
    sans-serif;
}
.validation-table th,
.validation-table td {
  text-align: left;
  padding: 11px;
  border-bottom: 1px solid #343e45;
}
.validation-table th {
  color: #e3e7e4;
  font-weight: 500;
}

.palette-legend b {
  font-weight: 400;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.palette-legend small {
  font-size: 9px;
  color: #a3a9ae;
  white-space: nowrap;
}
.palette-legend.five-bands small {
  font-size: 8px;
}

.palette-legend.five-bands > span {
  flex-direction: column;
  align-items: flex-start;
}
#color-note {
  display: block;
  grid-column: 1 / -1;
  font-size: 10px;
  line-height: 1.5;
  margin: 0;
}
