.editor-body {
  overflow: hidden;
  background: #050505;
}

.editor-app {
  --toolbar-h: 68px;
  --overview-h: 54px;
  --footer-h: 44px;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  display: grid;
  grid-template-rows: 34px var(--toolbar-h) minmax(0, 1fr) var(--footer-h) 24px;
  color: var(--text);
  background: #050505;
  overflow: hidden;
}

.editor-menubar {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  height: 34px;
  padding: 0 12px;
  background: #0c0c0c;
  border-bottom: 1px solid #1d1d1d;
}

.editor-logo img {
  display: block;
  height: 18px;
}

.editor-menus {
  display: flex;
  align-items: stretch;
  gap: 2px;
  height: 100%;
}

.menu {
  position: relative;
}

.menu-btn,
.menu-link {
  height: 100%;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--text2);
  font: 700 13px var(--font);
  text-decoration: none;
  cursor: pointer;
}

.menu-btn:hover,
.menu-link:hover,
.menu.open .menu-btn {
  background: #171717;
  color: var(--yellow);
}

.menu-popover {
  display: none;
  position: absolute;
  z-index: 20;
  top: 34px;
  left: 0;
  min-width: 230px;
  padding: 8px;
  background: rgba(13, 16, 15, 0.92);
  border: 1px solid rgba(223, 255, 0, 0.18);
  border-radius: 10px;
  box-shadow: 0 22px 50px rgba(0,0,0,0.58), inset 0 1px 0 rgba(255,255,255,0.06);
  backdrop-filter: blur(16px) saturate(1.25);
}

.menu.open .menu-popover {
  display: block;
}

.menu-popover button,
.menu-popover label,
.menu-popover a,
.menu-note {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: 700 13px var(--font);
  cursor: pointer;
  text-decoration: none;
}

.menu-note {
  cursor: default;
  color: var(--text3);
  font-size: 11px;
  line-height: 1.35;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 6px;
  padding-top: 10px;
}

.menu-popover kbd {
  color: var(--text3);
  font: 700 11px var(--mono);
}

.menu-popover button:hover,
.menu-popover label:hover,
.menu-popover a:hover {
  background: var(--yellow);
  color: #000;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.editor-toolbar {
  display: grid;
  grid-template-columns: 250px auto auto minmax(230px, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 0;
  padding: 6px 10px;
  background: #181818;
  border-bottom: 1px solid #2a2a2a;
}

.time-stack {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  background: #050505;
  border: 1px solid #333;
  padding: 10px 12px;
  border-radius: 2px;
}

.time-display {
  color: #f5f5f5;
  font: 700 30px/1 var(--mono);
  letter-spacing: 0;
  text-align: center;
  width: 100%;
}

.time-sub {
  color: #9fd3cf;
  font: 600 12px var(--mono);
}

.transport-group,
.tool-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.square-btn {
  width: 34px;
  height: 30px;
  border: 1px solid #393939;
  border-radius: 3px;
  background: #e7e7e7;
  color: #111;
  font: 800 13px var(--font);
  cursor: pointer;
}

.square-btn:hover:not(:disabled) {
  background: var(--yellow);
}

.square-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.square-btn.play {
  background: var(--yellow);
}

.square-btn.stop {
  font-size: 15px;
}

.square-btn.active {
  background: var(--red);
  color: #fff;
}

.record-dot {
  width: 12px;
  height: 12px;
  display: inline-block;
  border-radius: 50%;
  background: var(--red);
}

.selection-stack {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text2);
}

.selection-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.selection-grid {
  display: grid;
  grid-template-columns: auto auto auto auto auto auto;
  gap: 6px 8px;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
}

.selection-grid span {
  color: var(--text3);
}

.selection-grid strong {
  color: #9fd3cf;
  font-weight: 700;
}

.wave-editor {
  min-height: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  background: #050505;
  overflow: hidden;
}

