:root {
  --stage-light: #2c343a;
  --stage-mid: #1b2126;
  --stage-deep: #0e1215;
  --brass: #e6c48f;
  --text: #cfd3d2;
  --text-quiet: #7f8a8e;
  --engraved: rgba(240, 226, 204, 0.46);
  --face: Futura, 'Jost', 'Century Gothic', 'Avenir Next', sans-serif;
  --footer: 72px;
  --panel: 0px;
  --side: 0px;
  --below: 0px;
  --reserve: calc(2 * var(--footer));
  --line: rgba(255, 255, 255, 0.07);
  /* Uzun ekranda alt panel büyür: solo ve yapı sekmeleri sıkışmasın. */
  --dock: clamp(310px, 38vh, 420px);
}

.rhythm-open {
  --below: var(--dock);
  --reserve: calc(var(--below) + 76px);
}

.rhythm-open .stage {
  padding-bottom: calc(var(--below) + 60px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: radial-gradient(circle at 42% 34%, var(--stage-light), var(--stage-mid) 48%, var(--stage-deep) 100%);
  background-color: var(--stage-deep);
  color: var(--text);
  font-family: var(--face);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0 var(--panel) var(--below) var(--side);
  transition: padding 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.pan {
  position: relative;
  width: min(100vw - var(--panel) - var(--side) - 16px, 100vh - var(--reserve));
  width: min(100vw - var(--panel) - var(--side) - 16px, 100dvh - var(--reserve));
  aspect-ratio: 1;
  container-type: inline-size;
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 1.4s ease, transform 1.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.ready .pan {
  opacity: 1;
  transform: none;
}

#surface,
#solo-surface {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* Düet (üye): solda ritim panı, sağda solo panı. Dikey ekranda (telefon) alt alta. */
.duet {
  --gap: clamp(14px, 3vw, 56px);
}

.duet .stage {
  grid-auto-flow: column;
  gap: var(--gap);
  place-content: center;
}

.duet .pan {
  width: min((100vw - var(--panel) - var(--side) - 16px - var(--gap)) / 2, 100vh - var(--reserve));
  width: min((100vw - var(--panel) - var(--side) - 16px - var(--gap)) / 2, 100dvh - var(--reserve));
}

.duet .pan::before {
  content: attr(data-role);
  /* karenin köşesi dairenin dışında kalır; etiket oraya, üstteki düğmelere değmeden */
  position: absolute;
  left: 2%;
  bottom: 3%;
  color: var(--text-quiet);
  font: 400 12px / 1 var(--face);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  pointer-events: none;
}

@media (max-aspect-ratio: 1/1) {
  .duet .stage {
    grid-auto-flow: row;
  }

  .duet .pan {
    width: min(100vw - var(--panel) - var(--side) - 16px, (100vh - var(--reserve) - var(--gap) - 24px) / 2);
    width: min(100vw - var(--panel) - var(--side) - 16px, (100dvh - var(--reserve) - var(--gap) - 24px) / 2);
  }
}

/* Etiketler görsel ve klavye içindir; dokunuşlar alttaki yüzeye gider. Yazı alanın tam ortasında
   (sol pandakiler düğme, solo pandakiler yazı; ikisi de aynı biçimde ortalanır). */
.note {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 6.5cqw;
  height: 6.5cqw;
  margin: -3.25cqw 0 0 -3.25cqw;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--engraved);
  font: 500 max(10px, 1.55cqw) / 1 var(--face);
  letter-spacing: 0.03em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.note:focus-visible {
  outline: 1.5px solid var(--brass);
  outline-offset: 2px;
  color: var(--brass);
}

.scales {
  position: fixed;
  left: 0;
  right: var(--panel);
  bottom: calc(var(--below) + max(14px, env(safe-area-inset-bottom)));
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 0 16px;
  transition: right 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.midi {
  position: fixed;
  left: 16px;
  bottom: calc(var(--below) + max(14px, env(safe-area-inset-bottom)));
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scales button,
.midi {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 22px;
  background: none;
  color: var(--text-quiet);
  font: 400 15px / 1 var(--face);
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s ease;
}

.scales button:hover,
.midi:hover {
  color: var(--text);
}

.scales button[aria-pressed='true'],
.midi[aria-pressed='true'] {
  color: var(--brass);
}

.scales button:focus-visible,
.midi:focus-visible {
  outline: 1.5px solid var(--brass);
  outline-offset: -4px;
}

.top-actions {
  position: fixed;
  z-index: 2;
  top: max(8px, env(safe-area-inset-top));
  right: 12px;
  display: flex;
  gap: 2px;
}

.rhythm-toggle {
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 22px;
  background: none;
  color: var(--text-quiet);
  font: 400 15px / 1 var(--face);
  cursor: pointer;
}

.rhythm-toggle:hover {
  color: var(--text);
}

.rhythm {
  position: fixed;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--dock);
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 360px;
  align-items: start;
  gap: 28px;
  padding: 14px 20px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-top: 1px solid var(--line);
  background: var(--stage-deep);
  transform: translateY(100%);
  visibility: hidden;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0.35s;
}

.rhythm-open .rhythm {
  transform: none;
  visibility: visible;
}

.dock-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.rhythm button,
.rhythm input,
.rhythm select {
  font-family: var(--face);
  color: var(--text);
}

.rhythm button {
  cursor: pointer;
}

.rhythm input[type='text'],
.rhythm input[type='number'] {
  user-select: text;
  -webkit-user-select: text;
}

.rhythm :focus-visible,
.rhythm-toggle:focus-visible {
  outline: 1.5px solid var(--brass);
  outline-offset: 1px;
}

.rhythm-row,
.field-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.field-row {
  align-items: flex-end;
}

.field-row.spread {
  flex-wrap: wrap;
  justify-content: space-between;
}

.rhythm-row {
  justify-content: space-between;
}

.rhythm-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.play {
  min-width: 84px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--brass);
  border-radius: 22px;
  background: none;
  font-size: 16px;
}

.rhythm .play {
  color: var(--brass);
}

.rhythm .play[aria-pressed='true'] {
  background: var(--brass);
  color: var(--stage-deep);
}

.tempo {
  display: flex;
  align-items: center;
}

.step-button {
  width: 32px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 20px;
}

.bpm {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 11px;
  color: var(--text-quiet);
}

.bpm input {
  width: 56px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 24px;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}

.bpm input::-webkit-inner-spin-button,
.bpm input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.quiet {
  min-height: 44px;
  padding: 0 6px;
  border: 0;
  background: none;
  font-size: 15px;
}

.rhythm .quiet {
  color: var(--text-quiet);
}

.rhythm .quiet:hover {
  color: var(--text);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  font-size: 13px;
  color: var(--text-quiet);
}

.field.grow {
  flex: 1;
}

.field input[type='text'],
.field select {
  min-height: 40px;
  width: 100%;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 15px;
}

.field select option {
  background: var(--stage-mid);
}

.field input[aria-invalid='true'] {
  border-color: #d98a7a;
}

.meter {
  min-width: 56px;
  padding-bottom: 4px;
  color: var(--brass);
  font-size: 26px;
  line-height: 36px;
}

.hint {
  margin: 0;
  color: #e0a597;
  font-size: 13px;
  line-height: 1.4;
}

.chain {
  width: 130px;
}

.slots {
  display: flex;
  gap: 2px;
  min-height: 40px;
}

.slots button {
  min-width: 38px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  font-size: 16px;
}

.rhythm .slots button {
  color: var(--text-quiet);
}

.rhythm .slots button[aria-pressed='true'] {
  background: rgba(255, 255, 255, 0.07);
  color: var(--brass);
}

.slots button.sounding {
  box-shadow: inset 0 -2px 0 var(--brass);
}

.slots button.queued {
  box-shadow: inset 0 -2px 0 var(--text-quiet);
  animation: queued 0.5s steps(2) infinite alternate;
}

@keyframes queued {
  to {
    box-shadow: inset 0 -2px 0 transparent;
  }
}

.grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
  touch-action: none;
}

.track {
  display: flex;
  align-items: stretch;
  height: 26px;
}

.track-name {
  flex: none;
  width: 44px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 13px;
  text-align: left;
}

.track-name[aria-pressed='true'] {
  opacity: 0.4;
  text-decoration: line-through;
}

.cell {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
}

.cell.group-start {
  margin-left: 5px;
  border-left: 1px solid var(--line);
}

.cell::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(8px, 70%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
}

.cell[data-value='1']::before {
  background: #a97c4d;
  width: min(11px, 90%);
}

.cell[data-value='2']::before {
  background: var(--brass);
  width: min(14px, 100%);
  box-shadow: 0 0 8px rgba(230, 196, 143, 0.5);
}

.cell.now {
  background: rgba(230, 196, 143, 0.13);
}

.generate {
  flex: none;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--brass);
  border-radius: 20px;
  background: none;
  font-size: 14px;
}

.rhythm .generate {
  color: var(--brass);
}

.rhythm .generate:hover {
  background: rgba(230, 196, 143, 0.12);
}

.generator .quiet {
  flex: none;
  min-height: 40px;
  font-size: 14px;
}

.sliders {
  flex-direction: row;
  align-items: flex-end;
  gap: 14px;
}

.sliders input[type='range'] {
  width: 100%;
  height: 28px;
  margin: 0;
  accent-color: var(--brass);
}

.songs {
  width: min(460px, 100vw - 24px);
  max-height: min(680px, 100dvh - 24px);
  padding: 18px 20px 20px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--stage-mid);
  color: var(--text);
  font-family: var(--face);
}

