/* Audacity web recreation — classic grey theme */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: Tahoma, "Segoe UI", Verdana, sans-serif;
  font-size: 11px;
  color: #1a1a1a;
  background: #c9c9c9;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
#app { display: flex; flex-direction: column; height: 100vh; }

/* ---- title bar ---- */
#titlebar {
  height: 24px; line-height: 24px;
  background: linear-gradient(#0058e6, #0040b8);
  color: #fff; font-weight: bold; font-size: 12px;
  padding: 0 8px; letter-spacing: 0.2px;
  flex: none;
}
#titlebar-proj { font-weight: normal; opacity: 0.85; }

/* ---- menu bar ---- */
#menubar {
  display: flex; flex: none;
  background: #ececec;
  border-bottom: 1px solid #a9a9a9;
  padding: 1px 2px;
}
.menu-item {
  border: 1px solid transparent;
  background: transparent;
  font: inherit;
  padding: 3px 9px;
  cursor: default;
}
.menu-item:hover { background: #d6e2f5; border-color: #9db9e8; }
.menu-popup {
  position: fixed; z-index: 1000;
  background: #f4f4f4;
  border: 1px solid #7a7a7a;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  min-width: 200px;
  padding: 2px;
}
.mi { display: flex; padding: 3px 6px; cursor: default; }
.mi:hover { background: #2f6fd0; color: #fff; }
.mi.dis { color: #909090; }
.mi.dis:hover { background: transparent; }
.mi-check { width: 16px; flex: none; }
.mi-lab { flex: 1; }
.mi-sc { color: #888; margin-left: 24px; }
.mi:hover .mi-sc { color: #dde; }
.mi-sep { height: 1px; background: #c0c0c0; margin: 3px 4px; }

/* ---- toolbar area ---- */
#toolbar-area {
  display: flex; flex-wrap: wrap; align-items: stretch;
  background: #d4d4d4;
  border-bottom: 1px solid #909090;
  flex: none;
}
.toolbar {
  display: flex; align-items: center;
  padding: 3px 4px;
  border-right: 1px solid #b5b5b5;
}
.tb-grip {
  width: 8px; height: 26px; flex: none; margin-right: 4px;
  background-image: radial-gradient(#8a8a8a 1px, transparent 1.4px);
  background-size: 4px 4px;
}
.tb-sep { width: 1px; height: 22px; background: #a0a0a0; margin: 0 5px; }
.tb-icon { display: inline-flex; align-items: center; margin: 0 2px; }
.tbtn {
  width: 26px; height: 26px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(#f4f4f4, #dcdcdc);
  border: 1px solid #8d8d8d;
  border-radius: 3px;
  margin: 0 1px; padding: 0; cursor: default;
}
.tbtn:hover { background: linear-gradient(#ffffff, #e6e6e6); border-color: #4a6fa5; }
.tbtn:active, .tbtn.on { background: linear-gradient(#b8c8e2, #98aec9); border-color: #37548a; box-shadow: inset 1px 1px 2px rgba(0,0,0,0.25); }
.tbtn.dis { opacity: 0.4; pointer-events: none; }
.mixer-slider { width: 80px; margin: 0 3px; }
.meter {
  width: 90px; height: 14px;
  border: 1px solid #555;
  margin: 0 3px; background: #202028;
}

/* ---- track area ---- */
#trackarea { flex: 1; display: flex; flex-direction: column; min-height: 0; background: #6a6a74; }
#topstrip { display: flex; flex: none; border-bottom: 1px solid #666; }
#panel-corner {
  width: 186px; flex: none;
  background: #d4d4d4;
  border-right: 1px solid #909090;
}
#ruler-wrap { flex: 1; position: relative; min-width: 0; background: #e6e6e6; }
#ruler-canvas { display: block; }
#playhead-marker {
  position: absolute; top: 0; width: 0; height: 0; display: none;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 8px solid rgba(20,160,40,0.9);
  pointer-events: none;
}
#vzoom-col {
  width: 26px; flex: none;
  display: flex; flex-direction: column;
  background: #d4d4d4; border-left: 1px solid #909090;
  align-items: center; justify-content: space-around; padding: 2px 0;
}
.vzoom-btn {
  width: 20px; height: 20px; font-size: 13px; line-height: 1;
  background: linear-gradient(#f4f4f4, #dcdcdc);
  border: 1px solid #8d8d8d; border-radius: 3px;
  cursor: default;
}
.vzoom-btn:hover { border-color: #4a6fa5; }
.vzoom-btn:active { background: #b8c8e2; }

#tracks-scroll {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  position: relative; min-height: 0;
}
#tracks-inner { position: relative; }
#empty-hint {
  position: absolute; top: 30px; left: 50%; transform: translateX(-50%);
  color: #d8d8e0; font-size: 13px; pointer-events: none;
  background: rgba(0,0,0,0.25); padding: 8px 16px; border-radius: 4px;
}
.track-row {
  display: flex; position: relative;
  border-bottom: 1px solid #50505c;
}
.track-panel {
  width: 186px; flex: none;
  background: linear-gradient(#eeeeF4, #d8d8e4);
  border-right: 1px solid #909090;
  padding: 3px 4px;
  overflow: hidden;
}
.track-panel.sel { background: linear-gradient(#dbe4f8, #c4d2ec); }
.tp-top { display: flex; align-items: center; gap: 2px; }
.tp-close {
  width: 16px; height: 16px; flex: none;
  font-size: 12px; line-height: 14px; font-weight: bold;
  background: #e8e8e8; border: 1px solid #909090; border-radius: 2px;
  color: #444; cursor: default; padding: 0;
}
.tp-close:hover { background: #ffd8d8; color: #a00000; }
.tp-menu {
  width: 16px; height: 16px; flex: none;
  font-size: 9px; line-height: 14px;
  background: #e8e8e8; border: 1px solid #909090; border-radius: 2px;
  cursor: default; padding: 0;
}
.tp-name {
  flex: 1; min-width: 0;
  font: inherit; font-weight: bold;
  text-align: left;
  background: transparent; border: 1px solid transparent;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 1px 3px; cursor: default;
}
.tp-name:hover { border-color: #9db9e8; background: #e8f0fc; }
.tp-collapse {
  width: 16px; height: 16px; flex: none;
  font-size: 9px; line-height: 14px;
  background: #e8e8e8; border: 1px solid #909090; border-radius: 2px;
  cursor: default; padding: 0;
}
.tp-ms { display: flex; gap: 3px; margin: 3px 0; }
.tp-btn {
  flex: 1; font: inherit; font-size: 10px;
  padding: 2px 0;
  background: linear-gradient(#f0f0f0, #d8d8d8);
  border: 1px solid #8d8d8d; border-radius: 3px;
  cursor: default;
}
.tp-btn.on { box-shadow: inset 1px 1px 3px rgba(0,0,0,0.3); }
.tp-btn.mute.on { background: linear-gradient(#b0b0b8, #909098); }
.tp-btn.solo.on { background: linear-gradient(#ffe08a, #e8b830); }
.tp-slider { display: flex; align-items: center; gap: 2px; margin: 1px 0; }
.tp-slider input[type=range] { flex: 1; min-width: 0; height: 14px; }
.tp-sl { font-size: 9px; color: #333; width: 8px; text-align: center; }
.tp-sv { font-size: 9px; color: #333; width: 34px; text-align: right; }
.tp-info { font-size: 9px; color: #444; white-space: pre-line; margin-top: 2px; line-height: 1.25; }
.track-viewport { flex: 1; position: relative; min-width: 0; background: #8e8e99; }
.wave-canvas { position: absolute; inset: 0; display: block; }
.track-resize {
  position: absolute; left: 0; right: 0; bottom: -3px; height: 6px;
  cursor: ns-resize; z-index: 5;
}
.zoom-rubber {
  position: absolute; border: 1px dashed #2040a0;
  background: rgba(80,120,200,0.18); pointer-events: none; z-index: 6;
}
#playhead-line {
  position: absolute; top: 0; bottom: 0; width: 1.5px;
  background: rgba(20,160,40,0.85); pointer-events: none; z-index: 7;
  display: none;
}
#snap-guide {
  position: absolute; top: 0; width: 1px;
  background: rgba(255,190,0,0.95); pointer-events: none; z-index: 7;
  display: none;
}
#hscroll { flex: none; height: 15px; overflow-x: auto; overflow-y: hidden; background: #d4d4d4; }
#hscroll-inner { height: 1px; }

/* ---- selection bar ---- */
#selbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px;
  background: #d4d4d4; border-top: 1px solid #909090;
  padding: 3px 8px; flex: none;
}
.sel-group { display: inline-flex; align-items: center; gap: 4px; }
.sel-lab { color: #333; }
.sel-field {
  width: 108px; font: inherit;
  border: 1px solid #8a8a8a; padding: 2px 4px;
  background: #fff;
}
#selbar select { font: inherit; max-width: 160px; }

/* ---- status bar ---- */
#statusbar {
  display: flex; justify-content: space-between;
  background: #d4d4d4; border-top: 1px solid #909090;
  padding: 2px 8px; flex: none;
  color: #222; font-size: 10.5px;
}
#status-right { color: #444; }

/* ---- dialogs ---- */
#dialog-root { position: relative; z-index: 2000; }
.dlg-scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,0.18);
  display: flex; align-items: center; justify-content: center;
}
.dlg {
  background: #efefef;
  border: 1px solid #606060;
  box-shadow: 3px 3px 8px rgba(0,0,0,0.4);
  min-width: 340px; max-width: 92vw;
  max-height: 88vh; display: flex; flex-direction: column;
}
.dlg.wide { min-width: 520px; }
.dlg-title {
  background: linear-gradient(#f8f8f8, #dcdcdc);
  border-bottom: 1px solid #b0b0b0;
  padding: 5px 10px; font-weight: bold;
}
.dlg-body { padding: 10px 12px; overflow-y: auto; }
.dlg-msg { padding: 8px 4px; white-space: pre-wrap; max-width: 420px; line-height: 1.45; }
.dlg-row { display: flex; align-items: center; margin: 4px 0; gap: 6px; }
.dlg-lab { width: 170px; flex: none; text-align: right; }
.dlg-row input[type=number] { width: 76px; font: inherit; padding: 2px 4px; border: 1px solid #8a8a8a; }
.dlg-row input[type=text] { font: inherit; padding: 2px 4px; border: 1px solid #8a8a8a; }
.dlg-row input[type=range] { flex: 1; min-width: 120px; }
.dlg-num { width: 64px; }
.dlg-unit { width: 32px; color: #444; }
.dlg-note { color: #555; font-size: 10px; margin-top: 8px; max-width: 480px; }
.dlg-btns {
  display: flex; justify-content: flex-end; gap: 6px;
  padding: 8px 10px; border-top: 1px solid #c0c0c0;
  background: #e6e6e6;
}
.dlg-btn {
  min-width: 72px; font: inherit; padding: 4px 14px;
  background: linear-gradient(#f8f8f8, #e0e0e0);
  border: 1px solid #7a7a7a; border-radius: 3px;
}
.dlg-btn.primary { background: linear-gradient(#eef4ff, #cfe0f8); border-color: #405a80; font-weight: bold; }
.dlg-btn:hover { border-color: #2040a0; }
.eq-canvas, .spec-canvas { border: 1px solid #404050; display: block; margin-bottom: 6px; }
.about { max-width: 420px; line-height: 1.5; }
.about-title { font-size: 22px; font-weight: bold; color: #2040a0; }
.about-ver { color: #444; margin-bottom: 8px; }
.about-dim { color: #777; font-size: 10px; }
.kbd-table { border-collapse: collapse; }
.kbd-table td { padding: 2px 10px 2px 0; }
.kbd-k { font-weight: bold; color: #2040a0; white-space: nowrap; }

/* ---- scrollbars ---- */
::-webkit-scrollbar { width: 13px; height: 13px; }
::-webkit-scrollbar-track { background: #d4d4d4; }
::-webkit-scrollbar-thumb { background: #a8a8a8; border: 1px solid #888; }
::-webkit-scrollbar-thumb:hover { background: #909090; }
::-webkit-scrollbar-button { display: none; }

/* ---- narrow viewport ---- */
@media (max-width: 720px) {
  .track-panel, #panel-corner { width: 130px; }
  .render-panel-w {}
  .sel-field { width: 84px; }
  .mixer-slider { width: 56px; }
  .meter { width: 56px; }
  .dlg-lab { width: 110px; }
}
