:root {
  --bg: #121a26;
  --panel: #1a2433;
  --panel-2: #213045;
  --line: #2c3c54;
  --text: #ece6d8;
  --muted: #8d98ab;
  --cream: #e9d6a9;
  --signal: #ff6a3d;
  --sel: #7aa8ff;
  --ok: #5fd08a;
  --warn: #f2b84b;
  --err: #ff5c5c;
  --radius-s: 6px;
  --radius-m: 10px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--sel); outline-offset: 2px; }

.app {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(260px, 1fr) auto auto;
}

/* icons */
.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i.solid { fill: currentColor; stroke: none; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--panel-2); cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover:not(:disabled) { background: #2a3b55; border-color: #3a4f6e; }
.btn.primary { background: var(--cream); color: #1b1608; border-color: var(--cream); font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: #f4e4bd; border-color: #f4e4bd; }
.btn.ghost { background: transparent; }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; gap: 6px; }
.btn.small .i { width: 15px; height: 15px; }
.btn.wide { width: 100%; justify-content: center; }
.btn:disabled, .tool:disabled, .icon-btn:disabled { opacity: .38; cursor: not-allowed; }

.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid transparent; border-radius: var(--radius-s);
  background: transparent; cursor: pointer; color: var(--text);
}
.icon-btn:hover:not(:disabled) { background: var(--panel-2); border-color: var(--line); }
.icon-btn.toggle[aria-pressed="true"] { color: var(--cream); background: rgba(233,214,169,.12); border-color: rgba(233,214,169,.35); }

/* top bar */
.topbar {
  display: flex; align-items: center; gap: 20px;
  padding: 10px 18px; border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 30px; height: 30px; fill: var(--cream); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-size: 17px; letter-spacing: .01em; }
.brand-text span { font-size: 12px; color: var(--muted); }
.brand-text span:empty { display: none; }
.project { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 12px; overflow: hidden; }
#projName { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.muted { color: var(--muted); font-size: 13px; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 8px; }