.songs::backdrop {
  background: rgba(8, 10, 12, 0.6);
}

.songs button,
.songs input,
.songs select {
  font-family: var(--face);
  color: var(--text);
}

.songs button {
  cursor: pointer;
}

.songs button:disabled {
  opacity: 0.45;
  cursor: progress;
}

.songs input[type='text'] {
  user-select: text;
  -webkit-user-select: text;
}

.songs :focus-visible {
  outline: 1.5px solid var(--brass);
  outline-offset: 1px;
}

.songs .generate {
  color: var(--brass);
}

.songs .generate:hover {
  background: rgba(230, 196, 143, 0.12);
}

.songs .quiet {
  color: var(--text-quiet);
}

.songs .quiet:hover {
  color: var(--text);
}

.songs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.songs h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
}

.songs h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.songs-section {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.songs-section .field {
  flex: 1;
}

.songs .field input,
.songs .field select {
  min-height: 40px;
  width: 100%;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 15px;
}

.song-list {
  display: flex;
  flex-direction: column;
  max-height: 200px;
  margin: 14px 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.song-list li {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
  border-top: 1px solid var(--line);
}

.song-list li.songs-note {
  padding: 10px 0;
}

.song-list li > div {
  flex: 1;
  min-width: 0;
}

.song-list strong,
.song-list span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-list strong {
  font-size: 15px;
  font-weight: 500;
}

.song-list span {
  color: var(--text-quiet);
  font-size: 13px;
}

.songs-export {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.songs-note {
  margin: 0;
  color: var(--text-quiet);
  font-size: 14px;
  line-height: 1.4;
}

.songs-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.songs-status {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--brass);
  font-size: 14px;
  line-height: 1.4;
}

.songs-status .quiet {
  min-height: 32px;
  text-decoration: underline;
}

.notice {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
  line-height: 1.5;
}

.notice[hidden] {
  display: none;
}

/* Dar ekranda akortlarla çakışmasın diye gizli; MIDI masaüstü ve geniş ekran işi. */
@media (max-width: 760px) {
  .midi {
    display: none;
  }
}

/* Üç sütun sığmayınca alt bölüm tek sütuna iner ve kayar; ızgara önce gelir. */
@media (max-width: 899px), (max-height: 600px) {
  :root {
    --dock: min(58dvh, 470px);
  }

  .rhythm {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 16px 16px max(16px, env(safe-area-inset-bottom));
  }

  .dock-side {
    display: contents;
  }

  .rhythm-row,
  .rhythm-block,
  .generator,
  .grid {
    flex: none;
  }

  .rhythm-row {
    order: 0;
  }

  .grid,
  .generator {
    order: 1;
  }

  .rhythm-block {
    order: 2;
  }

  .track {
    height: 30px;
  }
}

@media (max-width: 420px) {
  .scales button {
    padding: 0 9px;
    font-size: 14px;
  }
}

/* Yatay telefon: altta yer kalmadığı için ritim bölümü yana geçer, akortlar sola. */
@media (max-height: 600px) and (min-width: 600px) {
  :root {
    --footer: 6px;
    --side: 84px;
  }

  .rhythm-open {
    --below: 0px;
    --panel: 360px;
    --reserve: 12px;
  }

  .rhythm-open .stage {
    padding-bottom: 0;
  }

  .rhythm {
    top: 0;
    left: auto;
    width: 360px;
    height: auto;
    border-top: 0;
    border-left: 1px solid var(--line);
    transform: translateX(100%);
  }

  .scales {
    left: max(4px, env(safe-area-inset-left));
    right: auto;
    bottom: 50%;
    transform: translateY(50%);
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
  }

  .scales button {
    padding: 0 6px;
    font-size: 14px;
  }

  .midi {
    display: none;
  }

  .rhythm {
    gap: 14px;
    padding-top: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pan {
    transform: none;
    transition: opacity 0.3s linear;
  }

  .stage,
  .scales,
  .rhythm {
    transition: none;
  }

  .slots button.queued {
    animation: none;
  }
}

/* Misafir: üyelere açık düğmeler bulanık ve tıklanamaz; sol üstte üyelik çağrısı. */
.locked {
  filter: blur(1.5px);
  opacity: 0.45;
  pointer-events: none;
  user-select: none;
}

.join {
  position: fixed;
  z-index: 2;
  top: max(8px, env(safe-area-inset-top));
  left: 12px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--brass) 55%, transparent);
  border-radius: 22px;
  background: none;
  color: var(--brass);
  font: 400 14px / 1 var(--face);
  cursor: pointer;
}

.join:hover {
  background: color-mix(in srgb, var(--brass) 12%, transparent);
}

.join:focus-visible {
  outline: 1.5px solid var(--brass);
  outline-offset: 2px;
}

.join[hidden] {
  display: none;
}

/* Runix sesi açamadığında: ilk dokunuşu ister */
.runix-hint {
  position: fixed;
  z-index: 3;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 12px 18px;
  border: 1px solid color-mix(in srgb, var(--brass) 55%, transparent);
  border-radius: 22px;
  background: color-mix(in srgb, #1b2126 88%, transparent);
  color: var(--brass);
  font: 400 15px / 1.3 var(--face);
  text-align: center;
  pointer-events: none;
  animation: runix-pulse 1.6s ease-in-out infinite;
}

.runix-hint[hidden] {
  display: none;
}

@keyframes runix-pulse {
  50% { opacity: 0.6; }
}


/* Telefon ve dar ekran: ritim motoru dikey kaydırılır (ızgarada yana sürükleme boyar),
   Çal / BPM / Tap satırı motorun altında sabit. */
@media (max-width: 899px), (max-height: 600px) {
  .grid {
    touch-action: pan-y;
  }

  .rhythm .rhythm-row {
    order: 9;
    position: sticky;
    bottom: calc(-1 * max(16px, env(safe-area-inset-bottom)));
    z-index: 1;
    margin: 0 -16px calc(-1 * max(16px, env(safe-area-inset-bottom)));
    padding: 8px 16px max(10px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--stage-deep);
  }
}

/* Telefon: Şarkılar sol üstte, Ritim Motoru sağ üstte; pan üst düğmelerin altında kalır. */
@media (max-width: 760px) {
  .top-actions {
    left: 12px;
    justify-content: space-between;
  }

  .rhythm-open {
    --reserve: calc(var(--below) + 76px + 52px);
  }

  .rhythm-open .stage {
    padding-top: 52px;
  }

  /* Misafirde sol üst Şarkılar'ın; üyelik çağrısı akortların üstüne iner. */
  .join {
    top: auto;
    left: 50%;
    bottom: calc(var(--below) + max(14px, env(safe-area-inset-bottom)) + 52px);
    max-width: calc(100vw - 32px);
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 13px;
  }
}

/* Alt panel sekmeleri: Ritim | Solo. Solo sekmesinde ritim ayarları gizlenir, Çal/BPM satırı kalır. */
.dock-tabs {
  grid-column: 1 / -1;
  display: flex;
  gap: 4px;
  margin: -6px 0 -12px;
}

.rhythm .dock-tabs button {
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 16px;
  background: none;
  color: var(--text-quiet);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.rhythm .dock-tabs button[aria-selected='true'] {
  color: var(--brass);
  background: color-mix(in srgb, var(--brass) 12%, transparent);
}

.rhythm:is([data-tab='solo'], [data-tab='form']) :is(.grid, .rhythm-block, .generator),
.rhythm:is([data-tab='solo'], [data-tab='form']) .solo-view ~ .dock-side {
  display: none;
}

.solo-view,
.form-view {
  --solo: #9cc8cf;
  grid-column: 2 / -1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.solo-view[hidden],
.form-view[hidden] {
  display: none;
}

.solo-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.solo-info {
  flex: 1;
  margin: 0;
  color: var(--text-quiet);
  font-size: 13px;
}

.solo-head .quiet[aria-pressed='true'] {
  color: var(--brass);
}

.solo-scroll {
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
  scrollbar-width: thin;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  padding-bottom: 6px;
}

.solo-grid {
  display: flex;
  width: max-content;
}

.solo-labels {
  position: sticky;
  left: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding-right: 6px;
  background: var(--stage-deep);
}

.solo-labels span {
  width: 44px;
  height: 20px;
  color: var(--text-quiet);
  font-size: 12px;
  line-height: 20px;
}

.solo-labels .solo-rhythm-label,
.solo-rhythm {
  height: 16px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
}

.solo-labels .solo-rhythm-label {
  font-size: 11px;
  line-height: 18px;
}

.solo-col {
  display: flex;
  flex-direction: column;
  width: 16px;
}

.solo-col.group-start {
  box-shadow: inset 1px 0 0 var(--line);
}

.solo-col.bar-start {
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.2);
}

.solo-col.now {
  background: rgba(156, 200, 207, 0.14);
}

.solo-cell {
  position: relative;
  height: 20px;
  padding: 0;
  border: 0;
  background: none;
}

.solo-cell::before,
.solo-rhythm::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  transform: translate(-50%, -50%);
}

.solo-cell[data-value='1']::before {
  width: 10px;
  background: color-mix(in srgb, var(--solo) 70%, #1b2126);
}

.solo-cell[data-value='2']::before {
  width: 12px;
  background: var(--solo);
  box-shadow: 0 0 8px color-mix(in srgb, var(--solo) 55%, transparent);
}

.solo-rhythm {
  position: relative;
  display: block;
}

.solo-rhythm[data-value='0']::before {
  background: none;
}

.solo-rhythm[data-value='1']::before {
  width: 8px;
  background: color-mix(in srgb, var(--brass) 80%, transparent);
}

@media (max-width: 899px), (max-height: 600px) {
  .dock-tabs {
    order: -1;
    margin: 0;
  }

  .solo-view,
  .form-view {
    order: 1;
  }

  .solo-col {
    width: 20px;
  }
}

/* Solo zaman çizgisinin üstünde bölüm şeridi */
.solo-labels .solo-section-label {
  height: 16px;
  margin-bottom: 4px;
  font-size: 11px;
  line-height: 16px;
}

.solo-section {
  position: relative;
  height: 16px;
  margin-bottom: 4px;
  background: color-mix(in srgb, var(--section, transparent) 30%, transparent);
  border-top: 2px solid var(--section, transparent);
  color: var(--text);
  font-size: 10px;
  line-height: 14px;
  white-space: nowrap;
  overflow: visible;
}

.solo-section.start {
  padding-left: 3px;
  z-index: 1;
}

/* Yapı sekmesi: bölüm blokları */
.form-head,
.form-edit {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.form-info {
  flex: 1 1 140px;
  margin: 0;
  align-self: center;
  color: var(--text-quiet);
  font-size: 13px;
}

.form-strip {
  display: flex;
  gap: 4px;
  min-height: 52px;
  overflow-x: auto;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
  scrollbar-width: thin;
  padding-bottom: 4px;
}

.rhythm .form-chip {
  flex: 1 0 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 48px;
  padding: 4px 8px;
  border: 1px solid color-mix(in srgb, var(--section) 55%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--section) 18%, transparent);
  text-align: left;
}

.rhythm .form-chip[aria-selected='true'] {
  border-color: var(--section);
  box-shadow: 0 0 0 1px var(--section);
}

.rhythm .form-chip.now {
  background: color-mix(in srgb, var(--section) 38%, transparent);
}

.form-chip-name {
  font-size: 13px;
}

.form-chip-meta {
  color: var(--text-quiet);
  font-size: 11px;
}

.rhythm .form-add {
  flex: none;
  align-self: stretch;
  min-width: 96px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: none;
  color: var(--text-quiet);
}

.rhythm .form-edit input {
  width: 72px;
  flex: none;
}

.form-edit .field {
  flex: none;
}

/* ——— Tersinir yapı: Geri al / Yinele ve geri dönüş noktaları ——— */
.dock-tabs {
  position: relative;
  align-items: center;
}

.dock-history {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.rhythm .dock-history .quiet {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.rhythm .dock-history .quiet:disabled {
  opacity: 0.35;
  cursor: default;
}

.points-pop {
  position: absolute;
  z-index: 5;
  top: calc(100% + 6px);
  right: 0;
  width: min(420px, calc(100vw - 32px));
  max-height: 60vh;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #151a1e;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.points-pop[hidden] {
  display: none;
}

.points-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.points-head p {
  flex: 1;
  margin: 0;
  color: var(--text-quiet);
  font-size: 12px;
  line-height: 1.4;
}

.points-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.points-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.points-list li span {
  flex: 1;
  min-width: 0;
}

.points-list li.auto span {
  color: var(--text-quiet);
}

.points-list li time {
  color: var(--text-quiet);
  font-size: 11px;
}

.points-list li.empty {
  color: var(--text-quiet);
}

/* Elle yazılan kalıp: üretici ve Runix dokunmaz */
.rhythm .slots button.handmade {
  box-shadow: inset 0 -2px 0 var(--brass);
}

/* ——— Solo ve Yapı sekmeleri alanı doldursun ——— */
.rhythm:is([data-tab='solo'], [data-tab='form']) {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  align-items: stretch;
}

.rhythm:is([data-tab='solo'], [data-tab='form']) .solo-view,
.rhythm:is([data-tab='solo'], [data-tab='form']) .form-view {
  grid-column: 2;
  min-height: 0;
}

.solo-view .solo-scroll {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

.solo-view .solo-grid {
  flex: 1 0 auto;
  min-width: 100%;
  align-items: stretch;
}

.solo-view .solo-col {
  flex: 1 0 16px;
}

.solo-view .solo-labels span:not(.solo-section-label):not(.solo-rhythm-label),
.solo-view .solo-cell {
  flex: 1 1 0;
  min-height: 16px;
  height: auto;
  max-height: 34px;
}

.solo-view .solo-labels {
  justify-content: flex-start;
}

.solo-view .solo-labels span {
  display: flex;
  align-items: center;
  line-height: 1;
}

@media (max-width: 899px), (max-height: 600px) {
  .solo-view .solo-scroll {
    height: clamp(240px, 42vh, 380px);
  }

  .dock-history .quiet {
    padding: 0 6px;
  }
}

/* ——— Yapı sekmesi: çift kanal (üstte ritim, altta solo), sütunlar bölümler ——— */
.form-strip.form-lanes {
  display: grid;
  grid-template-rows: minmax(48px, auto) minmax(44px, 1fr);
  gap: 4px;
  align-items: stretch;
}

.lane-label {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  color: var(--text-quiet);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lane-label.solo {
  grid-row: 2;
}

.rhythm .form-lanes .form-chip {
  flex: none;
  min-width: 0;
}

.rhythm .form-solo {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  min-height: 44px;
  padding: 4px 6px;
  border: 1px solid color-mix(in srgb, var(--clip, #9cc8cf) 45%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--clip, #9cc8cf) 12%, transparent);
  color: var(--clip, #9cc8cf);
  text-align: left;
}

.rhythm .form-solo.empty {
  align-items: center;
  justify-content: center;
  border-style: dashed;
  border-color: var(--line);
  background: none;
  color: var(--text-quiet);
}

.rhythm .form-solo[aria-selected='true'] {
  box-shadow: 0 0 0 1px var(--clip, var(--text-quiet));
}

.rhythm .form-solo.now {
  background: color-mix(in srgb, var(--clip, #9cc8cf) 28%, transparent);
}

.form-solo-name {
  font-size: 11px;
}

.form-solo svg {
  flex: 1;
  width: 100%;
  min-height: 18px;
  fill: currentColor;
}

.rhythm .form-lanes .form-add {
  min-width: 0;
}

.form-edit-gap {
  width: 1px;
  align-self: stretch;
  margin: 0 4px;
  background: var(--line);
}

/* Yapı sekmesinde çift kanal alanı doldursun */
.rhythm[data-tab='form'] .form-view .form-strip {
  flex: 1 1 auto;
  min-height: 0;
}

/* ——— Kim çalıyor: Ben / Birlikte / Runix ——— */
.mode-switch {
  display: flex;
  align-items: center;
  margin-right: 6px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 22px;
}

.mode-switch[hidden] {
  display: none;
}

.mode-switch button {
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 18px;
  background: none;
  color: var(--text-quiet);
  font: 400 14px / 1 var(--face);
  cursor: pointer;
}

.mode-switch button:hover {
  color: var(--text);
}

.mode-switch button[aria-checked='true'] {
  color: var(--brass);
  background: color-mix(in srgb, var(--brass) 14%, transparent);
}

/* Yalnız Runix: panel ve panlar izlenir; sekmeler ve Set denetimleri açık kalır. */
.mode-runix .rhythm :is(.grid, .solo-view, .form-view, .mix-view, .dock-side, .dock-history),
.mode-runix :is(.pan canvas, #notes, .scales, .solo-scale) {
  pointer-events: none;
}

.mode-runix .rhythm :is(.grid, .solo-view, .form-view, .mix-view, .dock-side) {
  opacity: 0.7;
}

.runix-toast {
  top: auto;
  bottom: calc(var(--below) + 76px);
  transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 32px));
  font-size: 14px;
  animation: none;
}

/* ——— Solo akordu (hibrit) ——— */
.duet .scales::before {
  content: 'Ritim';
  align-self: center;
  margin-right: 6px;
  color: var(--text-quiet);
  font: 400 11px / 1 var(--face);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* karenin sağ alt köşesi dairenin dışında kalır; rol etiketi sol altta (yazı yalnız ekran okuyucuya) */
.solo-scale {
  position: absolute;
  right: 1%;
  bottom: 2%;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-quiet);
  font: 400 11px / 1 var(--face);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.solo-scale select,
.mix-view select {
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--stage-mid);
  color: var(--text);
  font: 400 13px / 1 var(--face);
  letter-spacing: 0;
  text-transform: none;
}

.solo-scale span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.solo-clash {
  position: absolute;
  right: 1%;
  bottom: calc(2% + 38px);
  max-width: 34%;
  margin: 0;
  color: var(--brass);
  font: 400 12px / 1.2 var(--face);
  text-align: right;
  pointer-events: none;
}

.solo-clash[hidden] {
  display: none;
}

/* ——— Miks ve Set sekmeleri alanı doldursun ——— */
.mix-view,
.set-view,
.battle-view {
  grid-column: 2 / -1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mix-view[hidden],
.set-view[hidden],
.battle-view[hidden] {
  display: none;
}

.rhythm:is([data-tab='mix'], [data-tab='set'], [data-tab='battle']) :is(.grid, .rhythm-block, .generator),
.rhythm:is([data-tab='mix'], [data-tab='set'], [data-tab='battle']) .set-view ~ .dock-side {
  display: none;
}

.rhythm:is([data-tab='mix'], [data-tab='set'], [data-tab='battle']) {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  align-items: stretch;
}

.rhythm:is([data-tab='mix'], [data-tab='set'], [data-tab='battle']) :is(.mix-view, .set-view, .battle-view) {
  grid-column: 2;
  min-height: 0;
  overflow-y: auto;
}

.mix-head .slots {
  gap: 4px;
}

.mix-head .slots button {
  height: 34px;
  padding: 0 12px;
  font-size: 14px;
  white-space: nowrap;
}

.mix-head,
.set-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.mix-stage {
  width: 100%;
  height: 64px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(224, 163, 94, 0.06), transparent 50%, rgba(127, 200, 214, 0.06));
  color: var(--text-quiet);
}

.mix-strips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.mix-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px 14px;
  margin: 0;
  padding: 8px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.mix-strip legend {
  padding: 0 6px;
  font: 400 12px / 1 var(--face);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mix-strip--rhythm legend {
  color: #e0a35e;
}

.mix-strip--solo legend {
  color: #7fc8d6;
}

.mix-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.mix-field span {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  color: var(--text-quiet);
}

.mix-field output {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.mix-field[hidden] {
  display: none;
}

.mix-check {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-quiet);
  font-size: 13px;
}

.mix-hint {
  grid-column: 1 / -1;
  margin: 0;
}

.set-info {
  flex: 1;
  margin: 0;
  color: var(--text-quiet);
  font-size: 13px;
}

.set-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: segment;
}

.set-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  counter-increment: segment;
}

.set-list li::before {
  content: counter(segment);
  color: var(--text-quiet);
  font-size: 12px;
}

.set-list li strong {
  font-weight: 500;
}

.set-list li span {
  color: var(--text-quiet);
  font-size: 13px;
}

.set-list li.now {
  border-color: color-mix(in srgb, var(--brass) 60%, transparent);
  background: color-mix(in srgb, var(--brass) 8%, transparent);
}

.set-list li.now strong {
  color: var(--brass);
}

.set-list li.done {
  opacity: 0.5;
}

@media (max-width: 899px), (max-height: 600px) {
  .mix-strips {
    grid-template-columns: minmax(0, 1fr);
  }

  .mode-switch button {
    padding: 0 9px;
    font-size: 13px;
  }
}

/* Solo panın etiketleri yalnız görseldir: dokunuş alttaki solo yüzeyine geçsin. */
#solo-notes .note {
  pointer-events: none;
  cursor: default;
}

/* ——— Atışma: sıra kimdeyse o pan parlar, öbürü bir adım geri çekilir ——— */
body[data-turn] .pan {
  transition: opacity 0.35s ease, filter 0.35s ease, transform 0.35s ease;
}

body[data-turn='1'] .stage > .pan:first-child,
body[data-turn='2'] .pan--solo,
body[data-turn='both'] .pan {
  filter: drop-shadow(0 0 22px color-mix(in srgb, var(--brass) 38%, transparent));
}

body[data-turn='1'] .pan--solo,
body[data-turn='2'] .stage > .pan:first-child {
  opacity: 0.55;
  transform: scale(0.97);
}

/* Eşlikte öbür pan susmaz: geri çekilir ama sönmez. */
body[data-turn-kind='comp'][data-turn='1'] .pan--solo,
body[data-turn-kind='comp'][data-turn='2'] .stage > .pan:first-child {
  opacity: 0.82;
}

body[data-turn] .duet .pan::before,
body[data-turn].duet .pan::before {
  color: var(--brass);
}

.set-list li[data-player='2'] {
  margin-left: 24px;
}

/* Set / atışma listesi uzayınca durdurma düğmesi görünür kalsın. */
.set-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding-bottom: 6px;
  background: var(--stage-deep);
}

/* Atışmada anahtar değişimi */
.set-list li.key-change {
  border-color: color-mix(in srgb, #7fc8d6 55%, transparent);
}

/* ——— Atışma sekmesi ——— */
.battle-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 6px;
  background: var(--stage-deep);
}

.battle-presets {
  flex-wrap: wrap;
  gap: 4px;
}

.battle-presets button {
  height: 34px;
  padding: 0 12px;
  font-size: 14px;
  white-space: nowrap;
}

.battle-actions {
  display: flex;
  gap: 6px;
}

.battle-story,
.battle-live {
  margin: 0;
}

.battle-live {
  color: var(--brass);
}

.battle-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.battle-players {
  display: grid;
  gap: 10px;
}

.battle-box {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px 12px;
  margin: 0;
  padding: 8px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.battle-box legend {
  padding: 0 6px;
  color: var(--text-quiet);
  font: 400 12px / 1 var(--face);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.battle-player[data-player='0'] legend {
  color: #e0a35e;
}

.battle-player[data-player='1'] legend {
  color: #7fc8d6;
}

.battle-box .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text-quiet);
}

.battle-box :is(input[type='text'], input[type='number'], select) {
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--stage-mid);
  color: var(--text);
  font: 400 14px / 1 var(--face);
}

.battle-notes {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.battle-notes-label {
  color: var(--text-quiet);
  font-size: 13px;
}

.battle-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.battle-chip {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: none;
  color: var(--text-quiet);
  font: 400 13px / 1 var(--face);
  cursor: pointer;
}

.battle-chip[aria-pressed='true'] {
  border-color: color-mix(in srgb, var(--brass) 60%, transparent);
  background: color-mix(in srgb, var(--brass) 12%, transparent);
  color: var(--brass);
}

@media (max-width: 1100px) {
  .battle-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Runix canlı DJ satırı ve kaynağına göre set bölümleri */
.set-live {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  font-size: 13px;
}

.set-live[hidden] {
  display: none;
}

.set-live .set-live-every {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  color: var(--text-quiet);
}

.set-live select {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--stage-mid);
  color: var(--text);
}

.set-list li.auto strong {
  font-style: italic;
}

.set-list li.runix {
  border-color: color-mix(in srgb, #7fc8d6 45%, transparent);
}

/* Dar ekranda sekmeler alt satıra sarar (kaydırma, içinden açılan geri dönüş noktaları penceresini kesiyordu). */
@media (max-width: 899px) {
  .dock-tabs {
    flex-wrap: wrap;
    row-gap: 2px;
  }

  .rhythm .dock-tabs button[data-tab] {
    padding: 0 10px;
    font-size: 13px;
  }
}

/* Ses yükü göstergesi */
.audio-health {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.audio-health.warn {
  color: #e0a35e;
}

.mix-buffer {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-quiet);
  font-size: 13px;
}

/* Tanı kaydı */
.diag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
}

.diag-result {
  margin: 0;
}

.diag-link {
  color: var(--brass);
}

.diag-row select {
  min-height: 30px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--stage-mid);
  color: var(--text);
}

/* ——— DJ performans geçmişi (performance-panel.js) ——— */
.perf-view {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.perf-head h3 {
  margin: 0 0 2px;
  font: 400 12px / 1 var(--face);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
}

.perf-head .hint {
  margin: 4px 0 0;
}

.perf-now {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--brass) 55%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--brass) 7%, transparent);
  font-size: 13px;
}

.perf-now strong {
  font-weight: 500;
  color: var(--brass);
}

.perf-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.perf-item {
  border: 1px solid var(--line);
  border-radius: 10px;
}

.perf-item > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 12px;
  padding: 8px 12px;
  cursor: pointer;
  list-style: none;
}

.perf-item > summary::-webkit-details-marker {
  display: none;
}

.perf-item[open] > summary {
  border-bottom: 1px solid var(--line);
}

.perf-title {
  font-size: 14px;
}

.perf-live {
  margin-left: 6px;
  font-style: normal;
  font-size: 12px;
  color: var(--brass);
}

.perf-meta {
  color: var(--text-quiet);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.perf-segs {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 4px 0;
  list-style: none;
}

.perf-seg {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px;
}

.perf-seg + .perf-seg {
  border-top: 1px solid var(--line);
}

.perf-seg-index {
  width: 1.6em;
  color: var(--text-quiet);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.perf-seg-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.perf-seg-title {
  font-size: 13px;
}

.perf-seg-meta {
  color: var(--text-quiet);
  font-size: 12px;
}

.perf-stars {
  display: inline-flex;
  flex: none;
}

.perf-star {
  padding: 2px;
  border: 0;
  background: none;
  color: var(--text-quiet);
  font-size: 16px;
  line-height: 1;
  opacity: 0.45;
  cursor: pointer;
}

.perf-star--on {
  color: var(--brass);
  opacity: 1;
}

.perf-star:hover,
.perf-star:focus-visible {
  opacity: 1;
}

.perf-actions {
  display: flex;
  gap: 8px;
  padding: 6px 12px 10px;
}

/* İngilizce arayüz (?lang=en): CSS'teki etiketler */
html[lang='en'] .duet .scales::before {
  content: 'Rhythm';
}

/* Yedi akort (klasik + modern): dar ekranda akort satırı taşmasın; yatayda kaydırılır, ortalama yalnız sığarsa.
   Orta genişlikte MIDI düğmesi akort satırının üstüne çıkar (soldan çakışıyordu). */
.scales {
  overflow-x: auto;
  justify-content: safe center;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.scales::-webkit-scrollbar {
  display: none;
}

@media (max-width: 1100px) {
  .scales button {
    padding: 0 10px;
    font-size: 14px;
  }

}

/* Orta genişlikte MIDI düğmesi akort satırının solunda kalır, akortlar ona yer açar; dar ekranda bir sıra yukarı
   çıkar (yukarıda her genişlikte panın etiketine biniyordu). */
@media (min-width: 720px) and (max-width: 1100px) {
  .scales {
    padding-left: 130px;
    justify-content: flex-start;
  }
}

@media (max-width: 719px) {
  .midi {
    bottom: calc(var(--below) + max(14px, env(safe-area-inset-bottom)) + 46px);
  }
}

.perf-kind {
  margin-right: 4px;
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-quiet);
  font-size: 11px;
  letter-spacing: 0.04em;
  vertical-align: 1px;
}

/* Ses konsepti A / B (Miks sekmesi) */
.sound-concept {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sound-concept-label {
  color: var(--text-quiet);
  font-size: 13px;
  white-space: nowrap;
}

.sound-concept .slots button {
  min-width: 34px;
}

.chain-free {
  align-self: flex-end;
  white-space: nowrap;
}

.chain-free[hidden] {
  display: none;
}

/* Solo üretici (Solo sekmesi) */
.solo-make {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.solo-make select {
  max-width: 150px;
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 14px;
}

.solo-make select option {
  background: var(--stage-mid);
}

.solo-make select[hidden] {
  display: none;
}
