#funkRoot{
  --funk-bg:#0b0b0b;
  --funk-fg:#e9e9e9;
  --funk-muted:#b6b6b6;
  --funk-rule:#2a2a2a;
  --funk-accent:#00ff66;
  --funk-warn:#ffd400;
  --funk-danger:#ff2d2d;
  --funk-max:980px;
  color:var(--funk-fg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco,
               Consolas, "Liberation Mono", "Courier New", monospace;
  font-size:16px;
  line-height:1.6;
}

#funkRoot a{
  color:var(--funk-fg);
  text-decoration:none;
}
#funkRoot a:hover{ opacity:.85; }

#funkRoot .funk-wrap{
  max-width:var(--funk-max);
  margin:0 auto;
  padding:22px 18px 64px;
  width:100%;
  box-sizing:border-box;
  display:flex;
  flex-direction:column;
  align-items:stretch;
}

#funkRoot .funk-hero{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:14px;
  flex-wrap:wrap;
}

#funkRoot h1{
  margin:0;
  font-size:20px;
  letter-spacing:.3px;
}

#funkRoot .sub{
  color:var(--funk-muted);
  font-size:14px;
  margin-top:4px;
}

#funkRoot .rule{
  border-top:1px solid var(--funk-rule);
  margin:18px 0;
}

#funkRoot .grid{
  display:grid;
  grid-template-columns: 1fr;
  gap:18px;
  align-items:start;
  width:100%;
}


#funkRoot .panel{
  border:1px solid var(--funk-rule);
  border-radius:10px;
  padding:14px 14px 12px;
  background:rgba(255,255,255,0.02);
  width:100%;
  max-width:100%;
  display:block;
  box-sizing:border-box;
}

#funkRoot .panel h2{
  margin:0 0 10px;
  font-size:14px;
  color:var(--funk-muted);
  text-transform:uppercase;
  letter-spacing:1.2px;
}

#funkRoot .row{
  display:flex;
  flex-wrap:wrap;
  gap:12px 14px;
  align-items:center;
}

#funkRoot .row + .row{ margin-top:10px; }

#funkRoot .delay-row{
  flex-wrap:nowrap;
}

#funkRoot .delay-row label{
  flex:1 1 0;
  min-width:0;
}

#funkRoot .control-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap:12px 14px;
  align-items:center;
}

#funkRoot label{
  display:flex;
  gap:10px;
  align-items:center;
  color:var(--funk-muted);
  font-size:13px;
  white-space:nowrap;
}

#funkRoot input[type="range"]{
  width:170px;
  accent-color: var(--funk-accent);
}

#funkRoot input[type="number"],
#funkRoot select,
#funkRoot button{
  font: inherit;
  background:#0f0f0f;
  color:var(--funk-fg);
  border:1px solid var(--funk-rule);
  border-radius:8px;
  padding:7px 10px;
}

#funkRoot button{
  cursor:pointer;
  padding:8px 12px;
}
#funkRoot button:hover{ opacity:.92; }
#funkRoot button.primary{
  border-color: rgba(0,255,102,0.35);
}
#funkRoot button.danger{
  border-color: rgba(255,45,45,0.45);
}

#funkRoot .btn-compact{
  padding:4px 10px;
  font-size:13px;
  line-height:1.1;
}

#funkRoot .tiny{
  font-size:12px;
  color:var(--funk-muted);
}

#funkRoot .status{
  display:flex;
  flex-wrap:wrap;
  gap:10px 14px;
  align-items:center;
  font-size:13px;
  color:var(--funk-muted);
}

#funkRoot .pill{
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--funk-rule);
  background:rgba(255,255,255,0.02);
}

#funkRoot .pill-compact{
  padding:4px 10px;
  font-size:13px;
  line-height:1.1;
}

#funkRoot .dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:#555;
}

