:root {
  color-scheme: dark;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  background: #080b10;
  color: #e9edf3;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overflow: hidden;
}
#plot {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 14px 20px 0;
  overflow: hidden;
  border: 1px solid #252e3a;
  border-radius: 8px;
  background: #080b10;
}
canvas {
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
}
#labels {
  pointer-events: none;
}
#welcome {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  background: radial-gradient(ellipse at 50% 55%, #16202bdd, #080b10dd 65%);
  padding: 25px;
}
#welcome[hidden] {
  display: none;
}
#legend {
  position: absolute;
  bottom: 37px;
  right: 15px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 8px;
  letter-spacing: 1px;
  color: #9aa8b9;
  pointer-events: none;
}
#legend i {
  width: 75px;
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(
    90deg,
    #080b10,
    #49345e,
    #b34757,
    #ec914e,
    #fff1b0
  );
}
footer {
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  padding: 12px 23px;
  font-size: 9px;
  letter-spacing: 1.4px;
  color: #7f8d9f;
}
#panel[hidden] {
  display: none;
}
#notice {
  position: absolute;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  max-width: 90%;
  width: max-content;
  z-index: 5;
}
@media (max-width: 600px) {
  header {
    padding: 10px 12px;
    gap: 6px;
    flex-wrap: wrap;
  }
  .brand {
    gap: 6px;
  }
  .actions {
    gap: 6px;
  }
  #plot {
    margin: 8px 7px 0;
    border-radius: 5px;
  }
  footer {
    padding: 10px;
    font-size: 8px;
    letter-spacing: 0.8px;
  }
  #legend {
    right: 10px;
  }
}
@media (max-width: 390px) {
  .actions {
    width: 100%;
    justify-content: flex-end;
  }
  header {
    gap: 4px;
  }
}
@media (max-height: 480px) {
  header {
    padding: 5px 12px;
  }
  footer {
    padding: 5px 12px;
  }
}
header .actions {
  flex-wrap: wrap;
}
#notice {
  max-height: 45%;
  overflow: auto;
}

#settings {
  font-size: 23px;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
}
#settings[aria-expanded="true"] {
  color: #f2ac77;
  border-color: #f2ac77;
}

#welcome {
  background: #0c1020;
}
#welcome .vintage-mic {
  display: grid;
  place-items: center;
  width: 210px;
  height: 290px;
  padding: 20px;
  background: transparent;
  border: 0;
  border-radius: 30px;
  color: #f2ac77;
  transition:
    color 0.2s,
    transform 0.2s;
}
#welcome .vintage-mic svg {
  width: 150px;
  height: 225px;
}
#welcome .vintage-mic:hover {
  color: #ffd0a8;
  transform: translateY(-3px);
}
#welcome .vintage-mic:active {
  transform: scale(0.96);
}
#welcome .vintage-mic:disabled {
  opacity: 0.45;
}

#welcome .vintage-mic {
  position: relative;
  width: 240px;
  height: 240px;
  border: 2px solid #f2ac7780;
  border-radius: 50%;
  background: #f2ac770b;
  box-shadow: 0 0 0 10px #f2ac7705;
  animation: mic-invite 3s ease-in-out infinite;
  isolation: isolate;
}
#welcome .vintage-mic svg {
  width: 112px;
  height: 168px;
}
#welcome .vintage-mic::before {
  content: "";
  position: absolute;
  inset: -2px;
  border: 1px solid #f2ac7760;
  border-radius: 50%;
  z-index: -1;
  animation: mic-ripple 3s ease-out infinite;
  pointer-events: none;
}
#welcome .vintage-mic:hover {
  background: #f2ac771a;
  border-color: #ffd0a8;
  box-shadow: 0 0 35px #f2ac7720;
  animation: none;
  transform: scale(1.035);
}
#welcome .vintage-mic:hover::before {
  animation: none;
  opacity: 0;
}
#welcome .vintage-mic:active {
  transform: scale(0.96);
  background: #f2ac7728;
}
#welcome .vintage-mic:disabled {
  animation: none;
}
#welcome .vintage-mic:disabled::before {
  animation: none;
  opacity: 0;
}
@keyframes mic-invite {
  0%,
  100% {
    box-shadow:
      0 0 0 8px #f2ac7704,
      0 0 18px #f2ac7706;
  }
  50% {
    box-shadow:
      0 0 0 12px #f2ac7708,
      0 0 32px #f2ac7715;
  }
}
@keyframes mic-ripple {
  0% {
    transform: scale(1);
    opacity: 0;
  }
  15% {
    opacity: 0.55;
  }
  75%,
  100% {
    transform: scale(1.18);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  #welcome .vintage-mic,
  #welcome .vintage-mic::before {
    animation: none;
  }
  #welcome .vintage-mic::before {
    display: none;
  }
  #welcome .vintage-mic {
    transition: none;
  }
}
@media (max-width: 400px) {
  #welcome .vintage-mic {
    width: 210px;
    height: 210px;
  }
  #welcome .vintage-mic svg {
    width: 100px;
    height: 150px;
  }
}
@media (max-height: 420px) {
  #welcome .vintage-mic {
    width: 160px;
    height: 160px;
  }
  #welcome .vintage-mic svg {
    width: 76px;
    height: 114px;
  }
}
header .actions {
  flex-wrap: nowrap;
}

