:root {
  color-scheme: dark;
  --bg: #090b0f;
  --panel: #11151b;
  --panel-2: #171d25;
  --line: #2b3441;
  --text: #f5f8fb;
  --muted: #9aa6b5;
  --red: #ef2439;
  --red-2: #bd1022;
  --cyan: #24d5ff;
  --amber: #ffb23f;
  --green: #52d273;
  --rise: #1688ff;
  --hold: #00b368;
  --fall: #ffa927;
  --rest: #ff202d;
  --freq: #6517f2;
  --width: #9a9a9a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 0%, rgba(239, 36, 57, 0.18), transparent 29rem),
    linear-gradient(135deg, #07090d 0%, #111721 48%, #090b0f 100%);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
a {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  min-height: 100vh;
  padding: 22px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1480px, 100%);
  margin: 0 auto 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  color: var(--text);
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.05;
}

.brand strong {
  font-size: 1.04rem;
  letter-spacing: 0;
}

.brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.select-tool-button {
  flex: 0 0 auto;
  min-width: 116px;
  border: 1px solid rgba(36, 213, 255, 0.42);
  padding: 10px 14px;
  color: var(--cyan);
  background: rgba(36, 213, 255, 0.08);
  text-align: center;
  text-transform: uppercase;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease;
}

.select-tool-button:hover,
.select-tool-button:focus-visible {
  border-color: var(--cyan);
  color: #fff;
  background: rgba(36, 213, 255, 0.14);
  outline: none;
}

.select-tool-button[hidden],
.tool-hub[hidden] {
  display: none;
}

.tool-hub {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  width: min(1480px, 100%);
  margin: 0 auto 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(17, 21, 27, 0.82);
  box-shadow: var(--shadow);
}

.hub-copy {
  padding: clamp(22px, 3vw, 38px);
}

.hub-copy span {
  display: block;
  margin-bottom: 12px;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.hub-copy h1 {
  max-width: 650px;
}

.tool-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-content: stretch;
  padding: 0 clamp(22px, 3vw, 38px) clamp(22px, 3vw, 38px);
}

.tool-card {
  position: relative;
  display: flex;
  min-height: 0;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;
  border: 1px solid var(--line);
  padding: 20px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)),
    var(--panel-2);
  text-align: left;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.tool-card:hover {
  transform: translateY(-1px);
}

.tool-card:disabled {
  opacity: 1;
  cursor: default;
}

.tool-card:disabled:hover,
.tool-card.tool-card-disabled:hover {
  transform: none;
}

.tool-card.tool-card-disabled {
  cursor: default;
}

.tool-card.active {
  border-color: rgba(239, 36, 57, 0.84);
  background:
    linear-gradient(180deg, rgba(239, 36, 57, 0.22), rgba(17, 21, 27, 0.9)),
    var(--panel-2);
  box-shadow: 0 0 28px rgba(239, 36, 57, 0.2);
}

.tool-status {
  border: 1px solid rgba(239, 36, 57, 0.72);
  padding: 6px 9px;
  color: #ffdce0;
  background: rgba(239, 36, 57, 0.16);
  box-shadow: 0 0 18px rgba(239, 36, 57, 0.16);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.tool-status-coming-soon {
  border-color: rgba(255, 178, 63, 0.78);
  color: #ffe4ae;
  background: rgba(255, 178, 63, 0.16);
  box-shadow: 0 0 18px rgba(255, 178, 63, 0.18);
}

.tool-card strong {
  display: block;
  color: #fff;
  font-size: 1.15rem;
  line-height: 1.08;
}

.tool-card small {
  display: block;
  max-width: 30ch;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(285px, 355px) minmax(0, 1fr);
  gap: 18px;
  width: min(1480px, 100%);
  margin: 0 auto;
}

.tool-workspace:not(.active) {
  display: none;
}

#stimTool {
  margin-bottom: 28px;
}

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

.control-panel,
.stage {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(17, 21, 27, 0.9);
  box-shadow: var(--shadow);
}

.control-panel {
  display: grid;
  gap: 1px;
  align-self: start;
  overflow: hidden;
}

.control-block {
  padding: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
}

.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 620px;
  font-size: clamp(2.1rem, 4vw, 4.5rem);
  line-height: 0.94;
  letter-spacing: 0;
}

h2 {
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #dce5ee;
}