.channel-strip {
  box-sizing: border-box;
  min-height: 0;
  height: calc(100% - var(--overview-h));
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: stretch;
  gap: 0;
  padding: 0 3px;
  margin-top: var(--overview-h);
  background: #080808;
  border-right: 1px solid #252525;
  box-shadow: inset -1px 0 0 rgba(223, 255, 0, 0.16);
  color: rgba(223, 255, 0, 0.72);
}

.scale-label {
  display: block;
  font: 800 11px/1 var(--mono);
  opacity: 0.72;
}

.scale-label.channel {
  color: var(--yellow);
  font: 900 16px/1 var(--font);
  opacity: 1;
}

.scale-label.small {
  color: var(--text3);
  font-size: 10px;
}

.channel-lane {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto 1fr auto;
  align-items: center;
  justify-items: center;
}

.channel-lane .scale-label:first-child {
  grid-row: 1;
}

.channel-lane .scale-label.channel {
  grid-row: 3;
}

.channel-lane .scale-label:last-child {
  grid-row: 5;
}

.channel-divider {
  width: 100%;
  height: 1px;
  background: rgba(223, 255, 0, 0.16);
}

.wave-area {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: var(--overview-h) minmax(0, 1fr);
}

.overview-stage {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background:
    linear-gradient(to right, rgba(255,255,255,0.18) 1px, transparent 1px) 0 0 / 96px 100%,
    #101010;
  border-left: 1px solid #1d1d1d;
  border-bottom: 1px solid #242424;
}

.overview-waveform {
  display: block;
  width: 100%;
  height: var(--overview-h);
  cursor: default;
  touch-action: none;
}

.wave-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(to right, rgba(255,255,255,0.035) 1px, transparent 1px) 0 0 / 96px 100%,
    linear-gradient(to bottom, rgba(255,255,255,0.045) 1px, transparent 1px) 0 0 / 100% 25%,
    #030303;
}

.editor-waveform {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  touch-action: none;
  cursor: default;
}

.editor-waveform.is-selecting {
  cursor: ew-resize;
}

.editor-app.wave-compact .editor-waveform {
  min-height: 0;
}

.editor-app.wave-normal .editor-waveform {
  min-height: 0;
}

.editor-app.wave-large .editor-waveform {
  min-height: 0;
}

.timeline-hint {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  place-items: center;
  gap: 10px;
  color: var(--text3);
  font-size: 13px;
  text-align: center;
  pointer-events: none;
}

.timeline-hint strong {
  color: var(--text);
  font-size: 18px;
}

.timeline-hint span {
  max-width: 460px;
  line-height: 1.4;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  pointer-events: auto;
}

.empty-actions button,
.empty-actions label {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid #333;
  border-radius: 4px;
  background: #151515;
  color: var(--text);
  font: 800 12px var(--font);
  cursor: pointer;
}

.empty-actions button:hover,
.empty-actions label:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

.editor-footerbar {
  display: grid;
  grid-template-columns: minmax(210px, 280px) minmax(260px, 1fr) minmax(270px, auto);
  align-items: center;
  gap: 10px;
  min-height: 0;
  padding: 5px 8px;
  background: #090909;
  border-top: 1px solid #242424;
  overflow: hidden;
}