/* Keep transport controls stable when their icons change. */
#settings {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  max-width: 44px;
  min-height: 44px;
  max-height: 44px;
  padding: 8px;
  box-sizing: border-box;
}

#home {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  border-radius: 5px;
}
#home:hover {
  color: #f2ac77;
}
#welcome #begin svg {
  animation: mic-nudge 5.8s ease-in-out infinite;
}
#welcome #begin::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background: linear-gradient(
    110deg,
    transparent 40%,
    #f2ac771c 50%,
    transparent 60%
  );
  background-size: 300% 100%;
  background-position: 200% 0;
  animation: mic-sweep 5.8s ease-in-out infinite;
}
@keyframes mic-nudge {
  0%,
  12%,
  100% {
    transform: translateY(0);
  }
  6% {
    transform: translateY(-3px);
  }
}
@keyframes mic-sweep {
  0%,
  10% {
    background-position: 200% 0;
  }
  26%,
  100% {
    background-position: -100% 0;
  }
}
#welcome #begin:is(:hover, :focus-visible, :disabled),
#welcome[hidden] #begin {
  animation: none;
}
#welcome #begin:is(:hover, :focus-visible, :disabled) svg,
#welcome[hidden] #begin svg {
  animation: none;
  transform: none;
}
#welcome #begin:is(:hover, :focus-visible, :disabled)::before,
#welcome[hidden] #begin::before {
  animation: none;
  opacity: 0;
}
#welcome #begin:is(:hover, :focus-visible, :disabled)::after,
#welcome[hidden] #begin::after {
  animation: none;
  opacity: 0;
}
@media (prefers-reduced-motion: reduce) {
  #welcome #begin svg,
  #welcome #begin::after {
    animation: none;
  }
  #welcome #begin::after {
    display: none;
  }
}

#analysisOverlay {
  pointer-events: none;
}

/* Feature canvases keep their existing rendering ownership. */
canvas[hidden],
#spectrogramSettings[hidden],
#pitchSettings[hidden] {
  display: none !important;
}
.pitch-active #spectrogram,
.pitch-active #labels,
.pitch-active #analysisOverlay,
.pitch-active #legend {
  visibility: hidden;
}
.pitch-active #pitchCanvas {
  visibility: visible;
}

#settingsBody > .settingsGroup {
  border-bottom: 1px solid #283345;
  padding-bottom: 18px;
  margin-bottom: 20px;
}
#settingsBody #presetSettings {
  border: 0;
  padding: 0;
}

#offlineSettings {
  margin-top: 20px;
  border-top: 1px solid #283345;
  padding-top: 14px;
}

#filesBody {
  padding: 0 20px 20px;
}
#audioFileList {
  display: grid;
  gap: 6px;
  max-height: 32dvh;
  overflow: auto;
  margin: 12px 0;
}
#fileTransport {
  flex: 0 0 auto;
  padding: 12px 20px;
  border-top: 1px solid #283345;
  background: #0d1118;
}
.file-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  margin-bottom: 8px;
}
#fileTitle {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
#fileTime {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  color: #a8b5c5;
}
#fileWaveform {
  position: static;
  display: block;
  width: 100%;
  height: 64px;
  border-radius: 6px;
  touch-action: pan-y;
  cursor: crosshair;
}
#filePlay {
  min-width: 80px;
}
#fileTransport[hidden],
#filesBody[hidden],
#settingsBody[hidden] {
  display: none !important;
}
@media (max-width: 760px) {
  #fileTransport {
    padding: 10px 12px;
  }
  .file-heading {
    font-size: 12px;
  }
  #fileWaveform {
    height: 56px;
  }
}

#filesSection h2 {
  font-size: 18px;
  letter-spacing: -0.4px;
}
#audioFileInput[hidden] {
  display: none !important;
}
#fileTime {
  float: none;
}
#openFiles {
  min-height: 44px;
}
#filesSection {
  flex: none;
}
#panel .panelhead {
  padding: 6px 20px;
  min-height: 56px;
}
.file-detail {
  margin-left: 53px;
  margin-right: 13px;
}
.pitch-active .file-detail {
  margin-left: 49px;
  margin-right: 16px;
}
.waveform-ruler {
  display: flex;
  justify-content: space-between;
  color: #8796aa;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  margin: 4px 0 6px;
}
#fileOverview {
  position: static;
  display: block;
  width: 100%;
  height: 36px;
  margin: 4px 0 8px;
  border-radius: 4px;
  cursor: ew-resize;
  touch-action: none;
}
#fileAnalysisStatus {
  display: block;
  float: none;
  min-height: 18px;
  font-size: 12px;
  color: #a8b5c5;
}
@media (max-width: 760px), (pointer: coarse) {
  #openFiles,
  #openAudio,
  #filesSection,
  #fileTransport {
    display: none !important;
  }
}
#audioBookmarks {
  margin-top: 16px;
  border-top: 1px solid #283345;
  padding-top: 12px;
}
#audioBookmarks h3 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #c0cad7;
}
#audioBookmarkList {
  display: grid;
  gap: 6px;
}
#audioBookmarkList .library-item {
  display: grid;
  gap: 4px;
}
#audioBookmarkList small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#audioBookmarks[hidden] {
  display: none !important;
}
body {
  font-size: 14px;
  line-height: normal;
  color: #e9edf3;
  background: #080b10;
}