p {
  max-width: 610px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

output,
.counter {
  color: var(--cyan);
  font-size: 0.88rem;
  white-space: nowrap;
}

input[type="range"] {
  width: 100%;
  height: 26px;
  margin: 0;
  accent-color: var(--red);
}

.quick-options,
.tag-grid,
.snippet-list {
  display: grid;
  gap: 8px;
}

.quick-options {
  grid-template-columns: repeat(5, 1fr);
  margin-top: 13px;
}

.chip,
.tag {
  min-height: 42px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--panel-2);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.chip:hover,
.tag:hover,
.icon-button:hover,
.secondary-button:hover,
.primary-button:hover,
.download-link:hover,
.small-button:hover,
.info-button:hover {
  transform: translateY(-1px);
}

.chip.active,
.tag.active {
  border-color: rgba(239, 36, 57, 0.95);
  color: white;
  background: linear-gradient(180deg, var(--red), var(--red-2));
  box-shadow: 0 0 18px rgba(239, 36, 57, 0.23);
}

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

.tag {
  min-width: 0;
  padding: 0 8px;
  font-size: 0.88rem;
}

.meter {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 12px;
}

.meter span {
  height: 6px;
  background: var(--line);
}

.meter span.is-on:nth-child(1) {
  background: var(--green);
}

.meter span.is-on:nth-child(2) {
  background: var(--amber);
}

.meter span.is-on:nth-child(3) {
  background: var(--red);
}

.channel-map {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
  margin-top: 12px;
  color: var(--muted);
  font-weight: 800;
}

.channel-map i {
  display: block;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--red));
  box-shadow: 0 0 18px rgba(36, 213, 255, 0.3);
}

.stage {
  min-height: calc(100vh - 86px);
  padding: clamp(20px, 3vw, 42px);
  overflow: hidden;
}

.stage-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.library-stage {
  min-height: auto;
}

.library-stage .stage-head > div,
.library-stage .stage-head p {
  max-width: none;
  width: 100%;
}

.library-list {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.library-list[hidden] {
  display: none;
}

.library-faq {
  margin-top: 42px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.library-faq h2 {
  margin-bottom: 22px;
  color: #fff;
  font-size: 1.35rem;
  line-height: 1.1;
  text-transform: none;
  letter-spacing: 0;
}

.library-faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.library-faq-column {
  display: grid;
  gap: 12px;
}

.library-faq-item {
  border: 1px solid var(--line);
  margin-top: 0;
  background: rgba(23, 29, 37, 0.82);
}

.library-faq-item summary {
  position: relative;
  display: block;
  padding: 18px 54px 18px 20px;
  color: #fff;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.3;
  cursor: pointer;
  list-style: none;
}

.library-faq-item summary::-webkit-details-marker {
  display: none;
}

.library-faq-item summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 20px;
  color: var(--cyan);
  font-size: 1.4rem;
  font-weight: 400;
  transform: translateY(-50%);
}

.library-faq-item[open] summary::after {
  content: "-";
}

.library-faq-item p {
  max-width: none;
  margin: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px 20px 20px;
  color: var(--muted);
  line-height: 1.65;
}

.faq-report {
  margin: 20px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.faq-report a {
  color: var(--cyan);
  font-weight: 800;
}

.library-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 30px;
}

.library-submit-note {
  flex: 1 1 auto;
  max-width: none;
  border: 1px solid var(--line);
  border-left: 4px solid rgba(36, 213, 255, 0.34);
  padding: 18px 20px;
  color: var(--muted);
  background: rgba(23, 29, 37, 0.82);
}

.library-submit-note > span {
  min-width: 0;
}

.library-submit-note strong {
  color: #fff;
}

.fun-mode-control {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 0 0 194px;
}

.fun-mode-label {
  color: #fff;
  font-weight: 900;
  white-space: nowrap;
}

.library-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 0;
}

.library-card {
  display: grid;
  grid-template-columns: minmax(180px, max-content) 56px minmax(220px, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 92px;
  border: 1px solid var(--line);
  padding: 14px;
  background: rgba(23, 29, 37, 0.82);
}

.library-thumbnail {
  display: block;
  width: 92px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  object-fit: cover;
  background: rgba(8, 11, 16, 0.72);
}

.library-heading {
  min-width: 0;
}

.library-title-block {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.library-title-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.library-title {
  display: block;
  overflow-wrap: anywhere;
  color: #fff;
  font-size: 1rem;
}

.library-creator {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.2;
}

.library-duration {
  color: var(--cyan);
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
}

.library-duration.is-playing {
  color: #fff;
}

.library-item .library-play-button {
  width: 56px;
  min-width: 56px;
  min-height: 56px;
  padding: 0;
}

.library-item .library-play-button svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  stroke: currentColor;
}

.library-seek {
  min-width: 0;
  height: 22px;
}

.library-downloads {
  display: flex;
  gap: 10px;
}

.library-item .library-format-button {
  width: 92px;
  min-height: 56px;
  padding: 0 14px;
  white-space: nowrap;
}

.library-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}

.library-page-numbers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.library-page-button,
.library-page-number {
  min-height: 40px;
  border: 1px solid var(--line);
  padding: 0 14px;
  color: var(--muted);
  background: rgba(23, 29, 37, 0.82);
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    background-color 160ms ease;
}

