:root{
  --bg:#0b0b24;
  --text:#e5e7eb;
  --muted:#9ca3af;
  --accent:#782bda;
  --danger:#ef4444;
  --ok:#22c55e;
  --panel: rgba(255,255,255,0.04);
  --stroke: rgba(255,255,255,0.07);
  --footerH: 40px;
  --headerH: 64px;
  --sideW: 320px;
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: radial-gradient(1200px 800px at 15% 10%, #1d1250 0%, var(--bg) 60%);
  color:var(--text);
  overflow:hidden;
  height:100vh;
}

header{
  padding:14px 18px 10px;
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid rgba(255,255,255,0.06);
  height:var(--headerH);
}
.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}
.brand h1{ margin:0; line-height:0 }
.brand img{
  height:30px;
  width:auto;
}
header h1{
  margin:0;
  font-size:18px;
  letter-spacing:0.2px;
  font-weight:650;
  white-space:nowrap;
}

.topControls{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-end;
}

.pill{
  font-size:12px;
  color: var(--muted);
  padding:8px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.18);
  user-select:none;
}

.mono{
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
}

.btn{
  appearance:none;
  border:1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color:var(--text);
  border-radius:12px;
  padding:10px 12px;
  font-size:13px;
  cursor:pointer;
  transition: transform 120ms ease, background 120ms ease, border 120ms ease;
  user-select:none;
  white-space:nowrap;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}
.btn:hover{ transform: translateY(-1px); border-color: rgba(255,255,255,0.18); background: rgba(255,255,255,0.08); }
.btn:active{ transform: translateY(0px); }
.btn.primary{
  background: linear-gradient(180deg, rgba(120,43,218,0.95), rgba(120,43,218,0.75));
  border-color: rgba(120,43,218,0.9);
}
.btn.danger{
  border-color: rgba(239,68,68,0.50);
  background: rgba(239,68,68,0.14);
}
.btn.ok{
  border-color: rgba(34,197,94,0.45);
  background: rgba(34,197,94,0.12);
}
.btn.icon{
  width:40px;
  padding:10px 0;
  text-align:center;
  font-size:16px;
  line-height:1;
}
.btn:disabled{
  opacity:0.45;
  cursor:not-allowed;
  transform:none !important;
}

.seg{
  display:flex;
  gap:8px;
  align-items:center;
  padding:6px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.18);
}
.seg .btn{
  padding:8px 10px;
  border-radius:12px;
}

label{ display:block; font-size:12px; color:var(--muted); margin-bottom:6px; }
input, textarea, select{
  width:100%;
  padding:10px 10px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.22);
  color:var(--text);
  outline:none;
  font-size:13px;
}
input:focus, textarea:focus, select:focus{
  border-color: rgba(120,43,218,0.6);
  box-shadow: 0 0 0 3px rgba(120,43,218,0.16);
}

.row{
  display:flex;
  gap:12px;
  align-items:flex-end;
  flex-wrap:wrap;
}
.grow{
  flex: 1 1 320px;
  min-width: 240px;
}
.tight{ flex: 0 0 auto; }
.row .tight > .btn{ width: 100%; }

.wrap{
  height: calc(100vh - var(--headerH) - var(--footerH));
  padding:16px 18px 16px;
  display:grid;
  grid-template-columns: var(--sideW) 1.35fr 0.95fr;
  gap:16px;
  max-width: 1600px;
  margin:0 auto;
  overflow:hidden;
}
.card{
  background: linear-gradient(180deg, var(--panel), rgba(255,255,255,0.02));
  border:1px solid var(--stroke);
  border-radius:16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  min-height:0;
}
.card .hd{
  padding:12px 14px;
  background: rgba(0,0,0,0.18);
  border-bottom:1px solid rgba(255,255,255,0.06);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex: 0 0 auto;
}
.card .hd .kicker{ color:var(--muted); font-size:12px; }
.card .hd .name{ font-size:14px; font-weight:650; }
.card .bd{
  padding:12px 14px;
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
}

