/* The Rack's plugin chain: the panels and their faces, the generic face,
   the Fruity Balance stand-in, the pads and the mode bar. Split out of
   css/rack.css along its own section banners. */
/* ---------- Plugin chain ---------- */

/* The chain is one long row, so it scrolls rather than squeezing its panels.
   The drop area keeps its minimum width whatever is in front of it, which is
   what makes the row outgrow the panel and the overview worth having. */
.rack-chain {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.rack-plugin-face {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 8px 10px 10px;
  overflow: hidden;
}

.rack-plugin-face[data-ui="pads"] {
  padding: 6px;
}

/* A face taken from the plugin's own art: the panel is the image, so the frame
   gets out of the way and the panel is drawn at the size it was cropped at —
   256px tall, and as wide as that makes it — rather than being scaled to the
   strip. The cell is sized to give it that height; when the window is too short
   the chain scrolls rather than shrinking the art. */
.rack-plugin-face.is-art {
  display: block;
  flex: 0 0 auto;
  align-self: center;
  padding: 0;
  background: none;
  border-radius: 0;
}

.rack-plugin-art {
  display: block;
  width: auto;
  height: 256px;
}

/* The way into the browser's page for this plugin. It sits where the plugin's
   own header has its far corner free, and stays out of sight until the panel is
   hovered so the face is still the plugin's picture. */
.rack-plugin-face {
  position: relative;
}

.rack-face-magnify {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: rgba(20, 20, 20, 0.72);
  border: none;
  border-radius: 50%;
  color: #e8e8e8;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s, background 0.12s;
}

.rack-face-magnify .material-symbols-outlined {
  font-size: 16px;
}

.rack-plugin-face:hover .rack-face-magnify {
  opacity: 1;
}

.rack-face-magnify:hover {
  background: #000000;
}

/* A panel is dragged by picking it up; on the drawn faces the title bar is the
   obvious handle, and on the art ones the whole panel is. */
.rack-plugin-head,
.rack-plugin-face.is-art {
  cursor: grab;
}

/* Carried. It keeps its place in the flow, so the panels it passes move out of
   the way as it goes, and it stops taking pointer events so nothing under it is
   what the drop is measured against. */
.rack-plugin-face.is-dragging {
  z-index: 5;
  pointer-events: none;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.62);
}

.rack-plugin-face.is-dragging,
.rack-plugin-face.is-dragging .rack-plugin-head {
  cursor: grabbing;
}

body.is-moving-plugin,
body.is-moving-plugin * {
  cursor: grabbing !important;
}

/* ---------- The plugin chain's generic face ---------- */

.rack-plugin-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 6px;
}

.rack-plugin-strip {
  flex: 1;
  min-height: 24px;
  border-radius: 8px;
  background: #1f1f1f;
}

.rack-plugin-knobs {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 8px;
  flex-shrink: 0;
}

/* ---------- Fruity Balance ---------- */

.rack-plugin-head {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.rack-plugin-mark {
  font-size: 15px;
  color: #c8c8c8;
}

.rack-plugin-caret {
  font-size: 16px;
  color: #a0a0a0;
}

.rack-plugin-name {
  flex: 1;
  min-width: 0;
  font-family: var(--font-condensed);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #f0f0f0;
  white-space: nowrap;
  overflow: hidden;
}

.rack-plugin-knob {
  position: relative;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #6e6e6e, #454545 74%);
  flex-shrink: 0;
}

.rack-plugin-knob::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 50%;
  width: 1.5px;
  height: 6px;
  border-radius: 1px;
  background: #f1f1f1;
  transform: translateX(-50%);
}

/* The meter well: a pair of tick columns with the level scale printed between
   them. It takes whatever height the panel has left, which is what gives the
   editor its proportions. */
.rack-meter {
  position: relative;
  flex: 1 1 auto;
  min-height: 46px;
  margin-top: 6px;
  border-radius: 10px;
  background: linear-gradient(180deg, #262626, #1e1e1e);
  overflow: hidden;
}

.rack-meter-ticks {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 50%;
  width: 78px;
  transform: translateX(-50%);
  background-image:
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.16) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.16) 0 2px, transparent 2px 9px);
  background-repeat: no-repeat;
  background-size: 13px 100%;
  background-position: 0 0, 100% 0;
}

