:root {
  --fb-bg: #080a0d;
  --fb-panel: rgba(15, 18, 24, 0.94);
  --fb-panel-hi: rgba(23, 27, 35, 0.96);
  --fb-line: rgba(255, 255, 255, 0.11);
  --fb-text: #f2f5f7;
  --fb-muted: rgba(242, 245, 247, 0.62);
  --fb-cyan: #6ee7ff;
  --fb-lime: #b8ff6e;
  --fb-rose: #ff6e91;
  --fb-gold: #ffd36e;
  --fb-blue: #8aa8ff;
}

.ls-page-freqboard {
  background:
    linear-gradient(145deg, rgba(10, 18, 24, 0.95), rgba(8, 10, 13, 1) 52%, rgba(16, 13, 20, 1));
  color: var(--fb-text);
}

.fb-shell {
  width: min(1560px, 100%);
  margin: 0 auto;
  padding: 14px clamp(10px, 2.4vw, 28px) 88px;
}

.fb-stage,
.fb-panel {
  border: 1px solid var(--fb-line);
  background: var(--fb-panel);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.28);
}

.fb-stage {
  border-radius: 12px;
  overflow: hidden;
}

.fb-meter-panel {
  min-height: 210px;
  background: #080a0d;
  position: relative;
}

.fb-spectrum {
  width: 100%;
  height: 230px;
  display: block;
}

.fb-scope-labels {
  position: absolute;
  inset: auto 16px 10px;
  display: flex;
  justify-content: space-between;
  color: var(--fb-muted);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

.fb-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  padding: 10px;
  border-top: 1px solid var(--fb-line);
  background: rgba(255, 255, 255, 0.03);
}

.fb-btn,
.fb-segments button {
  min-height: 38px;
  border: 1px solid var(--fb-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--fb-text);
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}

.fb-btn {
  padding: 0 14px;
}

.fb-btn:hover,
.fb-segments button:hover {
  border-color: rgba(110, 231, 255, 0.6);
}

.fb-primary,
.fb-btn.active,
.fb-segments button.active {
  background: var(--fb-cyan);
  border-color: var(--fb-cyan);
  color: #061014;
}

.fb-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.fb-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
  align-items: start;
}

.fb-controls,
.fb-main {
  display: grid;
  gap: 14px;
}

.fb-panel {
  border-radius: 12px;
  padding: 14px;
}

.fb-panel-head h1,
.fb-panel-head h2,
.fb-section-title h2 {
  margin: 0;
  letter-spacing: 0;
}

.fb-panel-head h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.fb-panel-head h2,
.fb-section-title h2 {
  font-size: 1rem;
}

.fb-panel-head p,
.fb-section-title span {
  margin: 6px 0 0;
  color: var(--fb-muted);
  line-height: 1.45;
  font-size: 0.86rem;
}

.fb-panel-head.compact p {
  font-size: 0.8rem;
}

.fb-control-block {
  margin-top: 16px;
}

.fb-label {
  display: block;
  color: var(--fb-muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.fb-segments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  gap: 6px;
}

.fb-slider {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--fb-muted);
  font-size: 0.8rem;
}

.fb-slider span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.fb-slider strong {
  color: var(--fb-text);
  font-variant-numeric: tabular-nums;
}

.fb-slider input[type="range"] {
  width: 100%;
  accent-color: var(--fb-cyan);
}

.fb-switches {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.fb-switches label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--fb-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fb-readout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.fb-readout div {
  border: 1px solid var(--fb-line);
  border-radius: 8px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.04);
  min-width: 0;
}

.fb-readout span {
  display: block;
  color: var(--fb-muted);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.fb-readout strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
}

.fb-section-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
  margin-bottom: 12px;
}

.fb-key-grid {
  --cols: 10;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(44px, 1fr));
  gap: 6px;
}

.fb-key {
  min-width: 0;
  aspect-ratio: 1 / 0.78;
  border: 1px solid color-mix(in srgb, var(--key-color), white 12%);
  border-radius: 7px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--key-color), transparent 62%), rgba(255, 255, 255, 0.035)),
    #10141b;
  color: var(--fb-text);
  cursor: pointer;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 2px;
  padding: 6px 4px;
  text-align: left;
  overflow: hidden;
}

.fb-key.active {
  background: var(--key-color);
  color: #071014;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--key-color), white 42%), 0 0 18px var(--key-color);
  transform: translateY(1px);
}

.fb-key-index,
.fb-key-map {
  font-size: clamp(0.52rem, 1.2vw, 0.72rem);
  font-weight: 900;
  line-height: 1;
  opacity: 0.86;
}

.fb-key-freq {
  align-self: end;
  font-size: clamp(0.48rem, 1vw, 0.66rem);
  font-weight: 800;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.fb-voice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
  gap: 7px;
}

.fb-voice-grid + .fb-voice-grid {
  margin-top: 10px;
}

.fb-voice {
  min-height: 52px;
  border: 1px solid var(--fb-line);
  border-radius: 8px;
  color: var(--fb-text);
  font-size: 1rem;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.fb-voice[data-kind="vowel"] {
  background: rgba(110, 231, 255, 0.12);
  border-color: rgba(110, 231, 255, 0.35);
}

.fb-voice.active {
  background: var(--fb-gold);
  color: #151006;
}

.fb-timeline {
  width: 100%;
  height: 220px;
  display: block;
  border: 1px solid var(--fb-line);
  border-radius: 8px;
  background: #090c11;
}

.fb-file {
  width: 100%;
  margin-top: 10px;
  color: var(--fb-muted);
}

.fb-player audio {
  width: 100%;
  margin-top: 10px;
}

.fb-eq {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  height: 96px;
  align-items: end;
  margin-top: 12px;
}

.fb-eq span {
  height: var(--h);
  min-height: 20px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, var(--fb-lime), rgba(110, 231, 255, 0.45));
  color: #061014;
  display: flex;
  align-items: end;
  justify-content: center;
  padding: 5px 2px;
  font-size: 0.58rem;
  font-weight: 900;
  text-align: center;
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .fb-grid {
    grid-template-columns: 1fr;
  }

  .fb-key-grid {
    --cols: 5;
  }
}

@media (max-width: 620px) {
  .fb-shell {
    padding-inline: 8px;
  }

  .fb-toolbar {
    padding: 8px;
  }

  .fb-btn {
    min-height: 42px;
    padding-inline: 12px;
  }

  .fb-section-title {
    display: block;
  }

  .fb-key-grid {
    --cols: 4;
    gap: 5px;
  }

  .fb-key {
    aspect-ratio: 1 / 0.92;
  }

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