/* transport */
.transport {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  padding: 10px 18px; border-bottom: 1px solid var(--line);
}
.transport-buttons { display: flex; align-items: center; gap: 4px; }
.play-btn {
  width: 48px; height: 48px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--signal); color: #fff; display: grid; place-items: center; margin: 0 4px;
  box-shadow: 0 0 0 4px rgba(255,106,61,.15);
}
.play-btn:hover { filter: brightness(1.08); }
.play-btn .i { width: 22px; height: 22px; }
.clock-box { display: flex; flex-direction: column; min-width: 170px; }
.clock {
  font-size: 32px; font-weight: 300; line-height: 1; letter-spacing: .02em;
  font-variant-numeric: tabular-nums; color: var(--cream);
}
.clock-total { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 4px; }
.sel-fields { display: flex; gap: 10px; }
.sel-fields label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 3px; }
.sel-fields input {
  width: 96px; height: 30px; padding: 0 8px; background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--radius-s);
  font-variant-numeric: tabular-nums; color: var(--text);
}
.sel-fields input:focus { border-color: var(--sel); outline: none; }
.zoom { display: flex; gap: 2px; margin-left: auto; }
.monitor { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.monitor input { width: 100px; }

/* workspace */
.workspace { display: flex; min-height: 0; padding: 12px 18px 0; gap: 10px; }
.editor { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wave-wrap {
  position: relative; flex: 1; min-height: 200px;
  border: 1px solid var(--line); border-radius: var(--radius-m);
  overflow: hidden; background: #0f1621;
}
.wave-wrap > canvas { position: absolute; inset: 0; display: block; }
#overlayCanvas { cursor: text; touch-action: none; }
.hscroll { width: 100%; margin: 8px 0 0; }
.hscroll:disabled { opacity: .25; }
.meters {
  width: 64px; border: 1px solid var(--line); border-radius: var(--radius-m);
  background: #0f1621; position: relative; overflow: hidden; margin-bottom: 28px;
}
.meters canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* empty state */
.empty {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 24px; gap: 6px;
}
.empty[hidden] { display: none; }
.empty-art { width: 160px; fill: none; stroke: var(--cream); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; opacity: .85; margin-bottom: 8px; }
.empty h2 { margin: 0; font-size: 20px; font-weight: 600; }
.empty p { margin: 0; color: var(--muted); max-width: 46ch; }
.empty-actions { display: flex; gap: 10px; margin: 14px 0 6px; flex-wrap: wrap; justify-content: center; }
.empty .privacy { font-size: 12px; }

/* panels */
.panels {
  display: grid; grid-template-columns: 1.15fr .85fr 1.2fr; gap: 12px;
  padding: 12px 18px;
}
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m);
  padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.chip {
  font-size: 12px; color: var(--muted); padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70%;
  font-variant-numeric: tabular-nums;
}
.chip.active { color: var(--sel); border-color: rgba(122,168,255,.45); background: rgba(122,168,255,.08); }

.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tool {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; min-height: 38px;
  background: var(--panel-2); border: 1px solid transparent; border-radius: var(--radius-s);
  cursor: pointer; text-align: left; font-size: 13px;
}
.tool:hover:not(:disabled) { border-color: #3a4f6e; background: #263852; }
.tool .i { width: 16px; height: 16px; color: var(--cream); }

.inline-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.inline-row input[type=number], .inline-row select, .field input, .field select {
  height: 30px; padding: 0 8px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s); color: var(--text);
}
.inline-row input[type=number] { width: 70px; }

.gain-readout { display: flex; align-items: baseline; gap: 6px; }
.gain-readout output { font-size: 34px; font-weight: 300; line-height: 1; color: var(--cream); font-variant-numeric: tabular-nums; }
.gain-readout span { color: var(--muted); }
.gain-slider { width: 100%; }
.gain-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: -6px; font-variant-numeric: tabular-nums; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.quick .btn { flex: 1; justify-content: center; padding: 0 6px; font-variant-numeric: tabular-nums; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.check input { accent-color: var(--cream); width: 16px; height: 16px; }
.divider { height: 1px; background: var(--line); margin: 2px 0; }

/* range inputs */
input[type=range] { -webkit-appearance: none; appearance: none; background: transparent; height: 18px; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; background: var(--line); border-radius: 2px; }
input[type=range]::-moz-range-track { height: 4px; background: var(--line); border-radius: 2px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--cream); margin-top: -5px; border: none; }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--cream); border: none; }
.hscroll::-webkit-slider-thumb { width: 60px; height: 8px; border-radius: 4px; margin-top: -2px; background: #3d5272; }
.hscroll::-moz-range-thumb { width: 60px; height: 8px; border-radius: 4px; background: #3d5272; }

/* library */
.library { min-height: 0; }
.lib-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 230px; overflow-y: auto; }
.lib-item { display: grid; grid-template-columns: 84px 1fr; gap: 4px 10px; padding: 8px; background: var(--panel-2); border-radius: var(--radius-s); }
.lib-item canvas { width: 84px; height: 34px; grid-row: span 2; align-self: center; border-radius: 4px; background: #0f1621; }
.lib-info { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.lib-info b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.lib-info span { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lib-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.lib-actions button {
  height: 26px; padding: 0 9px; font-size: 12px; border-radius: 5px; cursor: pointer;
  border: 1px solid var(--line); background: transparent;
}
.lib-actions button:hover { background: #2a3b55; }
.lib-actions .x { margin-left: auto; color: var(--muted); }
.lib-empty { margin: 0; font-size: 13px; color: var(--muted); }
.lib-empty b { color: var(--text); font-weight: 600; }

/* status */
.status {
  display: flex; justify-content: space-between; gap: 20px; padding: 7px 18px;
  border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); background: var(--panel);
}
.status .keys { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
kbd {
  font: inherit; font-size: 11px; padding: 0 5px; border: 1px solid var(--line);
  border-bottom-width: 2px; border-radius: 4px; color: var(--text); margin: 0 1px;
}

/* modal */
.modal-back, .drop-overlay, .busy {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: rgba(8,12,18,.66); backdrop-filter: blur(3px);
}
.modal-back[hidden], .drop-overlay[hidden], .busy[hidden] { display: none; }
.modal {
  width: min(440px, calc(100% - 32px)); background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
}
.modal h2 { margin: 0; font-size: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field[hidden] { display: none; }
.field input, .field select { height: 36px; width: 100%; font-size: 14px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg button {
  padding: 10px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--bg);
  cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; font-weight: 600;
}
.seg button small { font-weight: 400; color: var(--muted); font-size: 12px; }
.seg button.on { border-color: var(--cream); background: rgba(233,214,169,.08); }
.seg button:disabled { opacity: .4; cursor: not-allowed; }
.progress { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.progress[hidden] { display: none; }
.progress div { height: 100%; width: 0; background: var(--cream); transition: width .15s; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

.drop-overlay { border: 3px dashed var(--cream); background: rgba(18,26,38,.85); }
.drop-overlay div { font-size: 26px; font-weight: 600; color: var(--cream); pointer-events: none; }

.busy { gap: 14px; grid-auto-flow: row; align-content: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--cream); animation: spin .8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* toasts */
.toasts { position: fixed; right: 18px; bottom: 44px; display: flex; flex-direction: column; gap: 8px; z-index: 60; pointer-events: none; }
.toast {
  max-width: 380px; padding: 10px 14px; border-radius: 8px; background: #26364d; border-left: 3px solid var(--cream);
  box-shadow: 0 10px 30px rgba(0,0,0,.35); font-size: 13px;
  opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: none; }
.toast.warn { border-left-color: var(--warn); }
.toast.err { border-left-color: var(--err); }

@media (prefers-reduced-motion: reduce) {
  .toast, .progress div { transition: none; }
  .spinner { animation-duration: 2.4s; }
}

@media (max-width: 1100px) {
  .panels { grid-template-columns: 1fr 1fr; }
  .library { grid-column: span 2; }
  .zoom { margin-left: 0; }
}
@media (max-width: 720px) {
  .app { height: auto; min-height: 100%; grid-template-rows: auto auto 340px auto auto; }
  .topbar { flex-wrap: wrap; gap: 10px; }
  .project { order: 3; flex-basis: 100%; }
  .top-actions .btn span { display: none; }
  .transport { gap: 12px; }
  .sel-fields input { width: 84px; }
  .panels { grid-template-columns: 1fr; }
  .library { grid-column: auto; }
  .tools { grid-template-columns: repeat(2, 1fr); }
  .status .keys { display: none; }
  .meters { width: 40px; }
}
.play-btn:disabled { opacity: .4; cursor: not-allowed; filter: none; }

/* language switch */
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; height: 36px; }
.lang button { border: none; background: transparent; padding: 0 11px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.lang button + button { border-left: 1px solid var(--line); }
.lang button.on { background: var(--panel-2); color: var(--cream); }
.lang button:hover:not(.on) { color: var(--text); }

.btn.danger { background: var(--err); border-color: var(--err); color: #fff; font-weight: 600; }
.btn.danger:hover:not(:disabled) { background: #ff7373; border-color: #ff7373; }
.modal-text { margin: 0; color: var(--muted); line-height: 1.55; }
@media (max-width: 720px) {
  .top-actions { flex-wrap: wrap; }
}

/* ---------- mode tabs ---------- */
.mode-tabs { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; }
.mode-tabs button {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border: none; border-radius: 6px;
  background: transparent; color: var(--muted); cursor: pointer; font-weight: 600; font-size: 13px;
}
.mode-tabs button .i { width: 16px; height: 16px; }
.mode-tabs button.on { background: var(--panel-2); color: var(--cream); }
.mode-tabs button:hover:not(.on) { color: var(--text); }

.app.mode-mt .editor-only { display: none !important; }
.app:not(.mode-mt) .mt-only { display: none !important; }
.app.mode-mt .panels { grid-template-columns: 1fr 1.25fr; }
.app.mode-mt .lib-actions .ed { display: none; }

/* ---------- multitrack ---------- */
.mt { position: absolute; inset: 0; display: flex; flex-direction: column; background: #0f1621; z-index: 2; }
.mt[hidden] { display: none; }
.mt-toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.mt-hint { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-headrow { display: flex; flex: none; height: 26px; }
.mt-corner { width: 200px; flex: none; background: #16202e; border-right: 1px solid var(--line); border-bottom: 1px solid #3a4b63; }
.mt-ruler-wrap { flex: 1; min-width: 0; overflow: hidden; background: #16202e; }
#mtRuler { display: block; cursor: pointer; touch-action: none; }
.mt-body { flex: 1; min-height: 0; display: flex; overflow-y: auto; overflow-x: hidden; }
.mt-heads { width: 200px; flex: none; background: var(--panel); border-right: 1px solid var(--line); align-self: flex-start; }
.mt-lanes { flex: 1; min-width: 0; align-self: flex-start; }
#mtCanvas { display: block; touch-action: none; }
.mt-head {
  display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 0 10px 0 9px;
  border-bottom: 1px solid var(--line); border-left: 3px solid var(--c); cursor: default;
}
.mt-head.sel { background: var(--panel-2); }
.mt-head.new { border-left-color: transparent; border-bottom: none; background: #0c121b; }
.mt-h1, .mt-h2 { display: flex; align-items: center; gap: 6px; }
.mt-head .sw { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.mt-head .tname {
  flex: 1; min-width: 0; height: 26px; padding: 0 6px; border: 1px solid transparent; border-radius: 5px;
  background: transparent; color: var(--text); font-weight: 600; font-size: 13px;
}
.mt-head .tname:hover { border-color: var(--line); }
.mt-head .tname:focus { border-color: var(--sel); background: var(--bg); outline: none; }
.mt-head .tdel { width: 24px; height: 24px; border: none; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; font-size: 16px; }
.mt-head .tdel:hover { background: rgba(255,92,92,.15); color: var(--err); }
.mt-head .ms {
  width: 26px; height: 24px; flex: none; border: 1px solid var(--line); border-radius: 5px; background: var(--bg);
  color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer;
}
.mt-head .ms.on { background: #f2b84b; border-color: #f2b84b; color: #1b1608; }
.mt-head .ms.solo.on { background: var(--sel); border-color: var(--sel); color: #0d1626; }
.mt-head .tvol { flex: 1; min-width: 0; }
.mt-head .tvo { width: 34px; text-align: right; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mt-empty {
  position: absolute; left: 200px; right: 0; top: 72px; bottom: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; gap: 6px; padding: 20px; pointer-events: none;
}
.mt-empty[hidden] { display: none; }
.mt-empty .empty-art { width: 120px; }
.mt-empty h2 { margin: 0; font-size: 19px; }
.mt-empty p { margin: 0; color: var(--muted); max-width: 52ch; }

.clip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.clip-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.clip-grid input {
  height: 30px; padding: 0 8px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s);
  color: var(--text); font-variant-numeric: tabular-nums; width: 100%;
}
.clip-grid input:focus { border-color: var(--sel); outline: none; }
.clip-grid input:disabled { opacity: .4; }
.mt-tips { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.55; }
.mt-tips b { color: var(--text); font-weight: 600; }
.lib-actions .trk { border-color: rgba(233,214,169,.45); color: var(--cream); }
.lib-item[draggable="true"] { cursor: grab; }

@media (max-width: 1100px) {
  .app.mode-mt .panels { grid-template-columns: 1fr; }
  .app.mode-mt .library { grid-column: auto; }
}
@media (max-width: 720px) {
  .mode-tabs { order: 2; }
  .mt-corner, .mt-heads { width: 140px; }
  .mt-empty { left: 140px; }
  .mt-hint { display: none; }
}

/* clean up */
.enhance { display: flex; flex-direction: column; gap: 8px; }
.enh-title { font-size: 13px; font-weight: 600; }
.enh-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.btn.enh { border-color: rgba(233,214,169,.4); }
.btn.enh .i { color: var(--cream); }
select.strength {
  height: 30px; padding: 0 6px; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius-s); color: var(--text); font-size: 13px;
}
.tb-sep { width: 1px; height: 22px; background: var(--line); margin: 0 2px; }
.tools.tools-2 { grid-template-columns: repeat(2, 1fr); }

/* ---------- recording ---------- */
.rec-btn {
  width: 36px; height: 36px; margin-left: 4px; border-radius: 50%; border: 2px solid var(--line);
  background: transparent; display: grid; place-items: center; cursor: pointer;
}
.rec-btn:hover { border-color: #ff5c5c; }
.rec-dot { width: 14px; height: 14px; border-radius: 50%; background: #ff3b3b; display: inline-block; flex: none; transition: border-radius .15s; }
.rec-dot.small { width: 11px; height: 11px; }
.rec-btn[aria-pressed="true"] { border-color: #ff3b3b; background: rgba(255,59,59,.12); }
.rec-btn[aria-pressed="true"] .rec-dot { border-radius: 3px; }
.mic-select {
  height: 30px; max-width: 160px; margin-left: 4px; padding: 0 6px; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-s); font-size: 12px;
}
.rec-badge { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #ff6b6b; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.rec-badge[hidden] { display: none; }
.rec-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #ff3b3b; animation: blink 1s steps(2, start) infinite; }
.app.recording .clock-total { display: none; }
@keyframes blink { to { visibility: hidden; } }
.rec-empty .rec-dot { box-shadow: 0 0 0 3px rgba(255,59,59,.18); }

.rec-overlay {
  position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; background: #0f1621; text-align: center; padding: 20px;
}
.rec-overlay[hidden] { display: none; }
.rec-pulse { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,59,59,.15); animation: pulse 1.6s ease-in-out infinite; }
.rec-pulse span { width: 26px; height: 26px; border-radius: 50%; background: #ff3b3b; }
@keyframes pulse { 50% { box-shadow: 0 0 0 14px rgba(255,59,59,.08); } }
.rec-ov-time { font-size: 34px; font-weight: 300; color: var(--cream); font-variant-numeric: tabular-nums; }
.rec-level { width: min(320px, 80%); height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.rec-level div { height: 100%; width: 0; background: linear-gradient(90deg, #5fd08a 0 70%, #f2b84b 70% 88%, #ff5c5c 88%); transition: width .06s linear; }
.rec-overlay p { margin: 0; color: var(--muted); max-width: 44ch; }

.app.recording .mode-tabs, .app.recording .panels, .app.recording .top-actions, .app.recording .zoom,
.app.recording .sel-fields, .app.recording .mt-toolbar, .app.recording .mt-heads, .app.recording #mtCanvas,
.app.recording #overlayCanvas, .app.recording .hscroll, .app.recording #btnStart, .app.recording #btnEnd,
.app.recording #btnLoop, .app.recording #btnPlay, .app.recording .mic-select {
  pointer-events: none; opacity: .45;
}
@media (prefers-reduced-motion: reduce) { .rec-pulse, .rec-badge .dot { animation: none; } }

/* link to the other studio page */
.tab-link {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 6px;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 13px;
}
.tab-link:hover { color: var(--text); }
.tab-link .i { width: 16px; height: 16px; }
