/* Create › Studio (js/studiodrawer.js): the input and its levels, Record, and the takes. Nick's side.
   On Moon, like the other player drawers: v2.css's --moon-* tokens, raised cards (--b-raised), the dark key
   (--b-key). No drop shadows. The record light is red: the one colour here that isn't music, because everyone
   reads it as "recording". Restyled when Peter's side's references (N29) arrive. */

.std {
  display: grid;
  gap: 22px;
  color: var(--moon-ink);
}

.std-sec {
  min-width: 0;
}

/* Parts the script hides (the "Use a microphone" key once the input is open, the input's own rows before) stay
   hidden whatever their display. */
.std [hidden] {
  display: none !important;
}

.std-h {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
}

.std-note {
  color: var(--moon-mtext);
  font-size: 12.5px;
  line-height: 1.45;
}

.std-fine {
  margin: 10px 0 0;
}

/* ---------- the input ---------- */

.std-key,
.std-rec {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px 0 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--moon-key-hi), var(--moon-key-lo));
  box-shadow: var(--b-key);
  color: var(--moon-key-ink);
  font-size: 14px;
  font-weight: 500;
  transition: scale var(--t) ease;
}

.std-key .ic {
  width: 18px;
  height: 18px;
}

.std-key:active,
.std-rec:active,
.std-act:active {
  scale: .98;
}

.std-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.std-label {
  flex: none;
  color: var(--moon-mtext);
  font-size: 13px;
}

.std-select,
.std-name {
  min-width: 0;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--moon-line);
  border-radius: 10px;
  background: var(--moon-raised);
  color: var(--moon-ink);
  font: inherit;
  font-size: 14px;
}

.std-pick .std-select {
  flex: 1;
}

.std-chans {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* One channel: its name, what it is, then its level across the row. */
.std-chan {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px 8px;
  padding: 10px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--moon-raised), var(--moon-raised-lo));
  box-shadow: var(--b-raised);
}

.std-meter {
  position: relative;
  grid-column: 1 / -1;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--moon-body-lo);
  box-shadow: inset 0 1px 2px rgba(23, 22, 20, .12);
}

.std-fill {
  position: absolute;
  inset: 0 14px 0 0;
  transform: scaleX(0);
  transform-origin: left;
  border-radius: inherit;
  background: var(--moon-ink);
  transition: transform 60ms linear;
}

/* The clip light: lit for a moment when a channel reaches the top. */
.std-clip {
  position: absolute;
  top: 1px;
  right: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--moon-line);
}

.std-chan.is-clip .std-clip {
  background: #D93A2B;
}


/* ---------- record ---------- */

.std-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.std-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #D93A2B;
}

.std-rec[aria-pressed="true"] .std-dot {
  border-radius: 2px;
}

.std-clock {
  min-width: 3.5em;
  font-family: var(--mono, "Geist Mono", ui-monospace, monospace);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.std-status {
  flex: 1 1 220px;
  min-width: 0;
  margin: 0;
  color: var(--moon-mtext);
  font-size: 13px;
  line-height: 1.4;
}

@media (prefers-reduced-motion: no-preference) {
  #dr-studio.is-recording .std-dot {
    animation: std-blink 1.2s ease-in-out infinite;
  }
}

@keyframes std-blink {
  50% {
    opacity: .35;
  }
}

/* ---------- takes ---------- */

.std-takes {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.std-empty {
  color: var(--moon-mtext);
  font-size: 13px;
}

.std-take {
  display: grid;
  gap: 8px;
  padding: 11px 12px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--moon-raised), var(--moon-raised-lo));
  box-shadow: var(--b-raised);
}

.std-take-h {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.std-take-name {
  font-size: 14px;
  font-weight: 500;
}

.std-take-line {
  overflow-wrap: anywhere;
  color: var(--moon-mtext);
  font-size: 12.5px;
}

.std-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.std-act {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--moon-line);
  border-radius: 10px;
  background: var(--moon-raised);
  color: var(--moon-ink);
  font-size: 13px;
  white-space: nowrap;
}

.std-act .ic {
  width: 14px;
  height: 14px;
}

.std-play[aria-pressed="true"] {
  border-color: transparent;
  background: linear-gradient(180deg, var(--moon-key-hi), var(--moon-key-lo));
  color: var(--moon-key-ink);
}

.std-star {
  min-width: 40px;
  justify-content: center;
  font-size: 16px;
}

/* The Alive star: an outline until the take is kept, then filled gold. */
.std-star-ic {
  display: block;
}

.std-star-ic path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
}