.rack-meter-scale {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.rack-meter-scale em {
  font-family: var(--font-ui);
  font-size: 9px;
  font-style: normal;
  line-height: 1;
  color: #a8a8a8;
}

.rack-meter-scale em.is-zero {
  color: #f0f0f0;
  font-weight: 700;
}

/* Centred rather than bottom-aligned: the main knob is the tallest cell, so
   centring it is what pushes its caption below the other two — and what lets it
   ride up over the well. */
.rack-plugin-ctrl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 6px;
  margin-top: -14px;
  flex-shrink: 0;
}

.rack-plugin-meter-cell,
.rack-plugin-knob-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.rack-select {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 20px;
  padding: 0 6px;
  background: var(--sh-inset);
  border: none;
  border-radius: 999px;
  color: #4aa3ff;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.rack-select .material-symbols-outlined {
  font-size: 14px;
  color: #8a8a8a;
}

.rack-plugin-cap {
  font-family: var(--font-condensed);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: #d0d0d0;
}

.rack-bigknob {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #2a2a2a;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.rack-bigknob::before {
  content: '';
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-right-color: #d8d8d8;
  border-top-color: #d8d8d8;
  transform: rotate(24deg);
}

.rack-bigknob i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 2px;
  border-radius: 2px;
  background: #f2f2f2;
  transform: translate(-50%, -50%);
}

.rack-smallknob {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #5c5c5c, #3a3a3a 74%);
  flex-shrink: 0;
}

.rack-smallknob::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 50%;
  width: 2px;
  height: 8px;
  border-radius: 1px;
  background: #f1f1f1;
  transform: translateX(-50%);
}

/* ---------- Pads ---------- */

.rack-pads {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
  gap: 5px;
}

.rack-pad {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  border-radius: 9px;
  background: #404040;
  cursor: pointer;
}

.rack-pad:hover {
  background: #4a4a4a;
}

.rack-pad-key {
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  color: #d8d8d8;
}

.rack-pad-label {
  max-width: 100%;
  padding: 0 3px;
  font-family: var(--font-condensed);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #9a9a9a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rack-pad.is-empty .rack-pad-key {
  color: #b0b0b0;
}

/* The empty effect slots are a drop target, so they are outlined rather than
   filled — the only dashed shape in the rack. */
.rack-slots {
  flex: 1 1 auto;
  min-width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #5a5a5a;
  border-radius: var(--sh-radius);
  font-family: var(--font-text);
  font-size: 12px;
  color: #9a9a9a;
  white-space: nowrap;
  overflow: hidden;
}

.rack-slots b {
  color: #d8d8d8;
  font-weight: 600;
}

.rack-slots.is-over {
  border-color: #00a59f;
  background: rgba(0, 165, 159, 0.08);
}

/* ---------- Mode bar ---------- */
/* The bar is part of the editor's own surface, not a strip laid over it: the
   rack paints the page tone, so the bar takes it too and only the chip and the
   glyphs stand out. */

.rack-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--rack-bar);
  padding: 0 8px;
  background: none;
  flex-shrink: 0;
}

.rack-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  height: calc(var(--rack-bar) - 8px);
  padding: 0 12px 0 4px;
  background: #111111;
  border-radius: 999px;
  flex-shrink: 0;
}

.rack-modes {
  display: flex;
  align-items: center;
  gap: 4px;
}

.rack-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 50%;
  color: #8a8a8a;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.1s, color 0.1s;
}

.rack-tab .material-symbols-outlined {
  font-size: 16px;
}

.rack-tab:hover {
  color: #ffffff;
}

/* The mode you are in carries a filled disc; the other stays a bare glyph. */
.rack-tab.is-on {
  background: #343434;
  color: #ffffff;
}

.rack-sel {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 4px 0 6px;
  background: none;
  border: none;
  font-family: var(--font-text);
  font-size: 12px;
  color: #d0d0d0;
  white-space: nowrap;
  cursor: pointer;
}

.rack-sel:hover {
  color: #ffffff;
}

/* The ring is the track's colour, which is the one thing in the bar that says
   which track the editor above belongs to. */
.rack-sel-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--c);
  color: #e8e8e8;
  font-size: 11px;
  font-weight: 600;
}

.rack-spacer {
  flex: 1;
}