.library-page-number {
  min-width: 40px;
  padding: 0 10px;
  color: #fff;
}

.library-page-button:hover,
.library-page-number:hover,
.library-page-button:focus-visible,
.library-page-number:focus-visible {
  border-color: rgba(36, 213, 255, 0.5);
  color: #fff;
  outline: none;
  transform: translateY(-1px);
}

.library-page-number.is-current {
  border-color: rgba(36, 213, 255, 0.74);
  color: var(--cyan);
  background: rgba(36, 213, 255, 0.08);
}

.library-page-button:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

.record-mode-toggle {
  position: relative;
  display: block;
  width: 96px;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 4px;
  color: rgba(150, 161, 176, 0.86);
  background: linear-gradient(180deg, #e8e8e8, #d8d8d8);
  box-shadow: inset 0 1px 4px rgba(255, 255, 255, 0.75), 0 12px 18px rgba(0, 0, 0, 0.22);
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

.record-mode-toggle[aria-pressed="true"] {
  color: rgba(8, 97, 46, 0.55);
  background: linear-gradient(180deg, #00dd62, #00bd4e);
  box-shadow: inset 0 1px 4px rgba(255, 255, 255, 0.4), 0 12px 20px rgba(0, 185, 78, 0.2);
}

.toggle-text {
  position: absolute;
  top: 50%;
  right: 13px;
  z-index: 1;
  font-size: 0.94rem;
  line-height: 1;
  text-shadow: 0 1px rgba(255, 255, 255, 0.44);
  transform: translateY(-50%);
}

.record-mode-toggle[aria-pressed="true"] .toggle-text {
  right: auto;
  left: 14px;
}

.toggle-knob {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 2;
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, #fff, #f3f3f3 46%, #cfcfcf 100%);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.22), inset 0 1px 4px rgba(255, 255, 255, 0.95);
  transition: left 180ms ease;
}

.record-mode-toggle[aria-pressed="true"] .toggle-knob {
  left: calc(100% - 40px);
}

.record-mode-panel {
  margin-top: 28px;
}

.record-mode-panel[hidden] {
  display: none;
}

.record-mode-main {
  display: grid;
  grid-template-columns: minmax(520px, 1.08fr) minmax(420px, 0.72fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: end;
  min-height: 620px;
}

.record-player {
  position: relative;
  min-height: 620px;
}

.record-platter {
  position: relative;
  width: min(64vw, 700px);
  aspect-ratio: 1;
  margin: 0 auto;
}

.record-disc {
  position: absolute;
  inset: 4%;
  z-index: 1;
  display: grid;
  place-items: center;
  border: 7px solid rgba(232, 237, 241, 0.88);
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 28%, rgba(255, 255, 255, 0.18), transparent 18%),
    radial-gradient(circle, #17191a 0 18%, #202222 19% 36%, #17191a 37% 100%);
  box-shadow:
    inset 0 0 36px rgba(255, 255, 255, 0.1),
    inset 0 0 100px rgba(0, 0, 0, 0.78),
    0 34px 46px rgba(0, 0, 0, 0.44);
  overflow: hidden;
}

.record-disc.is-spinning {
  animation: recordSpin 10s linear infinite;
}

.record-groove {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  pointer-events: none;
}

.groove-one {
  inset: 13%;
}

.groove-two {
  inset: 23%;
}

.groove-three {
  inset: 33%;
}

.record-disc img {
  position: relative;
  z-index: 2;
  width: 31%;
  aspect-ratio: 1;
  border: 4px solid rgba(230, 235, 238, 0.88);
  border-radius: 50%;
  object-fit: cover;
}

.record-pin {
  position: absolute;
  z-index: 3;
  width: 28px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, #fff, #b8c0c5 34%, #5b666d 72%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

.record-arm {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.record-arm-image {
  position: absolute;
  top: 6%;
  right: -7%;
  width: 52%;
  height: auto;
  transform: rotate(-10deg);
  transform-origin: 78% 12%;
  filter: drop-shadow(0 12px 12px rgba(0, 0, 0, 0.34));
}

.record-control-card {
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  padding: 28px;
  background: rgba(23, 29, 37, 0.86);
}

.record-title-line {
  flex-wrap: wrap;
}

.record-title {
  font-size: clamp(1.6rem, 2.25vw, 2.3rem);
  line-height: 1;
}

.record-creator {
  font-size: 1.32rem;
}

.record-play-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.record-control-card .record-play-button {
  width: 58px;
  min-width: 58px;
  min-height: 58px;
}

.record-control-card .record-play-button svg {
  width: 28px;
  height: 28px;
}

.record-downloads {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.record-downloads .library-format-button {
  width: 100%;
}

.record-floating-card {
  width: min(100%, 520px);
  max-width: 520px;
  justify-self: end;
  margin-bottom: 42px;
}

.record-track-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 28px;
  margin-top: 52px;
}

.record-track-card {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 0;
  align-items: center;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.record-track-card img {
  width: 116px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  object-fit: cover;
}

.record-track-card span {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 116px;
  align-content: center;
  border: 1px solid var(--line);
  padding: 18px 112px 18px 18px;
  background: rgba(23, 29, 37, 0.76);
}

.record-track-card strong {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
  color: #fff;
  font-size: 1.18rem;
  line-height: 1.15;
}

.record-track-card em {
  color: var(--cyan);
  font-style: normal;
  font-size: 0.92rem;
  white-space: nowrap;
}

.record-track-card small {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 800;
}

.record-select-button {
  position: absolute;
  right: 16px;
  bottom: 16px;
  min-height: 34px;
  border: 0;
  padding: 0 16px;
  color: #101820;
  background: #fff;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.22);
}

.record-select-button:hover,
.record-select-button:focus-visible {
  outline: none;
  background: #e9f8ff;
}

.record-track-card.is-selected .record-select-button {
  color: #fff;
  background: rgba(36, 213, 255, 0.22);
  border: 1px solid rgba(36, 213, 255, 0.5);
  box-shadow: none;
  cursor: default;
}

@keyframes recordSpin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1180px) and (min-width: 941px) {
  .record-mode-main {
    grid-template-columns: minmax(400px, 0.96fr) minmax(340px, 0.72fr);
    gap: 28px;
    min-height: 520px;
  }

  .record-player {
    min-height: 520px;
  }

  .record-platter {
    width: min(54vw, 560px);
  }

  .record-arm-image {
    width: 54%;
    right: -3%;
  }

  .record-track-strip {
    gap: 18px;
  }
}

.icon-button,
.secondary-button,
.primary-button,
.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid transparent;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.icon-button {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-color: var(--line);
  background: var(--panel-2);
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scope-wrap {
  position: relative;
  margin-top: 30px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    #080b10;
  background-size: 28px 28px;
}

.scope-meta {
  position: absolute;
  inset: 16px 18px auto 18px;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  pointer-events: none;
}

canvas {
  display: block;
  width: 100%;
  height: min(36vh, 440px);
  min-height: 285px;
}

.composer-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.88fr) minmax(0, 1.4fr);
  gap: 14px;
  margin-top: 16px;
}

.snippet-bank,
.timeline-panel {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 11, 16, 0.46);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.section-head span {
  color: var(--cyan);
  font-size: 0.84rem;
  white-space: nowrap;
}

.snippet-list {
  min-height: 184px;
  max-height: 292px;
  overflow: auto;
  padding: 12px;
}

.snippet-card,
.timeline-item,
.empty-list,
.timeline-empty {
  border: 1px solid var(--line);
  background: rgba(23, 29, 37, 0.82);
}

.snippet-card,
.timeline-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  cursor: grab;
}

.snippet-card:active,
.timeline-item:active {
  cursor: grabbing;
}

.snippet-card strong,
.timeline-item strong {
  display: block;
  color: #fff;
  font-size: 0.95rem;
}

.snippet-card span,
.timeline-item span,
.empty-list,
.timeline-empty {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.empty-list,
.timeline-empty {
  padding: 14px;
}

.timeline-dropzone {
  min-height: 184px;
  padding: 12px;
  transition:
    border-color 160ms ease,
    background-color 160ms ease;
}

.timeline-dropzone.is-dragging {
  outline: 1px solid rgba(36, 213, 255, 0.58);
  background: rgba(36, 213, 255, 0.05);
}

.timeline-list {
  display: flex;
  gap: 10px;
  min-height: 120px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.timeline-item {
  flex-direction: column;
  align-items: flex-start;
  flex-basis: 180px;
  min-width: 180px;
  max-width: 360px;
  border-color: rgba(239, 36, 57, 0.34);
  background: linear-gradient(180deg, rgba(239, 36, 57, 0.16), rgba(23, 29, 37, 0.86));
}

.timeline-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
}

.timeline-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.07);
}

.timeline-summary div {
  padding: 16px;
  background: rgba(12, 15, 20, 0.78);
}

.timeline-summary span,
.download-panel span,
.progress-copy span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.timeline-summary strong,
.download-panel strong,
.progress-copy strong {
  display: block;
  margin-top: 6px;
  color: #fff;
  font-size: 0.96rem;
}

.export-row {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.export-actions,
.transport {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.export-action {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.secondary-button,
.primary-button,
.download-link,
.small-button,
.info-button {
  min-height: 50px;
  padding: 0 19px;
  font-weight: 800;
}

.secondary-button {
  border-color: var(--line);
  background: var(--panel-2);
}

.primary-button,
.download-link {
  border-color: rgba(239, 36, 57, 0.78);
  background: linear-gradient(180deg, var(--red), var(--red-2));
  box-shadow: 0 16px 34px rgba(239, 36, 57, 0.22);
}

.alt-primary {
  border-color: rgba(36, 213, 255, 0.72);
  background: linear-gradient(180deg, #17aace, #0c738d);
  box-shadow: 0 16px 34px rgba(36, 213, 255, 0.15);
}

.full-button {
  width: 100%;
  margin-top: 10px;
}

.full-button:first-child {
  margin-top: 0;
}

.small-button,
.info-button {
  min-height: 34px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--panel-2);
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.small-button {
  padding: 0 10px;
  font-size: 0.78rem;
}

.small-button:disabled,
.primary-button:disabled,
.secondary-button:disabled,
.download-link:disabled,
.info-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.danger {
  border-color: rgba(239, 36, 57, 0.46);
  color: #ffc8ce;
}

.linx-snippet-card .small-button.danger {
  border-color: rgba(239, 36, 57, 0.72);
  color: #ffdce0;
  background: rgba(239, 36, 57, 0.16);
  box-shadow: 0 0 18px rgba(239, 36, 57, 0.16);
  font-weight: 900;
  text-transform: none;
  letter-spacing: 0;
}

.info-button {
  width: 42px;
  min-height: 50px;
  padding: 0;
  border-color: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #fff;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 1rem;
}

.info-panel {
  justify-self: end;
  max-width: 620px;
  padding: 12px 14px;
  border: 1px solid rgba(36, 213, 255, 0.32);
  color: #d8f6ff;
  background: rgba(36, 213, 255, 0.08);
  font-size: 0.9rem;
  line-height: 1.45;
}

.info-panel[hidden] {
  display: none;
}

.empty-list[hidden],
.timeline-empty[hidden] {
  display: none;
}

.download-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 15px;
  border: 1px solid rgba(82, 210, 115, 0.36);
  background: rgba(82, 210, 115, 0.08);
}

.progress-panel {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 15px;
  border: 1px solid rgba(36, 213, 255, 0.32);
  background: rgba(36, 213, 255, 0.07);
}

.progress-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.progress-copy strong {
  color: var(--cyan);
}

.progress-track {
  position: relative;
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.28);
}

.progress-track i {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--red));
  box-shadow: 0 0 18px rgba(36, 213, 255, 0.42);
  transition: width 120ms ease;
}

.progress-panel[hidden],
.download-panel[hidden] {
  display: none;
}

#stimTool .control-block > .progress-panel,
#stimTool .control-block > .download-panel {
  margin-top: 10px;
}

#stimTool .control-block > .download-panel {
  display: grid;
  align-items: stretch;
  gap: 12px;
}

#stimTool .control-block > .progress-panel[hidden],
#stimTool .control-block > .download-panel[hidden] {
  display: none;
}