.trackList{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.trackItem{
  border:1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.20);
  border-radius:14px;
  padding:10px;
  cursor:pointer;
  display:flex;
  gap:10px;
  align-items:flex-start;
  justify-content:space-between;
}
.trackItem:hover{
  border-color: rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.04);
}
.trackItem.active{
  border-color: rgba(120,43,218,0.70);
  box-shadow: 0 0 0 3px rgba(120,43,218,0.18);
}
.trackLeft{
  min-width:0;
  flex:1 1 auto;
}
.trackTitle{
  display:flex;
  gap:8px;
  align-items:center;
  min-width:0;
}
.trackBadge{
  background: rgba(120,43,218,0.18);
  border:1px solid rgba(120,43,218,0.35);
  padding:3px 8px;
  border-radius:999px;
  font-size:12px;
  flex:0 0 auto;
}
.trackName{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  font-size:13px;
  color: rgba(255,255,255,0.92);
}
.trackSub{
  margin-top:6px;
  color:var(--muted);
  font-size:12px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.trackActions{
  display:flex;
  gap:8px;
  flex:0 0 auto;
}
.trackActions .btn{
  padding:8px 10px;
  border-radius:10px;
  font-size:12px;
}

#waveWrap{
  position:relative;
  border-radius:14px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.20);
  padding:10px;
}
#wave{ position:relative; z-index:1; }
#timeline:empty{ display:none; }
#timeline{
  margin-top:8px;
  border-radius:12px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.16);
  padding:6px 10px;
  min-height: 38px;
}

.playerDrop{
  border-radius:12px;
  border:1px dashed rgba(255,255,255,0.26);
  background: rgba(0,0,0,0.22);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;
  z-index:10;
  transition: border-color 120ms ease, background 120ms ease, opacity 120ms ease;
  padding:14px;
  text-align:center;
}
.playerDrop .hint{
  color: var(--muted);
  font-size:13px;
  line-height:1.35;
  text-align:center;
  max-width: 520px;
  padding:0 12px;
}
.playerDrop .ctaRow{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  justify-content:center;
}
.playerDrop.hidden{
  opacity:0;
  pointer-events:none;
}
.playerDrop.dragover{
  border-color: rgba(120,43,218,0.70);
  background: rgba(120,43,218,0.12);
}

.playerDropOverlay{
  position:absolute;
  inset:10px;
  pointer-events:auto;
}

#markerOverlay{
  position:absolute;
  left:10px;
  right:10px;
  top:10px;
  bottom:10px;
  z-index:5;
  pointer-events:none;
  overflow:hidden;
}
#cueFlash{
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:40;
  border-radius:14px;
  opacity:0;
  box-shadow:
    inset 0 0 0 3px rgba(34,197,94,0.85),
    inset 0 0 40px 6px rgba(34,197,94,0.35),
    inset 0 0 120px 20px rgba(34,197,94,0.12);
}
#cueFlash.flash{ animation: cueFlash 650ms ease-out; }
@keyframes cueFlash{
  0%   { opacity:0; }
  12%  { opacity:1; }
  100% { opacity:0; }
}
#btnFlash.on{
  border-color: rgba(34,197,94,0.6);
  background: rgba(34,197,94,0.16);
}
.zoomBar .btn{ padding:6px 10px; }
.zoomBar .btn.icon{ width:32px; padding:6px 0; }
.zoomBar .pill{ padding:6px 9px; }
.zoomBar .spacer{ flex:1 1 auto; }
.cueEntry{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px 12px;
  align-items:end;
}
.cueEntry .cueEntryRow2{
  grid-column: 1 / -1;
  display:grid;
  grid-template-columns: 150px 160px 1fr;
  gap:12px;
  align-items:end;
}
@media (max-width: 700px){
  .cueEntry{ grid-template-columns: 1fr; }
  .cueEntry .cueEntryRow2{ grid-template-columns: 1fr 1fr; }
  .cueEntry .cueEntryRow2 .btn{ grid-column: 1 / -1; }
}
.zoomBar{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  margin-bottom:8px;
}
.zoomBar input[type=range]{
  flex:1 1 120px;
  min-width:80px;
  max-width:260px;
  padding:0;
  accent-color: var(--accent);
}
.marker{
  position:absolute;
  top:0;
  bottom:0;
  width:0;
  pointer-events:auto;
  touch-action:none;
}
.markerLine{
  position:absolute;
  top:0;
  bottom:0;
  left:-1px;
  width:2px;
  background: rgba(120,43,218,0.95);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.35);
}
.markerHit{
  position:absolute;
  top:0;
  bottom:0;
  left:-9px;
  width:18px;
  background: transparent;
  cursor: ew-resize;
}
.markerBubble{
  position:absolute;
  top:6px;
  left:10px;
  max-width: 170px;
  padding:3px 8px;
  border-radius:999px;
  border:1px solid rgba(120,43,218,0.55);
  background: rgba(10,14,24,0.92);
  color: rgba(255,255,255,0.95);
  font-size:11px;
  line-height:1.1;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  user-select:none;
  cursor:pointer;
}

