.control-bar {
  --control: clamp(1.9rem, 0.9rem + 2.2vw, 2.4rem);
  --face: #d3d3da;

  align-items: center;
  background: linear-gradient(#3b3b42, #2f2f36);
  border: 1px solid var(--rule);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  box-shadow: var(--lip);
  display: grid;
  gap: clamp(0.5rem, 1.5vw, 1rem);
  grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
  margin: 0 -1px;
  overflow: hidden;
  padding: clamp(0.4rem, 1vw, 0.5rem) clamp(0.6rem, 2vw, 1rem);
}

.control-slider {
  background: #14141a;
  border-radius: 999px;
  cursor: grab;
  height: 1.4rem;
  justify-self: end;
  max-width: 100%;
  position: relative;
  touch-action: none;
  width: 8rem;
}

.control-slider:active {
  cursor: grabbing;
}

/* The knob stays inside the rail at either end */
.control-slider::after {
  background: #d3d3da;
  border-radius: 50%;
  content: "";
  height: 1.05rem;
  left: clamp(0.525rem, var(--fader, 70%), 100% - 0.525rem);
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 1.05rem;
}

.lcd {
  align-items: center;
  background: #101016;
  border-radius: 6px;
  display: flex;
  height: clamp(2.4rem, 1.2rem + 2.6vw, 3rem);
  padding: 0 0.5rem;
}

.lcd-chevron {
  border-bottom: 2px solid var(--muted);
  border-right: 2px solid var(--muted);
  height: 0.4rem;
  margin: 0 0.15rem 0 0.1rem;
  transform: rotate(45deg) translateY(-0.15rem);
  width: 0.4rem;
}

.lcd-dim {
  color: #43434e;
}

.lcd-divided {
  border-left: 1px solid #303038;
}

.lcd-field {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: clamp(2.1rem, 1.1rem + 2.2vw, 2.6rem);
  padding: 0 clamp(0.25rem, 0.7vw, 0.35rem);
}

.lcd-label {
  color: var(--muted);
  font-size: 0.5rem;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
}

/* Wraps the chevron so the invisible select has something to cover, full LCD height */
.lcd-menu {
  align-items: center;
  align-self: stretch;
  cursor: pointer;
  display: flex;
  padding: 0 0.35rem;
  position: relative;
}

.lcd-picker {
  cursor: pointer;
  inset: 0;
  opacity: 0;
  position: absolute;
  width: 100%;
}

.lcd-menu:focus-within .lcd-chevron {
  border-color: var(--ink);
}

.lcd-value {
  color: #f2f2f5;
  font-family: var(--mono);
  font-size: clamp(1rem, 0.5rem + 1.1vw, 1.25rem);
  line-height: 1.1;
}

.transport {
  align-items: center;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid #262a30;
  border-radius: 6px;
  display: flex;
  gap: clamp(0.35rem, 1.1vw, 0.65rem);
  height: var(--control);
  justify-self: start;
  padding: 0 clamp(0.4rem, 1vw, 0.6rem);
}

.transport-button {
  border-radius: 4px;
  cursor: pointer;
  height: var(--control);
  position: relative;
  width: clamp(1.2rem, 0.6rem + 1.3vw, 1.5rem);
}

/* A well sunk into the panel: dark at the top lip, a thin catch of light at the bottom */
.transport-button:active {
  background: rgba(0, 0, 0, 0.5);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.85),
    inset 0 -1px 0 rgba(255, 255, 255, 0.07);
}

/* Every glyph centers on the button, so the press well always sits square around it */
.transport-button::before,
.transport-button::after {
  content: "";
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* Two triangles for the winders, one for play, a block for stop */
.transport-button.rewind::before,
.transport-button.rewind::after,
.transport-button.forward::before,
.transport-button.forward::after {
  border-bottom: 0.4rem solid transparent;
  border-top: 0.4rem solid transparent;
}

.transport-button.rewind::before,
.transport-button.rewind::after {
  border-right: 0.4rem solid var(--face);
}

/* The pair straddles the center, nudged toward the tips so it reads centered */
.transport-button.rewind::before {
  margin-left: -0.285rem;
}

.transport-button.rewind::after {
  margin-left: 0.165rem;
}

.transport-button.forward::before,
.transport-button.forward::after {
  border-left: 0.4rem solid var(--face);
}

.transport-button.forward::before {
  margin-left: -0.165rem;
}

.transport-button.forward::after {
  margin-left: 0.285rem;
}

.transport-button.stop::before {
  background: var(--face);
  border-radius: 1px;
  height: 0.7rem;
  width: 0.7rem;
}

.transport-button.play::before {
  border-bottom: 0.4rem solid transparent;
  border-left: 0.7rem solid var(--face);
  border-top: 0.4rem solid transparent;
  margin-left: 0.08rem;
}

.transport-button.record::before {
  background: #e0322f;
  border-radius: 50%;
  height: 0.85rem;
  width: 0.85rem;
}

/* A negative delay drops it in near the end of the lit half, so the first blink lands right away */
.transport-button.record.is-armed::before {
  animation: record-blink 1.4s steps(1) infinite;
  animation-delay: -0.55s;
  box-shadow: 0 0 0.4rem #e0322f;
}

@keyframes record-blink {
  50% {
    background: #4a1b1a;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .transport-button.record.is-armed::before {
    animation: none;
  }
}

/* Padding sinks the glyph to 1.15rem while the button keeps the shared footprint */
.transport-button.cycle {
  box-sizing: border-box;
  padding: 0.625rem 0.175rem;
}

.transport-button.cycle.is-on {
  background: rgba(224, 178, 47, 0.25);
  box-shadow: inset 0 0 0 1px rgba(224, 178, 47, 0.6);
}

@media (max-width: 60rem) {
  .control-slider {
    visibility: hidden;
  }
}