#funkRoot .dot.on{ background: var(--funk-accent); }
#funkRoot .dot.warn{ background: var(--funk-warn); }
#funkRoot .dot.danger{ background: var(--funk-danger); }

/* Sequencers */
#funkRoot .seq{
  overflow:auto;
  padding-bottom:4px;
  width:100%;
  max-width:100%;
}

#funkRoot .seq-grid{
  display:grid;
  grid-template-columns: 110px repeat(16, 26px);
  gap:6px;
  align-items:center;
  min-width: 110px;
}

#funkRoot .seq-grid.has-vol{
  grid-template-columns: 110px repeat(16, 26px) 120px 120px;
}

#funkRoot .seq-grid .head{
  color:var(--funk-muted);
  font-size:12px;
  text-align:center;
  opacity:.9;
}

#funkRoot .seq-grid .head.vol{
  text-align:center;
}

#funkRoot .seq-grid .head.pitch{
  text-align:center;
}

#funkRoot .track-name{
  color:var(--funk-muted);
  font-size:13px;
}

#funkRoot .track-vol{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
}

#funkRoot .track-vol input[type="range"]{
  width:100px;
}

#funkRoot .track-pitch{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
}

#funkRoot .track-pitch input[type="range"]{
  width:100px;
}

#funkRoot .step{
  width:26px;
  height:26px;
  border-radius:7px;
  border:1px solid var(--funk-rule);
  background:#0f0f0f;
  cursor:pointer;
  position:relative;
  box-sizing:border-box;
}

#funkRoot .step.on{
  border-color: rgba(0,255,102,0.45);
  background: rgba(0,255,102,0.10);
}

#funkRoot .step.playing::after{
  content:"";
  position:absolute;
  inset:-2px;
  border-radius:9px;
  border:1px solid rgba(255,255,255,0.25);
  pointer-events:none;
}

#funkRoot .step.off-len{
  opacity:.25;
  pointer-events:none;
}

#funkRoot .note-step{
  width:26px;
  height:26px;
  border-radius:7px;
  border:1px solid var(--funk-rule);
  background:#0f0f0f;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  font-size:12px;
  color:var(--funk-muted);
  user-select:none;
  position:relative;
  box-sizing:border-box;
}

#funkRoot .note-step.on{
  border-color: rgba(0,255,102,0.45);
  background: rgba(0,255,102,0.10);
  color: var(--funk-fg);
}

#funkRoot .note-step.playing::after{
  content:"";
  position:absolute;
  inset:-2px;
  border-radius:9px;
  border:1px solid rgba(255,255,255,0.25);
  pointer-events:none;
}

#funkRoot .note-step.off-len{
  opacity:.25;
  pointer-events:none;
}

#funkRoot .note-editor{
  display:flex;
  flex-wrap:wrap;
  gap:10px 12px;
  align-items:center;
  margin-top:10px;
}

#funkRoot .note-editor select{
  min-width:150px;
}

#funkRoot .flash-green{
  color:var(--funk-accent);
  animation: greenblink 1.15s steps(2,end) infinite;
}

@keyframes greenblink{
  0%{ opacity:1; }
  50%{ opacity:.25; }
  100%{ opacity:1; }
}

#funkRoot .two-col{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
}

@media (max-width: 860px){
  #funkRoot .grid{ grid-template-columns: 1fr; }
  #funkRoot .two-col{ grid-template-columns: 1fr; }
  #funkRoot .seq-grid{ grid-template-columns: 92px repeat(16, 24px); }
  #funkRoot .seq-grid.has-vol{ grid-template-columns: 92px repeat(16, 24px) 100px 100px; }
  #funkRoot .step,
  #funkRoot .note-step{ width:24px; height:24px; border-radius:7px; }
  #funkRoot input[type="range"]{ width:160px; }
  #funkRoot .track-vol input[type="range"]{ width:88px; }
  #funkRoot .track-pitch input[type="range"]{ width:88px; }
}