.std-star[aria-pressed="true"] .std-star-ic path {
  fill: var(--gold, #F6AD3B);
  stroke: none;
}

.std-del[data-sure="1"] {
  border-color: #D93A2B;
  color: #B32A1E;
}

/* ---------- this device, inputs by device, the band, a take's tracks (2026-11-09) ---------- */

.std-here {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.std-here-me {
  font-weight: 500;
}

/* An input's source: its device, its channel (when the device has several), and remove. */
.std-src {
  display: flex;
  grid-column: 1 / -1;
  gap: 6px;
  min-width: 0;
}

.std-src .std-dev {
  flex: 1 1 auto;
}

.std-src .std-chan-ch {
  flex: 0 1 auto;
}

.std-rm {
  flex: none;
  justify-content: center;
  min-width: 40px;
  font-size: 18px;
}

.std-add {
  margin-top: 8px;
}


.std-tracks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* A track, heard (dark key) or left out (open). */
.std-trk {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--moon-line);
  border-radius: 999px;
  background: var(--moon-raised);
  color: var(--moon-mtext);
  font-size: 12.5px;
  text-decoration: line-through;
}

.std-trk[aria-pressed="true"] {
  border-color: transparent;
  background: linear-gradient(180deg, var(--moon-key-hi), var(--moon-key-lo));
  color: var(--moon-key-ink);
  text-decoration: none;
}

/* ---------- short labels, the rest behind an "i" (Nick, 2026-11-09) ---------- */

.std-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.std-row .std-h {
  margin: 0;
}

.std-input > .std-row,
.std-sec > .std-row {
  margin-bottom: 10px;
}

/* An "i": a small round button; its words appear under its row. */
.std-i {
  display: grid;
  flex: none;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--moon-line);
  border-radius: 50%;
  background: var(--moon-raised);
  color: var(--moon-mtext);
  font-family: Georgia, serif;
  font-size: 13px;
  font-style: italic;
  font-weight: 600;
}

.std-i[aria-expanded="true"] {
  border-color: transparent;
  background: var(--moon-ink);
  color: var(--moon-body);
}

.std-info {
  margin: 6px 0 4px;
  color: var(--moon-mtext);
  font-size: 13px;
  line-height: 1.45;
}

.std-info[hidden] {
  display: none;
}

/* A Moon slide switch: its name, then the track with on or off printed in it (as v2.css's part switches). */
.std-sw {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0;
  color: var(--moon-ink);
  font-size: 14px;
}

.std-sw span {
  min-width: 7.5em;
  text-align: left;
}

.std-sw::after {
  content: "off";
  content: "off" / "";
  flex: none;
  width: 58px;
  height: 26px;
  padding: 0 8px;
  border-radius: 13px;
  background: var(--moon-trk-off);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .6), 0 1px 0 var(--moon-bevel-hi);
  color: var(--moon-trk-off-ink);
  font-size: 10px;
  font-weight: 600;
  line-height: 26px;
  text-align: right;
}

.std-sw::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 35px;
  z-index: 1;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  border-radius: 50%;
  background: var(--moon-thumb);
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .5), 0 2px 4px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .6);
  transition: translate 200ms var(--ease-out);
}

.std-sw[aria-pressed="true"]::after {
  content: "on";
  content: "on" / "";
  padding-left: 9px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--moon-lit) 74%, #000), var(--moon-lit));
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .35), 0 1px 0 var(--moon-bevel-hi);
  color: var(--moon-lit-ink, #15130F);
  text-align: left;
}

.std-sw[aria-pressed="true"]::before {
  translate: 32px 0;
}

.std-band {
  display: grid;
  gap: 2px;
  margin-bottom: 12px;
}

.std-opt + .std-opt {
  margin-top: 2px;
}

.std-hear {
  display: block;
  margin-top: 10px;
}

/* A take's name: tap it to rename. */
.std-take-name {
  width: 100%;
  min-height: 34px;
  margin: -4px 0 0 -6px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--moon-ink);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
}

.std-take-name:hover {
  border-color: var(--moon-line);
}

.std-take-name:focus {
  border-color: var(--moon-raised-edge);
  background: var(--moon-raised);
  outline: none;
}

.std-export {
  display: flex;
  flex-basis: 100%;
  flex-wrap: wrap;
  gap: 6px;
}

.std-export[hidden] {
  display: none;
}

.std-exp[aria-expanded="true"] {
  border-color: var(--moon-raised-edge);
  background: var(--moon-body-lo);
}

/* A take's levels: a row a track, how loud it is and (your inputs) where it sits from left to right. */
.std-lv[aria-expanded="true"] {
  border-color: var(--moon-raised-edge);
  background: var(--moon-body-lo);
}

.std-levels {
  display: grid;
  flex-basis: 100%;
  gap: 4px;
  padding-top: 2px;
}

.std-lvl {
  display: grid;
  gap: 0;
  padding: 6px 0 2px;
  border-top: 1px solid var(--moon-line);
}

.std-lvl-name {
  font-size: 13px;
  font-weight: 500;
}

.std-lvl-f {
  display: grid;
  grid-template-columns: 6.5em minmax(0, 1fr) 5.5em;
  align-items: center;
  gap: 10px;
}