.footer-module {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.footer-module label {
  color: var(--text3);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.compact-select,
.compact-btn {
  height: 26px;
  border: 1px solid #333;
  border-radius: 2px;
  background: #151515;
  color: var(--text);
  font: 800 11px var(--font);
}

.compact-select {
  min-width: 112px;
  padding: 0 7px;
}

.compact-btn {
  padding: 0 8px;
  cursor: pointer;
}

.compact-btn:hover:not(:disabled) {
  border-color: var(--yellow);
  color: var(--yellow);
}

.compact-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.compact-btn.export {
  background: var(--yellow);
  color: #000;
  border-color: var(--yellow);
}

.mini-meter {
  flex: 1;
  min-width: 72px;
  height: 12px;
  border: 1px solid #244;
  background: #030303;
  display: grid;
  gap: 2px;
  padding: 1px;
  overflow: hidden;
}

.mini-meter.mono {
  grid-template-rows: 1fr;
}

.mini-meter.stereo {
  grid-template-rows: 1fr 1fr;
}

.meter-lane {
  min-height: 0;
  background: #020909;
  overflow: hidden;
}

.mini-meter.mono .meter-lane:last-child {
  display: none;
}

.meter-lane span {
  display: block;
  height: 100%;
  width: var(--level, 0%);
  background: linear-gradient(to right, #6aff8f, var(--yellow), var(--red));
}

.input-module .compact-select {
  max-width: 170px;
}

.effects-module {
  justify-content: start;
}

.export-module {
  justify-content: end;
}

.download-slot {
  min-width: 0;
}

.download-slot .dl-btn {
  height: 26px;
  padding: 0 9px;
  border-radius: 2px;
  font-size: 11px;
}

.editor-status-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 18px;
  align-items: center;
  padding: 0 10px;
  border-top: 1px solid #1d1d1d;
  background: #080808;
  color: var(--text3);
  font: 600 11px var(--mono);
  min-height: 0;
}

.shortcut-modal,
.eq-modal,
.effect-modal,
.settings-modal,
.recent-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.72);
}

.shortcut-modal[hidden],
.eq-modal[hidden],
.effect-modal[hidden],
.settings-modal[hidden],
.recent-modal[hidden] {
  display: none;
}

.shortcut-panel,
.eq-panel,
.effect-panel,
.settings-panel,
.recent-panel {
  width: min(620px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  padding: 22px;
  border: 2px solid var(--yellow);
  border-radius: 8px;
  background: #111;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}

.shortcut-head,
.eq-head,
.effect-head,
.settings-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-kicker {
  margin: 0 0 4px;
  color: var(--yellow);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.shortcut-head h2 {
  margin: 0;
  font-size: 24px;
}

.eq-head h2 {
  margin: 0;
  font-size: 24px;
}

.eq-preset {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--text2);
  font-weight: 800;
}

.eq-board {
  display: grid;
  grid-template-columns: 70px repeat(3, minmax(90px, 1fr));
  gap: 14px;
  padding: 18px;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  background: #080808;
}

.eq-scale {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--text3);
  font: 800 12px var(--mono);
}

.eq-band {
  min-height: 300px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  text-align: center;
}

.eq-band small {
  color: var(--text3);
  font: 700 11px var(--mono);
}

.eq-band input[type="range"] {
  width: 220px;
  height: 28px;
  transform: rotate(-90deg);
  align-self: center;
  accent-color: var(--yellow);
}

.eq-band output {
  min-width: 64px;
  padding: 5px 7px;
  border: 1px solid #333;
  background: #111;
  color: var(--yellow);
  font: 800 12px var(--mono);
}

.eq-actions {
  display: flex;
  justify-content: end;
  gap: 10px;
  margin-top: 18px;
}

.effect-copy {
  margin: -4px 0 16px;
  color: var(--text2);
  font-size: 13px;
  line-height: 1.45;
}

.effect-fields {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  background: #080808;
}

.effect-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.7fr) minmax(160px, 1fr) 82px;
  gap: 12px;
  align-items: center;
  color: var(--text);
  font-weight: 800;
}

.effect-row span:first-child {
  color: var(--text2);
}

.effect-row input[type="range"] {
  accent-color: var(--yellow);
}

.effect-row input[type="number"] {
  height: 30px;
  border: 1px solid #333;
  border-radius: 3px;
  background: #050505;
  color: var(--yellow);
  text-align: right;
  font: 800 12px var(--mono);
}

.effect-actions {
  display: flex;
  justify-content: end;
  gap: 10px;
  margin-top: 18px;
}