#stimTool .control-block > .download-panel .download-link {
  display: grid;
  place-items: center;
  text-align: center;
}

.linx-meta {
  display: grid;
  gap: 18px;
}

.linx-meta[hidden] {
  display: none;
}

.linx-meta-item {
  display: grid;
  gap: 8px;
}

.linx-meta-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.linx-meta-item > span,
.linx-meta-heading span,
.linx-param label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.linx-meta-value {
  display: block;
  color: var(--text);
  font-size: 1.28rem;
  line-height: 1.15;
}

.linx-edit-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(36, 213, 255, 0.35);
  color: var(--cyan);
  background: rgba(36, 213, 255, 0.08);
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.linx-edit-button:hover,
.linx-edit-button:focus-visible {
  transform: translateY(-1px);
  border-color: var(--cyan);
  background: rgba(36, 213, 255, 0.14);
  outline: none;
}

.linx-edit-button[hidden],
.linx-meta-value[hidden],
.linx-name-input[hidden] {
  display: none;
}

.linx-name-input,
.linx-snippet-name,
.linx-param input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text);
  background: rgba(8, 11, 16, 0.72);
  padding: 9px 10px;
}

.linx-param input[type="number"] {
  appearance: textfield;
  padding-right: 34px;
}

.linx-param input[type="number"]::-webkit-outer-spin-button,
.linx-param input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.linx-name-input:focus,
.linx-snippet-name:focus,
.linx-param input:focus {
  outline: none;
  border-bottom-color: var(--cyan);
}

