.wb-context {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.wb-ctx-tabs {
  display: flex;
  flex-shrink: 0;
  border-bottom: 1px solid #262626;
}

/* Shares the .wb-lib-title type style, scaled down for a tab bar: these tabs and
   the Library heading are the same thing structurally — the top of a column — so
   they read as a pair rather than as chrome on one side and a heading on the
   other. Sentence case comes from the markup; no text-transform. */
.wb-ctx-tab {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 11px 0;
  cursor: pointer;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #8f8f8f;
  transition: color 0.15s, border-color 0.15s;
}

.wb-ctx-tab:hover {
  color: var(--text-secondary);
}

.wb-ctx-tab--active {
  color: var(--text);
  border-bottom-color: var(--text);
}

.wb-ctx-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.wb-ctx-panel {
  padding: 16px;
}

.wb-ctx-hint {
  font-size: 11px;
  color: #7a7a7a;
  margin-bottom: 12px;
  line-height: 1.45;
}

.wb-ctx-banks {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wb-ctx-bank {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 10px 12px;
}

/* The pedal colour-codes its four user banks red, yellow, green, blue, so the
   label names the colour — a player reading "USER SLOT 3 - GREEN" here can find it
   on the hardware by its green light. */
.wb-ctx-bank-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.wb-ctx-bank-slots {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wb-ctx-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  position: relative;
}

.wb-ctx-slot:hover {
  background: rgba(255, 255, 255, 0.03);
}

.wb-ctx-slot--selected {
  background: rgba(143, 179, 164, 0.14);
  border-color: #8fb3a4;
}

.wb-ctx-panel--slots {
  position: relative;
}

.wb-ctx-dnd-hint {
  display: block;
  position: absolute;
  left: 8px;
  right: 8px;
  top: 8px;
  z-index: 2;
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px dashed rgba(143, 179, 164, 0.45);
  background: rgba(20, 20, 20, 0.92);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: #8fb3a4;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s;
}

body.wb-dnd-active .wb-ctx-dnd-hint {
  opacity: 1;
  transform: translateY(0);
}

.wb-ctx-slot--drop-hover {
  background: rgba(143, 179, 164, 0.18) !important;
  border-color: #8fb3a4 !important;
  box-shadow: 0 0 0 1px rgba(143, 179, 164, 0.35);
}

.wb-ctx-slot--drop-hover .wb-ctx-slot-name {
  color: var(--text);
  font-weight: 500;
}

.wb-ctx-slot--drop-replace {
  background: rgba(207, 111, 111, 0.12) !important;
  border-color: #c97878 !important;
  box-shadow: 0 0 0 1px rgba(201, 120, 120, 0.35);
}

.wb-ctx-slot--drop-replace .wb-ctx-slot-name {
  color: #f0d0d0;
  font-weight: 500;
}

.wb-ctx-slot-drop-badge {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e8a0a0;
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid rgba(201, 120, 120, 0.45);
  background: rgba(207, 111, 111, 0.12);
}

.wb-ctx-slot-id {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #7a7a7a;
  width: 16px;
  flex-shrink: 0;
}

.wb-ctx-slot-name {
  font-size: 11px;
  color: #dcdcdc;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wb-ctx-slot-time {
  font-family: var(--font-mono);
  font-size: 9px;
  color: #6a6a6a;
  flex-shrink: 0;
}

/* ── Pending (assigned locally, never written to the pedal) ─────────────────
   The label sits in the same secondary grey as every other bit of row metadata,
   with the state carried by a single small dot. Amber text read as an error
   eight rows deep — and since a fresh migration marks *everything* pending, the
   warning colour became the panel's dominant note while the preset names, which
   are the actual content, receded. Colour is the accent here, not the message. */
.wb-ctx-slot-pending {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8f8f8f;
  flex-shrink: 0;
}

.wb-ctx-slot-pending::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c9a25f;
  flex-shrink: 0;
}

/* ── Footer ──────────────────────────────────────────────────────────────────
   Deliberately the same shape as the library column's footer: same padding,
   same divider, same button metrics, so both columns terminate identically. */
.wb-ctx-footer {
  display: flex;
  gap: 8px;
  padding: 10px 14px 14px;
  border-top: 1px solid #1c1c1c;
  flex-shrink: 0;
}

.wb-ctx-sync-btn {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 0;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.wb-ctx-sync-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Nothing owed. Dimmed rather than hidden so the column's footer doesn't
   appear and disappear as slots change. */
.wb-ctx-sync-btn:disabled {
  color: #6f6f6f;
  border-color: rgba(255, 255, 255, 0.12);
  cursor: default;
}

/* Connected with work owed — the one moment this is the thing to do. Solid,
   matching the editor's Save, since it's the same kind of commit. */
.wb-ctx-sync-btn--cta {
  background: #fff;
  border-color: #fff;
  color: #111;
}

.wb-ctx-sync-btn--cta:hover:not(:disabled) {
  background: #e6e6e6;
  border-color: #e6e6e6;
}

/* Pending, but no device to send to. Sits at the same height as the button it
   replaces so the column's base line doesn't shift when MIDI connects. */
.wb-ctx-footer--note {
  align-items: center;
}

.wb-ctx-sync-note {
  margin: 0;
  padding: 6px 2px;
  flex: 1;
  font-size: 11px;
  line-height: 1.45;
  color: #8f8f8f;
  text-align: center;
}

.wb-ctx-sync-stop {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #8f8f8f;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.wb-ctx-sync-stop:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.32);
  color: var(--text);
}

.wb-ctx-sync-btn:focus-visible,
.wb-ctx-sync-stop:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.65);
  outline-offset: 2px;
}

