/* MasKun Studio — dark theme, mobile-first. Semua kontrol sentuh ≥44px. */
:root {
  --bg: #0b0e14;
  --bg2: #11151d;
  --card: #161b26;
  --card2: #1c2331;
  --line: #2a3242;
  --txt: #e8ecf3;
  --dim: #9aa5b8;
  --acc: #f0a832;      /* amber emas */
  --acc2: #4fc3f7;     /* biru dingin */
  --ok: #5fd68a;
  --warn: #ffb454;
  --crit: #ff6b6b;
  --r: 14px;
  --tap: 44px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--txt);
  font-family: var(--font); font-size: 15px; line-height: 1.5;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
  overscroll-behavior-y: none;
}
button, input, select { font-family: var(--font); }

/* ---------- Header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px calc(10px) 12px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: rgba(11,14,20,.96); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.logo { font-weight: 800; font-size: 17px; letter-spacing: .3px; }
.logo .mk { color: var(--acc); }
.langseg { margin-left: auto; display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.langseg button {
  min-height: var(--tap); min-width: 52px; border: 0; background: transparent;
  color: var(--dim); font-weight: 700; font-size: 14px; padding: 0 12px; cursor: pointer;
}
.langseg button.act { background: var(--acc); color: #141414; }
.iconbtn {
  min-width: var(--tap); min-height: var(--tap); border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--txt);
  font-size: 19px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.iconbtn:active { background: var(--card2); }

/* ---------- Toolbar (undo/redo/A/B/bypass) ---------- */
.toolbar {
  display: flex; gap: 6px; align-items: center; overflow-x: auto;
  padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--bg2);
  scrollbar-width: none;
}
.toolbar::-webkit-scrollbar { display: none; }
.tbtn {
  min-height: var(--tap); padding: 0 14px; border-radius: 10px; white-space: nowrap;
  border: 1px solid var(--line); background: var(--card); color: var(--txt);
  font-size: 13px; font-weight: 700; cursor: pointer; flex: 0 0 auto;
}
.tbtn:active { background: var(--card2); }
.tbtn.warn { border-color: var(--acc); color: var(--acc); }
.tbtn.on { background: var(--acc); border-color: var(--acc); color: #141414; }
.tbtn:disabled { opacity: .35; }
.tsep { width: 1px; align-self: stretch; background: var(--line); flex: 0 0 auto; }

/* ---------- Transport ---------- */
.transport {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: var(--bg2); border-bottom: 1px solid var(--line);
}
.tport-btn {
  min-width: 52px; min-height: var(--tap); border-radius: 12px; font-size: 17px;
  border: 1px solid var(--line); background: var(--card); color: var(--txt); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 0 10px; font-weight: 700;
}
.tport-btn.primary { background: var(--acc); border-color: var(--acc); color: #141414; font-size: 18px; }
.tport-btn.toggled { border-color: var(--acc2); color: var(--acc2); }
.tport-btn:active { filter: brightness(1.15); }
.tport-btn .lbl { font-size: 12px; }
.timebox { margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; }
.timebox .cur { font-size: 16px; font-weight: 800; }
.timebox .tot { font-size: 12px; color: var(--dim); }
.trackname { font-size: 12px; color: var(--dim); max-width: 38vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.volwrap { display: flex; align-items: center; gap: 4px; }
.volwrap .vlab { font-size: 11px; color: var(--dim); }

/* ---------- Meter strip (permanen) ---------- */
.meterstrip {
  padding: 8px 12px; border-bottom: 1px solid var(--line); background: #0d1118;
  cursor: pointer; user-select: none;
}
.meterstrip .row { display: flex; align-items: baseline; gap: 12px; }
.meterstrip .big { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.meterstrip .big small { font-size: 12px; color: var(--dim); font-weight: 600; }
.meterstrip .tp { font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; margin-left: auto; }
.mbar { height: 8px; border-radius: 4px; background: #222a38; margin-top: 6px; overflow: hidden; }
.mbar > div { height: 100%; width: 0%; background: linear-gradient(90deg, var(--ok), var(--acc) 70%, var(--crit)); border-radius: 4px; }
.meterdetail { display: none; margin-top: 8px; grid-template-columns: 1fr 1fr; gap: 6px; }
.meterstrip.exp .meterdetail { display: grid; }
.mcell { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.mcell .k { font-size: 11px; color: var(--dim); }
.mcell .v { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.meternote { font-size: 11px; color: var(--dim); margin-top: 6px; }

/* ---------- Tabs ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; background: rgba(13,17,24,.98); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs button {
  flex: 1; min-height: 64px; border: 0; background: transparent; color: var(--dim);
  font-size: 11.5px; font-weight: 700; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
}
.tabs button .ic { font-size: 19px; }
.tabs button.act { color: var(--acc); }
.tabs button.act .ic { filter: drop-shadow(0 0 6px rgba(240,168,50,.5)); }

/* ---------- Panels & cards ---------- */
.panel { display: none; padding: 12px 12px 24px; max-width: 720px; margin: 0 auto; }
.panel.act { display: block; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px; margin-bottom: 12px;
}
.card h3 { margin: 0 0 4px; font-size: 15px; }
.card .sub { font-size: 12.5px; color: var(--dim); margin: 0 0 10px; }
.subtabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs button {
  min-height: var(--tap); padding: 0 16px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--line); background: var(--card); color: var(--dim);
  font-size: 13.5px; font-weight: 700; cursor: pointer; flex: 0 0 auto;
}
.subtabs button.act { background: var(--acc); border-color: var(--acc); color: #141414; }
.hint { font-size: 12.5px; color: var(--dim); margin: 8px 0 0; }

/* ---------- Slider rows ---------- */
.srow { margin: 10px 0; }
.srow .lab { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 2px; }
.srow .lab .n { font-size: 13.5px; font-weight: 600; }
.srow .lab .v { font-size: 13.5px; font-weight: 800; color: var(--acc); font-variant-numeric: tabular-nums; }
input[type=range] {
  width: 100%; min-height: var(--tap); margin: 0; background: transparent;
  -webkit-appearance: none; appearance: none; cursor: pointer;
}
input[type=range]::-webkit-slider-runnable-track { height: 10px; border-radius: 5px; background: #262e3d; }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--acc); margin-top: -12px; border: 3px solid #0b0e14;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
input[type=range]::-moz-range-track { height: 10px; border-radius: 5px; background: #262e3d; }
input[type=range]::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: var(--acc); border: 3px solid #0b0e14; }
input[type=range]:disabled { opacity: .35; }

/* ---------- Steppers ---------- */
.stepper { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.stepper .n { flex: 1; font-size: 13.5px; font-weight: 600; }
.stepper .v { font-size: 14px; font-weight: 800; color: var(--acc); font-variant-numeric: tabular-nums; min-width: 86px; text-align: right; }
.stepbtn {
  width: var(--tap); height: var(--tap); border-radius: 12px; font-size: 20px; font-weight: 800;
  border: 1px solid var(--line); background: var(--card2); color: var(--txt); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  touch-action: none; user-select: none;
}
.stepbtn:active { background: var(--acc); color: #141414; }

/* ---------- Toggle switch ---------- */
.togglerow { display: flex; align-items: center; justify-content: space-between; min-height: 52px; gap: 10px; }
.togglerow .n { font-size: 14px; font-weight: 700; }
.switch {
  position: relative; width: 64px; height: var(--tap); border-radius: 999px; flex: 0 0 auto;
  border: 1px solid var(--line); background: #262e3d; cursor: pointer; padding: 0;
}
.switch::after {
  content: ''; position: absolute; top: 4px; left: 5px; width: 34px; height: 34px;
  border-radius: 50%; background: #7c8798; transition: all .15s;
}
.switch.on { background: rgba(240,168,50,.25); border-color: var(--acc); }
.switch.on::after { left: 23px; background: var(--acc); }

/* ---------- Pills & selects ---------- */
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.pill {
  min-height: var(--tap); padding: 0 18px; border-radius: 999px; font-size: 13.5px; font-weight: 700;
  border: 1px solid var(--line); background: var(--card2); color: var(--txt); cursor: pointer;
}
.pill.act { background: var(--acc); border-color: var(--acc); color: #141414; }
select.bigsel {
  width: 100%; min-height: var(--tap); border-radius: 12px; font-size: 14.5px; font-weight: 600;
  background: var(--card2); color: var(--txt); border: 1px solid var(--line); padding: 0 12px; cursor: pointer;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 20px; border-radius: 12px; font-size: 14.5px; font-weight: 800;
  border: 1px solid var(--line); background: var(--card2); color: var(--txt); cursor: pointer;
}
.btn:active { filter: brightness(1.2); }
.btn.primary { background: var(--acc); border-color: var(--acc); color: #141414; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; margin: 6px 0; }
.btn:disabled { opacity: .4; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.btnrow .btn { flex: 1; min-width: 140px; }

/* ---------- EQ canvas ---------- */
.eqcanvas { width: 100%; height: 200px; border-radius: 12px; background: #0d1118; border: 1px solid var(--line); touch-action: none; display: block; }
.eqbandlist { display: flex; gap: 6px; overflow-x: auto; margin: 10px 0; scrollbar-width: none; padding-bottom: 2px; }
.eqbandlist::-webkit-scrollbar { display: none; }
.eqbandlist button {
  min-width: var(--tap); min-height: var(--tap); border-radius: 10px; font-size: 13px; font-weight: 800;
  border: 1px solid var(--line); background: var(--card2); color: var(--dim); cursor: pointer; flex: 0 0 auto;
}
.eqbandlist button.sel { border-color: var(--acc); color: var(--acc); }
.eqbandlist button.dis { opacity: .35; }

/* ---------- FX / ambience cards ---------- */
.fxcard .head { display: flex; align-items: center; justify-content: space-between; min-height: 52px; }
.fxcard .head .n { font-size: 15px; font-weight: 800; }
.fxcard .params { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 4px; }
.fxcard.offx .params { display: none; }

/* ---------- Batch ---------- */
.fileitem {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px; margin-bottom: 10px;
}
.fileitem .fn { font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fileitem .fd { font-size: 12px; color: var(--dim); margin: 2px 0 8px; }
.sugg { border-left: 3px solid var(--dim); padding: 6px 10px; margin: 6px 0; background: var(--bg2); border-radius: 0 8px 8px 0; font-size: 13px; }
.sugg.warning { border-color: var(--warn); }
.sugg.critical { border-color: var(--crit); }
.sugg.info { border-color: var(--acc2); }
.sugg .area { font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--dim); }
.sugg .iss { font-weight: 700; margin: 2px 0; }
.sugg .sg { color: var(--dim); }
.sev { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.sev.warning { background: rgba(255,180,84,.18); color: var(--warn); }
.sev.critical { background: rgba(255,107,107,.18); color: var(--crit); }
.sev.info { background: rgba(79,195,247,.15); color: var(--acc2); }
.report { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.report .rc { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.report .rc .k { font-size: 11px; color: var(--dim); }
.report .rc .v { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.report .rc .v.bad { color: var(--crit); }
.report .rc .v.good { color: var(--ok); }
.progress { height: 12px; border-radius: 6px; background: #222a38; overflow: hidden; margin: 8px 0; }
.progress > div { height: 100%; width: 0%; background: var(--acc); border-radius: 6px; transition: width .15s; }
.autotune { background: var(--bg2); border: 1px dashed var(--acc); border-radius: 10px; padding: 10px 12px; margin: 8px 0; font-size: 13px; }
.autotune .pr { font-family: ui-monospace, monospace; font-size: 12.5px; color: var(--acc2); }

/* ---------- Export ---------- */
.fmtgrid { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 8px 0; }
.fmtopt {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card2); cursor: pointer; font-size: 14px; font-weight: 700;
}
.fmtopt.sel { border-color: var(--acc); background: rgba(240,168,50,.1); }
.fmtopt input { width: 22px; height: 22px; accent-color: var(--acc); }
.dl { display: none; }
.dl.show { display: inline-flex; }

/* ---------- Modal & toast ---------- */
.modalback {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 60;
  display: none; align-items: flex-end; justify-content: center;
}
.modalback.show { display: flex; }
.modal {
  width: 100%; max-width: 560px; background: var(--bg2); border-top: 1px solid var(--line);
  border-radius: 20px 20px 0 0; padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
  max-height: 82vh; overflow-y: auto;
}
.modal h2 { margin: 0 0 12px; font-size: 17px; }
#toast {
  position: fixed; left: 12px; right: 12px; bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 70;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toastmsg {
  background: #202837; border: 1px solid var(--line); color: var(--txt);
  border-radius: 12px; padding: 12px 16px; font-size: 13.5px; font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,.5); animation: tin .2s;
}
.toastmsg.good { border-color: var(--ok); }
.toastmsg.bad { border-color: var(--crit); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

.hiddenfile { display: none; }
.kv { display: flex; justify-content: space-between; font-size: 13.5px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.kv .k { color: var(--dim); } .kv .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.sectiontitle { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--dim); margin: 14px 0 6px; }