.number-stepper {
  position: relative;
  min-width: 0;
}

.number-stepper-buttons {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 18px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.18);
  transition: opacity 140ms ease;
}

.number-stepper:hover .number-stepper-buttons,
.number-stepper:focus-within .number-stepper-buttons {
  opacity: 1;
  pointer-events: auto;
}

.number-step-button {
  width: 18px;
  height: 15px;
  border: 0;
  padding: 0;
  color: #ffffff;
  background: transparent;
  cursor: pointer;
}

.number-step-button::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  margin: 0 auto;
  border-right: 5px solid transparent;
  border-left: 5px solid transparent;
}

.number-step-button.up::before {
  border-bottom: 6px solid currentColor;
}

.number-step-button.down::before {
  border-top: 6px solid currentColor;
}

.number-step-button:hover,
.number-step-button:focus-visible,
.number-step-button.active {
  color: var(--cyan);
  background: rgba(36, 213, 255, 0.14);
}

.stim-preset-panel {
  display: grid;
  gap: 14px;
}

.stim-preset-panel[hidden] {
  display: none;
}

.stim-preset-panel summary {
  list-style: none;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
}

.stim-preset-panel summary::-webkit-details-marker {
  display: none;
}

.stim-preset-panel summary::after {
  content: "+";
  float: right;
  color: var(--cyan);
  font-size: 1rem;
  line-height: 0.8;
}

