/* UTM V2 player writing/review tools */
.app-shell{padding-bottom:138px}

.global-player{
  height:126px;
  grid-template-columns:minmax(190px,260px) auto minmax(360px,1fr);
  gap:22px;
  padding:12px 24px;
}

.player-track{min-width:0}
.player-track>div:last-child{min-width:0}
.player-track strong,.player-track span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:190px}

.player-controls{align-self:center}

.player-workspace{
  min-width:0;
  display:grid;
  grid-template-rows:auto auto;
  gap:8px;
}

.waveform-row{
  display:grid;
  grid-template-columns:38px minmax(0,1fr) 38px;
  gap:9px;
  align-items:center;
}
.waveform-time{
  font-size:8px;
  color:#6a7685;
  font-variant-numeric:tabular-nums;
}
.waveform-time:last-child{text-align:right}

.waveform-shell{
  position:relative;
  height:54px;
  border:1px solid rgba(255,255,255,.07);
  border-radius:11px;
  background:rgba(255,255,255,.018);
  overflow:visible;
}

.waveform{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  padding:7px 6px;
  display:flex;
  align-items:center;
  gap:2px;
  border:0;
  background:none;
  cursor:pointer;
  overflow:hidden;
  border-radius:inherit;
  z-index:3;
}
.waveform:focus-visible{outline:2px solid var(--brand-gold-bright);outline-offset:2px}
.waveform-bar{
  flex:1 1 0;
  min-width:1px;
  height:var(--bar-height,45%);
  border-radius:999px;
  background:rgba(147,164,184,.34);
  transition:background .16s ease,opacity .16s ease;
}

.waveform-played{
  position:absolute;
  inset:0;
  width:100%!important;
  overflow:hidden;
  pointer-events:none;
  z-index:4;
  border-radius:inherit;
  clip-path:polygon(0 0,var(--played,0%) 0,var(--played,0%) 100%,0 100%);
}
.waveform-played-bars{
  width:100%;
  height:100%;
  padding:7px 6px;
  display:flex;
  align-items:center;
  gap:2px;
}
.waveform-played .waveform-bar{
  background:linear-gradient(180deg,var(--brand-gold-bright),var(--brand-blue-bright));
  opacity:.95;
}

.loop-region{
  position:absolute;
  top:0;
  bottom:0;
  left:0;
  width:0;
  background:rgba(153,119,59,.13);
  border-left:1px solid rgba(192,154,85,.78);
  border-right:1px solid rgba(192,154,85,.78);
  pointer-events:none;
  opacity:0;
  z-index:2;
}
.loop-region.active{opacity:1}

.loop-point{
  position:absolute;
  top:0;
  bottom:0;
  width:1px;
  background:var(--brand-gold-bright);
  z-index:5;
  pointer-events:none;
  opacity:0;
}
.loop-point.active{opacity:1}
.loop-point::before{
  content:attr(data-label);
  position:absolute;
  top:-1px;
  left:50%;
  transform:translate(-50%,-100%);
  min-width:19px;
  height:17px;
  padding:0 5px;
  display:grid;
  place-items:center;
  border-radius:5px 5px 2px 2px;
  background:var(--brand-gold-bright);
  color:#091019;
  font-size:8px;
  font-weight:900;
}

.comment-marker{
  position:absolute;
  top:-8px;
  transform:translateX(-50%);
  width:25px;
  height:25px;
  border-radius:50%;
  border:2px solid #0a1119;
  background:var(--brand-blue);
  color:#fff;
  display:grid;
  place-items:center;
  font-size:7px;
  font-weight:900;
  z-index:8;
  cursor:pointer;
  box-shadow:0 0 0 1px rgba(192,154,85,.45),0 5px 12px rgba(0,0,0,.34);
}
.comment-marker::after{
  content:"";
  position:absolute;
  top:23px;
  left:50%;
  width:1px;
  height:12px;
  background:rgba(192,154,85,.55);
}
.comment-marker:hover,.comment-marker:focus-visible{
  transform:translateX(-50%) scale(1.08);
  outline:none;
  background:var(--brand-blue-bright);
}
.comment-marker.has-image{
  background-size:cover;
  background-position:center;
  color:transparent;
}

.player-tools-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-width:0;
}
.loop-controls{
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
}
.loop-control{
  min-height:28px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:8px;
  background:rgba(255,255,255,.025);
  color:#8794a4;
  padding:0 9px;
  cursor:pointer;
  font-size:8px;
  letter-spacing:.04em;
}
.loop-control:hover{border-color:rgba(192,154,85,.36);color:#fff}
.loop-control.active{
  background:rgba(153,119,59,.14);
  border-color:rgba(192,154,85,.5);
  color:var(--brand-gold-bright);
}
.loop-control:disabled{opacity:.35;cursor:not-allowed}

.loop-readout{
  margin-left:4px;
  font-size:8px;
  color:#6e7a89;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}
.player-hint{
  color:#596676;
  font-size:8px;
  text-align:right;
  white-space:nowrap;
}

@media(max-width:1050px){
  .global-player{
    grid-template-columns:minmax(150px,210px) auto minmax(260px,1fr);
    gap:12px;
    padding-inline:14px;
  }
  .player-hint{display:none}
}

@media(max-width:760px){
  .app-shell{padding-bottom:190px}
  .global-player{
    left:0;
    height:178px;
    grid-template-columns:1fr auto;
    grid-template-rows:auto 1fr;
    gap:8px 12px;
    padding:10px 12px;
  }
  .player-track strong,.player-track span{max-width:55vw}
  .player-workspace{grid-column:1/-1}
  .waveform-row{grid-template-columns:32px minmax(0,1fr) 32px}
  .waveform-shell{height:48px}
  .loop-controls{gap:4px}
  .loop-control{padding:0 7px}
}