.std-lvl-what {
  color: var(--moon-mtext);
  font-size: 12.5px;
}

/* ---------- Studio's rows that open, at the end: Timeline, Mixer and Export (js/studiorow.js) ---------- */

.stm-list {
  border-bottom: 1px solid var(--moon-line);
}

.stm-item {
  border-top: 1px solid var(--moon-line);
  transition: opacity 220ms var(--ease-out);
}

.stm-h {
  margin: 0;
  font: inherit;
}

.stm-open {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 50px;
  padding: 0 0 0 2px;
  border-radius: 10px;
  color: var(--moon-ink);
  text-align: left;
}

.stm-name {
  flex: none;
  font-size: 15px;
  font-weight: 500;
}

.stm-sum {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--moon-mtext);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stm-open .pm {
  color: var(--moon-mtext);
}

.stm-open[aria-expanded="true"] .pm-v {
  opacity: 0;
}

.stm-open:focus-visible {
  outline-offset: 0;
}

.stm-chev {
  display: none;
  width: 16px;
  height: 16px;
  color: var(--moon-mtext);
}

.stm-slot[hidden] {
  display: none;
}

@media (hover: hover) {
  .stm-open:hover {
    background-color: color-mix(in srgb, var(--moon-ink) 4%, transparent);
  }
}

@media (max-width: 639px) {
  .stm-open .pm {
    display: none;
  }

  .stm-chev {
    display: block;
  }
}

/* ---------- Mixer: the band's players (js/studiomixer.js) ---------- */

.stm-layer {
  display: grid;
  gap: 10px;
  padding: 2px 0 14px 2px;
  color: var(--moon-ink);
}

.stm-layer [hidden] {
  display: none !important;
}

.stm-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.stm-status {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--moon-mtext);
  font-size: 13px;
  line-height: 1.4;
}

.stm-layer .std-info {
  margin: 0;
}

.stm-rows {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* One player: its switch and Alone, then its level across the row. */
.stm-row {
  display: grid;
  gap: 2px;
  padding: 6px 12px 4px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--moon-raised), var(--moon-raised-lo));
  box-shadow: var(--b-raised);
}

.stm-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.stm-on span {
  min-width: 4.5em;
  font-weight: 500;
}

.stm-alone[aria-pressed="true"] {
  border-color: transparent;
  background: linear-gradient(180deg, var(--moon-key-hi), var(--moon-key-lo));
  color: var(--moon-key-ink);
}

.stm-lvl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  align-items: center;
  gap: 12px;
}

.stm-row.is-off .stm-lvl {
  opacity: .5;
}

.stm-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stm-reset:disabled {
  opacity: .45;
}

/* ---------- Export: the song as files (js/studioexport.js) ---------- */

.sxp-line {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.sxp-opts {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sxp-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sxp-key {
  min-width: 13.5em;
  min-height: 44px;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
}

.sxp-key:disabled {
  opacity: .45;
}

.sxp-opt .std-info {
  margin: 6px 0 2px;
}

.sxp-note {
  margin: 0;
  color: var(--moon-mtext);
  font-size: 12.5px;
  line-height: 1.45;
}

/* ---------- Timeline: the parts across, a row a player, a block where they play (js/studiotimeline.js) ---------- */

.stl-wrap {
  display: flex;
  gap: 10px;
  min-width: 0;
}

/* The header's row, then a row a player: the names and the blocks share these, so they line up. */
.stl-names,
.stl-grid {
  display: grid;
  grid-template-rows: 38px repeat(4, 40px);
  gap: 6px;
}

.stl-names {
  flex: none;
}

.stl-scroll {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 6px;
  overscroll-behavior-x: contain;
}

.stl-who {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
}

.stl-who.is-off {
  color: var(--moon-mtext);
}

.stl-off {
  font-size: 11px;
  font-weight: 600;
}

.stl-part {
  display: grid;
  align-content: end;
  gap: 1px;
  min-width: 0;
  padding: 0 4px 4px;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  line-height: 1.25;
}

.stl-pname {
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stl-plen {
  color: var(--moon-mtext);
  font-size: 11.5px;
}

/* The part you're on. */
.stl-part[aria-current="true"] {
  border-bottom-color: var(--moon-ink);
}

/* A block: dark where the player plays, open where they sit the part out. */
.stl-cell {
  min-width: 0;
  border: 1px solid var(--moon-raised-edge);
  border-radius: 9px;
  background: transparent;
  transition: scale var(--t) ease;
}

.stl-cell[aria-pressed="true"] {
  border-color: transparent;
  background: linear-gradient(180deg, var(--moon-key-hi), var(--moon-key-lo));
  box-shadow: var(--b-key);
}

.stl-cell:active {
  scale: .97;
}

.stl-cell:disabled {
  border-style: dashed;
  opacity: .6;
}

.stl-cell:focus-visible {
  outline: 2px solid var(--moon-ink);
  outline-offset: 2px;
}

.stl-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