.stim-preset-panel[open] summary::after {
  content: "-";
}

.stim-preset-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.stim-preset-card {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  padding: 12px;
  background: rgba(8, 11, 16, 0.45);
  transition:
    border-color 160ms ease,
    background-color 160ms ease;
}

.stim-preset-card:hover,
.stim-preset-card:focus-within {
  border-color: rgba(36, 213, 255, 0.45);
  background: rgba(36, 213, 255, 0.06);
}

.stim-preset-card strong {
  color: var(--text);
  font-size: 0.98rem;
}

.stim-preset-card small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.stim-preset-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-3px);
  transition:
    max-height 160ms ease,
    margin-top 160ms ease,
    opacity 160ms ease,
    transform 160ms ease;
}

.stim-preset-card:hover .stim-preset-actions,
.stim-preset-card:focus-within .stim-preset-actions {
  max-height: 44px;
  margin-top: 8px;
  opacity: 1;
  transform: translateY(0);
}

.stim-preset-actions .small-button:first-child {
  border-color: rgba(36, 213, 255, 0.45);
  color: var(--cyan);
}

.stim-preset-actions .small-button:last-child {
  border-color: rgba(176, 106, 255, 0.5);
  color: #cda9ff;
}

.stim-playlist-card .stim-preset-actions {
  grid-template-columns: 1fr;
}

.stim-playlist-card .stim-preset-actions .small-button,
.stim-playlist-card .stim-preset-actions .small-button:last-child {
  border-color: rgba(36, 213, 255, 0.45);
  color: var(--cyan);
}

.stim-preset-actions .small-button:hover,
.stim-preset-actions .small-button:focus-visible {
  transform: none;
}

.linx-info-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.07);
}

.linx-info-bar div {
  padding: 14px;
  background: rgba(12, 15, 20, 0.78);
}

.linx-info-bar span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.linx-info-bar strong {
  display: block;
  margin-top: 6px;
  color: #fff;
  font-size: 0.9rem;
}

.stim-buffer-note {
  display: inline-block;
  margin-left: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.linx-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 50px 24px;
  border: 1px dashed rgba(36, 213, 255, 0.26);
  background: rgba(8, 11, 16, 0.48);
  text-align: center;
}

.linx-empty[hidden],
.linx-editor[hidden] {
  display: none;
}

.linx-empty strong {
  font-size: 1.1rem;
}

.linx-empty span {
  color: var(--muted);
}

.linx-editor {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.linx-channel-switch {
  display: none;
}

.linx-channels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.linx-channel {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 11, 16, 0.46);
}

.linx-channel.ch1 {
  border-top: 2px solid var(--cyan);
}

.linx-channel.ch2 {
  border-top: 2px solid #b06aff;
}

.linx-snippet-list {
  display: grid;
  gap: 10px;
  min-height: 160px;
  padding: 12px;
}

.linx-snippet-card {
  border: 1px solid var(--line);
  background: rgba(23, 29, 37, 0.82);
  padding: 12px;
}

.linx-snippet-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.linx-order-controls {
  display: grid;
  grid-template-columns: auto auto;
  justify-items: center;
  align-items: center;
  column-gap: 5px;
  width: 50px;
}

.linx-order-number {
  display: grid;
  min-width: 20px;
  place-items: center;
  color: var(--muted);
  font-size: 1.06rem;
  font-weight: 900;
  line-height: 1;
}

.linx-order-arrows {
  display: grid;
  gap: 2px;
}

.linx-order-button {
  width: 18px;
  height: 14px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.linx-order-button::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  margin: 0 auto;
  border-right: 7px solid transparent;
  border-left: 7px solid transparent;
}

.linx-order-button.move-up::before {
  border-bottom: 12px solid var(--text);
}