.settings-panel {
  width: min(980px, 100%);
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.settings-grid fieldset {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 16px;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  background: #080808;
}

.settings-grid legend {
  padding: 0 6px;
  color: var(--yellow);
  font-weight: 900;
}

.settings-grid label {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, auto);
  align-items: center;
  gap: 12px;
  color: var(--text2);
  font-weight: 800;
}

.settings-grid label:has(input[type="checkbox"]) {
  display: flex;
}

.settings-grid input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--yellow);
}

.settings-grid input[type="color"] {
  width: 70px;
  height: 30px;
  padding: 2px;
  border: 1px solid #333;
  border-radius: 4px;
  background: #050505;
}

.settings-actions {
  display: flex;
  justify-content: end;
  gap: 10px;
  margin-top: 18px;
}

.recent-list {
  display: grid;
  gap: 8px;
}

.recent-list button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #333;
  border-radius: 5px;
  background: #080808;
  color: var(--text);
  font: 800 12px var(--font);
  cursor: pointer;
}

.recent-list button:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

.recent-list .empty {
  color: var(--text3);
  font-weight: 700;
}

.shortcut-list {
  display: grid;
  gap: 8px;
}

.shortcut-list label {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(130px, 180px);
  align-items: center;
  gap: 12px;
  color: var(--text2);
  font-weight: 700;
}

.shortcut-list input {
  height: 34px;
  border: 1px solid #3d3d3d;
  border-radius: 4px;
  background: #050505;
  color: var(--yellow);
  text-align: center;
  font: 800 12px var(--mono);
  cursor: pointer;
}

.shortcut-list input:focus {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

.shortcut-actions {
  display: flex;
  justify-content: end;
  gap: 10px;
  margin-top: 18px;
}

@media (max-width: 1100px) {
  .editor-app {
    --toolbar-h: auto;
    --overview-h: 48px;
    --footer-h: auto;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    grid-template-rows: 34px auto minmax(0, 1fr) auto 24px;
    overflow: hidden;
  }

  .editor-menubar,
  .editor-toolbar,
  .editor-footerbar {
    grid-template-columns: 1fr;
  }

  .editor-toolbar {
    gap: 8px;
    padding: 7px 10px;
  }

  .editor-menus,
  .transport-group,
  .tool-group,
  .selection-stack,
  .footer-module {
    flex-wrap: wrap;
  }

  .selection-stack {
    justify-self: stretch;
  }

  .selection-grid {
    grid-template-columns: auto auto;
  }

  .wave-editor {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .wave-area {
    grid-template-rows: var(--overview-h) minmax(0, 1fr);
  }

  .overview-waveform {
    height: var(--overview-h);
  }

  .editor-waveform {
    min-height: 0;
  }

  .editor-footerbar {
    gap: 6px;
    padding: 6px 8px;
  }

  .footer-module {
    min-height: 28px;
  }

  .export-module {
    justify-content: start;
  }
}

@media (max-width: 640px) {
  .editor-menubar {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 6px;
  }

  .editor-menus {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .editor-menus::-webkit-scrollbar {
    display: none;
  }

  .editor-logo img {
    height: 15px;
  }

  .menu-btn,
  .menu-link {
    padding: 0 9px;
  }

  .time-display {
    font-size: 24px;
  }

  .editor-toolbar {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
  }

  .time-stack {
    width: 100%;
    box-sizing: border-box;
  }

  .tool-group,
  .selection-stack {
    display: none;
  }

  .transport-group {
    justify-content: space-between;
  }

  .square-btn {
    width: 42px;
    height: 36px;
  }

  .editor-footerbar {
    gap: 6px;
  }

  .export-module {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) auto auto;
  }

  .eq-board {
    grid-template-columns: 48px repeat(3, minmax(64px, 1fr));
    gap: 8px;
    padding: 12px;
  }

  .eq-band {
    min-height: 240px;
  }

  .eq-band input[type="range"] {
    width: 170px;
  }

  .shortcut-list label {
    grid-template-columns: 1fr;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }
}
