.detail-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex: none;
  height: 100%;
}
.detail-tabs button {
  height: 100%;
  border: 0;
  border-radius: 0;
  padding: 0 9px;
  border-bottom: 2px solid transparent;
  color: var(--skin-muted,#b5b8c0);
  background: transparent;
}
.detail-tabs button[aria-selected="true"] {
  border-color: var(--pink);
  background: var(--skin-tab,#41434c);
  color: var(--skin-fg,#faf2f8);
}
.detail-tabs button svg { width: 14px; height: 14px; }
.clip-head { padding-left: 1px; }
#device-target { display: flex; align-items: center; gap: 6px; min-width: 0; }
#device-owner { width: auto; max-width: 40vw; height: 23px; font-size: 12px; }
#device-panel {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(254px, 1fr);
  grid-template-rows: 25px minmax(78px, 1fr) auto;
  gap: 0 4px;
  align-items: stretch;
  padding: 3px 4px;
  background: var(--skin-workspace,#27292e);
}
.device-card {
  --device-accent: var(--knob-highlight);
  grid-row: 1 / 4;
  display: grid;
  grid-template-rows: subgrid;
  background: var(--skin-surface,#36383f);
  border: 1px solid var(--skin-border,#51545d);
  border-radius: 4px;
  overflow: hidden;
  min-width: 0;
}
.device-card header {
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  background: var(--skin-raised,#42454d);
  border-bottom: 1px solid var(--skin-border,#24262d);
}
.device-card h3 { font-size: 12px; font-weight: 620; }
.device-power {
  padding: 1px;
  width: 18px;
  height: 19px;
  min-height: 18px;
  border: none;
  background: transparent;
}
.device-power i {
  background: #646872;
  border: 2px solid #222429;
  border-radius: 50%;
  width: 13px;
  height: 13px;
}
.device-power[aria-pressed="true"] i { background: var(--device-accent); }
.eq-mode { margin-left: auto; font: 11px var(--mono); height: 20px; }
.eq-display, .reduction-display, .return-effect-display {
  position: relative;
  min-height: 0;
  margin: 4px 6px 2px;
  background: #25272c;
  border: 1px solid #202125;
  border-radius: 2px;
}
.eq-display canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.reduction-display { display: flex; flex-direction: column; justify-content: center; padding: 2px 6px; gap: 2px; }
.reduction-display > div:first-child, .reduction-scale { display: flex; justify-content: space-between; align-items: center; }
.reduction-display > div:first-child { color: #c7c9d0; font-size: 10px; }
.reduction-display output { font: 10px var(--mono); color: #eccc88; }
.reduction-rail { position: relative; height: 6px; background: #16181c; }
.reduction-rail i { position: absolute; inset: 0 auto 0 0; width: 0%; background: #e7b961; }
.reduction-rail::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(to right, transparent 0 calc(4.1667% - 1px), #25272c 0 4.1667%);
}
.reduction-scale { font: 9px var(--mono); color: #9ca0aa; }
.device-knobs { display: flex; align-items: flex-start; padding: 2px 6px 4px; gap: 4px; }
.device-param { display: flex; flex: 1; min-width: 0; flex-direction: column; align-items: center; gap: 2px; }
.knob-label { color: var(--skin-fg,#e3e3e6); font-size: 11px; white-space: nowrap; }
.device-dial { --dial-size: clamp(26px, 3.1vh, 32px); touch-action: none; cursor: ns-resize; }
.knob-value {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 79px;
  background: var(--skin-field,#23252a);
  border: 1px solid var(--skin-border,#1c1e21);
  border-radius: 2px;
  padding: 0 3px;
  font: 10px var(--mono);
}
.knob-value input {
  width: 5ch; max-width: 75%; border: 0; color: var(--skin-fg,#eee); background: transparent;
  height: 18px; padding: 0; text-align: center; font: inherit;
}
.knob-value span, .device-param small { color: var(--skin-muted,#adb0b9); font: 9px var(--mono); }
.band-kill { min-height: 18px; font-size: 10px; padding: 0 7px; }
.band-kill[aria-pressed="true"] { color: #261e12; background: #e6bb69; border-color: #e6bb69; }
.wave-selection-tools {
  display: flex; align-items: center; gap: 4px; padding: 2px 5px; min-height: 23px;
  background: var(--skin-surface,#303239); border-bottom: 1px solid var(--skin-border,#222429);
}
.wave-selection-tools span { flex: 1; font: 10px var(--mono); color: var(--skin-muted,#b6b9c2); }
.wave-selection-tools button { min-height: 18px; font-size: 10px; padding: 0 5px; }
.cart-row { grid-template-columns: 17px 21px minmax(0,1fr) auto 22px; }
.cart-row .cart-preview {
  width: 21px; min-height: 21px; height: 21px; background: var(--skin-surface,#282a30); border: 1px solid var(--skin-border,#51545e);
}
.cart-preview svg { width: 11px; height: 11px; }
.cart-row .cart-preview[aria-pressed="true"] { background: #394c41; color: #a4eebd; border-color: #729e81; }
.cart-preview[data-phase="queued"], .cart-preview[data-phase="loading"] { animation: blink .6s infinite alternate; }
.wave-tools { min-height: 26px; height: auto; flex-wrap: wrap; }
@media(max-width: 790px) {
  main.show-devices .editor { min-height: 0; }
  #device-panel { flex: none; }
  .wave-tools { padding-block: 3px; gap: 3px; }
  .zoom-controls { flex-wrap: wrap; }
  .detail-tabs button { font-size: 11px; padding: 0 5px; }
}
@media(max-width: 510px) {
  .zoom-controls { margin-left: 0; }
  .wave-selection-tools { flex-wrap: wrap; }
  #clip-title { min-width: 0; }
}

@media (min-width:791px) {
  main.show-devices { grid-template-rows: minmax(0,1fr) var(--device-height, auto); }
}

.parametric-card .eq-band-title { margin-left:auto; color:var(--skin-muted,#c5c8d0); font:10px var(--mono); }
.eq-points { position:absolute; inset:0; pointer-events:none; }
.eq-point {
  position:absolute; transform:translate(-50%,-50%); pointer-events:auto; touch-action:none; cursor:move;
  width:16px; height:16px; min-height:0; padding:0; border-radius:50%;
  color:#e9ddd0; background:#414049; border:1px solid #ae9990; font:9px var(--mono);
}
.eq-point[aria-pressed="true"] { z-index:1; }
.eq-point[aria-pressed="true"], .eq-bands button[aria-pressed="true"] { background:#edb2cc; color:#211c20; border-color:#edb2cc; }
.eq-point[data-on="false"], .eq-bands button[data-on="false"] { border-style:dashed; }
.eq-bands { display:flex; gap:3px; margin:2px 6px 4px; }
.eq-bands button { flex:1; min-width:0; min-height:18px; padding:0; font:10px var(--mono); }
.filter-controls { display:grid; align-content:start; gap:2px; width:80px; flex:none; }
.filter-controls :is(select,button) { width:100%; min-height:16px; height:18px; padding:0 2px; font-size:10px; }
.filter-controls [data-band-power][aria-pressed="true"] { color:#f2c2d7; background:#493943; }
.parametric-card .device-knobs { min-height:62px; }