.linx-order-button.move-down::before {
  border-top: 12px solid var(--text);
}

.linx-order-button:hover::before,
.linx-order-button:focus-visible::before {
  filter: drop-shadow(0 0 8px rgba(36, 213, 255, 0.72));
}

.linx-order-button:focus-visible {
  outline: none;
}

.linx-param-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.linx-param {
  display: grid;
  gap: 5px;
}

.linx-snippet-duration {
  margin-top: 10px;
  color: var(--cyan);
  font-size: 0.84rem;
  font-weight: 400;
  text-align: right;
  letter-spacing: 0;
}

.linx-param[data-phase="rise"] > span {
  color: var(--rise);
}

.linx-param[data-phase="hold"] > span {
  color: var(--hold);
}

.linx-param[data-phase="fall"] > span {
  color: var(--fall);
}

.linx-param[data-phase="rest"] > span {
  color: var(--rest);
}

.linx-param[data-phase="freq"] > span {
  color: var(--freq);
}

.linx-param[data-phase="width"] > span {
  color: var(--width);
}

.linx-param[data-phase="repeat"] > span {
  color: var(--cyan);
  min-height: 2.35em;
}

#stimTool.sine-mode .linx-phase-legend {
  display: none;
}

#stimTool.sine-mode .stim-param-grid .linx-param[data-phase="rise"] > span,
#stimTool.sine-mode .stim-param-grid .linx-param[data-phase="hold"] > span,
#stimTool.sine-mode .stim-param-grid .linx-param[data-phase="fall"] > span,
#stimTool.sine-mode .stim-param-grid .linx-param[data-phase="rest"] > span {
  color: var(--text);
}

.stim-param-grid .linx-param > span {
  min-height: 2.35em;
}

.linx-param input.invalid {
  background: rgba(239, 36, 57, 0.12);
}

.linx-waveform-row {
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #080b10;
}

.linx-waveform {
  display: block;
  width: 100%;
  height: 44px;
  min-height: 44px;
}

.channel-footer {
  display: flex;
  justify-content: center;
  padding: 10px 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.summary-canvas-wrap {
  padding: 16px;
  overflow-x: hidden;
  background: #080b10;
}

.linx-phase-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px 0;
  background: #080b10;
}

.linx-phase-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.linx-phase-legend i {
  display: block;
  width: 26px;
  height: 4px;
}

.phase-rise {
  background: var(--rise);
}

.phase-hold {
  background: var(--hold);
}

.phase-fall {
  background: var(--fall);
}

.phase-rest {
  background: var(--rest);
}

#linxSummaryCanvas {
  display: block;
  width: 100%;
  min-height: 250px;
}

#stimSummaryCanvas {
  display: block;
  width: 100%;
  min-height: 250px;
}

.stim-summary-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.stim-window-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.section-head .stim-window-controls span {
  color: var(--muted);
  font-size: 0.78rem;
}

.stim-window-button {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-color: rgba(36, 213, 255, 0.34);
  color: var(--cyan);
  background: rgba(36, 213, 255, 0.06);
}

.stim-window-button:hover,
.stim-window-button:focus-visible {
  border-color: var(--cyan);
  color: #ffffff;
  background: rgba(36, 213, 255, 0.14);
}

.stim-window-button:disabled {
  opacity: 0.32;
  cursor: not-allowed;
  box-shadow: none;
}

.stim-play-button {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-color: rgba(36, 213, 255, 0.58);
  color: var(--cyan);
  background: rgba(36, 213, 255, 0.08);
}

.stim-play-button:hover,
.stim-play-button:focus-visible,
.stim-play-button.is-playing {
  border-color: var(--cyan);
  color: #ffffff;
  background: rgba(36, 213, 255, 0.16);
  box-shadow: 0 0 20px rgba(36, 213, 255, 0.16);
}

.stim-play-button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  box-shadow: none;
}

.stim-view-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px 0;
  background: #080b10;
}

.stim-view-toggle .small-button.active {
  border-color: var(--cyan);
  color: #ffffff;
  background: rgba(36, 213, 255, 0.12);
}