.endShade{
  position:absolute;
  top:0;
  bottom:0;
  right:0;
  background: rgba(239,68,68,0.12);
  pointer-events:none;
}
.startShade{
  position:absolute;
  top:0;
  bottom:0;
  left:0;
  background: rgba(34,197,94,0.10);
  pointer-events:none;
}
.marker.startMarker .markerLine{
  background: var(--ok);
}
.marker.startMarker .markerBubble{
  border-color: rgba(34,197,94,0.75);
}
.marker.endMarker .markerLine{
  background: var(--danger);
}
.marker.endMarker .markerBubble{
  border-color: rgba(239,68,68,0.75);
}

.cue.isActive{
  border-color: rgba(120,43,218,0.70);
  box-shadow: 0 0 0 3px rgba(120,43,218,0.18);
}
.cue.outOfRange{
  opacity:0.5;
}
.marker.outOfRange .markerLine{
  background: rgba(156,163,175,0.6);
}
.marker.outOfRange .markerBubble{
  opacity:0.6;
  text-decoration: line-through;
}
.cue.isSelected{
  border-color: rgba(255,255,255,0.85);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.14);
}
.marker.isSelected .markerLine{
  background: #fff;
  width:3px;
}
.marker.isSelected .markerBubble{
  border-color: #fff;
  background: rgba(255,255,255,0.16);
}
.marker.isActive .markerLine{
  width:3px;
  box-shadow: 0 0 0 2px rgba(120,43,218,0.18);
}
.marker.isActive .markerBubble{
  border-color: rgba(120,43,218,0.95);
  background: rgba(120,43,218,0.18);
}

