.wb-topbar {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid #262626;
  min-height: var(--wb-topbar-height);
}

.wb-tb-left {
  display: flex;
  align-items: center;
  min-width: 0;
}

/* Match classic desktop rail lockup: logo + Microcosm / Editor Beta */
.wb-tb-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  line-height: normal;
}

.wb-tb-logo {
  display: block;
  height: 30px;
  width: auto;
  flex-shrink: 0;
}

.wb-tb-tagline {
  display: flex;
  flex-direction: column;
  width: auto;
  max-width: 118px;
  margin-top: 0;
  padding-left: 0;
  text-align: left;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #fff;
  line-height: 1.08;
}

.wb-tb-tagline-line {
  display: block;
}

.wb-tb-tagline-beta {
  color: rgba(255, 255, 255, 0.5);
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
}

.wb-tb-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.wb-tb-help {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.wb-tb-help:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.wb-tb-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.wb-tb-status:hover {
  background: rgba(255, 255, 255, 0.08);
}

.wb-tb-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #666;
}

.wb-tb-status--connected .wb-tb-dot {
  background: var(--connected);
  box-shadow: 0 0 6px rgba(111, 207, 111, 0.53);
}

.wb-tb-status--disconnected .wb-tb-dot {
  background: #d9736b;
  box-shadow: none;
}

.wb-tb-status--unsupported .wb-tb-dot {
  background: #555;
}

/* Nothing selected yet: the chip is the only route to MIDI, so it reads as an
   invitation rather than a status. The prominence comes from the border and
   the label — never from the dot, which must keep reporting the real state.
   An accent-coloured dot here would read as "connected" and contradict the
   very text it sits next to. */
.wb-tb-status--cta {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.26);
  color: var(--text);
  padding: 4px 9px;
}

.wb-tb-status--cta:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.42);
}

.wb-tb-status-text {
  white-space: nowrap;
}

/* ── MIDI settings modal ── */
.wb-tb-troubleshoot {
  margin-bottom: 14px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(207, 111, 111, 0.1);
  border: 1px solid rgba(207, 111, 111, 0.25);
  color: #d4a0a0;
  font-size: 12px;
  line-height: 1.45;
}

.wb-tb-section {
  margin-bottom: 18px;
}

.wb-tb-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.wb-tb-section-head .wb-tb-section-label {
  margin-bottom: 0;
}

.wb-tb-section-label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.wb-tb-link-btn {
  background: none;
  border: none;
  color: var(--border-active);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
}

.wb-tb-link-btn:hover {
  color: var(--text);
}

.wb-tb-ch-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-width: 280px;
}

.wb-tb-ch-btn {
  min-width: 0;
  padding: 10px 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.wb-tb-ch-btn:hover {
  border-color: var(--hover-border);
  color: var(--text);
}

.wb-tb-ch-btn--active {
  border-color: var(--border-active);
  background: rgba(143, 179, 164, 0.14);
  color: var(--text);
}

.wb-tb-output-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wb-tb-output-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.wb-tb-output-row:hover {
  border-color: var(--hover-border);
}

.wb-tb-output-row--active {
  border-color: var(--border-active);
  background: rgba(143, 179, 164, 0.1);
}

.wb-tb-output-name {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wb-tb-output-check {
  color: var(--border-active);
  flex-shrink: 0;
  font-size: 14px;
}

.wb-tb-connected-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--connected);
}

.wb-tb-hint {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.wb-tb-hint--tight {
  margin-bottom: 10px;
  font-size: 11px;
}

.wb-tb-btn {
  padding: 10px 14px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.12s ease;
}

.wb-tb-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.wb-tb-btn--block {
  width: 100%;
  margin-bottom: 16px;
}

.wb-tb-btn--secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: var(--text);
}

.wb-tb-btn--secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
}

.wb-tb-btn--primary {
  background: var(--text);
  border: 1px solid var(--text);
  color: var(--bg);
}

.wb-tb-btn--primary:hover:not(:disabled) {
  opacity: 0.92;
}

.wb-tb-note {
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
  margin-top: 4px;
}