.linx-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10;
  border: 1px solid rgba(36, 213, 255, 0.42);
  padding: 10px 14px;
  color: #d8f6ff;
  background: rgba(8, 11, 16, 0.94);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.linx-toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 940px) {
  .app-shell {
    padding: 14px;
  }

  .tool-grid {
    padding-top: 0;
  }

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

  .fun-mode-control,
  .record-mode-toggle,
  .record-mode-panel {
    display: none;
  }

  .library-action-row {
    display: block;
  }

  .library-submit-note {
    display: block;
  }

  .library-item {
    grid-template-columns: 92px 36px minmax(0, 1fr);
    gap: 12px 10px;
    align-items: center;
    border: 1px solid var(--line);
    padding: 14px;
    background: rgba(23, 29, 37, 0.82);
  }

  .library-card {
    display: contents;
  }

  .library-heading {
    grid-column: 1 / -1;
    flex-wrap: wrap;
  }

  .library-thumbnail {
    grid-column: 1;
    grid-row: 2 / span 2;
    width: 92px;
    min-height: 0;
    align-self: start;
  }

  .library-item .library-play-button {
    grid-column: 2;
    grid-row: 2;
    width: 36px;
    min-width: 36px;
    min-height: 36px;
  }

  .library-item .library-play-button svg {
    width: 17px;
    height: 17px;
  }

  .library-seek {
    grid-column: 3;
    grid-row: 2;
  }

  .library-downloads {
    grid-column: 2 / -1;
    grid-row: 3;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .library-item .library-format-button {
    width: 100%;
    min-height: 44px;
    padding: 0 10px;
    font-size: 0.9rem;
  }

  .library-pagination {
    gap: 10px;
  }

  .library-page-button,
  .library-page-number {
    min-height: 38px;
    padding: 0 12px;
  }

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

  .stage {
    min-height: auto;
  }

  .control-panel {
    order: 2;
  }

  .stage {
    order: 1;
  }

  #linxTool .stage > .control-panel,
  #stimTool .stage > .control-panel {
    margin: 24px 0;
    box-shadow: none;
  }

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

  .timeline-list {
    flex-direction: column;
  }

  .timeline-item {
    max-width: none;
  }

  .linx-channels,
  .linx-info-bar {
    grid-template-columns: 1fr;
  }

  .linx-channel-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .linx-channel-toggle {
    display: grid;
    gap: 4px;
    min-height: 62px;
    border: 1px solid var(--line);
    border-top: 3px solid transparent;
    padding: 12px;
    color: var(--text);
    background: rgba(8, 11, 16, 0.56);
    text-align: left;
    cursor: pointer;
  }

  .linx-channel-toggle.ch1 {
    border-top-color: var(--cyan);
  }

  #stimTool .linx-summary-panel .section-head {
    align-items: start;
  }

  .stim-summary-actions {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: end;
    align-items: start;
    gap: 10px 12px;
  }

  .stim-window-controls {
    grid-column: 1 / -1;
    order: 0;
    justify-content: end;
  }

  #stimTool #stimSummaryMeta {
    justify-self: end;
    align-self: center;
  }

  .linx-channel-toggle.ch2 {
    border-top-color: #b06aff;
  }

  .linx-channel-toggle span {
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.12em;
  }

  .linx-channel-toggle small {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 800;
  }

  .linx-channel-toggle.active {
    background: rgba(23, 29, 37, 0.92);
    box-shadow: inset 0 0 0 1px rgba(36, 213, 255, 0.14);
  }

  #linxTool .linx-channel:not(.mobile-active),
  #stimTool .linx-channel:not(.mobile-active) {
    display: none;
  }

  .stim-preset-card .stim-preset-actions {
    max-height: 44px;
    margin-top: 8px;
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 620px) {
  .stage-head,
  .transport,
  .export-actions,
  .export-action,
  .download-panel,
  .progress-copy {
    align-items: stretch;
  }

  .stage-head,
  .transport,
  .export-actions,
  .export-action,
  .download-panel,
  .progress-copy {
    flex-direction: column;
  }

  .topbar {
    flex-direction: row;
    align-items: center;
  }

  .brand strong,
  .brand small {
    white-space: nowrap;
  }

  .brand strong {
    font-size: 0.95rem;
  }

  .select-tool-button {
    min-width: auto;
    padding: 9px 10px;
    font-size: 0.72rem;
  }

  .hub-copy {
    padding: 28px 24px 18px;
  }

  .hub-copy p {
    font-size: 1rem;
    line-height: 1.55;
  }

  .tool-grid {
    gap: 14px;
    padding: 0 24px 28px;
  }

  .tool-card {
    min-height: 0;
    gap: 10px;
    padding: 18px;
  }

  .tool-card strong {
    font-size: 1.06rem;
    line-height: 1.15;
  }

  #stimTool .stim-summary-actions {
    grid-template-columns: auto auto;
    width: 100%;
  }

  #stimTool .stim-play-button {
    justify-self: start;
  }

  #stimTool .stim-window-controls {
    min-width: 0;
    justify-content: space-between;
  }

  #stimTool .stim-window-controls span {
    min-width: 0;
    text-align: center;
  }

  .tool-card small {
    max-width: none;
  }

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

  .quick-options {
    grid-template-columns: repeat(5, minmax(42px, 1fr));
  }

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

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

  h1 {
    font-size: 2.32rem;
  }

  canvas {
    height: 360px;
  }

  .icon-button {
    align-self: flex-start;
  }
}