.list{
  margin:0;
  padding:0;
  list-style:none;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.cue{
  border:1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.20);
  border-radius:14px;
  padding:10px;
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
}
.cue .meta{ display:flex; flex-direction:column; gap:8px; min-width:0; flex:1 1 auto; }
.cue .top{ display:flex; gap:8px; align-items:center; min-width:0; }
.cue .id{
  background: rgba(120,43,218,0.18);
  border:1px solid rgba(120,43,218,0.35);
  padding:3px 8px;
  border-radius:999px;
  font-size:12px;
  flex:0 0 auto;
}
.cue .name{
  font-size:13px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width: 520px;
  color: rgba(255,255,255,0.92);
}
.cue .sub{
  color:var(--muted);
  font-size:12px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.cue .actions{
  display:flex;
  gap:8px;
  flex:0 0 auto;
}
.cue .actions .btn{ padding:8px 10px; border-radius:10px; font-size:12px; }

.editGrid{
  display:grid;
  grid-template-columns: 1.2fr 0.55fr;
  gap:10px;
  align-items:end;
}
.editGrid .full{ grid-column: 1 / -1; }
.mini{
  padding:8px 10px;
  border-radius:10px;
  font-size:12px;
}

.cueCardBd{
  overflow:auto !important;
  scroll-behavior:smooth;
}

.menuGroup{ position:relative; }
.menu{
  position:absolute;
  top: calc(100% + 6px);
  right:0;
  min-width: 300px;
  background: rgba(15,18,30,0.96);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
  padding: 6px;
  display:none;
  z-index: 30;
}
.menu.open{ display:block; }
.menuItem{
  width:100%;
  justify-content:flex-start;
  padding:9px 10px;
  border-radius:10px;
  font-size:12px;
}
.menuItem + .menuItem{ margin-top:6px; }

.modalBackdrop{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:50;
  padding:18px;
}
.modal{
  width:min(720px, 96vw);
  border-radius:16px;
  border:1px solid rgba(255,255,255,0.10);
  background: linear-gradient(180deg, rgba(20,24,40,0.94), rgba(12,15,25,0.92));
  box-shadow: 0 30px 90px rgba(0,0,0,0.55);
  overflow:hidden;
  max-height: calc(100vh - 36px);
  display:flex;
  flex-direction:column;
}
.modalHd, .modalFt{ flex:0 0 auto; }
.modalHd{
  padding:12px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.20);
}
.modalBd{ padding:14px; overflow:auto; flex:1 1 auto; min-height:0; }
.settingsCols{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
  align-items:start;
}
.settingsCol{ display:flex; flex-direction:column; gap:14px; min-width:0; }
@media (max-width: 820px){
  .settingsCols{ grid-template-columns: 1fr; }
}
.panelBox{
  padding:12px;
  border:1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.16);
  border-radius:14px;
}
.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
.grid4{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:10px;
}
.modalFt{
  padding:12px 14px;
  display:flex;
  gap:10px;
  justify-content:flex-end;
  border-top:1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.16);
}

.fieldError{
  margin-top:6px;
  font-size:12px;
  color: #fca5a5;
  display:none;
}
input.inputError{
  border-color: rgba(239,68,68,0.85);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.18);
}

.fieldTip{
  position:absolute;
  left:0;
  top:100%;
  margin-top:8px;
  padding:8px 10px;
  border-radius:10px;
  background: rgba(15,18,30,0.96);
  border: 1px solid rgba(239,68,68,0.55);
  color: rgba(255,255,255,0.95);
  font-size:12px;
  line-height:1.2;
  display:none;
  z-index: 40;
  box-shadow: 0 18px 45px rgba(0,0,0,0.45);
}
.fieldTip::before{
  content:"";
  position:absolute;
  top:-6px;
  left:14px;
  width:10px;
  height:10px;
  background: rgba(15,18,30,0.96);
  border-left: 1px solid rgba(239,68,68,0.55);
  border-top: 1px solid rgba(239,68,68,0.55);
  transform: rotate(45deg);
}

footer{
  height: var(--footerH);
  border-top:1px solid rgba(255,255,255,0.06);
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  color: rgba(229,231,235,0.72);
  font-size:12px;
  padding:0 14px;
  background: rgba(0,0,0,0.14);
}
footer a{
  color: rgba(229,231,235,0.90);
  text-decoration:none;
  font-weight:700;
  border-bottom:1px solid rgba(229,231,235,0.25);
}
footer a:hover{
  border-bottom-color: rgba(229,231,235,0.60);
}

@media (max-width: 1220px){
  body{ overflow:auto; height:auto; }
  .wrap{ height:auto; overflow:visible; grid-template-columns: 1fr; }
  .card .bd{ overflow:visible; }
  .cueCardBd{ max-height: 60vh; }
  header{ height:auto; }
  footer{ height:auto; padding:10px 14px; }
}
  

.steps{ margin:0; padding-left:20px; display:flex; flex-direction:column; gap:10px; font-size:14px; line-height:1.4; }
.steps-note{ margin:14px 0 0; font-size:12.5px; line-height:1.4; color:var(--muted); }
.linkBtn{ background:none; border:0; padding:0; font:inherit; color:inherit; cursor:pointer; text-decoration:underline; }
.steps-lede{ margin:0 0 12px; font-size:14px; line-height:1.4; }