/* ── Slot actions modal ── */
.wb-modal-dialog--slot {
  max-width: 360px;
}

.wb-slot-modal-status {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #8f8f8f;
}

.wb-slot-modal-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}

.wb-slot-modal-stack .wb-ctx-btn {
  padding: 10px 12px;
}

.wb-slot-modal-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.wb-slot-modal-content .wb-ctx-picker {
  margin-top: 14px;
  max-height: none;
  overflow: visible;
}

.wb-ctx-picker {
  margin-top: 10px;
  max-height: 280px;
  overflow-y: auto;
}

.wb-ctx-picker-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7a7a7a;
  margin: 8px 0 6px;
}

.wb-ctx-picker-label:first-child {
  margin-top: 0;
}

.wb-ctx-picker-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wb-ctx-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #161616;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.wb-ctx-picker-item:hover {
  border-color: #8fb3a4;
  background: rgba(143, 179, 164, 0.08);
}

.wb-ctx-picker-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wb-ctx-picker-item-name {
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wb-ctx-picker-item-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #8f8f8f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wb-ctx-picker-fav,
.wb-fav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #8fb3a4;
  flex-shrink: 0;
}

.wb-ctx-picker-empty {
  font-size: 11px;
  color: #7a7a7a;
  margin: 0;
}

.wb-ctx-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wb-ctx-history-entry {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.wb-ctx-history-entry:hover {
  border-color: #404040;
}

.wb-ctx-history-entry--preview {
  border-color: #8fb3a4;
  background: rgba(143, 179, 164, 0.08);
}

.wb-ctx-history-entry-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wb-ctx-history-time {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}

.wb-ctx-history-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7a7a7a;
}

.wb-ctx-history-detail {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.wb-ctx-history-action {
  margin-top: 10px;
  background: #1e1e1e;
  border: 1px solid #8fb3a4;
  border-radius: 10px;
  padding: 10px 12px;
}

.wb-ctx-history-action-title {
  font-size: 12px;
  color: var(--text);
}

.wb-ctx-history-action-status {
  font-size: 11px;
  color: #8f8f8f;
  margin-top: 2px;
}

.wb-ctx-history-action-buttons {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.wb-ctx-btn {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 7px 10px;
  border-radius: 7px;
  cursor: pointer;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.wb-ctx-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.wb-ctx-btn--block {
  width: 100%;
  text-align: center;
  padding: 9px 10px;
}

.wb-ctx-btn--primary {
  flex: 1;
  background: var(--text);
  border-color: var(--text);
  color: #0a0a0a;
}

.wb-ctx-btn--primary:hover:not(:disabled) {
  background: #e8e8e8;
  border-color: #e8e8e8;
}

.wb-ctx-btn--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--text);
}

.wb-ctx-btn--ghost:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.45);
}

.wb-ctx-btn--danger {
  background: transparent;
  border-color: rgba(224, 128, 128, 0.45);
  color: #e08080;
}

.wb-ctx-btn--danger:hover:not(:disabled) {
  background: rgba(224, 128, 128, 0.1);
  border-color: rgba(224, 128, 128, 0.7);
}

.wb-ctx-btn:not(.wb-ctx-btn--primary):not(.wb-ctx-btn--ghost):not(.wb-ctx-btn--danger):hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}

.wb-ctx-empty {
  font-size: 11px;
  color: #7a7a7a;
  padding: 8px 0;
}
